diff --git a/.github/workflows/action-self-test.yaml b/.github/workflows/action-self-test.yaml index 649c3460..243a9469 100644 --- a/.github/workflows/action-self-test.yaml +++ b/.github/workflows/action-self-test.yaml @@ -413,3 +413,18 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: always() + timeline-reports-test: + needs: action-test + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout code + uses: actions/checkout@v6 + - name: Timeline Report + uses: ./ + with: + report-path: './ctrf-reports/timeline/ctrf-report.json' + timeline-report: true + annotate: false + if: always() diff --git a/CHANGELOG.md b/CHANGELOG.md index bab46e10..294322e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## Unreleased +- Add the `timeline-report` input: a Mermaid Gantt chart of when each test ran on each thread or worker, with per-thread busy and idle time and a table of test timings. - Honor proxy and bypass environment variables for GitHub API calls, including authenticated CONNECT proxies and artifact redirects. - Preserve nested IDs during merge/grouping and renew derived report IDs; retain existing name-based historical test matching. diff --git a/README.md b/README.md index 973faaba..f358cd98 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,7 @@ For more advanced usage, there are several inputs available. previous-results-report: false insights-report: false slowest-report: false + timeline-report: false ai-report: false ai-summary-report: false skipped-report: false diff --git a/__tests__/ctrf/report-preparation.test.ts b/__tests__/ctrf/report-preparation.test.ts index 601c7bfc..05ad2cc3 100644 --- a/__tests__/ctrf/report-preparation.test.ts +++ b/__tests__/ctrf/report-preparation.test.ts @@ -512,6 +512,7 @@ function createSingleReportInputs(): Inputs { insightsReport: false, slowestReport: false, fileReport: false, + timelineReport: false, communityReport: false, communityReportName: "", artifactName: "", diff --git a/__tests__/ctrf/timeline.test.ts b/__tests__/ctrf/timeline.test.ts new file mode 100644 index 00000000..eabdc558 --- /dev/null +++ b/__tests__/ctrf/timeline.test.ts @@ -0,0 +1,2961 @@ +import * as core from "@actions/core"; +import type { Test } from "ctrf"; +import { + buildTimelineReport, + collectTimeline, + renderTimelineGantt, +} from "../../src/ctrf/timeline/index.js"; +import { + codeSpan, + escapeCell, + fitMiddle, + fitText, + formatDuration, + sanitizeMermaidText, + textWidth, +} from "../../src/ctrf/timeline/text.js"; + +vi.mock("@actions/core"); + +const ZWSP = "\u200b"; +const T0 = 1_792_570_616_000; +const HOUR = 3_600_000; + +function makeTest( + name: string, + start: number | undefined, + duration: number, + extra: Partial = {}, +): Test { + return { + name, + status: "passed", + duration, + ...(start === undefined + ? {} + : { start: T0 + start, stop: T0 + start + duration }), + ...extra, + }; +} + +/** + * Task lines of the bars and markers: without the empty tasks that keep the + * axis on the whole run, and without the lines that mark cuts. + */ +function taskLines(text: string): string[] { + return text + .split("\n") + .filter( + (line) => + line.startsWith(ZWSP) && !/^\u200b :(vert, )?[^,]*, 0ms$/.test(line), + ); +} + +function sections(text: string): string[] { + return text + .split("\n") + .filter((line) => line.startsWith(`section ${ZWSP}`)) + .map((line) => line.slice(`section ${ZWSP}`.length)); +} + +/** Splits the Gantt into lanes of [start offset ms, duration ms] pairs. */ +function laneSpans(text: string): Array> { + const lanes: Array> = []; + for (const line of text.split("\n")) { + if (line.startsWith("section ")) { + lanes.push([]); + continue; + } + const match = line.match( + /[ :](\d+) (\d\d):(\d\d):(\d\d)\.(\d{3}), (\d+)ms$/, + ); + if (match && line.startsWith(ZWSP) && !line.includes(":vert,")) { + const [, , h, m, s, ms, length] = match.map(Number); + lanes[lanes.length - 1].push([ + ((h * 60 + m) * 60 + s) * 1000 + ms, + length, + ]); + } + } + return lanes; +} + +function gantt(tests: Test[], limits = {}) { + return renderTimelineGantt(collectTimeline(tests, limits), limits); +} + +function seeded(seed: number) { + return () => { + seed = (seed * 16807) % 2147483647; + return seed / 2147483647; + }; +} + +/** 10,000 tests on 16 threads, back to back, each failed with the given chance. */ +function bigRun(failureRate: number, random = seeded(3)) { + const tests: Test[] = []; + for (let lane = 0; lane < 16; lane++) { + let cursor = 0; + for (let index = 0; index < 625; index++) { + const length = 50 + Math.floor(random() * 400); + tests.push( + makeTest(`t${lane}-${index}`, cursor, length, { + threadId: `worker-${lane + 1}`, + status: random() < failureRate ? "failed" : "passed", + }), + ); + cursor += length + Math.floor(random() * 5); + } + } + return tests; +} + +describe("collectTimeline", () => { + it("uses the start and stop of each test", () => { + const data = collectTimeline([makeTest("a", 100, 400, { threadId: "w1" })]); + expect(data.lanes).toHaveLength(1); + expect(data.lanes[0]).toMatchObject({ name: "w1", origin: "thread" }); + expect(data.lanes[0].executions[0]).toMatchObject({ + name: "a", + label: "a", + kind: "passed", + start: T0 + 100, + stop: T0 + 500, + }); + expect(data.start).toBe(T0 + 100); + expect(data.stop).toBe(T0 + 500); + expect(data.threads).toBe(1); + }); + + it("derives a missing stop from the start and the duration", () => { + const data = collectTimeline([ + { name: "a", status: "passed", duration: 250, start: T0 }, + ]); + expect(data.lanes[0].executions[0].stop).toBe(T0 + 250); + }); + + it("derives a missing start from the stop and the duration", () => { + const data = collectTimeline([ + { name: "a", status: "failed", duration: 250, stop: T0 + 1000 }, + ]); + expect(data.lanes[0].executions[0]).toMatchObject({ + start: T0 + 750, + stop: T0 + 1000, + kind: "failed", + }); + }); + + it("counts tests without timing instead of drawing them", () => { + const data = collectTimeline([ + makeTest("timed", 0, 10), + makeTest("no timing", undefined, 10), + { name: "zeroes", status: "passed", duration: 10, start: 0, stop: 0 }, + ]); + expect(data.tests).toBe(1); + expect(data.untimed).toBe(2); + }); + + it("rejects a stop before the start unless the duration can repair it", () => { + const data = collectTimeline([ + { + name: "broken", + status: "passed", + duration: Number.NaN, + start: T0 + 500, + stop: T0 + 100, + }, + { + name: "repaired", + status: "passed", + duration: 40, + start: T0 + 500, + stop: T0 + 100, + }, + ]); + expect(data.invalid).toBe(1); + expect(data.lanes[0].executions[0]).toMatchObject({ + name: "repaired", + start: T0 + 500, + stop: T0 + 540, + }); + }); + + it("rejects durations that would put a test centuries away", () => { + const data = collectTimeline([ + makeTest("fine", 0, 10), + { name: "no start", status: "passed", duration: 1e16, stop: T0 }, + { name: "no stop", status: "failed", duration: 1e300, start: T0 }, + ]); + expect(data.tests).toBe(1); + expect(data.invalid).toBe(2); + }); + + it("accepts timestamps written as numeric strings and rounds fractions", () => { + const data = collectTimeline([ + { + name: "a", + status: "passed", + duration: 1.4, + start: `${T0 + 0.4}` as unknown as number, + stop: T0 + 1.6, + }, + ]); + expect(data.lanes[0].executions[0]).toMatchObject({ + start: T0, + stop: T0 + 2, + }); + }); + + it("does not draw skipped and pending tests", () => { + const data = collectTimeline([ + makeTest("ran", 0, 10), + makeTest("skipped", 0, 0, { status: "skipped" }), + makeTest("pending", 0, 0, { status: "pending" }), + ]); + expect(data.notRun).toBe(2); + expect(data.lanes.flatMap((lane) => lane.executions)).toHaveLength(1); + }); + + it("draws runs before a retry in the lane of their test", () => { + const data = collectTimeline([ + makeTest("flaky", 2000, 500, { + threadId: "w1", + retries: 2, + retryAttempts: [ + { attempt: 1, status: "failed", start: T0, stop: T0 + 800 }, + { attempt: 2, status: "failed", start: T0 + 900, stop: T0 + 1900 }, + { attempt: 3, status: "failed" }, + ], + }), + ]); + expect(data.tests).toBe(1); + expect(data.attempts).toBe(2); + expect(data.lanes).toHaveLength(1); + expect( + data.lanes[0].executions.map((e) => [e.kind, e.attempt ?? null]), + ).toEqual([ + ["retry", 1], + ["retry", 2], + ["passed", null], + ]); + }); + + it("orders thread lanes naturally", () => { + const data = collectTimeline( + ["worker-10", "worker-2", "worker-1"].map((threadId, index) => + makeTest(`t${index}`, index * 10, 5, { threadId }), + ), + ); + expect(data.lanes.map((lane) => lane.name)).toEqual([ + "worker-1", + "worker-2", + "worker-10", + ]); + expect(data.inferredLanes).toBe(false); + expect(data.threads).toBe(3); + }); + + it("splits a thread whose tests overlap into several lanes", () => { + const data = collectTimeline([ + makeTest("fork 1", 0, 1000, { threadId: "Test worker" }), + makeTest("fork 2", 10, 1000, { threadId: "Test worker" }), + makeTest("fork 1 again", 1000, 1000, { threadId: "Test worker" }), + ]); + expect(data.lanes.map((lane) => lane.name)).toEqual([ + "Test worker", + "Test worker (2)", + ]); + expect(data.lanes[0].executions.map((e) => e.name)).toEqual([ + "fork 1", + "fork 1 again", + ]); + expect(data.splitThreads).toEqual([{ threadId: "Test worker", lanes: 2 }]); + expect(data.threads).toBe(1); + }); + + it("treats overlaps of a few milliseconds on a thread as clock jitter", () => { + const data = collectTimeline([ + makeTest("a", 0, 1000, { threadId: "w1" }), + makeTest("b", 997, 1000, { threadId: "w1" }), + ]); + expect(data.lanes).toHaveLength(1); + expect(data.splitThreads).toEqual([]); + }); + + it("tells short tests that overlap apart: they ran at the same time", () => { + expect( + collectTimeline([makeTest("a", 0, 10), makeTest("b", 8, 10)]).lanes, + ).toHaveLength(2); + expect( + collectTimeline([ + makeTest("a", 0, 3, { threadId: "w" }), + makeTest("b", 1, 3, { threadId: "w" }), + ]).lanes, + ).toHaveLength(2); + }); + + it("infers lanes from start and stop when there are no thread IDs", () => { + const data = collectTimeline([ + makeTest("a", 0, 1000), + makeTest("b", 100, 1000), + makeTest("c", 1000, 500), + makeTest("d", 1200, 100), + ]); + expect(data.inferredLanes).toBe(true); + expect(data.threads).toBe(0); + expect(data.lanes.map((lane) => [lane.name, lane.origin])).toEqual([ + ["Lane 1", "inferred"], + ["Lane 2", "inferred"], + ]); + expect(data.lanes[0].executions.map((e) => e.name)).toEqual(["a", "c"]); + expect(data.lanes[1].executions.map((e) => e.name)).toEqual(["b", "d"]); + }); + + it("keeps tests without a thread ID apart from threaded ones", () => { + const data = collectTimeline([ + makeTest("a", 0, 10, { threadId: "main" }), + makeTest("b", 0, 10), + ]); + expect(data.lanes.map((lane) => [lane.name, lane.origin])).toEqual([ + ["main", "thread"], + ["No thread ID", "unthreaded"], + ]); + expect(data.inferredLanes).toBe(false); + expect(data.threads).toBe(1); + }); + + it("infers lanes when there are more thread IDs than lanes", () => { + const tests = Array.from({ length: 50 }, (_, index) => + makeTest(`t${index}`, index * 100, 90, { threadId: `thread-${index}` }), + ); + tests.push(makeTest("no thread", 5000, 10)); + const data = collectTimeline(tests, { maxLanes: 10 }); + expect(data.lanes.map((lane) => lane.name)).toEqual(["Lane 1"]); + expect(data.tooManyThreads).toBe(50); + expect(data.inferredLanes).toBe(true); + expect(data.tests).toBe(51); + }); + + it("hides the lanes past the limit and counts their tests", () => { + const tests = Array.from({ length: 12 }, (_, index) => + makeTest(`t${index}`, index, 1000), + ); + const data = collectTimeline(tests, { maxLanes: 5 }); + expect(data.lanes).toHaveLength(5); + expect(data.hiddenLanes).toHaveLength(7); + expect(data.hiddenLanes.flatMap((lane) => lane.executions)).toHaveLength(7); + expect(data.tests).toBe(12); + }); + + it("packs thousands of overlapping tests quickly", () => { + const tests = Array.from({ length: 20_000 }, (_, index) => + makeTest(`t${index}`, index % 7, 1000), + ); + const started = performance.now(); + const data = collectTimeline(tests); + expect(performance.now() - started).toBeLessThan(2000); + expect(data.lanes).toHaveLength(40); + expect(data.hiddenLanes.flatMap((lane) => lane.executions)).toHaveLength( + 20_000 - 40, + ); + }); + + it("packs thousands of short tests that start together quickly", () => { + const tests = Array.from({ length: 20_000 }, (_, index) => + makeTest(`t${index}`, index % 4, 1 + (index % 5)), + ); + const started = performance.now(); + collectTimeline(tests); + expect(performance.now() - started).toBeLessThan(2000); + }); +}); + +describe("collectTimeline with real-world data", () => { + it("converts start and stop times written in seconds, micro- or nanoseconds", () => { + const seconds = Math.floor(T0 / 1000); + const data = collectTimeline([ + { + name: "seconds", + status: "passed", + duration: 1500, + start: seconds, + stop: seconds + 1, + threadId: "a", + }, + { + name: "micro", + status: "passed", + duration: 20, + start: (T0 + 2000) * 1000, + stop: (T0 + 2020) * 1000, + threadId: "b", + }, + { + name: "nano", + status: "passed", + duration: 20, + start: (T0 + 3000) * 1e6, + stop: (T0 + 3020) * 1e6, + threadId: "c", + }, + ]); + const [a, b, c] = data.lanes.map((lane) => lane.executions[0]); + expect(a).toMatchObject({ + start: seconds * 1000, + stop: seconds * 1000 + 1500, + }); + expect(b).toMatchObject({ start: T0 + 2000, stop: T0 + 2020 }); + expect(c).toMatchObject({ start: T0 + 3000, stop: T0 + 3020 }); + expect(data.convertedUnits).toEqual(["s", "µs", "ns"]); + // Two of six times are not on a whole second: not a whole-second report. + expect(data.coarse).toBe(false); + }); + + it("keeps the milliseconds of times in seconds with a fraction", () => { + const data = collectTimeline([ + { + name: "a", + status: "passed", + duration: 500, + start: (T0 + 250) / 1000, + stop: (T0 + 750) / 1000, + }, + ]); + expect(data.lanes[0].executions[0]).toMatchObject({ + start: T0 + 250, + stop: T0 + 750, + }); + expect(data.coarse).toBe(false); + expect(data.convertedUnits).toEqual(["s"]); + }); + + it("draws tests of one lane one after another when times are in whole seconds", () => { + const seconds = Math.floor(T0 / 1000); + const tests = Array.from({ length: 3 }, (_, index) => ({ + name: `t${index}`, + status: "passed" as const, + duration: 300, + start: seconds, + stop: seconds, + threadId: "w1", + })); + const data = collectTimeline(tests); + expect(data.lanes).toHaveLength(1); + expect( + data.lanes[0].executions.map((e) => [e.start - T0, e.stop - T0]), + ).toEqual([ + [0, 300], + [300, 600], + [600, 900], + ]); + }); + + it("treats tests in the same whole second as sequential when times are in seconds", () => { + const seconds = Math.floor(T0 / 1000); + const tests = Array.from({ length: 6 }, (_, index) => ({ + name: `t${index}`, + status: "passed" as const, + duration: 300, + start: seconds + Math.floor((index * 330) / 1000), + stop: seconds + Math.floor((index * 330 + 300) / 1000), + })); + expect(collectTimeline(tests).lanes).toHaveLength(1); + }); + + it("ignores times that are not epoch timestamps", () => { + const data = collectTimeline([ + makeTest("real", 0, 10), + { name: "relative", status: "passed", duration: 10, start: 5, stop: 15 }, + { + name: "minus one", + status: "failed", + duration: 10, + start: -1, + stop: -1, + }, + ]); + expect(data.tests).toBe(1); + expect(data.untimed).toBe(2); + expect(data.untimedFailed).toBe(1); + }); + + it("counts a result listed twice once", () => { + const test = makeTest("same", 0, 100, { threadId: "w1", testId: "id-1" }); + const data = collectTimeline([test, { ...test }]); + expect(data.tests).toBe(1); + expect(data.duplicates).toBe(1); + expect(data.splitThreads).toEqual([]); + }); + + it("tells apart tests with the same name but different IDs", () => { + const data = collectTimeline([ + makeTest("same", 0, 100, { testId: "a" }), + makeTest("same", 0, 100, { testId: "b" }), + ]); + expect(data.tests).toBe(2); + expect(data.duplicates).toBe(0); + }); + + it("drops a run before a retry that repeats the final result", () => { + const data = collectTimeline([ + makeTest("go test", 0, 100, { + threadId: "w1", + retryAttempts: [ + { attempt: 1, status: "failed", start: T0 - 200, stop: T0 - 100 }, + { attempt: 2, status: "passed", start: T0, stop: T0 + 100 }, + ], + }), + ]); + expect(data.attempts).toBe(1); + expect(data.duplicates).toBe(1); + }); + + it("draws Go's final result at its last attempt, not across all of them", () => { + // go-ctrf-json-reporter widens the final result to span every attempt and + // lists the last attempt again. + const data = collectTimeline([ + makeTest("TestFlaky", 0, 900, { + retryAttempts: [ + { attempt: 1, status: "failed", start: T0, stop: T0 + 200 }, + { attempt: 2, status: "passed", start: T0 + 600, stop: T0 + 900 }, + ], + }), + makeTest("TestOther", 200, 400), + ]); + expect(data.lanes).toHaveLength(1); + expect(data.tests).toBe(2); + expect(data.attempts).toBe(1); + expect(data.duplicates).toBe(1); + expect( + data.lanes[0].executions.map((e) => [e.name, e.start - T0, e.stop - T0]), + ).toEqual([ + ["TestFlaky", 0, 200], + ["TestOther", 200, 600], + ["TestFlaky", 600, 900], + ]); + }); + + it("leaves out Go parent tests, which only group their subtests", () => { + const data = collectTimeline([ + makeTest("TestParse", 0, 1000, { status: "failed" }), + makeTest("TestParse/empty", 0, 400), + makeTest("TestParse/broken", 400, 600, { status: "failed" }), + makeTest("TestOther", 1000, 500), + ]); + expect(data.parents).toBe(1); + expect(data.tests).toBe(3); + expect(data.lanes).toHaveLength(1); + }); + + it("labels bars without the suite or file that use-suite-name puts in front", () => { + const previous = process.env.GITHUB_WORKSPACE; + process.env.GITHUB_WORKSPACE = "/home/runner/work/repo"; + try { + const data = collectTimeline([ + makeTest("Checkout > pays - pays with card", 0, 10, { + suite: ["Checkout", "pays"], + }), + makeTest("tests/a.spec.ts - opens", 10, 10, { + filePath: "tests/a.spec.ts", + }), + makeTest("/tests/b.spec.ts - closes", 20, 10, { + filePath: "/home/runner/work/repo/tests/b.spec.ts", + }), + makeTest("plain name", 30, 10, { suite: ["Other"] }), + ]); + expect(data.lanes[0].executions.map((e) => e.label)).toEqual([ + "pays with card", + "opens", + "closes", + "plain name", + ]); + } finally { + process.env.GITHUB_WORKSPACE = previous; + } + }); + + it("draws two runs in one report side by side, cutting out the wait between them", () => { + const tests = [ + makeTest("old run", 0, 1000, { threadId: "w1" }), + makeTest("old run 2", 1000, 1000, { threadId: "w1" }), + ...Array.from({ length: 5 }, (_, index) => + makeTest(`new run ${index}`, 3 * HOUR + index * 100, 90, { + threadId: "w1", + }), + ), + ]; + const data = collectTimeline(tests); + expect(data.tests).toBe(7); + expect(data.cuts).toHaveLength(1); + const [cut] = data.cuts; + expect(cut.length).toBe(3 * HOUR - 2000); + // The runs stay 3% of the chart apart: 75ms of 2,490ms. + expect(cut.removed).toBe(3 * HOUR - 2000 - 75); + expect(cut.at).toBe(T0 + 2000 + 37.5); + const newRun = data.lanes[0].executions.find((e) => e.name === "new run 0"); + expect(newRun?.start).toBe(T0 + 2075); + expect(data.stop).toBe(T0 + 2075 + 490); + }); + + it("draws an earlier result of a test that ran again later as a run before a retry", () => { + const data = collectTimeline([ + makeTest("flaky", 0, 1000, { threadId: "w1", status: "failed" }), + makeTest("stable", 1000, 1000, { threadId: "w1" }), + makeTest("flaky", 3 * HOUR, 1000, { threadId: "w1" }), + ]); + expect(data.tests).toBe(2); + expect(data.attempts).toBe(1); + expect(data.rerun).toBe(1); + const earlier = data.lanes[0].executions[0]; + expect(earlier).toMatchObject({ name: "flaky", attempt: 0, kind: "retry" }); + }); + + it("leaves out earlier runs that a later run repeated", () => { + const tests = Array.from({ length: 10 }, (_, index) => [ + makeTest(`t${index}`, index * 100, 90, { threadId: "w1" }), + makeTest(`t${index}`, 3 * HOUR + index * 100, 90, { threadId: "w1" }), + ]).flat(); + const data = collectTimeline(tests); + expect(data.tests).toBe(10); + expect(data.attempts).toBe(0); + expect(data.history).toBe(10); + expect(data.cuts).toEqual([]); + expect(data.start).toBe(T0 + 3 * HOUR); + }); + + it("keeps idle stretches that are short or a small part of the run", () => { + const data = collectTimeline([ + makeTest("a", 0, 30 * 60_000, { threadId: "w1" }), + makeTest("b", 40 * 60_000, 30 * 60_000, { threadId: "w1" }), + ]); + expect(data.tests).toBe(2); + expect(data.cuts).toEqual([]); + expect(data.stop - data.start).toBe(70 * 60_000); + }); + + it("infers lanes that share the work like the workers did", () => { + // Four equally loaded workers that are idle two thirds of the time. Taking + // the first free lane would pile most tests into lane 1. + const random = seeded(7); + const tests: Test[] = []; + for (let worker = 0; worker < 4; worker++) { + let cursor = Math.floor(random() * 1000); + for (let index = 0; index < 150; index++) { + const length = 100 + Math.floor(random() * 900); + tests.push(makeTest(`w${worker}-${index}`, cursor, length)); + cursor += length + 200 + Math.floor(random() * 1800); + } + } + const sizes = collectTimeline(tests).lanes.map( + (lane) => lane.executions.length, + ); + expect(sizes).toHaveLength(4); + for (const size of sizes) { + expect(size).toBeGreaterThan(100); + expect(size).toBeLessThan(200); + } + }); + + it("puts a run before a retry on its test's thread only where the thread was free", () => { + const data = collectTimeline([ + makeTest("other test", 0, 1000, { threadId: "w1" }), + makeTest("flaky", 2000, 500, { + threadId: "w1", + retryAttempts: [ + { attempt: 1, status: "failed", start: T0 + 200, stop: T0 + 600 }, + { attempt: 2, status: "failed", start: T0 + 1200, stop: T0 + 1900 }, + ], + }), + ]); + expect(data.lanes.map((lane) => [lane.name, lane.origin])).toEqual([ + ["w1", "thread"], + ["Runs before a retry", "attempts"], + ]); + expect(data.lanes[0].executions.map((e) => e.attempt ?? 0)).toEqual([ + 0, 2, 0, + ]); + expect(data.lanes[1].executions.map((e) => e.attempt)).toEqual([1]); + expect(data.strayAttempts).toBe(1); + expect(data.splitThreads).toEqual([]); + }); + + it("uses the pytest-xdist worker when there is no thread ID", () => { + const data = collectTimeline([ + makeTest("a", 0, 10, { extra: { worker: "gw1" } }), + makeTest("b", 0, 10, { extra: { worker: "gw0" } }), + ]); + expect(data.lanes.map((lane) => lane.name)).toEqual(["gw0", "gw1"]); + expect(data.inferredLanes).toBe(false); + }); + + it("draws a skipped test that took time, but not one that did not", () => { + const data = collectTimeline([ + makeTest("assumption failed after setup", 0, 800, { status: "skipped" }), + makeTest("skipped at once", 900, 0, { status: "skipped" }), + makeTest("pending", undefined, 0, { status: "pending" }), + ]); + expect(data.tests).toBe(1); + expect(data.lanes[0].executions[0].kind).toBe("other"); + expect(data.skippedDrawn).toBe(true); + expect(data.notRun).toBe(2); + }); + + it("reads an unknown status as other", () => { + const data = collectTimeline([ + makeTest("broken", 0, 10, { status: "broken" as Test["status"] }), + ]); + expect(data.lanes[0].executions[0]).toMatchObject({ + status: "other", + kind: "other", + }); + }); + + it("counts runs before a retry without timing", () => { + const data = collectTimeline([ + makeTest("flaky", 0, 10, { + retryAttempts: [ + { attempt: 1, status: "failed", duration: 5 }, + { attempt: 2, status: "skipped" }, + ], + }), + ]); + expect(data.untimedAttempts).toBe(1); + }); + + it("flags implausibly many inferred lanes", () => { + const tests = Array.from({ length: 20 }, (_, index) => + makeTest(`t${index}`, index, 1000), + ); + expect(collectTimeline(tests).implausibleLanes).toBe(true); + expect(collectTimeline(tests.slice(0, 8)).implausibleLanes).toBe(false); + }); + + it("leaves out a thread whose start times were not measured, and keeps the others", () => { + const tests: Test[] = []; + for (let worker = 1; worker <= 4; worker++) { + for (let index = 0; index < 10; index++) { + tests.push( + makeTest(`w${worker}-${index}`, index * 100, 90, { + threadId: `w${worker}`, + }), + ); + } + } + for (let index = 0; index < 25; index++) { + tests.push( + makeTest(`stamped ${index}`, 2000, 10 + index, { threadId: "w5" }), + ); + } + const data = collectTimeline(tests); + expect(data.unmeasured).toEqual({ tests: 25, failed: 0, threads: ["w5"] }); + expect(data.tests).toBe(40); + expect(data.lanes.map((lane) => lane.name)).toEqual([ + "w1", + "w2", + "w3", + "w4", + ]); + }); + + it("keeps tests that took no time and share a millisecond: they were measured", () => { + const tests = Array.from({ length: 25 }, (_, index) => + makeTest(`case ${index}`, 2000, 0, { threadId: "w1" }), + ); + tests.push(makeTest("setup", 0, 2000, { threadId: "w1" })); + const data = collectTimeline(tests); + expect(data.unmeasured.tests).toBe(0); + expect(data.tests).toBe(26); + }); +}); + +describe("renderTimelineGantt", () => { + it("writes a compact Gantt on a clock that starts at 0:00", () => { + const { text } = gantt([ + makeTest("Login works", 0, 4200, { threadId: "worker-1" }), + makeTest("Logout works", 4300, 2100, { + threadId: "worker-1", + status: "failed", + }), + ]); + expect( + text.startsWith("---\nconfig:\n gantt:\n displayMode: compact\n"), + ).toBe(true); + expect(text).toContain("\ngantt\n"); + expect(text).toContain("\ndateFormat D HH:mm:ss.SSS\n"); + expect(text).toContain("\naxisFormat %-S.%Ls\n"); + expect(text).toContain("\ntodayMarker off"); + expect(sections(text)).toEqual(["worker-1"]); + expect(taskLines(text)).toEqual([ + `${ZWSP}Login works :16 00:00:00.000, 4200ms`, + `${ZWSP}Logout works :crit, 16 00:00:04.300, 2100ms`, + ]); + // Empty tasks at both ends keep the axis on the whole run. + expect(text).toContain(`\n${ZWSP} :16 00:00:00.000, 0ms\n`); + expect(text).toContain(`\n${ZWSP} :16 00:00:06.400, 0ms`); + }); + + it("keeps GitHub's light and dark themes and sets colors that differ in more than hue", () => { + const { text } = gantt([makeTest("a", 0, 10)]); + const frontmatter = text.split("\n---\n")[0]; + expect(frontmatter).not.toMatch(/^\s*theme:/m); + expect(frontmatter).toContain(" taskBkgColor: '#4ac26b'"); + expect(frontmatter).toContain(" critBkgColor: '#cf222e'"); + expect(frontmatter).toContain(" activeTaskBkgColor: '#eac54f'"); + expect(frontmatter).toContain(" doneTaskBkgColor: '#afb8c1'"); + expect(frontmatter).toContain(" vertLineColor: '#8c959f'"); + // White names on failed bars, dashed outlines on failed attempts. + expect(frontmatter).toMatch( + /\n {2}themeCSS: "[^"]*\.taskText\.critText0[^"]*fill:#ffffff !important[^"]*\.active0[^"]*stroke-dasharray:4 2[^"]*"\n/, + ); + }); + + it.each([ + [5_000, "%-S.%Ls"], + [30 * 60_000, "%-M:%S"], + [2 * HOUR, "%-H:%M:%S"], + ])("formats the axis for a run of %ims as %s", (length, format) => { + const { text } = gantt([makeTest("a", 0, length)]); + expect(text).toContain(`\naxisFormat ${format}\n`); + expect(text).toContain("\ndateFormat D HH:mm:ss.SSS\n"); + }); + + it("switches to epoch timestamps for runs of a day or more", () => { + const { text } = gantt([ + makeTest("soak", 0, 25 * HOUR), + makeTest("after", 25 * HOUR, 1000), + ]); + expect(text).toContain("\ndateFormat x\n"); + expect(text).toContain("\naxisFormat %b %-d %H:%M\n"); + expect(taskLines(text)[0]).toMatch(new RegExp(` :${T0}, 90000000ms$`)); + }); + + it("tags bars by kind", () => { + const lines = taskLines( + gantt([ + makeTest("passed", 0, 10_000), + makeTest("failed", 10_000, 10_000, { status: "failed" }), + makeTest("other", 20_000, 10_000, { status: "other" }), + makeTest("flaky", 40_000, 10_000, { + retryAttempts: [ + { + attempt: 1, + status: "failed", + start: T0 + 30_000, + stop: T0 + 40_000, + }, + ], + }), + ]).text, + ); + const tags = lines.map((line) => { + const data = line.split(" :")[1]; + return data.startsWith("16 ") ? "" : data.split(" 16 ")[0]; + }); + expect(tags).toEqual(["", "crit,", "done,", "active,", ""]); + }); + + it("starts every task with a zero-width space so no name reads as a keyword", () => { + const names = [ + "section should collapse", + "title renders", + "gantt chart", + "click me", + "2024-01-01 report", + "dateFormat x", + "Excludes weekends", + "todayMarker off", + "accTitle: hijack", + "%% not a comment", + "5% load", + ]; + const { text } = gantt( + names.map((name, index) => + makeTest(name, 0, 60_000, { threadId: `t${index}` }), + ), + ); + const lines = taskLines(text); + expect(lines).toHaveLength(names.length); + expect(sections(text)).toHaveLength(names.length); + for (const line of text.split("\n").filter((l) => l.includes(" :"))) { + if (line.startsWith("section") || /^\w/.test(line)) { + continue; + } + expect(line.startsWith(ZWSP)).toBe(true); + expect(line.split(" :")[0]).not.toMatch(/[:;%]/); + } + expect(text.match(/^title /m)).toBeNull(); + }); + + it("removes what would break the diagram or the markdown fence", () => { + const { text } = gantt([ + makeTest("a: b; c #1; d #amp; 100% ```x``` \nnext\tline", 0, 60_000, { + threadId: "w#1; x: `y` %%{i}%%
z", + }), + ]); + const [line] = taskLines(text); + const name = line.slice(1, line.lastIndexOf(" :")); + expect(name).toBe("a∶ b, c #1, d #amp, 100% '''x''' next line"); + expect(sections(text)).toEqual(["w#1, x∶ 'y' %%{i}%% z"]); + expect(text).not.toContain("`"); + expect(text).not.toMatch(/#\w+;/); + }); + + it("writes a name only when it fits inside its bar", () => { + const { text } = gantt([ + makeTest("A long test with a readable name", 0, 50_000), + makeTest("A short test with a long name that cannot fit", 50_000, 600), + ]); + const [long, short] = taskLines(text); + expect(long).toMatch(/^\u200bA long test with a readable name :/); + expect(short).toMatch(/^\u200b :/); + }); + + it("cuts a name that is too long for its bar", () => { + const name = "Checkout with a saved card and a discount code applied twice"; + const { text } = gantt([ + makeTest(name, 0, 9000), + makeTest("rest", 9000, 51_000), + ]); + const label = taskLines(text)[0].split(" :")[0].slice(1); + expect(label.endsWith("…")).toBe(true); + expect(name.startsWith(label.slice(0, -1))).toBe(true); + expect(label.length).toBeGreaterThan(6); + }); + + it("draws a failure too short for a bar as a diamond and keeps neighbours off it", () => { + const { text, diamonds } = gantt([ + makeTest("before", 0, 9900), + makeTest("init fails", 9900, 0, { status: "failed" }), + makeTest("after", 9910, 20_090), + ]); + expect(diamonds).toBe(true); + const lines = taskLines(text); + expect(lines[1]).toBe(`${ZWSP} :crit, milestone, 16 00:00:09.900, 0ms`); + const [lane] = laneSpans(text); + const [before, after] = [lane[1], lane[3]]; + const half = 12 * (30_000 / (1000 - 75 - 40)); + expect(before[0] + before[1]).toBeLessThanOrEqual(9900 - half + 1); + expect(after[0]).toBeGreaterThanOrEqual(9900 + half - 1); + }); + + it("keeps a failed bar red by drawing a retried attempt right before it as a sliver", () => { + const { text, kinds } = gantt([ + makeTest("A passes", 0, 30_000, { threadId: "T1" }), + makeTest("X fails", 30_100, 400, { + threadId: "T1", + status: "failed", + retryAttempts: [ + { + attempt: 1, + status: "failed", + start: T0 + 30_000, + stop: T0 + 30_100, + }, + ], + }), + makeTest("B passes", 30_500, 29_500, { threadId: "T1" }), + ]); + expect(kinds).toEqual(["passed", "failed", "retry"]); + const lines = taskLines(text); + expect(lines.filter((line) => line.includes(":crit, 16"))).toHaveLength(1); + expect(lines.filter((line) => line.includes(":active, 16"))).toHaveLength( + 1, + ); + expect(text).not.toContain("milestone"); + }); + + it("draws short failures as slivers on lanes where diamonds would crowd out the passes", () => { + const tests: Test[] = []; + for (let index = 0; index < 45; index++) { + tests.push( + makeTest(`fast failure ${index}`, index * 1330, 5, { + status: "failed", + threadId: "worker-0", + }), + makeTest(`passing test ${index}`, index * 1330 + 5, 1325, { + threadId: "worker-0", + }), + ); + } + tests.push( + makeTest("lone failure", 30_000, 5, { + status: "failed", + threadId: "worker-1", + }), + makeTest("long pass", 30_005, 29_000, { threadId: "worker-1" }), + ); + const { text, diamonds } = gantt(tests); + const [crowded, quiet] = laneSpans(text); + const milestones = text + .split("\n") + .filter((line) => line.includes("milestone")); + // worker-0 gets slivers, and keeps its passes between them; + // worker-1 keeps its diamond. + expect(milestones).toHaveLength(1); + expect(diamonds).toBe(true); + const lines = text.split("\nsection ")[1].split("\n"); + expect(lines.filter((line) => line.includes(":crit,")).length).toBe(45); + expect( + crowded.filter(([, length]) => length > 1000).length, + ).toBeGreaterThan(40); + expect(quiet.length).toBeGreaterThan(1); + }); + + it("draws short failures as slivers when diamonds would crowd the chart", () => { + const tests: Test[] = []; + for (let index = 0; index < 400; index++) { + tests.push( + makeTest(`t${index}`, index * 1000, 990, { + status: index % 2 === 0 ? "failed" : "passed", + }), + ); + } + const { text, diamonds } = gantt(tests); + expect(diamonds).toBe(false); + expect(text).not.toContain("milestone"); + expect(text).toContain("crit, "); + }); + + it("keeps failures spread over a stretch apart instead of one marker for all", () => { + const tests: Test[] = [makeTest("setup", 0, 20_000, { threadId: "w0" })]; + for (let index = 0; index < 3000; index++) { + tests.push( + makeTest(`parse case ${index}`, 20_000 + index * 3, 3, { + threadId: "w0", + status: index % 10 === 0 ? "failed" : "passed", + }), + ); + } + tests.push(makeTest("teardown", 29_000, 31_000, { threadId: "w0" })); + const { text } = gantt(tests); + const markers = laneSpans(text)[0].filter( + ([start]) => start >= 20_000 && start <= 29_000, + ); + const failures = text.split("\n").filter((line) => line.includes(":crit,")); + // The 9 seconds of cases are about 133px: several markers, not one. + expect(failures.length).toBeGreaterThan(4); + expect(markers.length).toBeGreaterThan(4); + }); + + it("merges runs of tests too short to tell apart and says how many", () => { + const tests = Array.from({ length: 300 }, (_, index) => + makeTest(`quick ${index}`, index * 10, 9), + ); + tests.push(makeTest("slow", 3000, 9000)); + const { text, mergedBars } = gantt(tests); + expect(mergedBars).toBe(true); + const lines = taskLines(text); + expect(lines.length).toBeLessThan(5); + expect(text).toContain("300 tests"); + }); + + it("never merges a failure into the passes around it", () => { + const tests = Array.from({ length: 200 }, (_, index) => + makeTest(`quick ${index}`, index * 10, 9, { + status: index === 100 ? "failed" : "passed", + }), + ); + tests.push(makeTest("slow", 2000, 600_000)); + const lines = taskLines(gantt(tests).text); + const failures = lines.filter((line) => line.includes("crit")); + expect(failures).toHaveLength(1); + expect(failures[0]).toContain("milestone"); + expect(lines.find((line) => line.startsWith(`${ZWSP}slow :`))).toMatch( + /^\u200bslow :16 /, + ); + }); + + it("keeps passes green when it merges skips into them to save space", () => { + const tests: Test[] = []; + const random = seeded(11); + for (let lane = 0; lane < 8; lane++) { + let cursor = 0; + for (let index = 0; index < 180; index++) { + const skip = index % 3 === 1; + const failed = index === 9 || index === 170; + const length = failed + ? 1500 + : skip + ? 30 + : 250 + Math.floor(random() * 100); + tests.push( + makeTest(`t${lane}-${index}`, cursor, length, { + threadId: `gw${lane}`, + status: failed ? "failed" : skip ? "skipped" : "passed", + }), + ); + cursor += length; + } + } + const { text, kinds } = gantt(tests, { maxDiagramChars: 20_000 }); + expect(text.length).toBeLessThanOrEqual(20_000); + expect(kinds).toContain("passed"); + let green = 0; + let gray = 0; + for (const line of taskLines(text)) { + const length = Number(line.match(/, (\d+)ms$/)?.[1]); + if (line.includes(":done,")) { + gray += length; + } else if (!line.includes(":crit,")) { + green += length; + } + } + expect(green).toBeGreaterThan(gray * 3); + // Both 1.5s failures of each worker stay where they ran, as bars. + const failed = taskLines(text).filter((line) => line.includes(":crit, 16")); + expect(failed.length).toBe(16); + }); + + it("survives merged bars split by failures into pieces over idle time", () => { + const tests: Test[] = []; + for (let worker = 1; worker < 40; worker++) { + for (let index = 0; index < 22; index++) { + tests.push( + makeTest(`w${worker}-${index}`, index * 4000, 4000, { + threadId: `worker-${worker}`, + }), + ); + } + } + tests.push( + makeTest("checkout passes", 0, 4000, { threadId: "worker-0" }), + makeTest("payment fails fast", 4000, 100, { + threadId: "worker-0", + status: "failed", + }), + makeTest("refund passes", 4100, 4000, { threadId: "worker-0" }), + makeTest("invoice fails fast", 8100, 100, { + threadId: "worker-0", + status: "failed", + }), + ...Array.from({ length: 19 }, (_, index) => + makeTest(`late ${index}`, 9200 + index * 4000, 4000, { + threadId: "worker-0", + }), + ), + ); + const report = buildTimelineReport(tests); + expect(report.hasData).toBe(true); + expect(report.mermaid).toContain("crit"); + expect(vi.mocked(core.warning)).not.toHaveBeenCalled(); + }); + + it("keeps every lane on one row: bars in a lane never overlap", () => { + const tests: Test[] = []; + const random = seeded(42); + for (let lane = 0; lane < 6; lane++) { + let cursor = Math.floor(random() * 100); + for (let index = 0; index < 400; index++) { + const length = Math.floor(random() ** 3 * 4000); + const status = random() < 0.05 ? "failed" : "passed"; + tests.push( + makeTest(`t${lane}-${index}`, cursor, length, { + status, + threadId: `w${lane}`, + retryAttempts: + random() < 0.03 + ? [ + { + attempt: 1, + status: "failed", + start: T0 + cursor - 20, + stop: T0 + cursor - 2, + }, + ] + : undefined, + }), + ); + cursor += length + Math.floor(random() * 50) - 3; + } + } + for (const maxDiagramChars of [20_000, 6000, 2500]) { + const lanes = laneSpans(gantt(tests, { maxDiagramChars }).text); + for (const lane of lanes) { + for (let index = 1; index < lane.length; index++) { + const [previousStart, previousLength] = lane[index - 1]; + expect(lane[index][0]).toBeGreaterThanOrEqual( + previousStart + previousLength, + ); + } + } + } + }); + + it("stays within the character budget for very large runs", () => { + const tests: Test[] = []; + for (let lane = 0; lane < 16; lane++) { + for (let index = 0; index < 1500; index++) { + tests.push( + makeTest( + `suite ${lane} test ${index}`, + index * 130 + (lane % 3), + 100, + { + status: index % 97 === 0 ? "failed" : "passed", + threadId: `ForkJoinPool-1-worker-${lane + 1}`, + }, + ), + ); + } + } + const { text, kinds } = gantt(tests); + expect(text.length).toBeLessThanOrEqual(20_000); + expect(kinds).toContain("failed"); + expect(sections(text)).toHaveLength(16); + }); + + it("stays within a small budget by coarsening further", () => { + const tests: Test[] = []; + for (let lane = 0; lane < 10; lane++) { + for (let index = 0; index < 500; index++) { + tests.push( + makeTest(`t${index}`, index * 200, 100, { + status: index % 2 ? "failed" : "passed", + threadId: `w${lane}`, + }), + ); + } + } + const { text } = gantt(tests, { maxDiagramChars: 3000 }); + expect(text.length).toBeLessThanOrEqual(3000); + expect(sections(text)).toHaveLength(10); + }); + + it("drops the labels, then the chart, rather than go over the budget", () => { + const name = `renders ✔${"\ufe0f".repeat(60_000)} icon`; + const tests = [ + makeTest(name, 0, 60_000, { threadId: "main" }), + makeTest("b", 0, 1000, { threadId: `w${"\ufe0f".repeat(60_000)}` }), + ]; + const { text } = gantt(tests); + expect(text.length).toBeLessThanOrEqual(20_000); + expect(gantt(tests, { maxDiagramChars: 300 }).text).toBe(""); + }); + + it("gives every lane its own section, even when names clash once cleaned", () => { + const { text } = gantt([ + makeTest("a", 0, 10, { threadId: "a;b" }), + makeTest("b", 0, 10, { threadId: "a,b" }), + ]); + expect(sections(text)).toEqual(["a,b", "a,b [2]"]); + }); + + it("keeps the part where long lane names differ", () => { + const base = "integration-tests-runner-node-alpha-0001-shard-"; + const { text } = gantt( + ["west", "east", "north"].map((region, index) => + makeTest(`t${index}`, 0, 1000, { + threadId: `${base}${region}-europe-zone-b-000123`, + }), + ), + ); + const names = sections(text); + expect(new Set(names).size).toBe(3); + expect(names.every((name) => !name.includes("["))).toBe(true); + expect( + names.some((name) => name.endsWith("rth-europe-zone-b-000123")), + ).toBe(true); + }); + + it("sizes the left margin to the longest lane name, within limits", () => { + const short = gantt([makeTest("a", 0, 10, { threadId: "w1" })]).text; + const long = gantt([ + makeTest("a", 0, 10, { threadId: "ForkJoinPool-1-worker-1" }), + ]).text; + const huge = gantt([ + makeTest("a", 0, 10, { threadId: "x".repeat(200) }), + ]).text; + const padding = (text: string) => + Number(text.match(/leftPadding: (\d+)/)?.[1]); + expect(padding(short)).toBe(75); + expect(padding(long)).toBeGreaterThan(150); + expect(padding(huge)).toBeGreaterThan(220); + expect(padding(huge)).toBeLessThanOrEqual(240); + expect(sections(huge)[0]).toMatch(/^x+…x{10}$/); + }); + + it("writes the description it is given for screen readers", () => { + const { text } = renderTimelineGantt( + collectTimeline([makeTest("a", 0, 1000)]), + {}, + "One test: a; 100% done", + ); + expect(text).toContain("\naccTitle: Test execution timeline\n"); + expect(text).toContain("\naccDescr: One test: a, 100% done\n"); + }); + + it("keeps the axis at 0:00 when the first test becomes a diamond", () => { + const lanes = laneSpans( + gantt([ + makeTest("init fails", 0, 0, { status: "failed" }), + makeTest("rest", 10, 60_000), + ]).text, + ); + expect(lanes[0][0]).toEqual([0, 0]); + }); + + it("gives a run where everything took no time an axis of its own", () => { + const { text } = gantt([ + makeTest("a", 0, 0), + makeTest("b", 0, 0, { status: "failed" }), + ]); + expect(text).not.toContain("NaN"); + expect(text).toContain(`\n${ZWSP} :16 00:00:00.001, 0ms`); + }); + + it("marks where a stretch without tests is cut out, and merges nothing across it", () => { + const tests = [ + ...Array.from({ length: 50 }, (_, index) => + makeTest(`first ${index}`, index * 20, 20, { threadId: "w1" }), + ), + ...Array.from({ length: 50 }, (_, index) => + makeTest(`second ${index}`, 3 * HOUR + index * 20, 20, { + threadId: "w1", + }), + ), + ]; + const data = collectTimeline(tests); + const { text } = renderTimelineGantt(data); + const cut = text.split("\n").filter((line) => line.includes(":vert,")); + // The runs stay 60ms apart, 3% of the 2s they took. + expect(cut).toEqual([`${ZWSP} :vert, 16 00:00:01.030, 0ms`]); + for (const [start, length] of laneSpans(text)[0]) { + expect(start >= 1030 || start + length <= 1030).toBe(true); + } + }); +}); + +describe("buildTimelineReport", () => { + it("explains what is missing when no test has timing", () => { + const report = buildTimelineReport([makeTest("a", undefined, 10)]); + expect(report.hasData).toBe(false); + expect(report.message).toContain("start"); + expect(report.message).toContain("threadId"); + }); + + it("says what is wrong when every test's times are broken", () => { + const report = buildTimelineReport([ + { + name: "a", + status: "passed", + duration: Number.NaN, + start: T0 + 9, + stop: T0, + }, + ]); + expect(report.hasData).toBe(false); + expect(report.message).toBe( + "No test in this report has start and stop times that can be placed on a timeline: they stop before they start, or are not plausible dates.", + ); + }); + + it("says so when no test ran at all", () => { + const report = buildTimelineReport([ + makeTest("a", 0, 0, { status: "skipped" }), + ]); + expect(report.hasData).toBe(false); + expect(report.message).toBe("No test ran, so there is no timeline."); + expect(buildTimelineReport([]).hasData).toBe(false); + }); + + it("summarises tests, lanes, length, how busy the lanes were and the peak", () => { + const report = buildTimelineReport([ + makeTest("a", 0, 10_000, { threadId: "w1" }), + makeTest("b", 0, 5000, { threadId: "w2" }), + makeTest("c", 5000, 5000, { + threadId: "w2", + retryAttempts: [ + { attempt: 1, status: "failed", start: T0 + 5000, stop: T0 + 5000 }, + ], + }), + ]); + expect(report.headline).toBe( + "**3** tests (and **1** run before a retry) on **2** threads in **10.0s** · busy **100%** of the time · up to **2** at once", + ); + }); + + it("counts threads, not lanes, and leaves runs before a retry out of how busy they were", () => { + const report = buildTimelineReport([ + makeTest("A", 0, 5000, { threadId: "0" }), + makeTest("B", 5000, 5000, { threadId: "0" }), + makeTest("C", 0, 5000, { threadId: "1" }), + makeTest("X", 5000, 5000, { + threadId: "1", + retryAttempts: [ + { attempt: 1, status: "failed", start: T0, stop: T0 + 5000 }, + ], + }), + ]); + expect(report.headline).toBe( + "**4** tests (and **1** run before a retry) on **2** threads and **1** more lane in **10.0s** · busy **100%** of the time · up to **3** at once", + ); + const split = buildTimelineReport([ + makeTest("fork 1", 0, 1000, { threadId: "Test worker" }), + makeTest("fork 2", 0, 1000, { threadId: "Test worker" }), + ]); + expect(split.headline).toBe( + "**2** tests on **1** thread in **2** lanes in **1.0s** · busy **100%** of the time · up to **2** at once", + ); + }); + + it("reports busy and idle time per lane", () => { + const report = buildTimelineReport([ + makeTest("a", 0, 10_000, { threadId: "w1", status: "failed" }), + makeTest("b", 0, 2000, { threadId: "w2" }), + makeTest("c", 6000, 2000, { threadId: "w2" }), + ]); + expect(report.showLanes).toBe(true); + expect(report.lanes).toEqual([ + { + name: "w1", + tests: 1, + retries: 0, + failed: 1, + busy: "10.0s", + idle: "0ms", + utilization: "100%", + }, + { + name: "w2", + tests: 2, + retries: 0, + failed: 0, + busy: "4.0s", + idle: "6.0s", + utilization: "40%", + }, + ]); + expect(report.headline).toContain("busy **70%** of the time"); + }); + + it("hides the lane table for a single lane", () => { + const report = buildTimelineReport([ + makeTest("a", 0, 10, { threadId: "w1" }), + ]); + expect(report.showLanes).toBe(false); + expect(report.headline).toBe( + "**1** test on **1** thread in **10ms** · busy **100%** of the time", + ); + expect(report.highlights).toBe(""); + }); + + it("names the slowest test and the one that finished last", () => { + const report = buildTimelineReport([ + makeTest("login", 0, 2000, { threadId: "w1" }), + makeTest("export `csv`", 0, 9000, { threadId: "w2" }), + makeTest("logout", 9000, 1500, { threadId: "w2" }), + ]); + expect(report.highlights).toBe( + "Slowest: `` export `csv` `` (9.0s on `w2`) · Last to finish: `logout` at 0:10.500 on `w2`", + ); + expect(report.mermaid).toContain( + "\naccDescr: 3 tests on 2 threads over 10.5s, 0 failed. The slowest test is export 'csv' (9.0s on w2). The last to finish is logout on w2, at 0:10.500.\n", + ); + const same = buildTimelineReport([ + makeTest("a", 0, 1000, { threadId: "w1" }), + makeTest("b", 0, 5000, { threadId: "w2" }), + ]); + expect(same.highlights).toBe( + "Slowest and last to finish: `b` (5.0s on `w2`, until 0:05.000)", + ); + }); + + it("lists executions grouped by lane, in start order on the clock of the axis", () => { + const report = buildTimelineReport([ + makeTest("second", 65_250, 1000, { threadId: "w2" }), + makeTest("third", 1000, 1000, { threadId: "w1" }), + makeTest("first", 0, 1500, { threadId: "w2", status: "failed" }), + ]); + expect(report.rows).toEqual([ + { + number: "", + start: "0:01.000", + duration: "1.0s", + lane: "w1", + name: "third", + status: "✅ passed", + }, + { + number: "1", + start: "0:00.000", + duration: "1.5s", + lane: "w2", + name: "first", + status: "❌ failed", + }, + { + number: "", + start: "1:05.250", + duration: "1.0s", + lane: "w2", + name: "second", + status: "✅ passed", + }, + ]); + expect(report.rowsTitle).toBe("Test timings (3)"); + expect(report.startHeader).toBe("Start"); + }); + + it("caps the timings table, keeping failures, retried failures and the slowest tests", () => { + const tests = Array.from({ length: 10 }, (_, index) => + makeTest(`t${index}`, index * 1000, 100 + index), + ); + tests[2] = makeTest("broken", 2000, 1, { status: "failed" }); + tests[3] = makeTest("flaky", 3500, 1, { + retryAttempts: [ + { attempt: 1, status: "failed", start: T0 + 3000, stop: T0 + 3001 }, + ], + }); + const report = buildTimelineReport(tests, { maxRows: 4 }); + expect(report.rows.map((row) => row.name)).toEqual([ + "broken", + "flaky (attempt 1)", + "t8", + "t9", + ]); + expect(report.rowsTitle).toBe( + "Test timings (4 of 11: failures, retried failures and the slowest)", + ); + const failuresOnly = buildTimelineReport(tests, { maxRows: 1 }); + expect(failuresOnly.rowsTitle).toBe("Test timings (1 of 11: failures)"); + }); + + it("shows table cells as written: one line, no links, formatting or mentions", () => { + const report = buildTimelineReport([ + makeTest("a | b\nc", 0, 10, { threadId: "x|y" }), + makeTest( + "see [log](https://evil.example) ![](https://evil.example/p.png) **bold** @octocat #12 `code` ", + 10, + 10, + { threadId: "x|y" }, + ), + ]); + expect(report.rows[0].name).toBe("a \\| b c"); + expect(report.rows[0].lane).toBe("x\\|y"); + expect(report.rows[1].name).toBe( + "see \\[log\\](https:\u2060//evil.example) !\\[\\](https:\u2060//evil.example/p.png) \\*\\*bold\\*\\* @\u2060octocat #\u206012 \\`code\\` <b>", + ); + }); + + it("adds notes only for what applies", () => { + expect( + buildTimelineReport([makeTest("a", 0, 10, { threadId: "w1" })]).notes, + ).toEqual([]); + + const report = buildTimelineReport([ + makeTest("timed", 0, 10), + makeTest("untimed", undefined, 10), + makeTest("skipped", undefined, 0, { status: "skipped" }), + ]); + expect(report.notes).toEqual([ + "1 test without start and stop times is not shown.", + "1 skipped or pending test is not shown.", + "The report has no thread IDs (threadId), so lanes are inferred from start and stop times.", + ]); + }); + + it("explains split threads, naming them as code", () => { + const report = buildTimelineReport([ + makeTest("a", 0, 1000, { threadId: "Test worker" }), + makeTest("b", 10, 1000, { threadId: "Test worker" }), + ]); + expect(report.notes).toEqual([ + "Tests on `Test worker` overlap in time (processes sharing a thread name, or a test timed around others), so it is shown as 2 lanes.", + ]); + const windows = buildTimelineReport([ + makeTest("a", 0, 1000, { threadId: "D:\\agents\\w1\\" }), + makeTest("b", 10, 1000, { threadId: "D:\\agents\\w1\\" }), + ]); + expect(windows.notes[0]).toContain("Tests on `D:\\agents\\w1\\` overlap"); + }); + + it("keeps notes short, whatever the thread names", () => { + const report = buildTimelineReport( + [0, 1, 2, 3].flatMap((thread) => [ + makeTest("a", 0, 1000, { + threadId: `pool-${thread}-${"worker".repeat(5000)}`, + }), + makeTest("b", 500, 1000, { + threadId: `pool-${thread}-${"worker".repeat(5000)}`, + }), + ]), + ); + const note = report.notes.find((text) => text.startsWith("Tests on")); + expect(note?.length).toBeLessThan(400); + expect(note).toContain("and 1 other thread"); + }); + + it("lists only the bar kinds that appear, and when 0:00 was to the millisecond", () => { + const report = buildTimelineReport([ + makeTest("a", 999, 60_000, { threadId: "w1" }), + makeTest("b", 60_999, 60_000, { threadId: "w1", status: "failed" }), + ]); + expect(report.legend).toBe( + `🟩 passed · 🟥 failed · 0:00 = ${new Date(T0 + 999).toISOString().slice(0, 23).replace("T", " ")} UTC`, + ); + const retried = buildTimelineReport([ + makeTest("flaky", 30_000, 30_000, { + retryAttempts: [ + { attempt: 1, status: "failed", start: T0, stop: T0 + 30_000 }, + ], + }), + ]); + expect(retried.legend).toContain("🟨 failed, then retried (dashed)"); + }); + + it("shows real times in the tables when a stretch is cut out of the chart", () => { + const report = buildTimelineReport([ + makeTest("early", 0, 1000, { threadId: "w1" }), + makeTest("late", 3 * HOUR, 1000, { threadId: "w1" }), + ]); + expect(report.rows.map((row) => row.start)).toEqual([ + "0:00:00.000", + "3:00:00.000", + ]); + expect(report.notes).toContain( + "No test ran for 2h 59m, so that stretch is cut out of the chart at the gray line; the tables show real times.", + ); + expect(report.highlights).toContain("at 3:00:01.000"); + }); +}); + +describe("text helpers", () => { + it("leaves ordinary names alone", () => { + expect(sanitizeMermaidText("should render > nested (case 1)")).toBe( + "should render > nested (case 1)", + ); + }); + + it("drops control, zero-width and bidirectional formatting characters", () => { + expect( + sanitizeMermaidText("a\u0000b\u200bc\u202ed\u2028e\u0085f\ufeff"), + ).toBe("a bcd e f"); + }); + + it("keeps the joiners that Persian, Indic scripts and emoji need", () => { + expect(sanitizeMermaidText("می\u200cخواهم 👨\u200d👩\u200d👧")).toBe( + "می\u200cخواهم 👨\u200d👩\u200d👧", + ); + }); + + it("cuts names between characters, never inside an emoji or a flag", () => { + const name = "🏳️\u200d🌈🇺🇦👨\u200d👩\u200d👧".repeat(10); + const cut = fitText(name, 120, 1); + expect(cut.endsWith("…")).toBe(true); + expect(name.startsWith(cut.slice(0, -1))).toBe(true); + expect(cut.length % "🏳️\u200d🌈🇺🇦👨\u200d👩\u200d👧".length).toBeGreaterThan( + 0, + ); + const tail = fitMiddle(name, 120); + expect(name.endsWith(tail.slice(tail.indexOf("…") + 1))).toBe(true); + }); + + it("cuts a name only where it does not fit, and keeps its cut inside the room", () => { + const name = "abcdefghijklmnopqrstuvwxyzabcdefghijkl"; + expect(fitText(name, textWidth(name), 10)).toBe(name); + const cut = fitText(name, textWidth(name) - 1, 10); + expect(cut.endsWith("…")).toBe(true); + expect(textWidth(cut)).toBeLessThanOrEqual(textWidth(name) - 1); + }); + + it("writes code spans that hold any text", () => { + expect(codeSpan("plain")).toBe("`plain`"); + expect(codeSpan("a `b` c")).toBe("``a `b` c``"); + expect(codeSpan("`edge`")).toBe("`` `edge` ``"); + expect(codeSpan("")).toBe("` `"); + }); + + it("escapes cells for markdown and HTML", () => { + expect(escapeCell("a & www.example.com")).toBe( + "a & <b> www\u2060.example.com", + ); + }); +}); + +describe("formatDuration", () => { + it.each([ + [0, "0ms"], + [999.4, "999ms"], + [1500, "1.5s"], + [65_000, "1m 5s"], + [120_000, "2m"], + [3_600_000, "1h"], + [3_900_000, "1h 5m"], + ])("formats %ims as %s", (ms, text) => { + expect(formatDuration(ms)).toBe(text); + }); +}); + +describe("buildTimelineReport with real-world data", () => { + it("never throws, and says so in the job log", () => { + const hostile = [ + null, + 1, + "x", + { name: 123, status: "weird", duration: "abc", start: "nope" }, + { + get name() { + throw new Error("boom"); + }, + status: "passed", + duration: 1, + start: T0, + stop: T0 + 1, + }, + ] as unknown as Test[]; + const report = buildTimelineReport(hostile); + expect(report.hasData).toBe(false); + expect(report.message).toContain("could not be drawn"); + expect(vi.mocked(core.warning)).toHaveBeenCalledWith( + "Timeline report could not be built: boom", + ); + }); + + it("explains every kind of test it leaves out", () => { + const report = buildTimelineReport([ + makeTest("drawn", 0, 1000, { threadId: "w1" }), + makeTest("drawn twice", 1000, 1000, { threadId: "w1", testId: "x" }), + makeTest("drawn twice", 1000, 1000, { threadId: "w1", testId: "x" }), + makeTest("untimed failure", undefined, 10, { status: "failed" }), + makeTest("old run", -6 * HOUR - 1000, 1000, { threadId: "w1" }), + makeTest("flaky", 2000, 100, { + threadId: "w1", + retryAttempts: [{ attempt: 1, status: "failed", duration: 5 }], + }), + makeTest("broken", 0, 10, { stop: T0 - 10, duration: Number.NaN }), + makeTest("TestGroup", 3000, 100, { threadId: "w1" }), + makeTest("TestGroup/case", 3000, 100, { threadId: "w1" }), + ]); + expect(report.notes).toEqual([ + "1 test without start and stop times is not shown (it failed).", + "1 test whose start and stop times cannot be placed (stopping before starting, or not a plausible date) is not shown.", + "1 run before a retry without start and stop times is not shown.", + "No test ran for 6h, so that stretch is cut out of the chart at the gray line; the tables show real times.", + "1 result listed more than once is counted once.", + "1 parent test that only groups its subtests (TestX around TestX/case) is not drawn.", + "A number on a bar is the row with that number (#) in the test timings below.", + ]); + }); + + it("says which results of a test that ran again are drawn as attempts, and what is left out", () => { + const rerun = buildTimelineReport([ + makeTest("flaky", 0, 1000, { threadId: "w1", status: "failed" }), + makeTest("stable", 1000, 1000, { threadId: "w1" }), + makeTest("flaky", 3 * HOUR, 1000, { threadId: "w1" }), + ]); + expect(rerun.notes).toContain( + "1 test ran again later in the report, so its earlier result is drawn as a run before a retry.", + ); + const history = buildTimelineReport( + Array.from({ length: 10 }, (_, index) => [ + makeTest(`t${index}`, index * 100, 90, { threadId: "w1" }), + makeTest(`t${index}`, 3 * HOUR + index * 100, 90, { threadId: "w1" }), + ]).flat(), + ); + expect(history.notes).toEqual([ + "10 results from earlier runs in the same report are not shown: later runs repeated those tests.", + ]); + }); + + it("says when start and stop times are in whole seconds", () => { + const seconds = Math.floor(T0 / 1000); + const report = buildTimelineReport([ + { + name: "a", + status: "passed", + duration: 10, + start: seconds, + stop: seconds, + }, + ]); + expect(report.notes).toContain( + "Start and stop times are in whole seconds, so tests are drawn one after another from the second they started: the chart shows their order rather than exact times.", + ); + }); + + it("says when start and stop times were converted from other units", () => { + const report = buildTimelineReport([ + { + name: "a", + status: "passed", + duration: 10, + start: T0 * 1000, + stop: (T0 + 10) * 1000, + }, + ]); + expect(report.notes).toContain( + "Some start and stop times are in microseconds rather than milliseconds.", + ); + }); + + it("explains runs before a retry drawn in a lane of their own", () => { + const report = buildTimelineReport([ + makeTest("other test", 0, 1000, { threadId: "w1" }), + makeTest("flaky", 2000, 500, { + threadId: "w1", + retryAttempts: [ + { attempt: 1, status: "failed", start: T0 + 200, stop: T0 + 600 }, + ], + }), + ]); + expect(report.notes).toContain( + "1 run before a retry overlaps other tests on its thread (such runs do not record where they ran), so it is shown in a lane of its own.", + ); + expect(report.lanes.map((lane) => lane.name)).toEqual([ + "w1", + "Runs before a retry", + ]); + }); + + it("names skipped tests in the legend when one is drawn", () => { + const report = buildTimelineReport([ + makeTest("a", 0, 1000), + makeTest("b", 1000, 1000, { status: "skipped" }), + ]); + expect(report.legend).toContain("⬜ skipped or other"); + }); + + it("draws the other threads when one thread's start times were not measured", () => { + const tests: Test[] = []; + for (let worker = 1; worker <= 2; worker++) { + for (let index = 0; index < 10; index++) { + tests.push( + makeTest(`w${worker}-${index}`, index * 100, 90, { + threadId: `w${worker}`, + }), + ); + } + } + for (let index = 0; index < 25; index++) { + tests.push( + makeTest(`stamped ${index}`, 2000, 10 + index, { threadId: "w9" }), + ); + } + const report = buildTimelineReport(tests); + expect(report.hasData).toBe(true); + expect(report.notes).toContain( + "25 tests on `w9` are not shown: most tests there that took time start in the same millisecond, so their start times were not measured.", + ); + }); +}); + +describe("timeline at scale", () => { + it("keeps the red share close to the real share of failures when it has to merge", () => { + const { text, approximate } = renderTimelineGantt( + collectTimeline(bigRun(0.05)), + { maxDiagramChars: 8000 }, + ); + expect(text.length).toBeLessThanOrEqual(8000); + expect(approximate).toBe(true); + let red = 0; + let all = 0; + for (const lane of laneSpans(text)) { + for (const [, length] of lane) { + all += length; + } + } + for (const line of taskLines(text)) { + const match = line.match(/:crit, (?!milestone).*, (\d+)ms$/); + if (match) { + red += Number(match[1]); + } + } + expect(red / all).toBeLessThan(0.15); + }); + + it("counts every thread in the headline and the lanes it cannot draw in a note", () => { + const tests = Array.from({ length: 60 }, (_, index) => + makeTest(`t${index}`, 0, 1000 + index, { + threadId: `worker-${index}`, + status: index === 59 ? "failed" : "passed", + }), + ); + const report = buildTimelineReport(tests, { maxLanes: 10 }); + expect(report.headline.startsWith("**60** tests on **60** threads")).toBe( + true, + ); + expect(report.lanes.map((lane) => lane.name)).toContain("worker-59"); + expect(report.notes).toContain( + "50 more threads with 50 tests are not drawn.", + ); + }); + + it("lists failures from lanes it cannot draw first, and says how many are listed", () => { + const tests = Array.from({ length: 60 }, (_, index) => + makeTest(`t${index}`, 0, 1000 + index, { + threadId: `worker-${index}`, + status: index < 15 ? "failed" : "passed", + }), + ); + const report = buildTimelineReport(tests, { maxLanes: 10 }); + expect(report.notes).toContain( + "50 more threads with 50 tests are not drawn; their failures are listed in the test timings.", + ); + const failedRows = report.rows.filter((row) => row.status === "❌ failed"); + expect(failedRows).toHaveLength(15); + const capped = buildTimelineReport(tests, { maxLanes: 10, maxRows: 3 }); + expect(capped.notes).toContain( + "50 more threads with 50 tests are not drawn; 3 of their 5 failures are listed in the test timings.", + ); + expect(capped.rows.map((row) => row.name)).toEqual(["t2", "t3", "t4"]); + }); + + it("keeps thread lanes when inferring lanes would not fit either", () => { + const tests = Array.from({ length: 30 }, (_, index) => + makeTest(`t${index}`, 0, 1000, { threadId: `w${index}` }), + ); + const data = collectTimeline(tests, { maxLanes: 10 }); + expect(data.inferredLanes).toBe(false); + expect(data.lanes).toHaveLength(10); + expect(data.hiddenLanes).toHaveLength(20); + }); + + it("keeps the timings table small even with huge test names", () => { + const tests = Array.from({ length: 400 }, (_, index) => + makeTest(`${index} ${"long & ".repeat(220)}`, index * 10, 5, { + status: "failed", + threadId: "w1", + }), + ); + const report = buildTimelineReport(tests); + const tableSize = report.rows + .map((row) => `| ${Object.values(row).join(" | ")} |`) + .join("\n").length; + expect(tableSize).toBeLessThanOrEqual(10_000); + expect(report.mermaid.length).toBeLessThanOrEqual(20_000); + }); + + it("does not draw start times that were not measured", () => { + const tests = Array.from({ length: 30 }, (_, index) => + makeTest(`t${index}`, 0, 100 + index * 10), + ); + const report = buildTimelineReport(tests); + expect(report.hasData).toBe(false); + expect(report.message).toBe( + "Most of the 30 tests with start and stop times start in the same millisecond, so their start times were not measured and there is no timeline.", + ); + }); + + it("says so when every test took no time at the same instant", () => { + const report = buildTimelineReport([ + makeTest("a", 0, 0, { threadId: "w1" }), + makeTest("b", 0, 0, { threadId: "w2" }), + ]); + expect(report.hasData).toBe(false); + expect(report.message).toBe( + "Every test with start and stop times started and finished within the same millisecond, so there is no timeline.", + ); + expect( + buildTimelineReport([ + makeTest("a", 0, 0, { threadId: "w1" }), + makeTest("b", undefined, 10, { status: "failed" }), + ]).message, + ).toBe( + "The only test with start and stop times started and finished within the same millisecond, so there is no timeline. 1 other test without start and stop times is not shown.", + ); + }); + + it("tells very fast forks sharing a thread name apart", () => { + const random = seeded(5); + const tests: Test[] = []; + for (let fork = 0; fork < 4; fork++) { + let cursor = fork; + for (let index = 0; index < 500; index++) { + const length = Math.floor(random() * 4); + tests.push( + makeTest(`f${fork}-${index}`, cursor, length, { + threadId: "Test worker", + }), + ); + cursor += length; + } + } + const report = buildTimelineReport(tests); + expect(report.lanes.length).toBeGreaterThanOrEqual(4); + expect(report.headline).toContain("up to **4** at once"); + }); + + it("keeps lanes named like numbers in order", () => { + const { text } = renderTimelineGantt( + collectTimeline([ + makeTest("a", 0, 1000, { threadId: "1" }), + makeTest("b", 10, 1000, { threadId: "1" }), + makeTest("c", 0, 1000, { threadId: "2" }), + ]), + ); + expect(sections(text)).toEqual(["1", "1 (2)", "2"]); + }); + + it("draws smaller bars when there are many lanes", () => { + const tests = Array.from({ length: 25 }, (_, index) => + makeTest(`t${index}`, index * 10, 1000, { threadId: `w${index}` }), + ); + const { text } = renderTimelineGantt(collectTimeline(tests)); + expect(text).toContain("\n barHeight: 12\n barGap: 3\n"); + expect( + renderTimelineGantt(collectTimeline(tests.slice(0, 5))).text, + ).not.toContain("barHeight"); + }); + + it("shortens long lane names in the middle so their ends stay apart", () => { + const { text } = renderTimelineGantt( + collectTimeline( + [1, 2].map((index) => + makeTest(`t${index}`, 0, 1000, { + threadId: `ForkJoinPool-1-worker-thread-pool-for-integration-tests-${index}`, + }), + ), + ), + ); + const names = sections(text); + expect(names[0]).not.toBe(names[1]); + expect(names[0]).toMatch(/^ForkJoinPool.*….*tests-1$/); + expect(names[1]).toMatch(/tests-2$/); + }); + + it("names hidden lanes in the tables so that they stay apart", () => { + const tests = Array.from({ length: 45 }, (_, index) => + makeTest(`t${index}`, 0, 1000 + (index < 40 ? 100 : 0), { + threadId: `com.example.integration.ParallelSuiteRunner-worker-${String(index + 1).padStart(2, "0")}`, + status: index >= 40 ? "failed" : "passed", + }), + ); + const report = buildTimelineReport(tests, { maxLanes: 40 }); + const lanes = report.rows + .filter((row) => row.status === "❌ failed") + .map((row) => row.lane); + expect(new Set(lanes).size).toBe(lanes.length); + }); + + it("writes every date on the 16th with exactly three digits of milliseconds", () => { + const { text } = renderTimelineGantt(collectTimeline(bigRun(0.02))); + for (const line of text.split("\n").filter((l) => l.startsWith(ZWSP))) { + expect(line).toMatch(/[ :]16 \d\d:\d\d:\d\d\.\d{3}, \d+ms$/); + } + }); + + it("uses the duration when the stop only repeats the start", () => { + const data = collectTimeline([ + { name: "a", status: "passed", duration: 250, start: T0, stop: T0 }, + ]); + expect(data.lanes[0].executions[0].stop).toBe(T0 + 250); + }); + + it("handles 200,000 executions in reasonable time", () => { + const random = seeded(9); + const tests: Test[] = []; + for (let lane = 0; lane < 32; lane++) { + let cursor = 0; + for (let index = 0; index < 6250; index++) { + const length = 1 + Math.floor(random() * 30); + tests.push( + makeTest(`t${lane}-${index}`, cursor, length, { + threadId: `w${lane}`, + status: random() < 0.01 ? "failed" : "passed", + }), + ); + cursor += length + Math.floor(random() * 3); + } + } + const started = performance.now(); + const report = buildTimelineReport(tests); + expect(performance.now() - started).toBeLessThan(8000); + expect(report.mermaid.length).toBeLessThanOrEqual(20_000); + }); +}); + +describe("what GitHub's diagram viewer does to the text", () => { + it("neutralises character references, which the viewer decodes before Mermaid parses", () => { + const { text } = renderTimelineGantt( + collectTimeline([ + makeTest("renders as a line break : ©", 0, 60_000, { + threadId: "pool thread", + }), + ]), + ); + expect(text).not.toContain("&"); + const [line] = taskLines(text); + expect(line.slice(1, line.lastIndexOf(" :"))).toBe( + "renders &#10, as a line break &#58 &copy", + ); + expect(sections(text)).toEqual(["pool&#10thread"]); + }); + + it("survives thread IDs named like object properties", () => { + const names = ["constructor", "__proto__", "toString", "hasOwnProperty"]; + const { text } = renderTimelineGantt( + collectTimeline( + names.map((threadId, index) => + makeTest(`t${index}`, index, 1000, { threadId }), + ), + ), + ); + expect(sections(text)).toEqual([ + "__proto__", + "constructor", + "hasOwnProperty", + "toString", + ]); + for (const line of text + .split("\n") + .filter((l) => l.startsWith("section "))) { + expect(line.startsWith(`section ${ZWSP}`)).toBe(true); + } + }); + + it("measures symbols that browsers draw as emoji generously", () => { + const symbols = "✓✗★⚡⭐✅❌".repeat(2); + const { text } = renderTimelineGantt( + collectTimeline([ + makeTest(symbols, 0, 10_000), + makeTest("rest", 10_000, 50_000), + ]), + ); + // The bar is about 150px wide: room for 14 letters, not for 14 emoji. + expect(taskLines(text)[0]).toMatch(/^\u200b :/); + }); +}); + +describe("Go reports", () => { + it("keeps a same-named test from another package that has no subtests", () => { + const data = collectTimeline([ + makeTest("TestParse", 0, 1500, { status: "failed", suite: ["alpha"] }), + makeTest("TestParse", 0, 500, { suite: ["beta"] }), + makeTest("TestParse/empty", 0, 200, { suite: ["beta"] }), + makeTest("TestParse/unicode", 200, 300, { suite: ["beta"] }), + ]); + expect(data.parents).toBe(1); + expect(data.tests).toBe(3); + const failed = data.lanes + .flatMap((lane) => lane.executions) + .filter((e) => e.kind === "failed"); + expect(failed.map((e) => e.scope)).toEqual([JSON.stringify(["", "alpha"])]); + }); + + it("recognises subtests whose case names hold slashes", () => { + const data = collectTimeline([ + makeTest("TestHandler", 0, 182, { status: "failed" }), + makeTest("TestHandler/GET_/health", 0, 40), + makeTest("TestHandler/GET_/users", 40, 40), + makeTest("TestHandler/POST_/users", 80, 50, { status: "failed" }), + makeTest("TestHandler/GET_/users/{id}", 130, 52), + makeTest("TestOther", 182, 100), + ]); + expect(data.parents).toBe(1); + expect(data.lanes).toHaveLength(1); + }); + + it("keeps a parent that failed while its subtests passed: it failed on its own", () => { + const data = collectTimeline([ + makeTest("TestFlow", 0, 556, { status: "failed" }), + makeTest("TestFlow/a", 0, 100), + makeTest("TestFlow/b", 100, 100), + makeTest("TestFlow/c", 200, 56), + ]); + expect(data.parents).toBe(0); + expect(data.tests).toBe(4); + }); + + it("never takes other frameworks' path-like names for parent tests", () => { + const data = collectTimeline([ + makeTest("/docs", 0, 800, { status: "failed" }), + makeTest("/docs/page-0", 100, 300), + makeTest("Users API GET /users", 0, 800, { + threadId: "w2", + status: "failed", + }), + makeTest("Users API GET /users/:id", 100, 300, { threadId: "w2" }), + ]); + expect(data.parents).toBe(0); + expect(data.tests).toBe(4); + }); +}); + +describe("whole-second times", () => { + const S = Math.floor(T0 / 1000) * 1000; + + it("recognises whole seconds written in milliseconds by their durations", () => { + const tests = Array.from({ length: 30 }, (_, index) => ({ + name: `t${index}`, + status: "passed" as const, + duration: 50, + start: S + Math.floor((index * 50) / 1000) * 1000, + stop: S + Math.floor((index * 50 + 50) / 1000) * 1000, + })); + const data = collectTimeline(tests); + expect(data.coarse).toBe(true); + expect(data.unmeasured.tests).toBe(0); + expect(data.lanes).toHaveLength(1); + expect(data.stop - data.start).toBe(1500); + }); + + it("keeps round times in milliseconds exact", () => { + const data = collectTimeline([ + makeTest("a", 0, 1000, { threadId: "w1" }), + makeTest("b", 0, 2000, { threadId: "w2" }), + makeTest("c", 1000, 1000, { threadId: "w1" }), + ]); + expect(data.coarse).toBe(false); + expect(data.lanes[0].executions.map((e) => e.start - T0)).toEqual([ + 0, 1000, + ]); + }); + + it("is not fooled by one whole second among fractional seconds", () => { + const tests = Array.from({ length: 200 }, (_, index) => { + const start = (T0 + index * 997 + 13) / 1000; + return { + name: `t${index}`, + status: "passed" as const, + duration: 900, + start: index === 50 ? Math.round(start) : start, + stop: (T0 + index * 997 + 913) / 1000, + }; + }); + const data = collectTimeline(tests); + expect(data.coarse).toBe(false); + expect(data.lanes).toHaveLength(1); + }); + + it("keeps parallel workers apart when there are no thread IDs", () => { + const tests = []; + for (let worker = 0; worker < 4; worker++) { + for (let index = 0; index < 10; index++) { + const at = S + worker * 77 + index * 930; + tests.push({ + name: `w${worker}-${index}`, + status: "passed" as const, + duration: 900, + start: Math.floor(at / 1000) * 1000, + stop: Math.floor((at + 900) / 1000) * 1000, + }); + } + } + const data = collectTimeline(tests); + expect(data.coarse).toBe(true); + // Whole seconds cannot tell which tests of a second ran one after another, + // so a lane more than there were workers is possible; never fewer. + expect(data.lanes.length).toBeGreaterThanOrEqual(4); + expect(data.lanes.length).toBeLessThanOrEqual(5); + expect(data.stop - data.start).toBeLessThan(11_000); + }); + + it("lays the tests of a second out in the order of the report", () => { + const data = collectTimeline( + ["setup_db", "query", "cleanup"].map((name, index) => ({ + name, + testId: `id-${9 - index}`, + status: "passed" as const, + duration: 200, + start: S, + stop: S, + threadId: "gw0", + })), + ); + expect(data.lanes[0].executions.map((e) => e.name)).toEqual([ + "setup_db", + "query", + "cleanup", + ]); + }); + + it("never draws a test past the line of a cut", () => { + const tests = [0, HOUR].flatMap((offset, run) => + Array.from({ length: 20 }, (_, index) => ({ + name: `run${run} test ${index}`, + status: "passed" as const, + duration: 100, + start: S + offset + Math.floor((index * 100) / 1000) * 1000, + stop: S + offset + Math.floor((index * 100 + 100) / 1000) * 1000, + threadId: "w1", + })), + ); + const data = collectTimeline(tests); + expect(data.cuts).toHaveLength(1); + const [cut] = data.cuts; + for (const execution of data.lanes[0].executions) { + expect(execution.stop <= cut.at || execution.start >= cut.at).toBe(true); + } + const report = buildTimelineReport(tests); + const late = report.rows.find((row) => row.name === "run0 test 12"); + expect(late?.start).toBe("0:00:01.200"); + }); +}); + +describe("runs in one report", () => { + it("keeps a later session made mostly of retries", () => { + const tests: Test[] = Array.from({ length: 40 }, (_, index) => + makeTest(`test_${index}`, index * 100, 90, { + threadId: `gw${index % 2}`, + status: index < 2 ? "failed" : "passed", + }), + ); + for (const name of ["test_0", "test_1"]) { + tests.push( + makeTest(name, 15 * 60_000 + (name === "test_1" ? 2000 : 0), 100, { + threadId: "gw0", + status: "failed", + retryAttempts: Array.from({ length: 15 }, (_, attempt) => ({ + attempt: attempt + 1, + status: "failed" as const, + start: T0 + 15 * 60_000 - 1600 + attempt * 100, + stop: T0 + 15 * 60_000 - 1510 + attempt * 100, + })), + }), + ); + } + const data = collectTimeline(tests); + expect(data.history).toBe(0); + expect(data.tests).toBe(40); + expect(data.rerun).toBe(2); + const failed = data.lanes + .flatMap((lane) => lane.executions) + .filter((e) => e.kind === "failed"); + expect(failed).toHaveLength(2); + }); + + it("keeps the results of a shard that did not run again", () => { + const tests: Test[] = []; + for (let shard = 1; shard <= 12; shard++) { + tests.push( + makeTest(`shard ${shard}`, 0, 60_000, { threadId: `s${shard}` }), + ); + if (shard < 12) { + tests.push( + makeTest(`shard ${shard}`, 2 * HOUR, 60_000, { + threadId: `s${shard}`, + }), + ); + } + } + const data = collectTimeline(tests); + expect(data.history).toBe(11); + expect(data.tests).toBe(12); + const twelve = data.lanes.find((lane) => lane.name === "s12"); + expect(twelve?.executions).toHaveLength(1); + }); + + it("does not count the space left at a cut as idle time", () => { + const tests = [0, 40 * 60_000].flatMap((offset, run) => + ["w1", "w2"].flatMap((threadId) => + Array.from({ length: 20 }, (_, index) => + makeTest( + `run${run} ${threadId} ${index}`, + offset + index * 30_000, + 30_000, + { + threadId, + }, + ), + ), + ), + ); + const report = buildTimelineReport(tests); + expect(report.headline).toContain("in **20m** · busy **100%** of the time"); + expect(report.lanes[0]).toMatchObject({ idle: "0ms", utilization: "100%" }); + }); +}); + +describe("large reports", () => { + it("draws a stretch of 130,000 tests that follows an idle moment", () => { + const tests: Test[] = [makeTest("smoke", 0, 10, { threadId: "w0" })]; + for (let worker = 0; worker < 8; worker++) { + for (let index = 0; index < 16_250; index++) { + tests.push( + makeTest(`w${worker}-${index}`, 15 + worker + index * 2, 2, { + threadId: `w${worker}`, + }), + ); + } + } + const report = buildTimelineReport(tests); + expect(report.hasData).toBe(true); + expect(vi.mocked(core.warning)).not.toHaveBeenCalled(); + }); + + it("draws a thread whose lanes hold more than 130,000 tests", () => { + const tests: Test[] = [makeTest("Suite", 0, 270_000, { threadId: "main" })]; + for (let index = 0; index < 130_000; index++) { + tests.push(makeTest(`t${index}`, index * 2 + 1, 2, { threadId: "main" })); + } + const report = buildTimelineReport(tests); + expect(report.hasData).toBe(true); + expect(vi.mocked(core.warning)).not.toHaveBeenCalled(); + }); + + it("places thousands of runs before a retry quickly", () => { + const tests = Array.from({ length: 40_000 }, (_, index) => + makeTest(`t${index}`, index % 3, 1, { + threadId: "w1", + retryAttempts: [ + { attempt: 1, status: "failed", start: T0 + 5, stop: T0 + 6 }, + ], + }), + ); + const started = performance.now(); + collectTimeline(tests); + expect(performance.now() - started).toBeLessThan(3000); + }); +}); + +describe("chart details", () => { + it("keeps failures visible in very short runs", () => { + const tests: Test[] = []; + for (let index = 0; index < 24; index++) { + tests.push( + makeTest(`pass ${index}`, index * 9, 8, { threadId: "w1" }), + ...(index % 2 === 0 + ? [ + makeTest(`fail ${index}`, index * 9 + 8, 0, { + threadId: "w1", + status: "failed" as const, + }), + ] + : []), + ); + } + const { text } = gantt(tests); + const failures = text.split("\n").filter((line) => line.includes(":crit,")); + expect(failures).toHaveLength(12); + for (const line of failures) { + expect(line.includes("milestone") || !line.endsWith(", 0ms")).toBe(true); + } + }); + + it("keeps idle time idle when it merges bars", () => { + const tests: Test[] = [ + makeTest("warm up cache", 0, 300, { threadId: "w0" }), + makeTest("late check", 22_000, 300, { threadId: "w0" }), + ]; + for (let worker = 1; worker <= 12; worker++) { + for (let index = 0; index < 400; index++) { + tests.push( + makeTest(`w${worker}-${index}`, index * 56, 55, { + threadId: `w${worker}`, + status: index % 12 === 0 ? "failed" : "passed", + }), + ); + } + } + const [lane] = laneSpans(gantt(tests).text); + for (const [start, length] of lane) { + expect(start >= 22_000 || start + length <= 300).toBe(true); + } + }); + + it("draws a long failure as a bar, also when it has to merge", () => { + const tests: Test[] = []; + for (let worker = 1; worker <= 12; worker++) { + for (let index = 0; index < 400; index++) { + tests.push( + makeTest(`w${worker}-${index}`, index * 56, 55, { + threadId: `w${worker}`, + status: index % 12 === 0 ? "failed" : "passed", + }), + ); + } + } + for (let index = 0; index < 20; index++) { + tests.push( + makeTest( + index === 10 ? "payment times out" : `w0-${index}`, + index * 1100, + index === 10 ? 1500 : 1000, + { threadId: "w0", status: index === 10 ? "failed" : "passed" }, + ), + ); + } + const { text } = gantt(tests); + const lane = text.split("\nsection ")[1].split("\n"); + const failure = lane.find((line) => line.includes(":crit,")); + expect(failure).toMatch(/:crit, 16 00:00:11\.000, 1500ms$/); + }); + + it("does not repaint passes after a long skipped test", () => { + const tests: Test[] = [ + makeTest("skipped after setup", 0, 180_000, { + threadId: "w1", + status: "skipped", + }), + ]; + for (let index = 0; index < 300; index++) { + tests.push( + makeTest(`p${index}`, 180_000 + index * 500, 500, { threadId: "w1" }), + ); + } + tests.push(makeTest("long", 0, 330_000, { threadId: "w2" })); + const { text, kinds } = gantt(tests); + expect(kinds).toEqual(["passed", "other"]); + const [lane] = laneSpans(text); + const lines = text.split("\nsection ")[1].split("\n"); + expect( + lines.some((line) => /:done, 16 00:00:00\.000, 18\d{4}ms$/.test(line)), + ).toBe(true); + expect(lane.length).toBeGreaterThan(2); + }); + + it("draws failures that sit close together as slivers, so the passes between stay", () => { + const tests: Test[] = []; + for (let index = 0; index < 8; index++) { + tests.push( + makeTest(`fail ${index}`, 20_000 + index * 1700, 5, { + threadId: "w1", + status: "failed", + }), + makeTest(`pass ${index}`, 20_005 + index * 1700, 1695, { + threadId: "w1", + }), + ); + } + tests.push(makeTest("long", 0, 60_000, { threadId: "w2" })); + const { text } = gantt(tests); + expect(text).not.toContain("milestone"); + const passes = laneSpans(text)[0].filter(([, length]) => length > 1000); + expect(passes).toHaveLength(8); + }); +}); + +describe("report text", () => { + it("calls hidden lanes lanes when their threads are drawn", () => { + const tests = Array.from({ length: 30 }, (_, worker) => [ + makeTest(`class ${worker}`, 0, 14_000, { threadId: `worker-${worker}` }), + ...Array.from({ length: 15 }, (_, index) => + makeTest(`t${worker}-${index}`, index * 1000, 1000, { + threadId: `worker-${worker}`, + }), + ), + ]).flat(); + const report = buildTimelineReport(tests); + expect(report.headline).toContain("on **30** threads in **60** lanes"); + expect(report.notes).toContain( + "20 more lanes with 20 tests are not drawn.", + ); + }); + + it("says the highlight times are UTC for runs of a day or more", () => { + const report = buildTimelineReport([ + makeTest("soak", 0, 26 * HOUR, { threadId: "w1" }), + makeTest("quick", 26 * HOUR, 500, { threadId: "w1", status: "failed" }), + ]); + expect(report.highlights).toContain("at 10-22 10:16:56.500 UTC"); + expect(report.startHeader).toBe("Start (UTC)"); + }); + + it("keeps GitHub references, math and emoji codes in table cells as written", () => { + const report = buildTimelineReport([ + makeTest("GH-123 regression and gh-7", 0, 10, { threadId: "w1" }), + makeTest("expands $(pwd) and $(ls)", 10, 10, { threadId: "w1" }), + makeTest("renders :warning: icon", 20, 10, { threadId: "w1" }), + ]); + expect(report.rows.map((row) => row.name)).toEqual([ + "GH\u2060-123 regression and gh\u2060-7", + "expands $(pwd) and $(ls)", + "renders :\u2060warning: icon", + ]); + }); + + it("explains a report whose tests have no times or broken ones", () => { + const report = buildTimelineReport([ + makeTest("a", undefined, 10), + { + name: "b", + status: "passed", + duration: Number.NaN, + start: T0 + 9, + stop: T0, + }, + ]); + expect(report.message).toBe( + "No test in this report has start and stop times that can be placed on a timeline: 1 test has none, and 1 stop before they start or are not plausible dates.", + ); + }); + + it("says the chart is left out to keep the summary small, and leaves out what only the chart shows", () => { + const tests = [0, 2 * HOUR].flatMap((offset) => + Array.from({ length: 100 }, (_, index) => + makeTest(`t${index}`, offset + index * 10, 10, { + threadId: "w1", + status: index % 2 === 0 ? "failed" : "passed", + testId: `${offset}-${index}`, + }), + ), + ); + const report = buildTimelineReport(tests, { maxDiagramChars: 300 }); + expect(report.mermaid).toBe(""); + expect(report.notes).toContain( + "The chart would be too large for this summary, so it is left out.", + ); + expect(report.notes.join(" ")).not.toContain("gray line"); + }); + + it("counts the failures among tests whose start times were not measured", () => { + const tests: Test[] = Array.from({ length: 10 }, (_, index) => + makeTest(`w1-${index}`, index * 100, 90, { threadId: "w1" }), + ); + for (let index = 0; index < 25; index++) { + tests.push( + makeTest(`stamped ${index}`, 2000, 10 + index, { + threadId: "w9", + status: index < 3 ? "failed" : "passed", + }), + ); + } + const report = buildTimelineReport(tests); + expect(report.notes[0]).toBe( + "25 tests on `w9` are not shown (3 of them failed): most tests there that took time start in the same millisecond, so their start times were not measured.", + ); + }); + + it("tells long thread names apart in the tables", () => { + const base = "integration-tests-runner-node-alpha-0001-shard-"; + const report = buildTimelineReport( + ["west", "east", "north"].map((region, index) => + makeTest(`t${index}`, 0, 1000, { + threadId: `${base}${region}-europe-zone-b-000123-and-more-text`, + }), + ), + ); + const names = report.lanes.map((lane) => lane.name); + expect(new Set(names).size).toBe(3); + expect(names.every((name) => !name.includes("["))).toBe(true); + }); +}); + +describe("invariants", () => { + /** Lanes of [start, length, failure] triples, as offsets from 0:00. */ + function bars(text: string): Array> { + const lanes: Array> = []; + for (const line of text.split("\n")) { + if (line.startsWith("section ")) { + lanes.push([]); + continue; + } + const match = line.match(/ (\d\d):(\d\d):(\d\d)\.(\d{3}), (\d+)ms$/); + if (match && line.startsWith(ZWSP) && !line.includes(":vert,")) { + const [, h, m, s, ms, length] = match.map(Number); + lanes[lanes.length - 1].push([ + ((h * 60 + m) * 60 + s) * 1000 + ms, + length, + /:(crit|active),/.test(line), + ]); + } + } + return lanes; + } + + it("never draws a pass over a failure wide enough to see", () => { + const data = collectTimeline(bigRun(0.05, seeded(17))); + const gantt = renderTimelineGantt(data); + expect(gantt.approximate).toBe(false); + const msPerPx = (data.stop - data.start) / 885; + bars(gantt.text).forEach((lane, index) => { + for (const failure of data.lanes[index].executions) { + if ( + failure.kind !== "failed" || + failure.stop - failure.start < 2 * msPerPx + ) { + continue; + } + const middle = (failure.start + failure.stop) / 2 - data.start; + const covering = lane.find( + ([start, length, failed]) => + !failed && start < middle && start + length > middle, + ); + expect(covering).toBeUndefined(); + } + }); + }); + + it("counts a report and a copy with use-suite-name prefixes once", () => { + const raw = [ + makeTest("opens", 0, 100, { suite: ["Checkout"], threadId: "w1" }), + makeTest("pays", 100, 100, { suite: ["Checkout"], threadId: "w1" }), + ]; + const prefixed = raw.map((test) => ({ + ...test, + name: `Checkout - Checkout - ${test.name}`, + })); + const data = collectTimeline([...raw, ...prefixed]); + expect(data.tests).toBe(2); + expect(data.duplicates).toBe(2); + }); +}); + +describe("numbered bars", () => { + /** Two forks of 30 tests of 0.2-1.7s: no bar is wide enough for a name. */ + function forks(): Test[] { + const tests: Test[] = []; + for (let fork = 0; fork < 2; fork++) { + let cursor = fork * 37; + for (let index = 0; index < 30; index++) { + const length = 200 + ((index * 97 + fork * 31) % 1500); + tests.push( + makeTest(`fork${fork} Test${index}`, cursor, length, { + threadId: "Test worker", + }), + ); + cursor += length + 3; + } + } + return tests; + } + + /** Numbered bars of the chart: number, lane index, start offset and length. */ + function numbered(text: string) { + const bars: Array<{ + number: string; + lane: number; + start: number; + length: number; + }> = []; + let lane = -1; + for (const line of text.split("\n")) { + if (line.startsWith("section ")) { + lane++; + continue; + } + const match = line.match( + /^\u200b(\d+) :(?:[a-z]+, )*16 (\d\d):(\d\d):(\d\d)\.(\d{3}), (\d+)ms$/, + ); + if (match) { + const [, number, h, m, s, ms, length] = match; + bars.push({ + number, + lane, + start: ((+h * 60 + +m) * 60 + +s) * 1000 + +ms, + length: +length, + }); + } + } + return bars; + } + + it("numbers bars too narrow for their name, as rows of the timings table", () => { + const report = buildTimelineReport(forks()); + expect(report.showNumbers).toBe(true); + const bars = numbered(report.mermaid); + expect(bars.length).toBeGreaterThan(30); + const rows = report.rows.filter((row) => row.number !== ""); + expect(rows.map((row) => row.number)).toEqual( + bars.map((_, index) => String(index + 1)), + ); + const laneNames = ["Test worker", "Test worker (2)"]; + for (const bar of bars) { + const row = rows.find((candidate) => candidate.number === bar.number); + expect(row?.lane).toBe(laneNames[bar.lane]); + expect(row?.start).toBe(formatClockForTest(bar.start)); + } + expect(report.notes).toContain( + "A number on a bar is the row with that number (#) in the test timings below.", + ); + }); + + it("writes each number only where it fits inside its bar", () => { + const data = collectTimeline(forks()); + const report = buildTimelineReport(forks()); + const padding = Number(report.mermaid.match(/leftPadding: (\d+)/)?.[1]); + const msPerPx = (data.stop - data.start) / (1000 - padding - 40); + for (const bar of numbered(report.mermaid)) { + expect(textWidth(bar.number)).toBeLessThanOrEqual( + bar.length / msPerPx - 8, + ); + } + }); + + it("keeps names where they fit, and numbers neither merged bars nor markers", () => { + const tests = [ + makeTest("a test with a name that fits easily", 0, 20_000, { + threadId: "w1", + }), + makeTest("narrow", 20_000, 1200, { threadId: "w1" }), + makeTest("rest one", 21_200, 18_800, { threadId: "w1" }), + makeTest("fails at once", 40_000, 0, { + threadId: "w1", + status: "failed", + }), + makeTest("rest two", 41_000, 4000, { threadId: "w1" }), + ...Array.from({ length: 50 }, (_, index) => + makeTest(`quick ${index}`, 45_000 + index * 10, 9, { threadId: "w1" }), + ), + makeTest("rest three", 45_500, 14_500, { threadId: "w1" }), + ]; + const report = buildTimelineReport(tests); + const lines = taskLines(report.mermaid); + expect(lines[0]).toMatch(/^\u200ba test with a name that fits easily :/); + expect(lines).toContain(`${ZWSP}1 :16 00:00:20.000, 1200ms`); + expect(report.rows.find((row) => row.number === "1")?.name).toBe("narrow"); + expect(lines.find((line) => line.includes("milestone"))).toMatch( + /^\u200b :crit, milestone, /, + ); + expect(lines.find((line) => line.includes(":16 00:00:45.000, "))).toMatch( + /^\u200b :16 00:00:45\.000, \d+ms$/, + ); + expect(report.rows.filter((row) => row.number !== "")).toHaveLength(1); + }); + + it("numbers only the bars the table has rows for", () => { + const report = buildTimelineReport(forks(), { maxRows: 5 }); + expect(report.rows).toHaveLength(5); + expect(numbered(report.mermaid).map((bar) => bar.number)).toEqual([ + "1", + "2", + "3", + "4", + "5", + ]); + expect(report.rowsTitle).toBe("Test timings (5 of 60: numbered bars)"); + }); + + it("numbers failed bars too", () => { + const tests = forks().map((test, index) => + index === 10 ? { ...test, status: "failed" as const } : test, + ); + const report = buildTimelineReport(tests); + const failed = report.rows.find((row) => row.name === "fork0 Test10"); + expect(failed?.number).not.toBe(""); + expect(report.mermaid).toContain(`\n${ZWSP}${failed?.number} :crit, 16 `); + }); + + it("leaves the # column out when no bar needs a number", () => { + const report = buildTimelineReport([ + makeTest("a long test with its name on the bar", 0, 60_000, { + threadId: "w1", + }), + ]); + expect(report.showNumbers).toBe(false); + expect(report.rows[0].number).toBe(""); + }); + + it("keeps the chart within its budget with the numbers written", () => { + const tests: Test[] = []; + for (let lane = 0; lane < 12; lane++) { + for (let index = 0; index < 30; index++) { + tests.push( + makeTest(`lane ${lane} test ${index}`, index * 2000, 1990, { + threadId: `w${lane}`, + }), + ); + } + } + for (const maxDiagramChars of [4000, 8000, 12_000, 20_000]) { + const report = buildTimelineReport(tests, { maxDiagramChars }); + expect(report.mermaid.length).toBeLessThanOrEqual(maxDiagramChars); + } + const report = buildTimelineReport(tests); + expect(numbered(report.mermaid)).toHaveLength(99); + }); +}); + +function formatClockForTest(offset: number): string { + const minutes = Math.floor(offset / 60_000); + const seconds = String(Math.floor(offset / 1000) % 60).padStart(2, "0"); + return `${minutes}:${seconds}.${String(offset % 1000).padStart(3, "0")}`; +} + +describe("numbered bars, edge cases", () => { + it("writes a test's number on one bar only, and none for a test whose name is shown", () => { + const tests: Test[] = []; + for (let index = 0; index < 12; index++) { + const at = index * 3020; + tests.push( + makeTest(`fail ${index}`, at, 10, { threadId: "w1", status: "failed" }), + makeTest(`a test with a long name number ${index}`, at + 10, 3010, { + threadId: "w1", + }), + ); + } + for (let lane = 2; lane <= 6; lane++) { + for (let index = 0; index < 40; index++) { + tests.push( + makeTest(`l${lane} ${index}`, index * 900, 890, { + threadId: `w${lane}`, + status: index % 7 === 3 ? "failed" : "passed", + }), + ); + } + } + for (const maxDiagramChars of [2500, 3000, 4000, 6000, 20_000]) { + const report = buildTimelineReport(tests, { maxDiagramChars }); + const numbers = report.mermaid.match(/\n\u200b\d+ :/g) ?? []; + expect(new Set(numbers).size).toBe(numbers.length); + const named = new Set( + [...report.mermaid.matchAll(/\n\u200b([^\n:]+?) :/g)].map((m) => m[1]), + ); + for (const row of report.rows.filter((row) => row.number !== "")) { + expect(named.has(row.name)).toBe(false); + } + } + }); + + it("ranks only tests whose bars get a number above retried failures and the slowest", () => { + const tests: Test[] = []; + for (const threadId of ["w0", "w1"]) { + for (let index = 0; index < 50; index++) { + tests.push( + makeTest(`short test ${threadId}-${index}`, index * 2000, 2000, { + threadId, + }), + ); + } + } + for (let index = 0; index < 5; index++) { + tests.push( + makeTest(`slow ${index}`, index * 20_000, 19_000, { threadId: "w2" }), + ); + } + tests.push( + makeTest("flaky", 30_000, 10_000, { + threadId: "w3", + retryAttempts: [0, 1, 2].map((attempt) => ({ + attempt: attempt + 1, + status: "failed" as const, + start: T0 + attempt * 10_000, + stop: T0 + attempt * 10_000 + 10_000, + })), + }), + ); + const report = buildTimelineReport(tests); + expect(report.rows.filter((row) => row.number !== "")).toHaveLength(9); + expect( + report.rows.filter((row) => row.name.startsWith("slow ")), + ).toHaveLength(5); + expect( + report.rows.filter((row) => row.name.includes("(attempt ")), + ).toHaveLength(3); + expect(report.rowsTitle).toBe( + "Test timings (100 of 109: numbered bars, retried failures and the slowest)", + ); + }); + + it("quotes a test name made of digits, so it does not read as a number", () => { + const report = buildTimelineReport([ + makeTest("2", 0, 3000, { threadId: "w0" }), + makeTest("checkout rejects an expired card", 3000, 300, { + threadId: "w0", + status: "failed", + }), + makeTest("rest", 3300, 6000, { threadId: "w0" }), + ]); + expect(report.mermaid).toContain(`\n${ZWSP}"2" :16 00:00:00.000, 3000ms\n`); + }); + + it("does not make the chart coarser to leave room for numbers", () => { + const tests: Test[] = []; + for (let lane = 0; lane < 12; lane++) { + for (let index = 0; index < 20; index++) { + tests.push( + makeTest(`lane ${lane} test ${index}`, index * 3000, 2990, { + threadId: `w${lane}`, + }), + ); + } + } + const roomy = buildTimelineReport(tests, { maxDiagramChars: 1_000_000 }); + expect(roomy.showNumbers).toBe(true); + // The same chart without its numbers: the one that has to fit the budget. + const plain = roomy.mermaid.replace(/\n\u200b\d+ :/g, `\n${ZWSP} :`); + const tight = buildTimelineReport(tests, { maxDiagramChars: plain.length }); + expect(tight.showNumbers).toBe(false); + expect(tight.mermaid).toBe(plain); + }); +}); diff --git a/__tests__/github/timeline-report.test.ts b/__tests__/github/timeline-report.test.ts new file mode 100644 index 00000000..1564b464 --- /dev/null +++ b/__tests__/github/timeline-report.test.ts @@ -0,0 +1,166 @@ +import * as core from "@actions/core"; +import type { CTRFReport } from "ctrf"; +import { generateViews } from "../../src/github/core.js"; +import { DEFAULT_REPORT_ORDER } from "../../src/reports/constants.js"; +import type { Inputs, ReportConditionals } from "../../src/types/index.js"; +import { + isAnyReportEnabled, + numberOfReportsEnabled, + reportTypeToInputKey, +} from "../../src/utils/report-utils.js"; + +vi.mock("@actions/core"); +vi.mock("@actions/github", () => ({ + context: { + serverUrl: "https://github.com", + repo: { owner: "test-owner", repo: "test-repo" }, + sha: "abc123", + payload: {}, + }, +})); + +const T0 = 1_792_570_616_000; + +function inputs(overrides: Partial = {}): Inputs { + return { + ctrfPath: "ctrf/*.json", + summary: true, + pullRequest: false, + issue: "", + issueRepo: "", + collapseLargeReports: false, + summaryReport: false, + summaryDeltaReport: false, + testsChangedReport: false, + githubReport: false, + testReport: false, + testListReport: false, + failedReport: false, + failRateReport: false, + flakyReport: false, + flakyRateReport: false, + failedFoldedReport: false, + previousResultsReport: false, + aiReport: false, + aiSummaryReport: false, + skippedReport: false, + suiteFoldedReport: false, + suiteListReport: false, + pullRequestReport: false, + commitReport: false, + customReport: false, + insightsReport: false, + slowestReport: false, + communityReport: false, + communityReportName: "", + fileReport: false, + timelineReport: false, + artifactName: "ctrf-report", + annotate: false, + title: "", + onFailOnly: false, + exitOnNoFiles: false, + exitOnEmpty: false, + exitOnFail: false, + useSuiteName: false, + previousResultsMax: 10, + flakyRateReportMax: -1, + failRateReportMax: -1, + metricsReportsMax: 100, + maxWorkflowRunsToCheck: 400, + maxPreviousRunsToFetch: 100, + fetchPreviousResults: false, + updateComment: false, + overwriteComment: false, + alwaysLatestComment: false, + commentTag: "", + writeCtrfToFile: "", + uploadArtifact: false, + groupBy: "filePath", + alwaysGroupBy: false, + integrationsConfig: {}, + ai: {}, + statusCheck: false, + statusCheckName: "Test Reporter Results", + reportOrder: [], + ...overrides, + }; +} + +function report(): CTRFReport { + return { + reportFormat: "CTRF", + specVersion: "0.2.0", + results: { + tool: { name: "jest" }, + summary: { + tests: 1, + passed: 1, + failed: 0, + skipped: 0, + pending: 0, + other: 0, + start: T0, + stop: T0 + 1000, + }, + tests: [ + { + name: "a", + status: "passed", + duration: 1000, + start: T0, + stop: T0 + 1000, + threadId: "w1", + }, + ], + }, + extra: { + reportConditionals: { + includeFailedReportCurrentFooter: false, + includeFailedReportAllFooter: false, + includeFlakyReportCurrentFooter: false, + includeFlakyReportAllFooter: false, + includeSkippedReportCurrentFooter: false, + includeMeasuredOverFooter: false, + showFailedReports: false, + showFlakyReports: false, + showSkippedReports: false, + } as ReportConditionals, + }, + }; +} + +describe("timeline-report", () => { + const mockCore = vi.mocked(core); + + beforeEach(() => { + vi.clearAllMocks(); + mockCore.summary.addRaw.mockReturnValue(mockCore.summary); + mockCore.summary.addEOL.mockReturnValue(mockCore.summary); + }); + + it("maps the report type to its input", () => { + expect(reportTypeToInputKey("timeline-report")).toBe("timelineReport"); + }); + + it("counts as an enabled report", () => { + expect(isAnyReportEnabled(inputs({ timelineReport: true }))).toBe(true); + expect(numberOfReportsEnabled(inputs({ timelineReport: true }))).toBe(1); + }); + + it("is ordered after the slowest tests report by default", () => { + expect(DEFAULT_REPORT_ORDER.indexOf("timeline-report")).toBe( + DEFAULT_REPORT_ORDER.indexOf("slowest-report") + 1, + ); + }); + + it("adds a Timeline section to the summary", () => { + generateViews(inputs({ timelineReport: true }), report()); + + const raw = mockCore.summary.addRaw.mock.calls.map(([text]) => text); + const heading = raw.indexOf("### Timeline"); + expect(heading).toBeGreaterThanOrEqual(0); + expect(raw[heading + 1]).toContain("```mermaid"); + expect(raw[heading + 1]).toContain("section \u200bw1"); + }); +}); diff --git a/__tests__/reports/timeline.test.ts b/__tests__/reports/timeline.test.ts new file mode 100644 index 00000000..4df91df9 --- /dev/null +++ b/__tests__/reports/timeline.test.ts @@ -0,0 +1,207 @@ +import type { CTRFReport, Test } from "ctrf"; +import { generateMarkdown } from "../../src/handlebars/core.js"; +import { BuiltInReports } from "../../src/reports/core.js"; +import { readTemplate } from "../../src/utils/index.js"; + +vi.mock("@actions/core"); +vi.mock("@actions/github", () => ({ + context: { + serverUrl: "https://github.com", + repo: { owner: "test-owner", repo: "test-repo" }, + sha: "abc123", + ref: "refs/heads/main", + workflow: "test", + job: "test-job", + runNumber: 1, + runId: 12345, + apiUrl: "https://api.github.com", + action: "test-action", + actor: "test-actor", + eventName: "push", + payload: {}, + }, +})); + +const T0 = 1_792_570_616_000; + +function makeReport(tests: Test[]): CTRFReport { + return { + reportFormat: "CTRF", + specVersion: "0.2.0", + results: { + tool: { name: "jest" }, + summary: { + tests: tests.length, + passed: tests.filter((t) => t.status === "passed").length, + failed: tests.filter((t) => t.status === "failed").length, + skipped: 0, + pending: 0, + other: 0, + start: T0, + stop: T0 + 10_000, + }, + tests, + }, + }; +} + +function makeTest( + name: string, + start: number, + duration: number, + extra: Partial = {}, +): Test { + return { + name, + status: "passed", + duration, + start: T0 + start, + stop: T0 + start + duration, + ...extra, + }; +} + +function render(tests: Test[]): string { + return generateMarkdown( + readTemplate(BuiltInReports.Timeline), + makeReport(tests), + ); +} + +describe("timeline.hbs", () => { + it("renders the headline, the chart, the lane table and the timings", () => { + const markdown = render([ + makeTest("Login", 0, 6000, { threadId: "worker-1" }), + makeTest("Logout", 6000, 4000, { threadId: "worker-1" }), + makeTest("Search", 0, 4000, { threadId: "worker-2", status: "failed" }), + ]); + + expect(markdown).toContain( + "**3** tests on **2** threads in **10.0s** · busy **70%** of the time · up to **2** at once
Slowest: `Login` (6.0s on `worker-1`) · Last to finish: `Logout` at 0:10.000 on `worker-1`\n\n```mermaid\n---\nconfig:\n", + ); + expect(markdown).toMatch( + /\ntodayMarker off\nsection \u200bworker-1\n[^`]*\n```\n\n/, + ); + expect(markdown).toContain( + "🟩 passed · 🟥 failed · 0:00 = 2026-10-21 08:16:56.000 UTC", + ); + expect(markdown).toContain( + "| Thread | Tests | Failed | Busy | Idle | Utilization |\n| :--- | ---: | ---: | ---: | ---: | ---: |\n| worker-1 | 2 | 0 | 10.0s | 0ms | 100% |\n| worker-2 | 1 | 1 | 4.0s | 6.0s | 40% |\n", + ); + expect(markdown).toContain( + "
\nTest timings (3)\n\n| Start | Duration | Thread | Test | Status |\n| ---: | ---: | :--- | :--- | :--- |\n| 0:00.000 | 6.0s | worker-1 | Login | ✅ passed |\n| 0:06.000 | 4.0s | worker-1 | Logout | ✅ passed |\n| 0:00.000 | 4.0s | worker-2 | Search | ❌ failed |\n\n
", + ); + }); + + it("adds a column for runs before a retry when tests were retried", () => { + const markdown = render([ + makeTest("Flaky", 3000, 2000, { + threadId: "w1", + retryAttempts: [ + { attempt: 1, status: "failed", start: T0, stop: T0 + 2500 }, + ], + }), + makeTest("Other", 0, 5000, { threadId: "w2" }), + ]); + expect(markdown).toContain( + "| Thread | Tests | Runs before a retry | Failed | Busy | Idle | Utilization |", + ); + expect(markdown).toContain("| w1 | 1 | 1 | 0 | 4.5s | 500ms | 90% |"); + expect(markdown).toContain( + "| 0:00.000 | 2.5s | w1 | Flaky (attempt 1) | ❌ failed |", + ); + expect(markdown).toContain("🟨 failed, then retried (dashed)"); + }); + + it("puts each note on its own line", () => { + const markdown = render([ + makeTest("timed", 0, 1000), + { name: "untimed", status: "passed", duration: 10 }, + ]); + expect(markdown).toContain( + "
\n
1 test without start and stop times is not shown.\n
The report has no thread IDs (threadId), so lanes are inferred from start and stop times.\n", + ); + }); + + it("leaves out the lane table for a single lane", () => { + const markdown = render([makeTest("only", 0, 1000, { threadId: "main" })]); + expect(markdown).not.toContain("| Thread | Tests |"); + expect(markdown).toContain("Test timings (1)"); + }); + + it("explains the missing data instead of drawing an empty chart", () => { + const markdown = render([ + { name: "a", status: "passed", duration: 10 }, + { name: "b", status: "failed", duration: 20 }, + ]); + expect(markdown).not.toContain("```mermaid"); + expect(markdown.trim()).toBe( + "No test in this report has start and stop times, so there is no timeline. Reporters that record start and stop for each test (and threadId for parallel workers) enable this report.", + ); + }); + + it("keeps test names from breaking out of the chart or the tables", () => { + const markdown = render([ + makeTest("evil ``` | name\nnext", 0, 60_000, { + threadId: "w|1", + }), + ]); + const fences = markdown.match(/```/g) ?? []; + expect(fences).toHaveLength(2); + expect(markdown).toContain( + "| w\\|1 | evil \\`\\`\\` \\| <img src=x> name next | ✅ passed |", + ); + }); + + it("adds a # column for the numbers on bars too narrow for a name", () => { + const tests: Test[] = []; + for (let fork = 0; fork < 2; fork++) { + let cursor = fork * 37; + for (let index = 0; index < 30; index++) { + const length = 200 + ((index * 97 + fork * 31) % 1500); + tests.push( + makeTest(`fork${fork} Test${index}`, cursor, length, { + threadId: "Test worker", + }), + ); + cursor += length + 3; + } + } + const markdown = render(tests); + expect(markdown).toContain( + "| # | Start | Duration | Thread | Test | Status |\n| ---: | ---: | ---: | :--- | :--- | :--- |\n| | 0:00.000 | 200ms | Test worker | fork0 Test0 | ✅ passed |\n", + ); + expect(markdown).toContain( + "| 1 | 0:01.394 | 588ms | Test worker | fork0 Test4 | ✅ passed |", + ); + expect(markdown).toContain(`\n\u200b1 :16 00:00:01.394, 588ms\n`); + expect(markdown).toContain( + "
A number on a bar is the row with that number (#) in the test timings below.", + ); + }); + + it("keeps the timings table near its size budget, whatever the names hold", () => { + const tests = Array.from({ length: 400 }, (_, index) => + makeTest(`t${index}[${"\"='".repeat(60)}] `, index * 10, 5, { + threadId: `w${index % 40}="${"'".repeat(20)}`, + status: index % 2 ? "failed" : "passed", + }), + ); + const markdown = render(tests); + const table = markdown.slice(markdown.indexOf("
")); + expect(table.length).toBeLessThan(11_000); + expect(markdown.length).toBeLessThan(40_000); + }); + + it("names the slowest test and the last to finish as code, after the headline", () => { + const markdown = render([ + makeTest("[link](https://example.com) @octocat", 0, 6000, { + threadId: "w1", + }), + makeTest("b", 0, 1000, { threadId: "w2" }), + ]); + expect(markdown).toContain( + "
Slowest and last to finish: `[link](https://example.com) @octocat` (6.0s on `w1`, until 0:06.000)\n", + ); + }); +}); diff --git a/action.yml b/action.yml index 0b31a43f..84ee9f30 100644 --- a/action.yml +++ b/action.yml @@ -107,6 +107,13 @@ inputs: 'Include a report showing the top 10 slowest tests by average duration.' required: false default: false + timeline-report: + description: > + Include a timeline (Mermaid Gantt chart) of when each test ran on each + thread or worker. Needs start and stop times on the tests, and threadId to + show parallel workers. + required: false + default: false pull-request-report: description: 'Include the pull request report.' required: false diff --git a/ctrf-reports/timeline/ctrf-report.json b/ctrf-reports/timeline/ctrf-report.json new file mode 100644 index 00000000..eab32dac --- /dev/null +++ b/ctrf-reports/timeline/ctrf-report.json @@ -0,0 +1,186 @@ +{ + "reportFormat": "CTRF", + "specVersion": "0.2.0", + "results": { + "tool": { + "name": "playwright" + }, + "summary": { + "tests": 17, + "passed": 14, + "failed": 2, + "skipped": 1, + "pending": 0, + "other": 0, + "start": 1767254400000, + "stop": 1767254434200 + }, + "tests": [ + { + "name": "should log in with valid credentials", + "status": "passed", + "duration": 4200, + "start": 1767254400000, + "stop": 1767254404200, + "threadId": "worker-0", + "filePath": "tests/e2e/auth.spec.ts" + }, + { + "name": "should lock the account after 3 failures", + "status": "passed", + "duration": 6100, + "start": 1767254404300, + "stop": 1767254410400, + "threadId": "worker-0", + "filePath": "tests/e2e/auth.spec.ts" + }, + { + "name": "should reset the password by email", + "status": "passed", + "duration": 1900, + "start": 1767254413200, + "stop": 1767254415100, + "threadId": "worker-0", + "filePath": "tests/e2e/auth.spec.ts", + "retries": 1, + "flaky": true, + "retryAttempts": [ + { + "attempt": 1, + "status": "failed", + "duration": 2600, + "start": 1767254410500, + "stop": 1767254413100, + "message": "Timed out waiting for the reset email" + } + ] + }, + { + "name": "should show the order history", + "status": "passed", + "duration": 15800, + "start": 1767254415200, + "stop": 1767254431000, + "threadId": "worker-0", + "filePath": "tests/e2e/orders.spec.ts" + }, + { + "name": "should export orders as CSV", + "status": "passed", + "duration": 3100, + "start": 1767254431100, + "stop": 1767254434200, + "threadId": "worker-0", + "filePath": "tests/e2e/orders.spec.ts" + }, + { + "name": "should register a new user", + "status": "passed", + "duration": 9800, + "start": 1767254400000, + "stop": 1767254409800, + "threadId": "worker-1", + "filePath": "tests/e2e/signup.spec.ts" + }, + { + "name": "should open the checkout page", + "status": "failed", + "duration": 0, + "start": 1767254409900, + "stop": 1767254409900, + "threadId": "worker-1", + "filePath": "tests/e2e/checkout.spec.ts", + "message": "beforeAll hook: page.goto: net::ERR_CONNECTION_REFUSED" + }, + { + "name": "should apply a discount code", + "status": "passed", + "duration": 5200, + "start": 1767254409950, + "stop": 1767254415150, + "threadId": "worker-1", + "filePath": "tests/e2e/checkout.spec.ts" + }, + { + "name": "should pay with a saved card", + "status": "failed", + "duration": 7700, + "start": 1767254415300, + "stop": 1767254423000, + "threadId": "worker-1", + "filePath": "tests/e2e/checkout.spec.ts", + "message": "expect(received).toBe(expected)" + }, + { + "name": "should send the receipt", + "status": "passed", + "duration": 2400, + "start": 1767254423100, + "stop": 1767254425500, + "threadId": "worker-1", + "filePath": "tests/e2e/checkout.spec.ts" + }, + { + "name": "should keep the cart after reload", + "status": "passed", + "duration": 1200, + "start": 1767254400000, + "stop": 1767254401200, + "threadId": "worker-2", + "filePath": "tests/e2e/cart.spec.ts" + }, + { + "name": "should update the cart badge", + "status": "passed", + "duration": 800, + "start": 1767254401300, + "stop": 1767254402100, + "threadId": "worker-2", + "filePath": "tests/e2e/cart.spec.ts" + }, + { + "name": "should generate the sales report", + "status": "passed", + "duration": 26000, + "start": 1767254402200, + "stop": 1767254428200, + "threadId": "worker-2", + "filePath": "tests/e2e/reports.spec.ts" + }, + { + "name": "should search by product name", + "status": "passed", + "duration": 3400, + "start": 1767254400000, + "stop": 1767254403400, + "threadId": "worker-3", + "filePath": "tests/e2e/search.spec.ts" + }, + { + "name": "should filter by price", + "status": "passed", + "duration": 2900, + "start": 1767254403500, + "stop": 1767254406400, + "threadId": "worker-3", + "filePath": "tests/e2e/search.spec.ts" + }, + { + "name": "should sort by rating", + "status": "passed", + "duration": 2100, + "start": 1767254406500, + "stop": 1767254408600, + "threadId": "worker-3", + "filePath": "tests/e2e/search.spec.ts" + }, + { + "name": "should support gift cards", + "status": "skipped", + "duration": 0, + "threadId": "worker-3", + "filePath": "tests/e2e/checkout.spec.ts" + } + ] + } +} diff --git a/dist/index.js b/dist/index.js index 742a422b..73987ab4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -892,8 +892,8 @@ var require_tree = __commonJS({ * @param {any} value */ add(key, value) { - const length = key.length; - if (length === 0) { + const length2 = key.length; + if (length2 === 0) { throw new TypeError("Unreachable"); } let index2 = 0; @@ -904,7 +904,7 @@ var require_tree = __commonJS({ throw new TypeError("key must be ascii string"); } if (node.code === code) { - if (length === ++index2) { + if (length2 === ++index2) { node.value = value; break; } else if (node.middle !== null) { @@ -1379,20 +1379,20 @@ var require_util = __commonJS({ return c6 >= 33 && c6 <= 126; } } - function isValidHTTPToken(characters) { - if (characters.length === 0) { + function isValidHTTPToken(characters2) { + if (characters2.length === 0) { return false; } - for (let i6 = 0; i6 < characters.length; ++i6) { - if (!isTokenCharCode(characters.charCodeAt(i6))) { + for (let i6 = 0; i6 < characters2.length; ++i6) { + if (!isTokenCharCode(characters2.charCodeAt(i6))) { return false; } } return true; } var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; - function isValidHeaderValue(characters) { - return !headerCharRegex.test(characters); + function isValidHeaderValue(characters2) { + return !headerCharRegex.test(characters2); } function parseRangeHeader(range5) { if (range5 == null || range5 === "") return { start: 0, end: null, size: null }; @@ -3429,10 +3429,10 @@ var require_data_url = __commonJS({ ); } function percentDecode(input) { - const length = input.length; - const output = new Uint8Array(length); + const length2 = input.length; + const output = new Uint8Array(length2); let j7 = 0; - for (let i6 = 0; i6 < length; ++i6) { + for (let i6 = 0; i6 < length2; ++i6) { const byte = input[i6]; if (byte !== 37) { output[j7++] = byte; @@ -3443,7 +3443,7 @@ var require_data_url = __commonJS({ i6 += 2; } } - return length === j7 ? output : output.subarray(0, j7); + return length2 === j7 ? output : output.subarray(0, j7); } function parseMIMEType(input) { input = removeHTTPWhitespace(input, true, true); @@ -3621,16 +3621,16 @@ var require_data_url = __commonJS({ return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1); } function isomorphicDecode(input) { - const length = input.length; - if ((2 << 15) - 1 > length) { + const length2 = input.length; + if ((2 << 15) - 1 > length2) { return String.fromCharCode.apply(null, input); } let result = ""; let i6 = 0; let addition = (2 << 15) - 1; - while (i6 < length) { - if (i6 + addition > length) { - addition = length - i6; + while (i6 < length2) { + if (i6 + addition > length2) { + addition = length2 - i6; } result += String.fromCharCode.apply(null, input.subarray(i6, i6 += addition)); } @@ -3706,8 +3706,8 @@ var require_webidl = __commonJS({ return new TypeError(`${message.header}: ${message.message}`); }; webidl.errors.conversionFailed = function(context5) { - const plural = context5.types.length === 1 ? "" : " one of"; - const message = `${context5.argument} could not be converted to${plural}: ${context5.types.join(", ")}.`; + const plural2 = context5.types.length === 1 ? "" : " one of"; + const message = `${context5.argument} could not be converted to${plural2}: ${context5.types.join(", ")}.`; return webidl.errors.exception({ header: context5.prefix, message @@ -3734,10 +3734,10 @@ var require_webidl = __commonJS({ } } }; - webidl.argumentLengthCheck = function({ length }, min, ctx) { - if (length < min) { + webidl.argumentLengthCheck = function({ length: length2 }, min, ctx) { + if (length2 < min) { throw webidl.errors.exception({ - message: `${min} argument${min !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`, + message: `${min} argument${min !== 1 ? "s" : ""} required, but${length2 ? " only" : ""} ${length2} found.`, header: ctx }); } @@ -4135,8 +4135,8 @@ var require_util2 = __commonJS({ } function responseURL(response) { const urlList = response.urlList; - const length = urlList.length; - return length === 0 ? null : urlList[length - 1].toString(); + const length2 = urlList.length; + return length2 === 0 ? null : urlList[length2 - 1].toString(); } function responseLocationURL(response, requestFragment) { if (!redirectStatusSet.has(response.status)) { @@ -5234,11 +5234,11 @@ var require_formdata_parser = __commonJS({ return true; } function validateBoundary(boundary) { - const length = boundary.length; - if (length < 27 || length > 70) { + const length2 = boundary.length; + if (length2 < 27 || length2 > 70) { return false; } - for (let i6 = 0; i6 < length; ++i6) { + for (let i6 = 0; i6 < length2; ++i6) { const cp2 = boundary.charCodeAt(i6); if (!(cp2 >= 48 && cp2 <= 57 || cp2 >= 65 && cp2 <= 90 || cp2 >= 97 && cp2 <= 122 || cp2 === 39 || cp2 === 45 || cp2 === 95)) { return false; @@ -5528,7 +5528,7 @@ var require_body = __commonJS({ assert2(isReadableStreamLike(stream5)); let action5 = null; let source = null; - let length = null; + let length2 = null; let type = null; if (typeof object === "string") { source = object; @@ -5548,7 +5548,7 @@ Content-Disposition: form-data`; const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n"); const blobParts = []; const rn = new Uint8Array([13, 10]); - length = 0; + length2 = 0; let hasUnknownSizeValue = false; for (const [name, value] of object) { if (typeof value === "string") { @@ -5557,7 +5557,7 @@ Content-Disposition: form-data`; ${normalizeLinefeeds(value)}\r `); blobParts.push(chunk2); - length += chunk2.byteLength; + length2 += chunk2.byteLength; } else { const chunk2 = textEncoder.encode(`${prefix2}; name="${escape4(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${escape4(value.name)}"` : "") + `\r Content-Type: ${value.type || "application/octet-stream"}\r @@ -5565,7 +5565,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r `); blobParts.push(chunk2, value, rn); if (typeof value.size === "number") { - length += chunk2.byteLength + value.size + rn.byteLength; + length2 += chunk2.byteLength + value.size + rn.byteLength; } else { hasUnknownSizeValue = true; } @@ -5574,9 +5574,9 @@ Content-Type: ${value.type || "application/octet-stream"}\r const chunk = textEncoder.encode(`--${boundary}--\r `); blobParts.push(chunk); - length += chunk.byteLength; + length2 += chunk.byteLength; if (hasUnknownSizeValue) { - length = null; + length2 = null; } source = object; action5 = async function* () { @@ -5591,7 +5591,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r type = `multipart/form-data; boundary=${boundary}`; } else if (isBlobLike3(object)) { source = object; - length = object.size; + length2 = object.size; if (object.type) { type = object.type; } @@ -5607,7 +5607,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r stream5 = object instanceof ReadableStream ? object : ReadableStreamFrom3(object); } if (typeof source === "string" || util4.isBuffer(source)) { - length = Buffer.byteLength(source); + length2 = Buffer.byteLength(source); } if (action5 != null) { let iterator2; @@ -5638,7 +5638,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r type: "bytes" }); } - const body2 = { stream: stream5, source, length }; + const body2 = { stream: stream5, source, length: length2 }; return [body2, type]; } function safelyExtractBody(object, keepalive = false) { @@ -9139,9 +9139,9 @@ var require_retry_handler = __commonJS({ if (!Number.isFinite(range5.start) || !Number.isFinite(range5.end)) { return null; } - const length = Number(contentLength2); + const length2 = Number(contentLength2); const expectedLength = range5.end - range5.start + 1; - if (!Number.isFinite(length) || length !== expectedLength) { + if (!Number.isFinite(length2) || length2 !== expectedLength) { return new RequestRetryError("Content-Length mismatch", statusCode, { headers, data: { count: retryCount } @@ -9725,23 +9725,23 @@ var require_readable = __commonJS({ while (consume2.stream.read() != null) { } } - function chunksDecode(chunks, length) { - if (chunks.length === 0 || length === 0) { + function chunksDecode(chunks, length2) { + if (chunks.length === 0 || length2 === 0) { return ""; } - const buffer2 = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length); + const buffer2 = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length2); const bufferLength = buffer2.length; const start = bufferLength > 2 && buffer2[0] === 239 && buffer2[1] === 187 && buffer2[2] === 191 ? 3 : 0; return buffer2.utf8Slice(start, bufferLength); } - function chunksConcat(chunks, length) { - if (chunks.length === 0 || length === 0) { + function chunksConcat(chunks, length2) { + if (chunks.length === 0 || length2 === 0) { return new Uint8Array(0); } if (chunks.length === 1) { return new Uint8Array(chunks[0]); } - const buffer2 = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer); + const buffer2 = new Uint8Array(Buffer.allocUnsafeSlow(length2).buffer); let offset = 0; for (let i6 = 0; i6 < chunks.length; ++i6) { const chunk = chunks[i6]; @@ -9751,18 +9751,18 @@ var require_readable = __commonJS({ return buffer2; } function consumeEnd(consume2) { - const { type, body: body2, resolve: resolve9, stream: stream5, length } = consume2; + const { type, body: body2, resolve: resolve9, stream: stream5, length: length2 } = consume2; try { if (type === "text") { - resolve9(chunksDecode(body2, length)); + resolve9(chunksDecode(body2, length2)); } else if (type === "json") { - resolve9(JSON.parse(chunksDecode(body2, length))); + resolve9(JSON.parse(chunksDecode(body2, length2))); } else if (type === "arrayBuffer") { - resolve9(chunksConcat(body2, length).buffer); + resolve9(chunksConcat(body2, length2).buffer); } else if (type === "blob") { resolve9(new Blob(body2, { type: stream5[kContentType] })); } else if (type === "bytes") { - resolve9(chunksConcat(body2, length)); + resolve9(chunksConcat(body2, length2)); } consumeFinish(consume2); } catch (err) { @@ -9807,23 +9807,23 @@ var require_util3 = __commonJS({ async function getResolveErrorBodyCallback({ callback, body: body2, contentType: contentType2, statusCode, statusMessage, headers }) { assert2(body2); let chunks = []; - let length = 0; + let length2 = 0; try { for await (const chunk of body2) { chunks.push(chunk); - length += chunk.length; - if (length > CHUNK_LIMIT) { + length2 += chunk.length; + if (length2 > CHUNK_LIMIT) { chunks = []; - length = 0; + length2 = 0; break; } } } catch { chunks = []; - length = 0; + length2 = 0; } const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`; - if (statusCode === 204 || !contentType2 || !length) { + if (statusCode === 204 || !contentType2 || !length2) { queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers))); return; } @@ -9832,9 +9832,9 @@ var require_util3 = __commonJS({ let payload; try { if (isContentTypeApplicationJson(contentType2)) { - payload = JSON.parse(chunksDecode(chunks, length)); + payload = JSON.parse(chunksDecode(chunks, length2)); } else if (isContentTypeText(contentType2)) { - payload = chunksDecode(chunks, length); + payload = chunksDecode(chunks, length2); } } catch { } finally { @@ -11309,15 +11309,15 @@ var require_pluralizer = __commonJS({ this: "these" }; module.exports = class Pluralizer { - constructor(singular, plural) { + constructor(singular, plural2) { this.singular = singular; - this.plural = plural; + this.plural = plural2; } - pluralize(count) { - const one = count === 1; + pluralize(count2) { + const one = count2 === 1; const keys = one ? singulars : plurals; const noun = one ? this.singular : this.plural; - return { ...keys, count, noun }; + return { ...keys, count: count2, noun }; } }; } @@ -14460,7 +14460,7 @@ var require_fetch = __commonJS({ fetchParams.controller.resume = async () => { while (true) { let bytes; - let isFailure; + let isFailure2; try { const { done, value } = await fetchParams.controller.next(); if (isAborted(fetchParams)) { @@ -14472,7 +14472,7 @@ var require_fetch = __commonJS({ bytes = void 0; } else { bytes = err; - isFailure = true; + isFailure2 = true; } } if (bytes === void 0) { @@ -14481,7 +14481,7 @@ var require_fetch = __commonJS({ return; } timingInfo.decodedBodySize += bytes?.byteLength ?? 0; - if (isFailure) { + if (isFailure2) { fetchParams.controller.terminate(bytes); return; } @@ -17784,11 +17784,11 @@ var require_receiver = __commonJS({ let offset = 0; while (offset !== n9) { const next = this.#buffers[0]; - const { length } = next; - if (length + offset === n9) { + const { length: length2 } = next; + if (length2 + offset === n9) { buffer2.set(this.#buffers.shift(), offset); break; - } else if (length + offset > n9) { + } else if (length2 + offset > n9) { buffer2.set(next.subarray(0, n9 - offset), offset); this.#buffers[0] = next.subarray(n9 - offset); break; @@ -18136,10 +18136,10 @@ var require_websocket = __commonJS({ return; } if (typeof data === "string") { - const length = Buffer.byteLength(data); - this.#bufferedAmount += length; + const length2 = Buffer.byteLength(data); + this.#bufferedAmount += length2; this.#sendQueue.add(data, () => { - this.#bufferedAmount -= length; + this.#bufferedAmount -= length2; }, sendHints.string); } else if (types2.isArrayBuffer(data)) { this.#bufferedAmount += data.byteLength; @@ -18443,11 +18443,11 @@ var require_eventsource_stream = __commonJS({ } return true; } - function isFieldName(line, length, field) { - if (length !== field.length) { + function isFieldName(line, length2, field) { + if (length2 !== field.length) { return false; } - for (let i6 = 0; i6 < length; i6++) { + for (let i6 = 0; i6 < length2; i6++) { if (line[i6] !== field[i6]) { return false; } @@ -18676,16 +18676,16 @@ ${value}`; return this.chunks[this.chunkIndex].subarray(this.linePos, this.pos); } const chunks = []; - let length = 0; + let length2 = 0; for (let i6 = this.lineChunkIndex; i6 <= this.chunkIndex; i6++) { const chunk = this.chunks[i6]; const start = i6 === this.lineChunkIndex ? this.linePos : 0; const end = i6 === this.chunkIndex ? this.pos : chunk.length; const slice = chunk.subarray(start, end); - length += slice.length; + length2 += slice.length; chunks.push(slice); } - return Buffer.concat(chunks, length); + return Buffer.concat(chunks, length2); } peekBufferedByte(offset) { let chunkIndex = this.lineChunkIndex; @@ -18701,15 +18701,15 @@ ${value}`; pos = 0; } } - discardLeadingBytes(count) { - while (count > 0 && this.lineChunkIndex < this.chunks.length) { + discardLeadingBytes(count2) { + while (count2 > 0 && this.lineChunkIndex < this.chunks.length) { const chunk = this.chunks[this.lineChunkIndex]; const remaining = chunk.length - this.linePos; - if (count < remaining) { - this.linePos += count; - count = 0; + if (count2 < remaining) { + this.linePos += count2; + count2 = 0; } else { - count -= remaining; + count2 -= remaining; this.lineChunkIndex++; this.linePos = 0; } @@ -19866,8 +19866,8 @@ var require_tree2 = __commonJS({ * @param {any} value */ add(key, value) { - const length = key.length; - if (length === 0) { + const length2 = key.length; + if (length2 === 0) { throw new TypeError("Unreachable"); } let index2 = 0; @@ -19878,7 +19878,7 @@ var require_tree2 = __commonJS({ throw new TypeError("key must be ascii string"); } if (node.code === code) { - if (length === ++index2) { + if (length2 === ++index2) { node.value = value; break; } else if (node.middle !== null) { @@ -20353,20 +20353,20 @@ var require_util9 = __commonJS({ return c6 >= 33 && c6 <= 126; } } - function isValidHTTPToken(characters) { - if (characters.length === 0) { + function isValidHTTPToken(characters2) { + if (characters2.length === 0) { return false; } - for (let i6 = 0; i6 < characters.length; ++i6) { - if (!isTokenCharCode(characters.charCodeAt(i6))) { + for (let i6 = 0; i6 < characters2.length; ++i6) { + if (!isTokenCharCode(characters2.charCodeAt(i6))) { return false; } } return true; } var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; - function isValidHeaderValue(characters) { - return !headerCharRegex.test(characters); + function isValidHeaderValue(characters2) { + return !headerCharRegex.test(characters2); } function parseRangeHeader(range5) { if (range5 == null || range5 === "") return { start: 0, end: null, size: null }; @@ -22403,10 +22403,10 @@ var require_data_url2 = __commonJS({ ); } function percentDecode(input) { - const length = input.length; - const output = new Uint8Array(length); + const length2 = input.length; + const output = new Uint8Array(length2); let j7 = 0; - for (let i6 = 0; i6 < length; ++i6) { + for (let i6 = 0; i6 < length2; ++i6) { const byte = input[i6]; if (byte !== 37) { output[j7++] = byte; @@ -22417,7 +22417,7 @@ var require_data_url2 = __commonJS({ i6 += 2; } } - return length === j7 ? output : output.subarray(0, j7); + return length2 === j7 ? output : output.subarray(0, j7); } function parseMIMEType(input) { input = removeHTTPWhitespace(input, true, true); @@ -22595,16 +22595,16 @@ var require_data_url2 = __commonJS({ return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1); } function isomorphicDecode(input) { - const length = input.length; - if ((2 << 15) - 1 > length) { + const length2 = input.length; + if ((2 << 15) - 1 > length2) { return String.fromCharCode.apply(null, input); } let result = ""; let i6 = 0; let addition = (2 << 15) - 1; - while (i6 < length) { - if (i6 + addition > length) { - addition = length - i6; + while (i6 < length2) { + if (i6 + addition > length2) { + addition = length2 - i6; } result += String.fromCharCode.apply(null, input.subarray(i6, i6 += addition)); } @@ -22680,8 +22680,8 @@ var require_webidl2 = __commonJS({ return new TypeError(`${message.header}: ${message.message}`); }; webidl.errors.conversionFailed = function(context5) { - const plural = context5.types.length === 1 ? "" : " one of"; - const message = `${context5.argument} could not be converted to${plural}: ${context5.types.join(", ")}.`; + const plural2 = context5.types.length === 1 ? "" : " one of"; + const message = `${context5.argument} could not be converted to${plural2}: ${context5.types.join(", ")}.`; return webidl.errors.exception({ header: context5.prefix, message @@ -22708,10 +22708,10 @@ var require_webidl2 = __commonJS({ } } }; - webidl.argumentLengthCheck = function({ length }, min, ctx) { - if (length < min) { + webidl.argumentLengthCheck = function({ length: length2 }, min, ctx) { + if (length2 < min) { throw webidl.errors.exception({ - message: `${min} argument${min !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`, + message: `${min} argument${min !== 1 ? "s" : ""} required, but${length2 ? " only" : ""} ${length2} found.`, header: ctx }); } @@ -23109,8 +23109,8 @@ var require_util10 = __commonJS({ } function responseURL(response) { const urlList = response.urlList; - const length = urlList.length; - return length === 0 ? null : urlList[length - 1].toString(); + const length2 = urlList.length; + return length2 === 0 ? null : urlList[length2 - 1].toString(); } function responseLocationURL(response, requestFragment) { if (!redirectStatusSet.has(response.status)) { @@ -24208,11 +24208,11 @@ var require_formdata_parser2 = __commonJS({ return true; } function validateBoundary(boundary) { - const length = boundary.length; - if (length < 27 || length > 70) { + const length2 = boundary.length; + if (length2 < 27 || length2 > 70) { return false; } - for (let i6 = 0; i6 < length; ++i6) { + for (let i6 = 0; i6 < length2; ++i6) { const cp2 = boundary.charCodeAt(i6); if (!(cp2 >= 48 && cp2 <= 57 || cp2 >= 65 && cp2 <= 90 || cp2 >= 97 && cp2 <= 122 || cp2 === 39 || cp2 === 45 || cp2 === 95)) { return false; @@ -24502,7 +24502,7 @@ var require_body2 = __commonJS({ assert2(isReadableStreamLike(stream5)); let action5 = null; let source = null; - let length = null; + let length2 = null; let type = null; if (typeof object === "string") { source = object; @@ -24522,7 +24522,7 @@ Content-Disposition: form-data`; const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n"); const blobParts = []; const rn = new Uint8Array([13, 10]); - length = 0; + length2 = 0; let hasUnknownSizeValue = false; for (const [name, value] of object) { if (typeof value === "string") { @@ -24531,7 +24531,7 @@ Content-Disposition: form-data`; ${normalizeLinefeeds(value)}\r `); blobParts.push(chunk2); - length += chunk2.byteLength; + length2 += chunk2.byteLength; } else { const chunk2 = textEncoder.encode(`${prefix2}; name="${escape4(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${escape4(value.name)}"` : "") + `\r Content-Type: ${value.type || "application/octet-stream"}\r @@ -24539,7 +24539,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r `); blobParts.push(chunk2, value, rn); if (typeof value.size === "number") { - length += chunk2.byteLength + value.size + rn.byteLength; + length2 += chunk2.byteLength + value.size + rn.byteLength; } else { hasUnknownSizeValue = true; } @@ -24548,9 +24548,9 @@ Content-Type: ${value.type || "application/octet-stream"}\r const chunk = textEncoder.encode(`--${boundary}--\r `); blobParts.push(chunk); - length += chunk.byteLength; + length2 += chunk.byteLength; if (hasUnknownSizeValue) { - length = null; + length2 = null; } source = object; action5 = async function* () { @@ -24565,7 +24565,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r type = `multipart/form-data; boundary=${boundary}`; } else if (isBlobLike3(object)) { source = object; - length = object.size; + length2 = object.size; if (object.type) { type = object.type; } @@ -24581,7 +24581,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r stream5 = object instanceof ReadableStream ? object : ReadableStreamFrom3(object); } if (typeof source === "string" || util4.isBuffer(source)) { - length = Buffer.byteLength(source); + length2 = Buffer.byteLength(source); } if (action5 != null) { let iterator2; @@ -24612,7 +24612,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r type: "bytes" }); } - const body2 = { stream: stream5, source, length }; + const body2 = { stream: stream5, source, length: length2 }; return [body2, type]; } function safelyExtractBody(object, keepalive = false) { @@ -28113,9 +28113,9 @@ var require_retry_handler2 = __commonJS({ if (!Number.isFinite(range5.start) || !Number.isFinite(range5.end)) { return null; } - const length = Number(contentLength2); + const length2 = Number(contentLength2); const expectedLength = range5.end - range5.start + 1; - if (!Number.isFinite(length) || length !== expectedLength) { + if (!Number.isFinite(length2) || length2 !== expectedLength) { return new RequestRetryError("Content-Length mismatch", statusCode, { headers, data: { count: retryCount } @@ -28699,23 +28699,23 @@ var require_readable2 = __commonJS({ while (consume2.stream.read() != null) { } } - function chunksDecode(chunks, length) { - if (chunks.length === 0 || length === 0) { + function chunksDecode(chunks, length2) { + if (chunks.length === 0 || length2 === 0) { return ""; } - const buffer2 = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length); + const buffer2 = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length2); const bufferLength = buffer2.length; const start = bufferLength > 2 && buffer2[0] === 239 && buffer2[1] === 187 && buffer2[2] === 191 ? 3 : 0; return buffer2.utf8Slice(start, bufferLength); } - function chunksConcat(chunks, length) { - if (chunks.length === 0 || length === 0) { + function chunksConcat(chunks, length2) { + if (chunks.length === 0 || length2 === 0) { return new Uint8Array(0); } if (chunks.length === 1) { return new Uint8Array(chunks[0]); } - const buffer2 = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer); + const buffer2 = new Uint8Array(Buffer.allocUnsafeSlow(length2).buffer); let offset = 0; for (let i6 = 0; i6 < chunks.length; ++i6) { const chunk = chunks[i6]; @@ -28725,18 +28725,18 @@ var require_readable2 = __commonJS({ return buffer2; } function consumeEnd(consume2) { - const { type, body: body2, resolve: resolve9, stream: stream5, length } = consume2; + const { type, body: body2, resolve: resolve9, stream: stream5, length: length2 } = consume2; try { if (type === "text") { - resolve9(chunksDecode(body2, length)); + resolve9(chunksDecode(body2, length2)); } else if (type === "json") { - resolve9(JSON.parse(chunksDecode(body2, length))); + resolve9(JSON.parse(chunksDecode(body2, length2))); } else if (type === "arrayBuffer") { - resolve9(chunksConcat(body2, length).buffer); + resolve9(chunksConcat(body2, length2).buffer); } else if (type === "blob") { resolve9(new Blob(body2, { type: stream5[kContentType] })); } else if (type === "bytes") { - resolve9(chunksConcat(body2, length)); + resolve9(chunksConcat(body2, length2)); } consumeFinish(consume2); } catch (err) { @@ -28781,23 +28781,23 @@ var require_util11 = __commonJS({ async function getResolveErrorBodyCallback({ callback, body: body2, contentType: contentType2, statusCode, statusMessage, headers }) { assert2(body2); let chunks = []; - let length = 0; + let length2 = 0; try { for await (const chunk of body2) { chunks.push(chunk); - length += chunk.length; - if (length > CHUNK_LIMIT) { + length2 += chunk.length; + if (length2 > CHUNK_LIMIT) { chunks = []; - length = 0; + length2 = 0; break; } } } catch { chunks = []; - length = 0; + length2 = 0; } const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`; - if (statusCode === 204 || !contentType2 || !length) { + if (statusCode === 204 || !contentType2 || !length2) { queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers))); return; } @@ -28806,9 +28806,9 @@ var require_util11 = __commonJS({ let payload; try { if (isContentTypeApplicationJson(contentType2)) { - payload = JSON.parse(chunksDecode(chunks, length)); + payload = JSON.parse(chunksDecode(chunks, length2)); } else if (isContentTypeText(contentType2)) { - payload = chunksDecode(chunks, length); + payload = chunksDecode(chunks, length2); } } catch { } finally { @@ -30283,15 +30283,15 @@ var require_pluralizer2 = __commonJS({ this: "these" }; module.exports = class Pluralizer { - constructor(singular, plural) { + constructor(singular, plural2) { this.singular = singular; - this.plural = plural; + this.plural = plural2; } - pluralize(count) { - const one = count === 1; + pluralize(count2) { + const one = count2 === 1; const keys = one ? singulars : plurals; const noun = one ? this.singular : this.plural; - return { ...keys, count, noun }; + return { ...keys, count: count2, noun }; } }; } @@ -33434,7 +33434,7 @@ var require_fetch2 = __commonJS({ fetchParams.controller.resume = async () => { while (true) { let bytes; - let isFailure; + let isFailure2; try { const { done, value } = await fetchParams.controller.next(); if (isAborted(fetchParams)) { @@ -33446,7 +33446,7 @@ var require_fetch2 = __commonJS({ bytes = void 0; } else { bytes = err; - isFailure = true; + isFailure2 = true; } } if (bytes === void 0) { @@ -33455,7 +33455,7 @@ var require_fetch2 = __commonJS({ return; } timingInfo.decodedBodySize += bytes?.byteLength ?? 0; - if (isFailure) { + if (isFailure2) { fetchParams.controller.terminate(bytes); return; } @@ -36758,11 +36758,11 @@ var require_receiver2 = __commonJS({ let offset = 0; while (offset !== n9) { const next = this.#buffers[0]; - const { length } = next; - if (length + offset === n9) { + const { length: length2 } = next; + if (length2 + offset === n9) { buffer2.set(this.#buffers.shift(), offset); break; - } else if (length + offset > n9) { + } else if (length2 + offset > n9) { buffer2.set(next.subarray(0, n9 - offset), offset); this.#buffers[0] = next.subarray(n9 - offset); break; @@ -37110,10 +37110,10 @@ var require_websocket2 = __commonJS({ return; } if (typeof data === "string") { - const length = Buffer.byteLength(data); - this.#bufferedAmount += length; + const length2 = Buffer.byteLength(data); + this.#bufferedAmount += length2; this.#sendQueue.add(data, () => { - this.#bufferedAmount -= length; + this.#bufferedAmount -= length2; }, sendHints.string); } else if (types2.isArrayBuffer(data)) { this.#bufferedAmount += data.byteLength; @@ -37417,11 +37417,11 @@ var require_eventsource_stream2 = __commonJS({ } return true; } - function isFieldName(line, length, field) { - if (length !== field.length) { + function isFieldName(line, length2, field) { + if (length2 !== field.length) { return false; } - for (let i6 = 0; i6 < length; i6++) { + for (let i6 = 0; i6 < length2; i6++) { if (line[i6] !== field[i6]) { return false; } @@ -37650,16 +37650,16 @@ ${value}`; return this.chunks[this.chunkIndex].subarray(this.linePos, this.pos); } const chunks = []; - let length = 0; + let length2 = 0; for (let i6 = this.lineChunkIndex; i6 <= this.chunkIndex; i6++) { const chunk = this.chunks[i6]; const start = i6 === this.lineChunkIndex ? this.linePos : 0; const end = i6 === this.chunkIndex ? this.pos : chunk.length; const slice = chunk.subarray(start, end); - length += slice.length; + length2 += slice.length; chunks.push(slice); } - return Buffer.concat(chunks, length); + return Buffer.concat(chunks, length2); } peekBufferedByte(offset) { let chunkIndex = this.lineChunkIndex; @@ -37675,15 +37675,15 @@ ${value}`; pos = 0; } } - discardLeadingBytes(count) { - while (count > 0 && this.lineChunkIndex < this.chunks.length) { + discardLeadingBytes(count2) { + while (count2 > 0 && this.lineChunkIndex < this.chunks.length) { const chunk = this.chunks[this.lineChunkIndex]; const remaining = chunk.length - this.linePos; - if (count < remaining) { - this.linePos += count; - count = 0; + if (count2 < remaining) { + this.linePos += count2; + count2 = 0; } else { - count -= remaining; + count2 -= remaining; this.lineChunkIndex++; this.linePos = 0; } @@ -45405,8 +45405,8 @@ var require_tree3 = __commonJS({ * @returns {void} */ add(key, value) { - const length = key.length; - if (length === 0) { + const length2 = key.length; + if (length2 === 0) { throw new TypeError("Unreachable"); } let index2 = 0; @@ -45417,7 +45417,7 @@ var require_tree3 = __commonJS({ throw new TypeError("key must be ascii string"); } if (node.code === code) { - if (length === ++index2) { + if (length2 === ++index2) { node.value = value; break; } else if (node.middle !== null) { @@ -46142,19 +46142,19 @@ var require_util17 = __commonJS({ return validTokenChars[c6] === 1; } var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; - function isValidHTTPToken(characters) { - if (characters.length >= 12) return tokenRegExp.test(characters); - if (characters.length === 0) return false; - for (let i6 = 0; i6 < characters.length; i6++) { - if (validTokenChars[characters.charCodeAt(i6)] !== 1) { + function isValidHTTPToken(characters2) { + if (characters2.length >= 12) return tokenRegExp.test(characters2); + if (characters2.length === 0) return false; + for (let i6 = 0; i6 < characters2.length; i6++) { + if (validTokenChars[characters2.charCodeAt(i6)] !== 1) { return false; } } return true; } var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; - function isValidHeaderValue(characters) { - return !headerCharRegex.test(characters); + function isValidHeaderValue(characters2) { + return !headerCharRegex.test(characters2); } var rangeHeaderRegex = /^bytes (\d+)-(\d+)\/(\d+|\*)?$/; function parseRangeHeader(range5) { @@ -48425,16 +48425,16 @@ var require_infra = __commonJS({ char === 32; } function isomorphicDecode(input) { - const length = input.length; - if ((2 << 15) - 1 > length) { + const length2 = input.length; + if ((2 << 15) - 1 > length2) { return String.fromCharCode.apply(null, input); } let result = ""; let i6 = 0; let addition = (2 << 15) - 1; - while (i6 < length) { - if (i6 + addition > length) { - addition = length - i6; + while (i6 < length2) { + if (i6 + addition > length2) { + addition = length2 - i6; } result += String.fromCharCode.apply(null, input.subarray(i6, i6 += addition)); } @@ -48564,11 +48564,11 @@ var require_data_url3 = __commonJS({ ); } function percentDecode(input) { - const length = input.length; - const output = new Uint8Array(length); + const length2 = input.length; + const output = new Uint8Array(length2); let j7 = 0; let i6 = 0; - while (i6 < length) { + while (i6 < length2) { const byte = input[i6]; if (byte !== 37) { output[j7++] = byte; @@ -48580,7 +48580,7 @@ var require_data_url3 = __commonJS({ } ++i6; } - return length === j7 ? output : output.subarray(0, j7); + return length2 === j7 ? output : output.subarray(0, j7); } function parseMIMEType(input) { input = removeHTTPWhitespace(input, true, true); @@ -48797,8 +48797,8 @@ var require_webidl3 = __commonJS({ return new TypeError(`${message.header}: ${message.message}`); }; webidl.errors.conversionFailed = function(opts) { - const plural = opts.types.length === 1 ? "" : " one of"; - const message = `${opts.argument} could not be converted to${plural}: ${opts.types.join(", ")}.`; + const plural2 = opts.types.length === 1 ? "" : " one of"; + const message = `${opts.argument} could not be converted to${plural2}: ${opts.types.join(", ")}.`; return webidl.errors.exception({ header: opts.prefix, message @@ -48817,10 +48817,10 @@ var require_webidl3 = __commonJS({ throw err; } }; - webidl.argumentLengthCheck = function({ length }, min, ctx) { - if (length < min) { + webidl.argumentLengthCheck = function({ length: length2 }, min, ctx) { + if (length2 < min) { throw webidl.errors.exception({ - message: `${min} argument${min !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`, + message: `${min} argument${min !== 1 ? "s" : ""} required, but${length2 ? " only" : ""} ${length2} found.`, header: ctx }); } @@ -49114,20 +49114,20 @@ var require_webidl3 = __commonJS({ const jsBufferSource = bufferSource; let jsArrayBuffer = jsBufferSource; let offset = 0; - let length = 0; + let length2 = 0; if (types2.isTypedArray(jsBufferSource) || types2.isDataView(jsBufferSource)) { jsArrayBuffer = jsBufferSource.buffer; offset = jsBufferSource.byteOffset; - length = jsBufferSource.byteLength; + length2 = jsBufferSource.byteLength; } else { assert2(types2.isAnyArrayBuffer(jsBufferSource)); - length = jsBufferSource.byteLength; + length2 = jsBufferSource.byteLength; } if (jsArrayBuffer.detached) { return new Uint8Array(0); } - const bytes = new Uint8Array(length); - const view = new Uint8Array(jsArrayBuffer, offset, length); + const bytes = new Uint8Array(length2); + const view = new Uint8Array(jsArrayBuffer, offset, length2); bytes.set(view); return bytes; }; @@ -49380,8 +49380,8 @@ var require_util18 = __commonJS({ var { isomorphicEncode, collectASequenceOfCodePoints, removeChars } = require_infra(); function responseURL(response) { const urlList = response.urlList; - const length = urlList.length; - return length === 0 ? null : urlList[length - 1].toString(); + const length2 = urlList.length; + return length2 === 0 ? null : urlList[length2 - 1].toString(); } function responseLocationURL(response, requestFragment) { if (!redirectStatusSet.has(response.status)) { @@ -50395,11 +50395,11 @@ var require_formdata_parser3 = __commonJS({ return true; } function validateBoundary(boundary) { - const length = boundary.length; - if (length < 27 || length > 70) { + const length2 = boundary.length; + if (length2 < 27 || length2 > 70) { return false; } - for (let i6 = 0; i6 < length; ++i6) { + for (let i6 = 0; i6 < length2; ++i6) { const cp2 = boundary.charCodeAt(i6); if (!(cp2 >= 48 && cp2 <= 57 || cp2 >= 65 && cp2 <= 90 || cp2 >= 97 && cp2 <= 122 || cp2 === 39 || cp2 === 45 || cp2 === 95)) { return false; @@ -50755,7 +50755,7 @@ var require_body3 = __commonJS({ assert2(webidl.is.ReadableStream(stream5)); let action5 = null; let source = null; - let length = null; + let length2 = null; let type = null; if (typeof object === "string") { source = object; @@ -50773,7 +50773,7 @@ Content-Disposition: form-data`; const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n"); const blobParts = []; const rn = new Uint8Array([13, 10]); - length = 0; + length2 = 0; let hasUnknownSizeValue = false; for (const [name, value] of object) { if (typeof value === "string") { @@ -50782,7 +50782,7 @@ Content-Disposition: form-data`; ${normalizeLinefeeds(value)}\r `); blobParts.push(chunk2); - length += chunk2.byteLength; + length2 += chunk2.byteLength; } else { const chunk2 = textEncoder.encode(`${prefix2}; name="${formdataEscape(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${formdataEscape(value.name)}"` : "") + `\r Content-Type: ${value.type || "application/octet-stream"}\r @@ -50790,7 +50790,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r `); blobParts.push(chunk2, value, rn); if (typeof value.size === "number") { - length += chunk2.byteLength + value.size + rn.byteLength; + length2 += chunk2.byteLength + value.size + rn.byteLength; } else { hasUnknownSizeValue = true; } @@ -50799,9 +50799,9 @@ Content-Type: ${value.type || "application/octet-stream"}\r const chunk = textEncoder.encode(`--${boundary}--\r `); blobParts.push(chunk); - length += chunk.byteLength; + length2 += chunk.byteLength; if (hasUnknownSizeValue) { - length = null; + length2 = null; } source = object; action5 = async function* () { @@ -50816,7 +50816,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r type = `multipart/form-data; boundary=${boundary}`; } else if (webidl.is.Blob(object)) { source = object; - length = object.size; + length2 = object.size; if (object.type) { type = object.type; } @@ -50840,7 +50840,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r } if (typeof source === "string" || isUint8Array(source)) { action5 = () => { - length = typeof source === "string" ? Buffer.byteLength(source) : source.length; + length2 = typeof source === "string" ? Buffer.byteLength(source) : source.length; return source; }; } @@ -50862,7 +50862,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r queueMicrotask(() => readableStreamClose(controller)); })(); } - const body2 = { stream: stream5, source, length }; + const body2 = { stream: stream5, source, length: length2 }; return [body2, type]; } function safelyExtractBody(object, keepalive = false) { @@ -56473,9 +56473,9 @@ var require_retry_handler3 = __commonJS({ if (!Number.isFinite(range5.start) || !Number.isFinite(range5.end)) { return; } - const length = Number(contentLength2); + const length2 = Number(contentLength2); const expectedLength = range5.end - range5.start + 1; - if (!Number.isFinite(length) || length !== expectedLength) { + if (!Number.isFinite(length2) || length2 !== expectedLength) { throw new RequestRetryError("Content-Length mismatch", statusCode, { headers, data: { count: retryCount } @@ -57359,11 +57359,11 @@ var require_readable3 = __commonJS({ while (consume2.stream.read() != null) { } } - function chunksDecode(chunks, length, encoding) { - if (chunks.length === 0 || length === 0) { + function chunksDecode(chunks, length2, encoding) { + if (chunks.length === 0 || length2 === 0) { return ""; } - const buffer2 = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length); + const buffer2 = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length2); const bufferLength = buffer2.length; const start = bufferLength > 2 && buffer2[0] === 239 && buffer2[1] === 187 && buffer2[2] === 191 ? 3 : 0; if (!encoding || encoding === "utf8" || encoding === "utf-8") { @@ -57372,14 +57372,14 @@ var require_readable3 = __commonJS({ return buffer2.subarray(start, bufferLength).toString(encoding); } } - function chunksConcat(chunks, length) { - if (chunks.length === 0 || length === 0) { + function chunksConcat(chunks, length2) { + if (chunks.length === 0 || length2 === 0) { return new Uint8Array(0); } if (chunks.length === 1) { return new Uint8Array(chunks[0]); } - const buffer2 = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer); + const buffer2 = new Uint8Array(Buffer.allocUnsafeSlow(length2).buffer); let offset = 0; for (let i6 = 0; i6 < chunks.length; ++i6) { const chunk = chunks[i6]; @@ -57389,18 +57389,18 @@ var require_readable3 = __commonJS({ return buffer2; } function consumeEnd(consume2, encoding) { - const { type, body: body2, resolve: resolve9, stream: stream5, length } = consume2; + const { type, body: body2, resolve: resolve9, stream: stream5, length: length2 } = consume2; try { if (type === "text") { - resolve9(chunksDecode(body2, length, encoding)); + resolve9(chunksDecode(body2, length2, encoding)); } else if (type === "json") { - resolve9(JSON.parse(chunksDecode(body2, length, encoding))); + resolve9(JSON.parse(chunksDecode(body2, length2, encoding))); } else if (type === "arrayBuffer") { - resolve9(chunksConcat(body2, length).buffer); + resolve9(chunksConcat(body2, length2).buffer); } else if (type === "blob") { resolve9(new Blob(body2, { type: stream5[kContentType] })); } else if (type === "bytes") { - resolve9(chunksConcat(body2, length)); + resolve9(chunksConcat(body2, length2)); } consumeFinish(consume2); } catch (err) { @@ -67766,7 +67766,7 @@ var require_fetch3 = __commonJS({ fetchParams.controller.resume = async () => { while (true) { let bytes; - let isFailure; + let isFailure2; try { const { done, value } = await fetchParams.controller.next(); if (isAborted(fetchParams)) { @@ -67778,7 +67778,7 @@ var require_fetch3 = __commonJS({ bytes = void 0; } else { bytes = err; - isFailure = true; + isFailure2 = true; } } if (bytes === void 0) { @@ -67787,7 +67787,7 @@ var require_fetch3 = __commonJS({ return; } timingInfo.decodedBodySize += bytes?.byteLength ?? 0; - if (isFailure) { + if (isFailure2) { fetchParams.controller.terminate(bytes); return; } @@ -70316,17 +70316,17 @@ var require_receiver3 = __commonJS({ const buffer2 = Buffer.allocUnsafeSlow(n9); while (offset !== n9) { const next = this.#buffers[0]; - const length = next.length; - if (length + offset === n9) { + const length2 = next.length; + if (length2 + offset === n9) { buffer2.set(this.#buffers.shift(), offset); break; - } else if (length + offset > n9) { + } else if (length2 + offset > n9) { buffer2.set(next.subarray(0, n9 - offset), offset); this.#buffers[0] = next.subarray(n9 - offset); break; } else { buffer2.set(this.#buffers.shift(), offset); - offset += length; + offset += length2; } } return buffer2; @@ -71505,11 +71505,11 @@ var require_eventsource_stream3 = __commonJS({ } return true; } - function isFieldName(line, length, field) { - if (length !== field.length) { + function isFieldName(line, length2, field) { + if (length2 !== field.length) { return false; } - for (let i6 = 0; i6 < length; i6++) { + for (let i6 = 0; i6 < length2; i6++) { if (line[i6] !== field[i6]) { return false; } @@ -71760,16 +71760,16 @@ ${value}`; return this.chunks[this.chunkIndex].subarray(this.linePos, this.pos); } const chunks = []; - let length = 0; + let length2 = 0; for (let i6 = this.lineChunkIndex; i6 <= this.chunkIndex; i6++) { const chunk = this.chunks[i6]; const start = i6 === this.lineChunkIndex ? this.linePos : 0; const end = i6 === this.chunkIndex ? this.pos : chunk.length; const slice = chunk.subarray(start, end); - length += slice.length; + length2 += slice.length; chunks.push(slice); } - return Buffer.concat(chunks, length); + return Buffer.concat(chunks, length2); } peekBufferedByte(offset) { let chunkIndex = this.lineChunkIndex; @@ -71785,15 +71785,15 @@ ${value}`; pos = 0; } } - discardLeadingBytes(count) { - while (count > 0 && this.lineChunkIndex < this.chunks.length) { + discardLeadingBytes(count2) { + while (count2 > 0 && this.lineChunkIndex < this.chunks.length) { const chunk = this.chunks[this.lineChunkIndex]; const remaining = chunk.length - this.linePos; - if (count < remaining) { - this.linePos += count; - count = 0; + if (count2 < remaining) { + this.linePos += count2; + count2 = 0; } else { - count -= remaining; + count2 -= remaining; this.lineChunkIndex++; this.linePos = 0; } @@ -75415,20 +75415,20 @@ var require_ms = __commonJS({ function fmtLong(ms2) { var msAbs = Math.abs(ms2); if (msAbs >= d6) { - return plural(ms2, msAbs, d6, "day"); + return plural2(ms2, msAbs, d6, "day"); } if (msAbs >= h6) { - return plural(ms2, msAbs, h6, "hour"); + return plural2(ms2, msAbs, h6, "hour"); } if (msAbs >= m3) { - return plural(ms2, msAbs, m3, "minute"); + return plural2(ms2, msAbs, m3, "minute"); } if (msAbs >= s2) { - return plural(ms2, msAbs, s2, "second"); + return plural2(ms2, msAbs, s2, "second"); } return ms2 + " ms"; } - function plural(ms2, msAbs, n9, name) { + function plural2(ms2, msAbs, n9, name) { var isPlural = msAbs >= n9 * 1.5; return Math.round(ms2 / n9) + " " + name + (isPlural ? "s" : ""); } @@ -76012,13 +76012,13 @@ var require_helpers = __commonJS({ var http3 = __importStar(__require("http")); var https4 = __importStar(__require("https")); async function toBuffer2(stream5) { - let length = 0; + let length2 = 0; const chunks = []; for await (const chunk of stream5) { - length += chunk.length; + length2 += chunk.length; chunks.push(chunk); } - return Buffer.concat(chunks, length); + return Buffer.concat(chunks, length2); } exports2.toBuffer = toBuffer2; async function json(stream5) { @@ -76760,15 +76760,15 @@ var require_brace_expansion = __commonJS({ } function combine2(acc, pre, values, max, maxLength, dropEmpties) { var out = []; - var length = 0; + var length2 = 0; for (var a6 = 0; a6 < acc.length; a6++) { for (var v2 = 0; v2 < values.length; v2++) { if (out.length >= max) return out; var expansion = acc[a6] + pre + values[v2]; if (dropEmpties && !expansion) continue; - if (length + expansion.length > maxLength) return out; + if (length2 + expansion.length > maxLength) return out; out.push(expansion); - length += expansion.length; + length2 += expansion.length; } } return out; @@ -76789,8 +76789,8 @@ var require_brace_expansion = __commonJS({ incr *= -1; test = gte2; } - var pad = n9.some(isPadded2); - var length = 0; + var pad2 = n9.some(isPadded2); + var length2 = 0; for (var i6 = x2; test(i6, y) && N2.length < max; i6 += incr) { var c6; if (isAlphaSequence) { @@ -76800,7 +76800,7 @@ var require_brace_expansion = __commonJS({ } } else { c6 = String(i6); - if (pad) { + if (pad2) { var need = width - c6.length; if (need > 0) { var z = new Array(need + 1).join("0"); @@ -76812,9 +76812,9 @@ var require_brace_expansion = __commonJS({ } } } - if (length + c6.length > maxLength) break; + if (length2 + c6.length > maxLength) break; N2.push(c6); - length += c6.length; + length2 += c6.length; } return N2; } @@ -78130,8 +78130,8 @@ function eachOfLimit(coll, limit3, iteratee, callback) { } function eachOfArrayLike(coll, iteratee, callback) { callback = once(callback); - var index2 = 0, completed = 0, { length } = coll, canceled = false; - if (length === 0) { + var index2 = 0, completed = 0, { length: length2 } = coll, canceled = false; + if (length2 === 0) { callback(null); } function iteratorCallback(err, value) { @@ -78141,11 +78141,11 @@ function eachOfArrayLike(coll, iteratee, callback) { if (canceled === true) return; if (err) { callback(err); - } else if (++completed === length || value === breakLoop) { + } else if (++completed === length2 || value === breakLoop) { callback(null); } } - for (; index2 < length; index2++) { + for (; index2 < length2; index2++) { iteratee(coll[index2], index2, onlyOnce(iteratorCallback)); } } @@ -79178,9 +79178,9 @@ function range2(size) { } return result; } -function timesLimit(count, limit3, iteratee, callback) { +function timesLimit(count2, limit3, iteratee, callback) { var _iteratee = wrapAsync(iteratee); - return mapLimit$1(range2(count), limit3, _iteratee, callback); + return mapLimit$1(range2(count2), limit3, _iteratee, callback); } function times(n9, iteratee, callback) { return timesLimit(n9, Infinity, iteratee, callback); @@ -79752,29 +79752,29 @@ var require_polyfills = __commonJS({ })(fs24.rename); } fs24.read = typeof fs24.read !== "function" ? fs24.read : (function(fs$read) { - function read(fd, buffer2, offset, length, position, callback_) { + function read(fd, buffer2, offset, length2, position, callback_) { var callback; if (callback_ && typeof callback_ === "function") { var eagCounter = 0; callback = function(er, _3, __) { if (er && er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; - return fs$read.call(fs24, fd, buffer2, offset, length, position, callback); + return fs$read.call(fs24, fd, buffer2, offset, length2, position, callback); } callback_.apply(this, arguments); }; } - return fs$read.call(fs24, fd, buffer2, offset, length, position, callback); + return fs$read.call(fs24, fd, buffer2, offset, length2, position, callback); } if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); return read; })(fs24.read); fs24.readSync = typeof fs24.readSync !== "function" ? fs24.readSync : /* @__PURE__ */ (function(fs$readSync) { - return function(fd, buffer2, offset, length, position) { + return function(fd, buffer2, offset, length2, position) { var eagCounter = 0; while (true) { try { - return fs$readSync.call(fs24, fd, buffer2, offset, length, position); + return fs$readSync.call(fs24, fd, buffer2, offset, length2, position); } catch (er) { if (er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; @@ -79973,7 +79973,7 @@ var require_legacy_streams = __commonJS({ this.bufferSize = 64 * 1024; options = options || {}; var keys = Object.keys(options); - for (var index2 = 0, length = keys.length; index2 < length; index2++) { + for (var index2 = 0, length2 = keys.length; index2 < length2; index2++) { var key = keys[index2]; this[key] = options[key]; } @@ -80021,7 +80021,7 @@ var require_legacy_streams = __commonJS({ this.bytesWritten = 0; options = options || {}; var keys = Object.keys(options); - for (var index2 = 0, length = keys.length; index2 < length; index2++) { + for (var index2 = 0, length2 = keys.length; index2 < length2; index2++) { var key = keys[index2]; this[key] = options[key]; } @@ -80541,15 +80541,15 @@ var require_safe_buffer = __commonJS({ copyProps(buffer2, exports2); exports2.Buffer = SafeBuffer; } - function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer3(arg, encodingOrOffset, length); + function SafeBuffer(arg, encodingOrOffset, length2) { + return Buffer3(arg, encodingOrOffset, length2); } copyProps(Buffer3, SafeBuffer); - SafeBuffer.from = function(arg, encodingOrOffset, length) { + SafeBuffer.from = function(arg, encodingOrOffset, length2) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } - return Buffer3(arg, encodingOrOffset, length); + return Buffer3(arg, encodingOrOffset, length2); }; SafeBuffer.alloc = function(size, fill, encoding) { if (typeof size !== "number") { @@ -81164,13 +81164,13 @@ var require_stream_writable = __commonJS({ var buffer2 = new Array(l3); var holder = state5.corkedRequestsFree; holder.entry = entry; - var count = 0; + var count2 = 0; var allBuffers = true; while (entry) { - buffer2[count] = entry; + buffer2[count2] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; - count += 1; + count2 += 1; } buffer2.allBuffers = allBuffers; doWrite(stream5, state5, true, state5.length, buffer2, "", holder.finish); @@ -82584,8 +82584,8 @@ var require_overRest = __commonJS({ function overRest(func, start, transform2) { start = nativeMax(start === void 0 ? func.length - 1 : start, 0); return function() { - var args = arguments, index2 = -1, length = nativeMax(args.length - start, 0), array = Array(length); - while (++index2 < length) { + var args = arguments, index2 = -1, length2 = nativeMax(args.length - start, 0), array = Array(length2); + while (++index2 < length2) { array[index2] = args[start + index2]; } index2 = -1; @@ -82904,16 +82904,16 @@ var require_shortOut = __commonJS({ var HOT_SPAN = 16; var nativeNow = Date.now; function shortOut(func) { - var count = 0, lastCalled = 0; + var count2 = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { - if (++count >= HOT_COUNT) { + if (++count2 >= HOT_COUNT) { return arguments[0]; } } else { - count = 0; + count2 = 0; } return func.apply(void 0, arguments); }; @@ -82995,10 +82995,10 @@ var require_isIndex = __commonJS({ init_cjs_globals(); var MAX_SAFE_INTEGER = 9007199254740991; var reIsUint = /^(?:0|[1-9]\d*)$/; - function isIndex(value, length) { + function isIndex(value, length2) { var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); + length2 = length2 == null ? MAX_SAFE_INTEGER : length2; + return !!length2 && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2); } module.exports = isIndex; } @@ -83236,13 +83236,13 @@ var require_arrayLikeKeys = __commonJS({ var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function arrayLikeKeys(value, inherited) { - var isArr = isArray3(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; + var isArr = isArray3(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length2 = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. - isIndex(key, length)))) { + isIndex(key, length2)))) { result.push(key); } } @@ -83339,12 +83339,12 @@ var require_defaults = __commonJS({ var defaults5 = baseRest(function(object, sources) { object = Object(object); var index2 = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : void 0; + var length2 = sources.length; + var guard = length2 > 2 ? sources[2] : void 0; if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length = 1; + length2 = 1; } - while (++index2 < length) { + while (++index2 < length2) { var source = sources[index2]; var props = keysIn(source); var propsIndex = -1; @@ -84834,9 +84834,9 @@ var require_validators = __commonJS({ }); function validateEncoding(data, encoding) { const normalizedEncoding = normalizeEncoding(encoding); - const length = data.length; - if (normalizedEncoding === "hex" && length % 2 !== 0) { - throw new ERR_INVALID_ARG_VALUE("encoding", encoding, `is invalid for data of length ${length}`); + const length2 = data.length; + if (normalizedEncoding === "hex" && length2 % 2 !== 0) { + throw new ERR_INVALID_ARG_VALUE("encoding", encoding, `is invalid for data of length ${length2}`); } } function validatePort(port, name = "Port", allowZero = true) { @@ -86042,16 +86042,16 @@ var require_safe_buffer2 = __commonJS({ copyProps(buffer2, exports2); exports2.Buffer = SafeBuffer; } - function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer3(arg, encodingOrOffset, length); + function SafeBuffer(arg, encodingOrOffset, length2) { + return Buffer3(arg, encodingOrOffset, length2); } SafeBuffer.prototype = Object.create(Buffer3.prototype); copyProps(Buffer3, SafeBuffer); - SafeBuffer.from = function(arg, encodingOrOffset, length) { + SafeBuffer.from = function(arg, encodingOrOffset, length2) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } - return Buffer3(arg, encodingOrOffset, length); + return Buffer3(arg, encodingOrOffset, length2); }; SafeBuffer.alloc = function(size, fill, encoding) { if (typeof size !== "number") { @@ -87659,17 +87659,17 @@ var require_writable = __commonJS({ } } } - function afterWriteTick({ stream: stream5, state: state5, count, cb }) { + function afterWriteTick({ stream: stream5, state: state5, count: count2, cb }) { state5.afterWriteTickInfo = null; - return afterWrite(stream5, state5, count, cb); + return afterWrite(stream5, state5, count2, cb); } - function afterWrite(stream5, state5, count, cb) { + function afterWrite(stream5, state5, count2, cb) { const needDrain = !state5.ending && !stream5.destroyed && state5.length === 0 && state5.needDrain; if (needDrain) { state5.needDrain = false; stream5.emit("drain"); } - while (count-- > 0) { + while (count2-- > 0) { state5.pendingcb--; cb(); } @@ -88550,7 +88550,7 @@ var require_transform = __commonJS({ Transform4.prototype._write = function(chunk, encoding, callback) { const rState = this._readableState; const wState = this._writableState; - const length = rState.length; + const length2 = rState.length; this._transform(chunk, encoding, (err, val) => { if (err) { callback(err); @@ -88560,7 +88560,7 @@ var require_transform = __commonJS({ this.push(val); } if (wState.ended || // Backwards compat. - length === rState.length || // Backwards compat. + length2 === rState.length || // Backwards compat. rState.length < rState.highWaterMark) { callback(); } else { @@ -89862,8 +89862,8 @@ var require_arrayPush = __commonJS({ "use strict"; init_cjs_globals(); function arrayPush(array, values) { - var index2 = -1, length = values.length, offset = array.length; - while (++index2 < length) { + var index2 = -1, length2 = values.length, offset = array.length; + while (++index2 < length2) { array[offset + index2] = values[index2]; } return array; @@ -89896,10 +89896,10 @@ var require_baseFlatten = __commonJS({ var arrayPush = require_arrayPush(); var isFlattenable = require_isFlattenable(); function baseFlatten(array, depth, predicate, isStrict, result) { - var index2 = -1, length = array.length; + var index2 = -1, length2 = array.length; predicate || (predicate = isFlattenable); result || (result = []); - while (++index2 < length) { + while (++index2 < length2) { var value = array[index2]; if (depth > 0 && predicate(value)) { if (depth > 1) { @@ -89924,8 +89924,8 @@ var require_flatten = __commonJS({ init_cjs_globals(); var baseFlatten = require_baseFlatten(); function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; + var length2 = array == null ? 0 : array.length; + return length2 ? baseFlatten(array, 1) : []; } module.exports = flatten; } @@ -90035,9 +90035,9 @@ var require_Hash = __commonJS({ var hashHas = require_hashHas(); var hashSet = require_hashSet(); function Hash(entries) { - var index2 = -1, length = entries == null ? 0 : entries.length; + var index2 = -1, length2 = entries == null ? 0 : entries.length; this.clear(); - while (++index2 < length) { + while (++index2 < length2) { var entry = entries[index2]; this.set(entry[0], entry[1]); } @@ -90071,10 +90071,10 @@ var require_assocIndexOf = __commonJS({ init_cjs_globals(); var eq = require_eq(); function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; + var length2 = array.length; + while (length2--) { + if (eq(array[length2][0], key)) { + return length2; } } return -1; @@ -90167,9 +90167,9 @@ var require_ListCache = __commonJS({ var listCacheHas = require_listCacheHas(); var listCacheSet = require_listCacheSet(); function ListCache(entries) { - var index2 = -1, length = entries == null ? 0 : entries.length; + var index2 = -1, length2 = entries == null ? 0 : entries.length; this.clear(); - while (++index2 < length) { + while (++index2 < length2) { var entry = entries[index2]; this.set(entry[0], entry[1]); } @@ -90310,9 +90310,9 @@ var require_MapCache = __commonJS({ var mapCacheHas = require_mapCacheHas(); var mapCacheSet = require_mapCacheSet(); function MapCache(entries) { - var index2 = -1, length = entries == null ? 0 : entries.length; + var index2 = -1, length2 = entries == null ? 0 : entries.length; this.clear(); - while (++index2 < length) { + while (++index2 < length2) { var entry = entries[index2]; this.set(entry[0], entry[1]); } @@ -90361,9 +90361,9 @@ var require_SetCache = __commonJS({ var setCacheAdd = require_setCacheAdd(); var setCacheHas = require_setCacheHas(); function SetCache(values) { - var index2 = -1, length = values == null ? 0 : values.length; + var index2 = -1, length2 = values == null ? 0 : values.length; this.__data__ = new MapCache(); - while (++index2 < length) { + while (++index2 < length2) { this.add(values[index2]); } } @@ -90379,8 +90379,8 @@ var require_baseFindIndex = __commonJS({ "use strict"; init_cjs_globals(); function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, index2 = fromIndex + (fromRight ? 1 : -1); - while (fromRight ? index2-- : ++index2 < length) { + var length2 = array.length, index2 = fromIndex + (fromRight ? 1 : -1); + while (fromRight ? index2-- : ++index2 < length2) { if (predicate(array[index2], index2, array)) { return index2; } @@ -90409,8 +90409,8 @@ var require_strictIndexOf = __commonJS({ "use strict"; init_cjs_globals(); function strictIndexOf(array, value, fromIndex) { - var index2 = fromIndex - 1, length = array.length; - while (++index2 < length) { + var index2 = fromIndex - 1, length2 = array.length; + while (++index2 < length2) { if (array[index2] === value) { return index2; } @@ -90443,8 +90443,8 @@ var require_arrayIncludes = __commonJS({ init_cjs_globals(); var baseIndexOf = require_baseIndexOf(); function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; + var length2 = array == null ? 0 : array.length; + return !!length2 && baseIndexOf(array, value, 0) > -1; } module.exports = arrayIncludes; } @@ -90456,8 +90456,8 @@ var require_arrayIncludesWith = __commonJS({ "use strict"; init_cjs_globals(); function arrayIncludesWith(array, value, comparator) { - var index2 = -1, length = array == null ? 0 : array.length; - while (++index2 < length) { + var index2 = -1, length2 = array == null ? 0 : array.length; + while (++index2 < length2) { if (comparator(value, array[index2])) { return true; } @@ -90474,8 +90474,8 @@ var require_arrayMap = __commonJS({ "use strict"; init_cjs_globals(); function arrayMap(array, iteratee) { - var index2 = -1, length = array == null ? 0 : array.length, result = Array(length); - while (++index2 < length) { + var index2 = -1, length2 = array == null ? 0 : array.length, result = Array(length2); + while (++index2 < length2) { result[index2] = iteratee(array[index2], index2, array); } return result; @@ -90509,8 +90509,8 @@ var require_baseDifference = __commonJS({ var cacheHas = require_cacheHas(); var LARGE_ARRAY_SIZE = 200; function baseDifference(array, values, iteratee, comparator) { - var index2 = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length; - if (!length) { + var index2 = -1, includes = arrayIncludes, isCommon = true, length2 = array.length, result = [], valuesLength = values.length; + if (!length2) { return result; } if (iteratee) { @@ -90525,7 +90525,7 @@ var require_baseDifference = __commonJS({ values = new SetCache(values); } outer: - while (++index2 < length) { + while (++index2 < length2) { var value = array[index2], computed = iteratee == null ? value : iteratee(value); value = comparator || value !== 0 ? value : 0; if (isCommon && computed === computed) { @@ -90644,11 +90644,11 @@ var require_baseUniq = __commonJS({ var setToArray = require_setToArray(); var LARGE_ARRAY_SIZE = 200; function baseUniq(array, iteratee, comparator) { - var index2 = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result; + var index2 = -1, includes = arrayIncludes, length2 = array.length, isCommon = true, result = [], seen = result; if (comparator) { isCommon = false; includes = arrayIncludesWith; - } else if (length >= LARGE_ARRAY_SIZE) { + } else if (length2 >= LARGE_ARRAY_SIZE) { var set = iteratee ? null : createSet(array); if (set) { return setToArray(set); @@ -90660,7 +90660,7 @@ var require_baseUniq = __commonJS({ seen = iteratee ? [] : result; } outer: - while (++index2 < length) { + while (++index2 < length2) { var value = array[index2], computed = iteratee ? iteratee(value) : value; value = comparator || value !== 0 ? value : 0; if (isCommon && computed === computed) { @@ -90840,15 +90840,15 @@ var require_brace_expansion2 = __commonJS({ } function combine2(acc, pre, values, max, maxLength, dropEmpties) { var out = []; - var length = 0; + var length2 = 0; for (var a6 = 0; a6 < acc.length; a6++) { for (var v2 = 0; v2 < values.length; v2++) { if (out.length >= max) return out; var expansion = acc[a6] + pre + values[v2]; if (dropEmpties && !expansion) continue; - if (length + expansion.length > maxLength) return out; + if (length2 + expansion.length > maxLength) return out; out.push(expansion); - length += expansion.length; + length2 += expansion.length; } } return out; @@ -90869,8 +90869,8 @@ var require_brace_expansion2 = __commonJS({ incr *= -1; test = gte2; } - var pad = n9.some(isPadded2); - var length = 0; + var pad2 = n9.some(isPadded2); + var length2 = 0; for (var i6 = x2; test(i6, y) && N2.length < max; i6 += incr) { var c6; if (isAlphaSequence) { @@ -90880,7 +90880,7 @@ var require_brace_expansion2 = __commonJS({ } } else { c6 = String(i6); - if (pad) { + if (pad2) { var need = width - c6.length; if (need > 0) { var z = new Array(need + 1).join("0"); @@ -90892,9 +90892,9 @@ var require_brace_expansion2 = __commonJS({ } } } - if (length + c6.length > maxLength) break; + if (length2 + c6.length > maxLength) break; N2.push(c6); - length += c6.length; + length2 += c6.length; } return N2; } @@ -100039,8 +100039,8 @@ var require_b4a = __commonJS({ function fill(buffer2, value, offset, end, encoding) { return toBuffer2(buffer2).fill(value, offset, end, encoding); } - function from(value, encodingOrOffset, length) { - return Buffer.from(value, encodingOrOffset, length); + function from(value, encodingOrOffset, length2) { + return Buffer.from(value, encodingOrOffset, length2); } function includes(buffer2, value, byteOffset, encoding) { return toBuffer2(buffer2).includes(value, byteOffset, encoding); @@ -100070,8 +100070,8 @@ var require_b4a = __commonJS({ function toHex2(buffer2, start, end) { return toBuffer2(buffer2).toString("hex", start, end); } - function write(buffer2, string, offset, length, encoding) { - return toBuffer2(buffer2).write(string, offset, length, encoding); + function write(buffer2, string, offset, length2, encoding) { + return toBuffer2(buffer2).write(string, offset, length2, encoding); } function readDoubleBE(buffer2, offset) { return toBuffer2(buffer2).readDoubleBE(offset); @@ -101716,8 +101716,8 @@ var require_headers5 = __commonJS({ } return positive ? sum : -1 * sum; } - function decodeOct(val, offset, length) { - val = val.subarray(offset, offset + length); + function decodeOct(val, offset, length2) { + val = val.subarray(offset, offset + length2); offset = 0; if (val[offset] & 128) { return parse256(val); @@ -101729,8 +101729,8 @@ var require_headers5 = __commonJS({ return parseInt(b4a.toString(val.subarray(offset, end)), 8); } } - function decodeStr(val, offset, length, encoding) { - return b4a.toString(val.subarray(offset, indexOf(val, 0, offset, offset + length)), encoding); + function decodeStr(val, offset, length2, encoding) { + return b4a.toString(val.subarray(offset, indexOf(val, 0, offset, offset + length2)), encoding); } function addLength(str) { const len = b4a.byteLength(str); @@ -102122,7 +102122,7 @@ var require_pack = __commonJS({ var FMODE = 420; var END_OF_TAR = b4a.alloc(1024); var Sink = class extends Writable2 { - constructor(pack, header, callback) { + constructor(pack2, header, callback) { super({ mapWritable, eagerOpen: true }); this.written = 0; this.header = header; @@ -102131,7 +102131,7 @@ var require_pack = __commonJS({ this._isLinkname = header.type === "symlink" && !header.linkname; this._isVoid = header.type !== "file" && header.type !== "contiguous-file"; this._finished = false; - this._pack = pack; + this._pack = pack2; this._openCallback = null; if (this._pack._stream === null) this._pack._stream = this; else this._pack._pending.push(this); @@ -102315,7 +102315,7 @@ var require_pack = __commonJS({ cb(); } }; - module.exports = function pack(opts) { + module.exports = function pack2(opts) { return new Pack(opts); }; function modeToType(mode) { @@ -103986,11 +103986,11 @@ var require_set_function_length = __commonJS({ var gOPD = require_gopd(); var $TypeError = require_type(); var $floor = GetIntrinsic("%Math.floor%"); - module.exports = function setFunctionLength(fn, length) { + module.exports = function setFunctionLength(fn, length2) { if (typeof fn !== "function") { throw new $TypeError("`fn` is not a function"); } - if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) { + if (typeof length2 !== "number" || length2 < 0 || length2 > 4294967295 || $floor(length2) !== length2) { throw new $TypeError("`length` must be a positive 32-bit integer"); } var loose = arguments.length > 2 && !!arguments[2]; @@ -104011,7 +104011,7 @@ var require_set_function_length = __commonJS({ /** @type {Parameters[0]} */ fn, "length", - length, + length2, true, true ); @@ -104020,7 +104020,7 @@ var require_set_function_length = __commonJS({ /** @type {Parameters[0]} */ fn, "length", - length + length2 ); } } @@ -108472,9 +108472,9 @@ var require_typed_array_length = __commonJS({ function(getter) { if (typeof foundLength !== "number") { try { - var length = getter(value); - if (typeof length === "number") { - foundLength = length; + var length2 = getter(value); + if (typeof length2 === "number") { + foundLength = length2; } } catch (e6) { } @@ -108520,12 +108520,12 @@ var require_IsTypedArrayOutOfBounds = __commonJS({ var byteOffsetStart = typedArrayByteOffset(O2); var isFixed = IsFixedLengthArrayBuffer(typedArrayBuffer(O2)); var byteOffsetEnd; - var length = isFixed ? typedArrayLength(O2) : "AUTO"; - if (length === "AUTO") { + var length2 = isFixed ? typedArrayLength(O2) : "AUTO"; + if (length2 === "AUTO") { byteOffsetEnd = bufferByteLength; } else { var elementSize = TypedArrayElementSize(O2); - byteOffsetEnd = byteOffsetStart + length * elementSize; + byteOffsetEnd = byteOffsetStart + length2 * elementSize; } if (byteOffsetStart > bufferByteLength || byteOffsetEnd > bufferByteLength) { return true; @@ -108558,9 +108558,9 @@ var require_TypedArrayLength = __commonJS({ } var O2 = taRecord["[[Object]]"]; var isFixed = IsFixedLengthArrayBuffer(typedArrayBuffer(O2)); - var length = isFixed ? typedArrayLength(O2) : "AUTO"; - if (length !== "AUTO") { - return length; + var length2 = isFixed ? typedArrayLength(O2) : "AUTO"; + if (length2 !== "AUTO") { + return length2; } if (isFixed) { throw new $TypeError("Assertion failed: array buffer is not fixed length"); @@ -108698,8 +108698,8 @@ var require_TypedArrayCreateFromConstructor = __commonJS({ if (IsTypedArrayOutOfBounds(taRecord)) { throw new $TypeError("new Typed Array is out of bounds"); } - var length = TypedArrayLength(taRecord); - if (length < argumentList[0]) { + var length2 = TypedArrayLength(taRecord); + if (length2 < argumentList[0]) { throw new $TypeError("`argumentList[0]` must be <= `newTypedArray.length`"); } } @@ -108812,9 +108812,9 @@ var require_implementation6 = __commonJS({ } else { final = min(relativeEnd, len); } - var count = max(final - k7, 0); - var A2 = TypedArraySpeciesCreate(O2, [count]); - if (count > 0) { + var count2 = max(final - k7, 0); + var A2 = TypedArraySpeciesCreate(O2, [count2]); + if (count2 > 0) { if (IsDetachedBuffer(typedArrayBuffer(O2))) { throw new $TypeError("Cannot use a Typed Array with an underlying ArrayBuffer that is detached"); } @@ -108827,7 +108827,7 @@ var require_implementation6 = __commonJS({ var srcByteOffset = typedArrayByteOffset(O2); var srcByteIndex = k7 * elementSize + srcByteOffset; var targetByteIndex = typedArrayByteOffset(A2); - var limit3 = targetByteIndex + count * elementSize; + var limit3 = targetByteIndex + count2 * elementSize; while (targetByteIndex < limit3) { var value = GetValueFromBuffer(srcBuffer, srcByteIndex, "UINT8", true, "UNORDERED"); SetValueInBuffer(targetBuffer, targetByteIndex, "UINT8", value, true, "UNORDERED"); @@ -108859,8 +108859,8 @@ var require_polyfill4 = __commonJS({ module.exports = function getPolyfill() { if (typeof Uint8Array === "function" && Uint8Array.prototype.slice) { var ta = new Uint8Array(1); - ta.constructor = function(length) { - return new Uint8Array(length); + ta.constructor = function(length2) { + return new Uint8Array(length2); }; try { ta.slice(); @@ -113130,11 +113130,11 @@ var require_fast_deep_equal = __commonJS({ if (a6 === b6) return true; if (a6 && b6 && typeof a6 == "object" && typeof b6 == "object") { if (a6.constructor !== b6.constructor) return false; - var length, i6, keys; + var length2, i6, keys; if (Array.isArray(a6)) { - length = a6.length; - if (length != b6.length) return false; - for (i6 = length; i6-- !== 0; ) + length2 = a6.length; + if (length2 != b6.length) return false; + for (i6 = length2; i6-- !== 0; ) if (!equal(a6[i6], b6[i6])) return false; return true; } @@ -113142,11 +113142,11 @@ var require_fast_deep_equal = __commonJS({ if (a6.valueOf !== Object.prototype.valueOf) return a6.valueOf() === b6.valueOf(); if (a6.toString !== Object.prototype.toString) return a6.toString() === b6.toString(); keys = Object.keys(a6); - length = keys.length; - if (length !== Object.keys(b6).length) return false; - for (i6 = length; i6-- !== 0; ) + length2 = keys.length; + if (length2 !== Object.keys(b6).length) return false; + for (i6 = length2; i6-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b6, keys[i6])) return false; - for (i6 = length; i6-- !== 0; ) { + for (i6 = length2; i6-- !== 0; ) { var key = keys[i6]; if (!equal(a6[key], b6[key])) return false; } @@ -113304,20 +113304,20 @@ var require_resolve = __commonJS({ return false; } function countKeys(schema2) { - let count = 0; + let count2 = 0; for (const key in schema2) { if (key === "$ref") return Infinity; - count++; + count2++; if (SIMPLE_INLINED.has(key)) continue; if (typeof schema2[key] == "object") { - (0, util_1.eachItem)(schema2[key], (sch) => count += countKeys(sch)); + (0, util_1.eachItem)(schema2[key], (sch) => count2 += countKeys(sch)); } - if (count === Infinity) + if (count2 === Infinity) return Infinity; } - return count; + return count2; } function getFullPath(resolver, id = "", normalize3) { if (normalize3 !== false) @@ -115105,12 +115105,12 @@ var require_fast_uri = __commonJS({ } function hasMalformedPercentEncoding(component) { if (component === void 0) return false; - let percent = component.indexOf("%"); - while (percent !== -1) { - if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) { + let percent2 = component.indexOf("%"); + while (percent2 !== -1) { + if (percent2 + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent2 + 1, percent2 + 3))) { return true; } - percent = component.indexOf("%", percent + 3); + percent2 = component.indexOf("%", percent2 + 3); } return false; } @@ -116168,11 +116168,11 @@ var require_ucs2length = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); function ucs2length(str) { const len = str.length; - let length = 0; + let length2 = 0; let pos = 0; let value; while (pos < len) { - length++; + length2++; value = str.charCodeAt(pos++); if (value >= 55296 && value <= 56319 && pos < len) { value = str.charCodeAt(pos); @@ -116180,7 +116180,7 @@ var require_ucs2length = __commonJS({ pos++; } } - return length; + return length2; } exports2.default = ucs2length; ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'; @@ -116829,8 +116829,8 @@ var require_contains = __commonJS({ cxt.result(valid, () => cxt.reset()); function validateItemsWithCount() { const schValid = gen.name("_valid"); - const count = gen.let("count", 0); - validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))); + const count2 = gen.let("count", 0); + validateItems(schValid, () => gen.if(schValid, () => checkLimits(count2))); } function validateItems(_valid, block) { gen.forRange("i", 0, len, (i6) => { @@ -116843,16 +116843,16 @@ var require_contains = __commonJS({ block(); }); } - function checkLimits(count) { - gen.code((0, codegen_1._)`${count}++`); + function checkLimits(count2) { + gen.code((0, codegen_1._)`${count2}++`); if (max === void 0) { - gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break()); + gen.if((0, codegen_1._)`${count2} >= ${min}`, () => gen.assign(valid, true).break()); } else { - gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break()); + gen.if((0, codegen_1._)`${count2} > ${max}`, () => gen.assign(valid, false).break()); if (min === 1) gen.assign(valid, true); else - gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true)); + gen.if((0, codegen_1._)`${count2} >= ${min}`, () => gen.assign(valid, true)); } } } @@ -118425,12 +118425,12 @@ var require_fs = __commonJS({ return fs24.exists(filename, resolve9); }); }; - exports2.read = function(fd, buffer2, offset, length, position, callback) { + exports2.read = function(fd, buffer2, offset, length2, position, callback) { if (typeof callback === "function") { - return fs24.read(fd, buffer2, offset, length, position, callback); + return fs24.read(fd, buffer2, offset, length2, position, callback); } return new Promise((resolve9, reject2) => { - fs24.read(fd, buffer2, offset, length, position, (err, bytesRead, buffer3) => { + fs24.read(fd, buffer2, offset, length2, position, (err, bytesRead, buffer3) => { if (err) return reject2(err); resolve9({ bytesRead, buffer: buffer3 }); }); @@ -120588,7 +120588,7 @@ var require_XMLCharacterData = __commonJS({ XMLCharacterData2.prototype.clone = function() { return Object.create(this); }; - XMLCharacterData2.prototype.substringData = function(offset, count) { + XMLCharacterData2.prototype.substringData = function(offset, count2) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }; XMLCharacterData2.prototype.appendData = function(arg) { @@ -120597,10 +120597,10 @@ var require_XMLCharacterData = __commonJS({ XMLCharacterData2.prototype.insertData = function(offset, arg) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }; - XMLCharacterData2.prototype.deleteData = function(offset, count) { + XMLCharacterData2.prototype.deleteData = function(offset, count2) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }; - XMLCharacterData2.prototype.replaceData = function(offset, count, arg) { + XMLCharacterData2.prototype.replaceData = function(offset, count2, arg) { throw new Error("This DOM method is not implemented." + this.debugInfo()); }; XMLCharacterData2.prototype.isEqualNode = function(node) { @@ -124933,8 +124933,8 @@ var require_sax = __commonJS({ } else { strictFail(parser2, "Unencoded <"); if (parser2.startTagPosition + 1 < parser2.position) { - var pad = parser2.position - parser2.startTagPosition; - c6 = new Array(pad).join(" ") + c6; + var pad2 = parser2.position - parser2.startTagPosition; + c6 = new Array(pad2).join(" ") + c6; } parser2.textNode += "<" + c6; parser2.state = S.TEXT; @@ -125390,12 +125390,12 @@ var require_sax = __commonJS({ var highSurrogate; var lowSurrogate; var index2 = -1; - var length = arguments.length; - if (!length) { + var length2 = arguments.length; + if (!length2) { return ""; } var result = ""; - while (++index2 < length) { + while (++index2 < length2) { var codePoint = Number(arguments[index2]); if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity` codePoint < 0 || // not a valid Unicode code point @@ -125411,7 +125411,7 @@ var require_sax = __commonJS({ lowSurrogate = codePoint % 1024 + 56320; codeUnits.push(highSurrogate, lowSurrogate); } - if (index2 + 1 === length || codeUnits.length > MAX_SIZE) { + if (index2 + 1 === length2 || codeUnits.length > MAX_SIZE) { result += stringFromCharCode.apply(null, codeUnits); codeUnits.length = 0; } @@ -129142,14 +129142,14 @@ var require_util29 = __commonJS({ if (!s2) { return false; } - var length = s2.length; - if (length < 9) { + var length2 = s2.length; + if (length2 < 9) { return false; } - if (s2.charCodeAt(length - 1) !== 95 || s2.charCodeAt(length - 2) !== 95 || s2.charCodeAt(length - 3) !== 111 || s2.charCodeAt(length - 4) !== 116 || s2.charCodeAt(length - 5) !== 111 || s2.charCodeAt(length - 6) !== 114 || s2.charCodeAt(length - 7) !== 112 || s2.charCodeAt(length - 8) !== 95 || s2.charCodeAt(length - 9) !== 95) { + if (s2.charCodeAt(length2 - 1) !== 95 || s2.charCodeAt(length2 - 2) !== 95 || s2.charCodeAt(length2 - 3) !== 111 || s2.charCodeAt(length2 - 4) !== 116 || s2.charCodeAt(length2 - 5) !== 111 || s2.charCodeAt(length2 - 6) !== 114 || s2.charCodeAt(length2 - 7) !== 112 || s2.charCodeAt(length2 - 8) !== 95 || s2.charCodeAt(length2 - 9) !== 95) { return false; } - for (var i6 = length - 10; i6 >= 0; i6--) { + for (var i6 = length2 - 10; i6 >= 0; i6--) { if (s2.charCodeAt(i6) !== 36) { return false; } @@ -129956,7 +129956,7 @@ var require_source_map_consumer = __commonJS({ var generatedMappings = aSourceMap._mappings.toArray().slice(); var destGeneratedMappings = smc.__generatedMappings = []; var destOriginalMappings = smc.__originalMappings = []; - for (var i6 = 0, length = generatedMappings.length; i6 < length; i6++) { + for (var i6 = 0, length2 = generatedMappings.length; i6 < length2; i6++) { var srcMapping = generatedMappings[i6]; var destMapping = new Mapping(); destMapping.generatedLine = srcMapping.generatedLine; @@ -129996,14 +129996,14 @@ var require_source_map_consumer = __commonJS({ var previousOriginalColumn = 0; var previousSource = 0; var previousName = 0; - var length = aStr.length; + var length2 = aStr.length; var index2 = 0; var cachedSegments = {}; var temp = {}; var originalMappings = []; var generatedMappings = []; var mapping, str, segment, end, value; - while (index2 < length) { + while (index2 < length2) { if (aStr.charAt(index2) === ";") { generatedLine++; index2++; @@ -130013,7 +130013,7 @@ var require_source_map_consumer = __commonJS({ } else { mapping = new Mapping(); mapping.generatedLine = generatedLine; - for (end = index2; end < length; end++) { + for (end = index2; end < length2; end++) { if (this._charIsMappingSeparator(aStr, end)) { break; } @@ -130595,11 +130595,11 @@ var require_source_node = __commonJS({ lastOriginalSource = null; sourceMappingActive = false; } - for (var idx = 0, length = chunk.length; idx < length; idx++) { + for (var idx = 0, length2 = chunk.length; idx < length2; idx++) { if (chunk.charCodeAt(idx) === NEWLINE_CODE) { generated.line++; generated.column = 0; - if (idx + 1 === length) { + if (idx + 1 === length2) { lastOriginalSource = null; sourceMappingActive = false; } else if (sourceMappingActive) { @@ -132102,10 +132102,10 @@ var require_encode = __commonJS({ while (end < single.length - 1 && single[end].charCodeAt(1) + 1 === single[end + 1].charCodeAt(1)) { end += 1; } - var count = 1 + end - start; - if (count < 3) + var count2 = 1 + end - start; + if (count2 < 3) continue; - single.splice(start, count, single[start] + "-" + single[end]); + single.splice(start, count2, single[start] + "-" + single[end]); } multiple.unshift("[" + single.join("") + "]"); return new RegExp(multiple.join("|"), "g"); @@ -132642,21 +132642,21 @@ var require_ansi_to_html = __commonJS({ text = text.replace(handler3.pattern, handler3.sub); } var results1 = []; - var _text = text, length = _text.length; - outer: while (length > 0) { + var _text = text, length2 = _text.length; + outer: while (length2 > 0) { for (var i6 = 0, o3 = 0, len = tokens.length; o3 < len; i6 = ++o3) { var handler2 = tokens[i6]; process6(handler2, i6); - if (text.length !== length) { - length = text.length; + if (text.length !== length2) { + length2 = text.length; continue outer; } } - if (text.length === length) { + if (text.length === length2) { break; } results1.push(0); - length = text.length; + length2 = text.length; } return results1; } @@ -135043,11 +135043,11 @@ var init_env = __esm({ // node_modules/@anthropic-ai/sdk/internal/utils/bytes.mjs function concatBytes2(buffers) { - let length = 0; + let length2 = 0; for (const buffer2 of buffers) { - length += buffer2.length; + length2 += buffer2.length; } - const output = new Uint8Array(length); + const output = new Uint8Array(length2); let index2 = 0; for (const buffer2 of buffers) { output.set(buffer2, index2); @@ -137078,34 +137078,34 @@ var init_parser2 = __esm({ } } let innermostOpenBracket = open2[open2.length - 1]; - let length = tokens.length; + let length2 = tokens.length; let JSON_NUMBER = /^-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?$/; - while (length > 0) { - let lastToken = tokens[length - 1]; + while (length2 > 0) { + let lastToken = tokens[length2 - 1]; switch (lastToken.type) { case "separator": - length--; + length2--; continue; case "number": if (lastToken.unterminated || !JSON_NUMBER.test(lastToken.value)) { - length--; + length2--; continue; } break; case "string": - let tokenBeforeTheLastToken = tokens[length - 2]; + let tokenBeforeTheLastToken = tokens[length2 - 2]; if (innermostOpenBracket === "{" && (tokenBeforeTheLastToken?.type === "delimiter" || tokenBeforeTheLastToken?.type === "brace" && tokenBeforeTheLastToken.value === "{")) { - length--; + length2--; continue; } break; case "delimiter": - length--; + length2--; break; } break; } - return tokens.slice(0, length); + return tokens.slice(0, length2); }; unstrip = (tokens) => { let tail = []; @@ -139101,11 +139101,11 @@ var require_base642 = __commonJS({ } this._paddingCharacter = _paddingCharacter; } - Coder2.prototype.encodedLength = function(length) { + Coder2.prototype.encodedLength = function(length2) { if (!this._paddingCharacter) { - return (length * 8 + 5) / 6 | 0; + return (length2 * 8 + 5) / 6 | 0; } - return (length + 2) / 3 * 4 | 0; + return (length2 + 2) / 3 * 4 | 0; }; Coder2.prototype.encode = function(data) { var out = ""; @@ -139131,11 +139131,11 @@ var require_base642 = __commonJS({ } return out; }; - Coder2.prototype.maxDecodedLength = function(length) { + Coder2.prototype.maxDecodedLength = function(length2) { if (!this._paddingCharacter) { - return (length * 6 + 7) / 8 | 0; + return (length2 * 6 + 7) / 8 | 0; } - return length / 4 * 3 | 0; + return length2 / 4 * 3 | 0; }; Coder2.prototype.decodedLength = function(s2) { return this.maxDecodedLength(s2.length - this._getPaddingLength(s2)); @@ -139145,13 +139145,13 @@ var require_base642 = __commonJS({ return new Uint8Array(0); } var paddingLength = this._getPaddingLength(s2); - var length = s2.length - paddingLength; - var out = new Uint8Array(this.maxDecodedLength(length)); + var length2 = s2.length - paddingLength; + var out = new Uint8Array(this.maxDecodedLength(length2)); var op = 0; var i6 = 0; var haveBad = 0; var v0 = 0, v1 = 0, v2 = 0, v3 = 0; - for (; i6 < length - 4; i6 += 4) { + for (; i6 < length2 - 4; i6 += 4) { v0 = this._decodeChar(s2.charCodeAt(i6 + 0)); v1 = this._decodeChar(s2.charCodeAt(i6 + 1)); v2 = this._decodeChar(s2.charCodeAt(i6 + 2)); @@ -139164,19 +139164,19 @@ var require_base642 = __commonJS({ haveBad |= v2 & INVALID_BYTE; haveBad |= v3 & INVALID_BYTE; } - if (i6 < length - 1) { + if (i6 < length2 - 1) { v0 = this._decodeChar(s2.charCodeAt(i6)); v1 = this._decodeChar(s2.charCodeAt(i6 + 1)); out[op++] = v0 << 2 | v1 >>> 4; haveBad |= v0 & INVALID_BYTE; haveBad |= v1 & INVALID_BYTE; } - if (i6 < length - 2) { + if (i6 < length2 - 2) { v2 = this._decodeChar(s2.charCodeAt(i6 + 2)); out[op++] = v1 << 4 | v2 >>> 2; haveBad |= v2 & INVALID_BYTE; } - if (i6 < length - 3) { + if (i6 < length2 - 3) { v3 = this._decodeChar(s2.charCodeAt(i6 + 3)); out[op++] = v2 << 6 | v3; haveBad |= v3 & INVALID_BYTE; @@ -139270,11 +139270,11 @@ var require_base642 = __commonJS({ return urlSafeCoder.decode(s2); } exports2.decodeURLSafe = decodeURLSafe; - exports2.encodedLength = function(length) { - return stdCoder.encodedLength(length); + exports2.encodedLength = function(length2) { + return stdCoder.encodedLength(length2); }; - exports2.maxDecodedLength = function(length) { - return stdCoder.maxDecodedLength(length); + exports2.maxDecodedLength = function(length2) { + return stdCoder.maxDecodedLength(length2); }; exports2.decodedLength = function(s2) { return stdCoder.decodedLength(s2); @@ -139547,28 +139547,28 @@ var require_sha256 = __commonJS({ this.outer = new Hash(); this.blockSize = this.inner.blockSize; this.digestLength = this.inner.digestLength; - var pad = new Uint8Array(this.blockSize); + var pad2 = new Uint8Array(this.blockSize); if (key.length > this.blockSize) { - new Hash().update(key).finish(pad).clean(); + new Hash().update(key).finish(pad2).clean(); } else { for (var i6 = 0; i6 < key.length; i6++) { - pad[i6] = key[i6]; + pad2[i6] = key[i6]; } } - for (var i6 = 0; i6 < pad.length; i6++) { - pad[i6] ^= 54; + for (var i6 = 0; i6 < pad2.length; i6++) { + pad2[i6] ^= 54; } - this.inner.update(pad); - for (var i6 = 0; i6 < pad.length; i6++) { - pad[i6] ^= 54 ^ 92; + this.inner.update(pad2); + for (var i6 = 0; i6 < pad2.length; i6++) { + pad2[i6] ^= 54 ^ 92; } - this.outer.update(pad); + this.outer.update(pad2); this.istate = new Uint32Array(8); this.ostate = new Uint32Array(8); this.inner._saveState(this.istate); this.outer._saveState(this.ostate); - for (var i6 = 0; i6 < pad.length; i6++) { - pad[i6] = 0; + for (var i6 = 0; i6 < pad2.length; i6++) { + pad2[i6] = 0; } } HMAC2.prototype.reset = function() { @@ -139637,20 +139637,20 @@ var require_sha256 = __commonJS({ counter[0]++; } var hkdfSalt = new Uint8Array(exports3.digestLength); - function hkdf(key, salt, info2, length) { + function hkdf(key, salt, info2, length2) { if (salt === void 0) { salt = hkdfSalt; } - if (length === void 0) { - length = 32; + if (length2 === void 0) { + length2 = 32; } var counter = new Uint8Array([1]); var okm = hmac2(salt, key); var hmac_ = new HMAC(okm); var buffer2 = new Uint8Array(hmac_.digestLength); var bufpos = buffer2.length; - var out = new Uint8Array(length); - for (var i6 = 0; i6 < length; i6++) { + var out = new Uint8Array(length2); + for (var i6 = 0; i6 < length2; i6++) { if (bufpos === buffer2.length) { fillBuffer(buffer2, hmac_, info2, counter); bufpos = 0; @@ -139732,10 +139732,10 @@ var require_timing_safe_equal = __commonJS({ } assert2(a6 instanceof DataView); assert2(b6 instanceof DataView); - const length = a6.byteLength; + const length2 = a6.byteLength; let out = 0; let i6 = -1; - while (++i6 < length) { + while (++i6 < length2) { out |= a6.getUint8(i6) ^ b6.getUint8(i6); } return out === 0; @@ -140446,11 +140446,11 @@ var init_ToolError = __esm({ function wellFormed(text) { return text.replace(LONE_SURROGATE_RE, "\uFFFD"); } -function oneLine(text, limit3 = FIELD_MAX) { +function oneLine2(text, limit3 = FIELD_MAX) { return cutPoints(wellFormed(text).replace(CONTROL_RE, " ").trim(), limit3); } function logSafe(name) { - return oneLine(name, LOG_MAX); + return oneLine2(name, LOG_MAX); } function quotedName(name) { return logSafe(name).replace(/[' ]+/g, " ").trim(); @@ -142894,15 +142894,15 @@ function betaEditTool(ctx) { throw e6; throw new ToolError(`edit: ${fsErrorMessage(e6, file_path)}`); } - const count = data.split(old_string).length - 1; - if (count === 0) + const count2 = data.split(old_string).length - 1; + if (count2 === 0) throw new ToolError(`edit: old_string not found in ${file_path}`); let updated; if (replace_all) { updated = data.split(old_string).join(new_string); } else { - if (count > 1) - throw new ToolError(`edit: old_string appears ${count} times in ${file_path} (must be unique)`); + if (count2 > 1) + throw new ToolError(`edit: old_string appears ${count2} times in ${file_path} (must be unique)`); updated = data.replace(old_string, () => new_string); } try { @@ -142910,7 +142910,7 @@ function betaEditTool(ctx) { } catch (e6) { throw new ToolError(`edit: write: ${fsErrorMessage(e6, file_path)}`); } - return `edited ${file_path} (${replace_all ? count : 1} replacement(s))`; + return `edited ${file_path} (${replace_all ? count2 : 1} replacement(s))`; } }); } @@ -156963,11 +156963,11 @@ var init_buffer_from = __esm({ "use strict"; init_cjs_globals(); init_is_array_buffer(); - fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { + fromArrayBuffer = (input, offset = 0, length2 = input.byteLength - offset) => { if (!isArrayBuffer3(input)) { throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); } - return Buffer.from(input, offset, length); + return Buffer.from(input, offset, length2); }; fromString = (input, encoding) => { if (typeof input !== "string") { @@ -157763,14 +157763,14 @@ var init_toUint8Array = __esm({ }); // node_modules/@smithy/core/dist-es/submodules/serde/concatBytes.js -function concatBytes3(arrays, length) { - if (length === void 0) { - length = 0; +function concatBytes3(arrays, length2) { + if (length2 === void 0) { + length2 = 0; for (const bytes of arrays) { - length += bytes.byteLength; + length2 += bytes.byteLength; } } - const result = new Uint8Array(length); + const result = new Uint8Array(length2); let offset = 0; for (const buf of arrays) { result.set(buf, offset); @@ -158134,18 +158134,18 @@ var init_parseIni = __esm({ if (isSection) { currentSection = void 0; currentSubSection = void 0; - const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); - const matches = prefixKeyRegex.exec(sectionName); + const sectionName2 = trimmedLine.substring(1, trimmedLine.length - 1); + const matches = prefixKeyRegex.exec(sectionName2); if (matches) { const [, prefix2, , name] = matches; if (Object.values(IniSectionType).includes(prefix2)) { currentSection = [prefix2, name].join(CONFIG_PREFIX_SEPARATOR); } } else { - currentSection = sectionName; + currentSection = sectionName2; } - if (profileNameBlockList.includes(sectionName)) { - throw new Error(`Found invalid profile name "${sectionName}"`); + if (profileNameBlockList.includes(sectionName2)) { + throw new Error(`Found invalid profile name "${sectionName2}"`); } } else if (currentSection) { const indexOfEqualsSign = trimmedLine.indexOf("="); @@ -160013,18 +160013,18 @@ async function collectBlob(blob) { async function collectReadableStream(stream5) { const chunks = []; const reader = stream5.getReader(); - let length = 0; + let length2 = 0; while (true) { const { done, value } = await reader.read(); if (value) { chunks.push(value); - length += value.length; + length2 += value.length; } if (done) { break; } } - return concatBytes3(chunks, length); + return concatBytes3(chunks, length2); } var streamCollector; var init_stream_collector_browser = __esm({ @@ -160388,13 +160388,13 @@ var init_Sha256Js = __esm({ this.inner = new _Sha256Js(); this.outer = new _Sha256Js(); const { inner, outer } = this; - const pad = new Uint8Array(BLOCK * 2); + const pad2 = new Uint8Array(BLOCK * 2); for (let i6 = 0; i6 < BLOCK; ++i6) { - pad[i6] = 54 ^ key[i6]; - pad[i6 + BLOCK] = 92 ^ key[i6]; + pad2[i6] = 54 ^ key[i6]; + pad2[i6 + BLOCK] = 92 ^ key[i6]; } - inner.update(pad.subarray(0, BLOCK)); - outer.update(pad.subarray(BLOCK)); + inner.update(pad2.subarray(0, BLOCK)); + outer.update(pad2.subarray(BLOCK)); } } update(data) { @@ -161017,18 +161017,18 @@ var init_EventStreamCodec = __esm({ } encode({ headers: rawHeaders, body: body2 }) { const headers = this.headerMarshaller.format(rawHeaders); - const length = headers.byteLength + body2.byteLength + 16; - const out = new Uint8Array(length); + const length2 = headers.byteLength + body2.byteLength + 16; + const out = new Uint8Array(length2); const view = new DataView(out.buffer, out.byteOffset, out.byteLength); const checksum = new Crc32Node(); - view.setUint32(0, length, false); + view.setUint32(0, length2, false); view.setUint32(4, headers.byteLength, false); checksum.update(out.subarray(0, 8)); view.setUint32(8, checksum.digestSync(), false); out.set(headers, 12); out.set(body2, headers.byteLength + 12); - checksum.update(out.subarray(8, length - 4)); - view.setUint32(length - 4, checksum.digestSync(), false); + checksum.update(out.subarray(8, length2 - 4)); + view.setUint32(length2 - 4, checksum.digestSync(), false); return out; } decode(message) { @@ -162643,11 +162643,11 @@ function contentLengthMiddleware(bodyLengthChecker) { const { body: body2, headers } = request2; if (body2 && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) { try { - const length = bodyLengthChecker(body2); - if (length != null) { + const length2 = bodyLengthChecker(body2); + if (length2 != null) { request2.headers = { ...request2.headers, - [CONTENT_LENGTH_HEADER]: String(length) + [CONTENT_LENGTH_HEADER]: String(length2) }; } } catch (ignored) { @@ -163193,9 +163193,9 @@ var init_DefaultRetryToken = __esm({ $retryLog = { acquisitionDelay: 0 }; - constructor(delay4, count, cost, longPoll) { + constructor(delay4, count2, cost, longPoll) { this.delay = delay4; - this.count = count; + this.count = count2; this.cost = cost; this.longPoll = longPoll; } @@ -169482,8 +169482,8 @@ var init_JsonBytesStringAdapter = __esm({ padEnd(maxLength, fillString) { return this.s().padEnd(maxLength, fillString); } - repeat(count) { - return this.s().repeat(count); + repeat(count2) { + return this.s().repeat(count2); } toUpperCase() { return this.s().toUpperCase(); @@ -181508,11 +181508,11 @@ var Summary = class { */ addTable(rows) { const tableBody = rows.map((row) => { - const cells = row.map((cell) => { - if (typeof cell === "string") { - return this.wrap("td", cell); + const cells = row.map((cell2) => { + if (typeof cell2 === "string") { + return this.wrap("td", cell2); } - const { header, data, colspan, rowspan } = cell; + const { header, data, colspan, rowspan } = cell2; const tag = header ? "th" : "td"; const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); return this.wrap(tag, data, attrs); @@ -184076,9 +184076,9 @@ var ReflectionBinaryReader = class { * If a message field is already present, it will be merged with the * new data. */ - read(reader, message, options, length) { + read(reader, message, options, length2) { this.prepare(); - const end = length === void 0 ? reader.len : reader.pos + length; + const end = length2 === void 0 ? reader.len : reader.pos + length2; while (reader.pos < end) { const [fieldNo, wireType] = reader.tag(), field = this.fieldNoToField.get(fieldNo); if (!field) { @@ -184133,8 +184133,8 @@ var ReflectionBinaryReader = class { * Read a map field, expecting key field = 1, value field = 2 */ mapEntry(field, reader, options) { - let length = reader.uint32(); - let end = reader.pos + length; + let length2 = reader.uint32(); + let end = reader.pos + length2; let key = void 0; let val = void 0; while (reader.pos < end) { @@ -184729,9 +184729,9 @@ var MessageType = class { * the target according to protobuf rules. If the target is * omitted, a new instance is created first. */ - internalBinaryRead(reader, length, options, target) { + internalBinaryRead(reader, length2, options, target) { let message = target !== null && target !== void 0 ? target : this.create(); - this.refBinReader.read(reader, message, options, length); + this.refBinReader.read(reader, message, options, length2); return message; } }; @@ -184834,8 +184834,8 @@ var Timestamp$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -184907,8 +184907,8 @@ var DoubleValue$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -184971,8 +184971,8 @@ var FloatValue$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185035,8 +185035,8 @@ var Int64Value$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185099,8 +185099,8 @@ var UInt64Value$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185163,8 +185163,8 @@ var Int32Value$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185227,8 +185227,8 @@ var UInt32Value$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185291,8 +185291,8 @@ var BoolValue$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185355,8 +185355,8 @@ var StringValue$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185419,8 +185419,8 @@ var BytesValue$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185525,8 +185525,8 @@ var CreateArtifactRequest$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185611,8 +185611,8 @@ var CreateArtifactResponse$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185688,8 +185688,8 @@ var FinalizeArtifactRequest$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185768,8 +185768,8 @@ var FinalizeArtifactResponse$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185832,8 +185832,8 @@ var ListArtifactsRequest$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185893,8 +185893,8 @@ var ListArtifactsResponse$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -185972,8 +185972,8 @@ var ListArtifactsResponse_MonolithArtifact$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -186071,8 +186071,8 @@ var GetSignedArtifactURLRequest$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -186132,8 +186132,8 @@ var GetSignedArtifactURLResponse$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -186195,8 +186195,8 @@ var DeleteArtifactRequest$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -186263,8 +186263,8 @@ var DeleteArtifactResponse$Type = class extends MessageType { reflectionMergePartial(this, message, value); return message; } - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length; + internalBinaryRead(reader, length2, options, target) { + let message = target !== null && target !== void 0 ? target : this.create(), end = reader.pos + length2; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -192403,9 +192403,9 @@ function validateAmpersand(xmlData, i6) { i6++; return validateNumberAmpersand(xmlData, i6); } - let count = 0; - for (; i6 < xmlData.length; i6++, count++) { - if (xmlData[i6].match(/\w/) && count < 20) + let count2 = 0; + for (; i6 < xmlData.length; i6++, count2++) { + if (xmlData[i6].match(/\w/) && count2 < 20) continue; if (xmlData[i6] === ";") break; @@ -198926,8 +198926,8 @@ var NativeCRC64 = (() => { HEAPU32[pnum >> 2] = num; return 0; } - function intArrayFromString(stringy, dontAddNull, length) { - var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1; + function intArrayFromString(stringy, dontAddNull, length2) { + var len = length2 > 0 ? length2 : lengthBytesUTF8(stringy) + 1; var u8array = new Array(len); var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length); if (dontAddNull) u8array.length = numBytesWritten; @@ -199627,20 +199627,20 @@ var NativeCRC64 = (() => { Crc64Hash.__cache__ = {}; Module["Crc64Hash"] = Crc64Hash; Crc64Hash.prototype["OnAppend"] = Crc64Hash.prototype.OnAppend = /** @suppress {undefinedVars, duplicate} @this{Object} */ - function(data, length) { + function(data, length2) { var self2 = this.ptr; if (data && typeof data === "object") data = data.ptr; - if (length && typeof length === "object") length = length.ptr; - _emscripten_bind_Crc64Hash_OnAppend_2(self2, data, length); + if (length2 && typeof length2 === "object") length2 = length2.ptr; + _emscripten_bind_Crc64Hash_OnAppend_2(self2, data, length2); }; ; Crc64Hash.prototype["OnFinal"] = Crc64Hash.prototype.OnFinal = /** @suppress {undefinedVars, duplicate} @this{Object} */ - function(data, length, result) { + function(data, length2, result) { var self2 = this.ptr; if (data && typeof data === "object") data = data.ptr; - if (length && typeof length === "object") length = length.ptr; + if (length2 && typeof length2 === "object") length2 = length2.ptr; if (result && typeof result === "object") result = result.ptr; - _emscripten_bind_Crc64Hash_OnFinal_3(self2, data, length, result); + _emscripten_bind_Crc64Hash_OnFinal_3(self2, data, length2, result); }; ; Crc64Hash.prototype["__destroy__"] = Crc64Hash.prototype.__destroy__ = /** @suppress {undefinedVars, duplicate} @this{Object} */ @@ -199678,10 +199678,10 @@ var StorageCRC64Calculator = class _StorageCRC64Calculator { * @param body - content to be append * @param length - length of the content */ - append(body2, length) { - const ptr = _StorageCRC64Calculator.nativeInstance._malloc(length); + append(body2, length2) { + const ptr = _StorageCRC64Calculator.nativeInstance._malloc(length2); _StorageCRC64Calculator.nativeInstance.HEAPU8.set(body2, ptr); - this.nativeCrc64Hash.OnAppend(ptr, length); + this.nativeCrc64Hash.OnAppend(ptr, length2); _StorageCRC64Calculator.nativeInstance._free(ptr); } /** @@ -199690,11 +199690,11 @@ var StorageCRC64Calculator = class _StorageCRC64Calculator { * @param length - * @returns */ - final(body2, length) { - const ptr = _StorageCRC64Calculator.nativeInstance._malloc(length); + final(body2, length2) { + const ptr = _StorageCRC64Calculator.nativeInstance._malloc(length2); _StorageCRC64Calculator.nativeInstance.HEAPU8.set(body2, ptr); const result = _StorageCRC64Calculator.nativeInstance._malloc(8); - this.nativeCrc64Hash.OnFinal(ptr, length, result); + this.nativeCrc64Hash.OnFinal(ptr, length2, result); _StorageCRC64Calculator.nativeInstance._free(ptr); const resultArray = new Uint8Array(8); resultArray.set(_StorageCRC64Calculator.nativeInstance.HEAPU8.subarray(result, result + 8)); @@ -199795,15 +199795,15 @@ var StructuredMessageEncoding = class { this.state = SMRegion.SegmentContent; } handlingSegmentContent(data) { - const length = Math.min(this.segmentContentLength - this.segmentContentOffset, data.length - this.currentDataOffset); - if (length !== 0) { - const current_content = Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length); - this.messageCrc64.append(current_content, length); - this.segmentCrc64.append(current_content, length); + const length2 = Math.min(this.segmentContentLength - this.segmentContentOffset, data.length - this.currentDataOffset); + if (length2 !== 0) { + const current_content = Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length2); + this.messageCrc64.append(current_content, length2); + this.segmentCrc64.append(current_content, length2); this.pushData(current_content); } - this.segmentContentOffset += length; - this.currentDataOffset += length; + this.segmentContentOffset += length2; + this.currentDataOffset += length2; if (this.segmentContentOffset === this.segmentContentLength) { this.state = SMRegion.SegmentFooter; } @@ -200075,11 +200075,11 @@ var StructuredMessageDecoding = class { } }; parseMessageHeader(data) { - const length = Math.min(MESSAGE_HEADER_LENGTH2 - this.messageHeaderOffset, data.length - this.currentDataOffset); - this.messageHeaderBuffer.set(Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length), this.messageHeaderOffset); - this.currentDataOffset += length; - this.messageHeaderOffset += length; - this.currentOffset += length; + const length2 = Math.min(MESSAGE_HEADER_LENGTH2 - this.messageHeaderOffset, data.length - this.currentDataOffset); + this.messageHeaderBuffer.set(Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length2), this.messageHeaderOffset); + this.currentDataOffset += length2; + this.messageHeaderOffset += length2; + this.currentOffset += length2; if (this.messageHeaderOffset === MESSAGE_HEADER_LENGTH2) { const currentVersion = this.messageHeaderBuffer[0]; if (currentVersion !== MESSAGE_VERSION2) { @@ -200090,11 +200090,11 @@ var StructuredMessageDecoding = class { } } parseSegmentHeader(data) { - const length = Math.min(SEGMENT_HEADER_LENGTH2 - this.segmentHeaderOffset, data.length - this.currentDataOffset); - this.segmentHeaderBuffer.set(Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length), this.segmentHeaderOffset); - this.currentDataOffset += length; - this.segmentHeaderOffset += length; - this.currentOffset += length; + const length2 = Math.min(SEGMENT_HEADER_LENGTH2 - this.segmentHeaderOffset, data.length - this.currentDataOffset); + this.segmentHeaderBuffer.set(Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length2), this.segmentHeaderOffset); + this.currentDataOffset += length2; + this.segmentHeaderOffset += length2; + this.currentOffset += length2; if (this.segmentHeaderOffset === SEGMENT_HEADER_LENGTH2) { const currentSegmentNumber = this.toInt16(Uint8Array.prototype.slice.call(this.segmentHeaderBuffer, 0, 2)); if (currentSegmentNumber !== this.segmentNumber + 1) { @@ -200106,24 +200106,24 @@ var StructuredMessageDecoding = class { } } parseSegmentContent(data) { - const length = Math.min(this.segmentContentLength - this.segmentContentOffset, data.length - this.currentDataOffset); - const dataToHandle = Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length); - this.segmentCrc64.append(dataToHandle, length); - this.messageCrc64.append(dataToHandle, length); + const length2 = Math.min(this.segmentContentLength - this.segmentContentOffset, data.length - this.currentDataOffset); + const dataToHandle = Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length2); + this.segmentCrc64.append(dataToHandle, length2); + this.messageCrc64.append(dataToHandle, length2); this.pushData(dataToHandle); - this.currentDataOffset += length; - this.segmentContentOffset += length; - this.currentOffset += length; + this.currentDataOffset += length2; + this.segmentContentOffset += length2; + this.currentOffset += length2; if (this.segmentContentOffset === this.segmentContentLength) { this.state = SMRegion2.SegmentFooter; } } parseSegmentFooter(data) { - const length = Math.min(FOOTER_LENGTH2 - this.segmentFooterOffset, data.length - this.currentDataOffset); - this.segmentFooterBuffer.set(Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length), this.segmentFooterOffset); - this.currentDataOffset += length; - this.segmentFooterOffset += length; - this.currentOffset += length; + const length2 = Math.min(FOOTER_LENGTH2 - this.segmentFooterOffset, data.length - this.currentDataOffset); + this.segmentFooterBuffer.set(Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length2), this.segmentFooterOffset); + this.currentDataOffset += length2; + this.segmentFooterOffset += length2; + this.currentOffset += length2; if (this.segmentFooterOffset === FOOTER_LENGTH2) { const crc64Result = this.segmentCrc64.final(new Uint8Array([]), 0); if (!this.checkCrc64CheckSum(crc64Result, this.segmentFooterBuffer)) { @@ -200141,11 +200141,11 @@ var StructuredMessageDecoding = class { } } parseMessageFooter(data) { - const length = Math.min(FOOTER_LENGTH2 - this.messageFooterOffset, data.length - this.currentDataOffset); - this.messageFooterBuffer.set(Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length), this.messageFooterOffset); - this.currentDataOffset += length; - this.messageFooterOffset += length; - this.currentOffset += length; + const length2 = Math.min(FOOTER_LENGTH2 - this.messageFooterOffset, data.length - this.currentDataOffset); + this.messageFooterBuffer.set(Uint8Array.prototype.slice.call(data, this.currentDataOffset, this.currentDataOffset + length2), this.messageFooterOffset); + this.currentDataOffset += length2; + this.messageFooterOffset += length2; + this.currentOffset += length2; if (this.messageFooterOffset === FOOTER_LENGTH2) { const crc64Result = this.messageCrc64.final(new Uint8Array([]), 0); if (!this.checkCrc64CheckSum(crc64Result, this.messageFooterBuffer)) { @@ -218129,13 +218129,13 @@ var RetriableReadableStream = class extends Readable5 { * @param count - How much data in original data source to read * @param options - */ - constructor(source, getter, offset, count, options = {}) { + constructor(source, getter, offset, count2, options = {}) { super({ highWaterMark: options.highWaterMark }); this.getter = getter; this.source = source; this.start = offset; this.offset = offset; - this.end = offset + count - 1; + this.end = offset + count2 - 1; this.maxRetryRequests = options.maxRetryRequests && options.maxRetryRequests >= 0 ? options.maxRetryRequests : 0; this.onProgress = options.onProgress; this.options = options; @@ -218694,10 +218694,10 @@ var BlobDownloadResponse = class { * @param count - * @param options - */ - constructor(originalResponse2, getter, offset, count, options = {}) { + constructor(originalResponse2, getter, offset, count2, options = {}) { this.originalResponse = originalResponse2; const streamBody = this.originalResponse.structuredBodyType === void 0 ? this.originalResponse.readableStreamBody : structuredMessageDecodingStream(this.originalResponse.readableStreamBody, options); - this.blobDownloadStream = new RetriableReadableStream(streamBody, getter, offset, count, options); + this.blobDownloadStream = new RetriableReadableStream(streamBody, getter, offset, count2, options); } }; @@ -218731,9 +218731,9 @@ var AvroParser = class _AvroParser { * @param length - * @param options - */ - static async readFixedBytes(stream5, length, options = {}) { - const bytes = await stream5.read(length, { abortSignal: options.abortSignal }); - if (bytes.length !== length) { + static async readFixedBytes(stream5, length2, options = {}) { + const bytes = await stream5.read(length2, { abortSignal: options.abortSignal }); + if (bytes.length !== length2) { throw new Error("Hit stream end."); } return bytes; @@ -218836,12 +218836,12 @@ var AvroParser = class _AvroParser { } static async readArray(stream5, readItemMethod, options = {}) { const items = []; - for (let count = await _AvroParser.readLong(stream5, options); count !== 0; count = await _AvroParser.readLong(stream5, options)) { - if (count < 0) { + for (let count2 = await _AvroParser.readLong(stream5, options); count2 !== 0; count2 = await _AvroParser.readLong(stream5, options)) { + if (count2 < 0) { await _AvroParser.readLong(stream5, options); - count = -count; + count2 = -count2; } - while (count--) { + while (count2--) { const item = await readItemMethod(stream5, options); items.push(item); } @@ -220348,11 +220348,11 @@ import fs4 from "fs"; import util2 from "util"; async function streamToBuffer(stream5, buffer2, offset, end, encoding) { let pos = 0; - const count = end - offset; + const count2 = end - offset; return new Promise((resolve9, reject2) => { const timeout2 = setTimeout(() => reject2(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); stream5.on("readable", () => { - if (pos >= count) { + if (pos >= count2) { clearTimeout(timeout2); resolve9(); return; @@ -220362,10 +220362,10 @@ async function streamToBuffer(stream5, buffer2, offset, end, encoding) { if (typeof chunk === "string") { chunk = Buffer.from(chunk, encoding); } - const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; + const chunkLength = pos + chunk.length > count2 ? count2 - pos : chunk.length; buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; - if (pos >= count) { + if (pos >= count2) { clearTimeout(timeout2); resolve9(); return; @@ -220374,8 +220374,8 @@ async function streamToBuffer(stream5, buffer2, offset, end, encoding) { }); stream5.on("end", () => { clearTimeout(timeout2); - if (pos < count) { - reject2(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); + if (pos < count2) { + reject2(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count2}`)); } resolve9(); }); @@ -220587,7 +220587,7 @@ var BlobClient = class _BlobClient extends StorageClient2 { * } * ``` */ - async download(offset = 0, count, options = {}) { + async download(offset = 0, count2, options = {}) { options.conditions = options.conditions || {}; options.conditions = options.conditions || {}; ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); @@ -220612,7 +220612,7 @@ var BlobClient = class _BlobClient extends StorageClient2 { onDownloadProgress: isNodeLike2 ? void 0 : options.onProgress // for Node.js, progress is reported by RetriableReadableStream }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + range: offset === 0 && !count2 ? void 0 : rangeToString({ offset, count: count2 }), rangeGetContentMD5: options.rangeGetContentMD5, rangeGetContentCRC64: options.rangeGetContentCrc64, snapshot: options.snapshot, @@ -221138,15 +221138,15 @@ var BlobClient = class _BlobClient extends StorageClient2 { async downloadToBuffer(param1, param2, param3, param4 = {}) { let buffer2; let offset = 0; - let count = 0; + let count2 = 0; let options = param4; if (param1 instanceof Buffer) { buffer2 = param1; offset = param2 || 0; - count = typeof param3 === "number" ? param3 : 0; + count2 = typeof param3 === "number" ? param3 : 0; } else { offset = typeof param1 === "number" ? param1 : 0; - count = typeof param2 === "number" ? param2 : 0; + count2 = typeof param2 === "number" ? param2 : 0; options = param3 || {}; } let blockSize = options.blockSize ?? 0; @@ -221159,38 +221159,38 @@ var BlobClient = class _BlobClient extends StorageClient2 { if (offset < 0) { throw new RangeError("offset option must be >= 0"); } - if (count && count <= 0) { + if (count2 && count2 <= 0) { throw new RangeError("count option must be greater than 0"); } if (!options.conditions) { options.conditions = {}; } return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { - if (!count) { + if (!count2) { const response = await this.getProperties({ ...options, tracingOptions: updatedOptions.tracingOptions }); - count = response.contentLength - offset; - if (count < 0) { + count2 = response.contentLength - offset; + if (count2 < 0) { throw new RangeError(`offset ${offset} shouldn't be larger than blob size ${response.contentLength}`); } } if (!buffer2) { try { - buffer2 = Buffer.alloc(count); + buffer2 = Buffer.alloc(count2); } catch (error2) { - throw new Error(`Unable to allocate the buffer of size: ${count}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile". ${error2.message}`); + throw new Error(`Unable to allocate the buffer of size: ${count2}(in bytes). Please try passing your own buffer to the "downloadToBuffer" method or try using other methods like "download" or "downloadToFile". ${error2.message}`); } } - if (buffer2.length < count) { - throw new RangeError(`The buffer's size should be equal to or larger than the request count of bytes: ${count}`); + if (buffer2.length < count2) { + throw new RangeError(`The buffer's size should be equal to or larger than the request count of bytes: ${count2}`); } let transferProgress = 0; const batch = new Batch(options.concurrency); - for (let off = offset; off < offset + count; off = off + blockSize) { + for (let off = offset; off < offset + count2; off = off + blockSize) { batch.addOperation(async () => { - let chunkEnd = offset + count; + let chunkEnd = offset + count2; if (off + blockSize < chunkEnd) { chunkEnd = off + blockSize; } @@ -221230,9 +221230,9 @@ var BlobClient = class _BlobClient extends StorageClient2 { * content is already read and written into a local file * at the specified path. */ - async downloadToFile(filePath, offset = 0, count, options = {}) { + async downloadToFile(filePath, offset = 0, count2, options = {}) { return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, { + const response = await this.download(offset, count2, { ...options, tracingOptions: updatedOptions.tracingOptions }); @@ -221703,14 +221703,14 @@ var AppendBlobClient = class _AppendBlobClient extends BlobClient { * @param count - Number of bytes to be appended as a block * @param options - */ - async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { + async appendBlockFromURL(sourceURL, sourceOffset, count2, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { abortSignal: options.abortSignal, - sourceRange: rangeToString({ offset: sourceOffset, count }), + sourceRange: rangeToString({ offset: sourceOffset, count: count2 }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, @@ -222045,7 +222045,7 @@ var BlockBlobClient = class _BlockBlobClient extends BlobClient { * @param options - Options to the Block Blob Stage Block From URL operation. * @returns Response data for the Block Blob Stage Block From URL operation. */ - async stageBlockFromURL(blockId2, sourceURL, offset = 0, count, options = {}) { + async stageBlockFromURL(blockId2, sourceURL, offset = 0, count2, options = {}) { ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { @@ -222053,7 +222053,7 @@ var BlockBlobClient = class _BlockBlobClient extends BlobClient { leaseAccessConditions: options.conditions, sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, - sourceRange: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + sourceRange: offset === 0 && !count2 ? void 0 : rangeToString({ offset, count: count2 }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), @@ -222288,10 +222288,10 @@ var BlockBlobClient = class _BlockBlobClient extends BlobClient { async uploadFile(filePath, options = {}) { return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { const size = (await fsStat(filePath)).size; - return this.uploadSeekableInternal((offset, count) => { + return this.uploadSeekableInternal((offset, count2) => { return () => fsCreateReadStream(filePath, { autoClose: true, - end: count ? offset + count - 1 : Infinity, + end: count2 ? offset + count2 - 1 : Infinity, start: offset }); }, size, { @@ -222332,18 +222332,18 @@ var BlockBlobClient = class _BlockBlobClient extends BlobClient { stream5, bufferSize, maxConcurrency, - async (body2, length) => { + async (body2, length2) => { const blockID = generateBlockID(blockIDPrefix, blockNum); blockList.push(blockID); blockNum++; - await this.stageBlock(blockID, body2, length, { + await this.stageBlock(blockID, body2, length2, { customerProvidedKey: options.customerProvidedKey, conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions, contentChecksumAlgorithm: options.contentChecksumAlgorithm }); - transferProgress += length; + transferProgress += length2; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress }); } @@ -222502,7 +222502,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * @param options - Options to the Page Blob Upload Pages operation. * @returns Response data for the Page Blob Upload Pages operation. */ - async uploadPages(body2, offset, count, options = {}) { + async uploadPages(body2, offset, count2, options = {}) { options.conditions = options.conditions || {}; ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { @@ -222516,13 +222516,13 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { requestOptions: { onUploadProgress: options.onProgress }, - range: rangeToString({ offset, count }), + range: rangeToString({ offset, count: count2 }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions }; - const uploadBodyParameters = await setUploadChecksumParameters(body2, count, parameters, options, this.blobClientConfig?.uploadContentChecksumAlgorithm); + const uploadBodyParameters = await setUploadChecksumParameters(body2, count2, parameters, options, this.blobClientConfig?.uploadContentChecksumAlgorithm); return assertResponse(await this.pageBlobContext.uploadPages(uploadBodyParameters.contentLength, uploadBodyParameters.body, parameters)); }); } @@ -222537,12 +222537,12 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * @param count - Number of bytes to be uploaded from source page blob * @param options - */ - async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { + async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count2, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { + return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count: count2 }), 0, rangeToString({ offset: destOffset, count: count2 }), { abortSignal: options.abortSignal, sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, @@ -222580,7 +222580,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * @param options - Options to the Page Blob Clear Pages operation. * @returns Response data for the Page Blob Clear Pages operation. */ - async clearPages(offset = 0, count, options = {}) { + async clearPages(offset = 0, count2, options = {}) { options.conditions = options.conditions || {}; return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { return assertResponse(await this.pageBlobContext.clearPages(0, { @@ -222590,7 +222590,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { ...options.conditions, ifTags: options.conditions?.tagConditions }, - range: rangeToString({ offset, count }), + range: rangeToString({ offset, count: count2 }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, @@ -222607,7 +222607,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * @param options - Options to the Page Blob Get Ranges operation. * @returns Response data for the Page Blob Get Ranges operation. */ - async getPageRanges(offset = 0, count, options = {}) { + async getPageRanges(offset = 0, count2, options = {}) { options.conditions = options.conditions || {}; return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { const response = assertResponse(await this.pageBlobContext.getPageRanges({ @@ -222617,7 +222617,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { ...options.conditions, ifTags: options.conditions?.tagConditions }, - range: rangeToString({ offset, count }), + range: rangeToString({ offset, count: count2 }), tracingOptions: updatedOptions.tracingOptions })); return rangeResponseFromModel(response); @@ -222635,7 +222635,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * @param marker - A string value that identifies the portion of the list to be returned with the next list operation. * @param options - Options to PageBlob Get Page Ranges Segment operation. */ - async listPageRangesSegment(offset = 0, count, marker2, options = {}) { + async listPageRangesSegment(offset = 0, count2, marker2, options = {}) { return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { return assertResponse(await this.pageBlobContext.getPageRanges({ abortSignal: options.abortSignal, @@ -222644,7 +222644,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { ...options.conditions, ifTags: options.conditions?.tagConditions }, - range: rangeToString({ offset, count }), + range: rangeToString({ offset, count: count2 }), marker: marker2, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions @@ -222665,11 +222665,11 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * items. The marker value is opaque to the client. * @param options - Options to List Page Ranges operation. */ - async *listPageRangeItemSegments(offset = 0, count, marker2, options = {}) { + async *listPageRangeItemSegments(offset = 0, count2, marker2, options = {}) { let getPageRangeItemSegmentsResponse; if (!!marker2 || marker2 === void 0) { do { - getPageRangeItemSegmentsResponse = await this.listPageRangesSegment(offset, count, marker2, options); + getPageRangeItemSegmentsResponse = await this.listPageRangesSegment(offset, count2, marker2, options); marker2 = getPageRangeItemSegmentsResponse.continuationToken; yield await getPageRangeItemSegmentsResponse; } while (marker2); @@ -222682,9 +222682,9 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * @param count - Number of bytes to get. * @param options - Options to List Page Ranges operation. */ - async *listPageRangeItems(offset = 0, count, options = {}) { + async *listPageRangeItems(offset = 0, count2, options = {}) { let marker2; - for await (const getPageRangesSegment of this.listPageRangeItemSegments(offset, count, marker2, options)) { + for await (const getPageRangesSegment of this.listPageRangeItemSegments(offset, count2, marker2, options)) { yield* ExtractPageRangeInfoItems(getPageRangesSegment); } } @@ -222760,9 +222760,9 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * @param options - Options to the Page Blob Get Ranges operation. * @returns An asyncIterableIterator that supports paging. */ - listPageRanges(offset = 0, count, options = {}) { + listPageRanges(offset = 0, count2, options = {}) { options.conditions = options.conditions || {}; - const iter = this.listPageRangeItems(offset, count, options); + const iter = this.listPageRangeItems(offset, count2, options); return { /** * The next method, part of the iteration protocol @@ -222780,7 +222780,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, { + return this.listPageRangeItemSegments(offset, count2, settings.continuationToken, { maxPageSize: settings.maxPageSize, ...options }); @@ -222797,7 +222797,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * @param options - Options to the Page Blob Get Page Ranges Diff operation. * @returns Response data for the Page Blob Get Page Range Diff operation. */ - async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { + async getPageRangesDiff(offset, count2, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ @@ -222808,7 +222808,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { ifTags: options.conditions?.tagConditions }, prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), + range: rangeToString({ offset, count: count2 }), tracingOptions: updatedOptions.tracingOptions })); return rangeResponseFromModel(result); @@ -222828,7 +222828,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * @param marker - A string value that identifies the portion of the get to be returned with the next get operation. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - async listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options = {}) { + async listPageRangesDiffSegment(offset, count2, prevSnapshotOrUrl, marker2, options = {}) { return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { return assertResponse(await this.pageBlobContext.getPageRangesDiff({ abortSignal: options?.abortSignal, @@ -222840,7 +222840,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { prevsnapshot: prevSnapshotOrUrl, range: rangeToString({ offset, - count + count: count2 }), marker: marker2, maxPageSize: options?.maxPageSize, @@ -222864,11 +222864,11 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * items. The marker value is opaque to the client. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - async *listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { + async *listPageRangeDiffItemSegments(offset, count2, prevSnapshotOrUrl, marker2, options) { let getPageRangeItemSegmentsResponse; if (!!marker2 || marker2 === void 0) { do { - getPageRangeItemSegmentsResponse = await this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options); + getPageRangeItemSegmentsResponse = await this.listPageRangesDiffSegment(offset, count2, prevSnapshotOrUrl, marker2, options); marker2 = getPageRangeItemSegmentsResponse.continuationToken; yield await getPageRangeItemSegmentsResponse; } while (marker2); @@ -222882,9 +222882,9 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - async *listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { + async *listPageRangeDiffItems(offset, count2, prevSnapshotOrUrl, options) { let marker2; - for await (const getPageRangesSegment of this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)) { + for await (const getPageRangesSegment of this.listPageRangeDiffItemSegments(offset, count2, prevSnapshotOrUrl, marker2, options)) { yield* ExtractPageRangeInfoItems(getPageRangesSegment); } } @@ -222970,9 +222970,9 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * @param options - Options to the Page Blob Get Ranges operation. * @returns An asyncIterableIterator that supports paging. */ - listPageRangesDiff(offset, count, prevSnapshot, options = {}) { + listPageRangesDiff(offset, count2, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + const iter = this.listPageRangeDiffItems(offset, count2, prevSnapshot, { ...options }); return { @@ -222992,7 +222992,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, { + return this.listPageRangeDiffItemSegments(offset, count2, prevSnapshot, settings.continuationToken, { maxPageSize: settings.maxPageSize, ...options }); @@ -223009,7 +223009,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { * @param options - Options to the Page Blob Get Page Ranges Diff operation. * @returns Response data for the Page Blob Get Page Range Diff operation. */ - async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl2, options = {}) { + async getPageRangesDiffForManagedDisks(offset, count2, prevSnapshotUrl2, options = {}) { options.conditions = options.conditions || {}; return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ @@ -223020,7 +223020,7 @@ var PageBlobClient = class _PageBlobClient extends BlobClient { ifTags: options.conditions?.tagConditions }, prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + range: rangeToString({ offset, count: count2 }), tracingOptions: updatedOptions.tracingOptions })); return rangeResponseFromModel(response); @@ -228723,7 +228723,8 @@ function isInputKey(key) { "communityReport", "insightsReport", "slowestReport", - "fileReport" + "fileReport", + "timelineReport" ]; return validInputKeys.includes(key); } @@ -228750,10 +228751,10 @@ function isAnySkippedReportEnabled(inputs) { return inputs.skippedReport; } function isAnyReportEnabled(inputs) { - return inputs.summaryReport || inputs.summaryDeltaReport || inputs.githubReport || inputs.failedReport || inputs.flakyReport || inputs.flakyRateReport || inputs.failedFoldedReport || inputs.failRateReport || inputs.previousResultsReport || inputs.aiReport || inputs.aiSummaryReport || inputs.skippedReport || inputs.testReport || inputs.testListReport || inputs.suiteFoldedReport || inputs.suiteListReport || inputs.pullRequestReport || inputs.commitReport || inputs.customReport || inputs.communityReport || inputs.insightsReport || inputs.slowestReport || inputs.fileReport || inputs.testsChangedReport; + return inputs.summaryReport || inputs.summaryDeltaReport || inputs.githubReport || inputs.failedReport || inputs.flakyReport || inputs.flakyRateReport || inputs.failedFoldedReport || inputs.failRateReport || inputs.previousResultsReport || inputs.aiReport || inputs.aiSummaryReport || inputs.skippedReport || inputs.testReport || inputs.testListReport || inputs.suiteFoldedReport || inputs.suiteListReport || inputs.pullRequestReport || inputs.commitReport || inputs.customReport || inputs.communityReport || inputs.insightsReport || inputs.slowestReport || inputs.fileReport || inputs.timelineReport || inputs.testsChangedReport; } function numberOfReportsEnabled(inputs) { - return (inputs.summaryReport ? 1 : 0) + (inputs.summaryDeltaReport ? 1 : 0) + (inputs.githubReport ? 1 : 0) + (inputs.failedReport ? 1 : 0) + (inputs.flakyReport ? 1 : 0) + (inputs.flakyRateReport ? 1 : 0) + (inputs.failedFoldedReport ? 1 : 0) + (inputs.failRateReport ? 1 : 0) + (inputs.previousResultsReport ? 1 : 0) + (inputs.aiReport ? 1 : 0) + (inputs.aiSummaryReport ? 1 : 0) + (inputs.skippedReport ? 1 : 0) + (inputs.testReport ? 1 : 0) + (inputs.testListReport ? 1 : 0) + (inputs.suiteFoldedReport ? 1 : 0) + (inputs.suiteListReport ? 1 : 0) + (inputs.pullRequestReport ? 1 : 0) + (inputs.commitReport ? 1 : 0) + (inputs.customReport ? 1 : 0) + (inputs.communityReport ? 1 : 0) + (inputs.insightsReport ? 1 : 0) + (inputs.slowestReport ? 1 : 0) + (inputs.fileReport ? 1 : 0) + (inputs.testsChangedReport ? 1 : 0); + return (inputs.summaryReport ? 1 : 0) + (inputs.summaryDeltaReport ? 1 : 0) + (inputs.githubReport ? 1 : 0) + (inputs.failedReport ? 1 : 0) + (inputs.flakyReport ? 1 : 0) + (inputs.flakyRateReport ? 1 : 0) + (inputs.failedFoldedReport ? 1 : 0) + (inputs.failRateReport ? 1 : 0) + (inputs.previousResultsReport ? 1 : 0) + (inputs.aiReport ? 1 : 0) + (inputs.aiSummaryReport ? 1 : 0) + (inputs.skippedReport ? 1 : 0) + (inputs.testReport ? 1 : 0) + (inputs.testListReport ? 1 : 0) + (inputs.suiteFoldedReport ? 1 : 0) + (inputs.suiteListReport ? 1 : 0) + (inputs.pullRequestReport ? 1 : 0) + (inputs.commitReport ? 1 : 0) + (inputs.customReport ? 1 : 0) + (inputs.communityReport ? 1 : 0) + (inputs.insightsReport ? 1 : 0) + (inputs.slowestReport ? 1 : 0) + (inputs.fileReport ? 1 : 0) + (inputs.timelineReport ? 1 : 0) + (inputs.testsChangedReport ? 1 : 0); } // node_modules/junit-to-ctrf/dist/index.js @@ -229495,6 +229496,2369 @@ function convertTimestamp() { // src/handlebars/helpers/ctrf.ts init_cjs_globals(); var import_handlebars2 = __toESM(require_lib5(), 1); + +// src/ctrf/timeline/index.ts +init_cjs_globals(); + +// src/ctrf/timeline/collect.ts +init_cjs_globals(); + +// src/ctrf/timeline/heap.ts +init_cjs_globals(); +var MinHeap = class { + constructor(less) { + this.less = less; + } + less; + items = []; + get size() { + return this.items.length; + } + peek() { + return this.items[0]; + } + push(item) { + const items = this.items; + items.push(item); + let index2 = items.length - 1; + while (index2 > 0) { + const parent2 = index2 - 1 >> 1; + if (!this.less(items[index2], items[parent2])) { + break; + } + [items[index2], items[parent2]] = [items[parent2], items[index2]]; + index2 = parent2; + } + } + pop() { + const items = this.items; + if (items.length === 0) { + return void 0; + } + const top2 = items[0]; + const last = items.pop(); + if (items.length > 0) { + items[0] = last; + let index2 = 0; + for (; ; ) { + const left2 = 2 * index2 + 1; + const right2 = left2 + 1; + let smallest = index2; + if (left2 < items.length && this.less(items[left2], items[smallest])) { + smallest = left2; + } + if (right2 < items.length && this.less(items[right2], items[smallest])) { + smallest = right2; + } + if (smallest === index2) { + break; + } + [items[index2], items[smallest]] = [items[smallest], items[index2]]; + index2 = smallest; + } + } + return top2; + } +}; + +// src/ctrf/timeline/types.ts +init_cjs_globals(); +var TIMELINE_LIMITS = { + maxDiagramChars: 2e4, + maxLanes: 40, + maxRows: 100 +}; + +// src/ctrf/timeline/collect.ts +var JITTER_MS = 1; +var THREAD_JITTER_MS = 5; +var SECOND_MS = 1e3; +var WHOLE_SECONDS_SHARE = 0.9; +var MISMATCHED_DURATIONS_SHARE = 0.1; +var MIN_CUT_MS = 5 * 6e4; +var CUT_SPACER = 0.03; +var MAX_CUTS = 20; +var HISTORY_SHARE = 0.9; +var ATTEMPT_LANES = 4; +var PLAUSIBLE_INFERRED_LANES = 16; +var MIN_TESTS_FOR_SAME_START = 20; +var EARLIEST_MS = 1e12; +var LATEST_MS = 1e13; +var GO_TEST = /^(Test|Benchmark|Fuzz|Example)/; +var STATUSES = [ + "passed", + "failed", + "skipped", + "pending", + "other" +]; +var threadOrder = new Intl.Collator("en", { + numeric: true, + sensitivity: "base" +}); +function collectTimeline(tests, limits = {}) { + const { maxLanes } = { ...TIMELINE_LIMITS, ...limits }; + const { entries, coarse } = readTests(tests); + const counts = { + untimed: 0, + untimedFailed: 0, + untimedAttempts: 0, + invalid: 0, + notRun: 0 + }; + const units = /* @__PURE__ */ new Set(); + let envelopes = 0; + const collected = []; + for (const { base, status, times: times2, attempts: tries } of entries) { + let timing2 = resolveTiming(times2, coarse); + const attempts2 = []; + for (const attempt of tries) { + const ran = attempt.status !== "skipped" && attempt.status !== "pending"; + const attemptTiming = resolveTiming(attempt.times, coarse); + if (typeof attemptTiming !== "object") { + counts.untimedAttempts += ran ? 1 : 0; + continue; + } + if (!ran && attemptTiming.stop <= attemptTiming.start) { + continue; + } + units.add(attemptTiming.unit); + attempts2.push({ + ...base, + status: attempt.status, + kind: kindOf(attempt.status, true), + start: attemptTiming.start, + stop: attemptTiming.stop, + attempt: attempt.attempt + }); + } + if (typeof timing2 === "object" && attempts2.length > 0) { + const final = timing2; + const last = attempts2.reduce((a6, b6) => b6.start > a6.start ? b6 : a6); + if (last.status === status && Math.abs(last.stop - final.stop) <= JITTER_MS && final.stop - final.start > last.stop - last.start && attempts2.every((a6) => a6.start >= final.start && a6.stop <= final.stop)) { + timing2 = { ...final, start: last.start, stop: last.stop }; + attempts2.splice(attempts2.indexOf(last), 1); + envelopes++; + } + } + for (const attempt of attempts2) { + collected.push(attempt); + } + const notRun = status === "skipped" || status === "pending"; + if (notRun && (typeof timing2 !== "object" || timing2.stop <= timing2.start)) { + counts.notRun++; + } else if (timing2 === "invalid") { + counts.invalid++; + } else if (timing2 === void 0) { + counts.untimed++; + counts.untimedFailed += status === "failed" ? 1 : 0; + } else { + units.add(timing2.unit); + collected.push({ + ...base, + status, + kind: kindOf(status, false), + start: timing2.start, + stop: timing2.stop + }); + } + } + const { unique, duplicates } = dropDuplicates(collected); + const { kept: withoutParents, parents } = dropParentTests(unique); + const { kept: measured, unmeasured } = dropUnmeasured(withoutParents, coarse); + const runs = splitRuns(measured); + let { lanes, inferredLanes, splitThreads, strayAttempts } = arrange( + runs.kept, + coarse + ); + const threadIds = /* @__PURE__ */ new Set(); + for (const execution of runs.kept) { + if (execution.threadId !== void 0) { + threadIds.add(execution.threadId); + } + } + let tooManyThreads = 0; + let crowdedThreads = 0; + const threadLanes = lanes.filter((lane) => lane.origin === "thread").length; + if (!inferredLanes && threadLanes > maxLanes) { + const packed = coarse ? packCoarse(runs.kept) : pack(runs.kept, toleranceFor(JITTER_MS)); + if (packed.length <= maxLanes) { + if (threadIds.size > maxLanes) { + tooManyThreads = threadIds.size; + } else { + crowdedThreads = threadIds.size; + } + lanes = packed.map((executions, index2) => ({ + name: `Lane ${index2 + 1}`, + origin: "inferred", + executions + })); + inferredLanes = true; + splitThreads = []; + strayAttempts = 0; + } + } + const { lanes: cutLanes, cuts } = cutBetweenRuns(lanes); + const { shown, hidden } = chooseLanes(cutLanes, maxLanes); + let start = Number.POSITIVE_INFINITY; + let stop = Number.NEGATIVE_INFINITY; + let finals = 0; + let attempts = 0; + let skippedDrawn = false; + for (const lane of cutLanes) { + for (const execution of lane.executions) { + start = Math.min(start, execution.start); + stop = Math.max(stop, execution.stop); + if (execution.attempt === void 0) { + finals++; + } else { + attempts++; + } + skippedDrawn ||= execution.status === "skipped" || execution.status === "pending"; + } + } + const total = finals + attempts; + return { + lanes: shown, + hiddenLanes: hidden, + start: total > 0 ? start : 0, + stop: total > 0 ? stop : 0, + threads: inferredLanes ? 0 : threadIds.size, + inferredLanes, + implausibleLanes: inferredLanes && cutLanes.length > PLAUSIBLE_INFERRED_LANES, + tooManyThreads, + crowdedThreads, + splitThreads, + strayAttempts, + tests: finals, + attempts, + skippedDrawn, + coarse, + ...counts, + duplicates: duplicates + envelopes, + parents, + unmeasured, + history: runs.history, + rerun: runs.rerun, + cuts, + convertedUnits: [...units].filter((unit) => unit !== "ms") + }; +} +function busyTime(executions) { + let busy = 0; + let lastStop = Number.NEGATIVE_INFINITY; + for (const execution of executions) { + const start = Math.max(execution.start, lastStop); + if (execution.stop > start) { + busy += execution.stop - start; + } + lastStop = Math.max(lastStop, execution.stop); + } + return busy; +} +function readTests(tests) { + const entries = []; + let timestamps = 0; + let wholeSeconds = 0; + let durations = 0; + let mismatched = 0; + const read = (start, stop, duration3) => { + const from = epochMs(start); + const to = epochMs(stop); + for (const time2 of [from, to]) { + if (time2) { + timestamps++; + wholeSeconds += time2.ms % SECOND_MS === 0 ? 1 : 0; + } + } + const number = toNumber2(duration3); + const length2 = number !== void 0 && number >= 0 ? number : void 0; + if (from && to && length2 !== void 0) { + durations++; + mismatched += Math.abs(to.ms - from.ms - length2) > JITTER_MS ? 1 : 0; + } + return { from, to, length: length2 }; + }; + for (const test of Array.isArray(tests) ? tests : []) { + if (!test || typeof test !== "object") { + continue; + } + const name = String(test.name ?? ""); + const label = labelOf(test, name); + const scope = JSON.stringify([ + test.filePath ?? "", + normalizeSuite(test.suite) ?? "" + ]); + const attempts = []; + if (Array.isArray(test.retryAttempts)) { + test.retryAttempts.forEach((attempt, index2) => { + if (!attempt || typeof attempt !== "object") { + return; + } + attempts.push({ + status: normalizeStatus(attempt.status), + times: read(attempt.start, attempt.stop, attempt.duration), + attempt: typeof attempt.attempt === "number" ? attempt.attempt : index2 + 1 + }); + }); + } + entries.push({ + base: { + name, + label, + testId: identityOf(test, label), + scope, + threadId: laneKey(test) + }, + status: normalizeStatus(test.status), + times: read(test.start, test.stop, test.duration), + attempts + }); + } + return { + entries, + coarse: timestamps > 0 && wholeSeconds >= WHOLE_SECONDS_SHARE * timestamps && mismatched > 0 && mismatched >= MISMATCHED_DURATIONS_SHARE * durations + }; +} +function normalizeStatus(status) { + return STATUSES.includes(status) ? status : "other"; +} +function kindOf(status, isAttempt) { + if (status === "failed") { + return isAttempt ? "retry" : "failed"; + } + return status === "passed" ? "passed" : "other"; +} +function laneKey(test) { + return normalizeThreadId(test.threadId) ?? normalizeThreadId( + test.extra?.worker + ); +} +function normalizeThreadId(threadId) { + if (typeof threadId !== "string" && typeof threadId !== "number") { + return void 0; + } + const text = String(threadId).trim(); + return text === "" ? void 0 : text; +} +function identityOf(test, label) { + const id = test.testId ?? test.id; + if (typeof id === "string" || typeof id === "number") { + return String(id); + } + return JSON.stringify([ + test.filePath ?? "", + normalizeSuite(test.suite) ?? "", + label + ]); +} +function labelOf(test, name) { + const workspace = process.env.GITHUB_WORKSPACE || ""; + const prefixes = [normalizeSuite(test.suite), test.filePath]; + if (test.filePath && workspace && test.filePath.startsWith(workspace)) { + prefixes.push(test.filePath.slice(workspace.length)); + } + let label = name; + for (let pass = 0; pass < 3; pass++) { + const prefix2 = prefixes.find( + (text) => text && label.startsWith(`${text} - `) && label.length > text.length + 3 + ); + if (!prefix2) { + break; + } + label = label.slice(prefix2.length + 3); + } + return label; +} +function toNumber2(value) { + if (typeof value === "string" && value.trim() !== "") { + value = Number(value); + } + return typeof value === "number" && Number.isFinite(value) ? value : void 0; +} +function epochMs(value) { + const number = toNumber2(value); + if (number === void 0) { + return void 0; + } + if (number >= 1e12 && number < 1e13) { + return { ms: number, unit: "ms" }; + } + if (number >= 1e9 && number < 1e10) { + return { ms: number * 1e3, unit: "s" }; + } + if (number >= 1e15 && number < 1e16) { + return { ms: number / 1e3, unit: "\xB5s" }; + } + if (number >= 1e18 && number < 1e19) { + return { ms: number / 1e6, unit: "ns" }; + } + return void 0; +} +function resolveTiming({ from, to, length: length2 }, coarse) { + let interval; + if (from && to) { + const wholeSeconds = from.ms % SECOND_MS === 0 && to.ms % SECOND_MS === 0; + if (length2 !== void 0 && (coarse || wholeSeconds || to.ms === from.ms && length2 > 0)) { + interval = [from.ms, from.ms + length2]; + } else if (to.ms >= from.ms) { + interval = [from.ms, to.ms]; + } else if (length2 !== void 0) { + interval = [from.ms, from.ms + length2]; + } else { + return "invalid"; + } + } else if (from && length2 !== void 0) { + interval = [from.ms, from.ms + length2]; + } else if (to && length2 !== void 0) { + interval = [to.ms - length2, to.ms]; + } else { + return void 0; + } + if (interval[0] < EARLIEST_MS || interval[1] >= LATEST_MS) { + return "invalid"; + } + const start = Math.round(interval[0]); + return { + start, + stop: Math.max(start, Math.round(interval[1])), + unit: (from ?? to)?.unit ?? "ms" + }; +} +function dropDuplicates(executions) { + const order = executions.map((_3, index2) => index2); + order.sort((x2, y) => { + const a6 = executions[x2]; + const b6 = executions[y]; + return a6.start - b6.start || a6.stop - b6.stop || compareText(a6.threadId ?? "", b6.threadId ?? "") || compareText(a6.testId, b6.testId) || compareText(a6.status, b6.status) || (a6.attempt ?? -1) - (b6.attempt ?? -1) || x2 - y; + }); + const dropped = new Uint8Array(executions.length); + let kept; + for (const index2 of order) { + const execution = executions[index2]; + if (kept && kept.start === execution.start && kept.stop === execution.stop && kept.threadId === execution.threadId && kept.testId === execution.testId && kept.status === execution.status) { + dropped[index2] = 1; + continue; + } + kept = execution; + } + const unique = executions.filter((_3, index2) => dropped[index2] === 0); + return { unique, duplicates: executions.length - unique.length }; +} +function compareText(a6, b6) { + return a6 < b6 ? -1 : a6 > b6 ? 1 : 0; +} +function dropParentTests(executions) { + const subtests = /* @__PURE__ */ new Map(); + for (const execution of executions) { + const name = execution.label; + if (!GO_TEST.test(name)) { + continue; + } + for (let slash = name.indexOf("/"); slash > 0; slash = name.indexOf("/", slash + 1)) { + const key = parentKey(execution, name.slice(0, slash)); + const list = subtests.get(key); + if (list) { + list.push(execution); + } else { + subtests.set(key, [execution]); + } + } + } + if (subtests.size === 0) { + return { kept: executions, parents: 0 }; + } + const kept = []; + let parents = 0; + for (const execution of executions) { + const children2 = subtests.get(parentKey(execution, execution.label)); + if (children2 && groupsSubtests(execution, children2)) { + parents += execution.attempt === void 0 ? 1 : 0; + } else { + kept.push(execution); + } + } + return { kept, parents }; +} +function parentKey(execution, name) { + return JSON.stringify([execution.threadId ?? "", execution.scope, name]); +} +function groupsSubtests(parent2, children2) { + let inside = false; + let failedInside = false; + for (const child of children2) { + const overlaps = child.stop > child.start ? child.start < parent2.stop && child.stop > parent2.start : child.start >= parent2.start && child.start <= parent2.stop; + if (!overlaps) { + continue; + } + if (child.start < parent2.start || child.stop > parent2.stop) { + return false; + } + inside = true; + failedInside ||= child.kind === "failed" || child.kind === "retry"; + } + return inside && (parent2.kind !== "failed" || failedInside); +} +function dropUnmeasured(executions, coarse) { + const unmeasured = { tests: 0, failed: 0, threads: [] }; + if (coarse) { + return { kept: executions, unmeasured }; + } + const groups = /* @__PURE__ */ new Map(); + const sizes = /* @__PURE__ */ new Map(); + for (const execution of executions) { + if (execution.stop - execution.start <= JITTER_MS) { + continue; + } + const key = execution.threadId ?? ""; + let starts = groups.get(key); + if (!starts) { + starts = /* @__PURE__ */ new Map(); + groups.set(key, starts); + } + starts.set(execution.start, (starts.get(execution.start) ?? 0) + 1); + sizes.set(key, (sizes.get(key) ?? 0) + 1); + } + const flagged = /* @__PURE__ */ new Set(); + for (const [key, starts] of groups) { + const size = sizes.get(key) ?? 0; + for (const same of starts.values()) { + if (same >= MIN_TESTS_FOR_SAME_START && same * 2 >= size) { + flagged.add(key); + break; + } + } + } + if (flagged.size === 0) { + return { kept: executions, unmeasured }; + } + const kept = []; + for (const execution of executions) { + if (!flagged.has(execution.threadId ?? "")) { + kept.push(execution); + } else if (execution.attempt === void 0) { + unmeasured.tests++; + unmeasured.failed += execution.kind === "failed" ? 1 : 0; + } + } + unmeasured.threads = [...flagged].sort(threadOrder.compare); + return { kept, unmeasured }; +} +function splitRuns(executions) { + const sorted = [...executions].sort((a6, b6) => a6.start - b6.start); + const stretches = []; + sorted.forEach((execution, index2) => { + const last = stretches[stretches.length - 1]; + if (last && execution.start <= last.stop) { + last.stop = Math.max(last.stop, execution.stop); + } else { + stretches.push({ + start: execution.start, + stop: execution.stop, + first: index2 + }); + } + }); + let active = 0; + for (const stretch of stretches) { + active += stretch.stop - stretch.start; + } + const runStarts = []; + let runStop = Number.NEGATIVE_INFINITY; + for (const stretch of stretches) { + const gap = stretch.start - runStop; + if (runStarts.length === 0 || gap > MIN_CUT_MS && gap > active) { + runStarts.push(stretch.first); + } + runStop = Math.max(runStop, stretch.stop); + } + if (runStarts.length < 2) { + return { kept: sorted, history: 0, rerun: 0 }; + } + const runOf = new Int32Array(sorted.length); + for (let run2 = 0; run2 < runStarts.length; run2++) { + const end = runStarts[run2 + 1] ?? sorted.length; + runOf.fill(run2, runStarts[run2], end); + } + const lastRun = /* @__PURE__ */ new Map(); + sorted.forEach((execution, index2) => { + if (execution.attempt === void 0) { + lastRun.set(execution.testId, runOf[index2]); + } + }); + const results = new Array(runStarts.length).fill(0); + const superseded = new Array(runStarts.length).fill(0); + sorted.forEach((execution, index2) => { + const run2 = runOf[index2]; + results[run2]++; + superseded[run2] += (lastRun.get(execution.testId) ?? run2) > run2 ? 1 : 0; + }); + const kept = []; + let history = 0; + let rerun = 0; + sorted.forEach((execution, index2) => { + const run2 = runOf[index2]; + const later = (lastRun.get(execution.testId) ?? run2) > run2; + if (later && superseded[run2] >= HISTORY_SHARE * results[run2]) { + history++; + return; + } + if (later && execution.attempt === void 0) { + rerun++; + kept.push({ + ...execution, + attempt: 0, + kind: execution.kind === "failed" ? "retry" : execution.kind, + run: run2 + }); + return; + } + kept.push({ ...execution, run: run2 }); + }); + return { kept, history, rerun }; +} +function cutBetweenRuns(lanes) { + const extents = /* @__PURE__ */ new Map(); + for (const lane of lanes) { + for (const execution of lane.executions) { + if (execution.run === void 0) { + continue; + } + const extent = extents.get(execution.run); + if (extent) { + extent.start = Math.min(extent.start, execution.start); + extent.stop = Math.max(extent.stop, execution.stop); + } else { + extents.set(execution.run, { + start: execution.start, + stop: execution.stop + }); + } + } + } + if (extents.size < 2) { + return { lanes, cuts: [] }; + } + const runs = [...extents.entries()].sort((a6, b6) => a6[1].start - b6[1].start); + let active = 0; + for (const [, extent] of runs) { + active += extent.stop - extent.start; + } + const spacer = Math.max(1, Math.round(active * CUT_SPACER)); + const gaps = []; + let stop = runs[0][1].stop; + for (let index2 = 1; index2 < runs.length; index2++) { + const { start } = runs[index2][1]; + if (start - stop > spacer) { + gaps.push({ index: index2, from: stop, to: start }); + } + stop = Math.max(stop, runs[index2][1].stop); + } + const chosen = gaps.sort((a6, b6) => b6.to - b6.from - (a6.to - a6.from) || a6.index - b6.index).slice(0, MAX_CUTS).sort((a6, b6) => a6.index - b6.index); + if (chosen.length === 0) { + return { lanes, cuts: [] }; + } + const cuts = []; + const shiftOf = /* @__PURE__ */ new Map(); + let shift = 0; + let next = 0; + runs.forEach(([run2], index2) => { + if (chosen[next]?.index === index2) { + const { from, to } = chosen[next]; + cuts.push({ + at: from - shift + spacer / 2, + length: to - from, + removed: to - from - spacer + }); + shift += to - from - spacer; + next++; + } + shiftOf.set(run2, shift); + }); + return { + lanes: lanes.map((lane) => ({ + ...lane, + executions: lane.executions.map((execution) => { + const by = execution.run === void 0 ? 0 : shiftOf.get(execution.run) ?? 0; + return by === 0 ? execution : { + ...execution, + start: execution.start - by, + stop: execution.stop - by + }; + }) + })), + cuts + }; +} +function arrange(executions, coarse) { + const tolerance = toleranceFor(JITTER_MS); + const packAll = (list) => coarse ? packCoarse(list) : pack(list, tolerance); + if (executions.every((e6) => e6.threadId === void 0)) { + return { + lanes: packAll(executions).map((laneExecutions, index2) => ({ + name: `Lane ${index2 + 1}`, + origin: "inferred", + executions: laneExecutions + })), + inferredLanes: true, + splitThreads: [], + strayAttempts: 0 + }; + } + const groups = /* @__PURE__ */ new Map(); + const unthreaded = []; + for (const execution of executions) { + if (execution.threadId === void 0) { + unthreaded.push(execution); + continue; + } + let group3 = groups.get(execution.threadId); + if (!group3) { + group3 = { all: [], finals: [], attempts: [] }; + groups.set(execution.threadId, group3); + } + group3.all.push(execution); + (execution.attempt === void 0 ? group3.finals : group3.attempts).push( + execution + ); + } + const threadTolerance = toleranceFor(THREAD_JITTER_MS); + const lanes = []; + const splitThreads = []; + const stray = []; + const threadIds = [...groups.keys()].sort(threadOrder.compare); + for (const threadId of threadIds) { + const { all, finals, attempts } = groups.get(threadId); + let threadLanes; + if (coarse) { + threadLanes = packCoarse(all); + } else if (finals.length === 0) { + threadLanes = pack(attempts, threadTolerance); + } else { + threadLanes = pack(finals, threadTolerance); + for (const attempt of placeAttempts( + threadLanes, + attempts, + threadTolerance + )) { + stray.push(attempt); + } + } + if (threadLanes.length > 1) { + splitThreads.push({ threadId, lanes: threadLanes.length }); + } + threadLanes.forEach((laneExecutions, index2) => { + lanes.push({ + name: index2 === 0 ? threadId : `${threadId} (${index2 + 1})`, + origin: "thread", + executions: laneExecutions + }); + }); + } + packAll(unthreaded).forEach((laneExecutions, index2) => { + lanes.push({ + name: index2 === 0 ? "No thread ID" : `No thread ID (${index2 + 1})`, + origin: "unthreaded", + executions: laneExecutions + }); + }); + pack(stray, tolerance).forEach((laneExecutions, index2) => { + lanes.push({ + name: index2 === 0 ? "Runs before a retry" : `Runs before a retry (${index2 + 1})`, + origin: "attempts", + executions: laneExecutions + }); + }); + return { + lanes, + inferredLanes: false, + splitThreads, + strayAttempts: stray.length + }; +} +function placeAttempts(lanes, attempts, tolerance) { + const tried = Math.min(lanes.length, ATTEMPT_LANES); + const placed = lanes.slice(0, tried).map(() => []); + const stray = []; + for (const attempt of [...attempts].sort(byStart)) { + let fits = false; + for (let index2 = 0; index2 < tried && !fits; index2++) { + const lane = lanes[index2]; + const before = placed[index2][placed[index2].length - 1]; + let low = 0; + let high = lane.length; + while (low < high) { + const middle = low + high >> 1; + if (byStart(lane[middle], attempt) <= 0) { + low = middle + 1; + } else { + high = middle; + } + } + const previous = lane[low - 1]; + const next = lane[low]; + fits = !(previous && previous.stop - tolerance(previous) > attempt.start) && !(next && attempt.stop - tolerance(attempt) > next.start) && !(before && before.stop - tolerance(before) > attempt.start); + if (fits) { + placed[index2].push(attempt); + } + } + if (!fits) { + stray.push(attempt); + } + } + placed.forEach((extra, index2) => { + if (extra.length > 0) { + lanes[index2] = mergeByStart(lanes[index2], extra); + } + }); + return stray; +} +function mergeByStart(a6, b6) { + const merged = []; + let i6 = 0; + let j7 = 0; + while (i6 < a6.length || j7 < b6.length) { + if (j7 >= b6.length || i6 < a6.length && byStart(a6[i6], b6[j7]) <= 0) { + merged.push(a6[i6++]); + } else { + merged.push(b6[j7++]); + } + } + return merged; +} +function chooseLanes(lanes, maxLanes) { + if (lanes.length <= maxLanes) { + return { shown: lanes, hidden: [] }; + } + const ranked = lanes.map((lane, index2) => ({ + index: index2, + failed: lane.executions.filter((e6) => e6.kind === "failed").length, + busy: busyTime(lane.executions) + })).sort( + (a6, b6) => b6.failed - a6.failed || b6.busy - a6.busy || a6.index - b6.index + ); + const keep = new Set(ranked.slice(0, maxLanes).map((lane) => lane.index)); + return { + shown: lanes.filter((_3, index2) => keep.has(index2)), + hidden: lanes.filter((_3, index2) => !keep.has(index2)) + }; +} +function toleranceFor(most) { + return (execution) => Math.min(most, Math.floor((execution.stop - execution.start) / 2)); +} +function pack(executions, tolerance) { + const lanes = []; + const ends = []; + const freeFrom = []; + const busy = new MinHeap( + (a6, b6) => freeFrom[a6] < freeFrom[b6] || freeFrom[a6] === freeFrom[b6] && a6 < b6 + ); + const free = new MinHeap( + (a6, b6) => ends[a6] > ends[b6] || ends[a6] === ends[b6] && a6 < b6 + ); + for (const execution of [...executions].sort(byStart)) { + while (busy.size > 0 && freeFrom[busy.peek()] <= execution.start) { + free.push(busy.pop()); + } + let lane = free.pop(); + if (lane === void 0) { + lane = lanes.length; + lanes.push([]); + ends.push(execution.stop); + freeFrom.push(Number.NEGATIVE_INFINITY); + } + lanes[lane].push(execution); + ends[lane] = Math.max(ends[lane], execution.stop); + freeFrom[lane] = Math.max( + freeFrom[lane], + execution.stop - tolerance(execution) + ); + busy.push(lane); + } + return lanes; +} +function packCoarse(executions) { + const lanes = []; + const ends = []; + const busy = new MinHeap( + (a6, b6) => ends[a6] < ends[b6] || ends[a6] === ends[b6] && a6 < b6 + ); + const free = new MinHeap( + (a6, b6) => ends[a6] > ends[b6] || ends[a6] === ends[b6] && a6 < b6 + ); + for (const execution of [...executions].sort((a6, b6) => a6.start - b6.start)) { + while (busy.size > 0 && ends[busy.peek()] <= execution.start) { + free.push(busy.pop()); + } + let lane = free.pop(); + if (lane === void 0 && busy.size > 0 && ends[busy.peek()] <= execution.start + SECOND_MS) { + lane = busy.pop(); + } + if (lane === void 0) { + lane = lanes.length; + lanes.push([]); + ends.push(Number.NEGATIVE_INFINITY); + } + const start = Math.max(execution.start, ends[lane]); + const stop = start + (execution.stop - execution.start); + lanes[lane].push({ ...execution, start, stop }); + ends[lane] = stop; + busy.push(lane); + } + return lanes; +} +function byStart(a6, b6) { + return a6.start - b6.start || a6.stop - b6.stop; +} + +// src/ctrf/timeline/gantt.ts +init_cjs_globals(); + +// src/ctrf/timeline/text.ts +init_cjs_globals(); +var ZWSP = String.fromCharCode(8203); +var MAX_LABEL_UNITS = 300; +var graphemes = new Intl.Segmenter("en", { granularity: "grapheme" }); +function characters(text) { + return Array.from(graphemes.segment(text), (part) => part.segment); +} +function oneLine(text) { + return String(text ?? "").replace(/[\u0000-\u001f\u007f-\u009f\u2028\u2029]/g, " ").replace(/\s+/g, " ").trim(); +} +function sanitizeMermaidText(text) { + return sanitizeMermaidLine(text).replace(/:/g, "\u2236"); +} +function sanitizeMermaidLine(text) { + return oneLine( + String(text ?? "").slice(0, MAX_LABEL_UNITS * 4).replace(/[\ud800-\udbff]$/, "") + ).replace(/[\u200b\u202a-\u202e\u2066-\u2069\ufeff]/g, "").replace(//gi, " ").replace(/;/g, ",").replace(/%/g, "\uFF05").replace(/&/g, "\uFF06").replace(/`/g, "'").replace(/\s+/g, " ").trim(); +} +function escapeCell(text) { + return oneLine(text).replace(/[\\`*_~[\]|]/g, "\\$&").replace(/&/g, "&").replace(//g, ">").replace(/\$/g, () => "$").replace(/([@#])(?=\w)/g, "$1\u2060").replace(/\b(gh)-(?=\d)/gi, "$1\u2060-").replace(/:\/\//g, ":\u2060//").replace(/\bwww\./gi, "www\u2060.").replace(/:(?=[\w+-]+:)/g, ":\u2060"); +} +function codeSpan(text) { + const content = oneLine(text) || " "; + let longest = 0; + for (const run2 of content.match(/`+/g) ?? []) { + longest = Math.max(longest, run2.length); + } + const fence = "`".repeat(longest + 1); + const space = /^`|`$/.test(content) ? " " : ""; + return `${fence}${space}${content}${space}${fence}`; +} +function textWidth(text) { + let width = 0; + for (const character of characters(text)) { + width += characterWidth(character); + } + return width; +} +function characterWidth(character) { + const code = character.codePointAt(0) ?? 0; + let width; + if (code === 8203) { + width = 0; + } else if (code >= 126976 || code >= 8592 && code <= 11263 || character.includes("\uFE0F")) { + width = 15; + } else if (code >= 4352 && code <= 4447 || code >= 11904 && code <= 42191 || code >= 44032 && code <= 55203 || code >= 63744 && code <= 64255 || code >= 65072 && code <= 65103 || code >= 65280 && code <= 65376 || code >= 65504 && code <= 65510 || code >= 131072) { + width = 11.5; + } else if ("MWmw@%&".includes(character)) { + width = 10.2; + } else if ("=<>+~^#".includes(character)) { + width = 8.6; + } else if ("|[]();:!".includes(character)) { + width = 5.6; + } else if ("iljtfr.,' ".includes(character)) { + width = 4.4; + } else if (code >= 65 && code <= 90) { + width = 7.6; + } else if (code >= 48 && code <= 57) { + width = 7; + } else { + width = code < 128 ? 6.2 : 8.6; + } + return width * 1.05; +} +function fitText(text, room, minCharacters) { + if (text.length <= MAX_LABEL_UNITS && textWidth(text) <= room) { + return text; + } + const parts = characters(text.slice(0, MAX_LABEL_UNITS)); + let width = characterWidth("\u2026"); + let kept = 0; + for (const part of parts) { + width += characterWidth(part); + if (width > room) { + break; + } + kept++; + } + return kept >= minCharacters ? `${parts.slice(0, kept).join("").trimEnd()}\u2026` : ""; +} +function fitMiddle(text, room, tail) { + if (text.length <= MAX_LABEL_UNITS && textWidth(text) <= room) { + return text; + } + const parts = characters(text); + const keep = Math.min( + tail ?? Math.min(10, Math.floor(parts.length / 2)), + parts.length - 1 + ); + const end = keep > 0 ? parts.slice(-keep) : []; + let width = textWidth(end.join("")) + characterWidth("\u2026"); + let head = 0; + for (const part of parts.slice(0, parts.length - keep)) { + width += characterWidth(part); + if (width > room) { + break; + } + head++; + } + return head > 0 ? `${parts.slice(0, head).join("")}\u2026${end.join("")}` : fitText(text, room, 1); +} +function truncateMiddle(text, max, tail) { + const parts = characters(text); + if (parts.length <= max) { + return text; + } + const end = Math.max(0, Math.min(tail ?? Math.floor((max - 1) / 3), max - 2)); + return `${parts.slice(0, max - 1 - end).join("").trimEnd()}\u2026${end > 0 ? parts.slice(-end).join("") : ""}`; +} +function shorten(text, max, tail) { + return limitUnits(truncateMiddle(text, max, tail), max * 4); +} +function limitUnits(text, max) { + if (text.length <= max) { + return text; + } + let kept = ""; + for (const part of characters(text.slice(0, max))) { + if (kept.length + part.length > max - 1) { + break; + } + kept += part; + } + return `${kept}\u2026`; +} +function distinctNames(names, shortenName) { + const labels = names.map((name) => shortenName(name)); + const byLabel = /* @__PURE__ */ new Map(); + labels.forEach((label, index2) => { + const same = byLabel.get(label); + if (same) { + same.push(index2); + } else { + byLabel.set(label, [index2]); + } + }); + for (const indices of byLabel.values()) { + const distinct = [...new Set(indices.map((index2) => names[index2]))]; + if (distinct.length > 1) { + const tail = commonEnd(distinct) + 3; + for (const index2 of indices) { + labels[index2] = shortenName(names[index2], tail); + } + } + } + return uniqueNames(labels); +} +function commonEnd(names) { + const parts = names.map((name) => characters(name).reverse()); + let shared = 0; + while (parts.every( + (chars2) => shared < chars2.length && chars2[shared] === parts[0][shared] + )) { + shared++; + } + return shared; +} +function uniqueNames(names) { + const used = /* @__PURE__ */ new Set(); + return names.map((name) => { + let unique = name; + for (let number = 2; used.has(unique); number++) { + unique = `${name} [${number}]`; + } + used.add(unique); + return unique; + }); +} +function attemptName(name, attempt) { + if (attempt === void 0) { + return name; + } + return attempt === 0 ? `${name} (earlier run)` : `${name} (attempt ${attempt})`; +} +function formatDuration(ms2) { + const rounded = Math.max(0, Math.round(ms2)); + if (rounded < 1e3) { + return `${rounded}ms`; + } + if (rounded < 6e4) { + return `${(rounded / 1e3).toFixed(1)}s`; + } + if (rounded < 36e5) { + const minutes2 = Math.floor(rounded / 6e4); + const seconds = Math.floor(rounded % 6e4 / 1e3); + return seconds > 0 ? `${minutes2}m ${seconds}s` : `${minutes2}m`; + } + const hours = Math.floor(rounded / 36e5); + const minutes = Math.floor(rounded % 36e5 / 6e4); + return minutes > 0 ? `${hours}h ${minutes}m` : `${hours}h`; +} +function formatClock(offset, span) { + const ms2 = Math.max(0, Math.round(offset)); + const seconds = `${pad(Math.floor(ms2 / 1e3) % 60, 2)}.${pad(ms2 % 1e3, 3)}`; + if (span >= 36e5) { + return `${Math.floor(ms2 / 36e5)}:${pad(Math.floor(ms2 / 6e4) % 60, 2)}:${seconds}`; + } + return `${Math.floor(ms2 / 6e4)}:${seconds}`; +} +function pad(value, width) { + return String(value).padStart(width, "0"); +} +function plural(value, word) { + return value === 1 ? word : `${word}s`; +} +function count(value, word) { + return `${value} ${plural(value, word)}`; +} +function isAre(value) { + return value === 1 ? "is" : "are"; +} +function percent(ratio) { + return `${Math.round(Math.min(1, Math.max(0, ratio)) * 100)}%`; +} + +// src/ctrf/timeline/gantt.ts +var DAY_MS = 864e5; +var CHART_WIDTH = 1e3; +var RIGHT_PADDING = 40; +var MIN_LEFT_PADDING = 75; +var MAX_LEFT_PADDING = 240; +var LANE_NAME_MARGIN = 20; +var SECTION_SCALE = 1.1; +var MAX_LANE_NAME_UNITS = 120; +var COMPACT_ABOVE_LANES = 20; +var LABEL_PADDING = 8; +var MIN_LABEL_CHARS = 10; +var MIN_LABEL_ROOM = 6; +var MAX_NUMBER_DIGITS = 3; +var DIAMOND_BELOW_PX = 4; +var SLIVER_PX = 3; +var MAX_DIAMOND_COVERAGE = 0.25; +var MIN_DIAMOND_SPACING = 1.5; +var NARROW_BAR_PX = 8; +var MIXED_BAR_PX = 2; +var LAST_LEVEL = 20; +var FAILURE_LEVEL = 8; +var THEME_VARIABLES = { + // passed + taskBkgColor: "#4ac26b", + taskBorderColor: "#1a7f37", + // failed, dark enough to tell from passed without seeing colors + critBkgColor: "#cf222e", + critBorderColor: "#82071e", + // failed attempt that was retried + activeTaskBkgColor: "#eac54f", + activeTaskBorderColor: "#9a6700", + // other + doneTaskBkgColor: "#afb8c1", + doneTaskBorderColor: "#6e7781", + // text inside the bars, which have the same colors in light and dark mode + taskTextColor: "#1f2328", + taskTextDarkColor: "#1f2328", + sectionBkgColor: "#8c959f", + sectionBkgColor2: "#8c959f", + // lines where a stretch without tests is cut out + vertLineColor: "#8c959f" +}; +var THEME_CSS = [ + ".taskText.critText0,.taskText.critText1,.taskText.critText2,.taskText.critText3{fill:#ffffff !important}", + ".active0,.active1,.active2,.active3{stroke-dasharray:4 2}" +].join(""); +var KIND_TAGS = { + passed: "", + failed: "crit, ", + retry: "active, ", + other: "done, " +}; +var KIND_ORDER = ["passed", "failed", "retry", "other"]; +var NO_TIME = { + passed: 0, + failed: 0, + retry: 0, + other: 0 +}; +function elapsedClock(data) { + return Math.max(1, data.stop - data.start) < DAY_MS; +} +function renderTimelineGantt(data, limits = {}, description = "Test execution timeline", numberBars) { + const { maxDiagramChars } = { ...TIMELINE_LIMITS, ...limits }; + const span = Math.max(1, data.stop - data.start); + const elapsed = elapsedClock(data); + const compact = data.lanes.length > COMPACT_ABOVE_LANES; + const fontScale = compact ? 10 / 11 : 1; + const laneNames = chartLaneNames(data.lanes, fontScale); + let widestName = 0; + for (const name of laneNames) { + widestName = Math.max( + widestName, + textWidth(name) * SECTION_SCALE * fontScale + ); + } + const leftPadding = Math.min( + MAX_LEFT_PADDING, + Math.max(MIN_LEFT_PADDING, Math.ceil(widestName) + LANE_NAME_MARGIN) + ); + const plotWidth = CHART_WIDTH - leftPadding - RIGHT_PADDING; + const clock = elapsed ? (time2) => mermaidClock(time2 - data.start) : (time2) => String(Math.round(time2)); + const start = Math.round(data.start); + const end = start + Math.max(1, Math.round(data.stop) - start); + const names = /* @__PURE__ */ new Map(); + const chart = { + geometry: { + msPerPx: span / plotWidth, + barHeight: compact ? 12 : 20, + fontScale + }, + plotWidth, + run: { start, stop: end }, + breaks: data.cuts.map((cut) => cut.at).sort((a6, b6) => a6 - b6), + laneNames, + header: ganttHeader({ + leftPadding, + compact, + description, + dateFormat: elapsed ? "D HH:mm:ss.SSS" : "x", + axisFormat: axisFormat(span, elapsed, data) + }), + // Mermaid fits the axis to the bars; empty tasks at both ends of the run + // keep it on the whole run, so it starts at 0:00. + firstLane: { + before: [`${ZWSP} :${clock(start)}, 0ms`], + after: [ + `${ZWSP} :${clock(end)}, 0ms`, + ...data.cuts.map( + (cut) => `${ZWSP} :vert, ${clock(Math.round(cut.at))}, 0ms` + ) + ] + }, + clock, + nameOf: (execution) => { + let name = names.get(execution); + if (name === void 0) { + name = sanitizeMermaidText( + attemptName(execution.label, execution.attempt) + ); + if (/^\d+$/.test(name)) { + name = `"${name}"`; + } + names.set(execution, name); + } + return name; + } + }; + const fits = (build) => { + const numbering = { candidates: [], named: /* @__PURE__ */ new Set() }; + const gantt = buildGantt(data, chart, build, maxDiagramChars, numbering); + if (!gantt || !numberBars || !build.labels) { + return gantt; + } + const numbers = numberBars( + candidatesOf(numbering), + maxDiagramChars - gantt.text.length + ); + if (numbers.size === 0) { + return gantt; + } + return buildGantt(data, chart, build, Number.POSITIVE_INFINITY, { + numbers, + written: /* @__PURE__ */ new Set() + }); + }; + for (let level = 0; level <= LAST_LEVEL; level++) { + const gantt = fits({ level, exact: true, labels: true }); + if (gantt) { + return gantt; + } + } + for (let level = FAILURE_LEVEL + 1; level <= LAST_LEVEL; level++) { + const gantt = fits({ level, exact: false, labels: true }); + if (gantt) { + return gantt; + } + } + return fits({ level: LAST_LEVEL, exact: false, labels: false }) ?? { + text: "", + kinds: [], + mergedBars: false, + diamonds: false, + approximate: false + }; +} +function candidatesOf(numbering) { + const best = /* @__PURE__ */ new Map(); + for (const candidate of numbering.candidates ?? []) { + const known = best.get(candidate.execution); + if (!numbering.named?.has(candidate.execution)) { + if (!known || candidate.digits > known.digits) { + best.set(candidate.execution, candidate); + } + } + } + return [...best.values()]; +} +function buildGantt(data, chart, build, budget, numbering) { + const lines = [chart.header]; + let length2 = chart.header.length; + const kinds = /* @__PURE__ */ new Set(); + let mergedBars = false; + let diamonds = false; + const push = (line) => { + lines.push(line); + length2 += line.length + 1; + }; + for (const [index2, lane] of data.lanes.entries()) { + let bars = layoutLane(lane.executions, chart, build, "diamond"); + if (crowdedDiamonds(bars, chart)) { + bars = layoutLane(lane.executions, chart, build, "sliver"); + } + push(`section ${sectionName(chart.laneNames[index2])}`); + if (index2 === 0) { + for (const line of chart.firstLane.before) { + push(line); + } + } + for (const bar of bars) { + kinds.add(bar.kind); + mergedBars ||= bar.members.length > 1 && !bar.marker; + diamonds ||= bar.diamond; + push( + taskLine( + bar, + build.labels ? barLabel(bar, chart, index2, numbering) : "", + chart.clock + ) + ); + } + if (index2 === 0) { + for (const line of chart.firstLane.after) { + push(line); + } + } + if (length2 > budget) { + return void 0; + } + } + return { + text: lines.join("\n"), + kinds: KIND_ORDER.filter((kind) => kinds.has(kind)), + mergedBars, + diamonds, + approximate: !build.exact + }; +} +function crowdedDiamonds(bars, chart) { + const width = diamondWidth(chart.geometry); + const spacing = MIN_DIAMOND_SPACING * width * chart.geometry.msPerPx; + let count2 = 0; + let previous = Number.NEGATIVE_INFINITY; + for (const bar of bars) { + if (!bar.diamond) { + continue; + } + if (bar.start - previous < spacing) { + return true; + } + previous = bar.start; + count2++; + } + return count2 * width > MAX_DIAMOND_COVERAGE * chart.plotWidth; +} +function layoutLane(executions, chart, build, marker2) { + const { geometry } = chart; + const limits = levelLimits(build.level, geometry, marker2); + const passes = []; + const failures = []; + const clusters = []; + let passOpen = false; + let failureOpen = false; + let clusterOpen = false; + let passSinceCluster = false; + let lastStop = Number.NEGATIVE_INFINITY; + for (const execution of executions) { + const start = Math.max(execution.start, lastStop); + const stop = Math.max(execution.stop, start); + lastStop = stop; + if (!isFailure(execution.kind)) { + const previous = passOpen ? passes[passes.length - 1] : void 0; + if (previous && merges(previous, execution.kind, start, stop, limits, chart)) { + grow(previous, execution, start, stop); + } else { + passes.push(newBar(execution, start, stop)); + } + passOpen = true; + failureOpen = false; + passSinceCluster ||= clusterOpen; + } else if (stop - start >= limits.markBelow) { + const previous = failureOpen ? failures[failures.length - 1] : void 0; + if (previous && merges(previous, execution.kind, start, stop, limits, chart)) { + grow(previous, execution, start, stop); + } else { + failures.push(newBar(execution, start, stop)); + } + failureOpen = true; + passOpen = false; + clusterOpen = false; + } else { + const cluster = clusterOpen ? clusters[clusters.length - 1] : void 0; + if (cluster && joins(cluster, start, stop, limits, chart, passSinceCluster)) { + cluster.stop = Math.max(cluster.stop, stop); + cluster.busy += stop - start; + cluster.members.push(execution); + cluster.passesInside ||= passSinceCluster; + if (execution.kind === "failed") { + cluster.kind = "failed"; + } + } else { + clusters.push({ + start, + stop, + busy: stop - start, + kind: execution.kind, + members: [execution], + passesInside: false + }); + } + clusterOpen = true; + failureOpen = false; + passSinceCluster = false; + } + } + const bars = failures; + const covered = []; + const markers = []; + for (const cluster of clusters) { + const extent = cluster.stop - cluster.start; + if (extent >= limits.barFrom && cluster.busy * 2 >= extent && !cluster.passesInside) { + bars.push({ + start: cluster.start, + stop: cluster.stop, + kind: cluster.kind, + members: cluster.members, + time: { ...NO_TIME, [cluster.kind]: cluster.busy }, + last: 0, + diamond: false, + marker: false + }); + covered.push([cluster.start, cluster.stop]); + } else { + markers.push(cluster); + } + } + const failureSpans = bars.map((bar) => [bar.start, bar.stop]).sort((a6, b6) => a6[0] - b6[0]); + let span = 0; + for (const cluster of markers) { + const center = (cluster.start + cluster.stop) / 2; + const reach = diamondWidth(geometry) / 2 * geometry.msPerPx; + while (span < failureSpans.length && failureSpans[span][1] < center - reach) { + span++; + } + const diamond = marker2 === "diamond" && !(span < failureSpans.length && failureSpans[span][0] <= center + reach); + const half = (diamond ? diamondWidth(geometry) : SLIVER_PX) / 2 * geometry.msPerPx; + const width = diamond ? 0 : SLIVER_PX * geometry.msPerPx; + bars.push({ + start: center - width / 2, + stop: center + width / 2, + kind: cluster.kind, + members: cluster.members, + time: { ...NO_TIME, [cluster.kind]: cluster.busy }, + last: 0, + diamond, + marker: true + }); + covered.push([center - half, center + half]); + for (const member2 of build.exact ? cluster.members : []) { + const from = Math.max(member2.start, cluster.start); + const to = Math.min(member2.stop, cluster.stop); + if (to - from >= geometry.msPerPx) { + covered.push([from, to]); + } + } + } + for (const piece of cutAround(passes, covered)) { + bars.push(piece); + } + bars.sort((a6, b6) => a6.start - b6.start || a6.stop - b6.stop); + const laid = []; + let previousStop = chart.run.start; + for (const bar of bars) { + let start = Math.min( + Math.max(Math.round(bar.start), previousStop), + chart.run.stop + ); + let stop = Math.min(Math.max(Math.round(bar.stop), start), chart.run.stop); + if (stop <= start && bar.stop > bar.start && !isFailure(bar.kind)) { + continue; + } + if (stop === start && isFailure(bar.kind) && !bar.diamond) { + if (stop < chart.run.stop) { + stop++; + } else if (start > previousStop) { + start--; + } else { + bar.diamond = true; + } + } + bar.start = start; + bar.stop = stop; + previousStop = stop; + laid.push(bar); + } + return laid; +} +function levelLimits(level, geometry, marker2) { + const px = geometry.msPerPx; + const scale = 2 ** level * px; + const failureScale = 2 ** Math.max(0, level - FAILURE_LEVEL) * px; + const markerPx = marker2 === "diamond" ? DIAMOND_BELOW_PX : SLIVER_PX; + return { + narrow: NARROW_BAR_PX * scale, + gap: scale, + mixed: MIXED_BAR_PX * scale, + markBelow: markerPx * failureScale, + barFrom: markerPx * px, + window: Math.max( + (marker2 === "diamond" ? diamondWidth(geometry) : SLIVER_PX) * px, + SLIVER_PX * failureScale + ), + chain: failureScale + }; +} +function isFailure(kind) { + return kind === "failed" || kind === "retry"; +} +function newBar(execution, start, stop) { + return { + start, + stop, + kind: execution.kind, + members: [execution], + time: { ...NO_TIME, [execution.kind]: stop - start }, + last: stop - start, + diamond: false, + marker: false + }; +} +function merges(previous, kind, start, stop, limits, chart) { + const width = stop - start; + const gap = start - previous.stop; + const bridge = Math.max( + NARROW_BAR_PX * chart.geometry.msPerPx, + previous.last, + width + ); + if (gap > Math.min(limits.gap, bridge) || crosses(chart, previous.stop, start)) { + return false; + } + if (kind === previous.kind) { + return width < limits.narrow && (previous.members.length > 1 || previous.stop - previous.start < limits.narrow); + } + const time2 = { ...previous.time }; + time2[kind] += width; + const minority = isFailure(kind) ? Math.min(time2.failed, time2.retry) : Math.min(time2.passed, time2.other); + return minority < limits.mixed; +} +function joins(cluster, start, stop, limits, chart, passBetween) { + if (crosses(chart, cluster.stop, start)) { + return false; + } + const extent = Math.max(stop, cluster.stop) - cluster.start; + return extent <= limits.window || !passBetween && start - cluster.stop <= limits.chain && (cluster.busy + stop - start) * 2 >= extent; +} +function crosses(chart, from, to) { + return chart.breaks.some((at2) => at2 > from && at2 < to); +} +function grow(bar, execution, start, stop) { + bar.stop = Math.max(bar.stop, stop); + bar.members.push(execution); + bar.time[execution.kind] += stop - start; + bar.last = stop - start; + bar.kind = dominantKind(bar.time, bar.kind); +} +function dominantKind(time2, fallback2) { + if (isFailure(fallback2)) { + return time2.failed > 0 || fallback2 === "failed" ? "failed" : "retry"; + } + if (time2.passed === time2.other) { + return fallback2; + } + return time2.passed > time2.other ? "passed" : "other"; +} +function cutAround(bars, cuts) { + if (cuts.length === 0) { + return bars; + } + const union = []; + for (const [from, to] of [...cuts].sort((a6, b6) => a6[0] - b6[0])) { + const last = union[union.length - 1]; + if (last && from <= last[1]) { + last[1] = Math.max(last[1], to); + } else { + union.push([from, to]); + } + } + const pieces = []; + let first = 0; + for (const bar of bars) { + while (first < union.length && union[first][1] <= bar.start) { + first++; + } + if (first === union.length || union[first][0] >= bar.stop) { + pieces.push(bar); + continue; + } + let from = bar.start; + for (let next = first; next < union.length && union[next][0] < bar.stop; next++) { + if (union[next][0] > from) { + addPiece(pieces, bar, from, union[next][0]); + } + from = Math.max(from, union[next][1]); + } + if (bar.stop > from) { + addPiece(pieces, bar, from, bar.stop); + } + } + return pieces; +} +function addPiece(pieces, bar, from, to) { + const members = bar.members.filter( + (member2) => member2.stop > member2.start ? member2.start < to && member2.stop > from : member2.start >= from && member2.start <= to + ); + if (members.length === 0) { + return; + } + const time2 = { ...NO_TIME }; + let start = Number.POSITIVE_INFINITY; + let stop = Number.NEGATIVE_INFINITY; + for (const member2 of members) { + time2[member2.kind] += Math.max( + 0, + Math.min(member2.stop, to) - Math.max(member2.start, from) + ); + start = Math.min(start, member2.start); + stop = Math.max(stop, member2.stop); + } + pieces.push({ + ...bar, + start: Math.max(from, start), + stop: Math.min(to, stop), + members, + time: time2, + kind: dominantKind(time2, members[0].kind) + }); +} +function barLabel(bar, chart, lane, numbering) { + if (bar.marker) { + return ""; + } + const { msPerPx, fontScale } = chart.geometry; + const room = (bar.stop - bar.start) / msPerPx / fontScale - LABEL_PADDING; + if (room < MIN_LABEL_ROOM) { + return ""; + } + if (bar.members.length > 1) { + const label = `${bar.members.length} ${countNoun(bar)}`; + return textWidth(label) <= room ? label : ""; + } + const [execution] = bar.members; + const name = fitText(chart.nameOf(execution), room, MIN_LABEL_CHARS); + if (name !== "") { + numbering.named?.add(execution); + return name; + } + const number = numbering.numbers?.get(execution); + if (number !== void 0 && !numbering.written?.has(execution) && textWidth(String(number)) <= room) { + numbering.written?.add(execution); + return String(number); + } + let digits = 0; + while (digits < MAX_NUMBER_DIGITS && textWidth("8".repeat(digits + 1)) <= room) { + digits++; + } + if (digits > 0) { + numbering.candidates?.push({ execution, lane, digits }); + } + return ""; +} +function countNoun(bar) { + if (!isFailure(bar.kind)) { + return "tests"; + } + if (bar.members.some((member2) => member2.kind !== bar.kind)) { + return "failures"; + } + return bar.kind === "failed" ? "failed" : "attempts"; +} +function diamondWidth(geometry) { + return Math.ceil(geometry.barHeight * Math.SQRT2 * 0.8) + 1; +} +function taskLine(bar, label, clock) { + const start = Math.round(bar.start); + const length2 = Math.max(0, Math.round(bar.stop) - start); + const tags2 = KIND_TAGS[bar.kind] + (bar.diamond ? "milestone, " : ""); + return `${ZWSP}${label} :${tags2}${clock(start)}, ${length2}ms`; +} +function sectionName(name) { + return `${ZWSP}${name}`; +} +function ganttHeader(options) { + return [ + "---", + "config:", + " gantt:", + " displayMode: compact", + ` useWidth: ${CHART_WIDTH}`, + ` leftPadding: ${options.leftPadding}`, + ` rightPadding: ${RIGHT_PADDING}`, + ...options.compact ? [ + " barHeight: 12", + " barGap: 3", + " fontSize: 10", + " sectionFontSize: 10" + ] : [], + ` themeCSS: "${THEME_CSS}"`, + " themeVariables:", + ...Object.entries(THEME_VARIABLES).map( + ([name, value]) => ` ${name}: '${value}'` + ), + "---", + "gantt", + "accTitle: Test execution timeline", + `accDescr: ${limitUnits(sanitizeMermaidLine(options.description), 1e3)}`, + `dateFormat ${options.dateFormat}`, + `axisFormat ${options.axisFormat}`, + "todayMarker off" + ].join("\n"); +} +function axisFormat(span, elapsed, run2) { + if (!elapsed) { + const sameYear = new Date(run2.start).getUTCFullYear() === new Date(run2.stop).getUTCFullYear(); + return sameYear ? "%b %-d %H:%M" : "%Y-%m-%d %H:%M"; + } + if (span < 1e4) { + return "%-S.%Ls"; + } + return span < 36e5 ? "%-M:%S" : "%-H:%M:%S"; +} +function mermaidClock(offset) { + const ms2 = Math.max(0, Math.round(offset)); + const hours = Math.floor(ms2 / 36e5); + const minutes = Math.floor(ms2 / 6e4) % 60; + const seconds = Math.floor(ms2 / 1e3) % 60; + return `16 ${pad(hours, 2)}:${pad(minutes, 2)}:${pad(seconds, 2)}.${pad(ms2 % 1e3, 3)}`; +} +function chartLaneNames(lanes, fontScale) { + const room = (MAX_LEFT_PADDING - LANE_NAME_MARGIN) / SECTION_SCALE / fontScale; + return distinctNames( + lanes.map((lane) => sanitizeMermaidText(lane.name) || "(unnamed)"), + (name, tail) => limitUnits(fitMiddle(name, room, tail), MAX_LANE_NAME_UNITS) + ); +} + +// src/ctrf/timeline/report.ts +init_cjs_globals(); +var MAX_TABLE_CHARS = 1e4; +var MAX_NAME_CHARS = 120; +var MAX_LANE_CHARS = 60; +var MAX_HIGHLIGHT_CHARS = 80; +var NAMED_THREADS = 3; +var MIN_LANES = 5; +var KIND_LEGEND = { + passed: "\u{1F7E9} passed", + failed: "\u{1F7E5} failed", + retry: "\u{1F7E8} failed, then retried (dashed)", + other: "\u2B1C other" +}; +var NO_TIMING = "No test in this report has start and stop times, so there is no timeline. Reporters that record start and stop for each test (and threadId for parallel workers) enable this report."; +function buildTimelineReport(tests, limits = {}) { + try { + return timelineReport(tests, limits); + } catch (error2) { + const message = error2 instanceof Error ? error2.message : String(error2); + warning(`Timeline report could not be built: ${message}`); + return emptyReport( + "The timeline could not be drawn from this report; see the warning in the job log." + ); + } +} +function timelineReport(tests, limits) { + const { maxLanes } = { ...TIMELINE_LIMITS, ...limits }; + let data = collectTimeline(tests, limits); + const total = data.tests + data.attempts; + if (total === 0) { + return emptyReport(emptyMessage(data)); + } + if (data.stop === data.start) { + const untimed = data.untimed > 0 ? ` ${count(data.untimed, "other test")} without start and stop times ${isAre(data.untimed)} not shown.` : ""; + return emptyReport( + `${total === 1 ? "The only test with start and stop times" : "Every test with start and stop times"} started and finished within the same millisecond, so there is no timeline.${untimed}` + ); + } + let view = drawTimeline(data, limits); + for (let lanes2 = Math.floor(Math.min(maxLanes, data.lanes.length) / 2); view.gantt.text === "" && lanes2 >= MIN_LANES; lanes2 = Math.floor(lanes2 / 2)) { + const fewer = collectTimeline(tests, { ...limits, maxLanes: lanes2 }); + const drawn = drawTimeline(fewer, limits); + if (drawn.gantt.text !== "") { + data = fewer; + view = drawn; + } + } + const { active, allLanes, laneNames, slowest, last, clock, where: where2, until: until2 } = view; + const { gantt, timings } = view; + const headline = [ + `**${data.tests}** ${plural(data.tests, "test")}`, + data.attempts > 0 ? ` (and **${data.attempts}** ${plural(data.attempts, "run")} before a retry)` : "", + ` on ${laneSummary(data, (value) => `**${value}**`)}`, + ` in **${formatDuration(active)}**`, + ` \xB7 busy **${percent(busyShare(allLanes, active))}** of the time`, + allLanes.length > 1 ? ` \xB7 up to **${peakConcurrency(allLanes)}** at once` : "" + ].join(""); + const name = ({ execution }) => codeSpan( + shorten( + attemptName(execution.label, execution.attempt), + MAX_HIGHLIGHT_CHARS + ) + ); + let highlights = ""; + if (last && total > 1) { + highlights = slowest?.execution === last.execution ? `Slowest and last to finish: ${name(last)} (${formatDuration(length(last.execution))}${where2(last, codeSpan)}, until ${until2(last)})` : [ + slowest ? `Slowest: ${name(slowest)} (${formatDuration(length(slowest.execution))}${where2(slowest, codeSpan)})` : "", + `Last to finish: ${name(last)} at ${until2(last)}${where2(last, codeSpan)}` + ].filter(Boolean).join(" \xB7 "); + } + const legend = [ + ...gantt.kinds.map( + (kind) => kind === "other" && data.skippedDrawn ? "\u2B1C skipped or other" : KIND_LEGEND[kind] + ), + ...gantt.diamonds ? ["\u2666\uFE0F failed too fast for a bar"] : [], + clock.dates ? "times on the axis are in your time zone" : `0:00 = ${new Date(data.start).toISOString().slice(0, 23).replace("T", " ")} UTC` + ].join(" \xB7 "); + const lanes = data.lanes.map((lane, index2) => { + const finals = lane.executions.filter((e6) => e6.attempt === void 0); + const busy = busyTime(lane.executions); + return { + name: cell(laneNames[index2], MAX_LANE_CHARS), + tests: finals.length, + retries: lane.executions.length - finals.length, + failed: finals.filter((e6) => e6.kind === "failed").length, + busy: formatDuration(busy), + idle: formatDuration(Math.max(0, active - busy)), + utilization: percent(busy / active) + }; + }); + return { + hasData: true, + message: "", + headline, + highlights, + mermaid: gantt.text, + legend, + notes: notes(data, gantt, timings), + laneHeader: data.inferredLanes ? "Lane" : "Thread", + showLanes: data.lanes.length > 1, + showRetries: data.attempts > 0, + lanes, + showNumbers: timings.numbers.size > 0, + startHeader: clock.dates ? "Start (UTC)" : "Start", + rowsTitle: timings.title, + rows: timings.rows + }; +} +function drawTimeline(data, limits) { + const { maxRows } = { ...TIMELINE_LIMITS, ...limits }; + let active = data.stop - data.start; + for (const cut of data.cuts) { + active -= cut.length - cut.removed; + } + active = Math.max(1, active); + const allLanes = [...data.lanes, ...data.hiddenLanes]; + const laneNames = tableLaneNames(allLanes); + let failed = 0; + for (const lane of allLanes) { + for (const execution of lane.executions) { + failed += execution.kind === "failed" ? 1 : 0; + } + } + const { slowest, last } = standouts(allLanes); + const clock = tableClock(data); + const where2 = ({ lane }, write) => allLanes[lane].origin === "thread" ? ` on ${write(laneNames[lane])}` : ""; + const until2 = (placed) => `${clock.format(clock.real(placed.execution.stop))}${clock.dates ? " UTC" : ""}`; + const rows = (candidates, room) => timingRows(allLanes, laneNames, { + maxRows, + shownLanes: data.lanes.length, + clock, + candidates, + room + }); + let timings; + const gantt = renderTimelineGantt( + data, + limits, + [ + `${testsAndAttempts(data.tests, data.attempts)} on ${laneSummary(data, String)} over ${formatDuration(active)}, ${failed} failed.`, + slowest ? `The slowest test is ${shorten(slowest.execution.label, MAX_HIGHLIGHT_CHARS)} (${formatDuration(length(slowest.execution))}${where2(slowest, String)}).` : "", + last ? `The last to finish is ${shorten(attemptName(last.execution.label, last.execution.attempt), MAX_HIGHLIGHT_CHARS)}${where2(last, String)}, at ${until2(last)}.` : "" + ].filter(Boolean).join(" "), + (candidates, room) => { + timings = rows(candidates, room); + return timings.numbers; + } + ); + return { + gantt, + timings: timings ?? rows([], 0), + active, + allLanes, + laneNames, + slowest, + last, + clock, + where: where2, + until: until2 + }; +} +function emptyReport(message) { + return { + hasData: false, + message, + headline: "", + highlights: "", + mermaid: "", + legend: "", + notes: [], + laneHeader: "Thread", + showLanes: false, + showRetries: false, + lanes: [], + showNumbers: false, + startHeader: "Start", + rowsTitle: "", + rows: [] + }; +} +function emptyMessage(data) { + if (data.unmeasured.tests > 0) { + return `Most of the ${count(data.unmeasured.tests, "test")} with start and stop times start in the same millisecond, so their start times were not measured and there is no timeline.`; + } + if (data.untimed > 0 && data.invalid > 0) { + return `No test in this report has start and stop times that can be placed on a timeline: ${count(data.untimed, "test")} ${data.untimed === 1 ? "has" : "have"} none, and ${data.invalid} stop before they start or are not plausible dates.`; + } + if (data.untimed > 0) { + return NO_TIMING; + } + if (data.invalid > 0) { + return "No test in this report has start and stop times that can be placed on a timeline: they stop before they start, or are not plausible dates."; + } + return "No test ran, so there is no timeline."; +} +function tableClock(data) { + const real = (time2) => { + let shift = 0; + for (const cut of data.cuts) { + if (cut.at <= time2) { + shift += cut.removed; + } + } + return time2 + shift; + }; + const span = real(data.stop) - data.start; + const elapsed = elapsedClock(data); + return { + real, + format: elapsed ? (time2) => formatClock(time2 - data.start, span) : (time2) => new Date(time2).toISOString().slice(5, 23).replace("T", " "), + dates: !elapsed + }; +} +function tableLaneNames(lanes) { + return distinctNames( + lanes.map((lane) => oneLine(lane.name) || "(unnamed)"), + (name, tail) => shorten(name, MAX_LANE_CHARS, tail) + ); +} +function laneSummary(data, strong) { + const lanes = [...data.lanes, ...data.hiddenLanes]; + if (data.inferredLanes) { + return `${strong(lanes.length)} ${plural(lanes.length, "lane")}`; + } + const threadLanes = lanes.filter((lane) => lane.origin === "thread").length; + const more = lanes.length - threadLanes; + return [ + `${strong(data.threads)} ${plural(data.threads, "thread")}`, + threadLanes > data.threads ? ` in ${strong(threadLanes)} lanes` : "", + more > 0 ? ` and ${strong(more)} more ${plural(more, "lane")}` : "" + ].join(""); +} +function busyShare(lanes, active) { + let busy = 0; + let workers = 0; + const threads = /* @__PURE__ */ new Map(); + for (const lane of lanes) { + if (lane.origin === "thread") { + const threadId = lane.executions[0]?.threadId ?? lane.name; + let executions = threads.get(threadId); + if (!executions) { + executions = []; + threads.set(threadId, executions); + } + for (const execution of lane.executions) { + executions.push(execution); + } + } else if (lane.origin !== "attempts") { + busy += busyTime(lane.executions); + workers++; + } + } + for (const executions of threads.values()) { + busy += busyTime( + executions.sort((a6, b6) => a6.start - b6.start || a6.stop - b6.stop) + ); + workers++; + } + return workers > 0 ? busy / workers / active : 0; +} +function standouts(lanes) { + let slowest; + let last; + lanes.forEach((lane, index2) => { + for (const execution of lane.executions) { + if (execution.attempt === void 0 && (!slowest || length(execution) > length(slowest.execution))) { + slowest = { execution, lane: index2 }; + } + if (!last || execution.stop > last.execution.stop) { + last = { execution, lane: index2 }; + } + } + }); + return { slowest, last }; +} +function timingRows(lanes, laneNames, options) { + const digitsOf = /* @__PURE__ */ new Map(); + for (const { execution, digits } of options.candidates) { + digitsOf.set(execution, digits); + } + const numberable = /* @__PURE__ */ new Set(); + let written = 0; + for (const { execution } of [...options.candidates].sort( + (a6, b6) => a6.lane - b6.lane || a6.execution.start - b6.execution.start || a6.execution.stop - b6.execution.stop + )) { + const number = String(numberable.size + 1); + if (numberable.size < options.maxRows && number.length <= (digitsOf.get(execution) ?? 0) && written + number.length <= options.room) { + numberable.add(execution); + written += number.length; + } + } + const priority = ({ execution, lane }) => { + if (execution.kind === "failed") { + return lane >= options.shownLanes ? -1 : 0; + } + if (numberable.has(execution)) { + return 0.5; + } + return execution.kind === "retry" ? 1 : 2; + }; + const worse = (a6, b6) => priority(a6) > priority(b6) || priority(a6) === priority(b6) && length(a6.execution) < length(b6.execution); + const best = new MinHeap(worse); + let considered = 0; + let hiddenFailures = 0; + lanes.forEach((lane, index2) => { + for (const execution of lane.executions) { + considered++; + if (index2 >= options.shownLanes && execution.kind === "failed") { + hiddenFailures++; + } + best.push({ execution, lane: index2 }); + if (best.size > options.maxRows) { + best.pop(); + } + } + }); + const chosen = []; + while (best.size > 0) { + chosen.push(best.pop()); + } + chosen.reverse(); + const kept = []; + let size = 0; + for (const placed of chosen) { + const { execution, lane } = placed; + const row = { + number: "", + start: options.clock.format(options.clock.real(execution.start)), + duration: formatDuration(length(execution)), + lane: cell(laneNames[lane], MAX_LANE_CHARS), + name: cell( + attemptName(execution.name, execution.attempt), + MAX_NAME_CHARS + ), + status: `${getEmoji(execution.status)} ${execution.status}` + }; + size += 20 + row.start.length + row.duration.length + row.lane.length + row.name.length + row.status.length; + if (size > MAX_TABLE_CHARS && kept.length > 0) { + break; + } + kept.push({ placed, row }); + } + kept.sort( + (a6, b6) => a6.placed.lane - b6.placed.lane || a6.placed.execution.start - b6.placed.execution.start || a6.placed.execution.stop - b6.placed.execution.stop + ); + const numbers = /* @__PURE__ */ new Map(); + for (const { placed, row } of kept) { + const next = numbers.size + 1; + if (numberable.has(placed.execution) && String(next).length <= (digitsOf.get(placed.execution) ?? 0)) { + numbers.set(placed.execution, next); + row.number = String(next); + } + } + let title = `Test timings (${considered})`; + if (kept.length < considered) { + const parts = /* @__PURE__ */ new Set(); + for (const { placed } of kept) { + const { execution } = placed; + parts.add( + execution.kind === "failed" ? "failures" : numbers.has(execution) ? "numbered bars" : execution.kind === "retry" ? "retried failures" : "the slowest" + ); + } + const order = [ + "failures", + "numbered bars", + "retried failures", + "the slowest" + ]; + title = `Test timings (${kept.length} of ${considered}: ${joinAnd(order.filter((part) => parts.has(part)))})`; + } + return { + rows: kept.map(({ row }) => row), + title, + hiddenFailures: { + total: hiddenFailures, + listed: kept.filter( + ({ placed }) => placed.lane >= options.shownLanes && placed.execution.kind === "failed" + ).length + }, + numbers + }; +} +function notes(data, gantt, timings) { + const result = []; + const chart = gantt.text !== ""; + if (!chart) { + result.push( + "The chart would be too large for this summary, so it is left out." + ); + } + if (data.untimed > 0) { + const failed = data.untimedFailed === 0 ? "" : data.untimed === 1 ? " (it failed)" : data.untimedFailed === data.untimed ? " (all of them failed)" : ` (${data.untimedFailed} of them failed)`; + result.push( + `${count(data.untimed, "test")} without start and stop times ${isAre(data.untimed)} not shown${failed}.` + ); + } + if (data.invalid > 0) { + result.push( + `${count(data.invalid, "test")} whose start and stop times cannot be placed (stopping before starting, or not a plausible date) ${isAre(data.invalid)} not shown.` + ); + } + if (data.notRun > 0) { + result.push( + `${count(data.notRun, "skipped or pending test")} ${isAre(data.notRun)} not shown.` + ); + } + if (data.untimedAttempts > 0) { + result.push( + `${runsBeforeRetry(data.untimedAttempts)} without start and stop times ${isAre(data.untimedAttempts)} not shown.` + ); + } + if (data.unmeasured.tests > 0) { + const { tests, failed, threads } = data.unmeasured; + const failures = failed === 0 ? "" : tests === 1 ? " (it failed)" : ` (${failed} of them failed)`; + result.push( + `${count(tests, "test")} ${threadsPhrase(threads)} ${isAre(tests)} not shown${failures}: most tests there that took time start in the same millisecond, so their start times were not measured.` + ); + } + if (data.history > 0) { + result.push( + `${count(data.history, "result")} from earlier runs in the same report ${isAre(data.history)} not shown: later runs repeated those tests.` + ); + } + if (data.rerun > 0) { + result.push( + data.rerun === 1 ? "1 test ran again later in the report, so its earlier result is drawn as a run before a retry." : `${data.rerun} earlier results of tests that ran again later in the report are drawn as runs before a retry.` + ); + } + if (data.cuts.length > 0) { + const one = data.cuts.length === 1; + const lengths = joinAnd(data.cuts.map((cut) => formatDuration(cut.length))); + const where2 = chart ? ` cut out of the chart at the gray line${one ? "" : "s"}` : " cut out of the timeline"; + result.push( + one ? `No test ran for ${lengths}, so that stretch is${where2}; the tables show real times.` : `Stretches without tests (${lengths}) are${where2}; the tables show real times.` + ); + } + if (data.duplicates > 0) { + result.push( + `${count(data.duplicates, "result")} listed more than once ${isAre(data.duplicates)} counted once.` + ); + } + if (data.parents > 0) { + result.push( + data.parents === 1 ? "1 parent test that only groups its subtests (TestX around TestX/case) is not drawn." : `${data.parents} parent tests that only group their subtests (TestX around TestX/case) are not drawn.` + ); + } + if (data.coarse) { + result.push( + "Start and stop times are in whole seconds, so tests are drawn one after another from the second they started: the chart shows their order rather than exact times." + ); + } else if (data.convertedUnits.length > 0) { + const units = data.convertedUnits.map( + (unit) => unit === "s" ? "seconds" : unit === "\xB5s" ? "microseconds" : "nanoseconds" + ); + result.push( + `Some start and stop times are in ${joinAnd(units)} rather than milliseconds.` + ); + } + if (data.tooManyThreads > 0) { + result.push( + `The report has ${data.tooManyThreads} thread IDs, too many for one lane each, so lanes are inferred from start and stop times.` + ); + } else if (data.crowdedThreads > 0) { + result.push( + `Tests on the report's ${count(data.crowdedThreads, "thread ID")} overlap too much for one lane per thread, so lanes are inferred from start and stop times.` + ); + } else if (data.inferredLanes) { + result.push( + "The report has no thread IDs (threadId), so lanes are inferred from start and stop times." + ); + } + if (data.implausibleLanes) { + result.push( + "So many tests overlap that the times may have been recorded after the tests ran; if fewer workers ran, the lanes do not match them." + ); + } + if (data.splitThreads.length > 0) { + const shown = data.splitThreads.length === 1 ? `it is shown as ${data.splitThreads[0].lanes} lanes` : "they are shown as several lanes"; + result.push( + `Tests on ${threadList(data.splitThreads.map(({ threadId }) => threadId))} overlap in time (processes sharing a thread name, or a test timed around others), so ${shown}.` + ); + } + if (data.strayAttempts > 0) { + const one = data.strayAttempts === 1; + result.push( + `${runsBeforeRetry(data.strayAttempts)} overlap${one ? "s" : ""} other tests on ${one ? "its" : "their"} thread (such runs do not record where they ran), so ${one ? "it is" : "they are"} shown in a lane of ${one ? "its" : "their"} own.` + ); + } + if (data.hiddenLanes.length > 0) { + result.push(hiddenLanesNote(data, timings)); + } + if (gantt.approximate) { + result.push( + "With this many failures, a marker stands for all the failures near it." + ); + } + if (timings.numbers.size > 0) { + result.push( + "A number on a bar is the row with that number (#) in the test timings below." + ); + } + if (gantt.mergedBars) { + result.push("Tests too short to tell apart are merged into one bar."); + } + return result; +} +function hiddenLanesNote(data, timings) { + const hidden = data.hiddenLanes.flatMap((lane) => lane.executions); + const attempts = hidden.filter((e6) => e6.attempt !== void 0).length; + const threadOf = (lane) => lane.origin === "thread" ? lane.executions[0]?.threadId : void 0; + const drawn = new Set(data.lanes.map(threadOf)); + const wholeThreads = data.hiddenLanes.every((lane) => { + const threadId = threadOf(lane); + return threadId !== void 0 && !drawn.has(threadId); + }); + const number = wholeThreads ? new Set(data.hiddenLanes.map(threadOf)).size : data.hiddenLanes.length; + const { total, listed } = timings.hiddenFailures; + const their = number === 1 ? "its" : "their"; + const failures = total === 0 ? "" : listed === total ? `; ${their} ${plural(total, "failure")} ${isAre(total)} listed in the test timings` : `; ${listed} of ${their} ${count(total, "failure")} ${isAre(listed)} listed in the test timings`; + return `${count(number, `more ${wholeThreads ? "thread" : "lane"}`)} with ${testsAndAttempts(hidden.length - attempts, attempts)} ${isAre(number)} not drawn${failures}.`; +} +function cell(text, max) { + let escaped = escapeCell(shorten(text, max)); + for (let size = max; escaped.length > max * 4 && size > 8; ) { + size = Math.floor(size / 2); + escaped = escapeCell(shorten(text, size)); + } + return escaped; +} +function threadList(threadIds) { + const named = threadIds.slice(0, NAMED_THREADS).map((threadId) => codeSpan(shorten(threadId, MAX_LANE_CHARS))); + const more = threadIds.length - named.length; + return joinAnd(more > 0 ? [...named, count(more, "other thread")] : named); +} +function threadsPhrase(threadIds) { + const named = threadIds.filter((threadId) => threadId !== ""); + return [ + named.length > 0 ? `on ${threadList(named)}` : "", + named.length < threadIds.length ? "without a thread ID" : "" + ].filter(Boolean).join(" or "); +} +function testsAndAttempts(tests, attempts) { + return joinAnd( + [ + tests > 0 ? count(tests, "test") : "", + attempts > 0 ? runsBeforeRetry(attempts) : "" + ].filter(Boolean) + ); +} +function runsBeforeRetry(value) { + return `${count(value, "run")} before a retry`; +} +function joinAnd(parts) { + return parts.length < 2 ? parts.join("") : `${parts.slice(0, -1).join(", ")} and ${parts[parts.length - 1]}`; +} +function peakConcurrency(lanes) { + const total = lanes.reduce((sum, lane) => sum + lane.executions.length, 0); + const starts = new Float64Array(total); + const stops = new Float64Array(total); + let index2 = 0; + for (const lane of lanes) { + let lastStop = Number.NEGATIVE_INFINITY; + for (const execution of lane.executions) { + const start = Math.max(execution.start, lastStop); + const stop = Math.max(execution.stop, start + 1); + starts[index2] = start; + stops[index2] = stop; + lastStop = stop; + index2++; + } + } + starts.sort(); + stops.sort(); + let running = 0; + let peak = 0; + let stopIndex = 0; + for (const start of starts) { + while (stopIndex < total && stops[stopIndex] <= start) { + running--; + stopIndex++; + } + running++; + peak = Math.max(peak, running); + } + return peak; +} +function length(execution) { + return execution.stop - execution.start; +} + +// src/handlebars/helpers/ctrf.ts function LimitFailedTests() { import_handlebars2.default.registerHelper( "limitFailedTests", @@ -229662,6 +232026,11 @@ function formatDecimalRateHelper() { } ); } +function timelineReportHelper() { + import_handlebars2.default.registerHelper("timelineReport", (tests) => { + return buildTimelineReport(Array.isArray(tests) ? tests : []); + }); +} // src/handlebars/helpers/ansi.ts init_cjs_globals(); @@ -229757,6 +232126,7 @@ function registerAllHelpers() { anySkippedTestsHelper(); formatTestPathHelper(); getCollapseLargeReportsHelper(); + timelineReportHelper(); } // src/github/context.ts @@ -230202,8 +232572,8 @@ var firstHelper = { return void 0; if (n9 == null) return array[0]; - const count = typeof n9 === "number" ? n9 : parseInt(String(n9), 10); - return array.slice(0, count); + const count2 = typeof n9 === "number" ? n9 : parseInt(String(n9), 10); + return array.slice(0, count2); } }; var forEachHelper = { @@ -230265,11 +232635,11 @@ var joinHelper = { var equalsLengthHelper = { name: "equalsLength", category: "Array", - fn: (value, length) => { - if (!value || typeof length !== "number" && typeof length !== "string") + fn: (value, length2) => { + if (!value || typeof length2 !== "number" && typeof length2 !== "string") return false; const len = Array.isArray(value) || typeof value === "string" ? value.length : 0; - const target = typeof length === "number" ? length : parseInt(String(length), 10); + const target = typeof length2 === "number" ? length2 : parseInt(String(length2), 10); return len === target; } }; @@ -230282,8 +232652,8 @@ var lastHelper = { const arr = typeof value === "string" ? value.split("") : value; if (n9 == null) return arr[arr.length - 1]; - const count = typeof n9 === "number" ? n9 : parseInt(String(n9), 10); - return arr.slice(-count); + const count2 = typeof n9 === "number" ? n9 : parseInt(String(n9), 10); + return arr.slice(-count2); } }; var sliceHelper = { @@ -231290,22 +233660,22 @@ init_cjs_globals(); var inflectHelper = { name: "inflect", category: "Inflection", - fn: (count, singular, plural, includeCount = false) => { + fn: (count2, singular, plural2, includeCount = false) => { let numericCount; - if (typeof count === "number") { - numericCount = count; - } else if (typeof count === "string") { - numericCount = parseInt(count, 10); + if (typeof count2 === "number") { + numericCount = count2; + } else if (typeof count2 === "string") { + numericCount = parseInt(count2, 10); if (Number.isNaN(numericCount)) { return ""; } } else { return ""; } - if (typeof singular !== "string" || typeof plural !== "string") { + if (typeof singular !== "string" || typeof plural2 !== "string") { return ""; } - const word = numericCount === 1 ? singular : plural; + const word = numericCount === 1 ? singular : plural2; const shouldIncludeCount = includeCount === true || includeCount === "true"; return shouldIncludeCount ? `${numericCount} ${word}` : word; } @@ -231490,7 +233860,7 @@ function gte(i6, y) { } function combine(acc, pre, values, max, maxLength, dropEmpties) { const out = []; - let length = 0; + let length2 = 0; for (let a6 = 0; a6 < acc.length; a6++) { for (let v2 = 0; v2 < values.length; v2++) { if (out.length >= max) @@ -231498,10 +233868,10 @@ function combine(acc, pre, values, max, maxLength, dropEmpties) { const expansion = acc[a6] + pre + values[v2]; if (dropEmpties && !expansion) continue; - if (length + expansion.length > maxLength) + if (length2 + expansion.length > maxLength) return out; out.push(expansion); - length += expansion.length; + length2 += expansion.length; } } return out; @@ -231522,8 +233892,8 @@ function expandSequence(body2, isAlphaSequence, max, maxLength) { incr *= -1; test = gte; } - const pad = n9.some(isPadded); - let length = 0; + const pad2 = n9.some(isPadded); + let length2 = 0; for (let i6 = x2; test(i6, y) && N2.length < max; i6 += incr) { let c6; if (isAlphaSequence) { @@ -231533,7 +233903,7 @@ function expandSequence(body2, isAlphaSequence, max, maxLength) { } } else { c6 = String(i6); - if (pad) { + if (pad2) { const need = width - c6.length; if (need > 0) { const z = new Array(need + 1).join("0"); @@ -231545,10 +233915,10 @@ function expandSequence(body2, isAlphaSequence, max, maxLength) { } } } - if (length + c6.length > maxLength) + if (length2 + c6.length > maxLength) break; N2.push(c6); - length += c6.length; + length2 += c6.length; } return N2; } @@ -234185,14 +236555,14 @@ var downCaseHelper = { var ellipsisHelper = { name: "ellipsis", category: "String", - fn: (str, length) => { + fn: (str, length2) => { if (typeof str !== "string") { return ""; } - if (typeof length !== "string") { + if (typeof length2 !== "string") { return str; } - const maxLength = parseInt(length, 10); + const maxLength = parseInt(length2, 10); if (Number.isNaN(maxLength) || maxLength <= 0) { return str; } @@ -234236,17 +236606,17 @@ var occurrencesHelper = { if (typeof str !== "string" || typeof substring2 !== "string" || !substring2) { return 0; } - let count = 0; + let count2 = 0; let position = 0; while (true) { position = str.indexOf(substring2, position); if (position === -1) { break; } - count++; + count2++; position += 1; } - return count; + return count2; } }; var pascalCaseHelper = { @@ -234802,7 +237172,8 @@ var BuiltInReports = { InsightsTable: join2(basePath, "insights-table.hbs"), SlowestTable: join2(basePath, "slowest-table.hbs"), GitHub: join2(basePath, "github.hbs"), - FileTable: join2(basePath, "file-table.hbs") + FileTable: join2(basePath, "file-table.hbs"), + Timeline: join2(basePath, "timeline.hbs") }; function getBasePath(report) { const actionPath = join2(import.meta.dirname, report); @@ -234832,6 +237203,7 @@ var DEFAULT_REPORT_ORDER = [ "pull-request-report", "commit-report", "slowest-report", + "timeline-report", "custom-report", "community-report", "test-report", @@ -235123,6 +237495,10 @@ function generateReportByType(reportType, inputs, report) { report ); break; + case "timeline-report": + info("Adding timeline report to summary"); + addViewToSummary("### Timeline", BuiltInReports.Timeline, report); + break; case "custom-report": if (inputs.templatePath) { info("Adding custom report to summary"); @@ -235260,6 +237636,7 @@ function getInputs() { communityReport: getInput("community-report").toLowerCase() === "true", communityReportName: getInput("community-report-name"), fileReport: getInput("file-report").toLowerCase() === "true", + timelineReport: getInput("timeline-report").toLowerCase() === "true", artifactName: getInput("artifact-name") || "ctrf-report", annotate: getInput("annotate").toLowerCase() === "true", title: getInput("title") || "", @@ -236879,11 +239256,11 @@ var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code} var wrapAnsiHyperlink = (url2) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url2}${ANSI_ESCAPE_BELL}`; var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character)); var wrapWord = (rows, word, columns) => { - const characters = [...word]; + const characters2 = [...word]; let isInsideEscape = false; let isInsideLinkEscape = false; let visible = stringWidth(stripAnsi3(rows.at(-1))); - for (const [index2, character] of characters.entries()) { + for (const [index2, character] of characters2.entries()) { const characterLength = stringWidth(character); if (visible + characterLength <= columns) { rows[rows.length - 1] += character; @@ -236893,7 +239270,7 @@ var wrapWord = (rows, word, columns) => { } if (ESCAPES.has(character)) { isInsideEscape = true; - const ansiEscapeLinkCandidate = characters.slice(index2 + 1, index2 + 1 + ANSI_ESCAPE_LINK.length).join(""); + const ansiEscapeLinkCandidate = characters2.slice(index2 + 1, index2 + 1 + ANSI_ESCAPE_LINK.length).join(""); isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK; } if (isInsideEscape) { @@ -236908,7 +239285,7 @@ var wrapWord = (rows, word, columns) => { continue; } visible += characterLength; - if (visible === columns && index2 < characters.length - 1) { + if (visible === columns && index2 < characters2.length - 1) { rows.push(""); visible = 0; } @@ -238254,7 +240631,7 @@ var Y18N = class { __n() { const args = Array.prototype.slice.call(arguments); const singular = args.shift(); - const plural = args.shift(); + const plural2 = args.shift(); const quantity = args.shift(); let cb = function() { }; @@ -238262,7 +240639,7 @@ var Y18N = class { cb = args.pop(); if (!this.cache[this.locale]) this._readLocaleFile(); - let str = quantity === 1 ? singular : plural; + let str = quantity === 1 ? singular : plural2; if (this.cache[this.locale][singular]) { const entry = this.cache[this.locale][singular]; str = entry[quantity === 1 ? "one" : "other"]; @@ -238270,7 +240647,7 @@ var Y18N = class { if (!this.cache[this.locale][singular] && this.updateFiles) { this.cache[this.locale][singular] = { one: singular, - other: plural + other: plural2 }; this._enqueueWrite({ directory: this.directory, @@ -238527,13 +240904,13 @@ function argsert(arg1, arg2, arg3) { const args = [].slice.call(callerArguments); while (args.length && args[args.length - 1] === void 0) args.pop(); - const length = _length || args.length; - if (length < parsed.demanded.length) { + const length2 = _length || args.length; + if (length2 < parsed.demanded.length) { throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`); } const totalCommands = parsed.demanded.length + parsed.optional.length; - if (length > totalCommands) { - throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`); + if (length2 > totalCommands) { + throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length2}.`); } parsed.demanded.forEach((demanded) => { const arg = args.shift(); @@ -242377,15 +244754,15 @@ var LineDecoder = class { __classPrivateFieldSet2(this, _LineDecoder_buffer, new Uint8Array(), "f"); } } else if (lines.length > 0 && __classPrivateFieldGet2(this, _LineDecoder_buffer, "f").length > MAX_RETAINED_BUFFER_BYTES) { - const length = __classPrivateFieldGet2(this, _LineDecoder_end, "f") - __classPrivateFieldGet2(this, _LineDecoder_start, "f"); - if (length <= MAX_RETAINED_BUFFER_BYTES || __classPrivateFieldGet2(this, _LineDecoder_buffer, "f").length > length * 4) { - const capacity = length <= MAX_RETAINED_BUFFER_BYTES ? Math.min(Math.max(length * 2, 256), MAX_RETAINED_BUFFER_BYTES) : length * 2; + const length2 = __classPrivateFieldGet2(this, _LineDecoder_end, "f") - __classPrivateFieldGet2(this, _LineDecoder_start, "f"); + if (length2 <= MAX_RETAINED_BUFFER_BYTES || __classPrivateFieldGet2(this, _LineDecoder_buffer, "f").length > length2 * 4) { + const capacity = length2 <= MAX_RETAINED_BUFFER_BYTES ? Math.min(Math.max(length2 * 2, 256), MAX_RETAINED_BUFFER_BYTES) : length2 * 2; const buffer2 = new Uint8Array(capacity); buffer2.set(__classPrivateFieldGet2(this, _LineDecoder_buffer, "f").subarray(__classPrivateFieldGet2(this, _LineDecoder_start, "f"), __classPrivateFieldGet2(this, _LineDecoder_end, "f"))); __classPrivateFieldSet2(this, _LineDecoder_buffer, buffer2, "f"); __classPrivateFieldSet2(this, _LineDecoder_start, 0, "f"); - __classPrivateFieldSet2(this, _LineDecoder_end, length, "f"); - __classPrivateFieldSet2(this, _LineDecoder_searchIndex, length, "f"); + __classPrivateFieldSet2(this, _LineDecoder_end, length2, "f"); + __classPrivateFieldSet2(this, _LineDecoder_searchIndex, length2, "f"); } } return lines; @@ -242401,17 +244778,17 @@ var LineDecoder = class { }; _LineDecoder_buffer = /* @__PURE__ */ new WeakMap(), _LineDecoder_start = /* @__PURE__ */ new WeakMap(), _LineDecoder_end = /* @__PURE__ */ new WeakMap(), _LineDecoder_searchIndex = /* @__PURE__ */ new WeakMap(), _LineDecoder_skipLeadingLF = /* @__PURE__ */ new WeakMap(), _LineDecoder_instances = /* @__PURE__ */ new WeakSet(), _LineDecoder_append = function _LineDecoder_append2(chunk) { if (__classPrivateFieldGet2(this, _LineDecoder_end, "f") + chunk.length > __classPrivateFieldGet2(this, _LineDecoder_buffer, "f").length) { - const length = __classPrivateFieldGet2(this, _LineDecoder_end, "f") - __classPrivateFieldGet2(this, _LineDecoder_start, "f"); - if (__classPrivateFieldGet2(this, _LineDecoder_start, "f") >= __classPrivateFieldGet2(this, _LineDecoder_buffer, "f").length / 2 && length + chunk.length <= __classPrivateFieldGet2(this, _LineDecoder_buffer, "f").length) { + const length2 = __classPrivateFieldGet2(this, _LineDecoder_end, "f") - __classPrivateFieldGet2(this, _LineDecoder_start, "f"); + if (__classPrivateFieldGet2(this, _LineDecoder_start, "f") >= __classPrivateFieldGet2(this, _LineDecoder_buffer, "f").length / 2 && length2 + chunk.length <= __classPrivateFieldGet2(this, _LineDecoder_buffer, "f").length) { __classPrivateFieldGet2(this, _LineDecoder_buffer, "f").copyWithin(0, __classPrivateFieldGet2(this, _LineDecoder_start, "f"), __classPrivateFieldGet2(this, _LineDecoder_end, "f")); } else { - const capacity = Math.max(__classPrivateFieldGet2(this, _LineDecoder_buffer, "f").length * 2, length + chunk.length, 256); + const capacity = Math.max(__classPrivateFieldGet2(this, _LineDecoder_buffer, "f").length * 2, length2 + chunk.length, 256); const buffer2 = new Uint8Array(capacity); buffer2.set(__classPrivateFieldGet2(this, _LineDecoder_buffer, "f").subarray(__classPrivateFieldGet2(this, _LineDecoder_start, "f"), __classPrivateFieldGet2(this, _LineDecoder_end, "f"))); __classPrivateFieldSet2(this, _LineDecoder_buffer, buffer2, "f"); } __classPrivateFieldSet2(this, _LineDecoder_searchIndex, __classPrivateFieldGet2(this, _LineDecoder_searchIndex, "f") - __classPrivateFieldGet2(this, _LineDecoder_start, "f"), "f"); - __classPrivateFieldSet2(this, _LineDecoder_end, length, "f"); + __classPrivateFieldSet2(this, _LineDecoder_end, length2, "f"); __classPrivateFieldSet2(this, _LineDecoder_start, 0, "f"); } __classPrivateFieldGet2(this, _LineDecoder_buffer, "f").set(chunk, __classPrivateFieldGet2(this, _LineDecoder_end, "f")); @@ -246507,16 +248884,16 @@ function visitHiddenEventValues(current, kind, visit) { function getInspectableEventKeys(current, kind, availableBytes) { if (Array.isArray(current)) { const descriptor = Object.getOwnPropertyDescriptor(current, "length"); - const length2 = descriptor && "value" in descriptor ? descriptor.value : void 0; - if (typeof length2 !== "number" || !Number.isSafeInteger(length2) || length2 < 0 || length2 > Math.floor(availableBytes / 16)) { + const length3 = descriptor && "value" in descriptor ? descriptor.value : void 0; + if (typeof length3 !== "number" || !Number.isSafeInteger(length3) || length3 < 0 || length3 > Math.floor(availableBytes / 16)) { return void 0; } } if (kind !== "typed-array") { return Reflect.ownKeys(current); } - const length = typedArrayLengthGetter?.call(current); - if (typeof length !== "number" || !Number.isSafeInteger(length) || length < 0 || length > MAX_INSPECTABLE_TYPED_ARRAY_ELEMENTS) { + const length2 = typedArrayLengthGetter?.call(current); + if (typeof length2 !== "number" || !Number.isSafeInteger(length2) || length2 < 0 || length2 > MAX_INSPECTABLE_TYPED_ARRAY_ELEMENTS) { return void 0; } return Reflect.ownKeys(current).filter((key) => { @@ -246524,7 +248901,7 @@ function getInspectableEventKeys(current, kind, availableBytes) { return true; } const index2 = Number(key); - return !Number.isInteger(index2) || index2 < 0 || index2 >= length || String(index2) !== key; + return !Number.isInteger(index2) || index2 < 0 || index2 >= length2 || String(index2) !== key; }); } function visitInspectableEventProperties(current, kind, depth, availableBytes, charge, visit) { @@ -247956,10 +250333,10 @@ _a4 = AbstractChatCompletionRunner, _AbstractChatCompletionRunner_completionArri if (!hasOwn(details, name)) { continue; } - const count = details[name]; - if (typeof count === "number") { + const count2 = details[name]; + if (typeof count2 === "number") { Object.defineProperty(totalDetails, name, { - value: (hasOwn(totalDetails, name) ? totalDetails[name] ?? 0 : 0) + count, + value: (hasOwn(totalDetails, name) ? totalDetails[name] ?? 0 : 0) + count2, enumerable: true, configurable: true, writable: true @@ -248065,7 +250442,7 @@ function parseJSON(jsonString, allowPartial = Allow.ALL) { return _parseJSON(jsonString.trim(), allowPartial); } var _parseJSON = (jsonString, allow) => { - const length = jsonString.length; + const length2 = jsonString.length; let index2 = 0; const markPartialJSON = (msg) => { throw new PartialJSON(`${msg} at position ${index2}`); @@ -248075,7 +250452,7 @@ var _parseJSON = (jsonString, allow) => { }; const parseAny = () => { skipBlank(); - if (index2 >= length) { + if (index2 >= length2) { markPartialJSON("Unexpected end of input"); } if (jsonString[index2] === '"') { @@ -248087,27 +250464,27 @@ var _parseJSON = (jsonString, allow) => { if (jsonString[index2] === "[") { return parseArr(); } - if (jsonString.substring(index2, index2 + 4) === "null" || Allow.NULL & allow && length - index2 < 4 && "null".startsWith(jsonString.substring(index2))) { + if (jsonString.substring(index2, index2 + 4) === "null" || Allow.NULL & allow && length2 - index2 < 4 && "null".startsWith(jsonString.substring(index2))) { index2 += 4; return null; } - if (jsonString.substring(index2, index2 + 4) === "true" || Allow.BOOL & allow && length - index2 < 4 && "true".startsWith(jsonString.substring(index2))) { + if (jsonString.substring(index2, index2 + 4) === "true" || Allow.BOOL & allow && length2 - index2 < 4 && "true".startsWith(jsonString.substring(index2))) { index2 += 4; return true; } - if (jsonString.substring(index2, index2 + 5) === "false" || Allow.BOOL & allow && length - index2 < 5 && "false".startsWith(jsonString.substring(index2))) { + if (jsonString.substring(index2, index2 + 5) === "false" || Allow.BOOL & allow && length2 - index2 < 5 && "false".startsWith(jsonString.substring(index2))) { index2 += 5; return false; } - if (jsonString.substring(index2, index2 + 8) === "Infinity" || Allow.INFINITY & allow && length - index2 < 8 && "Infinity".startsWith(jsonString.substring(index2))) { + if (jsonString.substring(index2, index2 + 8) === "Infinity" || Allow.INFINITY & allow && length2 - index2 < 8 && "Infinity".startsWith(jsonString.substring(index2))) { index2 += 8; return Infinity; } - if (jsonString.substring(index2, index2 + 9) === "-Infinity" || Allow.MINUS_INFINITY & allow && length - index2 > 1 && length - index2 < 9 && "-Infinity".startsWith(jsonString.substring(index2))) { + if (jsonString.substring(index2, index2 + 9) === "-Infinity" || Allow.MINUS_INFINITY & allow && length2 - index2 > 1 && length2 - index2 < 9 && "-Infinity".startsWith(jsonString.substring(index2))) { index2 += 9; return -Infinity; } - if (jsonString.substring(index2, index2 + 3) === "NaN" || Allow.NAN & allow && length - index2 < 3 && "NaN".startsWith(jsonString.substring(index2))) { + if (jsonString.substring(index2, index2 + 3) === "NaN" || Allow.NAN & allow && length2 - index2 < 3 && "NaN".startsWith(jsonString.substring(index2))) { index2 += 3; return Number.NaN; } @@ -248117,7 +250494,7 @@ var _parseJSON = (jsonString, allow) => { const start = index2; let escape4 = false; index2++; - while (index2 < length && (jsonString[index2] !== '"' || escape4 && jsonString[index2 - 1] === "\\")) { + while (index2 < length2 && (jsonString[index2] !== '"' || escape4 && jsonString[index2 - 1] === "\\")) { escape4 = jsonString[index2] === "\\" ? !escape4 : false; index2++; } @@ -248143,7 +250520,7 @@ var _parseJSON = (jsonString, allow) => { try { while (jsonString[index2] !== "}") { skipBlank(); - if (index2 >= length && Allow.OBJ & allow) { + if (index2 >= length2 && Allow.OBJ & allow) { return obj; } const key = parseStr(); @@ -248219,7 +250596,7 @@ var _parseJSON = (jsonString, allow) => { while (jsonString[index2] && !",]}".includes(jsonString[index2])) { index2++; } - if (index2 === length && !(Allow.NUM & allow)) { + if (index2 === length2 && !(Allow.NUM & allow)) { markPartialJSON("Unterminated number literal"); } const number = jsonString.substring(start, index2); @@ -248237,7 +250614,7 @@ var _parseJSON = (jsonString, allow) => { } }; const skipBlank = () => { - while (index2 < length && " \n\r ".includes(jsonString[index2])) { + while (index2 < length2 && " \n\r ".includes(jsonString[index2])) { index2++; } }; @@ -248448,8 +250825,8 @@ function captureSnapshotArray(snapshot2, property, maximum, kind) { if (!("value" in descriptor) || !Array.isArray(descriptor.value)) { throw new OpenAIError(`Chat completion stream contains an unsafe snapshot ${kind} collection`); } - const length = Object.getOwnPropertyDescriptor(descriptor.value, "length"); - if (!length || !("value" in length) || !Number.isSafeInteger(length.value) || length.value > maximum) { + const length2 = Object.getOwnPropertyDescriptor(descriptor.value, "length"); + if (!length2 || !("value" in length2) || !Number.isSafeInteger(length2.value) || length2.value > maximum) { throw new OpenAIError(`Chat completion stream exceeded its snapshot ${kind} limit`); } return descriptor.value; @@ -248466,13 +250843,13 @@ function captureSnapshotArrayItem(array, index2) { } function mapCapturedSnapshotArray(array, maximum, kind, map2) { const descriptor = Object.getOwnPropertyDescriptor(array, "length"); - const length = descriptor && "value" in descriptor ? descriptor.value : void 0; - if (typeof length !== "number" || !Number.isSafeInteger(length) || length < 0 || length > maximum) { + const length2 = descriptor && "value" in descriptor ? descriptor.value : void 0; + if (typeof length2 !== "number" || !Number.isSafeInteger(length2) || length2 < 0 || length2 > maximum) { throw new OpenAIError(`Chat completion stream exceeded its snapshot ${kind} limit`); } const mapped = []; - mapped.length = length; - for (let index2 = 0; index2 < length; index2 += 1) { + mapped.length = length2; + for (let index2 = 0; index2 < length2; index2 += 1) { const item = Object.getOwnPropertyDescriptor(array, index2); if (!item) { continue; @@ -248547,8 +250924,8 @@ function snapshotChatCompletionParserParams(params) { if (params.tools) { const stableTools = []; const lengthDescriptor = Object.getOwnPropertyDescriptor(params.tools, "length"); - const length = lengthDescriptor && "value" in lengthDescriptor ? lengthDescriptor.value : void 0; - const toolCount = typeof length === "number" && Number.isSafeInteger(length) && length >= 0 ? Math.min(length, MAX_STREAM_TOOL_CALLS) : 0; + const length2 = lengthDescriptor && "value" in lengthDescriptor ? lengthDescriptor.value : void 0; + const toolCount = typeof length2 === "number" && Number.isSafeInteger(length2) && length2 >= 0 ? Math.min(length2, MAX_STREAM_TOOL_CALLS) : 0; for (let index2 = 0; index2 < toolCount; index2 += 1) { const item = Object.getOwnPropertyDescriptor(params.tools, String(index2)); if (!item || !("value" in item)) { @@ -248645,12 +251022,12 @@ function canonicalSerializedParserSchema(value, budget) { } if (array) { const lengthDescriptor = Object.getOwnPropertyDescriptor(current, "length"); - const length = lengthDescriptor && "value" in lengthDescriptor ? lengthDescriptor.value : void 0; - if (typeof length !== "number" || !Number.isSafeInteger(length) || length < 0 || length > MAX_SERIALIZED_PARSER_SCHEMA_NODES - budget.nodes) { + const length2 = lengthDescriptor && "value" in lengthDescriptor ? lengthDescriptor.value : void 0; + if (typeof length2 !== "number" || !Number.isSafeInteger(length2) || length2 < 0 || length2 > MAX_SERIALIZED_PARSER_SCHEMA_NODES - budget.nodes) { return UNSAFE_SERIALIZED_PARSER_VALUE; } const items = []; - for (let index2 = 0; index2 < length; index2 += 1) { + for (let index2 = 0; index2 < length2; index2 += 1) { const key = String(index2); const descriptor = Object.getOwnPropertyDescriptor(current, key); if (!descriptor) { @@ -248967,9 +251344,9 @@ var ChatCompletionStream = class _ChatCompletionStream extends AbstractChatCompl __classPrivateFieldSet2(this, _ChatCompletionStream_hasAutoParseableTool, false, "f"); const tools = params?.tools; const lengthDescriptor = tools && Object.getOwnPropertyDescriptor(tools, "length"); - const length = lengthDescriptor && "value" in lengthDescriptor ? lengthDescriptor.value : void 0; - if (tools && typeof length === "number" && Number.isSafeInteger(length) && length >= 0) { - for (let index2 = 0; index2 < Math.min(length, MAX_STREAM_TOOL_CALLS); index2 += 1) { + const length2 = lengthDescriptor && "value" in lengthDescriptor ? lengthDescriptor.value : void 0; + if (tools && typeof length2 === "number" && Number.isSafeInteger(length2) && length2 >= 0) { + for (let index2 = 0; index2 < Math.min(length2, MAX_STREAM_TOOL_CALLS); index2 += 1) { const descriptor = Object.getOwnPropertyDescriptor(tools, String(index2)); if (!descriptor || !("value" in descriptor)) { continue; @@ -257147,14 +259524,14 @@ function isPrimitiveAssistantStreamArrayDelta(accumulator, delta) { return delta.every(isPrimitiveAssistantStreamValue) && accumulator.every(isPrimitiveAssistantStreamValue); } function countOwnAssistantStreamArrayEntries(accumulator) { - let count = 0; + let count2 = 0; for (const key of Object.keys(accumulator)) { const index2 = Number(key); if (Number.isSafeInteger(index2) && index2 >= 0 && index2 < accumulator.length && String(index2) === key) { - count += 1; + count2 += 1; } } - return count; + return count2; } function getAssistantStreamArrayOwnEntryCount(accumulator, enforceSparseHoleBudget, cachedState) { if (!enforceSparseHoleBudget) { @@ -258923,8 +261300,8 @@ function createEmbedding(client2, body2, options) { if (!Array.isArray(embeddings)) { throw new TypeError("Expected embeddings response data to be an array"); } - const { length } = embeddings; - for (let index2 = 0; index2 < length; index2 += 1) { + const { length: length2 } = embeddings; + for (let index2 = 0; index2 < length2; index2 += 1) { if (index2 in embeddings) { const embeddingBase64Obj = embeddings[index2]; const { embedding } = embeddingBase64Obj; @@ -260562,9 +262939,9 @@ function updateCachedOutputTextLength(context5, output, outputIndex, previousTex if (context5.deferOutputText) { return; } - const length = context5.outputTextLengths.get(output); - if (length !== void 0) { - const nextLength = length - previousText.length + nextText.length; + const length2 = context5.outputTextLengths.get(output); + if (length2 !== void 0) { + const nextLength = length2 - previousText.length + nextText.length; context5.outputTextLengths.set(output, nextLength); context5.outputTextIndex.update(outputIndex, nextLength); } diff --git a/dist/index.js.map b/dist/index.js.map index b2e1236b..dc0ea312 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["../scripts/cjs-globals.ts","../node_modules/tunnel/lib/tunnel.js","../node_modules/tunnel/index.js","../node_modules/@actions/http-client/node_modules/undici/lib/core/symbols.js","../node_modules/@actions/http-client/node_modules/undici/lib/core/errors.js","../node_modules/@actions/http-client/node_modules/undici/lib/core/constants.js","../node_modules/@actions/http-client/node_modules/undici/lib/core/tree.js","../node_modules/@actions/http-client/node_modules/undici/lib/core/util.js","../node_modules/@actions/http-client/node_modules/undici/lib/core/diagnostics.js","../node_modules/@actions/http-client/node_modules/undici/lib/core/request.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/dispatcher.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/dispatcher-base.js","../node_modules/@actions/http-client/node_modules/undici/lib/util/timers.js","../node_modules/@actions/http-client/node_modules/undici/lib/core/connect.js","../node_modules/@actions/http-client/node_modules/undici/lib/llhttp/utils.js","../node_modules/@actions/http-client/node_modules/undici/lib/llhttp/constants.js","../node_modules/@actions/http-client/node_modules/undici/lib/llhttp/llhttp-wasm.js","../node_modules/@actions/http-client/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/constants.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/global.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/data-url.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/webidl.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/util.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/symbols.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/file.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/formdata.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/formdata-parser.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/body.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/client-h1.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/client-h2.js","../node_modules/@actions/http-client/node_modules/undici/lib/handler/redirect-handler.js","../node_modules/@actions/http-client/node_modules/undici/lib/interceptor/redirect-interceptor.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/client.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/fixed-queue.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/pool-stats.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/pool-base.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/pool.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/balanced-pool.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/agent.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/proxy-agent.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js","../node_modules/@actions/http-client/node_modules/undici/lib/handler/retry-handler.js","../node_modules/@actions/http-client/node_modules/undici/lib/dispatcher/retry-agent.js","../node_modules/@actions/http-client/node_modules/undici/lib/api/readable.js","../node_modules/@actions/http-client/node_modules/undici/lib/api/util.js","../node_modules/@actions/http-client/node_modules/undici/lib/api/api-request.js","../node_modules/@actions/http-client/node_modules/undici/lib/api/abort-signal.js","../node_modules/@actions/http-client/node_modules/undici/lib/api/api-stream.js","../node_modules/@actions/http-client/node_modules/undici/lib/api/api-pipeline.js","../node_modules/@actions/http-client/node_modules/undici/lib/api/api-upgrade.js","../node_modules/@actions/http-client/node_modules/undici/lib/api/api-connect.js","../node_modules/@actions/http-client/node_modules/undici/lib/api/index.js","../node_modules/@actions/http-client/node_modules/undici/lib/mock/mock-errors.js","../node_modules/@actions/http-client/node_modules/undici/lib/mock/mock-symbols.js","../node_modules/@actions/http-client/node_modules/undici/lib/mock/mock-utils.js","../node_modules/@actions/http-client/node_modules/undici/lib/mock/mock-interceptor.js","../node_modules/@actions/http-client/node_modules/undici/lib/mock/mock-client.js","../node_modules/@actions/http-client/node_modules/undici/lib/mock/mock-pool.js","../node_modules/@actions/http-client/node_modules/undici/lib/mock/pluralizer.js","../node_modules/@actions/http-client/node_modules/undici/lib/mock/pending-interceptors-formatter.js","../node_modules/@actions/http-client/node_modules/undici/lib/mock/mock-agent.js","../node_modules/@actions/http-client/node_modules/undici/lib/global.js","../node_modules/@actions/http-client/node_modules/undici/lib/handler/decorator-handler.js","../node_modules/@actions/http-client/node_modules/undici/lib/interceptor/redirect.js","../node_modules/@actions/http-client/node_modules/undici/lib/interceptor/retry.js","../node_modules/@actions/http-client/node_modules/undici/lib/interceptor/dump.js","../node_modules/@actions/http-client/node_modules/undici/lib/interceptor/dns.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/headers.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/response.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/dispatcher-weakref.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/request.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fetch/index.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fileapi/symbols.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fileapi/progressevent.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fileapi/encoding.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fileapi/util.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/fileapi/filereader.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/cache/symbols.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/cache/util.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/cache/cache.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/cache/cachestorage.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/cookies/constants.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/cookies/util.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/cookies/parse.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/cookies/index.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/websocket/events.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/websocket/constants.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/websocket/symbols.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/websocket/util.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/websocket/frame.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/websocket/connection.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/websocket/permessage-deflate.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/websocket/receiver.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/websocket/sender.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/websocket/websocket.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/eventsource/util.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/eventsource/eventsource-stream.js","../node_modules/@actions/http-client/node_modules/undici/lib/web/eventsource/eventsource.js","../node_modules/@actions/http-client/node_modules/undici/index.js","../node_modules/@actions/github/node_modules/@actions/http-client/src/proxy.ts","../node_modules/@actions/github/node_modules/undici/lib/core/symbols.js","../node_modules/@actions/github/node_modules/undici/lib/core/errors.js","../node_modules/@actions/github/node_modules/undici/lib/core/constants.js","../node_modules/@actions/github/node_modules/undici/lib/core/tree.js","../node_modules/@actions/github/node_modules/undici/lib/core/util.js","../node_modules/@actions/github/node_modules/undici/lib/core/diagnostics.js","../node_modules/@actions/github/node_modules/undici/lib/core/request.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/dispatcher.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/dispatcher-base.js","../node_modules/@actions/github/node_modules/undici/lib/util/timers.js","../node_modules/@actions/github/node_modules/undici/lib/core/connect.js","../node_modules/@actions/github/node_modules/undici/lib/llhttp/utils.js","../node_modules/@actions/github/node_modules/undici/lib/llhttp/constants.js","../node_modules/@actions/github/node_modules/undici/lib/llhttp/llhttp-wasm.js","../node_modules/@actions/github/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/constants.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/global.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/data-url.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/webidl.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/util.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/symbols.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/file.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/formdata.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/formdata-parser.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/body.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/client-h1.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/client-h2.js","../node_modules/@actions/github/node_modules/undici/lib/handler/redirect-handler.js","../node_modules/@actions/github/node_modules/undici/lib/interceptor/redirect-interceptor.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/client.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/fixed-queue.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/pool-stats.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/pool-base.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/pool.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/balanced-pool.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/agent.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/proxy-agent.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js","../node_modules/@actions/github/node_modules/undici/lib/handler/retry-handler.js","../node_modules/@actions/github/node_modules/undici/lib/dispatcher/retry-agent.js","../node_modules/@actions/github/node_modules/undici/lib/api/readable.js","../node_modules/@actions/github/node_modules/undici/lib/api/util.js","../node_modules/@actions/github/node_modules/undici/lib/api/api-request.js","../node_modules/@actions/github/node_modules/undici/lib/api/abort-signal.js","../node_modules/@actions/github/node_modules/undici/lib/api/api-stream.js","../node_modules/@actions/github/node_modules/undici/lib/api/api-pipeline.js","../node_modules/@actions/github/node_modules/undici/lib/api/api-upgrade.js","../node_modules/@actions/github/node_modules/undici/lib/api/api-connect.js","../node_modules/@actions/github/node_modules/undici/lib/api/index.js","../node_modules/@actions/github/node_modules/undici/lib/mock/mock-errors.js","../node_modules/@actions/github/node_modules/undici/lib/mock/mock-symbols.js","../node_modules/@actions/github/node_modules/undici/lib/mock/mock-utils.js","../node_modules/@actions/github/node_modules/undici/lib/mock/mock-interceptor.js","../node_modules/@actions/github/node_modules/undici/lib/mock/mock-client.js","../node_modules/@actions/github/node_modules/undici/lib/mock/mock-pool.js","../node_modules/@actions/github/node_modules/undici/lib/mock/pluralizer.js","../node_modules/@actions/github/node_modules/undici/lib/mock/pending-interceptors-formatter.js","../node_modules/@actions/github/node_modules/undici/lib/mock/mock-agent.js","../node_modules/@actions/github/node_modules/undici/lib/global.js","../node_modules/@actions/github/node_modules/undici/lib/handler/decorator-handler.js","../node_modules/@actions/github/node_modules/undici/lib/interceptor/redirect.js","../node_modules/@actions/github/node_modules/undici/lib/interceptor/retry.js","../node_modules/@actions/github/node_modules/undici/lib/interceptor/dump.js","../node_modules/@actions/github/node_modules/undici/lib/interceptor/dns.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/headers.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/response.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/dispatcher-weakref.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/request.js","../node_modules/@actions/github/node_modules/undici/lib/web/fetch/index.js","../node_modules/@actions/github/node_modules/undici/lib/web/fileapi/symbols.js","../node_modules/@actions/github/node_modules/undici/lib/web/fileapi/progressevent.js","../node_modules/@actions/github/node_modules/undici/lib/web/fileapi/encoding.js","../node_modules/@actions/github/node_modules/undici/lib/web/fileapi/util.js","../node_modules/@actions/github/node_modules/undici/lib/web/fileapi/filereader.js","../node_modules/@actions/github/node_modules/undici/lib/web/cache/symbols.js","../node_modules/@actions/github/node_modules/undici/lib/web/cache/util.js","../node_modules/@actions/github/node_modules/undici/lib/web/cache/cache.js","../node_modules/@actions/github/node_modules/undici/lib/web/cache/cachestorage.js","../node_modules/@actions/github/node_modules/undici/lib/web/cookies/constants.js","../node_modules/@actions/github/node_modules/undici/lib/web/cookies/util.js","../node_modules/@actions/github/node_modules/undici/lib/web/cookies/parse.js","../node_modules/@actions/github/node_modules/undici/lib/web/cookies/index.js","../node_modules/@actions/github/node_modules/undici/lib/web/websocket/events.js","../node_modules/@actions/github/node_modules/undici/lib/web/websocket/constants.js","../node_modules/@actions/github/node_modules/undici/lib/web/websocket/symbols.js","../node_modules/@actions/github/node_modules/undici/lib/web/websocket/util.js","../node_modules/@actions/github/node_modules/undici/lib/web/websocket/frame.js","../node_modules/@actions/github/node_modules/undici/lib/web/websocket/connection.js","../node_modules/@actions/github/node_modules/undici/lib/web/websocket/permessage-deflate.js","../node_modules/@actions/github/node_modules/undici/lib/web/websocket/receiver.js","../node_modules/@actions/github/node_modules/undici/lib/web/websocket/sender.js","../node_modules/@actions/github/node_modules/undici/lib/web/websocket/websocket.js","../node_modules/@actions/github/node_modules/undici/lib/web/eventsource/util.js","../node_modules/@actions/github/node_modules/undici/lib/web/eventsource/eventsource-stream.js","../node_modules/@actions/github/node_modules/undici/lib/web/eventsource/eventsource.js","../node_modules/@actions/github/node_modules/undici/index.js","../node_modules/@actions/github/node_modules/@actions/http-client/src/index.ts","../node_modules/universal-user-agent/index.js","../node_modules/before-after-hook/lib/register.js","../node_modules/before-after-hook/lib/add.js","../node_modules/before-after-hook/lib/remove.js","../node_modules/before-after-hook/index.js","../node_modules/@octokit/endpoint/dist-bundle/index.js","../node_modules/content-type/src/index.ts","../node_modules/json-with-bigint/json-with-bigint.js","../node_modules/@octokit/request-error/dist-src/index.js","../node_modules/@octokit/request/dist-bundle/index.js","../node_modules/@octokit/graphql/dist-bundle/index.js","../node_modules/@octokit/auth-token/dist-bundle/index.js","../node_modules/@octokit/core/dist-src/version.js","../node_modules/@octokit/core/dist-src/index.js","../node_modules/@octokit/src/version.ts","../node_modules/@octokit/src/generated/endpoints.ts","../node_modules/@octokit/src/endpoints-to-methods.ts","../node_modules/@octokit/src/index.ts","../node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js","../node_modules/@octokit/plugin-request-log/dist-src/version.js","../node_modules/@octokit/plugin-request-log/dist-src/index.js","../node_modules/@octokit/rest/dist-src/version.js","../node_modules/@octokit/rest/dist-src/index.js","../node_modules/bottleneck/light.js","../node_modules/@octokit/plugin-retry/dist-bundle/index.js","../node_modules/undici/lib/core/symbols.js","../node_modules/undici/lib/util/timers.js","../node_modules/undici/lib/core/errors.js","../node_modules/undici/lib/core/constants.js","../node_modules/undici/lib/core/tree.js","../node_modules/undici/lib/core/util.js","../node_modules/undici/lib/util/stats.js","../node_modules/undici/lib/core/diagnostics.js","../node_modules/undici/lib/core/request.js","../node_modules/undici/lib/dispatcher/dispatcher.js","../node_modules/undici/lib/dispatcher/dispatcher-base.js","../node_modules/undici/lib/core/connect.js","../node_modules/undici/lib/llhttp/utils.js","../node_modules/undici/lib/llhttp/constants.js","../node_modules/undici/lib/llhttp/llhttp-wasm.js","../node_modules/undici/lib/llhttp/llhttp_simd-wasm.js","../node_modules/undici/lib/web/fetch/constants.js","../node_modules/undici/lib/web/fetch/global.js","../node_modules/undici/lib/encoding/index.js","../node_modules/undici/lib/web/infra/index.js","../node_modules/undici/lib/web/fetch/data-url.js","../node_modules/undici/lib/web/webidl/index.js","../node_modules/undici/lib/web/fetch/util.js","../node_modules/undici/lib/util/runtime-features.js","../node_modules/undici/lib/web/fetch/formdata.js","../node_modules/undici/lib/web/fetch/formdata-parser.js","../node_modules/undici/lib/web/fetch/body.js","../node_modules/undici/lib/dispatcher/client-h1.js","../node_modules/undici/lib/dispatcher/client-h2.js","../node_modules/undici/lib/dispatcher/client.js","../node_modules/undici/lib/dispatcher/fixed-queue.js","../node_modules/undici/lib/dispatcher/pool-base.js","../node_modules/undici/lib/dispatcher/pool.js","../node_modules/undici/lib/dispatcher/balanced-pool.js","../node_modules/undici/lib/dispatcher/round-robin-pool.js","../node_modules/undici/lib/dispatcher/agent.js","../node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js","../node_modules/undici/lib/core/socks5-utils.js","../node_modules/undici/lib/core/socks5-client.js","../node_modules/undici/lib/dispatcher/socks5-proxy-agent.js","../node_modules/undici/lib/dispatcher/proxy-agent.js","../node_modules/undici/lib/dispatcher/env-http-proxy-agent.js","../node_modules/undici/lib/handler/retry-handler.js","../node_modules/undici/lib/dispatcher/retry-agent.js","../node_modules/undici/lib/dispatcher/h2c-client.js","../node_modules/undici/lib/api/readable.js","../node_modules/undici/lib/api/api-request.js","../node_modules/undici/lib/api/abort-signal.js","../node_modules/undici/lib/api/api-stream.js","../node_modules/undici/lib/api/api-pipeline.js","../node_modules/undici/lib/api/api-upgrade.js","../node_modules/undici/lib/api/api-connect.js","../node_modules/undici/lib/api/index.js","../node_modules/undici/lib/mock/mock-errors.js","../node_modules/undici/lib/mock/mock-symbols.js","../node_modules/undici/lib/mock/mock-utils.js","../node_modules/undici/lib/mock/mock-interceptor.js","../node_modules/undici/lib/mock/mock-client.js","../node_modules/undici/lib/mock/mock-call-history.js","../node_modules/undici/lib/mock/mock-pool.js","../node_modules/undici/lib/mock/pending-interceptors-formatter.js","../node_modules/undici/lib/mock/mock-agent.js","../node_modules/undici/lib/mock/snapshot-utils.js","../node_modules/undici/lib/mock/snapshot-recorder.js","../node_modules/undici/lib/mock/snapshot-agent.js","../node_modules/undici/lib/global.js","../node_modules/undici/lib/handler/decorator-handler.js","../node_modules/undici/lib/handler/redirect-handler.js","../node_modules/undici/lib/interceptor/redirect.js","../node_modules/undici/lib/interceptor/response-error.js","../node_modules/undici/lib/interceptor/retry.js","../node_modules/undici/lib/interceptor/dump.js","../node_modules/undici/lib/interceptor/dns.js","../node_modules/undici/lib/util/cache.js","../node_modules/undici/lib/util/date.js","../node_modules/undici/lib/handler/cache-handler.js","../node_modules/undici/lib/cache/memory-cache-store.js","../node_modules/undici/lib/handler/cache-revalidation-handler.js","../node_modules/undici/lib/interceptor/cache.js","../node_modules/undici/lib/interceptor/decompress.js","../node_modules/undici/lib/handler/deduplication-handler.js","../node_modules/undici/lib/interceptor/deduplicate.js","../node_modules/undici/lib/cache/sqlite-cache-store.js","../node_modules/undici/lib/web/fetch/headers.js","../node_modules/undici/lib/web/fetch/response.js","../node_modules/undici/lib/web/fetch/request.js","../node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js","../node_modules/undici/lib/web/fetch/index.js","../node_modules/undici/lib/web/cache/util.js","../node_modules/undici/lib/web/cache/cache.js","../node_modules/undici/lib/web/cache/cachestorage.js","../node_modules/undici/lib/web/cookies/constants.js","../node_modules/undici/lib/web/cookies/util.js","../node_modules/undici/lib/web/cookies/parse.js","../node_modules/undici/lib/web/cookies/index.js","../node_modules/undici/lib/web/websocket/events.js","../node_modules/undici/lib/web/websocket/constants.js","../node_modules/undici/lib/web/websocket/util.js","../node_modules/undici/lib/web/websocket/frame.js","../node_modules/undici/lib/web/websocket/connection.js","../node_modules/undici/lib/web/websocket/permessage-deflate.js","../node_modules/undici/lib/web/websocket/receiver.js","../node_modules/undici/lib/web/websocket/sender.js","../node_modules/undici/lib/web/websocket/websocket.js","../node_modules/undici/lib/web/websocket/stream/websocketerror.js","../node_modules/undici/lib/web/websocket/stream/websocketstream.js","../node_modules/undici/lib/web/eventsource/util.js","../node_modules/undici/lib/web/eventsource/eventsource-stream.js","../node_modules/undici/lib/web/eventsource/eventsource.js","../node_modules/undici/index.js","../node_modules/adm-zip/util/constants.js","../node_modules/adm-zip/util/errors.js","../node_modules/adm-zip/util/utils.js","../node_modules/adm-zip/util/fattr.js","../node_modules/adm-zip/util/decoder.js","../node_modules/adm-zip/util/index.js","../node_modules/adm-zip/headers/entryHeader.js","../node_modules/adm-zip/headers/mainHeader.js","../node_modules/adm-zip/headers/index.js","../node_modules/adm-zip/methods/deflater.js","../node_modules/adm-zip/methods/inflater.js","../node_modules/adm-zip/methods/zipcrypto.js","../node_modules/adm-zip/methods/index.js","../node_modules/adm-zip/zipEntry.js","../node_modules/adm-zip/zipFile.js","../node_modules/adm-zip/adm-zip.js","../node_modules/@actions/artifact/package.json","../node_modules/@actions/artifact/lib/internal/shared/package-version.cjs","../node_modules/ms/index.js","../node_modules/debug/src/common.js","../node_modules/debug/src/browser.js","../node_modules/debug/src/node.js","../node_modules/debug/src/index.js","../node_modules/agent-base/src/helpers.ts","../node_modules/agent-base/src/index.ts","../node_modules/https-proxy-agent/src/parse-proxy-response.ts","../node_modules/https-proxy-agent/src/index.ts","../node_modules/http-proxy-agent/src/index.ts","../node_modules/@azure/core-tracing/src/state-cjs.ts","../node_modules/@azure/core-client/src/state-cjs.ts","../node_modules/readdir-glob/node_modules/minimatch/lib/path.js","../node_modules/balanced-match/index.js","../node_modules/readdir-glob/node_modules/brace-expansion/index.js","../node_modules/readdir-glob/node_modules/minimatch/minimatch.js","../node_modules/readdir-glob/index.js","../node_modules/async/dist/async.mjs","../node_modules/graceful-fs/polyfills.js","../node_modules/graceful-fs/legacy-streams.js","../node_modules/graceful-fs/clone.js","../node_modules/graceful-fs/graceful-fs.js","../node_modules/is-stream/index.js","../node_modules/process-nextick-args/index.js","../node_modules/lazystream/node_modules/isarray/index.js","../node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/stream.js","../node_modules/lazystream/node_modules/safe-buffer/index.js","../node_modules/core-util-is/lib/util.js","../node_modules/inherits/inherits_browser.js","../node_modules/inherits/inherits.js","../node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/BufferList.js","../node_modules/lazystream/node_modules/readable-stream/lib/internal/streams/destroy.js","../node_modules/util-deprecate/node.js","../node_modules/lazystream/node_modules/readable-stream/lib/_stream_writable.js","../node_modules/lazystream/node_modules/readable-stream/lib/_stream_duplex.js","../node_modules/lazystream/node_modules/string_decoder/lib/string_decoder.js","../node_modules/lazystream/node_modules/readable-stream/lib/_stream_readable.js","../node_modules/lazystream/node_modules/readable-stream/lib/_stream_transform.js","../node_modules/lazystream/node_modules/readable-stream/lib/_stream_passthrough.js","../node_modules/lazystream/node_modules/readable-stream/readable.js","../node_modules/lazystream/node_modules/readable-stream/passthrough.js","../node_modules/lazystream/lib/lazystream.js","../node_modules/normalize-path/index.js","../node_modules/lodash/identity.js","../node_modules/lodash/_apply.js","../node_modules/lodash/_overRest.js","../node_modules/lodash/constant.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObject.js","../node_modules/lodash/isFunction.js","../node_modules/lodash/_coreJsData.js","../node_modules/lodash/_isMasked.js","../node_modules/lodash/_toSource.js","../node_modules/lodash/_baseIsNative.js","../node_modules/lodash/_getValue.js","../node_modules/lodash/_getNative.js","../node_modules/lodash/_defineProperty.js","../node_modules/lodash/_baseSetToString.js","../node_modules/lodash/_shortOut.js","../node_modules/lodash/_setToString.js","../node_modules/lodash/_baseRest.js","../node_modules/lodash/eq.js","../node_modules/lodash/isLength.js","../node_modules/lodash/isArrayLike.js","../node_modules/lodash/_isIndex.js","../node_modules/lodash/_isIterateeCall.js","../node_modules/lodash/_baseTimes.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/_baseIsArguments.js","../node_modules/lodash/isArguments.js","../node_modules/lodash/isArray.js","../node_modules/lodash/stubFalse.js","../node_modules/lodash/isBuffer.js","../node_modules/lodash/_baseIsTypedArray.js","../node_modules/lodash/_baseUnary.js","../node_modules/lodash/_nodeUtil.js","../node_modules/lodash/isTypedArray.js","../node_modules/lodash/_arrayLikeKeys.js","../node_modules/lodash/_isPrototype.js","../node_modules/lodash/_nativeKeysIn.js","../node_modules/lodash/_baseKeysIn.js","../node_modules/lodash/keysIn.js","../node_modules/lodash/defaults.js","../node_modules/readable-stream/lib/ours/primordials.js","../node_modules/readable-stream/lib/ours/util/inspect.js","../node_modules/readable-stream/lib/ours/errors.js","../node_modules/event-target-shim/src/event.mjs","../node_modules/event-target-shim/src/event-target.mjs","../node_modules/abort-controller/src/abort-signal.ts","../node_modules/abort-controller/src/abort-controller.ts","../node_modules/readable-stream/lib/ours/util.js","../node_modules/readable-stream/lib/internal/validators.js","../node_modules/process/index.js","../node_modules/readable-stream/lib/internal/shims/process.js","../node_modules/readable-stream/lib/internal/streams/utils.js","../node_modules/readable-stream/lib/internal/streams/end-of-stream.js","../node_modules/readable-stream/lib/internal/streams/destroy.js","../node_modules/readable-stream/lib/internal/streams/legacy.js","../node_modules/readable-stream/lib/internal/streams/add-abort-signal.js","../node_modules/readable-stream/lib/internal/streams/buffer_list.js","../node_modules/readable-stream/lib/internal/streams/state.js","../node_modules/safe-buffer/index.js","../node_modules/string_decoder/lib/string_decoder.js","../node_modules/readable-stream/lib/internal/streams/from.js","../node_modules/readable-stream/lib/internal/streams/readable.js","../node_modules/readable-stream/lib/internal/streams/writable.js","../node_modules/readable-stream/lib/internal/streams/duplexify.js","../node_modules/readable-stream/lib/internal/streams/duplex.js","../node_modules/readable-stream/lib/internal/streams/transform.js","../node_modules/readable-stream/lib/internal/streams/passthrough.js","../node_modules/readable-stream/lib/internal/streams/pipeline.js","../node_modules/readable-stream/lib/internal/streams/compose.js","../node_modules/readable-stream/lib/internal/streams/operators.js","../node_modules/readable-stream/lib/stream/promises.js","../node_modules/readable-stream/lib/stream.js","../node_modules/readable-stream/lib/ours/index.js","../node_modules/lodash/_arrayPush.js","../node_modules/lodash/_isFlattenable.js","../node_modules/lodash/_baseFlatten.js","../node_modules/lodash/flatten.js","../node_modules/lodash/_nativeCreate.js","../node_modules/lodash/_hashClear.js","../node_modules/lodash/_hashDelete.js","../node_modules/lodash/_hashGet.js","../node_modules/lodash/_hashHas.js","../node_modules/lodash/_hashSet.js","../node_modules/lodash/_Hash.js","../node_modules/lodash/_listCacheClear.js","../node_modules/lodash/_assocIndexOf.js","../node_modules/lodash/_listCacheDelete.js","../node_modules/lodash/_listCacheGet.js","../node_modules/lodash/_listCacheHas.js","../node_modules/lodash/_listCacheSet.js","../node_modules/lodash/_ListCache.js","../node_modules/lodash/_Map.js","../node_modules/lodash/_mapCacheClear.js","../node_modules/lodash/_isKeyable.js","../node_modules/lodash/_getMapData.js","../node_modules/lodash/_mapCacheDelete.js","../node_modules/lodash/_mapCacheGet.js","../node_modules/lodash/_mapCacheHas.js","../node_modules/lodash/_mapCacheSet.js","../node_modules/lodash/_MapCache.js","../node_modules/lodash/_setCacheAdd.js","../node_modules/lodash/_setCacheHas.js","../node_modules/lodash/_SetCache.js","../node_modules/lodash/_baseFindIndex.js","../node_modules/lodash/_baseIsNaN.js","../node_modules/lodash/_strictIndexOf.js","../node_modules/lodash/_baseIndexOf.js","../node_modules/lodash/_arrayIncludes.js","../node_modules/lodash/_arrayIncludesWith.js","../node_modules/lodash/_arrayMap.js","../node_modules/lodash/_cacheHas.js","../node_modules/lodash/_baseDifference.js","../node_modules/lodash/isArrayLikeObject.js","../node_modules/lodash/difference.js","../node_modules/lodash/_Set.js","../node_modules/lodash/noop.js","../node_modules/lodash/_setToArray.js","../node_modules/lodash/_createSet.js","../node_modules/lodash/_baseUniq.js","../node_modules/lodash/union.js","../node_modules/lodash/_overArg.js","../node_modules/lodash/_getPrototype.js","../node_modules/lodash/isPlainObject.js","../node_modules/archiver-utils/node_modules/brace-expansion/index.js","../node_modules/archiver-utils/node_modules/minimatch/src/assert-valid-pattern.ts","../node_modules/archiver-utils/node_modules/minimatch/src/brace-expressions.ts","../node_modules/archiver-utils/node_modules/minimatch/src/unescape.ts","../node_modules/archiver-utils/node_modules/minimatch/src/ast.ts","../node_modules/archiver-utils/node_modules/minimatch/src/escape.ts","../node_modules/archiver-utils/node_modules/minimatch/src/index.ts","../node_modules/archiver-utils/node_modules/lru-cache/src/index.ts","../node_modules/minipass/src/index.ts","../node_modules/archiver-utils/node_modules/path-scurry/src/index.ts","../node_modules/archiver-utils/node_modules/glob/src/pattern.ts","../node_modules/archiver-utils/node_modules/glob/src/ignore.ts","../node_modules/archiver-utils/node_modules/glob/src/processor.ts","../node_modules/archiver-utils/node_modules/glob/src/walker.ts","../node_modules/archiver-utils/node_modules/glob/src/glob.ts","../node_modules/archiver-utils/node_modules/glob/src/has-magic.ts","../node_modules/archiver-utils/node_modules/glob/src/index.ts","../node_modules/archiver-utils/file.js","../node_modules/archiver-utils/index.js","../node_modules/archiver/lib/error.js","../node_modules/archiver/lib/core.js","../node_modules/compress-commons/lib/archivers/archive-entry.js","../node_modules/compress-commons/lib/archivers/zip/util.js","../node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js","../node_modules/compress-commons/lib/archivers/zip/unix-stat.js","../node_modules/compress-commons/lib/archivers/zip/constants.js","../node_modules/compress-commons/lib/archivers/zip/zip-archive-entry.js","../node_modules/compress-commons/lib/util/index.js","../node_modules/compress-commons/lib/archivers/archive-output-stream.js","../node_modules/crc-32/crc32.js","../node_modules/crc32-stream/lib/crc32-stream.js","../node_modules/crc32-stream/lib/deflate-crc32-stream.js","../node_modules/crc32-stream/lib/index.js","../node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js","../node_modules/compress-commons/lib/compress-commons.js","../node_modules/zip-stream/index.js","../node_modules/archiver/lib/plugins/zip.js","../node_modules/events-universal/default.js","../node_modules/fast-fifo/fixed-size.js","../node_modules/fast-fifo/index.js","../node_modules/b4a/index.js","../node_modules/text-decoder/lib/pass-through-decoder.js","../node_modules/text-decoder/lib/utf8-decoder.js","../node_modules/text-decoder/index.js","../node_modules/streamx/lib/errors.js","../node_modules/streamx/index.js","../node_modules/tar-stream/headers.js","../node_modules/tar-stream/extract.js","../node_modules/tar-stream/constants.js","../node_modules/tar-stream/pack.js","../node_modules/tar-stream/index.js","../node_modules/archiver/lib/plugins/tar.js","../node_modules/buffer-crc32/dist/index.cjs","../node_modules/archiver/lib/plugins/json.js","../node_modules/archiver/index.js","../node_modules/is-callable/index.js","../node_modules/for-each/index.js","../node_modules/possible-typed-array-names/index.js","../node_modules/available-typed-arrays/index.js","../node_modules/es-object-atoms/index.js","../node_modules/es-errors/index.js","../node_modules/es-errors/eval.js","../node_modules/es-errors/range.js","../node_modules/es-errors/ref.js","../node_modules/es-errors/syntax.js","../node_modules/es-errors/type.js","../node_modules/es-errors/uri.js","../node_modules/math-intrinsics/abs.js","../node_modules/math-intrinsics/floor.js","../node_modules/math-intrinsics/max.js","../node_modules/math-intrinsics/min.js","../node_modules/math-intrinsics/pow.js","../node_modules/math-intrinsics/round.js","../node_modules/math-intrinsics/isNaN.js","../node_modules/math-intrinsics/sign.js","../node_modules/gopd/gOPD.js","../node_modules/gopd/index.js","../node_modules/es-define-property/index.js","../node_modules/has-symbols/shams.js","../node_modules/has-symbols/index.js","../node_modules/get-proto/Reflect.getPrototypeOf.js","../node_modules/get-proto/Object.getPrototypeOf.js","../node_modules/function-bind/implementation.js","../node_modules/function-bind/index.js","../node_modules/call-bind-apply-helpers/functionCall.js","../node_modules/call-bind-apply-helpers/functionApply.js","../node_modules/call-bind-apply-helpers/reflectApply.js","../node_modules/call-bind-apply-helpers/actualApply.js","../node_modules/call-bind-apply-helpers/index.js","../node_modules/dunder-proto/get.js","../node_modules/get-proto/index.js","../node_modules/hasown/index.js","../node_modules/get-intrinsic/index.js","../node_modules/define-data-property/index.js","../node_modules/has-property-descriptors/index.js","../node_modules/set-function-length/index.js","../node_modules/call-bind-apply-helpers/applyBind.js","../node_modules/call-bind/index.js","../node_modules/call-bound/index.js","../node_modules/has-tostringtag/shams.js","../node_modules/which-typed-array/index.js","../node_modules/object-keys/isArguments.js","../node_modules/object-keys/implementation.js","../node_modules/object-keys/index.js","../node_modules/define-properties/index.js","../node_modules/object-inspect/util.inspect.js","../node_modules/object-inspect/index.js","../node_modules/es-abstract/helpers/isPropertyKey.js","../node_modules/es-object-atoms/isObject.js","../node_modules/es-abstract/2025/Get.js","../node_modules/math-intrinsics/isFinite.js","../node_modules/math-intrinsics/isInteger.js","../node_modules/is-array-buffer/index.js","../node_modules/array-buffer-byte-length/index.js","../node_modules/is-shared-array-buffer/index.js","../node_modules/es-abstract/2025/IsDetachedBuffer.js","../node_modules/es-abstract/2025/HasOwnProperty.js","../node_modules/es-abstract/helpers/IsArray.js","../node_modules/es-abstract/2025/IsArray.js","../node_modules/es-abstract/2025/IsBigIntElementType.js","../node_modules/es-abstract/2025/IsUnsignedElementType.js","../node_modules/es-abstract/helpers/bytesAsFloat16.js","../node_modules/es-abstract/helpers/bytesAsFloat32.js","../node_modules/es-abstract/helpers/bytesAsFloat64.js","../node_modules/es-abstract/helpers/bytesAsInteger.js","../node_modules/es-abstract/helpers/every.js","../node_modules/es-abstract/helpers/isByteValue.js","../node_modules/es-abstract/2025/tables/typed-array-objects.js","../node_modules/es-abstract/2025/RawBytesToNumeric.js","../node_modules/isarray/index.js","../node_modules/safe-array-concat/index.js","../node_modules/is-typed-array/index.js","../node_modules/typed-array-buffer/index.js","../node_modules/es-abstract/helpers/defaultEndianness.js","../node_modules/es-abstract/2025/GetValueFromBuffer.js","../node_modules/es-abstract/2025/SameValue.js","../node_modules/es-abstract/2025/Set.js","../node_modules/es-abstract/2025/StringToBigInt.js","../node_modules/is-date-object/index.js","../node_modules/is-regex/index.js","../node_modules/safe-regex-test/index.js","../node_modules/is-symbol/index.js","../node_modules/es-to-primitive/helpers/isPrimitive.js","../node_modules/es-abstract-get/isPropertyKey.js","../node_modules/es-abstract-get/GetV.js","../node_modules/es-abstract-get/GetMethod.js","../node_modules/es-to-primitive/es2015.js","../node_modules/es-abstract/2025/ToPrimitive.js","../node_modules/es-abstract/2025/ToBigInt.js","../node_modules/es-abstract/2025/BigInt/remainder.js","../node_modules/es-abstract/helpers/modBigInt.js","../node_modules/es-abstract/2025/ToBigInt64.js","../node_modules/es-abstract/2025/ToBigUint64.js","../node_modules/math-intrinsics/mod.js","../node_modules/es-abstract/helpers/mod.js","../node_modules/es-abstract/2025/modulo.js","../node_modules/es-abstract/helpers/isPrimitive.js","../node_modules/es-object-atoms/RequireObjectCoercible.js","../node_modules/es-abstract/2025/ToString.js","../node_modules/string.prototype.trim/implementation.js","../node_modules/string.prototype.trim/polyfill.js","../node_modules/string.prototype.trim/shim.js","../node_modules/string.prototype.trim/index.js","../node_modules/es-abstract/2025/StringToNumber.js","../node_modules/es-abstract/2025/ToNumber.js","../node_modules/es-abstract/2025/floor.js","../node_modules/es-abstract/2025/truncate.js","../node_modules/es-abstract/2025/ToInt16.js","../node_modules/es-abstract/2025/ToInt32.js","../node_modules/es-abstract/2025/ToInt8.js","../node_modules/es-abstract/2025/ToUint16.js","../node_modules/es-abstract/2025/ToUint32.js","../node_modules/es-abstract/2025/ToUint8.js","../node_modules/es-abstract/2025/clamp.js","../node_modules/es-abstract/2025/ToUint8Clamp.js","../node_modules/math-intrinsics/isNegativeZero.js","../node_modules/es-abstract/helpers/valueToFloat16Bytes.js","../node_modules/es-abstract/helpers/valueToFloat32Bytes.js","../node_modules/es-abstract/helpers/fractionToBinaryString.js","../node_modules/es-abstract/helpers/intToBinaryString.js","../node_modules/es-abstract/helpers/isNaN.js","../node_modules/es-abstract/helpers/valueToFloat64Bytes.js","../node_modules/es-abstract/helpers/integerToNBytes.js","../node_modules/es-abstract/2025/NumericToRawBytes.js","../node_modules/es-abstract/helpers/forEach.js","../node_modules/es-abstract/2025/SetValueInBuffer.js","../node_modules/es-abstract/2025/ToIntegerOrInfinity.js","../node_modules/es-abstract/2025/TypedArrayElementSize.js","../node_modules/es-abstract/2025/TypedArrayElementType.js","../node_modules/es-abstract/GetIntrinsic.js","../node_modules/es-abstract/helpers/records/property-descriptor.js","../node_modules/es-abstract/helpers/DefineOwnProperty.js","../node_modules/es-abstract/helpers/fromPropertyDescriptor.js","../node_modules/es-abstract/2025/FromPropertyDescriptor.js","../node_modules/es-abstract/2025/IsDataDescriptor.js","../node_modules/es-abstract/2025/IsCallable.js","../node_modules/es-abstract/2025/ToBoolean.js","../node_modules/es-abstract/2025/ToPropertyDescriptor.js","../node_modules/es-abstract/2025/DefinePropertyOrThrow.js","../node_modules/es-abstract/2025/IsConstructor.js","../node_modules/es-abstract/2025/SpeciesConstructor.js","../node_modules/es-abstract/2025/IsFixedLengthArrayBuffer.js","../node_modules/es-abstract/helpers/isInteger.js","../node_modules/es-abstract/helpers/records/typed-array-with-buffer-witness-record.js","../node_modules/es-abstract/2024/IsCallable.js","../node_modules/es-abstract/helpers/isObject.js","../node_modules/is-string/index.js","../node_modules/is-number-object/index.js","../node_modules/is-boolean-object/index.js","../node_modules/has-bigints/index.js","../node_modules/is-bigint/index.js","../node_modules/which-boxed-primitive/index.js","../node_modules/is-map/index.js","../node_modules/is-set/index.js","../node_modules/is-weakmap/index.js","../node_modules/is-weakset/index.js","../node_modules/which-collection/index.js","../node_modules/is-weakref/index.js","../node_modules/is-finalizationregistry/index.js","../node_modules/functions-have-names/index.js","../node_modules/is-document.all/index.js","../node_modules/function.prototype.name/implementation.js","../node_modules/function.prototype.name/polyfill.js","../node_modules/function.prototype.name/shim.js","../node_modules/function.prototype.name/index.js","../node_modules/generator-function/index.js","../node_modules/is-generator-function/index.js","../node_modules/async-function/index.js","../node_modules/is-async-function/index.js","../node_modules/which-builtin-type/index.js","../node_modules/reflect.getprototypeof/implementation.js","../node_modules/reflect.getprototypeof/polyfill.js","../node_modules/typed-array-byte-offset/index.js","../node_modules/typed-array-length/index.js","../node_modules/es-abstract/2025/IsTypedArrayOutOfBounds.js","../node_modules/es-abstract/2025/TypedArrayLength.js","../node_modules/es-abstract/2025/ArrayBufferByteLength.js","../node_modules/es-abstract/2025/MakeTypedArrayWithBufferWitnessRecord.js","../node_modules/es-abstract/2025/ValidateTypedArray.js","../node_modules/es-abstract/2025/TypedArrayCreateFromConstructor.js","../node_modules/es-abstract/helpers/typedArrayConstructors.js","../node_modules/es-abstract/2025/TypedArraySpeciesCreate.js","../node_modules/typedarray.prototype.slice/implementation.js","../node_modules/typedarray.prototype.slice/polyfill.js","../node_modules/typedarray.prototype.slice/shim.js","../node_modules/typedarray.prototype.slice/index.js","../node_modules/traverse/index.js","../node_modules/chainsaw/index.js","../node_modules/buffers/index.js","../node_modules/binary/lib/vars.js","../node_modules/binary/index.js","../node_modules/unzip-stream/lib/matcher-stream.js","../node_modules/unzip-stream/lib/entry.js","../node_modules/unzip-stream/lib/unzip-stream.js","../node_modules/unzip-stream/lib/parser-stream.js","../node_modules/unzip-stream/node_modules/mkdirp/index.js","../node_modules/unzip-stream/lib/extract.js","../node_modules/unzip-stream/unzip.js","../node_modules/ajv/lib/compile/codegen/code.ts","../node_modules/ajv/lib/compile/codegen/scope.ts","../node_modules/ajv/lib/compile/codegen/index.ts","../node_modules/ajv/lib/compile/util.ts","../node_modules/ajv/lib/compile/names.ts","../node_modules/ajv/lib/compile/errors.ts","../node_modules/ajv/lib/compile/validate/boolSchema.ts","../node_modules/ajv/lib/compile/rules.ts","../node_modules/ajv/lib/compile/validate/applicability.ts","../node_modules/ajv/lib/compile/validate/dataType.ts","../node_modules/ajv/lib/compile/validate/defaults.ts","../node_modules/ajv/lib/vocabularies/code.ts","../node_modules/ajv/lib/compile/validate/keyword.ts","../node_modules/ajv/lib/compile/validate/subschema.ts","../node_modules/fast-deep-equal/index.js","../node_modules/json-schema-traverse/index.js","../node_modules/ajv/lib/compile/resolve.ts","../node_modules/ajv/lib/compile/validate/index.ts","../node_modules/ajv/lib/runtime/validation_error.ts","../node_modules/ajv/lib/compile/ref_error.ts","../node_modules/ajv/lib/compile/index.ts","../node_modules/ajv/dist/refs/data.json","../node_modules/fast-uri/lib/utils.js","../node_modules/fast-uri/lib/schemes.js","../node_modules/fast-uri/index.js","../node_modules/ajv/lib/runtime/uri.ts","../node_modules/ajv/lib/core.ts","../node_modules/ajv/lib/vocabularies/core/id.ts","../node_modules/ajv/lib/vocabularies/core/ref.ts","../node_modules/ajv/lib/vocabularies/core/index.ts","../node_modules/ajv/lib/vocabularies/validation/limitNumber.ts","../node_modules/ajv/lib/vocabularies/validation/multipleOf.ts","../node_modules/ajv/lib/runtime/ucs2length.ts","../node_modules/ajv/lib/vocabularies/validation/limitLength.ts","../node_modules/ajv/lib/vocabularies/validation/pattern.ts","../node_modules/ajv/lib/vocabularies/validation/limitProperties.ts","../node_modules/ajv/lib/vocabularies/validation/required.ts","../node_modules/ajv/lib/vocabularies/validation/limitItems.ts","../node_modules/ajv/lib/runtime/equal.ts","../node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts","../node_modules/ajv/lib/vocabularies/validation/const.ts","../node_modules/ajv/lib/vocabularies/validation/enum.ts","../node_modules/ajv/lib/vocabularies/validation/index.ts","../node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts","../node_modules/ajv/lib/vocabularies/applicator/items.ts","../node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts","../node_modules/ajv/lib/vocabularies/applicator/items2020.ts","../node_modules/ajv/lib/vocabularies/applicator/contains.ts","../node_modules/ajv/lib/vocabularies/applicator/dependencies.ts","../node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts","../node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts","../node_modules/ajv/lib/vocabularies/applicator/properties.ts","../node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts","../node_modules/ajv/lib/vocabularies/applicator/not.ts","../node_modules/ajv/lib/vocabularies/applicator/anyOf.ts","../node_modules/ajv/lib/vocabularies/applicator/oneOf.ts","../node_modules/ajv/lib/vocabularies/applicator/allOf.ts","../node_modules/ajv/lib/vocabularies/applicator/if.ts","../node_modules/ajv/lib/vocabularies/applicator/thenElse.ts","../node_modules/ajv/lib/vocabularies/applicator/index.ts","../node_modules/ajv/lib/vocabularies/format/format.ts","../node_modules/ajv/lib/vocabularies/format/index.ts","../node_modules/ajv/lib/vocabularies/metadata.ts","../node_modules/ajv/lib/vocabularies/draft7.ts","../node_modules/ajv/lib/vocabularies/discriminator/types.ts","../node_modules/ajv/lib/vocabularies/discriminator/index.ts","../node_modules/ajv/dist/refs/json-schema-draft-07.json","../node_modules/ajv/lib/ajv.ts","../node_modules/ajv-formats/src/formats.ts","../node_modules/ajv-formats/src/limit.ts","../node_modules/ajv-formats/src/index.ts","../node_modules/universalify/index.js","../node_modules/fs-extra/lib/fs/index.js","../node_modules/fs-extra/lib/mkdirs/utils.js","../node_modules/fs-extra/lib/mkdirs/make-dir.js","../node_modules/fs-extra/lib/mkdirs/index.js","../node_modules/fs-extra/lib/path-exists/index.js","../node_modules/fs-extra/lib/util/utimes.js","../node_modules/fs-extra/lib/util/stat.js","../node_modules/fs-extra/lib/util/async.js","../node_modules/fs-extra/lib/copy/copy.js","../node_modules/fs-extra/lib/copy/copy-sync.js","../node_modules/fs-extra/lib/copy/index.js","../node_modules/fs-extra/lib/remove/index.js","../node_modules/fs-extra/lib/empty/index.js","../node_modules/fs-extra/lib/ensure/file.js","../node_modules/fs-extra/lib/ensure/link.js","../node_modules/fs-extra/lib/ensure/symlink-paths.js","../node_modules/fs-extra/lib/ensure/symlink-type.js","../node_modules/fs-extra/lib/ensure/symlink.js","../node_modules/fs-extra/lib/ensure/index.js","../node_modules/jsonfile/utils.js","../node_modules/jsonfile/index.js","../node_modules/fs-extra/lib/json/jsonfile.js","../node_modules/fs-extra/lib/output-file/index.js","../node_modules/fs-extra/lib/json/output-json.js","../node_modules/fs-extra/lib/json/output-json-sync.js","../node_modules/fs-extra/lib/json/index.js","../node_modules/fs-extra/lib/move/move.js","../node_modules/fs-extra/lib/move/move-sync.js","../node_modules/fs-extra/lib/move/index.js","../node_modules/fs-extra/lib/index.js","../node_modules/xml2js/lib/defaults.js","../node_modules/xmlbuilder/lib/Utility.js","../node_modules/xmlbuilder/lib/XMLDOMImplementation.js","../node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js","../node_modules/xmlbuilder/lib/XMLDOMStringList.js","../node_modules/xmlbuilder/lib/XMLDOMConfiguration.js","../node_modules/xmlbuilder/lib/NodeType.js","../node_modules/xmlbuilder/lib/XMLAttribute.js","../node_modules/xmlbuilder/lib/XMLNamedNodeMap.js","../node_modules/xmlbuilder/lib/XMLElement.js","../node_modules/xmlbuilder/lib/XMLCharacterData.js","../node_modules/xmlbuilder/lib/XMLCData.js","../node_modules/xmlbuilder/lib/XMLComment.js","../node_modules/xmlbuilder/lib/XMLDeclaration.js","../node_modules/xmlbuilder/lib/XMLDTDAttList.js","../node_modules/xmlbuilder/lib/XMLDTDEntity.js","../node_modules/xmlbuilder/lib/XMLDTDElement.js","../node_modules/xmlbuilder/lib/XMLDTDNotation.js","../node_modules/xmlbuilder/lib/XMLDocType.js","../node_modules/xmlbuilder/lib/XMLRaw.js","../node_modules/xmlbuilder/lib/XMLText.js","../node_modules/xmlbuilder/lib/XMLProcessingInstruction.js","../node_modules/xmlbuilder/lib/XMLDummy.js","../node_modules/xmlbuilder/lib/XMLNodeList.js","../node_modules/xmlbuilder/lib/DocumentPosition.js","../node_modules/xmlbuilder/lib/XMLNode.js","../node_modules/xmlbuilder/lib/XMLStringifier.js","../node_modules/xmlbuilder/lib/WriterState.js","../node_modules/xmlbuilder/lib/XMLWriterBase.js","../node_modules/xmlbuilder/lib/XMLStringWriter.js","../node_modules/xmlbuilder/lib/XMLDocument.js","../node_modules/xmlbuilder/lib/XMLDocumentCB.js","../node_modules/xmlbuilder/lib/XMLStreamWriter.js","../node_modules/xmlbuilder/lib/index.js","../node_modules/xml2js/lib/builder.js","../node_modules/sax/lib/sax.js","../node_modules/xml2js/lib/bom.js","../node_modules/xml2js/lib/processors.js","../node_modules/xml2js/lib/parser.js","../node_modules/xml2js/lib/xml2js.js","../node_modules/handlebars/lib/handlebars/utils.js","../node_modules/handlebars/lib/handlebars/exception.js","../node_modules/handlebars/lib/handlebars/helpers/block-helper-missing.js","../node_modules/handlebars/lib/handlebars/helpers/each.js","../node_modules/handlebars/lib/handlebars/helpers/helper-missing.js","../node_modules/handlebars/lib/handlebars/helpers/if.js","../node_modules/handlebars/lib/handlebars/helpers/log.js","../node_modules/handlebars/lib/handlebars/helpers/lookup.js","../node_modules/handlebars/lib/handlebars/helpers/with.js","../node_modules/handlebars/lib/handlebars/helpers.js","../node_modules/handlebars/lib/handlebars/decorators/inline.js","../node_modules/handlebars/lib/handlebars/decorators.js","../node_modules/handlebars/lib/handlebars/logger.js","../node_modules/handlebars/lib/handlebars/internal/proto-access.js","../node_modules/handlebars/lib/handlebars/base.js","../node_modules/handlebars/lib/handlebars/safe-string.js","../node_modules/handlebars/lib/handlebars/internal/wrapHelper.js","../node_modules/handlebars/lib/handlebars/runtime.js","../node_modules/handlebars/lib/handlebars/no-conflict.js","../node_modules/handlebars/lib/handlebars.runtime.js","../node_modules/handlebars/lib/handlebars/compiler/ast.js","../node_modules/handlebars/lib/handlebars/compiler/parser.js","../node_modules/handlebars/lib/handlebars/compiler/node-types.js","../node_modules/handlebars/lib/handlebars/compiler/visitor.js","../node_modules/handlebars/lib/handlebars/compiler/whitespace-control.js","../node_modules/handlebars/lib/handlebars/compiler/helpers.js","../node_modules/handlebars/lib/handlebars/compiler/base.js","../node_modules/handlebars/lib/handlebars/compiler/compiler.js","../node_modules/source-map/lib/base64.js","../node_modules/source-map/lib/base64-vlq.js","../node_modules/source-map/lib/util.js","../node_modules/source-map/lib/array-set.js","../node_modules/source-map/lib/mapping-list.js","../node_modules/source-map/lib/source-map-generator.js","../node_modules/source-map/lib/binary-search.js","../node_modules/source-map/lib/quick-sort.js","../node_modules/source-map/lib/source-map-consumer.js","../node_modules/source-map/lib/source-node.js","../node_modules/source-map/source-map.js","../node_modules/handlebars/lib/handlebars/compiler/code-gen.js","../node_modules/handlebars/lib/handlebars/compiler/javascript-compiler.js","../node_modules/handlebars/lib/handlebars.js","../node_modules/handlebars/lib/handlebars/compiler/printer.js","../node_modules/handlebars/lib/index.js","../node_modules/entities/lib/maps/entities.json","../node_modules/entities/lib/maps/legacy.json","../node_modules/entities/lib/maps/xml.json","../node_modules/entities/lib/maps/decode.json","../node_modules/entities/lib/decode_codepoint.js","../node_modules/entities/lib/decode.js","../node_modules/entities/lib/encode.js","../node_modules/entities/lib/index.js","../node_modules/ansi-to-html/src/ansi_to_html.js","../node_modules/slack-ctrf/dist/message-formatter.js","../node_modules/slack-ctrf/dist/slack-notify.js","../node_modules/slack-ctrf/dist/utils/common.js","../node_modules/slack-ctrf/dist/slack-reporter.js","../node_modules/slack-ctrf/dist/index.js","../node_modules/get-caller-file/index.ts","../node_modules/openai/src/internal/auth/x509-transport-state.cts","../node_modules/@anthropic-ai/sdk/internal/tslib.mjs","../node_modules/@anthropic-ai/sdk/src/internal/errors.ts","../node_modules/@anthropic-ai/sdk/src/core/error.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/values.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/sleep.ts","../node_modules/@anthropic-ai/sdk/src/version.ts","../node_modules/@anthropic-ai/sdk/src/internal/detect-platform.ts","../node_modules/@anthropic-ai/sdk/src/internal/request-signal.ts","../node_modules/@anthropic-ai/sdk/src/internal/shims.ts","../node_modules/@anthropic-ai/sdk/src/internal/request-options.ts","../node_modules/@anthropic-ai/sdk/src/internal/qs/formats.ts","../node_modules/@anthropic-ai/sdk/src/internal/qs/utils.ts","../node_modules/@anthropic-ai/sdk/src/internal/qs/stringify.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/query.ts","../node_modules/@anthropic-ai/sdk/src/internal/node.ts","../node_modules/@anthropic-ai/sdk/src/lib/credentials/types.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/time.ts","../node_modules/@anthropic-ai/sdk/src/lib/credentials/token-cache.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/env.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/bytes.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/base64.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/log.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/uuid.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils.ts","../node_modules/@anthropic-ai/sdk/src/core/credentials.ts","../node_modules/@anthropic-ai/sdk/src/lib/credentials/identity-token.ts","../node_modules/@anthropic-ai/sdk/src/lib/credentials/oidc-federation.ts","../node_modules/@anthropic-ai/sdk/src/lib/credentials/user-oauth.ts","../node_modules/@anthropic-ai/sdk/src/lib/credentials/credential-chain.ts","../node_modules/@anthropic-ai/sdk/src/internal/decoders/line.ts","../node_modules/@anthropic-ai/sdk/src/core/streaming.ts","../node_modules/@anthropic-ai/sdk/src/internal/parse.ts","../node_modules/@anthropic-ai/sdk/src/core/middleware.ts","../node_modules/@anthropic-ai/sdk/src/core/api-promise.ts","../node_modules/@anthropic-ai/sdk/src/core/pagination.ts","../node_modules/@anthropic-ai/sdk/src/internal/uploads.ts","../node_modules/@anthropic-ai/sdk/src/internal/to-file.ts","../node_modules/@anthropic-ai/sdk/src/core/uploads.ts","../node_modules/@anthropic-ai/sdk/resources/shared.mjs","../node_modules/@anthropic-ai/sdk/src/core/resource.ts","../node_modules/@anthropic-ai/sdk/src/internal/headers.ts","../node_modules/@anthropic-ai/sdk/src/internal/stainless-helper-header.ts","../node_modules/@anthropic-ai/sdk/src/error.ts","../node_modules/@anthropic-ai/sdk/src/streaming.ts","../node_modules/@anthropic-ai/sdk/src/lib/parser.ts","../node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/parser.ts","../node_modules/@anthropic-ai/sdk/src/internal/message-stream-utils.ts","../node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts","../node_modules/@anthropic-ai/sdk/src/internal/decoders/jsonl.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/path.ts","../node_modules/@anthropic-ai/sdk/src/resources/messages/batches.ts","../node_modules/@anthropic-ai/sdk/src/internal/constants.ts","../node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/deployment-runs.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/deployments.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/dreams.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/models.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/user-profiles.ts","../node_modules/@stablelib/base64/base64.ts","../node_modules/fast-sha256/sha256.js","../node_modules/standardwebhooks/src/timing_safe_equal.ts","../node_modules/standardwebhooks/src/index.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/webhooks.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/agents/versions.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/agents/agents.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/abort.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/backoff.ts","../node_modules/@anthropic-ai/sdk/src/lib/helper-client.ts","../node_modules/@anthropic-ai/sdk/src/lib/environments/poller.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/async-queue.ts","../node_modules/@anthropic-ai/sdk/src/lib/tools/ToolError.ts","../node_modules/@anthropic-ai/sdk/src/lib/internal/toolsets/sanitize.ts","../node_modules/@anthropic-ai/sdk/src/lib/tools/BetaRunnableTool.ts","../node_modules/@anthropic-ai/sdk/src/lib/tools/SessionToolRunner.ts","../node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/sync-interval.ts","../node_modules/@anthropic-ai/sdk/src/helpers/beta/json-schema.ts","../node_modules/@anthropic-ai/sdk/src/internal/utils/promise.ts","../node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/fs-util.ts","../node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/skills.ts","../node_modules/@anthropic-ai/sdk/src/internal/file-store.ts","../node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/memories.ts","../node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.ts","../node_modules/@anthropic-ai/sdk/src/lib/environments/worker.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/environments/work.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/environments/environments.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memories.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-versions.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-stores.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/messages/batches.ts","../node_modules/@anthropic-ai/sdk/src/lib/beta-parser.ts","../node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts","../node_modules/@anthropic-ai/sdk/src/lib/internal/toolsets/family.ts","../node_modules/@anthropic-ai/sdk/src/lib/internal/toolsets/errors.ts","../node_modules/@anthropic-ai/sdk/src/lib/internal/toolsets/run.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/api-keys.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/artifacts.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/connectors.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/cost-report.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/plugins.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/skills.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/summaries.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/usage-report.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/user-cost-report.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/user-usage-report.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/users.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/apps/chat/projects.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/apps/chat/chat.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/apps/apps.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/analytics/analytics.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/compliance-settings.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/external-keys.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/issuers.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/workspaces.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/rules.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/federation.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/invites.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/plugin-marketplaces.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/rate-limits.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/users.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/plugins/installation-settings.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/plugins/shares.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/plugins/versions.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/plugins/plugins.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/rbac-groups/members.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/rbac-groups/rbac-groups.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/rbac-roles/permissions.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/rbac-roles/rbac-roles.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/workspaces.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/service-accounts.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/spend-limits/effective.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/spend-limits/increase-requests.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/spend-limits/spend-limits.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/members.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/rate-limits.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/service-accounts.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/workspaces.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/organization/organization.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/events.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/resources.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/events.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/threads.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/sessions.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/skills/versions.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/skills/skills.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/certificates.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/tunnels.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/credentials.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/vaults.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta.ts","../node_modules/@anthropic-ai/sdk/src/lib/internal/BetaToolRunnerStream.ts","../node_modules/@anthropic-ai/sdk/src/lib/tools/BetaToolRunner.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts","../node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts","../node_modules/@anthropic-ai/sdk/src/resources/completions.ts","../node_modules/@anthropic-ai/sdk/src/resources/files.ts","../node_modules/@anthropic-ai/sdk/src/resources/models.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/api-keys.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/compliance-settings.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/external-keys.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/invites.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/rate-limits.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/users.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/federation/issuers.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/federation/rules/workspaces.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/federation/rules/rules.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/federation/federation.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/service-accounts/workspaces.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/service-accounts/service-accounts.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/workspaces/members.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/workspaces/rate-limits.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/workspaces/service-accounts.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/workspaces/workspaces.ts","../node_modules/@anthropic-ai/sdk/src/resources/organization/organization.ts","../node_modules/@anthropic-ai/sdk/src/resources/skills/versions.ts","../node_modules/@anthropic-ai/sdk/src/resources/skills/skills.ts","../node_modules/@anthropic-ai/sdk/src/resources/index.ts","../node_modules/@anthropic-ai/sdk/src/client.ts","../node_modules/@anthropic-ai/sdk/src/index.ts","../node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js","../node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/isStreamingPayload/isStreamingPayload.js","../node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js","../node_modules/@smithy/types/dist-es/endpoint.js","../node_modules/@smithy/types/dist-es/extensions/checksum.js","../node_modules/@smithy/types/dist-es/extensions/index.js","../node_modules/@smithy/types/dist-es/middleware.js","../node_modules/@smithy/types/dist-es/profile.js","../node_modules/@smithy/types/dist-es/index.js","../node_modules/@smithy/core/dist-es/submodules/transport/getSmithyContext.js","../node_modules/@smithy/core/dist-es/submodules/transport/hasOwn.js","../node_modules/@smithy/core/dist-es/submodules/transport/httpRequest.js","../node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js","../node_modules/@smithy/core/dist-es/submodules/transport/isValidHostLabel.js","../node_modules/@smithy/core/dist-es/submodules/transport/isValidHostname.js","../node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js","../node_modules/@smithy/core/dist-es/submodules/transport/parseQueryString.js","../node_modules/@smithy/core/dist-es/submodules/transport/parseUrl.js","../node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js","../node_modules/@smithy/core/dist-es/submodules/transport/index.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/client.js","../node_modules/@smithy/core/dist-es/submodules/schema/deref.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js","../node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js","../node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js","../node_modules/@smithy/core/dist-es/submodules/schema/middleware/getSchemaSerdePlugin.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js","../node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js","../node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js","../node_modules/@smithy/core/dist-es/submodules/schema/index.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/schemaLogFilter.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/defaults-mode.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/emitWarningIfUnsupportedVersion.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/retry.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/NoOpLogger.js","../node_modules/@smithy/core/dist-es/submodules/client/smithy-client/client-command-builder.js","../node_modules/@smithy/core/dist-es/submodules/client/index.js","../node_modules/@smithy/core/dist-es/submodules/serde/is-array-buffer/is-array-buffer.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-buffer-from/buffer-from.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-base64/fromBase64.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/fromUtf8.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-stream/blob/Uint8ArrayBlobAdapter.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUtf8.js","../node_modules/@smithy/core/dist-es/submodules/serde/uuid/v4.js","../node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js","../node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js","../node_modules/@smithy/core/dist-es/submodules/serde/lazy-json.js","../node_modules/@smithy/core/dist-es/submodules/serde/quote-header.js","../node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js","../node_modules/@smithy/core/dist-es/submodules/serde/split-every.js","../node_modules/@smithy/core/dist-es/submodules/serde/split-header.js","../node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-hex-encoding/hex-encoding.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-body-length/calculateBodyLength.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.js","../node_modules/@smithy/core/dist-es/submodules/serde/concatBytes.js","../node_modules/@smithy/core/dist-es/submodules/config/property-provider/ProviderError.js","../node_modules/@smithy/core/dist-es/submodules/config/property-provider/CredentialsProviderError.js","../node_modules/@smithy/core/dist-es/submodules/config/property-provider/TokenProviderError.js","../node_modules/@smithy/core/dist-es/submodules/config/property-provider/chain.js","../node_modules/@smithy/core/dist-es/submodules/config/property-provider/fromValue.js","../node_modules/@smithy/core/dist-es/submodules/config/property-provider/memoize.js","../node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js","../node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/types.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getProfileName.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSSOTokenFilepath.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSSOTokenFromFile.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/constants.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigData.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getConfigFilepath.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getCredentialsFilepath.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/parseIni.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/readFile.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/loadSharedConfigFiles.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getSsoSessionData.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/loadSsoSessionData.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/mergeConfigFiles.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/parseKnownFiles.js","../node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/externalDataInterceptor.js","../node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/getSelectorName.js","../node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromEnv.js","../node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromSharedConfigFiles.js","../node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/fromStatic.js","../node_modules/@smithy/core/dist-es/submodules/config/node-config-provider/configLoader.js","../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js","../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/endpointsConfig/NodeUseFipsEndpointConfigOptions.js","../node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/constants.js","../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/getInstanceMetadataRegion.js","../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/config.js","../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/checkRegion.js","../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/isFipsRegion.js","../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/getRealRegion.js","../node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/resolveRegionConfig.js","../node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/defaultsModeConfig.js","../node_modules/@smithy/core/dist-es/submodules/config/defaults-mode/resolveDefaultsModeConfig.js","../node_modules/@smithy/core/dist-es/submodules/config/index.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getIgnoreConfiguredEndpointUrls.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromConfig.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/service-customizations/s3.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/service-customizations/index.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/createConfigValueProvider.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/toEndpointV1.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointFromInstructions.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/endpointMiddleware.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/getEndpointPlugin.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/bdd/BinaryDecisionDiagram.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointError.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/index.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/debugId.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/toDebugString.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/debug/index.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/customEndpointFunctions.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/booleanEquals.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/coalesce.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttrPathList.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttr.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isSet.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/ite.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/not.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/isIpAddress.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/parseURL.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/split.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/stringEquals.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/substring.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/uriEncode.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/index.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/endpointFunctions.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateTemplate.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getReferenceValue.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateExpression.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/callFunction.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/evaluateCondition.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointHeaders.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointProperties.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/utils/getEndpointUrl.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/decideEndpoint.js","../node_modules/@smithy/core/dist-es/submodules/endpoints/index.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-type-check.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/fromUtf8.browser.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-base64/constants-for-browser.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.browser.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUtf8.browser.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.browser.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-stream/sdk-stream-mixin.browser.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.js","../node_modules/@smithy/core/dist-es/submodules/serde/util-stream/sdk-stream-mixin.js","../node_modules/@smithy/core/dist-es/submodules/serde/index.js","../node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js","../node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js","../node_modules/@smithy/core/dist-es/submodules/protocols/SerdeContext.js","../node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Js.js","../node_modules/@smithy/core/dist-es/submodules/checksum/crc32/Crc32Node.js","../node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Js.js","../node_modules/@smithy/core/dist-es/submodules/checksum/sha256/Sha256Node.js","../node_modules/@smithy/core/dist-es/submodules/checksum/index.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/splitMessage.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/EventStreamCodec.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageDecoderStream.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/MessageEncoderStream.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageEncoderStream.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getChunkedStream.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/EventStreamMarshaller.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/EventStreamMarshaller.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/utils.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-config-resolver/EventStreamSerdeConfig.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js","../node_modules/@smithy/core/dist-es/submodules/event-streams/index.js","../node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js","../node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js","../node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js","../node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js","../node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js","../node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js","../node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js","../node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js","../node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js","../node_modules/@smithy/core/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js","../node_modules/@smithy/core/dist-es/submodules/protocols/util-uri-escape/escape-uri.js","../node_modules/@smithy/core/dist-es/submodules/protocols/querystring-builder/buildQueryString.js","../node_modules/@smithy/core/dist-es/submodules/protocols/index.js","../node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js","../node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js","../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/constants.js","../node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js","../node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js","../node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js","../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRateLimiter.js","../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/retries-2026-config.js","../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryBackoffStrategy.js","../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryToken.js","../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/config.js","../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js","../node_modules/@smithy/core/dist-es/submodules/retry/util-retry/AdaptiveRetryStrategy.js","../node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js","../node_modules/@smithy/core/dist-es/submodules/retry/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/setTokenFeature.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-logger/loggerMiddleware.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/configuration.js","../node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/recursionDetectionMiddleware.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-recursion-detection/getRecursionDetectionPlugin.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/resolveAuthOptions.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-auth-scheme/index.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/httpSigningMiddleware.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/getHttpSigningMiddleware.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/middleware-http-signing/index.js","../node_modules/@smithy/core/dist-es/normalizeProvider.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/pagination/createPaginator.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/noAuth.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/index.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/memoizeIdentityProvider.js","../node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/index.js","../node_modules/@smithy/core/dist-es/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/configurations.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partitions.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/partition.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/check-features.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/constants.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/encode-features.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-user-agent/user-agent-middleware.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/getRuntimeUserAgentPair.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/crt-availability.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/is-crt-available.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/defaultUserAgent.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-node/nodeAppIdConfigOptions.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/isIpAddress.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/isVirtualHostableS3Bucket.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/aws.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/stsRegionDefaultResolver.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/region-config-resolver/extensions.js","../node_modules/@aws-sdk/core/dist-es/submodules/client/index.js","../node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamConfiguration.js","../node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHandlingMiddleware.js","../node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHeaderMiddleware.js","../node_modules/@aws-sdk/middleware-eventstream/dist-es/getEventStreamPlugin.js","../node_modules/@aws-sdk/middleware-eventstream/dist-es/index.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/utils.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketEndpointMiddleware.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/middlewares/websocketInjectSessionIdMiddleware.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/getWebSocketPlugin.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/WebsocketSignatureV4.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/resolveWebSocketConfig.js","../node_modules/@aws-sdk/middleware-websocket/dist-es/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js","../node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js","../node_modules/@smithy/signature-v4/dist-es/constants.js","../node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js","../node_modules/@smithy/signature-v4/dist-es/utilDate.js","../node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js","../node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js","../node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js","../node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js","../node_modules/@smithy/signature-v4/dist-es/headerUtil.js","../node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js","../node_modules/@smithy/signature-v4/dist-es/prepareRequest.js","../node_modules/@smithy/signature-v4/dist-es/SignatureV4.js","../node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js","../node_modules/@smithy/signature-v4/dist-es/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-node-config.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/clock-skew-defaults.js","../node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/auth/httpAuthSchemeProvider.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/EndpointParameters.js","../node_modules/@aws-sdk/client-bedrock-runtime/package.json","../node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js","../node_modules/@aws-sdk/credential-provider-env/dist-es/index.js","../node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js","../node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js","../node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/node-http.js","../node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js","../node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/retry.js","../node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js","../node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js","../node_modules/@smithy/credential-provider-imds/dist-es/config/Endpoint.js","../node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointConfigOptions.js","../node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointMode.js","../node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js","../node_modules/@smithy/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js","../node_modules/@smithy/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js","../node_modules/@smithy/credential-provider-imds/dist-es/utils/staticStabilityProvider.js","../node_modules/@smithy/credential-provider-imds/dist-es/fromInstanceMetadata.js","../node_modules/@smithy/credential-provider-imds/dist-es/index.js","../node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js","../node_modules/@smithy/node-http-handler/dist-es/constants.js","../node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js","../node_modules/@smithy/node-http-handler/dist-es/node-https.js","../node_modules/@smithy/node-http-handler/dist-es/timing.js","../node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js","../node_modules/@smithy/node-http-handler/dist-es/set-request-timeout.js","../node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js","../node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js","../node_modules/@smithy/node-http-handler/dist-es/write-request-body.js","../node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js","../node_modules/@smithy/node-http-handler/dist-es/node-http2.js","../node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js","../node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js","../node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js","../node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js","../node_modules/@smithy/node-http-handler/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js","../node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js","../node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/retry-wrapper.js","../node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js","../node_modules/@aws-sdk/credential-provider-http/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js","../node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js","../node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js","../node_modules/@aws-sdk/token-providers/dist-es/constants.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/EndpointParameters.js","../node_modules/@aws-sdk/nested-clients/package.json","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/needsReviver.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/writeKey.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js","../node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js","../node_modules/@aws-sdk/xml-builder/dist-es/index.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js","../node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/bdd.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.shared.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeExtensions.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDCClient.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commandBuilder.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/CreateTokenCommand.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDC.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/enums.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/models_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/index.js","../node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js","../node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js","../node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js","../node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js","../node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js","../node_modules/@aws-sdk/token-providers/dist-es/fromSso.js","../node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js","../node_modules/@aws-sdk/token-providers/dist-es/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthSchemeProvider.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/EndpointParameters.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/bdd.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/endpointResolver.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/errors.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.shared.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthExtensionConfiguration.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeExtensions.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSOClient.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commandBuilder.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/GetRoleCredentialsCommand.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSO.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/models_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/index.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/loadSso.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js","../node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js","../node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js","../node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4SignWithCredentials.js","../node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js","../node_modules/@aws-sdk/signature-v4-multi-region/dist-es/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/bdd.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/EndpointParameters.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthExtensionConfiguration.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commandBuilder.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/models_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/index.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/EndpointParameters.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.shared.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthExtensionConfiguration.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeExtensions.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commandBuilder.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenWithIAMCommand.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/Signin.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/index.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/models_0.js","../node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/index.js","../node_modules/@aws-sdk/credential-provider-login/dist-es/LoginCredentialsFetcher.js","../node_modules/@aws-sdk/credential-provider-login/dist-es/fromLoginCredentials.js","../node_modules/@aws-sdk/credential-provider-login/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveLoginCredentials.js","../node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js","../node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js","../node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js","../node_modules/@aws-sdk/credential-provider-process/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js","../node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js","../node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js","../node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js","../node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js","../node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js","../node_modules/@aws-sdk/credential-provider-node/dist-es/index.js","../node_modules/@aws-sdk/eventstream-handler-node/dist-es/EventSigningTransformStream.js","../node_modules/@aws-sdk/eventstream-handler-node/dist-es/EventStreamPayloadHandler.js","../node_modules/@aws-sdk/eventstream-handler-node/dist-es/eventStreamPayloadHandlerProvider.js","../node_modules/@aws-sdk/eventstream-handler-node/dist-es/index.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/bdd.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/endpoint/endpointResolver.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/models/BedrockRuntimeServiceException.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/models/errors.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/schemas/schemas_0.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.shared.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeConfig.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/auth/httpAuthExtensionConfiguration.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/runtimeExtensions.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/BedrockRuntimeClient.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commandBuilder.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ApplyGuardrailCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ConverseCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ConverseStreamCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/CountTokensCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/GetAsyncInvokeCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeGuardrailChecksCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeModelCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeModelWithBidirectionalStreamCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/InvokeModelWithResponseStreamCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/ListAsyncInvokesCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/StartAsyncInvokeCommand.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/pagination/ListAsyncInvokesPaginator.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/BedrockRuntime.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/commands/index.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/pagination/Interfaces.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/pagination/index.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/models/enums.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/models/models_0.js","../node_modules/@aws-sdk/client-bedrock-runtime/dist-es/index.js","../src/index.ts","../src/core/action-handler.ts","../src/github/index.ts","../src/github/core.ts","../node_modules/@actions/core/src/command.ts","../node_modules/@actions/core/src/utils.ts","../node_modules/@actions/core/src/file-command.ts","../node_modules/@actions/core/src/core.ts","../node_modules/@actions/http-client/src/index.ts","../node_modules/@actions/http-client/src/proxy.ts","../node_modules/@actions/http-client/src/auth.ts","../node_modules/@actions/core/src/summary.ts","../node_modules/@actions/core/src/path-utils.ts","../node_modules/@actions/core/src/platform.ts","../node_modules/@actions/io/src/io-util.ts","../node_modules/@actions/exec/src/toolrunner.ts","../src/ctrf/index.ts","../src/ctrf/enrichers.ts","../src/ctrf/helpers.ts","../src/ctrf/metrics.ts","../node_modules/@actions/github/src/github.ts","../node_modules/@actions/github/src/context.ts","../node_modules/@actions/github/src/utils.ts","../node_modules/@actions/github/src/internal/utils.ts","../src/client/github/index.ts","../src/client/github/client.ts","../src/config/index.ts","../src/client/github/issues.ts","../src/client/github/ids.ts","../src/client/github/workflows.ts","../src/client/github/artifacts.ts","../node_modules/@actions/artifact/src/artifact.ts","../node_modules/@actions/artifact/src/internal/shared/config.ts","../node_modules/@actions/artifact/src/internal/upload/upload-artifact.ts","../node_modules/@actions/artifact/src/internal/upload/retention.ts","../node_modules/@actions/artifact/src/generated/index.ts","../node_modules/@actions/artifact/src/generated/google/protobuf/timestamp.ts","../node_modules/@protobuf-ts/runtime/build/es2015/index.js","../node_modules/@protobuf-ts/runtime/build/es2015/json-typings.js","../node_modules/@protobuf-ts/runtime/build/es2015/base64.js","../node_modules/@protobuf-ts/runtime/build/es2015/binary-format-contract.js","../node_modules/@protobuf-ts/runtime/build/es2015/binary-reader.js","../node_modules/@protobuf-ts/runtime/build/es2015/pb-long.js","../node_modules/@protobuf-ts/runtime/build/es2015/goog-varint.js","../node_modules/@protobuf-ts/runtime/build/es2015/binary-writer.js","../node_modules/@protobuf-ts/runtime/build/es2015/assert.js","../node_modules/@protobuf-ts/runtime/build/es2015/json-format-contract.js","../node_modules/@protobuf-ts/runtime/build/es2015/message-type-contract.js","../node_modules/@protobuf-ts/runtime/build/es2015/message-type.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-info.js","../node_modules/@protobuf-ts/runtime/build/es2015/lower-camel-case.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-type-check.js","../node_modules/@protobuf-ts/runtime/build/es2015/oneof.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-json-reader.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-long-convert.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-json-writer.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-binary-reader.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-scalar-default.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-binary-writer.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-create.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-merge-partial.js","../node_modules/@protobuf-ts/runtime/build/es2015/reflection-equals.js","../node_modules/@actions/artifact/src/generated/google/protobuf/wrappers.ts","../node_modules/@actions/artifact/src/generated/results/api/v1/artifact.ts","../node_modules/@protobuf-ts/runtime-rpc/build/es2015/index.js","../node_modules/@protobuf-ts/runtime-rpc/build/es2015/service-type.js","../node_modules/@protobuf-ts/runtime-rpc/build/es2015/reflection-info.js","../node_modules/@actions/artifact/src/generated/results/api/v1/artifact.twirp-client.ts","../node_modules/@actions/artifact/src/internal/upload/path-and-artifact-name-validation.ts","../node_modules/@actions/artifact/src/internal/shared/user-agent.ts","../node_modules/@actions/artifact/src/internal/shared/errors.ts","../node_modules/@actions/artifact/src/internal/shared/util.ts","../node_modules/jwt-decode/build/esm/index.js","../node_modules/@actions/artifact/src/internal/shared/artifact-twirp-client.ts","../node_modules/@actions/artifact/src/internal/upload/upload-zip-specification.ts","../node_modules/@azure/storage-blob/src/index.ts","../node_modules/@azure/core-rest-pipeline/src/index.ts","../node_modules/@azure/core-rest-pipeline/src/pipeline.ts","../node_modules/@typespec/ts-http-runtime/src/index.ts","../node_modules/@typespec/ts-http-runtime/src/abort-controller/AbortError.ts","../node_modules/@typespec/ts-http-runtime/src/logger/logger.ts","../node_modules/@typespec/ts-http-runtime/src/logger/debug.ts","../node_modules/@typespec/ts-http-runtime/src/logger/log.ts","../node_modules/@typespec/ts-http-runtime/src/env.ts","../node_modules/@typespec/ts-http-runtime/src/httpHeaders.ts","../node_modules/@typespec/ts-http-runtime/src/pipelineRequest.ts","../node_modules/@typespec/ts-http-runtime/src/util/uuidUtils.ts","../node_modules/@typespec/ts-http-runtime/src/pipeline.ts","../node_modules/@typespec/ts-http-runtime/src/restError.ts","../node_modules/@typespec/ts-http-runtime/src/util/error.ts","../node_modules/@typespec/ts-http-runtime/src/util/object.ts","../node_modules/@typespec/ts-http-runtime/src/util/inspect.ts","../node_modules/@typespec/ts-http-runtime/src/util/sanitizer.ts","../node_modules/@typespec/ts-http-runtime/src/util/bytesEncoding.ts","../node_modules/@typespec/ts-http-runtime/src/defaultHttpClient.ts","../node_modules/@typespec/ts-http-runtime/src/nodeHttpClient.ts","../node_modules/@typespec/ts-http-runtime/src/log.ts","../node_modules/@typespec/ts-http-runtime/src/client/getClient.ts","../node_modules/@typespec/ts-http-runtime/src/client/clientHelpers.ts","../node_modules/@typespec/ts-http-runtime/src/createPipelineFromOptions.ts","../node_modules/@typespec/ts-http-runtime/src/policies/logPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/userAgentPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/util/userAgent.ts","../node_modules/@typespec/ts-http-runtime/src/util/userAgentPlatform.ts","../node_modules/@typespec/ts-http-runtime/src/constants.ts","../node_modules/@typespec/ts-http-runtime/src/policies/defaultRetryPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/retryStrategies/exponentialRetryStrategy.ts","../node_modules/@typespec/ts-http-runtime/src/util/delay.ts","../node_modules/@typespec/ts-http-runtime/src/util/random.ts","../node_modules/@typespec/ts-http-runtime/src/retryStrategies/throttlingRetryStrategy.ts","../node_modules/@typespec/ts-http-runtime/src/util/helpers.ts","../node_modules/@typespec/ts-http-runtime/src/policies/retryPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/formDataPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/formData.ts","../node_modules/@typespec/ts-http-runtime/src/policies/platformPolicies.ts","../node_modules/@typespec/ts-http-runtime/src/policies/agentPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/tlsPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/proxyPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/decompressResponsePolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/redirectPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/multipartPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/util/typeGuards.ts","../node_modules/@typespec/ts-http-runtime/src/util/typeGuards-node.ts","../node_modules/@typespec/ts-http-runtime/src/util/concat.ts","../node_modules/@typespec/ts-http-runtime/src/client/apiVersionPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/auth/credentials.ts","../node_modules/@typespec/ts-http-runtime/src/policies/auth/apiKeyAuthenticationPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/auth/checkInsecureConnection.ts","../node_modules/@typespec/ts-http-runtime/src/policies/auth/basicAuthenticationPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/auth/bearerAuthenticationPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/auth/oauth2AuthenticationPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/client/sendRequest.ts","../node_modules/@typespec/ts-http-runtime/src/client/multipart.ts","../node_modules/@typespec/ts-http-runtime/src/client/urlHelpers.ts","../node_modules/@typespec/ts-http-runtime/src/client/operationOptionHelpers.ts","../node_modules/@typespec/ts-http-runtime/src/client/restError.ts","../node_modules/@azure/core-rest-pipeline/src/createPipelineFromOptions.ts","../node_modules/@azure/core-rest-pipeline/src/policies/logPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/log.ts","../node_modules/@azure/logger/src/index.ts","../node_modules/@typespec/ts-http-runtime/src/logger/internal.ts","../node_modules/@typespec/ts-http-runtime/src/policies/internal.ts","../node_modules/@typespec/ts-http-runtime/src/policies/exponentialRetryPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/systemErrorRetryPolicy.ts","../node_modules/@typespec/ts-http-runtime/src/policies/throttlingRetryPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/redirectPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/userAgentPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/util/userAgent.ts","../node_modules/@azure/core-rest-pipeline/src/util/userAgentPlatform.ts","../node_modules/@azure/core-rest-pipeline/src/constants.ts","../node_modules/@azure/core-rest-pipeline/src/policies/multipartPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/util/file.ts","../node_modules/@azure/core-rest-pipeline/src/util/createFile.ts","../node_modules/@azure/core-rest-pipeline/src/policies/decompressResponsePolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/defaultRetryPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/formDataPolicy.ts","../node_modules/@azure/core-util/src/index.ts","../node_modules/@typespec/ts-http-runtime/src/util/internal.ts","../node_modules/@typespec/ts-http-runtime/src/util/sha256.ts","../node_modules/@azure/core-util/src/aborterUtils.ts","../node_modules/@azure/core-util/src/createAbortablePromise.ts","../node_modules/@azure/abort-controller/src/index.ts","../node_modules/@azure/abort-controller/src/AbortError.ts","../node_modules/@azure/core-util/src/delay.ts","../node_modules/@azure/core-util/src/error.ts","../node_modules/@azure/core-util/src/typeGuards.ts","../node_modules/@azure/core-rest-pipeline/src/policies/proxyPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/setClientRequestIdPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/agentPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/tlsPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/tracingPolicy.ts","../node_modules/@azure/core-tracing/src/index.ts","../node_modules/@azure/core-tracing/src/instrumenter.ts","../node_modules/@azure/core-tracing/src/tracingContext.ts","../node_modules/@azure/core-tracing/src/state.ts","../node_modules/@azure/core-tracing/src/tracingClient.ts","../node_modules/@azure/core-rest-pipeline/src/restError.ts","../node_modules/@azure/core-rest-pipeline/src/policies/wrapAbortSignalLikePolicy.ts","../node_modules/@azure/core-rest-pipeline/src/util/wrapAbortSignal.ts","../node_modules/@azure/core-rest-pipeline/src/defaultHttpClient.ts","../node_modules/@azure/core-rest-pipeline/src/httpHeaders.ts","../node_modules/@azure/core-rest-pipeline/src/pipelineRequest.ts","../node_modules/@azure/core-rest-pipeline/src/policies/exponentialRetryPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/systemErrorRetryPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/throttlingRetryPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/retryPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/bearerTokenAuthenticationPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/util/tokenCycler.ts","../node_modules/@azure/core-rest-pipeline/src/policies/ndJsonPolicy.ts","../node_modules/@azure/core-rest-pipeline/src/policies/auxiliaryAuthenticationHeaderPolicy.ts","../node_modules/@azure/storage-blob/src/BlobServiceClient.ts","../node_modules/@azure/core-auth/src/index.ts","../node_modules/@azure/core-auth/src/azureKeyCredential.ts","../node_modules/@azure/core-auth/src/keyCredential.ts","../node_modules/@azure/core-auth/src/azureNamedKeyCredential.ts","../node_modules/@azure/core-auth/src/azureSASCredential.ts","../node_modules/@azure/core-auth/src/tokenCredential.ts","../node_modules/@azure/storage-blob/src/Pipeline.ts","../node_modules/@azure/core-http-compat/src/index.ts","../node_modules/@azure/core-http-compat/src/extendedClient.ts","../node_modules/@azure/core-http-compat/src/policies/disableKeepAlivePolicy.ts","../node_modules/@azure/core-client/src/index.ts","../node_modules/@azure/core-client/src/serializer.ts","../node_modules/@azure/core-client/src/base64.ts","../node_modules/@azure/core-client/src/interfaces.ts","../node_modules/@azure/core-client/src/utils.ts","../node_modules/@azure/core-client/src/serviceClient.ts","../node_modules/@azure/core-client/src/pipeline.ts","../node_modules/@azure/core-client/src/deserializationPolicy.ts","../node_modules/@azure/core-client/src/operationHelpers.ts","../node_modules/@azure/core-client/src/state.ts","../node_modules/@azure/core-client/src/serializationPolicy.ts","../node_modules/@azure/core-client/src/interfaceHelpers.ts","../node_modules/@azure/core-client/src/httpClientCache.ts","../node_modules/@azure/core-client/src/urlHelpers.ts","../node_modules/@azure/core-client/src/log.ts","../node_modules/@azure/core-client/src/authorizeRequestOnClaimChallenge.ts","../node_modules/@azure/core-client/src/authorizeRequestOnTenantChallenge.ts","../node_modules/@azure/core-http-compat/src/response.ts","../node_modules/@azure/core-http-compat/src/util.ts","../node_modules/@azure/core-http-compat/src/policies/requestPolicyFactoryPolicy.ts","../node_modules/@azure/core-http-compat/src/httpClientAdapter.ts","../node_modules/@azure/core-xml/src/index.ts","../node_modules/@azure/core-xml/src/xml.ts","../node_modules/fast-xml-parser/src/fxp.js","../node_modules/fast-xml-parser/src/validator.js","../node_modules/fast-xml-parser/src/util.js","../node_modules/fast-xml-parser/src/xmlparser/XMLParser.js","../node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js","../node_modules/@nodable/entities/src/index.js","../node_modules/@nodable/entities/src/EntityDecoder.js","../node_modules/@nodable/entities/src/entities.js","../node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js","../node_modules/fast-xml-parser/src/xmlparser/xmlNode.js","../node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js","../node_modules/xml-naming/src/index.js","../node_modules/strnum/strnum.js","../node_modules/anynum/anynum.js","../node_modules/anynum/digitTable.js","../node_modules/fast-xml-parser/src/ignoreAttributes.js","../node_modules/path-expression-matcher/src/index.js","../node_modules/path-expression-matcher/src/Expression.js","../node_modules/path-expression-matcher/src/Matcher.js","../node_modules/path-expression-matcher/src/ExpressionSet.js","../node_modules/is-unsafe/src/index.js","../node_modules/is-unsafe/src/contexts/html.js","../node_modules/is-unsafe/src/contexts/xml.js","../node_modules/is-unsafe/src/contexts/svg.js","../node_modules/is-unsafe/src/contexts/sql.js","../node_modules/is-unsafe/src/contexts/shell.js","../node_modules/is-unsafe/src/contexts/redos.js","../node_modules/is-unsafe/src/contexts/nosql.js","../node_modules/is-unsafe/src/contexts/log.js","../node_modules/is-unsafe/src/contexts/sql-strict.js","../node_modules/fast-xml-parser/src/xmlparser/node2json.js","../node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js","../node_modules/fast-xml-builder/src/fxb.js","../node_modules/fast-xml-builder/src/orderedJs2Xml.js","../node_modules/fast-xml-builder/src/util.js","../node_modules/fast-xml-builder/src/ignoreAttributes.js","../node_modules/@azure/core-xml/src/xml.common.ts","../node_modules/@azure/storage-blob/src/log.ts","../node_modules/@azure/storage-common/src/index.ts","../node_modules/@azure/storage-common/src/indexPlatform.ts","../node_modules/@azure/storage-common/src/BufferScheduler.ts","../node_modules/@azure/storage-common/src/PooledBuffer.ts","../node_modules/@azure/storage-common/src/BuffersStream.ts","../node_modules/@azure/storage-common/src/bufferHelpers.ts","../node_modules/@azure/storage-common/src/bufferHelpers.common.ts","../node_modules/@azure/storage-common/src/StructuredMessageEncodingStream.ts","../node_modules/@azure/storage-common/src/StructuredMessageEncoding.ts","../node_modules/@azure/storage-common/src/StorageCRC64Calculator.ts","../node_modules/@azure/storage-common/dist/esm/crc64.js","../node_modules/@azure/storage-common/src/streamHelpers.ts","../node_modules/@azure/storage-common/src/StructuredMessageDecodingStream.ts","../node_modules/@azure/storage-common/src/StructuredMessageDecoding.ts","../node_modules/@azure/storage-common/src/cache.ts","../node_modules/@azure/storage-common/src/StorageResponseFormat.ts","../node_modules/@azure/storage-common/src/StorageBrowserPolicyFactory.ts","../node_modules/@azure/storage-common/src/policies/StorageBrowserPolicy.ts","../node_modules/@azure/storage-common/src/policies/RequestPolicy.ts","../node_modules/@azure/storage-common/src/credentials/AnonymousCredential.ts","../node_modules/@azure/storage-common/src/policies/AnonymousCredentialPolicy.ts","../node_modules/@azure/storage-common/src/policies/CredentialPolicy.ts","../node_modules/@azure/storage-common/src/credentials/Credential.ts","../node_modules/@azure/storage-common/src/credentials/StorageSharedKeyCredential.ts","../node_modules/@azure/storage-common/src/policies/StorageSharedKeyCredentialPolicy.ts","../node_modules/@azure/storage-common/src/utils/constants.ts","../node_modules/@azure/storage-common/src/utils/utils.common.ts","../node_modules/@azure/storage-common/src/utils/SharedKeyComparator.ts","../node_modules/@azure/storage-common/src/StorageRetryPolicyFactory.ts","../node_modules/@azure/storage-common/src/policies/StorageRetryPolicy.ts","../node_modules/@azure/storage-common/src/log.ts","../node_modules/@azure/storage-common/src/policies/StorageRetryPolicyType.ts","../node_modules/@azure/storage-common/src/policies/StorageBrowserPolicyV2.ts","../node_modules/@azure/storage-common/src/policies/StorageCorrectContentLengthPolicy.ts","../node_modules/@azure/storage-common/src/policies/StorageRetryPolicyV2.ts","../node_modules/@azure/storage-common/src/policies/StorageSharedKeyCredentialPolicyV2.ts","../node_modules/@azure/storage-common/src/policies/StorageRedirectRangeHeaderPolicy.ts","../node_modules/@azure/storage-common/src/policies/StorageRequestFailureDetailsParserPolicy.ts","../node_modules/@azure/storage-common/src/credentials/UserDelegationKeyCredential.ts","../node_modules/@azure/storage-blob/src/utils/constants.ts","../node_modules/@azure/storage-blob/src/ContainerClient.ts","../node_modules/@azure/storage-blob/src/StorageClient.ts","../node_modules/@azure/storage-blob/src/StorageContextClient.ts","../node_modules/@azure/storage-blob/src/generated/src/index.ts","../node_modules/@azure/storage-blob/src/generated/src/models/index.ts","../node_modules/@azure/storage-blob/src/generated/src/storageClient.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/index.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/service.ts","../node_modules/@azure/storage-blob/src/generated/src/models/mappers.ts","../node_modules/@azure/storage-blob/src/generated/src/models/parameters.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/container.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/blob.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/pageBlob.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/appendBlob.ts","../node_modules/@azure/storage-blob/src/generated/src/operations/blockBlob.ts","../node_modules/@azure/storage-blob/src/generated/src/operationsInterfaces/index.ts","../node_modules/@azure/storage-blob/src/generated/src/operationsInterfaces/service.ts","../node_modules/@azure/storage-blob/src/generated/src/operationsInterfaces/container.ts","../node_modules/@azure/storage-blob/src/generated/src/operationsInterfaces/blob.ts","../node_modules/@azure/storage-blob/src/generated/src/operationsInterfaces/pageBlob.ts","../node_modules/@azure/storage-blob/src/generated/src/operationsInterfaces/appendBlob.ts","../node_modules/@azure/storage-blob/src/generated/src/operationsInterfaces/blockBlob.ts","../node_modules/@azure/storage-blob/src/utils/utils.common.ts","../node_modules/@azure/storage-blob/src/utils/tracing.ts","../node_modules/@azure/storage-blob/src/utils/blobListArrowParser.ts","../node_modules/@azure/storage-blob/src/utils/blobListXmlParser.ts","../node_modules/@azure/storage-blob/src/sas/BlobSASSignatureValues.ts","../node_modules/@azure/storage-blob/src/sas/BlobSASPermissions.ts","../node_modules/@azure/storage-blob/src/sas/ContainerSASPermissions.ts","../node_modules/@azure/storage-blob/src/sas/SasIPRange.ts","../node_modules/@azure/storage-blob/src/sas/SASQueryParameters.ts","../node_modules/@azure/storage-blob/src/BlobLeaseClient.ts","../node_modules/@azure/storage-blob/src/Clients.ts","../node_modules/@azure/storage-blob/src/BlobDownloadResponse.ts","../node_modules/@azure/storage-blob/src/utils/RetriableReadableStream.ts","../node_modules/@azure/storage-blob/src/BlobQueryResponse.ts","../node_modules/@azure/storage-blob/src/utils/BlobQuickQueryStream.ts","../node_modules/@azure/storage-blob/src/internal-avro/index.ts","../node_modules/@azure/storage-blob/src/internal-avro/AvroReader.ts","../node_modules/@azure/storage-blob/src/internal-avro/AvroConstants.ts","../node_modules/@azure/storage-blob/src/internal-avro/AvroParser.ts","../node_modules/@azure/storage-blob/src/internal-avro/utils/utils.common.ts","../node_modules/@azure/storage-blob/src/internal-avro/AvroReadable.ts","../node_modules/@azure/storage-blob/src/internal-avro/AvroReadableFromStream.ts","../node_modules/@azure/storage-blob/src/models.ts","../node_modules/@azure/storage-blob/src/PageBlobRangeResponse.ts","../node_modules/@azure/storage-blob/src/pollers/BlobStartCopyFromUrlPoller.ts","../node_modules/@azure/core-lro/src/index.ts","../node_modules/@azure/core-lro/src/http/poller.ts","../node_modules/@azure/core-lro/src/http/operation.ts","../node_modules/@azure/core-lro/src/poller/operation.ts","../node_modules/@azure/core-lro/src/logger.ts","../node_modules/@azure/core-lro/src/poller/constants.ts","../node_modules/@azure/core-lro/src/poller/poller.ts","../node_modules/@azure/core-lro/src/legacy/lroEngine/index.ts","../node_modules/@azure/core-lro/src/legacy/lroEngine/lroEngine.ts","../node_modules/@azure/core-lro/src/legacy/lroEngine/operation.ts","../node_modules/@azure/core-lro/src/legacy/poller.ts","../node_modules/@azure/core-lro/src/legacy/pollOperation.ts","../node_modules/@azure/storage-blob/src/Range.ts","../node_modules/@azure/storage-blob/src/utils/Batch.ts","../node_modules/@azure/storage-blob/src/utils/utils.ts","../node_modules/@azure/storage-blob/src/BlobBatchClient.ts","../node_modules/@azure/storage-blob/src/BatchResponseParser.ts","../node_modules/@azure/storage-blob/src/BatchUtils.ts","../node_modules/@azure/storage-blob/src/BlobBatch.ts","../node_modules/@azure/storage-blob/src/utils/Mutex.ts","../node_modules/@azure/storage-blob/src/sas/AccountSASPermissions.ts","../node_modules/@azure/storage-blob/src/sas/AccountSASSignatureValues.ts","../node_modules/@azure/storage-blob/src/sas/AccountSASResourceTypes.ts","../node_modules/@azure/storage-blob/src/sas/AccountSASServices.ts","../node_modules/@azure/storage-blob/src/generatedModels.ts","../node_modules/@actions/artifact/src/internal/upload/blob-upload.ts","../node_modules/@actions/artifact/src/internal/upload/zip.ts","../node_modules/@actions/artifact/src/internal/upload/stream.ts","../node_modules/@actions/artifact/src/internal/upload/types.ts","../node_modules/@actions/artifact/src/internal/download/download-artifact.ts","../node_modules/@actions/artifact/src/internal/find/retry-options.ts","../node_modules/@actions/artifact/src/internal/delete/delete-artifact.ts","../node_modules/@actions/artifact/src/internal/find/get-artifact.ts","../node_modules/@actions/artifact/src/internal/find/list-artifacts.ts","../node_modules/@actions/artifact/src/internal/client.ts","../node_modules/@actions/artifact/lib/internal/shared/interfaces.js","../src/ctrf/core/src/methods/run-insights.ts","../src/ctrf/core/src/methods/utilities/sort-reports.ts","../src/ctrf/previous-results.ts","../src/ctrf/slowest-tests.ts","../src/ctrf/average-test-duration.ts","../src/ctrf/handle-baseline.ts","../src/ctrf/core/src/methods/read-reports.ts","../node_modules/glob/node_modules/balanced-match/src/index.ts","../node_modules/glob/node_modules/brace-expansion/src/index.ts","../node_modules/glob/node_modules/minimatch/src/assert-valid-pattern.ts","../node_modules/glob/node_modules/minimatch/src/brace-expressions.ts","../node_modules/glob/node_modules/minimatch/src/unescape.ts","../node_modules/glob/node_modules/minimatch/src/ast.ts","../node_modules/glob/node_modules/minimatch/src/escape.ts","../node_modules/glob/node_modules/minimatch/src/index.ts","../node_modules/glob/src/glob.ts","../node_modules/glob/node_modules/lru-cache/src/index.ts","../node_modules/glob/node_modules/path-scurry/src/index.ts","../node_modules/glob/node_modules/minipass/src/index.ts","../node_modules/glob/src/pattern.ts","../node_modules/glob/src/ignore.ts","../node_modules/glob/src/processor.ts","../node_modules/glob/src/walker.ts","../node_modules/glob/src/has-magic.ts","../node_modules/glob/src/index.ts","../src/ctrf/adapter/normalize.ts","../src/ctrf/summary-insights.ts","../src/ctrf/report-preparation.ts","../src/utils/index.ts","../src/utils/file-system.ts","../src/ctrf/core/src/methods/merge-reports.ts","../node_modules/ctrf/dist/index.js","../src/ctrf/core/src/constants.ts","../src/utils/report-utils.ts","../node_modules/junit-to-ctrf/dist/index.js","../node_modules/junit-to-ctrf/dist/convert.js","../node_modules/junit-to-ctrf/dist/identity.js","../node_modules/junit-to-ctrf/dist/read.js","../src/ctrf/report-conditionals.ts","../src/ctrf/prefix-test-names-with-suite.ts","../src/ctrf/group-test-results.ts","../src/handlebars/core.ts","../src/handlebars/helpers/index.ts","../src/handlebars/helpers/string.ts","../src/handlebars/helpers/ctrf.ts","../src/handlebars/helpers/ansi.ts","../src/handlebars/helpers/array.ts","../src/handlebars/helpers/math.ts","../src/github/context.ts","../node_modules/handlebars-helpers-ctrf/dist/index.js","../node_modules/handlebars-helpers-ctrf/dist/helper-registry.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/array.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/collections.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/comparison.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/ctrf.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/date.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/fs.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/github.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/inflection.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/match.js","../node_modules/handlebars-helpers-ctrf/node_modules/minimatch/src/index.ts","../node_modules/handlebars-helpers-ctrf/node_modules/brace-expansion/src/index.ts","../node_modules/handlebars-helpers-ctrf/node_modules/balanced-match/src/index.ts","../node_modules/handlebars-helpers-ctrf/node_modules/minimatch/src/assert-valid-pattern.ts","../node_modules/handlebars-helpers-ctrf/node_modules/minimatch/src/ast.ts","../node_modules/handlebars-helpers-ctrf/node_modules/minimatch/src/brace-expressions.ts","../node_modules/handlebars-helpers-ctrf/node_modules/minimatch/src/unescape.ts","../node_modules/handlebars-helpers-ctrf/node_modules/minimatch/src/escape.ts","../node_modules/handlebars-helpers-ctrf/dist/helpers/math.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/misc.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/number.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/object.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/path.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/regex.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/string.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/timestamp.js","../node_modules/handlebars-helpers-ctrf/dist/helpers/url.js","../src/reports/core.ts","../src/reports/constants.ts","../src/github/helpers.ts","../src/core/inputs.ts","../src/github/handler.ts","../src/client/github/checks.ts","../src/integrations/handler.ts","../src/integrations/slack.ts","../src/integrations/teams.ts","../node_modules/teams-ctrf/dist/index.js","../src/integrations/ai.ts","../node_modules/ai-ctrf/dist/index.js","../node_modules/yargs/index.mjs","../node_modules/yargs/lib/platform-shims/esm.mjs","../node_modules/cliui/index.mjs","../node_modules/cliui/build/lib/index.js","../node_modules/string-width/index.js","../node_modules/strip-ansi/index.js","../node_modules/ansi-regex/index.js","../node_modules/get-east-asian-width/index.js","../node_modules/get-east-asian-width/lookup.js","../node_modules/get-east-asian-width/lookup-data.js","../node_modules/get-east-asian-width/utilities.js","../node_modules/emoji-regex/index.mjs","../node_modules/wrap-ansi/index.js","../node_modules/ansi-styles/index.js","../node_modules/escalade/sync/index.mjs","../node_modules/yargs-parser/build/lib/index.js","../node_modules/yargs-parser/build/lib/string-utils.js","../node_modules/yargs-parser/build/lib/yargs-parser.js","../node_modules/yargs-parser/build/lib/tokenize-arg-string.js","../node_modules/yargs-parser/build/lib/yargs-parser-types.js","../node_modules/yargs/build/lib/utils/process-argv.js","../node_modules/yargs/node_modules/string-width/index.js","../node_modules/y18n/index.mjs","../node_modules/y18n/build/lib/platform-shims/node.js","../node_modules/y18n/build/lib/index.js","../node_modules/yargs/build/lib/yargs-factory.js","../node_modules/yargs/build/lib/command.js","../node_modules/yargs/build/lib/typings/common-types.js","../node_modules/yargs/build/lib/utils/is-promise.js","../node_modules/yargs/build/lib/middleware.js","../node_modules/yargs/build/lib/argsert.js","../node_modules/yargs/build/lib/yerror.js","../node_modules/yargs/build/lib/parse-command.js","../node_modules/yargs/build/lib/utils/maybe-async-result.js","../node_modules/yargs/build/lib/usage.js","../node_modules/yargs/build/lib/utils/obj-filter.js","../node_modules/yargs/build/lib/utils/set-blocking.js","../node_modules/yargs/build/lib/completion.js","../node_modules/yargs/build/lib/completion-templates.js","../node_modules/yargs/build/lib/validation.js","../node_modules/yargs/build/lib/utils/levenshtein.js","../node_modules/yargs/build/lib/utils/apply-extends.js","../node_modules/yargs/helpers/helpers.mjs","../node_modules/openai/src/index.ts","../node_modules/openai/src/client.ts","../node_modules/openai/internal/tslib.mjs","../node_modules/openai/src/internal/utils/uuid.ts","../node_modules/openai/src/internal/utils/values.ts","../node_modules/openai/src/core/error.ts","../node_modules/openai/src/internal/errors.ts","../node_modules/openai/src/internal/utils/sleep.ts","../node_modules/openai/src/internal/utils/abort.ts","../node_modules/openai/src/internal/parse.ts","../node_modules/openai/src/internal/shims.ts","../node_modules/openai/src/internal/utils/bytes.ts","../node_modules/openai/src/internal/decoders/line.ts","../node_modules/openai/src/internal/utils/log.ts","../node_modules/openai/src/core/streaming.ts","../node_modules/openai/src/internal/detect-platform.ts","../node_modules/openai/src/version.ts","../node_modules/openai/src/internal/request-options.ts","../node_modules/openai/src/internal/utils/query.ts","../node_modules/openai/src/internal/qs/stringify.ts","../node_modules/openai/src/internal/qs/utils.ts","../node_modules/openai/src/internal/qs/formats.ts","../node_modules/openai/src/internal/data-residency.ts","../node_modules/openai/src/core/api-promise.ts","../node_modules/openai/src/core/pagination.ts","../node_modules/openai/src/auth/workload-identity-auth.ts","../node_modules/openai/src/internal/auth/x509-api-origin.ts","../node_modules/openai/src/internal/headers.ts","../node_modules/openai/src/internal/auth/x509-transport-registry.ts","../node_modules/openai/internal/auth/x509-transport-state.mjs","../node_modules/openai/src/internal/auth/x509-transport-state-browser.ts","../node_modules/openai/src/internal/auth/x509-workload-identity-auth.ts","../node_modules/openai/src/internal/auth/x509-credential-options.ts","../node_modules/openai/src/core/uploads.ts","../node_modules/openai/src/internal/uploads.ts","../node_modules/openai/src/internal/to-file.ts","../node_modules/openai/src/resources/index.ts","../node_modules/openai/src/resources/chat/index.ts","../node_modules/openai/src/resources/chat/chat.ts","../node_modules/openai/src/core/resource.ts","../node_modules/openai/src/resources/chat/completions/completions.ts","../node_modules/openai/src/resources/chat/completions/messages.ts","../node_modules/openai/src/internal/utils/path.ts","../node_modules/openai/src/lib/chat-completions/streaming.ts","../node_modules/openai/src/lib/ChatCompletionRunner.ts","../node_modules/openai/src/error.ts","../node_modules/openai/src/lib/parser.ts","../node_modules/openai/src/lib/chatCompletionUtils.ts","../node_modules/openai/src/lib/EventStream.ts","../node_modules/openai/src/lib/RunnableFunction.ts","../node_modules/openai/src/lib/AbstractChatCompletionRunner.ts","../node_modules/openai/src/lib/ChatCompletionStreamingRunner.ts","../node_modules/openai/src/_vendor/partial-json-parser/parser.ts","../node_modules/openai/src/streaming.ts","../node_modules/openai/src/lib/ChatCompletionStream.ts","../node_modules/openai/src/resources/chat/completions/index.ts","../node_modules/openai/src/resources/shared.ts","../node_modules/openai/src/resources/admin/admin.ts","../node_modules/openai/src/resources/admin/organization/organization.ts","../node_modules/openai/src/resources/admin/organization/admin-api-keys.ts","../node_modules/openai/src/resources/admin/organization/audit-logs.ts","../node_modules/openai/src/resources/admin/organization/certificates.ts","../node_modules/openai/src/resources/admin/organization/data-retention.ts","../node_modules/openai/src/resources/admin/organization/external-storage.ts","../node_modules/openai/src/resources/admin/organization/invites.ts","../node_modules/openai/src/resources/admin/organization/roles.ts","../node_modules/openai/src/resources/admin/organization/spend-alerts.ts","../node_modules/openai/src/resources/admin/organization/spend-limit.ts","../node_modules/openai/src/resources/admin/organization/usage.ts","../node_modules/openai/src/resources/admin/organization/groups/groups.ts","../node_modules/openai/src/resources/admin/organization/groups/roles.ts","../node_modules/openai/src/resources/admin/organization/groups/users.ts","../node_modules/openai/src/resources/admin/organization/projects/projects.ts","../node_modules/openai/src/resources/admin/organization/projects/api-keys.ts","../node_modules/openai/src/resources/admin/organization/projects/certificates.ts","../node_modules/openai/src/resources/admin/organization/projects/data-retention.ts","../node_modules/openai/src/resources/admin/organization/projects/hosted-tool-permissions.ts","../node_modules/openai/src/resources/admin/organization/projects/model-permissions.ts","../node_modules/openai/src/resources/admin/organization/projects/rate-limits.ts","../node_modules/openai/src/resources/admin/organization/projects/roles.ts","../node_modules/openai/src/resources/admin/organization/projects/spend-alerts.ts","../node_modules/openai/src/resources/admin/organization/projects/spend-limit.ts","../node_modules/openai/src/resources/admin/organization/projects/groups/groups.ts","../node_modules/openai/src/resources/admin/organization/projects/groups/roles.ts","../node_modules/openai/src/resources/admin/organization/projects/service-accounts/service-accounts.ts","../node_modules/openai/src/resources/admin/organization/projects/service-accounts/api-keys.ts","../node_modules/openai/src/resources/admin/organization/projects/users/users.ts","../node_modules/openai/src/resources/admin/organization/projects/users/roles.ts","../node_modules/openai/src/resources/admin/organization/users/users.ts","../node_modules/openai/src/resources/admin/organization/users/roles.ts","../node_modules/openai/src/resources/audio/audio.ts","../node_modules/openai/src/resources/audio/speech.ts","../node_modules/openai/src/resources/audio/transcriptions.ts","../node_modules/openai/src/resources/audio/translations.ts","../node_modules/openai/src/resources/audio/voices.ts","../node_modules/openai/src/resources/batches.ts","../node_modules/openai/src/resources/beta/beta.ts","../node_modules/openai/src/resources/beta/assistants.ts","../node_modules/openai/src/resources/beta/realtime/realtime.ts","../node_modules/openai/src/resources/beta/realtime/sessions.ts","../node_modules/openai/src/resources/beta/realtime/transcription-sessions.ts","../node_modules/openai/src/resources/beta/agents/agents.ts","../node_modules/openai/src/resources/beta/agents/environments/environments.ts","../node_modules/openai/src/resources/beta/agents/environments/files.ts","../node_modules/openai/src/lib/beta/agents/files.ts","../node_modules/openai/src/resources/beta/agents/environments/templates.ts","../node_modules/openai/src/resources/beta/agents/sessions/sessions.ts","../node_modules/openai/src/lib/agents/turn-state.ts","../node_modules/openai/src/lib/beta/agents/tool-output.ts","../node_modules/openai/src/lib/beta/agents/tool-stages.ts","../node_modules/openai/src/lib/beta/agents/tool-dispatcher.ts","../node_modules/openai/src/lib/beta/agents/parse-result.ts","../node_modules/openai/src/lib/beta/agents/parsed-agent-turn-result.ts","../node_modules/openai/src/lib/beta/agents/agent-turn-result.ts","../node_modules/openai/src/lib/agents/output-text.ts","../node_modules/openai/src/lib/beta/agents/output-parse-error.ts","../node_modules/openai/src/lib/beta/agents/agent-turn-result-error.ts","../node_modules/openai/src/lib/beta/agents/agent-turn-result-collector.ts","../node_modules/openai/src/lib/beta/agents/result-collection.ts","../node_modules/openai/src/lib/agents/agent-session-stream.ts","../node_modules/openai/src/lib/beta/agents/agent-session-create-stream.ts","../node_modules/openai/src/resources/beta/agents/sessions/artifacts.ts","../node_modules/openai/src/lib/beta/agents/pages.ts","../node_modules/openai/src/lib/beta/agents/result-artifacts.ts","../node_modules/openai/src/resources/beta/agents/sessions/events.ts","../node_modules/openai/src/resources/beta/agents/sessions/items.ts","../node_modules/openai/src/resources/beta/agents/sessions/traces.ts","../node_modules/openai/src/resources/beta/agents/sessions/subagents/subagents.ts","../node_modules/openai/src/resources/beta/agents/sessions/subagents/items.ts","../node_modules/openai/src/resources/beta/agents/sessions/subagents/turns/turns.ts","../node_modules/openai/src/resources/beta/agents/sessions/subagents/turns/items.ts","../node_modules/openai/src/resources/beta/agents/sessions/turns/turns.ts","../node_modules/openai/src/resources/beta/agents/sessions/turns/items.ts","../node_modules/openai/src/resources/beta/agents/vaults/vaults.ts","../node_modules/openai/src/resources/beta/agents/vaults/credentials.ts","../node_modules/openai/src/resources/beta/chatkit/chatkit.ts","../node_modules/openai/src/resources/beta/chatkit/sessions.ts","../node_modules/openai/src/resources/beta/chatkit/threads.ts","../node_modules/openai/src/resources/beta/responses/responses.ts","../node_modules/openai/src/resources/beta/responses/input-items.ts","../node_modules/openai/src/resources/beta/responses/input-tokens.ts","../node_modules/openai/src/resources/beta/threads/threads.ts","../node_modules/openai/src/resources/beta/threads/messages.ts","../node_modules/openai/src/resources/beta/threads/runs/runs.ts","../node_modules/openai/src/resources/beta/threads/runs/steps.ts","../node_modules/openai/src/internal/utils.ts","../node_modules/openai/src/internal/utils/base64.ts","../node_modules/openai/src/internal/utils/env.ts","../node_modules/openai/src/internal/assistant-stream-delta.ts","../node_modules/openai/src/lib/AssistantStream.ts","../node_modules/openai/src/lib/assistant-run-polling.ts","../node_modules/openai/src/lib/polling.ts","../node_modules/openai/src/resources/completions.ts","../node_modules/openai/src/resources/containers/containers.ts","../node_modules/openai/src/resources/containers/files/files.ts","../node_modules/openai/src/resources/containers/files/content.ts","../node_modules/openai/src/resources/content-provenance-checks.ts","../node_modules/openai/src/resources/conversations/conversations.ts","../node_modules/openai/src/resources/conversations/items.ts","../node_modules/openai/src/resources/decisions.ts","../node_modules/openai/src/resources/embeddings.ts","../node_modules/openai/src/lib/embeddings.ts","../node_modules/openai/src/resources/evals/evals.ts","../node_modules/openai/src/resources/evals/runs/runs.ts","../node_modules/openai/src/resources/evals/runs/output-items.ts","../node_modules/openai/src/resources/files.ts","../node_modules/openai/src/lib/file-processing.ts","../node_modules/openai/src/resources/fine-tuning/fine-tuning.ts","../node_modules/openai/src/resources/fine-tuning/methods.ts","../node_modules/openai/src/resources/fine-tuning/alpha/alpha.ts","../node_modules/openai/src/resources/fine-tuning/alpha/graders.ts","../node_modules/openai/src/resources/fine-tuning/checkpoints/checkpoints.ts","../node_modules/openai/src/resources/fine-tuning/checkpoints/permissions.ts","../node_modules/openai/src/resources/fine-tuning/jobs/jobs.ts","../node_modules/openai/src/resources/fine-tuning/jobs/checkpoints.ts","../node_modules/openai/src/resources/graders/graders.ts","../node_modules/openai/src/resources/graders/grader-models.ts","../node_modules/openai/src/resources/images.ts","../node_modules/openai/src/resources/live/live.ts","../node_modules/openai/src/resources/live/sessions.ts","../node_modules/openai/src/resources/live/forks/forks.ts","../node_modules/openai/src/resources/live/sideband/sideband.ts","../node_modules/openai/src/resources/models.ts","../node_modules/openai/src/resources/moderations.ts","../node_modules/openai/src/resources/realtime/realtime.ts","../node_modules/openai/src/resources/realtime/calls.ts","../node_modules/openai/src/internal/multipart-encoding.ts","../node_modules/openai/src/resources/realtime/client-secrets.ts","../node_modules/openai/src/resources/realtime/translations/translations.ts","../node_modules/openai/src/resources/realtime/translations/client-secrets.ts","../node_modules/openai/src/resources/responses/responses.ts","../node_modules/openai/src/lib/ResponsesParser.ts","../node_modules/openai/src/internal/responses/response-accumulator.ts","../node_modules/openai/src/internal/responses/canonical-output-text.ts","../node_modules/openai/src/internal/responses/output-text-index.ts","../node_modules/openai/src/lib/responses/ResponseStream.ts","../node_modules/openai/src/resources/responses/input-items.ts","../node_modules/openai/src/resources/responses/input-tokens.ts","../node_modules/openai/src/resources/safety/safety.ts","../node_modules/openai/src/resources/safety/alerts.ts","../node_modules/openai/src/resources/safety/cases.ts","../node_modules/openai/src/resources/skills/skills.ts","../node_modules/openai/src/resources/skills/content.ts","../node_modules/openai/src/resources/skills/versions/versions.ts","../node_modules/openai/src/resources/skills/versions/content.ts","../node_modules/openai/src/resources/uploads/uploads.ts","../node_modules/openai/src/resources/uploads/parts.ts","../node_modules/openai/src/resources/vector-stores/vector-stores.ts","../node_modules/openai/src/resources/vector-stores/file-batches.ts","../node_modules/openai/src/lib/vector-store-polling.ts","../node_modules/openai/src/lib/vector-store-upload.ts","../node_modules/openai/src/lib/Util.ts","../node_modules/openai/src/resources/vector-stores/files.ts","../node_modules/openai/src/resources/videos.ts","../node_modules/openai/src/resources/webhooks/webhooks.ts","../node_modules/openai/src/lib/webhook-signature.ts","../node_modules/openai/src/resources/webhooks/event-types.ts","../node_modules/openai/src/internal/realtime-credentials.ts","../node_modules/openai/src/internal/bedrock.ts","../node_modules/openai/src/internal/ws.ts","../node_modules/openai/src/internal/provider.ts","../node_modules/openai/src/azure.ts","../node_modules/openai/src/bedrock.ts","../node_modules/@google/generative-ai/dist/index.mjs"],"sourcesContent":["export const __filename = import.meta.filename;\nexport const __dirname = import.meta.dirname;\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","module.exports = require('./lib/tunnel');\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 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\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'\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'\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 {\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 /**\n * @param {number|null} statusCode\n * @param {Buffer[]|null} headers\n * @param {import('node:stream').Duplex} socket\n * @param {string} [statusText]\n */\n onUpgrade (statusCode, headers, socket, statusText = '') {\n this.onFinally()\n\n assert(!this.aborted)\n assert(!this.completed)\n\n if (statusCode !== null) {\n this.#publishUpgradeHeaders(statusCode, headers, statusText)\n }\n\n const result = this[kHandler].onUpgrade(statusCode, headers, socket)\n\n if (!this.aborted) {\n this.completed = true\n if (statusCode !== null) {\n this.#publishUpgradeTrailers()\n }\n }\n\n return result\n }\n\n /**\n * @param {number} statusCode\n * @param {import('node:http2').IncomingHttpHeaders} headers\n * @param {(headers: import('node:http2').IncomingHttpHeaders) => Buffer[]} parseHeaders\n * @param {string} [statusText]\n */\n onUpgradeResponse (statusCode, headers, parseHeaders, statusText = '') {\n assert(!this.aborted)\n assert(this.completed)\n\n if (channels.headers.hasSubscribers) {\n this.#publishUpgradeHeaders(statusCode, parseHeaders(headers), statusText)\n }\n this.#publishUpgradeTrailers()\n }\n\n /**\n * @param {Error} error\n */\n onUpgradeError (error) {\n assert(!this.aborted)\n assert(this.completed)\n\n if (channels.error.hasSubscribers) {\n channels.error.publish({ request: this, error })\n }\n }\n\n /**\n * @param {number} statusCode\n * @param {Buffer[]} headers\n * @param {string} statusText\n */\n #publishUpgradeHeaders (statusCode, headers, statusText) {\n if (channels.headers.hasSubscribers) {\n channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })\n }\n }\n\n #publishUpgradeTrailers () {\n if (channels.trailers.hasSubscribers) {\n channels.trailers.publish({ request: this, trailers: [] })\n }\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 // Coerce primitives (and reject unsafe coercions such as functions\n // with a crafted toString/Symbol.toPrimitive).\n const str = `${val[i]}`\n if (!isValidHeaderValue(str)) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n arr.push(str)\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 // Coerce primitives (and reject unsafe coercions such as functions\n // with a crafted toString/Symbol.toPrimitive).\n val = `${val}`\n if (!isValidHeaderValue(val)) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\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","'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 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'\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 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\";\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\";\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/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpb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EgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQA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wTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAk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EMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQA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ohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIA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AC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==', 'base64')\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\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","'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 { 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\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\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 { 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 { 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\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 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\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 InvalidArgumentError,\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, statusText } = 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, statusText)\n } catch (error) {\n util.errorRequest(client, request, error)\n util.destroy(socket, error)\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 clearImmediate(socket[kIdleSocketValidationTimeout])\n socket[kIdleSocketValidationTimeout] = null\n }\n\n socket[kIdleSocketValidation] = 0\n}\n\nfunction scheduleIdleSocketValidation (client, socket) {\n socket[kIdleSocketValidation] = 1\n // Yield to the check phase (after poll) so unsolicited bytes / FIN / RST\n // already pending on this idle keep-alive socket are processed before the\n // next request is written (GHSA-35p6-xmwp-9g52).\n //\n // setTimeout(0) pays Node's ~1ms timer floor on every sequential reuse\n // (#5493). setImmediate avoids that, but an *unref'd* Immediate lets poll\n // block for ~500ms when the event loop is otherwise idle (#5600 / #5606).\n // A ref'd Immediate both keeps the pending request alive and makes poll\n // return immediately — the hybrid those issues asked for.\n socket[kIdleSocketValidationTimeout] = setImmediate(() => {\n socket[kIdleSocketValidationTimeout] = null\n socket[kIdleSocketValidation] = 2\n\n if (client[kSocket] === socket && !socket.destroyed) {\n client[kResume]()\n }\n })\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) {\n const contentType = body.type\n if (contentType) {\n const contentTypeValue = `${contentType}`\n if (!util.isValidHeaderValue(contentTypeValue)) {\n util.errorRequest(client, request, new InvalidArgumentError('invalid content-type header'))\n return false\n }\n headers.push('content-type', contentTypeValue)\n }\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 /**\n * @param {Error} [error]\n */\n const abort = (error) => {\n if (request.aborted) {\n return\n }\n\n if (request.completed) {\n if (request.upgrade || request.method === 'CONNECT') {\n util.destroy(socket, new InformationalError('aborted'))\n }\n return\n }\n\n util.errorRequest(client, request, error || 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 { errorMonitor } = require('node:events')\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\n/**\n * @param {import('node:http2').IncomingHttpHeaders} headers\n * @returns {Buffer[]}\n */\nfunction parseH2ResponseHeaders (headers) {\n const { [HTTP2_HEADER_STATUS]: _statusCode, ...realHeaders } = headers\n return parseH2Headers(realHeaders)\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 /**\n * @param {Error} [error]\n */\n const abort = (error) => {\n if (request.aborted) {\n return\n }\n\n if (request.completed) {\n if (method === 'CONNECT' && stream != null) {\n util.destroy(stream, error || new RequestAbortedError())\n }\n return\n }\n\n error = error || new RequestAbortedError()\n\n util.errorRequest(client, request, error)\n\n if (stream != null) {\n util.destroy(stream, error)\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, error)\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 disabled endStream to allow the user to write to the stream\n stream = session.request(headers, { endStream: false, signal })\n let upgradeResponseFinished = false\n\n /**\n * @param {import('node:http2').IncomingHttpHeaders} headers\n */\n const onResponse = (headers) => {\n upgradeResponseFinished = true\n stream.off(errorMonitor, onUpgradeError)\n request.onUpgradeResponse(Number(headers[HTTP2_HEADER_STATUS]), headers, parseH2ResponseHeaders)\n }\n\n /**\n * @param {Error} error\n */\n const onUpgradeError = (error) => {\n upgradeResponseFinished = true\n stream.off('response', onResponse)\n request.onUpgradeError(error)\n }\n\n const onReady = () => {\n try {\n request.onUpgrade(null, null, stream)\n } catch (error) {\n stream.off('response', onResponse)\n abort(error)\n return\n }\n\n if (request.aborted) {\n return\n }\n\n stream.off('error', abort)\n stream.once(errorMonitor, onUpgradeError)\n client[kQueue][client[kRunningIdx]++] = null\n }\n\n stream.once('response', onResponse)\n stream.once('error', abort)\n ++session[kOpenStreams]\n onReady()\n\n stream.once('close', () => {\n if (!upgradeResponseFinished && request.completed) {\n stream.off('response', onResponse)\n stream.off(errorMonitor, onUpgradeError)\n request.onUpgradeError(new InformationalError(`HTTP/2: \"stream error\" received - code ${stream.rstCode}`))\n }\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","'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'\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","// @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","/* 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","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 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","'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 {\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\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 { 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 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","'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\nfunction validatePartialResponseContentLength (headers, range, statusCode, retryCount) {\n const contentLength = headers['content-length']\n if (contentLength == null) {\n return null\n }\n\n if (!Number.isFinite(range.start) || !Number.isFinite(range.end)) {\n return null\n }\n\n const length = Number(contentLength)\n const expectedLength = range.end - range.start + 1\n if (!Number.isFinite(length) || length !== expectedLength) {\n return new RequestRetryError('Content-Length mismatch', statusCode, {\n headers,\n data: { count: retryCount }\n })\n }\n\n return null\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 this.headersSent = false\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 checkpointResponseEnd (headers, resume) {\n if (this.end == null && this.opts.method !== 'HEAD') {\n const contentLength = headers['content-length']\n this.end = contentLength != null ? Number(contentLength) - 1 : null\n\n assert(\n this.end == null || Number.isFinite(this.end),\n 'invalid content-length'\n )\n }\n\n this.resume = this.end != null ? resume : null\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 // Only expose a response if no earlier attempt has reached the caller.\n // Otherwise abort this attempt so the error settles the existing body\n // instead of replacing it with a new response.\n if (!this.headersSent && this.retryOpts.statusCodes.includes(statusCode) === false) {\n this.headersSent = true\n this.checkpointResponseEnd(headers, resume)\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 contentLengthError = validatePartialResponseContentLength(headers, contentRange, statusCode, this.retryCount)\n if (contentLengthError != null) {\n this.abort(contentLengthError)\n return false\n }\n\n const { start, size, end = size - 1 } = contentRange\n\n if (this.start !== start || (this.end != null && this.end !== end)) {\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 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 this.headersSent = true\n return this.handler.onHeaders(\n statusCode,\n rawHeaders,\n resume,\n statusMessage\n )\n }\n\n const contentLengthError = validatePartialResponseContentLength(headers, range, statusCode, this.retryCount)\n if (contentLengthError != null) {\n this.abort(contentLengthError)\n return false\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.headersSent = true\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) || (this.headersSent && this.resume == null)) {\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'\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","// 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 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","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 { 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 {\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 { 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\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\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","'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\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 { 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 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 { 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\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\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 { 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\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'\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'\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'\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","// 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","'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\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","/* 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","// 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","'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 { 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\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 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 {\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\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\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\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\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 > 0x7E || // exclude DEL and non-ascii\n code === 0x3B // ;\n ) {\n throw new Error('Invalid cookie path')\n }\n }\n}\n\n/**\n * ::= | \n *\n * ::= any one of the 52 alphabetic characters A through Z in\n * upper case and a through z in lower case\n *\n * ::= any one of the ten digits 0 through 9r\n *\n * @see https://www.rfc-editor.org/rfc/rfc1034#section-3.5\n * @param {number} code\n */\nfunction isLetterOrDigit (code) {\n return (\n (code >= 0x30 && code <= 0x39) || // 0-9\n (code >= 0x41 && code <= 0x5A) || // A-Z\n (code >= 0x61 && code <= 0x7A) // a-z\n )\n}\n\n/**\n * Validates a cookie domain against the \"preferred name syntax\".\n *\n * ::= | \" \"\n * ::=