diff --git a/.claude/launch.json b/.claude/launch.json new file mode 100644 index 0000000000..eedc4432b9 --- /dev/null +++ b/.claude/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.0.1", + "configurations": [ + { + "name": "solid-docs-dev", + "runtimeExecutable": "pnpm", + "runtimeArgs": ["dev"], + "port": 3000 + } + ] +} diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index da45c4712c..672b5663d7 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - v2-rebuild pull_request: branches: - main @@ -40,3 +41,6 @@ jobs: - name: Check formatting run: pnpm exec prettier . --check + + - name: Tone lint + run: pnpm lint:tone diff --git a/.pnpm-store/v11/.pnpm-needs-build-marker b/.pnpm-store/v11/.pnpm-needs-build-marker new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.pnpm-store/v11/files/00/21d5b4eb58c81882a97226356fdf0c8e5a12877642329dddb09ca399b3e1857ea281433e3628f064ce7b411c4638e38e9d55e4d789496731882ffffb93fc2f b/.pnpm-store/v11/files/00/21d5b4eb58c81882a97226356fdf0c8e5a12877642329dddb09ca399b3e1857ea281433e3628f064ce7b411c4638e38e9d55e4d789496731882ffffb93fc2f new file mode 100644 index 0000000000..6a6e43899c --- /dev/null +++ b/.pnpm-store/v11/files/00/21d5b4eb58c81882a97226356fdf0c8e5a12877642329dddb09ca399b3e1857ea281433e3628f064ce7b411c4638e38e9d55e4d789496731882ffffb93fc2f @@ -0,0 +1,100 @@ +'use strict' + +const { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require('node:zlib') +const { isValidClientWindowBits } = require('./util') +const { MessageSizeExceededError } = require('../../core/errors') + +const tail = Buffer.from([0x00, 0x00, 0xff, 0xff]) +const kBuffer = Symbol('kBuffer') +const kLength = Symbol('kLength') + +class PerMessageDeflate { + /** @type {import('node:zlib').InflateRaw} */ + #inflate + + #options = {} + + #maxPayloadSize = 0 + + /** + * @param {Map} extensions + */ + constructor (extensions, options) { + this.#options.serverNoContextTakeover = extensions.has('server_no_context_takeover') + this.#options.serverMaxWindowBits = extensions.get('server_max_window_bits') + + this.#maxPayloadSize = options.maxPayloadSize + } + + /** + * Decompress a compressed payload. + * @param {Buffer} chunk Compressed data + * @param {boolean} fin Final fragment flag + * @param {Function} callback Callback function + */ + decompress (chunk, fin, callback) { + // An endpoint uses the following algorithm to decompress a message. + // 1. Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the + // payload of the message. + // 2. Decompress the resulting data using DEFLATE. + if (!this.#inflate) { + let windowBits = Z_DEFAULT_WINDOWBITS + + if (this.#options.serverMaxWindowBits) { // empty values default to Z_DEFAULT_WINDOWBITS + if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) { + callback(new Error('Invalid server_max_window_bits')) + return + } + + windowBits = Number.parseInt(this.#options.serverMaxWindowBits) + } + + try { + this.#inflate = createInflateRaw({ windowBits }) + } catch (err) { + callback(err) + return + } + this.#inflate[kBuffer] = [] + this.#inflate[kLength] = 0 + + this.#inflate.on('data', (data) => { + this.#inflate[kLength] += data.length + + if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) { + callback(new MessageSizeExceededError()) + this.#inflate.removeAllListeners() + this.#inflate = null + return + } + + this.#inflate[kBuffer].push(data) + }) + + this.#inflate.on('error', (err) => { + this.#inflate = null + callback(err) + }) + } + + this.#inflate.write(chunk) + if (fin) { + this.#inflate.write(tail) + } + + this.#inflate.flush(() => { + if (!this.#inflate) { + return + } + + const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength]) + + this.#inflate[kBuffer].length = 0 + this.#inflate[kLength] = 0 + + callback(null, full) + }) + } +} + +module.exports = { PerMessageDeflate } diff --git a/.pnpm-store/v11/files/00/61a8646b26d16deb6ed9705454917d48d7f784becdccf24aac2efce3e3c46b7b6fa74e6bb92c2e568c7ef217538b6bc865d518245bebeba92c47f43b0050fc b/.pnpm-store/v11/files/00/61a8646b26d16deb6ed9705454917d48d7f784becdccf24aac2efce3e3c46b7b6fa74e6bb92c2e568c7ef217538b6bc865d518245bebeba92c47f43b0050fc new file mode 100644 index 0000000000..6df16f21ac --- /dev/null +++ b/.pnpm-store/v11/files/00/61a8646b26d16deb6ed9705454917d48d7f784becdccf24aac2efce3e3c46b7b6fa74e6bb92c2e568c7ef217538b6bc865d518245bebeba92c47f43b0050fc @@ -0,0 +1,52 @@ +#!/usr/bin/env node + +const which = require('../lib') +const argv = process.argv.slice(2) + +const usage = (err) => { + if (err) { + console.error(`which: ${err}`) + } + console.error('usage: which [-as] program ...') + process.exit(1) +} + +if (!argv.length) { + return usage() +} + +let dashdash = false +const [commands, flags] = argv.reduce((acc, arg) => { + if (dashdash || arg === '--') { + dashdash = true + return acc + } + + if (!/^-/.test(arg)) { + acc[0].push(arg) + return acc + } + + for (const flag of arg.slice(1).split('')) { + if (flag === 's') { + acc[1].silent = true + } else if (flag === 'a') { + acc[1].all = true + } else { + usage(`illegal option -- ${flag}`) + } + } + + return acc +}, [[], {}]) + +for (const command of commands) { + try { + const res = which.sync(command, { all: flags.all }) + if (!flags.silent) { + console.log([].concat(res).join('\n')) + } + } catch (err) { + process.exitCode = 1 + } +} diff --git a/.pnpm-store/v11/files/00/a9aeaf93dcff7335010e076c3259d3422eb40e730a2e25f50df8ebb5d7944d5f961b6f2a9bf6267a1ce8ca3f97058d3235ae5d6f96ffb0461eabfdcd04e97f b/.pnpm-store/v11/files/00/a9aeaf93dcff7335010e076c3259d3422eb40e730a2e25f50df8ebb5d7944d5f961b6f2a9bf6267a1ce8ca3f97058d3235ae5d6f96ffb0461eabfdcd04e97f new file mode 100644 index 0000000000..2274feef26 --- /dev/null +++ b/.pnpm-store/v11/files/00/a9aeaf93dcff7335010e076c3259d3422eb40e730a2e25f50df8ebb5d7944d5f961b6f2a9bf6267a1ce8ca3f97058d3235ae5d6f96ffb0461eabfdcd04e97f @@ -0,0 +1,49 @@ +// tar -x +import * as fsm from '@isaacs/fs-minipass'; +import fs from 'node:fs'; +import { filesFilter } from './list.js'; +import { makeCommand } from './make-command.js'; +import { Unpack, UnpackSync } from './unpack.js'; +const extractFileSync = (opt) => { + const u = new UnpackSync(opt); + const file = opt.file; + const stat = fs.statSync(file); + // This trades a zero-byte read() syscall for a stat + // However, it will usually result in less memory allocation + const readSize = opt.maxReadSize || 16 * 1024 * 1024; + const stream = new fsm.ReadStreamSync(file, { + readSize: readSize, + size: stat.size, + }); + stream.pipe(u); +}; +const extractFile = (opt, _) => { + const u = new Unpack(opt); + const readSize = opt.maxReadSize || 16 * 1024 * 1024; + const file = opt.file; + const p = new Promise((resolve, reject) => { + u.on('error', reject); + u.on('close', resolve); + // This trades a zero-byte read() syscall for a stat + // However, it will usually result in less memory allocation + fs.stat(file, (er, stat) => { + if (er) { + reject(er); + } + else { + const stream = new fsm.ReadStream(file, { + readSize: readSize, + size: stat.size, + }); + stream.on('error', reject); + stream.pipe(u); + } + }); + }); + return p; +}; +export const extract = makeCommand(extractFileSync, extractFile, opt => new UnpackSync(opt), opt => new Unpack(opt), (opt, files) => { + if (files?.length) + filesFilter(opt, files); +}); +//# sourceMappingURL=extract.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/01/24f3a56640c22207461854fd296b20c05588992a4230f8c3ff688dae8dc13ba61a9ceb53c7f61d0e5bae72b91d12eacbadfb8d92349767c3ada106e3dd4b46 b/.pnpm-store/v11/files/01/24f3a56640c22207461854fd296b20c05588992a4230f8c3ff688dae8dc13ba61a9ceb53c7f61d0e5bae72b91d12eacbadfb8d92349767c3ada106e3dd4b46 new file mode 100644 index 0000000000..273b5957b4 --- /dev/null +++ b/.pnpm-store/v11/files/01/24f3a56640c22207461854fd296b20c05588992a4230f8c3ff688dae8dc13ba61a9ceb53c7f61d0e5bae72b91d12eacbadfb8d92349767c3ada106e3dd4b46 @@ -0,0 +1,304 @@ +'use strict' + +const log = require('./log') +const semver = require('semver') +const { execFile } = require('./util') +const win = process.platform === 'win32' + +function getOsUserInfo () { + try { + return require('os').userInfo().username + } catch {} +} + +const systemDrive = process.env.SystemDrive || 'C:' +const username = process.env.USERNAME || process.env.USER || getOsUserInfo() +const localAppData = process.env.LOCALAPPDATA || `${systemDrive}\\${username}\\AppData\\Local` +const foundLocalAppData = process.env.LOCALAPPDATA || username +const programFiles = process.env.ProgramW6432 || process.env.ProgramFiles || `${systemDrive}\\Program Files` +const programFilesX86 = process.env['ProgramFiles(x86)'] || `${programFiles} (x86)` + +const winDefaultLocationsArray = [] +for (const majorMinor of ['311', '310', '39', '38']) { + if (foundLocalAppData) { + winDefaultLocationsArray.push( + `${localAppData}\\Programs\\Python\\Python${majorMinor}\\python.exe`, + `${programFiles}\\Python${majorMinor}\\python.exe`, + `${localAppData}\\Programs\\Python\\Python${majorMinor}-32\\python.exe`, + `${programFiles}\\Python${majorMinor}-32\\python.exe`, + `${programFilesX86}\\Python${majorMinor}-32\\python.exe` + ) + } else { + winDefaultLocationsArray.push( + `${programFiles}\\Python${majorMinor}\\python.exe`, + `${programFiles}\\Python${majorMinor}-32\\python.exe`, + `${programFilesX86}\\Python${majorMinor}-32\\python.exe` + ) + } +} + +class PythonFinder { + static findPython = (...args) => new PythonFinder(...args).findPython() + + log = log.withPrefix('find Python') + argsExecutable = ['-c', 'import sys; sys.stdout.buffer.write(sys.executable.encode(\'utf-8\'));'] + argsVersion = ['-c', 'import sys; print("%s.%s.%s" % sys.version_info[:3]);'] + semverRange = '>=3.6.0' + + // These can be overridden for testing: + execFile = execFile + env = process.env + win = win + pyLauncher = 'py.exe' + winDefaultLocations = winDefaultLocationsArray + + constructor (configPython) { + this.configPython = configPython + this.errorLog = [] + } + + // Logs a message at verbose level, but also saves it to be displayed later + // at error level if an error occurs. This should help diagnose the problem. + addLog (message) { + this.log.verbose(message) + this.errorLog.push(message) + } + + // Find Python by trying a sequence of possibilities. + // Ignore errors, keep trying until Python is found. + async findPython () { + const SKIP = 0 + const FAIL = 1 + const toCheck = (() => { + if (this.env.NODE_GYP_FORCE_PYTHON) { + return [{ + before: () => { + this.addLog( + 'checking Python explicitly set from NODE_GYP_FORCE_PYTHON') + this.addLog('- process.env.NODE_GYP_FORCE_PYTHON is ' + + `"${this.env.NODE_GYP_FORCE_PYTHON}"`) + }, + check: () => this.checkCommand(this.env.NODE_GYP_FORCE_PYTHON) + }] + } + + const checks = [ + { + before: () => { + if (!this.configPython) { + this.addLog('--python was not set on the command line') + return SKIP + } + this.addLog(`--python=${this.configPython} was set on the command line`) + }, + check: () => this.checkCommand(this.configPython) + }, + { + before: () => { + if (!this.env.PYTHON) { + this.addLog('Python is not set from environment variable ' + + 'PYTHON') + return SKIP + } + this.addLog('checking Python explicitly set from environment ' + + 'variable PYTHON') + this.addLog(`- process.env.PYTHON is "${this.env.PYTHON}"`) + }, + check: () => this.checkCommand(this.env.PYTHON) + } + ] + + if (this.win) { + checks.push({ + before: () => { + this.addLog( + 'checking if the py launcher can be used to find Python 3') + }, + check: () => this.checkPyLauncher() + }) + } + + checks.push(...[ + { + before: () => { this.addLog('checking if "python3" can be used') }, + check: () => this.checkCommand('python3') + }, + { + before: () => { this.addLog('checking if "python" can be used') }, + check: () => this.checkCommand('python') + } + ]) + + if (this.win) { + for (let i = 0; i < this.winDefaultLocations.length; ++i) { + const location = this.winDefaultLocations[i] + checks.push({ + before: () => this.addLog(`checking if Python is ${location}`), + check: () => this.checkExecPath(location) + }) + } + } + + return checks + })() + + for (const check of toCheck) { + const before = check.before() + if (before === SKIP) { + continue + } + if (before === FAIL) { + return this.fail() + } + try { + return await check.check() + } catch (err) { + this.log.silly('runChecks: err = %j', (err && err.stack) || err) + } + } + + return this.fail() + } + + // Check if command is a valid Python to use. + // Will exit the Python finder on success. + // If on Windows, run in a CMD shell to support BAT/CMD launchers. + async checkCommand (command) { + let exec = command + let args = this.argsExecutable + let shell = false + if (this.win) { + // Arguments have to be manually quoted + exec = `"${exec}"` + args = args.map(a => `"${a}"`) + shell = true + } + + this.log.verbose(`- executing "${command}" to get executable path`) + // Possible outcomes: + // - Error: not in PATH, not executable or execution fails + // - Gibberish: the next command to check version will fail + // - Absolute path to executable + try { + const execPath = await this.run(exec, args, shell) + this.addLog(`- executable path is "${execPath}"`) + return this.checkExecPath(execPath) + } catch (err) { + this.addLog(`- "${command}" is not in PATH or produced an error`) + throw err + } + } + + // Check if the py launcher can find a valid Python to use. + // Will exit the Python finder on success. + // Distributions of Python on Windows by default install with the "py.exe" + // Python launcher which is more likely to exist than the Python executable + // being in the $PATH. + // Because the Python launcher supports Python 2 and Python 3, we should + // explicitly request a Python 3 version. This is done by supplying "-3" as + // the first command line argument. Since "py.exe -3" would be an invalid + // executable for "execFile", we have to use the launcher to figure out + // where the actual "python.exe" executable is located. + async checkPyLauncher () { + this.log.verbose(`- executing "${this.pyLauncher}" to get Python 3 executable path`) + // Possible outcomes: same as checkCommand + try { + const execPath = await this.run(this.pyLauncher, ['-3', ...this.argsExecutable], false) + this.addLog(`- executable path is "${execPath}"`) + return this.checkExecPath(execPath) + } catch (err) { + this.addLog(`- "${this.pyLauncher}" is not in PATH or produced an error`) + throw err + } + } + + // Check if a Python executable is the correct version to use. + // Will exit the Python finder on success. + async checkExecPath (execPath) { + this.log.verbose(`- executing "${execPath}" to get version`) + // Possible outcomes: + // - Error: executable can not be run (likely meaning the command wasn't + // a Python executable and the previous command produced gibberish) + // - Gibberish: somehow the last command produced an executable path, + // this will fail when verifying the version + // - Version of the Python executable + try { + const version = await this.run(execPath, this.argsVersion, false) + this.addLog(`- version is "${version}"`) + + const range = new semver.Range(this.semverRange) + let valid = false + try { + valid = range.test(version) + } catch (err) { + this.log.silly('range.test() threw:\n%s', err.stack) + this.addLog(`- "${execPath}" does not have a valid version`) + this.addLog('- is it a Python executable?') + throw err + } + if (!valid) { + this.addLog(`- version is ${version} - should be ${this.semverRange}`) + this.addLog('- THIS VERSION OF PYTHON IS NOT SUPPORTED') + throw new Error(`Found unsupported Python version ${version}`) + } + return this.succeed(execPath, version) + } catch (err) { + this.addLog(`- "${execPath}" could not be run`) + throw err + } + } + + // Run an executable or shell command, trimming the output. + async run (exec, args, shell) { + const env = Object.assign({}, this.env) + env.TERM = 'dumb' + const opts = { env, shell } + + this.log.silly('execFile: exec = %j', exec) + this.log.silly('execFile: args = %j', args) + this.log.silly('execFile: opts = %j', opts) + try { + const [err, stdout, stderr] = await this.execFile(exec, args, opts) + this.log.silly('execFile result: err = %j', (err && err.stack) || err) + this.log.silly('execFile result: stdout = %j', stdout) + this.log.silly('execFile result: stderr = %j', stderr) + return stdout.trim() + } catch (err) { + this.log.silly('execFile: threw:\n%s', err.stack) + throw err + } + } + + succeed (execPath, version) { + this.log.info(`using Python version ${version} found at "${execPath}"`) + return execPath + } + + fail () { + const errorLog = this.errorLog.join('\n') + + const pathExample = this.win + ? 'C:\\Path\\To\\python.exe' + : '/path/to/pythonexecutable' + // For Windows 80 col console, use up to the column before the one marked + // with X (total 79 chars including logger prefix, 58 chars usable here): + // X + const info = [ + '**********************************************************', + 'You need to install the latest version of Python.', + 'Node-gyp should be able to find and use Python. If not,', + 'you can try one of the following options:', + `- Use the switch --python="${pathExample}"`, + ' (accepted by both node-gyp and npm)', + '- Set the environment variable PYTHON', + 'For more information consult the documentation at:', + 'https://github.com/nodejs/node-gyp#installation', + '**********************************************************' + ].join('\n') + + this.log.error(`\n${errorLog}\n\n${info}\n`) + throw new Error('Could not find any Python installation to use') + } +} + +module.exports = PythonFinder diff --git a/.pnpm-store/v11/files/01/3557accc49dcb9d890a5ad61d93624baa93c370b0a5e052565708fb1033fa2fbaf3ef0516765cfa21abbb5495df4732165fb4732e259c227584ed1f322c33c b/.pnpm-store/v11/files/01/3557accc49dcb9d890a5ad61d93624baa93c370b0a5e052565708fb1033fa2fbaf3ef0516765cfa21abbb5495df4732165fb4732e259c227584ed1f322c33c new file mode 100644 index 0000000000..1a73546278 --- /dev/null +++ b/.pnpm-store/v11/files/01/3557accc49dcb9d890a5ad61d93624baa93c370b0a5e052565708fb1033fa2fbaf3ef0516765cfa21abbb5495df4732165fb4732e259c227584ed1f322c33c @@ -0,0 +1,63 @@ +{ + "name": "@reflink/reflink", + "version": "0.1.19", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "url": "https://github.com/pnpm/reflink" + }, + "napi": { + "name": "reflink", + "triples": { + "additional": [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "aarch64-pc-windows-msvc", + "x86_64-unknown-linux-musl" + ] + }, + "npmClient": "npm" + }, + "files": [ + "binding.js", + "binding.d.ts", + "index.js", + "index.d.ts" + ], + "license": "MIT", + "devDependencies": { + "@napi-rs/cli": "^2.16.3", + "@types/node": "^20.8.0", + "chalk": "^5.3.0", + "rimraf": "^5.0.5", + "typescript": "^5.2.2", + "vitest": "^0.34.6" + }, + "engines": { + "node": ">= 10" + }, + "scripts": { + "artifacts": "napi artifacts", + "build": "pnpm gen-dts && napi build --js binding.js --dts binding.d.ts --platform --release", + "build:debug": "pnpm gen-dts && napi build --js binding.js --dts binding.d.ts --platform", + "gen-dts": "tsc --checkJs index.js --declaration --emitDeclarationOnly", + "prepublishOnly": "napi prepublish -t npm", + "pretest": "pnpm build", + "test": "cargo t && vitest && rimraf -g __reflink-tests-*", + "bench": "node benchmark.mjs", + "universal": "napi universal", + "version": "napi version" + }, + "packageManager": "pnpm@9.12.3", + "optionalDependencies": { + "@reflink/reflink-win32-x64-msvc": "0.1.19", + "@reflink/reflink-darwin-x64": "0.1.19", + "@reflink/reflink-linux-x64-gnu": "0.1.19", + "@reflink/reflink-darwin-arm64": "0.1.19", + "@reflink/reflink-linux-arm64-gnu": "0.1.19", + "@reflink/reflink-linux-arm64-musl": "0.1.19", + "@reflink/reflink-win32-arm64-msvc": "0.1.19", + "@reflink/reflink-linux-x64-musl": "0.1.19" + } +} \ No newline at end of file diff --git a/.pnpm-store/v11/files/01/417f8e91d649dceb2146f694abda86f2ffae5d35da0976ca4e6a273ef2301fb1b41fcd1a25a83b771dd84d94d04a150bedac58c413c97fa22098ee4d817f9e b/.pnpm-store/v11/files/01/417f8e91d649dceb2146f694abda86f2ffae5d35da0976ca4e6a273ef2301fb1b41fcd1a25a83b771dd84d94d04a150bedac58c413c97fa22098ee4d817f9e new file mode 100644 index 0000000000..a7a4bc3783 --- /dev/null +++ b/.pnpm-store/v11/files/01/417f8e91d649dceb2146f694abda86f2ffae5d35da0976ca4e6a273ef2301fb1b41fcd1a25a83b771dd84d94d04a150bedac58c413c97fa22098ee4d817f9e @@ -0,0 +1,17 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= prepart ( '.' prepart ) * +prepart ::= nr | alphanumid +build ::= buildid ( '.' buildid ) * +alphanumid ::= ( [0-9] ) * [A-Za-z-] [-0-9A-Za-z] * +buildid ::= [-0-9A-Za-z]+ diff --git a/.pnpm-store/v11/files/01/500a5004283cb793e1ff04fc072b5480e66b08b688d5b5288367b82f8df26b3b6653bc4dffd3c84d5f2b8aaa888703252027abd4773659981d14ff06bebab7 b/.pnpm-store/v11/files/01/500a5004283cb793e1ff04fc072b5480e66b08b688d5b5288367b82f8df26b3b6653bc4dffd3c84d5f2b8aaa888703252027abd4773659981d14ff06bebab7 new file mode 100644 index 0000000000..55dba352e9 --- /dev/null +++ b/.pnpm-store/v11/files/01/500a5004283cb793e1ff04fc072b5480e66b08b688d5b5288367b82f8df26b3b6653bc4dffd3c84d5f2b8aaa888703252027abd4773659981d14ff06bebab7 @@ -0,0 +1,152 @@ +'use strict' + +const { kConstruct } = require('./symbols') +const { Cache } = require('./cache') +const { webidl } = require('../fetch/webidl') +const { kEnumerableProperty } = require('../../core/util') + +class CacheStorage { + /** + * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map + * @type {Map} + */ + async has (cacheName) { + webidl.brandCheck(this, CacheStorage) + + const prefix = 'CacheStorage.has' + webidl.argumentLengthCheck(arguments, 1, prefix) + + cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName') + + // 2.1.1 + // 2.2 + return this.#caches.has(cacheName) + } + + /** + * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open + * @param {string} cacheName + * @returns {Promise} + */ + async open (cacheName) { + webidl.brandCheck(this, CacheStorage) + + const prefix = 'CacheStorage.open' + webidl.argumentLengthCheck(arguments, 1, prefix) + + cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName') + + // 2.1 + if (this.#caches.has(cacheName)) { + // await caches.open('v1') !== await caches.open('v1') + + // 2.1.1 + const cache = this.#caches.get(cacheName) + + // 2.1.1.1 + return new Cache(kConstruct, cache) + } + + // 2.2 + const cache = [] + + // 2.3 + this.#caches.set(cacheName, cache) + + // 2.4 + return new Cache(kConstruct, cache) + } + + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete + * @param {string} cacheName + * @returns {Promise} + */ + async delete (cacheName) { + webidl.brandCheck(this, CacheStorage) + + const prefix = 'CacheStorage.delete' + webidl.argumentLengthCheck(arguments, 1, prefix) + + cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName') + + return this.#caches.delete(cacheName) + } + + /** + * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys + * @returns {Promise} + */ + async keys () { + webidl.brandCheck(this, CacheStorage) + + // 2.1 + const keys = this.#caches.keys() + + // 2.2 + return [...keys] + } +} + +Object.defineProperties(CacheStorage.prototype, { + [Symbol.toStringTag]: { + value: 'CacheStorage', + configurable: true + }, + match: kEnumerableProperty, + has: kEnumerableProperty, + open: kEnumerableProperty, + delete: kEnumerableProperty, + keys: kEnumerableProperty +}) + +module.exports = { + CacheStorage +} diff --git a/.pnpm-store/v11/files/03/27c53c217e47d93149eb92af9497a45575f3734d18d799f87389ef7cc512e11cc2e37e475acb9ab761ec91594ca7fa4fa16a52b2f9ed3eb258d1fc0cbfdbef b/.pnpm-store/v11/files/03/27c53c217e47d93149eb92af9497a45575f3734d18d799f87389ef7cc512e11cc2e37e475acb9ab761ec91594ca7fa4fa16a52b2f9ed3eb258d1fc0cbfdbef new file mode 100644 index 0000000000..e9ded40bd5 --- /dev/null +++ b/.pnpm-store/v11/files/03/27c53c217e47d93149eb92af9497a45575f3734d18d799f87389ef7cc512e11cc2e37e475acb9ab761ec91594ca7fa4fa16a52b2f9ed3eb258d1fc0cbfdbef @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=options.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/05/55706682f6c15c401114c190f6787be9b6183c3d97dec0dcc07977535d4ecf74d2c3e1f88948d9c44e87031fd501c6a45e94f0263ec6485e592931be0b06d7 b/.pnpm-store/v11/files/05/55706682f6c15c401114c190f6787be9b6183c3d97dec0dcc07977535d4ecf74d2c3e1f88948d9c44e87031fd501c6a45e94f0263ec6485e592931be0b06d7 new file mode 100644 index 0000000000..609817665e --- /dev/null +++ b/.pnpm-store/v11/files/05/55706682f6c15c401114c190f6787be9b6183c3d97dec0dcc07977535d4ecf74d2c3e1f88948d9c44e87031fd501c6a45e94f0263ec6485e592931be0b06d7 @@ -0,0 +1,12 @@ +'use strict' + +async function rebuild (gyp, argv) { + gyp.todo.push( + { name: 'clean', args: [] } + , { name: 'configure', args: argv } + , { name: 'build', args: [] } + ) +} + +module.exports = rebuild +module.exports.usage = 'Runs "clean", "configure" and "build" all at once' diff --git a/.pnpm-store/v11/files/05/c8ce12fb8eb116902374923084ea6f59ffb09451ab1372f1cbdf795947391130d86e55b603ff248177d37fb4a4751d49c4a93fdf9d6a58dc7e354102c5fa6f b/.pnpm-store/v11/files/05/c8ce12fb8eb116902374923084ea6f59ffb09451ab1372f1cbdf795947391130d86e55b603ff248177d37fb4a4751d49c4a93fdf9d6a58dc7e354102c5fa6f new file mode 100644 index 0000000000..77487dcaac --- /dev/null +++ b/.pnpm-store/v11/files/05/c8ce12fb8eb116902374923084ea6f59ffb09451ab1372f1cbdf795947391130d86e55b603ff248177d37fb4a4751d49c4a93fdf9d6a58dc7e354102c5fa6f @@ -0,0 +1,54 @@ +'use strict' + +const eq = require('./eq') +const neq = require('./neq') +const gt = require('./gt') +const gte = require('./gte') +const lt = require('./lt') +const lte = require('./lte') + +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a === b + + case '!==': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError(`Invalid operator: ${op}`) + } +} +module.exports = cmp diff --git a/.pnpm-store/v11/files/06/550be2aef7224a69307343004a7428f1c70ce74c8a8a4c9dfe5cd95eb0a0434b66cecc73f0577a45cef407d8d4daf9729afd7cf5ba212839752500c371a5e3 b/.pnpm-store/v11/files/06/550be2aef7224a69307343004a7428f1c70ce74c8a8a4c9dfe5cd95eb0a0434b66cecc73f0577a45cef407d8d4daf9729afd7cf5ba212839752500c371a5e3 new file mode 100644 index 0000000000..23dba93c91 Binary files /dev/null and b/.pnpm-store/v11/files/06/550be2aef7224a69307343004a7428f1c70ce74c8a8a4c9dfe5cd95eb0a0434b66cecc73f0577a45cef407d8d4daf9729afd7cf5ba212839752500c371a5e3 differ diff --git a/.pnpm-store/v11/files/06/c0c216654a1df8de5a164ab14152edee872a0c9aa5b7c6f845b1a1f3e62ff464e7097bfb4fda53534d8f1cc100bfd2dea45cfbfa5e40e7b2b3616c80b9d0f6 b/.pnpm-store/v11/files/06/c0c216654a1df8de5a164ab14152edee872a0c9aa5b7c6f845b1a1f3e62ff464e7097bfb4fda53534d8f1cc100bfd2dea45cfbfa5e40e7b2b3616c80b9d0f6 new file mode 100644 index 0000000000..d6fc6c7e38 --- /dev/null +++ b/.pnpm-store/v11/files/06/c0c216654a1df8de5a164ab14152edee872a0c9aa5b7c6f845b1a1f3e62ff464e7097bfb4fda53534d8f1cc100bfd2dea45cfbfa5e40e7b2b3616c80b9d0f6 @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeCommand = void 0; +const options_js_1 = require("./options.js"); +const makeCommand = (syncFile, asyncFile, syncNoFile, asyncNoFile, validate) => { + return Object.assign((opt_ = [], entries, cb) => { + if (Array.isArray(opt_)) { + entries = opt_; + opt_ = {}; + } + if (typeof entries === 'function') { + cb = entries; + entries = undefined; + } + entries = !entries ? [] : Array.from(entries); + const opt = (0, options_js_1.dealias)(opt_); + validate?.(opt, entries); + if ((0, options_js_1.isSyncFile)(opt)) { + if (typeof cb === 'function') { + throw new TypeError('callback not supported for sync tar functions'); + } + return syncFile(opt, entries); + } + else if ((0, options_js_1.isAsyncFile)(opt)) { + const p = asyncFile(opt, entries); + return cb ? p.then(() => cb(), cb) : p; + } + else if ((0, options_js_1.isSyncNoFile)(opt)) { + if (typeof cb === 'function') { + throw new TypeError('callback not supported for sync tar functions'); + } + return syncNoFile(opt, entries); + } + else if ((0, options_js_1.isAsyncNoFile)(opt)) { + if (typeof cb === 'function') { + throw new TypeError('callback only supported with file option'); + } + return asyncNoFile(opt, entries); + /* c8 ignore start */ + } + throw new Error('impossible options??'); + /* c8 ignore stop */ + }, { + syncFile, + asyncFile, + syncNoFile, + asyncNoFile, + validate, + }); +}; +exports.makeCommand = makeCommand; +//# sourceMappingURL=make-command.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/07/65a978806c8f58f1c2410f4eba56e8fe03b3ff0aa8049b7cd31747680c2bc029a9c56634e928365a2d22ad435328d99afbb2df174eface552868f5f5139101 b/.pnpm-store/v11/files/07/65a978806c8f58f1c2410f4eba56e8fe03b3ff0aa8049b7cd31747680c2bc029a9c56634e928365a2d22ad435328d99afbb2df174eface552868f5f5139101 new file mode 100644 index 0000000000..202880132d --- /dev/null +++ b/.pnpm-store/v11/files/07/65a978806c8f58f1c2410f4eba56e8fe03b3ff0aa8049b7cd31747680c2bc029a9c56634e928365a2d22ad435328d99afbb2df174eface552868f5f5139101 @@ -0,0 +1,425 @@ +'use strict' + +const kUndiciError = Symbol.for('undici.error.UND_ERR') +class UndiciError extends Error { + constructor (message) { + super(message) + this.name = 'UndiciError' + this.code = 'UND_ERR' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kUndiciError] === true + } + + [kUndiciError] = true +} + +const kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT') +class ConnectTimeoutError extends UndiciError { + constructor (message) { + super(message) + this.name = 'ConnectTimeoutError' + this.message = message || 'Connect Timeout Error' + this.code = 'UND_ERR_CONNECT_TIMEOUT' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kConnectTimeoutError] === true + } + + [kConnectTimeoutError] = true +} + +const kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT') +class HeadersTimeoutError extends UndiciError { + constructor (message) { + super(message) + this.name = 'HeadersTimeoutError' + this.message = message || 'Headers Timeout Error' + this.code = 'UND_ERR_HEADERS_TIMEOUT' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kHeadersTimeoutError] === true + } + + [kHeadersTimeoutError] = true +} + +const kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW') +class HeadersOverflowError extends UndiciError { + constructor (message) { + super(message) + this.name = 'HeadersOverflowError' + this.message = message || 'Headers Overflow Error' + this.code = 'UND_ERR_HEADERS_OVERFLOW' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kHeadersOverflowError] === true + } + + [kHeadersOverflowError] = true +} + +const kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT') +class BodyTimeoutError extends UndiciError { + constructor (message) { + super(message) + this.name = 'BodyTimeoutError' + this.message = message || 'Body Timeout Error' + this.code = 'UND_ERR_BODY_TIMEOUT' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kBodyTimeoutError] === true + } + + [kBodyTimeoutError] = true +} + +const kResponseStatusCodeError = Symbol.for('undici.error.UND_ERR_RESPONSE_STATUS_CODE') +class ResponseStatusCodeError extends UndiciError { + constructor (message, statusCode, headers, body) { + super(message) + this.name = 'ResponseStatusCodeError' + this.message = message || 'Response Status Code Error' + this.code = 'UND_ERR_RESPONSE_STATUS_CODE' + this.body = body + this.status = statusCode + this.statusCode = statusCode + this.headers = headers + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kResponseStatusCodeError] === true + } + + [kResponseStatusCodeError] = true +} + +const kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG') +class InvalidArgumentError extends UndiciError { + constructor (message) { + super(message) + this.name = 'InvalidArgumentError' + this.message = message || 'Invalid Argument Error' + this.code = 'UND_ERR_INVALID_ARG' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kInvalidArgumentError] === true + } + + [kInvalidArgumentError] = true +} + +const kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE') +class InvalidReturnValueError extends UndiciError { + constructor (message) { + super(message) + this.name = 'InvalidReturnValueError' + this.message = message || 'Invalid Return Value Error' + this.code = 'UND_ERR_INVALID_RETURN_VALUE' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kInvalidReturnValueError] === true + } + + [kInvalidReturnValueError] = true +} + +const kAbortError = Symbol.for('undici.error.UND_ERR_ABORT') +class AbortError extends UndiciError { + constructor (message) { + super(message) + this.name = 'AbortError' + this.message = message || 'The operation was aborted' + this.code = 'UND_ERR_ABORT' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kAbortError] === true + } + + [kAbortError] = true +} + +const kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED') +class RequestAbortedError extends AbortError { + constructor (message) { + super(message) + this.name = 'AbortError' + this.message = message || 'Request aborted' + this.code = 'UND_ERR_ABORTED' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kRequestAbortedError] === true + } + + [kRequestAbortedError] = true +} + +const kInformationalError = Symbol.for('undici.error.UND_ERR_INFO') +class InformationalError extends UndiciError { + constructor (message) { + super(message) + this.name = 'InformationalError' + this.message = message || 'Request information' + this.code = 'UND_ERR_INFO' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kInformationalError] === true + } + + [kInformationalError] = true +} + +const kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH') +class RequestContentLengthMismatchError extends UndiciError { + constructor (message) { + super(message) + this.name = 'RequestContentLengthMismatchError' + this.message = message || 'Request body length does not match content-length header' + this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kRequestContentLengthMismatchError] === true + } + + [kRequestContentLengthMismatchError] = true +} + +const kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH') +class ResponseContentLengthMismatchError extends UndiciError { + constructor (message) { + super(message) + this.name = 'ResponseContentLengthMismatchError' + this.message = message || 'Response body length does not match content-length header' + this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kResponseContentLengthMismatchError] === true + } + + [kResponseContentLengthMismatchError] = true +} + +const kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED') +class ClientDestroyedError extends UndiciError { + constructor (message) { + super(message) + this.name = 'ClientDestroyedError' + this.message = message || 'The client is destroyed' + this.code = 'UND_ERR_DESTROYED' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kClientDestroyedError] === true + } + + [kClientDestroyedError] = true +} + +const kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED') +class ClientClosedError extends UndiciError { + constructor (message) { + super(message) + this.name = 'ClientClosedError' + this.message = message || 'The client is closed' + this.code = 'UND_ERR_CLOSED' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kClientClosedError] === true + } + + [kClientClosedError] = true +} + +const kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET') +class SocketError extends UndiciError { + constructor (message, socket) { + super(message) + this.name = 'SocketError' + this.message = message || 'Socket error' + this.code = 'UND_ERR_SOCKET' + this.socket = socket + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kSocketError] === true + } + + [kSocketError] = true +} + +const kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED') +class NotSupportedError extends UndiciError { + constructor (message) { + super(message) + this.name = 'NotSupportedError' + this.message = message || 'Not supported error' + this.code = 'UND_ERR_NOT_SUPPORTED' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kNotSupportedError] === true + } + + [kNotSupportedError] = true +} + +const kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM') +class BalancedPoolMissingUpstreamError extends UndiciError { + constructor (message) { + super(message) + this.name = 'MissingUpstreamError' + this.message = message || 'No upstream has been added to the BalancedPool' + this.code = 'UND_ERR_BPL_MISSING_UPSTREAM' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kBalancedPoolMissingUpstreamError] === true + } + + [kBalancedPoolMissingUpstreamError] = true +} + +const kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER') +class HTTPParserError extends Error { + constructor (message, code, data) { + super(message) + this.name = 'HTTPParserError' + this.code = code ? `HPE_${code}` : undefined + this.data = data ? data.toString() : undefined + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kHTTPParserError] === true + } + + [kHTTPParserError] = true +} + +const kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE') +class ResponseExceededMaxSizeError extends UndiciError { + constructor (message) { + super(message) + this.name = 'ResponseExceededMaxSizeError' + this.message = message || 'Response content exceeded max size' + this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kResponseExceededMaxSizeError] === true + } + + [kResponseExceededMaxSizeError] = true +} + +const kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY') +class RequestRetryError extends UndiciError { + constructor (message, code, { headers, data }) { + super(message) + this.name = 'RequestRetryError' + this.message = message || 'Request retry error' + this.code = 'UND_ERR_REQ_RETRY' + this.statusCode = code + this.data = data + this.headers = headers + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kRequestRetryError] === true + } + + [kRequestRetryError] = true +} + +const kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE') +class ResponseError extends UndiciError { + constructor (message, code, { headers, data }) { + super(message) + this.name = 'ResponseError' + this.message = message || 'Response error' + this.code = 'UND_ERR_RESPONSE' + this.statusCode = code + this.data = data + this.headers = headers + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kResponseError] === true + } + + [kResponseError] = true +} + +const kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS') +class SecureProxyConnectionError extends UndiciError { + constructor (cause, message, options) { + super(message, { cause, ...(options ?? {}) }) + this.name = 'SecureProxyConnectionError' + this.message = message || 'Secure Proxy Connection failed' + this.code = 'UND_ERR_PRX_TLS' + this.cause = cause + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kSecureProxyConnectionError] === true + } + + [kSecureProxyConnectionError] = true +} + +const kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED') +class MessageSizeExceededError extends UndiciError { + constructor (message) { + super(message) + this.name = 'MessageSizeExceededError' + this.message = message || 'Max decompressed message size exceeded' + this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED' + } + + static [Symbol.hasInstance] (instance) { + return instance && instance[kMessageSizeExceededError] === true + } + + get [kMessageSizeExceededError] () { + return true + } +} + +module.exports = { + AbortError, + HTTPParserError, + UndiciError, + HeadersTimeoutError, + HeadersOverflowError, + BodyTimeoutError, + RequestContentLengthMismatchError, + ConnectTimeoutError, + ResponseStatusCodeError, + InvalidArgumentError, + InvalidReturnValueError, + RequestAbortedError, + ClientDestroyedError, + ClientClosedError, + InformationalError, + SocketError, + NotSupportedError, + ResponseContentLengthMismatchError, + BalancedPoolMissingUpstreamError, + ResponseExceededMaxSizeError, + RequestRetryError, + ResponseError, + SecureProxyConnectionError, + MessageSizeExceededError +} diff --git a/.pnpm-store/v11/files/07/b67dfc4b3bc9f7b61182d8e14ace36da090dcf1c9ed0da6027ce1d33cd0f3601c43ff8a4b74f6bd19d034e1c0c0335b454a86b3f71052259f4709b50143174 b/.pnpm-store/v11/files/07/b67dfc4b3bc9f7b61182d8e14ace36da090dcf1c9ed0da6027ce1d33cd0f3601c43ff8a4b74f6bd19d034e1c0c0335b454a86b3f71052259f4709b50143174 new file mode 100644 index 0000000000..5438127208 --- /dev/null +++ b/.pnpm-store/v11/files/07/b67dfc4b3bc9f7b61182d8e14ace36da090dcf1c9ed0da6027ce1d33cd0f3601c43ff8a4b74f6bd19d034e1c0c0335b454a86b3f71052259f4709b50143174 @@ -0,0 +1,350 @@ +'use strict' + +const debug = require('../internal/debug') +const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') +const { safeRe: re, t } = require('../internal/re') + +const parseOptions = require('../internal/parse-options') +const { compareIdentifiers } = require('../internal/identifiers') + +const isPrereleaseIdentifier = (prerelease, identifier) => { + const identifiers = identifier.split('.') + if (identifiers.length > prerelease.length) { + return false + } + + for (let i = 0; i < identifiers.length; i++) { + if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) { + return false + } + } + + return true +} + +class SemVer { + constructor (version, options) { + options = parseOptions(options) + + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } + + if (other.version === this.version) { + return 0 + } + + return this.compareMain(other) || this.comparePre(other) + } + + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + if (this.major < other.major) { + return -1 + } + if (this.major > other.major) { + return 1 + } + if (this.minor < other.minor) { + return -1 + } + if (this.minor > other.minor) { + return 1 + } + if (this.patch < other.patch) { + return -1 + } + if (this.patch > other.patch) { + return 1 + } + return 0 + } + + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('build compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier, identifierBase) { + if (release.startsWith('pre')) { + if (!identifier && identifierBase === false) { + throw new Error('invalid increment argument: identifier is empty') + } + // Avoid an invalid semver results + if (identifier) { + const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]) + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`) + } + } + } + + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier, identifierBase) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier, identifierBase) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier, identifierBase) + this.inc('pre', identifier, identifierBase) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier, identifierBase) + } + this.inc('pre', identifier, identifierBase) + break + case 'release': + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`) + } + this.prerelease.length = 0 + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': { + const base = Number(identifierBase) ? 1 : 0 + + if (this.prerelease.length === 0) { + this.prerelease = [base] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + if (identifier === this.prerelease.join('.') && identifierBase === false) { + throw new Error('invalid increment argument: identifier already exists') + } + this.prerelease.push(base) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + let prerelease = [identifier, base] + if (identifierBase === false) { + prerelease = [identifier] + } + if (isPrereleaseIdentifier(this.prerelease, identifier)) { + const prereleaseBase = this.prerelease[identifier.split('.').length] + if (isNaN(prereleaseBase)) { + this.prerelease = prerelease + } + } else { + this.prerelease = prerelease + } + } + break + } + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.raw = this.format() + if (this.build.length) { + this.raw += `+${this.build.join('.')}` + } + return this + } +} + +module.exports = SemVer diff --git a/.pnpm-store/v11/files/08/2138df4ad074bc6d65e072331db84744a7ef705b4cd17b6dd35d43c3c7551fddd74fd9c4e38fa6e9b330a07a82df3b64de35225093f68dd274cbf04973f545 b/.pnpm-store/v11/files/08/2138df4ad074bc6d65e072331db84744a7ef705b4cd17b6dd35d43c3c7551fddd74fd9c4e38fa6e9b330a07a82df3b64de35225093f68dd274cbf04973f545 new file mode 100644 index 0000000000..b8fe1db504 --- /dev/null +++ b/.pnpm-store/v11/files/08/2138df4ad074bc6d65e072331db84744a7ef705b4cd17b6dd35d43c3c7551fddd74fd9c4e38fa6e9b330a07a82df3b64de35225093f68dd274cbf04973f545 @@ -0,0 +1,8 @@ +'use strict' + +const parse = require('./parse') +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease diff --git a/.pnpm-store/v11/files/08/39803cb3c423c79ff53c967c5e1510d82c7ef23c17c96501e569bf71031cd1ed413a460758429aa24ec31a3c09014bbb58d744279271341f11917f119248dd b/.pnpm-store/v11/files/08/39803cb3c423c79ff53c967c5e1510d82c7ef23c17c96501e569bf71031cd1ed413a460758429aa24ec31a3c09014bbb58d744279271341f11917f119248dd new file mode 100644 index 0000000000..cce5ff80b0 --- /dev/null +++ b/.pnpm-store/v11/files/08/39803cb3c423c79ff53c967c5e1510d82c7ef23c17c96501e569bf71031cd1ed413a460758429aa24ec31a3c09014bbb58d744279271341f11917f119248dd @@ -0,0 +1,25 @@ +// unix absolute paths are also absolute on win32, so we use this for both +import { win32 } from 'node:path'; +const { isAbsolute, parse } = win32; +// returns [root, stripped] +// Note that windows will think that //x/y/z/a has a "root" of //x/y, and in +// those cases, we want to sanitize it to x/y/z/a, not z/a, so we strip / +// explicitly if it's the first character. +// drive-specific relative paths on Windows get their root stripped off even +// though they are not absolute, so `c:../foo` becomes ['c:', '../foo'] +export const stripAbsolutePath = (path) => { + let r = ''; + let parsed = parse(path); + while (isAbsolute(path) || parsed.root) { + // windows will think that //x/y/z has a "root" of //x/y/ + // but strip the //?/C:/ off of //?/C:/path + const root = path.charAt(0) === '/' && path.slice(0, 4) !== '//?/' ? + '/' + : parsed.root; + path = path.slice(root.length); + r += root; + parsed = parse(path); + } + return [r, path]; +}; +//# sourceMappingURL=strip-absolute-path.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/09/32671774c543ee463e200aeac258b8b4585d3a9336465f3d04a8d90bc8f47bec07a5c6bf31519b18828ceaa44059485fbd5284fbcec10f567ded5a005df2d9 b/.pnpm-store/v11/files/09/32671774c543ee463e200aeac258b8b4585d3a9336465f3d04a8d90bc8f47bec07a5c6bf31519b18828ceaa44059485fbd5284fbcec10f567ded5a005df2d9 new file mode 100644 index 0000000000..441c9cc303 --- /dev/null +++ b/.pnpm-store/v11/files/09/32671774c543ee463e200aeac258b8b4585d3a9336465f3d04a8d90bc8f47bec07a5c6bf31519b18828ceaa44059485fbd5284fbcec10f567ded5a005df2d9 @@ -0,0 +1,514 @@ +const abbrev = require('abbrev') +const debug = require('./debug') +const defaultTypeDefs = require('./type-defs') + +const hasOwn = (o, k) => Object.prototype.hasOwnProperty.call(o, k) + +const getType = (k, { types, dynamicTypes }) => { + let hasType = hasOwn(types, k) + let type = types[k] + if (!hasType && typeof dynamicTypes === 'function') { + const matchedType = dynamicTypes(k) + if (matchedType !== undefined) { + type = matchedType + hasType = true + } + } + return [hasType, type] +} + +const isTypeDef = (type, def) => def && type === def +const hasTypeDef = (type, def) => def && type.indexOf(def) !== -1 +const doesNotHaveTypeDef = (type, def) => def && !hasTypeDef(type, def) + +function nopt (args, { + types, + shorthands, + typeDefs, + invalidHandler, // opt is configured but its value does not validate against given type + unknownHandler, // opt is not configured + abbrevHandler, // opt is being expanded via abbrev + typeDefault, + dynamicTypes, +} = {}) { + debug(types, shorthands, args, typeDefs) + + const data = {} + const argv = { + remain: [], + cooked: args, + original: args.slice(0), + } + + parse(args, data, argv.remain, { + typeDefs, types, dynamicTypes, shorthands, unknownHandler, abbrevHandler, + }) + + // now data is full + clean(data, { types, dynamicTypes, typeDefs, invalidHandler, typeDefault }) + data.argv = argv + + Object.defineProperty(data.argv, 'toString', { + value: function () { + return this.original.map(JSON.stringify).join(' ') + }, + enumerable: false, + }) + + return data +} + +function clean (data, { + types = {}, + typeDefs = {}, + dynamicTypes, + invalidHandler, + typeDefault, +} = {}) { + const StringType = typeDefs.String?.type + const NumberType = typeDefs.Number?.type + const ArrayType = typeDefs.Array?.type + const BooleanType = typeDefs.Boolean?.type + const DateType = typeDefs.Date?.type + + const hasTypeDefault = typeof typeDefault !== 'undefined' + if (!hasTypeDefault) { + typeDefault = [false, true, null] + if (StringType) { + typeDefault.push(StringType) + } + if (ArrayType) { + typeDefault.push(ArrayType) + } + } + + const remove = {} + + Object.keys(data).forEach((k) => { + if (k === 'argv') { + return + } + let val = data[k] + debug('val=%j', val) + const isArray = Array.isArray(val) + let [hasType, rawType] = getType(k, { types, dynamicTypes }) + let type = rawType + if (!isArray) { + val = [val] + } + if (!type) { + type = typeDefault + } + if (isTypeDef(type, ArrayType)) { + type = typeDefault.concat(ArrayType) + } + if (!Array.isArray(type)) { + type = [type] + } + + debug('val=%j', val) + debug('types=', type) + val = val.map((v) => { + // if it's an unknown value, then parse false/true/null/numbers/dates + if (typeof v === 'string') { + debug('string %j', v) + v = v.trim() + if ((v === 'null' && ~type.indexOf(null)) + || (v === 'true' && + (~type.indexOf(true) || hasTypeDef(type, BooleanType))) + || (v === 'false' && + (~type.indexOf(false) || hasTypeDef(type, BooleanType)))) { + v = JSON.parse(v) + debug('jsonable %j', v) + } else if (hasTypeDef(type, NumberType) && !isNaN(v)) { + debug('convert to number', v) + v = +v + } else if (hasTypeDef(type, DateType) && !isNaN(Date.parse(v))) { + debug('convert to date', v) + v = new Date(v) + } + } + + if (!hasType) { + if (!hasTypeDefault) { + return v + } + // if the default type has been passed in then we want to validate the + // unknown data key instead of bailing out earlier. we also set the raw + // type which is passed to the invalid handler so that it can be + // determined if during validation if it is unknown vs invalid + rawType = typeDefault + } + + // allow `--no-blah` to set 'blah' to null if null is allowed + if (v === false && ~type.indexOf(null) && + !(~type.indexOf(false) || hasTypeDef(type, BooleanType))) { + v = null + } + + const d = {} + d[k] = v + debug('prevalidated val', d, v, rawType) + if (!validate(d, k, v, rawType, { typeDefs })) { + if (invalidHandler) { + invalidHandler(k, v, rawType, data) + } else if (invalidHandler !== false) { + debug('invalid: ' + k + '=' + v, rawType) + } + return remove + } + debug('validated v', d, v, rawType) + return d[k] + }).filter((v) => v !== remove) + + // if we allow Array specifically, then an empty array is how we + // express 'no value here', not null. Allow it. + if (!val.length && doesNotHaveTypeDef(type, ArrayType)) { + debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(ArrayType)) + delete data[k] + } else if (isArray) { + debug(isArray, data[k], val) + data[k] = val + } else { + data[k] = val[0] + } + + debug('k=%s val=%j', k, val, data[k]) + }) +} + +function validate (data, k, val, type, { typeDefs } = {}) { + const ArrayType = typeDefs?.Array?.type + // arrays are lists of types. + if (Array.isArray(type)) { + for (let i = 0, l = type.length; i < l; i++) { + if (isTypeDef(type[i], ArrayType)) { + continue + } + if (validate(data, k, val, type[i], { typeDefs })) { + return true + } + } + delete data[k] + return false + } + + // an array of anything? + if (isTypeDef(type, ArrayType)) { + return true + } + + // Original comment: + // NaN is poisonous. Means that something is not allowed. + // New comment: Changing this to an isNaN check breaks a lot of tests. + // Something is being assumed here that is not actually what happens in + // practice. Fixing it is outside the scope of getting linting to pass in + // this repo. Leaving as-is for now. + /* eslint-disable-next-line no-self-compare */ + if (type !== type) { + debug('Poison NaN', k, val, type) + delete data[k] + return false + } + + // explicit list of values + if (val === type) { + debug('Explicitly allowed %j', val) + data[k] = val + return true + } + + // now go through the list of typeDefs, validate against each one. + let ok = false + const types = Object.keys(typeDefs) + for (let i = 0, l = types.length; i < l; i++) { + debug('test type %j %j %j', k, val, types[i]) + const t = typeDefs[types[i]] + if (t && ( + (type && type.name && t.type && t.type.name) ? + (type.name === t.type.name) : + (type === t.type) + )) { + const d = {} + ok = t.validate(d, k, val) !== false + val = d[k] + if (ok) { + data[k] = val + break + } + } + } + debug('OK? %j (%j %j %j)', ok, k, val, types[types.length - 1]) + + if (!ok) { + delete data[k] + } + return ok +} + +function parse (args, data, remain, { + types = {}, + typeDefs = {}, + shorthands = {}, + dynamicTypes, + unknownHandler, + abbrevHandler, +} = {}) { + const StringType = typeDefs.String?.type + const NumberType = typeDefs.Number?.type + const ArrayType = typeDefs.Array?.type + const BooleanType = typeDefs.Boolean?.type + + debug('parse', args, data, remain) + + const abbrevs = abbrev(Object.keys(types)) + debug('abbrevs=%j', abbrevs) + const shortAbbr = abbrev(Object.keys(shorthands)) + + for (let i = 0; i < args.length; i++) { + let arg = args[i] + debug('arg', arg) + + if (arg.match(/^-{2,}$/)) { + // done with keys. + // the rest are args. + remain.push.apply(remain, args.slice(i + 1)) + args[i] = '--' + break + } + let hadEq = false + if (arg.charAt(0) === '-' && arg.length > 1) { + const at = arg.indexOf('=') + if (at > -1) { + hadEq = true + const v = arg.slice(at + 1) + arg = arg.slice(0, at) + args.splice(i, 1, arg, v) + } + + // see if it's a shorthand + // if so, splice and back up to re-parse it. + const shRes = resolveShort(arg, shortAbbr, abbrevs, { shorthands, abbrevHandler }) + debug('arg=%j shRes=%j', arg, shRes) + if (shRes) { + args.splice.apply(args, [i, 1].concat(shRes)) + if (arg !== shRes[0]) { + i-- + continue + } + } + arg = arg.replace(/^-+/, '') + let no = null + while (arg.toLowerCase().indexOf('no-') === 0) { + no = !no + arg = arg.slice(3) + } + + // abbrev includes the original full string in its abbrev list + if (abbrevs[arg] && abbrevs[arg] !== arg) { + if (abbrevHandler) { + abbrevHandler(arg, abbrevs[arg]) + } else if (abbrevHandler !== false) { + debug(`abbrev: ${arg} -> ${abbrevs[arg]}`) + } + arg = abbrevs[arg] + } + + let [hasType, argType] = getType(arg, { types, dynamicTypes }) + let isTypeArray = Array.isArray(argType) + if (isTypeArray && argType.length === 1) { + isTypeArray = false + argType = argType[0] + } + + let isArray = isTypeDef(argType, ArrayType) || + isTypeArray && hasTypeDef(argType, ArrayType) + + // allow unknown things to be arrays if specified multiple times. + if (!hasType && hasOwn(data, arg)) { + if (!Array.isArray(data[arg])) { + data[arg] = [data[arg]] + } + isArray = true + } + + let val + let la = args[i + 1] + + const isBool = typeof no === 'boolean' || + isTypeDef(argType, BooleanType) || + isTypeArray && hasTypeDef(argType, BooleanType) || + (typeof argType === 'undefined' && !hadEq) || + (la === 'false' && + (argType === null || + isTypeArray && ~argType.indexOf(null))) + + if (typeof argType === 'undefined') { + // la is going to unexpectedly be parsed outside the context of this arg + const hangingLa = !hadEq && la && !la?.startsWith('-') && !['true', 'false'].includes(la) + if (unknownHandler) { + if (hangingLa) { + unknownHandler(arg, la) + } else { + unknownHandler(arg) + } + } else if (unknownHandler !== false) { + debug(`unknown: ${arg}`) + if (hangingLa) { + debug(`unknown: ${la} parsed as normal opt`) + } + } + } + + if (isBool) { + // just set and move along + val = !no + // however, also support --bool true or --bool false + if (la === 'true' || la === 'false') { + val = JSON.parse(la) + la = null + if (no) { + val = !val + } + i++ + } + + // also support "foo":[Boolean, "bar"] and "--foo bar" + if (isTypeArray && la) { + if (~argType.indexOf(la)) { + // an explicit type + val = la + i++ + } else if (la === 'null' && ~argType.indexOf(null)) { + // null allowed + val = null + i++ + } else if (!la.match(/^-{2,}[^-]/) && + !isNaN(la) && + hasTypeDef(argType, NumberType)) { + // number + val = +la + i++ + } else if (!la.match(/^-[^-]/) && hasTypeDef(argType, StringType)) { + // string + val = la + i++ + } + } + + if (isArray) { + (data[arg] = data[arg] || []).push(val) + } else { + data[arg] = val + } + + continue + } + + if (isTypeDef(argType, StringType)) { + if (la === undefined) { + la = '' + } else if (la.match(/^-{1,2}[^-]+/)) { + la = '' + i-- + } + } + + if (la && la.match(/^-{2,}$/)) { + la = undefined + i-- + } + + val = la === undefined ? true : la + if (isArray) { + (data[arg] = data[arg] || []).push(val) + } else { + data[arg] = val + } + + i++ + continue + } + remain.push(arg) + } +} + +const SINGLES = Symbol('singles') +const singleCharacters = (arg, shorthands) => { + let singles = shorthands[SINGLES] + if (!singles) { + singles = Object.keys(shorthands).filter((s) => s.length === 1).reduce((l, r) => { + l[r] = true + return l + }, {}) + shorthands[SINGLES] = singles + debug('shorthand singles', singles) + } + const chrs = arg.split('').filter((c) => singles[c]) + return chrs.join('') === arg ? chrs : null +} + +function resolveShort (arg, ...rest) { + const { abbrevHandler, types = {}, shorthands = {} } = rest.length ? rest.pop() : {} + const shortAbbr = rest[0] ?? abbrev(Object.keys(shorthands)) + const abbrevs = rest[1] ?? abbrev(Object.keys(types)) + + // handle single-char shorthands glommed together, like + // npm ls -glp, but only if there is one dash, and only if + // all of the chars are single-char shorthands, and it's + // not a match to some other abbrev. + arg = arg.replace(/^-+/, '') + + // if it's an exact known option, then don't go any further + if (abbrevs[arg] === arg) { + return null + } + + // if it's an exact known shortopt, same deal + if (shorthands[arg]) { + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) { + shorthands[arg] = shorthands[arg].split(/\s+/) + } + + return shorthands[arg] + } + + // first check to see if this arg is a set of single-char shorthands + const chrs = singleCharacters(arg, shorthands) + if (chrs) { + return chrs.map((c) => shorthands[c]).reduce((l, r) => l.concat(r), []) + } + + // if it's an arg abbrev, and not a literal shorthand, then prefer the arg + if (abbrevs[arg] && !shorthands[arg]) { + return null + } + + // if it's an abbr for a shorthand, then use that + // exact match has already happened so we don't need to account for that here + if (shortAbbr[arg]) { + if (abbrevHandler) { + abbrevHandler(arg, shortAbbr[arg]) + } else if (abbrevHandler !== false) { + debug(`abbrev: ${arg} -> ${shortAbbr[arg]}`) + } + arg = shortAbbr[arg] + } + + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) { + shorthands[arg] = shorthands[arg].split(/\s+/) + } + + return shorthands[arg] +} + +module.exports = { + nopt, + clean, + parse, + validate, + resolveShort, + typeDefs: defaultTypeDefs, +} diff --git a/.pnpm-store/v11/files/09/b2babc669c70e37ec7f37894f1613516c9292e5d77bf7c362ae913b74d1aa49933277d6462e9087e476c7b0a77bca010943d4e0bcb2701dcfac6999bc4c76f b/.pnpm-store/v11/files/09/b2babc669c70e37ec7f37894f1613516c9292e5d77bf7c362ae913b74d1aa49933277d6462e9087e476c7b0a77bca010943d4e0bcb2701dcfac6999bc4c76f new file mode 100644 index 0000000000..49f7efe431 --- /dev/null +++ b/.pnpm-store/v11/files/09/b2babc669c70e37ec7f37894f1613516c9292e5d77bf7c362ae913b74d1aa49933277d6462e9087e476c7b0a77bca010943d4e0bcb2701dcfac6999bc4c76f @@ -0,0 +1,26 @@ +Minizlib was created by Isaac Z. Schlueter. +It is a derivative work of the Node.js project. + +""" +Copyright (c) 2017-2023 Isaac Z. Schlueter and Contributors +Copyright (c) 2017-2023 Node.js contributors. All rights reserved. +Copyright (c) 2017-2023 Joyent, Inc. and other Node contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +""" diff --git a/.pnpm-store/v11/files/09/bcd16c2dac993637ae2abf3551a4fa73d1d76a5aa1fba4a72973e664640ace24ca874542913b68a0b2679832744c6a42efbb9935162de7a18bcd8e97e0dabb b/.pnpm-store/v11/files/09/bcd16c2dac993637ae2abf3551a4fa73d1d76a5aa1fba4a72973e664640ace24ca874542913b68a0b2679832744c6a42efbb9935162de7a18bcd8e97e0dabb new file mode 100644 index 0000000000..49dd727961 --- /dev/null +++ b/.pnpm-store/v11/files/09/bcd16c2dac993637ae2abf3551a4fa73d1d76a5aa1fba4a72973e664640ace24ca874542913b68a0b2679832744c6a42efbb9935162de7a18bcd8e97e0dabb @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.modeFix = void 0; +const modeFix = (mode, isDir, portable) => { + mode &= 0o7777; + // in portable mode, use the minimum reasonable umask + // if this system creates files with 0o664 by default + // (as some linux distros do), then we'll write the + // archive with 0o644 instead. Also, don't ever create + // a file that is not readable/writable by the owner. + if (portable) { + mode = (mode | 0o600) & ~0o22; + } + // if dirs are readable, then they should be listable + if (isDir) { + if (mode & 0o400) { + mode |= 0o100; + } + if (mode & 0o40) { + mode |= 0o10; + } + if (mode & 0o4) { + mode |= 0o1; + } + } + return mode; +}; +exports.modeFix = modeFix; +//# sourceMappingURL=mode-fix.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/09/fef9dfbbddf1c45ef9cdfa8aed30fa8d50d5019118f4119b8729ae30e2ca7f7772e682341462c5673d2b781359e0f8bbfaf0072eadef898919893417211273 b/.pnpm-store/v11/files/09/fef9dfbbddf1c45ef9cdfa8aed30fa8d50d5019118f4119b8729ae30e2ca7f7772e682341462c5673d2b781359e0f8bbfaf0072eadef898919893417211273 new file mode 100644 index 0000000000..5101324a80 --- /dev/null +++ b/.pnpm-store/v11/files/09/fef9dfbbddf1c45ef9cdfa8aed30fa8d50d5019118f4119b8729ae30e2ca7f7772e682341462c5673d2b781359e0f8bbfaf0072eadef898919893417211273 @@ -0,0 +1,1632 @@ +'use strict' + +const { Transform } = require('node:stream') +const zlib = require('node:zlib') +const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require('./constants') +const { getGlobalOrigin } = require('./global') +const { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require('./data-url') +const { performance } = require('node:perf_hooks') +const { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require('../../core/util') +const assert = require('node:assert') +const { isUint8Array } = require('node:util/types') +const { webidl } = require('./webidl') + +let supportedHashes = [] + +// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable +/** @type {import('crypto')} */ +let crypto +try { + crypto = require('node:crypto') + const possibleRelevantHashes = ['sha256', 'sha384', 'sha512'] + supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)) +/* c8 ignore next 3 */ +} catch { + +} + +function responseURL (response) { + // https://fetch.spec.whatwg.org/#responses + // A response has an associated URL. It is a pointer to the last URL + // in response’s URL list and null if response’s URL list is empty. + const urlList = response.urlList + const length = urlList.length + return length === 0 ? null : urlList[length - 1].toString() +} + +// https://fetch.spec.whatwg.org/#concept-response-location-url +function responseLocationURL (response, requestFragment) { + // 1. If response’s status is not a redirect status, then return null. + if (!redirectStatusSet.has(response.status)) { + return null + } + + // 2. Let location be the result of extracting header list values given + // `Location` and response’s header list. + let location = response.headersList.get('location', true) + + // 3. If location is a header value, then set location to the result of + // parsing location with response’s URL. + if (location !== null && isValidHeaderValue(location)) { + if (!isValidEncodedURL(location)) { + // Some websites respond location header in UTF-8 form without encoding them as ASCII + // and major browsers redirect them to correctly UTF-8 encoded addresses. + // Here, we handle that behavior in the same way. + location = normalizeBinaryStringToUtf8(location) + } + location = new URL(location, responseURL(response)) + } + + // 4. If location is a URL whose fragment is null, then set location’s + // fragment to requestFragment. + if (location && !location.hash) { + location.hash = requestFragment + } + + // 5. Return location. + return location +} + +/** + * @see https://www.rfc-editor.org/rfc/rfc1738#section-2.2 + * @param {string} url + * @returns {boolean} + */ +function isValidEncodedURL (url) { + for (let i = 0; i < url.length; ++i) { + const code = url.charCodeAt(i) + + if ( + code > 0x7E || // Non-US-ASCII + DEL + code < 0x20 // Control characters NUL - US + ) { + return false + } + } + return true +} + +/** + * If string contains non-ASCII characters, assumes it's UTF-8 encoded and decodes it. + * Since UTF-8 is a superset of ASCII, this will work for ASCII strings as well. + * @param {string} value + * @returns {string} + */ +function normalizeBinaryStringToUtf8 (value) { + return Buffer.from(value, 'binary').toString('utf8') +} + +/** @returns {URL} */ +function requestCurrentURL (request) { + return request.urlList[request.urlList.length - 1] +} + +function requestBadPort (request) { + // 1. Let url be request’s current URL. + const url = requestCurrentURL(request) + + // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port, + // then return blocked. + if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) { + return 'blocked' + } + + // 3. Return allowed. + return 'allowed' +} + +function isErrorLike (object) { + return object instanceof Error || ( + object?.constructor?.name === 'Error' || + object?.constructor?.name === 'DOMException' + ) +} + +// Check whether |statusText| is a ByteString and +// matches the Reason-Phrase token production. +// RFC 2616: https://tools.ietf.org/html/rfc2616 +// RFC 7230: https://tools.ietf.org/html/rfc7230 +// "reason-phrase = *( HTAB / SP / VCHAR / obs-text )" +// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116 +function isValidReasonPhrase (statusText) { + for (let i = 0; i < statusText.length; ++i) { + const c = statusText.charCodeAt(i) + if ( + !( + ( + c === 0x09 || // HTAB + (c >= 0x20 && c <= 0x7e) || // SP / VCHAR + (c >= 0x80 && c <= 0xff) + ) // obs-text + ) + ) { + return false + } + } + return true +} + +/** + * @see https://fetch.spec.whatwg.org/#header-name + * @param {string} potentialValue + */ +const isValidHeaderName = isValidHTTPToken + +/** + * @see https://fetch.spec.whatwg.org/#header-value + * @param {string} potentialValue + */ +function isValidHeaderValue (potentialValue) { + // - Has no leading or trailing HTTP tab or space bytes. + // - Contains no 0x00 (NUL) or HTTP newline bytes. + return ( + potentialValue[0] === '\t' || + potentialValue[0] === ' ' || + potentialValue[potentialValue.length - 1] === '\t' || + potentialValue[potentialValue.length - 1] === ' ' || + potentialValue.includes('\n') || + potentialValue.includes('\r') || + potentialValue.includes('\0') + ) === false +} + +// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect +function setRequestReferrerPolicyOnRedirect (request, actualResponse) { + // Given a request request and a response actualResponse, this algorithm + // updates request’s referrer policy according to the Referrer-Policy + // header (if any) in actualResponse. + + // 1. Let policy be the result of executing § 8.1 Parse a referrer policy + // from a Referrer-Policy header on actualResponse. + + // 8.1 Parse a referrer policy from a Referrer-Policy header + // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list. + const { headersList } = actualResponse + // 2. Let policy be the empty string. + // 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. + // 4. Return policy. + const policyHeader = (headersList.get('referrer-policy', true) ?? '').split(',') + + // Note: As the referrer-policy can contain multiple policies + // separated by comma, we need to loop through all of them + // and pick the first valid one. + // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy + let policy = '' + if (policyHeader.length > 0) { + // The right-most policy takes precedence. + // The left-most policy is the fallback. + for (let i = policyHeader.length; i !== 0; i--) { + const token = policyHeader[i - 1].trim() + if (referrerPolicyTokens.has(token)) { + policy = token + break + } + } + } + + // 2. If policy is not the empty string, then set request’s referrer policy to policy. + if (policy !== '') { + request.referrerPolicy = policy + } +} + +// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check +function crossOriginResourcePolicyCheck () { + // TODO + return 'allowed' +} + +// https://fetch.spec.whatwg.org/#concept-cors-check +function corsCheck () { + // TODO + return 'success' +} + +// https://fetch.spec.whatwg.org/#concept-tao-check +function TAOCheck () { + // TODO + return 'success' +} + +function appendFetchMetadata (httpRequest) { + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header + // TODO + + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header + + // 1. Assert: r’s url is a potentially trustworthy URL. + // TODO + + // 2. Let header be a Structured Header whose value is a token. + let header = null + + // 3. Set header’s value to r’s mode. + header = httpRequest.mode + + // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list. + httpRequest.headersList.set('sec-fetch-mode', header, true) + + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header + // TODO + + // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header + // TODO +} + +// https://fetch.spec.whatwg.org/#append-a-request-origin-header +function appendRequestOriginHeader (request) { + // 1. Let serializedOrigin be the result of byte-serializing a request origin + // with request. + // TODO: implement "byte-serializing a request origin" + let serializedOrigin = request.origin + + // - "'client' is changed to an origin during fetching." + // This doesn't happen in undici (in most cases) because undici, by default, + // has no concept of origin. + // - request.origin can also be set to request.client.origin (client being + // an environment settings object), which is undefined without using + // setGlobalOrigin. + if (serializedOrigin === 'client' || serializedOrigin === undefined) { + return + } + + // 2. If request’s response tainting is "cors" or request’s mode is "websocket", + // then append (`Origin`, serializedOrigin) to request’s header list. + // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then: + if (request.responseTainting === 'cors' || request.mode === 'websocket') { + request.headersList.append('origin', serializedOrigin, true) + } else if (request.method !== 'GET' && request.method !== 'HEAD') { + // 1. Switch on request’s referrer policy: + switch (request.referrerPolicy) { + case 'no-referrer': + // Set serializedOrigin to `null`. + serializedOrigin = null + break + case 'no-referrer-when-downgrade': + case 'strict-origin': + case 'strict-origin-when-cross-origin': + // If request’s origin is a tuple origin, its scheme is "https", and + // request’s current URL’s scheme is not "https", then set + // serializedOrigin to `null`. + if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) { + serializedOrigin = null + } + break + case 'same-origin': + // If request’s origin is not same origin with request’s current URL’s + // origin, then set serializedOrigin to `null`. + if (!sameOrigin(request, requestCurrentURL(request))) { + serializedOrigin = null + } + break + default: + // Do nothing. + } + + // 2. Append (`Origin`, serializedOrigin) to request’s header list. + request.headersList.append('origin', serializedOrigin, true) + } +} + +// https://w3c.github.io/hr-time/#dfn-coarsen-time +function coarsenTime (timestamp, crossOriginIsolatedCapability) { + // TODO + return timestamp +} + +// https://fetch.spec.whatwg.org/#clamp-and-coarsen-connection-timing-info +function clampAndCoarsenConnectionTimingInfo (connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) { + if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) { + return { + domainLookupStartTime: defaultStartTime, + domainLookupEndTime: defaultStartTime, + connectionStartTime: defaultStartTime, + connectionEndTime: defaultStartTime, + secureConnectionStartTime: defaultStartTime, + ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol + } + } + + return { + domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability), + domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability), + connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability), + connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability), + secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability), + ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol + } +} + +// https://w3c.github.io/hr-time/#dfn-coarsened-shared-current-time +function coarsenedSharedCurrentTime (crossOriginIsolatedCapability) { + return coarsenTime(performance.now(), crossOriginIsolatedCapability) +} + +// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info +function createOpaqueTimingInfo (timingInfo) { + return { + startTime: timingInfo.startTime ?? 0, + redirectStartTime: 0, + redirectEndTime: 0, + postRedirectStartTime: timingInfo.startTime ?? 0, + finalServiceWorkerStartTime: 0, + finalNetworkResponseStartTime: 0, + finalNetworkRequestStartTime: 0, + endTime: 0, + encodedBodySize: 0, + decodedBodySize: 0, + finalConnectionTimingInfo: null + } +} + +// https://html.spec.whatwg.org/multipage/origin.html#policy-container +function makePolicyContainer () { + // Note: the fetch spec doesn't make use of embedder policy or CSP list + return { + referrerPolicy: 'strict-origin-when-cross-origin' + } +} + +// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container +function clonePolicyContainer (policyContainer) { + return { + referrerPolicy: policyContainer.referrerPolicy + } +} + +// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer +function determineRequestsReferrer (request) { + // 1. Let policy be request's referrer policy. + const policy = request.referrerPolicy + + // Note: policy cannot (shouldn't) be null or an empty string. + assert(policy) + + // 2. Let environment be request’s client. + + let referrerSource = null + + // 3. Switch on request’s referrer: + if (request.referrer === 'client') { + // Note: node isn't a browser and doesn't implement document/iframes, + // so we bypass this step and replace it with our own. + + const globalOrigin = getGlobalOrigin() + + if (!globalOrigin || globalOrigin.origin === 'null') { + return 'no-referrer' + } + + // note: we need to clone it as it's mutated + referrerSource = new URL(globalOrigin) + } else if (request.referrer instanceof URL) { + // Let referrerSource be request’s referrer. + referrerSource = request.referrer + } + + // 4. Let request’s referrerURL be the result of stripping referrerSource for + // use as a referrer. + let referrerURL = stripURLForReferrer(referrerSource) + + // 5. Let referrerOrigin be the result of stripping referrerSource for use as + // a referrer, with the origin-only flag set to true. + const referrerOrigin = stripURLForReferrer(referrerSource, true) + + // 6. If the result of serializing referrerURL is a string whose length is + // greater than 4096, set referrerURL to referrerOrigin. + if (referrerURL.toString().length > 4096) { + referrerURL = referrerOrigin + } + + const areSameOrigin = sameOrigin(request, referrerURL) + const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && + !isURLPotentiallyTrustworthy(request.url) + + // 8. Execute the switch statements corresponding to the value of policy: + switch (policy) { + case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true) + case 'unsafe-url': return referrerURL + case 'same-origin': + return areSameOrigin ? referrerOrigin : 'no-referrer' + case 'origin-when-cross-origin': + return areSameOrigin ? referrerURL : referrerOrigin + case 'strict-origin-when-cross-origin': { + const currentURL = requestCurrentURL(request) + + // 1. If the origin of referrerURL and the origin of request’s current + // URL are the same, then return referrerURL. + if (sameOrigin(referrerURL, currentURL)) { + return referrerURL + } + + // 2. If referrerURL is a potentially trustworthy URL and request’s + // current URL is not a potentially trustworthy URL, then return no + // referrer. + if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { + return 'no-referrer' + } + + // 3. Return referrerOrigin. + return referrerOrigin + } + case 'strict-origin': // eslint-disable-line + /** + * 1. If referrerURL is a potentially trustworthy URL and + * request’s current URL is not a potentially trustworthy URL, + * then return no referrer. + * 2. Return referrerOrigin + */ + case 'no-referrer-when-downgrade': // eslint-disable-line + /** + * 1. If referrerURL is a potentially trustworthy URL and + * request’s current URL is not a potentially trustworthy URL, + * then return no referrer. + * 2. Return referrerOrigin + */ + + default: // eslint-disable-line + return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin + } +} + +/** + * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url + * @param {URL} url + * @param {boolean|undefined} originOnly + */ +function stripURLForReferrer (url, originOnly) { + // 1. Assert: url is a URL. + assert(url instanceof URL) + + url = new URL(url) + + // 2. If url’s scheme is a local scheme, then return no referrer. + if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') { + return 'no-referrer' + } + + // 3. Set url’s username to the empty string. + url.username = '' + + // 4. Set url’s password to the empty string. + url.password = '' + + // 5. Set url’s fragment to null. + url.hash = '' + + // 6. If the origin-only flag is true, then: + if (originOnly) { + // 1. Set url’s path to « the empty string ». + url.pathname = '' + + // 2. Set url’s query to null. + url.search = '' + } + + // 7. Return url. + return url +} + +function isURLPotentiallyTrustworthy (url) { + if (!(url instanceof URL)) { + return false + } + + // If child of about, return true + if (url.href === 'about:blank' || url.href === 'about:srcdoc') { + return true + } + + // If scheme is data, return true + if (url.protocol === 'data:') return true + + // If file, return true + if (url.protocol === 'file:') return true + + return isOriginPotentiallyTrustworthy(url.origin) + + function isOriginPotentiallyTrustworthy (origin) { + // If origin is explicitly null, return false + if (origin == null || origin === 'null') return false + + const originAsURL = new URL(origin) + + // If secure, return true + if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') { + return true + } + + // If localhost or variants, return true + if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || + (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) || + (originAsURL.hostname.endsWith('.localhost'))) { + return true + } + + // If any other, return false + return false + } +} + +/** + * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist + * @param {Uint8Array} bytes + * @param {string} metadataList + */ +function bytesMatch (bytes, metadataList) { + // If node is not built with OpenSSL support, we cannot check + // a request's integrity, so allow it by default (the spec will + // allow requests if an invalid hash is given, as precedence). + /* istanbul ignore if: only if node is built with --without-ssl */ + if (crypto === undefined) { + return true + } + + // 1. Let parsedMetadata be the result of parsing metadataList. + const parsedMetadata = parseMetadata(metadataList) + + // 2. If parsedMetadata is no metadata, return true. + if (parsedMetadata === 'no metadata') { + return true + } + + // 3. If response is not eligible for integrity validation, return false. + // TODO + + // 4. If parsedMetadata is the empty set, return true. + if (parsedMetadata.length === 0) { + return true + } + + // 5. Let metadata be the result of getting the strongest + // metadata from parsedMetadata. + const strongest = getStrongestMetadata(parsedMetadata) + const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest) + + // 6. For each item in metadata: + for (const item of metadata) { + // 1. Let algorithm be the alg component of item. + const algorithm = item.algo + + // 2. Let expectedValue be the val component of item. + const expectedValue = item.hash + + // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e + // "be liberal with padding". This is annoying, and it's not even in the spec. + + // 3. Let actualValue be the result of applying algorithm to bytes. + let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64') + + if (actualValue[actualValue.length - 1] === '=') { + if (actualValue[actualValue.length - 2] === '=') { + actualValue = actualValue.slice(0, -2) + } else { + actualValue = actualValue.slice(0, -1) + } + } + + // 4. If actualValue is a case-sensitive match for expectedValue, + // return true. + if (compareBase64Mixed(actualValue, expectedValue)) { + return true + } + } + + // 7. Return false. + return false +} + +// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options +// https://www.w3.org/TR/CSP2/#source-list-syntax +// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1 +const parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i + +/** + * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata + * @param {string} metadata + */ +function parseMetadata (metadata) { + // 1. Let result be the empty set. + /** @type {{ algo: string, hash: string }[]} */ + const result = [] + + // 2. Let empty be equal to true. + let empty = true + + // 3. For each token returned by splitting metadata on spaces: + for (const token of metadata.split(' ')) { + // 1. Set empty to false. + empty = false + + // 2. Parse token as a hash-with-options. + const parsedToken = parseHashWithOptions.exec(token) + + // 3. If token does not parse, continue to the next token. + if ( + parsedToken === null || + parsedToken.groups === undefined || + parsedToken.groups.algo === undefined + ) { + // Note: Chromium blocks the request at this point, but Firefox + // gives a warning that an invalid integrity was given. The + // correct behavior is to ignore these, and subsequently not + // check the integrity of the resource. + continue + } + + // 4. Let algorithm be the hash-algo component of token. + const algorithm = parsedToken.groups.algo.toLowerCase() + + // 5. If algorithm is a hash function recognized by the user + // agent, add the parsed token to result. + if (supportedHashes.includes(algorithm)) { + result.push(parsedToken.groups) + } + } + + // 4. Return no metadata if empty is true, otherwise return result. + if (empty === true) { + return 'no metadata' + } + + return result +} + +/** + * @param {{ algo: 'sha256' | 'sha384' | 'sha512' }[]} metadataList + */ +function getStrongestMetadata (metadataList) { + // Let algorithm be the algo component of the first item in metadataList. + // Can be sha256 + let algorithm = metadataList[0].algo + // If the algorithm is sha512, then it is the strongest + // and we can return immediately + if (algorithm[3] === '5') { + return algorithm + } + + for (let i = 1; i < metadataList.length; ++i) { + const metadata = metadataList[i] + // If the algorithm is sha512, then it is the strongest + // and we can break the loop immediately + if (metadata.algo[3] === '5') { + algorithm = 'sha512' + break + // If the algorithm is sha384, then a potential sha256 or sha384 is ignored + } else if (algorithm[3] === '3') { + continue + // algorithm is sha256, check if algorithm is sha384 and if so, set it as + // the strongest + } else if (metadata.algo[3] === '3') { + algorithm = 'sha384' + } + } + return algorithm +} + +function filterMetadataListByAlgorithm (metadataList, algorithm) { + if (metadataList.length === 1) { + return metadataList + } + + let pos = 0 + for (let i = 0; i < metadataList.length; ++i) { + if (metadataList[i].algo === algorithm) { + metadataList[pos++] = metadataList[i] + } + } + + metadataList.length = pos + + return metadataList +} + +/** + * Compares two base64 strings, allowing for base64url + * in the second string. + * +* @param {string} actualValue always base64 + * @param {string} expectedValue base64 or base64url + * @returns {boolean} + */ +function compareBase64Mixed (actualValue, expectedValue) { + if (actualValue.length !== expectedValue.length) { + return false + } + for (let i = 0; i < actualValue.length; ++i) { + if (actualValue[i] !== expectedValue[i]) { + if ( + (actualValue[i] === '+' && expectedValue[i] === '-') || + (actualValue[i] === '/' && expectedValue[i] === '_') + ) { + continue + } + return false + } + } + + return true +} + +// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request +function tryUpgradeRequestToAPotentiallyTrustworthyURL (request) { + // TODO +} + +/** + * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin} + * @param {URL} A + * @param {URL} B + */ +function sameOrigin (A, B) { + // 1. If A and B are the same opaque origin, then return true. + if (A.origin === B.origin && A.origin === 'null') { + return true + } + + // 2. If A and B are both tuple origins and their schemes, + // hosts, and port are identical, then return true. + if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { + return true + } + + // 3. Return false. + return false +} + +function createDeferredPromise () { + let res + let rej + const promise = new Promise((resolve, reject) => { + res = resolve + rej = reject + }) + + return { promise, resolve: res, reject: rej } +} + +function isAborted (fetchParams) { + return fetchParams.controller.state === 'aborted' +} + +function isCancelled (fetchParams) { + return fetchParams.controller.state === 'aborted' || + fetchParams.controller.state === 'terminated' +} + +/** + * @see https://fetch.spec.whatwg.org/#concept-method-normalize + * @param {string} method + */ +function normalizeMethod (method) { + return normalizedMethodRecordsBase[method.toLowerCase()] ?? method +} + +// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string +function serializeJavascriptValueToJSONString (value) { + // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »). + const result = JSON.stringify(value) + + // 2. If result is undefined, then throw a TypeError. + if (result === undefined) { + throw new TypeError('Value is not JSON serializable') + } + + // 3. Assert: result is a string. + assert(typeof result === 'string') + + // 4. Return result. + return result +} + +// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object +const esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())) + +/** + * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object + * @param {string} name name of the instance + * @param {symbol} kInternalIterator + * @param {string | number} [keyIndex] + * @param {string | number} [valueIndex] + */ +function createIterator (name, kInternalIterator, keyIndex = 0, valueIndex = 1) { + class FastIterableIterator { + /** @type {any} */ + #target + /** @type {'key' | 'value' | 'key+value'} */ + #kind + /** @type {number} */ + #index + + /** + * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object + * @param {unknown} target + * @param {'key' | 'value' | 'key+value'} kind + */ + constructor (target, kind) { + this.#target = target + this.#kind = kind + this.#index = 0 + } + + next () { + // 1. Let interface be the interface for which the iterator prototype object exists. + // 2. Let thisValue be the this value. + // 3. Let object be ? ToObject(thisValue). + // 4. If object is a platform object, then perform a security + // check, passing: + // 5. If object is not a default iterator object for interface, + // then throw a TypeError. + if (typeof this !== 'object' || this === null || !(#target in this)) { + throw new TypeError( + `'next' called on an object that does not implement interface ${name} Iterator.` + ) + } + + // 6. Let index be object’s index. + // 7. Let kind be object’s kind. + // 8. Let values be object’s target's value pairs to iterate over. + const index = this.#index + const values = this.#target[kInternalIterator] + + // 9. Let len be the length of values. + const len = values.length + + // 10. If index is greater than or equal to len, then return + // CreateIterResultObject(undefined, true). + if (index >= len) { + return { + value: undefined, + done: true + } + } + + // 11. Let pair be the entry in values at index index. + const { [keyIndex]: key, [valueIndex]: value } = values[index] + + // 12. Set object’s index to index + 1. + this.#index = index + 1 + + // 13. Return the iterator result for pair and kind. + + // https://webidl.spec.whatwg.org/#iterator-result + + // 1. Let result be a value determined by the value of kind: + let result + switch (this.#kind) { + case 'key': + // 1. Let idlKey be pair’s key. + // 2. Let key be the result of converting idlKey to an + // ECMAScript value. + // 3. result is key. + result = key + break + case 'value': + // 1. Let idlValue be pair’s value. + // 2. Let value be the result of converting idlValue to + // an ECMAScript value. + // 3. result is value. + result = value + break + case 'key+value': + // 1. Let idlKey be pair’s key. + // 2. Let idlValue be pair’s value. + // 3. Let key be the result of converting idlKey to an + // ECMAScript value. + // 4. Let value be the result of converting idlValue to + // an ECMAScript value. + // 5. Let array be ! ArrayCreate(2). + // 6. Call ! CreateDataProperty(array, "0", key). + // 7. Call ! CreateDataProperty(array, "1", value). + // 8. result is array. + result = [key, value] + break + } + + // 2. Return CreateIterResultObject(result, false). + return { + value: result, + done: false + } + } + } + + // https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object + // @ts-ignore + delete FastIterableIterator.prototype.constructor + + Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype) + + Object.defineProperties(FastIterableIterator.prototype, { + [Symbol.toStringTag]: { + writable: false, + enumerable: false, + configurable: true, + value: `${name} Iterator` + }, + next: { writable: true, enumerable: true, configurable: true } + }) + + /** + * @param {unknown} target + * @param {'key' | 'value' | 'key+value'} kind + * @returns {IterableIterator} + */ + return function (target, kind) { + return new FastIterableIterator(target, kind) + } +} + +/** + * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object + * @param {string} name name of the instance + * @param {any} object class + * @param {symbol} kInternalIterator + * @param {string | number} [keyIndex] + * @param {string | number} [valueIndex] + */ +function iteratorMixin (name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) { + const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex) + + const properties = { + keys: { + writable: true, + enumerable: true, + configurable: true, + value: function keys () { + webidl.brandCheck(this, object) + return makeIterator(this, 'key') + } + }, + values: { + writable: true, + enumerable: true, + configurable: true, + value: function values () { + webidl.brandCheck(this, object) + return makeIterator(this, 'value') + } + }, + entries: { + writable: true, + enumerable: true, + configurable: true, + value: function entries () { + webidl.brandCheck(this, object) + return makeIterator(this, 'key+value') + } + }, + forEach: { + writable: true, + enumerable: true, + configurable: true, + value: function forEach (callbackfn, thisArg = globalThis) { + webidl.brandCheck(this, object) + webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`) + if (typeof callbackfn !== 'function') { + throw new TypeError( + `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.` + ) + } + for (const { 0: key, 1: value } of makeIterator(this, 'key+value')) { + callbackfn.call(thisArg, value, key, this) + } + } + } + } + + return Object.defineProperties(object.prototype, { + ...properties, + [Symbol.iterator]: { + writable: true, + enumerable: false, + configurable: true, + value: properties.entries.value + } + }) +} + +/** + * @see https://fetch.spec.whatwg.org/#body-fully-read + */ +async function fullyReadBody (body, processBody, processBodyError) { + // 1. If taskDestination is null, then set taskDestination to + // the result of starting a new parallel queue. + + // 2. Let successSteps given a byte sequence bytes be to queue a + // fetch task to run processBody given bytes, with taskDestination. + const successSteps = processBody + + // 3. Let errorSteps be to queue a fetch task to run processBodyError, + // with taskDestination. + const errorSteps = processBodyError + + // 4. Let reader be the result of getting a reader for body’s stream. + // If that threw an exception, then run errorSteps with that + // exception and return. + let reader + + try { + reader = body.stream.getReader() + } catch (e) { + errorSteps(e) + return + } + + // 5. Read all bytes from reader, given successSteps and errorSteps. + try { + successSteps(await readAllBytes(reader)) + } catch (e) { + errorSteps(e) + } +} + +function isReadableStreamLike (stream) { + return stream instanceof ReadableStream || ( + stream[Symbol.toStringTag] === 'ReadableStream' && + typeof stream.tee === 'function' + ) +} + +/** + * @param {ReadableStreamController} controller + */ +function readableStreamClose (controller) { + try { + controller.close() + controller.byobRequest?.respond(0) + } catch (err) { + // TODO: add comment explaining why this error occurs. + if (!err.message.includes('Controller is already closed') && !err.message.includes('ReadableStream is already closed')) { + throw err + } + } +} + +const invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/ // eslint-disable-line + +/** + * @see https://infra.spec.whatwg.org/#isomorphic-encode + * @param {string} input + */ +function isomorphicEncode (input) { + // 1. Assert: input contains no code points greater than U+00FF. + assert(!invalidIsomorphicEncodeValueRegex.test(input)) + + // 2. Return a byte sequence whose length is equal to input’s code + // point length and whose bytes have the same values as the + // values of input’s code points, in the same order + return input +} + +/** + * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes + * @see https://streams.spec.whatwg.org/#read-loop + * @param {ReadableStreamDefaultReader} reader + */ +async function readAllBytes (reader) { + const bytes = [] + let byteLength = 0 + + while (true) { + const { done, value: chunk } = await reader.read() + + if (done) { + // 1. Call successSteps with bytes. + return Buffer.concat(bytes, byteLength) + } + + // 1. If chunk is not a Uint8Array object, call failureSteps + // with a TypeError and abort these steps. + if (!isUint8Array(chunk)) { + throw new TypeError('Received non-Uint8Array chunk') + } + + // 2. Append the bytes represented by chunk to bytes. + bytes.push(chunk) + byteLength += chunk.length + + // 3. Read-loop given reader, bytes, successSteps, and failureSteps. + } +} + +/** + * @see https://fetch.spec.whatwg.org/#is-local + * @param {URL} url + */ +function urlIsLocal (url) { + assert('protocol' in url) // ensure it's a url object + + const protocol = url.protocol + + return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:' +} + +/** + * @param {string|URL} url + * @returns {boolean} + */ +function urlHasHttpsScheme (url) { + return ( + ( + typeof url === 'string' && + url[5] === ':' && + url[0] === 'h' && + url[1] === 't' && + url[2] === 't' && + url[3] === 'p' && + url[4] === 's' + ) || + url.protocol === 'https:' + ) +} + +/** + * @see https://fetch.spec.whatwg.org/#http-scheme + * @param {URL} url + */ +function urlIsHttpHttpsScheme (url) { + assert('protocol' in url) // ensure it's a url object + + const protocol = url.protocol + + return protocol === 'http:' || protocol === 'https:' +} + +/** + * @see https://fetch.spec.whatwg.org/#simple-range-header-value + * @param {string} value + * @param {boolean} allowWhitespace + */ +function simpleRangeHeaderValue (value, allowWhitespace) { + // 1. Let data be the isomorphic decoding of value. + // Note: isomorphic decoding takes a sequence of bytes (ie. a Uint8Array) and turns it into a string, + // nothing more. We obviously don't need to do that if value is a string already. + const data = value + + // 2. If data does not start with "bytes", then return failure. + if (!data.startsWith('bytes')) { + return 'failure' + } + + // 3. Let position be a position variable for data, initially pointing at the 5th code point of data. + const position = { position: 5 } + + // 4. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, + // from data given position. + if (allowWhitespace) { + collectASequenceOfCodePoints( + (char) => char === '\t' || char === ' ', + data, + position + ) + } + + // 5. If the code point at position within data is not U+003D (=), then return failure. + if (data.charCodeAt(position.position) !== 0x3D) { + return 'failure' + } + + // 6. Advance position by 1. + position.position++ + + // 7. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, from + // data given position. + if (allowWhitespace) { + collectASequenceOfCodePoints( + (char) => char === '\t' || char === ' ', + data, + position + ) + } + + // 8. Let rangeStart be the result of collecting a sequence of code points that are ASCII digits, + // from data given position. + const rangeStart = collectASequenceOfCodePoints( + (char) => { + const code = char.charCodeAt(0) + + return code >= 0x30 && code <= 0x39 + }, + data, + position + ) + + // 9. Let rangeStartValue be rangeStart, interpreted as decimal number, if rangeStart is not the + // empty string; otherwise null. + const rangeStartValue = rangeStart.length ? Number(rangeStart) : null + + // 10. If allowWhitespace is true, collect a sequence of code points that are HTTP tab or space, + // from data given position. + if (allowWhitespace) { + collectASequenceOfCodePoints( + (char) => char === '\t' || char === ' ', + data, + position + ) + } + + // 11. If the code point at position within data is not U+002D (-), then return failure. + if (data.charCodeAt(position.position) !== 0x2D) { + return 'failure' + } + + // 12. Advance position by 1. + position.position++ + + // 13. If allowWhitespace is true, collect a sequence of code points that are HTTP tab + // or space, from data given position. + // Note from Khafra: its the same step as in #8 again lol + if (allowWhitespace) { + collectASequenceOfCodePoints( + (char) => char === '\t' || char === ' ', + data, + position + ) + } + + // 14. Let rangeEnd be the result of collecting a sequence of code points that are + // ASCII digits, from data given position. + // Note from Khafra: you wouldn't guess it, but this is also the same step as #8 + const rangeEnd = collectASequenceOfCodePoints( + (char) => { + const code = char.charCodeAt(0) + + return code >= 0x30 && code <= 0x39 + }, + data, + position + ) + + // 15. Let rangeEndValue be rangeEnd, interpreted as decimal number, if rangeEnd + // is not the empty string; otherwise null. + // Note from Khafra: THE SAME STEP, AGAIN!!! + // Note: why interpret as a decimal if we only collect ascii digits? + const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null + + // 16. If position is not past the end of data, then return failure. + if (position.position < data.length) { + return 'failure' + } + + // 17. If rangeEndValue and rangeStartValue are null, then return failure. + if (rangeEndValue === null && rangeStartValue === null) { + return 'failure' + } + + // 18. If rangeStartValue and rangeEndValue are numbers, and rangeStartValue is + // greater than rangeEndValue, then return failure. + // Note: ... when can they not be numbers? + if (rangeStartValue > rangeEndValue) { + return 'failure' + } + + // 19. Return (rangeStartValue, rangeEndValue). + return { rangeStartValue, rangeEndValue } +} + +/** + * @see https://fetch.spec.whatwg.org/#build-a-content-range + * @param {number} rangeStart + * @param {number} rangeEnd + * @param {number} fullLength + */ +function buildContentRange (rangeStart, rangeEnd, fullLength) { + // 1. Let contentRange be `bytes `. + let contentRange = 'bytes ' + + // 2. Append rangeStart, serialized and isomorphic encoded, to contentRange. + contentRange += isomorphicEncode(`${rangeStart}`) + + // 3. Append 0x2D (-) to contentRange. + contentRange += '-' + + // 4. Append rangeEnd, serialized and isomorphic encoded to contentRange. + contentRange += isomorphicEncode(`${rangeEnd}`) + + // 5. Append 0x2F (/) to contentRange. + contentRange += '/' + + // 6. Append fullLength, serialized and isomorphic encoded to contentRange. + contentRange += isomorphicEncode(`${fullLength}`) + + // 7. Return contentRange. + return contentRange +} + +// A Stream, which pipes the response to zlib.createInflate() or +// zlib.createInflateRaw() depending on the first byte of the Buffer. +// If the lower byte of the first byte is 0x08, then the stream is +// interpreted as a zlib stream, otherwise it's interpreted as a +// raw deflate stream. +class InflateStream extends Transform { + #zlibOptions + + /** @param {zlib.ZlibOptions} [zlibOptions] */ + constructor (zlibOptions) { + super() + this.#zlibOptions = zlibOptions + } + + _transform (chunk, encoding, callback) { + if (!this._inflateStream) { + if (chunk.length === 0) { + callback() + return + } + this._inflateStream = (chunk[0] & 0x0F) === 0x08 + ? zlib.createInflate(this.#zlibOptions) + : zlib.createInflateRaw(this.#zlibOptions) + + this._inflateStream.on('data', this.push.bind(this)) + this._inflateStream.on('end', () => this.push(null)) + this._inflateStream.on('error', (err) => this.destroy(err)) + } + + this._inflateStream.write(chunk, encoding, callback) + } + + _final (callback) { + if (this._inflateStream) { + this._inflateStream.end() + this._inflateStream = null + } + callback() + } +} + +/** + * @param {zlib.ZlibOptions} [zlibOptions] + * @returns {InflateStream} + */ +function createInflate (zlibOptions) { + return new InflateStream(zlibOptions) +} + +/** + * @see https://fetch.spec.whatwg.org/#concept-header-extract-mime-type + * @param {import('./headers').HeadersList} headers + */ +function extractMimeType (headers) { + // 1. Let charset be null. + let charset = null + + // 2. Let essence be null. + let essence = null + + // 3. Let mimeType be null. + let mimeType = null + + // 4. Let values be the result of getting, decoding, and splitting `Content-Type` from headers. + const values = getDecodeSplit('content-type', headers) + + // 5. If values is null, then return failure. + if (values === null) { + return 'failure' + } + + // 6. For each value of values: + for (const value of values) { + // 6.1. Let temporaryMimeType be the result of parsing value. + const temporaryMimeType = parseMIMEType(value) + + // 6.2. If temporaryMimeType is failure or its essence is "*/*", then continue. + if (temporaryMimeType === 'failure' || temporaryMimeType.essence === '*/*') { + continue + } + + // 6.3. Set mimeType to temporaryMimeType. + mimeType = temporaryMimeType + + // 6.4. If mimeType’s essence is not essence, then: + if (mimeType.essence !== essence) { + // 6.4.1. Set charset to null. + charset = null + + // 6.4.2. If mimeType’s parameters["charset"] exists, then set charset to + // mimeType’s parameters["charset"]. + if (mimeType.parameters.has('charset')) { + charset = mimeType.parameters.get('charset') + } + + // 6.4.3. Set essence to mimeType’s essence. + essence = mimeType.essence + } else if (!mimeType.parameters.has('charset') && charset !== null) { + // 6.5. Otherwise, if mimeType’s parameters["charset"] does not exist, and + // charset is non-null, set mimeType’s parameters["charset"] to charset. + mimeType.parameters.set('charset', charset) + } + } + + // 7. If mimeType is null, then return failure. + if (mimeType == null) { + return 'failure' + } + + // 8. Return mimeType. + return mimeType +} + +/** + * @see https://fetch.spec.whatwg.org/#header-value-get-decode-and-split + * @param {string|null} value + */ +function gettingDecodingSplitting (value) { + // 1. Let input be the result of isomorphic decoding value. + const input = value + + // 2. Let position be a position variable for input, initially pointing at the start of input. + const position = { position: 0 } + + // 3. Let values be a list of strings, initially empty. + const values = [] + + // 4. Let temporaryValue be the empty string. + let temporaryValue = '' + + // 5. While position is not past the end of input: + while (position.position < input.length) { + // 5.1. Append the result of collecting a sequence of code points that are not U+0022 (") + // or U+002C (,) from input, given position, to temporaryValue. + temporaryValue += collectASequenceOfCodePoints( + (char) => char !== '"' && char !== ',', + input, + position + ) + + // 5.2. If position is not past the end of input, then: + if (position.position < input.length) { + // 5.2.1. If the code point at position within input is U+0022 ("), then: + if (input.charCodeAt(position.position) === 0x22) { + // 5.2.1.1. Append the result of collecting an HTTP quoted string from input, given position, to temporaryValue. + temporaryValue += collectAnHTTPQuotedString( + input, + position + ) + + // 5.2.1.2. If position is not past the end of input, then continue. + if (position.position < input.length) { + continue + } + } else { + // 5.2.2. Otherwise: + + // 5.2.2.1. Assert: the code point at position within input is U+002C (,). + assert(input.charCodeAt(position.position) === 0x2C) + + // 5.2.2.2. Advance position by 1. + position.position++ + } + } + + // 5.3. Remove all HTTP tab or space from the start and end of temporaryValue. + temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 0x9 || char === 0x20) + + // 5.4. Append temporaryValue to values. + values.push(temporaryValue) + + // 5.6. Set temporaryValue to the empty string. + temporaryValue = '' + } + + // 6. Return values. + return values +} + +/** + * @see https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split + * @param {string} name lowercase header name + * @param {import('./headers').HeadersList} list + */ +function getDecodeSplit (name, list) { + // 1. Let value be the result of getting name from list. + const value = list.get(name, true) + + // 2. If value is null, then return null. + if (value === null) { + return null + } + + // 3. Return the result of getting, decoding, and splitting value. + return gettingDecodingSplitting(value) +} + +const textDecoder = new TextDecoder() + +/** + * @see https://encoding.spec.whatwg.org/#utf-8-decode + * @param {Buffer} buffer + */ +function utf8DecodeBytes (buffer) { + if (buffer.length === 0) { + return '' + } + + // 1. Let buffer be the result of peeking three bytes from + // ioQueue, converted to a byte sequence. + + // 2. If buffer is 0xEF 0xBB 0xBF, then read three + // bytes from ioQueue. (Do nothing with those bytes.) + if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { + buffer = buffer.subarray(3) + } + + // 3. Process a queue with an instance of UTF-8’s + // decoder, ioQueue, output, and "replacement". + const output = textDecoder.decode(buffer) + + // 4. Return output. + return output +} + +class EnvironmentSettingsObjectBase { + get baseUrl () { + return getGlobalOrigin() + } + + get origin () { + return this.baseUrl?.origin + } + + policyContainer = makePolicyContainer() +} + +class EnvironmentSettingsObject { + settingsObject = new EnvironmentSettingsObjectBase() +} + +const environmentSettingsObject = new EnvironmentSettingsObject() + +module.exports = { + isAborted, + isCancelled, + isValidEncodedURL, + createDeferredPromise, + ReadableStreamFrom, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + clampAndCoarsenConnectionTimingInfo, + coarsenedSharedCurrentTime, + determineRequestsReferrer, + makePolicyContainer, + clonePolicyContainer, + appendFetchMetadata, + appendRequestOriginHeader, + TAOCheck, + corsCheck, + crossOriginResourcePolicyCheck, + createOpaqueTimingInfo, + setRequestReferrerPolicyOnRedirect, + isValidHTTPToken, + requestBadPort, + requestCurrentURL, + responseURL, + responseLocationURL, + isBlobLike, + isURLPotentiallyTrustworthy, + isValidReasonPhrase, + sameOrigin, + normalizeMethod, + serializeJavascriptValueToJSONString, + iteratorMixin, + createIterator, + isValidHeaderName, + isValidHeaderValue, + isErrorLike, + fullyReadBody, + bytesMatch, + isReadableStreamLike, + readableStreamClose, + isomorphicEncode, + urlIsLocal, + urlHasHttpsScheme, + urlIsHttpHttpsScheme, + readAllBytes, + simpleRangeHeaderValue, + buildContentRange, + parseMetadata, + createInflate, + extractMimeType, + getDecodeSplit, + utf8DecodeBytes, + environmentSettingsObject +} diff --git a/.pnpm-store/v11/files/0a/20b887acccaa5c6cbd00c27b95fe7b07d35e4b2530d0bc55448939cbee880be77195e191773e0a1eec2f9a2d4e3d7f2b2c4840d138e1220c97b7a4b8ac34fa b/.pnpm-store/v11/files/0a/20b887acccaa5c6cbd00c27b95fe7b07d35e4b2530d0bc55448939cbee880be77195e191773e0a1eec2f9a2d4e3d7f2b2c4840d138e1220c97b7a4b8ac34fa new file mode 100644 index 0000000000..8af86805c9 Binary files /dev/null and b/.pnpm-store/v11/files/0a/20b887acccaa5c6cbd00c27b95fe7b07d35e4b2530d0bc55448939cbee880be77195e191773e0a1eec2f9a2d4e3d7f2b2c4840d138e1220c97b7a4b8ac34fa differ diff --git a/.pnpm-store/v11/files/0a/ab4d484df289485beb90ee8b7d929d2d6fa5d7e4385c17b2745dea40e295f1a9c6c3c8c6c206b46f04a50b51eb01952793ffb84e978c9d0d7447435280abe7 b/.pnpm-store/v11/files/0a/ab4d484df289485beb90ee8b7d929d2d6fa5d7e4385c17b2745dea40e295f1a9c6c3c8c6c206b46f04a50b51eb01952793ffb84e978c9d0d7447435280abe7 new file mode 100644 index 0000000000..136082130b Binary files /dev/null and b/.pnpm-store/v11/files/0a/ab4d484df289485beb90ee8b7d929d2d6fa5d7e4385c17b2745dea40e295f1a9c6c3c8c6c206b46f04a50b51eb01952793ffb84e978c9d0d7447435280abe7 differ diff --git a/.pnpm-store/v11/files/0b/fc25e8d7e85546ae73a749fab344769369948d550d42d6e1ab2381a500def4fcd73351f5639b7ead50d15641b1dd880eec61942b7e5d2f23538d3b7f840b0d b/.pnpm-store/v11/files/0b/fc25e8d7e85546ae73a749fab344769369948d550d42d6e1ab2381a500def4fcd73351f5639b7ead50d15641b1dd880eec61942b7e5d2f23538d3b7f840b0d new file mode 100644 index 0000000000..df935a58cb --- /dev/null +++ b/.pnpm-store/v11/files/0b/fc25e8d7e85546ae73a749fab344769369948d550d42d6e1ab2381a500def4fcd73351f5639b7ead50d15641b1dd880eec61942b7e5d2f23538d3b7f840b0d @@ -0,0 +1,38 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") +basedir_win="$basedir" +exe="" +msys="" + +case `uname -a` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir_win=`cygpath -w "$basedir"` + fi + exe=".exe" + msys="true" + ;; + *WSL2*) + if command -v wslpath > /dev/null 2>&1; then + basedir_win="$(wslpath -w "$basedir" 2> /dev/null)" + if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then + basedir_win="$basedir" + else + exe=".exe" + fi + fi + ;; +esac + +if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then + exec "$basedir/node.exe" "$basedir_win/../node-gyp/bin/node-gyp.js" "$@" +elif [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../node-gyp/bin/node-gyp.js" "$@" +elif command -v node >/dev/null 2>&1; then + exec node "$basedir/../node-gyp/bin/node-gyp.js" "$@" +elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then + exec node.exe "$basedir_win/../node-gyp/bin/node-gyp.js" "$@" +else + exec node "$basedir/../node-gyp/bin/node-gyp.js" "$@" +fi +# cmd-shim-target=/Users/runner/work/pnpm/pnpm/pnpm11/pnpm/temp-deploy/node_modules/node-gyp/./bin/node-gyp.js diff --git a/.pnpm-store/v11/files/0c/506ce7f95070e944e96231238990a0daf8e148b497c7da13bd1714079d8ec7845c40688b16148acc91992775cf1bec0753680d90525fd46cb382eeac3dbb71 b/.pnpm-store/v11/files/0c/506ce7f95070e944e96231238990a0daf8e148b497c7da13bd1714079d8ec7845c40688b16148acc91992775cf1bec0753680d90525fd46cb382eeac3dbb71 new file mode 100644 index 0000000000..5be251961a --- /dev/null +++ b/.pnpm-store/v11/files/0c/506ce7f95070e944e96231238990a0daf8e148b497c7da13bd1714079d8ec7845c40688b16148acc91992775cf1bec0753680d90525fd46cb382eeac3dbb71 @@ -0,0 +1,10 @@ +'use strict' + +const Range = require('../classes/range') + +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + +module.exports = toComparators diff --git a/.pnpm-store/v11/files/0c/5d992acbd5017877b63b90b3dc94a6b15edec2bf893958ab490b6245a51e2588dbb97d75ba46251ced55cd4ae5ca5c291d2994a453c584a529b4711fa8357e b/.pnpm-store/v11/files/0c/5d992acbd5017877b63b90b3dc94a6b15edec2bf893958ab490b6245a51e2588dbb97d75ba46251ced55cd4ae5ca5c291d2994a453c584a529b4711fa8357e new file mode 100644 index 0000000000..262732e670 --- /dev/null +++ b/.pnpm-store/v11/files/0c/5d992acbd5017877b63b90b3dc94a6b15edec2bf893958ab490b6245a51e2588dbb97d75ba46251ced55cd4ae5ca5c291d2994a453c584a529b4711fa8357e @@ -0,0 +1,49 @@ +'use strict' + +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') +module.exports = (versions, range, options) => { + const set = [] + let first = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!first) { + first = version + } + } else { + if (prev) { + set.push([first, prev]) + } + prev = null + first = null + } + } + if (first) { + set.push([first, null]) + } + + const ranges = [] + for (const [min, max] of set) { + if (min === max) { + ranges.push(min) + } else if (!max && min === v[0]) { + ranges.push('*') + } else if (!max) { + ranges.push(`>=${min}`) + } else if (min === v[0]) { + ranges.push(`<=${max}`) + } else { + ranges.push(`${min} - ${max}`) + } + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} diff --git a/.pnpm-store/v11/files/0d/5eb683f629acd69d1b4ef10c36b811be255ee28d9e4556a0c2c33b58a0572ca137a0170219e1b4a1f590b571283486818380622bfbb6b4913e2b6efc3f6aa9 b/.pnpm-store/v11/files/0d/5eb683f629acd69d1b4ef10c36b811be255ee28d9e4556a0c2c33b58a0572ca137a0170219e1b4a1f590b571283486818380622bfbb6b4913e2b6efc3f6aa9 new file mode 100644 index 0000000000..11d03e38a8 --- /dev/null +++ b/.pnpm-store/v11/files/0d/5eb683f629acd69d1b4ef10c36b811be255ee28d9e4556a0c2c33b58a0572ca137a0170219e1b4a1f590b571283486818380622bfbb6b4913e2b6efc3f6aa9 @@ -0,0 +1,12 @@ +'use strict' + +module.exports = { + kWebSocketURL: Symbol('url'), + kReadyState: Symbol('ready state'), + kController: Symbol('controller'), + kResponse: Symbol('response'), + kBinaryType: Symbol('binary type'), + kSentClose: Symbol('sent close'), + kReceivedClose: Symbol('received close'), + kByteParser: Symbol('byte parser') +} diff --git a/.pnpm-store/v11/files/0e/04a2a00eca3b0ac076d489b7687429c857619531f4595d41b215f7e905cff9f495176067c196a35afd991143c4ae63a4ab326b7d3af1920507ad88a3e847be b/.pnpm-store/v11/files/0e/04a2a00eca3b0ac076d489b7687429c857619531f4595d41b215f7e905cff9f495176067c196a35afd991143c4ae63a4ab326b7d3af1920507ad88a3e847be new file mode 100644 index 0000000000..21398e9766 --- /dev/null +++ b/.pnpm-store/v11/files/0e/04a2a00eca3b0ac076d489b7687429c857619531f4595d41b215f7e905cff9f495176067c196a35afd991143c4ae63a4ab326b7d3af1920507ad88a3e847be @@ -0,0 +1,30 @@ +// tar -u +import { makeCommand } from './make-command.js'; +import { replace as r } from './replace.js'; +// just call tar.r with the filter and mtimeCache +export const update = makeCommand(r.syncFile, r.asyncFile, r.syncNoFile, r.asyncNoFile, (opt, entries = []) => { + r.validate?.(opt, entries); + mtimeFilter(opt); +}); +const mtimeFilter = (opt) => { + const filter = opt.filter; + if (!opt.mtimeCache) { + opt.mtimeCache = new Map(); + } + opt.filter = + filter ? + (path, stat) => filter(path, stat) && + !( + /* c8 ignore start */ + ((opt.mtimeCache?.get(path) ?? stat.mtime ?? 0) > + (stat.mtime ?? 0)) + /* c8 ignore stop */ + ) + : (path, stat) => !( + /* c8 ignore start */ + ((opt.mtimeCache?.get(path) ?? stat.mtime ?? 0) > + (stat.mtime ?? 0)) + /* c8 ignore stop */ + ); +}; +//# sourceMappingURL=update.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/0e/def19efe0e85994dcaaed5146f0d371c5e419f063399cfa9f3761f0e92ac0264043978cebe2a5eb8387d9bd73f5dbf2e661963a3aba7f52ccdff5c27bb7e87 b/.pnpm-store/v11/files/0e/def19efe0e85994dcaaed5146f0d371c5e419f063399cfa9f3761f0e92ac0264043978cebe2a5eb8387d9bd73f5dbf2e661963a3aba7f52ccdff5c27bb7e87 new file mode 100644 index 0000000000..f25502776e --- /dev/null +++ b/.pnpm-store/v11/files/0e/def19efe0e85994dcaaed5146f0d371c5e419f063399cfa9f3761f0e92ac0264043978cebe2a5eb8387d9bd73f5dbf2e661963a3aba7f52ccdff5c27bb7e87 @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.warnMethod = void 0; +const warnMethod = (self, code, message, data = {}) => { + if (self.file) { + data.file = self.file; + } + if (self.cwd) { + data.cwd = self.cwd; + } + data.code = + (message instanceof Error && + message.code) || + code; + data.tarCode = code; + if (!self.strict && data.recoverable !== false) { + if (message instanceof Error) { + data = Object.assign(message, data); + message = message.message; + } + self.emit('warn', code, message, data); + } + else if (message instanceof Error) { + self.emit('error', Object.assign(message, data)); + } + else { + self.emit('error', Object.assign(new Error(`${code}: ${message}`), data)); + } +}; +exports.warnMethod = warnMethod; +//# sourceMappingURL=warn-method.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/0f/0fc87f7f3e8be4e04d59702dc38b9120dd65a2db787c4c7450a5868477675a61ddd4e3e0a3102ce6096200f347e4a6effdb3c74b1e7d4f4e2871479674c38a b/.pnpm-store/v11/files/0f/0fc87f7f3e8be4e04d59702dc38b9120dd65a2db787c4c7450a5868477675a61ddd4e3e0a3102ce6096200f347e4a6effdb3c74b1e7d4f4e2871479674c38a new file mode 100644 index 0000000000..3b61ec2b65 --- /dev/null +++ b/.pnpm-store/v11/files/0f/0fc87f7f3e8be4e04d59702dc38b9120dd65a2db787c4c7450a5868477675a61ddd4e3e0a3102ce6096200f347e4a6effdb3c74b1e7d4f4e2871479674c38a @@ -0,0 +1,259 @@ +/* tslint:disable */ +/* eslint-disable */ +/* prettier-ignore */ + +/* auto-generated by NAPI-RS */ + +const { existsSync, readFileSync } = require('fs') +const { join } = require('path') + +const { platform, arch } = process + +let nativeBinding = null +let localFileExisted = false +let loadError = null + +function isMusl() { + // For Node 10 + if (!process.report || typeof process.report.getReport !== 'function') { + try { + const lddPath = require('child_process').execSync('which ldd').toString().trim() + return readFileSync(lddPath, 'utf8').includes('musl') + } catch (e) { + return true + } + } else { + const { glibcVersionRuntime } = process.report.getReport().header + return !glibcVersionRuntime + } +} + +switch (platform) { + case 'android': + switch (arch) { + case 'arm64': + localFileExisted = existsSync(join(__dirname, 'reflink.android-arm64.node')) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.android-arm64.node') + } else { + nativeBinding = require('@reflink/reflink-android-arm64') + } + } catch (e) { + loadError = e + } + break + case 'arm': + localFileExisted = existsSync(join(__dirname, 'reflink.android-arm-eabi.node')) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.android-arm-eabi.node') + } else { + nativeBinding = require('@reflink/reflink-android-arm-eabi') + } + } catch (e) { + loadError = e + } + break + default: + throw new Error(`Unsupported architecture on Android ${arch}`) + } + break + case 'win32': + switch (arch) { + case 'x64': + localFileExisted = existsSync( + join(__dirname, 'reflink.win32-x64-msvc.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.win32-x64-msvc.node') + } else { + nativeBinding = require('@reflink/reflink-win32-x64-msvc') + } + } catch (e) { + loadError = e + } + break + case 'ia32': + localFileExisted = existsSync( + join(__dirname, 'reflink.win32-ia32-msvc.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.win32-ia32-msvc.node') + } else { + nativeBinding = require('@reflink/reflink-win32-ia32-msvc') + } + } catch (e) { + loadError = e + } + break + case 'arm64': + localFileExisted = existsSync( + join(__dirname, 'reflink.win32-arm64-msvc.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.win32-arm64-msvc.node') + } else { + nativeBinding = require('@reflink/reflink-win32-arm64-msvc') + } + } catch (e) { + loadError = e + } + break + default: + throw new Error(`Unsupported architecture on Windows: ${arch}`) + } + break + case 'darwin': + localFileExisted = existsSync(join(__dirname, 'reflink.darwin-universal.node')) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.darwin-universal.node') + } else { + nativeBinding = require('@reflink/reflink-darwin-universal') + } + break + } catch {} + switch (arch) { + case 'x64': + localFileExisted = existsSync(join(__dirname, 'reflink.darwin-x64.node')) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.darwin-x64.node') + } else { + nativeBinding = require('@reflink/reflink-darwin-x64') + } + } catch (e) { + loadError = e + } + break + case 'arm64': + localFileExisted = existsSync( + join(__dirname, 'reflink.darwin-arm64.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.darwin-arm64.node') + } else { + nativeBinding = require('@reflink/reflink-darwin-arm64') + } + } catch (e) { + loadError = e + } + break + default: + throw new Error(`Unsupported architecture on macOS: ${arch}`) + } + break + case 'freebsd': + if (arch !== 'x64') { + throw new Error(`Unsupported architecture on FreeBSD: ${arch}`) + } + localFileExisted = existsSync(join(__dirname, 'reflink.freebsd-x64.node')) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.freebsd-x64.node') + } else { + nativeBinding = require('@reflink/reflink-freebsd-x64') + } + } catch (e) { + loadError = e + } + break + case 'linux': + switch (arch) { + case 'x64': + if (isMusl()) { + localFileExisted = existsSync( + join(__dirname, 'reflink.linux-x64-musl.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.linux-x64-musl.node') + } else { + nativeBinding = require('@reflink/reflink-linux-x64-musl') + } + } catch (e) { + loadError = e + } + } else { + localFileExisted = existsSync( + join(__dirname, 'reflink.linux-x64-gnu.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.linux-x64-gnu.node') + } else { + nativeBinding = require('@reflink/reflink-linux-x64-gnu') + } + } catch (e) { + loadError = e + } + } + break + case 'arm64': + if (isMusl()) { + localFileExisted = existsSync( + join(__dirname, 'reflink.linux-arm64-musl.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.linux-arm64-musl.node') + } else { + nativeBinding = require('@reflink/reflink-linux-arm64-musl') + } + } catch (e) { + loadError = e + } + } else { + localFileExisted = existsSync( + join(__dirname, 'reflink.linux-arm64-gnu.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.linux-arm64-gnu.node') + } else { + nativeBinding = require('@reflink/reflink-linux-arm64-gnu') + } + } catch (e) { + loadError = e + } + } + break + case 'arm': + localFileExisted = existsSync( + join(__dirname, 'reflink.linux-arm-gnueabihf.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./reflink.linux-arm-gnueabihf.node') + } else { + nativeBinding = require('@reflink/reflink-linux-arm-gnueabihf') + } + } catch (e) { + loadError = e + } + break + default: + throw new Error(`Unsupported architecture on Linux: ${arch}`) + } + break + default: + throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`) +} + +if (!nativeBinding) { + if (loadError) { + throw loadError + } + throw new Error(`Failed to load native binding`) +} + +const { ReflinkError, reflinkFile, reflinkFileSync } = nativeBinding + +module.exports.ReflinkError = ReflinkError +module.exports.reflinkFile = reflinkFile +module.exports.reflinkFileSync = reflinkFileSync diff --git a/.pnpm-store/v11/files/0f/61a65797649517cc52177e85b10928a749ed61801900c9a0b81a052313b6c6a28699767da43248dcfc7baa90fceb162f9b481045214c575971dfe3d62a6421 b/.pnpm-store/v11/files/0f/61a65797649517cc52177e85b10928a749ed61801900c9a0b81a052313b6c6a28699767da43248dcfc7baa90fceb162f9b481045214c575971dfe3d62a6421 new file mode 100644 index 0000000000..0e3e86c743 --- /dev/null +++ b/.pnpm-store/v11/files/0f/61a65797649517cc52177e85b10928a749ed61801900c9a0b81a052313b6c6a28699767da43248dcfc7baa90fceb162f9b481045214c575971dfe3d62a6421 @@ -0,0 +1,174 @@ +# This file comes from +# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py +# Do not edit! Edit the upstream one instead. + +"""Python module for generating .ninja files. + +Note that this is emphatically not a required piece of Ninja; it's +just a helpful utility for build-file-generation systems that already +use Python. +""" + +import textwrap + + +def escape_path(word): + return word.replace("$ ", "$$ ").replace(" ", "$ ").replace(":", "$:") + + +class Writer: + def __init__(self, output, width=78): + self.output = output + self.width = width + + def newline(self): + self.output.write("\n") + + def comment(self, text): + for line in textwrap.wrap(text, self.width - 2): + self.output.write("# " + line + "\n") + + def variable(self, key, value, indent=0): + if value is None: + return + if isinstance(value, list): + value = " ".join(filter(None, value)) # Filter out empty strings. + self._line(f"{key} = {value}", indent) + + def pool(self, name, depth): + self._line("pool %s" % name) + self.variable("depth", depth, indent=1) + + def rule( + self, + name, + command, + description=None, + depfile=None, + generator=False, + pool=None, + restat=False, + rspfile=None, + rspfile_content=None, + deps=None, + ): + self._line("rule %s" % name) + self.variable("command", command, indent=1) + if description: + self.variable("description", description, indent=1) + if depfile: + self.variable("depfile", depfile, indent=1) + if generator: + self.variable("generator", "1", indent=1) + if pool: + self.variable("pool", pool, indent=1) + if restat: + self.variable("restat", "1", indent=1) + if rspfile: + self.variable("rspfile", rspfile, indent=1) + if rspfile_content: + self.variable("rspfile_content", rspfile_content, indent=1) + if deps: + self.variable("deps", deps, indent=1) + + def build( + self, outputs, rule, inputs=None, implicit=None, order_only=None, variables=None + ): + outputs = self._as_list(outputs) + all_inputs = self._as_list(inputs)[:] + out_outputs = list(map(escape_path, outputs)) + all_inputs = list(map(escape_path, all_inputs)) + + if implicit: + implicit = map(escape_path, self._as_list(implicit)) + all_inputs.append("|") + all_inputs.extend(implicit) + if order_only: + order_only = map(escape_path, self._as_list(order_only)) + all_inputs.append("||") + all_inputs.extend(order_only) + + self._line( + "build {}: {}".format(" ".join(out_outputs), " ".join([rule] + all_inputs)) + ) + + if variables: + if isinstance(variables, dict): + iterator = iter(variables.items()) + else: + iterator = iter(variables) + + for key, val in iterator: + self.variable(key, val, indent=1) + + return outputs + + def include(self, path): + self._line("include %s" % path) + + def subninja(self, path): + self._line("subninja %s" % path) + + def default(self, paths): + self._line("default %s" % " ".join(self._as_list(paths))) + + def _count_dollars_before_index(self, s, i): + """Returns the number of '$' characters right in front of s[i].""" + dollar_count = 0 + dollar_index = i - 1 + while dollar_index > 0 and s[dollar_index] == "$": + dollar_count += 1 + dollar_index -= 1 + return dollar_count + + def _line(self, text, indent=0): + """Write 'text' word-wrapped at self.width characters.""" + leading_space = " " * indent + while len(leading_space) + len(text) > self.width: + # The text is too wide; wrap if possible. + + # Find the rightmost space that would obey our width constraint and + # that's not an escaped space. + available_space = self.width - len(leading_space) - len(" $") + space = available_space + while True: + space = text.rfind(" ", 0, space) + if space < 0 or self._count_dollars_before_index(text, space) % 2 == 0: + break + + if space < 0: + # No such space; just use the first unescaped space we can find. + space = available_space - 1 + while True: + space = text.find(" ", space + 1) + if ( + space < 0 + or self._count_dollars_before_index(text, space) % 2 == 0 + ): + break + if space < 0: + # Give up on breaking. + break + + self.output.write(leading_space + text[0:space] + " $\n") + text = text[space + 1 :] + + # Subsequent lines are continuations, so indent them. + leading_space = " " * (indent + 2) + + self.output.write(leading_space + text + "\n") + + def _as_list(self, input): + if input is None: + return [] + if isinstance(input, list): + return input + return [input] + + +def escape(string): + """Escape a string such that it can be embedded into a Ninja file without + further interpretation.""" + assert "\n" not in string, "Ninja syntax does not allow newlines" + # We only have one special metacharacter: '$'. + return string.replace("$", "$$") diff --git a/.pnpm-store/v11/files/10/2fa7074103f50800926424fc1e5a7baef84e2e7c5e50517130c3c08f1a24c248f3067a2a6d02686b4851974c9ad02a05daf315fb1031b9e1ff4f3f881e018c b/.pnpm-store/v11/files/10/2fa7074103f50800926424fc1e5a7baef84e2e7c5e50517130c3c08f1a24c248f3067a2a6d02686b4851974c9ad02a05daf315fb1031b9e1ff4f3f881e018c new file mode 100644 index 0000000000..b70ba1f2cd --- /dev/null +++ b/.pnpm-store/v11/files/10/2fa7074103f50800926424fc1e5a7baef84e2e7c5e50517130c3c08f1a24c248f3067a2a6d02686b4851974c9ad02a05daf315fb1031b9e1ff4f3f881e018c @@ -0,0 +1,363 @@ +import assert from 'assert'; +import { Buffer } from 'buffer'; +import { Minipass } from 'minipass'; +import * as realZlib from 'zlib'; +import { constants } from './constants.js'; +export { constants } from './constants.js'; +const OriginalBufferConcat = Buffer.concat; +const desc = Object.getOwnPropertyDescriptor(Buffer, 'concat'); +const noop = (args) => args; +const passthroughBufferConcat = desc?.writable === true || desc?.set !== undefined + ? (makeNoOp) => { + Buffer.concat = makeNoOp ? noop : OriginalBufferConcat; + } + : (_) => { }; +const _superWrite = Symbol('_superWrite'); +export class ZlibError extends Error { + code; + errno; + constructor(err, origin) { + super('zlib: ' + err.message, { cause: err }); + this.code = err.code; + this.errno = err.errno; + /* c8 ignore next */ + if (!this.code) + this.code = 'ZLIB_ERROR'; + this.message = 'zlib: ' + err.message; + Error.captureStackTrace(this, origin ?? this.constructor); + } + get name() { + return 'ZlibError'; + } +} +// the Zlib class they all inherit from +// This thing manages the queue of requests, and returns +// true or false if there is anything in the queue when +// you call the .write() method. +const _flushFlag = Symbol('flushFlag'); +class ZlibBase extends Minipass { + #sawError = false; + #ended = false; + #flushFlag; + #finishFlushFlag; + #fullFlushFlag; + #handle; + #onError; + get sawError() { + return this.#sawError; + } + get handle() { + return this.#handle; + } + /* c8 ignore start */ + get flushFlag() { + return this.#flushFlag; + } + /* c8 ignore stop */ + constructor(opts, mode) { + if (!opts || typeof opts !== 'object') + throw new TypeError('invalid options for ZlibBase constructor'); + //@ts-ignore + super(opts); + /* c8 ignore start */ + this.#flushFlag = opts.flush ?? 0; + this.#finishFlushFlag = opts.finishFlush ?? 0; + this.#fullFlushFlag = opts.fullFlushFlag ?? 0; + /* c8 ignore stop */ + //@ts-ignore + if (typeof realZlib[mode] !== 'function') { + throw new TypeError('Compression method not supported: ' + mode); + } + // this will throw if any options are invalid for the class selected + try { + // @types/node doesn't know that it exports the classes, but they're there + //@ts-ignore + this.#handle = new realZlib[mode](opts); + } + catch (er) { + // make sure that all errors get decorated properly + throw new ZlibError(er, this.constructor); + } + this.#onError = err => { + // no sense raising multiple errors, since we abort on the first one. + if (this.#sawError) + return; + this.#sawError = true; + // there is no way to cleanly recover. + // continuing only obscures problems. + this.close(); + this.emit('error', err); + }; + this.#handle?.on('error', er => this.#onError(new ZlibError(er))); + this.once('end', () => this.close); + } + close() { + if (this.#handle) { + this.#handle.close(); + this.#handle = undefined; + this.emit('close'); + } + } + reset() { + if (!this.#sawError) { + assert(this.#handle, 'zlib binding closed'); + //@ts-ignore + return this.#handle.reset?.(); + } + } + flush(flushFlag) { + if (this.ended) + return; + if (typeof flushFlag !== 'number') + flushFlag = this.#fullFlushFlag; + this.write(Object.assign(Buffer.alloc(0), { [_flushFlag]: flushFlag })); + } + end(chunk, encoding, cb) { + /* c8 ignore start */ + if (typeof chunk === 'function') { + cb = chunk; + encoding = undefined; + chunk = undefined; + } + if (typeof encoding === 'function') { + cb = encoding; + encoding = undefined; + } + /* c8 ignore stop */ + if (chunk) { + if (encoding) + this.write(chunk, encoding); + else + this.write(chunk); + } + this.flush(this.#finishFlushFlag); + this.#ended = true; + return super.end(cb); + } + get ended() { + return this.#ended; + } + // overridden in the gzip classes to do portable writes + [_superWrite](data) { + return super.write(data); + } + write(chunk, encoding, cb) { + // process the chunk using the sync process + // then super.write() all the outputted chunks + if (typeof encoding === 'function') + (cb = encoding), (encoding = 'utf8'); + if (typeof chunk === 'string') + chunk = Buffer.from(chunk, encoding); + if (this.#sawError) + return; + assert(this.#handle, 'zlib binding closed'); + // _processChunk tries to .close() the native handle after it's done, so we + // intercept that by temporarily making it a no-op. + // diving into the node:zlib internals a bit here + const nativeHandle = this.#handle + ._handle; + const originalNativeClose = nativeHandle.close; + nativeHandle.close = () => { }; + const originalClose = this.#handle.close; + this.#handle.close = () => { }; + // It also calls `Buffer.concat()` at the end, which may be convenient + // for some, but which we are not interested in as it slows us down. + passthroughBufferConcat(true); + let result = undefined; + try { + const flushFlag = typeof chunk[_flushFlag] === 'number' + ? chunk[_flushFlag] + : this.#flushFlag; + result = this.#handle._processChunk(chunk, flushFlag); + // if we don't throw, reset it back how it was + passthroughBufferConcat(false); + } + catch (err) { + // or if we do, put Buffer.concat() back before we emit error + // Error events call into user code, which may call Buffer.concat() + passthroughBufferConcat(false); + this.#onError(new ZlibError(err, this.write)); + } + finally { + if (this.#handle) { + // Core zlib resets `_handle` to null after attempting to close the + // native handle. Our no-op handler prevented actual closure, but we + // need to restore the `._handle` property. + ; + this.#handle._handle = + nativeHandle; + nativeHandle.close = originalNativeClose; + this.#handle.close = originalClose; + // `_processChunk()` adds an 'error' listener. If we don't remove it + // after each call, these handlers start piling up. + this.#handle.removeAllListeners('error'); + // make sure OUR error listener is still attached tho + } + } + if (this.#handle) + this.#handle.on('error', er => this.#onError(new ZlibError(er, this.write))); + let writeReturn; + if (result) { + if (Array.isArray(result) && result.length > 0) { + const r = result[0]; + // The first buffer is always `handle._outBuffer`, which would be + // re-used for later invocations; so, we always have to copy that one. + writeReturn = this[_superWrite](Buffer.from(r)); + for (let i = 1; i < result.length; i++) { + writeReturn = this[_superWrite](result[i]); + } + } + else { + // either a single Buffer or an empty array + writeReturn = this[_superWrite](Buffer.from(result)); + } + } + if (cb) + cb(); + return writeReturn; + } +} +export class Zlib extends ZlibBase { + #level; + #strategy; + constructor(opts, mode) { + opts = opts || {}; + opts.flush = opts.flush || constants.Z_NO_FLUSH; + opts.finishFlush = opts.finishFlush || constants.Z_FINISH; + opts.fullFlushFlag = constants.Z_FULL_FLUSH; + super(opts, mode); + this.#level = opts.level; + this.#strategy = opts.strategy; + } + params(level, strategy) { + if (this.sawError) + return; + if (!this.handle) + throw new Error('cannot switch params when binding is closed'); + // no way to test this without also not supporting params at all + /* c8 ignore start */ + if (!this.handle.params) + throw new Error('not supported in this implementation'); + /* c8 ignore stop */ + if (this.#level !== level || this.#strategy !== strategy) { + this.flush(constants.Z_SYNC_FLUSH); + assert(this.handle, 'zlib binding closed'); + // .params() calls .flush(), but the latter is always async in the + // core zlib. We override .flush() temporarily to intercept that and + // flush synchronously. + const origFlush = this.handle.flush; + this.handle.flush = (flushFlag, cb) => { + /* c8 ignore start */ + if (typeof flushFlag === 'function') { + cb = flushFlag; + flushFlag = this.flushFlag; + } + /* c8 ignore stop */ + this.flush(flushFlag); + cb?.(); + }; + try { + ; + this.handle.params(level, strategy); + } + finally { + this.handle.flush = origFlush; + } + /* c8 ignore start */ + if (this.handle) { + this.#level = level; + this.#strategy = strategy; + } + /* c8 ignore stop */ + } + } +} +// minimal 2-byte header +export class Deflate extends Zlib { + constructor(opts) { + super(opts, 'Deflate'); + } +} +export class Inflate extends Zlib { + constructor(opts) { + super(opts, 'Inflate'); + } +} +export class Gzip extends Zlib { + #portable; + constructor(opts) { + super(opts, 'Gzip'); + this.#portable = opts && !!opts.portable; + } + [_superWrite](data) { + if (!this.#portable) + return super[_superWrite](data); + // we'll always get the header emitted in one first chunk + // overwrite the OS indicator byte with 0xFF + this.#portable = false; + data[9] = 255; + return super[_superWrite](data); + } +} +export class Gunzip extends Zlib { + constructor(opts) { + super(opts, 'Gunzip'); + } +} +// raw - no header +export class DeflateRaw extends Zlib { + constructor(opts) { + super(opts, 'DeflateRaw'); + } +} +export class InflateRaw extends Zlib { + constructor(opts) { + super(opts, 'InflateRaw'); + } +} +// auto-detect header. +export class Unzip extends Zlib { + constructor(opts) { + super(opts, 'Unzip'); + } +} +class Brotli extends ZlibBase { + constructor(opts, mode) { + opts = opts || {}; + opts.flush = opts.flush || constants.BROTLI_OPERATION_PROCESS; + opts.finishFlush = + opts.finishFlush || constants.BROTLI_OPERATION_FINISH; + opts.fullFlushFlag = constants.BROTLI_OPERATION_FLUSH; + super(opts, mode); + } +} +export class BrotliCompress extends Brotli { + constructor(opts) { + super(opts, 'BrotliCompress'); + } +} +export class BrotliDecompress extends Brotli { + constructor(opts) { + super(opts, 'BrotliDecompress'); + } +} +class Zstd extends ZlibBase { + constructor(opts, mode) { + opts = opts || {}; + opts.flush = opts.flush || constants.ZSTD_e_continue; + opts.finishFlush = opts.finishFlush || constants.ZSTD_e_end; + opts.fullFlushFlag = constants.ZSTD_e_flush; + super(opts, mode); + } +} +export class ZstdCompress extends Zstd { + constructor(opts) { + super(opts, 'ZstdCompress'); + } +} +export class ZstdDecompress extends Zstd { + constructor(opts) { + super(opts, 'ZstdDecompress'); + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/10/f6c8309a2c4261715b6e5e26becf31252e0964879287e79c62aaf93eed3a5024e5066a62d31db64d60896ae534d4e10f21b075feef548b532f4797ff506766 b/.pnpm-store/v11/files/10/f6c8309a2c4261715b6e5e26becf31252e0964879287e79c62aaf93eed3a5024e5066a62d31db64d60896ae534d4e10f21b075feef548b532f4797ff506766 new file mode 100644 index 0000000000..dd0d648d49 --- /dev/null +++ b/.pnpm-store/v11/files/10/f6c8309a2c4261715b6e5e26becf31252e0964879287e79c62aaf93eed3a5024e5066a62d31db64d60896ae534d4e10f21b075feef548b532f4797ff506766 @@ -0,0 +1,192 @@ +import contextlib +import re +from dataclasses import dataclass +from typing import Dict, Iterator, NoReturn, Optional, Tuple, Union + +from .specifiers import Specifier + + +@dataclass +class Token: + name: str + text: str + position: int + + +class ParserSyntaxError(Exception): + """The provided source text could not be parsed correctly.""" + + def __init__( + self, + message: str, + *, + source: str, + span: Tuple[int, int], + ) -> None: + self.span = span + self.message = message + self.source = source + + super().__init__() + + def __str__(self) -> str: + marker = " " * self.span[0] + "~" * (self.span[1] - self.span[0]) + "^" + return "\n ".join([self.message, self.source, marker]) + + +DEFAULT_RULES: "Dict[str, Union[str, re.Pattern[str]]]" = { + "LEFT_PARENTHESIS": r"\(", + "RIGHT_PARENTHESIS": r"\)", + "LEFT_BRACKET": r"\[", + "RIGHT_BRACKET": r"\]", + "SEMICOLON": r";", + "COMMA": r",", + "QUOTED_STRING": re.compile( + r""" + ( + ('[^']*') + | + ("[^"]*") + ) + """, + re.VERBOSE, + ), + "OP": r"(===|==|~=|!=|<=|>=|<|>)", + "BOOLOP": r"\b(or|and)\b", + "IN": r"\bin\b", + "NOT": r"\bnot\b", + "VARIABLE": re.compile( + r""" + \b( + python_version + |python_full_version + |os[._]name + |sys[._]platform + |platform_(release|system) + |platform[._](version|machine|python_implementation) + |python_implementation + |implementation_(name|version) + |extra + )\b + """, + re.VERBOSE, + ), + "SPECIFIER": re.compile( + Specifier._operator_regex_str + Specifier._version_regex_str, + re.VERBOSE | re.IGNORECASE, + ), + "AT": r"\@", + "URL": r"[^ \t]+", + "IDENTIFIER": r"\b[a-zA-Z0-9][a-zA-Z0-9._-]*\b", + "VERSION_PREFIX_TRAIL": r"\.\*", + "VERSION_LOCAL_LABEL_TRAIL": r"\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*", + "WS": r"[ \t]+", + "END": r"$", +} + + +class Tokenizer: + """Context-sensitive token parsing. + + Provides methods to examine the input stream to check whether the next token + matches. + """ + + def __init__( + self, + source: str, + *, + rules: "Dict[str, Union[str, re.Pattern[str]]]", + ) -> None: + self.source = source + self.rules: Dict[str, re.Pattern[str]] = { + name: re.compile(pattern) for name, pattern in rules.items() + } + self.next_token: Optional[Token] = None + self.position = 0 + + def consume(self, name: str) -> None: + """Move beyond provided token name, if at current position.""" + if self.check(name): + self.read() + + def check(self, name: str, *, peek: bool = False) -> bool: + """Check whether the next token has the provided name. + + By default, if the check succeeds, the token *must* be read before + another check. If `peek` is set to `True`, the token is not loaded and + would need to be checked again. + """ + assert ( + self.next_token is None + ), f"Cannot check for {name!r}, already have {self.next_token!r}" + assert name in self.rules, f"Unknown token name: {name!r}" + + expression = self.rules[name] + + match = expression.match(self.source, self.position) + if match is None: + return False + if not peek: + self.next_token = Token(name, match[0], self.position) + return True + + def expect(self, name: str, *, expected: str) -> Token: + """Expect a certain token name next, failing with a syntax error otherwise. + + The token is *not* read. + """ + if not self.check(name): + raise self.raise_syntax_error(f"Expected {expected}") + return self.read() + + def read(self) -> Token: + """Consume the next token and return it.""" + token = self.next_token + assert token is not None + + self.position += len(token.text) + self.next_token = None + + return token + + def raise_syntax_error( + self, + message: str, + *, + span_start: Optional[int] = None, + span_end: Optional[int] = None, + ) -> NoReturn: + """Raise ParserSyntaxError at the given position.""" + span = ( + self.position if span_start is None else span_start, + self.position if span_end is None else span_end, + ) + raise ParserSyntaxError( + message, + source=self.source, + span=span, + ) + + @contextlib.contextmanager + def enclosing_tokens( + self, open_token: str, close_token: str, *, around: str + ) -> Iterator[None]: + if self.check(open_token): + open_position = self.position + self.read() + else: + open_position = None + + yield + + if open_position is None: + return + + if not self.check(close_token): + self.raise_syntax_error( + f"Expected matching {close_token} for {open_token}, after {around}", + span_start=open_position, + ) + + self.read() diff --git a/.pnpm-store/v11/files/12/ba5ad6f2befd4de078b600793eac246aec8b0e42b4c4b42d1b58b5b850da06a9b218573736e0f2bf3452a9e402d75f13e39585f2d58b15359e097e36d6995d b/.pnpm-store/v11/files/12/ba5ad6f2befd4de078b600793eac246aec8b0e42b4c4b42d1b58b5b850da06a9b218573736e0f2bf3452a9e402d75f13e39585f2d58b15359e097e36d6995d new file mode 100644 index 0000000000..f5db1ed762 --- /dev/null +++ b/.pnpm-store/v11/files/12/ba5ad6f2befd4de078b600793eac246aec8b0e42b4c4b42d1b58b5b850da06a9b218573736e0f2bf3452a9e402d75f13e39585f2d58b15359e097e36d6995d @@ -0,0 +1,307 @@ +import { readdir, readdirSync, realpath, realpathSync, stat, statSync } from "fs"; +import { isAbsolute, posix, resolve } from "path"; +import { fileURLToPath } from "url"; +import { fdir } from "fdir"; +import picomatch from "picomatch"; +//#region src/utils.ts +const isReadonlyArray = Array.isArray; +const BACKSLASHES = /\\/g; +const DRIVE_RELATIVE_PATH = /^[A-Za-z]:$/; +const isWin = process.platform === "win32"; +const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/; +function getPartialMatcher(patterns, options = {}) { + const patternsCount = patterns.length; + const patternsParts = Array(patternsCount); + const matchers = Array(patternsCount); + let i, j; + for (i = 0; i < patternsCount; i++) { + const parts = splitPattern(patterns[i]); + patternsParts[i] = parts; + const partsCount = parts.length; + const partMatchers = Array(partsCount); + for (j = 0; j < partsCount; j++) partMatchers[j] = picomatch(parts[j], options); + matchers[i] = partMatchers; + } + return (input) => { + const inputParts = input.split("/"); + if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return true; + for (i = 0; i < patternsCount; i++) { + const patternParts = patternsParts[i]; + const matcher = matchers[i]; + const inputPatternCount = inputParts.length; + const minParts = Math.min(inputPatternCount, patternParts.length); + j = 0; + while (j < minParts) { + const part = patternParts[j]; + if (part.includes("/")) return true; + if (!matcher[j](inputParts[j])) break; + if (!options.noglobstar && part === "**") return true; + j++; + } + if (j === inputPatternCount) return true; + } + return false; + }; +} +/* node:coverage ignore next 2 */ +const WIN32_ROOT_DIR = /^[A-Z]:\/$/i; +const isRoot = isWin ? (p) => WIN32_ROOT_DIR.test(p) : (p) => p === "/"; +function buildFormat(cwd, root, absolute) { + if (cwd === root || root.startsWith(`${cwd}/`)) { + if (absolute) { + const start = cwd.length + +!isRoot(cwd); + return (p, isDir) => p.slice(start, isDir ? -1 : void 0) || "."; + } + const prefix = root.slice(cwd.length + 1); + if (prefix) return (p, isDir) => { + if (p === ".") return prefix; + const result = `${prefix}/${p}`; + return isDir ? result.slice(0, -1) : result; + }; + return (p, isDir) => isDir && p !== "." ? p.slice(0, -1) : p; + } + if (absolute) return (p) => posix.relative(cwd, p) || "."; + return (p) => posix.relative(cwd, `${root}/${p}`) || "."; +} +function buildRelative(cwd, root) { + if (root.startsWith(`${cwd}/`)) { + const prefix = root.slice(cwd.length + 1); + return (p) => `${prefix}/${p}`; + } + return (p) => { + const result = posix.relative(cwd, `${root}/${p}`); + return p[p.length - 1] === "/" && result !== "" ? `${result}/` : result || "."; + }; +} +function ensureNonDriveRelativePath(path) { + return path.replace(DRIVE_RELATIVE_PATH, (match) => `${match}/`); +} +const splitPatternOptions = { parts: true }; +function splitPattern(path) { + var _result$parts; + const result = picomatch.scan(path, splitPatternOptions); + return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path]; +} +const ESCAPED_WIN32_BACKSLASHES = /\\(?![()[\]{}!+@])/g; +function convertPosixPathToPattern(path) { + return escapePosixPath(path); +} +function convertWin32PathToPattern(path) { + return escapeWin32Path(path).replace(ESCAPED_WIN32_BACKSLASHES, "/"); +} +/** +* Converts a path to a pattern depending on the platform. +* Identical to {@link escapePath} on POSIX systems. +* @see {@link https://superchupu.dev/tinyglobby/documentation#convertPathToPattern} +*/ +/* node:coverage ignore next 3 */ +const convertPathToPattern = isWin ? convertWin32PathToPattern : convertPosixPathToPattern; +const POSIX_UNESCAPED_GLOB_SYMBOLS = /(? path.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&"); +const escapeWin32Path = (path) => path.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&"); +/** +* Escapes a path's special characters depending on the platform. +* @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath} +*/ +/* node:coverage ignore next */ +const escapePath = isWin ? escapeWin32Path : escapePosixPath; +/** +* Checks if a pattern has dynamic parts. +* +* Has a few minor differences with [`fast-glob`](https://github.com/mrmlnc/fast-glob) for better accuracy: +* +* - Doesn't necessarily return `false` on patterns that include `\`. +* - Returns `true` if the pattern includes parentheses, regardless of them representing one single pattern or not. +* - Returns `true` for unfinished glob extensions i.e. `(h`, `+(h`. +* - Returns `true` for unfinished brace expansions as long as they include `,` or `..`. +* +* @see {@link https://superchupu.dev/tinyglobby/documentation#isDynamicPattern} +*/ +function isDynamicPattern(pattern, options) { + if ((options === null || options === void 0 ? void 0 : options.caseSensitiveMatch) === false) return true; + const scan = picomatch.scan(pattern); + return scan.isGlob || scan.negated; +} +function log(...tasks) { + console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks); +} +function ensureStringArray(value) { + return typeof value === "string" ? [value] : value !== null && value !== void 0 ? value : []; +} +//#endregion +//#region src/patterns.ts +const PARENT_DIRECTORY = /^(\/?\.\.)+/; +const ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g; +function normalizePattern(pattern, opts, props, isIgnore) { + var _PARENT_DIRECTORY$exe; + const cwd = opts.cwd; + let result = pattern; + if (pattern[pattern.length - 1] === "/") result = pattern.slice(0, -1); + if (result[result.length - 1] !== "*" && opts.expandDirectories) result += "/**"; + const escapedCwd = escapePath(cwd); + result = isAbsolute(result.replace(ESCAPING_BACKSLASHES, "")) ? posix.relative(escapedCwd, result) : posix.normalize(result); + const parentDir = (_PARENT_DIRECTORY$exe = PARENT_DIRECTORY.exec(result)) === null || _PARENT_DIRECTORY$exe === void 0 ? void 0 : _PARENT_DIRECTORY$exe[0]; + const parts = splitPattern(result); + if (parentDir) { + const n = (parentDir.length + 1) / 3; + let i = 0; + const cwdParts = escapedCwd.split("/"); + while (i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]) { + result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || "."; + i++; + } + const potentialRoot = posix.join(cwd, parentDir.slice(i * 3)); + if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) { + props.root = ensureNonDriveRelativePath(potentialRoot); + props.depthOffset = -n + i; + } + } + if (!isIgnore && props.depthOffset >= 0) { + var _props$commonPath; + (_props$commonPath = props.commonPath) !== null && _props$commonPath !== void 0 || (props.commonPath = parts); + const newCommonPath = []; + const length = Math.min(props.commonPath.length, parts.length); + for (let i = 0; i < length; i++) { + const part = parts[i]; + if (part === "**" && !parts[i + 1]) { + newCommonPath.pop(); + break; + } + if (i === parts.length - 1 || part !== props.commonPath[i] || isDynamicPattern(part)) break; + newCommonPath.push(part); + } + props.depthOffset = newCommonPath.length; + props.commonPath = newCommonPath; + props.root = ensureNonDriveRelativePath(newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd); + } + return result; +} +function processPatterns(options, patterns, props) { + const matchPatterns = []; + const ignorePatterns = []; + for (const pattern of options.ignore) { + if (!pattern) continue; + if (pattern[0] !== "!" || pattern[1] === "(") ignorePatterns.push(normalizePattern(pattern, options, props, true)); + } + for (const pattern of patterns) { + if (!pattern) continue; + if (pattern[0] !== "!" || pattern[1] === "(") matchPatterns.push(normalizePattern(pattern, options, props, false)); + else if (pattern[1] !== "!" || pattern[2] === "(") ignorePatterns.push(normalizePattern(pattern.slice(1), options, props, true)); + } + return { + match: matchPatterns, + ignore: ignorePatterns + }; +} +//#endregion +//#region src/crawler.ts +function buildCrawler(options, patterns) { + const cwd = options.cwd; + const props = { + root: cwd, + depthOffset: 0 + }; + const processed = processPatterns(options, patterns, props); + if (options.debug) log("internal processing patterns:", processed); + const { absolute, caseSensitiveMatch, debug, dot, followSymbolicLinks, onlyDirectories } = options; + const root = props.root.replace(BACKSLASHES, ""); + const matchOptions = { + dot, + nobrace: options.braceExpansion === false, + nocase: !caseSensitiveMatch, + noextglob: options.extglob === false, + noglobstar: options.globstar === false, + posix: true + }; + const matcher = picomatch(processed.match, matchOptions); + const ignore = picomatch(processed.ignore, matchOptions); + const partialMatcher = getPartialMatcher(processed.match, matchOptions); + const format = buildFormat(cwd, root, absolute); + const excludeFormatter = absolute ? format : buildFormat(cwd, root, true); + const excludePredicate = (_, p) => { + const relativePath = excludeFormatter(p, true); + return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath); + }; + let maxDepth; + if (options.deep !== void 0) maxDepth = Math.round(options.deep - props.depthOffset); + const crawler = new fdir({ + filters: [debug ? (p, isDirectory) => { + const path = format(p, isDirectory); + const matches = matcher(path) && !ignore(path); + if (matches) log(`matched ${path}`); + return matches; + } : (p, isDirectory) => { + const path = format(p, isDirectory); + return matcher(path) && !ignore(path); + }], + exclude: debug ? (_, p) => { + const skipped = excludePredicate(_, p); + log(`${skipped ? "skipped" : "crawling"} ${p}`); + return skipped; + } : excludePredicate, + fs: options.fs, + pathSeparator: "/", + relativePaths: !absolute, + resolvePaths: absolute, + includeBasePath: absolute, + resolveSymlinks: followSymbolicLinks, + excludeSymlinks: !followSymbolicLinks, + excludeFiles: onlyDirectories, + includeDirs: onlyDirectories || !options.onlyFiles, + maxDepth, + signal: options.signal + }).crawl(root); + if (options.debug) log("internal properties:", { + ...props, + root + }); + return [crawler, cwd !== root && !absolute && buildRelative(cwd, root)]; +} +//#endregion +//#region src/index.ts +function formatPaths(paths, mapper) { + if (mapper) for (let i = paths.length - 1; i >= 0; i--) paths[i] = mapper(paths[i]); + return paths; +} +const defaultOptions = { + caseSensitiveMatch: true, + debug: !!process.env.TINYGLOBBY_DEBUG, + expandDirectories: true, + followSymbolicLinks: true, + onlyFiles: true +}; +function getOptions(options) { + const opts = Object.assign({}, options); + for (const key in defaultOptions) if (opts[key] === void 0) Object.assign(opts, { [key]: defaultOptions[key] }); + opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve(opts.cwd || process.cwd())).replace(BACKSLASHES, "/"); + opts.ignore = ensureStringArray(opts.ignore); + opts.fs && (opts.fs = { + readdir: opts.fs.readdir || readdir, + readdirSync: opts.fs.readdirSync || readdirSync, + realpath: opts.fs.realpath || realpath, + realpathSync: opts.fs.realpathSync || realpathSync, + stat: opts.fs.stat || stat, + statSync: opts.fs.statSync || statSync + }); + if (opts.debug) log("globbing with options:", opts); + return opts; +} +function getCrawler(globInput, inputOptions = {}) { + var _ref; + if (globInput && (inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.patterns)) throw new Error("Cannot pass patterns as both an argument and an option"); + const isModern = isReadonlyArray(globInput) || typeof globInput === "string"; + const patterns = ensureStringArray((_ref = isModern ? globInput : globInput.patterns) !== null && _ref !== void 0 ? _ref : "**/*"); + const options = getOptions(isModern ? inputOptions : globInput); + return patterns.length > 0 ? buildCrawler(options, patterns) : []; +} +async function glob(globInput, options) { + const [crawler, relative] = getCrawler(globInput, options); + return crawler ? formatPaths(await crawler.withPromise(), relative) : []; +} +function globSync(globInput, options) { + const [crawler, relative] = getCrawler(globInput, options); + return crawler ? formatPaths(crawler.sync(), relative) : []; +} +//#endregion +export { convertPathToPattern, escapePath, glob, globSync, isDynamicPattern }; diff --git a/.pnpm-store/v11/files/13/228875c6e5b753a03538387f55451b6d298fd6f6bb3ab039a8d0c2eff1acdaf73923126d92d90f8f1ce85c9c4352f435be5db87c71d0f2e85a7b28548cba41 b/.pnpm-store/v11/files/13/228875c6e5b753a03538387f55451b6d298fd6f6bb3ab039a8d0c2eff1acdaf73923126d92d90f8f1ce85c9c4352f435be5db87c71d0f2e85a7b28548cba41 new file mode 100644 index 0000000000..7c52bdf252 --- /dev/null +++ b/.pnpm-store/v11/files/13/228875c6e5b753a03538387f55451b6d298fd6f6bb3ab039a8d0c2eff1acdaf73923126d92d90f8f1ce85c9c4352f435be5db87c71d0f2e85a7b28548cba41 @@ -0,0 +1,5 @@ +'use strict' + +const compare = require('./compare') +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte diff --git a/.pnpm-store/v11/files/14/09324d3cebd01bdb2fd70800dc54021a36d21c2076a8febd384d533faf7aef4b420107c29ae2687e7c53d4d64cb28e205cc3f62340fc6bc999bd31c70ea5cb b/.pnpm-store/v11/files/14/09324d3cebd01bdb2fd70800dc54021a36d21c2076a8febd384d533faf7aef4b420107c29ae2687e7c53d4d64cb28e205cc3f62340fc6bc999bd31c70ea5cb new file mode 100644 index 0000000000..72d22ff32b --- /dev/null +++ b/.pnpm-store/v11/files/14/09324d3cebd01bdb2fd70800dc54021a36d21c2076a8febd384d533faf7aef4b420107c29ae2687e7c53d4d64cb28e205cc3f62340fc6bc999bd31c70ea5cb @@ -0,0 +1,55 @@ +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""gypsh output module + +gypsh is a GYP shell. It's not really a generator per se. All it does is +fire up an interactive Python session with a few local variables set to the +variables passed to the generator. Like gypd, it's intended as a debugging +aid, to facilitate the exploration of .gyp structures after being processed +by the input module. + +The expected usage is "gyp -f gypsh -D OS=desired_os". +""" + +import code +import sys + +# All of this stuff about generator variables was lovingly ripped from gypd.py. +# That module has a much better description of what's going on and why. +_generator_identity_variables = [ + "EXECUTABLE_PREFIX", + "EXECUTABLE_SUFFIX", + "INTERMEDIATE_DIR", + "PRODUCT_DIR", + "RULE_INPUT_ROOT", + "RULE_INPUT_DIRNAME", + "RULE_INPUT_EXT", + "RULE_INPUT_NAME", + "RULE_INPUT_PATH", + "SHARED_INTERMEDIATE_DIR", +] + +generator_default_variables = {} + +for v in _generator_identity_variables: + generator_default_variables[v] = "<(%s)" % v + + +def GenerateOutput(target_list, target_dicts, data, params): + locals = { + "target_list": target_list, + "target_dicts": target_dicts, + "data": data, + } + + # Use a banner that looks like the stock Python one and like what + # code.interact uses by default, but tack on something to indicate what + # locals are available, and identify gypsh. + banner = ( + f"Python {sys.version} on {sys.platform}\nlocals.keys() = " + f"{sorted(locals.keys())!r}\ngypsh" + ) + + code.interact(banner, local=locals) diff --git a/.pnpm-store/v11/files/16/57a5bae0935f6744b4f8d7915f511940e339a352a95f95652dcb160688af599153fa70c0e99802deafebbf284959c5264000f81c19e0de04de565d16db9626 b/.pnpm-store/v11/files/16/57a5bae0935f6744b4f8d7915f511940e339a352a95f95652dcb160688af599153fa70c0e99802deafebbf284959c5264000f81c19e0de04de565d16db9626 new file mode 100644 index 0000000000..c6748e2e25 --- /dev/null +++ b/.pnpm-store/v11/files/16/57a5bae0935f6744b4f8d7915f511940e339a352a95f95652dcb160688af599153fa70c0e99802deafebbf284959c5264000f81c19e0de04de565d16db9626 @@ -0,0 +1,3 @@ +// separate file so I stop getting nagged in vim about deprecated API. +export const umask = () => process.umask(); +//# sourceMappingURL=process-umask.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/16/a2e1ab242ac2ae59ee0329789525d548b0739b5ca0903ea0e24ce363a5271ebbd181e32d671125b584b06b1dae67db33a8bc35817b38c27e1f8b175525f5d7 b/.pnpm-store/v11/files/16/a2e1ab242ac2ae59ee0329789525d548b0739b5ca0903ea0e24ce363a5271ebbd181e32d671125b584b06b1dae67db33a8bc35817b38c27e1f8b175525f5d7 new file mode 100644 index 0000000000..2c75e67cdf --- /dev/null +++ b/.pnpm-store/v11/files/16/a2e1ab242ac2ae59ee0329789525d548b0739b5ca0903ea0e24ce363a5271ebbd181e32d671125b584b06b1dae67db33a8bc35817b38c27e1f8b175525f5d7 @@ -0,0 +1,58 @@ +/** + * This is the Windows implementation of isexe, which uses the file + * extension and PATHEXT setting. + * + * @module + */ +import { statSync } from 'node:fs'; +import { stat } from 'node:fs/promises'; +import { delimiter } from 'node:path'; +/** + * Determine whether a path is executable based on the file extension + * and PATHEXT environment variable (or specified pathExt option) + */ +export const isexe = async (path, options = {}) => { + const { ignoreErrors = false } = options; + try { + return checkStat(await stat(path), path, options); + } + catch (e) { + const er = e; + if (ignoreErrors || er.code === 'EACCES') + return false; + throw er; + } +}; +/** + * Synchronously determine whether a path is executable based on the file + * extension and PATHEXT environment variable (or specified pathExt option) + */ +export const sync = (path, options = {}) => { + const { ignoreErrors = false } = options; + try { + return checkStat(statSync(path), path, options); + } + catch (e) { + const er = e; + if (ignoreErrors || er.code === 'EACCES') + return false; + throw er; + } +}; +const checkPathExt = (path, options) => { + const { pathExt = process.env.PATHEXT || '' } = options; + const peSplit = pathExt.split(delimiter); + if (peSplit.indexOf('') !== -1) { + return true; + } + for (const pes of peSplit) { + const p = pes.toLowerCase(); + const ext = path.substring(path.length - p.length).toLowerCase(); + if (p && ext === p) { + return true; + } + } + return false; +}; +const checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options); +//# sourceMappingURL=win32.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/1a/4a4ab95ac709c8db42455d430304c0364ccd3e5ae79e7ac052bf51bf25decfa7ee0ede72462f0da8eaefc00076548de73c893b3bb9fcf58ab3d46458004974 b/.pnpm-store/v11/files/1a/4a4ab95ac709c8db42455d430304c0364ccd3e5ae79e7ac052bf51bf25decfa7ee0ede72462f0da8eaefc00076548de73c893b3bb9fcf58ab3d46458004974 new file mode 100644 index 0000000000..0db67edcb5 --- /dev/null +++ b/.pnpm-store/v11/files/1a/4a4ab95ac709c8db42455d430304c0364ccd3e5ae79e7ac052bf51bf25decfa7ee0ede72462f0da8eaefc00076548de73c893b3bb9fcf58ab3d46458004974 @@ -0,0 +1,8 @@ +'use strict' + +const parse = require('./parse') +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null +} +module.exports = valid diff --git a/.pnpm-store/v11/files/1b/67667b6937f3776ca978d5fc3e646f4044f739b81f195ec53170992c11aaeb44b0927efd105fb1dd91e4d9419ee67909a4709eeefc1ad2f32a0dc2b4ccd91e b/.pnpm-store/v11/files/1b/67667b6937f3776ca978d5fc3e646f4044f739b81f195ec53170992c11aaeb44b0927efd105fb1dd91e4d9419ee67909a4709eeefc1ad2f32a0dc2b4ccd91e new file mode 100644 index 0000000000..eb2292a21e --- /dev/null +++ b/.pnpm-store/v11/files/1b/67667b6937f3776ca978d5fc3e646f4044f739b81f195ec53170992c11aaeb44b0927efd105fb1dd91e4d9419ee67909a4709eeefc1ad2f32a0dc2b4ccd91e @@ -0,0 +1,23 @@ +{ + "name": "@reflink/reflink-win32-arm64-msvc", + "version": "0.1.19", + "repository": { + "url": "https://github.com/pnpm/reflink.git", + "type": "git", + "directory": "win32-arm64-msvc" + }, + "os": [ + "win32" + ], + "cpu": [ + "arm64" + ], + "main": "reflink.win32-arm64-msvc.node", + "files": [ + "reflink.win32-arm64-msvc.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} \ No newline at end of file diff --git a/.pnpm-store/v11/files/1e/69c89558ffe39e5c1ebb6728c4f0eb6023563c7a7f31b5417a8efcc906378d2e2af7b0e06a66980fbaab7996aeb2ae1ea3918fdbe5ffcc3f77ea888a68efbc b/.pnpm-store/v11/files/1e/69c89558ffe39e5c1ebb6728c4f0eb6023563c7a7f31b5417a8efcc906378d2e2af7b0e06a66980fbaab7996aeb2ae1ea3918fdbe5ffcc3f77ea888a68efbc new file mode 100644 index 0000000000..6f62d44e4e --- /dev/null +++ b/.pnpm-store/v11/files/1e/69c89558ffe39e5c1ebb6728c4f0eb6023563c7a7f31b5417a8efcc906378d2e2af7b0e06a66980fbaab7996aeb2ae1ea3918fdbe5ffcc3f77ea888a68efbc @@ -0,0 +1,3 @@ +This software is made available under the terms of *either* of the licenses +found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made +under the terms of *both* these licenses. diff --git a/.pnpm-store/v11/files/1f/1ec2fed66a13c4fb0cfc73046a324096d1f6d22281637a5da2c4101faf5f90d874f633e41f328c9810cd0c8692a9a2e718910826549177b56e6c4f8fb0f83f b/.pnpm-store/v11/files/1f/1ec2fed66a13c4fb0cfc73046a324096d1f6d22281637a5da2c4101faf5f90d874f633e41f328c9810cd0c8692a9a2e718910826549177b56e6c4f8fb0f83f new file mode 100644 index 0000000000..5d3d200968 --- /dev/null +++ b/.pnpm-store/v11/files/1f/1ec2fed66a13c4fb0cfc73046a324096d1f6d22281637a5da2c4101faf5f90d874f633e41f328c9810cd0c8692a9a2e718910826549177b56e6c4f8fb0f83f @@ -0,0 +1,5 @@ +'use strict' + +const compareBuild = require('./compare-build') +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort diff --git a/.pnpm-store/v11/files/20/803f52da551bbc042be1537441c7ca4607e3c8017fea61c225571487f070812f523d2cc93c6250229f193c825d0c1f17482923cb7a790f85fd7a299a4a2213 b/.pnpm-store/v11/files/20/803f52da551bbc042be1537441c7ca4607e3c8017fea61c225571487f070812f523d2cc93c6250229f193c825d0c1f17482923cb7a790f85fd7a299a4a2213 new file mode 100644 index 0000000000..75f3fc136a --- /dev/null +++ b/.pnpm-store/v11/files/20/803f52da551bbc042be1537441c7ca4607e3c8017fea61c225571487f070812f523d2cc93c6250229f193c825d0c1f17482923cb7a790f85fd7a299a4a2213 @@ -0,0 +1,144 @@ +'use strict' + +const semver = require('semver') +const path = require('path') +const log = require('./log') + +// versions where -headers.tar.gz started shipping +const headersTarballRange = '>= 3.0.0 || ~0.12.10 || ~0.10.42' +const bitsre = /\/win-(x86|x64|arm64)\// +const bitsreV3 = /\/win-(x86|ia32|x64)\// // io.js v3.x.x shipped with "ia32" but should +// have been "x86" + +// Captures all the logic required to determine download URLs, local directory and +// file names. Inputs come from command-line switches (--target, --dist-url), +// `process.version` and `process.release` where it exists. +function processRelease (argv, gyp, defaultVersion, defaultRelease) { + let version = (semver.valid(argv[0]) && argv[0]) || gyp.opts.target || defaultVersion + const versionSemver = semver.parse(version) + let overrideDistUrl = gyp.opts['dist-url'] || gyp.opts.disturl + let isNamedForLegacyIojs + let name + let distBaseUrl + let baseUrl + let libUrl32 + let libUrl64 + let libUrlArm64 + let tarballUrl + let canGetHeaders + + if (!versionSemver) { + // not a valid semver string, nothing we can do + return { version } + } + // flatten version into String + version = versionSemver.version + + // defaultVersion should come from process.version so ought to be valid semver + const isDefaultVersion = version === semver.parse(defaultVersion).version + + // can't use process.release if we're using --target=x.y.z + if (!isDefaultVersion) { + defaultRelease = null + } + + if (defaultRelease) { + // v3 onward, has process.release + name = defaultRelease.name.replace(/io\.js/, 'iojs') // remove the '.' for directory naming purposes + } else { + // old node or alternative --target= + // semver.satisfies() doesn't like prerelease tags so test major directly + isNamedForLegacyIojs = versionSemver.major >= 1 && versionSemver.major < 4 + // isNamedForLegacyIojs is required to support Electron < 4 (in particular Electron 3) + // as previously this logic was used to ensure "iojs" was used to download iojs releases + // and "node" for node releases. Unfortunately the logic was broad enough that electron@3 + // published release assets as "iojs" so that the node-gyp logic worked. Once Electron@3 has + // been EOL for a while (late 2019) we should remove this hack. + name = isNamedForLegacyIojs ? 'iojs' : 'node' + } + + // check for the nvm.sh standard mirror env variables + if (!overrideDistUrl && process.env.NODEJS_ORG_MIRROR) { + overrideDistUrl = process.env.NODEJS_ORG_MIRROR + } + + if (overrideDistUrl) { + log.verbose('download', 'using dist-url', overrideDistUrl) + } + + if (overrideDistUrl) { + distBaseUrl = overrideDistUrl.replace(/\/+$/, '') + } else { + distBaseUrl = 'https://nodejs.org/dist' + } + distBaseUrl = new URL(distBaseUrl + '/v' + version + '/') + + // new style, based on process.release so we have a lot of the data we need + if (defaultRelease && defaultRelease.headersUrl && !overrideDistUrl) { + baseUrl = new URL('./', defaultRelease.headersUrl) + libUrl32 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x86', versionSemver.major) + libUrl64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x64', versionSemver.major) + libUrlArm64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'arm64', versionSemver.major) + tarballUrl = defaultRelease.headersUrl + } else { + // older versions without process.release are captured here and we have to make + // a lot of assumptions, additionally if you --target=x.y.z then we can't use the + // current process.release + baseUrl = distBaseUrl + libUrl32 = resolveLibUrl(name, baseUrl, 'x86', versionSemver.major) + libUrl64 = resolveLibUrl(name, baseUrl, 'x64', versionSemver.major) + libUrlArm64 = resolveLibUrl(name, baseUrl, 'arm64', versionSemver.major) + + // making the bold assumption that anything with a version number >3.0.0 will + // have a *-headers.tar.gz file in its dist location, even some frankenstein + // custom version + canGetHeaders = semver.satisfies(versionSemver, headersTarballRange) + tarballUrl = new URL(name + '-v' + version + (canGetHeaders ? '-headers' : '') + '.tar.gz', baseUrl).href + } + + return { + version, + semver: versionSemver, + name, + baseUrl: baseUrl.href, + tarballUrl, + shasumsUrl: new URL('SHASUMS256.txt', baseUrl).href, + versionDir: (name !== 'node' ? name + '-' : '') + version, + ia32: { + libUrl: libUrl32.href, + libPath: normalizePath(path.relative(baseUrl.pathname, libUrl32.pathname)) + }, + x64: { + libUrl: libUrl64.href, + libPath: normalizePath(path.relative(baseUrl.pathname, libUrl64.pathname)) + }, + arm64: { + libUrl: libUrlArm64.href, + libPath: normalizePath(path.relative(baseUrl.pathname, libUrlArm64.pathname)) + } + } +} + +function normalizePath (p) { + return path.normalize(p).replace(/\\/g, '/') +} + +function resolveLibUrl (name, defaultUrl, arch, versionMajor) { + if (!defaultUrl.pathname) defaultUrl = new URL(defaultUrl) + const base = new URL('./', defaultUrl) + const hasLibUrl = bitsre.test(defaultUrl.pathname) || (versionMajor === 3 && bitsreV3.test(defaultUrl.pathname)) + + if (!hasLibUrl) { + // let's assume it's a baseUrl then + if (versionMajor >= 1) { + return new URL('win-' + arch + '/' + name + '.lib', base) + } + // prior to io.js@1.0.0 32-bit node.lib lives in /, 64-bit lives in /x64/ + return new URL((arch === 'x86' ? '' : arch + '/') + name + '.lib', base) + } + + // else we have a proper url to a .lib, just make sure it's the right arch + return new URL(defaultUrl.pathname.replace(versionMajor === 3 ? bitsreV3 : bitsre, '/win-' + arch + '/'), defaultUrl) +} + +module.exports = processRelease diff --git a/.pnpm-store/v11/files/21/5f1f321fe4e4954972de8475a7e6f4273bd7b6a9fc93600de73cf391385ac2ee5e7f32ae21f6a144448cf97dd1b07d27d8736e62c7ade899c4ff4907e8a063 b/.pnpm-store/v11/files/21/5f1f321fe4e4954972de8475a7e6f4273bd7b6a9fc93600de73cf391385ac2ee5e7f32ae21f6a144448cf97dd1b07d27d8736e62c7ade899c4ff4907e8a063 new file mode 100644 index 0000000000..8cf6fb93e6 --- /dev/null +++ b/.pnpm-store/v11/files/21/5f1f321fe4e4954972de8475a7e6f4273bd7b6a9fc93600de73cf391385ac2ee5e7f32ae21f6a144448cf97dd1b07d27d8736e62c7ade899c4ff4907e8a063 @@ -0,0 +1,31 @@ +###-begin-{pkgname}-completion-### +if type complete &>/dev/null; then + _{pkgname}_completion () { + local words cword + if type _get_comp_words_by_ref &>/dev/null; then + _get_comp_words_by_ref -n = -n @ -n : -w words -i cword + else + cword="$COMP_CWORD" + words=("${COMP_WORDS[@]}") + fi + + local si="$IFS" + IFS=$'\n' COMPREPLY=($(COMP_CWORD="$cword" \ + COMP_LINE="$COMP_LINE" \ + COMP_POINT="$COMP_POINT" \ + SHELL=bash \ + {completer} completion-server -- "${words[@]}" \ + 2>/dev/null)) || return $? + IFS="$si" + + if [ "$COMPREPLY" = "__tabtab_complete_files__" ]; then + COMPREPLY=($(compgen -f -- "$cword")) + fi + + if type __ltrim_colon_completions &>/dev/null; then + __ltrim_colon_completions "${words[cword]}" + fi + } + complete -o default -F _{pkgname}_completion {pkgname} +fi +###-end-{pkgname}-completion-### diff --git a/.pnpm-store/v11/files/22/a40492878cc1f63f7d0f24d061d4e0776ead189d9f7a8cbb8e8038dc439f77f3811d25c6672040e227c33ba7cf49088c800ea6ff9dd2233d25934b6200665d b/.pnpm-store/v11/files/22/a40492878cc1f63f7d0f24d061d4e0776ead189d9f7a8cbb8e8038dc439f77f3811d25c6672040e227c33ba7cf49088c800ea6ff9dd2233d25934b6200665d new file mode 100644 index 0000000000..068c4ea039 --- /dev/null +++ b/.pnpm-store/v11/files/22/a40492878cc1f63f7d0f24d061d4e0776ead189d9f7a8cbb8e8038dc439f77f3811d25c6672040e227c33ba7cf49088c800ea6ff9dd2233d25934b6200665d @@ -0,0 +1,311 @@ +// parse a 512-byte header block to a data object, or vice-versa +// encode returns `true` if a pax extended header is needed, because +// the data could not be faithfully encoded in a simple header. +// (Also, check header.needPax to see if it needs a pax header.) +import { posix as pathModule } from 'node:path'; +import * as large from './large-numbers.js'; +import * as types from './types.js'; +const notNegative = (n) => n === undefined || n < 0 ? undefined : n; +export class Header { + cksumValid = false; + needPax = false; + nullBlock = false; + block; + path; + mode; + uid; + gid; + size; + cksum; + #type = 'Unsupported'; + linkpath; + uname; + gname; + devmaj = 0; + devmin = 0; + atime; + ctime; + mtime; + charset; + comment; + constructor(data, off = 0, ex, gex) { + if (Buffer.isBuffer(data)) { + this.decode(data, off || 0, ex, gex); + } + else if (data) { + this.#slurp(data); + } + } + decode(buf, off, ex, gex) { + if (!off) { + off = 0; + } + if (!buf || !(buf.length >= off + 512)) { + throw new Error('need 512 bytes for header'); + } + // Decode the typeflag (independent of any pending PAX/GNU extended header) + // up front so we can tell whether THIS block is itself an intermediary + // extension header (PAX `x`/`g`, GNU long-name `L`, GNU long-link `K`). + // Per POSIX pax, a PAX extended header describes the *next file entry*, not + // the extension headers that may sit between it and that file. Applying the + // pending PAX overrides (notably `size`) to an intervening `L`/`K`/`x`/`g` + // header desynchronizes the stream relative to other tar implementations + // and enables tar interpretation-conflict / file-smuggling attacks. + const t = decString(buf, off + 156, 1); + const isNormalFS = types.normalFsTypes.has(t); + const exForFields = isNormalFS ? ex : undefined; + const gexForFields = isNormalFS ? gex : undefined; + this.path = exForFields?.path ?? decString(buf, off, 100); + this.mode = + exForFields?.mode ?? + gexForFields?.mode ?? + decNumber(buf, off + 100, 8); + this.uid = + exForFields?.uid ?? gexForFields?.uid ?? decNumber(buf, off + 108, 8); + this.gid = + exForFields?.gid ?? gexForFields?.gid ?? decNumber(buf, off + 116, 8); + this.size = notNegative(exForFields?.size ?? + gexForFields?.size ?? + decNumber(buf, off + 124, 12)); + this.mtime = + exForFields?.mtime ?? + gexForFields?.mtime ?? + decDate(buf, off + 136, 12); + this.cksum = decNumber(buf, off + 148, 12); + // if we have extended or global extended headers, apply them now + // See https://github.com/npm/node-tar/pull/187 + // Apply global before local, so it overrides. Never slurp the pending + // extended-header fields onto an intermediary extension header. + if (gexForFields) + this.#slurp(gexForFields, true); + if (exForFields) + this.#slurp(exForFields); + // old tar versions marked dirs as a file with a trailing / + if (types.isCode(t)) { + this.#type = t || '0'; + } + if (this.#type === '0' && this.path.slice(-1) === '/') { + this.#type = '5'; + } + // tar implementations sometimes incorrectly put the stat(dir).size + // as the size in the tarball, even though Directory entries are + // not able to have any body at all. In the very rare chance that + // it actually DOES have a body, we weren't going to do anything with + // it anyway, and it'll just be a warning about an invalid header. + if (this.#type === '5') { + this.size = 0; + } + this.linkpath = decString(buf, off + 157, 100); + if (buf.subarray(off + 257, off + 265).toString() === 'ustar\u000000') { + /* c8 ignore start */ + this.uname = + exForFields?.uname ?? + gexForFields?.uname ?? + decString(buf, off + 265, 32); + this.gname = + exForFields?.gname ?? + gexForFields?.gname ?? + decString(buf, off + 297, 32); + this.devmaj = + exForFields?.devmaj ?? + gexForFields?.devmaj ?? + decNumber(buf, off + 329, 8) ?? + 0; + this.devmin = + exForFields?.devmin ?? + gexForFields?.devmin ?? + decNumber(buf, off + 337, 8) ?? + 0; + /* c8 ignore stop */ + if (buf[off + 475] !== 0) { + // definitely a prefix, definitely >130 chars. + const prefix = decString(buf, off + 345, 155); + this.path = prefix + '/' + this.path; + } + else { + const prefix = decString(buf, off + 345, 130); + if (prefix) { + this.path = prefix + '/' + this.path; + } + /* c8 ignore start */ + this.atime = ex?.atime ?? gex?.atime ?? decDate(buf, off + 476, 12); + this.ctime = ex?.ctime ?? gex?.ctime ?? decDate(buf, off + 488, 12); + /* c8 ignore stop */ + } + } + let sum = 8 * 0x20; + for (let i = off; i < off + 148; i++) { + sum += buf[i]; + } + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i]; + } + this.cksumValid = sum === this.cksum; + if (this.cksum === undefined && sum === 8 * 0x20) { + this.nullBlock = true; + } + } + #slurp(ex, gex = false) { + Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => { + // we slurp in everything except for the path attribute in + // a global extended header, because that's weird. Also, any + // null/undefined values are ignored. + return !(v === null || + v === undefined || + (k === 'size' && Number(v) < 0) || + (k === 'path' && gex) || + (k === 'linkpath' && gex) || + k === 'global'); + }))); + } + encode(buf, off = 0) { + if (!buf) { + buf = this.block = Buffer.alloc(512); + } + if (this.#type === 'Unsupported') { + this.#type = '0'; + } + if (!(buf.length >= off + 512)) { + throw new Error('need 512 bytes for header'); + } + const prefixSize = this.ctime || this.atime ? 130 : 155; + const split = splitPrefix(this.path || '', prefixSize); + const path = split[0]; + const prefix = split[1]; + this.needPax = !!split[2]; + this.needPax = encString(buf, off, 100, path) || this.needPax; + this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax; + this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax; + this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax; + this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax; + this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax; + buf[off + 156] = Number(this.#type.codePointAt(0)); + this.needPax = + encString(buf, off + 157, 100, this.linkpath) || this.needPax; + buf.write('ustar\u000000', off + 257, 8); + this.needPax = + encString(buf, off + 265, 32, this.uname) || this.needPax; + this.needPax = + encString(buf, off + 297, 32, this.gname) || this.needPax; + this.needPax = + encNumber(buf, off + 329, 8, this.devmaj) || this.needPax; + this.needPax = + encNumber(buf, off + 337, 8, this.devmin) || this.needPax; + this.needPax = + encString(buf, off + 345, prefixSize, prefix) || this.needPax; + if (buf[off + 475] !== 0) { + this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax; + } + else { + this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax; + this.needPax = + encDate(buf, off + 476, 12, this.atime) || this.needPax; + this.needPax = + encDate(buf, off + 488, 12, this.ctime) || this.needPax; + } + let sum = 8 * 0x20; + for (let i = off; i < off + 148; i++) { + sum += buf[i]; + } + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i]; + } + this.cksum = sum; + encNumber(buf, off + 148, 8, this.cksum); + this.cksumValid = true; + return this.needPax; + } + get type() { + return (this.#type === 'Unsupported' ? + this.#type + : types.name.get(this.#type)); + } + get typeKey() { + return this.#type; + } + set type(type) { + const c = String(types.code.get(type)); + if (types.isCode(c) || c === 'Unsupported') { + this.#type = c; + } + else if (types.isCode(type)) { + this.#type = type; + } + else { + throw new TypeError('invalid entry type: ' + type); + } + } +} +const splitPrefix = (p, prefixSize) => { + const pathSize = 100; + let pp = p; + let prefix = ''; + let ret = undefined; + const root = pathModule.parse(p).root || '.'; + if (Buffer.byteLength(pp) < pathSize) { + ret = [pp, prefix, false]; + } + else { + // first set prefix to the dir, and path to the base + prefix = pathModule.dirname(pp); + pp = pathModule.basename(pp); + do { + if (Buffer.byteLength(pp) <= pathSize && + Buffer.byteLength(prefix) <= prefixSize) { + // both fit! + ret = [pp, prefix, false]; + } + else if (Buffer.byteLength(pp) > pathSize && + Buffer.byteLength(prefix) <= prefixSize) { + // prefix fits in prefix, but path doesn't fit in path + ret = [pp.slice(0, pathSize - 1), prefix, true]; + } + else { + // make path take a bit from prefix + pp = pathModule.join(pathModule.basename(prefix), pp); + prefix = pathModule.dirname(prefix); + } + } while (prefix !== root && ret === undefined); + // at this point, found no resolution, just truncate + if (!ret) { + ret = [p.slice(0, pathSize - 1), '', true]; + } + } + return ret; +}; +const decString = (buf, off, size) => buf + .subarray(off, off + size) + .toString('utf8') + .replace(/\0.*/, ''); +const decDate = (buf, off, size) => numToDate(decNumber(buf, off, size)); +const numToDate = (num) => num === undefined ? undefined : new Date(num * 1000); +const decNumber = (buf, off, size) => Number(buf[off]) & 0x80 ? + large.parse(buf.subarray(off, off + size)) + : decSmallNumber(buf, off, size); +const nanUndef = (value) => (isNaN(value) ? undefined : value); +const decSmallNumber = (buf, off, size) => nanUndef(parseInt(buf + .subarray(off, off + size) + .toString('utf8') + .replace(/\0.*$/, '') + .trim(), 8)); +// the maximum encodable as a null-terminated octal, by field size +const MAXNUM = { + 12: 0o77777777777, + 8: 0o7777777, +}; +const encNumber = (buf, off, size, num) => num === undefined ? false + : num > MAXNUM[size] || num < 0 ? + (large.encode(num, buf.subarray(off, off + size)), true) + : (encSmallNumber(buf, off, size, num), false); +const encSmallNumber = (buf, off, size, num) => buf.write(octalString(num, size), off, size, 'ascii'); +const octalString = (num, size) => padOctal(Math.floor(num).toString(8), size); +const padOctal = (str, size) => (str.length === size - 1 ? + str + : new Array(size - str.length - 1).join('0') + str + ' ') + '\0'; +const encDate = (buf, off, size, date) => date === undefined ? false : (encNumber(buf, off, size, date.getTime() / 1000)); +// enough to fill the longest string we've got +const NULLS = new Array(156).join('\0'); +// pad with nulls, return true if it's longer or non-ascii +const encString = (buf, off, size, str) => str === undefined ? false : ((buf.write(str + NULLS, off, size, 'utf8'), + str.length !== Buffer.byteLength(str) || str.length > size)); +//# sourceMappingURL=header.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/25/df7bbded9ec1e4766e94c2e0c41013612afeae586b0a2469ec9a47181a8fbf5e599adbd96cd6b77b84ef20896f1888af3202cb1a87948a2efda88b7b7b95ed b/.pnpm-store/v11/files/25/df7bbded9ec1e4766e94c2e0c41013612afeae586b0a2469ec9a47181a8fbf5e599adbd96cd6b77b84ef20896f1888af3202cb1a87948a2efda88b7b7b95ed new file mode 100644 index 0000000000..87babf0248 --- /dev/null +++ b/.pnpm-store/v11/files/25/df7bbded9ec1e4766e94c2e0c41013612afeae586b0a2469ec9a47181a8fbf5e599adbd96cd6b77b84ef20896f1888af3202cb1a87948a2efda88b7b7b95ed @@ -0,0 +1,53 @@ +{ + "name": "graceful-fs", + "description": "A drop-in replacement for fs, making various improvements.", + "version": "4.2.11", + "repository": { + "type": "git", + "url": "https://github.com/isaacs/node-graceful-fs" + }, + "main": "graceful-fs.js", + "directories": { + "test": "test" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "test": "nyc --silent node test.js | tap -c -", + "posttest": "nyc report" + }, + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "devDependencies": { + "import-fresh": "^2.0.0", + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^16.3.4" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js", + "clone.js" + ], + "tap": { + "reporter": "classic" + } +} diff --git a/.pnpm-store/v11/files/26/6f4de8e822b90a5af3fcb4b5a6bdf2849c8f187ef0be8f94f1f75c9fb63f4090a5fa5b0b38a655483c11b57b39a6aea694df7007af34bbfddc1956cd771b74 b/.pnpm-store/v11/files/26/6f4de8e822b90a5af3fcb4b5a6bdf2849c8f187ef0be8f94f1f75c9fb63f4090a5fa5b0b38a655483c11b57b39a6aea694df7007af34bbfddc1956cd771b74 new file mode 100644 index 0000000000..bfd8c587a3 --- /dev/null +++ b/.pnpm-store/v11/files/26/6f4de8e822b90a5af3fcb4b5a6bdf2849c8f187ef0be8f94f1f75c9fb63f4090a5fa5b0b38a655483c11b57b39a6aea694df7007af34bbfddc1956cd771b74 @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Unit tests for the xcode.py file.""" + +import sys +import unittest + +from gyp.generator import xcode + + +class TestEscapeXcodeDefine(unittest.TestCase): + if sys.platform == "darwin": + + def test_InheritedRemainsUnescaped(self): + self.assertEqual(xcode.EscapeXcodeDefine("$(inherited)"), "$(inherited)") + + def test_Escaping(self): + self.assertEqual(xcode.EscapeXcodeDefine('a b"c\\'), 'a\\ b\\"c\\\\') + + +if __name__ == "__main__": + unittest.main() diff --git a/.pnpm-store/v11/files/27/b8c0252eae50ca3ce02ab7c5670664c0c824e03eb3da1089f3f0a00d23e648a956bcb9f53645c6d79674a87c4cc86d1085dc335911be0210d691336b121857 b/.pnpm-store/v11/files/27/b8c0252eae50ca3ce02ab7c5670664c0c824e03eb3da1089f3f0a00d23e648a956bcb9f53645c6d79674a87c4cc86d1085dc335911be0210d691336b121857 new file mode 100644 index 0000000000..f433b1a53f --- /dev/null +++ b/.pnpm-store/v11/files/27/b8c0252eae50ca3ce02ab7c5670664c0c824e03eb3da1089f3f0a00d23e648a956bcb9f53645c6d79674a87c4cc86d1085dc335911be0210d691336b121857 @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/.pnpm-store/v11/files/28/5949e730fd212df6a885ef36d712e27e8b7d9c2733309161b96f451ee2e2f45a99a54af82fc03861d4aebba1091f65d3b0e20e7f801e81a7cbcafc33f2d237 b/.pnpm-store/v11/files/28/5949e730fd212df6a885ef36d712e27e8b7d9c2733309161b96f451ee2e2f45a99a54af82fc03861d4aebba1091f65d3b0e20e7f801e81a7cbcafc33f2d237 new file mode 100644 index 0000000000..efb8b02a59 --- /dev/null +++ b/.pnpm-store/v11/files/28/5949e730fd212df6a885ef36d712e27e8b7d9c2733309161b96f451ee2e2f45a99a54af82fc03861d4aebba1091f65d3b0e20e7f801e81a7cbcafc33f2d237 @@ -0,0 +1,606 @@ +'use strict' + +const log = require('./log') +const { existsSync } = require('fs') +const { win32: path } = require('path') +const { regSearchKeys, execFile } = require('./util') + +class VisualStudioFinder { + static findVisualStudio = (...args) => new VisualStudioFinder(...args).findVisualStudio() + + log = log.withPrefix('find VS') + + regSearchKeys = regSearchKeys + + constructor (nodeSemver, configMsvsVersion) { + this.nodeSemver = nodeSemver + this.configMsvsVersion = configMsvsVersion + this.errorLog = [] + this.validVersions = [] + } + + // Logs a message at verbose level, but also saves it to be displayed later + // at error level if an error occurs. This should help diagnose the problem. + addLog (message) { + this.log.verbose(message) + this.errorLog.push(message) + } + + async findVisualStudio () { + this.configVersionYear = null + this.configPath = null + if (this.configMsvsVersion) { + this.addLog(`--msvs_version=${this.configMsvsVersion} was set on the command line`) + if (this.configMsvsVersion.match(/^\d{4}$/)) { + this.configVersionYear = parseInt(this.configMsvsVersion, 10) + this.addLog( + `- looking for Visual Studio version ${this.configVersionYear}`) + } else { + this.configPath = path.resolve(this.configMsvsVersion) + this.addLog( + `- looking for Visual Studio installed in "${this.configPath}"`) + } + } else { + this.addLog('--msvs_version was not set on the command line') + } + + if (process.env.VCINSTALLDIR) { + this.envVcInstallDir = + path.resolve(process.env.VCINSTALLDIR, '..') + this.addLog('running in VS Command Prompt, installation path is:\n' + + `"${this.envVcInstallDir}"\n- will only use this version`) + } else { + this.addLog('VCINSTALLDIR not set, not running in VS Command Prompt') + } + + const checks = [ + () => this.findVisualStudio2019OrNewerFromSpecifiedLocation(), + () => this.findVisualStudio2019OrNewerUsingSetupModule(), + () => this.findVisualStudio2019OrNewer(), + () => this.findVisualStudio2017FromSpecifiedLocation(), + () => this.findVisualStudio2017UsingSetupModule(), + () => this.findVisualStudio2017(), + () => this.findVisualStudio2015(), + () => this.findVisualStudio2013() + ] + + for (const check of checks) { + const info = await check() + if (info) { + return this.succeed(info) + } + } + + return this.fail() + } + + succeed (info) { + this.log.info(`using VS${info.versionYear} (${info.version}) found at:` + + `\n"${info.path}"` + + '\nrun with --verbose for detailed information') + return info + } + + fail () { + if (this.configMsvsVersion && this.envVcInstallDir) { + this.errorLog.push( + 'msvs_version does not match this VS Command Prompt or the', + 'installation cannot be used.') + } else if (this.configMsvsVersion) { + // If msvs_version was specified but finding VS failed, print what would + // have been accepted + this.errorLog.push('') + if (this.validVersions) { + this.errorLog.push('valid versions for msvs_version:') + this.validVersions.forEach((version) => { + this.errorLog.push(`- "${version}"`) + }) + } else { + this.errorLog.push('no valid versions for msvs_version were found') + } + } + + const errorLog = this.errorLog.join('\n') + + // For Windows 80 col console, use up to the column before the one marked + // with X (total 79 chars including logger prefix, 62 chars usable here): + // X + const infoLog = [ + '**************************************************************', + 'You need to install the latest version of Visual Studio', + 'including the "Desktop development with C++" workload.', + 'For more information consult the documentation at:', + 'https://github.com/nodejs/node-gyp#on-windows', + '**************************************************************' + ].join('\n') + + this.log.error(`\n${errorLog}\n\n${infoLog}\n`) + throw new Error('Could not find any Visual Studio installation to use') + } + + async findVisualStudio2019OrNewerFromSpecifiedLocation () { + return this.findVSFromSpecifiedLocation([2019, 2022, 2026]) + } + + async findVisualStudio2017FromSpecifiedLocation () { + if (this.nodeSemver.major >= 22) { + this.addLog( + 'not looking for VS2017 as it is only supported up to Node.js 21') + return null + } + return this.findVSFromSpecifiedLocation([2017]) + } + + async findVSFromSpecifiedLocation (supportedYears) { + if (!this.envVcInstallDir) { + return null + } + const info = { + path: path.resolve(this.envVcInstallDir), + // Assume the version specified by the user is correct. + // Since Visual Studio 2015, the Developer Command Prompt sets the + // VSCMD_VER environment variable which contains the version information + // for Visual Studio. + // https://learn.microsoft.com/en-us/visualstudio/ide/reference/command-prompt-powershell?view=vs-2022 + version: process.env.VSCMD_VER, + packages: [ + 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64', + 'Microsoft.VisualStudio.Component.VC.Tools.ARM64', + // Assume MSBuild exists. It will be checked in processing. + 'Microsoft.VisualStudio.VC.MSBuild.Base' + ] + } + + // Is there a better way to get SDK information? + const envWindowsSDKVersion = process.env.WindowsSDKVersion + const sdkVersionMatched = envWindowsSDKVersion?.match(/^(\d+)\.(\d+)\.(\d+)\..*/) + if (sdkVersionMatched) { + info.packages.push(`Microsoft.VisualStudio.Component.Windows10SDK.${sdkVersionMatched[3]}.Desktop`) + } + // pass for further processing + return this.processData([info], supportedYears) + } + + async findVisualStudio2019OrNewerUsingSetupModule () { + return this.findNewVSUsingSetupModule([2019, 2022, 2026]) + } + + async findVisualStudio2017UsingSetupModule () { + if (this.nodeSemver.major >= 22) { + this.addLog( + 'not looking for VS2017 as it is only supported up to Node.js 21') + return null + } + return this.findNewVSUsingSetupModule([2017]) + } + + async findNewVSUsingSetupModule (supportedYears) { + const ps = path.join(process.env.SystemRoot, 'System32', + 'WindowsPowerShell', 'v1.0', 'powershell.exe') + const vcInstallDir = this.envVcInstallDir + + const checkModuleArgs = [ + '-NoProfile', + '-Command', + '&{@(Get-Module -ListAvailable -Name VSSetup).Version.ToString()}' + ] + this.log.silly('Running', ps, checkModuleArgs) + const [cErr] = await this.execFile(ps, checkModuleArgs) + if (cErr) { + this.addLog('VSSetup module doesn\'t seem to exist. You can install it via: "Install-Module VSSetup -Scope CurrentUser"') + this.log.silly('VSSetup error = %j', cErr && (cErr.stack || cErr)) + return null + } + const filterArg = vcInstallDir !== undefined ? `| where {$_.InstallationPath -eq '${vcInstallDir}' }` : '' + const psArgs = [ + '-NoProfile', + '-Command', + `&{Get-VSSetupInstance ${filterArg} | ConvertTo-Json -Depth 3}` + ] + + this.log.silly('Running', ps, psArgs) + const [err, stdout, stderr] = await this.execFile(ps, psArgs) + let parsedData = this.parseData(err, stdout, stderr) + if (parsedData === null) { + return null + } + this.log.silly('Parsed data', parsedData) + if (!Array.isArray(parsedData)) { + // if there are only 1 result, then Powershell will output non-array + parsedData = [parsedData] + } + // normalize output + parsedData = parsedData.map((info) => { + info.path = info.InstallationPath + info.version = `${info.InstallationVersion.Major}.${info.InstallationVersion.Minor}.${info.InstallationVersion.Build}.${info.InstallationVersion.Revision}` + info.packages = info.Packages.map((p) => p.Id) + return info + }) + // pass for further processing + return this.processData(parsedData, supportedYears) + } + + // Invoke the PowerShell script to get information about Visual Studio 2019 + // or newer installations + async findVisualStudio2019OrNewer () { + return this.findNewVS([2019, 2022, 2026]) + } + + // Invoke the PowerShell script to get information about Visual Studio 2017 + async findVisualStudio2017 () { + if (this.nodeSemver.major >= 22) { + this.addLog( + 'not looking for VS2017 as it is only supported up to Node.js 21') + return null + } + return this.findNewVS([2017]) + } + + // Invoke the PowerShell script to get information about Visual Studio 2017 + // or newer installations + async findNewVS (supportedYears) { + const ps = path.join(process.env.SystemRoot, 'System32', + 'WindowsPowerShell', 'v1.0', 'powershell.exe') + const csFile = path.join(__dirname, 'Find-VisualStudio.cs') + const psArgs = [ + '-ExecutionPolicy', + 'Unrestricted', + '-NoProfile', + '-Command', + '&{Add-Type -IgnoreWarnings -Path \'' + csFile + '\';' + '[VisualStudioConfiguration.Main]::PrintJson()}' + ] + + this.log.silly('Running', ps, psArgs) + const [err, stdout, stderr] = await this.execFile(ps, psArgs) + const parsedData = this.parseData(err, stdout, stderr, { checkIsArray: true }) + if (parsedData === null) { + return null + } + return this.processData(parsedData, supportedYears) + } + + // Parse the output of the PowerShell script, make sanity checks + parseData (err, stdout, stderr, sanityCheckOptions) { + const defaultOptions = { + checkIsArray: false + } + + // Merging provided options with the default options + const sanityOptions = { ...defaultOptions, ...sanityCheckOptions } + + this.log.silly('PS stderr = %j', stderr) + + const failPowershell = (failureDetails) => { + this.addLog( + `could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details. \n + Failure details: ${failureDetails}`) + return null + } + + if (err) { + this.log.silly('PS err = %j', err && (err.stack || err)) + return failPowershell(`${err}`.substring(0, 40)) + } + + let vsInfo + try { + vsInfo = JSON.parse(stdout) + } catch (e) { + this.log.silly('PS stdout = %j', stdout) + this.log.silly(e) + return failPowershell() + } + + if (sanityOptions.checkIsArray && !Array.isArray(vsInfo)) { + this.log.silly('PS stdout = %j', stdout) + return failPowershell('Expected array as output of the PS script') + } + return vsInfo + } + + // Process parsed data containing information about VS installations + // Look for the required parts, extract and output them back + processData (vsInfo, supportedYears) { + vsInfo = vsInfo.map((info) => { + this.log.silly(`processing installation: "${info.path}"`) + info.path = path.resolve(info.path) + const ret = this.getVersionInfo(info) + ret.path = info.path + ret.msBuild = this.getMSBuild(info, ret.versionYear) + ret.toolset = this.getToolset(info, ret.versionYear) + ret.sdk = this.getSDK(info) + return ret + }) + this.log.silly('vsInfo:', vsInfo) + + // Remove future versions or errors parsing version number + // Also remove any unsupported versions + vsInfo = vsInfo.filter((info) => { + if (info.versionYear && supportedYears.indexOf(info.versionYear) !== -1) { + return true + } + this.addLog(`${info.versionYear ? 'unsupported' : 'unknown'} version "${info.version}" found at "${info.path}"`) + return false + }) + + // Sort to place newer versions first + vsInfo.sort((a, b) => b.versionYear - a.versionYear) + + for (let i = 0; i < vsInfo.length; ++i) { + const info = vsInfo[i] + this.addLog(`checking VS${info.versionYear} (${info.version}) found ` + + `at:\n"${info.path}"`) + + if (info.msBuild) { + this.addLog('- found "Visual Studio C++ core features"') + } else { + this.addLog('- "Visual Studio C++ core features" missing') + continue + } + + if (info.toolset) { + this.addLog(`- found VC++ toolset: ${info.toolset}`) + } else { + this.addLog('- missing any VC++ toolset') + continue + } + + if (info.sdk) { + this.addLog(`- found Windows SDK: ${info.sdk}`) + } else { + this.addLog('- missing any Windows SDK') + continue + } + + if (!this.checkConfigVersion(info.versionYear, info.path)) { + continue + } + + return info + } + + this.addLog( + 'could not find a version of Visual Studio 2017 or newer to use') + return null + } + + // Helper - process version information + getVersionInfo (info) { + const match = /^(\d+)\.(\d+)(?:\..*)?/.exec(info.version) + if (!match) { + this.log.silly('- failed to parse version:', info.version) + return {} + } + this.log.silly('- version match = %j', match) + const ret = { + version: info.version, + versionMajor: parseInt(match[1], 10), + versionMinor: parseInt(match[2], 10) + } + if (ret.versionMajor === 15) { + ret.versionYear = 2017 + return ret + } + if (ret.versionMajor === 16) { + ret.versionYear = 2019 + return ret + } + if (ret.versionMajor === 17) { + ret.versionYear = 2022 + return ret + } + if (ret.versionMajor === 18) { + ret.versionYear = 2026 + return ret + } + this.log.silly('- unsupported version:', ret.versionMajor) + return {} + } + + msBuildPathExists (path) { + return existsSync(path) + } + + // Helper - process MSBuild information + getMSBuild (info, versionYear) { + const pkg = 'Microsoft.VisualStudio.VC.MSBuild.Base' + const msbuildPath = path.join(info.path, 'MSBuild', 'Current', 'Bin', 'MSBuild.exe') + const msbuildPathArm64 = path.join(info.path, 'MSBuild', 'Current', 'Bin', 'arm64', 'MSBuild.exe') + if (info.packages.indexOf(pkg) !== -1) { + this.log.silly('- found VC.MSBuild.Base') + if (versionYear === 2017) { + return path.join(info.path, 'MSBuild', '15.0', 'Bin', 'MSBuild.exe') + } + if (versionYear === 2019) { + if (process.arch === 'arm64' && this.msBuildPathExists(msbuildPathArm64)) { + return msbuildPathArm64 + } else { + return msbuildPath + } + } + } + /** + * Visual Studio 2022 doesn't have the MSBuild package. + * Support for compiling _on_ ARM64 was added in MSVC 14.32.31326, + * so let's leverage it if the user has an ARM64 device. + */ + if (process.arch === 'arm64' && this.msBuildPathExists(msbuildPathArm64)) { + return msbuildPathArm64 + } else if (this.msBuildPathExists(msbuildPath)) { + return msbuildPath + } + return null + } + + // Helper - process toolset information + getToolset (info, versionYear) { + const vcToolsArm64 = 'VC.Tools.ARM64' + const pkgArm64 = `Microsoft.VisualStudio.Component.${vcToolsArm64}` + const vcToolsX64 = 'VC.Tools.x86.x64' + const pkgX64 = `Microsoft.VisualStudio.Component.${vcToolsX64}` + const express = 'Microsoft.VisualStudio.WDExpress' + + if (process.arch === 'arm64' && info.packages.includes(pkgArm64)) { + this.log.silly(`- found ${vcToolsArm64}`) + } else if (info.packages.includes(pkgX64)) { + if (process.arch === 'arm64') { + this.addLog(`- found ${vcToolsX64} on ARM64 platform. Expect less performance and/or link failure with ARM64 binary.`) + } else { + this.log.silly(`- found ${vcToolsX64}`) + } + } else if (info.packages.includes(express)) { + this.log.silly('- found Visual Studio Express (looking for toolset)') + } else { + return null + } + + if (versionYear === 2017) { + return 'v141' + } else if (versionYear === 2019) { + return 'v142' + } else if (versionYear === 2022) { + return 'v143' + } else if (versionYear === 2026) { + return 'v145' + } + this.log.silly('- invalid versionYear:', versionYear) + return null + } + + // Helper - process Windows SDK information + getSDK (info) { + const win8SDK = 'Microsoft.VisualStudio.Component.Windows81SDK' + const win10SDKPrefix = 'Microsoft.VisualStudio.Component.Windows10SDK.' + const win11SDKPrefix = 'Microsoft.VisualStudio.Component.Windows11SDK.' + + let Win10or11SDKVer = 0 + info.packages.forEach((pkg) => { + if (!pkg.startsWith(win10SDKPrefix) && !pkg.startsWith(win11SDKPrefix)) { + return + } + const parts = pkg.split('.') + if (parts.length > 5 && parts[5] !== 'Desktop') { + this.log.silly('- ignoring non-Desktop Win10/11SDK:', pkg) + return + } + const foundSdkVer = parseInt(parts[4], 10) + if (isNaN(foundSdkVer)) { + // Microsoft.VisualStudio.Component.Windows10SDK.IpOverUsb + this.log.silly('- failed to parse Win10/11SDK number:', pkg) + return + } + this.log.silly('- found Win10/11SDK:', foundSdkVer) + Win10or11SDKVer = Math.max(Win10or11SDKVer, foundSdkVer) + }) + + if (Win10or11SDKVer !== 0) { + return `10.0.${Win10or11SDKVer}.0` + } else if (info.packages.indexOf(win8SDK) !== -1) { + this.log.silly('- found Win8SDK') + return '8.1' + } + return null + } + + // Find an installation of Visual Studio 2015 to use + async findVisualStudio2015 () { + if (this.nodeSemver.major >= 19) { + this.addLog( + 'not looking for VS2015 as it is only supported up to Node.js 18') + return null + } + return this.findOldVS({ + version: '14.0', + versionMajor: 14, + versionMinor: 0, + versionYear: 2015, + toolset: 'v140' + }) + } + + // Find an installation of Visual Studio 2013 to use + async findVisualStudio2013 () { + if (this.nodeSemver.major >= 9) { + this.addLog( + 'not looking for VS2013 as it is only supported up to Node.js 8') + return null + } + return this.findOldVS({ + version: '12.0', + versionMajor: 12, + versionMinor: 0, + versionYear: 2013, + toolset: 'v120' + }) + } + + // Helper - common code for VS2013 and VS2015 + async findOldVS (info) { + const regVC7 = ['HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7', + 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7'] + const regMSBuild = 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions' + + this.addLog(`looking for Visual Studio ${info.versionYear}`) + try { + let res = await this.regSearchKeys(regVC7, info.version, []) + const vsPath = path.resolve(res, '..') + this.addLog(`- found in "${vsPath}"`) + const msBuildRegOpts = process.arch === 'ia32' ? [] : ['/reg:32'] + + try { + res = await this.regSearchKeys([`${regMSBuild}\\${info.version}`], 'MSBuildToolsPath', msBuildRegOpts) + } catch (err) { + this.addLog('- could not find MSBuild in registry for this version') + return null + } + + const msBuild = path.join(res, 'MSBuild.exe') + this.addLog(`- MSBuild in "${msBuild}"`) + + if (!this.checkConfigVersion(info.versionYear, vsPath)) { + return null + } + + info.path = vsPath + info.msBuild = msBuild + info.sdk = null + return info + } catch (err) { + this.addLog('- not found') + return null + } + } + + // After finding a usable version of Visual Studio: + // - add it to validVersions to be displayed at the end if a specific + // version was requested and not found; + // - check if this is the version that was requested. + // - check if this matches the Visual Studio Command Prompt + checkConfigVersion (versionYear, vsPath) { + this.validVersions.push(versionYear) + this.validVersions.push(vsPath) + + if (this.configVersionYear && this.configVersionYear !== versionYear) { + this.addLog('- msvs_version does not match this version') + return false + } + if (this.configPath && + path.relative(this.configPath, vsPath) !== '') { + this.addLog('- msvs_version does not point to this installation') + return false + } + if (this.envVcInstallDir && + path.relative(this.envVcInstallDir, vsPath) !== '') { + this.addLog('- does not match this Visual Studio Command Prompt') + return false + } + + return true + } + + async execFile (exec, args) { + return await execFile(exec, args, { encoding: 'utf8' }) + } +} + +module.exports = VisualStudioFinder diff --git a/.pnpm-store/v11/files/29/84cc885166e88bc29303e87cf22dce7730e63b67acfa7dfcd874570d58cf0308d0d19becc09b9754782713bf2cdfc79d1984cbcc51c4a302cb13115b0b0f9f b/.pnpm-store/v11/files/29/84cc885166e88bc29303e87cf22dce7730e63b67acfa7dfcd874570d58cf0308d0d19becc09b9754782713bf2cdfc79d1984cbcc51c4a302cb13115b0b0f9f new file mode 100644 index 0000000000..43665577bd --- /dev/null +++ b/.pnpm-store/v11/files/29/84cc885166e88bc29303e87cf22dce7730e63b67acfa7dfcd874570d58cf0308d0d19becc09b9754782713bf2cdfc79d1984cbcc51c4a302cb13115b0b0f9f @@ -0,0 +1,371 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Utility functions for Windows builds. + +These functions are executed via gyp-win-tool when using the ninja generator. +""" + +import os +import re +import shutil +import stat +import string +import subprocess +import sys + +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) + +# A regex matching an argument corresponding to the output filename passed to +# link.exe. +_LINK_EXE_OUT_ARG = re.compile("/OUT:(?P.+)$", re.IGNORECASE) + + +def main(args): + executor = WinTool() + if (exit_code := executor.Dispatch(args)) is not None: + sys.exit(exit_code) + + +class WinTool: + """This class performs all the Windows tooling steps. The methods can either + be executed directly, or dispatched from an argument list.""" + + def _UseSeparateMspdbsrv(self, env, args): + """Allows to use a unique instance of mspdbsrv.exe per linker instead of a + shared one.""" + if len(args) < 1: + raise Exception("Not enough arguments") + + if args[0] != "link.exe": + return + + # Use the output filename passed to the linker to generate an endpoint name + # for mspdbsrv.exe. + endpoint_name = None + for arg in args: + m = _LINK_EXE_OUT_ARG.match(arg) + if m: + endpoint_name = re.sub( + r"\W+", "", "%s_%d" % (m.group("out"), os.getpid()) + ) + break + + if endpoint_name is None: + return + + # Adds the appropriate environment variable. This will be read by link.exe + # to know which instance of mspdbsrv.exe it should connect to (if it's + # not set then the default endpoint is used). + env["_MSPDBSRV_ENDPOINT_"] = endpoint_name + + def Dispatch(self, args): + """Dispatches a string command to a method.""" + if len(args) < 1: + raise Exception("Not enough arguments") + + method = "Exec%s" % self._CommandifyName(args[0]) + return getattr(self, method)(*args[1:]) + + def _CommandifyName(self, name_string): + """Transforms a tool name like recursive-mirror to RecursiveMirror.""" + return name_string.title().replace("-", "") + + def _GetEnv(self, arch): + """Gets the saved environment from a file for a given architecture.""" + # The environment is saved as an "environment block" (see CreateProcess + # and msvs_emulation for details). We convert to a dict here. + # Drop last 2 NULs, one for list terminator, one for trailing vs. separator. + pairs = open(arch).read()[:-2].split("\0") + kvs = [item.split("=", 1) for item in pairs] + return dict(kvs) + + def ExecStamp(self, path): + """Simple stamp command.""" + open(path, "w").close() + + def ExecRecursiveMirror(self, source, dest): + """Emulation of rm -rf out && cp -af in out.""" + if os.path.exists(dest): + if os.path.isdir(dest): + + def _on_error(fn, path, excinfo): + # The operation failed, possibly because the file is set to + # read-only. If that's why, make it writable and try the op again. + if not os.access(path, os.W_OK): + os.chmod(path, stat.S_IWRITE) + fn(path) + + shutil.rmtree(dest, onerror=_on_error) + else: + if not os.access(dest, os.W_OK): + # Attempt to make the file writable before deleting it. + os.chmod(dest, stat.S_IWRITE) + os.unlink(dest) + + if os.path.isdir(source): + shutil.copytree(source, dest) + else: + shutil.copy2(source, dest) + + def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): + """Filter diagnostic output from link that looks like: + ' Creating library ui.dll.lib and object ui.dll.exp' + This happens when there are exports from the dll or exe. + """ + env = self._GetEnv(arch) + if use_separate_mspdbsrv == "True": + self._UseSeparateMspdbsrv(env, args) + if sys.platform == "win32": + args = list(args) # *args is a tuple by default, which is read-only. + args[0] = args[0].replace("/", "\\") + # https://docs.python.org/2/library/subprocess.html: + # "On Unix with shell=True [...] if args is a sequence, the first item + # specifies the command string, and any additional items will be treated as + # additional arguments to the shell itself. That is to say, Popen does the + # equivalent of: + # Popen(['/bin/sh', '-c', args[0], args[1], ...])" + # For that reason, since going through the shell doesn't seem necessary on + # non-Windows don't do that there. + link = subprocess.Popen( + args, + shell=sys.platform == "win32", + env=env, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) + out = link.communicate()[0].decode("utf-8") + for line in out.splitlines(): + if ( + not line.startswith(" Creating library ") + and not line.startswith("Generating code") + and not line.startswith("Finished generating code") + ): + print(line) + return link.returncode + + def ExecLinkWithManifests( + self, + arch, + embed_manifest, + out, + ldcmd, + resname, + mt, + rc, + intermediate_manifest, + *manifests, + ): + """A wrapper for handling creating a manifest resource and then executing + a link command.""" + # The 'normal' way to do manifests is to have link generate a manifest + # based on gathering dependencies from the object files, then merge that + # manifest with other manifests supplied as sources, convert the merged + # manifest to a resource, and then *relink*, including the compiled + # version of the manifest resource. This breaks incremental linking, and + # is generally overly complicated. Instead, we merge all the manifests + # provided (along with one that includes what would normally be in the + # linker-generated one, see msvs_emulation.py), and include that into the + # first and only link. We still tell link to generate a manifest, but we + # only use that to assert that our simpler process did not miss anything. + variables = { + "python": sys.executable, + "arch": arch, + "out": out, + "ldcmd": ldcmd, + "resname": resname, + "mt": mt, + "rc": rc, + "intermediate_manifest": intermediate_manifest, + "manifests": " ".join(manifests), + } + add_to_ld = "" + if manifests: + subprocess.check_call( + "%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo " + "-manifest %(manifests)s -out:%(out)s.manifest" % variables + ) + if embed_manifest == "True": + subprocess.check_call( + "%(python)s gyp-win-tool manifest-to-rc %(arch)s %(out)s.manifest" + " %(out)s.manifest.rc %(resname)s" % variables + ) + subprocess.check_call( + "%(python)s gyp-win-tool rc-wrapper %(arch)s %(rc)s " + "%(out)s.manifest.rc" % variables + ) + add_to_ld = " %(out)s.manifest.res" % variables + subprocess.check_call(ldcmd + add_to_ld) + + # Run mt.exe on the theoretically complete manifest we generated, merging + # it with the one the linker generated to confirm that the linker + # generated one does not add anything. This is strictly unnecessary for + # correctness, it's only to verify that e.g. /MANIFESTDEPENDENCY was not + # used in a #pragma comment. + if manifests: + # Merge the intermediate one with ours to .assert.manifest, then check + # that .assert.manifest is identical to ours. + subprocess.check_call( + "%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo " + "-manifest %(out)s.manifest %(intermediate_manifest)s " + "-out:%(out)s.assert.manifest" % variables + ) + assert_manifest = "%(out)s.assert.manifest" % variables + our_manifest = "%(out)s.manifest" % variables + # Load and normalize the manifests. mt.exe sometimes removes whitespace, + # and sometimes doesn't unfortunately. + with open(our_manifest) as our_f, open(assert_manifest) as assert_f: + translator = str.maketrans("", "", string.whitespace) + our_data = our_f.read().translate(translator) + assert_data = assert_f.read().translate(translator) + if our_data != assert_data: + os.unlink(out) + + def dump(filename): + print(filename, file=sys.stderr) + print("-----", file=sys.stderr) + with open(filename) as f: + print(f.read(), file=sys.stderr) + print("-----", file=sys.stderr) + + dump(intermediate_manifest) + dump(our_manifest) + dump(assert_manifest) + sys.stderr.write( + 'Linker generated manifest "%s" added to final manifest "%s" ' + '(result in "%s"). ' + "Were /MANIFEST switches used in #pragma statements? " + % (intermediate_manifest, our_manifest, assert_manifest) + ) + return 1 + + def ExecManifestWrapper(self, arch, *args): + """Run manifest tool with environment set. Strip out undesirable warning + (some XML blocks are recognized by the OS loader, but not the manifest + tool).""" + env = self._GetEnv(arch) + popen = subprocess.Popen( + args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + out = popen.communicate()[0].decode("utf-8") + for line in out.splitlines(): + if line and "manifest authoring warning 81010002" not in line: + print(line) + return popen.returncode + + def ExecManifestToRc(self, arch, *args): + """Creates a resource file pointing a SxS assembly manifest. + |args| is tuple containing path to resource file, path to manifest file + and resource name which can be "1" (for executables) or "2" (for DLLs).""" + manifest_path, resource_path, resource_name = args + with open(resource_path, "w") as output: + output.write( + '#include \n%s RT_MANIFEST "%s"' + % (resource_name, os.path.abspath(manifest_path).replace("\\", "/")) + ) + + def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, *flags): + """Filter noisy filenames output from MIDL compile step that isn't + quietable via command line flags. + """ + args = ( + ["midl", "/nologo"] + + list(flags) + + [ + "/out", + outdir, + "/tlb", + tlb, + "/h", + h, + "/dlldata", + dlldata, + "/iid", + iid, + "/proxy", + proxy, + idl, + ] + ) + env = self._GetEnv(arch) + popen = subprocess.Popen( + args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + out = popen.communicate()[0].decode("utf-8") + # Filter junk out of stdout, and write filtered versions. Output we want + # to filter is pairs of lines that look like this: + # Processing C:\Program Files (x86)\Microsoft SDKs\...\include\objidl.idl + # objidl.idl + lines = out.splitlines() + prefixes = ("Processing ", "64 bit Processing ") + processing = {os.path.basename(x) for x in lines if x.startswith(prefixes)} + for line in lines: + if not line.startswith(prefixes) and line not in processing: + print(line) + return popen.returncode + + def ExecAsmWrapper(self, arch, *args): + """Filter logo banner from invocations of asm.exe.""" + env = self._GetEnv(arch) + popen = subprocess.Popen( + args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + out = popen.communicate()[0].decode("utf-8") + for line in out.splitlines(): + if ( + not line.startswith("Copyright (C) Microsoft Corporation") + and not line.startswith("Microsoft (R) Macro Assembler") + and not line.startswith(" Assembling: ") + and line + ): + print(line) + return popen.returncode + + def ExecRcWrapper(self, arch, *args): + """Filter logo banner from invocations of rc.exe. Older versions of RC + don't support the /nologo flag.""" + env = self._GetEnv(arch) + popen = subprocess.Popen( + args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + out = popen.communicate()[0].decode("utf-8") + for line in out.splitlines(): + if ( + not line.startswith("Microsoft (R) Windows (R) Resource Compiler") + and not line.startswith("Copyright (C) Microsoft Corporation") + and line + ): + print(line) + return popen.returncode + + def ExecActionWrapper(self, arch, rspfile, *dir): + """Runs an action command line from a response file using the environment + for |arch|. If |dir| is supplied, use that as the working directory.""" + env = self._GetEnv(arch) + # TODO(scottmg): This is a temporary hack to get some specific variables + # through to actions that are set after gyp-time. http://crbug.com/333738. + for k, v in os.environ.items(): + if k not in env: + env[k] = v + args = open(rspfile).read() + dir = dir[0] if dir else None + return subprocess.call(args, shell=True, env=env, cwd=dir) + + def ExecClCompile(self, project_dir, selected_files): + """Executed by msvs-ninja projects when the 'ClCompile' target is used to + build selected C/C++ files.""" + project_dir = os.path.relpath(project_dir, BASE_DIR) + selected_files = selected_files.split(";") + ninja_targets = [ + os.path.join(project_dir, filename) + "^^" for filename in selected_files + ] + cmd = ["ninja.exe"] + cmd.extend(ninja_targets) + return subprocess.call(cmd, shell=True, cwd=BASE_DIR) + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/.pnpm-store/v11/files/2a/7ba2d40f3afe5096f6d620356a5ffb57fe8c3ee0345668c513775b709ce7935208601f0218ee9d862121ca4443cd2ed4871598bec533283e37ad5e171f1b7b b/.pnpm-store/v11/files/2a/7ba2d40f3afe5096f6d620356a5ffb57fe8c3ee0345668c513775b709ce7935208601f0218ee9d862121ca4443cd2ed4871598bec533283e37ad5e171f1b7b new file mode 100644 index 0000000000..5339c93f47 --- /dev/null +++ b/.pnpm-store/v11/files/2a/7ba2d40f3afe5096f6d620356a5ffb57fe8c3ee0345668c513775b709ce7935208601f0218ee9d862121ca4443cd2ed4871598bec533283e37ad5e171f1b7b @@ -0,0 +1,82 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.create = void 0; +const fs_minipass_1 = require("@isaacs/fs-minipass"); +const node_path_1 = __importDefault(require("node:path")); +const list_js_1 = require("./list.js"); +const make_command_js_1 = require("./make-command.js"); +const pack_js_1 = require("./pack.js"); +const createFileSync = (opt, files) => { + const p = new pack_js_1.PackSync(opt); + const stream = new fs_minipass_1.WriteStreamSync(opt.file, { + mode: opt.mode || 0o666, + }); + p.pipe(stream); + addFilesSync(p, files); +}; +const createFile = (opt, files) => { + const p = new pack_js_1.Pack(opt); + const stream = new fs_minipass_1.WriteStream(opt.file, { + mode: opt.mode || 0o666, + }); + p.pipe(stream); + const promise = new Promise((res, rej) => { + stream.on('error', rej); + stream.on('close', res); + p.on('error', rej); + }); + addFilesAsync(p, files).catch(er => p.emit('error', er)); + return promise; +}; +const addFilesSync = (p, files) => { + files.forEach(file => { + if (file.charAt(0) === '@') { + (0, list_js_1.list)({ + file: node_path_1.default.resolve(p.cwd, file.slice(1)), + sync: true, + noResume: true, + onReadEntry: entry => p.add(entry), + }); + } + else { + p.add(file); + } + }); + p.end(); +}; +const addFilesAsync = async (p, files) => { + for (const file of files) { + if (file.charAt(0) === '@') { + await (0, list_js_1.list)({ + file: node_path_1.default.resolve(String(p.cwd), file.slice(1)), + noResume: true, + onReadEntry: entry => { + p.add(entry); + }, + }); + } + else { + p.add(file); + } + } + p.end(); +}; +const createSync = (opt, files) => { + const p = new pack_js_1.PackSync(opt); + addFilesSync(p, files); + return p; +}; +const createAsync = (opt, files) => { + const p = new pack_js_1.Pack(opt); + addFilesAsync(p, files).catch(er => p.emit('error', er)); + return p; +}; +exports.create = (0, make_command_js_1.makeCommand)(createFileSync, createFile, createSync, createAsync, (_opt, files) => { + if (!files?.length) { + throw new TypeError('no paths specified to add to archive'); + } +}); +//# sourceMappingURL=create.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/2a/f273c92fb8070d158f27fe55f6f87cf29ae95041e0b430b776af0d0e960b90747413a7b041bbe104bfd958a9ff2d878ceb498fc6b7ab0da1688e5181220e62 b/.pnpm-store/v11/files/2a/f273c92fb8070d158f27fe55f6f87cf29ae95041e0b430b776af0d0e960b90747413a7b041bbe104bfd958a9ff2d878ceb498fc6b7ab0da1688e5181220e62 new file mode 100644 index 0000000000..dfc2c1957b --- /dev/null +++ b/.pnpm-store/v11/files/2a/f273c92fb8070d158f27fe55f6f87cf29ae95041e0b430b776af0d0e960b90747413a7b041bbe104bfd958a9ff2d878ceb498fc6b7ab0da1688e5181220e62 @@ -0,0 +1,123 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.constants = void 0; +// Update with any zlib constants that are added or changed in the future. +// Node v6 didn't export this, so we just hard code the version and rely +// on all the other hard-coded values from zlib v4736. When node v6 +// support drops, we can just export the realZlibConstants object. +const zlib_1 = __importDefault(require("zlib")); +/* c8 ignore start */ +const realZlibConstants = zlib_1.default.constants || { ZLIB_VERNUM: 4736 }; +/* c8 ignore stop */ +exports.constants = Object.freeze(Object.assign(Object.create(null), { + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + Z_VERSION_ERROR: -6, + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + DEFLATE: 1, + INFLATE: 2, + GZIP: 3, + GUNZIP: 4, + DEFLATERAW: 5, + INFLATERAW: 6, + UNZIP: 7, + BROTLI_DECODE: 8, + BROTLI_ENCODE: 9, + Z_MIN_WINDOWBITS: 8, + Z_MAX_WINDOWBITS: 15, + Z_DEFAULT_WINDOWBITS: 15, + Z_MIN_CHUNK: 64, + Z_MAX_CHUNK: Infinity, + Z_DEFAULT_CHUNK: 16384, + Z_MIN_MEMLEVEL: 1, + Z_MAX_MEMLEVEL: 9, + Z_DEFAULT_MEMLEVEL: 8, + Z_MIN_LEVEL: -1, + Z_MAX_LEVEL: 9, + Z_DEFAULT_LEVEL: -1, + BROTLI_OPERATION_PROCESS: 0, + BROTLI_OPERATION_FLUSH: 1, + BROTLI_OPERATION_FINISH: 2, + BROTLI_OPERATION_EMIT_METADATA: 3, + BROTLI_MODE_GENERIC: 0, + BROTLI_MODE_TEXT: 1, + BROTLI_MODE_FONT: 2, + BROTLI_DEFAULT_MODE: 0, + BROTLI_MIN_QUALITY: 0, + BROTLI_MAX_QUALITY: 11, + BROTLI_DEFAULT_QUALITY: 11, + BROTLI_MIN_WINDOW_BITS: 10, + BROTLI_MAX_WINDOW_BITS: 24, + BROTLI_LARGE_MAX_WINDOW_BITS: 30, + BROTLI_DEFAULT_WINDOW: 22, + BROTLI_MIN_INPUT_BLOCK_BITS: 16, + BROTLI_MAX_INPUT_BLOCK_BITS: 24, + BROTLI_PARAM_MODE: 0, + BROTLI_PARAM_QUALITY: 1, + BROTLI_PARAM_LGWIN: 2, + BROTLI_PARAM_LGBLOCK: 3, + BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, + BROTLI_PARAM_SIZE_HINT: 5, + BROTLI_PARAM_LARGE_WINDOW: 6, + BROTLI_PARAM_NPOSTFIX: 7, + BROTLI_PARAM_NDIRECT: 8, + BROTLI_DECODER_RESULT_ERROR: 0, + BROTLI_DECODER_RESULT_SUCCESS: 1, + BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, + BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, + BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, + BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, + BROTLI_DECODER_NO_ERROR: 0, + BROTLI_DECODER_SUCCESS: 1, + BROTLI_DECODER_NEEDS_MORE_INPUT: 2, + BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, + BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, + BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, + BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, + BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, + BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, + BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, + BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, + BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, + BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, + BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, + BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, + BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, + BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, + BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, + BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, + BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, + BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, + BROTLI_DECODER_ERROR_UNREACHABLE: -31, +}, realZlibConstants)); +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/2b/5546a85e4915b8987d96a5528fd1473cc4aa2252354f97376e1504972e942d0e24c72e93392247138df5b84071d8634506031f7c8ca5c8c472e7095ea3a380 b/.pnpm-store/v11/files/2b/5546a85e4915b8987d96a5528fd1473cc4aa2252354f97376e1504972e942d0e24c72e93392247138df5b84071d8634506031f7c8ca5c8c472e7095ea3a380 new file mode 100644 index 0000000000..0e7601f693 --- /dev/null +++ b/.pnpm-store/v11/files/2b/5546a85e4915b8987d96a5528fd1473cc4aa2252354f97376e1504972e942d0e24c72e93392247138df5b84071d8634506031f7c8ca5c8c472e7095ea3a380 @@ -0,0 +1,6 @@ +'use strict' + +// Determine if version is greater than all the versions possible in the range. +const outside = require('./outside') +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr diff --git a/.pnpm-store/v11/files/2b/8cc73f3700e218d2baa8bb3aee26c635f16940a5b38413285f1a30e83019a51ecca5272f75529fcea323246e90e28669b97b5858e191bf3d99472df30abe4b b/.pnpm-store/v11/files/2b/8cc73f3700e218d2baa8bb3aee26c635f16940a5b38413285f1a30e83019a51ecca5272f75529fcea323246e90e28669b97b5858e191bf3d99472df30abe4b new file mode 100644 index 0000000000..f9dbbf64fe --- /dev/null +++ b/.pnpm-store/v11/files/2b/8cc73f3700e218d2baa8bb3aee26c635f16940a5b38413285f1a30e83019a51ecca5272f75529fcea323246e90e28669b97b5858e191bf3d99472df30abe4b @@ -0,0 +1,108 @@ +'use strict' + +const assert = require('node:assert') +const { AsyncResource } = require('node:async_hooks') +const { InvalidArgumentError, SocketError } = require('../core/errors') +const util = require('../core/util') +const { addSignal, removeSignal } = require('./abort-signal') + +class ConnectHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + const { signal, opaque, responseHeaders } = opts + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + super('UNDICI_CONNECT') + + this.opaque = opaque || null + this.responseHeaders = responseHeaders || null + this.callback = callback + this.abort = null + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (this.reason) { + abort(this.reason) + return + } + + assert(this.callback) + + this.abort = abort + this.context = context + } + + onHeaders () { + throw new SocketError('bad connect', null) + } + + onUpgrade (statusCode, rawHeaders, socket) { + const { callback, opaque, context } = this + + removeSignal(this) + + this.callback = null + + let headers = rawHeaders + // Indicates is an HTTP2Session + if (headers != null) { + headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + } + + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + socket, + opaque, + context + }) + } + + onError (err) { + const { callback, opaque } = this + + removeSignal(this) + + if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + } +} + +function connect (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + connect.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + const connectHandler = new ConnectHandler(opts, callback) + this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts?.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = connect diff --git a/.pnpm-store/v11/files/2b/8dd90d1d10f95bb1b477988c2409d492218990062470b205a8b5e272632ccf2272236509ad1de56ff53bf297768db2cd357fe5463ae0d607ad07177f2c6407 b/.pnpm-store/v11/files/2b/8dd90d1d10f95bb1b477988c2409d492218990062470b205a8b5e272632ccf2272236509ad1de56ff53bf297768db2cd357fe5463ae0d607ad07177f2c6407 new file mode 100644 index 0000000000..da9ee8f4e4 --- /dev/null +++ b/.pnpm-store/v11/files/2b/8dd90d1d10f95bb1b477988c2409d492218990062470b205a8b5e272632ccf2272236509ad1de56ff53bf297768db2cd357fe5463ae0d607ad07177f2c6407 @@ -0,0 +1,5 @@ +'use strict' + +const compare = require('./compare') +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte diff --git a/.pnpm-store/v11/files/2b/9dbcf32b12d5badff41bb41450060c49e5350efc15e53ed9c22765edb36e5540cb64c7e43af8a447abf901dc594b905a5e6809ee4d6962bfe130721a01d3a9 b/.pnpm-store/v11/files/2b/9dbcf32b12d5badff41bb41450060c49e5350efc15e53ed9c22765edb36e5540cb64c7e43af8a447abf901dc594b905a5e6809ee4d6962bfe130721a01d3a9 new file mode 100644 index 0000000000..91f3a5cfc7 --- /dev/null +++ b/.pnpm-store/v11/files/2b/9dbcf32b12d5badff41bb41450060c49e5350efc15e53ed9c22765edb36e5540cb64c7e43af8a447abf901dc594b905a5e6809ee4d6962bfe130721a01d3a9 @@ -0,0 +1,1038 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Minipass = exports.isWritable = exports.isReadable = exports.isStream = void 0; +const proc = typeof process === 'object' && process + ? process + : { + stdout: null, + stderr: null, + }; +const node_events_1 = require("node:events"); +const node_stream_1 = __importDefault(require("node:stream")); +const node_string_decoder_1 = require("node:string_decoder"); +/** + * Return true if the argument is a Minipass stream, Node stream, or something + * else that Minipass can interact with. + */ +const isStream = (s) => !!s && + typeof s === 'object' && + (s instanceof Minipass || + s instanceof node_stream_1.default || + (0, exports.isReadable)(s) || + (0, exports.isWritable)(s)) +/** + * Return true if the argument is a valid {@link Minipass.Readable} + */ +; +exports.isStream = isStream; +/** + * Return true if the argument is a valid {@link Minipass.Readable} + */ +const isReadable = (s) => !!s && + typeof s === 'object' && + s instanceof node_events_1.EventEmitter && + typeof s.pipe === 'function' && + // node core Writable streams have a pipe() method, but it throws + s.pipe !== node_stream_1.default.Writable.prototype.pipe +/** + * Return true if the argument is a valid {@link Minipass.Writable} + */ +; +exports.isReadable = isReadable; +/** + * Return true if the argument is a valid {@link Minipass.Writable} + */ +const isWritable = (s) => !!s && + typeof s === 'object' && + s instanceof node_events_1.EventEmitter && + typeof s.write === 'function' && + typeof s.end === 'function'; +exports.isWritable = isWritable; +const EOF = Symbol('EOF'); +const MAYBE_EMIT_END = Symbol('maybeEmitEnd'); +const EMITTED_END = Symbol('emittedEnd'); +const EMITTING_END = Symbol('emittingEnd'); +const EMITTED_ERROR = Symbol('emittedError'); +const CLOSED = Symbol('closed'); +const READ = Symbol('read'); +const FLUSH = Symbol('flush'); +const FLUSHCHUNK = Symbol('flushChunk'); +const ENCODING = Symbol('encoding'); +const DECODER = Symbol('decoder'); +const FLOWING = Symbol('flowing'); +const PAUSED = Symbol('paused'); +const RESUME = Symbol('resume'); +const BUFFER = Symbol('buffer'); +const PIPES = Symbol('pipes'); +const BUFFERLENGTH = Symbol('bufferLength'); +const BUFFERPUSH = Symbol('bufferPush'); +const BUFFERSHIFT = Symbol('bufferShift'); +const OBJECTMODE = Symbol('objectMode'); +// internal event when stream is destroyed +const DESTROYED = Symbol('destroyed'); +// internal event when stream has an error +const ERROR = Symbol('error'); +const EMITDATA = Symbol('emitData'); +const EMITEND = Symbol('emitEnd'); +const EMITEND2 = Symbol('emitEnd2'); +const ASYNC = Symbol('async'); +const ABORT = Symbol('abort'); +const ABORTED = Symbol('aborted'); +const SIGNAL = Symbol('signal'); +const DATALISTENERS = Symbol('dataListeners'); +const DISCARDED = Symbol('discarded'); +const defer = (fn) => Promise.resolve().then(fn); +const nodefer = (fn) => fn(); +const isEndish = (ev) => ev === 'end' || ev === 'finish' || ev === 'prefinish'; +const isArrayBufferLike = (b) => b instanceof ArrayBuffer || + (!!b && + typeof b === 'object' && + b.constructor && + b.constructor.name === 'ArrayBuffer' && + b.byteLength >= 0); +const isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b); +/** + * Internal class representing a pipe to a destination stream. + * + * @internal + */ +class Pipe { + src; + dest; + opts; + ondrain; + constructor(src, dest, opts) { + this.src = src; + this.dest = dest; + this.opts = opts; + this.ondrain = () => src[RESUME](); + this.dest.on('drain', this.ondrain); + } + unpipe() { + this.dest.removeListener('drain', this.ondrain); + } + // only here for the prototype + /* c8 ignore start */ + proxyErrors(_er) { } + /* c8 ignore stop */ + end() { + this.unpipe(); + if (this.opts.end) + this.dest.end(); + } +} +/** + * Internal class representing a pipe to a destination stream where + * errors are proxied. + * + * @internal + */ +class PipeProxyErrors extends Pipe { + unpipe() { + this.src.removeListener('error', this.proxyErrors); + super.unpipe(); + } + constructor(src, dest, opts) { + super(src, dest, opts); + this.proxyErrors = (er) => this.dest.emit('error', er); + src.on('error', this.proxyErrors); + } +} +const isObjectModeOptions = (o) => !!o.objectMode; +const isEncodingOptions = (o) => !o.objectMode && !!o.encoding && o.encoding !== 'buffer'; +/** + * Main export, the Minipass class + * + * `RType` is the type of data emitted, defaults to Buffer + * + * `WType` is the type of data to be written, if RType is buffer or string, + * then any {@link Minipass.ContiguousData} is allowed. + * + * `Events` is the set of event handler signatures that this object + * will emit, see {@link Minipass.Events} + */ +class Minipass extends node_events_1.EventEmitter { + [FLOWING] = false; + [PAUSED] = false; + [PIPES] = []; + [BUFFER] = []; + [OBJECTMODE]; + [ENCODING]; + [ASYNC]; + [DECODER]; + [EOF] = false; + [EMITTED_END] = false; + [EMITTING_END] = false; + [CLOSED] = false; + [EMITTED_ERROR] = null; + [BUFFERLENGTH] = 0; + [DESTROYED] = false; + [SIGNAL]; + [ABORTED] = false; + [DATALISTENERS] = 0; + [DISCARDED] = false; + /** + * true if the stream can be written + */ + writable = true; + /** + * true if the stream can be read + */ + readable = true; + /** + * If `RType` is Buffer, then options do not need to be provided. + * Otherwise, an options object must be provided to specify either + * {@link Minipass.SharedOptions.objectMode} or + * {@link Minipass.SharedOptions.encoding}, as appropriate. + */ + constructor(...args) { + const options = (args[0] || + {}); + super(); + if (options.objectMode && typeof options.encoding === 'string') { + throw new TypeError('Encoding and objectMode may not be used together'); + } + if (isObjectModeOptions(options)) { + this[OBJECTMODE] = true; + this[ENCODING] = null; + } + else if (isEncodingOptions(options)) { + this[ENCODING] = options.encoding; + this[OBJECTMODE] = false; + } + else { + this[OBJECTMODE] = false; + this[ENCODING] = null; + } + this[ASYNC] = !!options.async; + this[DECODER] = this[ENCODING] + ? new node_string_decoder_1.StringDecoder(this[ENCODING]) + : null; + //@ts-ignore - private option for debugging and testing + if (options && options.debugExposeBuffer === true) { + Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] }); + } + //@ts-ignore - private option for debugging and testing + if (options && options.debugExposePipes === true) { + Object.defineProperty(this, 'pipes', { get: () => this[PIPES] }); + } + const { signal } = options; + if (signal) { + this[SIGNAL] = signal; + if (signal.aborted) { + this[ABORT](); + } + else { + signal.addEventListener('abort', () => this[ABORT]()); + } + } + } + /** + * The amount of data stored in the buffer waiting to be read. + * + * For Buffer strings, this will be the total byte length. + * For string encoding streams, this will be the string character length, + * according to JavaScript's `string.length` logic. + * For objectMode streams, this is a count of the items waiting to be + * emitted. + */ + get bufferLength() { + return this[BUFFERLENGTH]; + } + /** + * The `BufferEncoding` currently in use, or `null` + */ + get encoding() { + return this[ENCODING]; + } + /** + * @deprecated - This is a read only property + */ + set encoding(_enc) { + throw new Error('Encoding must be set at instantiation time'); + } + /** + * @deprecated - Encoding may only be set at instantiation time + */ + setEncoding(_enc) { + throw new Error('Encoding must be set at instantiation time'); + } + /** + * True if this is an objectMode stream + */ + get objectMode() { + return this[OBJECTMODE]; + } + /** + * @deprecated - This is a read-only property + */ + set objectMode(_om) { + throw new Error('objectMode must be set at instantiation time'); + } + /** + * true if this is an async stream + */ + get ['async']() { + return this[ASYNC]; + } + /** + * Set to true to make this stream async. + * + * Once set, it cannot be unset, as this would potentially cause incorrect + * behavior. Ie, a sync stream can be made async, but an async stream + * cannot be safely made sync. + */ + set ['async'](a) { + this[ASYNC] = this[ASYNC] || !!a; + } + // drop everything and get out of the flow completely + [ABORT]() { + this[ABORTED] = true; + this.emit('abort', this[SIGNAL]?.reason); + this.destroy(this[SIGNAL]?.reason); + } + /** + * True if the stream has been aborted. + */ + get aborted() { + return this[ABORTED]; + } + /** + * No-op setter. Stream aborted status is set via the AbortSignal provided + * in the constructor options. + */ + set aborted(_) { } + write(chunk, encoding, cb) { + if (this[ABORTED]) + return false; + if (this[EOF]) + throw new Error('write after end'); + if (this[DESTROYED]) { + this.emit('error', Object.assign(new Error('Cannot call write after a stream was destroyed'), { code: 'ERR_STREAM_DESTROYED' })); + return true; + } + if (typeof encoding === 'function') { + cb = encoding; + encoding = 'utf8'; + } + if (!encoding) + encoding = 'utf8'; + const fn = this[ASYNC] ? defer : nodefer; + // convert array buffers and typed array views into buffers + // at some point in the future, we may want to do the opposite! + // leave strings and buffers as-is + // anything is only allowed if in object mode, so throw + if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { + if (isArrayBufferView(chunk)) { + //@ts-ignore - sinful unsafe type changing + chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength); + } + else if (isArrayBufferLike(chunk)) { + //@ts-ignore - sinful unsafe type changing + chunk = Buffer.from(chunk); + } + else if (typeof chunk !== 'string') { + throw new Error('Non-contiguous data written to non-objectMode stream'); + } + } + // handle object mode up front, since it's simpler + // this yields better performance, fewer checks later. + if (this[OBJECTMODE]) { + // maybe impossible? + /* c8 ignore start */ + if (this[FLOWING] && this[BUFFERLENGTH] !== 0) + this[FLUSH](true); + /* c8 ignore stop */ + if (this[FLOWING]) + this.emit('data', chunk); + else + this[BUFFERPUSH](chunk); + if (this[BUFFERLENGTH] !== 0) + this.emit('readable'); + if (cb) + fn(cb); + return this[FLOWING]; + } + // at this point the chunk is a buffer or string + // don't buffer it up or send it to the decoder + if (!chunk.length) { + if (this[BUFFERLENGTH] !== 0) + this.emit('readable'); + if (cb) + fn(cb); + return this[FLOWING]; + } + // fast-path writing strings of same encoding to a stream with + // an empty buffer, skipping the buffer/decoder dance + if (typeof chunk === 'string' && + // unless it is a string already ready for us to use + !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) { + //@ts-ignore - sinful unsafe type change + chunk = Buffer.from(chunk, encoding); + } + if (Buffer.isBuffer(chunk) && this[ENCODING]) { + //@ts-ignore - sinful unsafe type change + chunk = this[DECODER].write(chunk); + } + // Note: flushing CAN potentially switch us into not-flowing mode + if (this[FLOWING] && this[BUFFERLENGTH] !== 0) + this[FLUSH](true); + if (this[FLOWING]) + this.emit('data', chunk); + else + this[BUFFERPUSH](chunk); + if (this[BUFFERLENGTH] !== 0) + this.emit('readable'); + if (cb) + fn(cb); + return this[FLOWING]; + } + /** + * Low-level explicit read method. + * + * In objectMode, the argument is ignored, and one item is returned if + * available. + * + * `n` is the number of bytes (or in the case of encoding streams, + * characters) to consume. If `n` is not provided, then the entire buffer + * is returned, or `null` is returned if no data is available. + * + * If `n` is greater that the amount of data in the internal buffer, + * then `null` is returned. + */ + read(n) { + if (this[DESTROYED]) + return null; + this[DISCARDED] = false; + if (this[BUFFERLENGTH] === 0 || + n === 0 || + (n && n > this[BUFFERLENGTH])) { + this[MAYBE_EMIT_END](); + return null; + } + if (this[OBJECTMODE]) + n = null; + if (this[BUFFER].length > 1 && !this[OBJECTMODE]) { + // not object mode, so if we have an encoding, then RType is string + // otherwise, must be Buffer + this[BUFFER] = [ + (this[ENCODING] + ? this[BUFFER].join('') + : Buffer.concat(this[BUFFER], this[BUFFERLENGTH])), + ]; + } + const ret = this[READ](n || null, this[BUFFER][0]); + this[MAYBE_EMIT_END](); + return ret; + } + [READ](n, chunk) { + if (this[OBJECTMODE]) + this[BUFFERSHIFT](); + else { + const c = chunk; + if (n === c.length || n === null) + this[BUFFERSHIFT](); + else if (typeof c === 'string') { + this[BUFFER][0] = c.slice(n); + chunk = c.slice(0, n); + this[BUFFERLENGTH] -= n; + } + else { + this[BUFFER][0] = c.subarray(n); + chunk = c.subarray(0, n); + this[BUFFERLENGTH] -= n; + } + } + this.emit('data', chunk); + if (!this[BUFFER].length && !this[EOF]) + this.emit('drain'); + return chunk; + } + end(chunk, encoding, cb) { + if (typeof chunk === 'function') { + cb = chunk; + chunk = undefined; + } + if (typeof encoding === 'function') { + cb = encoding; + encoding = 'utf8'; + } + if (chunk !== undefined) + this.write(chunk, encoding); + if (cb) + this.once('end', cb); + this[EOF] = true; + this.writable = false; + // if we haven't written anything, then go ahead and emit, + // even if we're not reading. + // we'll re-emit if a new 'end' listener is added anyway. + // This makes MP more suitable to write-only use cases. + if (this[FLOWING] || !this[PAUSED]) + this[MAYBE_EMIT_END](); + return this; + } + // don't let the internal resume be overwritten + [RESUME]() { + if (this[DESTROYED]) + return; + if (!this[DATALISTENERS] && !this[PIPES].length) { + this[DISCARDED] = true; + } + this[PAUSED] = false; + this[FLOWING] = true; + this.emit('resume'); + if (this[BUFFER].length) + this[FLUSH](); + else if (this[EOF]) + this[MAYBE_EMIT_END](); + else + this.emit('drain'); + } + /** + * Resume the stream if it is currently in a paused state + * + * If called when there are no pipe destinations or `data` event listeners, + * this will place the stream in a "discarded" state, where all data will + * be thrown away. The discarded state is removed if a pipe destination or + * data handler is added, if pause() is called, or if any synchronous or + * asynchronous iteration is started. + */ + resume() { + return this[RESUME](); + } + /** + * Pause the stream + */ + pause() { + this[FLOWING] = false; + this[PAUSED] = true; + this[DISCARDED] = false; + } + /** + * true if the stream has been forcibly destroyed + */ + get destroyed() { + return this[DESTROYED]; + } + /** + * true if the stream is currently in a flowing state, meaning that + * any writes will be immediately emitted. + */ + get flowing() { + return this[FLOWING]; + } + /** + * true if the stream is currently in a paused state + */ + get paused() { + return this[PAUSED]; + } + [BUFFERPUSH](chunk) { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] += 1; + else + this[BUFFERLENGTH] += chunk.length; + this[BUFFER].push(chunk); + } + [BUFFERSHIFT]() { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] -= 1; + else + this[BUFFERLENGTH] -= this[BUFFER][0].length; + return this[BUFFER].shift(); + } + [FLUSH](noDrain = false) { + do { } while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && + this[BUFFER].length); + if (!noDrain && !this[BUFFER].length && !this[EOF]) + this.emit('drain'); + } + [FLUSHCHUNK](chunk) { + this.emit('data', chunk); + return this[FLOWING]; + } + /** + * Pipe all data emitted by this stream into the destination provided. + * + * Triggers the flow of data. + */ + pipe(dest, opts) { + if (this[DESTROYED]) + return dest; + this[DISCARDED] = false; + const ended = this[EMITTED_END]; + opts = opts || {}; + if (dest === proc.stdout || dest === proc.stderr) + opts.end = false; + else + opts.end = opts.end !== false; + opts.proxyErrors = !!opts.proxyErrors; + // piping an ended stream ends immediately + if (ended) { + if (opts.end) + dest.end(); + } + else { + // "as" here just ignores the WType, which pipes don't care about, + // since they're only consuming from us, and writing to the dest + this[PIPES].push(!opts.proxyErrors + ? new Pipe(this, dest, opts) + : new PipeProxyErrors(this, dest, opts)); + if (this[ASYNC]) + defer(() => this[RESUME]()); + else + this[RESUME](); + } + return dest; + } + /** + * Fully unhook a piped destination stream. + * + * If the destination stream was the only consumer of this stream (ie, + * there are no other piped destinations or `'data'` event listeners) + * then the flow of data will stop until there is another consumer or + * {@link Minipass#resume} is explicitly called. + */ + unpipe(dest) { + const p = this[PIPES].find(p => p.dest === dest); + if (p) { + if (this[PIPES].length === 1) { + if (this[FLOWING] && this[DATALISTENERS] === 0) { + this[FLOWING] = false; + } + this[PIPES] = []; + } + else + this[PIPES].splice(this[PIPES].indexOf(p), 1); + p.unpipe(); + } + } + /** + * Alias for {@link Minipass#on} + */ + addListener(ev, handler) { + return this.on(ev, handler); + } + /** + * Mostly identical to `EventEmitter.on`, with the following + * behavior differences to prevent data loss and unnecessary hangs: + * + * - Adding a 'data' event handler will trigger the flow of data + * + * - Adding a 'readable' event handler when there is data waiting to be read + * will cause 'readable' to be emitted immediately. + * + * - Adding an 'endish' event handler ('end', 'finish', etc.) which has + * already passed will cause the event to be emitted immediately and all + * handlers removed. + * + * - Adding an 'error' event handler after an error has been emitted will + * cause the event to be re-emitted immediately with the error previously + * raised. + */ + on(ev, handler) { + const ret = super.on(ev, handler); + if (ev === 'data') { + this[DISCARDED] = false; + this[DATALISTENERS]++; + if (!this[PIPES].length && !this[FLOWING]) { + this[RESUME](); + } + } + else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) { + super.emit('readable'); + } + else if (isEndish(ev) && this[EMITTED_END]) { + super.emit(ev); + this.removeAllListeners(ev); + } + else if (ev === 'error' && this[EMITTED_ERROR]) { + const h = handler; + if (this[ASYNC]) + defer(() => h.call(this, this[EMITTED_ERROR])); + else + h.call(this, this[EMITTED_ERROR]); + } + return ret; + } + /** + * Alias for {@link Minipass#off} + */ + removeListener(ev, handler) { + return this.off(ev, handler); + } + /** + * Mostly identical to `EventEmitter.off` + * + * If a 'data' event handler is removed, and it was the last consumer + * (ie, there are no pipe destinations or other 'data' event listeners), + * then the flow of data will stop until there is another consumer or + * {@link Minipass#resume} is explicitly called. + */ + off(ev, handler) { + const ret = super.off(ev, handler); + // if we previously had listeners, and now we don't, and we don't + // have any pipes, then stop the flow, unless it's been explicitly + // put in a discarded flowing state via stream.resume(). + if (ev === 'data') { + this[DATALISTENERS] = this.listeners('data').length; + if (this[DATALISTENERS] === 0 && + !this[DISCARDED] && + !this[PIPES].length) { + this[FLOWING] = false; + } + } + return ret; + } + /** + * Mostly identical to `EventEmitter.removeAllListeners` + * + * If all 'data' event handlers are removed, and they were the last consumer + * (ie, there are no pipe destinations), then the flow of data will stop + * until there is another consumer or {@link Minipass#resume} is explicitly + * called. + */ + removeAllListeners(ev) { + const ret = super.removeAllListeners(ev); + if (ev === 'data' || ev === undefined) { + this[DATALISTENERS] = 0; + if (!this[DISCARDED] && !this[PIPES].length) { + this[FLOWING] = false; + } + } + return ret; + } + /** + * true if the 'end' event has been emitted + */ + get emittedEnd() { + return this[EMITTED_END]; + } + [MAYBE_EMIT_END]() { + if (!this[EMITTING_END] && + !this[EMITTED_END] && + !this[DESTROYED] && + this[BUFFER].length === 0 && + this[EOF]) { + this[EMITTING_END] = true; + this.emit('end'); + this.emit('prefinish'); + this.emit('finish'); + if (this[CLOSED]) + this.emit('close'); + this[EMITTING_END] = false; + } + } + /** + * Mostly identical to `EventEmitter.emit`, with the following + * behavior differences to prevent data loss and unnecessary hangs: + * + * If the stream has been destroyed, and the event is something other + * than 'close' or 'error', then `false` is returned and no handlers + * are called. + * + * If the event is 'end', and has already been emitted, then the event + * is ignored. If the stream is in a paused or non-flowing state, then + * the event will be deferred until data flow resumes. If the stream is + * async, then handlers will be called on the next tick rather than + * immediately. + * + * If the event is 'close', and 'end' has not yet been emitted, then + * the event will be deferred until after 'end' is emitted. + * + * If the event is 'error', and an AbortSignal was provided for the stream, + * and there are no listeners, then the event is ignored, matching the + * behavior of node core streams in the presense of an AbortSignal. + * + * If the event is 'finish' or 'prefinish', then all listeners will be + * removed after emitting the event, to prevent double-firing. + */ + emit(ev, ...args) { + const data = args[0]; + // error and close are only events allowed after calling destroy() + if (ev !== 'error' && + ev !== 'close' && + ev !== DESTROYED && + this[DESTROYED]) { + return false; + } + else if (ev === 'data') { + return !this[OBJECTMODE] && !data + ? false + : this[ASYNC] + ? (defer(() => this[EMITDATA](data)), true) + : this[EMITDATA](data); + } + else if (ev === 'end') { + return this[EMITEND](); + } + else if (ev === 'close') { + this[CLOSED] = true; + // don't emit close before 'end' and 'finish' + if (!this[EMITTED_END] && !this[DESTROYED]) + return false; + const ret = super.emit('close'); + this.removeAllListeners('close'); + return ret; + } + else if (ev === 'error') { + this[EMITTED_ERROR] = data; + super.emit(ERROR, data); + const ret = !this[SIGNAL] || this.listeners('error').length + ? super.emit('error', data) + : false; + this[MAYBE_EMIT_END](); + return ret; + } + else if (ev === 'resume') { + const ret = super.emit('resume'); + this[MAYBE_EMIT_END](); + return ret; + } + else if (ev === 'finish' || ev === 'prefinish') { + const ret = super.emit(ev); + this.removeAllListeners(ev); + return ret; + } + // Some other unknown event + const ret = super.emit(ev, ...args); + this[MAYBE_EMIT_END](); + return ret; + } + [EMITDATA](data) { + for (const p of this[PIPES]) { + if (p.dest.write(data) === false) + this.pause(); + } + const ret = this[DISCARDED] ? false : super.emit('data', data); + this[MAYBE_EMIT_END](); + return ret; + } + [EMITEND]() { + if (this[EMITTED_END]) + return false; + this[EMITTED_END] = true; + this.readable = false; + return this[ASYNC] + ? (defer(() => this[EMITEND2]()), true) + : this[EMITEND2](); + } + [EMITEND2]() { + if (this[DECODER]) { + const data = this[DECODER].end(); + if (data) { + for (const p of this[PIPES]) { + p.dest.write(data); + } + if (!this[DISCARDED]) + super.emit('data', data); + } + } + for (const p of this[PIPES]) { + p.end(); + } + const ret = super.emit('end'); + this.removeAllListeners('end'); + return ret; + } + /** + * Return a Promise that resolves to an array of all emitted data once + * the stream ends. + */ + async collect() { + const buf = Object.assign([], { + dataLength: 0, + }); + if (!this[OBJECTMODE]) + buf.dataLength = 0; + // set the promise first, in case an error is raised + // by triggering the flow here. + const p = this.promise(); + this.on('data', c => { + buf.push(c); + if (!this[OBJECTMODE]) + buf.dataLength += c.length; + }); + await p; + return buf; + } + /** + * Return a Promise that resolves to the concatenation of all emitted data + * once the stream ends. + * + * Not allowed on objectMode streams. + */ + async concat() { + if (this[OBJECTMODE]) { + throw new Error('cannot concat in objectMode'); + } + const buf = await this.collect(); + return (this[ENCODING] + ? buf.join('') + : Buffer.concat(buf, buf.dataLength)); + } + /** + * Return a void Promise that resolves once the stream ends. + */ + async promise() { + return new Promise((resolve, reject) => { + this.on(DESTROYED, () => reject(new Error('stream destroyed'))); + this.on('error', er => reject(er)); + this.on('end', () => resolve()); + }); + } + /** + * Asynchronous `for await of` iteration. + * + * This will continue emitting all chunks until the stream terminates. + */ + [Symbol.asyncIterator]() { + // set this up front, in case the consumer doesn't call next() + // right away. + this[DISCARDED] = false; + let stopped = false; + const stop = async () => { + this.pause(); + stopped = true; + return { value: undefined, done: true }; + }; + const next = () => { + if (stopped) + return stop(); + const res = this.read(); + if (res !== null) + return Promise.resolve({ done: false, value: res }); + if (this[EOF]) + return stop(); + let resolve; + let reject; + const onerr = (er) => { + this.off('data', ondata); + this.off('end', onend); + this.off(DESTROYED, ondestroy); + stop(); + reject(er); + }; + const ondata = (value) => { + this.off('error', onerr); + this.off('end', onend); + this.off(DESTROYED, ondestroy); + this.pause(); + resolve({ value, done: !!this[EOF] }); + }; + const onend = () => { + this.off('error', onerr); + this.off('data', ondata); + this.off(DESTROYED, ondestroy); + stop(); + resolve({ done: true, value: undefined }); + }; + const ondestroy = () => onerr(new Error('stream destroyed')); + return new Promise((res, rej) => { + reject = rej; + resolve = res; + this.once(DESTROYED, ondestroy); + this.once('error', onerr); + this.once('end', onend); + this.once('data', ondata); + }); + }; + return { + next, + throw: stop, + return: stop, + [Symbol.asyncIterator]() { + return this; + }, + [Symbol.asyncDispose]: async () => { }, + }; + } + /** + * Synchronous `for of` iteration. + * + * The iteration will terminate when the internal buffer runs out, even + * if the stream has not yet terminated. + */ + [Symbol.iterator]() { + // set this up front, in case the consumer doesn't call next() + // right away. + this[DISCARDED] = false; + let stopped = false; + const stop = () => { + this.pause(); + this.off(ERROR, stop); + this.off(DESTROYED, stop); + this.off('end', stop); + stopped = true; + return { done: true, value: undefined }; + }; + const next = () => { + if (stopped) + return stop(); + const value = this.read(); + return value === null ? stop() : { done: false, value }; + }; + this.once('end', stop); + this.once(ERROR, stop); + this.once(DESTROYED, stop); + return { + next, + throw: stop, + return: stop, + [Symbol.iterator]() { + return this; + }, + [Symbol.dispose]: () => { }, + }; + } + /** + * Destroy a stream, preventing it from being used for any further purpose. + * + * If the stream has a `close()` method, then it will be called on + * destruction. + * + * After destruction, any attempt to write data, read data, or emit most + * events will be ignored. + * + * If an error argument is provided, then it will be emitted in an + * 'error' event. + */ + destroy(er) { + if (this[DESTROYED]) { + if (er) + this.emit('error', er); + else + this.emit(DESTROYED); + return this; + } + this[DESTROYED] = true; + this[DISCARDED] = true; + // throw away all buffered data, it's never coming out + this[BUFFER].length = 0; + this[BUFFERLENGTH] = 0; + const wc = this; + if (typeof wc.close === 'function' && !this[CLOSED]) + wc.close(); + if (er) + this.emit('error', er); + // if no error to emit, still reject pending promises + else + this.emit(DESTROYED); + return this; + } + /** + * Alias for {@link isStream} + * + * Former export location, maintained for backwards compatibility. + * + * @deprecated + */ + static get isStream() { + return exports.isStream; + } +} +exports.Minipass = Minipass; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/2c/04efdcab887ff94f6adbbd70d0470dbc29b17ebd7c823e8eb3be5320e913cf25af2db514cd6de92beacab7051e2e497eb52dd04562ca28b57d018b05ba7001 b/.pnpm-store/v11/files/2c/04efdcab887ff94f6adbbd70d0470dbc29b17ebd7c823e8eb3be5320e913cf25af2db514cd6de92beacab7051e2e497eb52dd04562ca28b57d018b05ba7001 new file mode 100644 index 0000000000..9ae8aadb95 --- /dev/null +++ b/.pnpm-store/v11/files/2c/04efdcab887ff94f6adbbd70d0470dbc29b17ebd7c823e8eb3be5320e913cf25af2db514cd6de92beacab7051e2e497eb52dd04562ca28b57d018b05ba7001 @@ -0,0 +1,195 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +'use strict' + +const argv = process.argv.slice(2) + +let versions = [] + +const range = [] + +let inc = null + +const version = require('../package.json').version + +let loose = false + +let includePrerelease = false + +let coerce = false + +let rtl = false + +let identifier + +let identifierBase + +const semver = require('../') +const parseOptions = require('../internal/parse-options') + +let reverse = false + +let options = {} + +const main = () => { + if (!argv.length) { + return help() + } + while (argv.length) { + let a = argv.shift() + const indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + const value = a.slice(indexOfEqualSign + 1) + a = a.slice(0, indexOfEqualSign) + argv.unshift(value) + } + + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + if (semver.RELEASE_TYPES.includes(argv[0]) || (argv[0] === 'release')) { + inc = { value: argv.shift(), maybeErrantValue: null, option: a } + } else { + inc = { value: 'patch', maybeErrantValue: argv[0], option: a } + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-n': + identifierBase = argv.shift() + if (identifierBase === 'false') { + identifierBase = false + } + break + case '-c': case '--coerce': + coerce = true + break + case '--rtl': + rtl = true + break + case '--ltr': + rtl = false + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + options = parseOptions({ loose, includePrerelease, rtl }) + + if ( + inc && + versions.includes(inc.maybeErrantValue) && + !semver.valid(inc.maybeErrantValue, options) + ) { + console.warn(`Invalid value for ${inc.option}; defaulting to 'patch'. This may become a failure in future major versions.`) + } + + versions = versions.map((v) => { + return coerce ? (semver.coerce(v, options) || { version: v }).version : v + }).filter((v) => { + return semver.valid(v, options) + }) + if (!versions.length) { + return fail() + } + if (inc && (versions.length !== 1 || range.length)) { + return failInc() + } + + for (let i = 0, l = range.length; i < l; i++) { + versions = versions.filter((v) => { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) { + return fail() + } + } + versions + .sort((a, b) => semver[reverse ? 'rcompare' : 'compare'](a, b, options)) + .map(v => semver.clean(v, options)) + .map(v => inc ? semver.inc(v, inc.value, options, identifier, identifierBase) : v) + .forEach(v => console.log(v)) +} + +const failInc = () => { + console.error('--inc can only be used on a single version with no range') + fail() +} + +const fail = () => process.exit(1) + +const help = () => console.log( +`SemVer ${version} + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, prerelease, or release. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +-n + Base number to be used for the prerelease identifier. + Can be either 0 or 1, or false to omit the number altogether. + Defaults to 0. + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them.`) + +main() diff --git a/.pnpm-store/v11/files/2c/ee02b2ef22d8e3577697d7022a12039150072ddd55ec458ade8128654cec1483e07ec146c58e045fe0f1d0146114dd763506be005d6061f6a2ac79fadb4ea5 b/.pnpm-store/v11/files/2c/ee02b2ef22d8e3577697d7022a12039150072ddd55ec458ade8128654cec1483e07ec146c58e045fe0f1d0146114dd763506be005d6061f6a2ac79fadb4ea5 new file mode 100644 index 0000000000..9a685d680a --- /dev/null +++ b/.pnpm-store/v11/files/2c/ee02b2ef22d8e3577697d7022a12039150072ddd55ec458ade8128654cec1483e07ec146c58e045fe0f1d0146114dd763506be005d6061f6a2ac79fadb4ea5 @@ -0,0 +1,2272 @@ +// https://github.com/Ethan-Arrowood/undici-fetch + +'use strict' + +const { + makeNetworkError, + makeAppropriateNetworkError, + filterResponse, + makeResponse, + fromInnerResponse +} = require('./response') +const { HeadersList } = require('./headers') +const { Request, cloneRequest } = require('./request') +const zlib = require('node:zlib') +const { + bytesMatch, + makePolicyContainer, + clonePolicyContainer, + requestBadPort, + TAOCheck, + appendRequestOriginHeader, + responseLocationURL, + requestCurrentURL, + setRequestReferrerPolicyOnRedirect, + tryUpgradeRequestToAPotentiallyTrustworthyURL, + createOpaqueTimingInfo, + appendFetchMetadata, + corsCheck, + crossOriginResourcePolicyCheck, + determineRequestsReferrer, + coarsenedSharedCurrentTime, + createDeferredPromise, + isBlobLike, + sameOrigin, + isCancelled, + isAborted, + isErrorLike, + fullyReadBody, + readableStreamClose, + isomorphicEncode, + urlIsLocal, + urlIsHttpHttpsScheme, + urlHasHttpsScheme, + clampAndCoarsenConnectionTimingInfo, + simpleRangeHeaderValue, + buildContentRange, + createInflate, + extractMimeType +} = require('./util') +const { kState, kDispatcher } = require('./symbols') +const assert = require('node:assert') +const { safelyExtractBody, extractBody } = require('./body') +const { + redirectStatusSet, + nullBodyStatus, + safeMethodsSet, + requestBodyHeader, + subresourceSet +} = require('./constants') +const EE = require('node:events') +const { Readable, pipeline, finished } = require('node:stream') +const { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require('../../core/util') +const { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require('./data-url') +const { getGlobalDispatcher } = require('../../global') +const { webidl } = require('./webidl') +const { STATUS_CODES } = require('node:http') +const GET_OR_HEAD = ['GET', 'HEAD'] + +const defaultUserAgent = typeof __UNDICI_IS_NODE__ !== 'undefined' || typeof esbuildDetection !== 'undefined' + ? 'node' + : 'undici' + +/** @type {import('buffer').resolveObjectURL} */ +let resolveObjectURL + +class Fetch extends EE { + constructor (dispatcher) { + super() + + this.dispatcher = dispatcher + this.connection = null + this.dump = false + this.state = 'ongoing' + } + + terminate (reason) { + if (this.state !== 'ongoing') { + return + } + + this.state = 'terminated' + this.connection?.destroy(reason) + this.emit('terminated', reason) + } + + // https://fetch.spec.whatwg.org/#fetch-controller-abort + abort (error) { + if (this.state !== 'ongoing') { + return + } + + // 1. Set controller’s state to "aborted". + this.state = 'aborted' + + // 2. Let fallbackError be an "AbortError" DOMException. + // 3. Set error to fallbackError if it is not given. + if (!error) { + error = new DOMException('The operation was aborted.', 'AbortError') + } + + // 4. Let serializedError be StructuredSerialize(error). + // If that threw an exception, catch it, and let + // serializedError be StructuredSerialize(fallbackError). + + // 5. Set controller’s serialized abort reason to serializedError. + this.serializedAbortReason = error + + this.connection?.destroy(error) + this.emit('terminated', error) + } +} + +function handleFetchDone (response) { + finalizeAndReportTiming(response, 'fetch') +} + +// https://fetch.spec.whatwg.org/#fetch-method +function fetch (input, init = undefined) { + webidl.argumentLengthCheck(arguments, 1, 'globalThis.fetch') + + // 1. Let p be a new promise. + let p = createDeferredPromise() + + // 2. Let requestObject be the result of invoking the initial value of + // Request as constructor with input and init as arguments. If this throws + // an exception, reject p with it and return p. + let requestObject + + try { + requestObject = new Request(input, init) + } catch (e) { + p.reject(e) + return p.promise + } + + // 3. Let request be requestObject’s request. + const request = requestObject[kState] + + // 4. If requestObject’s signal’s aborted flag is set, then: + if (requestObject.signal.aborted) { + // 1. Abort the fetch() call with p, request, null, and + // requestObject’s signal’s abort reason. + abortFetch(p, request, null, requestObject.signal.reason) + + // 2. Return p. + return p.promise + } + + // 5. Let globalObject be request’s client’s global object. + const globalObject = request.client.globalObject + + // 6. If globalObject is a ServiceWorkerGlobalScope object, then set + // request’s service-workers mode to "none". + if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') { + request.serviceWorkers = 'none' + } + + // 7. Let responseObject be null. + let responseObject = null + + // 8. Let relevantRealm be this’s relevant Realm. + + // 9. Let locallyAborted be false. + let locallyAborted = false + + // 10. Let controller be null. + let controller = null + + // 11. Add the following abort steps to requestObject’s signal: + addAbortListener( + requestObject.signal, + () => { + // 1. Set locallyAborted to true. + locallyAborted = true + + // 2. Assert: controller is non-null. + assert(controller != null) + + // 3. Abort controller with requestObject’s signal’s abort reason. + controller.abort(requestObject.signal.reason) + + const realResponse = responseObject?.deref() + + // 4. Abort the fetch() call with p, request, responseObject, + // and requestObject’s signal’s abort reason. + abortFetch(p, request, realResponse, requestObject.signal.reason) + } + ) + + // 12. Let handleFetchDone given response response be to finalize and + // report timing with response, globalObject, and "fetch". + // see function handleFetchDone + + // 13. Set controller to the result of calling fetch given request, + // with processResponseEndOfBody set to handleFetchDone, and processResponse + // given response being these substeps: + + const processResponse = (response) => { + // 1. If locallyAborted is true, terminate these substeps. + if (locallyAborted) { + return + } + + // 2. If response’s aborted flag is set, then: + if (response.aborted) { + // 1. Let deserializedError be the result of deserialize a serialized + // abort reason given controller’s serialized abort reason and + // relevantRealm. + + // 2. Abort the fetch() call with p, request, responseObject, and + // deserializedError. + + abortFetch(p, request, responseObject, controller.serializedAbortReason) + return + } + + // 3. If response is a network error, then reject p with a TypeError + // and terminate these substeps. + if (response.type === 'error') { + p.reject(new TypeError('fetch failed', { cause: response.error })) + return + } + + // 4. Set responseObject to the result of creating a Response object, + // given response, "immutable", and relevantRealm. + responseObject = new WeakRef(fromInnerResponse(response, 'immutable')) + + // 5. Resolve p with responseObject. + p.resolve(responseObject.deref()) + p = null + } + + controller = fetching({ + request, + processResponseEndOfBody: handleFetchDone, + processResponse, + dispatcher: requestObject[kDispatcher] // undici + }) + + // 14. Return p. + return p.promise +} + +// https://fetch.spec.whatwg.org/#finalize-and-report-timing +function finalizeAndReportTiming (response, initiatorType = 'other') { + // 1. If response is an aborted network error, then return. + if (response.type === 'error' && response.aborted) { + return + } + + // 2. If response’s URL list is null or empty, then return. + if (!response.urlList?.length) { + return + } + + // 3. Let originalURL be response’s URL list[0]. + const originalURL = response.urlList[0] + + // 4. Let timingInfo be response’s timing info. + let timingInfo = response.timingInfo + + // 5. Let cacheState be response’s cache state. + let cacheState = response.cacheState + + // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return. + if (!urlIsHttpHttpsScheme(originalURL)) { + return + } + + // 7. If timingInfo is null, then return. + if (timingInfo === null) { + return + } + + // 8. If response’s timing allow passed flag is not set, then: + if (!response.timingAllowPassed) { + // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo. + timingInfo = createOpaqueTimingInfo({ + startTime: timingInfo.startTime + }) + + // 2. Set cacheState to the empty string. + cacheState = '' + } + + // 9. Set timingInfo’s end time to the coarsened shared current time + // given global’s relevant settings object’s cross-origin isolated + // capability. + // TODO: given global’s relevant settings object’s cross-origin isolated + // capability? + timingInfo.endTime = coarsenedSharedCurrentTime() + + // 10. Set response’s timing info to timingInfo. + response.timingInfo = timingInfo + + // 11. Mark resource timing for timingInfo, originalURL, initiatorType, + // global, and cacheState. + markResourceTiming( + timingInfo, + originalURL.href, + initiatorType, + globalThis, + cacheState + ) +} + +// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing +const markResourceTiming = performance.markResourceTiming + +// https://fetch.spec.whatwg.org/#abort-fetch +function abortFetch (p, request, responseObject, error) { + // 1. Reject promise with error. + if (p) { + // We might have already resolved the promise at this stage + p.reject(error) + } + + // 2. If request’s body is not null and is readable, then cancel request’s + // body with error. + if (request.body != null && isReadable(request.body?.stream)) { + request.body.stream.cancel(error).catch((err) => { + if (err.code === 'ERR_INVALID_STATE') { + // Node bug? + return + } + throw err + }) + } + + // 3. If responseObject is null, then return. + if (responseObject == null) { + return + } + + // 4. Let response be responseObject’s response. + const response = responseObject[kState] + + // 5. If response’s body is not null and is readable, then error response’s + // body with error. + if (response.body != null && isReadable(response.body?.stream)) { + response.body.stream.cancel(error).catch((err) => { + if (err.code === 'ERR_INVALID_STATE') { + // Node bug? + return + } + throw err + }) + } +} + +// https://fetch.spec.whatwg.org/#fetching +function fetching ({ + request, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseEndOfBody, + processResponseConsumeBody, + useParallelQueue = false, + dispatcher = getGlobalDispatcher() // undici +}) { + // Ensure that the dispatcher is set accordingly + assert(dispatcher) + + // 1. Let taskDestination be null. + let taskDestination = null + + // 2. Let crossOriginIsolatedCapability be false. + let crossOriginIsolatedCapability = false + + // 3. If request’s client is non-null, then: + if (request.client != null) { + // 1. Set taskDestination to request’s client’s global object. + taskDestination = request.client.globalObject + + // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin + // isolated capability. + crossOriginIsolatedCapability = + request.client.crossOriginIsolatedCapability + } + + // 4. If useParallelQueue is true, then set taskDestination to the result of + // starting a new parallel queue. + // TODO + + // 5. Let timingInfo be a new fetch timing info whose start time and + // post-redirect start time are the coarsened shared current time given + // crossOriginIsolatedCapability. + const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability) + const timingInfo = createOpaqueTimingInfo({ + startTime: currentTime + }) + + // 6. Let fetchParams be a new fetch params whose + // request is request, + // timing info is timingInfo, + // process request body chunk length is processRequestBodyChunkLength, + // process request end-of-body is processRequestEndOfBody, + // process response is processResponse, + // process response consume body is processResponseConsumeBody, + // process response end-of-body is processResponseEndOfBody, + // task destination is taskDestination, + // and cross-origin isolated capability is crossOriginIsolatedCapability. + const fetchParams = { + controller: new Fetch(dispatcher), + request, + timingInfo, + processRequestBodyChunkLength, + processRequestEndOfBody, + processResponse, + processResponseConsumeBody, + processResponseEndOfBody, + taskDestination, + crossOriginIsolatedCapability + } + + // 7. If request’s body is a byte sequence, then set request’s body to + // request’s body as a body. + // NOTE: Since fetching is only called from fetch, body should already be + // extracted. + assert(!request.body || request.body.stream) + + // 8. If request’s window is "client", then set request’s window to request’s + // client, if request’s client’s global object is a Window object; otherwise + // "no-window". + if (request.window === 'client') { + // TODO: What if request.client is null? + request.window = + request.client?.globalObject?.constructor?.name === 'Window' + ? request.client + : 'no-window' + } + + // 9. If request’s origin is "client", then set request’s origin to request’s + // client’s origin. + if (request.origin === 'client') { + request.origin = request.client.origin + } + + // 10. If all of the following conditions are true: + // TODO + + // 11. If request’s policy container is "client", then: + if (request.policyContainer === 'client') { + // 1. If request’s client is non-null, then set request’s policy + // container to a clone of request’s client’s policy container. [HTML] + if (request.client != null) { + request.policyContainer = clonePolicyContainer( + request.client.policyContainer + ) + } else { + // 2. Otherwise, set request’s policy container to a new policy + // container. + request.policyContainer = makePolicyContainer() + } + } + + // 12. If request’s header list does not contain `Accept`, then: + if (!request.headersList.contains('accept', true)) { + // 1. Let value be `*/*`. + const value = '*/*' + + // 2. A user agent should set value to the first matching statement, if + // any, switching on request’s destination: + // "document" + // "frame" + // "iframe" + // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8` + // "image" + // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5` + // "style" + // `text/css,*/*;q=0.1` + // TODO + + // 3. Append `Accept`/value to request’s header list. + request.headersList.append('accept', value, true) + } + + // 13. If request’s header list does not contain `Accept-Language`, then + // user agents should append `Accept-Language`/an appropriate value to + // request’s header list. + if (!request.headersList.contains('accept-language', true)) { + request.headersList.append('accept-language', '*', true) + } + + // 14. If request’s priority is null, then use request’s initiator and + // destination appropriately in setting request’s priority to a + // user-agent-defined object. + if (request.priority === null) { + // TODO + } + + // 15. If request is a subresource request, then: + if (subresourceSet.has(request.destination)) { + // TODO + } + + // 16. Run main fetch given fetchParams. + mainFetch(fetchParams) + .catch(err => { + fetchParams.controller.terminate(err) + }) + + // 17. Return fetchParam's controller + return fetchParams.controller +} + +// https://fetch.spec.whatwg.org/#concept-main-fetch +async function mainFetch (fetchParams, recursive = false) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let response be null. + let response = null + + // 3. If request’s local-URLs-only flag is set and request’s current URL is + // not local, then set response to a network error. + if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) { + response = makeNetworkError('local URLs only') + } + + // 4. Run report Content Security Policy violations for request. + // TODO + + // 5. Upgrade request to a potentially trustworthy URL, if appropriate. + tryUpgradeRequestToAPotentiallyTrustworthyURL(request) + + // 6. If should request be blocked due to a bad port, should fetching request + // be blocked as mixed content, or should request be blocked by Content + // Security Policy returns blocked, then set response to a network error. + if (requestBadPort(request) === 'blocked') { + response = makeNetworkError('bad port') + } + // TODO: should fetching request be blocked as mixed content? + // TODO: should request be blocked by Content Security Policy? + + // 7. If request’s referrer policy is the empty string, then set request’s + // referrer policy to request’s policy container’s referrer policy. + if (request.referrerPolicy === '') { + request.referrerPolicy = request.policyContainer.referrerPolicy + } + + // 8. If request’s referrer is not "no-referrer", then set request’s + // referrer to the result of invoking determine request’s referrer. + if (request.referrer !== 'no-referrer') { + request.referrer = determineRequestsReferrer(request) + } + + // 9. Set request’s current URL’s scheme to "https" if all of the following + // conditions are true: + // - request’s current URL’s scheme is "http" + // - request’s current URL’s host is a domain + // - Matching request’s current URL’s host per Known HSTS Host Domain Name + // Matching results in either a superdomain match with an asserted + // includeSubDomains directive or a congruent match (with or without an + // asserted includeSubDomains directive). [HSTS] + // TODO + + // 10. If recursive is false, then run the remaining steps in parallel. + // TODO + + // 11. If response is null, then set response to the result of running + // the steps corresponding to the first matching statement: + if (response === null) { + response = await (async () => { + const currentURL = requestCurrentURL(request) + + if ( + // - request’s current URL’s origin is same origin with request’s origin, + // and request’s response tainting is "basic" + (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') || + // request’s current URL’s scheme is "data" + (currentURL.protocol === 'data:') || + // - request’s mode is "navigate" or "websocket" + (request.mode === 'navigate' || request.mode === 'websocket') + ) { + // 1. Set request’s response tainting to "basic". + request.responseTainting = 'basic' + + // 2. Return the result of running scheme fetch given fetchParams. + return await schemeFetch(fetchParams) + } + + // request’s mode is "same-origin" + if (request.mode === 'same-origin') { + // 1. Return a network error. + return makeNetworkError('request mode cannot be "same-origin"') + } + + // request’s mode is "no-cors" + if (request.mode === 'no-cors') { + // 1. If request’s redirect mode is not "follow", then return a network + // error. + if (request.redirect !== 'follow') { + return makeNetworkError( + 'redirect mode cannot be "follow" for "no-cors" request' + ) + } + + // 2. Set request’s response tainting to "opaque". + request.responseTainting = 'opaque' + + // 3. Return the result of running scheme fetch given fetchParams. + return await schemeFetch(fetchParams) + } + + // request’s current URL’s scheme is not an HTTP(S) scheme + if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) { + // Return a network error. + return makeNetworkError('URL scheme must be a HTTP(S) scheme') + } + + // - request’s use-CORS-preflight flag is set + // - request’s unsafe-request flag is set and either request’s method is + // not a CORS-safelisted method or CORS-unsafe request-header names with + // request’s header list is not empty + // 1. Set request’s response tainting to "cors". + // 2. Let corsWithPreflightResponse be the result of running HTTP fetch + // given fetchParams and true. + // 3. If corsWithPreflightResponse is a network error, then clear cache + // entries using request. + // 4. Return corsWithPreflightResponse. + // TODO + + // Otherwise + // 1. Set request’s response tainting to "cors". + request.responseTainting = 'cors' + + // 2. Return the result of running HTTP fetch given fetchParams. + return await httpFetch(fetchParams) + })() + } + + // 12. If recursive is true, then return response. + if (recursive) { + return response + } + + // 13. If response is not a network error and response is not a filtered + // response, then: + if (response.status !== 0 && !response.internalResponse) { + // If request’s response tainting is "cors", then: + if (request.responseTainting === 'cors') { + // 1. Let headerNames be the result of extracting header list values + // given `Access-Control-Expose-Headers` and response’s header list. + // TODO + // 2. If request’s credentials mode is not "include" and headerNames + // contains `*`, then set response’s CORS-exposed header-name list to + // all unique header names in response’s header list. + // TODO + // 3. Otherwise, if headerNames is not null or failure, then set + // response’s CORS-exposed header-name list to headerNames. + // TODO + } + + // Set response to the following filtered response with response as its + // internal response, depending on request’s response tainting: + if (request.responseTainting === 'basic') { + response = filterResponse(response, 'basic') + } else if (request.responseTainting === 'cors') { + response = filterResponse(response, 'cors') + } else if (request.responseTainting === 'opaque') { + response = filterResponse(response, 'opaque') + } else { + assert(false) + } + } + + // 14. Let internalResponse be response, if response is a network error, + // and response’s internal response otherwise. + let internalResponse = + response.status === 0 ? response : response.internalResponse + + // 15. If internalResponse’s URL list is empty, then set it to a clone of + // request’s URL list. + if (internalResponse.urlList.length === 0) { + internalResponse.urlList.push(...request.urlList) + } + + // 16. If request’s timing allow failed flag is unset, then set + // internalResponse’s timing allow passed flag. + if (!request.timingAllowFailed) { + response.timingAllowPassed = true + } + + // 17. If response is not a network error and any of the following returns + // blocked + // - should internalResponse to request be blocked as mixed content + // - should internalResponse to request be blocked by Content Security Policy + // - should internalResponse to request be blocked due to its MIME type + // - should internalResponse to request be blocked due to nosniff + // TODO + + // 18. If response’s type is "opaque", internalResponse’s status is 206, + // internalResponse’s range-requested flag is set, and request’s header + // list does not contain `Range`, then set response and internalResponse + // to a network error. + if ( + response.type === 'opaque' && + internalResponse.status === 206 && + internalResponse.rangeRequested && + !request.headers.contains('range', true) + ) { + response = internalResponse = makeNetworkError() + } + + // 19. If response is not a network error and either request’s method is + // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status, + // set internalResponse’s body to null and disregard any enqueuing toward + // it (if any). + if ( + response.status !== 0 && + (request.method === 'HEAD' || + request.method === 'CONNECT' || + nullBodyStatus.includes(internalResponse.status)) + ) { + internalResponse.body = null + fetchParams.controller.dump = true + } + + // 20. If request’s integrity metadata is not the empty string, then: + if (request.integrity) { + // 1. Let processBodyError be this step: run fetch finale given fetchParams + // and a network error. + const processBodyError = (reason) => + fetchFinale(fetchParams, makeNetworkError(reason)) + + // 2. If request’s response tainting is "opaque", or response’s body is null, + // then run processBodyError and abort these steps. + if (request.responseTainting === 'opaque' || response.body == null) { + processBodyError(response.error) + return + } + + // 3. Let processBody given bytes be these steps: + const processBody = (bytes) => { + // 1. If bytes do not match request’s integrity metadata, + // then run processBodyError and abort these steps. [SRI] + if (!bytesMatch(bytes, request.integrity)) { + processBodyError('integrity mismatch') + return + } + + // 2. Set response’s body to bytes as a body. + response.body = safelyExtractBody(bytes)[0] + + // 3. Run fetch finale given fetchParams and response. + fetchFinale(fetchParams, response) + } + + // 4. Fully read response’s body given processBody and processBodyError. + await fullyReadBody(response.body, processBody, processBodyError) + } else { + // 21. Otherwise, run fetch finale given fetchParams and response. + fetchFinale(fetchParams, response) + } +} + +// https://fetch.spec.whatwg.org/#concept-scheme-fetch +// given a fetch params fetchParams +function schemeFetch (fetchParams) { + // Note: since the connection is destroyed on redirect, which sets fetchParams to a + // cancelled state, we do not want this condition to trigger *unless* there have been + // no redirects. See https://github.com/nodejs/undici/issues/1776 + // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. + if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { + return Promise.resolve(makeAppropriateNetworkError(fetchParams)) + } + + // 2. Let request be fetchParams’s request. + const { request } = fetchParams + + const { protocol: scheme } = requestCurrentURL(request) + + // 3. Switch on request’s current URL’s scheme and run the associated steps: + switch (scheme) { + case 'about:': { + // If request’s current URL’s path is the string "blank", then return a new response + // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) », + // and body is the empty byte sequence as a body. + + // Otherwise, return a network error. + return Promise.resolve(makeNetworkError('about scheme is not supported')) + } + case 'blob:': { + if (!resolveObjectURL) { + resolveObjectURL = require('node:buffer').resolveObjectURL + } + + // 1. Let blobURLEntry be request’s current URL’s blob URL entry. + const blobURLEntry = requestCurrentURL(request) + + // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56 + // Buffer.resolveObjectURL does not ignore URL queries. + if (blobURLEntry.search.length !== 0) { + return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.')) + } + + const blob = resolveObjectURL(blobURLEntry.toString()) + + // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s + // object is not a Blob object, then return a network error. + if (request.method !== 'GET' || !isBlobLike(blob)) { + return Promise.resolve(makeNetworkError('invalid method')) + } + + // 3. Let blob be blobURLEntry’s object. + // Note: done above + + // 4. Let response be a new response. + const response = makeResponse() + + // 5. Let fullLength be blob’s size. + const fullLength = blob.size + + // 6. Let serializedFullLength be fullLength, serialized and isomorphic encoded. + const serializedFullLength = isomorphicEncode(`${fullLength}`) + + // 7. Let type be blob’s type. + const type = blob.type + + // 8. If request’s header list does not contain `Range`: + // 9. Otherwise: + if (!request.headersList.contains('range', true)) { + // 1. Let bodyWithType be the result of safely extracting blob. + // Note: in the FileAPI a blob "object" is a Blob *or* a MediaSource. + // In node, this can only ever be a Blob. Therefore we can safely + // use extractBody directly. + const bodyWithType = extractBody(blob) + + // 2. Set response’s status message to `OK`. + response.statusText = 'OK' + + // 3. Set response’s body to bodyWithType’s body. + response.body = bodyWithType[0] + + // 4. Set response’s header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ». + response.headersList.set('content-length', serializedFullLength, true) + response.headersList.set('content-type', type, true) + } else { + // 1. Set response’s range-requested flag. + response.rangeRequested = true + + // 2. Let rangeHeader be the result of getting `Range` from request’s header list. + const rangeHeader = request.headersList.get('range', true) + + // 3. Let rangeValue be the result of parsing a single range header value given rangeHeader and true. + const rangeValue = simpleRangeHeaderValue(rangeHeader, true) + + // 4. If rangeValue is failure, then return a network error. + if (rangeValue === 'failure') { + return Promise.resolve(makeNetworkError('failed to fetch the data URL')) + } + + // 5. Let (rangeStart, rangeEnd) be rangeValue. + let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue + + // 6. If rangeStart is null: + // 7. Otherwise: + if (rangeStart === null) { + // 1. Set rangeStart to fullLength − rangeEnd. + rangeStart = fullLength - rangeEnd + + // 2. Set rangeEnd to rangeStart + rangeEnd − 1. + rangeEnd = rangeStart + rangeEnd - 1 + } else { + // 1. If rangeStart is greater than or equal to fullLength, then return a network error. + if (rangeStart >= fullLength) { + return Promise.resolve(makeNetworkError('Range start is greater than the blob\'s size.')) + } + + // 2. If rangeEnd is null or rangeEnd is greater than or equal to fullLength, then set + // rangeEnd to fullLength − 1. + if (rangeEnd === null || rangeEnd >= fullLength) { + rangeEnd = fullLength - 1 + } + } + + // 8. Let slicedBlob be the result of invoking slice blob given blob, rangeStart, + // rangeEnd + 1, and type. + const slicedBlob = blob.slice(rangeStart, rangeEnd, type) + + // 9. Let slicedBodyWithType be the result of safely extracting slicedBlob. + // Note: same reason as mentioned above as to why we use extractBody + const slicedBodyWithType = extractBody(slicedBlob) + + // 10. Set response’s body to slicedBodyWithType’s body. + response.body = slicedBodyWithType[0] + + // 11. Let serializedSlicedLength be slicedBlob’s size, serialized and isomorphic encoded. + const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`) + + // 12. Let contentRange be the result of invoking build a content range given rangeStart, + // rangeEnd, and fullLength. + const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength) + + // 13. Set response’s status to 206. + response.status = 206 + + // 14. Set response’s status message to `Partial Content`. + response.statusText = 'Partial Content' + + // 15. Set response’s header list to « (`Content-Length`, serializedSlicedLength), + // (`Content-Type`, type), (`Content-Range`, contentRange) ». + response.headersList.set('content-length', serializedSlicedLength, true) + response.headersList.set('content-type', type, true) + response.headersList.set('content-range', contentRange, true) + } + + // 10. Return response. + return Promise.resolve(response) + } + case 'data:': { + // 1. Let dataURLStruct be the result of running the + // data: URL processor on request’s current URL. + const currentURL = requestCurrentURL(request) + const dataURLStruct = dataURLProcessor(currentURL) + + // 2. If dataURLStruct is failure, then return a + // network error. + if (dataURLStruct === 'failure') { + return Promise.resolve(makeNetworkError('failed to fetch the data URL')) + } + + // 3. Let mimeType be dataURLStruct’s MIME type, serialized. + const mimeType = serializeAMimeType(dataURLStruct.mimeType) + + // 4. Return a response whose status message is `OK`, + // header list is « (`Content-Type`, mimeType) », + // and body is dataURLStruct’s body as a body. + return Promise.resolve(makeResponse({ + statusText: 'OK', + headersList: [ + ['content-type', { name: 'Content-Type', value: mimeType }] + ], + body: safelyExtractBody(dataURLStruct.body)[0] + })) + } + case 'file:': { + // For now, unfortunate as it is, file URLs are left as an exercise for the reader. + // When in doubt, return a network error. + return Promise.resolve(makeNetworkError('not implemented... yet...')) + } + case 'http:': + case 'https:': { + // Return the result of running HTTP fetch given fetchParams. + + return httpFetch(fetchParams) + .catch((err) => makeNetworkError(err)) + } + default: { + return Promise.resolve(makeNetworkError('unknown scheme')) + } + } +} + +// https://fetch.spec.whatwg.org/#finalize-response +function finalizeResponse (fetchParams, response) { + // 1. Set fetchParams’s request’s done flag. + fetchParams.request.done = true + + // 2, If fetchParams’s process response done is not null, then queue a fetch + // task to run fetchParams’s process response done given response, with + // fetchParams’s task destination. + if (fetchParams.processResponseDone != null) { + queueMicrotask(() => fetchParams.processResponseDone(response)) + } +} + +// https://fetch.spec.whatwg.org/#fetch-finale +function fetchFinale (fetchParams, response) { + // 1. Let timingInfo be fetchParams’s timing info. + let timingInfo = fetchParams.timingInfo + + // 2. If response is not a network error and fetchParams’s request’s client is a secure context, + // then set timingInfo’s server-timing headers to the result of getting, decoding, and splitting + // `Server-Timing` from response’s internal response’s header list. + // TODO + + // 3. Let processResponseEndOfBody be the following steps: + const processResponseEndOfBody = () => { + // 1. Let unsafeEndTime be the unsafe shared current time. + const unsafeEndTime = Date.now() // ? + + // 2. If fetchParams’s request’s destination is "document", then set fetchParams’s controller’s + // full timing info to fetchParams’s timing info. + if (fetchParams.request.destination === 'document') { + fetchParams.controller.fullTimingInfo = timingInfo + } + + // 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global: + fetchParams.controller.reportTimingSteps = () => { + // 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return. + if (fetchParams.request.url.protocol !== 'https:') { + return + } + + // 2. Set timingInfo’s end time to the relative high resolution time given unsafeEndTime and global. + timingInfo.endTime = unsafeEndTime + + // 3. Let cacheState be response’s cache state. + let cacheState = response.cacheState + + // 4. Let bodyInfo be response’s body info. + const bodyInfo = response.bodyInfo + + // 5. If response’s timing allow passed flag is not set, then set timingInfo to the result of creating an + // opaque timing info for timingInfo and set cacheState to the empty string. + if (!response.timingAllowPassed) { + timingInfo = createOpaqueTimingInfo(timingInfo) + + cacheState = '' + } + + // 6. Let responseStatus be 0. + let responseStatus = 0 + + // 7. If fetchParams’s request’s mode is not "navigate" or response’s has-cross-origin-redirects is false: + if (fetchParams.request.mode !== 'navigator' || !response.hasCrossOriginRedirects) { + // 1. Set responseStatus to response’s status. + responseStatus = response.status + + // 2. Let mimeType be the result of extracting a MIME type from response’s header list. + const mimeType = extractMimeType(response.headersList) + + // 3. If mimeType is not failure, then set bodyInfo’s content type to the result of minimizing a supported MIME type given mimeType. + if (mimeType !== 'failure') { + bodyInfo.contentType = minimizeSupportedMimeType(mimeType) + } + } + + // 8. If fetchParams’s request’s initiator type is non-null, then mark resource timing given timingInfo, + // fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo, + // and responseStatus. + if (fetchParams.request.initiatorType != null) { + // TODO: update markresourcetiming + markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus) + } + } + + // 4. Let processResponseEndOfBodyTask be the following steps: + const processResponseEndOfBodyTask = () => { + // 1. Set fetchParams’s request’s done flag. + fetchParams.request.done = true + + // 2. If fetchParams’s process response end-of-body is non-null, then run fetchParams’s process + // response end-of-body given response. + if (fetchParams.processResponseEndOfBody != null) { + queueMicrotask(() => fetchParams.processResponseEndOfBody(response)) + } + + // 3. If fetchParams’s request’s initiator type is non-null and fetchParams’s request’s client’s + // global object is fetchParams’s task destination, then run fetchParams’s controller’s report + // timing steps given fetchParams’s request’s client’s global object. + if (fetchParams.request.initiatorType != null) { + fetchParams.controller.reportTimingSteps() + } + } + + // 5. Queue a fetch task to run processResponseEndOfBodyTask with fetchParams’s task destination + queueMicrotask(() => processResponseEndOfBodyTask()) + } + + // 4. If fetchParams’s process response is non-null, then queue a fetch task to run fetchParams’s + // process response given response, with fetchParams’s task destination. + if (fetchParams.processResponse != null) { + queueMicrotask(() => { + fetchParams.processResponse(response) + fetchParams.processResponse = null + }) + } + + // 5. Let internalResponse be response, if response is a network error; otherwise response’s internal response. + const internalResponse = response.type === 'error' ? response : (response.internalResponse ?? response) + + // 6. If internalResponse’s body is null, then run processResponseEndOfBody. + // 7. Otherwise: + if (internalResponse.body == null) { + processResponseEndOfBody() + } else { + // mcollina: all the following steps of the specs are skipped. + // The internal transform stream is not needed. + // See https://github.com/nodejs/undici/pull/3093#issuecomment-2050198541 + + // 1. Let transformStream be a new TransformStream. + // 2. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream. + // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm + // set to processResponseEndOfBody. + // 4. Set internalResponse’s body’s stream to the result of internalResponse’s body’s stream piped through transformStream. + + finished(internalResponse.body.stream, () => { + processResponseEndOfBody() + }) + } +} + +// https://fetch.spec.whatwg.org/#http-fetch +async function httpFetch (fetchParams) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let response be null. + let response = null + + // 3. Let actualResponse be null. + let actualResponse = null + + // 4. Let timingInfo be fetchParams’s timing info. + const timingInfo = fetchParams.timingInfo + + // 5. If request’s service-workers mode is "all", then: + if (request.serviceWorkers === 'all') { + // TODO + } + + // 6. If response is null, then: + if (response === null) { + // 1. If makeCORSPreflight is true and one of these conditions is true: + // TODO + + // 2. If request’s redirect mode is "follow", then set request’s + // service-workers mode to "none". + if (request.redirect === 'follow') { + request.serviceWorkers = 'none' + } + + // 3. Set response and actualResponse to the result of running + // HTTP-network-or-cache fetch given fetchParams. + actualResponse = response = await httpNetworkOrCacheFetch(fetchParams) + + // 4. If request’s response tainting is "cors" and a CORS check + // for request and response returns failure, then return a network error. + if ( + request.responseTainting === 'cors' && + corsCheck(request, response) === 'failure' + ) { + return makeNetworkError('cors failure') + } + + // 5. If the TAO check for request and response returns failure, then set + // request’s timing allow failed flag. + if (TAOCheck(request, response) === 'failure') { + request.timingAllowFailed = true + } + } + + // 7. If either request’s response tainting or response’s type + // is "opaque", and the cross-origin resource policy check with + // request’s origin, request’s client, request’s destination, + // and actualResponse returns blocked, then return a network error. + if ( + (request.responseTainting === 'opaque' || response.type === 'opaque') && + crossOriginResourcePolicyCheck( + request.origin, + request.client, + request.destination, + actualResponse + ) === 'blocked' + ) { + return makeNetworkError('blocked') + } + + // 8. If actualResponse’s status is a redirect status, then: + if (redirectStatusSet.has(actualResponse.status)) { + // 1. If actualResponse’s status is not 303, request’s body is not null, + // and the connection uses HTTP/2, then user agents may, and are even + // encouraged to, transmit an RST_STREAM frame. + // See, https://github.com/whatwg/fetch/issues/1288 + if (request.redirect !== 'manual') { + fetchParams.controller.connection.destroy(undefined, false) + } + + // 2. Switch on request’s redirect mode: + if (request.redirect === 'error') { + // Set response to a network error. + response = makeNetworkError('unexpected redirect') + } else if (request.redirect === 'manual') { + // Set response to an opaque-redirect filtered response whose internal + // response is actualResponse. + // NOTE(spec): On the web this would return an `opaqueredirect` response, + // but that doesn't make sense server side. + // See https://github.com/nodejs/undici/issues/1193. + response = actualResponse + } else if (request.redirect === 'follow') { + // Set response to the result of running HTTP-redirect fetch given + // fetchParams and response. + response = await httpRedirectFetch(fetchParams, response) + } else { + assert(false) + } + } + + // 9. Set response’s timing info to timingInfo. + response.timingInfo = timingInfo + + // 10. Return response. + return response +} + +// https://fetch.spec.whatwg.org/#http-redirect-fetch +function httpRedirectFetch (fetchParams, response) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let actualResponse be response, if response is not a filtered response, + // and response’s internal response otherwise. + const actualResponse = response.internalResponse + ? response.internalResponse + : response + + // 3. Let locationURL be actualResponse’s location URL given request’s current + // URL’s fragment. + let locationURL + + try { + locationURL = responseLocationURL( + actualResponse, + requestCurrentURL(request).hash + ) + + // 4. If locationURL is null, then return response. + if (locationURL == null) { + return response + } + } catch (err) { + // 5. If locationURL is failure, then return a network error. + return Promise.resolve(makeNetworkError(err)) + } + + // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network + // error. + if (!urlIsHttpHttpsScheme(locationURL)) { + return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme')) + } + + // 7. If request’s redirect count is 20, then return a network error. + if (request.redirectCount === 20) { + return Promise.resolve(makeNetworkError('redirect count exceeded')) + } + + // 8. Increase request’s redirect count by 1. + request.redirectCount += 1 + + // 9. If request’s mode is "cors", locationURL includes credentials, and + // request’s origin is not same origin with locationURL’s origin, then return + // a network error. + if ( + request.mode === 'cors' && + (locationURL.username || locationURL.password) && + !sameOrigin(request, locationURL) + ) { + return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"')) + } + + // 10. If request’s response tainting is "cors" and locationURL includes + // credentials, then return a network error. + if ( + request.responseTainting === 'cors' && + (locationURL.username || locationURL.password) + ) { + return Promise.resolve(makeNetworkError( + 'URL cannot contain credentials for request mode "cors"' + )) + } + + // 11. If actualResponse’s status is not 303, request’s body is non-null, + // and request’s body’s source is null, then return a network error. + if ( + actualResponse.status !== 303 && + request.body != null && + request.body.source == null + ) { + return Promise.resolve(makeNetworkError()) + } + + // 12. If one of the following is true + // - actualResponse’s status is 301 or 302 and request’s method is `POST` + // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD` + if ( + ([301, 302].includes(actualResponse.status) && request.method === 'POST') || + (actualResponse.status === 303 && + !GET_OR_HEAD.includes(request.method)) + ) { + // then: + // 1. Set request’s method to `GET` and request’s body to null. + request.method = 'GET' + request.body = null + + // 2. For each headerName of request-body-header name, delete headerName from + // request’s header list. + for (const headerName of requestBodyHeader) { + request.headersList.delete(headerName) + } + } + + // 13. If request’s current URL’s origin is not same origin with locationURL’s + // origin, then for each headerName of CORS non-wildcard request-header name, + // delete headerName from request’s header list. + if (!sameOrigin(requestCurrentURL(request), locationURL)) { + // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name + request.headersList.delete('authorization', true) + + // https://fetch.spec.whatwg.org/#authentication-entries + request.headersList.delete('proxy-authorization', true) + + // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement. + request.headersList.delete('cookie', true) + request.headersList.delete('host', true) + } + + // 14. If request’s body is non-null, then set request’s body to the first return + // value of safely extracting request’s body’s source. + if (request.body != null) { + assert(request.body.source != null) + request.body = safelyExtractBody(request.body.source)[0] + } + + // 15. Let timingInfo be fetchParams’s timing info. + const timingInfo = fetchParams.timingInfo + + // 16. Set timingInfo’s redirect end time and post-redirect start time to the + // coarsened shared current time given fetchParams’s cross-origin isolated + // capability. + timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = + coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability) + + // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s + // redirect start time to timingInfo’s start time. + if (timingInfo.redirectStartTime === 0) { + timingInfo.redirectStartTime = timingInfo.startTime + } + + // 18. Append locationURL to request’s URL list. + request.urlList.push(locationURL) + + // 19. Invoke set request’s referrer policy on redirect on request and + // actualResponse. + setRequestReferrerPolicyOnRedirect(request, actualResponse) + + // 20. Return the result of running main fetch given fetchParams and true. + return mainFetch(fetchParams, true) +} + +// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch +async function httpNetworkOrCacheFetch ( + fetchParams, + isAuthenticationFetch = false, + isNewConnectionFetch = false +) { + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let httpFetchParams be null. + let httpFetchParams = null + + // 3. Let httpRequest be null. + let httpRequest = null + + // 4. Let response be null. + let response = null + + // 5. Let storedResponse be null. + // TODO: cache + + // 6. Let httpCache be null. + const httpCache = null + + // 7. Let the revalidatingFlag be unset. + const revalidatingFlag = false + + // 8. Run these steps, but abort when the ongoing fetch is terminated: + + // 1. If request’s window is "no-window" and request’s redirect mode is + // "error", then set httpFetchParams to fetchParams and httpRequest to + // request. + if (request.window === 'no-window' && request.redirect === 'error') { + httpFetchParams = fetchParams + httpRequest = request + } else { + // Otherwise: + + // 1. Set httpRequest to a clone of request. + httpRequest = cloneRequest(request) + + // 2. Set httpFetchParams to a copy of fetchParams. + httpFetchParams = { ...fetchParams } + + // 3. Set httpFetchParams’s request to httpRequest. + httpFetchParams.request = httpRequest + } + + // 3. Let includeCredentials be true if one of + const includeCredentials = + request.credentials === 'include' || + (request.credentials === 'same-origin' && + request.responseTainting === 'basic') + + // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s + // body is non-null; otherwise null. + const contentLength = httpRequest.body ? httpRequest.body.length : null + + // 5. Let contentLengthHeaderValue be null. + let contentLengthHeaderValue = null + + // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or + // `PUT`, then set contentLengthHeaderValue to `0`. + if ( + httpRequest.body == null && + ['POST', 'PUT'].includes(httpRequest.method) + ) { + contentLengthHeaderValue = '0' + } + + // 7. If contentLength is non-null, then set contentLengthHeaderValue to + // contentLength, serialized and isomorphic encoded. + if (contentLength != null) { + contentLengthHeaderValue = isomorphicEncode(`${contentLength}`) + } + + // 8. If contentLengthHeaderValue is non-null, then append + // `Content-Length`/contentLengthHeaderValue to httpRequest’s header + // list. + if (contentLengthHeaderValue != null) { + httpRequest.headersList.append('content-length', contentLengthHeaderValue, true) + } + + // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`, + // contentLengthHeaderValue) to httpRequest’s header list. + + // 10. If contentLength is non-null and httpRequest’s keepalive is true, + // then: + if (contentLength != null && httpRequest.keepalive) { + // NOTE: keepalive is a noop outside of browser context. + } + + // 11. If httpRequest’s referrer is a URL, then append + // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded, + // to httpRequest’s header list. + if (httpRequest.referrer instanceof URL) { + httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href), true) + } + + // 12. Append a request `Origin` header for httpRequest. + appendRequestOriginHeader(httpRequest) + + // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA] + appendFetchMetadata(httpRequest) + + // 14. If httpRequest’s header list does not contain `User-Agent`, then + // user agents should append `User-Agent`/default `User-Agent` value to + // httpRequest’s header list. + if (!httpRequest.headersList.contains('user-agent', true)) { + httpRequest.headersList.append('user-agent', defaultUserAgent) + } + + // 15. If httpRequest’s cache mode is "default" and httpRequest’s header + // list contains `If-Modified-Since`, `If-None-Match`, + // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set + // httpRequest’s cache mode to "no-store". + if ( + httpRequest.cache === 'default' && + (httpRequest.headersList.contains('if-modified-since', true) || + httpRequest.headersList.contains('if-none-match', true) || + httpRequest.headersList.contains('if-unmodified-since', true) || + httpRequest.headersList.contains('if-match', true) || + httpRequest.headersList.contains('if-range', true)) + ) { + httpRequest.cache = 'no-store' + } + + // 16. If httpRequest’s cache mode is "no-cache", httpRequest’s prevent + // no-cache cache-control header modification flag is unset, and + // httpRequest’s header list does not contain `Cache-Control`, then append + // `Cache-Control`/`max-age=0` to httpRequest’s header list. + if ( + httpRequest.cache === 'no-cache' && + !httpRequest.preventNoCacheCacheControlHeaderModification && + !httpRequest.headersList.contains('cache-control', true) + ) { + httpRequest.headersList.append('cache-control', 'max-age=0', true) + } + + // 17. If httpRequest’s cache mode is "no-store" or "reload", then: + if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') { + // 1. If httpRequest’s header list does not contain `Pragma`, then append + // `Pragma`/`no-cache` to httpRequest’s header list. + if (!httpRequest.headersList.contains('pragma', true)) { + httpRequest.headersList.append('pragma', 'no-cache', true) + } + + // 2. If httpRequest’s header list does not contain `Cache-Control`, + // then append `Cache-Control`/`no-cache` to httpRequest’s header list. + if (!httpRequest.headersList.contains('cache-control', true)) { + httpRequest.headersList.append('cache-control', 'no-cache', true) + } + } + + // 18. If httpRequest’s header list contains `Range`, then append + // `Accept-Encoding`/`identity` to httpRequest’s header list. + if (httpRequest.headersList.contains('range', true)) { + httpRequest.headersList.append('accept-encoding', 'identity', true) + } + + // 19. Modify httpRequest’s header list per HTTP. Do not append a given + // header if httpRequest’s header list contains that header’s name. + // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129 + if (!httpRequest.headersList.contains('accept-encoding', true)) { + if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) { + httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate', true) + } else { + httpRequest.headersList.append('accept-encoding', 'gzip, deflate', true) + } + } + + httpRequest.headersList.delete('host', true) + + // 20. If includeCredentials is true, then: + if (includeCredentials) { + // 1. If the user agent is not configured to block cookies for httpRequest + // (see section 7 of [COOKIES]), then: + // TODO: credentials + // 2. If httpRequest’s header list does not contain `Authorization`, then: + // TODO: credentials + } + + // 21. If there’s a proxy-authentication entry, use it as appropriate. + // TODO: proxy-authentication + + // 22. Set httpCache to the result of determining the HTTP cache + // partition, given httpRequest. + // TODO: cache + + // 23. If httpCache is null, then set httpRequest’s cache mode to + // "no-store". + if (httpCache == null) { + httpRequest.cache = 'no-store' + } + + // 24. If httpRequest’s cache mode is neither "no-store" nor "reload", + // then: + if (httpRequest.cache !== 'no-store' && httpRequest.cache !== 'reload') { + // TODO: cache + } + + // 9. If aborted, then return the appropriate network error for fetchParams. + // TODO + + // 10. If response is null, then: + if (response == null) { + // 1. If httpRequest’s cache mode is "only-if-cached", then return a + // network error. + if (httpRequest.cache === 'only-if-cached') { + return makeNetworkError('only if cached') + } + + // 2. Let forwardResponse be the result of running HTTP-network fetch + // given httpFetchParams, includeCredentials, and isNewConnectionFetch. + const forwardResponse = await httpNetworkFetch( + httpFetchParams, + includeCredentials, + isNewConnectionFetch + ) + + // 3. If httpRequest’s method is unsafe and forwardResponse’s status is + // in the range 200 to 399, inclusive, invalidate appropriate stored + // responses in httpCache, as per the "Invalidation" chapter of HTTP + // Caching, and set storedResponse to null. [HTTP-CACHING] + if ( + !safeMethodsSet.has(httpRequest.method) && + forwardResponse.status >= 200 && + forwardResponse.status <= 399 + ) { + // TODO: cache + } + + // 4. If the revalidatingFlag is set and forwardResponse’s status is 304, + // then: + if (revalidatingFlag && forwardResponse.status === 304) { + // TODO: cache + } + + // 5. If response is null, then: + if (response == null) { + // 1. Set response to forwardResponse. + response = forwardResponse + + // 2. Store httpRequest and forwardResponse in httpCache, as per the + // "Storing Responses in Caches" chapter of HTTP Caching. [HTTP-CACHING] + // TODO: cache + } + } + + // 11. Set response’s URL list to a clone of httpRequest’s URL list. + response.urlList = [...httpRequest.urlList] + + // 12. If httpRequest’s header list contains `Range`, then set response’s + // range-requested flag. + if (httpRequest.headersList.contains('range', true)) { + response.rangeRequested = true + } + + // 13. Set response’s request-includes-credentials to includeCredentials. + response.requestIncludesCredentials = includeCredentials + + // 14. If response’s status is 401, httpRequest’s response tainting is not + // "cors", includeCredentials is true, and request’s window is an environment + // settings object, then: + // TODO + + // 15. If response’s status is 407, then: + if (response.status === 407) { + // 1. If request’s window is "no-window", then return a network error. + if (request.window === 'no-window') { + return makeNetworkError() + } + + // 2. ??? + + // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams. + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams) + } + + // 4. Prompt the end user as appropriate in request’s window and store + // the result as a proxy-authentication entry. [HTTP-AUTH] + // TODO: Invoke some kind of callback? + + // 5. Set response to the result of running HTTP-network-or-cache fetch given + // fetchParams. + // TODO + return makeNetworkError('proxy authentication required') + } + + // 16. If all of the following are true + if ( + // response’s status is 421 + response.status === 421 && + // isNewConnectionFetch is false + !isNewConnectionFetch && + // request’s body is null, or request’s body is non-null and request’s body’s source is non-null + (request.body == null || request.body.source != null) + ) { + // then: + + // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams. + if (isCancelled(fetchParams)) { + return makeAppropriateNetworkError(fetchParams) + } + + // 2. Set response to the result of running HTTP-network-or-cache + // fetch given fetchParams, isAuthenticationFetch, and true. + + // TODO (spec): The spec doesn't specify this but we need to cancel + // the active response before we can start a new one. + // https://github.com/whatwg/fetch/issues/1293 + fetchParams.controller.connection.destroy() + + response = await httpNetworkOrCacheFetch( + fetchParams, + isAuthenticationFetch, + true + ) + } + + // 17. If isAuthenticationFetch is true, then create an authentication entry + if (isAuthenticationFetch) { + // TODO + } + + // 18. Return response. + return response +} + +// https://fetch.spec.whatwg.org/#http-network-fetch +async function httpNetworkFetch ( + fetchParams, + includeCredentials = false, + forceNewConnection = false +) { + assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed) + + fetchParams.controller.connection = { + abort: null, + destroyed: false, + destroy (err, abort = true) { + if (!this.destroyed) { + this.destroyed = true + if (abort) { + this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError')) + } + } + } + } + + // 1. Let request be fetchParams’s request. + const request = fetchParams.request + + // 2. Let response be null. + let response = null + + // 3. Let timingInfo be fetchParams’s timing info. + const timingInfo = fetchParams.timingInfo + + // 4. Let httpCache be the result of determining the HTTP cache partition, + // given request. + // TODO: cache + const httpCache = null + + // 5. If httpCache is null, then set request’s cache mode to "no-store". + if (httpCache == null) { + request.cache = 'no-store' + } + + // 6. Let networkPartitionKey be the result of determining the network + // partition key given request. + // TODO + + // 7. Let newConnection be "yes" if forceNewConnection is true; otherwise + // "no". + const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars + + // 8. Switch on request’s mode: + if (request.mode === 'websocket') { + // Let connection be the result of obtaining a WebSocket connection, + // given request’s current URL. + // TODO + } else { + // Let connection be the result of obtaining a connection, given + // networkPartitionKey, request’s current URL’s origin, + // includeCredentials, and forceNewConnection. + // TODO + } + + // 9. Run these steps, but abort when the ongoing fetch is terminated: + + // 1. If connection is failure, then return a network error. + + // 2. Set timingInfo’s final connection timing info to the result of + // calling clamp and coarsen connection timing info with connection’s + // timing info, timingInfo’s post-redirect start time, and fetchParams’s + // cross-origin isolated capability. + + // 3. If connection is not an HTTP/2 connection, request’s body is non-null, + // and request’s body’s source is null, then append (`Transfer-Encoding`, + // `chunked`) to request’s header list. + + // 4. Set timingInfo’s final network-request start time to the coarsened + // shared current time given fetchParams’s cross-origin isolated + // capability. + + // 5. Set response to the result of making an HTTP request over connection + // using request with the following caveats: + + // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS] + // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH] + + // - If request’s body is non-null, and request’s body’s source is null, + // then the user agent may have a buffer of up to 64 kibibytes and store + // a part of request’s body in that buffer. If the user agent reads from + // request’s body beyond that buffer’s size and the user agent needs to + // resend request, then instead return a network error. + + // - Set timingInfo’s final network-response start time to the coarsened + // shared current time given fetchParams’s cross-origin isolated capability, + // immediately after the user agent’s HTTP parser receives the first byte + // of the response (e.g., frame header bytes for HTTP/2 or response status + // line for HTTP/1.x). + + // - Wait until all the headers are transmitted. + + // - Any responses whose status is in the range 100 to 199, inclusive, + // and is not 101, are to be ignored, except for the purposes of setting + // timingInfo’s final network-response start time above. + + // - If request’s header list contains `Transfer-Encoding`/`chunked` and + // response is transferred via HTTP/1.0 or older, then return a network + // error. + + // - If the HTTP request results in a TLS client certificate dialog, then: + + // 1. If request’s window is an environment settings object, make the + // dialog available in request’s window. + + // 2. Otherwise, return a network error. + + // To transmit request’s body body, run these steps: + let requestBody = null + // 1. If body is null and fetchParams’s process request end-of-body is + // non-null, then queue a fetch task given fetchParams’s process request + // end-of-body and fetchParams’s task destination. + if (request.body == null && fetchParams.processRequestEndOfBody) { + queueMicrotask(() => fetchParams.processRequestEndOfBody()) + } else if (request.body != null) { + // 2. Otherwise, if body is non-null: + + // 1. Let processBodyChunk given bytes be these steps: + const processBodyChunk = async function * (bytes) { + // 1. If the ongoing fetch is terminated, then abort these steps. + if (isCancelled(fetchParams)) { + return + } + + // 2. Run this step in parallel: transmit bytes. + yield bytes + + // 3. If fetchParams’s process request body is non-null, then run + // fetchParams’s process request body given bytes’s length. + fetchParams.processRequestBodyChunkLength?.(bytes.byteLength) + } + + // 2. Let processEndOfBody be these steps: + const processEndOfBody = () => { + // 1. If fetchParams is canceled, then abort these steps. + if (isCancelled(fetchParams)) { + return + } + + // 2. If fetchParams’s process request end-of-body is non-null, + // then run fetchParams’s process request end-of-body. + if (fetchParams.processRequestEndOfBody) { + fetchParams.processRequestEndOfBody() + } + } + + // 3. Let processBodyError given e be these steps: + const processBodyError = (e) => { + // 1. If fetchParams is canceled, then abort these steps. + if (isCancelled(fetchParams)) { + return + } + + // 2. If e is an "AbortError" DOMException, then abort fetchParams’s controller. + if (e.name === 'AbortError') { + fetchParams.controller.abort() + } else { + fetchParams.controller.terminate(e) + } + } + + // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody, + // processBodyError, and fetchParams’s task destination. + requestBody = (async function * () { + try { + for await (const bytes of request.body.stream) { + yield * processBodyChunk(bytes) + } + processEndOfBody() + } catch (err) { + processBodyError(err) + } + })() + } + + try { + // socket is only provided for websockets + const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody }) + + if (socket) { + response = makeResponse({ status, statusText, headersList, socket }) + } else { + const iterator = body[Symbol.asyncIterator]() + fetchParams.controller.next = () => iterator.next() + + response = makeResponse({ status, statusText, headersList }) + } + } catch (err) { + // 10. If aborted, then: + if (err.name === 'AbortError') { + // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame. + fetchParams.controller.connection.destroy() + + // 2. Return the appropriate network error for fetchParams. + return makeAppropriateNetworkError(fetchParams, err) + } + + return makeNetworkError(err) + } + + // 11. Let pullAlgorithm be an action that resumes the ongoing fetch + // if it is suspended. + const pullAlgorithm = async () => { + await fetchParams.controller.resume() + } + + // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s + // controller with reason, given reason. + const cancelAlgorithm = (reason) => { + // If the aborted fetch was already terminated, then we do not + // need to do anything. + if (!isCancelled(fetchParams)) { + fetchParams.controller.abort(reason) + } + } + + // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by + // the user agent. + // TODO + + // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object + // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent. + // TODO + + // 15. Let stream be a new ReadableStream. + // 16. Set up stream with byte reading support with pullAlgorithm set to pullAlgorithm, + // cancelAlgorithm set to cancelAlgorithm. + const stream = new ReadableStream( + { + async start (controller) { + fetchParams.controller.controller = controller + }, + async pull (controller) { + await pullAlgorithm(controller) + }, + async cancel (reason) { + await cancelAlgorithm(reason) + }, + type: 'bytes' + } + ) + + // 17. Run these steps, but abort when the ongoing fetch is terminated: + + // 1. Set response’s body to a new body whose stream is stream. + response.body = { stream, source: null, length: null } + + // 2. If response is not a network error and request’s cache mode is + // not "no-store", then update response in httpCache for request. + // TODO + + // 3. If includeCredentials is true and the user agent is not configured + // to block cookies for request (see section 7 of [COOKIES]), then run the + // "set-cookie-string" parsing algorithm (see section 5.2 of [COOKIES]) on + // the value of each header whose name is a byte-case-insensitive match for + // `Set-Cookie` in response’s header list, if any, and request’s current URL. + // TODO + + // 18. If aborted, then: + // TODO + + // 19. Run these steps in parallel: + + // 1. Run these steps, but abort when fetchParams is canceled: + fetchParams.controller.onAborted = onAborted + fetchParams.controller.on('terminated', onAborted) + fetchParams.controller.resume = async () => { + // 1. While true + while (true) { + // 1-3. See onData... + + // 4. Set bytes to the result of handling content codings given + // codings and bytes. + let bytes + let isFailure + try { + const { done, value } = await fetchParams.controller.next() + + if (isAborted(fetchParams)) { + break + } + + bytes = done ? undefined : value + } catch (err) { + if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { + // zlib doesn't like empty streams. + bytes = undefined + } else { + bytes = err + + // err may be propagated from the result of calling readablestream.cancel, + // which might not be an error. https://github.com/nodejs/undici/issues/2009 + isFailure = true + } + } + + if (bytes === undefined) { + // 2. Otherwise, if the bytes transmission for response’s message + // body is done normally and stream is readable, then close + // stream, finalize response for fetchParams and response, and + // abort these in-parallel steps. + readableStreamClose(fetchParams.controller.controller) + + finalizeResponse(fetchParams, response) + + return + } + + // 5. Increase timingInfo’s decoded body size by bytes’s length. + timingInfo.decodedBodySize += bytes?.byteLength ?? 0 + + // 6. If bytes is failure, then terminate fetchParams’s controller. + if (isFailure) { + fetchParams.controller.terminate(bytes) + return + } + + // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes + // into stream. + const buffer = new Uint8Array(bytes) + if (buffer.byteLength) { + fetchParams.controller.controller.enqueue(buffer) + } + + // 8. If stream is errored, then terminate the ongoing fetch. + if (isErrored(stream)) { + fetchParams.controller.terminate() + return + } + + // 9. If stream doesn’t need more data ask the user agent to suspend + // the ongoing fetch. + if (fetchParams.controller.controller.desiredSize <= 0) { + return + } + } + } + + // 2. If aborted, then: + function onAborted (reason) { + // 2. If fetchParams is aborted, then: + if (isAborted(fetchParams)) { + // 1. Set response’s aborted flag. + response.aborted = true + + // 2. If stream is readable, then error stream with the result of + // deserialize a serialized abort reason given fetchParams’s + // controller’s serialized abort reason and an + // implementation-defined realm. + if (isReadable(stream)) { + fetchParams.controller.controller.error( + fetchParams.controller.serializedAbortReason + ) + } + } else { + // 3. Otherwise, if stream is readable, error stream with a TypeError. + if (isReadable(stream)) { + fetchParams.controller.controller.error(new TypeError('terminated', { + cause: isErrorLike(reason) ? reason : undefined + })) + } + } + + // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame. + // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so. + fetchParams.controller.connection.destroy() + } + + // 20. Return response. + return response + + function dispatch ({ body }) { + const url = requestCurrentURL(request) + /** @type {import('../..').Agent} */ + const agent = fetchParams.controller.dispatcher + + return new Promise((resolve, reject) => agent.dispatch( + { + path: url.pathname + url.search, + origin: url.origin, + method: request.method, + body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body, + headers: request.headersList.entries, + maxRedirections: 0, + upgrade: request.mode === 'websocket' ? 'websocket' : undefined + }, + { + body: null, + abort: null, + + onConnect (abort) { + // TODO (fix): Do we need connection here? + const { connection } = fetchParams.controller + + // Set timingInfo’s final connection timing info to the result of calling clamp and coarsen + // connection timing info with connection’s timing info, timingInfo’s post-redirect start + // time, and fetchParams’s cross-origin isolated capability. + // TODO: implement connection timing + timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(undefined, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability) + + if (connection.destroyed) { + abort(new DOMException('The operation was aborted.', 'AbortError')) + } else { + fetchParams.controller.on('terminated', abort) + this.abort = connection.abort = abort + } + + // Set timingInfo’s final network-request start time to the coarsened shared current time given + // fetchParams’s cross-origin isolated capability. + timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability) + }, + + onResponseStarted () { + // Set timingInfo’s final network-response start time to the coarsened shared current + // time given fetchParams’s cross-origin isolated capability, immediately after the + // user agent’s HTTP parser receives the first byte of the response (e.g., frame header + // bytes for HTTP/2 or response status line for HTTP/1.x). + timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability) + }, + + onHeaders (status, rawHeaders, resume, statusText) { + if (status < 200) { + return + } + + let location = '' + + const headersList = new HeadersList() + + for (let i = 0; i < rawHeaders.length; i += 2) { + headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true) + } + location = headersList.get('location', true) + + this.body = new Readable({ read: resume }) + + const decoders = [] + + const willFollow = location && request.redirect === 'follow' && + redirectStatusSet.has(status) + + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding + if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) { + // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1 + const contentEncoding = headersList.get('content-encoding', true) + // "All content-coding values are case-insensitive..." + /** @type {string[]} */ + const codings = contentEncoding ? contentEncoding.toLowerCase().split(',') : [] + + // Limit the number of content-encodings to prevent resource exhaustion. + // CVE fix similar to urllib3 (GHSA-gm62-xv2j-4w53) and curl (CVE-2022-32206). + const maxContentEncodings = 5 + if (codings.length > maxContentEncodings) { + reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`)) + return true + } + + for (let i = codings.length - 1; i >= 0; --i) { + const coding = codings[i].trim() + // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2 + if (coding === 'x-gzip' || coding === 'gzip') { + decoders.push(zlib.createGunzip({ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + flush: zlib.constants.Z_SYNC_FLUSH, + finishFlush: zlib.constants.Z_SYNC_FLUSH + })) + } else if (coding === 'deflate') { + decoders.push(createInflate({ + flush: zlib.constants.Z_SYNC_FLUSH, + finishFlush: zlib.constants.Z_SYNC_FLUSH + })) + } else if (coding === 'br') { + decoders.push(zlib.createBrotliDecompress({ + flush: zlib.constants.BROTLI_OPERATION_FLUSH, + finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH + })) + } else { + decoders.length = 0 + break + } + } + } + + const onError = this.onError.bind(this) + + resolve({ + status, + statusText, + headersList, + body: decoders.length + ? pipeline(this.body, ...decoders, (err) => { + if (err) { + this.onError(err) + } + }).on('error', onError) + : this.body.on('error', onError) + }) + + return true + }, + + onData (chunk) { + if (fetchParams.controller.dump) { + return + } + + // 1. If one or more bytes have been transmitted from response’s + // message body, then: + + // 1. Let bytes be the transmitted bytes. + const bytes = chunk + + // 2. Let codings be the result of extracting header list values + // given `Content-Encoding` and response’s header list. + // See pullAlgorithm. + + // 3. Increase timingInfo’s encoded body size by bytes’s length. + timingInfo.encodedBodySize += bytes.byteLength + + // 4. See pullAlgorithm... + + return this.body.push(bytes) + }, + + onComplete () { + if (this.abort) { + fetchParams.controller.off('terminated', this.abort) + } + + if (fetchParams.controller.onAborted) { + fetchParams.controller.off('terminated', fetchParams.controller.onAborted) + } + + fetchParams.controller.ended = true + + this.body.push(null) + }, + + onError (error) { + if (this.abort) { + fetchParams.controller.off('terminated', this.abort) + } + + this.body?.destroy(error) + + fetchParams.controller.terminate(error) + + reject(error) + }, + + onUpgrade (status, rawHeaders, socket) { + if (status !== 101) { + return + } + + const headersList = new HeadersList() + + for (let i = 0; i < rawHeaders.length; i += 2) { + headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString('latin1'), true) + } + + resolve({ + status, + statusText: STATUS_CODES[status], + headersList, + socket + }) + + return true + } + } + )) + } +} + +module.exports = { + fetch, + Fetch, + fetching, + finalizeAndReportTiming +} diff --git a/.pnpm-store/v11/files/2d/0a5028eee1b67b03e4ce264fe2f99f4b5461603533838e3bfedf7bbf43dbdc3d6c2cff9f3140d9315e439c257304ca9419f7f366ee00dac6b032e7fcd2f32e b/.pnpm-store/v11/files/2d/0a5028eee1b67b03e4ce264fe2f99f4b5461603533838e3bfedf7bbf43dbdc3d6c2cff9f3140d9315e439c257304ca9419f7f366ee00dac6b032e7fcd2f32e new file mode 100644 index 0000000000..7cbcc17ef1 --- /dev/null +++ b/.pnpm-store/v11/files/2d/0a5028eee1b67b03e4ce264fe2f99f4b5461603533838e3bfedf7bbf43dbdc3d6c2cff9f3140d9315e439c257304ca9419f7f366ee00dac6b032e7fcd2f32e @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.code = exports.name = exports.normalFsTypes = exports.isName = exports.isCode = void 0; +const isCode = (c) => exports.name.has(c); +exports.isCode = isCode; +const isName = (c) => exports.code.has(c); +exports.isName = isName; +/** + * types that are a normal file system entry, not metadata. + * + * These can be the subject of extended/globalExtended headers, long path + * names, long linkpath names, etc. + * + * Any other types are meta, and cannot be targetted by extended PAX headers. + */ +exports.normalFsTypes = new Set([ + '0', + '', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + 'D', +]); +// map types from key to human-friendly name +exports.name = new Map([ + ['0', 'File'], + // same as File + ['', 'OldFile'], + ['1', 'Link'], + ['2', 'SymbolicLink'], + // Devices and FIFOs aren't fully supported + // they are parsed, but skipped when unpacking + ['3', 'CharacterDevice'], + ['4', 'BlockDevice'], + ['5', 'Directory'], + ['6', 'FIFO'], + // same as File + ['7', 'ContiguousFile'], + // pax headers + ['g', 'GlobalExtendedHeader'], + ['x', 'ExtendedHeader'], + // vendor-specific stuff + // skip + ['A', 'SolarisACL'], + // like 5, but with data, which should be skipped + ['D', 'GNUDumpDir'], + // metadata only, skip + ['I', 'Inode'], + // data = link path of next file + ['K', 'NextFileHasLongLinkpath'], + // data = path of next file + ['L', 'NextFileHasLongPath'], + // skip + ['M', 'ContinuationFile'], + // like L + ['N', 'OldGnuLongPath'], + // skip + ['S', 'SparseFile'], + // skip + ['V', 'TapeVolumeHeader'], + // like x + ['X', 'OldExtendedHeader'], +]); +// map the other direction +exports.code = new Map(Array.from(exports.name).map(kv => [kv[1], kv[0]])); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/2d/177757767e5d485496c680840a8d801b72df01ad4d1dc058293b7b3f080f3623d12f77b328e60ff0069bc6c354dcfa0ba83aaf66fdf73611fc2916b401b8e4 b/.pnpm-store/v11/files/2d/177757767e5d485496c680840a8d801b72df01ad4d1dc058293b7b3f080f3623d12f77b328e60ff0069bc6c354dcfa0ba83aaf66fdf73611fc2916b401b8e4 new file mode 100644 index 0000000000..d2fa131e56 --- /dev/null +++ b/.pnpm-store/v11/files/2d/177757767e5d485496c680840a8d801b72df01ad4d1dc058293b7b3f080f3623d12f77b328e60ff0069bc6c354dcfa0ba83aaf66fdf73611fc2916b401b8e4 @@ -0,0 +1,23 @@ +{ + "name": "@reflink/reflink-darwin-x64", + "version": "0.1.19", + "repository": { + "url": "https://github.com/pnpm/reflink.git", + "type": "git", + "directory": "darwin-x64" + }, + "os": [ + "darwin" + ], + "cpu": [ + "x64" + ], + "main": "reflink.darwin-x64.node", + "files": [ + "reflink.darwin-x64.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} \ No newline at end of file diff --git a/.pnpm-store/v11/files/2d/a3988746b988c854a1cfe0e5619645c370f830019a0ec5f9f060132a2c872355e6a07401c41773c685ed913a0d1d814601217c50dbf129e9173e2c9da032fb b/.pnpm-store/v11/files/2d/a3988746b988c854a1cfe0e5619645c370f830019a0ec5f9f060132a2c872355e6a07401c41773c685ed913a0d1d814601217c50dbf129e9173e2c9da032fb new file mode 100644 index 0000000000..6a7b68d5ea --- /dev/null +++ b/.pnpm-store/v11/files/2d/a3988746b988c854a1cfe0e5619645c370f830019a0ec5f9f060132a2c872355e6a07401c41773c685ed913a0d1d814601217c50dbf129e9173e2c9da032fb @@ -0,0 +1,93 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.chownrSync = exports.chownr = void 0; +const node_fs_1 = __importDefault(require("node:fs")); +const node_path_1 = __importDefault(require("node:path")); +const lchownSync = (path, uid, gid) => { + try { + return node_fs_1.default.lchownSync(path, uid, gid); + } + catch (er) { + if (er?.code !== 'ENOENT') + throw er; + } +}; +const chown = (cpath, uid, gid, cb) => { + node_fs_1.default.lchown(cpath, uid, gid, er => { + // Skip ENOENT error + cb(er && er?.code !== 'ENOENT' ? er : null); + }); +}; +const chownrKid = (p, child, uid, gid, cb) => { + if (child.isDirectory()) { + (0, exports.chownr)(node_path_1.default.resolve(p, child.name), uid, gid, (er) => { + if (er) + return cb(er); + const cpath = node_path_1.default.resolve(p, child.name); + chown(cpath, uid, gid, cb); + }); + } + else { + const cpath = node_path_1.default.resolve(p, child.name); + chown(cpath, uid, gid, cb); + } +}; +const chownr = (p, uid, gid, cb) => { + node_fs_1.default.readdir(p, { withFileTypes: true }, (er, children) => { + // any error other than ENOTDIR or ENOTSUP means it's not readable, + // or doesn't exist. give up. + if (er) { + if (er.code === 'ENOENT') + return cb(); + else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP') + return cb(er); + } + if (er || !children.length) + return chown(p, uid, gid, cb); + let len = children.length; + let errState = null; + const then = (er) => { + /* c8 ignore start */ + if (errState) + return; + /* c8 ignore stop */ + if (er) + return cb((errState = er)); + if (--len === 0) + return chown(p, uid, gid, cb); + }; + for (const child of children) { + chownrKid(p, child, uid, gid, then); + } + }); +}; +exports.chownr = chownr; +const chownrKidSync = (p, child, uid, gid) => { + if (child.isDirectory()) + (0, exports.chownrSync)(node_path_1.default.resolve(p, child.name), uid, gid); + lchownSync(node_path_1.default.resolve(p, child.name), uid, gid); +}; +const chownrSync = (p, uid, gid) => { + let children; + try { + children = node_fs_1.default.readdirSync(p, { withFileTypes: true }); + } + catch (er) { + const e = er; + if (e?.code === 'ENOENT') + return; + else if (e?.code === 'ENOTDIR' || e?.code === 'ENOTSUP') + return lchownSync(p, uid, gid); + else + throw e; + } + for (const child of children) { + chownrKidSync(p, child, uid, gid); + } + return lchownSync(p, uid, gid); +}; +exports.chownrSync = chownrSync; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/2f/43e484a1ab18c9d9d60a666041f3565dc4112167bd2444a57348359844925cacfd9ab86332ed56e9873506d9871bd8a8752b4589823be1d8c8e943f870df2f b/.pnpm-store/v11/files/2f/43e484a1ab18c9d9d60a666041f3565dc4112167bd2444a57348359844925cacfd9ab86332ed56e9873506d9871bd8a8752b4589823be1d8c8e943f870df2f new file mode 100644 index 0000000000..ef11b01368 --- /dev/null +++ b/.pnpm-store/v11/files/2f/43e484a1ab18c9d9d60a666041f3565dc4112167bd2444a57348359844925cacfd9ab86332ed56e9873506d9871bd8a8752b4589823be1d8c8e943f870df2f @@ -0,0 +1,132 @@ +import { Minipass } from 'minipass'; +import { normalizeWindowsPath } from './normalize-windows-path.js'; +export class ReadEntry extends Minipass { + extended; + globalExtended; + header; + startBlockSize; + blockRemain; + remain; + type; + meta = false; + ignore = false; + path; + mode; + uid; + gid; + uname; + gname; + size = 0; + mtime; + atime; + ctime; + linkpath; + dev; + ino; + nlink; + invalid = false; + absolute; + unsupported = false; + constructor(header, ex, gex) { + super({}); + // read entries always start life paused. this is to avoid the + // situation where Minipass's auto-ending empty streams results + // in an entry ending before we're ready for it. + this.pause(); + this.extended = ex; + this.globalExtended = gex; + this.header = header; + /* c8 ignore start */ + this.remain = header.size ?? 0; + /* c8 ignore stop */ + this.startBlockSize = 512 * Math.ceil(this.remain / 512); + this.blockRemain = this.startBlockSize; + this.type = header.type; + switch (this.type) { + case 'File': + case 'OldFile': + case 'Link': + case 'SymbolicLink': + case 'CharacterDevice': + case 'BlockDevice': + case 'Directory': + case 'FIFO': + case 'ContiguousFile': + case 'GNUDumpDir': + break; + case 'NextFileHasLongLinkpath': + case 'NextFileHasLongPath': + case 'OldGnuLongPath': + case 'GlobalExtendedHeader': + case 'ExtendedHeader': + case 'OldExtendedHeader': + this.meta = true; + break; + // NOTE: gnutar and bsdtar treat unrecognized types as 'File' + // it may be worth doing the same, but with a warning. + default: + this.ignore = true; + } + /* c8 ignore start */ + if (!header.path) { + throw new Error('no path provided for tar.ReadEntry'); + } + /* c8 ignore stop */ + this.path = normalizeWindowsPath(header.path); + this.mode = header.mode; + if (this.mode) { + this.mode = this.mode & 0o7777; + } + this.uid = header.uid; + this.gid = header.gid; + this.uname = header.uname; + this.gname = header.gname; + this.size = this.remain; + this.mtime = header.mtime; + this.atime = header.atime; + this.ctime = header.ctime; + /* c8 ignore start */ + this.linkpath = + header.linkpath ? normalizeWindowsPath(header.linkpath) : undefined; + /* c8 ignore stop */ + this.uname = header.uname; + this.gname = header.gname; + if (ex) { + this.#slurp(ex); + } + if (gex) { + this.#slurp(gex, true); + } + } + write(data) { + const writeLen = data.length; + if (writeLen > this.blockRemain) { + throw new Error('writing more to entry than is appropriate'); + } + const r = this.remain; + const br = this.blockRemain; + this.remain = Math.max(0, r - writeLen); + this.blockRemain = Math.max(0, br - writeLen); + if (this.ignore) { + return true; + } + if (r >= writeLen) { + return super.write(data); + } + // r < writeLen + return super.write(data.subarray(0, r)); + } + #slurp(ex, gex = false) { + if (ex.path) + ex.path = normalizeWindowsPath(ex.path); + if (ex.linkpath) + ex.linkpath = normalizeWindowsPath(ex.linkpath); + Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => { + // we slurp in everything except for the path attribute in + // a global extended header, because that's weird. Also, any + // null/undefined values are ignored. + return !(v === null || v === undefined || (k === 'path' && gex)); + }))); + } +} +//# sourceMappingURL=read-entry.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/30/89451eba6c2ff0293f2134d0bb1ec549903642b0fca76b04d8eb12c19b90da99bf8702f4bd4cf6370e8ee23b5e5c577c0d853aeb6cfc1e08f0d18369bd2224 b/.pnpm-store/v11/files/30/89451eba6c2ff0293f2134d0bb1ec549903642b0fca76b04d8eb12c19b90da99bf8702f4bd4cf6370e8ee23b5e5c577c0d853aeb6cfc1e08f0d18369bd2224 new file mode 100644 index 0000000000..bb87d361e4 --- /dev/null +++ b/.pnpm-store/v11/files/30/89451eba6c2ff0293f2134d0bb1ec549903642b0fca76b04d8eb12c19b90da99bf8702f4bd4cf6370e8ee23b5e5c577c0d853aeb6cfc1e08f0d18369bd2224 @@ -0,0 +1,371 @@ +'use strict' + +const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require('./constants') +const { + kReadyState, + kSentClose, + kByteParser, + kReceivedClose, + kResponse +} = require('./symbols') +const { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = require('./util') +const { channels } = require('../../core/diagnostics') +const { CloseEvent } = require('./events') +const { makeRequest } = require('../fetch/request') +const { fetching } = require('../fetch/index') +const { Headers, getHeadersList } = require('../fetch/headers') +const { getDecodeSplit } = require('../fetch/util') +const { WebsocketFrameSend } = require('./frame') + +/** @type {import('crypto')} */ +let crypto +try { + crypto = require('node:crypto') +/* c8 ignore next 3 */ +} catch { + +} + +/** + * @see https://websockets.spec.whatwg.org/#concept-websocket-establish + * @param {URL} url + * @param {string|string[]} protocols + * @param {import('./websocket').WebSocket} ws + * @param {(response: any, extensions: string[] | undefined) => void} onEstablish + * @param {Partial} options + */ +function establishWebSocketConnection (url, protocols, client, ws, onEstablish, options) { + // 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s + // scheme is "ws", and to "https" otherwise. + const requestURL = url + + requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:' + + // 2. Let request be a new request, whose URL is requestURL, client is client, + // service-workers mode is "none", referrer is "no-referrer", mode is + // "websocket", credentials mode is "include", cache mode is "no-store" , + // and redirect mode is "error". + const request = makeRequest({ + urlList: [requestURL], + client, + serviceWorkers: 'none', + referrer: 'no-referrer', + mode: 'websocket', + credentials: 'include', + cache: 'no-store', + redirect: 'error' + }) + + // Note: undici extension, allow setting custom headers. + if (options.headers) { + const headersList = getHeadersList(new Headers(options.headers)) + + request.headersList = headersList + } + + // 3. Append (`Upgrade`, `websocket`) to request’s header list. + // 4. Append (`Connection`, `Upgrade`) to request’s header list. + // Note: both of these are handled by undici currently. + // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397 + + // 5. Let keyValue be a nonce consisting of a randomly selected + // 16-byte value that has been forgiving-base64-encoded and + // isomorphic encoded. + const keyValue = crypto.randomBytes(16).toString('base64') + + // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s + // header list. + request.headersList.append('sec-websocket-key', keyValue) + + // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s + // header list. + request.headersList.append('sec-websocket-version', '13') + + // 8. For each protocol in protocols, combine + // (`Sec-WebSocket-Protocol`, protocol) in request’s header + // list. + for (const protocol of protocols) { + request.headersList.append('sec-websocket-protocol', protocol) + } + + // 9. Let permessageDeflate be a user-agent defined + // "permessage-deflate" extension header value. + // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673 + const permessageDeflate = 'permessage-deflate; client_max_window_bits' + + // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to + // request’s header list. + request.headersList.append('sec-websocket-extensions', permessageDeflate) + + // 11. Fetch request with useParallelQueue set to true, and + // processResponse given response being these steps: + const controller = fetching({ + request, + useParallelQueue: true, + dispatcher: options.dispatcher, + processResponse (response) { + // 1. If response is a network error or its status is not 101, + // fail the WebSocket connection. + if (response.type === 'error' || response.status !== 101) { + failWebsocketConnection(ws, 'Received network error or non-101 status code.') + return + } + + // 2. If protocols is not the empty list and extracting header + // list values given `Sec-WebSocket-Protocol` and response’s + // header list results in null, failure, or the empty byte + // sequence, then fail the WebSocket connection. + if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) { + failWebsocketConnection(ws, 'Server did not respond with sent protocols.') + return + } + + // 3. Follow the requirements stated step 2 to step 6, inclusive, + // of the last set of steps in section 4.1 of The WebSocket + // Protocol to validate response. This either results in fail + // the WebSocket connection or the WebSocket connection is + // established. + + // 2. If the response lacks an |Upgrade| header field or the |Upgrade| + // header field contains a value that is not an ASCII case- + // insensitive match for the value "websocket", the client MUST + // _Fail the WebSocket Connection_. + if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') { + failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".') + return + } + + // 3. If the response lacks a |Connection| header field or the + // |Connection| header field doesn't contain a token that is an + // ASCII case-insensitive match for the value "Upgrade", the client + // MUST _Fail the WebSocket Connection_. + if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') { + failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".') + return + } + + // 4. If the response lacks a |Sec-WebSocket-Accept| header field or + // the |Sec-WebSocket-Accept| contains a value other than the + // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket- + // Key| (as a string, not base64-decoded) with the string "258EAFA5- + // E914-47DA-95CA-C5AB0DC85B11" but ignoring any leading and + // trailing whitespace, the client MUST _Fail the WebSocket + // Connection_. + const secWSAccept = response.headersList.get('Sec-WebSocket-Accept') + const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64') + if (secWSAccept !== digest) { + failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.') + return + } + + // 5. If the response includes a |Sec-WebSocket-Extensions| header + // field and this header field indicates the use of an extension + // that was not present in the client's handshake (the server has + // indicated an extension not requested by the client), the client + // MUST _Fail the WebSocket Connection_. (The parsing of this + // header field to determine which extensions are requested is + // discussed in Section 9.1.) + const secExtension = response.headersList.get('Sec-WebSocket-Extensions') + let extensions + + if (secExtension !== null) { + extensions = parseExtensions(secExtension) + + if (!extensions.has('permessage-deflate')) { + failWebsocketConnection(ws, 'Sec-WebSocket-Extensions header does not match.') + return + } + } + + // 6. If the response includes a |Sec-WebSocket-Protocol| header field + // and this header field indicates the use of a subprotocol that was + // not present in the client's handshake (the server has indicated a + // subprotocol not requested by the client), the client MUST _Fail + // the WebSocket Connection_. + const secProtocol = response.headersList.get('Sec-WebSocket-Protocol') + + if (secProtocol !== null) { + const requestProtocols = getDecodeSplit('sec-websocket-protocol', request.headersList) + + // The client can request that the server use a specific subprotocol by + // including the |Sec-WebSocket-Protocol| field in its handshake. If it + // is specified, the server needs to include the same field and one of + // the selected subprotocol values in its response for the connection to + // be established. + if (!requestProtocols.includes(secProtocol)) { + failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.') + return + } + } + + response.socket.on('data', onSocketData) + response.socket.on('close', onSocketClose) + response.socket.on('error', onSocketError) + + if (channels.open.hasSubscribers) { + channels.open.publish({ + address: response.socket.address(), + protocol: secProtocol, + extensions: secExtension + }) + } + + onEstablish(response, extensions) + } + }) + + return controller +} + +function closeWebSocketConnection (ws, code, reason, reasonByteLength) { + if (isClosing(ws) || isClosed(ws)) { + // If this's ready state is CLOSING (2) or CLOSED (3) + // Do nothing. + } else if (!isEstablished(ws)) { + // If the WebSocket connection is not yet established + // Fail the WebSocket connection and set this's ready state + // to CLOSING (2). + failWebsocketConnection(ws, 'Connection was closed before it was established.') + ws[kReadyState] = states.CLOSING + } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) { + // If the WebSocket closing handshake has not yet been started + // Start the WebSocket closing handshake and set this's ready + // state to CLOSING (2). + // - If neither code nor reason is present, the WebSocket Close + // message must not have a body. + // - If code is present, then the status code to use in the + // WebSocket Close message must be the integer given by code. + // - If reason is also present, then reasonBytes must be + // provided in the Close message after the status code. + + ws[kSentClose] = sentCloseFrameState.PROCESSING + + const frame = new WebsocketFrameSend() + + // If neither code nor reason is present, the WebSocket Close + // message must not have a body. + + // If code is present, then the status code to use in the + // WebSocket Close message must be the integer given by code. + if (code !== undefined && reason === undefined) { + frame.frameData = Buffer.allocUnsafe(2) + frame.frameData.writeUInt16BE(code, 0) + } else if (code !== undefined && reason !== undefined) { + // If reason is also present, then reasonBytes must be + // provided in the Close message after the status code. + frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength) + frame.frameData.writeUInt16BE(code, 0) + // the body MAY contain UTF-8-encoded data with value /reason/ + frame.frameData.write(reason, 2, 'utf-8') + } else { + frame.frameData = emptyBuffer + } + + /** @type {import('stream').Duplex} */ + const socket = ws[kResponse].socket + + socket.write(frame.createFrame(opcodes.CLOSE)) + + ws[kSentClose] = sentCloseFrameState.SENT + + // Upon either sending or receiving a Close control frame, it is said + // that _The WebSocket Closing Handshake is Started_ and that the + // WebSocket connection is in the CLOSING state. + ws[kReadyState] = states.CLOSING + } else { + // Otherwise + // Set this's ready state to CLOSING (2). + ws[kReadyState] = states.CLOSING + } +} + +/** + * @param {Buffer} chunk + */ +function onSocketData (chunk) { + if (!this.ws[kByteParser].write(chunk)) { + this.pause() + } +} + +/** + * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol + * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4 + */ +function onSocketClose () { + const { ws } = this + const { [kResponse]: response } = ws + + response.socket.off('data', onSocketData) + response.socket.off('close', onSocketClose) + response.socket.off('error', onSocketError) + + // If the TCP connection was closed after the + // WebSocket closing handshake was completed, the WebSocket connection + // is said to have been closed _cleanly_. + const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose] + + let code = 1005 + let reason = '' + + const result = ws[kByteParser].closingInfo + + if (result && !result.error) { + code = result.code ?? 1005 + reason = result.reason + } else if (!ws[kReceivedClose]) { + // If _The WebSocket + // Connection is Closed_ and no Close control frame was received by the + // endpoint (such as could occur if the underlying transport connection + // is lost), _The WebSocket Connection Close Code_ is considered to be + // 1006. + code = 1006 + } + + // 1. Change the ready state to CLOSED (3). + ws[kReadyState] = states.CLOSED + + // 2. If the user agent was required to fail the WebSocket + // connection, or if the WebSocket connection was closed + // after being flagged as full, fire an event named error + // at the WebSocket object. + // TODO + + // 3. Fire an event named close at the WebSocket object, + // using CloseEvent, with the wasClean attribute + // initialized to true if the connection closed cleanly + // and false otherwise, the code attribute initialized to + // the WebSocket connection close code, and the reason + // attribute initialized to the result of applying UTF-8 + // decode without BOM to the WebSocket connection close + // reason. + // TODO: process.nextTick + fireEvent('close', ws, (type, init) => new CloseEvent(type, init), { + wasClean, code, reason + }) + + if (channels.close.hasSubscribers) { + channels.close.publish({ + websocket: ws, + code, + reason + }) + } +} + +function onSocketError (error) { + const { ws } = this + + ws[kReadyState] = states.CLOSING + + if (channels.socketError.hasSubscribers) { + channels.socketError.publish(error) + } + + this.destroy() +} + +module.exports = { + establishWebSocketConnection, + closeWebSocketConnection +} diff --git a/.pnpm-store/v11/files/30/e834d9f79981bc0db9b0e640de77e59e0527fcc4fb0709a5852a648aaef08fa8120d2ca753c8dd107bf2dae6bd70da729dc5d55e6fe7ee223a645fd282b701 b/.pnpm-store/v11/files/30/e834d9f79981bc0db9b0e640de77e59e0527fcc4fb0709a5852a648aaef08fa8120d2ca753c8dd107bf2dae6bd70da729dc5d55e6fe7ee223a645fd282b701 new file mode 100644 index 0000000000..31c05fa303 --- /dev/null +++ b/.pnpm-store/v11/files/30/e834d9f79981bc0db9b0e640de77e59e0527fcc4fb0709a5852a648aaef08fa8120d2ca753c8dd107bf2dae6bd70da729dc5d55e6fe7ee223a645fd282b701 @@ -0,0 +1,78 @@ +{ + "name": "isexe", + "version": "4.0.0", + "description": "Minimal module to check if a file is executable.", + "main": "./dist/commonjs/index.min.js", + "module": "./dist/esm/index.min.js", + "types": "./dist/commonjs/index.d.ts", + "files": [ + "dist" + ], + "tshy": { + "selfLink": false, + "exports": { + "./raw": "./src/index.ts", + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + } + }, + "exports": { + "./raw": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "devDependencies": { + "@types/node": "^25.2.1", + "esbuild": "^0.27.3", + "prettier": "^3.8.1", + "tap": "^21.5.1", + "tshy": "^3.1.3", + "typedoc": "^0.28.16" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy && bash build.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write .", + "typedoc": "typedoc" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "BlueOak-1.0.0", + "repository": "https://github.com/isaacs/isexe", + "engines": { + "node": ">=20" + }, + "type": "module" +} diff --git a/.pnpm-store/v11/files/31/2d62da1f41e2b9fe0f15ef30d81a4241f309d83a24643ec8cb99104ef5ef7f52ec216c5cdf0e3995fc5b538dfdfc54e78fbde3a57eb0ab8bd04dec07cb5586 b/.pnpm-store/v11/files/31/2d62da1f41e2b9fe0f15ef30d81a4241f309d83a24643ec8cb99104ef5ef7f52ec216c5cdf0e3995fc5b538dfdfc54e78fbde3a57eb0ab8bd04dec07cb5586 new file mode 100644 index 0000000000..4570cde1a9 Binary files /dev/null and b/.pnpm-store/v11/files/31/2d62da1f41e2b9fe0f15ef30d81a4241f309d83a24643ec8cb99104ef5ef7f52ec216c5cdf0e3995fc5b538dfdfc54e78fbde3a57eb0ab8bd04dec07cb5586 differ diff --git a/.pnpm-store/v11/files/31/dacf2ebacce5527c466d6bf1d0b4e10bb217458d5694b62d6be40a242bc26bde0161f5d88951f8101760a11c55662280c54e2ab09e5a9fe474483d76a30530 b/.pnpm-store/v11/files/31/dacf2ebacce5527c466d6bf1d0b4e10bb217458d5694b62d6be40a242bc26bde0161f5d88951f8101760a11c55662280c54e2ab09e5a9fe474483d76a30530 new file mode 100644 index 0000000000..ee672cfbf2 --- /dev/null +++ b/.pnpm-store/v11/files/31/dacf2ebacce5527c466d6bf1d0b4e10bb217458d5694b62d6be40a242bc26bde0161f5d88951f8101760a11c55662280c54e2ab09e5a9fe474483d76a30530 @@ -0,0 +1,328 @@ +'use strict' + +const { promises: fs, readFileSync } = require('graceful-fs') +const path = require('path') +const log = require('./log') +const os = require('os') +const processRelease = require('./process-release') +const win = process.platform === 'win32' +const findNodeDirectory = require('./find-node-directory') +const { createConfigGypi } = require('./create-config-gypi') +const { format: msgFormat } = require('util') +const { findAccessibleSync } = require('./util') +const { findPython } = require('./find-python') +const { findVisualStudio } = win ? require('./find-visualstudio') : {} + +const majorRe = /^#define NODE_MAJOR_VERSION (\d+)/m +const minorRe = /^#define NODE_MINOR_VERSION (\d+)/m +const patchRe = /^#define NODE_PATCH_VERSION (\d+)/m + +async function configure (gyp, argv) { + const buildDir = path.resolve('build') + const configNames = ['config.gypi', 'common.gypi'] + const configs = [] + let nodeDir + const release = processRelease(argv, gyp, process.version, process.release) + + const python = await findPython(gyp.opts.python) + return getNodeDir() + + async function getNodeDir () { + // 'python' should be set by now + process.env.PYTHON = python + + if (!gyp.opts.nodedir && + process.config.variables.use_prefix_to_find_headers) { + // check if the headers can be found using the prefix specified + // at build time. Use them if they match the version expected + const prefix = process.config.variables.node_prefix + let availVersion + try { + const nodeVersionH = readFileSync(path.join(prefix, + 'include', 'node', 'node_version.h'), { encoding: 'utf8' }) + const major = nodeVersionH.match(majorRe)[1] + const minor = nodeVersionH.match(minorRe)[1] + const patch = nodeVersionH.match(patchRe)[1] + availVersion = major + '.' + minor + '.' + patch + } catch {} + if (availVersion === release.version) { + // ok version matches, use the headers + gyp.opts.nodedir = prefix + log.verbose('using local node headers based on prefix', + 'setting nodedir to ' + gyp.opts.nodedir) + } + } + + if (gyp.opts.nodedir) { + // --nodedir was specified. use that for the dev files + nodeDir = gyp.opts.nodedir.replace(/^~/, os.homedir()) + log.verbose('get node dir', 'compiling against specified --nodedir dev files: %s', nodeDir) + } else { + // if no --nodedir specified, ensure node dependencies are installed + if ('v' + release.version !== process.version) { + // if --target was given, then determine a target version to compile for + log.verbose('get node dir', 'compiling against --target node version: %s', release.version) + } else { + // if no --target was specified then use the current host node version + log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version) + } + + if (!release.semver) { + // could not parse the version string with semver + throw new Error('Invalid version number: ' + release.version) + } + + // If the tarball option is set, always remove and reinstall the headers + // into devdir. Otherwise only install if they're not already there. + gyp.opts.ensure = !gyp.opts.tarball + + await gyp.commands.install([release.version]) + + log.verbose('get node dir', 'target node version installed:', release.versionDir) + nodeDir = path.resolve(gyp.devDir, release.versionDir) + } + + return createBuildDir() + } + + async function createBuildDir () { + log.verbose('build dir', 'attempting to create "build" dir: %s', buildDir) + + const isNew = await fs.mkdir(buildDir, { recursive: true }) + log.verbose( + 'build dir', '"build" dir needed to be created?', isNew ? 'Yes' : 'No' + ) + if (win) { + let usingMakeGenerator = false + for (let i = argv.length - 1; i >= 0; --i) { + const arg = argv[i] + if (arg === '-f' || arg === '--format') { + const format = argv[i + 1] + if (typeof format === 'string' && format.startsWith('make')) { + usingMakeGenerator = true + break + } + } else if (arg.startsWith('--format=make')) { + usingMakeGenerator = true + break + } + } + let vsInfo = {} + if (!usingMakeGenerator) { + vsInfo = await findVisualStudio(release.semver, gyp.opts['msvs-version']) + } + return createConfigFile(vsInfo) + } + return createConfigFile(null) + } + + async function createConfigFile (vsInfo) { + if (win) { + process.env.GYP_MSVS_VERSION = Math.min(vsInfo.versionYear, 2015) + process.env.GYP_MSVS_OVERRIDE_PATH = vsInfo.path + } + const configPath = await createConfigGypi({ gyp, buildDir, nodeDir, vsInfo, python }) + configs.push(configPath) + return findConfigs() + } + + async function findConfigs () { + const name = configNames.shift() + if (!name) { + return runGyp() + } + + const fullPath = path.resolve(name) + log.verbose(name, 'checking for gypi file: %s', fullPath) + try { + await fs.stat(fullPath) + log.verbose(name, 'found gypi file') + configs.push(fullPath) + } catch (err) { + // ENOENT will check next gypi filename + if (err.code !== 'ENOENT') { + throw err + } + } + + return findConfigs() + } + + async function runGyp () { + if (!~argv.indexOf('-f') && !~argv.indexOf('--format')) { + if (win) { + log.verbose('gyp', 'gyp format was not specified; forcing "msvs"') + // force the 'make' target for non-Windows + argv.push('-f', 'msvs') + } else { + log.verbose('gyp', 'gyp format was not specified; forcing "make"') + // force the 'make' target for non-Windows + argv.push('-f', 'make') + } + } + + // include all the ".gypi" files that were found + configs.forEach(function (config) { + argv.push('-I', config) + }) + + // For AIX and z/OS we need to set up the path to the exports file + // which contains the symbols needed for linking. + let nodeExpFile + let nodeRootDir + let candidates + let logprefix = 'find exports file' + if (process.platform === 'aix' || process.platform === 'os390' || process.platform === 'os400') { + const ext = process.platform === 'os390' ? 'x' : 'exp' + nodeRootDir = findNodeDirectory() + + if (process.platform === 'aix' || process.platform === 'os400') { + candidates = [ + 'include/node/node', + 'out/Release/node', + 'out/Debug/node', + 'node' + ].map(function (file) { + return file + '.' + ext + }) + } else { + candidates = [ + 'out/Release/lib.target/libnode', + 'out/Debug/lib.target/libnode', + 'out/Release/obj.target/libnode', + 'out/Debug/obj.target/libnode', + 'lib/libnode' + ].map(function (file) { + return file + '.' + ext + }) + } + + nodeExpFile = findAccessibleSync(logprefix, nodeRootDir, candidates) + if (nodeExpFile !== undefined) { + log.verbose(logprefix, 'Found exports file: %s', nodeExpFile) + } else { + const msg = msgFormat('Could not find node.%s file in %s', ext, nodeRootDir) + log.error(logprefix, 'Could not find exports file') + throw new Error(msg) + } + } + + // For z/OS we need to set up the path to zoslib include directory, + // which contains headers included in v8config.h. + let zoslibIncDir + if (process.platform === 'os390') { + logprefix = "find zoslib's zos-base.h:" + let msg + let zoslibIncPath = process.env.ZOSLIB_INCLUDES + if (zoslibIncPath) { + zoslibIncPath = findAccessibleSync(logprefix, zoslibIncPath, ['zos-base.h']) + if (zoslibIncPath === undefined) { + msg = msgFormat('Could not find zos-base.h file in the directory set ' + + 'in ZOSLIB_INCLUDES environment variable: %s; set it ' + + 'to the correct path, or unset it to search %s', process.env.ZOSLIB_INCLUDES, nodeRootDir) + } + } else { + candidates = [ + 'include/node/zoslib/zos-base.h', + 'include/zoslib/zos-base.h', + 'zoslib/include/zos-base.h', + 'install/include/node/zoslib/zos-base.h' + ] + zoslibIncPath = findAccessibleSync(logprefix, nodeRootDir, candidates) + if (zoslibIncPath === undefined) { + msg = msgFormat('Could not find any of %s in directory %s; set ' + + 'environmant variable ZOSLIB_INCLUDES to the path ' + + 'that contains zos-base.h', candidates.toString(), nodeRootDir) + } + } + if (zoslibIncPath !== undefined) { + zoslibIncDir = path.dirname(zoslibIncPath) + log.verbose(logprefix, "Found zoslib's zos-base.h in: %s", zoslibIncDir) + } else if (release.version.split('.')[0] >= 16) { + // zoslib is only shipped in Node v16 and above. + log.error(logprefix, msg) + throw new Error(msg) + } + } + + // this logic ported from the old `gyp_addon` python file + const gypScript = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') + const addonGypi = path.resolve(__dirname, '..', 'addon.gypi') + let commonGypi = path.resolve(nodeDir, 'include/node/common.gypi') + try { + await fs.stat(commonGypi) + } catch (err) { + commonGypi = path.resolve(nodeDir, 'common.gypi') + } + + let outputDir = 'build' + if (win) { + // Windows expects an absolute path + outputDir = buildDir + } + const nodeGypDir = path.resolve(__dirname, '..') + + let nodeLibFile = path.join(nodeDir, + !gyp.opts.nodedir ? '<(target_arch)' : '$(Configuration)', + release.name + '.lib') + + argv.push('-I', addonGypi) + argv.push('-I', commonGypi) + argv.push('-Dlibrary=shared_library') + argv.push('-Dvisibility=default') + argv.push('-Dnode_root_dir=' + nodeDir) + if (process.platform === 'aix' || process.platform === 'os390' || process.platform === 'os400') { + argv.push('-Dnode_exp_file=' + nodeExpFile) + if (process.platform === 'os390' && zoslibIncDir) { + argv.push('-Dzoslib_include_dir=' + zoslibIncDir) + } + } + argv.push('-Dnode_gyp_dir=' + nodeGypDir) + + // Do this to keep Cygwin environments happy, else the unescaped '\' gets eaten up, + // resulting in bad paths, Ex c:parentFolderfolderanotherFolder instead of c:\parentFolder\folder\anotherFolder + if (win) { + nodeLibFile = nodeLibFile.replace(/\\/g, '\\\\') + } + argv.push('-Dnode_lib_file=' + nodeLibFile) + argv.push('-Dmodule_root_dir=' + process.cwd()) + argv.push('-Dnode_engine=' + + (gyp.opts.node_engine || process.jsEngine || 'v8')) + argv.push('--depth=.') + argv.push('--no-parallel') + + // tell gyp to write the Makefile/Solution files into output_dir + argv.push('--generator-output', outputDir) + + // tell make to write its output into the same dir + argv.push('-Goutput_dir=.') + + // enforce use of the "binding.gyp" file + argv.unshift('binding.gyp') + + // execute `gyp` from the current target nodedir + argv.unshift(gypScript) + + // make sure python uses files that came with this particular node package + const pypath = [path.join(__dirname, '..', 'gyp', 'pylib')] + if (process.env.PYTHONPATH) { + pypath.push(process.env.PYTHONPATH) + } + process.env.PYTHONPATH = pypath.join(win ? ';' : ':') + + await new Promise((resolve, reject) => { + const cp = gyp.spawn(python, argv) + cp.on('exit', (code) => { + if (code !== 0) { + reject(new Error('`gyp` failed with exit code: ' + code)) + } else { + // we're done + resolve() + } + }) + }) + } +} + +module.exports = configure +module.exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module' diff --git a/.pnpm-store/v11/files/31/e15e5eb34f49cf8e930a49926bbf607148dcd8485de9d0c122793e7206075596d970ddc3e196c8d0fc3a775c7091eba36c98f58fbe3dd2736fdc3401b865a6 b/.pnpm-store/v11/files/31/e15e5eb34f49cf8e930a49926bbf607148dcd8485de9d0c122793e7206075596d970ddc3e196c8d0fc3a775c7091eba36c98f58fbe3dd2736fdc3401b865a6 new file mode 100644 index 0000000000..8aafe45f8f --- /dev/null +++ b/.pnpm-store/v11/files/31/e15e5eb34f49cf8e930a49926bbf607148dcd8485de9d0c122793e7206075596d970ddc3e196c8d0fc3a775c7091eba36c98f58fbe3dd2736fdc3401b865a6 @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var full_jitter_1 = require("./full/full.jitter"); +var no_jitter_1 = require("./no/no.jitter"); +function JitterFactory(options) { + switch (options.jitter) { + case "full": + return full_jitter_1.fullJitter; + case "none": + default: + return no_jitter_1.noJitter; + } +} +exports.JitterFactory = JitterFactory; +//# sourceMappingURL=jitter.factory.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/32/34c8832c737f923f7f0006bb1b983e2f41c2a5b098360384db2accef7bb1adeb4a77c7212d44836e6fce30b835e4dc610a284d5032364d87a4d4764496f9b8 b/.pnpm-store/v11/files/32/34c8832c737f923f7f0006bb1b983e2f41c2a5b098360384db2accef7bb1adeb4a77c7212d44836e6fce30b835e4dc610a284d5032364d87a4d4764496f9b8 new file mode 100644 index 0000000000..fb0b5a24c5 --- /dev/null +++ b/.pnpm-store/v11/files/32/34c8832c737f923f7f0006bb1b983e2f41c2a5b098360384db2accef7bb1adeb4a77c7212d44836e6fce30b835e4dc610a284d5032364d87a4d4764496f9b8 @@ -0,0 +1,278 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; +const utils_1 = require("./utils"); +// C headers +var ERROR; +(function (ERROR) { + ERROR[ERROR["OK"] = 0] = "OK"; + ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL"; + ERROR[ERROR["STRICT"] = 2] = "STRICT"; + ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED"; + ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; + ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; + ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD"; + ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL"; + ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; + ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION"; + ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; + ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; + ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; + ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS"; + ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; + ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; + ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; + ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; + ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; + ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; + ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; + ERROR[ERROR["PAUSED"] = 21] = "PAUSED"; + ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; + ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; + ERROR[ERROR["USER"] = 24] = "USER"; +})(ERROR = exports.ERROR || (exports.ERROR = {})); +var TYPE; +(function (TYPE) { + TYPE[TYPE["BOTH"] = 0] = "BOTH"; + TYPE[TYPE["REQUEST"] = 1] = "REQUEST"; + TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE"; +})(TYPE = exports.TYPE || (exports.TYPE = {})); +var FLAGS; +(function (FLAGS) { + FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; + FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; + FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; + FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED"; + FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE"; + FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; + FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY"; + FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING"; + // 1 << 8 is unused + FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; +})(FLAGS = exports.FLAGS || (exports.FLAGS = {})); +var LENIENT_FLAGS; +(function (LENIENT_FLAGS) { + LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS"; + LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; + LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; +})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {})); +var METHODS; +(function (METHODS) { + METHODS[METHODS["DELETE"] = 0] = "DELETE"; + METHODS[METHODS["GET"] = 1] = "GET"; + METHODS[METHODS["HEAD"] = 2] = "HEAD"; + METHODS[METHODS["POST"] = 3] = "POST"; + METHODS[METHODS["PUT"] = 4] = "PUT"; + /* pathological */ + METHODS[METHODS["CONNECT"] = 5] = "CONNECT"; + METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS"; + METHODS[METHODS["TRACE"] = 7] = "TRACE"; + /* WebDAV */ + METHODS[METHODS["COPY"] = 8] = "COPY"; + METHODS[METHODS["LOCK"] = 9] = "LOCK"; + METHODS[METHODS["MKCOL"] = 10] = "MKCOL"; + METHODS[METHODS["MOVE"] = 11] = "MOVE"; + METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND"; + METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH"; + METHODS[METHODS["SEARCH"] = 14] = "SEARCH"; + METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK"; + METHODS[METHODS["BIND"] = 16] = "BIND"; + METHODS[METHODS["REBIND"] = 17] = "REBIND"; + METHODS[METHODS["UNBIND"] = 18] = "UNBIND"; + METHODS[METHODS["ACL"] = 19] = "ACL"; + /* subversion */ + METHODS[METHODS["REPORT"] = 20] = "REPORT"; + METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY"; + METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT"; + METHODS[METHODS["MERGE"] = 23] = "MERGE"; + /* upnp */ + METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH"; + METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY"; + METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE"; + METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; + /* RFC-5789 */ + METHODS[METHODS["PATCH"] = 28] = "PATCH"; + METHODS[METHODS["PURGE"] = 29] = "PURGE"; + /* CalDAV */ + METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR"; + /* RFC-2068, section 19.6.1.2 */ + METHODS[METHODS["LINK"] = 31] = "LINK"; + METHODS[METHODS["UNLINK"] = 32] = "UNLINK"; + /* icecast */ + METHODS[METHODS["SOURCE"] = 33] = "SOURCE"; + /* RFC-7540, section 11.6 */ + METHODS[METHODS["PRI"] = 34] = "PRI"; + /* RFC-2326 RTSP */ + METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE"; + METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE"; + METHODS[METHODS["SETUP"] = 37] = "SETUP"; + METHODS[METHODS["PLAY"] = 38] = "PLAY"; + METHODS[METHODS["PAUSE"] = 39] = "PAUSE"; + METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN"; + METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER"; + METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER"; + METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT"; + METHODS[METHODS["RECORD"] = 44] = "RECORD"; + /* RAOP */ + METHODS[METHODS["FLUSH"] = 45] = "FLUSH"; +})(METHODS = exports.METHODS || (exports.METHODS = {})); +exports.METHODS_HTTP = [ + METHODS.DELETE, + METHODS.GET, + METHODS.HEAD, + METHODS.POST, + METHODS.PUT, + METHODS.CONNECT, + METHODS.OPTIONS, + METHODS.TRACE, + METHODS.COPY, + METHODS.LOCK, + METHODS.MKCOL, + METHODS.MOVE, + METHODS.PROPFIND, + METHODS.PROPPATCH, + METHODS.SEARCH, + METHODS.UNLOCK, + METHODS.BIND, + METHODS.REBIND, + METHODS.UNBIND, + METHODS.ACL, + METHODS.REPORT, + METHODS.MKACTIVITY, + METHODS.CHECKOUT, + METHODS.MERGE, + METHODS['M-SEARCH'], + METHODS.NOTIFY, + METHODS.SUBSCRIBE, + METHODS.UNSUBSCRIBE, + METHODS.PATCH, + METHODS.PURGE, + METHODS.MKCALENDAR, + METHODS.LINK, + METHODS.UNLINK, + METHODS.PRI, + // TODO(indutny): should we allow it with HTTP? + METHODS.SOURCE, +]; +exports.METHODS_ICE = [ + METHODS.SOURCE, +]; +exports.METHODS_RTSP = [ + METHODS.OPTIONS, + METHODS.DESCRIBE, + METHODS.ANNOUNCE, + METHODS.SETUP, + METHODS.PLAY, + METHODS.PAUSE, + METHODS.TEARDOWN, + METHODS.GET_PARAMETER, + METHODS.SET_PARAMETER, + METHODS.REDIRECT, + METHODS.RECORD, + METHODS.FLUSH, + // For AirPlay + METHODS.GET, + METHODS.POST, +]; +exports.METHOD_MAP = utils_1.enumToMap(METHODS); +exports.H_METHOD_MAP = {}; +Object.keys(exports.METHOD_MAP).forEach((key) => { + if (/^H/.test(key)) { + exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key]; + } +}); +var FINISH; +(function (FINISH) { + FINISH[FINISH["SAFE"] = 0] = "SAFE"; + FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; + FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE"; +})(FINISH = exports.FINISH || (exports.FINISH = {})); +exports.ALPHA = []; +for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) { + // Upper case + exports.ALPHA.push(String.fromCharCode(i)); + // Lower case + exports.ALPHA.push(String.fromCharCode(i + 0x20)); +} +exports.NUM_MAP = { + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, + 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, +}; +exports.HEX_MAP = { + 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, + 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, + A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF, + a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf, +}; +exports.NUM = [ + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', +]; +exports.ALPHANUM = exports.ALPHA.concat(exports.NUM); +exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')']; +exports.USERINFO_CHARS = exports.ALPHANUM + .concat(exports.MARK) + .concat(['%', ';', ':', '&', '=', '+', '$', ',']); +// TODO(indutny): use RFC +exports.STRICT_URL_CHAR = [ + '!', '"', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + ':', ';', '<', '=', '>', + '@', '[', '\\', ']', '^', '_', + '`', + '{', '|', '}', '~', +].concat(exports.ALPHANUM); +exports.URL_CHAR = exports.STRICT_URL_CHAR + .concat(['\t', '\f']); +// All characters with 0x80 bit set to 1 +for (let i = 0x80; i <= 0xff; i++) { + exports.URL_CHAR.push(i); +} +exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']); +/* Tokens as defined by rfc 2616. Also lowercases them. + * token = 1* + * separators = "(" | ")" | "<" | ">" | "@" + * | "," | ";" | ":" | "\" | <"> + * | "/" | "[" | "]" | "?" | "=" + * | "{" | "}" | SP | HT + */ +exports.STRICT_TOKEN = [ + '!', '#', '$', '%', '&', '\'', + '*', '+', '-', '.', + '^', '_', '`', + '|', '~', +].concat(exports.ALPHANUM); +exports.TOKEN = exports.STRICT_TOKEN.concat([' ']); +/* + * Verify that a char is a valid visible (printable) US-ASCII + * character or %x80-FF + */ +exports.HEADER_CHARS = ['\t']; +for (let i = 32; i <= 255; i++) { + if (i !== 127) { + exports.HEADER_CHARS.push(i); + } +} +// ',' = \x44 +exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44); +exports.MAJOR = exports.NUM_MAP; +exports.MINOR = exports.MAJOR; +var HEADER_STATE; +(function (HEADER_STATE) { + HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL"; + HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION"; + HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; + HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE"; + HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; + HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; + HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; + HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; +})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {})); +exports.SPECIAL_HEADERS = { + 'connection': HEADER_STATE.CONNECTION, + 'content-length': HEADER_STATE.CONTENT_LENGTH, + 'proxy-connection': HEADER_STATE.CONNECTION, + 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING, + 'upgrade': HEADER_STATE.UPGRADE, +}; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/32/393dc683a1df1a478ebef57c317b06b5a355a5c88ecfc82eabb74eae604626cafd03d63634072b30911c616fe8bec86fb5138f3f89dad0e99ff01e0ecfb352 b/.pnpm-store/v11/files/32/393dc683a1df1a478ebef57c317b06b5a355a5c88ecfc82eabb74eae604626cafd03d63634072b30911c616fe8bec86fb5138f3f89dad0e99ff01e0ecfb352 new file mode 100644 index 0000000000..f4a84fb76c --- /dev/null +++ b/.pnpm-store/v11/files/32/393dc683a1df1a478ebef57c317b06b5a355a5c88ecfc82eabb74eae604626cafd03d63634072b30911c616fe8bec86fb5138f3f89dad0e99ff01e0ecfb352 @@ -0,0 +1,348 @@ +"use strict"; +// parse a 512-byte header block to a data object, or vice-versa +// encode returns `true` if a pax extended header is needed, because +// the data could not be faithfully encoded in a simple header. +// (Also, check header.needPax to see if it needs a pax header.) +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Header = void 0; +const node_path_1 = require("node:path"); +const large = __importStar(require("./large-numbers.js")); +const types = __importStar(require("./types.js")); +const notNegative = (n) => n === undefined || n < 0 ? undefined : n; +class Header { + cksumValid = false; + needPax = false; + nullBlock = false; + block; + path; + mode; + uid; + gid; + size; + cksum; + #type = 'Unsupported'; + linkpath; + uname; + gname; + devmaj = 0; + devmin = 0; + atime; + ctime; + mtime; + charset; + comment; + constructor(data, off = 0, ex, gex) { + if (Buffer.isBuffer(data)) { + this.decode(data, off || 0, ex, gex); + } + else if (data) { + this.#slurp(data); + } + } + decode(buf, off, ex, gex) { + if (!off) { + off = 0; + } + if (!buf || !(buf.length >= off + 512)) { + throw new Error('need 512 bytes for header'); + } + // Decode the typeflag (independent of any pending PAX/GNU extended header) + // up front so we can tell whether THIS block is itself an intermediary + // extension header (PAX `x`/`g`, GNU long-name `L`, GNU long-link `K`). + // Per POSIX pax, a PAX extended header describes the *next file entry*, not + // the extension headers that may sit between it and that file. Applying the + // pending PAX overrides (notably `size`) to an intervening `L`/`K`/`x`/`g` + // header desynchronizes the stream relative to other tar implementations + // and enables tar interpretation-conflict / file-smuggling attacks. + const t = decString(buf, off + 156, 1); + const isNormalFS = types.normalFsTypes.has(t); + const exForFields = isNormalFS ? ex : undefined; + const gexForFields = isNormalFS ? gex : undefined; + this.path = exForFields?.path ?? decString(buf, off, 100); + this.mode = + exForFields?.mode ?? + gexForFields?.mode ?? + decNumber(buf, off + 100, 8); + this.uid = + exForFields?.uid ?? gexForFields?.uid ?? decNumber(buf, off + 108, 8); + this.gid = + exForFields?.gid ?? gexForFields?.gid ?? decNumber(buf, off + 116, 8); + this.size = notNegative(exForFields?.size ?? + gexForFields?.size ?? + decNumber(buf, off + 124, 12)); + this.mtime = + exForFields?.mtime ?? + gexForFields?.mtime ?? + decDate(buf, off + 136, 12); + this.cksum = decNumber(buf, off + 148, 12); + // if we have extended or global extended headers, apply them now + // See https://github.com/npm/node-tar/pull/187 + // Apply global before local, so it overrides. Never slurp the pending + // extended-header fields onto an intermediary extension header. + if (gexForFields) + this.#slurp(gexForFields, true); + if (exForFields) + this.#slurp(exForFields); + // old tar versions marked dirs as a file with a trailing / + if (types.isCode(t)) { + this.#type = t || '0'; + } + if (this.#type === '0' && this.path.slice(-1) === '/') { + this.#type = '5'; + } + // tar implementations sometimes incorrectly put the stat(dir).size + // as the size in the tarball, even though Directory entries are + // not able to have any body at all. In the very rare chance that + // it actually DOES have a body, we weren't going to do anything with + // it anyway, and it'll just be a warning about an invalid header. + if (this.#type === '5') { + this.size = 0; + } + this.linkpath = decString(buf, off + 157, 100); + if (buf.subarray(off + 257, off + 265).toString() === 'ustar\u000000') { + /* c8 ignore start */ + this.uname = + exForFields?.uname ?? + gexForFields?.uname ?? + decString(buf, off + 265, 32); + this.gname = + exForFields?.gname ?? + gexForFields?.gname ?? + decString(buf, off + 297, 32); + this.devmaj = + exForFields?.devmaj ?? + gexForFields?.devmaj ?? + decNumber(buf, off + 329, 8) ?? + 0; + this.devmin = + exForFields?.devmin ?? + gexForFields?.devmin ?? + decNumber(buf, off + 337, 8) ?? + 0; + /* c8 ignore stop */ + if (buf[off + 475] !== 0) { + // definitely a prefix, definitely >130 chars. + const prefix = decString(buf, off + 345, 155); + this.path = prefix + '/' + this.path; + } + else { + const prefix = decString(buf, off + 345, 130); + if (prefix) { + this.path = prefix + '/' + this.path; + } + /* c8 ignore start */ + this.atime = ex?.atime ?? gex?.atime ?? decDate(buf, off + 476, 12); + this.ctime = ex?.ctime ?? gex?.ctime ?? decDate(buf, off + 488, 12); + /* c8 ignore stop */ + } + } + let sum = 8 * 0x20; + for (let i = off; i < off + 148; i++) { + sum += buf[i]; + } + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i]; + } + this.cksumValid = sum === this.cksum; + if (this.cksum === undefined && sum === 8 * 0x20) { + this.nullBlock = true; + } + } + #slurp(ex, gex = false) { + Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => { + // we slurp in everything except for the path attribute in + // a global extended header, because that's weird. Also, any + // null/undefined values are ignored. + return !(v === null || + v === undefined || + (k === 'size' && Number(v) < 0) || + (k === 'path' && gex) || + (k === 'linkpath' && gex) || + k === 'global'); + }))); + } + encode(buf, off = 0) { + if (!buf) { + buf = this.block = Buffer.alloc(512); + } + if (this.#type === 'Unsupported') { + this.#type = '0'; + } + if (!(buf.length >= off + 512)) { + throw new Error('need 512 bytes for header'); + } + const prefixSize = this.ctime || this.atime ? 130 : 155; + const split = splitPrefix(this.path || '', prefixSize); + const path = split[0]; + const prefix = split[1]; + this.needPax = !!split[2]; + this.needPax = encString(buf, off, 100, path) || this.needPax; + this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax; + this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax; + this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax; + this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax; + this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax; + buf[off + 156] = Number(this.#type.codePointAt(0)); + this.needPax = + encString(buf, off + 157, 100, this.linkpath) || this.needPax; + buf.write('ustar\u000000', off + 257, 8); + this.needPax = + encString(buf, off + 265, 32, this.uname) || this.needPax; + this.needPax = + encString(buf, off + 297, 32, this.gname) || this.needPax; + this.needPax = + encNumber(buf, off + 329, 8, this.devmaj) || this.needPax; + this.needPax = + encNumber(buf, off + 337, 8, this.devmin) || this.needPax; + this.needPax = + encString(buf, off + 345, prefixSize, prefix) || this.needPax; + if (buf[off + 475] !== 0) { + this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax; + } + else { + this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax; + this.needPax = + encDate(buf, off + 476, 12, this.atime) || this.needPax; + this.needPax = + encDate(buf, off + 488, 12, this.ctime) || this.needPax; + } + let sum = 8 * 0x20; + for (let i = off; i < off + 148; i++) { + sum += buf[i]; + } + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i]; + } + this.cksum = sum; + encNumber(buf, off + 148, 8, this.cksum); + this.cksumValid = true; + return this.needPax; + } + get type() { + return (this.#type === 'Unsupported' ? + this.#type + : types.name.get(this.#type)); + } + get typeKey() { + return this.#type; + } + set type(type) { + const c = String(types.code.get(type)); + if (types.isCode(c) || c === 'Unsupported') { + this.#type = c; + } + else if (types.isCode(type)) { + this.#type = type; + } + else { + throw new TypeError('invalid entry type: ' + type); + } + } +} +exports.Header = Header; +const splitPrefix = (p, prefixSize) => { + const pathSize = 100; + let pp = p; + let prefix = ''; + let ret = undefined; + const root = node_path_1.posix.parse(p).root || '.'; + if (Buffer.byteLength(pp) < pathSize) { + ret = [pp, prefix, false]; + } + else { + // first set prefix to the dir, and path to the base + prefix = node_path_1.posix.dirname(pp); + pp = node_path_1.posix.basename(pp); + do { + if (Buffer.byteLength(pp) <= pathSize && + Buffer.byteLength(prefix) <= prefixSize) { + // both fit! + ret = [pp, prefix, false]; + } + else if (Buffer.byteLength(pp) > pathSize && + Buffer.byteLength(prefix) <= prefixSize) { + // prefix fits in prefix, but path doesn't fit in path + ret = [pp.slice(0, pathSize - 1), prefix, true]; + } + else { + // make path take a bit from prefix + pp = node_path_1.posix.join(node_path_1.posix.basename(prefix), pp); + prefix = node_path_1.posix.dirname(prefix); + } + } while (prefix !== root && ret === undefined); + // at this point, found no resolution, just truncate + if (!ret) { + ret = [p.slice(0, pathSize - 1), '', true]; + } + } + return ret; +}; +const decString = (buf, off, size) => buf + .subarray(off, off + size) + .toString('utf8') + .replace(/\0.*/, ''); +const decDate = (buf, off, size) => numToDate(decNumber(buf, off, size)); +const numToDate = (num) => num === undefined ? undefined : new Date(num * 1000); +const decNumber = (buf, off, size) => Number(buf[off]) & 0x80 ? + large.parse(buf.subarray(off, off + size)) + : decSmallNumber(buf, off, size); +const nanUndef = (value) => (isNaN(value) ? undefined : value); +const decSmallNumber = (buf, off, size) => nanUndef(parseInt(buf + .subarray(off, off + size) + .toString('utf8') + .replace(/\0.*$/, '') + .trim(), 8)); +// the maximum encodable as a null-terminated octal, by field size +const MAXNUM = { + 12: 0o77777777777, + 8: 0o7777777, +}; +const encNumber = (buf, off, size, num) => num === undefined ? false + : num > MAXNUM[size] || num < 0 ? + (large.encode(num, buf.subarray(off, off + size)), true) + : (encSmallNumber(buf, off, size, num), false); +const encSmallNumber = (buf, off, size, num) => buf.write(octalString(num, size), off, size, 'ascii'); +const octalString = (num, size) => padOctal(Math.floor(num).toString(8), size); +const padOctal = (str, size) => (str.length === size - 1 ? + str + : new Array(size - str.length - 1).join('0') + str + ' ') + '\0'; +const encDate = (buf, off, size, date) => date === undefined ? false : (encNumber(buf, off, size, date.getTime() / 1000)); +// enough to fill the longest string we've got +const NULLS = new Array(156).join('\0'); +// pad with nulls, return true if it's longer or non-ascii +const encString = (buf, off, size, str) => str === undefined ? false : ((buf.write(str + NULLS, off, size, 'utf8'), + str.length !== Buffer.byteLength(str) || str.length > size)); +//# sourceMappingURL=header.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/32/3d601d77fd1181d36a988e6f2470c4463a3236f8f654a2f58bde584ec052126a5e87376a0d2704faf9b6444741e554662bb3717ab773924918bc082bbaa781 b/.pnpm-store/v11/files/32/3d601d77fd1181d36a988e6f2470c4463a3236f8f654a2f58bde584ec052126a5e87376a0d2704faf9b6444741e554662bb3717ab773924918bc082bbaa781 new file mode 100644 index 0000000000..7cb0271bca --- /dev/null +++ b/.pnpm-store/v11/files/32/3d601d77fd1181d36a988e6f2470c4463a3236f8f654a2f58bde584ec052126a5e87376a0d2704faf9b6444741e554662bb3717ab773924918bc082bbaa781 @@ -0,0 +1,2 @@ +"use strict";var a=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var _=a(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.sync=i.isexe=void 0;var M=require("node:fs"),x=require("node:fs/promises"),q=async(t,e={})=>{let{ignoreErrors:r=!1}=e;try{return d(await(0,x.stat)(t),e)}catch(s){let n=s;if(r||n.code==="EACCES")return!1;throw n}};i.isexe=q;var m=(t,e={})=>{let{ignoreErrors:r=!1}=e;try{return d((0,M.statSync)(t),e)}catch(s){let n=s;if(r||n.code==="EACCES")return!1;throw n}};i.sync=m;var d=(t,e)=>t.isFile()&&A(t,e),A=(t,e)=>{let r=e.uid??process.getuid?.(),s=e.groups??process.getgroups?.()??[],n=e.gid??process.getgid?.()??s[0];if(r===void 0||n===void 0)throw new Error("cannot get uid or gid");let u=new Set([n,...s]),c=t.mode,S=t.uid,P=t.gid,f=parseInt("100",8),l=parseInt("010",8),j=parseInt("001",8),C=f|l;return!!(c&j||c&l&&u.has(P)||c&f&&S===r||c&C&&r===0)}});var g=a(o=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0});o.sync=o.isexe=void 0;var T=require("node:fs"),I=require("node:fs/promises"),D=require("node:path"),F=async(t,e={})=>{let{ignoreErrors:r=!1}=e;try{return y(await(0,I.stat)(t),t,e)}catch(s){let n=s;if(r||n.code==="EACCES")return!1;throw n}};o.isexe=F;var L=(t,e={})=>{let{ignoreErrors:r=!1}=e;try{return y((0,T.statSync)(t),t,e)}catch(s){let n=s;if(r||n.code==="EACCES")return!1;throw n}};o.sync=L;var B=(t,e)=>{let{pathExt:r=process.env.PATHEXT||""}=e,s=r.split(D.delimiter);if(s.indexOf("")!==-1)return!0;for(let n of s){let u=n.toLowerCase(),c=t.substring(t.length-u.length).toLowerCase();if(u&&c===u)return!0}return!1},y=(t,e,r)=>t.isFile()&&B(e,r)});var p=a(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0})});var v=exports&&exports.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),G=exports&&exports.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w=exports&&exports.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[s.length]=n);return s},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),n=0;n 1) { + acc = initial; + } + else if (this.head) { + walker = this.head.next; + acc = this.head.value; + } + else { + throw new TypeError('Reduce of empty list with no initial value'); + } + for (var i = 0; !!walker; i++) { + acc = fn(acc, walker.value, i); + walker = walker.next; + } + return acc; + } + reduceReverse(fn, initial) { + let acc; + let walker = this.tail; + if (arguments.length > 1) { + acc = initial; + } + else if (this.tail) { + walker = this.tail.prev; + acc = this.tail.value; + } + else { + throw new TypeError('Reduce of empty list with no initial value'); + } + for (let i = this.length - 1; !!walker; i--) { + acc = fn(acc, walker.value, i); + walker = walker.prev; + } + return acc; + } + toArray() { + const arr = new Array(this.length); + for (let i = 0, walker = this.head; !!walker; i++) { + arr[i] = walker.value; + walker = walker.next; + } + return arr; + } + toArrayReverse() { + const arr = new Array(this.length); + for (let i = 0, walker = this.tail; !!walker; i++) { + arr[i] = walker.value; + walker = walker.prev; + } + return arr; + } + slice(from = 0, to = this.length) { + if (to < 0) { + to += this.length; + } + if (from < 0) { + from += this.length; + } + const ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + let walker = this.head; + let i = 0; + for (i = 0; !!walker && i < from; i++) { + walker = walker.next; + } + for (; !!walker && i < to; i++, walker = walker.next) { + ret.push(walker.value); + } + return ret; + } + sliceReverse(from = 0, to = this.length) { + if (to < 0) { + to += this.length; + } + if (from < 0) { + from += this.length; + } + const ret = new Yallist(); + if (to < from || to < 0) { + return ret; + } + if (from < 0) { + from = 0; + } + if (to > this.length) { + to = this.length; + } + let i = this.length; + let walker = this.tail; + for (; !!walker && i > to; i--) { + walker = walker.prev; + } + for (; !!walker && i > from; i--, walker = walker.prev) { + ret.push(walker.value); + } + return ret; + } + splice(start, deleteCount = 0, ...nodes) { + if (start > this.length) { + start = this.length - 1; + } + if (start < 0) { + start = this.length + start; + } + let walker = this.head; + for (let i = 0; !!walker && i < start; i++) { + walker = walker.next; + } + const ret = []; + for (let i = 0; !!walker && i < deleteCount; i++) { + ret.push(walker.value); + walker = this.removeNode(walker); + } + if (!walker) { + walker = this.tail; + } + else if (walker !== this.tail) { + walker = walker.prev; + } + for (const v of nodes) { + walker = insertAfter(this, walker, v); + } + return ret; + } + reverse() { + const head = this.head; + const tail = this.tail; + for (let walker = head; !!walker; walker = walker.prev) { + const p = walker.prev; + walker.prev = walker.next; + walker.next = p; + } + this.head = tail; + this.tail = head; + return this; + } +} +exports.Yallist = Yallist; +// insertAfter undefined means "make the node the new head of list" +function insertAfter(self, node, value) { + const prev = node; + const next = node ? node.next : self.head; + const inserted = new Node(value, prev, next, self); + if (inserted.next === undefined) { + self.tail = inserted; + } + if (inserted.prev === undefined) { + self.head = inserted; + } + self.length++; + return inserted; +} +function push(self, item) { + self.tail = new Node(item, self.tail, undefined, self); + if (!self.head) { + self.head = self.tail; + } + self.length++; +} +function unshift(self, item) { + self.head = new Node(item, undefined, self.head, self); + if (!self.tail) { + self.tail = self.head; + } + self.length++; +} +class Node { + list; + next; + prev; + value; + constructor(value, prev, next, list) { + this.list = list; + this.value = value; + if (prev) { + prev.next = this; + this.prev = prev; + } + else { + this.prev = undefined; + } + if (next) { + next.prev = this; + this.next = next; + } + else { + this.next = undefined; + } + } +} +exports.Node = Node; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/32/fbd1c0b9ef0b82042bdf88f1b1221774cbb4ced118c19c91ac06b5b72e106e45841ae3694868377821229be573ab62bfbb64aea5e71cc35469dc579a838ea2 b/.pnpm-store/v11/files/32/fbd1c0b9ef0b82042bdf88f1b1221774cbb4ced118c19c91ac06b5b72e106e45841ae3694868377821229be573ab62bfbb64aea5e71cc35469dc579a838ea2 new file mode 100644 index 0000000000..7a74db6bde --- /dev/null +++ b/.pnpm-store/v11/files/32/fbd1c0b9ef0b82042bdf88f1b1221774cbb4ced118c19c91ac06b5b72e106e45841ae3694868377821229be573ab62bfbb64aea5e71cc35469dc579a838ea2 @@ -0,0 +1,744 @@ +'use strict' + +const assert = require('node:assert') + +const encoder = new TextEncoder() + +/** + * @see https://mimesniff.spec.whatwg.org/#http-token-code-point + */ +const HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/ +const HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/ // eslint-disable-line +const ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g // eslint-disable-line +/** + * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point + */ +const HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/ // eslint-disable-line + +// https://fetch.spec.whatwg.org/#data-url-processor +/** @param {URL} dataURL */ +function dataURLProcessor (dataURL) { + // 1. Assert: dataURL’s scheme is "data". + assert(dataURL.protocol === 'data:') + + // 2. Let input be the result of running the URL + // serializer on dataURL with exclude fragment + // set to true. + let input = URLSerializer(dataURL, true) + + // 3. Remove the leading "data:" string from input. + input = input.slice(5) + + // 4. Let position point at the start of input. + const position = { position: 0 } + + // 5. Let mimeType be the result of collecting a + // sequence of code points that are not equal + // to U+002C (,), given position. + let mimeType = collectASequenceOfCodePointsFast( + ',', + input, + position + ) + + // 6. Strip leading and trailing ASCII whitespace + // from mimeType. + // Undici implementation note: we need to store the + // length because if the mimetype has spaces removed, + // the wrong amount will be sliced from the input in + // step #9 + const mimeTypeLength = mimeType.length + mimeType = removeASCIIWhitespace(mimeType, true, true) + + // 7. If position is past the end of input, then + // return failure + if (position.position >= input.length) { + return 'failure' + } + + // 8. Advance position by 1. + position.position++ + + // 9. Let encodedBody be the remainder of input. + const encodedBody = input.slice(mimeTypeLength + 1) + + // 10. Let body be the percent-decoding of encodedBody. + let body = stringPercentDecode(encodedBody) + + // 11. If mimeType ends with U+003B (;), followed by + // zero or more U+0020 SPACE, followed by an ASCII + // case-insensitive match for "base64", then: + if (/;(\u0020){0,}base64$/i.test(mimeType)) { + // 1. Let stringBody be the isomorphic decode of body. + const stringBody = isomorphicDecode(body) + + // 2. Set body to the forgiving-base64 decode of + // stringBody. + body = forgivingBase64(stringBody) + + // 3. If body is failure, then return failure. + if (body === 'failure') { + return 'failure' + } + + // 4. Remove the last 6 code points from mimeType. + mimeType = mimeType.slice(0, -6) + + // 5. Remove trailing U+0020 SPACE code points from mimeType, + // if any. + mimeType = mimeType.replace(/(\u0020)+$/, '') + + // 6. Remove the last U+003B (;) code point from mimeType. + mimeType = mimeType.slice(0, -1) + } + + // 12. If mimeType starts with U+003B (;), then prepend + // "text/plain" to mimeType. + if (mimeType.startsWith(';')) { + mimeType = 'text/plain' + mimeType + } + + // 13. Let mimeTypeRecord be the result of parsing + // mimeType. + let mimeTypeRecord = parseMIMEType(mimeType) + + // 14. If mimeTypeRecord is failure, then set + // mimeTypeRecord to text/plain;charset=US-ASCII. + if (mimeTypeRecord === 'failure') { + mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII') + } + + // 15. Return a new data: URL struct whose MIME + // type is mimeTypeRecord and body is body. + // https://fetch.spec.whatwg.org/#data-url-struct + return { mimeType: mimeTypeRecord, body } +} + +// https://url.spec.whatwg.org/#concept-url-serializer +/** + * @param {URL} url + * @param {boolean} excludeFragment + */ +function URLSerializer (url, excludeFragment = false) { + if (!excludeFragment) { + return url.href + } + + const href = url.href + const hashLength = url.hash.length + + const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength) + + if (!hashLength && href.endsWith('#')) { + return serialized.slice(0, -1) + } + + return serialized +} + +// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points +/** + * @param {(char: string) => boolean} condition + * @param {string} input + * @param {{ position: number }} position + */ +function collectASequenceOfCodePoints (condition, input, position) { + // 1. Let result be the empty string. + let result = '' + + // 2. While position doesn’t point past the end of input and the + // code point at position within input meets the condition condition: + while (position.position < input.length && condition(input[position.position])) { + // 1. Append that code point to the end of result. + result += input[position.position] + + // 2. Advance position by 1. + position.position++ + } + + // 3. Return result. + return result +} + +/** + * A faster collectASequenceOfCodePoints that only works when comparing a single character. + * @param {string} char + * @param {string} input + * @param {{ position: number }} position + */ +function collectASequenceOfCodePointsFast (char, input, position) { + const idx = input.indexOf(char, position.position) + const start = position.position + + if (idx === -1) { + position.position = input.length + return input.slice(start) + } + + position.position = idx + return input.slice(start, position.position) +} + +// https://url.spec.whatwg.org/#string-percent-decode +/** @param {string} input */ +function stringPercentDecode (input) { + // 1. Let bytes be the UTF-8 encoding of input. + const bytes = encoder.encode(input) + + // 2. Return the percent-decoding of bytes. + return percentDecode(bytes) +} + +/** + * @param {number} byte + */ +function isHexCharByte (byte) { + // 0-9 A-F a-f + return (byte >= 0x30 && byte <= 0x39) || (byte >= 0x41 && byte <= 0x46) || (byte >= 0x61 && byte <= 0x66) +} + +/** + * @param {number} byte + */ +function hexByteToNumber (byte) { + return ( + // 0-9 + byte >= 0x30 && byte <= 0x39 + ? (byte - 48) + // Convert to uppercase + // ((byte & 0xDF) - 65) + 10 + : ((byte & 0xDF) - 55) + ) +} + +// https://url.spec.whatwg.org/#percent-decode +/** @param {Uint8Array} input */ +function percentDecode (input) { + const length = input.length + // 1. Let output be an empty byte sequence. + /** @type {Uint8Array} */ + const output = new Uint8Array(length) + let j = 0 + // 2. For each byte byte in input: + for (let i = 0; i < length; ++i) { + const byte = input[i] + + // 1. If byte is not 0x25 (%), then append byte to output. + if (byte !== 0x25) { + output[j++] = byte + + // 2. Otherwise, if byte is 0x25 (%) and the next two bytes + // after byte in input are not in the ranges + // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F), + // and 0x61 (a) to 0x66 (f), all inclusive, append byte + // to output. + } else if ( + byte === 0x25 && + !(isHexCharByte(input[i + 1]) && isHexCharByte(input[i + 2])) + ) { + output[j++] = 0x25 + + // 3. Otherwise: + } else { + // 1. Let bytePoint be the two bytes after byte in input, + // decoded, and then interpreted as hexadecimal number. + // 2. Append a byte whose value is bytePoint to output. + output[j++] = (hexByteToNumber(input[i + 1]) << 4) | hexByteToNumber(input[i + 2]) + + // 3. Skip the next two bytes in input. + i += 2 + } + } + + // 3. Return output. + return length === j ? output : output.subarray(0, j) +} + +// https://mimesniff.spec.whatwg.org/#parse-a-mime-type +/** @param {string} input */ +function parseMIMEType (input) { + // 1. Remove any leading and trailing HTTP whitespace + // from input. + input = removeHTTPWhitespace(input, true, true) + + // 2. Let position be a position variable for input, + // initially pointing at the start of input. + const position = { position: 0 } + + // 3. Let type be the result of collecting a sequence + // of code points that are not U+002F (/) from + // input, given position. + const type = collectASequenceOfCodePointsFast( + '/', + input, + position + ) + + // 4. If type is the empty string or does not solely + // contain HTTP token code points, then return failure. + // https://mimesniff.spec.whatwg.org/#http-token-code-point + if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) { + return 'failure' + } + + // 5. If position is past the end of input, then return + // failure + if (position.position > input.length) { + return 'failure' + } + + // 6. Advance position by 1. (This skips past U+002F (/).) + position.position++ + + // 7. Let subtype be the result of collecting a sequence of + // code points that are not U+003B (;) from input, given + // position. + let subtype = collectASequenceOfCodePointsFast( + ';', + input, + position + ) + + // 8. Remove any trailing HTTP whitespace from subtype. + subtype = removeHTTPWhitespace(subtype, false, true) + + // 9. If subtype is the empty string or does not solely + // contain HTTP token code points, then return failure. + if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { + return 'failure' + } + + const typeLowercase = type.toLowerCase() + const subtypeLowercase = subtype.toLowerCase() + + // 10. Let mimeType be a new MIME type record whose type + // is type, in ASCII lowercase, and subtype is subtype, + // in ASCII lowercase. + // https://mimesniff.spec.whatwg.org/#mime-type + const mimeType = { + type: typeLowercase, + subtype: subtypeLowercase, + /** @type {Map} */ + parameters: new Map(), + // https://mimesniff.spec.whatwg.org/#mime-type-essence + essence: `${typeLowercase}/${subtypeLowercase}` + } + + // 11. While position is not past the end of input: + while (position.position < input.length) { + // 1. Advance position by 1. (This skips past U+003B (;).) + position.position++ + + // 2. Collect a sequence of code points that are HTTP + // whitespace from input given position. + collectASequenceOfCodePoints( + // https://fetch.spec.whatwg.org/#http-whitespace + char => HTTP_WHITESPACE_REGEX.test(char), + input, + position + ) + + // 3. Let parameterName be the result of collecting a + // sequence of code points that are not U+003B (;) + // or U+003D (=) from input, given position. + let parameterName = collectASequenceOfCodePoints( + (char) => char !== ';' && char !== '=', + input, + position + ) + + // 4. Set parameterName to parameterName, in ASCII + // lowercase. + parameterName = parameterName.toLowerCase() + + // 5. If position is not past the end of input, then: + if (position.position < input.length) { + // 1. If the code point at position within input is + // U+003B (;), then continue. + if (input[position.position] === ';') { + continue + } + + // 2. Advance position by 1. (This skips past U+003D (=).) + position.position++ + } + + // 6. If position is past the end of input, then break. + if (position.position > input.length) { + break + } + + // 7. Let parameterValue be null. + let parameterValue = null + + // 8. If the code point at position within input is + // U+0022 ("), then: + if (input[position.position] === '"') { + // 1. Set parameterValue to the result of collecting + // an HTTP quoted string from input, given position + // and the extract-value flag. + parameterValue = collectAnHTTPQuotedString(input, position, true) + + // 2. Collect a sequence of code points that are not + // U+003B (;) from input, given position. + collectASequenceOfCodePointsFast( + ';', + input, + position + ) + + // 9. Otherwise: + } else { + // 1. Set parameterValue to the result of collecting + // a sequence of code points that are not U+003B (;) + // from input, given position. + parameterValue = collectASequenceOfCodePointsFast( + ';', + input, + position + ) + + // 2. Remove any trailing HTTP whitespace from parameterValue. + parameterValue = removeHTTPWhitespace(parameterValue, false, true) + + // 3. If parameterValue is the empty string, then continue. + if (parameterValue.length === 0) { + continue + } + } + + // 10. If all of the following are true + // - parameterName is not the empty string + // - parameterName solely contains HTTP token code points + // - parameterValue solely contains HTTP quoted-string token code points + // - mimeType’s parameters[parameterName] does not exist + // then set mimeType’s parameters[parameterName] to parameterValue. + if ( + parameterName.length !== 0 && + HTTP_TOKEN_CODEPOINTS.test(parameterName) && + (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && + !mimeType.parameters.has(parameterName) + ) { + mimeType.parameters.set(parameterName, parameterValue) + } + } + + // 12. Return mimeType. + return mimeType +} + +// https://infra.spec.whatwg.org/#forgiving-base64-decode +/** @param {string} data */ +function forgivingBase64 (data) { + // 1. Remove all ASCII whitespace from data. + data = data.replace(ASCII_WHITESPACE_REPLACE_REGEX, '') // eslint-disable-line + + let dataLength = data.length + // 2. If data’s code point length divides by 4 leaving + // no remainder, then: + if (dataLength % 4 === 0) { + // 1. If data ends with one or two U+003D (=) code points, + // then remove them from data. + if (data.charCodeAt(dataLength - 1) === 0x003D) { + --dataLength + if (data.charCodeAt(dataLength - 1) === 0x003D) { + --dataLength + } + } + } + + // 3. If data’s code point length divides by 4 leaving + // a remainder of 1, then return failure. + if (dataLength % 4 === 1) { + return 'failure' + } + + // 4. If data contains a code point that is not one of + // U+002B (+) + // U+002F (/) + // ASCII alphanumeric + // then return failure. + if (/[^+/0-9A-Za-z]/.test(data.length === dataLength ? data : data.substring(0, dataLength))) { + return 'failure' + } + + const buffer = Buffer.from(data, 'base64') + return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength) +} + +// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string +// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string +/** + * @param {string} input + * @param {{ position: number }} position + * @param {boolean?} extractValue + */ +function collectAnHTTPQuotedString (input, position, extractValue) { + // 1. Let positionStart be position. + const positionStart = position.position + + // 2. Let value be the empty string. + let value = '' + + // 3. Assert: the code point at position within input + // is U+0022 ("). + assert(input[position.position] === '"') + + // 4. Advance position by 1. + position.position++ + + // 5. While true: + while (true) { + // 1. Append the result of collecting a sequence of code points + // that are not U+0022 (") or U+005C (\) from input, given + // position, to value. + value += collectASequenceOfCodePoints( + (char) => char !== '"' && char !== '\\', + input, + position + ) + + // 2. If position is past the end of input, then break. + if (position.position >= input.length) { + break + } + + // 3. Let quoteOrBackslash be the code point at position within + // input. + const quoteOrBackslash = input[position.position] + + // 4. Advance position by 1. + position.position++ + + // 5. If quoteOrBackslash is U+005C (\), then: + if (quoteOrBackslash === '\\') { + // 1. If position is past the end of input, then append + // U+005C (\) to value and break. + if (position.position >= input.length) { + value += '\\' + break + } + + // 2. Append the code point at position within input to value. + value += input[position.position] + + // 3. Advance position by 1. + position.position++ + + // 6. Otherwise: + } else { + // 1. Assert: quoteOrBackslash is U+0022 ("). + assert(quoteOrBackslash === '"') + + // 2. Break. + break + } + } + + // 6. If the extract-value flag is set, then return value. + if (extractValue) { + return value + } + + // 7. Return the code points from positionStart to position, + // inclusive, within input. + return input.slice(positionStart, position.position) +} + +/** + * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type + */ +function serializeAMimeType (mimeType) { + assert(mimeType !== 'failure') + const { parameters, essence } = mimeType + + // 1. Let serialization be the concatenation of mimeType’s + // type, U+002F (/), and mimeType’s subtype. + let serialization = essence + + // 2. For each name → value of mimeType’s parameters: + for (let [name, value] of parameters.entries()) { + // 1. Append U+003B (;) to serialization. + serialization += ';' + + // 2. Append name to serialization. + serialization += name + + // 3. Append U+003D (=) to serialization. + serialization += '=' + + // 4. If value does not solely contain HTTP token code + // points or value is the empty string, then: + if (!HTTP_TOKEN_CODEPOINTS.test(value)) { + // 1. Precede each occurrence of U+0022 (") or + // U+005C (\) in value with U+005C (\). + value = value.replace(/(\\|")/g, '\\$1') + + // 2. Prepend U+0022 (") to value. + value = '"' + value + + // 3. Append U+0022 (") to value. + value += '"' + } + + // 5. Append value to serialization. + serialization += value + } + + // 3. Return serialization. + return serialization +} + +/** + * @see https://fetch.spec.whatwg.org/#http-whitespace + * @param {number} char + */ +function isHTTPWhiteSpace (char) { + // "\r\n\t " + return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x020 +} + +/** + * @see https://fetch.spec.whatwg.org/#http-whitespace + * @param {string} str + * @param {boolean} [leading=true] + * @param {boolean} [trailing=true] + */ +function removeHTTPWhitespace (str, leading = true, trailing = true) { + return removeChars(str, leading, trailing, isHTTPWhiteSpace) +} + +/** + * @see https://infra.spec.whatwg.org/#ascii-whitespace + * @param {number} char + */ +function isASCIIWhitespace (char) { + // "\r\n\t\f " + return char === 0x00d || char === 0x00a || char === 0x009 || char === 0x00c || char === 0x020 +} + +/** + * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace + * @param {string} str + * @param {boolean} [leading=true] + * @param {boolean} [trailing=true] + */ +function removeASCIIWhitespace (str, leading = true, trailing = true) { + return removeChars(str, leading, trailing, isASCIIWhitespace) +} + +/** + * @param {string} str + * @param {boolean} leading + * @param {boolean} trailing + * @param {(charCode: number) => boolean} predicate + * @returns + */ +function removeChars (str, leading, trailing, predicate) { + let lead = 0 + let trail = str.length - 1 + + if (leading) { + while (lead < str.length && predicate(str.charCodeAt(lead))) lead++ + } + + if (trailing) { + while (trail > 0 && predicate(str.charCodeAt(trail))) trail-- + } + + return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1) +} + +/** + * @see https://infra.spec.whatwg.org/#isomorphic-decode + * @param {Uint8Array} input + * @returns {string} + */ +function isomorphicDecode (input) { + // 1. To isomorphic decode a byte sequence input, return a string whose code point + // length is equal to input’s length and whose code points have the same values + // as the values of input’s bytes, in the same order. + const length = input.length + if ((2 << 15) - 1 > length) { + return String.fromCharCode.apply(null, input) + } + let result = ''; let i = 0 + let addition = (2 << 15) - 1 + while (i < length) { + if (i + addition > length) { + addition = length - i + } + result += String.fromCharCode.apply(null, input.subarray(i, i += addition)) + } + return result +} + +/** + * @see https://mimesniff.spec.whatwg.org/#minimize-a-supported-mime-type + * @param {Exclude, 'failure'>} mimeType + */ +function minimizeSupportedMimeType (mimeType) { + switch (mimeType.essence) { + case 'application/ecmascript': + case 'application/javascript': + case 'application/x-ecmascript': + case 'application/x-javascript': + case 'text/ecmascript': + case 'text/javascript': + case 'text/javascript1.0': + case 'text/javascript1.1': + case 'text/javascript1.2': + case 'text/javascript1.3': + case 'text/javascript1.4': + case 'text/javascript1.5': + case 'text/jscript': + case 'text/livescript': + case 'text/x-ecmascript': + case 'text/x-javascript': + // 1. If mimeType is a JavaScript MIME type, then return "text/javascript". + return 'text/javascript' + case 'application/json': + case 'text/json': + // 2. If mimeType is a JSON MIME type, then return "application/json". + return 'application/json' + case 'image/svg+xml': + // 3. If mimeType’s essence is "image/svg+xml", then return "image/svg+xml". + return 'image/svg+xml' + case 'text/xml': + case 'application/xml': + // 4. If mimeType is an XML MIME type, then return "application/xml". + return 'application/xml' + } + + // 2. If mimeType is a JSON MIME type, then return "application/json". + if (mimeType.subtype.endsWith('+json')) { + return 'application/json' + } + + // 4. If mimeType is an XML MIME type, then return "application/xml". + if (mimeType.subtype.endsWith('+xml')) { + return 'application/xml' + } + + // 5. If mimeType is supported by the user agent, then return mimeType’s essence. + // Technically, node doesn't support any mimetypes. + + // 6. Return the empty string. + return '' +} + +module.exports = { + dataURLProcessor, + URLSerializer, + collectASequenceOfCodePoints, + collectASequenceOfCodePointsFast, + stringPercentDecode, + parseMIMEType, + collectAnHTTPQuotedString, + serializeAMimeType, + removeChars, + removeHTTPWhitespace, + minimizeSupportedMimeType, + HTTP_TOKEN_CODEPOINTS, + isomorphicDecode +} diff --git a/.pnpm-store/v11/files/33/56b0b9e53e266a42fc6b81a04eabd78d727591174a2e70e7537a98dd1ce1adffb8b037de87d228533a9e9e2de4a72f5fe1e6e6b8714b0f460cc860306b3227 b/.pnpm-store/v11/files/33/56b0b9e53e266a42fc6b81a04eabd78d727591174a2e70e7537a98dd1ce1adffb8b037de87d228533a9e9e2de4a72f5fe1e6e6b8714b0f460cc860306b3227 new file mode 100644 index 0000000000..ec44113805 --- /dev/null +++ b/.pnpm-store/v11/files/33/56b0b9e53e266a42fc6b81a04eabd78d727591174a2e70e7537a98dd1ce1adffb8b037de87d228533a9e9e2de4a72f5fe1e6e6b8714b0f460cc860306b3227 @@ -0,0 +1,502 @@ +// A readable tar stream creator +// Technically, this is a transform stream that you write paths into, +// and tar format comes out of. +// The `add()` method is like `write()` but returns this, +// and end() return `this` as well, so you can +// do `new Pack(opt).add('files').add('dir').end().pipe(output) +// You could also do something like: +// streamOfPaths().pipe(new Pack()).pipe(new fs.WriteStream('out.tar')) +import fs from 'fs'; +import { WriteEntry, WriteEntrySync, WriteEntryTar, } from './write-entry.js'; +export class PackJob { + path; + absolute; + entry; + stat; + readdir; + pending = false; + pendingLink = false; + ignore = false; + piped = false; + constructor(path, absolute) { + this.path = path || './'; + this.absolute = absolute; + } +} +import { Minipass } from 'minipass'; +import * as zlib from 'minizlib'; +import { Yallist } from 'yallist'; +import { warnMethod } from './warn-method.js'; +const EOF = Buffer.alloc(1024); +const ONSTAT = Symbol('onStat'); +const ENDED = Symbol('ended'); +const QUEUE = Symbol('queue'); +const PENDINGLINKS = Symbol('pendingLinks'); +const CURRENT = Symbol('current'); +const PROCESS = Symbol('process'); +const PROCESSING = Symbol('processing'); +const PROCESSJOB = Symbol('processJob'); +const JOBS = Symbol('jobs'); +const JOBDONE = Symbol('jobDone'); +const ADDFSENTRY = Symbol('addFSEntry'); +const ADDTARENTRY = Symbol('addTarEntry'); +const STAT = Symbol('stat'); +const READDIR = Symbol('readdir'); +const ONREADDIR = Symbol('onreaddir'); +const PIPE = Symbol('pipe'); +const ENTRY = Symbol('entry'); +const ENTRYOPT = Symbol('entryOpt'); +const WRITEENTRYCLASS = Symbol('writeEntryClass'); +const WRITE = Symbol('write'); +const ONDRAIN = Symbol('ondrain'); +import path from 'path'; +import { normalizeWindowsPath } from './normalize-windows-path.js'; +export class Pack extends Minipass { + sync = false; + opt; + cwd; + maxReadSize; + preservePaths; + strict; + noPax; + prefix; + linkCache; + statCache; + file; + portable; + zip; + readdirCache; + noDirRecurse; + follow; + noMtime; + mtime; + filter; + jobs; + [WRITEENTRYCLASS]; + onWriteEntry; + // Note: we actually DO need a linked list here, because we + // shift() to update the head of the list where we start, but still + // while that happens, need to know what the next item in the queue + // will be. Since we do multiple jobs in parallel, it's not as simple + // as just an Array.shift(), since that would lose the information about + // the next job in the list. We could add a .next field on the PackJob + // class, but then we'd have to be tracking the tail of the queue the + // whole time, and Yallist just does that for us anyway. + [QUEUE]; + [PENDINGLINKS] = new Map(); + [JOBS] = 0; + [PROCESSING] = false; + [ENDED] = false; + constructor(opt = {}) { + super(); + this.opt = opt; + this.file = opt.file || ''; + this.cwd = opt.cwd || process.cwd(); + this.maxReadSize = opt.maxReadSize; + this.preservePaths = !!opt.preservePaths; + this.strict = !!opt.strict; + this.noPax = !!opt.noPax; + this.prefix = normalizeWindowsPath(opt.prefix || ''); + this.linkCache = opt.linkCache || new Map(); + this.statCache = opt.statCache || new Map(); + this.readdirCache = opt.readdirCache || new Map(); + this.onWriteEntry = opt.onWriteEntry; + this[WRITEENTRYCLASS] = WriteEntry; + if (typeof opt.onwarn === 'function') { + this.on('warn', opt.onwarn); + } + this.portable = !!opt.portable; + if (opt.gzip || opt.brotli || opt.zstd) { + if ((opt.gzip ? 1 : 0) + (opt.brotli ? 1 : 0) + (opt.zstd ? 1 : 0) > + 1) { + throw new TypeError('gzip, brotli, zstd are mutually exclusive'); + } + if (opt.gzip) { + if (typeof opt.gzip !== 'object') { + opt.gzip = {}; + } + if (this.portable) { + opt.gzip.portable = true; + } + this.zip = new zlib.Gzip(opt.gzip); + } + if (opt.brotli) { + if (typeof opt.brotli !== 'object') { + opt.brotli = {}; + } + this.zip = new zlib.BrotliCompress(opt.brotli); + } + if (opt.zstd) { + if (typeof opt.zstd !== 'object') { + opt.zstd = {}; + } + this.zip = new zlib.ZstdCompress(opt.zstd); + } + /* c8 ignore next */ + if (!this.zip) + throw new Error('impossible'); + const zip = this.zip; + zip.on('data', chunk => super.write(chunk)); + zip.on('end', () => super.end()); + zip.on('drain', () => this[ONDRAIN]()); + this.on('resume', () => zip.resume()); + } + else { + this.on('drain', this[ONDRAIN]); + } + this.noDirRecurse = !!opt.noDirRecurse; + this.follow = !!opt.follow; + this.noMtime = !!opt.noMtime; + if (opt.mtime) + this.mtime = opt.mtime; + this.filter = + typeof opt.filter === 'function' ? opt.filter : () => true; + this[QUEUE] = new Yallist(); + this[JOBS] = 0; + this.jobs = Number(opt.jobs) || 4; + this[PROCESSING] = false; + this[ENDED] = false; + } + [WRITE](chunk) { + return super.write(chunk); + } + add(path) { + this.write(path); + return this; + } + end(path, encoding, cb) { + /* c8 ignore start */ + if (typeof path === 'function') { + cb = path; + path = undefined; + } + if (typeof encoding === 'function') { + cb = encoding; + encoding = undefined; + } + /* c8 ignore stop */ + if (path) { + this.add(path); + } + this[ENDED] = true; + this[PROCESS](); + /* c8 ignore next */ + if (cb) + cb(); + return this; + } + write(path) { + if (this[ENDED]) { + throw new Error('write after end'); + } + if (typeof path === 'string') { + this[ADDFSENTRY](path); + } + else { + this[ADDTARENTRY](path); + } + return this.flowing; + } + [ADDTARENTRY](p) { + const absolute = normalizeWindowsPath(path.resolve(this.cwd, p.path)); + // in this case, we don't have to wait for the stat + if (!this.filter(p.path, p)) { + p.resume(); + } + else { + const job = new PackJob(p.path, absolute); + job.entry = new WriteEntryTar(p, this[ENTRYOPT](job)); + job.entry.on('end', () => this[JOBDONE](job)); + this[JOBS] += 1; + this[QUEUE].push(job); + } + this[PROCESS](); + } + [ADDFSENTRY](p) { + const absolute = normalizeWindowsPath(path.resolve(this.cwd, p)); + this[QUEUE].push(new PackJob(p, absolute)); + this[PROCESS](); + } + [STAT](job) { + job.pending = true; + this[JOBS] += 1; + const stat = this.follow ? 'stat' : 'lstat'; + fs[stat](job.absolute, (er, stat) => { + job.pending = false; + this[JOBS] -= 1; + if (er) { + this.emit('error', er); + } + else { + this[ONSTAT](job, stat); + } + }); + } + [ONSTAT](job, stat) { + this.statCache.set(job.absolute, stat); + job.stat = stat; + // now we have the stat, we can filter it. + if (!this.filter(job.path, stat)) { + job.ignore = true; + } + else if (stat.isFile() && + stat.nlink > 1 && + !this.linkCache.get(`${stat.dev}:${stat.ino}`) && + !this.sync) { + // if it's not filtered, and it's a new File entry, and next anyway + // process right away in case any pending Link entries are about + // to try to link to it. + if (job === this[CURRENT]) { + this[PROCESSJOB](job); + } + else { + // if it's NOT the current entry, it needs to be deferred, + // so that the link target can be built first. + const key = `${stat.dev}:${stat.ino}`; + const pending = this[PENDINGLINKS].get(key); + if (pending) + pending.push(job); + else + this[PENDINGLINKS].set(key, [job]); + job.pendingLink = true; + job.pending = true; + } + } + this[PROCESS](); + } + [READDIR](job) { + job.pending = true; + this[JOBS] += 1; + fs.readdir(job.absolute, (er, entries) => { + job.pending = false; + this[JOBS] -= 1; + if (er) { + return this.emit('error', er); + } + this[ONREADDIR](job, entries); + }); + } + [ONREADDIR](job, entries) { + this.readdirCache.set(job.absolute, entries); + job.readdir = entries; + this[PROCESS](); + } + [PROCESS]() { + if (this[PROCESSING]) { + return; + } + this[PROCESSING] = true; + for (let w = this[QUEUE].head; !!w && this[JOBS] < this.jobs; w = w.next) { + this[PROCESSJOB](w.value); + if (w.value.ignore) { + const p = w.next; + this[QUEUE].removeNode(w); + w.next = p; + } + } + this[PROCESSING] = false; + if (this[ENDED] && this[QUEUE].length === 0 && this[JOBS] === 0) { + if (this.zip) { + this.zip.end(EOF); + } + else { + super.write(EOF); + super.end(); + } + } + } + get [CURRENT]() { + return this[QUEUE] && this[QUEUE].head && this[QUEUE].head.value; + } + [JOBDONE](job) { + this[QUEUE].shift(); + this[JOBS] -= 1; + const { stat } = job; + if (stat && stat.isFile() && stat.nlink > 1) { + // might be a file with pending links + const key = `${stat.dev}:${stat.ino}`; + const pending = this[PENDINGLINKS].get(key); + if (pending) { + this[PENDINGLINKS].delete(key); + for (const job of pending) { + job.pending = false; + this[PROCESSJOB](job); + } + } + } + this[PROCESS](); + } + [PROCESSJOB](job) { + if (job.pending && job.pendingLink && job === this[CURRENT]) { + // At least one of the links to this file are not being included + // in the tarball, so we need to just proceed. + job.pending = false; + job.pendingLink = false; + } + if (job.pending) { + return; + } + if (job.entry) { + if (job === this[CURRENT] && !job.piped) { + this[PIPE](job); + } + return; + } + if (!job.stat) { + const sc = this.statCache.get(job.absolute); + if (sc) { + this[ONSTAT](job, sc); + } + else { + this[STAT](job); + } + } + if (!job.stat) { + return; + } + // filtered out! + if (job.ignore) { + return; + } + if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) { + const rc = this.readdirCache.get(job.absolute); + if (rc) { + this[ONREADDIR](job, rc); + } + else { + this[READDIR](job); + } + if (!job.readdir) { + return; + } + } + // we know it doesn't have an entry, because that got checked above + job.entry = this[ENTRY](job); + if (!job.entry) { + job.ignore = true; + return; + } + if (job === this[CURRENT] && !job.piped) { + this[PIPE](job); + } + } + [ENTRYOPT](job) { + return { + onwarn: (code, msg, data) => this.warn(code, msg, data), + noPax: this.noPax, + cwd: this.cwd, + absolute: job.absolute, + preservePaths: this.preservePaths, + maxReadSize: this.maxReadSize, + strict: this.strict, + portable: this.portable, + linkCache: this.linkCache, + statCache: this.statCache, + noMtime: this.noMtime, + mtime: this.mtime, + prefix: this.prefix, + onWriteEntry: this.onWriteEntry, + }; + } + [ENTRY](job) { + this[JOBS] += 1; + try { + const e = new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job)); + return e + .on('end', () => this[JOBDONE](job)) + .on('error', er => this.emit('error', er)); + } + catch (er) { + this.emit('error', er); + } + } + [ONDRAIN]() { + if (this[CURRENT] && this[CURRENT].entry) { + this[CURRENT].entry.resume(); + } + } + // like .pipe() but using super, because our write() is special + [PIPE](job) { + job.piped = true; + if (job.readdir) { + job.readdir.forEach(entry => { + const p = job.path; + const base = p === './' ? '' : p.replace(/\/*$/, '/'); + this[ADDFSENTRY](base + entry); + }); + } + const source = job.entry; + const zip = this.zip; + /* c8 ignore start */ + if (!source) + throw new Error('cannot pipe without source'); + /* c8 ignore stop */ + if (zip) { + source.on('data', chunk => { + if (!zip.write(chunk)) { + source.pause(); + } + }); + } + else { + source.on('data', chunk => { + if (!super.write(chunk)) { + source.pause(); + } + }); + } + } + pause() { + if (this.zip) { + this.zip.pause(); + } + return super.pause(); + } + warn(code, message, data = {}) { + warnMethod(this, code, message, data); + } +} +export class PackSync extends Pack { + sync = true; + constructor(opt) { + super(opt); + this[WRITEENTRYCLASS] = WriteEntrySync; + } + // pause/resume are no-ops in sync streams. + pause() { } + resume() { } + [STAT](job) { + const stat = this.follow ? 'statSync' : 'lstatSync'; + this[ONSTAT](job, fs[stat](job.absolute)); + } + [READDIR](job) { + this[ONREADDIR](job, fs.readdirSync(job.absolute)); + } + // gotta get it all in this tick + [PIPE](job) { + const source = job.entry; + const zip = this.zip; + if (job.readdir) { + job.readdir.forEach(entry => { + const p = job.path; + const base = p === './' ? '' : p.replace(/\/*$/, '/'); + this[ADDFSENTRY](base + entry); + }); + } + /* c8 ignore start */ + if (!source) + throw new Error('Cannot pipe without source'); + /* c8 ignore stop */ + if (zip) { + source.on('data', chunk => { + zip.write(chunk); + }); + } + else { + source.on('data', chunk => { + super[WRITE](chunk); + }); + } + } +} +//# sourceMappingURL=pack.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/33/b523e750207e64795e4c24195d14ca787497d4da62f057df2d72e05a65dfd0023e1875954993c27617884c577b242b8c4fb5b3cc3501af88548535c8cb8280 b/.pnpm-store/v11/files/33/b523e750207e64795e4c24195d14ca787497d4da62f057df2d72e05a65dfd0023e1875954993c27617884c577b242b8c4fb5b3cc3501af88548535c8cb8280 new file mode 100644 index 0000000000..c1fe035f48 --- /dev/null +++ b/.pnpm-store/v11/files/33/b523e750207e64795e4c24195d14ca787497d4da62f057df2d72e05a65dfd0023e1875954993c27617884c577b242b8c4fb5b3cc3501af88548535c8cb8280 @@ -0,0 +1,4 @@ +"use strict";var d=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var We=d(F=>{"use strict";var Do=F&&F.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(F,"__esModule",{value:!0});F.Minipass=F.isWritable=F.isReadable=F.isStream=void 0;var kr=typeof process=="object"&&process?process:{stdout:null,stderr:null},ss=require("node:events"),qr=Do(require("node:stream")),Po=require("node:string_decoder"),No=s=>!!s&&typeof s=="object"&&(s instanceof Zt||s instanceof qr.default||(0,F.isReadable)(s)||(0,F.isWritable)(s));F.isStream=No;var Mo=s=>!!s&&typeof s=="object"&&s instanceof ss.EventEmitter&&typeof s.pipe=="function"&&s.pipe!==qr.default.Writable.prototype.pipe;F.isReadable=Mo;var Lo=s=>!!s&&typeof s=="object"&&s instanceof ss.EventEmitter&&typeof s.write=="function"&&typeof s.end=="function";F.isWritable=Lo;var ce=Symbol("EOF"),ue=Symbol("maybeEmitEnd"),we=Symbol("emittedEnd"),jt=Symbol("emittingEnd"),dt=Symbol("emittedError"),Ut=Symbol("closed"),xr=Symbol("read"),qt=Symbol("flush"),jr=Symbol("flushChunk"),K=Symbol("encoding"),Ue=Symbol("decoder"),R=Symbol("flowing"),mt=Symbol("paused"),qe=Symbol("resume"),O=Symbol("buffer"),I=Symbol("pipes"),v=Symbol("bufferLength"),Xi=Symbol("bufferPush"),Wt=Symbol("bufferShift"),N=Symbol("objectMode"),E=Symbol("destroyed"),Qi=Symbol("error"),Ji=Symbol("emitData"),Ur=Symbol("emitEnd"),es=Symbol("emitEnd2"),J=Symbol("async"),ts=Symbol("abort"),Ht=Symbol("aborted"),pt=Symbol("signal"),Ne=Symbol("dataListeners"),x=Symbol("discarded"),_t=s=>Promise.resolve().then(s),Ao=s=>s(),Io=s=>s==="end"||s==="finish"||s==="prefinish",Fo=s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,Co=s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),Gt=class{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[qe](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},is=class extends Gt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=r=>this.dest.emit("error",r),e.on("error",this.proxyErrors)}},Bo=s=>!!s.objectMode,zo=s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer",Zt=class extends ss.EventEmitter{[R]=!1;[mt]=!1;[I]=[];[O]=[];[N];[K];[J];[Ue];[ce]=!1;[we]=!1;[jt]=!1;[Ut]=!1;[dt]=null;[v]=0;[E]=!1;[pt];[Ht]=!1;[Ne]=0;[x]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Bo(t)?(this[N]=!0,this[K]=null):zo(t)?(this[K]=t.encoding,this[N]=!1):(this[N]=!1,this[K]=null),this[J]=!!t.async,this[Ue]=this[K]?new Po.StringDecoder(this[K]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[O]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[I]});let{signal:i}=t;i&&(this[pt]=i,i.aborted?this[ts]():i.addEventListener("abort",()=>this[ts]()))}get bufferLength(){return this[v]}get encoding(){return this[K]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[N]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[J]}set async(e){this[J]=this[J]||!!e}[ts](){this[Ht]=!0,this.emit("abort",this[pt]?.reason),this.destroy(this[pt]?.reason)}get aborted(){return this[Ht]}set aborted(e){}write(e,t,i){if(this[Ht])return!1;if(this[ce])throw new Error("write after end");if(this[E])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let r=this[J]?_t:Ao;if(!this[N]&&!Buffer.isBuffer(e)){if(Co(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Fo(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[N]?(this[R]&&this[v]!==0&&this[qt](!0),this[R]?this.emit("data",e):this[Xi](e),this[v]!==0&&this.emit("readable"),i&&r(i),this[R]):e.length?(typeof e=="string"&&!(t===this[K]&&!this[Ue]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[K]&&(e=this[Ue].write(e)),this[R]&&this[v]!==0&&this[qt](!0),this[R]?this.emit("data",e):this[Xi](e),this[v]!==0&&this.emit("readable"),i&&r(i),this[R]):(this[v]!==0&&this.emit("readable"),i&&r(i),this[R])}read(e){if(this[E])return null;if(this[x]=!1,this[v]===0||e===0||e&&e>this[v])return this[ue](),null;this[N]&&(e=null),this[O].length>1&&!this[N]&&(this[O]=[this[K]?this[O].join(""):Buffer.concat(this[O],this[v])]);let t=this[xr](e||null,this[O][0]);return this[ue](),t}[xr](e,t){if(this[N])this[Wt]();else{let i=t;e===i.length||e===null?this[Wt]():typeof i=="string"?(this[O][0]=i.slice(e),t=i.slice(0,e),this[v]-=e):(this[O][0]=i.subarray(e),t=i.subarray(0,e),this[v]-=e)}return this.emit("data",t),!this[O].length&&!this[ce]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t="utf8"),e!==void 0&&this.write(e,t),i&&this.once("end",i),this[ce]=!0,this.writable=!1,(this[R]||!this[mt])&&this[ue](),this}[qe](){this[E]||(!this[Ne]&&!this[I].length&&(this[x]=!0),this[mt]=!1,this[R]=!0,this.emit("resume"),this[O].length?this[qt]():this[ce]?this[ue]():this.emit("drain"))}resume(){return this[qe]()}pause(){this[R]=!1,this[mt]=!0,this[x]=!1}get destroyed(){return this[E]}get flowing(){return this[R]}get paused(){return this[mt]}[Xi](e){this[N]?this[v]+=1:this[v]+=e.length,this[O].push(e)}[Wt](){return this[N]?this[v]-=1:this[v]-=this[O][0].length,this[O].shift()}[qt](e=!1){do;while(this[jr](this[Wt]())&&this[O].length);!e&&!this[O].length&&!this[ce]&&this.emit("drain")}[jr](e){return this.emit("data",e),this[R]}pipe(e,t){if(this[E])return e;this[x]=!1;let i=this[we];return t=t||{},e===kr.stdout||e===kr.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[I].push(t.proxyErrors?new is(this,e,t):new Gt(this,e,t)),this[J]?_t(()=>this[qe]()):this[qe]()),e}unpipe(e){let t=this[I].find(i=>i.dest===e);t&&(this[I].length===1?(this[R]&&this[Ne]===0&&(this[R]=!1),this[I]=[]):this[I].splice(this[I].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if(e==="data")this[x]=!1,this[Ne]++,!this[I].length&&!this[R]&&this[qe]();else if(e==="readable"&&this[v]!==0)super.emit("readable");else if(Io(e)&&this[we])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[dt]){let r=t;this[J]?_t(()=>r.call(this,this[dt])):r.call(this,this[dt])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return e==="data"&&(this[Ne]=this.listeners("data").length,this[Ne]===0&&!this[x]&&!this[I].length&&(this[R]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ne]=0,!this[x]&&!this[I].length&&(this[R]=!1)),t}get emittedEnd(){return this[we]}[ue](){!this[jt]&&!this[we]&&!this[E]&&this[O].length===0&&this[ce]&&(this[jt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ut]&&this.emit("close"),this[jt]=!1)}emit(e,...t){let i=t[0];if(e!=="error"&&e!=="close"&&e!==E&&this[E])return!1;if(e==="data")return!this[N]&&!i?!1:this[J]?(_t(()=>this[Ji](i)),!0):this[Ji](i);if(e==="end")return this[Ur]();if(e==="close"){if(this[Ut]=!0,!this[we]&&!this[E])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[dt]=i,super.emit(Qi,i);let n=!this[pt]||this.listeners("error").length?super.emit("error",i):!1;return this[ue](),n}else if(e==="resume"){let n=super.emit("resume");return this[ue](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let r=super.emit(e,...t);return this[ue](),r}[Ji](e){for(let i of this[I])i.dest.write(e)===!1&&this.pause();let t=this[x]?!1:super.emit("data",e);return this[ue](),t}[Ur](){return this[we]?!1:(this[we]=!0,this.readable=!1,this[J]?(_t(()=>this[es]()),!0):this[es]())}[es](){if(this[Ue]){let t=this[Ue].end();if(t){for(let i of this[I])i.dest.write(t);this[x]||super.emit("data",t)}}for(let t of this[I])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[N]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[N]||(e.dataLength+=i.length)}),await t,e}async concat(){if(this[N])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[K]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(E,()=>t(new Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[x]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[ce])return t();let n,o,a=u=>{this.off("data",h),this.off("end",l),this.off(E,c),t(),o(u)},h=u=>{this.off("error",a),this.off("end",l),this.off(E,c),this.pause(),n({value:u,done:!!this[ce]})},l=()=>{this.off("error",a),this.off("data",h),this.off(E,c),t(),n({done:!0,value:void 0})},c=()=>a(new Error("stream destroyed"));return new Promise((u,b)=>{o=b,n=u,this.once(E,c),this.once("error",a),this.once("end",l),this.once("data",h)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[x]=!1;let e=!1,t=()=>(this.pause(),this.off(Qi,t),this.off(E,t),this.off("end",t),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return t();let r=this.read();return r===null?t():{done:!1,value:r}};return this.once("end",t),this.once(Qi,t),this.once(E,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[E])return e?this.emit("error",e):this.emit(E),this;this[E]=!0,this[x]=!0,this[O].length=0,this[v]=0;let t=this;return typeof t.close=="function"&&!this[Ut]&&t.close(),e?this.emit("error",e):this.emit(E),this}static get isStream(){return F.isStream}};F.Minipass=Zt});var Ke=d(W=>{"use strict";var Wr=W&&W.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(W,"__esModule",{value:!0});W.WriteStreamSync=W.WriteStream=W.ReadStreamSync=W.ReadStream=void 0;var ko=Wr(require("events")),z=Wr(require("fs")),xo=We(),jo=z.default.writev,Ee=Symbol("_autoClose"),$=Symbol("_close"),wt=Symbol("_ended"),p=Symbol("_fd"),rs=Symbol("_finished"),de=Symbol("_flags"),ns=Symbol("_flush"),ls=Symbol("_handleChunk"),cs=Symbol("_makeBuf"),Et=Symbol("_mode"),Yt=Symbol("_needDrain"),Ze=Symbol("_onerror"),Ye=Symbol("_onopen"),os=Symbol("_onread"),He=Symbol("_onwrite"),be=Symbol("_open"),V=Symbol("_path"),ye=Symbol("_pos"),ee=Symbol("_queue"),Ge=Symbol("_read"),as=Symbol("_readSize"),fe=Symbol("_reading"),yt=Symbol("_remain"),hs=Symbol("_size"),Kt=Symbol("_write"),Me=Symbol("_writing"),Vt=Symbol("_defaultFlag"),Le=Symbol("_errored"),$t=class extends xo.Minipass{[Le]=!1;[p];[V];[as];[fe]=!1;[hs];[yt];[Ee];constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Le]=!1,this[p]=typeof t.fd=="number"?t.fd:void 0,this[V]=e,this[as]=t.readSize||16*1024*1024,this[fe]=!1,this[hs]=typeof t.size=="number"?t.size:1/0,this[yt]=this[hs],this[Ee]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[p]=="number"?this[Ge]():this[be]()}get fd(){return this[p]}get path(){return this[V]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[be](){z.default.open(this[V],"r",(e,t)=>this[Ye](e,t))}[Ye](e,t){e?this[Ze](e):(this[p]=t,this.emit("open",t),this[Ge]())}[cs](){return Buffer.allocUnsafe(Math.min(this[as],this[yt]))}[Ge](){if(!this[fe]){this[fe]=!0;let e=this[cs]();if(e.length===0)return process.nextTick(()=>this[os](null,0,e));z.default.read(this[p],e,0,e.length,null,(t,i,r)=>this[os](t,i,r))}}[os](e,t,i){this[fe]=!1,e?this[Ze](e):this[ls](t,i)&&this[Ge]()}[$](){if(this[Ee]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,z.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ze](e){this[fe]=!0,this[$](),this.emit("error",e)}[ls](e,t){let i=!1;return this[yt]-=e,e>0&&(i=super.write(ethis[Ye](e,t))}[Ye](e,t){this[Vt]&&this[de]==="r+"&&e&&e.code==="ENOENT"?(this[de]="w",this[be]()):e?this[Ze](e):(this[p]=t,this.emit("open",t),this[Me]||this[ns]())}end(e,t){return e&&this.write(e,t),this[wt]=!0,!this[Me]&&!this[ee].length&&typeof this[p]=="number"&&this[He](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[wt]?(this.emit("error",new Error("write() after end()")),!1):this[p]===void 0||this[Me]||this[ee].length?(this[ee].push(e),this[Yt]=!0,!1):(this[Me]=!0,this[Kt](e),!0)}[Kt](e){z.default.write(this[p],e,0,e.length,this[ye],(t,i)=>this[He](t,i))}[He](e,t){e?this[Ze](e):(this[ye]!==void 0&&typeof t=="number"&&(this[ye]+=t),this[ee].length?this[ns]():(this[Me]=!1,this[wt]&&!this[rs]?(this[rs]=!0,this[$](),this.emit("finish")):this[Yt]&&(this[Yt]=!1,this.emit("drain"))))}[ns](){if(this[ee].length===0)this[wt]&&this[He](null,0);else if(this[ee].length===1)this[Kt](this[ee].pop());else{let e=this[ee];this[ee]=[],jo(this[p],e,this[ye],(t,i)=>this[He](t,i))}}[$](){if(this[Ee]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,z.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}};W.WriteStream=Xt;var fs=class extends Xt{[be](){let e;if(this[Vt]&&this[de]==="r+")try{e=z.default.openSync(this[V],this[de],this[Et])}catch(t){if(t?.code==="ENOENT")return this[de]="w",this[be]();throw t}else e=z.default.openSync(this[V],this[de],this[Et]);this[Ye](null,e)}[$](){if(this[Ee]&&typeof this[p]=="number"){let e=this[p];this[p]=void 0,z.default.closeSync(e),this.emit("close")}}[Kt](e){let t=!0;try{this[He](null,z.default.writeSync(this[p],e,0,e.length,this[ye])),t=!1}finally{if(t)try{this[$]()}catch{}}}};W.WriteStreamSync=fs});var Qt=d(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.dealias=S.isNoFile=S.isFile=S.isAsync=S.isSync=S.isAsyncNoFile=S.isSyncNoFile=S.isAsyncFile=S.isSyncFile=void 0;var Uo=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),qo=s=>!!s.sync&&!!s.file;S.isSyncFile=qo;var Wo=s=>!s.sync&&!!s.file;S.isAsyncFile=Wo;var Ho=s=>!!s.sync&&!s.file;S.isSyncNoFile=Ho;var Go=s=>!s.sync&&!s.file;S.isAsyncNoFile=Go;var Zo=s=>!!s.sync;S.isSync=Zo;var Yo=s=>!s.sync;S.isAsync=Yo;var Ko=s=>!!s.file;S.isFile=Ko;var Vo=s=>!s.file;S.isNoFile=Vo;var $o=s=>{let e=Uo.get(s);return e||s},Xo=(s={})=>{if(!s)return{};let e={};for(let[t,i]of Object.entries(s)){let r=$o(t);e[r]=i}return e.chmod===void 0&&e.noChmod===!1&&(e.chmod=!0),delete e.noChmod,e};S.dealias=Xo});var Ve=d(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.makeCommand=void 0;var bt=Qt(),Qo=(s,e,t,i,r)=>Object.assign((n=[],o,a)=>{Array.isArray(n)&&(o=n,n={}),typeof o=="function"&&(a=o,o=void 0),o=o?Array.from(o):[];let h=(0,bt.dealias)(n);if(r?.(h,o),(0,bt.isSyncFile)(h)){if(typeof a=="function")throw new TypeError("callback not supported for sync tar functions");return s(h,o)}else if((0,bt.isAsyncFile)(h)){let l=e(h,o);return a?l.then(()=>a(),a):l}else if((0,bt.isSyncNoFile)(h)){if(typeof a=="function")throw new TypeError("callback not supported for sync tar functions");return t(h,o)}else if((0,bt.isAsyncNoFile)(h)){if(typeof a=="function")throw new TypeError("callback only supported with file option");return i(h,o)}throw new Error("impossible options??")},{syncFile:s,asyncFile:e,syncNoFile:t,asyncNoFile:i,validate:r});Jt.makeCommand=Qo});var ds=d($e=>{"use strict";var Jo=$e&&$e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty($e,"__esModule",{value:!0});$e.constants=void 0;var ea=Jo(require("zlib")),ta=ea.default.constants||{ZLIB_VERNUM:4736};$e.constants=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},ta))});var Ps=d(f=>{"use strict";var ia=f&&f.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),sa=f&&f.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),ra=f&&f.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;rs,ms=Gr?.writable===!0||Gr?.set!==void 0?s=>{Ae.Buffer.concat=s?la:ha}:s=>{},Ie=Symbol("_superWrite"),Fe=class extends Error{code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}};f.ZlibError=Fe;var ps=Symbol("flushFlag"),St=class extends oa.Minipass{#e=!1;#i=!1;#s;#n;#r;#t;#o;get sawError(){return this.#e}get handle(){return this.#t}get flushFlag(){return this.#s}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#s=e.flush??0,this.#n=e.finishFlush??0,this.#r=e.fullFlushFlag??0,typeof Hr[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#t=new Hr[t](e)}catch(i){throw new Fe(i,this.constructor)}this.#o=i=>{this.#e||(this.#e=!0,this.close(),this.emit("error",i))},this.#t?.on("error",i=>this.#o(new Fe(i))),this.once("end",()=>this.close)}close(){this.#t&&(this.#t.close(),this.#t=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,_s.default)(this.#t,"zlib binding closed"),this.#t.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#r),this.write(Object.assign(Ae.Buffer.alloc(0),{[ps]:e})))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#n),this.#i=!0,super.end(i)}get ended(){return this.#i}[Ie](e){return super.write(e)}write(e,t,i){if(typeof t=="function"&&(i=t,t="utf8"),typeof e=="string"&&(e=Ae.Buffer.from(e,t)),this.#e)return;(0,_s.default)(this.#t,"zlib binding closed");let r=this.#t._handle,n=r.close;r.close=()=>{};let o=this.#t.close;this.#t.close=()=>{},ms(!0);let a;try{let l=typeof e[ps]=="number"?e[ps]:this.#s;a=this.#t._processChunk(e,l),ms(!1)}catch(l){ms(!1),this.#o(new Fe(l,this.write))}finally{this.#t&&(this.#t._handle=r,r.close=n,this.#t.close=o,this.#t.removeAllListeners("error"))}this.#t&&this.#t.on("error",l=>this.#o(new Fe(l,this.write)));let h;if(a)if(Array.isArray(a)&&a.length>0){let l=a[0];h=this[Ie](Ae.Buffer.from(l));for(let c=1;c{typeof r=="function"&&(n=r,r=this.flushFlag),this.flush(r),n?.()};try{this.handle.params(e,t)}finally{this.handle.flush=i}this.handle&&(this.#e=e,this.#i=t)}}}};f.Zlib=ie;var ws=class extends ie{constructor(e){super(e,"Deflate")}};f.Deflate=ws;var ys=class extends ie{constructor(e){super(e,"Inflate")}};f.Inflate=ys;var Es=class extends ie{#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Ie](e){return this.#e?(this.#e=!1,e[9]=255,super[Ie](e)):super[Ie](e)}};f.Gzip=Es;var bs=class extends ie{constructor(e){super(e,"Gunzip")}};f.Gunzip=bs;var Ss=class extends ie{constructor(e){super(e,"DeflateRaw")}};f.DeflateRaw=Ss;var gs=class extends ie{constructor(e){super(e,"InflateRaw")}};f.InflateRaw=gs;var Rs=class extends ie{constructor(e){super(e,"Unzip")}};f.Unzip=Rs;var ei=class extends St{constructor(e,t){e=e||{},e.flush=e.flush||te.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||te.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=te.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},Os=class extends ei{constructor(e){super(e,"BrotliCompress")}};f.BrotliCompress=Os;var vs=class extends ei{constructor(e){super(e,"BrotliDecompress")}};f.BrotliDecompress=vs;var ti=class extends St{constructor(e,t){e=e||{},e.flush=e.flush||te.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||te.constants.ZSTD_e_end,e.fullFlushFlag=te.constants.ZSTD_e_flush,super(e,t)}},Ts=class extends ti{constructor(e){super(e,"ZstdCompress")}};f.ZstdCompress=Ts;var Ds=class extends ti{constructor(e){super(e,"ZstdDecompress")}};f.ZstdDecompress=Ds});var Kr=d(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.parse=Xe.encode=void 0;var ca=(s,e)=>{if(Number.isSafeInteger(s))s<0?fa(s,e):ua(s,e);else throw Error("cannot encode number outside of javascript safe integer range");return e};Xe.encode=ca;var ua=(s,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=s&255,s=Math.floor(s/256)},fa=(s,e)=>{e[0]=255;var t=!1;s=s*-1;for(var i=e.length;i>1;i--){var r=s&255;s=Math.floor(s/256),t?e[i-1]=Zr(r):r===0?e[i-1]=0:(t=!0,e[i-1]=Yr(r))}},da=s=>{let e=s[0],t=e===128?pa(s.subarray(1,s.length)):e===255?ma(s):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t};Xe.parse=da;var ma=s=>{for(var e=s.length,t=0,i=!1,r=e-1;r>-1;r--){var n=Number(s[r]),o;i?o=Zr(n):n===0?o=n:(i=!0,o=Yr(n)),o!==0&&(t-=o*Math.pow(256,e-r-1))}return t},pa=s=>{for(var e=s.length,t=0,i=e-1;i>-1;i--){var r=Number(s[i]);r!==0&&(t+=r*Math.pow(256,e-i-1))}return t},Zr=s=>(255^s)&255,Yr=s=>(255^s)+1&255});var Ns=d(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.code=C.name=C.normalFsTypes=C.isName=C.isCode=void 0;var _a=s=>C.name.has(s);C.isCode=_a;var wa=s=>C.code.has(s);C.isName=wa;C.normalFsTypes=new Set(["0","","1","2","3","4","5","6","7","D"]);C.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);C.code=new Map(Array.from(C.name).map(s=>[s[1],s[0]]))});var et=d(se=>{"use strict";var ya=se&&se.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Ea=se&&se.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Vr=se&&se.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;rs===void 0||s<0?void 0:s,As=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#e="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,t=0,i,r){Buffer.isBuffer(e)?this.decode(e,t||0,i,r):e&&this.#i(e)}decode(e,t,i,r){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");let n=Ce(e,t+156,1),o=Je.normalFsTypes.has(n),a=o?i:void 0,h=o?r:void 0;if(this.path=a?.path??Ce(e,t,100),this.mode=a?.mode??h?.mode??Se(e,t+100,8),this.uid=a?.uid??h?.uid??Se(e,t+108,8),this.gid=a?.gid??h?.gid??Se(e,t+116,8),this.size=ba(a?.size??h?.size??Se(e,t+124,12)),this.mtime=a?.mtime??h?.mtime??Ms(e,t+136,12),this.cksum=Se(e,t+148,12),h&&this.#i(h,!0),a&&this.#i(a),Je.isCode(n)&&(this.#e=n||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=Ce(e,t+157,100),e.subarray(t+257,t+265).toString()==="ustar\x0000")if(this.uname=a?.uname??h?.uname??Ce(e,t+265,32),this.gname=a?.gname??h?.gname??Ce(e,t+297,32),this.devmaj=a?.devmaj??h?.devmaj??Se(e,t+329,8)??0,this.devmin=a?.devmin??h?.devmin??Se(e,t+337,8)??0,e[t+475]!==0){let c=Ce(e,t+345,155);this.path=c+"/"+this.path}else{let c=Ce(e,t+345,130);c&&(this.path=c+"/"+this.path),this.atime=i?.atime??r?.atime??Ms(e,t+476,12),this.ctime=i?.ctime??r?.ctime??Ms(e,t+488,12)}let l=256;for(let c=t;c!(r==null||i==="size"&&Number(r)<0||i==="path"&&t||i==="linkpath"&&t||i==="global"))))}encode(e,t=0){if(e||(e=this.block=Buffer.alloc(512)),this.#e==="Unsupported"&&(this.#e="0"),!(e.length>=t+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,r=Sa(this.path||"",i),n=r[0],o=r[1];this.needPax=!!r[2],this.needPax=Be(e,t,100,n)||this.needPax,this.needPax=ge(e,t+100,8,this.mode)||this.needPax,this.needPax=ge(e,t+108,8,this.uid)||this.needPax,this.needPax=ge(e,t+116,8,this.gid)||this.needPax,this.needPax=ge(e,t+124,12,this.size)||this.needPax,this.needPax=Ls(e,t+136,12,this.mtime)||this.needPax,e[t+156]=Number(this.#e.codePointAt(0)),this.needPax=Be(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=Be(e,t+265,32,this.uname)||this.needPax,this.needPax=Be(e,t+297,32,this.gname)||this.needPax,this.needPax=ge(e,t+329,8,this.devmaj)||this.needPax,this.needPax=ge(e,t+337,8,this.devmin)||this.needPax,this.needPax=Be(e,t+345,i,o)||this.needPax,e[t+475]!==0?this.needPax=Be(e,t+345,155,o)||this.needPax:(this.needPax=Be(e,t+345,130,o)||this.needPax,this.needPax=Ls(e,t+476,12,this.atime)||this.needPax,this.needPax=Ls(e,t+488,12,this.ctime)||this.needPax);let a=256;for(let h=t;h{let i=s,r="",n,o=Qe.posix.parse(s).root||".";if(Buffer.byteLength(i)<100)n=[i,r,!1];else{r=Qe.posix.dirname(i),i=Qe.posix.basename(i);do Buffer.byteLength(i)<=100&&Buffer.byteLength(r)<=e?n=[i,r,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(r)<=e?n=[i.slice(0,99),r,!0]:(i=Qe.posix.join(Qe.posix.basename(r),i),r=Qe.posix.dirname(r));while(r!==o&&n===void 0);n||(n=[s.slice(0,99),"",!0])}return n},Ce=(s,e,t)=>s.subarray(e,e+t).toString("utf8").replace(/\0.*/,""),Ms=(s,e,t)=>ga(Se(s,e,t)),ga=s=>s===void 0?void 0:new Date(s*1e3),Se=(s,e,t)=>Number(s[e])&128?$r.parse(s.subarray(e,e+t)):Oa(s,e,t),Ra=s=>isNaN(s)?void 0:s,Oa=(s,e,t)=>Ra(parseInt(s.subarray(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),va={12:8589934591,8:2097151},ge=(s,e,t,i)=>i===void 0?!1:i>va[t]||i<0?($r.encode(i,s.subarray(e,e+t)),!0):(Ta(s,e,t,i),!1),Ta=(s,e,t,i)=>s.write(Da(i,t),e,t,"ascii"),Da=(s,e)=>Pa(Math.floor(s).toString(8),e),Pa=(s,e)=>(s.length===e-1?s:new Array(e-s.length-1).join("0")+s+" ")+"\0",Ls=(s,e,t,i)=>i===void 0?!1:ge(s,e,t,i.getTime()/1e3),Na=new Array(156).join("\0"),Be=(s,e,t,i)=>i===void 0?!1:(s.write(i+Na,e,t,"utf8"),i.length!==Buffer.byteLength(i)||i.length>t)});var si=d(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.Pax=void 0;var Ma=require("node:path"),La=et(),Is=class s{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,t=!1){this.atime=e.atime,this.charset=e.charset,this.comment=e.comment,this.ctime=e.ctime,this.dev=e.dev,this.gid=e.gid,this.global=t,this.gname=e.gname,this.ino=e.ino,this.linkpath=e.linkpath,this.mtime=e.mtime,this.nlink=e.nlink,this.path=e.path,this.size=e.size,this.uid=e.uid,this.uname=e.uname}encode(){let e=this.encodeBody();if(e==="")return Buffer.allocUnsafe(0);let t=Buffer.byteLength(e),i=512*Math.ceil(1+t/512),r=Buffer.allocUnsafe(i);for(let n=0;n<512;n++)r[n]=0;new La.Header({path:("PaxHeader/"+(0,Ma.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:t,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(r),r.write(e,512,t,"utf8");for(let n=t+512;n=Math.pow(10,o)&&(o+=1),o+n+r}static parse(e,t,i=!1){return new s(Aa(Ia(e),t),i)}};ii.Pax=Is;var Aa=(s,e)=>e?Object.assign({},e,s):s,Ia=s=>s.replace(/\n$/,"").split(` +`).reduce(Fa,Object.create(null)),Fa=(s,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return s;e=e.slice((t+" ").length);let i=e.split("="),r=i.shift();if(!r)return s;let n=r.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),o=i.join("=").replace(/\0.*/,"");switch(n){case"path":case"linkpath":case"type":case"charset":case"comment":case"gname":case"uname":s[n]=o;break;case"ctime":case"atime":case"mtime":s[n]=new Date(Number(o)*1e3);break;case"size":let a=+o;a>=0&&(s[n]=a);break;case"gid":case"uid":case"dev":case"ino":case"nlink":case"mode":s[n]=+o;break}return s}});var tt=d(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.normalizeWindowsPath=void 0;var Ca=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;ri.normalizeWindowsPath=Ca!=="win32"?s=>String(s):s=>String(s).replaceAll(/\\/g,"/")});var Cs=d(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.ReadEntry=void 0;var Ba=We(),ni=tt(),Fs=class extends Ba.Minipass{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,t,i){switch(super({}),this.pause(),this.extended=t,this.globalExtended=i,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.path=(0,ni.normalizeWindowsPath)(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?(0,ni.normalizeWindowsPath)(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),i&&this.#e(i,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,r=this.blockRemain;return this.remain=Math.max(0,i-t),this.blockRemain=Math.max(0,r-t),this.ignore?!0:i>=t?super.write(e):super.write(e.subarray(0,i))}#e(e,t=!1){e.path&&(e.path=(0,ni.normalizeWindowsPath)(e.path)),e.linkpath&&(e.linkpath=(0,ni.normalizeWindowsPath)(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,r])=>!(r==null||i==="path"&&t))))}};oi.ReadEntry=Fs});var hi=d(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.warnMethod=void 0;var za=(s,e,t,i={})=>{s.file&&(i.file=s.file),s.cwd&&(i.cwd=s.cwd),i.code=t instanceof Error&&t.code||e,i.tarCode=e,!s.strict&&i.recoverable!==!1?(t instanceof Error&&(i=Object.assign(t,i),t=t.message),s.emit("warn",e,t,i)):t instanceof Error?s.emit("error",Object.assign(t,i)):s.emit("error",Object.assign(new Error(`${e}: ${t}`),i))};ai.warnMethod=za});var _i=d(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.Parser=void 0;var ka=require("events"),Bs=Ps(),Xr=et(),Qr=si(),xa=Cs(),ja=hi(),Ua=1024*1024,qs=Buffer.from([31,139]),Ws=Buffer.from([40,181,47,253]),qa=Math.max(qs.length,Ws.length),H=Symbol("state"),ze=Symbol("writeEntry"),me=Symbol("readEntry"),zs=Symbol("nextEntry"),Jr=Symbol("processEntry"),re=Symbol("extendedHeader"),gt=Symbol("globalExtendedHeader"),Re=Symbol("meta"),en=Symbol("emitMeta"),_=Symbol("buffer"),pe=Symbol("queue"),Oe=Symbol("ended"),ks=Symbol("emittedEnd"),ke=Symbol("emit"),y=Symbol("unzip"),li=Symbol("consumeChunk"),ci=Symbol("consumeChunkSub"),xs=Symbol("consumeBody"),tn=Symbol("consumeMeta"),sn=Symbol("consumeHeader"),Rt=Symbol("consuming"),js=Symbol("bufferConcat"),ui=Symbol("maybeEnd"),it=Symbol("writing"),ne=Symbol("aborted"),fi=Symbol("onDone"),xe=Symbol("sawValidEntry"),di=Symbol("sawNullBlock"),mi=Symbol("sawEOF"),rn=Symbol("closeStream"),Wa=1e3,Ot=Symbol("compressedBytesRead"),Us=Symbol("decompressedBytesRead"),nn=Symbol("checkDecompressionRatio"),Ha=()=>!0,Hs=class extends ka.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;zstd;maxDecompressionRatio;writable=!0;readable=!1;[pe]=[];[_];[me];[ze];[H]="begin";[Re]="";[re];[gt];[Oe]=!1;[y];[ne]=!1;[xe];[di]=!1;[mi]=!1;[it]=!1;[Rt]=!1;[ks]=!1;[Ot]=0;[Us]=0;constructor(e={}){super(),this.file=e.file||"",this.on(fi,()=>{(this[H]==="begin"||this[xe]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(fi,e.ondone):this.on(fi,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxDecompressionRatio=typeof e.maxDecompressionRatio=="number"?e.maxDecompressionRatio:Wa,this.maxMetaEntrySize=e.maxMetaEntrySize||Ua,this.filter=typeof e.filter=="function"?e.filter:Ha;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:t?void 0:!1;let i=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:i?!0:void 0,this.on("end",()=>this[rn]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,i={}){(0,ja.warnMethod)(this,e,t,i)}[sn](e,t){this[xe]===void 0&&(this[xe]=!1);let i;try{i=new Xr.Header(e,t,this[re],this[gt])}catch(r){return this.warn("TAR_ENTRY_INVALID",r)}if(i.nullBlock)this[di]?(this[mi]=!0,this[H]==="begin"&&(this[H]="header"),this[ke]("eof")):(this[di]=!0,this[ke]("nullBlock"));else if(this[di]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let r=i.type;if(/^(Symbolic)?Link$/.test(r)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(r)&&!/^(Global)?ExtendedHeader$/.test(r)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let n=this[ze]=new xa.ReadEntry(i,this[re],this[gt]);if(!this[xe])if(n.remain){let o=()=>{n.invalid||(this[xe]=!0)};n.on("end",o)}else this[xe]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[ke]("ignoredEntry",n),this[H]="ignore",n.resume()):n.size>0&&(this[Re]="",n.on("data",o=>this[Re]+=o),this[H]="meta"):(this[re]=void 0,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[ke]("ignoredEntry",n),this[H]=n.remain?"ignore":"header",n.resume()):(n.remain?this[H]="body":(this[H]="header",n.end()),this[me]?this[pe].push(n):(this[pe].push(n),this[zs]())))}}}[rn](){queueMicrotask(()=>this.emit("close"))}[Jr](e){let t=!0;if(!e)this[me]=void 0,t=!1;else if(Array.isArray(e)){let[i,...r]=e;this.emit(i,...r)}else this[me]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[zs]()),t=!1);return t}[zs](){do;while(this[Jr](this[pe].shift()));if(this[pe].length===0){let e=this[me];!e||e.flowing||e.size===e.remain?this[it]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[xs](e,t){let i=this[ze];if(!i)throw new Error("attempt to consume body without entry??");let r=i.blockRemain??0,n=r>=e.length&&t===0?e:e.subarray(t,t+r);return i.write(n),i.blockRemain||(this[H]="header",this[ze]=void 0,i.end()),n.length}[tn](e,t){let i=this[ze],r=this[xs](e,t);return!this[ze]&&i&&this[en](i),r}[ke](e,t,i){this[pe].length===0&&!this[me]?this.emit(e,t,i):this[pe].push([e,t,i])}[en](e){switch(this[ke]("meta",this[Re]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[re]=Qr.Pax.parse(this[Re],this[re],!1);break;case"GlobalExtendedHeader":this[gt]=Qr.Pax.parse(this[Re],this[gt],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[re]??Object.create(null);this[re]=t,t.path=this[Re].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[re]||Object.create(null);this[re]=t,t.linkpath=this[Re].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){if(!this[ne]){if(this[y]){let t=this[y];t.write=()=>!0,t.end=()=>t,t.emit=()=>!1,t.destroy?.()}this[ne]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}}[nn](e){this[Us]+=e.length;let t=this[Us]/this[Ot];return t>this.maxDecompressionRatio?(this.abort(new Error(`max decompression ratio exceeded: ${t.toFixed(2)} > ${this.maxDecompressionRatio}`)),!1):!0}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this[ne])return i?.(),!1;if((this[y]===void 0||this.brotli===void 0&&this[y]===!1)&&e){if(this[_]&&(e=Buffer.concat([this[_],e]),this[_]=void 0),e.length{this[nn](c)&&this[li](c)}),this[y].on("error",c=>{this[ne]||this.abort(c)}),this[y].on("end",()=>{this[Oe]=!0,this[li]()}),this[it]=!0,this[Ot]+=e.length;let l=!!this[y][h?"end":"write"](e);return this[it]=!1,i?.(),l}}this[it]=!0,this[y]?(this[Ot]+=e.length,this[y].write(e)):this[li](e),this[it]=!1;let n=this[pe].length>0?!1:this[me]?this[me].flowing:!0;return!n&&this[pe].length===0&&this[me]?.once("drain",()=>this.emit("drain")),i?.(),n}[js](e){e&&!this[ne]&&(this[_]=this[_]?Buffer.concat([this[_],e]):e)}[ui](){if(this[Oe]&&!this[ks]&&!this[ne]&&!this[Rt]){this[ks]=!0;let e=this[ze];if(e?.blockRemain){let t=this[_]?this[_].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[_]&&e.write(this[_]),e.end()}this[ke](fi)}}[li](e){if(this[Rt]&&e)this[js](e);else if(!e&&!this[_])this[ui]();else if(e){if(this[Rt]=!0,this[_]){this[js](e);let t=this[_];this[_]=void 0,this[ci](t)}else this[ci](e);for(;this[_]&&this[_]?.length>=512&&!this[ne]&&!this[mi];){let t=this[_];this[_]=void 0,this[ci](t)}this[Rt]=!1}(!this[_]||this[Oe])&&this[ui]()}[ci](e){let t=0,i=e.length;for(;t+512<=i&&!this[ne]&&!this[mi];)switch(this[H]){case"begin":case"header":this[sn](e,t),t+=512;break;case"ignore":case"body":t+=this[xs](e,t);break;case"meta":t+=this[tn](e,t);break;default:throw new Error("invalid state: "+this[H])}t{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.stripTrailingSlashes=void 0;var Ga=s=>{let e=s.length-1,t=-1;for(;e>-1&&s.charAt(e)==="/";)t=e,e--;return t===-1?s:s.slice(0,t)};wi.stripTrailingSlashes=Ga});var rt=d(B=>{"use strict";var Za=B&&B.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Ya=B&&B.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Ka=B&&B.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r{let e=s.onReadEntry;s.onReadEntry=e?t=>{e(t),t.resume()}:t=>t.resume()},Ja=(s,e)=>{let t=new Map(e.map(o=>[(0,Gs.stripTrailingSlashes)(o),!0])),i=s.filter,r=100,n=(o,a="",h=0)=>{if(h>=r)return t.set(o,!1),!1;let l=a||(0,on.parse)(o).root||".",c;if(o===l)c=!1;else{let u=t.get(o);c=u!==void 0?u:n((0,on.dirname)(o),l,h+1)}return t.set(o,c),c};s.filter=i?(o,a)=>i(o,a)&&n((0,Gs.stripTrailingSlashes)(o)):o=>n((0,Gs.stripTrailingSlashes)(o))};B.filesFilter=Ja;var eh=s=>{let e=new Ei.Parser(s),t=s.file,i;try{i=st.default.openSync(t,"r");let r=st.default.fstatSync(i),n=s.maxReadSize||16*1024*1024;if(r.size{let t=new Ei.Parser(s),i=s.maxReadSize||16*1024*1024,r=s.file;return new Promise((o,a)=>{t.on("error",a),t.on("end",o),st.default.stat(r,(h,l)=>{if(h)a(h);else{let c=new $a.ReadStream(r,{readSize:i,size:l.size});c.on("error",a),c.pipe(t)}})})};B.list=(0,Xa.makeCommand)(eh,th,s=>new Ei.Parser(s),s=>new Ei.Parser(s),(s,e)=>{e?.length&&(0,B.filesFilter)(s,e),s.noResume||Qa(s)})});var an=d(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.modeFix=void 0;var ih=(s,e,t)=>(s&=4095,t&&(s=(s|384)&-19),e&&(s&256&&(s|=64),s&32&&(s|=8),s&4&&(s|=1)),s);bi.modeFix=ih});var Zs=d(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.stripAbsolutePath=void 0;var sh=require("node:path"),{isAbsolute:rh,parse:hn}=sh.win32,nh=s=>{let e="",t=hn(s);for(;rh(s)||t.root;){let i=s.charAt(0)==="/"&&s.slice(0,4)!=="//?/"?"/":t.root;s=s.slice(i.length),e+=i,t=hn(s)}return[e,s]};Si.stripAbsolutePath=nh});var Ks=d(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.decode=nt.encode=void 0;var gi=["|","<",">","?",":"],Ys=gi.map(s=>String.fromCodePoint(61440+Number(s.codePointAt(0)))),oh=new Map(gi.map((s,e)=>[s,Ys[e]])),ah=new Map(Ys.map((s,e)=>[s,gi[e]])),hh=s=>gi.reduce((e,t)=>e.split(t).join(oh.get(t)),s);nt.encode=hh;var lh=s=>Ys.reduce((e,t)=>e.split(t).join(ah.get(t)),s);nt.decode=lh});var nr=d(M=>{"use strict";var ch=M&&M.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),uh=M&&M.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),fh=M&&M.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;re?(s=(0,oe.normalizeWindowsPath)(s).replace(/^\.(\/|$)/,""),(0,dh.stripTrailingSlashes)(e)+"/"+s):(0,oe.normalizeWindowsPath)(s),ph=16*1024*1024,cn=Symbol("process"),un=Symbol("file"),fn=Symbol("directory"),$s=Symbol("symlink"),dn=Symbol("hardlink"),vt=Symbol("header"),Ri=Symbol("read"),Xs=Symbol("lstat"),Oi=Symbol("onlstat"),Qs=Symbol("onread"),Js=Symbol("onreadlink"),er=Symbol("openfile"),tr=Symbol("onopenfile"),ve=Symbol("close"),vi=Symbol("mode"),ir=Symbol("awaitDrain"),Vs=Symbol("ondrain"),he=Symbol("prefix"),Ti=class extends pn.Minipass{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#e=!1;constructor(e,t={}){let i=(0,yn.dealias)(t);super(),this.path=(0,oe.normalizeWindowsPath)(e),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||ph,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=(0,oe.normalizeWindowsPath)(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?(0,oe.normalizeWindowsPath)(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){let[o,a]=(0,bn.stripAbsolutePath)(this.path);o&&typeof a=="string"&&(this.path=a,r=o)}this.win32=!!i.win32||process.platform==="win32",this.win32&&(this.path=mh.decode(this.path.replaceAll(/\\/g,"/")),e=e.replaceAll(/\\/g,"/")),this.absolute=(0,oe.normalizeWindowsPath)(i.absolute||ln.default.resolve(this.cwd,e)),this.path===""&&(this.path="./"),r&&this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path});let n=this.statCache.get(this.absolute);n?this[Oi](n):this[Xs]()}warn(e,t,i={}){return(0,Sn.warnMethod)(this,e,t,i)}emit(e,...t){return e==="error"&&(this.#e=!0),super.emit(e,...t)}[Xs](){ae.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Oi](t)})}[Oi](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=_h(e),this.emit("stat",e),this[cn]()}[cn](){switch(this.type){case"File":return this[un]();case"Directory":return this[fn]();case"SymbolicLink":return this[$s]();default:return this.end()}}[vi](e){return(0,wn.modeFix)(e,this.type==="Directory",this.portable)}[he](e){return gn(e,this.prefix)}[vt](){if(!this.stat)throw new Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new _n.Header({path:this[he](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[he](this.linkpath):this.linkpath,mode:this[vi](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new En.Pax({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[he](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[he](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let e=this.header?.block;if(!e)throw new Error("failed to encode header");super.write(e)}[fn](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[vt](),this.end()}[$s](){ae.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Js](t)})}[Js](e){this.linkpath=(0,oe.normalizeWindowsPath)(e),this[vt](),this.end()}[dn](e){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=(0,oe.normalizeWindowsPath)(ln.default.relative(this.cwd,e)),this.stat.size=0,this[vt](),this.end()}[un](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,t=this.linkCache.get(e);if(t?.indexOf(this.cwd)===0)return this[dn](t);this.linkCache.set(e,this.absolute)}if(this[vt](),this.stat.size===0)return this.end();this[er]()}[er](){ae.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[tr](t)})}[tr](e){if(this.fd=e,this.#e)return this[ve]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[Ri]()}[Ri](){let{fd:e,buf:t,offset:i,length:r,pos:n}=this;if(e===void 0||t===void 0)throw new Error("cannot read file without first opening");ae.default.read(e,t,i,r,n,(o,a)=>{if(o)return this[ve](()=>this.emit("error",o));this[Qs](a)})}[ve](e=()=>{}){this.fd!==void 0&&ae.default.close(this.fd,e)}[Qs](e){if(e<=0&&this.remain>0){let r=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ve](()=>this.emit("error",r))}if(e>this.remain){let r=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ve](()=>this.emit("error",r))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(e===this.remain)for(let r=e;rthis[Vs]())}[ir](e){this.once("drain",e)}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this.blockRemaine?this.emit("error",e):this.end());if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[Ri]()}};M.WriteEntry=Ti;var sr=class extends Ti{sync=!0;[Xs](){this[Oi](ae.default.lstatSync(this.absolute))}[$s](){this[Js](ae.default.readlinkSync(this.absolute))}[er](){this[tr](ae.default.openSync(this.absolute,"r"))}[Ri](){let e=!0;try{let{fd:t,buf:i,offset:r,length:n,pos:o}=this;if(t===void 0||i===void 0)throw new Error("fd and buf must be set in READ method");let a=ae.default.readSync(t,i,r,n,o);this[Qs](a),e=!1}finally{if(e)try{this[ve](()=>{})}catch{}}}[ir](e){e()}[ve](e=()=>{}){this.fd!==void 0&&ae.default.closeSync(this.fd),e()}};M.WriteEntrySync=sr;var rr=class extends pn.Minipass{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,t,i={}){return(0,Sn.warnMethod)(this,e,t,i)}constructor(e,t={}){let i=(0,yn.dealias)(t);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=e;let{type:r}=e;if(r==="Unsupported")throw new Error("writing entry that should be ignored");this.type=r,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=(0,oe.normalizeWindowsPath)(e.path),this.mode=e.mode!==void 0?this[vi](e.mode):void 0,this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:i.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=e.linkpath!==void 0?(0,oe.normalizeWindowsPath)(e.linkpath):void 0,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let n=!1;if(!this.preservePaths){let[a,h]=(0,bn.stripAbsolutePath)(this.path);a&&typeof h=="string"&&(this.path=h,n=a)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new _n.Header({path:this[he](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[he](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new En.Pax({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[he](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[he](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let o=this.header?.block;if(!o)throw new Error("failed to encode header");super.write(o),e.pipe(this)}[he](e){return gn(e,this.prefix)}[vi](e){return(0,wn.modeFix)(e,this.type==="Directory",this.portable)}write(e,t,i){typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8"));let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(e,i)}end(e,t,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t??"utf8")),i&&this.once("finish",i),e?super.end(e,i):super.end(i),this}};M.WriteEntryTar=rr;var _h=s=>s.isFile()?"File":s.isDirectory()?"Directory":s.isSymbolicLink()?"SymbolicLink":"Unsupported"});var Rn=d(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.Node=at.Yallist=void 0;var or=class s{tail;head;length=0;static create(e=[]){return new s(e)}constructor(e=[]){for(let t of e)this.push(t)}*[Symbol.iterator](){for(let e=this.head;e;e=e.next)yield e.value}removeNode(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");let t=e.next,i=e.prev;return t&&(t.prev=i),i&&(i.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=i),this.length--,e.next=void 0,e.prev=void 0,e.list=void 0,t}unshiftNode(e){if(e===this.head)return;e.list&&e.list.removeNode(e);let t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}pushNode(e){if(e===this.tail)return;e.list&&e.list.removeNode(e);let t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}push(...e){for(let t=0,i=e.length;t1)i=t;else if(this.head)r=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;r;n++)i=e(i,r.value,n),r=r.next;return i}reduceReverse(e,t){let i,r=this.tail;if(arguments.length>1)i=t;else if(this.tail)r=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;r;n--)i=e(i,r.value,n),r=r.prev;return i}toArray(){let e=new Array(this.length);for(let t=0,i=this.head;i;t++)e[t]=i.value,i=i.next;return e}toArrayReverse(){let e=new Array(this.length);for(let t=0,i=this.tail;i;t++)e[t]=i.value,i=i.prev;return e}slice(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let i=new s;if(tthis.length&&(t=this.length);let r=this.head,n=0;for(n=0;r&&nthis.length&&(t=this.length);let r=this.length,n=this.tail;for(;n&&r>t;r--)n=n.prev;for(;n&&r>e;r--,n=n.prev)i.push(n.value);return i}splice(e,t=0,...i){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);let r=this.head;for(let o=0;r&&o{"use strict";var bh=L&&L.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Sh=L&&L.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),gh=L&&L.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new ar.Gzip(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new ar.BrotliCompress(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new ar.ZstdCompress(e.zstd)),!this.zip)throw new Error("impossible");let t=this.zip;t.on("data",i=>super.write(i)),t.on("end",()=>super.end()),t.on("drain",()=>this[cr]()),this.on("resume",()=>t.resume())}else this.on("drain",this[cr]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter=typeof e.filter=="function"?e.filter:()=>!0,this[X]=new Oh.Yallist,this[Q]=0,this.jobs=Number(e.jobs)||4,this[Pt]=!1,this[Tt]=!1}[Nn](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&this.add(e),this[Tt]=!0,this[je](),i&&i(),this}write(e){if(this[Tt])throw new Error("write after end");return typeof e=="string"?this[Ni](e):this[vn](e),this.flowing}[vn](e){let t=(0,ur.normalizeWindowsPath)(Dn.default.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let i=new Nt(e.path,t);i.entry=new fr.WriteEntryTar(e,this[lr](i)),i.entry.on("end",()=>this[hr](i)),this[Q]+=1,this[X].push(i)}this[je]()}[Ni](e){let t=(0,ur.normalizeWindowsPath)(Dn.default.resolve(this.cwd,e));this[X].push(new Nt(e,t)),this[je]()}[dr](e){e.pending=!0,this[Q]+=1;let t=this.follow?"stat":"lstat";Ii.default[t](e.absolute,(i,r)=>{e.pending=!1,this[Q]-=1,i?this.emit("error",i):this[Pi](e,r)})}[Pi](e,t){if(this.statCache.set(e.absolute,t),e.stat=t,!this.filter(e.path,t))e.ignore=!0;else if(t.isFile()&&t.nlink>1&&!this.linkCache.get(`${t.dev}:${t.ino}`)&&!this.sync)if(e===this[Te])this[Di](e);else{let i=`${t.dev}:${t.ino}`,r=this[Dt].get(i);r?r.push(e):this[Dt].set(i,[e]),e.pendingLink=!0,e.pending=!0}this[je]()}[mr](e){e.pending=!0,this[Q]+=1,Ii.default.readdir(e.absolute,(t,i)=>{if(e.pending=!1,this[Q]-=1,t)return this.emit("error",t);this[Mi](e,i)})}[Mi](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[je]()}[je](){if(!this[Pt]){this[Pt]=!0;for(let e=this[X].head;e&&this[Q]1){let i=`${t.dev}:${t.ino}`,r=this[Dt].get(i);if(r){this[Dt].delete(i);for(let n of r)n.pending=!1,this[Di](n)}}this[je]()}[Di](e){if(e.pending&&e.pendingLink&&e===this[Te]&&(e.pending=!1,e.pendingLink=!1),!e.pending){if(e.entry){e===this[Te]&&!e.piped&&this[Li](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[Pi](e,t):this[dr](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[Mi](e,t):this[mr](e),!e.readdir)return}if(e.entry=this[Tn](e),!e.entry){e.ignore=!0;return}e===this[Te]&&!e.piped&&this[Li](e)}}}[lr](e){return{onwarn:(t,i,r)=>this.warn(t,i,r),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[Tn](e){this[Q]+=1;try{return new this[Ai](e.path,this[lr](e)).on("end",()=>this[hr](e)).on("error",i=>this.emit("error",i))}catch(t){this.emit("error",t)}}[cr](){this[Te]&&this[Te].entry&&this[Te].entry.resume()}[Li](e){e.piped=!0,e.readdir&&e.readdir.forEach(r=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[Ni](o+r)});let t=e.entry,i=this.zip;if(!t)throw new Error("cannot pipe without source");i?t.on("data",r=>{i.write(r)||t.pause()}):t.on("data",r=>{super.write(r)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,t,i={}){(0,vh.warnMethod)(this,e,t,i)}};L.Pack=Fi;var pr=class extends Fi{sync=!0;constructor(e){super(e),this[Ai]=fr.WriteEntrySync}pause(){}resume(){}[dr](e){let t=this.follow?"statSync":"lstatSync";this[Pi](e,Ii.default[t](e.absolute))}[mr](e){this[Mi](e,Ii.default.readdirSync(e.absolute))}[Li](e){let t=e.entry,i=this.zip;if(e.readdir&&e.readdir.forEach(r=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[Ni](o+r)}),!t)throw new Error("Cannot pipe without source");i?t.on("data",r=>{i.write(r)}):t.on("data",r=>{super[Nn](r)})}};L.PackSync=pr});var _r=d(ht=>{"use strict";var Th=ht&&ht.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ht,"__esModule",{value:!0});ht.create=void 0;var Mn=Ke(),Ln=Th(require("node:path")),An=rt(),Dh=Ve(),Bi=Ci(),Ph=(s,e)=>{let t=new Bi.PackSync(s),i=new Mn.WriteStreamSync(s.file,{mode:s.mode||438});t.pipe(i),In(t,e)},Nh=(s,e)=>{let t=new Bi.Pack(s),i=new Mn.WriteStream(s.file,{mode:s.mode||438});t.pipe(i);let r=new Promise((n,o)=>{i.on("error",o),i.on("close",n),t.on("error",o)});return Fn(t,e).catch(n=>t.emit("error",n)),r},In=(s,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,An.list)({file:Ln.default.resolve(s.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>s.add(i)}):s.add(t)}),s.end()},Fn=async(s,e)=>{for(let t of e)t.charAt(0)==="@"?await(0,An.list)({file:Ln.default.resolve(String(s.cwd),t.slice(1)),noResume:!0,onReadEntry:i=>{s.add(i)}}):s.add(t);s.end()},Mh=(s,e)=>{let t=new Bi.PackSync(s);return In(t,e),t},Lh=(s,e)=>{let t=new Bi.Pack(s);return Fn(t,e).catch(i=>t.emit("error",i)),t};ht.create=(0,Dh.makeCommand)(Ph,Nh,Mh,Lh,(s,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive")})});var Wn=d(lt=>{"use strict";var Ah=lt&<.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(lt,"__esModule",{value:!0});lt.getWriteFlag=void 0;var zn=Ah(require("fs")),Ih=process.env.__FAKE_PLATFORM__||process.platform,kn=Ih==="win32",{O_CREAT:xn,O_NOFOLLOW:Cn,O_TRUNC:jn,O_WRONLY:Un}=zn.default.constants,qn=Number(process.env.__FAKE_FS_O_FILENAME__)||zn.default.constants.UV_FS_O_FILEMAP||0,Fh=kn&&!!qn,Ch=512*1024,Bh=qn|jn|xn|Un,Bn=!kn&&typeof Cn=="number"?Cn|jn|xn|Un:null;lt.getWriteFlag=Bn!==null?()=>Bn:Fh?s=>s"w"});var Gn=d(le=>{"use strict";var Hn=le&&le.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(le,"__esModule",{value:!0});le.chownrSync=le.chownr=void 0;var ki=Hn(require("node:fs")),Mt=Hn(require("node:path")),wr=(s,e,t)=>{try{return ki.default.lchownSync(s,e,t)}catch(i){if(i?.code!=="ENOENT")throw i}},zi=(s,e,t,i)=>{ki.default.lchown(s,e,t,r=>{i(r&&r?.code!=="ENOENT"?r:null)})},zh=(s,e,t,i,r)=>{if(e.isDirectory())(0,le.chownr)(Mt.default.resolve(s,e.name),t,i,n=>{if(n)return r(n);let o=Mt.default.resolve(s,e.name);zi(o,t,i,r)});else{let n=Mt.default.resolve(s,e.name);zi(n,t,i,r)}},kh=(s,e,t,i)=>{ki.default.readdir(s,{withFileTypes:!0},(r,n)=>{if(r){if(r.code==="ENOENT")return i();if(r.code!=="ENOTDIR"&&r.code!=="ENOTSUP")return i(r)}if(r||!n.length)return zi(s,e,t,i);let o=n.length,a=null,h=l=>{if(!a){if(l)return i(a=l);if(--o===0)return zi(s,e,t,i)}};for(let l of n)zh(s,l,e,t,h)})};le.chownr=kh;var xh=(s,e,t,i)=>{e.isDirectory()&&(0,le.chownrSync)(Mt.default.resolve(s,e.name),t,i),wr(Mt.default.resolve(s,e.name),t,i)},jh=(s,e,t)=>{let i;try{i=ki.default.readdirSync(s,{withFileTypes:!0})}catch(r){let n=r;if(n?.code==="ENOENT")return;if(n?.code==="ENOTDIR"||n?.code==="ENOTSUP")return wr(s,e,t);throw n}for(let r of i)xh(s,r,e,t);return wr(s,e,t)};le.chownrSync=jh});var Zn=d(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.CwdError=void 0;var yr=class extends Error{path;code;syscall="chdir";constructor(e,t){super(`${t}: Cannot cd into '${e}'`),this.path=e,this.code=t}get name(){return"CwdError"}};xi.CwdError=yr});var br=d(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.SymlinkError=void 0;var Er=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,t){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=t}get name(){return"SymlinkError"}};ji.SymlinkError=Er});var Xn=d(De=>{"use strict";var gr=De&&De.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(De,"__esModule",{value:!0});De.mkdirSync=De.mkdir=void 0;var Yn=Gn(),j=gr(require("node:fs")),Uh=gr(require("node:fs/promises")),Ui=gr(require("node:path")),Kn=Zn(),_e=tt(),Vn=br(),qh=(s,e)=>{j.default.stat(s,(t,i)=>{(t||!i.isDirectory())&&(t=new Kn.CwdError(s,t?.code||"ENOTDIR")),e(t)})},Wh=(s,e,t)=>{s=(0,_e.normalizeWindowsPath)(s);let i=e.umask??18,r=e.mode|448,n=(r&i)!==0,o=e.uid,a=e.gid,h=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),l=e.preserve,c=e.unlink,u=(0,_e.normalizeWindowsPath)(e.cwd),b=(w,P)=>{w?t(w):P&&h?(0,Yn.chownr)(P,o,a,xt=>b(xt)):n?j.default.chmod(s,r,t):t()};if(s===u)return qh(s,b);if(l)return Uh.default.mkdir(s,{mode:r,recursive:!0}).then(w=>b(null,w??void 0),b);let A=(0,_e.normalizeWindowsPath)(Ui.default.relative(u,s)).split("/");Sr(u,A,r,c,u,void 0,b)};De.mkdir=Wh;var Sr=(s,e,t,i,r,n,o)=>{if(e.length===0)return o(null,n);let a=e.shift(),h=(0,_e.normalizeWindowsPath)(Ui.default.resolve(s+"/"+a));j.default.mkdir(h,t,$n(h,e,t,i,r,n,o))},$n=(s,e,t,i,r,n,o)=>a=>{a?j.default.lstat(s,(h,l)=>{if(h)h.path=h.path&&(0,_e.normalizeWindowsPath)(h.path),o(h);else if(l.isDirectory())Sr(s,e,t,i,r,n,o);else if(i)j.default.unlink(s,c=>{if(c)return o(c);j.default.mkdir(s,t,$n(s,e,t,i,r,n,o))});else{if(l.isSymbolicLink())return o(new Vn.SymlinkError(s,s+"/"+e.join("/")));o(a)}}):(n=n||s,Sr(s,e,t,i,r,n,o))},Hh=s=>{let e=!1,t;try{e=j.default.statSync(s).isDirectory()}catch(i){t=i?.code}finally{if(!e)throw new Kn.CwdError(s,t??"ENOTDIR")}},Gh=(s,e)=>{s=(0,_e.normalizeWindowsPath)(s);let t=e.umask??18,i=e.mode|448,r=(i&t)!==0,n=e.uid,o=e.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),h=e.preserve,l=e.unlink,c=(0,_e.normalizeWindowsPath)(e.cwd),u=w=>{w&&a&&(0,Yn.chownrSync)(w,n,o),r&&j.default.chmodSync(s,i)};if(s===c)return Hh(c),u();if(h)return u(j.default.mkdirSync(s,{mode:i,recursive:!0})??void 0);let D=(0,_e.normalizeWindowsPath)(Ui.default.relative(c,s)).split("/"),A;for(let w=D.shift(),P=c;w&&(P+="/"+w);w=D.shift()){P=(0,_e.normalizeWindowsPath)(Ui.default.resolve(P));try{j.default.mkdirSync(P,i),A=A||P}catch{let xt=j.default.lstatSync(P);if(xt.isDirectory())continue;if(l){j.default.unlinkSync(P),j.default.mkdirSync(P,i),A=A||P;continue}else if(xt.isSymbolicLink())return new Vn.SymlinkError(P,P+"/"+D.join("/"))}}return u(A)};De.mkdirSync=Gh});var Jn=d(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.normalizeUnicode=void 0;var Rr=Object.create(null),Qn=1e4,ct=new Set,Zh=s=>{ct.has(s)?ct.delete(s):Rr[s]=s.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),ct.add(s);let e=Rr[s],t=ct.size-Qn;if(t>Qn/10){for(let i of ct)if(ct.delete(i),delete Rr[i],--t<=0)break}return e};qi.normalizeUnicode=Zh});var to=d(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.PathReservations=void 0;var eo=require("node:path"),Yh=Jn(),Kh=yi(),Vh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,$h=Vh==="win32",Xh=s=>s.split("/").slice(0,-1).reduce((t,i)=>{let r=t.at(-1);return r!==void 0&&(i=(0,eo.join)(r,i)),t.push(i||"/"),t},[]),Or=class{#e=new Map;#i=new Map;#s=new Set;reserve(e,t){e=$h?["win32 parallelization disabled"]:e.map(r=>(0,Kh.stripTrailingSlashes)((0,eo.join)((0,Yh.normalizeUnicode)(r))));let i=new Set(e.map(r=>Xh(r)).reduce((r,n)=>r.concat(n)));this.#i.set(t,{dirs:i,paths:e});for(let r of e){let n=this.#e.get(r);n?n.push(t):this.#e.set(r,[t])}for(let r of i){let n=this.#e.get(r);if(!n)this.#e.set(r,[new Set([t])]);else{let o=n.at(-1);o instanceof Set?o.add(t):n.push(new Set([t]))}}return this.#r(t)}#n(e){let t=this.#i.get(e);if(!t)throw new Error("function does not have any path reservations");return{paths:t.paths.map(i=>this.#e.get(i)),dirs:[...t.dirs].map(i=>this.#e.get(i))}}check(e){let{paths:t,dirs:i}=this.#n(e);return t.every(r=>r&&r[0]===e)&&i.every(r=>r&&r[0]instanceof Set&&r[0].has(e))}#r(e){return this.#s.has(e)||!this.check(e)?!1:(this.#s.add(e),e(()=>this.#t(e)),!0)}#t(e){if(!this.#s.has(e))return!1;let t=this.#i.get(e);if(!t)throw new Error("invalid reservation");let{paths:i,dirs:r}=t,n=new Set;for(let o of i){let a=this.#e.get(o);if(!a||a?.[0]!==e)continue;let h=a[1];if(!h){this.#e.delete(o);continue}if(a.shift(),typeof h=="function")n.add(h);else for(let l of h)n.add(l)}for(let o of r){let a=this.#e.get(o),h=a?.[0];if(!(!a||!(h instanceof Set)))if(h.size===1&&a.length===1){this.#e.delete(o);continue}else if(h.size===1){a.shift();let l=a[0];typeof l=="function"&&n.add(l)}else h.delete(e)}return this.#s.delete(e),n.forEach(o=>this.#r(o)),!0}};Wi.PathReservations=Or});var io=d(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.umask=void 0;var Qh=()=>process.umask();Hi.umask=Qh});var Cr=d(k=>{"use strict";var Jh=k&&k.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),el=k&&k.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),fo=k&&k.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r{if(!zt)return m.default.unlink(s,e);let t=s+".DELETE."+(0,mo.randomBytes)(16).toString("hex");m.default.rename(s,t,i=>{if(i)return e(i);m.default.unlink(t,e)})},cl=s=>{if(!zt)return m.default.unlinkSync(s);let e=s+".DELETE."+(0,mo.randomBytes)(16).toString("hex");m.default.renameSync(s,e),m.default.unlinkSync(e)},uo=(s,e,t)=>s!==void 0&&s===s>>>0?s:e!==void 0&&e===e>>>0?e:t,Yi=class extends sl.Parser{[Tr]=!1;[Bt]=!1;[Gi]=0;reservations=new nl.PathReservations;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){if(e.ondone=()=>{this[Tr]=!0,this[Dr]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;this.preserveOwner=e.preserveOwner===void 0&&typeof e.uid!="number"?process.getuid?.()===0:!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:hl,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||zt,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=(0,U.normalizeWindowsPath)(g.default.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?typeof e.processUmask=="number"?e.processUmask:(0,ol.umask)():0,this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[ro](t))}warn(e,t,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,t,i)}[Dr](){this[Tr]&&this[Gi]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[vr](e,t){let i=e[t],{type:r}=e;if(!i||this.preservePaths)return!0;let[n,o]=(0,rl.stripAbsolutePath)(i),a=o.replaceAll(/\\/g,"/").split("/");if(a.includes("..")||zt&&/^[a-z]:\.\.$/i.test(a[0]??"")){if(t==="path"||r==="Link")return this.warn("TAR_ENTRY_ERROR",`${t} contains '..'`,{entry:e,[t]:i}),!1;let h=g.default.posix.dirname(e.path),l=g.default.posix.normalize(g.default.posix.join(h,a.join("/")));if(l.startsWith("../")||l==="..")return this.warn("TAR_ENTRY_ERROR",`${t} escapes extraction directory`,{entry:e,[t]:i}),!1}return n&&(e[t]=String(o),this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute ${t}`,{entry:e,[t]:i})),!0}[lo](e){let t=(0,U.normalizeWindowsPath)(e.path),i=t.split("/");if(this.strip){if(i.length=this.strip)e.linkpath=r.slice(this.strip).join("/");else return!1}i.splice(0,this.strip),e.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this[vr](e,"path")||!this[vr](e,"linkpath"))return!1;if(e.absolute=g.default.isAbsolute(e.path)?(0,U.normalizeWindowsPath)(g.default.resolve(e.path)):(0,U.normalizeWindowsPath)(g.default.resolve(this.cwd,e.path)),!this.preservePaths&&typeof e.absolute=="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:(0,U.normalizeWindowsPath)(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:r}=g.default.win32.parse(String(e.absolute));e.absolute=r+so.encode(String(e.absolute).slice(r.length));let{root:n}=g.default.win32.parse(e.path);e.path=n+so.encode(e.path.slice(n.length))}return!0}[ro](e){if(!this[lo](e))return e.resume();switch(il.default.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Pr](e);default:return this[ho](e)}}[T](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[ut](),t.resume())}[Pe](e,t,i){(0,_o.mkdir)((0,U.normalizeWindowsPath)(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t},i)}[It](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[Ft](e){return uo(this.uid,e.uid,this.processUid)}[Ct](e){return uo(this.gid,e.gid,this.processGid)}[Mr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,r=new tl.WriteStream(String(e.absolute),{flags:(0,po.getWriteFlag)(e.size),mode:i,autoClose:!1});r.on("error",h=>{r.fd&&m.default.close(r.fd,()=>{}),r.write=()=>!0,this[T](h,e),t()});let n=1,o=h=>{if(h){r.fd&&m.default.close(r.fd,()=>{}),this[T](h,e),t();return}--n===0&&r.fd!==void 0&&m.default.close(r.fd,l=>{l?this[T](l,e):this[ut](),t()})};r.on("finish",()=>{let h=String(e.absolute),l=r.fd;if(typeof l=="number"&&e.mtime&&!this.noMtime){n++;let c=e.atime||new Date,u=e.mtime;m.default.futimes(l,c,u,b=>b?m.default.utimes(h,c,u,D=>o(D&&b)):o())}if(typeof l=="number"&&this[It](e)){n++;let c=this[Ft](e),u=this[Ct](e);typeof c=="number"&&typeof u=="number"&&m.default.fchown(l,c,u,b=>b?m.default.chown(h,c,u,D=>o(D&&b)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",h=>{this[T](h,e),t()}),e.pipe(a)),a.pipe(r)}[Lr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode;this[Pe](String(e.absolute),i,r=>{if(r){this[T](r,e),t();return}let n=1,o=()=>{--n===0&&(t(),this[ut](),e.resume())};e.mtime&&!this.noMtime&&(n++,m.default.utimes(String(e.absolute),e.atime||new Date,e.mtime,o)),this[It](e)&&(n++,m.default.chown(String(e.absolute),Number(this[Ft](e)),Number(this[Ct](e)),o)),o()})}[ho](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[oo](e,t){let i=(0,U.normalizeWindowsPath)(g.default.relative(this.cwd,g.default.resolve(g.default.dirname(String(e.absolute)),String(e.linkpath)))).split("/");this[At](e,this.cwd,i,()=>this[Zi](e,String(e.linkpath),"symlink",t),r=>{this[T](r,e),t()})}[ao](e,t){let i=(0,U.normalizeWindowsPath)(g.default.resolve(this.cwd,String(e.linkpath))),r=(0,U.normalizeWindowsPath)(String(e.linkpath)).split("/");this[At](e,this.cwd,r,()=>this[Zi](e,i,"link",t),n=>{this[T](n,e),t()})}[At](e,t,i,r,n){let o=i.shift();if(this.preservePaths||o===void 0)return r();let a=g.default.resolve(t,o);m.default.lstat(a,(h,l)=>{if(h)return r();if(l?.isSymbolicLink())return n(new wo.SymlinkError(a,g.default.resolve(a,i.join("/"))));this[At](e,a,i,r,n)})}[co](){this[Gi]++}[ut](){this[Gi]--,this[Dr]()}[Ar](e){this[ut](),e.resume()}[Nr](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!zt}[Pr](e){this[co]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,i=>this[no](e,i))}[no](e,t){let i=a=>{t(a)},r=()=>{this[Pe](this.cwd,this.dmode,a=>{if(a){this[T](a,e),i();return}this[Bt]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=(0,U.normalizeWindowsPath)(g.default.dirname(String(e.absolute)));if(a!==this.cwd)return this[Pe](a,this.dmode,h=>{if(h){this[T](h,e),i();return}o()})}o()},o=()=>{m.default.lstat(String(e.absolute),(a,h)=>{if(h&&(this.keep||this.newer&&h.mtime>(e.mtime??h.mtime))){this[Ar](e),i();return}if(a||this[Nr](e,h))return this[G](null,e,i);if(h.isDirectory()){if(e.type==="Directory"){let l=this.chmod&&e.mode&&(h.mode&4095)!==e.mode,c=u=>this[G](u??null,e,i);return l?m.default.chmod(String(e.absolute),Number(e.mode),c):c()}if(e.absolute!==this.cwd)return m.default.rmdir(String(e.absolute),l=>this[G](l??null,e,i))}if(e.absolute===this.cwd)return this[G](null,e,i);ll(String(e.absolute),l=>this[G](l??null,e,i))})};this[Bt]?n():r()}[G](e,t,i){if(e){this[T](e,t),i();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Mr](t,i);case"Link":return this[ao](t,i);case"SymbolicLink":return this[oo](t,i);case"Directory":case"GNUDumpDir":return this[Lr](t,i)}}[Zi](e,t,i,r){m.default[i](t,String(e.absolute),n=>{n?this[T](n,e):(this[ut](),e.resume()),r()})}};k.Unpack=Yi;var Lt=s=>{try{return[null,s()]}catch(e){return[e,null]}},Ir=class extends Yi{sync=!0;[G](e,t){return super[G](e,t,()=>{})}[Pr](e){if(!this[Bt]){let n=this[Pe](this.cwd,this.dmode);if(n)return this[T](n,e);this[Bt]=!0}if(e.absolute!==this.cwd){let n=(0,U.normalizeWindowsPath)(g.default.dirname(String(e.absolute)));if(n!==this.cwd){let o=this[Pe](n,this.dmode);if(o)return this[T](o,e)}}let[t,i]=Lt(()=>m.default.lstatSync(String(e.absolute)));if(i&&(this.keep||this.newer&&i.mtime>(e.mtime??i.mtime)))return this[Ar](e);if(t||this[Nr](e,i))return this[G](null,e);if(i.isDirectory()){if(e.type==="Directory"){let o=this.chmod&&e.mode&&(i.mode&4095)!==e.mode,[a]=o?Lt(()=>{m.default.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[G](a,e)}let[n]=Lt(()=>m.default.rmdirSync(String(e.absolute)));this[G](n,e)}let[r]=e.absolute===this.cwd?[]:Lt(()=>cl(String(e.absolute)));this[G](r,e)}[Mr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,r=a=>{let h;try{m.default.closeSync(n)}catch(l){h=l}(a||h)&&this[T](a||h,e),t()},n;try{n=m.default.openSync(String(e.absolute),(0,po.getWriteFlag)(e.size),i)}catch(a){return r(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[T](a,e)),e.pipe(o)),o.on("data",a=>{try{m.default.writeSync(n,a,0,a.length)}catch(h){r(h)}}),o.on("end",()=>{let a=null;if(e.mtime&&!this.noMtime){let h=e.atime||new Date,l=e.mtime;try{m.default.futimesSync(n,h,l)}catch(c){try{m.default.utimesSync(String(e.absolute),h,l)}catch{a=c}}}if(this[It](e)){let h=this[Ft](e),l=this[Ct](e);try{m.default.fchownSync(n,Number(h),Number(l))}catch(c){try{m.default.chownSync(String(e.absolute),Number(h),Number(l))}catch{a=a||c}}}r(a)})}[Lr](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode,r=this[Pe](String(e.absolute),i);if(r){this[T](r,e),t();return}if(e.mtime&&!this.noMtime)try{m.default.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[It](e))try{m.default.chownSync(String(e.absolute),Number(this[Ft](e)),Number(this[Ct](e)))}catch{}t(),e.resume()}[Pe](e,t){try{return(0,_o.mkdirSync)((0,U.normalizeWindowsPath)(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t})}catch(i){return i}}[At](e,t,i,r,n){if(this.preservePaths||i.length===0)return r();let o=t;for(let a of i){o=g.default.resolve(o,a);let[h,l]=Lt(()=>m.default.lstatSync(o));if(h)return r();if(l.isSymbolicLink())return n(new wo.SymlinkError(o,g.default.resolve(t,i.join("/"))))}r()}[Zi](e,t,i,r){let n=`${i}Sync`;try{m.default[n](t,String(e.absolute)),r(),e.resume()}catch(o){return this[T](o,e)}}};k.UnpackSync=Ir});var Br=d(Z=>{"use strict";var ul=Z&&Z.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),fl=Z&&Z.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),dl=Z&&Z.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r{let e=new Ki.UnpackSync(s),t=s.file,i=Eo.default.statSync(t),r=s.maxReadSize||16*1024*1024;new yo.ReadStreamSync(t,{readSize:r,size:i.size}).pipe(e)},yl=(s,e)=>{let t=new Ki.Unpack(s),i=s.maxReadSize||16*1024*1024,r=s.file;return new Promise((o,a)=>{t.on("error",a),t.on("close",o),Eo.default.stat(r,(h,l)=>{if(h)a(h);else{let c=new yo.ReadStream(r,{readSize:i,size:l.size});c.on("error",a),c.pipe(t)}})})};Z.extract=(0,_l.makeCommand)(wl,yl,s=>new Ki.UnpackSync(s),s=>new Ki.Unpack(s),(s,e)=>{e?.length&&(0,pl.filesFilter)(s,e)})});var Vi=d(ft=>{"use strict";var bo=ft&&ft.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ft,"__esModule",{value:!0});ft.replace=void 0;var So=Ke(),q=bo(require("node:fs")),go=bo(require("node:path")),Ro=et(),Oo=rt(),El=Ve(),bl=Qt(),vo=Ci(),Sl=(s,e)=>{let t=new vo.PackSync(s),i=!0,r,n;try{try{r=q.default.openSync(s.file,"r+")}catch(h){if(h?.code==="ENOENT")r=q.default.openSync(s.file,"w+");else throw h}let o=q.default.fstatSync(r),a=Buffer.alloc(512);e:for(n=0;no.size)break;n+=l,s.mtimeCache&&h.mtime&&s.mtimeCache.set(String(h.path),h.mtime)}i=!1,gl(s,t,n,r,e)}finally{if(i)try{q.default.closeSync(r)}catch{}}},gl=(s,e,t,i,r)=>{let n=new So.WriteStreamSync(s.file,{fd:i,start:t});e.pipe(n),Ol(e,r)},Rl=(s,e)=>{e=Array.from(e);let t=new vo.Pack(s),i=(n,o,a)=>{let h=(D,A)=>{D?q.default.close(n,w=>a(D)):a(null,A)},l=0;if(o===0)return h(null,0);let c=0,u=Buffer.alloc(512),b=(D,A)=>{if(D||A===void 0)return h(D);if(c+=A,c<512&&A)return q.default.read(n,u,c,u.length-c,l+c,b);if(l===0&&u[0]===31&&u[1]===139)return h(new Error("cannot append to compressed archives"));if(c<512)return h(null,l);let w=new Ro.Header(u);if(!w.cksumValid)return h(null,l);let P=512*Math.ceil((w.size??0)/512);if(l+P+512>o||(l+=P+512,l>=o))return h(null,l);s.mtimeCache&&w.mtime&&s.mtimeCache.set(String(w.path),w.mtime),c=0,q.default.read(n,u,0,512,l,b)};q.default.read(n,u,0,512,l,b)};return new Promise((n,o)=>{t.on("error",o);let a="r+",h=(l,c)=>{if(l&&l.code==="ENOENT"&&a==="r+")return a="w+",q.default.open(s.file,a,h);if(l||!c)return o(l);q.default.fstat(c,(u,b)=>{if(u)return q.default.close(c,()=>o(u));i(c,b.size,(D,A)=>{if(D)return o(D);let w=new So.WriteStream(s.file,{fd:c,start:A});t.pipe(w),w.on("error",o),w.on("close",n),vl(t,e)})})};q.default.open(s.file,a,h)})},Ol=(s,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,Oo.list)({file:go.default.resolve(s.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>s.add(i)}):s.add(t)}),s.end()},vl=async(s,e)=>{for(let t of e)t.charAt(0)==="@"?await(0,Oo.list)({file:go.default.resolve(String(s.cwd),t.slice(1)),noResume:!0,onReadEntry:i=>s.add(i)}):s.add(t);s.end()};ft.replace=(0,El.makeCommand)(Sl,Rl,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(s,e)=>{if(!(0,bl.isFile)(s))throw new TypeError("file is required");if(s.gzip||s.brotli||s.zstd||s.file.endsWith(".br")||s.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e?.length)throw new TypeError("no paths specified to add/replace")})});var zr=d($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.update=void 0;var Tl=Ve(),kt=Vi();$i.update=(0,Tl.makeCommand)(kt.replace.syncFile,kt.replace.asyncFile,kt.replace.syncNoFile,kt.replace.asyncNoFile,(s,e=[])=>{kt.replace.validate?.(s,e),Dl(s)});var Dl=s=>{let e=s.filter;s.mtimeCache||(s.mtimeCache=new Map),s.filter=e?(t,i)=>e(t,i)&&!((s.mtimeCache?.get(t)??i.mtime??0)>(i.mtime??0)):(t,i)=>!((s.mtimeCache?.get(t)??i.mtime??0)>(i.mtime??0))}});var To=exports&&exports.__createBinding||(Object.create?(function(s,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,i,r)}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]})),Pl=exports&&exports.__setModuleDefault||(Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e}),Y=exports&&exports.__exportStar||function(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&To(e,s,t)},Nl=exports&&exports.__importStar||(function(){var s=function(e){return s=Object.getOwnPropertyNames||function(t){var i=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[i.length]=r);return i},s(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=s(e),r=0;r list of targets it depends on. + edges = {} + + # Queue of targets to visit. + targets_to_visit = target_list[:] + + while len(targets_to_visit) > 0: + target = targets_to_visit.pop() + if target in edges: + continue + edges[target] = [] + + for dep in target_dicts[target].get("dependencies", []): + edges[target].append(dep) + targets_to_visit.append(dep) + + try: + filepath = params["generator_flags"]["output_dir"] + except KeyError: + filepath = "." + filename = os.path.join(filepath, "dump.json") + f = open(filename, "w") + json.dump(edges, f) + f.close() + print("Wrote json to %s." % filename) diff --git a/.pnpm-store/v11/files/35/181c7aa2b235093ac082b41033772f4373b8cb1a3c316397591a8882ff6d63d4c5de0fa3b016033eb718e52dee698f220167e709d6cead5e4a8321b416fe2c b/.pnpm-store/v11/files/35/181c7aa2b235093ac082b41033772f4373b8cb1a3c316397591a8882ff6d63d4c5de0fa3b016033eb718e52dee698f220167e709d6cead5e4a8321b416fe2c new file mode 100644 index 0000000000..70c81ae8ca --- /dev/null +++ b/.pnpm-store/v11/files/35/181c7aa2b235093ac082b41033772f4373b8cb1a3c316397591a8882ff6d63d4c5de0fa3b016033eb718e52dee698f220167e709d6cead5e4a8321b416fe2c @@ -0,0 +1,260 @@ +#!/usr/bin/env python3 +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""gyptest.py -- test runner for GYP tests.""" + +import argparse +import os +import platform +import subprocess +import sys +import time + + +def is_test_name(f): + return f.startswith("gyptest") and f.endswith(".py") + + +def find_all_gyptest_files(directory): + result = [] + for root, dirs, files in os.walk(directory): + result.extend([os.path.join(root, f) for f in files if is_test_name(f)]) + result.sort() + return result + + +def main(argv=None): + if argv is None: + argv = sys.argv + + parser = argparse.ArgumentParser() + parser.add_argument("-a", "--all", action="store_true", help="run all tests") + parser.add_argument("-C", "--chdir", action="store", help="change to directory") + parser.add_argument( + "-f", + "--format", + action="store", + default="", + help="run tests with the specified formats", + ) + parser.add_argument( + "-G", + "--gyp_option", + action="append", + default=[], + help="Add -G options to the gyp command line", + ) + parser.add_argument( + "-l", "--list", action="store_true", help="list available tests and exit" + ) + parser.add_argument( + "-n", + "--no-exec", + action="store_true", + help="no execute, just print the command line", + ) + parser.add_argument( + "--path", action="append", default=[], help="additional $PATH directory" + ) + parser.add_argument( + "-q", + "--quiet", + action="store_true", + help="quiet, don't print anything unless there are failures", + ) + parser.add_argument( + "-v", + "--verbose", + action="store_true", + help="print configuration info and test results.", + ) + parser.add_argument("tests", nargs="*") + args = parser.parse_args(argv[1:]) + + if args.chdir: + os.chdir(args.chdir) + + if args.path: + extra_path = [os.path.abspath(p) for p in args.path] + extra_path = os.pathsep.join(extra_path) + os.environ["PATH"] = extra_path + os.pathsep + os.environ["PATH"] + + if not args.tests: + if not args.all: + sys.stderr.write("Specify -a to get all tests.\n") + return 1 + args.tests = ["test"] + + tests = [] + for arg in args.tests: + if os.path.isdir(arg): + tests.extend(find_all_gyptest_files(os.path.normpath(arg))) + else: + if not is_test_name(os.path.basename(arg)): + print(arg, "is not a valid gyp test name.", file=sys.stderr) + sys.exit(1) + tests.append(arg) + + if args.list: + for test in tests: + print(test) + sys.exit(0) + + os.environ["PYTHONPATH"] = os.path.abspath("test/lib") + + if args.verbose: + print_configuration_info() + + if args.gyp_option and not args.quiet: + print("Extra Gyp options: %s\n" % args.gyp_option) + + if args.format: + format_list = args.format.split(",") + else: + format_list = { + "aix5": ["make"], + "os400": ["make"], + "freebsd7": ["make"], + "freebsd8": ["make"], + "openbsd5": ["make"], + "cygwin": ["msvs"], + "win32": ["msvs", "ninja"], + "linux": ["make", "ninja"], + "linux2": ["make", "ninja"], + "linux3": ["make", "ninja"], + # TODO: Re-enable xcode-ninja. + # https://bugs.chromium.org/p/gyp/issues/detail?id=530 + # 'darwin': ['make', 'ninja', 'xcode', 'xcode-ninja'], + "darwin": ["make", "ninja", "xcode"], + }[sys.platform] + + gyp_options = [] + for option in args.gyp_option: + gyp_options += ["-G", option] + + runner = Runner(format_list, tests, gyp_options, args.verbose) + runner.run() + + if not args.quiet: + runner.print_results() + + return 1 if runner.failures else 0 + + +def print_configuration_info(): + print("Test configuration:") + if sys.platform == "darwin": + sys.path.append(os.path.abspath("test/lib")) + import TestMac # noqa: PLC0415 + + print(f" Mac {platform.mac_ver()[0]} {platform.mac_ver()[2]}") + print(f" Xcode {TestMac.Xcode.Version()}") + elif sys.platform == "win32": + sys.path.append(os.path.abspath("pylib")) + import gyp.MSVSVersion # noqa: PLC0415 + + print(" Win %s %s\n" % platform.win32_ver()[0:2]) + print(" MSVS %s" % gyp.MSVSVersion.SelectVisualStudioVersion().Description()) + elif sys.platform in ("linux", "linux2"): + print(" Linux %s" % " ".join(platform.linux_distribution())) + print(f" Python {platform.python_version()}") + print(f" PYTHONPATH={os.environ['PYTHONPATH']}") + print() + + +class Runner: + def __init__(self, formats, tests, gyp_options, verbose): + self.formats = formats + self.tests = tests + self.verbose = verbose + self.gyp_options = gyp_options + self.failures = [] + self.num_tests = len(formats) * len(tests) + num_digits = len(str(self.num_tests)) + self.fmt_str = "[%%%dd/%%%dd] (%%s) %%s" % (num_digits, num_digits) + self.isatty = sys.stdout.isatty() and not self.verbose + self.env = os.environ.copy() + self.hpos = 0 + + def run(self): + run_start = time.time() + + i = 1 + for fmt in self.formats: + for test in self.tests: + self.run_test(test, fmt, i) + i += 1 + + if self.isatty: + self.erase_current_line() + + self.took = time.time() - run_start + + def run_test(self, test, fmt, i): + if self.isatty: + self.erase_current_line() + + msg = self.fmt_str % (i, self.num_tests, fmt, test) + self.print_(msg) + + start = time.time() + cmd = [sys.executable, test] + self.gyp_options + self.env["TESTGYP_FORMAT"] = fmt + proc = subprocess.Popen( + cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=self.env + ) + proc.wait() + took = time.time() - start + + stdout = proc.stdout.read().decode("utf8") + if proc.returncode == 2: + res = "skipped" + elif proc.returncode: + res = "failed" + self.failures.append(f"({test}) {fmt}") + else: + res = "passed" + res_msg = f" {res} {took:.3f}s" + self.print_(res_msg) + + if stdout and not stdout.endswith(("PASSED\n", "NO RESULT\n")): + print() + print("\n".join(f" {line}" for line in stdout.splitlines())) + elif not self.isatty: + print() + + def print_(self, msg): + print(msg, end="") + index = msg.rfind("\n") + if index == -1: + self.hpos += len(msg) + else: + self.hpos = len(msg) - index + sys.stdout.flush() + + def erase_current_line(self): + print("\b" * self.hpos + " " * self.hpos + "\b" * self.hpos, end="") + sys.stdout.flush() + self.hpos = 0 + + def print_results(self): + num_failures = len(self.failures) + if num_failures: + print() + if num_failures == 1: + print("Failed the following test:") + else: + print("Failed the following %d tests:" % num_failures) + print("\t" + "\n\t".join(sorted(self.failures))) + print() + print( + "Ran %d tests in %.3fs, %d failed." + % (self.num_tests, self.took, num_failures) + ) + print() + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/.pnpm-store/v11/files/35/83cdc64bfef7e3cf7c19cdc791939d567596aac78b43dd1ab30dc8905d007f5071a43e8efa099886b884beee0edeed7c0a2af5e04c91ff3b350fdc7a0cebbf b/.pnpm-store/v11/files/35/83cdc64bfef7e3cf7c19cdc791939d567596aac78b43dd1ab30dc8905d007f5071a43e8efa099886b884beee0edeed7c0a2af5e04c91ff3b350fdc7a0cebbf new file mode 100644 index 0000000000..5b0eaec8cc --- /dev/null +++ b/.pnpm-store/v11/files/35/83cdc64bfef7e3cf7c19cdc791939d567596aac78b43dd1ab30dc8905d007f5071a43e8efa099886b884beee0edeed7c0a2af5e04c91ff3b350fdc7a0cebbf @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.normalizeUnicode = void 0; +// warning: extremely hot code path. +// This has been meticulously optimized for use +// within npm install on large package trees. +// Do not edit without careful benchmarking. +const normalizeCache = Object.create(null); +// Limit the size of this. Very low-sophistication LRU cache +const MAX = 10000; +const cache = new Set(); +const normalizeUnicode = (s) => { + if (!cache.has(s)) { + // shake out identical accents and ligatures + normalizeCache[s] = s + .normalize('NFD') + .toLocaleLowerCase('en') + .toLocaleUpperCase('en'); + } + else { + cache.delete(s); + } + cache.add(s); + const ret = normalizeCache[s]; + let i = cache.size - MAX; + // only prune when we're 10% over the max + if (i > MAX / 10) { + for (const s of cache) { + cache.delete(s); + delete normalizeCache[s]; + if (--i <= 0) + break; + } + } + return ret; +}; +exports.normalizeUnicode = normalizeUnicode; +//# sourceMappingURL=normalize-unicode.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/35/cf8d7189b251bffd5c4d1841fec011b7d21626b80d8ddecc1d0d0f5c9c79aecd8aedb26d126123ee0f6c23ef7262a8ad053338bf239c3fdf380e0b30e4ea33 b/.pnpm-store/v11/files/35/cf8d7189b251bffd5c4d1841fec011b7d21626b80d8ddecc1d0d0f5c9c79aecd8aedb26d126123ee0f6c23ef7262a8ad053338bf239c3fdf380e0b30e4ea33 new file mode 100644 index 0000000000..5a488ffce2 --- /dev/null +++ b/.pnpm-store/v11/files/35/cf8d7189b251bffd5c4d1841fec011b7d21626b80d8ddecc1d0d0f5c9c79aecd8aedb26d126123ee0f6c23ef7262a8ad053338bf239c3fdf380e0b30e4ea33 @@ -0,0 +1,480 @@ +'use strict' + +const { pipeline } = require('node:stream') +const { fetching } = require('../fetch') +const { makeRequest } = require('../fetch/request') +const { webidl } = require('../fetch/webidl') +const { EventSourceStream } = require('./eventsource-stream') +const { parseMIMEType } = require('../fetch/data-url') +const { createFastMessageEvent } = require('../websocket/events') +const { isNetworkError } = require('../fetch/response') +const { delay } = require('./util') +const { kEnumerableProperty } = require('../../core/util') +const { environmentSettingsObject } = require('../fetch/util') + +let experimentalWarned = false + +/** + * A reconnection time, in milliseconds. This must initially be an implementation-defined value, + * probably in the region of a few seconds. + * + * In Comparison: + * - Chrome uses 3000ms. + * - Deno uses 5000ms. + * + * @type {3000} + */ +const defaultReconnectionTime = 3000 + +/** + * The readyState attribute represents the state of the connection. + * @enum + * @readonly + * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource-readystate-dev + */ + +/** + * The connection has not yet been established, or it was closed and the user + * agent is reconnecting. + * @type {0} + */ +const CONNECTING = 0 + +/** + * The user agent has an open connection and is dispatching events as it + * receives them. + * @type {1} + */ +const OPEN = 1 + +/** + * The connection is not open, and the user agent is not trying to reconnect. + * @type {2} + */ +const CLOSED = 2 + +/** + * Requests for the element will have their mode set to "cors" and their credentials mode set to "same-origin". + * @type {'anonymous'} + */ +const ANONYMOUS = 'anonymous' + +/** + * Requests for the element will have their mode set to "cors" and their credentials mode set to "include". + * @type {'use-credentials'} + */ +const USE_CREDENTIALS = 'use-credentials' + +/** + * The EventSource interface is used to receive server-sent events. It + * connects to a server over HTTP and receives events in text/event-stream + * format without closing the connection. + * @extends {EventTarget} + * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events + * @api public + */ +class EventSource extends EventTarget { + #events = { + open: null, + error: null, + message: null + } + + #url = null + #withCredentials = false + + #readyState = CONNECTING + + #request = null + #controller = null + + #dispatcher + + /** + * @type {import('./eventsource-stream').eventSourceSettings} + */ + #state + + /** + * Creates a new EventSource object. + * @param {string} url + * @param {EventSourceInit} [eventSourceInitDict] + * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface + */ + constructor (url, eventSourceInitDict = {}) { + // 1. Let ev be a new EventSource object. + super() + + webidl.util.markAsUncloneable(this) + + const prefix = 'EventSource constructor' + webidl.argumentLengthCheck(arguments, 1, prefix) + + if (!experimentalWarned) { + experimentalWarned = true + process.emitWarning('EventSource is experimental, expect them to change at any time.', { + code: 'UNDICI-ES' + }) + } + + url = webidl.converters.USVString(url, prefix, 'url') + eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, 'eventSourceInitDict') + + this.#dispatcher = eventSourceInitDict.dispatcher + this.#state = { + lastEventId: '', + reconnectionTime: defaultReconnectionTime + } + + // 2. Let settings be ev's relevant settings object. + // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object + const settings = environmentSettingsObject + + let urlRecord + + try { + // 3. Let urlRecord be the result of encoding-parsing a URL given url, relative to settings. + urlRecord = new URL(url, settings.settingsObject.baseUrl) + this.#state.origin = urlRecord.origin + } catch (e) { + // 4. If urlRecord is failure, then throw a "SyntaxError" DOMException. + throw new DOMException(e, 'SyntaxError') + } + + // 5. Set ev's url to urlRecord. + this.#url = urlRecord.href + + // 6. Let corsAttributeState be Anonymous. + let corsAttributeState = ANONYMOUS + + // 7. If the value of eventSourceInitDict's withCredentials member is true, + // then set corsAttributeState to Use Credentials and set ev's + // withCredentials attribute to true. + if (eventSourceInitDict.withCredentials) { + corsAttributeState = USE_CREDENTIALS + this.#withCredentials = true + } + + // 8. Let request be the result of creating a potential-CORS request given + // urlRecord, the empty string, and corsAttributeState. + const initRequest = { + redirect: 'follow', + keepalive: true, + // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes + mode: 'cors', + credentials: corsAttributeState === 'anonymous' + ? 'same-origin' + : 'omit', + referrer: 'no-referrer' + } + + // 9. Set request's client to settings. + initRequest.client = environmentSettingsObject.settingsObject + + // 10. User agents may set (`Accept`, `text/event-stream`) in request's header list. + initRequest.headersList = [['accept', { name: 'accept', value: 'text/event-stream' }]] + + // 11. Set request's cache mode to "no-store". + initRequest.cache = 'no-store' + + // 12. Set request's initiator type to "other". + initRequest.initiator = 'other' + + initRequest.urlList = [new URL(this.#url)] + + // 13. Set ev's request to request. + this.#request = makeRequest(initRequest) + + this.#connect() + } + + /** + * Returns the state of this EventSource object's connection. It can have the + * values described below. + * @returns {0|1|2} + * @readonly + */ + get readyState () { + return this.#readyState + } + + /** + * Returns the URL providing the event stream. + * @readonly + * @returns {string} + */ + get url () { + return this.#url + } + + /** + * Returns a boolean indicating whether the EventSource object was + * instantiated with CORS credentials set (true), or not (false, the default). + */ + get withCredentials () { + return this.#withCredentials + } + + #connect () { + if (this.#readyState === CLOSED) return + + this.#readyState = CONNECTING + + const fetchParams = { + request: this.#request, + dispatcher: this.#dispatcher + } + + // 14. Let processEventSourceEndOfBody given response res be the following step: if res is not a network error, then reestablish the connection. + const processEventSourceEndOfBody = (response) => { + if (isNetworkError(response)) { + this.dispatchEvent(new Event('error')) + this.close() + } + + this.#reconnect() + } + + // 15. Fetch request, with processResponseEndOfBody set to processEventSourceEndOfBody... + fetchParams.processResponseEndOfBody = processEventSourceEndOfBody + + // and processResponse set to the following steps given response res: + fetchParams.processResponse = (response) => { + // 1. If res is an aborted network error, then fail the connection. + + if (isNetworkError(response)) { + // 1. When a user agent is to fail the connection, the user agent + // must queue a task which, if the readyState attribute is set to a + // value other than CLOSED, sets the readyState attribute to CLOSED + // and fires an event named error at the EventSource object. Once the + // user agent has failed the connection, it does not attempt to + // reconnect. + if (response.aborted) { + this.close() + this.dispatchEvent(new Event('error')) + return + // 2. Otherwise, if res is a network error, then reestablish the + // connection, unless the user agent knows that to be futile, in + // which case the user agent may fail the connection. + } else { + this.#reconnect() + return + } + } + + // 3. Otherwise, if res's status is not 200, or if res's `Content-Type` + // is not `text/event-stream`, then fail the connection. + const contentType = response.headersList.get('content-type', true) + const mimeType = contentType !== null ? parseMIMEType(contentType) : 'failure' + const contentTypeValid = mimeType !== 'failure' && mimeType.essence === 'text/event-stream' + if ( + response.status !== 200 || + contentTypeValid === false + ) { + this.close() + this.dispatchEvent(new Event('error')) + return + } + + // 4. Otherwise, announce the connection and interpret res's body + // line by line. + + // When a user agent is to announce the connection, the user agent + // must queue a task which, if the readyState attribute is set to a + // value other than CLOSED, sets the readyState attribute to OPEN + // and fires an event named open at the EventSource object. + // @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model + this.#readyState = OPEN + this.dispatchEvent(new Event('open')) + + // If redirected to a different origin, set the origin to the new origin. + this.#state.origin = response.urlList[response.urlList.length - 1].origin + + const eventSourceStream = new EventSourceStream({ + eventSourceSettings: this.#state, + push: (event) => { + this.dispatchEvent(createFastMessageEvent( + event.type, + event.options + )) + } + }) + + pipeline(response.body.stream, + eventSourceStream, + (error) => { + if ( + error?.aborted === false + ) { + this.close() + this.dispatchEvent(new Event('error')) + } + }) + } + + this.#controller = fetching(fetchParams) + } + + /** + * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model + * @returns {Promise} + */ + async #reconnect () { + // When a user agent is to reestablish the connection, the user agent must + // run the following steps. These steps are run in parallel, not as part of + // a task. (The tasks that it queues, of course, are run like normal tasks + // and not themselves in parallel.) + + // 1. Queue a task to run the following steps: + + // 1. If the readyState attribute is set to CLOSED, abort the task. + if (this.#readyState === CLOSED) return + + // 2. Set the readyState attribute to CONNECTING. + this.#readyState = CONNECTING + + // 3. Fire an event named error at the EventSource object. + this.dispatchEvent(new Event('error')) + + // 2. Wait a delay equal to the reconnection time of the event source. + await delay(this.#state.reconnectionTime) + + // 5. Queue a task to run the following steps: + + // 1. If the EventSource object's readyState attribute is not set to + // CONNECTING, then return. + if (this.#readyState !== CONNECTING) return + + // 2. Let request be the EventSource object's request. + // 3. If the EventSource object's last event ID string is not the empty + // string, then: + // 1. Let lastEventIDValue be the EventSource object's last event ID + // string, encoded as UTF-8. + // 2. Set (`Last-Event-ID`, lastEventIDValue) in request's header + // list. + if (this.#state.lastEventId.length) { + this.#request.headersList.set('last-event-id', this.#state.lastEventId, true) + } + + // 4. Fetch request and process the response obtained in this fashion, if any, as described earlier in this section. + this.#connect() + } + + /** + * Closes the connection, if any, and sets the readyState attribute to + * CLOSED. + */ + close () { + webidl.brandCheck(this, EventSource) + + if (this.#readyState === CLOSED) return + this.#readyState = CLOSED + this.#controller.abort() + this.#request = null + } + + get onopen () { + return this.#events.open + } + + set onopen (fn) { + if (this.#events.open) { + this.removeEventListener('open', this.#events.open) + } + + if (typeof fn === 'function') { + this.#events.open = fn + this.addEventListener('open', fn) + } else { + this.#events.open = null + } + } + + get onmessage () { + return this.#events.message + } + + set onmessage (fn) { + if (this.#events.message) { + this.removeEventListener('message', this.#events.message) + } + + if (typeof fn === 'function') { + this.#events.message = fn + this.addEventListener('message', fn) + } else { + this.#events.message = null + } + } + + get onerror () { + return this.#events.error + } + + set onerror (fn) { + if (this.#events.error) { + this.removeEventListener('error', this.#events.error) + } + + if (typeof fn === 'function') { + this.#events.error = fn + this.addEventListener('error', fn) + } else { + this.#events.error = null + } + } +} + +const constantsPropertyDescriptors = { + CONNECTING: { + __proto__: null, + configurable: false, + enumerable: true, + value: CONNECTING, + writable: false + }, + OPEN: { + __proto__: null, + configurable: false, + enumerable: true, + value: OPEN, + writable: false + }, + CLOSED: { + __proto__: null, + configurable: false, + enumerable: true, + value: CLOSED, + writable: false + } +} + +Object.defineProperties(EventSource, constantsPropertyDescriptors) +Object.defineProperties(EventSource.prototype, constantsPropertyDescriptors) + +Object.defineProperties(EventSource.prototype, { + close: kEnumerableProperty, + onerror: kEnumerableProperty, + onmessage: kEnumerableProperty, + onopen: kEnumerableProperty, + readyState: kEnumerableProperty, + url: kEnumerableProperty, + withCredentials: kEnumerableProperty +}) + +webidl.converters.EventSourceInitDict = webidl.dictionaryConverter([ + { + key: 'withCredentials', + converter: webidl.converters.boolean, + defaultValue: () => false + }, + { + key: 'dispatcher', // undici only + converter: webidl.converters.any + } +]) + +module.exports = { + EventSource, + defaultReconnectionTime +} diff --git a/.pnpm-store/v11/files/36/2488cca8a13707ad11104fde085e97f57fe76726f2c75d0ecd4967a6868b1b320bd60656b14500554ad281e005d6869283388b8630e1086b03f8193928df53 b/.pnpm-store/v11/files/36/2488cca8a13707ad11104fde085e97f57fe76726f2c75d0ecd4967a6868b1b320bd60656b14500554ad281e005d6869283388b8630e1086b03f8193928df53 new file mode 100644 index 0000000000..fba2266dd7 --- /dev/null +++ b/.pnpm-store/v11/files/36/2488cca8a13707ad11104fde085e97f57fe76726f2c75d0ecd4967a6868b1b320bd60656b14500554ad281e005d6869283388b8630e1086b03f8193928df53 @@ -0,0 +1,220 @@ +'use strict' + +const assert = require('node:assert') +const { finished, PassThrough } = require('node:stream') +const { InvalidArgumentError, InvalidReturnValueError } = require('../core/errors') +const util = require('../core/util') +const { getResolveErrorBodyCallback } = require('./util') +const { AsyncResource } = require('node:async_hooks') +const { addSignal, removeSignal } = require('./abort-signal') + +class StreamHandler extends AsyncResource { + constructor (opts, factory, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts + + try { + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('invalid factory') + } + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } + + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } + + super('UNDICI_STREAM') + } catch (err) { + if (util.isStream(body)) { + util.destroy(body.on('error', util.nop), err) + } + throw err + } + + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.factory = factory + this.callback = callback + this.res = null + this.abort = null + this.context = null + this.trailers = null + this.body = body + this.onInfo = onInfo || null + this.throwOnError = throwOnError || false + + if (util.isStream(body)) { + body.on('error', (err) => { + this.onError(err) + }) + } + + addSignal(this, signal) + } + + onConnect (abort, context) { + if (this.reason) { + abort(this.reason) + return + } + + assert(this.callback) + + this.abort = abort + this.context = context + } + + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const { factory, opaque, context, callback, responseHeaders } = this + + const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }) + } + return + } + + this.factory = null + + let res + + if (this.throwOnError && statusCode >= 400) { + const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers + const contentType = parsedHeaders['content-type'] + res = new PassThrough() + + this.callback = null + this.runInAsyncScope(getResolveErrorBodyCallback, null, + { callback, body: res, contentType, statusCode, statusMessage, headers } + ) + } else { + if (factory === null) { + return + } + + res = this.runInAsyncScope(factory, null, { + statusCode, + headers, + opaque, + context + }) + + if ( + !res || + typeof res.write !== 'function' || + typeof res.end !== 'function' || + typeof res.on !== 'function' + ) { + throw new InvalidReturnValueError('expected Writable') + } + + // TODO: Avoid finished. It registers an unnecessary amount of listeners. + finished(res, { readable: false }, (err) => { + const { callback, res, opaque, trailers, abort } = this + + this.res = null + if (err || !res.readable) { + util.destroy(res, err) + } + + this.callback = null + this.runInAsyncScope(callback, null, err || null, { opaque, trailers }) + + if (err) { + abort() + } + }) + } + + res.on('drain', resume) + + this.res = res + + const needDrain = res.writableNeedDrain !== undefined + ? res.writableNeedDrain + : res._writableState?.needDrain + + return needDrain !== true + } + + onData (chunk) { + const { res } = this + + return res ? res.write(chunk) : true + } + + onComplete (trailers) { + const { res } = this + + removeSignal(this) + + if (!res) { + return + } + + this.trailers = util.parseHeaders(trailers) + + res.end() + } + + onError (err) { + const { res, callback, opaque, body } = this + + removeSignal(this) + + this.factory = null + + if (res) { + this.res = null + util.destroy(res, err) + } else if (callback) { + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + + if (body) { + this.body = null + util.destroy(body, err) + } + } +} + +function stream (opts, factory, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + stream.call(this, opts, factory, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + this.dispatch(opts, new StreamHandler(opts, factory, callback)) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts?.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = stream diff --git a/.pnpm-store/v11/files/36/de2460ecef6373584d9278e2973030d8340e12da7e43c3e80526cbf9171aec9b84d553149eb706f603ce72d65d94d9bcbd5c79dc394692d02edd80c3fa0e1f b/.pnpm-store/v11/files/36/de2460ecef6373584d9278e2973030d8340e12da7e43c3e80526cbf9171aec9b84d553149eb706f603ce72d65d94d9bcbd5c79dc394692d02edd80c3fa0e1f new file mode 100644 index 0000000000..40e34071e4 --- /dev/null +++ b/.pnpm-store/v11/files/36/de2460ecef6373584d9278e2973030d8340e12da7e43c3e80526cbf9171aec9b84d553149eb706f603ce72d65d94d9bcbd5c79dc394692d02edd80c3fa0e1f @@ -0,0 +1,25 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var delay_base_1 = require("../delay.base"); +var AlwaysDelay = /** @class */ (function (_super) { + __extends(AlwaysDelay, _super); + function AlwaysDelay() { + return _super !== null && _super.apply(this, arguments) || this; + } + return AlwaysDelay; +}(delay_base_1.Delay)); +exports.AlwaysDelay = AlwaysDelay; +//# sourceMappingURL=always.delay.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/38/1513423700217c2a5ac451a6e33ec7c204829123d622a399b4771727fdb99652a9bfe1c998979fd3617df4141c3b445414a5692da1b84469ecca98d8e2cf73 b/.pnpm-store/v11/files/38/1513423700217c2a5ac451a6e33ec7c204829123d622a399b4771727fdb99652a9bfe1c998979fd3617df4141c3b445414a5692da1b84469ecca98d8e2cf73 new file mode 100644 index 0000000000..cc19ac1a2e --- /dev/null +++ b/.pnpm-store/v11/files/38/1513423700217c2a5ac451a6e33ec7c204829123d622a399b4771727fdb99652a9bfe1c998979fd3617df4141c3b445414a5692da1b84469ecca98d8e2cf73 @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SymlinkError = void 0; +class SymlinkError extends Error { + path; + symlink; + syscall = 'symlink'; + code = 'TAR_SYMLINK_ERROR'; + constructor(symlink, path) { + super('TAR_SYMLINK_ERROR: Cannot extract through symbolic link'); + this.symlink = symlink; + this.path = path; + } + get name() { + return 'SymlinkError'; + } +} +exports.SymlinkError = SymlinkError; +//# sourceMappingURL=symlink-error.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/38/336788e546b7692a364789c37952c2c25874b1f2e4e98d03616d8c2b125f1fba84436bbe4863eb8bc95dd83e7649065cc1e41479d3807fded613bdf25fe3ee b/.pnpm-store/v11/files/38/336788e546b7692a364789c37952c2c25874b1f2e4e98d03616d8c2b125f1fba84436bbe4863eb8bc95dd83e7649065cc1e41479d3807fded613bdf25fe3ee new file mode 100644 index 0000000000..2b3178c526 --- /dev/null +++ b/.pnpm-store/v11/files/38/336788e546b7692a364789c37952c2c25874b1f2e4e98d03616d8c2b125f1fba84436bbe4863eb8bc95dd83e7649065cc1e41479d3807fded613bdf25fe3ee @@ -0,0 +1,430 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WriteStreamSync = exports.WriteStream = exports.ReadStreamSync = exports.ReadStream = void 0; +const events_1 = __importDefault(require("events")); +const fs_1 = __importDefault(require("fs")); +const minipass_1 = require("minipass"); +const writev = fs_1.default.writev; +const _autoClose = Symbol('_autoClose'); +const _close = Symbol('_close'); +const _ended = Symbol('_ended'); +const _fd = Symbol('_fd'); +const _finished = Symbol('_finished'); +const _flags = Symbol('_flags'); +const _flush = Symbol('_flush'); +const _handleChunk = Symbol('_handleChunk'); +const _makeBuf = Symbol('_makeBuf'); +const _mode = Symbol('_mode'); +const _needDrain = Symbol('_needDrain'); +const _onerror = Symbol('_onerror'); +const _onopen = Symbol('_onopen'); +const _onread = Symbol('_onread'); +const _onwrite = Symbol('_onwrite'); +const _open = Symbol('_open'); +const _path = Symbol('_path'); +const _pos = Symbol('_pos'); +const _queue = Symbol('_queue'); +const _read = Symbol('_read'); +const _readSize = Symbol('_readSize'); +const _reading = Symbol('_reading'); +const _remain = Symbol('_remain'); +const _size = Symbol('_size'); +const _write = Symbol('_write'); +const _writing = Symbol('_writing'); +const _defaultFlag = Symbol('_defaultFlag'); +const _errored = Symbol('_errored'); +class ReadStream extends minipass_1.Minipass { + [_errored] = false; + [_fd]; + [_path]; + [_readSize]; + [_reading] = false; + [_size]; + [_remain]; + [_autoClose]; + constructor(path, opt) { + opt = opt || {}; + super(opt); + this.readable = true; + this.writable = false; + if (typeof path !== 'string') { + throw new TypeError('path must be a string'); + } + this[_errored] = false; + this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined; + this[_path] = path; + this[_readSize] = opt.readSize || 16 * 1024 * 1024; + this[_reading] = false; + this[_size] = typeof opt.size === 'number' ? opt.size : Infinity; + this[_remain] = this[_size]; + this[_autoClose] = + typeof opt.autoClose === 'boolean' ? opt.autoClose : true; + if (typeof this[_fd] === 'number') { + this[_read](); + } + else { + this[_open](); + } + } + get fd() { + return this[_fd]; + } + get path() { + return this[_path]; + } + //@ts-ignore + write() { + throw new TypeError('this is a readable stream'); + } + //@ts-ignore + end() { + throw new TypeError('this is a readable stream'); + } + [_open]() { + fs_1.default.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd)); + } + [_onopen](er, fd) { + if (er) { + this[_onerror](er); + } + else { + this[_fd] = fd; + this.emit('open', fd); + this[_read](); + } + } + [_makeBuf]() { + return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain])); + } + [_read]() { + if (!this[_reading]) { + this[_reading] = true; + const buf = this[_makeBuf](); + /* c8 ignore start */ + if (buf.length === 0) { + return process.nextTick(() => this[_onread](null, 0, buf)); + } + /* c8 ignore stop */ + fs_1.default.read(this[_fd], buf, 0, buf.length, null, (er, br, b) => this[_onread](er, br, b)); + } + } + [_onread](er, br, buf) { + this[_reading] = false; + if (er) { + this[_onerror](er); + } + else if (this[_handleChunk](br, buf)) { + this[_read](); + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd]; + this[_fd] = undefined; + fs_1.default.close(fd, er => er ? this.emit('error', er) : this.emit('close')); + } + } + [_onerror](er) { + this[_reading] = true; + this[_close](); + this.emit('error', er); + } + [_handleChunk](br, buf) { + let ret = false; + // no effect if infinite + this[_remain] -= br; + if (br > 0) { + ret = super.write(br < buf.length ? buf.subarray(0, br) : buf); + } + if (br === 0 || this[_remain] <= 0) { + ret = false; + this[_close](); + super.end(); + } + return ret; + } + emit(ev, ...args) { + switch (ev) { + case 'prefinish': + case 'finish': + return false; + case 'drain': + if (typeof this[_fd] === 'number') { + this[_read](); + } + return false; + case 'error': + if (this[_errored]) { + return false; + } + this[_errored] = true; + return super.emit(ev, ...args); + default: + return super.emit(ev, ...args); + } + } +} +exports.ReadStream = ReadStream; +class ReadStreamSync extends ReadStream { + [_open]() { + let threw = true; + try { + this[_onopen](null, fs_1.default.openSync(this[_path], 'r')); + threw = false; + } + finally { + if (threw) { + this[_close](); + } + } + } + [_read]() { + let threw = true; + try { + if (!this[_reading]) { + this[_reading] = true; + do { + const buf = this[_makeBuf](); + /* c8 ignore start */ + const br = buf.length === 0 + ? 0 + : fs_1.default.readSync(this[_fd], buf, 0, buf.length, null); + /* c8 ignore stop */ + if (!this[_handleChunk](br, buf)) { + break; + } + } while (true); + this[_reading] = false; + } + threw = false; + } + finally { + if (threw) { + this[_close](); + } + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd]; + this[_fd] = undefined; + fs_1.default.closeSync(fd); + this.emit('close'); + } + } +} +exports.ReadStreamSync = ReadStreamSync; +class WriteStream extends events_1.default { + readable = false; + writable = true; + [_errored] = false; + [_writing] = false; + [_ended] = false; + [_queue] = []; + [_needDrain] = false; + [_path]; + [_mode]; + [_autoClose]; + [_fd]; + [_defaultFlag]; + [_flags]; + [_finished] = false; + [_pos]; + constructor(path, opt) { + opt = opt || {}; + super(opt); + this[_path] = path; + this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined; + this[_mode] = opt.mode === undefined ? 0o666 : opt.mode; + this[_pos] = typeof opt.start === 'number' ? opt.start : undefined; + this[_autoClose] = + typeof opt.autoClose === 'boolean' ? opt.autoClose : true; + // truncating makes no sense when writing into the middle + const defaultFlag = this[_pos] !== undefined ? 'r+' : 'w'; + this[_defaultFlag] = opt.flags === undefined; + this[_flags] = opt.flags === undefined ? defaultFlag : opt.flags; + if (this[_fd] === undefined) { + this[_open](); + } + } + emit(ev, ...args) { + if (ev === 'error') { + if (this[_errored]) { + return false; + } + this[_errored] = true; + } + return super.emit(ev, ...args); + } + get fd() { + return this[_fd]; + } + get path() { + return this[_path]; + } + [_onerror](er) { + this[_close](); + this[_writing] = true; + this.emit('error', er); + } + [_open]() { + fs_1.default.open(this[_path], this[_flags], this[_mode], (er, fd) => this[_onopen](er, fd)); + } + [_onopen](er, fd) { + if (this[_defaultFlag] && + this[_flags] === 'r+' && + er && + er.code === 'ENOENT') { + this[_flags] = 'w'; + this[_open](); + } + else if (er) { + this[_onerror](er); + } + else { + this[_fd] = fd; + this.emit('open', fd); + if (!this[_writing]) { + this[_flush](); + } + } + } + end(buf, enc) { + if (buf) { + //@ts-ignore + this.write(buf, enc); + } + this[_ended] = true; + // synthetic after-write logic, where drain/finish live + if (!this[_writing] && + !this[_queue].length && + typeof this[_fd] === 'number') { + this[_onwrite](null, 0); + } + return this; + } + write(buf, enc) { + if (typeof buf === 'string') { + buf = Buffer.from(buf, enc); + } + if (this[_ended]) { + this.emit('error', new Error('write() after end()')); + return false; + } + if (this[_fd] === undefined || this[_writing] || this[_queue].length) { + this[_queue].push(buf); + this[_needDrain] = true; + return false; + } + this[_writing] = true; + this[_write](buf); + return true; + } + [_write](buf) { + fs_1.default.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw)); + } + [_onwrite](er, bw) { + if (er) { + this[_onerror](er); + } + else { + if (this[_pos] !== undefined && typeof bw === 'number') { + this[_pos] += bw; + } + if (this[_queue].length) { + this[_flush](); + } + else { + this[_writing] = false; + if (this[_ended] && !this[_finished]) { + this[_finished] = true; + this[_close](); + this.emit('finish'); + } + else if (this[_needDrain]) { + this[_needDrain] = false; + this.emit('drain'); + } + } + } + } + [_flush]() { + if (this[_queue].length === 0) { + if (this[_ended]) { + this[_onwrite](null, 0); + } + } + else if (this[_queue].length === 1) { + this[_write](this[_queue].pop()); + } + else { + const iovec = this[_queue]; + this[_queue] = []; + writev(this[_fd], iovec, this[_pos], (er, bw) => this[_onwrite](er, bw)); + } + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd]; + this[_fd] = undefined; + fs_1.default.close(fd, er => er ? this.emit('error', er) : this.emit('close')); + } + } +} +exports.WriteStream = WriteStream; +class WriteStreamSync extends WriteStream { + [_open]() { + let fd; + // only wrap in a try{} block if we know we'll retry, to avoid + // the rethrow obscuring the error's source frame in most cases. + if (this[_defaultFlag] && this[_flags] === 'r+') { + try { + fd = fs_1.default.openSync(this[_path], this[_flags], this[_mode]); + } + catch (er) { + if (er?.code === 'ENOENT') { + this[_flags] = 'w'; + return this[_open](); + } + else { + throw er; + } + } + } + else { + fd = fs_1.default.openSync(this[_path], this[_flags], this[_mode]); + } + this[_onopen](null, fd); + } + [_close]() { + if (this[_autoClose] && typeof this[_fd] === 'number') { + const fd = this[_fd]; + this[_fd] = undefined; + fs_1.default.closeSync(fd); + this.emit('close'); + } + } + [_write](buf) { + // throw the original, but try to close if it fails + let threw = true; + try { + this[_onwrite](null, fs_1.default.writeSync(this[_fd], buf, 0, buf.length, this[_pos])); + threw = false; + } + finally { + if (threw) { + try { + this[_close](); + } + catch { + // ok error + } + } + } + } +} +exports.WriteStreamSync = WriteStreamSync; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/38/4e05eed0440bd6d678eacd22db09ec184457cef4b0f6c8ff4f07e941855a48c7a9d51cb5169f470daa527dc3b0e10809c0647f29a514597104bc850a604fc2 b/.pnpm-store/v11/files/38/4e05eed0440bd6d678eacd22db09ec184457cef4b0f6c8ff4f07e941855a48c7a9d51cb5169f470daa527dc3b0e10809c0647f29a514597104bc850a604fc2 new file mode 100644 index 0000000000..1b1468d4ab --- /dev/null +++ b/.pnpm-store/v11/files/38/4e05eed0440bd6d678eacd22db09ec184457cef4b0f6c8ff4f07e941855a48c7a9d51cb5169f470daa527dc3b0e10809c0647f29a514597104bc850a604fc2 @@ -0,0 +1,104 @@ +'use strict' + +const { WebsocketFrameSend } = require('./frame') +const { opcodes, sendHints } = require('./constants') +const FixedQueue = require('../../dispatcher/fixed-queue') + +/** @type {typeof Uint8Array} */ +const FastBuffer = Buffer[Symbol.species] + +/** + * @typedef {object} SendQueueNode + * @property {Promise | null} promise + * @property {((...args: any[]) => any)} callback + * @property {Buffer | null} frame + */ + +class SendQueue { + /** + * @type {FixedQueue} + */ + #queue = new FixedQueue() + + /** + * @type {boolean} + */ + #running = false + + /** @type {import('node:net').Socket} */ + #socket + + constructor (socket) { + this.#socket = socket + } + + add (item, cb, hint) { + if (hint !== sendHints.blob) { + const frame = createFrame(item, hint) + if (!this.#running) { + // fast-path + this.#socket.write(frame, cb) + } else { + /** @type {SendQueueNode} */ + const node = { + promise: null, + callback: cb, + frame + } + this.#queue.push(node) + } + return + } + + /** @type {SendQueueNode} */ + const node = { + promise: item.arrayBuffer().then((ab) => { + node.promise = null + node.frame = createFrame(ab, hint) + }), + callback: cb, + frame: null + } + + this.#queue.push(node) + + if (!this.#running) { + this.#run() + } + } + + async #run () { + this.#running = true + const queue = this.#queue + while (!queue.isEmpty()) { + const node = queue.shift() + // wait pending promise + if (node.promise !== null) { + await node.promise + } + // write + this.#socket.write(node.frame, node.callback) + // cleanup + node.callback = node.frame = null + } + this.#running = false + } +} + +function createFrame (data, hint) { + return new WebsocketFrameSend(toBuffer(data, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY) +} + +function toBuffer (data, hint) { + switch (hint) { + case sendHints.string: + return Buffer.from(data) + case sendHints.arrayBuffer: + case sendHints.blob: + return new FastBuffer(data) + case sendHints.typedArray: + return new FastBuffer(data.buffer, data.byteOffset, data.byteLength) + } +} + +module.exports = { SendQueue } diff --git a/.pnpm-store/v11/files/38/aa2b80f17d6cae7dfd0dd14b2dbb70a934592fcad1e4f6682b7e87bc551737842e40c800c6478e3d5d0b1b2fe1c6de674bcb81eb34b8c5fbacab3b387029ec b/.pnpm-store/v11/files/38/aa2b80f17d6cae7dfd0dd14b2dbb70a934592fcad1e4f6682b7e87bc551737842e40c800c6478e3d5d0b1b2fe1c6de674bcb81eb34b8c5fbacab3b387029ec new file mode 100644 index 0000000000..7e7b50baa4 --- /dev/null +++ b/.pnpm-store/v11/files/38/aa2b80f17d6cae7dfd0dd14b2dbb70a934592fcad1e4f6682b7e87bc551737842e40c800c6478e3d5d0b1b2fe1c6de674bcb81eb34b8c5fbacab3b387029ec @@ -0,0 +1,74 @@ +'use strict'; +const path = require('path'); +const os = require('os'); + +const homedir = os.homedir(); +const tmpdir = os.tmpdir(); +const {env} = process; + +const macos = name => { + const library = path.join(homedir, 'Library'); + + return { + data: path.join(library, 'Application Support', name), + config: path.join(library, 'Preferences', name), + cache: path.join(library, 'Caches', name), + log: path.join(library, 'Logs', name), + temp: path.join(tmpdir, name) + }; +}; + +const windows = name => { + const appData = env.APPDATA || path.join(homedir, 'AppData', 'Roaming'); + const localAppData = env.LOCALAPPDATA || path.join(homedir, 'AppData', 'Local'); + + return { + // Data/config/cache/log are invented by me as Windows isn't opinionated about this + data: path.join(localAppData, name, 'Data'), + config: path.join(appData, name, 'Config'), + cache: path.join(localAppData, name, 'Cache'), + log: path.join(localAppData, name, 'Log'), + temp: path.join(tmpdir, name) + }; +}; + +// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +const linux = name => { + const username = path.basename(homedir); + + return { + data: path.join(env.XDG_DATA_HOME || path.join(homedir, '.local', 'share'), name), + config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, '.config'), name), + cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, '.cache'), name), + // https://wiki.debian.org/XDGBaseDirectorySpecification#state + log: path.join(env.XDG_STATE_HOME || path.join(homedir, '.local', 'state'), name), + temp: path.join(tmpdir, username, name) + }; +}; + +const envPaths = (name, options) => { + if (typeof name !== 'string') { + throw new TypeError(`Expected string, got ${typeof name}`); + } + + options = Object.assign({suffix: 'nodejs'}, options); + + if (options.suffix) { + // Add suffix to prevent possible conflict with native apps + name += `-${options.suffix}`; + } + + if (process.platform === 'darwin') { + return macos(name); + } + + if (process.platform === 'win32') { + return windows(name); + } + + return linux(name); +}; + +module.exports = envPaths; +// TODO: Remove this for the next major release +module.exports.default = envPaths; diff --git a/.pnpm-store/v11/files/39/6815acc23dff04b2102a2b5adb55be78246fd492eaef163e07ac361a314169e5df5aca72b294bd0e5738fd27a4ad7973fc05785fe618cc6af92df16dcb2003 b/.pnpm-store/v11/files/39/6815acc23dff04b2102a2b5adb55be78246fd492eaef163e07ac361a314169e5df5aca72b294bd0e5738fd27a4ad7973fc05785fe618cc6af92df16dcb2003 new file mode 100644 index 0000000000..c15bbc37aa --- /dev/null +++ b/.pnpm-store/v11/files/39/6815acc23dff04b2102a2b5adb55be78246fd492eaef163e07ac361a314169e5df5aca72b294bd0e5738fd27a4ad7973fc05785fe618cc6af92df16dcb2003 @@ -0,0 +1,423 @@ +'use strict' + +/** + * This module offers an optimized timer implementation designed for scenarios + * where high precision is not critical. + * + * The timer achieves faster performance by using a low-resolution approach, + * with an accuracy target of within 500ms. This makes it particularly useful + * for timers with delays of 1 second or more, where exact timing is less + * crucial. + * + * It's important to note that Node.js timers are inherently imprecise, as + * delays can occur due to the event loop being blocked by other operations. + * Consequently, timers may trigger later than their scheduled time. + */ + +/** + * The fastNow variable contains the internal fast timer clock value. + * + * @type {number} + */ +let fastNow = 0 + +/** + * RESOLUTION_MS represents the target resolution time in milliseconds. + * + * @type {number} + * @default 1000 + */ +const RESOLUTION_MS = 1e3 + +/** + * TICK_MS defines the desired interval in milliseconds between each tick. + * The target value is set to half the resolution time, minus 1 ms, to account + * for potential event loop overhead. + * + * @type {number} + * @default 499 + */ +const TICK_MS = (RESOLUTION_MS >> 1) - 1 + +/** + * fastNowTimeout is a Node.js timer used to manage and process + * the FastTimers stored in the `fastTimers` array. + * + * @type {NodeJS.Timeout} + */ +let fastNowTimeout + +/** + * The kFastTimer symbol is used to identify FastTimer instances. + * + * @type {Symbol} + */ +const kFastTimer = Symbol('kFastTimer') + +/** + * The fastTimers array contains all active FastTimers. + * + * @type {FastTimer[]} + */ +const fastTimers = [] + +/** + * These constants represent the various states of a FastTimer. + */ + +/** + * The `NOT_IN_LIST` constant indicates that the FastTimer is not included + * in the `fastTimers` array. Timers with this status will not be processed + * during the next tick by the `onTick` function. + * + * A FastTimer can be re-added to the `fastTimers` array by invoking the + * `refresh` method on the FastTimer instance. + * + * @type {-2} + */ +const NOT_IN_LIST = -2 + +/** + * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled + * for removal from the `fastTimers` array. A FastTimer in this state will + * be removed in the next tick by the `onTick` function and will no longer + * be processed. + * + * This status is also set when the `clear` method is called on the FastTimer instance. + * + * @type {-1} + */ +const TO_BE_CLEARED = -1 + +/** + * The `PENDING` constant signifies that the FastTimer is awaiting processing + * in the next tick by the `onTick` function. Timers with this status will have + * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick. + * + * @type {0} + */ +const PENDING = 0 + +/** + * The `ACTIVE` constant indicates that the FastTimer is active and waiting + * for its timer to expire. During the next tick, the `onTick` function will + * check if the timer has expired, and if so, it will execute the associated callback. + * + * @type {1} + */ +const ACTIVE = 1 + +/** + * The onTick function processes the fastTimers array. + * + * @returns {void} + */ +function onTick () { + /** + * Increment the fastNow value by the TICK_MS value, despite the actual time + * that has passed since the last tick. This approach ensures independence + * from the system clock and delays caused by a blocked event loop. + * + * @type {number} + */ + fastNow += TICK_MS + + /** + * The `idx` variable is used to iterate over the `fastTimers` array. + * Expired timers are removed by replacing them with the last element in the array. + * Consequently, `idx` is only incremented when the current element is not removed. + * + * @type {number} + */ + let idx = 0 + + /** + * The len variable will contain the length of the fastTimers array + * and will be decremented when a FastTimer should be removed from the + * fastTimers array. + * + * @type {number} + */ + let len = fastTimers.length + + while (idx < len) { + /** + * @type {FastTimer} + */ + const timer = fastTimers[idx] + + // If the timer is in the ACTIVE state and the timer has expired, it will + // be processed in the next tick. + if (timer._state === PENDING) { + // Set the _idleStart value to the fastNow value minus the TICK_MS value + // to account for the time the timer was in the PENDING state. + timer._idleStart = fastNow - TICK_MS + timer._state = ACTIVE + } else if ( + timer._state === ACTIVE && + fastNow >= timer._idleStart + timer._idleTimeout + ) { + timer._state = TO_BE_CLEARED + timer._idleStart = -1 + timer._onTimeout(timer._timerArg) + } + + if (timer._state === TO_BE_CLEARED) { + timer._state = NOT_IN_LIST + + // Move the last element to the current index and decrement len if it is + // not the only element in the array. + if (--len !== 0) { + fastTimers[idx] = fastTimers[len] + } + } else { + ++idx + } + } + + // Set the length of the fastTimers array to the new length and thus + // removing the excess FastTimers elements from the array. + fastTimers.length = len + + // If there are still active FastTimers in the array, refresh the Timer. + // If there are no active FastTimers, the timer will be refreshed again + // when a new FastTimer is instantiated. + if (fastTimers.length !== 0) { + refreshTimeout() + } +} + +function refreshTimeout () { + // If the fastNowTimeout is already set, refresh it. + if (fastNowTimeout) { + fastNowTimeout.refresh() + // fastNowTimeout is not instantiated yet, create a new Timer. + } else { + clearTimeout(fastNowTimeout) + fastNowTimeout = setTimeout(onTick, TICK_MS) + + // If the Timer has an unref method, call it to allow the process to exit if + // there are no other active handles. + if (fastNowTimeout.unref) { + fastNowTimeout.unref() + } + } +} + +/** + * The `FastTimer` class is a data structure designed to store and manage + * timer information. + */ +class FastTimer { + [kFastTimer] = true + + /** + * The state of the timer, which can be one of the following: + * - NOT_IN_LIST (-2) + * - TO_BE_CLEARED (-1) + * - PENDING (0) + * - ACTIVE (1) + * + * @type {-2|-1|0|1} + * @private + */ + _state = NOT_IN_LIST + + /** + * The number of milliseconds to wait before calling the callback. + * + * @type {number} + * @private + */ + _idleTimeout = -1 + + /** + * The time in milliseconds when the timer was started. This value is used to + * calculate when the timer should expire. + * + * @type {number} + * @default -1 + * @private + */ + _idleStart = -1 + + /** + * The function to be executed when the timer expires. + * @type {Function} + * @private + */ + _onTimeout + + /** + * The argument to be passed to the callback when the timer expires. + * + * @type {*} + * @private + */ + _timerArg + + /** + * @constructor + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should wait + * before the specified function or code is executed. + * @param {*} arg + */ + constructor (callback, delay, arg) { + this._onTimeout = callback + this._idleTimeout = delay + this._timerArg = arg + + this.refresh() + } + + /** + * Sets the timer's start time to the current time, and reschedules the timer + * to call its callback at the previously specified duration adjusted to the + * current time. + * Using this on a timer that has already called its callback will reactivate + * the timer. + * + * @returns {void} + */ + refresh () { + // In the special case that the timer is not in the list of active timers, + // add it back to the array to be processed in the next tick by the onTick + // function. + if (this._state === NOT_IN_LIST) { + fastTimers.push(this) + } + + // If the timer is the only active timer, refresh the fastNowTimeout for + // better resolution. + if (!fastNowTimeout || fastTimers.length === 1) { + refreshTimeout() + } + + // Setting the state to PENDING will cause the timer to be reset in the + // next tick by the onTick function. + this._state = PENDING + } + + /** + * The `clear` method cancels the timer, preventing it from executing. + * + * @returns {void} + * @private + */ + clear () { + // Set the state to TO_BE_CLEARED to mark the timer for removal in the next + // tick by the onTick function. + this._state = TO_BE_CLEARED + + // Reset the _idleStart value to -1 to indicate that the timer is no longer + // active. + this._idleStart = -1 + } +} + +/** + * This module exports a setTimeout and clearTimeout function that can be + * used as a drop-in replacement for the native functions. + */ +module.exports = { + /** + * The setTimeout() method sets a timer which executes a function once the + * timer expires. + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should + * wait before the specified function or code is executed. + * @param {*} [arg] An optional argument to be passed to the callback function + * when the timer expires. + * @returns {NodeJS.Timeout|FastTimer} + */ + setTimeout (callback, delay, arg) { + // If the delay is less than or equal to the RESOLUTION_MS value return a + // native Node.js Timer instance. + return delay <= RESOLUTION_MS + ? setTimeout(callback, delay, arg) + : new FastTimer(callback, delay, arg) + }, + /** + * The clearTimeout method cancels an instantiated Timer previously created + * by calling setTimeout. + * + * @param {NodeJS.Timeout|FastTimer} timeout + */ + clearTimeout (timeout) { + // If the timeout is a FastTimer, call its own clear method. + if (timeout[kFastTimer]) { + /** + * @type {FastTimer} + */ + timeout.clear() + // Otherwise it is an instance of a native NodeJS.Timeout, so call the + // Node.js native clearTimeout function. + } else { + clearTimeout(timeout) + } + }, + /** + * The setFastTimeout() method sets a fastTimer which executes a function once + * the timer expires. + * @param {Function} callback A function to be executed after the timer + * expires. + * @param {number} delay The time, in milliseconds that the timer should + * wait before the specified function or code is executed. + * @param {*} [arg] An optional argument to be passed to the callback function + * when the timer expires. + * @returns {FastTimer} + */ + setFastTimeout (callback, delay, arg) { + return new FastTimer(callback, delay, arg) + }, + /** + * The clearTimeout method cancels an instantiated FastTimer previously + * created by calling setFastTimeout. + * + * @param {FastTimer} timeout + */ + clearFastTimeout (timeout) { + timeout.clear() + }, + /** + * The now method returns the value of the internal fast timer clock. + * + * @returns {number} + */ + now () { + return fastNow + }, + /** + * Trigger the onTick function to process the fastTimers array. + * Exported for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + * @param {number} [delay=0] The delay in milliseconds to add to the now value. + */ + tick (delay = 0) { + fastNow += delay - RESOLUTION_MS + 1 + onTick() + onTick() + }, + /** + * Reset FastTimers. + * Exported for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + */ + reset () { + fastNow = 0 + fastTimers.length = 0 + clearTimeout(fastNowTimeout) + fastNowTimeout = null + }, + /** + * Exporting for testing purposes only. + * Marking as deprecated to discourage any use outside of testing. + * @deprecated + */ + kFastTimer +} diff --git a/.pnpm-store/v11/files/39/b19428b34c7005a237aec51d702762bb343d7382ec2a9cc38e0d640b419d1c9ff11822e933c9b2c57be9b7cdecc667687511b36fdeada749e4682894226351 b/.pnpm-store/v11/files/39/b19428b34c7005a237aec51d702762bb343d7382ec2a9cc38e0d640b419d1c9ff11822e933c9b2c57be9b7cdecc667687511b36fdeada749e4682894226351 new file mode 100644 index 0000000000..f7bee0c6fc --- /dev/null +++ b/.pnpm-store/v11/files/39/b19428b34c7005a237aec51d702762bb343d7382ec2a9cc38e0d640b419d1c9ff11822e933c9b2c57be9b7cdecc667687511b36fdeada749e4682894226351 @@ -0,0 +1,53 @@ +module.exports = abbrev + +function abbrev (...args) { + let list = args + if (args.length === 1 && (Array.isArray(args[0]) || typeof args[0] === 'string')) { + list = [].concat(args[0]) + } + + for (let i = 0, l = list.length; i < l; i++) { + list[i] = typeof list[i] === 'string' ? list[i] : String(list[i]) + } + + // sort them lexicographically, so that they're next to their nearest kin + list = list.sort(lexSort) + + // walk through each, seeing how much it has in common with the next and previous + const abbrevs = {} + let prev = '' + for (let ii = 0, ll = list.length; ii < ll; ii++) { + const current = list[ii] + const next = list[ii + 1] || '' + let nextMatches = true + let prevMatches = true + if (current === next) { + continue + } + let j = 0 + const cl = current.length + for (; j < cl; j++) { + const curChar = current.charAt(j) + nextMatches = nextMatches && curChar === next.charAt(j) + prevMatches = prevMatches && curChar === prev.charAt(j) + if (!nextMatches && !prevMatches) { + j++ + break + } + } + prev = current + if (j === cl) { + abbrevs[current] = current + continue + } + for (let a = current.slice(0, j); j <= cl; j++) { + abbrevs[a] = current + a += current.charAt(j) + } + } + return abbrevs +} + +function lexSort (a, b) { + return a === b ? 0 : a > b ? 1 : -1 +} diff --git a/.pnpm-store/v11/files/3a/0cdd10ca3c024f271f5697a3a1447fe9c7e8fb00bd6ddf6d5f34759f9148fd2fe77eb6fffd1823d77fe43e0edccca4d8cff70146b69d45c39acf7cb6a51175 b/.pnpm-store/v11/files/3a/0cdd10ca3c024f271f5697a3a1447fe9c7e8fb00bd6ddf6d5f34759f9148fd2fe77eb6fffd1823d77fe43e0edccca4d8cff70146b69d45c39acf7cb6a51175 new file mode 100644 index 0000000000..d2e45a7627 --- /dev/null +++ b/.pnpm-store/v11/files/3a/0cdd10ca3c024f271f5697a3a1447fe9c7e8fb00bd6ddf6d5f34759f9148fd2fe77eb6fffd1823d77fe43e0edccca4d8cff70146b69d45c39acf7cb6a51175 @@ -0,0 +1,250 @@ +// Copyright 2017 - Refael Ackermann +// Distributed under MIT style license +// See accompanying file LICENSE at https://github.com/node4good/windows-autoconf + +// Usage: +// powershell -ExecutionPolicy Unrestricted -Command "Add-Type -Path Find-VisualStudio.cs; [VisualStudioConfiguration.Main]::PrintJson()" +// This script needs to be compatible with PowerShell v2 to run on Windows 2008R2 and Windows 7. + +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Collections.Generic; + +namespace VisualStudioConfiguration +{ + [Flags] + public enum InstanceState : uint + { + None = 0, + Local = 1, + Registered = 2, + NoRebootRequired = 4, + NoErrors = 8, + Complete = 4294967295, + } + + [Guid("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IEnumSetupInstances + { + + void Next([MarshalAs(UnmanagedType.U4), In] int celt, + [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface), Out] ISetupInstance[] rgelt, + [MarshalAs(UnmanagedType.U4)] out int pceltFetched); + + void Skip([MarshalAs(UnmanagedType.U4), In] int celt); + + void Reset(); + + [return: MarshalAs(UnmanagedType.Interface)] + IEnumSetupInstances Clone(); + } + + [Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ISetupConfiguration + { + } + + [Guid("26AAB78C-4A60-49D6-AF3B-3C35BC93365D")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ISetupConfiguration2 : ISetupConfiguration + { + + [return: MarshalAs(UnmanagedType.Interface)] + IEnumSetupInstances EnumInstances(); + + [return: MarshalAs(UnmanagedType.Interface)] + ISetupInstance GetInstanceForCurrentProcess(); + + [return: MarshalAs(UnmanagedType.Interface)] + ISetupInstance GetInstanceForPath([MarshalAs(UnmanagedType.LPWStr), In] string path); + + [return: MarshalAs(UnmanagedType.Interface)] + IEnumSetupInstances EnumAllInstances(); + } + + [Guid("B41463C3-8866-43B5-BC33-2B0676F7F42E")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ISetupInstance + { + } + + [Guid("89143C9A-05AF-49B0-B717-72E218A2185C")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ISetupInstance2 : ISetupInstance + { + [return: MarshalAs(UnmanagedType.BStr)] + string GetInstanceId(); + + [return: MarshalAs(UnmanagedType.Struct)] + System.Runtime.InteropServices.ComTypes.FILETIME GetInstallDate(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetInstallationName(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetInstallationPath(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetInstallationVersion(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetDisplayName([MarshalAs(UnmanagedType.U4), In] int lcid); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetDescription([MarshalAs(UnmanagedType.U4), In] int lcid); + + [return: MarshalAs(UnmanagedType.BStr)] + string ResolvePath([MarshalAs(UnmanagedType.LPWStr), In] string pwszRelativePath); + + [return: MarshalAs(UnmanagedType.U4)] + InstanceState GetState(); + + [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)] + ISetupPackageReference[] GetPackages(); + + ISetupPackageReference GetProduct(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetProductPath(); + + [return: MarshalAs(UnmanagedType.VariantBool)] + bool IsLaunchable(); + + [return: MarshalAs(UnmanagedType.VariantBool)] + bool IsComplete(); + + [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)] + ISetupPropertyStore GetProperties(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetEnginePath(); + } + + [Guid("DA8D8A16-B2B6-4487-A2F1-594CCCCD6BF5")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ISetupPackageReference + { + + [return: MarshalAs(UnmanagedType.BStr)] + string GetId(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetVersion(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetChip(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetLanguage(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetBranch(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetType(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetUniqueId(); + + [return: MarshalAs(UnmanagedType.VariantBool)] + bool GetIsExtension(); + } + + [Guid("c601c175-a3be-44bc-91f6-4568d230fc83")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ISetupPropertyStore + { + + [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] + string[] GetNames(); + + object GetValue([MarshalAs(UnmanagedType.LPWStr), In] string pwszName); + } + + [Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")] + [CoClass(typeof(SetupConfigurationClass))] + [ComImport] + public interface SetupConfiguration : ISetupConfiguration2, ISetupConfiguration + { + } + + [Guid("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D")] + [ClassInterface(ClassInterfaceType.None)] + [ComImport] + public class SetupConfigurationClass + { + } + + public static class Main + { + public static void PrintJson() + { + ISetupConfiguration query = new SetupConfiguration(); + ISetupConfiguration2 query2 = (ISetupConfiguration2)query; + IEnumSetupInstances e = query2.EnumAllInstances(); + + int pceltFetched; + ISetupInstance2[] rgelt = new ISetupInstance2[1]; + List instances = new List(); + while (true) + { + e.Next(1, rgelt, out pceltFetched); + if (pceltFetched <= 0) + { + Console.WriteLine(String.Format("[{0}]", string.Join(",", instances.ToArray()))); + return; + } + + try + { + instances.Add(InstanceJson(rgelt[0])); + } + catch (COMException) + { + // Ignore instances that can't be queried. + } + } + } + + private static string JsonString(string s) + { + return "\"" + s.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\""; + } + + private static string InstanceJson(ISetupInstance2 setupInstance2) + { + // Visual Studio component directory: + // https://docs.microsoft.com/en-us/visualstudio/install/workload-and-component-ids + + StringBuilder json = new StringBuilder(); + json.Append("{"); + + string path = JsonString(setupInstance2.GetInstallationPath()); + json.Append(String.Format("\"path\":{0},", path)); + + string version = JsonString(setupInstance2.GetInstallationVersion()); + json.Append(String.Format("\"version\":{0},", version)); + + List packages = new List(); + foreach (ISetupPackageReference package in setupInstance2.GetPackages()) + { + string id = JsonString(package.GetId()); + packages.Add(id); + } + json.Append(String.Format("\"packages\":[{0}]", string.Join(",", packages.ToArray()))); + + json.Append("}"); + return json.ToString(); + } + } +} diff --git a/.pnpm-store/v11/files/3a/71cb52281b5e26d46e3d89373b1d055007cb0529ade2028809e44de0c43e9c93a793de01aa0026b7169f659108b05a8caf6ec1d30806d41fedaeb2412cbcce b/.pnpm-store/v11/files/3a/71cb52281b5e26d46e3d89373b1d055007cb0529ade2028809e44de0c43e9c93a793de01aa0026b7169f659108b05a8caf6ec1d30806d41fedaeb2412cbcce new file mode 100644 index 0000000000..d13eaa9af2 --- /dev/null +++ b/.pnpm-store/v11/files/3a/71cb52281b5e26d46e3d89373b1d055007cb0529ade2028809e44de0c43e9c93a793de01aa0026b7169f659108b05a8caf6ec1d30806d41fedaeb2412cbcce @@ -0,0 +1,1936 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +This module contains classes that help to emulate xcodebuild behavior on top of +other build systems, such as make and ninja. +""" + +import copy +import os +import os.path +import re +import shlex +import subprocess +import sys + +import gyp.common +from gyp.common import GypError + +# Populated lazily by XcodeVersion, for efficiency, and to fix an issue when +# "xcodebuild" is called too quickly (it has been found to return incorrect +# version number). +XCODE_VERSION_CACHE = None + +# Populated lazily by GetXcodeArchsDefault, to an |XcodeArchsDefault| instance +# corresponding to the installed version of Xcode. +XCODE_ARCHS_DEFAULT_CACHE = None + + +def XcodeArchsVariableMapping(archs, archs_including_64_bit=None): + """Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable, + and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).""" + mapping = {"$(ARCHS_STANDARD)": archs} + if archs_including_64_bit: + mapping["$(ARCHS_STANDARD_INCLUDING_64_BIT)"] = archs_including_64_bit + return mapping + + +class XcodeArchsDefault: + """A class to resolve ARCHS variable from xcode_settings, resolving Xcode + macros and implementing filtering by VALID_ARCHS. The expansion of macros + depends on the SDKROOT used ("macosx", "iphoneos", "iphonesimulator") and + on the version of Xcode. + """ + + # Match variable like $(ARCHS_STANDARD). + variable_pattern = re.compile(r"\$\([a-zA-Z_][a-zA-Z0-9_]*\)$") + + def __init__(self, default, mac, iphonesimulator, iphoneos): + self._default = (default,) + self._archs = {"mac": mac, "ios": iphoneos, "iossim": iphonesimulator} + + def _VariableMapping(self, sdkroot): + """Returns the dictionary of variable mapping depending on the SDKROOT.""" + sdkroot = sdkroot.lower() + if "iphoneos" in sdkroot: + return self._archs["ios"] + elif "iphonesimulator" in sdkroot: + return self._archs["iossim"] + else: + return self._archs["mac"] + + def _ExpandArchs(self, archs, sdkroot): + """Expands variables references in ARCHS, and remove duplicates.""" + variable_mapping = self._VariableMapping(sdkroot) + expanded_archs = [] + for arch in archs: + if self.variable_pattern.match(arch): + variable = arch + try: + variable_expansion = variable_mapping[variable] + for arch in variable_expansion: + if arch not in expanded_archs: + expanded_archs.append(arch) + except KeyError: + print('Warning: Ignoring unsupported variable "%s".' % variable) + elif arch not in expanded_archs: + expanded_archs.append(arch) + return expanded_archs + + def ActiveArchs(self, archs, valid_archs, sdkroot): + """Expands variables references in ARCHS, and filter by VALID_ARCHS if it + is defined (if not set, Xcode accept any value in ARCHS, otherwise, only + values present in VALID_ARCHS are kept).""" + expanded_archs = self._ExpandArchs(archs or self._default, sdkroot or "") + if valid_archs: + filtered_archs = [] + for arch in expanded_archs: + if arch in valid_archs: + filtered_archs.append(arch) + expanded_archs = filtered_archs + return expanded_archs + + +def GetXcodeArchsDefault(): + """Returns the |XcodeArchsDefault| object to use to expand ARCHS for the + installed version of Xcode. The default values used by Xcode for ARCHS + and the expansion of the variables depends on the version of Xcode used. + + For all version anterior to Xcode 5.0 or posterior to Xcode 5.1 included + uses $(ARCHS_STANDARD) if ARCHS is unset, while Xcode 5.0 to 5.0.2 uses + $(ARCHS_STANDARD_INCLUDING_64_BIT). This variable was added to Xcode 5.0 + and deprecated with Xcode 5.1. + + For "macosx" SDKROOT, all version starting with Xcode 5.0 includes 64-bit + architecture as part of $(ARCHS_STANDARD) and default to only building it. + + For "iphoneos" and "iphonesimulator" SDKROOT, 64-bit architectures are part + of $(ARCHS_STANDARD_INCLUDING_64_BIT) from Xcode 5.0. From Xcode 5.1, they + are also part of $(ARCHS_STANDARD). + + All these rules are coded in the construction of the |XcodeArchsDefault| + object to use depending on the version of Xcode detected. The object is + for performance reason.""" + global XCODE_ARCHS_DEFAULT_CACHE + if XCODE_ARCHS_DEFAULT_CACHE: + return XCODE_ARCHS_DEFAULT_CACHE + xcode_version, _ = XcodeVersion() + if xcode_version < "0500": + XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( + "$(ARCHS_STANDARD)", + XcodeArchsVariableMapping(["i386"]), + XcodeArchsVariableMapping(["i386"]), + XcodeArchsVariableMapping(["armv7"]), + ) + elif xcode_version < "0510": + XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( + "$(ARCHS_STANDARD_INCLUDING_64_BIT)", + XcodeArchsVariableMapping(["x86_64"], ["x86_64"]), + XcodeArchsVariableMapping(["i386"], ["i386", "x86_64"]), + XcodeArchsVariableMapping( + ["armv7", "armv7s"], ["armv7", "armv7s", "arm64"] + ), + ) + else: + XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( + "$(ARCHS_STANDARD)", + XcodeArchsVariableMapping(["x86_64"], ["x86_64"]), + XcodeArchsVariableMapping(["i386", "x86_64"], ["i386", "x86_64"]), + XcodeArchsVariableMapping( + ["armv7", "armv7s", "arm64"], ["armv7", "armv7s", "arm64"] + ), + ) + return XCODE_ARCHS_DEFAULT_CACHE + + +class XcodeSettings: + """A class that understands the gyp 'xcode_settings' object.""" + + # Populated lazily by _SdkPath(). Shared by all XcodeSettings, so cached + # at class-level for efficiency. + _sdk_path_cache = {} + _platform_path_cache = {} + _sdk_root_cache = {} + + # Populated lazily by GetExtraPlistItems(). Shared by all XcodeSettings, so + # cached at class-level for efficiency. + _plist_cache = {} + + # Populated lazily by GetIOSPostbuilds. Shared by all XcodeSettings, so + # cached at class-level for efficiency. + _codesigning_key_cache = {} + + def __init__(self, spec): + self.spec = spec + + self.isIOS = False + self.mac_toolchain_dir = None + self.header_map_path = None + + # Per-target 'xcode_settings' are pushed down into configs earlier by gyp. + # This means self.xcode_settings[config] always contains all settings + # for that config -- the per-target settings as well. Settings that are + # the same for all configs are implicitly per-target settings. + self.xcode_settings = {} + configs = spec["configurations"] + for configname, config in configs.items(): + self.xcode_settings[configname] = config.get("xcode_settings", {}) + self._ConvertConditionalKeys(configname) + if self.xcode_settings[configname].get("IPHONEOS_DEPLOYMENT_TARGET", None): + self.isIOS = True + + # This is only non-None temporarily during the execution of some methods. + self.configname = None + + # Used by _AdjustLibrary to match .a and .dylib entries in libraries. + self.library_re = re.compile(r"^lib([^/]+)\.(a|dylib)$") + + def _ConvertConditionalKeys(self, configname): + """Converts or warns on conditional keys. Xcode supports conditional keys, + such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation + with some keys converted while the rest force a warning.""" + settings = self.xcode_settings[configname] + conditional_keys = [key for key in settings if key.endswith("]")] + for key in conditional_keys: + # If you need more, speak up at http://crbug.com/122592 + if key.endswith("[sdk=iphoneos*]"): + if configname.endswith("iphoneos"): + new_key = key.split("[")[0] + settings[new_key] = settings[key] + else: + print( + "Warning: Conditional keys not implemented, ignoring:", + " ".join(conditional_keys), + ) + del settings[key] + + def _Settings(self): + assert self.configname + return self.xcode_settings[self.configname] + + def _Test(self, test_key, cond_key, default): + return self._Settings().get(test_key, default) == cond_key + + def _Appendf(self, lst, test_key, format_str, default=None): + if test_key in self._Settings(): + lst.append(format_str % str(self._Settings()[test_key])) + elif default: + lst.append(format_str % str(default)) + + def _WarnUnimplemented(self, test_key): + if test_key in self._Settings(): + print('Warning: Ignoring not yet implemented key "%s".' % test_key) + + def IsBinaryOutputFormat(self, configname): + default = "binary" if self.isIOS else "xml" + format = self.xcode_settings[configname].get("INFOPLIST_OUTPUT_FORMAT", default) + return format == "binary" + + def IsIosFramework(self): + return self.spec["type"] == "shared_library" and self._IsBundle() and self.isIOS + + def _IsBundle(self): + return ( + int(self.spec.get("mac_bundle", 0)) != 0 + or self._IsXCTest() + or self._IsXCUiTest() + ) + + def _IsXCTest(self): + return int(self.spec.get("mac_xctest_bundle", 0)) != 0 + + def _IsXCUiTest(self): + return int(self.spec.get("mac_xcuitest_bundle", 0)) != 0 + + def _IsIosAppExtension(self): + return int(self.spec.get("ios_app_extension", 0)) != 0 + + def _IsIosWatchKitExtension(self): + return int(self.spec.get("ios_watchkit_extension", 0)) != 0 + + def _IsIosWatchApp(self): + return int(self.spec.get("ios_watch_app", 0)) != 0 + + def GetFrameworkVersion(self): + """Returns the framework version of the current target. Only valid for + bundles.""" + assert self._IsBundle() + return self.GetPerTargetSetting("FRAMEWORK_VERSION", default="A") + + def GetWrapperExtension(self): + """Returns the bundle extension (.app, .framework, .plugin, etc). Only + valid for bundles.""" + assert self._IsBundle() + if self.spec["type"] in ("loadable_module", "shared_library"): + default_wrapper_extension = { + "loadable_module": "bundle", + "shared_library": "framework", + }[self.spec["type"]] + wrapper_extension = self.GetPerTargetSetting( + "WRAPPER_EXTENSION", default=default_wrapper_extension + ) + return "." + self.spec.get("product_extension", wrapper_extension) + elif self.spec["type"] == "executable": + if self._IsIosAppExtension() or self._IsIosWatchKitExtension(): + return "." + self.spec.get("product_extension", "appex") + else: + return "." + self.spec.get("product_extension", "app") + else: + assert False, "Don't know extension for '{}', target '{}'".format( + self.spec["type"], + self.spec["target_name"], + ) + + def GetProductName(self): + """Returns PRODUCT_NAME.""" + return self.spec.get("product_name", self.spec["target_name"]) + + def GetFullProductName(self): + """Returns FULL_PRODUCT_NAME.""" + if self._IsBundle(): + return self.GetWrapperName() + else: + return self._GetStandaloneBinaryPath() + + def GetWrapperName(self): + """Returns the directory name of the bundle represented by this target. + Only valid for bundles.""" + assert self._IsBundle() + return self.GetProductName() + self.GetWrapperExtension() + + def GetBundleContentsFolderPath(self): + """Returns the qualified path to the bundle's contents folder. E.g. + Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.""" + if self.isIOS: + return self.GetWrapperName() + assert self._IsBundle() + if self.spec["type"] == "shared_library": + return os.path.join( + self.GetWrapperName(), "Versions", self.GetFrameworkVersion() + ) + else: + # loadable_modules have a 'Contents' folder like executables. + return os.path.join(self.GetWrapperName(), "Contents") + + def GetBundleResourceFolder(self): + """Returns the qualified path to the bundle's resource folder. E.g. + Chromium.app/Contents/Resources. Only valid for bundles.""" + assert self._IsBundle() + if self.isIOS: + return self.GetBundleContentsFolderPath() + return os.path.join(self.GetBundleContentsFolderPath(), "Resources") + + def GetBundleExecutableFolderPath(self): + """Returns the qualified path to the bundle's executables folder. E.g. + Chromium.app/Contents/MacOS. Only valid for bundles.""" + assert self._IsBundle() + if self.spec["type"] in ("shared_library") or self.isIOS: + return self.GetBundleContentsFolderPath() + elif self.spec["type"] in ("executable", "loadable_module"): + return os.path.join(self.GetBundleContentsFolderPath(), "MacOS") + + def GetBundleJavaFolderPath(self): + """Returns the qualified path to the bundle's Java resource folder. + E.g. Chromium.app/Contents/Resources/Java. Only valid for bundles.""" + assert self._IsBundle() + return os.path.join(self.GetBundleResourceFolder(), "Java") + + def GetBundleFrameworksFolderPath(self): + """Returns the qualified path to the bundle's frameworks folder. E.g, + Chromium.app/Contents/Frameworks. Only valid for bundles.""" + assert self._IsBundle() + return os.path.join(self.GetBundleContentsFolderPath(), "Frameworks") + + def GetBundleSharedFrameworksFolderPath(self): + """Returns the qualified path to the bundle's frameworks folder. E.g, + Chromium.app/Contents/SharedFrameworks. Only valid for bundles.""" + assert self._IsBundle() + return os.path.join(self.GetBundleContentsFolderPath(), "SharedFrameworks") + + def GetBundleSharedSupportFolderPath(self): + """Returns the qualified path to the bundle's shared support folder. E.g, + Chromium.app/Contents/SharedSupport. Only valid for bundles.""" + assert self._IsBundle() + if self.spec["type"] == "shared_library": + return self.GetBundleResourceFolder() + else: + return os.path.join(self.GetBundleContentsFolderPath(), "SharedSupport") + + def GetBundlePlugInsFolderPath(self): + """Returns the qualified path to the bundle's plugins folder. E.g, + Chromium.app/Contents/PlugIns. Only valid for bundles.""" + assert self._IsBundle() + return os.path.join(self.GetBundleContentsFolderPath(), "PlugIns") + + def GetBundleXPCServicesFolderPath(self): + """Returns the qualified path to the bundle's XPC services folder. E.g, + Chromium.app/Contents/XPCServices. Only valid for bundles.""" + assert self._IsBundle() + return os.path.join(self.GetBundleContentsFolderPath(), "XPCServices") + + def GetBundlePlistPath(self): + """Returns the qualified path to the bundle's plist file. E.g. + Chromium.app/Contents/Info.plist. Only valid for bundles.""" + assert self._IsBundle() + if ( + self.spec["type"] in ("executable", "loadable_module") + or self.IsIosFramework() + ): + return os.path.join(self.GetBundleContentsFolderPath(), "Info.plist") + else: + return os.path.join( + self.GetBundleContentsFolderPath(), "Resources", "Info.plist" + ) + + def GetProductType(self): + """Returns the PRODUCT_TYPE of this target.""" + if self._IsIosAppExtension(): + assert self._IsBundle(), ( + "ios_app_extension flag requires mac_bundle " + "(target %s)" % self.spec["target_name"] + ) + return "com.apple.product-type.app-extension" + if self._IsIosWatchKitExtension(): + assert self._IsBundle(), ( + "ios_watchkit_extension flag requires " + "mac_bundle (target %s)" % self.spec["target_name"] + ) + return "com.apple.product-type.watchkit-extension" + if self._IsIosWatchApp(): + assert self._IsBundle(), ( + "ios_watch_app flag requires mac_bundle " + "(target %s)" % self.spec["target_name"] + ) + return "com.apple.product-type.application.watchapp" + if self._IsXCUiTest(): + assert self._IsBundle(), ( + "mac_xcuitest_bundle flag requires mac_bundle " + "(target %s)" % self.spec["target_name"] + ) + return "com.apple.product-type.bundle.ui-testing" + if self._IsBundle(): + return { + "executable": "com.apple.product-type.application", + "loadable_module": "com.apple.product-type.bundle", + "shared_library": "com.apple.product-type.framework", + }[self.spec["type"]] + else: + return { + "executable": "com.apple.product-type.tool", + "loadable_module": "com.apple.product-type.library.dynamic", + "shared_library": "com.apple.product-type.library.dynamic", + "static_library": "com.apple.product-type.library.static", + }[self.spec["type"]] + + def GetMachOType(self): + """Returns the MACH_O_TYPE of this target.""" + # Weird, but matches Xcode. + if not self._IsBundle() and self.spec["type"] == "executable": + return "" + return { + "executable": "mh_execute", + "static_library": "staticlib", + "shared_library": "mh_dylib", + "loadable_module": "mh_bundle", + }[self.spec["type"]] + + def _GetBundleBinaryPath(self): + """Returns the name of the bundle binary of by this target. + E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.""" + assert self._IsBundle() + return os.path.join( + self.GetBundleExecutableFolderPath(), self.GetExecutableName() + ) + + def _GetStandaloneExecutableSuffix(self): + if "product_extension" in self.spec: + return "." + self.spec["product_extension"] + return { + "executable": "", + "static_library": ".a", + "shared_library": ".dylib", + "loadable_module": ".so", + }[self.spec["type"]] + + def _GetStandaloneExecutablePrefix(self): + return self.spec.get( + "product_prefix", + { + "executable": "", + "static_library": "lib", + "shared_library": "lib", + # Non-bundled loadable_modules are called foo.so for some reason + # (that is, .so and no prefix) with the xcode build -- match that. + "loadable_module": "", + }[self.spec["type"]], + ) + + def _GetStandaloneBinaryPath(self): + """Returns the name of the non-bundle binary represented by this target. + E.g. hello_world. Only valid for non-bundles.""" + assert not self._IsBundle() + assert self.spec["type"] in { + "executable", + "shared_library", + "static_library", + "loadable_module", + }, "Unexpected type %s" % self.spec["type"] + target = self.spec["target_name"] + if self.spec["type"] in {"loadable_module", "shared_library", "static_library"}: + if target[:3] == "lib": + target = target[3:] + + target_prefix = self._GetStandaloneExecutablePrefix() + target = self.spec.get("product_name", target) + target_ext = self._GetStandaloneExecutableSuffix() + return target_prefix + target + target_ext + + def GetExecutableName(self): + """Returns the executable name of the bundle represented by this target. + E.g. Chromium.""" + if self._IsBundle(): + return self.spec.get("product_name", self.spec["target_name"]) + else: + return self._GetStandaloneBinaryPath() + + def GetExecutablePath(self): + """Returns the qualified path to the primary executable of the bundle + represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.""" + if self._IsBundle(): + return self._GetBundleBinaryPath() + else: + return self._GetStandaloneBinaryPath() + + def GetActiveArchs(self, configname): + """Returns the architectures this target should be built for.""" + config_settings = self.xcode_settings[configname] + xcode_archs_default = GetXcodeArchsDefault() + return xcode_archs_default.ActiveArchs( + config_settings.get("ARCHS"), + config_settings.get("VALID_ARCHS"), + config_settings.get("SDKROOT"), + ) + + def _GetSdkVersionInfoItem(self, sdk, infoitem): + # xcodebuild requires Xcode and can't run on Command Line Tools-only + # systems from 10.7 onward. + # Since the CLT has no SDK paths anyway, returning None is the + # most sensible route and should still do the right thing. + try: + return GetStdoutQuiet(["xcrun", "--sdk", sdk, infoitem]) + except (GypError, OSError): + pass + + def _SdkRoot(self, configname): + if configname is None: + configname = self.configname + return self.GetPerConfigSetting("SDKROOT", configname, default="") + + def _XcodePlatformPath(self, configname=None): + sdk_root = self._SdkRoot(configname) + if sdk_root not in XcodeSettings._platform_path_cache: + platform_path = self._GetSdkVersionInfoItem( + sdk_root, "--show-sdk-platform-path" + ) + XcodeSettings._platform_path_cache[sdk_root] = platform_path + return XcodeSettings._platform_path_cache[sdk_root] + + def _SdkPath(self, configname=None): + sdk_root = self._SdkRoot(configname) + if sdk_root.startswith("/"): + return sdk_root + return self._XcodeSdkPath(sdk_root) + + def _XcodeSdkPath(self, sdk_root): + if sdk_root not in XcodeSettings._sdk_path_cache: + sdk_path = self._GetSdkVersionInfoItem(sdk_root, "--show-sdk-path") + XcodeSettings._sdk_path_cache[sdk_root] = sdk_path + if sdk_root: + XcodeSettings._sdk_root_cache[sdk_path] = sdk_root + return XcodeSettings._sdk_path_cache[sdk_root] + + def _AppendPlatformVersionMinFlags(self, lst): + self._Appendf(lst, "MACOSX_DEPLOYMENT_TARGET", "-mmacosx-version-min=%s") + if "IPHONEOS_DEPLOYMENT_TARGET" in self._Settings(): + # TODO: Implement this better? + sdk_path_basename = os.path.basename(self._SdkPath()) + if sdk_path_basename.lower().startswith("iphonesimulator"): + self._Appendf( + lst, "IPHONEOS_DEPLOYMENT_TARGET", "-mios-simulator-version-min=%s" + ) + else: + self._Appendf( + lst, "IPHONEOS_DEPLOYMENT_TARGET", "-miphoneos-version-min=%s" + ) + + def GetCflags(self, configname, arch=None): + """Returns flags that need to be added to .c, .cc, .m, and .mm + compilations.""" + # This functions (and the similar ones below) do not offer complete + # emulation of all xcode_settings keys. They're implemented on demand. + + self.configname = configname + cflags = [] + + sdk_root = self._SdkPath() + if "SDKROOT" in self._Settings() and sdk_root: + cflags.append("-isysroot") + cflags.append(sdk_root) + + if self.header_map_path: + cflags.append("-I%s" % self.header_map_path) + + if self._Test("CLANG_WARN_CONSTANT_CONVERSION", "YES", default="NO"): + cflags.append("-Wconstant-conversion") + + if self._Test("GCC_CHAR_IS_UNSIGNED_CHAR", "YES", default="NO"): + cflags.append("-funsigned-char") + + if self._Test("GCC_CW_ASM_SYNTAX", "YES", default="YES"): + cflags.append("-fasm-blocks") + + if "GCC_DYNAMIC_NO_PIC" in self._Settings(): + if self._Settings()["GCC_DYNAMIC_NO_PIC"] == "YES": + cflags.append("-mdynamic-no-pic") + else: + pass + # TODO: In this case, it depends on the target. xcode passes + # mdynamic-no-pic by default for executable and possibly static lib + # according to mento + + if self._Test("GCC_ENABLE_PASCAL_STRINGS", "YES", default="YES"): + cflags.append("-mpascal-strings") + + self._Appendf(cflags, "GCC_OPTIMIZATION_LEVEL", "-O%s", default="s") + + if self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES"): + dbg_format = self._Settings().get("DEBUG_INFORMATION_FORMAT", "dwarf") + if dbg_format == "dwarf": + cflags.append("-gdwarf-2") + elif dbg_format == "stabs": + raise NotImplementedError("stabs debug format is not supported yet.") + elif dbg_format == "dwarf-with-dsym": + cflags.append("-gdwarf-2") + else: + raise NotImplementedError("Unknown debug format %s" % dbg_format) + + if self._Settings().get("GCC_STRICT_ALIASING") == "YES": + cflags.append("-fstrict-aliasing") + elif self._Settings().get("GCC_STRICT_ALIASING") == "NO": + cflags.append("-fno-strict-aliasing") + + if self._Test("GCC_SYMBOLS_PRIVATE_EXTERN", "YES", default="NO"): + cflags.append("-fvisibility=hidden") + + if self._Test("GCC_TREAT_WARNINGS_AS_ERRORS", "YES", default="NO"): + cflags.append("-Werror") + + if self._Test("GCC_WARN_ABOUT_MISSING_NEWLINE", "YES", default="NO"): + cflags.append("-Wnewline-eof") + + # In Xcode, this is only activated when GCC_COMPILER_VERSION is clang or + # llvm-gcc. It also requires a fairly recent libtool, and + # if the system clang isn't used, DYLD_LIBRARY_PATH needs to contain the + # path to the libLTO.dylib that matches the used clang. + if self._Test("LLVM_LTO", "YES", default="NO"): + cflags.append("-flto") + + self._AppendPlatformVersionMinFlags(cflags) + + # TODO: + if self._Test("COPY_PHASE_STRIP", "YES", default="NO"): + self._WarnUnimplemented("COPY_PHASE_STRIP") + self._WarnUnimplemented("GCC_DEBUGGING_SYMBOLS") + self._WarnUnimplemented("GCC_ENABLE_OBJC_EXCEPTIONS") + + # TODO: This is exported correctly, but assigning to it is not supported. + self._WarnUnimplemented("MACH_O_TYPE") + self._WarnUnimplemented("PRODUCT_TYPE") + + # If GYP_CROSSCOMPILE (--cross-compiling), disable architecture-specific + # additions and assume these will be provided as required via CC_host, + # CXX_host, CC_target and CXX_target. + if not gyp.common.CrossCompileRequested(): + if arch is not None: + archs = [arch] + else: + assert self.configname + archs = self.GetActiveArchs(self.configname) + if len(archs) != 1: + # TODO: Supporting fat binaries will be annoying. + self._WarnUnimplemented("ARCHS") + archs = ["i386"] + cflags.append("-arch") + cflags.append(archs[0]) + + if archs[0] in ("i386", "x86_64"): + if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"): + cflags.append("-msse3") + if self._Test( + "GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS", "YES", default="NO" + ): + cflags.append("-mssse3") # Note 3rd 's'. + if self._Test("GCC_ENABLE_SSE41_EXTENSIONS", "YES", default="NO"): + cflags.append("-msse4.1") + if self._Test("GCC_ENABLE_SSE42_EXTENSIONS", "YES", default="NO"): + cflags.append("-msse4.2") + + cflags += self._Settings().get("WARNING_CFLAGS", []) + + if self._IsXCTest(): + platform_root = self._XcodePlatformPath(configname) + if platform_root: + cflags.append("-F" + platform_root + "/Developer/Library/Frameworks/") + + framework_root = sdk_root if sdk_root else "" + config = self.spec["configurations"][self.configname] + framework_dirs = config.get("mac_framework_dirs", []) + for directory in framework_dirs: + cflags.append("-F" + directory.replace("$(SDKROOT)", framework_root)) + + self.configname = None + return cflags + + def GetCflagsC(self, configname): + """Returns flags that need to be added to .c, and .m compilations.""" + self.configname = configname + cflags_c = [] + if self._Settings().get("GCC_C_LANGUAGE_STANDARD", "") == "ansi": + cflags_c.append("-ansi") + else: + self._Appendf(cflags_c, "GCC_C_LANGUAGE_STANDARD", "-std=%s") + cflags_c += self._Settings().get("OTHER_CFLAGS", []) + self.configname = None + return cflags_c + + def GetCflagsCC(self, configname): + """Returns flags that need to be added to .cc, and .mm compilations.""" + self.configname = configname + cflags_cc = [] + + clang_cxx_language_standard = self._Settings().get( + "CLANG_CXX_LANGUAGE_STANDARD" + ) + # Note: Don't make c++0x to c++11 so that c++0x can be used with older + # clangs that don't understand c++11 yet (like Xcode 4.2's). + if clang_cxx_language_standard: + cflags_cc.append("-std=%s" % clang_cxx_language_standard) + + self._Appendf(cflags_cc, "CLANG_CXX_LIBRARY", "-stdlib=%s") + + if self._Test("GCC_ENABLE_CPP_RTTI", "NO", default="YES"): + cflags_cc.append("-fno-rtti") + if self._Test("GCC_ENABLE_CPP_EXCEPTIONS", "NO", default="YES"): + cflags_cc.append("-fno-exceptions") + if self._Test("GCC_INLINES_ARE_PRIVATE_EXTERN", "YES", default="NO"): + cflags_cc.append("-fvisibility-inlines-hidden") + if self._Test("GCC_THREADSAFE_STATICS", "NO", default="YES"): + cflags_cc.append("-fno-threadsafe-statics") + # Note: This flag is a no-op for clang, it only has an effect for gcc. + if self._Test("GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO", "NO", default="YES"): + cflags_cc.append("-Wno-invalid-offsetof") + + other_ccflags = [] + + for flag in self._Settings().get("OTHER_CPLUSPLUSFLAGS", ["$(inherited)"]): + # TODO: More general variable expansion. Missing in many other places too. + if flag in ("$inherited", "$(inherited)", "${inherited}"): + flag = "$OTHER_CFLAGS" + if flag in ("$OTHER_CFLAGS", "$(OTHER_CFLAGS)", "${OTHER_CFLAGS}"): + other_ccflags += self._Settings().get("OTHER_CFLAGS", []) + else: + other_ccflags.append(flag) + cflags_cc += other_ccflags + + self.configname = None + return cflags_cc + + def _AddObjectiveCGarbageCollectionFlags(self, flags): + gc_policy = self._Settings().get("GCC_ENABLE_OBJC_GC", "unsupported") + if gc_policy == "supported": + flags.append("-fobjc-gc") + elif gc_policy == "required": + flags.append("-fobjc-gc-only") + + def _AddObjectiveCARCFlags(self, flags): + if self._Test("CLANG_ENABLE_OBJC_ARC", "YES", default="NO"): + flags.append("-fobjc-arc") + + def _AddObjectiveCMissingPropertySynthesisFlags(self, flags): + if self._Test( + "CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS", "YES", default="NO" + ): + flags.append("-Wobjc-missing-property-synthesis") + + def GetCflagsObjC(self, configname): + """Returns flags that need to be added to .m compilations.""" + self.configname = configname + cflags_objc = [] + self._AddObjectiveCGarbageCollectionFlags(cflags_objc) + self._AddObjectiveCARCFlags(cflags_objc) + self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objc) + self.configname = None + return cflags_objc + + def GetCflagsObjCC(self, configname): + """Returns flags that need to be added to .mm compilations.""" + self.configname = configname + cflags_objcc = [] + self._AddObjectiveCGarbageCollectionFlags(cflags_objcc) + self._AddObjectiveCARCFlags(cflags_objcc) + self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objcc) + if self._Test("GCC_OBJC_CALL_CXX_CDTORS", "YES", default="NO"): + cflags_objcc.append("-fobjc-call-cxx-cdtors") + self.configname = None + return cflags_objcc + + def GetInstallNameBase(self): + """Return DYLIB_INSTALL_NAME_BASE for this target.""" + # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. + if self.spec["type"] != "shared_library" and ( + self.spec["type"] != "loadable_module" or self._IsBundle() + ): + return None + install_base = self.GetPerTargetSetting( + "DYLIB_INSTALL_NAME_BASE", + default="/Library/Frameworks" if self._IsBundle() else "/usr/local/lib", + ) + return install_base + + def _StandardizePath(self, path): + """Do :standardizepath processing for path.""" + # I'm not quite sure what :standardizepath does. Just call normpath(), + # but don't let @executable_path/../foo collapse to foo. + if "/" in path: + prefix, rest = "", path + if path.startswith("@"): + prefix, rest = path.split("/", 1) + rest = os.path.normpath(rest) # :standardizepath + path = os.path.join(prefix, rest) + return path + + def GetInstallName(self): + """Return LD_DYLIB_INSTALL_NAME for this target.""" + # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. + if self.spec["type"] != "shared_library" and ( + self.spec["type"] != "loadable_module" or self._IsBundle() + ): + return None + + default_install_name = ( + "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)" + ) + install_name = self.GetPerTargetSetting( + "LD_DYLIB_INSTALL_NAME", default=default_install_name + ) + + # Hardcode support for the variables used in chromium for now, to + # unblock people using the make build. + if "$" in install_name: + assert install_name in ( + "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/" + "$(WRAPPER_NAME)/$(PRODUCT_NAME)", + default_install_name, + ), ( + "Variables in LD_DYLIB_INSTALL_NAME are not generally supported " + "yet in target '%s' (got '%s')" + % (self.spec["target_name"], install_name) + ) + + install_name = install_name.replace( + "$(DYLIB_INSTALL_NAME_BASE:standardizepath)", + self._StandardizePath(self.GetInstallNameBase()), + ) + if self._IsBundle(): + # These are only valid for bundles, hence the |if|. + install_name = install_name.replace( + "$(WRAPPER_NAME)", self.GetWrapperName() + ) + install_name = install_name.replace( + "$(PRODUCT_NAME)", self.GetProductName() + ) + else: + assert "$(WRAPPER_NAME)" not in install_name + assert "$(PRODUCT_NAME)" not in install_name + + install_name = install_name.replace( + "$(EXECUTABLE_PATH)", self.GetExecutablePath() + ) + return install_name + + def _MapLinkerFlagFilename(self, ldflag, gyp_to_build_path): + """Checks if ldflag contains a filename and if so remaps it from + gyp-directory-relative to build-directory-relative.""" + # This list is expanded on demand. + # They get matched as: + # -exported_symbols_list file + # -Wl,exported_symbols_list file + # -Wl,exported_symbols_list,file + LINKER_FILE = r"(\S+)" + WORD = r"\S+" + linker_flags = [ + ["-exported_symbols_list", LINKER_FILE], # Needed for NaCl. + ["-unexported_symbols_list", LINKER_FILE], + ["-reexported_symbols_list", LINKER_FILE], + ["-sectcreate", WORD, WORD, LINKER_FILE], # Needed for remoting. + ] + for flag_pattern in linker_flags: + regex = re.compile("(?:-Wl,)?" + "[ ,]".join(flag_pattern)) + m = regex.match(ldflag) + if m: + ldflag = ( + ldflag[: m.start(1)] + + gyp_to_build_path(m.group(1)) + + ldflag[m.end(1) :] + ) + # Required for ffmpeg (no idea why they don't use LIBRARY_SEARCH_PATHS, + # TODO(thakis): Update ffmpeg.gyp): + if ldflag.startswith("-L"): + ldflag = "-L" + gyp_to_build_path(ldflag[len("-L") :]) + return ldflag + + def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): + """Returns flags that need to be passed to the linker. + + Args: + configname: The name of the configuration to get ld flags for. + product_dir: The directory where products such static and dynamic + libraries are placed. This is added to the library search path. + gyp_to_build_path: A function that converts paths relative to the + current gyp file to paths relative to the build directory. + """ + self.configname = configname + ldflags = [] + + # The xcode build is relative to a gyp file's directory, and OTHER_LDFLAGS + # can contain entries that depend on this. Explicitly absolutify these. + for ldflag in self._Settings().get("OTHER_LDFLAGS", []): + ldflags.append(self._MapLinkerFlagFilename(ldflag, gyp_to_build_path)) + + if self._Test("DEAD_CODE_STRIPPING", "YES", default="NO"): + ldflags.append("-Wl,-dead_strip") + + if self._Test("PREBINDING", "YES", default="NO"): + ldflags.append("-Wl,-prebind") + + self._Appendf( + ldflags, "DYLIB_COMPATIBILITY_VERSION", "-compatibility_version %s" + ) + self._Appendf(ldflags, "DYLIB_CURRENT_VERSION", "-current_version %s") + + self._AppendPlatformVersionMinFlags(ldflags) + + if "SDKROOT" in self._Settings() and self._SdkPath(): + ldflags.append("-isysroot") + ldflags.append(self._SdkPath()) + + for library_path in self._Settings().get("LIBRARY_SEARCH_PATHS", []): + ldflags.append("-L" + gyp_to_build_path(library_path)) + + if "ORDER_FILE" in self._Settings(): + ldflags.append("-Wl,-order_file") + ldflags.append("-Wl," + gyp_to_build_path(self._Settings()["ORDER_FILE"])) + + if not gyp.common.CrossCompileRequested(): + if arch is not None: + archs = [arch] + else: + assert self.configname + archs = self.GetActiveArchs(self.configname) + if len(archs) != 1: + # TODO: Supporting fat binaries will be annoying. + self._WarnUnimplemented("ARCHS") + archs = ["i386"] + # Avoid quoting the space between -arch and the arch name + ldflags.append("-arch") + ldflags.append(archs[0]) + + # Xcode adds the product directory by default. + # Rewrite -L. to -L./ to work around http://www.openradar.me/25313838 + ldflags.append("-L" + (product_dir if product_dir != "." else "./")) + + install_name = self.GetInstallName() + if install_name and self.spec["type"] != "loadable_module": + ldflags.append("-install_name") + ldflags.append(install_name.replace(" ", r"\ ")) + + for rpath in self._Settings().get("LD_RUNPATH_SEARCH_PATHS", []): + ldflags.append("-Wl,-rpath," + rpath) + + sdk_root = self._SdkPath() + if not sdk_root: + sdk_root = "" + config = self.spec["configurations"][self.configname] + framework_dirs = config.get("mac_framework_dirs", []) + for directory in framework_dirs: + ldflags.append("-F" + directory.replace("$(SDKROOT)", sdk_root)) + + if self._IsXCTest(): + platform_root = self._XcodePlatformPath(configname) + if sdk_root and platform_root: + ldflags.append("-F" + platform_root + "/Developer/Library/Frameworks/") + ldflags.append("-framework") + ldflags.append("XCTest") + + is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension() + if sdk_root and is_extension: + # Adds the link flags for extensions. These flags are common for all + # extensions and provide loader and main function. + # These flags reflect the compilation options used by xcode to compile + # extensions. + xcode_version, _ = XcodeVersion() + if xcode_version < "0900": + ldflags.append("-lpkstart") + ldflags.append( + sdk_root + + "/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit" + ) + else: + ldflags.append("-e") + ldflags.append("_NSExtensionMain") + ldflags.append("-fapplication-extension") + + self._Appendf(ldflags, "CLANG_CXX_LIBRARY", "-stdlib=%s") + + self.configname = None + return ldflags + + def GetLibtoolflags(self, configname): + """Returns flags that need to be passed to the static linker. + + Args: + configname: The name of the configuration to get ld flags for. + """ + self.configname = configname + libtoolflags = [] + + for libtoolflag in self._Settings().get("OTHER_LDFLAGS", []): + libtoolflags.append(libtoolflag) + # TODO(thakis): ARCHS? + + self.configname = None + return libtoolflags + + def GetPerTargetSettings(self): + """Gets a list of all the per-target settings. This will only fetch keys + whose values are the same across all configurations.""" + first_pass = True + result = {} + for configname in sorted(self.xcode_settings.keys()): + if first_pass: + result = dict(self.xcode_settings[configname]) + first_pass = False + else: + for key, value in self.xcode_settings[configname].items(): + if key not in result: + continue + elif result[key] != value: + del result[key] + return result + + def GetPerConfigSetting(self, setting, configname, default=None): + if configname in self.xcode_settings: + return self.xcode_settings[configname].get(setting, default) + else: + return self.GetPerTargetSetting(setting, default) + + def GetPerTargetSetting(self, setting, default=None): + """Tries to get xcode_settings.setting from spec. Assumes that the setting + has the same value in all configurations and throws otherwise.""" + is_first_pass = True + result = None + for configname in sorted(self.xcode_settings.keys()): + if is_first_pass: + result = self.xcode_settings[configname].get(setting, None) + is_first_pass = False + else: + assert result == self.xcode_settings[configname].get(setting, None), ( + "Expected per-target setting for '%s', got per-config setting " + "(target %s)" % (setting, self.spec["target_name"]) + ) + if result is None: + return default + return result + + def _GetStripPostbuilds(self, configname, output_binary, quiet): + """Returns a list of shell commands that contain the shell commands + necessary to strip this target's binary. These should be run as postbuilds + before the actual postbuilds run.""" + self.configname = configname + + result = [] + if self._Test("DEPLOYMENT_POSTPROCESSING", "YES", default="NO") and self._Test( + "STRIP_INSTALLED_PRODUCT", "YES", default="NO" + ): + default_strip_style = "debugging" + if ( + self.spec["type"] == "loadable_module" or self._IsIosAppExtension() + ) and self._IsBundle(): + default_strip_style = "non-global" + elif self.spec["type"] == "executable": + default_strip_style = "all" + + strip_style = self._Settings().get("STRIP_STYLE", default_strip_style) + strip_flags = {"all": "", "non-global": "-x", "debugging": "-S"}[ + strip_style + ] + + explicit_strip_flags = self._Settings().get("STRIPFLAGS", "") + if explicit_strip_flags: + strip_flags += " " + _NormalizeEnvVarReferences(explicit_strip_flags) + + if not quiet: + result.append("echo STRIP\\(%s\\)" % self.spec["target_name"]) + result.append(f"strip {strip_flags} {output_binary}") + + self.configname = None + return result + + def _GetDebugInfoPostbuilds(self, configname, output, output_binary, quiet): + """Returns a list of shell commands that contain the shell commands + necessary to massage this target's debug information. These should be run + as postbuilds before the actual postbuilds run.""" + self.configname = configname + + # For static libraries, no dSYMs are created. + result = [] + if ( + self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES") + and self._Test( + "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym", default="dwarf" + ) + and self.spec["type"] != "static_library" + ): + if not quiet: + result.append("echo DSYMUTIL\\(%s\\)" % self.spec["target_name"]) + result.append("dsymutil {} -o {}".format(output_binary, output + ".dSYM")) + + self.configname = None + return result + + def _GetTargetPostbuilds(self, configname, output, output_binary, quiet=False): + """Returns a list of shell commands that contain the shell commands + to run as postbuilds for this target, before the actual postbuilds.""" + # dSYMs need to build before stripping happens. + return self._GetDebugInfoPostbuilds( + configname, output, output_binary, quiet + ) + self._GetStripPostbuilds(configname, output_binary, quiet) + + def _GetIOSPostbuilds(self, configname, output_binary): + """Return a shell command to codesign the iOS output binary so it can + be deployed to a device. This should be run as the very last step of the + build.""" + if not ( + (self.isIOS and (self.spec["type"] == "executable" or self._IsXCTest())) + or self.IsIosFramework() + ): + return [] + + postbuilds = [] + product_name = self.GetFullProductName() + settings = self.xcode_settings[configname] + + # Xcode expects XCTests to be copied into the TEST_HOST dir. + if self._IsXCTest(): + source = os.path.join("${BUILT_PRODUCTS_DIR}", product_name) + test_host = os.path.dirname(settings.get("TEST_HOST")) + xctest_destination = os.path.join(test_host, "PlugIns", product_name) + postbuilds.extend([f"ditto {source} {xctest_destination}"]) + + key = self._GetIOSCodeSignIdentityKey(settings) + if not key: + return postbuilds + + # Warn for any unimplemented signing xcode keys. + unimpl = ["OTHER_CODE_SIGN_FLAGS"] + unimpl = set(unimpl) & set(self.xcode_settings[configname].keys()) + if unimpl: + print( + "Warning: Some codesign keys not implemented, ignoring: %s" + % ", ".join(sorted(unimpl)) + ) + + if self._IsXCTest(): + # For device xctests, Xcode copies two extra frameworks into $TEST_HOST. + test_host = os.path.dirname(settings.get("TEST_HOST")) + frameworks_dir = os.path.join(test_host, "Frameworks") + platform_root = self._XcodePlatformPath(configname) + frameworks = [ + "Developer/Library/PrivateFrameworks/IDEBundleInjection.framework", + "Developer/Library/Frameworks/XCTest.framework", + ] + for framework in frameworks: + source = os.path.join(platform_root, framework) + destination = os.path.join(frameworks_dir, os.path.basename(framework)) + postbuilds.extend([f"ditto {source} {destination}"]) + + # Then re-sign everything with 'preserve=True' + postbuilds.extend( + [ + '%s %s code-sign-bundle "%s" "%s" "%s" "%s" %s' + % ( + sys.executable, + os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), + key, + settings.get("CODE_SIGN_ENTITLEMENTS", ""), + settings.get("PROVISIONING_PROFILE", ""), + destination, + True, + ) + ] + ) + plugin_dir = os.path.join(test_host, "PlugIns") + targets = [os.path.join(plugin_dir, product_name), test_host] + for target in targets: + postbuilds.extend( + [ + '%s %s code-sign-bundle "%s" "%s" "%s" "%s" %s' + % ( + sys.executable, + os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), + key, + settings.get("CODE_SIGN_ENTITLEMENTS", ""), + settings.get("PROVISIONING_PROFILE", ""), + target, + True, + ) + ] + ) + + postbuilds.extend( + [ + '%s %s code-sign-bundle "%s" "%s" "%s" "%s" %s' + % ( + sys.executable, + os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), + key, + settings.get("CODE_SIGN_ENTITLEMENTS", ""), + settings.get("PROVISIONING_PROFILE", ""), + os.path.join("${BUILT_PRODUCTS_DIR}", product_name), + False, + ) + ] + ) + return postbuilds + + def _GetIOSCodeSignIdentityKey(self, settings): + identity = settings.get("CODE_SIGN_IDENTITY") + if not identity: + return None + if identity not in XcodeSettings._codesigning_key_cache: + output = subprocess.check_output( + ["security", "find-identity", "-p", "codesigning", "-v"] + ) + for line in output.splitlines(): + if identity in line: + fingerprint = line.split()[1] + cache = XcodeSettings._codesigning_key_cache + assert identity not in cache or fingerprint == cache[identity], ( + "Multiple codesigning fingerprints for identity: %s" % identity + ) + XcodeSettings._codesigning_key_cache[identity] = fingerprint + return XcodeSettings._codesigning_key_cache.get(identity, "") + + def AddImplicitPostbuilds( + self, configname, output, output_binary, postbuilds=[], quiet=False + ): + """Returns a list of shell commands that should run before and after + |postbuilds|.""" + assert output_binary is not None + pre = self._GetTargetPostbuilds(configname, output, output_binary, quiet) + post = self._GetIOSPostbuilds(configname, output_binary) + return pre + postbuilds + post + + def _AdjustLibrary(self, library, config_name=None): + if library.endswith(".framework"): + l_flag = "-framework " + os.path.splitext(os.path.basename(library))[0] + else: + m = self.library_re.match(library) + l_flag = "-l" + m.group(1) if m else library + + sdk_root = self._SdkPath(config_name) + if not sdk_root: + sdk_root = "" + # Xcode 7 started shipping with ".tbd" (text based stubs) files instead of + # ".dylib" without providing a real support for them. What it does, for + # "/usr/lib" libraries, is do "-L/usr/lib -lname" which is dependent on the + # library order and cause collision when building Chrome. + # + # Instead substitute ".tbd" to ".dylib" in the generated project when the + # following conditions are both true: + # - library is referenced in the gyp file as "$(SDKROOT)/**/*.dylib", + # - the ".dylib" file does not exists but a ".tbd" file do. + library = l_flag.replace("$(SDKROOT)", sdk_root) + if l_flag.startswith("$(SDKROOT)"): + basename, ext = os.path.splitext(library) + if ext == ".dylib" and not os.path.exists(library): + tbd_library = basename + ".tbd" + if os.path.exists(tbd_library): + library = tbd_library + return library + + def AdjustLibraries(self, libraries, config_name=None): + """Transforms entries like 'Cocoa.framework' in libraries into entries like + '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. + """ + libraries = [self._AdjustLibrary(library, config_name) for library in libraries] + return libraries + + def _BuildMachineOSBuild(self): + return GetStdout(["sw_vers", "-buildVersion"]) + + def _XcodeIOSDeviceFamily(self, configname): + family = self.xcode_settings[configname].get("TARGETED_DEVICE_FAMILY", "1") + return [int(x) for x in family.split(",")] + + def GetExtraPlistItems(self, configname=None): + """Returns a dictionary with extra items to insert into Info.plist.""" + if configname not in XcodeSettings._plist_cache: + cache = {} + cache["BuildMachineOSBuild"] = self._BuildMachineOSBuild() + + xcode_version, xcode_build = XcodeVersion() + cache["DTXcode"] = xcode_version + cache["DTXcodeBuild"] = xcode_build + compiler = self.xcode_settings[configname].get("GCC_VERSION") + if compiler is not None: + cache["DTCompiler"] = compiler + + sdk_root = self._SdkRoot(configname) + if not sdk_root: + sdk_root = self._DefaultSdkRoot() + sdk_version = self._GetSdkVersionInfoItem(sdk_root, "--show-sdk-version") + cache["DTSDKName"] = sdk_root + (sdk_version or "") + if xcode_version >= "0720": + cache["DTSDKBuild"] = self._GetSdkVersionInfoItem( + sdk_root, "--show-sdk-build-version" + ) + elif xcode_version >= "0430": + cache["DTSDKBuild"] = sdk_version + else: + cache["DTSDKBuild"] = cache["BuildMachineOSBuild"] + + if self.isIOS: + cache["MinimumOSVersion"] = self.xcode_settings[configname].get( + "IPHONEOS_DEPLOYMENT_TARGET" + ) + cache["DTPlatformName"] = sdk_root + cache["DTPlatformVersion"] = sdk_version + + if configname.endswith("iphoneos"): + cache["CFBundleSupportedPlatforms"] = ["iPhoneOS"] + cache["DTPlatformBuild"] = cache["DTSDKBuild"] + else: + cache["CFBundleSupportedPlatforms"] = ["iPhoneSimulator"] + # This is weird, but Xcode sets DTPlatformBuild to an empty field + # for simulator builds. + cache["DTPlatformBuild"] = "" + XcodeSettings._plist_cache[configname] = cache + + # Include extra plist items that are per-target, not per global + # XcodeSettings. + items = dict(XcodeSettings._plist_cache[configname]) + if self.isIOS: + items["UIDeviceFamily"] = self._XcodeIOSDeviceFamily(configname) + return items + + def _DefaultSdkRoot(self): + """Returns the default SDKROOT to use. + + Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode + project, then the environment variable was empty. Starting with this + version, Xcode uses the name of the newest SDK installed. + """ + xcode_version, _ = XcodeVersion() + if xcode_version < "0500": + return "" + default_sdk_path = self._XcodeSdkPath("") + if default_sdk_root := XcodeSettings._sdk_root_cache.get(default_sdk_path): + return default_sdk_root + try: + all_sdks = GetStdout(["xcodebuild", "-showsdks"]) + except (GypError, OSError): + # If xcodebuild fails, there will be no valid SDKs + return "" + for line in all_sdks.splitlines(): + items = line.split() + if len(items) >= 3 and items[-2] == "-sdk": + sdk_root = items[-1] + sdk_path = self._XcodeSdkPath(sdk_root) + if sdk_path == default_sdk_path: + return sdk_root + return "" + + +class MacPrefixHeader: + """A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature. + + This feature consists of several pieces: + * If GCC_PREFIX_HEADER is present, all compilations in that project get an + additional |-include path_to_prefix_header| cflag. + * If GCC_PRECOMPILE_PREFIX_HEADER is present too, then the prefix header is + instead compiled, and all other compilations in the project get an + additional |-include path_to_compiled_header| instead. + + Compiled prefix headers have the extension gch. There is one gch file for + every language used in the project (c, cc, m, mm), since gch files for + different languages aren't compatible. + + gch files themselves are built with the target's normal cflags, but they + obviously don't get the |-include| flag. Instead, they need a -x flag that + describes their language. + + All o files in the target need to depend on the gch file, to make sure + it's built before any o file is built. + + This class helps with some of these tasks, but it needs help from the build + system for writing dependencies to the gch files, for writing build commands + for the gch files, and for figuring out the location of the gch files. + """ + + def __init__( + self, xcode_settings, gyp_path_to_build_path, gyp_path_to_build_output + ): + """If xcode_settings is None, all methods on this class are no-ops. + + Args: + gyp_path_to_build_path: A function that takes a gyp-relative path, + and returns a path relative to the build directory. + gyp_path_to_build_output: A function that takes a gyp-relative path and + a language code ('c', 'cc', 'm', or 'mm'), and that returns a path + to where the output of precompiling that path for that language + should be placed (without the trailing '.gch'). + """ + # This doesn't support per-configuration prefix headers. Good enough + # for now. + self.header = None + self.compile_headers = False + if xcode_settings: + self.header = xcode_settings.GetPerTargetSetting("GCC_PREFIX_HEADER") + self.compile_headers = ( + xcode_settings.GetPerTargetSetting( + "GCC_PRECOMPILE_PREFIX_HEADER", default="NO" + ) + != "NO" + ) + self.compiled_headers = {} + if self.header: + if self.compile_headers: + for lang in ["c", "cc", "m", "mm"]: + self.compiled_headers[lang] = gyp_path_to_build_output( + self.header, lang + ) + self.header = gyp_path_to_build_path(self.header) + + def _CompiledHeader(self, lang, arch): + assert self.compile_headers + h = self.compiled_headers[lang] + if arch: + h += "." + arch + return h + + def GetInclude(self, lang, arch=None): + """Gets the cflags to include the prefix header for language |lang|.""" + if self.compile_headers and lang in self.compiled_headers: + return "-include %s" % self._CompiledHeader(lang, arch) + elif self.header: + return "-include %s" % self.header + else: + return "" + + def _Gch(self, lang, arch): + """Returns the actual file name of the prefix header for language |lang|.""" + assert self.compile_headers + return self._CompiledHeader(lang, arch) + ".gch" + + def GetObjDependencies(self, sources, objs, arch=None): + """Given a list of source files and the corresponding object files, returns + a list of (source, object, gch) tuples, where |gch| is the build-directory + relative path to the gch file each object file depends on. |compilable[i]| + has to be the source file belonging to |objs[i]|.""" + if not self.header or not self.compile_headers: + return [] + + result = [] + for source, obj in zip(sources, objs): + ext = os.path.splitext(source)[1] + lang = { + ".c": "c", + ".cpp": "cc", + ".cc": "cc", + ".cxx": "cc", + ".m": "m", + ".mm": "mm", + }.get(ext, None) + if lang: + result.append((source, obj, self._Gch(lang, arch))) + return result + + def GetPchBuildCommands(self, arch=None): + """Returns [(path_to_gch, language_flag, language, header)]. + |path_to_gch| and |header| are relative to the build directory. + """ + if not self.header or not self.compile_headers: + return [] + return [ + (self._Gch("c", arch), "-x c-header", "c", self.header), + (self._Gch("cc", arch), "-x c++-header", "cc", self.header), + (self._Gch("m", arch), "-x objective-c-header", "m", self.header), + (self._Gch("mm", arch), "-x objective-c++-header", "mm", self.header), + ] + + +def XcodeVersion(): + """Returns a tuple of version and build version of installed Xcode.""" + # `xcodebuild -version` output looks like + # Xcode 4.6.3 + # Build version 4H1503 + # or like + # Xcode 3.2.6 + # Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0 + # BuildVersion: 10M2518 + # Convert that to ('0463', '4H1503') or ('0326', '10M2518'). + global XCODE_VERSION_CACHE + if XCODE_VERSION_CACHE: + return XCODE_VERSION_CACHE + version = "" + build = "" + try: + version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines() + # In some circumstances xcodebuild exits 0 but doesn't return + # the right results; for example, a user on 10.7 or 10.8 with + # a bogus path set via xcode-select + # In that case this may be a CLT-only install so fall back to + # checking that version. + if len(version_list) < 2: + raise GypError("xcodebuild returned unexpected results") + version = version_list[0].split()[-1] # Last word on first line + build = version_list[-1].split()[-1] # Last word on last line + except (GypError, OSError): + # Xcode not installed so look for XCode Command Line Tools + version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322 + if not version: + raise GypError("No Xcode or CLT version detected!") + # Be careful to convert "4.2.3" to "0423" and "11.0.0" to "1100": + version = version.split(".")[:3] # Just major, minor, micro + version[0] = version[0].zfill(2) # Add a leading zero if major is one digit + version = ("".join(version) + "00")[:4] # Limit to exactly four characters + XCODE_VERSION_CACHE = (version, build) + return XCODE_VERSION_CACHE + + +# This function ported from the logic in Homebrew's CLT version check +def CLTVersion(): + """Returns the version of command-line tools from pkgutil.""" + # pkgutil output looks like + # package-id: com.apple.pkg.CLTools_Executables + # version: 5.0.1.0.1.1382131676 + # volume: / + # location: / + # install-time: 1382544035 + # groups: com.apple.FindSystemFiles.pkg-group + # com.apple.DevToolsBoth.pkg-group + # com.apple.DevToolsNonRelocatableShared.pkg-group + STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo" + FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI" + MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables" + + regex = re.compile(r"version: (?P.+)") + for key in [MAVERICKS_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID]: + try: + output = GetStdout(["/usr/sbin/pkgutil", "--pkg-info", key]) + if m := re.search(regex, output): + return m.groupdict()["version"] + except (GypError, OSError): + continue + + regex = re.compile(r"Command Line Tools for Xcode\s+(?P\S+)") + try: + output = GetStdout(["/usr/sbin/softwareupdate", "--history"]) + if m := re.search(regex, output): + return m.groupdict()["version"] + except (GypError, OSError): + return None + + +def GetStdoutQuiet(cmdlist): + """Returns the content of standard output returned by invoking |cmdlist|. + Ignores the stderr. + Raises |GypError| if the command return with a non-zero return code.""" + job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out = job.communicate()[0].decode("utf-8") + if job.returncode != 0: + raise GypError("Error %d running %s" % (job.returncode, cmdlist[0])) + return out.rstrip("\n") + + +def GetStdout(cmdlist): + """Returns the content of standard output returned by invoking |cmdlist|. + Raises |GypError| if the command return with a non-zero return code.""" + job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE) + out = job.communicate()[0].decode("utf-8") + if job.returncode != 0: + sys.stderr.write(out + "\n") + raise GypError("Error %d running %s" % (job.returncode, cmdlist[0])) + return out.rstrip("\n") + + +def MergeGlobalXcodeSettingsToSpec(global_dict, spec): + """Merges the global xcode_settings dictionary into each configuration of the + target represented by spec. For keys that are both in the global and the local + xcode_settings dict, the local key gets precedence. + """ + # The xcode generator special-cases global xcode_settings and does something + # that amounts to merging in the global xcode_settings into each local + # xcode_settings dict. + global_xcode_settings = global_dict.get("xcode_settings", {}) + for config in spec["configurations"].values(): + if "xcode_settings" in config: + new_settings = global_xcode_settings.copy() + new_settings.update(config["xcode_settings"]) + config["xcode_settings"] = new_settings + + +def IsMacBundle(flavor, spec): + """Returns if |spec| should be treated as a bundle. + + Bundles are directories with a certain subdirectory structure, instead of + just a single file. Bundle rules do not produce a binary but also package + resources into that directory.""" + is_mac_bundle = ( + int(spec.get("mac_xctest_bundle", 0)) != 0 + or int(spec.get("mac_xcuitest_bundle", 0)) != 0 + or (int(spec.get("mac_bundle", 0)) != 0 and flavor == "mac") + ) + + if is_mac_bundle: + assert spec["type"] != "none", ( + 'mac_bundle targets cannot have type none (target "%s")' + % spec["target_name"] + ) + return is_mac_bundle + + +def GetMacBundleResources(product_dir, xcode_settings, resources): + """Yields (output, resource) pairs for every resource in |resources|. + Only call this for mac bundle targets. + + Args: + product_dir: Path to the directory containing the output bundle, + relative to the build directory. + xcode_settings: The XcodeSettings of the current target. + resources: A list of bundle resources, relative to the build directory. + """ + dest = os.path.join(product_dir, xcode_settings.GetBundleResourceFolder()) + for res in resources: + output = dest + + # The make generator doesn't support it, so forbid it everywhere + # to keep the generators more interchangeable. + assert " " not in res, "Spaces in resource filenames not supported (%s)" % res + + # Split into (path,file). + res_parts = os.path.split(res) + + # Now split the path into (prefix,maybe.lproj). + lproj_parts = os.path.split(res_parts[0]) + # If the resource lives in a .lproj bundle, add that to the destination. + if lproj_parts[1].endswith(".lproj"): + output = os.path.join(output, lproj_parts[1]) + + output = os.path.join(output, res_parts[1]) + # Compiled XIB files are referred to by .nib. + if output.endswith(".xib"): + output = os.path.splitext(output)[0] + ".nib" + # Compiled storyboard files are referred to by .storyboardc. + if output.endswith(".storyboard"): + output = os.path.splitext(output)[0] + ".storyboardc" + + yield output, res + + +def GetMacInfoPlist(product_dir, xcode_settings, gyp_path_to_build_path): + """Returns (info_plist, dest_plist, defines, extra_env), where: + * |info_plist| is the source plist path, relative to the + build directory, + * |dest_plist| is the destination plist path, relative to the + build directory, + * |defines| is a list of preprocessor defines (empty if the plist + shouldn't be preprocessed, + * |extra_env| is a dict of env variables that should be exported when + invoking |mac_tool copy-info-plist|. + + Only call this for mac bundle targets. + + Args: + product_dir: Path to the directory containing the output bundle, + relative to the build directory. + xcode_settings: The XcodeSettings of the current target. + gyp_to_build_path: A function that converts paths relative to the + current gyp file to paths relative to the build directory. + """ + info_plist = xcode_settings.GetPerTargetSetting("INFOPLIST_FILE") + if not info_plist: + return None, None, [], {} + + # The make generator doesn't support it, so forbid it everywhere + # to keep the generators more interchangeable. + assert " " not in info_plist, ( + "Spaces in Info.plist filenames not supported (%s)" % info_plist + ) + + info_plist = gyp_path_to_build_path(info_plist) + + # If explicitly set to preprocess the plist, invoke the C preprocessor and + # specify any defines as -D flags. + if ( + xcode_settings.GetPerTargetSetting("INFOPLIST_PREPROCESS", default="NO") + == "YES" + ): + # Create an intermediate file based on the path. + defines = shlex.split( + xcode_settings.GetPerTargetSetting( + "INFOPLIST_PREPROCESSOR_DEFINITIONS", default="" + ) + ) + else: + defines = [] + + dest_plist = os.path.join(product_dir, xcode_settings.GetBundlePlistPath()) + extra_env = xcode_settings.GetPerTargetSettings() + + return info_plist, dest_plist, defines, extra_env + + +def _GetXcodeEnv( + xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None +): + """Return the environment variables that Xcode would set. See + http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153 + for a full list. + + Args: + xcode_settings: An XcodeSettings object. If this is None, this function + returns an empty dict. + built_products_dir: Absolute path to the built products dir. + srcroot: Absolute path to the source root. + configuration: The build configuration name. + additional_settings: An optional dict with more values to add to the + result. + """ + + if not xcode_settings: + return {} + + # This function is considered a friend of XcodeSettings, so let it reach into + # its implementation details. + spec = xcode_settings.spec + + # These are filled in on an as-needed basis. + env = { + "BUILT_FRAMEWORKS_DIR": built_products_dir, + "BUILT_PRODUCTS_DIR": built_products_dir, + "CONFIGURATION": configuration, + "PRODUCT_NAME": xcode_settings.GetProductName(), + # For FULL_PRODUCT_NAME see: + # /Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/MacOSX\ Product\ Types.xcspec # noqa: E501 + "SRCROOT": srcroot, + "SOURCE_ROOT": "${SRCROOT}", + # This is not true for static libraries, but currently the env is only + # written for bundles: + "TARGET_BUILD_DIR": built_products_dir, + "TEMP_DIR": "${TMPDIR}", + "XCODE_VERSION_ACTUAL": XcodeVersion()[0], + } + if xcode_settings.GetPerConfigSetting("SDKROOT", configuration): + env["SDKROOT"] = xcode_settings._SdkPath(configuration) + else: + env["SDKROOT"] = "" + + if xcode_settings.mac_toolchain_dir: + env["DEVELOPER_DIR"] = xcode_settings.mac_toolchain_dir + + if spec["type"] in ( + "executable", + "static_library", + "shared_library", + "loadable_module", + ): + env["EXECUTABLE_NAME"] = xcode_settings.GetExecutableName() + env["EXECUTABLE_PATH"] = xcode_settings.GetExecutablePath() + env["FULL_PRODUCT_NAME"] = xcode_settings.GetFullProductName() + mach_o_type = xcode_settings.GetMachOType() + if mach_o_type: + env["MACH_O_TYPE"] = mach_o_type + env["PRODUCT_TYPE"] = xcode_settings.GetProductType() + if xcode_settings._IsBundle(): + # xcodeproj_file.py sets the same Xcode subfolder value for this as for + # FRAMEWORKS_FOLDER_PATH so Xcode builds will actually use FFP's value. + env["BUILT_FRAMEWORKS_DIR"] = os.path.join( + built_products_dir + os.sep + xcode_settings.GetBundleFrameworksFolderPath() + ) + env["CONTENTS_FOLDER_PATH"] = xcode_settings.GetBundleContentsFolderPath() + env["EXECUTABLE_FOLDER_PATH"] = xcode_settings.GetBundleExecutableFolderPath() + env["UNLOCALIZED_RESOURCES_FOLDER_PATH"] = ( + xcode_settings.GetBundleResourceFolder() + ) + env["JAVA_FOLDER_PATH"] = xcode_settings.GetBundleJavaFolderPath() + env["FRAMEWORKS_FOLDER_PATH"] = xcode_settings.GetBundleFrameworksFolderPath() + env["SHARED_FRAMEWORKS_FOLDER_PATH"] = ( + xcode_settings.GetBundleSharedFrameworksFolderPath() + ) + env["SHARED_SUPPORT_FOLDER_PATH"] = ( + xcode_settings.GetBundleSharedSupportFolderPath() + ) + env["PLUGINS_FOLDER_PATH"] = xcode_settings.GetBundlePlugInsFolderPath() + env["XPCSERVICES_FOLDER_PATH"] = xcode_settings.GetBundleXPCServicesFolderPath() + env["INFOPLIST_PATH"] = xcode_settings.GetBundlePlistPath() + env["WRAPPER_NAME"] = xcode_settings.GetWrapperName() + + if install_name := xcode_settings.GetInstallName(): + env["LD_DYLIB_INSTALL_NAME"] = install_name + if install_name_base := xcode_settings.GetInstallNameBase(): + env["DYLIB_INSTALL_NAME_BASE"] = install_name_base + xcode_version, _ = XcodeVersion() + if xcode_version >= "0500" and not env.get("SDKROOT"): + sdk_root = xcode_settings._SdkRoot(configuration) + if not sdk_root: + sdk_root = xcode_settings._XcodeSdkPath("") + if sdk_root is None: + sdk_root = "" + env["SDKROOT"] = sdk_root + + if not additional_settings: + additional_settings = {} + else: + # Flatten lists to strings. + for k in additional_settings: + if not isinstance(additional_settings[k], str): + additional_settings[k] = " ".join(additional_settings[k]) + additional_settings.update(env) + + for k in additional_settings: + additional_settings[k] = _NormalizeEnvVarReferences(additional_settings[k]) + + return additional_settings + + +def _NormalizeEnvVarReferences(str): + """Takes a string containing variable references in the form ${FOO}, $(FOO), + or $FOO, and returns a string with all variable references in the form ${FOO}. + """ + # $FOO -> ${FOO} + str = re.sub(r"\$([a-zA-Z_][a-zA-Z0-9_]*)", r"${\1}", str) + + # $(FOO) -> ${FOO} + matches = re.findall(r"(\$\(([a-zA-Z0-9\-_]+)\))", str) + for match in matches: + to_replace, variable = match + assert "$(" not in match, "$($(FOO)) variables not supported: " + match + str = str.replace(to_replace, "${" + variable + "}") + + return str + + +def ExpandEnvVars(string, expansions): + """Expands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the + expansions list. If the variable expands to something that references + another variable, this variable is expanded as well if it's in env -- + until no variables present in env are left.""" + for k, v in reversed(expansions): + string = string.replace("${" + k + "}", v) + string = string.replace("$(" + k + ")", v) + string = string.replace("$" + k, v) + return string + + +def _TopologicallySortedEnvVarKeys(env): + """Takes a dict |env| whose values are strings that can refer to other keys, + for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of + env such that key2 is after key1 in L if env[key2] refers to env[key1]. + + Throws an Exception in case of dependency cycles. + """ + # Since environment variables can refer to other variables, the evaluation + # order is important. Below is the logic to compute the dependency graph + # and sort it. + regex = re.compile(r"\$\{([a-zA-Z0-9\-_]+)\}") + + def GetEdges(node): + # Use a definition of edges such that user_of_variable -> used_variable. + # This happens to be easier in this case, since a variable's + # definition contains all variables it references in a single string. + # We can then reverse the result of the topological sort at the end. + # Since: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) + matches = {v for v in regex.findall(env[node]) if v in env} + for dependee in matches: + assert "${" not in dependee, "Nested variables not supported: " + dependee + return matches + + try: + # Topologically sort, and then reverse, because we used an edge definition + # that's inverted from the expected result of this function (see comment + # above). + order = gyp.common.TopologicallySorted(env.keys(), GetEdges) + order.reverse() + return order + except gyp.common.CycleError as e: + raise GypError( + "Xcode environment variables are cyclically dependent: " + str(e.nodes) + ) + + +def GetSortedXcodeEnv( + xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None +): + env = _GetXcodeEnv( + xcode_settings, built_products_dir, srcroot, configuration, additional_settings + ) + return [(key, env[key]) for key in _TopologicallySortedEnvVarKeys(env)] + + +def GetSpecPostbuildCommands(spec, quiet=False): + """Returns the list of postbuilds explicitly defined on |spec|, in a form + executable by a shell.""" + postbuilds = [] + for postbuild in spec.get("postbuilds", []): + if not quiet: + postbuilds.append( + "echo POSTBUILD\\(%s\\) %s" + % (spec["target_name"], postbuild["postbuild_name"]) + ) + postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild["action"])) + return postbuilds + + +def _HasIOSTarget(targets): + """Returns true if any target contains the iOS specific key + IPHONEOS_DEPLOYMENT_TARGET.""" + for target_dict in targets.values(): + for config in target_dict["configurations"].values(): + if config.get("xcode_settings", {}).get("IPHONEOS_DEPLOYMENT_TARGET"): + return True + return False + + +def _AddIOSDeviceConfigurations(targets): + """Clone all targets and append -iphoneos to the name. Configure these targets + to build for iOS devices and use correct architectures for those builds.""" + for target_dict in targets.values(): + toolset = target_dict["toolset"] + configs = target_dict["configurations"] + for config_name, simulator_config_dict in dict(configs).items(): + iphoneos_config_dict = copy.deepcopy(simulator_config_dict) + configs[config_name + "-iphoneos"] = iphoneos_config_dict + configs[config_name + "-iphonesimulator"] = simulator_config_dict + if toolset == "target": + simulator_config_dict["xcode_settings"]["SDKROOT"] = "iphonesimulator" + iphoneos_config_dict["xcode_settings"]["SDKROOT"] = "iphoneos" + return targets + + +def CloneConfigurationForDeviceAndEmulator(target_dicts): + """If |target_dicts| contains any iOS targets, automatically create -iphoneos + targets for iOS device builds.""" + if _HasIOSTarget(target_dicts): + return _AddIOSDeviceConfigurations(target_dicts) + return target_dicts diff --git a/.pnpm-store/v11/files/3b/2a3a5626bf64c79e5c7adf7bd68c6387d95543bd47baf68c224588aed7cb0c97ebba122bc37549741cf7a9f1d5d0f5bfad8ab9574f08699d994b5be59f9847 b/.pnpm-store/v11/files/3b/2a3a5626bf64c79e5c7adf7bd68c6387d95543bd47baf68c224588aed7cb0c97ebba122bc37549741cf7a9f1d5d0f5bfad8ab9574f08699d994b5be59f9847 new file mode 100644 index 0000000000..f17aaccfa5 --- /dev/null +++ b/.pnpm-store/v11/files/3b/2a3a5626bf64c79e5c7adf7bd68c6387d95543bd47baf68c224588aed7cb0c97ebba122bc37549741cf7a9f1d5d0f5bfad8ab9574f08699d994b5be59f9847 @@ -0,0 +1,41 @@ +{ + "name": "abbrev", + "version": "4.0.0", + "description": "Like ruby's abbrev module, but in js", + "author": "GitHub Inc.", + "main": "lib/index.js", + "scripts": { + "test": "node --test", + "lint": "npm run eslint", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run eslint -- --fix", + "snap": "node --test --test-update-snapshots", + "posttest": "npm run lint", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "test:cover": "node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/abbrev-js.git" + }, + "license": "ISC", + "devDependencies": { + "@npmcli/eslint-config": "^5.0.0", + "@npmcli/template-oss": "4.26.1" + }, + "files": [ + "bin/", + "lib/" + ], + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.26.1", + "publish": true, + "testRunner": "node:test", + "latestCiVersion": 24 + } +} diff --git a/.pnpm-store/v11/files/3b/4c15112cddedb7ba486d32d9818648565ad22ba943e7374a3bb8b0497812e80cac595f4d3ba4c756867c72f643108c842cc25cb7ae4c8b8f9ae019764b2f8d b/.pnpm-store/v11/files/3b/4c15112cddedb7ba486d32d9818648565ad22ba943e7374a3bb8b0497812e80cac595f4d3ba4c756867c72f643108c842cc25cb7ae4c8b8f9ae019764b2f8d new file mode 100644 index 0000000000..6a1b6bd383 --- /dev/null +++ b/.pnpm-store/v11/files/3b/4c15112cddedb7ba486d32d9818648565ad22ba943e7374a3bb8b0497812e80cac595f4d3ba4c756867c72f643108c842cc25cb7ae4c8b8f9ae019764b2f8d @@ -0,0 +1,124 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var options_1 = require("./options"); +var delay_factory_1 = require("./delay/delay.factory"); +/** + * Executes a function with exponential backoff. + * @param request the function to be executed + * @param options options to customize the backoff behavior + * @returns Promise that resolves to the result of the `request` function + */ +function backOff(request, options) { + if (options === void 0) { options = {}; } + return __awaiter(this, void 0, void 0, function () { + var sanitizedOptions, backOff; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + sanitizedOptions = options_1.getSanitizedOptions(options); + backOff = new BackOff(request, sanitizedOptions); + return [4 /*yield*/, backOff.execute()]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); +} +exports.backOff = backOff; +var BackOff = /** @class */ (function () { + function BackOff(request, options) { + this.request = request; + this.options = options; + this.attemptNumber = 0; + } + BackOff.prototype.execute = function () { + return __awaiter(this, void 0, void 0, function () { + var e_1, shouldRetry; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!!this.attemptLimitReached) return [3 /*break*/, 7]; + _a.label = 1; + case 1: + _a.trys.push([1, 4, , 6]); + return [4 /*yield*/, this.applyDelay()]; + case 2: + _a.sent(); + return [4 /*yield*/, this.request()]; + case 3: return [2 /*return*/, _a.sent()]; + case 4: + e_1 = _a.sent(); + this.attemptNumber++; + return [4 /*yield*/, this.options.retry(e_1, this.attemptNumber)]; + case 5: + shouldRetry = _a.sent(); + if (!shouldRetry || this.attemptLimitReached) { + throw e_1; + } + return [3 /*break*/, 6]; + case 6: return [3 /*break*/, 0]; + case 7: throw new Error("Something went wrong."); + } + }); + }); + }; + Object.defineProperty(BackOff.prototype, "attemptLimitReached", { + get: function () { + return this.attemptNumber >= this.options.numOfAttempts; + }, + enumerable: true, + configurable: true + }); + BackOff.prototype.applyDelay = function () { + return __awaiter(this, void 0, void 0, function () { + var delay; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + delay = delay_factory_1.DelayFactory(this.options, this.attemptNumber); + return [4 /*yield*/, delay.apply()]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + return BackOff; +}()); +//# sourceMappingURL=backoff.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/3b/5e2e5115021fcbb9ac904e00c9f16225f944575ff2abfefc2cd5bc601784b9827dc813d27e5917247600bb22ace14925348a3b3baee4a6818734dd37404147 b/.pnpm-store/v11/files/3b/5e2e5115021fcbb9ac904e00c9f16225f944575ff2abfefc2cd5bc601784b9827dc813d27e5917247600bb22ace14925348a3b3baee4a6818734dd37404147 new file mode 100644 index 0000000000..be17d62877 --- /dev/null +++ b/.pnpm-store/v11/files/3b/5e2e5115021fcbb9ac904e00c9f16225f944575ff2abfefc2cd5bc601784b9827dc813d27e5917247600bb22ace14925348a3b3baee4a6818734dd37404147 @@ -0,0 +1,214 @@ +'use strict' + +const assert = require('node:assert') +const { Readable } = require('./readable') +const { InvalidArgumentError, RequestAbortedError } = require('../core/errors') +const util = require('../core/util') +const { getResolveErrorBodyCallback } = require('./util') +const { AsyncResource } = require('node:async_hooks') + +class RequestHandler extends AsyncResource { + constructor (opts, callback) { + if (!opts || typeof opts !== 'object') { + throw new InvalidArgumentError('invalid opts') + } + + const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts + + try { + if (typeof callback !== 'function') { + throw new InvalidArgumentError('invalid callback') + } + + if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) { + throw new InvalidArgumentError('invalid highWaterMark') + } + + if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { + throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') + } + + if (method === 'CONNECT') { + throw new InvalidArgumentError('invalid method') + } + + if (onInfo && typeof onInfo !== 'function') { + throw new InvalidArgumentError('invalid onInfo callback') + } + + super('UNDICI_REQUEST') + } catch (err) { + if (util.isStream(body)) { + util.destroy(body.on('error', util.nop), err) + } + throw err + } + + this.method = method + this.responseHeaders = responseHeaders || null + this.opaque = opaque || null + this.callback = callback + this.res = null + this.abort = null + this.body = body + this.trailers = {} + this.context = null + this.onInfo = onInfo || null + this.throwOnError = throwOnError + this.highWaterMark = highWaterMark + this.signal = signal + this.reason = null + this.removeAbortListener = null + + if (util.isStream(body)) { + body.on('error', (err) => { + this.onError(err) + }) + } + + if (this.signal) { + if (this.signal.aborted) { + this.reason = this.signal.reason ?? new RequestAbortedError() + } else { + this.removeAbortListener = util.addAbortListener(this.signal, () => { + this.reason = this.signal.reason ?? new RequestAbortedError() + if (this.res) { + util.destroy(this.res.on('error', util.nop), this.reason) + } else if (this.abort) { + this.abort(this.reason) + } + + if (this.removeAbortListener) { + this.res?.off('close', this.removeAbortListener) + this.removeAbortListener() + this.removeAbortListener = null + } + }) + } + } + } + + onConnect (abort, context) { + if (this.reason) { + abort(this.reason) + return + } + + assert(this.callback) + + this.abort = abort + this.context = context + } + + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this + + const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) + + if (statusCode < 200) { + if (this.onInfo) { + this.onInfo({ statusCode, headers }) + } + return + } + + const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers + const contentType = parsedHeaders['content-type'] + const contentLength = parsedHeaders['content-length'] + const res = new Readable({ + resume, + abort, + contentType, + contentLength: this.method !== 'HEAD' && contentLength + ? Number(contentLength) + : null, + highWaterMark + }) + + if (this.removeAbortListener) { + res.on('close', this.removeAbortListener) + } + + this.callback = null + this.res = res + if (callback !== null) { + if (this.throwOnError && statusCode >= 400) { + this.runInAsyncScope(getResolveErrorBodyCallback, null, + { callback, body: res, contentType, statusCode, statusMessage, headers } + ) + } else { + this.runInAsyncScope(callback, null, null, { + statusCode, + headers, + trailers: this.trailers, + opaque, + body: res, + context + }) + } + } + } + + onData (chunk) { + return this.res.push(chunk) + } + + onComplete (trailers) { + util.parseHeaders(trailers, this.trailers) + this.res.push(null) + } + + onError (err) { + const { res, callback, body, opaque } = this + + if (callback) { + // TODO: Does this need queueMicrotask? + this.callback = null + queueMicrotask(() => { + this.runInAsyncScope(callback, null, err, { opaque }) + }) + } + + if (res) { + this.res = null + // Ensure all queued handlers are invoked before destroying res. + queueMicrotask(() => { + util.destroy(res, err) + }) + } + + if (body) { + this.body = null + util.destroy(body, err) + } + + if (this.removeAbortListener) { + res?.off('close', this.removeAbortListener) + this.removeAbortListener() + this.removeAbortListener = null + } + } +} + +function request (opts, callback) { + if (callback === undefined) { + return new Promise((resolve, reject) => { + request.call(this, opts, (err, data) => { + return err ? reject(err) : resolve(data) + }) + }) + } + + try { + this.dispatch(opts, new RequestHandler(opts, callback)) + } catch (err) { + if (typeof callback !== 'function') { + throw err + } + const opaque = opts?.opaque + queueMicrotask(() => callback(err, { opaque })) + } +} + +module.exports = request +module.exports.RequestHandler = RequestHandler diff --git a/.pnpm-store/v11/files/3b/e50528525919402ee3ea530b57fb8904a149552cf4f2a79a36383ea96b9882f8c13cdd7e186480fb8ae52384a8ee4c74ec958477608d975055b4a9191340bb b/.pnpm-store/v11/files/3b/e50528525919402ee3ea530b57fb8904a149552cf4f2a79a36383ea96b9882f8c13cdd7e186480fb8ae52384a8ee4c74ec958477608d975055b4a9191340bb new file mode 100644 index 0000000000..82d7d502ae --- /dev/null +++ b/.pnpm-store/v11/files/3b/e50528525919402ee3ea530b57fb8904a149552cf4f2a79a36383ea96b9882f8c13cdd7e186480fb8ae52384a8ee4c74ec958477608d975055b4a9191340bb @@ -0,0 +1,32 @@ +"use strict"; +// Get the appropriate flag to use for creating files +// We use fmap on Windows platforms for files less than +// 512kb. This is a fairly low limit, but avoids making +// things slower in some cases. Since most of what this +// library is used for is extracting tarballs of many +// relatively small files in npm packages and the like, +// it can be a big boost on Windows platforms. +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getWriteFlag = void 0; +const fs_1 = __importDefault(require("fs")); +const platform = process.env.__FAKE_PLATFORM__ || process.platform; +const isWindows = platform === 'win32'; +/* c8 ignore start */ +const { O_CREAT, O_NOFOLLOW, O_TRUNC, O_WRONLY } = fs_1.default.constants; +const UV_FS_O_FILEMAP = Number(process.env.__FAKE_FS_O_FILENAME__) || + fs_1.default.constants.UV_FS_O_FILEMAP || + 0; +/* c8 ignore stop */ +const fMapEnabled = isWindows && !!UV_FS_O_FILEMAP; +const fMapLimit = 512 * 1024; +const fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY; +const noFollowFlag = !isWindows && typeof O_NOFOLLOW === 'number' ? + O_NOFOLLOW | O_TRUNC | O_CREAT | O_WRONLY + : null; +exports.getWriteFlag = noFollowFlag !== null ? () => noFollowFlag + : !fMapEnabled ? () => 'w' + : (size) => (size < fMapLimit ? fMapFlag : 'w'); +//# sourceMappingURL=get-write-flag.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/3b/ee167c68b96ff816f58063691d7771d02667c3ad4a9f95d877e0fe418733145be087042b03e7a306b3e6ce29e48b13cf1b8f0479ba1f0fb5219efd25317054 b/.pnpm-store/v11/files/3b/ee167c68b96ff816f58063691d7771d02667c3ad4a9f95d877e0fe418733145be087042b03e7a306b3e6ce29e48b13cf1b8f0479ba1f0fb5219efd25317054 new file mode 100644 index 0000000000..323aa9ee6f --- /dev/null +++ b/.pnpm-store/v11/files/3b/ee167c68b96ff816f58063691d7771d02667c3ad4a9f95d877e0fe418733145be087042b03e7a306b3e6ce29e48b13cf1b8f0479ba1f0fb5219efd25317054 @@ -0,0 +1,184 @@ +'use strict' + +const { parseSetCookie } = require('./parse') +const { stringify } = require('./util') +const { webidl } = require('../fetch/webidl') +const { Headers } = require('../fetch/headers') + +/** + * @typedef {Object} Cookie + * @property {string} name + * @property {string} value + * @property {Date|number|undefined} expires + * @property {number|undefined} maxAge + * @property {string|undefined} domain + * @property {string|undefined} path + * @property {boolean|undefined} secure + * @property {boolean|undefined} httpOnly + * @property {'Strict'|'Lax'|'None'} sameSite + * @property {string[]} unparsed + */ + +/** + * @param {Headers} headers + * @returns {Record} + */ +function getCookies (headers) { + webidl.argumentLengthCheck(arguments, 1, 'getCookies') + + webidl.brandCheck(headers, Headers, { strict: false }) + + const cookie = headers.get('cookie') + const out = {} + + if (!cookie) { + return out + } + + for (const piece of cookie.split(';')) { + const [name, ...value] = piece.split('=') + + out[name.trim()] = value.join('=') + } + + return out +} + +/** + * @param {Headers} headers + * @param {string} name + * @param {{ path?: string, domain?: string }|undefined} attributes + * @returns {void} + */ +function deleteCookie (headers, name, attributes) { + webidl.brandCheck(headers, Headers, { strict: false }) + + const prefix = 'deleteCookie' + webidl.argumentLengthCheck(arguments, 2, prefix) + + name = webidl.converters.DOMString(name, prefix, 'name') + attributes = webidl.converters.DeleteCookieAttributes(attributes) + + // Matches behavior of + // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278 + setCookie(headers, { + name, + value: '', + expires: new Date(0), + ...attributes + }) +} + +/** + * @param {Headers} headers + * @returns {Cookie[]} + */ +function getSetCookies (headers) { + webidl.argumentLengthCheck(arguments, 1, 'getSetCookies') + + webidl.brandCheck(headers, Headers, { strict: false }) + + const cookies = headers.getSetCookie() + + if (!cookies) { + return [] + } + + return cookies.map((pair) => parseSetCookie(pair)) +} + +/** + * @param {Headers} headers + * @param {Cookie} cookie + * @returns {void} + */ +function setCookie (headers, cookie) { + webidl.argumentLengthCheck(arguments, 2, 'setCookie') + + webidl.brandCheck(headers, Headers, { strict: false }) + + cookie = webidl.converters.Cookie(cookie) + + const str = stringify(cookie) + + if (str) { + headers.append('Set-Cookie', str) + } +} + +webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'path', + defaultValue: () => null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'domain', + defaultValue: () => null + } +]) + +webidl.converters.Cookie = webidl.dictionaryConverter([ + { + converter: webidl.converters.DOMString, + key: 'name' + }, + { + converter: webidl.converters.DOMString, + key: 'value' + }, + { + converter: webidl.nullableConverter((value) => { + if (typeof value === 'number') { + return webidl.converters['unsigned long long'](value) + } + + return new Date(value) + }), + key: 'expires', + defaultValue: () => null + }, + { + converter: webidl.nullableConverter(webidl.converters['long long']), + key: 'maxAge', + defaultValue: () => null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'domain', + defaultValue: () => null + }, + { + converter: webidl.nullableConverter(webidl.converters.DOMString), + key: 'path', + defaultValue: () => null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: 'secure', + defaultValue: () => null + }, + { + converter: webidl.nullableConverter(webidl.converters.boolean), + key: 'httpOnly', + defaultValue: () => null + }, + { + converter: webidl.converters.USVString, + key: 'sameSite', + allowedValues: ['Strict', 'Lax', 'None'] + }, + { + converter: webidl.sequenceConverter(webidl.converters.DOMString), + key: 'unparsed', + defaultValue: () => new Array(0) + } +]) + +module.exports = { + getCookies, + deleteCookie, + getSetCookies, + setCookie +} diff --git a/.pnpm-store/v11/files/3b/f6be69f09dac956389e2d46afdfb76ba2a633e2aa416001e5f96e3e8444cab18b1f497d2220de09d0f94afe696557719803aab299954ca3fdecb882d51227c b/.pnpm-store/v11/files/3b/f6be69f09dac956389e2d46afdfb76ba2a633e2aa416001e5f96e3e8444cab18b1f497d2220de09d0f94afe696557719803aab299954ca3fdecb882d51227c new file mode 100644 index 0000000000..cdc373a563 --- /dev/null +++ b/.pnpm-store/v11/files/3b/f6be69f09dac956389e2d46afdfb76ba2a633e2aa416001e5f96e3e8444cab18b1f497d2220de09d0f94afe696557719803aab299954ca3fdecb882d51227c @@ -0,0 +1,38 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") +basedir_win="$basedir" +exe="" +msys="" + +case `uname -a` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir_win=`cygpath -w "$basedir"` + fi + exe=".exe" + msys="true" + ;; + *WSL2*) + if command -v wslpath > /dev/null 2>&1; then + basedir_win="$(wslpath -w "$basedir" 2> /dev/null)" + if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then + basedir_win="$basedir" + else + exe=".exe" + fi + fi + ;; +esac + +if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then + exec "$basedir/node.exe" "$basedir_win/../which/bin/which.js" "$@" +elif [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../which/bin/which.js" "$@" +elif command -v node >/dev/null 2>&1; then + exec node "$basedir/../which/bin/which.js" "$@" +elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then + exec node.exe "$basedir_win/../which/bin/which.js" "$@" +else + exec node "$basedir/../which/bin/which.js" "$@" +fi +# cmd-shim-target=/Users/runner/work/pnpm/pnpm/pnpm11/pnpm/temp-deploy/node_modules/which/./bin/which.js diff --git a/.pnpm-store/v11/files/3c/e5970e98a2724c15a6c2269222136910f6c273c92b0c2dd66c6fa7a4b3c3c9e907b43eaf2ddebcc073cd12e5566f91e8320347bc4c07605a2b3ed5a067ca79 b/.pnpm-store/v11/files/3c/e5970e98a2724c15a6c2269222136910f6c273c92b0c2dd66c6fa7a4b3c3c9e907b43eaf2ddebcc073cd12e5566f91e8320347bc4c07605a2b3ed5a067ca79 new file mode 100644 index 0000000000..117f6bead9 --- /dev/null +++ b/.pnpm-store/v11/files/3c/e5970e98a2724c15a6c2269222136910f6c273c92b0c2dd66c6fa7a4b3c3c9e907b43eaf2ddebcc073cd12e5566f91e8320347bc4c07605a2b3ed5a067ca79 @@ -0,0 +1,166 @@ +// A path exclusive reservation system +// reserve([list, of, paths], fn) +// When the fn is first in line for all its paths, it +// is called with a cb that clears the reservation. +// +// Used by async unpack to avoid clobbering paths in use, +// while still allowing maximal safe parallelization. +import { join } from 'node:path'; +import { normalizeUnicode } from './normalize-unicode.js'; +import { stripTrailingSlashes } from './strip-trailing-slashes.js'; +const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform; +const isWindows = platform === 'win32'; +// return a set of parent dirs for a given path +// '/a/b/c/d' -> ['/', '/a', '/a/b', '/a/b/c', '/a/b/c/d'] +const getDirs = (path) => { + const dirs = path + .split('/') + .slice(0, -1) + .reduce((set, path) => { + const s = set.at(-1); + if (s !== undefined) { + path = join(s, path); + } + set.push(path || '/'); + return set; + }, []); + return dirs; +}; +export class PathReservations { + // path => [function or Set] + // A Set object means a directory reservation + // A fn is a direct reservation on that path + #queues = new Map(); + // fn => {paths:[path,...], dirs:[path, ...]} + #reservations = new Map(); + // functions currently running + #running = new Set(); + reserve(paths, fn) { + paths = + isWindows ? + ['win32 parallelization disabled'] + : paths.map(p => { + // don't need normPath, because we skip this entirely for windows + return stripTrailingSlashes(join(normalizeUnicode(p))); + }); + const dirs = new Set(paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b))); + this.#reservations.set(fn, { dirs, paths }); + for (const p of paths) { + const q = this.#queues.get(p); + if (!q) { + this.#queues.set(p, [fn]); + } + else { + q.push(fn); + } + } + for (const dir of dirs) { + const q = this.#queues.get(dir); + if (!q) { + this.#queues.set(dir, [new Set([fn])]); + } + else { + const l = q.at(-1); + if (l instanceof Set) { + l.add(fn); + } + else { + q.push(new Set([fn])); + } + } + } + return this.#run(fn); + } + // return the queues for each path the function cares about + // fn => {paths, dirs} + #getQueues(fn) { + const res = this.#reservations.get(fn); + /* c8 ignore start */ + if (!res) { + throw new Error('function does not have any path reservations'); + } + /* c8 ignore stop */ + return { + paths: res.paths.map((path) => this.#queues.get(path)), + dirs: [...res.dirs].map(path => this.#queues.get(path)), + }; + } + // check if fn is first in line for all its paths, and is + // included in the first set for all its dir queues + check(fn) { + const { paths, dirs } = this.#getQueues(fn); + return (paths.every(q => q && q[0] === fn) && + dirs.every(q => q && q[0] instanceof Set && q[0].has(fn))); + } + // run the function if it's first in line and not already running + #run(fn) { + if (this.#running.has(fn) || !this.check(fn)) { + return false; + } + this.#running.add(fn); + fn(() => this.#clear(fn)); + return true; + } + #clear(fn) { + if (!this.#running.has(fn)) { + return false; + } + const res = this.#reservations.get(fn); + /* c8 ignore start */ + if (!res) { + throw new Error('invalid reservation'); + } + /* c8 ignore stop */ + const { paths, dirs } = res; + const next = new Set(); + for (const path of paths) { + const q = this.#queues.get(path); + /* c8 ignore start */ + if (!q || q?.[0] !== fn) { + continue; + } + /* c8 ignore stop */ + const q0 = q[1]; + if (!q0) { + this.#queues.delete(path); + continue; + } + q.shift(); + if (typeof q0 === 'function') { + next.add(q0); + } + else { + for (const f of q0) { + next.add(f); + } + } + } + for (const dir of dirs) { + const q = this.#queues.get(dir); + const q0 = q?.[0]; + /* c8 ignore next - type safety only */ + if (!q || !(q0 instanceof Set)) + continue; + if (q0.size === 1 && q.length === 1) { + this.#queues.delete(dir); + continue; + } + else if (q0.size === 1) { + q.shift(); + // next one must be a function, + // or else the Set would've been reused + const n = q[0]; + if (typeof n === 'function') { + next.add(n); + } + } + else { + q0.delete(fn); + } + } + this.#running.delete(fn); + next.forEach(fn => this.#run(fn)); + return true; + } +} +//# sourceMappingURL=path-reservations.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/3d/1da922de6a18bd9d70e237981c5ef0bdc526ae15c49ca48afb39cd07a99d8c308949bf1d31db689e934c43229db8f2bc0cc646c614de8711ed975c85050d89 b/.pnpm-store/v11/files/3d/1da922de6a18bd9d70e237981c5ef0bdc526ae15c49ca48afb39cd07a99d8c308949bf1d31db689e934c43229db8f2bc0cc646c614de8711ed975c85050d89 new file mode 100644 index 0000000000..3f6aeeb7dc --- /dev/null +++ b/.pnpm-store/v11/files/3d/1da922de6a18bd9d70e237981c5ef0bdc526ae15c49ca48afb39cd07a99d8c308949bf1d31db689e934c43229db8f2bc0cc646c614de8711ed975c85050d89 @@ -0,0 +1,81 @@ +'use strict' + +const cp = require('child_process') +const path = require('path') +const { openSync, closeSync } = require('graceful-fs') +const log = require('./log') + +const execFile = async (...args) => new Promise((resolve) => { + const child = cp.execFile(...args, (...a) => resolve(a)) + child.stdin.end() +}) + +async function regGetValue (key, value, addOpts) { + const outReValue = value.replace(/\W/g, '.') + const outRe = new RegExp(`^\\s+${outReValue}\\s+REG_\\w+\\s+(\\S.*)$`, 'im') + const reg = path.join(process.env.SystemRoot, 'System32', 'reg.exe') + const regArgs = ['query', key, '/v', value].concat(addOpts) + + log.silly('reg', 'running', reg, regArgs) + const [err, stdout, stderr] = await execFile(reg, regArgs, { encoding: 'utf8' }) + + log.silly('reg', 'reg.exe stdout = %j', stdout) + if (err || stderr.trim() !== '') { + log.silly('reg', 'reg.exe err = %j', err && (err.stack || err)) + log.silly('reg', 'reg.exe stderr = %j', stderr) + if (err) { + throw err + } + throw new Error(stderr) + } + + const result = outRe.exec(stdout) + if (!result) { + log.silly('reg', 'error parsing stdout') + throw new Error('Could not parse output of reg.exe') + } + + log.silly('reg', 'found: %j', result[1]) + return result[1] +} + +async function regSearchKeys (keys, value, addOpts) { + for (const key of keys) { + try { + return await regGetValue(key, value, addOpts) + } catch { + continue + } + } +} + +/** + * Returns the first file or directory from an array of candidates that is + * readable by the current user, or undefined if none of the candidates are + * readable. + */ +function findAccessibleSync (logprefix, dir, candidates) { + for (let next = 0; next < candidates.length; next++) { + const candidate = path.resolve(dir, candidates[next]) + let fd + try { + fd = openSync(candidate, 'r') + } catch (e) { + // this candidate was not found or not readable, do nothing + log.silly(logprefix, 'Could not open %s: %s', candidate, e.message) + continue + } + closeSync(fd) + log.silly(logprefix, 'Found readable %s', candidate) + return candidate + } + + return undefined +} + +module.exports = { + execFile, + regGetValue, + regSearchKeys, + findAccessibleSync +} diff --git a/.pnpm-store/v11/files/3d/4164460059ccb0f32080263efa9f2e9b83a2f8f7ac22757e312f1e2f41674236b984e04902762e14e9186df1dfe921f50b27382acb473fee909bfa79c9193a b/.pnpm-store/v11/files/3d/4164460059ccb0f32080263efa9f2e9b83a2f8f7ac22757e312f1e2f41674236b984e04902762e14e9186df1dfe921f50b27382acb473fee909bfa79c9193a new file mode 100644 index 0000000000..edb24b1dc3 --- /dev/null +++ b/.pnpm-store/v11/files/3d/4164460059ccb0f32080263efa9f2e9b83a2f8f7ac22757e312f1e2f41674236b984e04902762e14e9186df1dfe921f50b27382acb473fee909bfa79c9193a @@ -0,0 +1,5 @@ +'use strict' + +const compareBuild = require('./compare-build') +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort diff --git a/.pnpm-store/v11/files/3d/5b211388390e08fd46c10873c792165f9fdded0d32116bdf9d0919f8fdd02cdbc5b3f8feb9553c1c7d18859b198c00d16bad5997d8a599e5a992131ae1a10a b/.pnpm-store/v11/files/3d/5b211388390e08fd46c10873c792165f9fdded0d32116bdf9d0919f8fdd02cdbc5b3f8feb9553c1c7d18859b198c00d16bad5997d8a599e5a992131ae1a10a new file mode 100644 index 0000000000..0dfad0762c --- /dev/null +++ b/.pnpm-store/v11/files/3d/5b211388390e08fd46c10873c792165f9fdded0d32116bdf9d0919f8fdd02cdbc5b3f8feb9553c1c7d18859b198c00d16bad5997d8a599e5a992131ae1a10a @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=options.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/3d/7ab588c60571bd690cca6d91646f445d63e884f9308ae32857e31baea7d654ab6bc89e7069937ad7310bdb8124af2909ad755b125cdadd28bed88a206565a1 b/.pnpm-store/v11/files/3d/7ab588c60571bd690cca6d91646f445d63e884f9308ae32857e31baea7d654ab6bc89e7069937ad7310bdb8124af2909ad755b125cdadd28bed88a206565a1 new file mode 100644 index 0000000000..5b07aa7f71 --- /dev/null +++ b/.pnpm-store/v11/files/3d/7ab588c60571bd690cca6d91646f445d63e884f9308ae32857e31baea7d654ab6bc89e7069937ad7310bdb8124af2909ad755b125cdadd28bed88a206565a1 @@ -0,0 +1,99 @@ +"use strict"; +// Tar can encode large and negative numbers using a leading byte of +// 0xff for negative, and 0x80 for positive. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parse = exports.encode = void 0; +const encode = (num, buf) => { + if (!Number.isSafeInteger(num)) { + // The number is so large that javascript cannot represent it with integer + // precision. + throw Error('cannot encode number outside of javascript safe integer range'); + } + else if (num < 0) { + encodeNegative(num, buf); + } + else { + encodePositive(num, buf); + } + return buf; +}; +exports.encode = encode; +const encodePositive = (num, buf) => { + buf[0] = 0x80; + for (var i = buf.length; i > 1; i--) { + buf[i - 1] = num & 0xff; + num = Math.floor(num / 0x100); + } +}; +const encodeNegative = (num, buf) => { + buf[0] = 0xff; + var flipped = false; + num = num * -1; + for (var i = buf.length; i > 1; i--) { + var byte = num & 0xff; + num = Math.floor(num / 0x100); + if (flipped) { + buf[i - 1] = onesComp(byte); + } + else if (byte === 0) { + buf[i - 1] = 0; + } + else { + flipped = true; + buf[i - 1] = twosComp(byte); + } + } +}; +const parse = (buf) => { + const pre = buf[0]; + const value = pre === 0x80 ? pos(buf.subarray(1, buf.length)) + : pre === 0xff ? twos(buf) + : null; + if (value === null) { + throw Error('invalid base256 encoding'); + } + if (!Number.isSafeInteger(value)) { + // The number is so large that javascript cannot represent it with integer + // precision. + throw Error('parsed number outside of javascript safe integer range'); + } + return value; +}; +exports.parse = parse; +const twos = (buf) => { + var len = buf.length; + var sum = 0; + var flipped = false; + for (var i = len - 1; i > -1; i--) { + var byte = Number(buf[i]); + var f; + if (flipped) { + f = onesComp(byte); + } + else if (byte === 0) { + f = byte; + } + else { + flipped = true; + f = twosComp(byte); + } + if (f !== 0) { + sum -= f * Math.pow(256, len - i - 1); + } + } + return sum; +}; +const pos = (buf) => { + var len = buf.length; + var sum = 0; + for (var i = len - 1; i > -1; i--) { + var byte = Number(buf[i]); + if (byte !== 0) { + sum += byte * Math.pow(256, len - i - 1); + } + } + return sum; +}; +const onesComp = (byte) => (0xff ^ byte) & 0xff; +const twosComp = (byte) => ((0xff ^ byte) + 1) & 0xff; +//# sourceMappingURL=large-numbers.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/3d/887d18ee36ed3fdaf190bd80378bbced3943c5f8fc209c31c5733adcd05742fae52479d0cdc13801a5428eed08d5ad5b9223652eaadb13b704ba010fd26b88 b/.pnpm-store/v11/files/3d/887d18ee36ed3fdaf190bd80378bbced3943c5f8fc209c31c5733adcd05742fae52479d0cdc13801a5428eed08d5ad5b9223652eaadb13b704ba010fd26b88 new file mode 100644 index 0000000000..7687896f4b --- /dev/null +++ b/.pnpm-store/v11/files/3d/887d18ee36ed3fdaf190bd80378bbced3943c5f8fc209c31c5733adcd05742fae52479d0cdc13801a5428eed08d5ad5b9223652eaadb13b704ba010fd26b88 @@ -0,0 +1,33 @@ +"use strict"; +// tar -u +Object.defineProperty(exports, "__esModule", { value: true }); +exports.update = void 0; +const make_command_js_1 = require("./make-command.js"); +const replace_js_1 = require("./replace.js"); +// just call tar.r with the filter and mtimeCache +exports.update = (0, make_command_js_1.makeCommand)(replace_js_1.replace.syncFile, replace_js_1.replace.asyncFile, replace_js_1.replace.syncNoFile, replace_js_1.replace.asyncNoFile, (opt, entries = []) => { + replace_js_1.replace.validate?.(opt, entries); + mtimeFilter(opt); +}); +const mtimeFilter = (opt) => { + const filter = opt.filter; + if (!opt.mtimeCache) { + opt.mtimeCache = new Map(); + } + opt.filter = + filter ? + (path, stat) => filter(path, stat) && + !( + /* c8 ignore start */ + ((opt.mtimeCache?.get(path) ?? stat.mtime ?? 0) > + (stat.mtime ?? 0)) + /* c8 ignore stop */ + ) + : (path, stat) => !( + /* c8 ignore start */ + ((opt.mtimeCache?.get(path) ?? stat.mtime ?? 0) > + (stat.mtime ?? 0)) + /* c8 ignore stop */ + ); +}; +//# sourceMappingURL=update.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/3e/49521ade92e3384f77dc220b9961a7e5fcb4556b4c9ada13e41363c0a3abf4ccfd7684dc1699b5ffd2c04c52a3a6ad72b90277180bf3131d2a62b7add02f27 b/.pnpm-store/v11/files/3e/49521ade92e3384f77dc220b9961a7e5fcb4556b4c9ada13e41363c0a3abf4ccfd7684dc1699b5ffd2c04c52a3a6ad72b90277180bf3131d2a62b7add02f27 new file mode 100644 index 0000000000..4e88751690 --- /dev/null +++ b/.pnpm-store/v11/files/3e/49521ade92e3384f77dc220b9961a7e5fcb4556b4c9ada13e41363c0a3abf4ccfd7684dc1699b5ffd2c04c52a3a6ad72b90277180bf3131d2a62b7add02f27 @@ -0,0 +1,76 @@ +import { WriteStream, WriteStreamSync } from '@isaacs/fs-minipass'; +import path from 'node:path'; +import { list } from './list.js'; +import { makeCommand } from './make-command.js'; +import { Pack, PackSync } from './pack.js'; +const createFileSync = (opt, files) => { + const p = new PackSync(opt); + const stream = new WriteStreamSync(opt.file, { + mode: opt.mode || 0o666, + }); + p.pipe(stream); + addFilesSync(p, files); +}; +const createFile = (opt, files) => { + const p = new Pack(opt); + const stream = new WriteStream(opt.file, { + mode: opt.mode || 0o666, + }); + p.pipe(stream); + const promise = new Promise((res, rej) => { + stream.on('error', rej); + stream.on('close', res); + p.on('error', rej); + }); + addFilesAsync(p, files).catch(er => p.emit('error', er)); + return promise; +}; +const addFilesSync = (p, files) => { + files.forEach(file => { + if (file.charAt(0) === '@') { + list({ + file: path.resolve(p.cwd, file.slice(1)), + sync: true, + noResume: true, + onReadEntry: entry => p.add(entry), + }); + } + else { + p.add(file); + } + }); + p.end(); +}; +const addFilesAsync = async (p, files) => { + for (const file of files) { + if (file.charAt(0) === '@') { + await list({ + file: path.resolve(String(p.cwd), file.slice(1)), + noResume: true, + onReadEntry: entry => { + p.add(entry); + }, + }); + } + else { + p.add(file); + } + } + p.end(); +}; +const createSync = (opt, files) => { + const p = new PackSync(opt); + addFilesSync(p, files); + return p; +}; +const createAsync = (opt, files) => { + const p = new Pack(opt); + addFilesAsync(p, files).catch(er => p.emit('error', er)); + return p; +}; +export const create = makeCommand(createFileSync, createFile, createSync, createAsync, (_opt, files) => { + if (!files?.length) { + throw new TypeError('no paths specified to add to archive'); + } +}); +//# sourceMappingURL=create.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/3e/8856548a731363239dd1f5edaf423b8cf523312098fe4dc80f919a6f8bda2c893a644e747f2a4d8dd02f6150b04cbc8a9100b3810a541fd6a199397b5bac9f b/.pnpm-store/v11/files/3e/8856548a731363239dd1f5edaf423b8cf523312098fe4dc80f919a6f8bda2c893a644e747f2a4d8dd02f6150b04cbc8a9100b3810a541fd6a199397b5bac9f new file mode 100644 index 0000000000..c1524a1d53 --- /dev/null +++ b/.pnpm-store/v11/files/3e/8856548a731363239dd1f5edaf423b8cf523312098fe4dc80f919a6f8bda2c893a644e747f2a4d8dd02f6150b04cbc8a9100b3810a541fd6a199397b5bac9f @@ -0,0 +1,63 @@ +"use strict"; +/** + * This is the Windows implementation of isexe, which uses the file + * extension and PATHEXT setting. + * + * @module + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sync = exports.isexe = void 0; +const node_fs_1 = require("node:fs"); +const promises_1 = require("node:fs/promises"); +const node_path_1 = require("node:path"); +/** + * Determine whether a path is executable based on the file extension + * and PATHEXT environment variable (or specified pathExt option) + */ +const isexe = async (path, options = {}) => { + const { ignoreErrors = false } = options; + try { + return checkStat(await (0, promises_1.stat)(path), path, options); + } + catch (e) { + const er = e; + if (ignoreErrors || er.code === 'EACCES') + return false; + throw er; + } +}; +exports.isexe = isexe; +/** + * Synchronously determine whether a path is executable based on the file + * extension and PATHEXT environment variable (or specified pathExt option) + */ +const sync = (path, options = {}) => { + const { ignoreErrors = false } = options; + try { + return checkStat((0, node_fs_1.statSync)(path), path, options); + } + catch (e) { + const er = e; + if (ignoreErrors || er.code === 'EACCES') + return false; + throw er; + } +}; +exports.sync = sync; +const checkPathExt = (path, options) => { + const { pathExt = process.env.PATHEXT || '' } = options; + const peSplit = pathExt.split(node_path_1.delimiter); + if (peSplit.indexOf('') !== -1) { + return true; + } + for (const pes of peSplit) { + const p = pes.toLowerCase(); + const ext = path.substring(path.length - p.length).toLowerCase(); + if (p && ext === p) { + return true; + } + } + return false; +}; +const checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options); +//# sourceMappingURL=win32.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/3e/e17952d12a59e35ed0a397a300fd66654ddf2e642ebf4a49ce58ada4b41970e88fa285f6404a83cb7eb4089f5725d3b8534fdba0f1dc2be408afa589b53416 b/.pnpm-store/v11/files/3e/e17952d12a59e35ed0a397a300fd66654ddf2e642ebf4a49ce58ada4b41970e88fa285f6404a83cb7eb4089f5725d3b8534fdba0f1dc2be408afa589b53416 new file mode 100644 index 0000000000..e4ad8b889d --- /dev/null +++ b/.pnpm-store/v11/files/3e/e17952d12a59e35ed0a397a300fd66654ddf2e642ebf4a49ce58ada4b41970e88fa285f6404a83cb7eb4089f5725d3b8534fdba0f1dc2be408afa589b53416 @@ -0,0 +1,38 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") +basedir_win="$basedir" +exe="" +msys="" + +case `uname -a` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir_win=`cygpath -w "$basedir"` + fi + exe=".exe" + msys="true" + ;; + *WSL2*) + if command -v wslpath > /dev/null 2>&1; then + basedir_win="$(wslpath -w "$basedir" 2> /dev/null)" + if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then + basedir_win="$basedir" + else + exe=".exe" + fi + fi + ;; +esac + +if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then + exec "$basedir/node.exe" "$basedir_win/../nopt/bin/nopt.js" "$@" +elif [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../nopt/bin/nopt.js" "$@" +elif command -v node >/dev/null 2>&1; then + exec node "$basedir/../nopt/bin/nopt.js" "$@" +elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then + exec node.exe "$basedir_win/../nopt/bin/nopt.js" "$@" +else + exec node "$basedir/../nopt/bin/nopt.js" "$@" +fi +# cmd-shim-target=/Users/runner/work/pnpm/pnpm/pnpm11/pnpm/temp-deploy/node_modules/nopt/bin/nopt.js diff --git a/.pnpm-store/v11/files/3f/240bef21562b22e80802b0a41e0c8f2ec5220b81c31fa7d0429acffd45907f6099ad63a2be0cf22356989680bdf8523197a9f7d929b65a64d9f4602fd265ff b/.pnpm-store/v11/files/3f/240bef21562b22e80802b0a41e0c8f2ec5220b81c31fa7d0429acffd45907f6099ad63a2be0cf22356989680bdf8523197a9f7d929b65a64d9f4602fd265ff new file mode 100644 index 0000000000..c8ba5dd8ec --- /dev/null +++ b/.pnpm-store/v11/files/3f/240bef21562b22e80802b0a41e0c8f2ec5220b81c31fa7d0429acffd45907f6099ad63a2be0cf22356989680bdf8523197a9f7d929b65a64d9f4602fd265ff @@ -0,0 +1,67 @@ +module.exports = { + kClose: Symbol('close'), + kDestroy: Symbol('destroy'), + kDispatch: Symbol('dispatch'), + kUrl: Symbol('url'), + kWriting: Symbol('writing'), + kResuming: Symbol('resuming'), + kQueue: Symbol('queue'), + kConnect: Symbol('connect'), + kConnecting: Symbol('connecting'), + kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'), + kKeepAliveMaxTimeout: Symbol('max keep alive timeout'), + kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'), + kKeepAliveTimeoutValue: Symbol('keep alive timeout'), + kKeepAlive: Symbol('keep alive'), + kHeadersTimeout: Symbol('headers timeout'), + kBodyTimeout: Symbol('body timeout'), + kServerName: Symbol('server name'), + kLocalAddress: Symbol('local address'), + kHost: Symbol('host'), + kNoRef: Symbol('no ref'), + kBodyUsed: Symbol('used'), + kBody: Symbol('abstracted request body'), + kRunning: Symbol('running'), + kBlocking: Symbol('blocking'), + kPending: Symbol('pending'), + kSize: Symbol('size'), + kBusy: Symbol('busy'), + kQueued: Symbol('queued'), + kFree: Symbol('free'), + kConnected: Symbol('connected'), + kClosed: Symbol('closed'), + kNeedDrain: Symbol('need drain'), + kReset: Symbol('reset'), + kDestroyed: Symbol.for('nodejs.stream.destroyed'), + kResume: Symbol('resume'), + kOnError: Symbol('on error'), + kMaxHeadersSize: Symbol('max headers size'), + kRunningIdx: Symbol('running index'), + kPendingIdx: Symbol('pending index'), + kError: Symbol('error'), + kClients: Symbol('clients'), + kClient: Symbol('client'), + kParser: Symbol('parser'), + kOnDestroyed: Symbol('destroy callbacks'), + kPipelining: Symbol('pipelining'), + kSocket: Symbol('socket'), + kHostHeader: Symbol('host header'), + kConnector: Symbol('connector'), + kStrictContentLength: Symbol('strict content length'), + kMaxRedirections: Symbol('maxRedirections'), + kMaxRequests: Symbol('maxRequestsPerClient'), + kProxy: Symbol('proxy agent options'), + kCounter: Symbol('socket request counter'), + kInterceptors: Symbol('dispatch interceptors'), + kMaxResponseSize: Symbol('max response size'), + kHTTP2Session: Symbol('http2Session'), + kHTTP2SessionState: Symbol('http2Session state'), + kRetryHandlerDefaultRetry: Symbol('retry agent default retry'), + kConstruct: Symbol('constructable'), + kListeners: Symbol('listeners'), + kHTTPContext: Symbol('http context'), + kMaxConcurrentStreams: Symbol('max concurrent streams'), + kNoProxyAgent: Symbol('no proxy agent'), + kHttpProxyAgent: Symbol('http proxy agent'), + kHttpsProxyAgent: Symbol('https proxy agent') +} diff --git a/.pnpm-store/v11/files/3f/35133efd0741246da0103869e42fa8bdad5cca6f08384a07441b11d0687829d0bb9a176164fb544ff0a57a08c525b8abd618677e42008b5785fbb59c68ffe0 b/.pnpm-store/v11/files/3f/35133efd0741246da0103869e42fa8bdad5cca6f08384a07441b11d0687829d0bb9a176164fb544ff0a57a08c525b8abd618677e42008b5785fbb59c68ffe0 new file mode 100644 index 0000000000..8bca510815 --- /dev/null +++ b/.pnpm-store/v11/files/3f/35133efd0741246da0103869e42fa8bdad5cca6f08384a07441b11d0687829d0bb9a176164fb544ff0a57a08c525b8abd618677e42008b5785fbb59c68ffe0 @@ -0,0 +1,12 @@ +// Copyright (c) 2013 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file is used to generate an empty .pdb -- with a 4KB pagesize -- that is +// then used during the final link for modules that have large PDBs. Otherwise, +// the linker will generate a pdb with a page size of 1KB, which imposes a limit +// of 1GB on the .pdb. By generating an initial empty .pdb with the compiler +// (rather than the linker), this limit is avoided. With this in place PDBs may +// grow to 2GB. +// +// This file is referenced by the msvs_large_pdb mechanism in MSVSUtil.py. diff --git a/.pnpm-store/v11/files/3f/a748e59fb3af0c5293530844faa9606d9271836489d2c8013417779d10cc180187f5e670477f9ec77d341e0ef64eab7dcfb876c6390f027bc6f869a12d0f46 b/.pnpm-store/v11/files/3f/a748e59fb3af0c5293530844faa9606d9271836489d2c8013417779d10cc180187f5e670477f9ec77d341e0ef64eab7dcfb876c6390f027bc6f869a12d0f46 new file mode 100644 index 0000000000..19129e315f --- /dev/null +++ b/.pnpm-store/v11/files/3f/a748e59fb3af0c5293530844faa9606d9271836489d2c8013417779d10cc180187f5e670477f9ec77d341e0ef64eab7dcfb876c6390f027bc6f869a12d0f46 @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/.pnpm-store/v11/files/40/d22773bed182b4956ec307cfd4a6bfc06773d93d2b1d43e85129fadf30ad30b7eff715221f3a7076551d149f0f6b6f823bdd9c2a39acdc15b29c976ec17844 b/.pnpm-store/v11/files/40/d22773bed182b4956ec307cfd4a6bfc06773d93d2b1d43e85129fadf30ad30b7eff715221f3a7076551d149f0f6b6f823bdd9c2a39acdc15b29c976ec17844 new file mode 100644 index 0000000000..2fb32a0e63 --- /dev/null +++ b/.pnpm-store/v11/files/40/d22773bed182b4956ec307cfd4a6bfc06773d93d2b1d43e85129fadf30ad30b7eff715221f3a7076551d149f0f6b6f823bdd9c2a39acdc15b29c976ec17844 @@ -0,0 +1,5 @@ +'use strict' + +const compare = require('./compare') +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt diff --git a/.pnpm-store/v11/files/41/72c2bb8a8f2b8efea714788ad15ca9c0fe77ffd11d82ac4ace332135fcae46d736c2e06b5fa66fde20bffabc56aca59a8a3984874aa72c1f155dd81199c897 b/.pnpm-store/v11/files/41/72c2bb8a8f2b8efea714788ad15ca9c0fe77ffd11d82ac4ace332135fcae46d736c2e06b5fa66fde20bffabc56aca59a8a3984874aa72c1f155dd81199c897 new file mode 100644 index 0000000000..8cd8abccc5 --- /dev/null +++ b/.pnpm-store/v11/files/41/72c2bb8a8f2b8efea714788ad15ca9c0fe77ffd11d82ac4ace332135fcae46d736c2e06b5fa66fde20bffabc56aca59a8a3984874aa72c1f155dd81199c897 @@ -0,0 +1,240 @@ +'use strict' + +const net = require('node:net') +const assert = require('node:assert') +const util = require('./util') +const { InvalidArgumentError, ConnectTimeoutError } = require('./errors') +const timers = require('../util/timers') + +function noop () {} + +let tls // include tls conditionally since it is not always available + +// TODO: session re-use does not wait for the first +// connection to resolve the session and might therefore +// resolve the same servername multiple times even when +// re-use is enabled. + +let SessionCache +// FIXME: remove workaround when the Node bug is fixed +// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 +if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) { + SessionCache = class WeakSessionCache { + constructor (maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions + this._sessionCache = new Map() + this._sessionRegistry = new global.FinalizationRegistry((key) => { + if (this._sessionCache.size < this._maxCachedSessions) { + return + } + + const ref = this._sessionCache.get(key) + if (ref !== undefined && ref.deref() === undefined) { + this._sessionCache.delete(key) + } + }) + } + + get (sessionKey) { + const ref = this._sessionCache.get(sessionKey) + return ref ? ref.deref() : null + } + + set (sessionKey, session) { + if (this._maxCachedSessions === 0) { + return + } + + this._sessionCache.set(sessionKey, new WeakRef(session)) + this._sessionRegistry.register(session, sessionKey) + } + } +} else { + SessionCache = class SimpleSessionCache { + constructor (maxCachedSessions) { + this._maxCachedSessions = maxCachedSessions + this._sessionCache = new Map() + } + + get (sessionKey) { + return this._sessionCache.get(sessionKey) + } + + set (sessionKey, session) { + if (this._maxCachedSessions === 0) { + return + } + + if (this._sessionCache.size >= this._maxCachedSessions) { + // remove the oldest session + const { value: oldestKey } = this._sessionCache.keys().next() + this._sessionCache.delete(oldestKey) + } + + this._sessionCache.set(sessionKey, session) + } + } +} + +function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) { + if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { + throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero') + } + + const options = { path: socketPath, ...opts } + const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions) + timeout = timeout == null ? 10e3 : timeout + allowH2 = allowH2 != null ? allowH2 : false + return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { + let socket + if (protocol === 'https:') { + if (!tls) { + tls = require('node:tls') + } + servername = servername || options.servername || util.getServerName(host) || null + + const sessionKey = servername || hostname + assert(sessionKey) + + const session = customSession || sessionCache.get(sessionKey) || null + + port = port || 443 + + socket = tls.connect({ + highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... + ...options, + servername, + session, + localAddress, + // TODO(HTTP/2): Add support for h2c + ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'], + socket: httpSocket, // upgrade socket connection + port, + host: hostname + }) + + socket + .on('session', function (session) { + // TODO (fix): Can a session become invalid once established? Don't think so? + sessionCache.set(sessionKey, session) + }) + } else { + assert(!httpSocket, 'httpSocket can only be sent on TLS update') + + port = port || 80 + + socket = net.connect({ + highWaterMark: 64 * 1024, // Same as nodejs fs streams. + ...options, + localAddress, + port, + host: hostname + }) + } + + // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket + if (options.keepAlive == null || options.keepAlive) { + const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay + socket.setKeepAlive(true, keepAliveInitialDelay) + } + + const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port }) + + socket + .setNoDelay(true) + .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () { + queueMicrotask(clearConnectTimeout) + + if (callback) { + const cb = callback + callback = null + cb(null, this) + } + }) + .on('error', function (err) { + queueMicrotask(clearConnectTimeout) + + if (callback) { + const cb = callback + callback = null + cb(err) + } + }) + + return socket + } +} + +/** + * @param {WeakRef} socketWeakRef + * @param {object} opts + * @param {number} opts.timeout + * @param {string} opts.hostname + * @param {number} opts.port + * @returns {() => void} + */ +const setupConnectTimeout = process.platform === 'win32' + ? (socketWeakRef, opts) => { + if (!opts.timeout) { + return noop + } + + let s1 = null + let s2 = null + const fastTimer = timers.setFastTimeout(() => { + // setImmediate is added to make sure that we prioritize socket error events over timeouts + s1 = setImmediate(() => { + // Windows needs an extra setImmediate probably due to implementation differences in the socket logic + s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts)) + }) + }, opts.timeout) + return () => { + timers.clearFastTimeout(fastTimer) + clearImmediate(s1) + clearImmediate(s2) + } + } + : (socketWeakRef, opts) => { + if (!opts.timeout) { + return noop + } + + let s1 = null + const fastTimer = timers.setFastTimeout(() => { + // setImmediate is added to make sure that we prioritize socket error events over timeouts + s1 = setImmediate(() => { + onConnectTimeout(socketWeakRef.deref(), opts) + }) + }, opts.timeout) + return () => { + timers.clearFastTimeout(fastTimer) + clearImmediate(s1) + } + } + +/** + * @param {net.Socket} socket + * @param {object} opts + * @param {number} opts.timeout + * @param {string} opts.hostname + * @param {number} opts.port + */ +function onConnectTimeout (socket, opts) { + // The socket could be already garbage collected + if (socket == null) { + return + } + + let message = 'Connect Timeout Error' + if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) { + message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},` + } else { + message += ` (attempted address: ${opts.hostname}:${opts.port},` + } + + message += ` timeout: ${opts.timeout}ms)` + + util.destroy(socket, new ConnectTimeoutError(message)) +} + +module.exports = buildConnector diff --git a/.pnpm-store/v11/files/41/9cf5b5847b1fd242db1f49694141df65425139319ee91c15de86d9ff943b5c87007ca26d5ac5a7a9a886389cbdb7f3872635ae33b7c204a7d059910e2efcc7 b/.pnpm-store/v11/files/41/9cf5b5847b1fd242db1f49694141df65425139319ee91c15de86d9ff943b5c87007ca26d5ac5a7a9a886389cbdb7f3872635ae33b7c204a7d059910e2efcc7 new file mode 100644 index 0000000000..0754aff26f --- /dev/null +++ b/.pnpm-store/v11/files/41/9cf5b5847b1fd242db1f49694141df65425139319ee91c15de86d9ff943b5c87007ca26d5ac5a7a9a886389cbdb7f3872635ae33b7c204a7d059910e2efcc7 @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""These functions are executed via gyp-flock-tool when using the Makefile +generator. Used on systems that don't have a built-in flock.""" + +import fcntl +import os +import struct +import subprocess +import sys + + +def main(args): + executor = FlockTool() + executor.Dispatch(args) + + +class FlockTool: + """This class emulates the 'flock' command.""" + + def Dispatch(self, args): + """Dispatches a string command to a method.""" + if len(args) < 1: + raise Exception("Not enough arguments") + + method = "Exec%s" % self._CommandifyName(args[0]) + getattr(self, method)(*args[1:]) + + def _CommandifyName(self, name_string): + """Transforms a tool name like copy-info-plist to CopyInfoPlist""" + return name_string.title().replace("-", "") + + def ExecFlock(self, lockfile, *cmd_list): + """Emulates the most basic behavior of Linux's flock(1).""" + # Rely on exception handling to report errors. + # Note that the stock python on SunOS has a bug + # where fcntl.flock(fd, LOCK_EX) always fails + # with EBADF, that's why we use this F_SETLK + # hack instead. + fd = os.open(lockfile, os.O_WRONLY | os.O_NOCTTY | os.O_CREAT, 0o666) + if sys.platform.startswith("aix") or sys.platform == "os400": + # Python on AIX is compiled with LARGEFILE support, which changes the + # struct size. + op = struct.pack("hhIllqq", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) + else: + op = struct.pack("hhllhhl", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) + fcntl.fcntl(fd, fcntl.F_SETLK, op) + return subprocess.call(cmd_list) + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/.pnpm-store/v11/files/41/a5f7c38c77c9bb62f6cbef4b878050b91df07feb9c057ea6e4eac703bef94882aa03efd891ccc83b949a70e21f9fcf5940cf263d96f9f5d544b1cc6a350040 b/.pnpm-store/v11/files/41/a5f7c38c77c9bb62f6cbef4b878050b91df07feb9c057ea6e4eac703bef94882aa03efd891ccc83b949a70e21f9fcf5940cf263d96f9f5d544b1cc6a350040 new file mode 100644 index 0000000000..af89c8ef43 --- /dev/null +++ b/.pnpm-store/v11/files/41/a5f7c38c77c9bb62f6cbef4b878050b91df07feb9c057ea6e4eac703bef94882aa03efd891ccc83b949a70e21f9fcf5940cf263d96f9f5d544b1cc6a350040 @@ -0,0 +1,26 @@ +'use strict' + +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} +module.exports = minSatisfying diff --git a/.pnpm-store/v11/files/42/31e07756612ffa47e87a568aaf67142622912a55844010d3d3d73ccec0b76ccee2bb28ef4d678cf97de04c48842f5e771eebfae3c68a9da0219c4a013a161d b/.pnpm-store/v11/files/42/31e07756612ffa47e87a568aaf67142622912a55844010d3d3d73ccec0b76ccee2bb28ef4d678cf97de04c48842f5e771eebfae3c68a9da0219c4a013a161d new file mode 100644 index 0000000000..5fd3bb88c1 --- /dev/null +++ b/.pnpm-store/v11/files/42/31e07756612ffa47e87a568aaf67142622912a55844010d3d3d73ccec0b76ccee2bb28ef4d678cf97de04c48842f5e771eebfae3c68a9da0219c4a013a161d @@ -0,0 +1,25 @@ +export const modeFix = (mode, isDir, portable) => { + mode &= 0o7777; + // in portable mode, use the minimum reasonable umask + // if this system creates files with 0o664 by default + // (as some linux distros do), then we'll write the + // archive with 0o644 instead. Also, don't ever create + // a file that is not readable/writable by the owner. + if (portable) { + mode = (mode | 0o600) & ~0o22; + } + // if dirs are readable, then they should be listable + if (isDir) { + if (mode & 0o400) { + mode |= 0o100; + } + if (mode & 0o40) { + mode |= 0o10; + } + if (mode & 0o4) { + mode |= 0o1; + } + } + return mode; +}; +//# sourceMappingURL=mode-fix.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/42/7d2a6301397f9c4a8960894c3924bbb499a4dcd91b659cba18bd24bb90be734e14df0c02eb9812bd42ec38ff0177a0d21dc44b8ff2744b44f94ea46be119b2 b/.pnpm-store/v11/files/42/7d2a6301397f9c4a8960894c3924bbb499a4dcd91b659cba18bd24bb90be734e14df0c02eb9812bd42ec38ff0177a0d21dc44b8ff2744b44f94ea46be119b2 new file mode 100644 index 0000000000..9eaf3fd03a --- /dev/null +++ b/.pnpm-store/v11/files/42/7d2a6301397f9c4a8960894c3924bbb499a4dcd91b659cba18bd24bb90be734e14df0c02eb9812bd42ec38ff0177a0d21dc44b8ff2744b44f94ea46be119b2 @@ -0,0 +1,107 @@ +'use strict' + +const { + PoolBase, + kClients, + kNeedDrain, + kAddClient, + kGetDispatcher +} = require('./pool-base') +const Client = require('./client') +const { + InvalidArgumentError +} = require('../core/errors') +const util = require('../core/util') +const { kUrl, kInterceptors } = require('../core/symbols') +const buildConnector = require('../core/connect') + +const kOptions = Symbol('options') +const kConnections = Symbol('connections') +const kFactory = Symbol('factory') + +function defaultFactory (origin, opts) { + return new Client(origin, opts) +} + +class Pool extends PoolBase { + constructor (origin, { + connections, + factory = defaultFactory, + connect, + connectTimeout, + tls, + maxCachedSessions, + socketPath, + autoSelectFamily, + autoSelectFamilyAttemptTimeout, + allowH2, + ...options + } = {}) { + if (connections != null && (!Number.isFinite(connections) || connections < 0)) { + throw new InvalidArgumentError('invalid connections') + } + + if (typeof factory !== 'function') { + throw new InvalidArgumentError('factory must be a function.') + } + + if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { + throw new InvalidArgumentError('connect must be a function or an object') + } + + if (typeof connect !== 'function') { + connect = buildConnector({ + ...tls, + maxCachedSessions, + allowH2, + socketPath, + timeout: connectTimeout, + ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), + ...connect + }) + } + + super(options) + + this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) + ? options.interceptors.Pool + : [] + this[kConnections] = connections || null + this[kUrl] = util.parseOrigin(origin) + this[kOptions] = { ...util.deepClone(options), connect, allowH2 } + this[kOptions].interceptors = options.interceptors + ? { ...options.interceptors } + : undefined + this[kFactory] = factory + + this.on('connectionError', (origin, targets, error) => { + // If a connection error occurs, we remove the client from the pool, + // and emit a connectionError event. They will not be re-used. + // Fixes https://github.com/nodejs/undici/issues/3895 + for (const target of targets) { + // Do not use kRemoveClient here, as it will close the client, + // but the client cannot be closed in this state. + const idx = this[kClients].indexOf(target) + if (idx !== -1) { + this[kClients].splice(idx, 1) + } + } + }) + } + + [kGetDispatcher] () { + for (const client of this[kClients]) { + if (!client[kNeedDrain]) { + return client + } + } + + if (!this[kConnections] || this[kClients].length < this[kConnections]) { + const dispatcher = this[kFactory](this[kUrl], this[kOptions]) + this[kAddClient](dispatcher) + return dispatcher + } + } +} + +module.exports = Pool diff --git a/.pnpm-store/v11/files/43/099ed60b3f615109e7f59ea7e10b309b811512705ea69df74d4db86c7e342c3b66f215791cc111e0dac704a90be30e122b5d931567d687a30d29f00da3ed2f b/.pnpm-store/v11/files/43/099ed60b3f615109e7f59ea7e10b309b811512705ea69df74d4db86c7e342c3b66f215791cc111e0dac704a90be30e122b5d931567d687a30d29f00da3ed2f new file mode 100644 index 0000000000..f1af6d51a4 --- /dev/null +++ b/.pnpm-store/v11/files/43/099ed60b3f615109e7f59ea7e10b309b811512705ea69df74d4db86c7e342c3b66f215791cc111e0dac704a90be30e122b5d931567d687a30d29f00da3ed2f @@ -0,0 +1,62 @@ +/** + * This is the Posix implementation of isexe, which uses the file + * mode and uid/gid values. + * + * @module + */ +import { statSync } from 'node:fs'; +import { stat } from 'node:fs/promises'; +/** + * Determine whether a path is executable according to the mode and + * current (or specified) user and group IDs. + */ +export const isexe = async (path, options = {}) => { + const { ignoreErrors = false } = options; + try { + return checkStat(await stat(path), options); + } + catch (e) { + const er = e; + if (ignoreErrors || er.code === 'EACCES') + return false; + throw er; + } +}; +/** + * Synchronously determine whether a path is executable according to + * the mode and current (or specified) user and group IDs. + */ +export const sync = (path, options = {}) => { + const { ignoreErrors = false } = options; + try { + return checkStat(statSync(path), options); + } + catch (e) { + const er = e; + if (ignoreErrors || er.code === 'EACCES') + return false; + throw er; + } +}; +const checkStat = (stat, options) => stat.isFile() && checkMode(stat, options); +const checkMode = (stat, options) => { + const myUid = options.uid ?? process.getuid?.(); + const myGroups = options.groups ?? process.getgroups?.() ?? []; + const myGid = options.gid ?? process.getgid?.() ?? myGroups[0]; + if (myUid === undefined || myGid === undefined) { + throw new Error('cannot get uid or gid'); + } + const groups = new Set([myGid, ...myGroups]); + const mod = stat.mode; + const uid = stat.uid; + const gid = stat.gid; + const u = parseInt('100', 8); + const g = parseInt('010', 8); + const o = parseInt('001', 8); + const ug = u | g; + return !!(mod & o || + (mod & g && groups.has(gid)) || + (mod & u && uid === myUid) || + (mod & ug && myUid === 0)); +}; +//# sourceMappingURL=posix.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/44/e44d5edbd59dd793ac1c4b641d1cbde72dfe6001e4f1d6fbdef86d96588f064c4d9916dab45537a3a3df6fa3f70711c513e6a9bbad3935498fa2369953baf2 b/.pnpm-store/v11/files/44/e44d5edbd59dd793ac1c4b641d1cbde72dfe6001e4f1d6fbdef86d96588f064c4d9916dab45537a3a3df6fa3f70711c513e6a9bbad3935498fa2369953baf2 new file mode 100644 index 0000000000..2fd358baf8 --- /dev/null +++ b/.pnpm-store/v11/files/44/e44d5edbd59dd793ac1c4b641d1cbde72dfe6001e4f1d6fbdef86d96588f064c4d9916dab45537a3a3df6fa3f70711c513e6a9bbad3935498fa2369953baf2 @@ -0,0 +1,111 @@ +const { isexe, sync: isexeSync } = require('isexe') +const { join, delimiter, sep, posix } = require('path') + +const isWindows = process.platform === 'win32' + +// used to check for slashed in commands passed in. always checks for the posix +// seperator on all platforms, and checks for the current separator when not on +// a posix platform. don't use the isWindows check for this since that is mocked +// in tests but we still need the code to actually work when called. that is also +// why it is ignored from coverage. +/* istanbul ignore next */ +const rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? '' : sep}]`.replace(/(\\)/g, '\\$1')) +const rRel = new RegExp(`^\\.${rSlash.source}`) + +const getNotFoundError = (cmd) => + Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) + +const getPathInfo = (cmd, { + path: optPath = process.env.PATH, + pathExt: optPathExt = process.env.PATHEXT, + delimiter: optDelimiter = delimiter, +}) => { + // If it has a slash, then we don't bother searching the pathenv. + // just check the file itself, and that's it. + const pathEnv = cmd.match(rSlash) ? [''] : [ + // windows always checks the cwd first + ...(isWindows ? [process.cwd()] : []), + ...(optPath || /* istanbul ignore next: very unusual */ '').split(optDelimiter), + ] + + if (isWindows) { + const pathExtExe = optPathExt || + ['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter) + const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]) + if (cmd.includes('.') && pathExt[0] !== '') { + pathExt.unshift('') + } + return { pathEnv, pathExt, pathExtExe } + } + + return { pathEnv, pathExt: [''] } +} + +const getPathPart = (raw, cmd) => { + const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw + const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : '' + return prefix + join(pathPart, cmd) +} + +const which = async (cmd, opt = {}) => { + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + for (const envPart of pathEnv) { + const p = getPathPart(envPart, cmd) + + for (const ext of pathExt) { + const withExt = p + ext + const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true }) + if (is) { + if (!opt.all) { + return withExt + } + found.push(withExt) + } + } + } + + if (opt.all && found.length) { + return found + } + + if (opt.nothrow) { + return null + } + + throw getNotFoundError(cmd) +} + +const whichSync = (cmd, opt = {}) => { + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + for (const pathEnvPart of pathEnv) { + const p = getPathPart(pathEnvPart, cmd) + + for (const ext of pathExt) { + const withExt = p + ext + const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true }) + if (is) { + if (!opt.all) { + return withExt + } + found.push(withExt) + } + } + } + + if (opt.all && found.length) { + return found + } + + if (opt.nothrow) { + return null + } + + throw getNotFoundError(cmd) +} + +module.exports = which +which.sync = whichSync diff --git a/.pnpm-store/v11/files/46/fe059fdf96b0e16bbf8a30ca3af374d2a87e1470cdd612f882ee480e8423859c2536e2f35c4046e081b66bb30b21bc2824292d19d71d02bd0d59de03609915 b/.pnpm-store/v11/files/46/fe059fdf96b0e16bbf8a30ca3af374d2a87e1470cdd612f882ee480e8423859c2536e2f35c4046e081b66bb30b21bc2824292d19d71d02bd0d59de03609915 new file mode 100644 index 0000000000..63e197706d --- /dev/null +++ b/.pnpm-store/v11/files/46/fe059fdf96b0e16bbf8a30ca3af374d2a87e1470cdd612f882ee480e8423859c2536e2f35c4046e081b66bb30b21bc2824292d19d71d02bd0d59de03609915 @@ -0,0 +1,41 @@ +/* + * When this file is linked to a DLL, it sets up a delay-load hook that + * intervenes when the DLL is trying to load the host executable + * dynamically. Instead of trying to locate the .exe file it'll just + * return a handle to the process image. + * + * This allows compiled addons to work when the host executable is renamed. + */ + +#ifdef _MSC_VER + +#pragma managed(push, off) + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#include + +#include +#include + +static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { + HMODULE m; + if (event != dliNotePreLoadLibrary) + return NULL; + + if (_stricmp(info->szDll, HOST_BINARY) != 0) + return NULL; + + // try for libnode.dll to compat node.js that using 'vcbuild.bat dll' + m = GetModuleHandle(TEXT("libnode.dll")); + if (m == NULL) m = GetModuleHandle(NULL); + return (FARPROC) m; +} + +decltype(__pfnDliNotifyHook2) __pfnDliNotifyHook2 = load_exe_hook; + +#pragma managed(pop) + +#endif diff --git a/.pnpm-store/v11/files/47/354ae585720c38837036fd3a6751a34968eb51901ed32384eff9f9e5bf5f7a2c708e6435a7ac65550631a9ad3a6f5854e0862ae6a191b41e74c155a080d6f7 b/.pnpm-store/v11/files/47/354ae585720c38837036fd3a6751a34968eb51901ed32384eff9f9e5bf5f7a2c708e6435a7ac65550631a9ad3a6f5854e0862ae6a191b41e74c155a080d6f7 new file mode 100644 index 0000000000..63d8090c62 --- /dev/null +++ b/.pnpm-store/v11/files/47/354ae585720c38837036fd3a6751a34968eb51901ed32384eff9f9e5bf5f7a2c708e6435a7ac65550631a9ad3a6f5854e0862ae6a191b41e74c155a080d6f7 @@ -0,0 +1,7 @@ +'use strict' + +const SemVer = require('../classes/semver') +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) + +module.exports = compare diff --git a/.pnpm-store/v11/files/48/0bf4a07d6bae55de41be6449308fd00cb8f2b4044ca5eb5d0658828f7ab50253ee3a945b3c12452c2b62414b997f733439cc356465b2180c437aa6aaff6a11 b/.pnpm-store/v11/files/48/0bf4a07d6bae55de41be6449308fd00cb8f2b4044ca5eb5d0658828f7ab50253ee3a945b3c12452c2b62414b997f733439cc356465b2180c437aa6aaff6a11 new file mode 100644 index 0000000000..544e412551 --- /dev/null +++ b/.pnpm-store/v11/files/48/0bf4a07d6bae55de41be6449308fd00cb8f2b4044ca5eb5d0658828f7ab50253ee3a945b3c12452c2b62414b997f733439cc356465b2180c437aa6aaff6a11 @@ -0,0 +1,252 @@ +'use strict' + +const { isBlobLike, iteratorMixin } = require('./util') +const { kState } = require('./symbols') +const { kEnumerableProperty } = require('../../core/util') +const { FileLike, isFileLike } = require('./file') +const { webidl } = require('./webidl') +const { File: NativeFile } = require('node:buffer') +const nodeUtil = require('node:util') + +/** @type {globalThis['File']} */ +const File = globalThis.File ?? NativeFile + +// https://xhr.spec.whatwg.org/#formdata +class FormData { + constructor (form) { + webidl.util.markAsUncloneable(this) + + if (form !== undefined) { + throw webidl.errors.conversionFailed({ + prefix: 'FormData constructor', + argument: 'Argument 1', + types: ['undefined'] + }) + } + + this[kState] = [] + } + + append (name, value, filename = undefined) { + webidl.brandCheck(this, FormData) + + const prefix = 'FormData.append' + webidl.argumentLengthCheck(arguments, 2, prefix) + + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" + ) + } + + // 1. Let value be value if given; otherwise blobValue. + + name = webidl.converters.USVString(name, prefix, 'name') + value = isBlobLike(value) + ? webidl.converters.Blob(value, prefix, 'value', { strict: false }) + : webidl.converters.USVString(value, prefix, 'value') + filename = arguments.length === 3 + ? webidl.converters.USVString(filename, prefix, 'filename') + : undefined + + // 2. Let entry be the result of creating an entry with + // name, value, and filename if given. + const entry = makeEntry(name, value, filename) + + // 3. Append entry to this’s entry list. + this[kState].push(entry) + } + + delete (name) { + webidl.brandCheck(this, FormData) + + const prefix = 'FormData.delete' + webidl.argumentLengthCheck(arguments, 1, prefix) + + name = webidl.converters.USVString(name, prefix, 'name') + + // The delete(name) method steps are to remove all entries whose name + // is name from this’s entry list. + this[kState] = this[kState].filter(entry => entry.name !== name) + } + + get (name) { + webidl.brandCheck(this, FormData) + + const prefix = 'FormData.get' + webidl.argumentLengthCheck(arguments, 1, prefix) + + name = webidl.converters.USVString(name, prefix, 'name') + + // 1. If there is no entry whose name is name in this’s entry list, + // then return null. + const idx = this[kState].findIndex((entry) => entry.name === name) + if (idx === -1) { + return null + } + + // 2. Return the value of the first entry whose name is name from + // this’s entry list. + return this[kState][idx].value + } + + getAll (name) { + webidl.brandCheck(this, FormData) + + const prefix = 'FormData.getAll' + webidl.argumentLengthCheck(arguments, 1, prefix) + + name = webidl.converters.USVString(name, prefix, 'name') + + // 1. If there is no entry whose name is name in this’s entry list, + // then return the empty list. + // 2. Return the values of all entries whose name is name, in order, + // from this’s entry list. + return this[kState] + .filter((entry) => entry.name === name) + .map((entry) => entry.value) + } + + has (name) { + webidl.brandCheck(this, FormData) + + const prefix = 'FormData.has' + webidl.argumentLengthCheck(arguments, 1, prefix) + + name = webidl.converters.USVString(name, prefix, 'name') + + // The has(name) method steps are to return true if there is an entry + // whose name is name in this’s entry list; otherwise false. + return this[kState].findIndex((entry) => entry.name === name) !== -1 + } + + set (name, value, filename = undefined) { + webidl.brandCheck(this, FormData) + + const prefix = 'FormData.set' + webidl.argumentLengthCheck(arguments, 2, prefix) + + if (arguments.length === 3 && !isBlobLike(value)) { + throw new TypeError( + "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" + ) + } + + // The set(name, value) and set(name, blobValue, filename) method steps + // are: + + // 1. Let value be value if given; otherwise blobValue. + + name = webidl.converters.USVString(name, prefix, 'name') + value = isBlobLike(value) + ? webidl.converters.Blob(value, prefix, 'name', { strict: false }) + : webidl.converters.USVString(value, prefix, 'name') + filename = arguments.length === 3 + ? webidl.converters.USVString(filename, prefix, 'name') + : undefined + + // 2. Let entry be the result of creating an entry with name, value, and + // filename if given. + const entry = makeEntry(name, value, filename) + + // 3. If there are entries in this’s entry list whose name is name, then + // replace the first such entry with entry and remove the others. + const idx = this[kState].findIndex((entry) => entry.name === name) + if (idx !== -1) { + this[kState] = [ + ...this[kState].slice(0, idx), + entry, + ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name) + ] + } else { + // 4. Otherwise, append entry to this’s entry list. + this[kState].push(entry) + } + } + + [nodeUtil.inspect.custom] (depth, options) { + const state = this[kState].reduce((a, b) => { + if (a[b.name]) { + if (Array.isArray(a[b.name])) { + a[b.name].push(b.value) + } else { + a[b.name] = [a[b.name], b.value] + } + } else { + a[b.name] = b.value + } + + return a + }, { __proto__: null }) + + options.depth ??= depth + options.colors ??= true + + const output = nodeUtil.formatWithOptions(options, state) + + // remove [Object null prototype] + return `FormData ${output.slice(output.indexOf(']') + 2)}` + } +} + +iteratorMixin('FormData', FormData, kState, 'name', 'value') + +Object.defineProperties(FormData.prototype, { + append: kEnumerableProperty, + delete: kEnumerableProperty, + get: kEnumerableProperty, + getAll: kEnumerableProperty, + has: kEnumerableProperty, + set: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'FormData', + configurable: true + } +}) + +/** + * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry + * @param {string} name + * @param {string|Blob} value + * @param {?string} filename + * @returns + */ +function makeEntry (name, value, filename) { + // 1. Set name to the result of converting name into a scalar value string. + // Note: This operation was done by the webidl converter USVString. + + // 2. If value is a string, then set value to the result of converting + // value into a scalar value string. + if (typeof value === 'string') { + // Note: This operation was done by the webidl converter USVString. + } else { + // 3. Otherwise: + + // 1. If value is not a File object, then set value to a new File object, + // representing the same bytes, whose name attribute value is "blob" + if (!isFileLike(value)) { + value = value instanceof Blob + ? new File([value], 'blob', { type: value.type }) + : new FileLike(value, 'blob', { type: value.type }) + } + + // 2. If filename is given, then set value to a new File object, + // representing the same bytes, whose name attribute is filename. + if (filename !== undefined) { + /** @type {FilePropertyBag} */ + const options = { + type: value.type, + lastModified: value.lastModified + } + + value = value instanceof NativeFile + ? new File([value], filename, options) + : new FileLike(value, filename, options) + } + } + + // 4. Return an entry whose name is name and whose value is value. + return { name, value } +} + +module.exports = { FormData, makeEntry } diff --git a/.pnpm-store/v11/files/48/7f3e1f59622b42955afe3db4b58822cd527162f8433c2d8d9fb20a83cd83ce57afea9fb2d540ebc1ba315f8f1b0ecd74ce45ff7f086f9c837b8073040a97f7 b/.pnpm-store/v11/files/48/7f3e1f59622b42955afe3db4b58822cd527162f8433c2d8d9fb20a83cd83ce57afea9fb2d540ebc1ba315f8f1b0ecd74ce45ff7f086f9c837b8073040a97f7 new file mode 100644 index 0000000000..a5d95153ec --- /dev/null +++ b/.pnpm-store/v11/files/48/7f3e1f59622b42955afe3db4b58822cd527162f8433c2d8d9fb20a83cd83ce57afea9fb2d540ebc1ba315f8f1b0ecd74ce45ff7f086f9c837b8073040a97f7 @@ -0,0 +1,170 @@ +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import locale +import os +import re +import sys +from functools import reduce + + +def XmlToString(content, encoding="utf-8", pretty=False): + """Writes the XML content to disk, touching the file only if it has changed. + + Visual Studio files have a lot of pre-defined structures. This function makes + it easy to represent these structures as Python data structures, instead of + having to create a lot of function calls. + + Each XML element of the content is represented as a list composed of: + 1. The name of the element, a string, + 2. The attributes of the element, a dictionary (optional), and + 3+. The content of the element, if any. Strings are simple text nodes and + lists are child elements. + + Example 1: + + becomes + ['test'] + + Example 2: + + This is + it! + + + becomes + ['myelement', {'a':'value1', 'b':'value2'}, + ['childtype', 'This is'], + ['childtype', 'it!'], + ] + + Args: + content: The structured content to be converted. + encoding: The encoding to report on the first XML line. + pretty: True if we want pretty printing with indents and new lines. + + Returns: + The XML content as a string. + """ + # We create a huge list of all the elements of the file. + xml_parts = ['' % encoding] + if pretty: + xml_parts.append("\n") + _ConstructContentList(xml_parts, content, pretty) + + # Convert it to a string + return "".join(xml_parts) + + +def _ConstructContentList(xml_parts, specification, pretty, level=0): + """Appends the XML parts corresponding to the specification. + + Args: + xml_parts: A list of XML parts to be appended to. + specification: The specification of the element. See EasyXml docs. + pretty: True if we want pretty printing with indents and new lines. + level: Indentation level. + """ + # The first item in a specification is the name of the element. + if pretty: + indentation = " " * level + new_line = "\n" + else: + indentation = "" + new_line = "" + name = specification[0] + if not isinstance(name, str): + raise Exception( + "The first item of an EasyXml specification should be " + "a string. Specification was " + str(specification) + ) + xml_parts.append(indentation + "<" + name) + + # Optionally in second position is a dictionary of the attributes. + rest = specification[1:] + if rest and isinstance(rest[0], dict): + for at, val in sorted(rest[0].items()): + xml_parts.append(f' {at}="{_XmlEscape(val, attr=True)}"') + rest = rest[1:] + if rest: + xml_parts.append(">") + all_strings = reduce(lambda x, y: x and isinstance(y, str), rest, True) + multi_line = not all_strings + if multi_line and new_line: + xml_parts.append(new_line) + for child_spec in rest: + # If it's a string, append a text node. + # Otherwise recurse over that child definition + if isinstance(child_spec, str): + xml_parts.append(_XmlEscape(child_spec)) + else: + _ConstructContentList(xml_parts, child_spec, pretty, level + 1) + if multi_line and indentation: + xml_parts.append(indentation) + xml_parts.append(f"{new_line}") + else: + xml_parts.append("/>%s" % new_line) + + +def WriteXmlIfChanged( + content, path, encoding="utf-8", pretty=False, win32=(sys.platform == "win32") +): + """Writes the XML content to disk, touching the file only if it has changed. + + Args: + content: The structured content to be written. + path: Location of the file. + encoding: The encoding to report on the first line of the XML file. + pretty: True if we want pretty printing with indents and new lines. + """ + xml_string = XmlToString(content, encoding, pretty) + if win32 and os.linesep != "\r\n": + xml_string = xml_string.replace("\n", "\r\n") + + try: # getdefaultlocale() was removed in Python 3.11 + default_encoding = locale.getdefaultlocale()[1] + except AttributeError: + default_encoding = locale.getencoding() + + if default_encoding and default_encoding.upper() != encoding.upper(): + xml_string = xml_string.encode(encoding) + + # Get the old content + try: + with open(path) as file: + existing = file.read() + except OSError: + existing = None + + # It has changed, write it + if existing != xml_string: + with open(path, "wb") as file: + file.write(xml_string) + + +_xml_escape_map = { + '"': """, + "'": "'", + "<": "<", + ">": ">", + "&": "&", + "\n": " ", + "\r": " ", +} + + +_xml_escape_re = re.compile("(%s)" % "|".join(map(re.escape, _xml_escape_map.keys()))) + + +def _XmlEscape(value, attr=False): + """Escape a string for inclusion in XML.""" + + def replace(match): + m = match.string[match.start() : match.end()] + # don't replace single quotes in attrs + if attr and m == "'": + return m + return _xml_escape_map[m] + + return _xml_escape_re.sub(replace, value) diff --git a/.pnpm-store/v11/files/4a/12ad1b25d620a4c525ae98d81ce32e3f596fdb00cd3d9c49e4a99448369b420dd7e12df35e9b4c4699dff1e1e73f70110f60e33cbd1bb800ceb252545a854b b/.pnpm-store/v11/files/4a/12ad1b25d620a4c525ae98d81ce32e3f596fdb00cd3d9c49e4a99448369b420dd7e12df35e9b4c4699dff1e1e73f70110f60e33cbd1bb800ceb252545a854b new file mode 100644 index 0000000000..3abaa8bd6d --- /dev/null +++ b/.pnpm-store/v11/files/4a/12ad1b25d620a4c525ae98d81ce32e3f596fdb00cd3d9c49e4a99448369b420dd7e12df35e9b4c4699dff1e1e73f70110f60e33cbd1bb800ceb252545a854b @@ -0,0 +1,610 @@ +'use strict' + +const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require('./headers') +const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require('./body') +const util = require('../../core/util') +const nodeUtil = require('node:util') +const { kEnumerableProperty } = util +const { + isValidReasonPhrase, + isCancelled, + isAborted, + isBlobLike, + serializeJavascriptValueToJSONString, + isErrorLike, + isomorphicEncode, + environmentSettingsObject: relevantRealm +} = require('./util') +const { + redirectStatusSet, + nullBodyStatus +} = require('./constants') +const { kState, kHeaders } = require('./symbols') +const { webidl } = require('./webidl') +const { FormData } = require('./formdata') +const { URLSerializer } = require('./data-url') +const { kConstruct } = require('../../core/symbols') +const assert = require('node:assert') +const { types } = require('node:util') + +const textEncoder = new TextEncoder('utf-8') + +// https://fetch.spec.whatwg.org/#response-class +class Response { + // Creates network error Response. + static error () { + // The static error() method steps are to return the result of creating a + // Response object, given a new network error, "immutable", and this’s + // relevant Realm. + const responseObject = fromInnerResponse(makeNetworkError(), 'immutable') + + return responseObject + } + + // https://fetch.spec.whatwg.org/#dom-response-json + static json (data, init = {}) { + webidl.argumentLengthCheck(arguments, 1, 'Response.json') + + if (init !== null) { + init = webidl.converters.ResponseInit(init) + } + + // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data. + const bytes = textEncoder.encode( + serializeJavascriptValueToJSONString(data) + ) + + // 2. Let body be the result of extracting bytes. + const body = extractBody(bytes) + + // 3. Let responseObject be the result of creating a Response object, given a new response, + // "response", and this’s relevant Realm. + const responseObject = fromInnerResponse(makeResponse({}), 'response') + + // 4. Perform initialize a response given responseObject, init, and (body, "application/json"). + initializeResponse(responseObject, init, { body: body[0], type: 'application/json' }) + + // 5. Return responseObject. + return responseObject + } + + // Creates a redirect Response that redirects to url with status status. + static redirect (url, status = 302) { + webidl.argumentLengthCheck(arguments, 1, 'Response.redirect') + + url = webidl.converters.USVString(url) + status = webidl.converters['unsigned short'](status) + + // 1. Let parsedURL be the result of parsing url with current settings + // object’s API base URL. + // 2. If parsedURL is failure, then throw a TypeError. + // TODO: base-URL? + let parsedURL + try { + parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl) + } catch (err) { + throw new TypeError(`Failed to parse URL from ${url}`, { cause: err }) + } + + // 3. If status is not a redirect status, then throw a RangeError. + if (!redirectStatusSet.has(status)) { + throw new RangeError(`Invalid status code ${status}`) + } + + // 4. Let responseObject be the result of creating a Response object, + // given a new response, "immutable", and this’s relevant Realm. + const responseObject = fromInnerResponse(makeResponse({}), 'immutable') + + // 5. Set responseObject’s response’s status to status. + responseObject[kState].status = status + + // 6. Let value be parsedURL, serialized and isomorphic encoded. + const value = isomorphicEncode(URLSerializer(parsedURL)) + + // 7. Append `Location`/value to responseObject’s response’s header list. + responseObject[kState].headersList.append('location', value, true) + + // 8. Return responseObject. + return responseObject + } + + // https://fetch.spec.whatwg.org/#dom-response + constructor (body = null, init = {}) { + webidl.util.markAsUncloneable(this) + if (body === kConstruct) { + return + } + + if (body !== null) { + body = webidl.converters.BodyInit(body) + } + + init = webidl.converters.ResponseInit(init) + + // 1. Set this’s response to a new response. + this[kState] = makeResponse({}) + + // 2. Set this’s headers to a new Headers object with this’s relevant + // Realm, whose header list is this’s response’s header list and guard + // is "response". + this[kHeaders] = new Headers(kConstruct) + setHeadersGuard(this[kHeaders], 'response') + setHeadersList(this[kHeaders], this[kState].headersList) + + // 3. Let bodyWithType be null. + let bodyWithType = null + + // 4. If body is non-null, then set bodyWithType to the result of extracting body. + if (body != null) { + const [extractedBody, type] = extractBody(body) + bodyWithType = { body: extractedBody, type } + } + + // 5. Perform initialize a response given this, init, and bodyWithType. + initializeResponse(this, init, bodyWithType) + } + + // Returns response’s type, e.g., "cors". + get type () { + webidl.brandCheck(this, Response) + + // The type getter steps are to return this’s response’s type. + return this[kState].type + } + + // Returns response’s URL, if it has one; otherwise the empty string. + get url () { + webidl.brandCheck(this, Response) + + const urlList = this[kState].urlList + + // The url getter steps are to return the empty string if this’s + // response’s URL is null; otherwise this’s response’s URL, + // serialized with exclude fragment set to true. + const url = urlList[urlList.length - 1] ?? null + + if (url === null) { + return '' + } + + return URLSerializer(url, true) + } + + // Returns whether response was obtained through a redirect. + get redirected () { + webidl.brandCheck(this, Response) + + // The redirected getter steps are to return true if this’s response’s URL + // list has more than one item; otherwise false. + return this[kState].urlList.length > 1 + } + + // Returns response’s status. + get status () { + webidl.brandCheck(this, Response) + + // The status getter steps are to return this’s response’s status. + return this[kState].status + } + + // Returns whether response’s status is an ok status. + get ok () { + webidl.brandCheck(this, Response) + + // The ok getter steps are to return true if this’s response’s status is an + // ok status; otherwise false. + return this[kState].status >= 200 && this[kState].status <= 299 + } + + // Returns response’s status message. + get statusText () { + webidl.brandCheck(this, Response) + + // The statusText getter steps are to return this’s response’s status + // message. + return this[kState].statusText + } + + // Returns response’s headers as Headers. + get headers () { + webidl.brandCheck(this, Response) + + // The headers getter steps are to return this’s headers. + return this[kHeaders] + } + + get body () { + webidl.brandCheck(this, Response) + + return this[kState].body ? this[kState].body.stream : null + } + + get bodyUsed () { + webidl.brandCheck(this, Response) + + return !!this[kState].body && util.isDisturbed(this[kState].body.stream) + } + + // Returns a clone of response. + clone () { + webidl.brandCheck(this, Response) + + // 1. If this is unusable, then throw a TypeError. + if (bodyUnusable(this)) { + throw webidl.errors.exception({ + header: 'Response.clone', + message: 'Body has already been consumed.' + }) + } + + // 2. Let clonedResponse be the result of cloning this’s response. + const clonedResponse = cloneResponse(this[kState]) + + // Note: To re-register because of a new stream. + if (hasFinalizationRegistry && this[kState].body?.stream) { + streamRegistry.register(this, new WeakRef(this[kState].body.stream)) + } + + // 3. Return the result of creating a Response object, given + // clonedResponse, this’s headers’s guard, and this’s relevant Realm. + return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders])) + } + + [nodeUtil.inspect.custom] (depth, options) { + if (options.depth === null) { + options.depth = 2 + } + + options.colors ??= true + + const properties = { + status: this.status, + statusText: this.statusText, + headers: this.headers, + body: this.body, + bodyUsed: this.bodyUsed, + ok: this.ok, + redirected: this.redirected, + type: this.type, + url: this.url + } + + return `Response ${nodeUtil.formatWithOptions(options, properties)}` + } +} + +mixinBody(Response) + +Object.defineProperties(Response.prototype, { + type: kEnumerableProperty, + url: kEnumerableProperty, + status: kEnumerableProperty, + ok: kEnumerableProperty, + redirected: kEnumerableProperty, + statusText: kEnumerableProperty, + headers: kEnumerableProperty, + clone: kEnumerableProperty, + body: kEnumerableProperty, + bodyUsed: kEnumerableProperty, + [Symbol.toStringTag]: { + value: 'Response', + configurable: true + } +}) + +Object.defineProperties(Response, { + json: kEnumerableProperty, + redirect: kEnumerableProperty, + error: kEnumerableProperty +}) + +// https://fetch.spec.whatwg.org/#concept-response-clone +function cloneResponse (response) { + // To clone a response response, run these steps: + + // 1. If response is a filtered response, then return a new identical + // filtered response whose internal response is a clone of response’s + // internal response. + if (response.internalResponse) { + return filterResponse( + cloneResponse(response.internalResponse), + response.type + ) + } + + // 2. Let newResponse be a copy of response, except for its body. + const newResponse = makeResponse({ ...response, body: null }) + + // 3. If response’s body is non-null, then set newResponse’s body to the + // result of cloning response’s body. + if (response.body != null) { + newResponse.body = cloneBody(newResponse, response.body) + } + + // 4. Return newResponse. + return newResponse +} + +function makeResponse (init) { + return { + aborted: false, + rangeRequested: false, + timingAllowPassed: false, + requestIncludesCredentials: false, + type: 'default', + status: 200, + timingInfo: null, + cacheState: '', + statusText: '', + ...init, + headersList: init?.headersList + ? new HeadersList(init?.headersList) + : new HeadersList(), + urlList: init?.urlList ? [...init.urlList] : [] + } +} + +function makeNetworkError (reason) { + const isError = isErrorLike(reason) + return makeResponse({ + type: 'error', + status: 0, + error: isError + ? reason + : new Error(reason ? String(reason) : reason), + aborted: reason && reason.name === 'AbortError' + }) +} + +// @see https://fetch.spec.whatwg.org/#concept-network-error +function isNetworkError (response) { + return ( + // A network error is a response whose type is "error", + response.type === 'error' && + // status is 0 + response.status === 0 + ) +} + +function makeFilteredResponse (response, state) { + state = { + internalResponse: response, + ...state + } + + return new Proxy(response, { + get (target, p) { + return p in state ? state[p] : target[p] + }, + set (target, p, value) { + assert(!(p in state)) + target[p] = value + return true + } + }) +} + +// https://fetch.spec.whatwg.org/#concept-filtered-response +function filterResponse (response, type) { + // Set response to the following filtered response with response as its + // internal response, depending on request’s response tainting: + if (type === 'basic') { + // A basic filtered response is a filtered response whose type is "basic" + // and header list excludes any headers in internal response’s header list + // whose name is a forbidden response-header name. + + // Note: undici does not implement forbidden response-header names + return makeFilteredResponse(response, { + type: 'basic', + headersList: response.headersList + }) + } else if (type === 'cors') { + // A CORS filtered response is a filtered response whose type is "cors" + // and header list excludes any headers in internal response’s header + // list whose name is not a CORS-safelisted response-header name, given + // internal response’s CORS-exposed header-name list. + + // Note: undici does not implement CORS-safelisted response-header names + return makeFilteredResponse(response, { + type: 'cors', + headersList: response.headersList + }) + } else if (type === 'opaque') { + // An opaque filtered response is a filtered response whose type is + // "opaque", URL list is the empty list, status is 0, status message + // is the empty byte sequence, header list is empty, and body is null. + + return makeFilteredResponse(response, { + type: 'opaque', + urlList: Object.freeze([]), + status: 0, + statusText: '', + body: null + }) + } else if (type === 'opaqueredirect') { + // An opaque-redirect filtered response is a filtered response whose type + // is "opaqueredirect", status is 0, status message is the empty byte + // sequence, header list is empty, and body is null. + + return makeFilteredResponse(response, { + type: 'opaqueredirect', + status: 0, + statusText: '', + headersList: [], + body: null + }) + } else { + assert(false) + } +} + +// https://fetch.spec.whatwg.org/#appropriate-network-error +function makeAppropriateNetworkError (fetchParams, err = null) { + // 1. Assert: fetchParams is canceled. + assert(isCancelled(fetchParams)) + + // 2. Return an aborted network error if fetchParams is aborted; + // otherwise return a network error. + return isAborted(fetchParams) + ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err })) + : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err })) +} + +// https://whatpr.org/fetch/1392.html#initialize-a-response +function initializeResponse (response, init, body) { + // 1. If init["status"] is not in the range 200 to 599, inclusive, then + // throw a RangeError. + if (init.status !== null && (init.status < 200 || init.status > 599)) { + throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.') + } + + // 2. If init["statusText"] does not match the reason-phrase token production, + // then throw a TypeError. + if ('statusText' in init && init.statusText != null) { + // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2: + // reason-phrase = *( HTAB / SP / VCHAR / obs-text ) + if (!isValidReasonPhrase(String(init.statusText))) { + throw new TypeError('Invalid statusText') + } + } + + // 3. Set response’s response’s status to init["status"]. + if ('status' in init && init.status != null) { + response[kState].status = init.status + } + + // 4. Set response’s response’s status message to init["statusText"]. + if ('statusText' in init && init.statusText != null) { + response[kState].statusText = init.statusText + } + + // 5. If init["headers"] exists, then fill response’s headers with init["headers"]. + if ('headers' in init && init.headers != null) { + fill(response[kHeaders], init.headers) + } + + // 6. If body was given, then: + if (body) { + // 1. If response's status is a null body status, then throw a TypeError. + if (nullBodyStatus.includes(response.status)) { + throw webidl.errors.exception({ + header: 'Response constructor', + message: `Invalid response status code ${response.status}` + }) + } + + // 2. Set response's body to body's body. + response[kState].body = body.body + + // 3. If body's type is non-null and response's header list does not contain + // `Content-Type`, then append (`Content-Type`, body's type) to response's header list. + if (body.type != null && !response[kState].headersList.contains('content-type', true)) { + response[kState].headersList.append('content-type', body.type, true) + } + } +} + +/** + * @see https://fetch.spec.whatwg.org/#response-create + * @param {any} innerResponse + * @param {'request' | 'immutable' | 'request-no-cors' | 'response' | 'none'} guard + * @returns {Response} + */ +function fromInnerResponse (innerResponse, guard) { + const response = new Response(kConstruct) + response[kState] = innerResponse + response[kHeaders] = new Headers(kConstruct) + setHeadersList(response[kHeaders], innerResponse.headersList) + setHeadersGuard(response[kHeaders], guard) + + if (hasFinalizationRegistry && innerResponse.body?.stream) { + // If the target (response) is reclaimed, the cleanup callback may be called at some point with + // the held value provided for it (innerResponse.body.stream). The held value can be any value: + // a primitive or an object, even undefined. If the held value is an object, the registry keeps + // a strong reference to it (so it can pass it to the cleanup callback later). Reworded from + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry + streamRegistry.register(response, new WeakRef(innerResponse.body.stream)) + } + + return response +} + +webidl.converters.ReadableStream = webidl.interfaceConverter( + ReadableStream +) + +webidl.converters.FormData = webidl.interfaceConverter( + FormData +) + +webidl.converters.URLSearchParams = webidl.interfaceConverter( + URLSearchParams +) + +// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit +webidl.converters.XMLHttpRequestBodyInit = function (V, prefix, name) { + if (typeof V === 'string') { + return webidl.converters.USVString(V, prefix, name) + } + + if (isBlobLike(V)) { + return webidl.converters.Blob(V, prefix, name, { strict: false }) + } + + if (ArrayBuffer.isView(V) || types.isArrayBuffer(V)) { + return webidl.converters.BufferSource(V, prefix, name) + } + + if (util.isFormDataLike(V)) { + return webidl.converters.FormData(V, prefix, name, { strict: false }) + } + + if (V instanceof URLSearchParams) { + return webidl.converters.URLSearchParams(V, prefix, name) + } + + return webidl.converters.DOMString(V, prefix, name) +} + +// https://fetch.spec.whatwg.org/#bodyinit +webidl.converters.BodyInit = function (V, prefix, argument) { + if (V instanceof ReadableStream) { + return webidl.converters.ReadableStream(V, prefix, argument) + } + + // Note: the spec doesn't include async iterables, + // this is an undici extension. + if (V?.[Symbol.asyncIterator]) { + return V + } + + return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument) +} + +webidl.converters.ResponseInit = webidl.dictionaryConverter([ + { + key: 'status', + converter: webidl.converters['unsigned short'], + defaultValue: () => 200 + }, + { + key: 'statusText', + converter: webidl.converters.ByteString, + defaultValue: () => '' + }, + { + key: 'headers', + converter: webidl.converters.HeadersInit + } +]) + +module.exports = { + isNetworkError, + makeNetworkError, + makeResponse, + makeAppropriateNetworkError, + filterResponse, + Response, + cloneResponse, + fromInnerResponse +} diff --git a/.pnpm-store/v11/files/4a/2f8c00f376aacbc37336e2a43bac2de1dd834e811c035a69833664d26188c15e7a374cd173654353c2d54174b90c5e1284073d097eeb8d6623319e3c978d1a b/.pnpm-store/v11/files/4a/2f8c00f376aacbc37336e2a43bac2de1dd834e811c035a69833664d26188c15e7a374cd173654353c2d54174b90c5e1284073d097eeb8d6623319e3c978d1a new file mode 100644 index 0000000000..8ac8481930 --- /dev/null +++ b/.pnpm-store/v11/files/4a/2f8c00f376aacbc37336e2a43bac2de1dd834e811c035a69833664d26188c15e7a374cd173654353c2d54174b90c5e1284073d097eeb8d6623319e3c978d1a @@ -0,0 +1,5 @@ +'use strict' + +const { Buffer } = require('node:buffer') + +module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv', 'base64') diff --git a/.pnpm-store/v11/files/4a/671c4a0b4f3ed916354698e4187d7ef9a69400767dfb93d804427abcf032887bcd367ec31b74fd5f1309b704d404388bf059251336cfa83a9de9b72344c2ce b/.pnpm-store/v11/files/4a/671c4a0b4f3ed916354698e4187d7ef9a69400767dfb93d804427abcf032887bcd367ec31b74fd5f1309b704d404388bf059251336cfa83a9de9b72344c2ce new file mode 100644 index 0000000000..1df6f1227b --- /dev/null +++ b/.pnpm-store/v11/files/4a/671c4a0b4f3ed916354698e4187d7ef9a69400767dfb93d804427abcf032887bcd367ec31b74fd5f1309b704d404388bf059251336cfa83a9de9b72344c2ce @@ -0,0 +1,40 @@ +'use strict' + +// In case of breaking changes, increase the version +// number to avoid conflicts. +const globalOrigin = Symbol.for('undici.globalOrigin.1') + +function getGlobalOrigin () { + return globalThis[globalOrigin] +} + +function setGlobalOrigin (newOrigin) { + if (newOrigin === undefined) { + Object.defineProperty(globalThis, globalOrigin, { + value: undefined, + writable: true, + enumerable: false, + configurable: false + }) + + return + } + + const parsedURL = new URL(newOrigin) + + if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') { + throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`) + } + + Object.defineProperty(globalThis, globalOrigin, { + value: parsedURL, + writable: true, + enumerable: false, + configurable: false + }) +} + +module.exports = { + getGlobalOrigin, + setGlobalOrigin +} diff --git a/.pnpm-store/v11/files/4a/e0600174ebcaa9cc4dfb5d40b4e02da63523b71d6f18857b2c6a0b66c6491e6a4c8cacb650784a5752fa9d51fb749272cd95682910c46ba1aa1cd9b9c17f00 b/.pnpm-store/v11/files/4a/e0600174ebcaa9cc4dfb5d40b4e02da63523b71d6f18857b2c6a0b66c6491e6a4c8cacb650784a5752fa9d51fb749272cd95682910c46ba1aa1cd9b9c17f00 new file mode 100644 index 0000000000..94515ad913 --- /dev/null +++ b/.pnpm-store/v11/files/4a/e0600174ebcaa9cc4dfb5d40b4e02da63523b71d6f18857b2c6a0b66c6491e6a4c8cacb650784a5752fa9d51fb749272cd95682910c46ba1aa1cd9b9c17f00 @@ -0,0 +1,158 @@ +const META = Symbol('proc-log.meta') +module.exports = { + META: META, + output: { + LEVELS: [ + 'standard', + 'error', + 'buffer', + 'flush', + ], + KEYS: { + standard: 'standard', + error: 'error', + buffer: 'buffer', + flush: 'flush', + }, + standard: function (...args) { + return process.emit('output', 'standard', ...args) + }, + error: function (...args) { + return process.emit('output', 'error', ...args) + }, + buffer: function (...args) { + return process.emit('output', 'buffer', ...args) + }, + flush: function (...args) { + return process.emit('output', 'flush', ...args) + }, + }, + log: { + LEVELS: [ + 'notice', + 'error', + 'warn', + 'info', + 'verbose', + 'http', + 'silly', + 'timing', + 'pause', + 'resume', + ], + KEYS: { + notice: 'notice', + error: 'error', + warn: 'warn', + info: 'info', + verbose: 'verbose', + http: 'http', + silly: 'silly', + timing: 'timing', + pause: 'pause', + resume: 'resume', + }, + error: function (...args) { + return process.emit('log', 'error', ...args) + }, + notice: function (...args) { + return process.emit('log', 'notice', ...args) + }, + warn: function (...args) { + return process.emit('log', 'warn', ...args) + }, + info: function (...args) { + return process.emit('log', 'info', ...args) + }, + verbose: function (...args) { + return process.emit('log', 'verbose', ...args) + }, + http: function (...args) { + return process.emit('log', 'http', ...args) + }, + silly: function (...args) { + return process.emit('log', 'silly', ...args) + }, + timing: function (...args) { + return process.emit('log', 'timing', ...args) + }, + pause: function () { + return process.emit('log', 'pause') + }, + resume: function () { + return process.emit('log', 'resume') + }, + }, + time: { + LEVELS: [ + 'start', + 'end', + ], + KEYS: { + start: 'start', + end: 'end', + }, + start: function (name, fn) { + process.emit('time', 'start', name) + function end () { + return process.emit('time', 'end', name) + } + if (typeof fn === 'function') { + const res = fn() + if (res && res.finally) { + return res.finally(end) + } + end() + return res + } + return end + }, + end: function (name) { + return process.emit('time', 'end', name) + }, + }, + input: { + LEVELS: [ + 'start', + 'end', + 'read', + ], + KEYS: { + start: 'start', + end: 'end', + read: 'read', + }, + start: function (...args) { + // Support callback for backwards compatibility and pass additional args to event + let fn + if (typeof args[0] === 'function') { + fn = args.shift() + } + process.emit('input', 'start', ...args) + function end () { + return process.emit('input', 'end', ...args) + } + if (typeof fn === 'function') { + const res = fn() + if (res && res.finally) { + return res.finally(end) + } + end() + return res + } + return end + }, + end: function (...args) { + return process.emit('input', 'end', ...args) + }, + read: function (...args) { + let resolve, reject + const promise = new Promise((_resolve, _reject) => { + resolve = _resolve + reject = _reject + }) + process.emit('input', 'read', resolve, reject, ...args) + return promise + }, + }, +} diff --git a/.pnpm-store/v11/files/4b/1023e9be53e4196b4f6dca426701bf6ec73857a6934f76d830747d126c166bdfc9fd58e1e54d4389d0df75d046cabecae61f70917a9619fc56317ea7194c03 b/.pnpm-store/v11/files/4b/1023e9be53e4196b4f6dca426701bf6ec73857a6934f76d830747d126c166bdfc9fd58e1e54d4389d0df75d046cabecae61f70917a9619fc56317ea7194c03 new file mode 100644 index 0000000000..4f2f7e5f14 --- /dev/null +++ b/.pnpm-store/v11/files/4b/1023e9be53e4196b4f6dca426701bf6ec73857a6934f76d830747d126c166bdfc9fd58e1e54d4389d0df75d046cabecae61f70917a9619fc56317ea7194c03 @@ -0,0 +1,94 @@ +// Tar can encode large and negative numbers using a leading byte of +// 0xff for negative, and 0x80 for positive. +export const encode = (num, buf) => { + if (!Number.isSafeInteger(num)) { + // The number is so large that javascript cannot represent it with integer + // precision. + throw Error('cannot encode number outside of javascript safe integer range'); + } + else if (num < 0) { + encodeNegative(num, buf); + } + else { + encodePositive(num, buf); + } + return buf; +}; +const encodePositive = (num, buf) => { + buf[0] = 0x80; + for (var i = buf.length; i > 1; i--) { + buf[i - 1] = num & 0xff; + num = Math.floor(num / 0x100); + } +}; +const encodeNegative = (num, buf) => { + buf[0] = 0xff; + var flipped = false; + num = num * -1; + for (var i = buf.length; i > 1; i--) { + var byte = num & 0xff; + num = Math.floor(num / 0x100); + if (flipped) { + buf[i - 1] = onesComp(byte); + } + else if (byte === 0) { + buf[i - 1] = 0; + } + else { + flipped = true; + buf[i - 1] = twosComp(byte); + } + } +}; +export const parse = (buf) => { + const pre = buf[0]; + const value = pre === 0x80 ? pos(buf.subarray(1, buf.length)) + : pre === 0xff ? twos(buf) + : null; + if (value === null) { + throw Error('invalid base256 encoding'); + } + if (!Number.isSafeInteger(value)) { + // The number is so large that javascript cannot represent it with integer + // precision. + throw Error('parsed number outside of javascript safe integer range'); + } + return value; +}; +const twos = (buf) => { + var len = buf.length; + var sum = 0; + var flipped = false; + for (var i = len - 1; i > -1; i--) { + var byte = Number(buf[i]); + var f; + if (flipped) { + f = onesComp(byte); + } + else if (byte === 0) { + f = byte; + } + else { + flipped = true; + f = twosComp(byte); + } + if (f !== 0) { + sum -= f * Math.pow(256, len - i - 1); + } + } + return sum; +}; +const pos = (buf) => { + var len = buf.length; + var sum = 0; + for (var i = len - 1; i > -1; i--) { + var byte = Number(buf[i]); + if (byte !== 0) { + sum += byte * Math.pow(256, len - i - 1); + } + } + return sum; +}; +const onesComp = (byte) => (0xff ^ byte) & 0xff; +const twosComp = (byte) => ((0xff ^ byte) + 1) & 0xff; +//# sourceMappingURL=large-numbers.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/4b/18617fedce3f0e8dd76830a68c0318ed81f13d151432dc77e383d263106ab58cf6024b8ac5ea5e224db211e630f34cf9d2556e846b1f99bb8c9965e757b9c7 b/.pnpm-store/v11/files/4b/18617fedce3f0e8dd76830a68c0318ed81f13d151432dc77e383d263106ab58cf6024b8ac5ea5e224db211e630f34cf9d2556e846b1f99bb8c9965e757b9c7 new file mode 100644 index 0000000000..6d1db91543 --- /dev/null +++ b/.pnpm-store/v11/files/4b/18617fedce3f0e8dd76830a68c0318ed81f13d151432dc77e383d263106ab58cf6024b8ac5ea5e224db211e630f34cf9d2556e846b1f99bb8c9965e757b9c7 @@ -0,0 +1,37 @@ +'use strict' + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' + +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || +/* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 + +// Max safe length for a build identifier. The max length minus 6 characters for +// the shortest version with a build 0.0.0+BUILD. +const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +const RELEASE_TYPES = [ + 'major', + 'premajor', + 'minor', + 'preminor', + 'patch', + 'prepatch', + 'prerelease', +] + +module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 0b001, + FLAG_LOOSE: 0b010, +} diff --git a/.pnpm-store/v11/files/4b/2a61e6643a2dc8f69e2fe5b6c5b2004965995bbdbb9baf1917eb0efcf9100edb3c5c03a59b9fb203ba158b21f3ab117d33c8b9e280e8c3ccede63362ca4e86 b/.pnpm-store/v11/files/4b/2a61e6643a2dc8f69e2fe5b6c5b2004965995bbdbb9baf1917eb0efcf9100edb3c5c03a59b9fb203ba158b21f3ab117d33c8b9e280e8c3ccede63362ca4e86 new file mode 100644 index 0000000000..eafbce45dc --- /dev/null +++ b/.pnpm-store/v11/files/4b/2a61e6643a2dc8f69e2fe5b6c5b2004965995bbdbb9baf1917eb0efcf9100edb3c5c03a59b9fb203ba158b21f3ab117d33c8b9e280e8c3ccede63362ca4e86 @@ -0,0 +1,2 @@ +# DO NOT MODIFY THIS FILE UNLESS YOU KNOW WHAT WILL HAPPEN +# This file is intended for changing pnpm's default settings by the package manager that install pnpm diff --git a/.pnpm-store/v11/files/4b/80a81dfd42adb00dae5bcbac99a03c55446c9a08f7e7c07ea62168ccc6af5fd87b4c9d76c91e245d27a7d2304ee5cd8e9dc0a400aced8345c60186e229e535 b/.pnpm-store/v11/files/4b/80a81dfd42adb00dae5bcbac99a03c55446c9a08f7e7c07ea62168ccc6af5fd87b4c9d76c91e245d27a7d2304ee5cd8e9dc0a400aced8345c60186e229e535 new file mode 100644 index 0000000000..9e4396a5de --- /dev/null +++ b/.pnpm-store/v11/files/4b/80a81dfd42adb00dae5bcbac99a03c55446c9a08f7e7c07ea62168ccc6af5fd87b4c9d76c91e245d27a7d2304ee5cd8e9dc0a400aced8345c60186e229e535 @@ -0,0 +1,8 @@ +'use strict' + +const { readFileSync, writeFileSync } = require('node:fs') +const { transcode } = require('node:buffer') + +const buffer = transcode(readFileSync('./undici-fetch.js'), 'utf8', 'latin1') + +writeFileSync('./undici-fetch.js', buffer.toString('latin1')) diff --git a/.pnpm-store/v11/files/4b/c5f22922c78f4512c1bbf64f3550601c01e0a56c91ffbed02a1b92a642427579ac799b78532e8f1e16caecd9bc9388de83fbc418bee7f524cff05dc2a819a4 b/.pnpm-store/v11/files/4b/c5f22922c78f4512c1bbf64f3550601c01e0a56c91ffbed02a1b92a642427579ac799b78532e8f1e16caecd9bc9388de83fbc418bee7f524cff05dc2a819a4 new file mode 100644 index 0000000000..f0aeda7d48 --- /dev/null +++ b/.pnpm-store/v11/files/4b/c5f22922c78f4512c1bbf64f3550601c01e0a56c91ffbed02a1b92a642427579ac799b78532e8f1e16caecd9bc9388de83fbc418bee7f524cff05dc2a819a4 @@ -0,0 +1,184 @@ +'use strict'; + +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +const DEFAULT_MAX_EXTGLOB_RECURSION = 0; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; +const SEP = '/'; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR, + SEP +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)`, + SEP: '\\' +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE = { + __proto__: null, + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +module.exports = { + DEFAULT_MAX_EXTGLOB_RECURSION, + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + __proto__: null, + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; diff --git a/.pnpm-store/v11/files/4b/e655ac9550bee2c1512a43f79081a07f7e8ac8e3b25eb79d595b21158bd9486312c379b24847e42bc48348ee01bef128fc54a02dda9a7bef1a10ae6446bee0 b/.pnpm-store/v11/files/4b/e655ac9550bee2c1512a43f79081a07f7e8ac8e3b25eb79d595b21158bd9486312c379b24847e42bc48348ee01bef128fc54a02dda9a7bef1a10ae6446bee0 new file mode 100644 index 0000000000..2afe747d3a --- /dev/null +++ b/.pnpm-store/v11/files/4b/e655ac9550bee2c1512a43f79081a07f7e8ac8e3b25eb79d595b21158bd9486312c379b24847e42bc48348ee01bef128fc54a02dda9a7bef1a10ae6446bee0 @@ -0,0 +1,57 @@ +const { addAbortListener } = require('../core/util') +const { RequestAbortedError } = require('../core/errors') + +const kListener = Symbol('kListener') +const kSignal = Symbol('kSignal') + +function abort (self) { + if (self.abort) { + self.abort(self[kSignal]?.reason) + } else { + self.reason = self[kSignal]?.reason ?? new RequestAbortedError() + } + removeSignal(self) +} + +function addSignal (self, signal) { + self.reason = null + + self[kSignal] = null + self[kListener] = null + + if (!signal) { + return + } + + if (signal.aborted) { + abort(self) + return + } + + self[kSignal] = signal + self[kListener] = () => { + abort(self) + } + + addAbortListener(self[kSignal], self[kListener]) +} + +function removeSignal (self) { + if (!self[kSignal]) { + return + } + + if ('removeEventListener' in self[kSignal]) { + self[kSignal].removeEventListener('abort', self[kListener]) + } else { + self[kSignal].removeListener('abort', self[kListener]) + } + + self[kSignal] = null + self[kListener] = null +} + +module.exports = { + addSignal, + removeSignal +} diff --git a/.pnpm-store/v11/files/4c/21e42f8b4365ec78d0ff2695c0bfe27f729c06bd4a56ce128f29478ac5b83c8ddc1345c23c5296da5274959e700875bd1703e515c6395c67b231fe00109c7c b/.pnpm-store/v11/files/4c/21e42f8b4365ec78d0ff2695c0bfe27f729c06bd4a56ce128f29478ac5b83c8ddc1345c23c5296da5274959e700875bd1703e515c6395c67b231fe00109c7c new file mode 100644 index 0000000000..c02ee375e2 --- /dev/null +++ b/.pnpm-store/v11/files/4c/21e42f8b4365ec78d0ff2695c0bfe27f729c06bd4a56ce128f29478ac5b83c8ddc1345c23c5296da5274959e700875bd1703e515c6395c67b231fe00109c7c @@ -0,0 +1,160 @@ +'use strict' + +const { kClients } = require('../core/symbols') +const Agent = require('../dispatcher/agent') +const { + kAgent, + kMockAgentSet, + kMockAgentGet, + kDispatches, + kIsMockActive, + kNetConnect, + kGetNetConnect, + kOptions, + kFactory +} = require('./mock-symbols') +const MockClient = require('./mock-client') +const MockPool = require('./mock-pool') +const { matchValue, buildMockOptions } = require('./mock-utils') +const { InvalidArgumentError, UndiciError } = require('../core/errors') +const Dispatcher = require('../dispatcher/dispatcher') +const Pluralizer = require('./pluralizer') +const PendingInterceptorsFormatter = require('./pending-interceptors-formatter') + +class MockAgent extends Dispatcher { + constructor (opts) { + super(opts) + + this[kNetConnect] = true + this[kIsMockActive] = true + + // Instantiate Agent and encapsulate + if ((opts?.agent && typeof opts.agent.dispatch !== 'function')) { + throw new InvalidArgumentError('Argument opts.agent must implement Agent') + } + const agent = opts?.agent ? opts.agent : new Agent(opts) + this[kAgent] = agent + + this[kClients] = agent[kClients] + this[kOptions] = buildMockOptions(opts) + } + + get (origin) { + let dispatcher = this[kMockAgentGet](origin) + + if (!dispatcher) { + dispatcher = this[kFactory](origin) + this[kMockAgentSet](origin, dispatcher) + } + return dispatcher + } + + dispatch (opts, handler) { + // Call MockAgent.get to perform additional setup before dispatching as normal + this.get(opts.origin) + return this[kAgent].dispatch(opts, handler) + } + + async close () { + await this[kAgent].close() + this[kClients].clear() + } + + deactivate () { + this[kIsMockActive] = false + } + + activate () { + this[kIsMockActive] = true + } + + enableNetConnect (matcher) { + if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) { + if (Array.isArray(this[kNetConnect])) { + this[kNetConnect].push(matcher) + } else { + this[kNetConnect] = [matcher] + } + } else if (typeof matcher === 'undefined') { + this[kNetConnect] = true + } else { + throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.') + } + } + + disableNetConnect () { + this[kNetConnect] = false + } + + // This is required to bypass issues caused by using global symbols - see: + // https://github.com/nodejs/undici/issues/1447 + get isMockActive () { + return this[kIsMockActive] + } + + [kMockAgentSet] (origin, dispatcher) { + this[kClients].set(origin, dispatcher) + } + + [kFactory] (origin) { + const mockOptions = Object.assign({ agent: this }, this[kOptions]) + return this[kOptions] && this[kOptions].connections === 1 + ? new MockClient(origin, mockOptions) + : new MockPool(origin, mockOptions) + } + + [kMockAgentGet] (origin) { + // First check if we can immediately find it + const client = this[kClients].get(origin) + if (client) { + return client + } + + // If the origin is not a string create a dummy parent pool and return to user + if (typeof origin !== 'string') { + const dispatcher = this[kFactory]('http://localhost:9999') + this[kMockAgentSet](origin, dispatcher) + return dispatcher + } + + // If we match, create a pool and assign the same dispatches + for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) { + if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) { + const dispatcher = this[kFactory](origin) + this[kMockAgentSet](origin, dispatcher) + dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches] + return dispatcher + } + } + } + + [kGetNetConnect] () { + return this[kNetConnect] + } + + pendingInterceptors () { + const mockAgentClients = this[kClients] + + return Array.from(mockAgentClients.entries()) + .flatMap(([origin, scope]) => scope[kDispatches].map(dispatch => ({ ...dispatch, origin }))) + .filter(({ pending }) => pending) + } + + assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { + const pending = this.pendingInterceptors() + + if (pending.length === 0) { + return + } + + const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length) + + throw new UndiciError(` +${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: + +${pendingInterceptorsFormatter.format(pending)} +`.trim()) + } +} + +module.exports = MockAgent diff --git a/.pnpm-store/v11/files/4c/45fbddeac71917f212168c20b4e3120a366fe70a4d7718088288b15a757e4c820105559668666b5a1509c1562db26b0f55538f8d53a9bdc0449eb368cff6e2 b/.pnpm-store/v11/files/4c/45fbddeac71917f212168c20b4e3120a366fe70a4d7718088288b15a757e4c820105559668666b5a1509c1562db26b0f55538f8d53a9bdc0449eb368cff6e2 new file mode 100644 index 0000000000..d31766e2e0 --- /dev/null +++ b/.pnpm-store/v11/files/4c/45fbddeac71917f212168c20b4e3120a366fe70a4d7718088288b15a757e4c820105559668666b5a1509c1562db26b0f55538f8d53a9bdc0449eb368cff6e2 @@ -0,0 +1,15 @@ +export class SymlinkError extends Error { + path; + symlink; + syscall = 'symlink'; + code = 'TAR_SYMLINK_ERROR'; + constructor(symlink, path) { + super('TAR_SYMLINK_ERROR: Cannot extract through symbolic link'); + this.symlink = symlink; + this.path = path; + } + get name() { + return 'SymlinkError'; + } +} +//# sourceMappingURL=symlink-error.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/4c/55d57a21cbd51aadc9b0a4d052e960fb34e39ccb78c46af983952c77ecd99a06540be67c79a4e71aeae9bc09da9a27737d846486e8c0156babe395a168941f b/.pnpm-store/v11/files/4c/55d57a21cbd51aadc9b0a4d052e960fb34e39ccb78c46af983952c77ecd99a06540be67c79a4e71aeae9bc09da9a27737d846486e8c0156babe395a168941f new file mode 100644 index 0000000000..dceaed923d --- /dev/null +++ b/.pnpm-store/v11/files/4c/55d57a21cbd51aadc9b0a4d052e960fb34e39ccb78c46af983952c77ecd99a06540be67c79a4e71aeae9bc09da9a27737d846486e8c0156babe395a168941f @@ -0,0 +1,80 @@ +{ + "name": "minizlib", + "version": "3.1.0", + "description": "A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.", + "main": "./dist/commonjs/index.js", + "dependencies": { + "minipass": "^7.1.2" + }, + "scripts": { + "prepare": "tshy", + "pretest": "npm run prepare", + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write . --loglevel warn", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/minizlib.git" + }, + "keywords": [ + "zlib", + "gzip", + "gunzip", + "deflate", + "inflate", + "compression", + "zip", + "unzip" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "MIT", + "devDependencies": { + "@types/node": "^24.5.2", + "tap": "^21.1.0", + "tshy": "^3.0.2", + "typedoc": "^0.28.1" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">= 18" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "types": "./dist/commonjs/index.d.ts", + "type": "module", + "prettier": { + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "module": "./dist/esm/index.js" +} diff --git a/.pnpm-store/v11/files/4c/6b593658302ce252d640b4c1a39ad8122b2e400556881cb1fc19a260a81705b6428182502075e4581ce1a2d56bd3bbcd4a88e2e53cea8e9b5612c20cacc969 b/.pnpm-store/v11/files/4c/6b593658302ce252d640b4c1a39ad8122b2e400556881cb1fc19a260a81705b6428182502075e4581ce1a2d56bd3bbcd4a88e2e53cea8e9b5612c20cacc969 new file mode 100644 index 0000000000..b1e0098ec4 --- /dev/null +++ b/.pnpm-store/v11/files/4c/6b593658302ce252d640b4c1a39ad8122b2e400556881cb1fc19a260a81705b6428182502075e4581ce1a2d56bd3bbcd4a88e2e53cea8e9b5612c20cacc969 @@ -0,0 +1,65 @@ +'use strict' +const EventEmitter = require('node:events') + +class Dispatcher extends EventEmitter { + dispatch () { + throw new Error('not implemented') + } + + close () { + throw new Error('not implemented') + } + + destroy () { + throw new Error('not implemented') + } + + compose (...args) { + // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ... + const interceptors = Array.isArray(args[0]) ? args[0] : args + let dispatch = this.dispatch.bind(this) + + for (const interceptor of interceptors) { + if (interceptor == null) { + continue + } + + if (typeof interceptor !== 'function') { + throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`) + } + + dispatch = interceptor(dispatch) + + if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) { + throw new TypeError('invalid interceptor') + } + } + + return new ComposedDispatcher(this, dispatch) + } +} + +class ComposedDispatcher extends Dispatcher { + #dispatcher = null + #dispatch = null + + constructor (dispatcher, dispatch) { + super() + this.#dispatcher = dispatcher + this.#dispatch = dispatch + } + + dispatch (...args) { + this.#dispatch(...args) + } + + close (...args) { + return this.#dispatcher.close(...args) + } + + destroy (...args) { + return this.#dispatcher.destroy(...args) + } +} + +module.exports = Dispatcher diff --git a/.pnpm-store/v11/files/4c/e45f48334b1d5f8ebdb42040ffaaa0b186f33b2d518d95ee22181ae93e04a15236ccd0d3152ff4bef1df37a664582679d6abf7dbca010ad179f0984600f939 b/.pnpm-store/v11/files/4c/e45f48334b1d5f8ebdb42040ffaaa0b186f33b2d518d95ee22181ae93e04a15236ccd0d3152ff4bef1df37a664582679d6abf7dbca010ad179f0984600f939 new file mode 100644 index 0000000000..1d1d2b6544 --- /dev/null +++ b/.pnpm-store/v11/files/4c/e45f48334b1d5f8ebdb42040ffaaa0b186f33b2d518d95ee22181ae93e04a15236ccd0d3152ff4bef1df37a664582679d6abf7dbca010ad179f0984600f939 @@ -0,0 +1,290 @@ +'use strict' + +/** + * @see https://encoding.spec.whatwg.org/#concept-encoding-get + * @param {string|undefined} label + */ +function getEncoding (label) { + if (!label) { + return 'failure' + } + + // 1. Remove any leading and trailing ASCII whitespace from label. + // 2. If label is an ASCII case-insensitive match for any of the + // labels listed in the table below, then return the + // corresponding encoding; otherwise return failure. + switch (label.trim().toLowerCase()) { + case 'unicode-1-1-utf-8': + case 'unicode11utf8': + case 'unicode20utf8': + case 'utf-8': + case 'utf8': + case 'x-unicode20utf8': + return 'UTF-8' + case '866': + case 'cp866': + case 'csibm866': + case 'ibm866': + return 'IBM866' + case 'csisolatin2': + case 'iso-8859-2': + case 'iso-ir-101': + case 'iso8859-2': + case 'iso88592': + case 'iso_8859-2': + case 'iso_8859-2:1987': + case 'l2': + case 'latin2': + return 'ISO-8859-2' + case 'csisolatin3': + case 'iso-8859-3': + case 'iso-ir-109': + case 'iso8859-3': + case 'iso88593': + case 'iso_8859-3': + case 'iso_8859-3:1988': + case 'l3': + case 'latin3': + return 'ISO-8859-3' + case 'csisolatin4': + case 'iso-8859-4': + case 'iso-ir-110': + case 'iso8859-4': + case 'iso88594': + case 'iso_8859-4': + case 'iso_8859-4:1988': + case 'l4': + case 'latin4': + return 'ISO-8859-4' + case 'csisolatincyrillic': + case 'cyrillic': + case 'iso-8859-5': + case 'iso-ir-144': + case 'iso8859-5': + case 'iso88595': + case 'iso_8859-5': + case 'iso_8859-5:1988': + return 'ISO-8859-5' + case 'arabic': + case 'asmo-708': + case 'csiso88596e': + case 'csiso88596i': + case 'csisolatinarabic': + case 'ecma-114': + case 'iso-8859-6': + case 'iso-8859-6-e': + case 'iso-8859-6-i': + case 'iso-ir-127': + case 'iso8859-6': + case 'iso88596': + case 'iso_8859-6': + case 'iso_8859-6:1987': + return 'ISO-8859-6' + case 'csisolatingreek': + case 'ecma-118': + case 'elot_928': + case 'greek': + case 'greek8': + case 'iso-8859-7': + case 'iso-ir-126': + case 'iso8859-7': + case 'iso88597': + case 'iso_8859-7': + case 'iso_8859-7:1987': + case 'sun_eu_greek': + return 'ISO-8859-7' + case 'csiso88598e': + case 'csisolatinhebrew': + case 'hebrew': + case 'iso-8859-8': + case 'iso-8859-8-e': + case 'iso-ir-138': + case 'iso8859-8': + case 'iso88598': + case 'iso_8859-8': + case 'iso_8859-8:1988': + case 'visual': + return 'ISO-8859-8' + case 'csiso88598i': + case 'iso-8859-8-i': + case 'logical': + return 'ISO-8859-8-I' + case 'csisolatin6': + case 'iso-8859-10': + case 'iso-ir-157': + case 'iso8859-10': + case 'iso885910': + case 'l6': + case 'latin6': + return 'ISO-8859-10' + case 'iso-8859-13': + case 'iso8859-13': + case 'iso885913': + return 'ISO-8859-13' + case 'iso-8859-14': + case 'iso8859-14': + case 'iso885914': + return 'ISO-8859-14' + case 'csisolatin9': + case 'iso-8859-15': + case 'iso8859-15': + case 'iso885915': + case 'iso_8859-15': + case 'l9': + return 'ISO-8859-15' + case 'iso-8859-16': + return 'ISO-8859-16' + case 'cskoi8r': + case 'koi': + case 'koi8': + case 'koi8-r': + case 'koi8_r': + return 'KOI8-R' + case 'koi8-ru': + case 'koi8-u': + return 'KOI8-U' + case 'csmacintosh': + case 'mac': + case 'macintosh': + case 'x-mac-roman': + return 'macintosh' + case 'iso-8859-11': + case 'iso8859-11': + case 'iso885911': + case 'tis-620': + case 'windows-874': + return 'windows-874' + case 'cp1250': + case 'windows-1250': + case 'x-cp1250': + return 'windows-1250' + case 'cp1251': + case 'windows-1251': + case 'x-cp1251': + return 'windows-1251' + case 'ansi_x3.4-1968': + case 'ascii': + case 'cp1252': + case 'cp819': + case 'csisolatin1': + case 'ibm819': + case 'iso-8859-1': + case 'iso-ir-100': + case 'iso8859-1': + case 'iso88591': + case 'iso_8859-1': + case 'iso_8859-1:1987': + case 'l1': + case 'latin1': + case 'us-ascii': + case 'windows-1252': + case 'x-cp1252': + return 'windows-1252' + case 'cp1253': + case 'windows-1253': + case 'x-cp1253': + return 'windows-1253' + case 'cp1254': + case 'csisolatin5': + case 'iso-8859-9': + case 'iso-ir-148': + case 'iso8859-9': + case 'iso88599': + case 'iso_8859-9': + case 'iso_8859-9:1989': + case 'l5': + case 'latin5': + case 'windows-1254': + case 'x-cp1254': + return 'windows-1254' + case 'cp1255': + case 'windows-1255': + case 'x-cp1255': + return 'windows-1255' + case 'cp1256': + case 'windows-1256': + case 'x-cp1256': + return 'windows-1256' + case 'cp1257': + case 'windows-1257': + case 'x-cp1257': + return 'windows-1257' + case 'cp1258': + case 'windows-1258': + case 'x-cp1258': + return 'windows-1258' + case 'x-mac-cyrillic': + case 'x-mac-ukrainian': + return 'x-mac-cyrillic' + case 'chinese': + case 'csgb2312': + case 'csiso58gb231280': + case 'gb2312': + case 'gb_2312': + case 'gb_2312-80': + case 'gbk': + case 'iso-ir-58': + case 'x-gbk': + return 'GBK' + case 'gb18030': + return 'gb18030' + case 'big5': + case 'big5-hkscs': + case 'cn-big5': + case 'csbig5': + case 'x-x-big5': + return 'Big5' + case 'cseucpkdfmtjapanese': + case 'euc-jp': + case 'x-euc-jp': + return 'EUC-JP' + case 'csiso2022jp': + case 'iso-2022-jp': + return 'ISO-2022-JP' + case 'csshiftjis': + case 'ms932': + case 'ms_kanji': + case 'shift-jis': + case 'shift_jis': + case 'sjis': + case 'windows-31j': + case 'x-sjis': + return 'Shift_JIS' + case 'cseuckr': + case 'csksc56011987': + case 'euc-kr': + case 'iso-ir-149': + case 'korean': + case 'ks_c_5601-1987': + case 'ks_c_5601-1989': + case 'ksc5601': + case 'ksc_5601': + case 'windows-949': + return 'EUC-KR' + case 'csiso2022kr': + case 'hz-gb-2312': + case 'iso-2022-cn': + case 'iso-2022-cn-ext': + case 'iso-2022-kr': + case 'replacement': + return 'replacement' + case 'unicodefffe': + case 'utf-16be': + return 'UTF-16BE' + case 'csunicode': + case 'iso-10646-ucs-2': + case 'ucs-2': + case 'unicode': + case 'unicodefeff': + case 'utf-16': + case 'utf-16le': + return 'UTF-16LE' + case 'x-user-defined': + return 'x-user-defined' + default: return 'failure' + } +} + +module.exports = { + getEncoding +} diff --git a/.pnpm-store/v11/files/4d/22d320665c57022e6e3862b9b3f92314226045faf685b43491ac153c8057f60b97797f2131e9df7f3eeb33b9390b0717fbfeb0b8df55a982bb2d5f886eab2d b/.pnpm-store/v11/files/4d/22d320665c57022e6e3862b9b3f92314226045faf685b43491ac153c8057f60b97797f2131e9df7f3eeb33b9390b0717fbfeb0b8df55a982bb2d5f886eab2d new file mode 100644 index 0000000000..fc9cacb198 --- /dev/null +++ b/.pnpm-store/v11/files/4d/22d320665c57022e6e3862b9b3f92314226045faf685b43491ac153c8057f60b97797f2131e9df7f3eeb33b9390b0717fbfeb0b8df55a982bb2d5f886eab2d @@ -0,0 +1,123 @@ +'use strict' + +const util = require('../core/util') +const { InvalidArgumentError, RequestAbortedError } = require('../core/errors') +const DecoratorHandler = require('../handler/decorator-handler') + +class DumpHandler extends DecoratorHandler { + #maxSize = 1024 * 1024 + #abort = null + #dumped = false + #aborted = false + #size = 0 + #reason = null + #handler = null + + constructor ({ maxSize }, handler) { + super(handler) + + if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) { + throw new InvalidArgumentError('maxSize must be a number greater than 0') + } + + this.#maxSize = maxSize ?? this.#maxSize + this.#handler = handler + } + + onConnect (abort) { + this.#abort = abort + + this.#handler.onConnect(this.#customAbort.bind(this)) + } + + #customAbort (reason) { + this.#aborted = true + this.#reason = reason + } + + // TODO: will require adjustment after new hooks are out + onHeaders (statusCode, rawHeaders, resume, statusMessage) { + const headers = util.parseHeaders(rawHeaders) + const contentLength = headers['content-length'] + + if (contentLength != null && contentLength > this.#maxSize) { + throw new RequestAbortedError( + `Response size (${contentLength}) larger than maxSize (${ + this.#maxSize + })` + ) + } + + if (this.#aborted) { + return true + } + + return this.#handler.onHeaders( + statusCode, + rawHeaders, + resume, + statusMessage + ) + } + + onError (err) { + if (this.#dumped) { + return + } + + err = this.#reason ?? err + + this.#handler.onError(err) + } + + onData (chunk) { + this.#size = this.#size + chunk.length + + if (this.#size >= this.#maxSize) { + this.#dumped = true + + if (this.#aborted) { + this.#handler.onError(this.#reason) + } else { + this.#handler.onComplete([]) + } + } + + return true + } + + onComplete (trailers) { + if (this.#dumped) { + return + } + + if (this.#aborted) { + this.#handler.onError(this.reason) + return + } + + this.#handler.onComplete(trailers) + } +} + +function createDumpInterceptor ( + { maxSize: defaultMaxSize } = { + maxSize: 1024 * 1024 + } +) { + return dispatch => { + return function Intercept (opts, handler) { + const { dumpMaxSize = defaultMaxSize } = + opts + + const dumpHandler = new DumpHandler( + { maxSize: dumpMaxSize }, + handler + ) + + return dispatch(opts, dumpHandler) + } + } +} + +module.exports = createDumpInterceptor diff --git a/.pnpm-store/v11/files/4d/5e5a5b9270d9bd9e0131b89060248833f7d504177dac8fb32041724e623ee5e18cfbf6833d1882954df75fcbe8d3d017a5b57a3da2bada803fa22bbd98724b b/.pnpm-store/v11/files/4d/5e5a5b9270d9bd9e0131b89060248833f7d504177dac8fb32041724e623ee5e18cfbf6833d1882954df75fcbe8d3d017a5b57a3da2bada803fa22bbd98724b new file mode 100644 index 0000000000..7cf5faf711 --- /dev/null +++ b/.pnpm-store/v11/files/4d/5e5a5b9270d9bd9e0131b89060248833f7d504177dac8fb32041724e623ee5e18cfbf6833d1882954df75fcbe8d3d017a5b57a3da2bada803fa22bbd98724b @@ -0,0 +1,3 @@ +{ + ".": "12.4.0" +} diff --git a/.pnpm-store/v11/files/4e/8c270984223b03234ba6d94da70b6c210b6ae233baf86f5412f47ed9d71b3cec7b3541b0ec19f94de42a9df16a4dda410ef93a386a332bce01f2820b097d17 b/.pnpm-store/v11/files/4e/8c270984223b03234ba6d94da70b6c210b6ae233baf86f5412f47ed9d71b3cec7b3541b0ec19f94de42a9df16a4dda410ef93a386a332bce01f2820b097d17 new file mode 100644 index 0000000000..479c374f10 --- /dev/null +++ b/.pnpm-store/v11/files/4e/8c270984223b03234ba6d94da70b6c210b6ae233baf86f5412f47ed9d71b3cec7b3541b0ec19f94de42a9df16a4dda410ef93a386a332bce01f2820b097d17 @@ -0,0 +1,15 @@ +'use strict' + +const fs = require('graceful-fs').promises +const log = require('./log') + +async function clean (gyp, argv) { + // Remove the 'build' dir + const buildDir = 'build' + + log.verbose('clean', 'removing "%s" directory', buildDir) + await fs.rm(buildDir, { recursive: true, force: true, maxRetries: 3 }) +} + +module.exports = clean +module.exports.usage = 'Removes any generated build files and the "out" dir' diff --git a/.pnpm-store/v11/files/4f/235317994b1ea8bffd021a3320badecd2f5da158a6423d5e5115a2768a82f9292dff7837c30db226237514d68c028dbae8986389cc798fa33848350ade34f9 b/.pnpm-store/v11/files/4f/235317994b1ea8bffd021a3320badecd2f5da158a6423d5e5115a2768a82f9292dff7837c30db226237514d68c028dbae8986389cc798fa33848350ade34f9 new file mode 100644 index 0000000000..7f579406da --- /dev/null +++ b/.pnpm-store/v11/files/4f/235317994b1ea8bffd021a3320badecd2f5da158a6423d5e5115a2768a82f9292dff7837c30db226237514d68c028dbae8986389cc798fa33848350ade34f9 @@ -0,0 +1,52 @@ +{ + "name": "node-gyp", + "description": "Node.js native addon build tool", + "license": "MIT", + "keywords": [ + "native", + "addon", + "module", + "c", + "c++", + "bindings", + "gyp" + ], + "version": "12.4.0", + "installVersion": 11, + "author": "Nathan Rajlich (http://tootallnate.net)", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/node-gyp.git" + }, + "preferGlobal": true, + "bin": "./bin/node-gyp.js", + "main": "./lib/node-gyp.js", + "dependencies": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "graceful-fs": "^4.2.6", + "nopt": "^9.0.0", + "proc-log": "^6.0.0", + "semver": "^7.3.5", + "tar": "^7.5.4", + "tinyglobby": "^0.2.12", + "undici": "^6.25.0", + "which": "^6.0.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + }, + "devDependencies": { + "bindings": "^1.5.0", + "cross-env": "^10.1.0", + "eslint": "^9.39.1", + "mocha": "^11.7.5", + "nan": "^2.23.1", + "neostandard": "^0.13.0", + "require-inject": "^1.4.4" + }, + "scripts": { + "lint": "eslint \"*/*.js\" \"test/**/*.js\" \".github/**/*.js\"", + "test": "cross-env NODE_GYP_NULL_LOGGER=true mocha --timeout 30000 test/test-download.js test/test-*" + } +} diff --git a/.pnpm-store/v11/files/4f/44dde10fdd0c3dd28c8b3d50c853b2c91ec29799bc9917c2a9cc88eb7aa5721cfc3311a244af5e33e8b46f2a908ce7a8349fd9cea0c66496182c9534799e0c b/.pnpm-store/v11/files/4f/44dde10fdd0c3dd28c8b3d50c853b2c91ec29799bc9917c2a9cc88eb7aa5721cfc3311a244af5e33e8b46f2a908ce7a8349fd9cea0c66496182c9534799e0c new file mode 100644 index 0000000000..16b6f4e80b --- /dev/null +++ b/.pnpm-store/v11/files/4f/44dde10fdd0c3dd28c8b3d50c853b2c91ec29799bc9917c2a9cc88eb7aa5721cfc3311a244af5e33e8b46f2a908ce7a8349fd9cea0c66496182c9534799e0c @@ -0,0 +1,2755 @@ +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Notes: +# +# This is all roughly based on the Makefile system used by the Linux +# kernel, but is a non-recursive make -- we put the entire dependency +# graph in front of make and let it figure it out. +# +# The code below generates a separate .mk file for each target, but +# all are sourced by the top-level Makefile. This means that all +# variables in .mk-files clobber one another. Be careful to use := +# where appropriate for immediate evaluation, and similarly to watch +# that you're not relying on a variable value to last between different +# .mk files. +# +# TODOs: +# +# Global settings and utility functions are currently stuffed in the +# toplevel Makefile. It may make sense to generate some .mk files on +# the side to keep the files readable. + + +import hashlib +import os +import re +import subprocess +import sys + +import gyp +import gyp.common +import gyp.xcode_emulation +from gyp.common import GetEnvironFallback + +generator_default_variables = { + "EXECUTABLE_PREFIX": "", + "EXECUTABLE_SUFFIX": "", + "STATIC_LIB_PREFIX": "lib", + "SHARED_LIB_PREFIX": "lib", + "STATIC_LIB_SUFFIX": ".a", + "INTERMEDIATE_DIR": "$(obj).$(TOOLSET)/$(TARGET)/geni", + "SHARED_INTERMEDIATE_DIR": "$(obj)/gen", + "PRODUCT_DIR": "$(builddir)", + "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", # This gets expanded by Python. + "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", # This gets expanded by Python. + "RULE_INPUT_PATH": "$(abspath $<)", + "RULE_INPUT_EXT": "$(suffix $<)", + "RULE_INPUT_NAME": "$(notdir $<)", + "CONFIGURATION_NAME": "$(BUILDTYPE)", +} + +# Make supports multiple toolsets +generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() + +# Request sorted dependencies in the order from dependents to dependencies. +generator_wants_sorted_dependencies = False + +# Placates pylint. +generator_additional_non_configuration_keys = [] +generator_additional_path_sections = [] +generator_extra_sources_for_rules = [] +generator_filelist_paths = None + + +def CalculateVariables(default_variables, params): + """Calculate additional variables for use in the build (called by gyp).""" + flavor = gyp.common.GetFlavor(params) + if flavor == "mac": + default_variables.setdefault("OS", "mac") + default_variables.setdefault("SHARED_LIB_SUFFIX", ".dylib") + default_variables.setdefault( + "SHARED_LIB_DIR", generator_default_variables["PRODUCT_DIR"] + ) + default_variables.setdefault( + "LIB_DIR", generator_default_variables["PRODUCT_DIR"] + ) + + # Copy additional generator configuration data from Xcode, which is shared + # by the Mac Make generator. + import gyp.generator.xcode as xcode_generator # noqa: PLC0415 + + global generator_additional_non_configuration_keys + generator_additional_non_configuration_keys = getattr( + xcode_generator, "generator_additional_non_configuration_keys", [] + ) + global generator_additional_path_sections + generator_additional_path_sections = getattr( + xcode_generator, "generator_additional_path_sections", [] + ) + global generator_extra_sources_for_rules + generator_extra_sources_for_rules = getattr( + xcode_generator, "generator_extra_sources_for_rules", [] + ) + COMPILABLE_EXTENSIONS.update({".m": "objc", ".mm": "objcxx"}) + else: + operating_system = flavor + if flavor == "android": + operating_system = "linux" # Keep this legacy behavior for now. + default_variables.setdefault("OS", operating_system) + if flavor == "aix": + default_variables.setdefault("SHARED_LIB_SUFFIX", ".a") + elif flavor == "zos": + default_variables.setdefault("SHARED_LIB_SUFFIX", ".x") + COMPILABLE_EXTENSIONS.update({".pli": "pli"}) + else: + default_variables.setdefault("SHARED_LIB_SUFFIX", ".so") + default_variables.setdefault("SHARED_LIB_DIR", "$(builddir)/lib.$(TOOLSET)") + default_variables.setdefault("LIB_DIR", "$(obj).$(TOOLSET)") + + +def CalculateGeneratorInputInfo(params): + """Calculate the generator specific info that gets fed to input (called by + gyp).""" + generator_flags = params.get("generator_flags", {}) + android_ndk_version = generator_flags.get("android_ndk_version", None) + # Android NDK requires a strict link order. + if android_ndk_version: + global generator_wants_sorted_dependencies + generator_wants_sorted_dependencies = True + + output_dir = params["options"].generator_output or params["options"].toplevel_dir + builddir_name = generator_flags.get("output_dir", "out") + qualified_out_dir = os.path.normpath( + os.path.join(output_dir, builddir_name, "gypfiles") + ) + + global generator_filelist_paths + generator_filelist_paths = { + "toplevel": params["options"].toplevel_dir, + "qualified_out_dir": qualified_out_dir, + } + + +# The .d checking code below uses these functions: +# wildcard, sort, foreach, shell, wordlist +# wildcard can handle spaces, the rest can't. +# Since I could find no way to make foreach work with spaces in filenames +# correctly, the .d files have spaces replaced with another character. The .d +# file for +# Chromium\ Framework.framework/foo +# is for example +# out/Release/.deps/out/Release/Chromium?Framework.framework/foo +# This is the replacement character. +SPACE_REPLACEMENT = "?" + + +LINK_COMMANDS_LINUX = """\ +quiet_cmd_alink = AR($(TOOLSET)) $@ +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) + +quiet_cmd_alink_thin = AR($(TOOLSET)) $@ +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) + +# Due to circular dependencies between libraries :(, we wrap the +# special "figure out circular dependencies" flags around the entire +# input list during linking. +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group + +# Note: this does not handle spaces in paths +define xargs + $(1) $(word 1,$(2)) +$(if $(word 2,$(2)),$(call xargs,$(1),$(wordlist 2,$(words $(2)),$(2)))) +endef + +define write-to-file + @: >$(1) +$(call xargs,@printf "%s\\n" >>$(1),$(2)) +endef + +OBJ_FILE_LIST := ar-file-list + +define create_archive + rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)` + $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) + $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST) +endef + +define create_thin_archive + rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` + $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) + $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) +endef + +# We support two kinds of shared objects (.so): +# 1) shared_library, which is just bundling together many dependent libraries +# into a link line. +# 2) loadable_module, which is generating a module intended for dlopen(). +# +# They differ only slightly: +# In the former case, we want to package all dependent code into the .so. +# In the latter case, we want to package just the API exposed by the +# outermost module. +# This means shared_library uses --whole-archive, while loadable_module doesn't. +# (Note that --whole-archive is incompatible with the --start-group used in +# normal linking.) + +# Other shared-object link notes: +# - Set SONAME to the library filename so our binaries don't reference +# the local, absolute paths used on the link command-line. +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) +""" # noqa: E501 + +LINK_COMMANDS_MAC = """\ +quiet_cmd_alink = LIBTOOL-STATIC $@ +cmd_alink = rm -f $@ && %(python)s gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %%.o,$^) + +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) +""" % {"python": sys.executable} # noqa: E501 + +LINK_COMMANDS_ANDROID = """\ +quiet_cmd_alink = AR($(TOOLSET)) $@ +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) + +quiet_cmd_alink_thin = AR($(TOOLSET)) $@ +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) + +# Note: this does not handle spaces in paths +define xargs + $(1) $(word 1,$(2)) +$(if $(word 2,$(2)),$(call xargs,$(1),$(wordlist 2,$(words $(2)),$(2)))) +endef + +define write-to-file + @: >$(1) +$(call xargs,@printf "%s\\n" >>$(1),$(2)) +endef + +OBJ_FILE_LIST := ar-file-list + +define create_archive + rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)` + $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) + $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST) +endef + +define create_thin_archive + rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)` + $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2))) + $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST) +endef + +# Due to circular dependencies between libraries :(, we wrap the +# special "figure out circular dependencies" flags around the entire +# input list during linking. +quiet_cmd_link = LINK($(TOOLSET)) $@ +quiet_cmd_link_host = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) +cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) + +# Other shared-object link notes: +# - Set SONAME to the library filename so our binaries don't reference +# the local, absolute paths used on the link command-line. +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) +quiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) +""" # noqa: E501 + + +LINK_COMMANDS_AIX = """\ +quiet_cmd_alink = AR($(TOOLSET)) $@ +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) + +quiet_cmd_alink_thin = AR($(TOOLSET)) $@ +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) + +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) +""" # noqa: E501 + + +LINK_COMMANDS_OS400 = """\ +quiet_cmd_alink = AR($(TOOLSET)) $@ +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X64 crs $@ $(filter %.o,$^) + +quiet_cmd_alink_thin = AR($(TOOLSET)) $@ +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X64 crs $@ $(filter %.o,$^) + +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) +""" # noqa: E501 + + +LINK_COMMANDS_OS390 = """\ +quiet_cmd_alink = AR($(TOOLSET)) $@ +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) + +quiet_cmd_alink_thin = AR($(TOOLSET)) $@ +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) + +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) +""" # noqa: E501 + + +# Header of toplevel Makefile. +# This should go into the build tree, but it's easier to keep it here for now. +SHARED_HEADER = ( + """\ +# We borrow heavily from the kernel build setup, though we are simpler since +# we don't have Kconfig tweaking settings on us. + +# The implicit make rules have it looking for RCS files, among other things. +# We instead explicitly write all the rules we care about. +# It's even quicker (saves ~200ms) to pass -r on the command line. +MAKEFLAGS=-r + +# The source directory tree. +srcdir := %(srcdir)s +abs_srcdir := $(abspath $(srcdir)) + +# The name of the builddir. +builddir_name ?= %(builddir)s + +# The V=1 flag on command line makes us verbosely print command lines. +ifdef V + quiet= +else + quiet=quiet_ +endif + +# Specify BUILDTYPE=Release on the command line for a release build. +BUILDTYPE ?= %(default_configuration)s + +# Directory all our build output goes into. +# Note that this must be two directories beneath src/ for unit tests to pass, +# as they reach into the src/ directory for data with relative paths. +builddir ?= $(builddir_name)/$(BUILDTYPE) +abs_builddir := $(abspath $(builddir)) +depsdir := $(builddir)/.deps + +# Object output directory. +obj := $(builddir)/obj +abs_obj := $(abspath $(obj)) + +# We build up a list of every single one of the targets so we can slurp in the +# generated dependency rule Makefiles in one pass. +all_deps := + +%(make_global_settings)s + +CC.target ?= %(CC.target)s +CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS) +CXX.target ?= %(CXX.target)s +CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS) +LINK.target ?= %(LINK.target)s +LDFLAGS.target ?= $(LDFLAGS) +AR.target ?= %(AR.target)s +PLI.target ?= %(PLI.target)s + +# C++ apps need to be linked with g++. +LINK ?= $(CXX.target) + +# TODO(evan): move all cross-compilation logic to gyp-time so we don't need +# to replicate this environment fallback in make as well. +CC.host ?= %(CC.host)s +CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host) +CXX.host ?= %(CXX.host)s +CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host) +LINK.host ?= %(LINK.host)s +LDFLAGS.host ?= $(LDFLAGS_host) +AR.host ?= %(AR.host)s +PLI.host ?= %(PLI.host)s + +# Define a dir function that can handle spaces. +# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions +# "leading spaces cannot appear in the text of the first argument as written. +# These characters can be put into the argument value by variable substitution." +empty := +space := $(empty) $(empty) + +# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces +replace_spaces = $(subst $(space),""" + + SPACE_REPLACEMENT + + """,$1) +unreplace_spaces = $(subst """ + + SPACE_REPLACEMENT + + """,$(space),$1) +dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1))) + +# Flags to make gcc output dependency info. Note that you need to be +# careful here to use the flags that ccache and distcc can understand. +# We write to a dep file on the side first and then rename at the end +# so we can't end up with a broken dep file. +depfile = $(depsdir)/$(call replace_spaces,$@).d +DEPFLAGS = %(makedep_args)s -MF $(depfile).raw + +# We have to fixup the deps output in a few ways. +# (1) the file output should mention the proper .o file. +# ccache or distcc lose the path to the target, so we convert a rule of +# the form: +# foobar.o: DEP1 DEP2 +# into +# path/to/foobar.o: DEP1 DEP2 +# (2) we want missing files not to cause us to fail to build. +# We want to rewrite +# foobar.o: DEP1 DEP2 \\ +# DEP3 +# to +# DEP1: +# DEP2: +# DEP3: +# so if the files are missing, they're just considered phony rules. +# We have to do some pretty insane escaping to get those backslashes +# and dollar signs past make, the shell, and sed at the same time. +# Doesn't work with spaces, but that's fine: .d files have spaces in +# their names replaced with other characters.""" + r""" +define fixup_dep +# The depfile may not exist if the input file didn't have any #includes. +touch $(depfile).raw +# Fixup path as in (1).""" + + ( + r""" +sed -e "s|^$(notdir $@)|$@|" -re 's/\\\\([^$$])/\/\1/g' $(depfile).raw >> $(depfile)""" + if sys.platform == "win32" + else r""" +sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)""" + ) + + r""" +# Add extra rules as in (2). +# We remove slashes and replace spaces with new lines; +# remove blank lines; +# delete the first line and append a colon to the remaining lines.""" + + ( + """ +sed -e 's/\\\\\\\\$$//' -e 's/\\\\\\\\/\\//g' -e 'y| |\\n|' $(depfile).raw |\\""" + if sys.platform == "win32" + else """ +sed -e 's|\\\\||' -e 'y| |\\n|' $(depfile).raw |\\""" + ) + + r""" + grep -v '^$$' |\ + sed -e 1d -e 's|$$|:|' \ + >> $(depfile) +rm $(depfile).raw +endef +""" + """ +# Command definitions: +# - cmd_foo is the actual command to run; +# - quiet_cmd_foo is the brief-output summary of the command. + +quiet_cmd_cc = CC($(TOOLSET)) $@ +cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c + +quiet_cmd_cxx = CXX($(TOOLSET)) $@ +cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c +%(extra_commands)s +quiet_cmd_touch = TOUCH $@ +cmd_touch = touch $@ + +quiet_cmd_copy = COPY $@ +# send stderr to /dev/null to ignore messages when linking directories. +cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@") + +quiet_cmd_symlink = SYMLINK $@ +cmd_symlink = ln -sf "$<" "$@" + +%(link_commands)s +""" # noqa: E501 + r""" +# Define an escape_quotes function to escape single quotes. +# This allows us to handle quotes properly as long as we always use +# use single quotes and escape_quotes. +escape_quotes = $(subst ','\'',$(1)) +# This comment is here just to include a ' to unconfuse syntax highlighting. +# Define an escape_vars function to escape '$' variable syntax. +# This allows us to read/write command lines with shell variables (e.g. +# $LD_LIBRARY_PATH), without triggering make substitution. +escape_vars = $(subst $$,$$$$,$(1)) +# Helper that expands to a shell command to echo a string exactly as it is in +# make. This uses printf instead of echo because printf's behaviour with respect +# to escape sequences is more portable than echo's across different shells +# (e.g., dash, bash). +exact_echo = printf '%%s\n' '$(call escape_quotes,$(1))' +""" + """ +# Helper to compare the command we're about to run against the command +# we logged the last time we ran the command. Produces an empty +# string (false) when the commands match. +# Tricky point: Make has no string-equality test function. +# The kernel uses the following, but it seems like it would have false +# positives, where one string reordered its arguments. +# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \\ +# $(filter-out $(cmd_$@), $(cmd_$(1)))) +# We instead substitute each for the empty string into the other, and +# say they're equal if both substitutions produce the empty string. +# .d files contain """ + + SPACE_REPLACEMENT + + """ instead of spaces, take that into account. +command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\\ + $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) + +# Helper that is non-empty when a prerequisite changes. +# Normally make does this implicitly, but we force rules to always run +# so we can check their command lines. +# $? -- new prerequisites +# $| -- order-only dependencies +prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) + +# Helper that executes all postbuilds until one fails. +define do_postbuilds + @E=0;\\ + for p in $(POSTBUILDS); do\\ + eval $$p;\\ + E=$$?;\\ + if [ $$E -ne 0 ]; then\\ + break;\\ + fi;\\ + done;\\ + if [ $$E -ne 0 ]; then\\ + rm -rf "$@";\\ + exit $$E;\\ + fi +endef + +# do_cmd: run a command via the above cmd_foo names, if necessary. +# Should always run for a given target to handle command-line changes. +# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. +# Third argument, if non-zero, makes it do POSTBUILDS processing. +# Note: We intentionally do NOT call dirx for depfile, since it contains """ + + SPACE_REPLACEMENT + + """ for +# spaces already and dirx strips the """ + + SPACE_REPLACEMENT + + """ characters. +define do_cmd +$(if $(or $(command_changed),$(prereq_changed)), + @$(call exact_echo, $($(quiet)cmd_$(1))) + @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" + $(if $(findstring flock,$(word %(flock_index)d,$(cmd_$1))), + @$(cmd_$(1)) + @echo " $(quiet_cmd_$(1)): Finished", + @$(cmd_$(1)) + ) + @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) + @$(if $(2),$(fixup_dep)) + $(if $(and $(3), $(POSTBUILDS)), + $(call do_postbuilds) + ) +) +endef + +# Declare the "%(default_target)s" target first so it is the default, +# even though we don't have the deps yet. +.PHONY: %(default_target)s +%(default_target)s: + +# make looks for ways to re-generate included makefiles, but in our case, we +# don't have a direct way. Explicitly telling make that it has nothing to do +# for them makes it go faster. +%%.d: ; + +# Use FORCE_DO_CMD to force a target to run. Should be coupled with +# do_cmd. +.PHONY: FORCE_DO_CMD +FORCE_DO_CMD: + +""" # noqa: E501 +) + +SHARED_HEADER_MAC_COMMANDS = """ +quiet_cmd_objc = CXX($(TOOLSET)) $@ +cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< + +quiet_cmd_objcxx = CXX($(TOOLSET)) $@ +cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< + +# Commands for precompiled header files. +quiet_cmd_pch_c = CXX($(TOOLSET)) $@ +cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< +quiet_cmd_pch_cc = CXX($(TOOLSET)) $@ +cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< +quiet_cmd_pch_m = CXX($(TOOLSET)) $@ +cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< +quiet_cmd_pch_mm = CXX($(TOOLSET)) $@ +cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< + +# gyp-mac-tool is written next to the root Makefile by gyp. +# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd +# already. +quiet_cmd_mac_tool = MACTOOL $(4) $< +cmd_mac_tool = %(python)s gyp-mac-tool $(4) $< "$@" + +quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@ +cmd_mac_package_framework = %(python)s gyp-mac-tool package-framework "$@" $(4) + +quiet_cmd_infoplist = INFOPLIST $@ +cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@" +""" % {"python": sys.executable} # noqa: E501 + + +def WriteRootHeaderSuffixRules(writer): + extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower) + + writer.write("# Suffix rules, putting all outputs into $(obj).\n") + for ext in extensions: + writer.write("$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD\n" % ext) + writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) + + writer.write("\n# Try building from generated source, too.\n") + for ext in extensions: + writer.write( + "$(obj).$(TOOLSET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD\n" % ext + ) + writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) + writer.write("\n") + for ext in extensions: + writer.write("$(obj).$(TOOLSET)/%%.o: $(obj)/%%%s FORCE_DO_CMD\n" % ext) + writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) + writer.write("\n") + + +SHARED_HEADER_OS390_COMMANDS = """ +PLIFLAGS.target ?= -qlp=64 -qlimits=extname=31 $(PLIFLAGS) +PLIFLAGS.host ?= -qlp=64 -qlimits=extname=31 $(PLIFLAGS) + +quiet_cmd_pli = PLI($(TOOLSET)) $@ +cmd_pli = $(PLI.$(TOOLSET)) $(GYP_PLIFLAGS) $(PLIFLAGS.$(TOOLSET)) -c $< && \ + if [ -f $(notdir $@) ]; then /bin/cp $(notdir $@) $@; else true; fi +""" + +SHARED_HEADER_SUFFIX_RULES_COMMENT1 = """\ +# Suffix rules, putting all outputs into $(obj). +""" + + +SHARED_HEADER_SUFFIX_RULES_COMMENT2 = """\ +# Try building from generated source, too. +""" + + +SHARED_FOOTER = """\ +# "all" is a concatenation of the "all" targets from all the included +# sub-makefiles. This is just here to clarify. +all: + +# Add in dependency-tracking rules. $(all_deps) is the list of every single +# target in our tree. Only consider the ones with .d (dependency) info: +d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) +ifneq ($(d_files),) + include $(d_files) +endif +""" + +header = """\ +# This file is generated by gyp; do not edit. + +""" + +# Maps every compilable file extension to the do_cmd that compiles it. +COMPILABLE_EXTENSIONS = { + ".c": "cc", + ".cc": "cxx", + ".cpp": "cxx", + ".cxx": "cxx", + ".s": "cc", + ".S": "cc", +} + + +def Compilable(filename): + """Return true if the file is compilable (should be in OBJS).""" + return any(res for res in (filename.endswith(e) for e in COMPILABLE_EXTENSIONS)) + + +def Linkable(filename): + """Return true if the file is linkable (should be on the link line).""" + return filename.endswith(".o") + + +def Target(filename): + """Translate a compilable filename to its .o target.""" + return os.path.splitext(filename)[0] + ".o" + + +def EscapeShellArgument(s): + """Quotes an argument so that it will be interpreted literally by a POSIX + shell. Taken from + http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python + """ + return "'" + s.replace("'", "'\\''") + "'" + + +def EscapeMakeVariableExpansion(s): + """Make has its own variable expansion syntax using $. We must escape it for + string to be interpreted literally.""" + return s.replace("$", "$$") + + +def EscapeCppDefine(s): + """Escapes a CPP define so that it will reach the compiler unaltered.""" + s = EscapeShellArgument(s) + s = EscapeMakeVariableExpansion(s) + # '#' characters must be escaped even embedded in a string, else Make will + # treat it as the start of a comment. + return s.replace("#", r"\#") + + +def QuoteIfNecessary(string): + """TODO: Should this ideally be replaced with one or more of the above + functions?""" + if '"' in string: + string = '"' + string.replace('"', '\\"') + '"' + return string + + +def replace_sep(string): + if sys.platform == "win32": + string = string.replace("\\\\", "/").replace("\\", "/") + return string + + +def StringToMakefileVariable(string): + """Convert a string to a value that is acceptable as a make variable name.""" + return re.sub("[^a-zA-Z0-9_]", "_", string) + + +srcdir_prefix = "" + + +def Sourceify(path): + """Convert a path to its source directory form.""" + if "$(" in path: + return path + if os.path.isabs(path): + return path + return srcdir_prefix + path + + +def QuoteSpaces(s, quote=r"\ "): + return s.replace(" ", quote) + + +def SourceifyAndQuoteSpaces(path): + """Convert a path to its source directory form and quote spaces.""" + return QuoteSpaces(Sourceify(path)) + + +# Map from qualified target to path to output. +target_outputs = {} +# Map from qualified target to any linkable output. A subset +# of target_outputs. E.g. when mybinary depends on liba, we want to +# include liba in the linker line; when otherbinary depends on +# mybinary, we just want to build mybinary first. +target_link_deps = {} + + +class MakefileWriter: + """MakefileWriter packages up the writing of one target-specific foobar.mk. + + Its only real entry point is Write(), and is mostly used for namespacing. + """ + + def __init__(self, generator_flags, flavor): + self.generator_flags = generator_flags + self.flavor = flavor + + self.suffix_rules_srcdir = {} + self.suffix_rules_objdir1 = {} + self.suffix_rules_objdir2 = {} + + # Generate suffix rules for all compilable extensions. + for ext, value in COMPILABLE_EXTENSIONS.items(): + # Suffix rules for source folder. + self.suffix_rules_srcdir.update( + { + ext: ( + """\ +$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD +\t@$(call do_cmd,%s,1) +""" + % (ext, value) + ) + } + ) + + # Suffix rules for generated source files. + self.suffix_rules_objdir1.update( + { + ext: ( + """\ +$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD +\t@$(call do_cmd,%s,1) +""" + % (ext, value) + ) + } + ) + self.suffix_rules_objdir2.update( + { + ext: ( + """\ +$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD +\t@$(call do_cmd,%s,1) +""" + % (ext, value) + ) + } + ) + + def Write( + self, qualified_target, base_path, output_filename, spec, configs, part_of_all + ): + """The main entry point: writes a .mk file for a single target. + + Arguments: + qualified_target: target we're generating + base_path: path relative to source root we're building in, used to resolve + target-relative paths + output_filename: output .mk file name to write + spec, configs: gyp info + part_of_all: flag indicating this target is part of 'all' + """ + gyp.common.EnsureDirExists(output_filename) + + self.fp = open(output_filename, "w") + + self.fp.write(header) + + self.qualified_target = qualified_target + self.path = base_path + self.target = spec["target_name"] + self.type = spec["type"] + self.toolset = spec["toolset"] + + self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) + if self.flavor == "mac": + self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) + else: + self.xcode_settings = None + + deps, link_deps = self.ComputeDeps(spec) + + # Some of the generation below can add extra output, sources, or + # link dependencies. All of the out params of the functions that + # follow use names like extra_foo. + extra_outputs = [] + extra_sources = [] + extra_link_deps = [] + extra_mac_bundle_resources = [] + mac_bundle_deps = [] + + if self.is_mac_bundle: + self.output = self.ComputeMacBundleOutput(spec) + self.output_binary = self.ComputeMacBundleBinaryOutput(spec) + else: + self.output = self.output_binary = replace_sep(self.ComputeOutput(spec)) + + self.is_standalone_static_library = bool( + spec.get("standalone_static_library", 0) + ) + self._INSTALLABLE_TARGETS = ("executable", "loadable_module", "shared_library") + if self.is_standalone_static_library or self.type in self._INSTALLABLE_TARGETS: + self.alias = os.path.basename(self.output) + install_path = self._InstallableTargetInstallPath() + else: + self.alias = self.output + install_path = self.output + + self.WriteLn("TOOLSET := " + self.toolset) + self.WriteLn("TARGET := " + self.target) + + # Actions must come first, since they can generate more OBJs for use below. + if "actions" in spec: + self.WriteActions( + spec["actions"], + extra_sources, + extra_outputs, + extra_mac_bundle_resources, + part_of_all, + ) + + # Rules must be early like actions. + if "rules" in spec: + self.WriteRules( + spec["rules"], + extra_sources, + extra_outputs, + extra_mac_bundle_resources, + part_of_all, + ) + + if "copies" in spec: + self.WriteCopies(spec["copies"], extra_outputs, part_of_all) + + # Bundle resources. + if self.is_mac_bundle: + all_mac_bundle_resources = ( + spec.get("mac_bundle_resources", []) + extra_mac_bundle_resources + ) + self.WriteMacBundleResources(all_mac_bundle_resources, mac_bundle_deps) + self.WriteMacInfoPlist(mac_bundle_deps) + + # Sources. + all_sources = spec.get("sources", []) + extra_sources + if all_sources: + self.WriteSources( + configs, + deps, + all_sources, + extra_outputs, + extra_link_deps, + part_of_all, + gyp.xcode_emulation.MacPrefixHeader( + self.xcode_settings, + lambda p: Sourceify(self.Absolutify(p)), + self.Pchify, + ), + ) + sources = [x for x in all_sources if Compilable(x)] + if sources: + self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT1) + extensions = {os.path.splitext(s)[1] for s in sources} + for ext in extensions: + if ext in self.suffix_rules_srcdir: + self.WriteLn(self.suffix_rules_srcdir[ext]) + self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT2) + for ext in extensions: + if ext in self.suffix_rules_objdir1: + self.WriteLn(self.suffix_rules_objdir1[ext]) + for ext in extensions: + if ext in self.suffix_rules_objdir2: + self.WriteLn(self.suffix_rules_objdir2[ext]) + self.WriteLn("# End of this set of suffix rules") + + # Add dependency from bundle to bundle binary. + if self.is_mac_bundle: + mac_bundle_deps.append(self.output_binary) + + self.WriteTarget( + spec, + configs, + deps, + extra_link_deps + link_deps, + mac_bundle_deps, + extra_outputs, + part_of_all, + ) + + # Update global list of target outputs, used in dependency tracking. + target_outputs[qualified_target] = install_path + + # Update global list of link dependencies. + if self.type in ("static_library", "shared_library"): + target_link_deps[qualified_target] = self.output_binary + + # Currently any versions have the same effect, but in future the behavior + # could be different. + if self.generator_flags.get("android_ndk_version", None): + self.WriteAndroidNdkModuleRule(self.target, all_sources, link_deps) + + self.fp.close() + + def WriteSubMake(self, output_filename, makefile_path, targets, build_dir): + """Write a "sub-project" Makefile. + + This is a small, wrapper Makefile that calls the top-level Makefile to build + the targets from a single gyp file (i.e. a sub-project). + + Arguments: + output_filename: sub-project Makefile name to write + makefile_path: path to the top-level Makefile + targets: list of "all" targets for this sub-project + build_dir: build output directory, relative to the sub-project + """ + gyp.common.EnsureDirExists(output_filename) + self.fp = open(output_filename, "w") + self.fp.write(header) + # For consistency with other builders, put sub-project build output in the + # sub-project dir (see test/subdirectory/gyptest-subdir-all.py). + self.WriteLn( + "export builddir_name ?= %s" + % replace_sep(os.path.join(os.path.dirname(output_filename), build_dir)) + ) + self.WriteLn(".PHONY: all") + self.WriteLn("all:") + if makefile_path: + makefile_path = " -C " + makefile_path + self.WriteLn("\t$(MAKE){} {}".format(makefile_path, " ".join(targets))) + self.fp.close() + + def WriteActions( + self, + actions, + extra_sources, + extra_outputs, + extra_mac_bundle_resources, + part_of_all, + ): + """Write Makefile code for any 'actions' from the gyp input. + + extra_sources: a list that will be filled in with newly generated source + files, if any + extra_outputs: a list that will be filled in with any outputs of these + actions (used to make other pieces dependent on these + actions) + part_of_all: flag indicating this target is part of 'all' + """ + env = self.GetSortedXcodeEnv() + for action in actions: + name = StringToMakefileVariable( + "{}_{}".format(self.qualified_target, action["action_name"]) + ) + self.WriteLn('### Rules for action "%s":' % action["action_name"]) + inputs = action["inputs"] + outputs = action["outputs"] + + # Build up a list of outputs. + # Collect the output dirs we'll need. + dirs = set() + for out in outputs: + dir = os.path.split(out)[0] + if dir: + dirs.add(dir) + if int(action.get("process_outputs_as_sources", False)): + extra_sources += outputs + if int(action.get("process_outputs_as_mac_bundle_resources", False)): + extra_mac_bundle_resources += outputs + + # Write the actual command. + action_commands = action["action"] + if self.flavor == "mac": + action_commands = [ + gyp.xcode_emulation.ExpandEnvVars(command, env) + for command in action_commands + ] + command = gyp.common.EncodePOSIXShellList(action_commands) + if "message" in action: + self.WriteLn( + "quiet_cmd_{} = ACTION {} $@".format(name, action["message"]) + ) + else: + self.WriteLn(f"quiet_cmd_{name} = ACTION {name} $@") + if len(dirs) > 0: + command = "mkdir -p %s" % " ".join(dirs) + "; " + command + + cd_action = "cd %s; " % Sourceify(self.path or ".") + + # command and cd_action get written to a toplevel variable called + # cmd_foo. Toplevel variables can't handle things that change per + # makefile like $(TARGET), so hardcode the target. + command = command.replace("$(TARGET)", self.target) + cd_action = cd_action.replace("$(TARGET)", self.target) + + # Set LD_LIBRARY_PATH in case the action runs an executable from this + # build which links to shared libs from this build. + # actions run on the host, so they should in theory only use host + # libraries, but until everything is made cross-compile safe, also use + # target libraries. + # TODO(piman): when everything is cross-compile safe, remove lib.target + if self.flavor in {"zos", "aix"}: + self.WriteLn( + "cmd_%s = LIBPATH=$(builddir)/lib.host:" + "$(builddir)/lib.target:$$LIBPATH; " + "export LIBPATH; " + "%s%s" % (name, cd_action, command) + ) + else: + self.WriteLn( + "cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:" + "$(builddir)/lib.target:$$LD_LIBRARY_PATH; " + "export LD_LIBRARY_PATH; " + "%s%s" % (name, cd_action, command) + ) + self.WriteLn() + outputs = [self.Absolutify(o) for o in outputs] + # The makefile rules are all relative to the top dir, but the gyp actions + # are defined relative to their containing dir. This replaces the obj + # variable for the action rule with an absolute version so that the output + # goes in the right place. + # Only write the 'obj' and 'builddir' rules for the "primary" output (:1); + # it's superfluous for the "extra outputs", and this avoids accidentally + # writing duplicate dummy rules for those outputs. + # Same for environment. + self.WriteLn("%s: obj := $(abs_obj)" % QuoteSpaces(outputs[0])) + self.WriteLn("%s: builddir := $(abs_builddir)" % QuoteSpaces(outputs[0])) + self.WriteSortedXcodeEnv(outputs[0], self.GetSortedXcodeEnv()) + + for input in inputs: + assert " " not in input, ( + "Spaces in action input filenames not supported (%s)" % input + ) + for output in outputs: + assert " " not in output, ( + "Spaces in action output filenames not supported (%s)" % output + ) + + # See the comment in WriteCopies about expanding env vars. + outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] + inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] + + self.WriteDoCmd( + outputs, + [Sourceify(self.Absolutify(i)) for i in inputs], + part_of_all=part_of_all, + command=name, + ) + + # Stuff the outputs in a variable so we can refer to them later. + outputs_variable = "action_%s_outputs" % name + self.WriteLn("{} := {}".format(outputs_variable, " ".join(outputs))) + extra_outputs.append("$(%s)" % outputs_variable) + self.WriteLn() + + self.WriteLn() + + def WriteRules( + self, + rules, + extra_sources, + extra_outputs, + extra_mac_bundle_resources, + part_of_all, + ): + """Write Makefile code for any 'rules' from the gyp input. + + extra_sources: a list that will be filled in with newly generated source + files, if any + extra_outputs: a list that will be filled in with any outputs of these + rules (used to make other pieces dependent on these rules) + part_of_all: flag indicating this target is part of 'all' + """ + env = self.GetSortedXcodeEnv() + for rule in rules: + name = StringToMakefileVariable( + "{}_{}".format(self.qualified_target, rule["rule_name"]) + ) + count = 0 + self.WriteLn("### Generated for rule %s:" % name) + + all_outputs = [] + + for rule_source in rule.get("rule_sources", []): + dirs = set() + (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) + (rule_source_root, _rule_source_ext) = os.path.splitext( + rule_source_basename + ) + + outputs = [ + self.ExpandInputRoot(out, rule_source_root, rule_source_dirname) + for out in rule["outputs"] + ] + + for out in outputs: + dir = os.path.dirname(out) + if dir: + dirs.add(dir) + if int(rule.get("process_outputs_as_sources", False)): + extra_sources += outputs + if int(rule.get("process_outputs_as_mac_bundle_resources", False)): + extra_mac_bundle_resources += outputs + inputs = [ + Sourceify(self.Absolutify(i)) + for i in [rule_source] + rule.get("inputs", []) + ] + actions = ["$(call do_cmd,%s_%d)" % (name, count)] + + if name == "resources_grit": + # HACK: This is ugly. Grit intentionally doesn't touch the + # timestamp of its output file when the file doesn't change, + # which is fine in hash-based dependency systems like scons + # and forge, but not kosher in the make world. After some + # discussion, hacking around it here seems like the least + # amount of pain. + actions += ["@touch --no-create $@"] + + # See the comment in WriteCopies about expanding env vars. + outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] + inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] + + outputs = [self.Absolutify(o) for o in outputs] + all_outputs += outputs + # Only write the 'obj' and 'builddir' rules for the "primary" output + # (:1); it's superfluous for the "extra outputs", and this avoids + # accidentally writing duplicate dummy rules for those outputs. + self.WriteLn("%s: obj := $(abs_obj)" % outputs[0]) + self.WriteLn("%s: builddir := $(abs_builddir)" % outputs[0]) + self.WriteMakeRule( + outputs, inputs, actions, command="%s_%d" % (name, count) + ) + # Spaces in rule filenames are not supported, but rule variables have + # spaces in them (e.g. RULE_INPUT_PATH expands to '$(abspath $<)'). + # The spaces within the variables are valid, so remove the variables + # before checking. + variables_with_spaces = re.compile(r"\$\([^ ]* \$<\)") + for output in outputs: + output = re.sub(variables_with_spaces, "", output) + assert " " not in output, ( + "Spaces in rule filenames not yet supported (%s)" % output + ) + self.WriteLn("all_deps += %s" % " ".join(outputs)) + + action = [ + self.ExpandInputRoot(ac, rule_source_root, rule_source_dirname) + for ac in rule["action"] + ] + mkdirs = "" + if len(dirs) > 0: + mkdirs = "mkdir -p %s; " % " ".join(dirs) + cd_action = "cd %s; " % Sourceify(self.path or ".") + + # action, cd_action, and mkdirs get written to a toplevel variable + # called cmd_foo. Toplevel variables can't handle things that change + # per makefile like $(TARGET), so hardcode the target. + if self.flavor == "mac": + action = [ + gyp.xcode_emulation.ExpandEnvVars(command, env) + for command in action + ] + action = gyp.common.EncodePOSIXShellList(action) + action = action.replace("$(TARGET)", self.target) + cd_action = cd_action.replace("$(TARGET)", self.target) + mkdirs = mkdirs.replace("$(TARGET)", self.target) + + # Set LD_LIBRARY_PATH in case the rule runs an executable from this + # build which links to shared libs from this build. + # rules run on the host, so they should in theory only use host + # libraries, but until everything is made cross-compile safe, also use + # target libraries. + # TODO(piman): when everything is cross-compile safe, remove lib.target + self.WriteLn( + "cmd_%(name)s_%(count)d = LD_LIBRARY_PATH=" + "$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; " + "export LD_LIBRARY_PATH; " + "%(cd_action)s%(mkdirs)s%(action)s" + % { + "action": action, + "cd_action": cd_action, + "count": count, + "mkdirs": mkdirs, + "name": name, + } + ) + self.WriteLn( + "quiet_cmd_%(name)s_%(count)d = RULE %(name)s_%(count)d $@" + % {"count": count, "name": name} + ) + self.WriteLn() + count += 1 + + outputs_variable = "rule_%s_outputs" % name + self.WriteList(all_outputs, outputs_variable) + extra_outputs.append("$(%s)" % outputs_variable) + + self.WriteLn("### Finished generating for rule: %s" % name) + self.WriteLn() + self.WriteLn("### Finished generating for all rules") + self.WriteLn("") + + def WriteCopies(self, copies, extra_outputs, part_of_all): + """Write Makefile code for any 'copies' from the gyp input. + + extra_outputs: a list that will be filled in with any outputs of this action + (used to make other pieces dependent on this action) + part_of_all: flag indicating this target is part of 'all' + """ + self.WriteLn("### Generated for copy rule.") + + variable = StringToMakefileVariable(self.qualified_target + "_copies") + outputs = [] + for copy in copies: + for path in copy["files"]: + # Absolutify() may call normpath, and will strip trailing slashes. + path = Sourceify(self.Absolutify(path)) + filename = os.path.split(path)[1] + output = Sourceify( + self.Absolutify(os.path.join(copy["destination"], filename)) + ) + + # If the output path has variables in it, which happens in practice for + # 'copies', writing the environment as target-local doesn't work, + # because the variables are already needed for the target name. + # Copying the environment variables into global make variables doesn't + # work either, because then the .d files will potentially contain spaces + # after variable expansion, and .d file handling cannot handle spaces. + # As a workaround, manually expand variables at gyp time. Since 'copies' + # can't run scripts, there's no need to write the env then. + # WriteDoCmd() will escape spaces for .d files. + env = self.GetSortedXcodeEnv() + output = gyp.xcode_emulation.ExpandEnvVars(output, env) + path = gyp.xcode_emulation.ExpandEnvVars(path, env) + self.WriteDoCmd([output], [path], "copy", part_of_all) + outputs.append(output) + self.WriteLn( + "{} = {}".format(variable, " ".join(QuoteSpaces(o) for o in outputs)) + ) + extra_outputs.append("$(%s)" % variable) + self.WriteLn() + + def WriteMacBundleResources(self, resources, bundle_deps): + """Writes Makefile code for 'mac_bundle_resources'.""" + self.WriteLn("### Generated for mac_bundle_resources") + + for output, res in gyp.xcode_emulation.GetMacBundleResources( + generator_default_variables["PRODUCT_DIR"], + self.xcode_settings, + [Sourceify(self.Absolutify(r)) for r in resources], + ): + _, ext = os.path.splitext(output) + if ext != ".xcassets": + # Make does not supports '.xcassets' emulation. + self.WriteDoCmd( + [output], [res], "mac_tool,,,copy-bundle-resource", part_of_all=True + ) + bundle_deps.append(output) + + def WriteMacInfoPlist(self, bundle_deps): + """Write Makefile code for bundle Info.plist files.""" + info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( + generator_default_variables["PRODUCT_DIR"], + self.xcode_settings, + lambda p: Sourceify(self.Absolutify(p)), + ) + if not info_plist: + return + if defines: + # Create an intermediate file to store preprocessed results. + intermediate_plist = "$(obj).$(TOOLSET)/$(TARGET)/" + os.path.basename( + info_plist + ) + self.WriteList( + defines, + intermediate_plist + ": INFOPLIST_DEFINES", + "-D", + quoter=EscapeCppDefine, + ) + self.WriteMakeRule( + [intermediate_plist], + [info_plist], + [ + "$(call do_cmd,infoplist)", + # "Convert" the plist so that any weird whitespace changes from the + # preprocessor do not affect the XML parser in mac_tool. + "@plutil -convert xml1 $@ $@", + ], + ) + info_plist = intermediate_plist + # plists can contain envvars and substitute them into the file. + self.WriteSortedXcodeEnv( + out, self.GetSortedXcodeEnv(additional_settings=extra_env) + ) + self.WriteDoCmd( + [out], [info_plist], "mac_tool,,,copy-info-plist", part_of_all=True + ) + bundle_deps.append(out) + + def WriteSources( + self, + configs, + deps, + sources, + extra_outputs, + extra_link_deps, + part_of_all, + precompiled_header, + ): + """Write Makefile code for any 'sources' from the gyp input. + These are source files necessary to build the current target. + + configs, deps, sources: input from gyp. + extra_outputs: a list of extra outputs this action should be dependent on; + used to serialize action/rules before compilation + extra_link_deps: a list that will be filled in with any outputs of + compilation (to be used in link lines) + part_of_all: flag indicating this target is part of 'all' + """ + + # Write configuration-specific variables for CFLAGS, etc. + for configname in sorted(configs.keys()): + config = configs[configname] + self.WriteList( + config.get("defines"), + "DEFS_%s" % configname, + prefix="-D", + quoter=EscapeCppDefine, + ) + + if self.flavor == "mac": + cflags = self.xcode_settings.GetCflags( + configname, arch=config.get("xcode_configuration_platform") + ) + cflags_c = self.xcode_settings.GetCflagsC(configname) + cflags_cc = self.xcode_settings.GetCflagsCC(configname) + cflags_objc = self.xcode_settings.GetCflagsObjC(configname) + cflags_objcc = self.xcode_settings.GetCflagsObjCC(configname) + else: + cflags = config.get("cflags") + cflags_c = config.get("cflags_c") + cflags_cc = config.get("cflags_cc") + + self.WriteLn("# Flags passed to all source files.") + self.WriteList(cflags, "CFLAGS_%s" % configname) + self.WriteLn("# Flags passed to only C files.") + self.WriteList(cflags_c, "CFLAGS_C_%s" % configname) + self.WriteLn("# Flags passed to only C++ files.") + self.WriteList(cflags_cc, "CFLAGS_CC_%s" % configname) + if self.flavor == "mac": + self.WriteLn("# Flags passed to only ObjC files.") + self.WriteList(cflags_objc, "CFLAGS_OBJC_%s" % configname) + self.WriteLn("# Flags passed to only ObjC++ files.") + self.WriteList(cflags_objcc, "CFLAGS_OBJCC_%s" % configname) + includes = config.get("include_dirs") + if includes: + includes = [Sourceify(self.Absolutify(i)) for i in includes] + self.WriteList(includes, "INCS_%s" % configname, prefix="-I") + + compilable = list(filter(Compilable, sources)) + objs = [self.Objectify(self.Absolutify(Target(c))) for c in compilable] + self.WriteList(objs, "OBJS") + + for obj in objs: + assert " " not in obj, "Spaces in object filenames not supported (%s)" % obj + self.WriteLn("# Add to the list of files we specially track dependencies for.") + self.WriteLn("all_deps += $(OBJS)") + self.WriteLn() + + # Make sure our dependencies are built first. + if deps: + self.WriteMakeRule( + ["$(OBJS)"], + deps, + comment="Make sure our dependencies are built before any of us.", + order_only=True, + ) + + # Make sure the actions and rules run first. + # If they generate any extra headers etc., the per-.o file dep tracking + # will catch the proper rebuilds, so order only is still ok here. + if extra_outputs: + self.WriteMakeRule( + ["$(OBJS)"], + extra_outputs, + comment="Make sure our actions/rules run before any of us.", + order_only=True, + ) + + if pchdeps := precompiled_header.GetObjDependencies(compilable, objs): + self.WriteLn("# Dependencies from obj files to their precompiled headers") + for source, obj, gch in pchdeps: + self.WriteLn(f"{obj}: {gch}") + self.WriteLn("# End precompiled header dependencies") + + if objs: + extra_link_deps.append("$(OBJS)") + self.WriteLn( + """\ +# CFLAGS et al overrides must be target-local. +# See "Target-specific Variable Values" in the GNU Make manual.""" + ) + self.WriteLn("$(OBJS): TOOLSET := $(TOOLSET)") + self.WriteLn( + "$(OBJS): GYP_CFLAGS := " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "%s " % precompiled_header.GetInclude("c") + "$(CFLAGS_$(BUILDTYPE)) " + "$(CFLAGS_C_$(BUILDTYPE))" + ) + self.WriteLn( + "$(OBJS): GYP_CXXFLAGS := " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "%s " % precompiled_header.GetInclude("cc") + "$(CFLAGS_$(BUILDTYPE)) " + "$(CFLAGS_CC_$(BUILDTYPE))" + ) + if self.flavor == "mac": + self.WriteLn( + "$(OBJS): GYP_OBJCFLAGS := " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "%s " + % precompiled_header.GetInclude("m") + + "$(CFLAGS_$(BUILDTYPE)) " + "$(CFLAGS_C_$(BUILDTYPE)) " + "$(CFLAGS_OBJC_$(BUILDTYPE))" + ) + self.WriteLn( + "$(OBJS): GYP_OBJCXXFLAGS := " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "%s " + % precompiled_header.GetInclude("mm") + + "$(CFLAGS_$(BUILDTYPE)) " + "$(CFLAGS_CC_$(BUILDTYPE)) " + "$(CFLAGS_OBJCC_$(BUILDTYPE))" + ) + + self.WritePchTargets(precompiled_header.GetPchBuildCommands()) + + # If there are any object files in our input file list, link them into our + # output. + extra_link_deps += [source for source in sources if Linkable(source)] + + self.WriteLn() + + def WritePchTargets(self, pch_commands): + """Writes make rules to compile prefix headers.""" + if not pch_commands: + return + + for gch, lang_flag, lang, input in pch_commands: + extra_flags = { + "c": "$(CFLAGS_C_$(BUILDTYPE))", + "cc": "$(CFLAGS_CC_$(BUILDTYPE))", + "m": "$(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))", + "mm": "$(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))", + }[lang] + var_name = { + "c": "GYP_PCH_CFLAGS", + "cc": "GYP_PCH_CXXFLAGS", + "m": "GYP_PCH_OBJCFLAGS", + "mm": "GYP_PCH_OBJCXXFLAGS", + }[lang] + self.WriteLn( + f"{gch}: {var_name} := {lang_flag} " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "$(CFLAGS_$(BUILDTYPE)) " + extra_flags + ) + + self.WriteLn(f"{gch}: {input} FORCE_DO_CMD") + self.WriteLn("\t@$(call do_cmd,pch_%s,1)" % lang) + self.WriteLn("") + assert " " not in gch, "Spaces in gch filenames not supported (%s)" % gch + self.WriteLn("all_deps += %s" % gch) + self.WriteLn("") + + def ComputeOutputBasename(self, spec): + """Return the 'output basename' of a gyp spec. + + E.g., the loadable module 'foobar' in directory 'baz' will produce + 'libfoobar.so' + """ + assert not self.is_mac_bundle + + if self.flavor == "mac" and self.type in ( + "static_library", + "executable", + "shared_library", + "loadable_module", + ): + return self.xcode_settings.GetExecutablePath() + + target = spec["target_name"] + target_prefix = "" + target_ext = "" + if self.type == "static_library": + if target[:3] == "lib": + target = target[3:] + target_prefix = "lib" + target_ext = ".a" + elif self.type in ("loadable_module", "shared_library"): + if target[:3] == "lib": + target = target[3:] + target_prefix = "lib" + if self.flavor == "aix": + target_ext = ".a" + elif self.flavor == "zos": + target_ext = ".x" + else: + target_ext = ".so" + elif self.type == "none": + target = "%s.stamp" % target + elif self.type != "executable": + print( + "ERROR: What output file should be generated?", + "type", + self.type, + "target", + target, + ) + + target_prefix = spec.get("product_prefix", target_prefix) + target = spec.get("product_name", target) + if product_ext := spec.get("product_extension"): + target_ext = "." + product_ext + + return target_prefix + target + target_ext + + def _InstallImmediately(self): + return ( + self.toolset == "target" + and self.flavor == "mac" + and self.type + in ("static_library", "executable", "shared_library", "loadable_module") + ) + + def ComputeOutput(self, spec): + """Return the 'output' (full output path) of a gyp spec. + + E.g., the loadable module 'foobar' in directory 'baz' will produce + '$(obj)/baz/libfoobar.so' + """ + assert not self.is_mac_bundle + + path = os.path.join("$(obj)." + self.toolset, self.path) + if self.type == "executable" or self._InstallImmediately(): + path = "$(builddir)" + path = spec.get("product_dir", path) + return os.path.join(path, self.ComputeOutputBasename(spec)) + + def ComputeMacBundleOutput(self, spec): + """Return the 'output' (full output path) to a bundle output directory.""" + assert self.is_mac_bundle + path = generator_default_variables["PRODUCT_DIR"] + return os.path.join(path, self.xcode_settings.GetWrapperName()) + + def ComputeMacBundleBinaryOutput(self, spec): + """Return the 'output' (full output path) to the binary in a bundle.""" + path = generator_default_variables["PRODUCT_DIR"] + return os.path.join(path, self.xcode_settings.GetExecutablePath()) + + def ComputeDeps(self, spec): + """Compute the dependencies of a gyp spec. + + Returns a tuple (deps, link_deps), where each is a list of + filenames that will need to be put in front of make for either + building (deps) or linking (link_deps). + """ + deps = [] + link_deps = [] + if "dependencies" in spec: + deps.extend( + [ + target_outputs[dep] + for dep in spec["dependencies"] + if target_outputs[dep] + ] + ) + for dep in spec["dependencies"]: + if dep in target_link_deps: + link_deps.append(target_link_deps[dep]) + deps.extend(link_deps) + # TODO: It seems we need to transitively link in libraries (e.g. -lfoo)? + # This hack makes it work: + # link_deps.extend(spec.get('libraries', [])) + return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) + + def GetSharedObjectFromSidedeck(self, sidedeck): + """Return the shared object files based on sidedeck""" + return re.sub(r"\.x$", ".so", sidedeck) + + def GetUnversionedSidedeckFromSidedeck(self, sidedeck): + """Return the shared object files based on sidedeck""" + return re.sub(r"\.\d+\.x$", ".x", sidedeck) + + def WriteDependencyOnExtraOutputs(self, target, extra_outputs): + self.WriteMakeRule( + [self.output_binary], + extra_outputs, + comment="Build our special outputs first.", + order_only=True, + ) + + def WriteTarget( + self, spec, configs, deps, link_deps, bundle_deps, extra_outputs, part_of_all + ): + """Write Makefile code to produce the final target of the gyp spec. + + spec, configs: input from gyp. + deps, link_deps: dependency lists; see ComputeDeps() + extra_outputs: any extra outputs that our target should depend on + part_of_all: flag indicating this target is part of 'all' + """ + + self.WriteLn("### Rules for final target.") + + if extra_outputs: + self.WriteDependencyOnExtraOutputs(self.output_binary, extra_outputs) + self.WriteMakeRule( + extra_outputs, + deps, + comment=("Preserve order dependency of special output on deps."), + order_only=True, + ) + + target_postbuilds = {} + if self.type != "none": + for configname in sorted(configs.keys()): + config = configs[configname] + if self.flavor == "mac": + ldflags = self.xcode_settings.GetLdflags( + configname, + generator_default_variables["PRODUCT_DIR"], + lambda p: Sourceify(self.Absolutify(p)), + arch=config.get("xcode_configuration_platform"), + ) + + # TARGET_POSTBUILDS_$(BUILDTYPE) is added to postbuilds later on. + gyp_to_build = gyp.common.InvertRelativePath(self.path) + target_postbuild = self.xcode_settings.AddImplicitPostbuilds( + configname, + QuoteSpaces( + os.path.normpath(os.path.join(gyp_to_build, self.output)) + ), + QuoteSpaces( + os.path.normpath( + os.path.join(gyp_to_build, self.output_binary) + ) + ), + ) + if target_postbuild: + target_postbuilds[configname] = target_postbuild + else: + ldflags = config.get("ldflags", []) + # Compute an rpath for this output if needed. + if any(dep.endswith(".so") or ".so." in dep for dep in deps): + # We want to get the literal string "$ORIGIN" + # into the link command, so we need lots of escaping. + ldflags.append(r"-Wl,-rpath=\$$ORIGIN/") + ldflags.append(r"-Wl,-rpath-link=\$(builddir)/") + if library_dirs := config.get("library_dirs", []): + library_dirs = [Sourceify(self.Absolutify(i)) for i in library_dirs] + ldflags += [("-L%s" % library_dir) for library_dir in library_dirs] + self.WriteList(ldflags, "LDFLAGS_%s" % configname) + if self.flavor == "mac": + self.WriteList( + self.xcode_settings.GetLibtoolflags(configname), + "LIBTOOLFLAGS_%s" % configname, + ) + libraries = spec.get("libraries") + if libraries: + # Remove duplicate entries + libraries = gyp.common.uniquer(libraries) + if self.flavor == "mac": + libraries = self.xcode_settings.AdjustLibraries(libraries) + self.WriteList(libraries, "LIBS") + self.WriteLn( + "%s: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))" + % QuoteSpaces(self.output_binary) + ) + self.WriteLn("%s: LIBS := $(LIBS)" % QuoteSpaces(self.output_binary)) + + if self.flavor == "mac": + self.WriteLn( + "%s: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))" + % QuoteSpaces(self.output_binary) + ) + + # Postbuild actions. Like actions, but implicitly depend on the target's + # output. + postbuilds = [] + if self.flavor == "mac": + if target_postbuilds: + postbuilds.append("$(TARGET_POSTBUILDS_$(BUILDTYPE))") + postbuilds.extend(gyp.xcode_emulation.GetSpecPostbuildCommands(spec)) + + if postbuilds: + # Envvars may be referenced by TARGET_POSTBUILDS_$(BUILDTYPE), + # so we must output its definition first, since we declare variables + # using ":=". + self.WriteSortedXcodeEnv(self.output, self.GetSortedXcodePostbuildEnv()) + + for configname, value in target_postbuilds.items(): + self.WriteLn( + "%s: TARGET_POSTBUILDS_%s := %s" + % ( + QuoteSpaces(self.output), + configname, + gyp.common.EncodePOSIXShellList(value), + ) + ) + + # Postbuilds expect to be run in the gyp file's directory, so insert an + # implicit postbuild to cd to there. + postbuilds.insert(0, gyp.common.EncodePOSIXShellList(["cd", self.path])) + for i, postbuild in enumerate(postbuilds): + if not postbuild.startswith("$"): + postbuilds[i] = EscapeShellArgument(postbuild) + self.WriteLn("%s: builddir := $(abs_builddir)" % QuoteSpaces(self.output)) + self.WriteLn( + "%s: POSTBUILDS := %s" + % (QuoteSpaces(self.output), " ".join(postbuilds)) + ) + + # A bundle directory depends on its dependencies such as bundle resources + # and bundle binary. When all dependencies have been built, the bundle + # needs to be packaged. + if self.is_mac_bundle: + # If the framework doesn't contain a binary, then nothing depends + # on the actions -- make the framework depend on them directly too. + self.WriteDependencyOnExtraOutputs(self.output, extra_outputs) + + # Bundle dependencies. Note that the code below adds actions to this + # target, so if you move these two lines, move the lines below as well. + self.WriteList([QuoteSpaces(dep) for dep in bundle_deps], "BUNDLE_DEPS") + self.WriteLn("%s: $(BUNDLE_DEPS)" % QuoteSpaces(self.output)) + + # After the framework is built, package it. Needs to happen before + # postbuilds, since postbuilds depend on this. + if self.type in ("shared_library", "loadable_module"): + self.WriteLn( + "\t@$(call do_cmd,mac_package_framework,,,%s)" + % self.xcode_settings.GetFrameworkVersion() + ) + + # Bundle postbuilds can depend on the whole bundle, so run them after + # the bundle is packaged, not already after the bundle binary is done. + if postbuilds: + self.WriteLn("\t@$(call do_postbuilds)") + postbuilds = [] # Don't write postbuilds for target's output. + + # Needed by test/mac/gyptest-rebuild.py. + self.WriteLn("\t@true # No-op, used by tests") + + # Since this target depends on binary and resources which are in + # nested subfolders, the framework directory will be older than + # its dependencies usually. To prevent this rule from executing + # on every build (expensive, especially with postbuilds), explicitly + # update the time on the framework directory. + self.WriteLn("\t@touch -c %s" % QuoteSpaces(self.output)) + + if postbuilds: + assert not self.is_mac_bundle, ( + "Postbuilds for bundles should be done " + "on the bundle, not the binary (target '%s')" % self.target + ) + assert "product_dir" not in spec, ( + "Postbuilds do not work with custom product_dir" + ) + + if self.type == "executable": + self.WriteLn( + "%s: LD_INPUTS := %s" + % ( + QuoteSpaces(self.output_binary), + " ".join(QuoteSpaces(dep) for dep in link_deps), + ) + ) + if self.toolset == "host" and self.flavor == "android": + self.WriteDoCmd( + [self.output_binary], + link_deps, + "link_host", + part_of_all, + postbuilds=postbuilds, + ) + else: + self.WriteDoCmd( + [self.output_binary], + link_deps, + "link", + part_of_all, + postbuilds=postbuilds, + ) + + elif self.type == "static_library": + for link_dep in link_deps: + assert " " not in link_dep, ( + "Spaces in alink input filenames not supported (%s)" % link_dep + ) + if ( + self.flavor not in ("mac", "openbsd", "netbsd", "win") + and not self.is_standalone_static_library + ): + if self.flavor in ("linux", "android", "openharmony"): + self.WriteMakeRule( + [self.output_binary], + link_deps, + actions=["$(call create_thin_archive,$@,$^)"], + ) + else: + self.WriteDoCmd( + [self.output_binary], + link_deps, + "alink_thin", + part_of_all, + postbuilds=postbuilds, + ) + elif self.flavor in ("linux", "android", "openharmony"): + self.WriteMakeRule( + [self.output_binary], + link_deps, + actions=["$(call create_archive,$@,$^)"], + ) + else: + self.WriteDoCmd( + [self.output_binary], + link_deps, + "alink", + part_of_all, + postbuilds=postbuilds, + ) + elif self.type == "shared_library": + self.WriteLn( + "%s: LD_INPUTS := %s" + % ( + QuoteSpaces(self.output_binary), + " ".join(QuoteSpaces(dep) for dep in link_deps), + ) + ) + self.WriteDoCmd( + [self.output_binary], + link_deps, + "solink", + part_of_all, + postbuilds=postbuilds, + ) + # z/OS has a .so target as well as a sidedeck .x target + if self.flavor == "zos": + self.WriteLn( + "%s: %s" + % ( + QuoteSpaces( + self.GetSharedObjectFromSidedeck(self.output_binary) + ), + QuoteSpaces(self.output_binary), + ) + ) + elif self.type == "loadable_module": + for link_dep in link_deps: + assert " " not in link_dep, ( + "Spaces in module input filenames not supported (%s)" % link_dep + ) + if self.toolset == "host" and self.flavor == "android": + self.WriteDoCmd( + [self.output_binary], + link_deps, + "solink_module_host", + part_of_all, + postbuilds=postbuilds, + ) + else: + self.WriteDoCmd( + [self.output_binary], + link_deps, + "solink_module", + part_of_all, + postbuilds=postbuilds, + ) + elif self.type == "none": + # Write a stamp line. + self.WriteDoCmd( + [self.output_binary], deps, "touch", part_of_all, postbuilds=postbuilds + ) + else: + print("WARNING: no output for", self.type, self.target) + + # Add an alias for each target (if there are any outputs). + # Installable target aliases are created below. + if (self.output and self.output != self.target) and ( + self.type not in self._INSTALLABLE_TARGETS + ): + self.WriteMakeRule( + [self.target], [self.output], comment="Add target alias", phony=True + ) + if part_of_all: + self.WriteMakeRule( + ["all"], + [self.target], + comment='Add target alias to "all" target.', + phony=True, + ) + + # Add special-case rules for our installable targets. + # 1) They need to install to the build dir or "product" dir. + # 2) They get shortcuts for building (e.g. "make chrome"). + # 3) They are part of "make all". + if self.type in self._INSTALLABLE_TARGETS or self.is_standalone_static_library: + if self.type == "shared_library": + file_desc = "shared library" + elif self.type == "static_library": + file_desc = "static library" + else: + file_desc = "executable" + install_path = self._InstallableTargetInstallPath() + installable_deps = [] + if self.flavor != "zos": + installable_deps.append(self.output) + if ( + self.flavor == "mac" + and "product_dir" not in spec + and self.toolset == "target" + ): + # On mac, products are created in install_path immediately. + assert install_path == self.output, f"{install_path} != {self.output}" + + # Point the target alias to the final binary output. + self.WriteMakeRule( + [self.target], [install_path], comment="Add target alias", phony=True + ) + if install_path != self.output: + assert not self.is_mac_bundle # See comment a few lines above. + self.WriteDoCmd( + [install_path], + [self.output], + "copy", + comment="Copy this to the %s output path." % file_desc, + part_of_all=part_of_all, + ) + if self.flavor != "zos": + installable_deps.append(install_path) + if self.flavor == "zos" and self.type == "shared_library": + # lib.target/libnode.so has a dependency on $(obj).target/libnode.so + self.WriteDoCmd( + [self.GetSharedObjectFromSidedeck(install_path)], + [self.GetSharedObjectFromSidedeck(self.output)], + "copy", + comment="Copy this to the %s output path." % file_desc, + part_of_all=part_of_all, + ) + # Create a symlink of libnode.x to libnode.version.x + self.WriteDoCmd( + [self.GetUnversionedSidedeckFromSidedeck(install_path)], + [install_path], + "symlink", + comment="Symlnk this to the %s output path." % file_desc, + part_of_all=part_of_all, + ) + # Place libnode.version.so and libnode.x symlink in lib.target dir + installable_deps.append(self.GetSharedObjectFromSidedeck(install_path)) + installable_deps.append( + self.GetUnversionedSidedeckFromSidedeck(install_path) + ) + if self.alias not in (self.output, self.target): + self.WriteMakeRule( + [self.alias], + installable_deps, + comment="Short alias for building this %s." % file_desc, + phony=True, + ) + if self.flavor == "zos" and self.type == "shared_library": + # Make sure that .x symlink target is run + self.WriteMakeRule( + ["all"], + [ + self.GetUnversionedSidedeckFromSidedeck(install_path), + self.GetSharedObjectFromSidedeck(install_path), + ], + comment='Add %s to "all" target.' % file_desc, + phony=True, + ) + elif part_of_all: + self.WriteMakeRule( + ["all"], + [install_path], + comment='Add %s to "all" target.' % file_desc, + phony=True, + ) + + def WriteList(self, value_list, variable=None, prefix="", quoter=QuoteIfNecessary): + """Write a variable definition that is a list of values. + + E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out + foo = blaha blahb + but in a pretty-printed style. + """ + values = "" + if value_list: + value_list = [replace_sep(quoter(prefix + value)) for value in value_list] + values = " \\\n\t" + " \\\n\t".join(value_list) + self.fp.write(f"{variable} :={values}\n\n") + + def WriteDoCmd( + self, outputs, inputs, command, part_of_all, comment=None, postbuilds=False + ): + """Write a Makefile rule that uses do_cmd. + + This makes the outputs dependent on the command line that was run, + as well as support the V= make command line flag. + """ + suffix = "" + if postbuilds: + assert "," not in command + suffix = ",,1" # Tell do_cmd to honor $POSTBUILDS + self.WriteMakeRule( + outputs, + inputs, + actions=[f"$(call do_cmd,{command}{suffix})"], + comment=comment, + command=command, + force=True, + ) + # Add our outputs to the list of targets we read depfiles from. + # all_deps is only used for deps file reading, and for deps files we replace + # spaces with ? because escaping doesn't work with make's $(sort) and + # other functions. + outputs = [QuoteSpaces(o, SPACE_REPLACEMENT) for o in outputs] + self.WriteLn("all_deps += %s" % " ".join(outputs)) + + def WriteMakeRule( + self, + outputs, + inputs, + actions=None, + comment=None, + order_only=False, + force=False, + phony=False, + command=None, + ): + """Write a Makefile rule, with some extra tricks. + + outputs: a list of outputs for the rule (note: this is not directly + supported by make; see comments below) + inputs: a list of inputs for the rule + actions: a list of shell commands to run for the rule + comment: a comment to put in the Makefile above the rule (also useful + for making this Python script's code self-documenting) + order_only: if true, makes the dependency order-only + force: if true, include FORCE_DO_CMD as an order-only dep + phony: if true, the rule does not actually generate the named output, the + output is just a name to run the rule + command: (optional) command name to generate unambiguous labels + """ + outputs = [QuoteSpaces(o) for o in outputs] + inputs = [QuoteSpaces(i) for i in inputs] + + if comment: + self.WriteLn("# " + comment) + if phony: + self.WriteLn(".PHONY: " + " ".join(outputs)) + if actions: + self.WriteLn("%s: TOOLSET := $(TOOLSET)" % outputs[0]) + force_append = " FORCE_DO_CMD" if force else "" + + if order_only: + # Order only rule: Just write a simple rule. + # TODO(evanm): just make order_only a list of deps instead of this hack. + self.WriteLn( + "{}: | {}{}".format(" ".join(outputs), " ".join(inputs), force_append) + ) + elif len(outputs) == 1: + # Regular rule, one output: Just write a simple rule. + self.WriteLn("{}: {}{}".format(outputs[0], " ".join(inputs), force_append)) + else: + # Regular rule, more than one output: Multiple outputs are tricky in + # make. We will write three rules: + # - All outputs depend on an intermediate file. + # - Make .INTERMEDIATE depend on the intermediate. + # - The intermediate file depends on the inputs and executes the + # actual command. + # - The intermediate recipe will 'touch' the intermediate file. + # - The multi-output rule will have an do-nothing recipe. + + # Hash the target name to avoid generating overlong filenames. + cmddigest = hashlib.sha256( + (command or self.target).encode("utf-8") + ).hexdigest() + intermediate = "%s.intermediate" % cmddigest + self.WriteLn("{}: {}".format(" ".join(outputs), intermediate)) + self.WriteLn("\t%s" % "@:") + self.WriteLn("{}: {}".format(".INTERMEDIATE", intermediate)) + self.WriteLn( + "{}: {}{}".format(intermediate, " ".join(inputs), force_append) + ) + actions.insert(0, "$(call do_cmd,touch)") + + if actions: + for action in actions: + self.WriteLn("\t%s" % action) + self.WriteLn() + + def WriteAndroidNdkModuleRule(self, module_name, all_sources, link_deps): + """Write a set of LOCAL_XXX definitions for Android NDK. + + These variable definitions will be used by Android NDK but do nothing for + non-Android applications. + + Arguments: + module_name: Android NDK module name, which must be unique among all + module names. + all_sources: A list of source files (will be filtered by Compilable). + link_deps: A list of link dependencies, which must be sorted in + the order from dependencies to dependents. + """ + if self.type not in ("executable", "shared_library", "static_library"): + return + + self.WriteLn("# Variable definitions for Android applications") + self.WriteLn("include $(CLEAR_VARS)") + self.WriteLn("LOCAL_MODULE := " + module_name) + self.WriteLn( + "LOCAL_CFLAGS := $(CFLAGS_$(BUILDTYPE)) " + "$(DEFS_$(BUILDTYPE)) " + # LOCAL_CFLAGS is applied to both of C and C++. There is + # no way to specify $(CFLAGS_C_$(BUILDTYPE)) only for C + # sources. + "$(CFLAGS_C_$(BUILDTYPE)) " + # $(INCS_$(BUILDTYPE)) includes the prefix '-I' while + # LOCAL_C_INCLUDES does not expect it. So put it in + # LOCAL_CFLAGS. + "$(INCS_$(BUILDTYPE))" + ) + # LOCAL_CXXFLAGS is obsolete and LOCAL_CPPFLAGS is preferred. + self.WriteLn("LOCAL_CPPFLAGS := $(CFLAGS_CC_$(BUILDTYPE))") + self.WriteLn("LOCAL_C_INCLUDES :=") + self.WriteLn("LOCAL_LDLIBS := $(LDFLAGS_$(BUILDTYPE)) $(LIBS)") + + # Detect the C++ extension. + cpp_ext = {".cc": 0, ".cpp": 0, ".cxx": 0} + default_cpp_ext = ".cpp" + for filename in all_sources: + ext = os.path.splitext(filename)[1] + if ext in cpp_ext: + cpp_ext[ext] += 1 + if cpp_ext[ext] > cpp_ext[default_cpp_ext]: + default_cpp_ext = ext + self.WriteLn("LOCAL_CPP_EXTENSION := " + default_cpp_ext) + + self.WriteList( + list(map(self.Absolutify, filter(Compilable, all_sources))), + "LOCAL_SRC_FILES", + ) + + # Filter out those which do not match prefix and suffix and produce + # the resulting list without prefix and suffix. + def DepsToModules(deps, prefix, suffix): + modules = [] + for filepath in deps: + filename = os.path.basename(filepath) + if filename.startswith(prefix) and filename.endswith(suffix): + modules.append(filename[len(prefix) : -len(suffix)]) + return modules + + # Retrieve the default value of 'SHARED_LIB_SUFFIX' + params = {"flavor": "linux"} + default_variables = {} + CalculateVariables(default_variables, params) + + self.WriteList( + DepsToModules( + link_deps, + generator_default_variables["SHARED_LIB_PREFIX"], + default_variables["SHARED_LIB_SUFFIX"], + ), + "LOCAL_SHARED_LIBRARIES", + ) + self.WriteList( + DepsToModules( + link_deps, + generator_default_variables["STATIC_LIB_PREFIX"], + generator_default_variables["STATIC_LIB_SUFFIX"], + ), + "LOCAL_STATIC_LIBRARIES", + ) + + if self.type == "executable": + self.WriteLn("include $(BUILD_EXECUTABLE)") + elif self.type == "shared_library": + self.WriteLn("include $(BUILD_SHARED_LIBRARY)") + elif self.type == "static_library": + self.WriteLn("include $(BUILD_STATIC_LIBRARY)") + self.WriteLn() + + def WriteLn(self, text=""): + self.fp.write(text + "\n") + + def GetSortedXcodeEnv(self, additional_settings=None): + return gyp.xcode_emulation.GetSortedXcodeEnv( + self.xcode_settings, + "$(abs_builddir)", + os.path.join("$(abs_srcdir)", self.path), + "$(BUILDTYPE)", + additional_settings, + ) + + def GetSortedXcodePostbuildEnv(self): + # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. + # TODO(thakis): It would be nice to have some general mechanism instead. + strip_save_file = self.xcode_settings.GetPerTargetSetting( + "CHROMIUM_STRIP_SAVE_FILE", "" + ) + # Even if strip_save_file is empty, explicitly write it. Else a postbuild + # might pick up an export from an earlier target. + return self.GetSortedXcodeEnv( + additional_settings={"CHROMIUM_STRIP_SAVE_FILE": strip_save_file} + ) + + def WriteSortedXcodeEnv(self, target, env): + for k, v in env: + # For + # foo := a\ b + # the escaped space does the right thing. For + # export foo := a\ b + # it does not -- the backslash is written to the env as literal character. + # So don't escape spaces in |env[k]|. + self.WriteLn(f"{QuoteSpaces(target)}: export {k} := {v}") + + def Objectify(self, path): + """Convert a path to its output directory form.""" + if "$(" in path: + path = path.replace("$(obj)/", "$(obj).%s/$(TARGET)/" % self.toolset) + if "$(obj)" not in path: + path = f"$(obj).{self.toolset}/$(TARGET)/{path}" + return path + + def Pchify(self, path, lang): + """Convert a prefix header path to its output directory form.""" + path = self.Absolutify(path) + if "$(" in path: + path = path.replace( + "$(obj)/", f"$(obj).{self.toolset}/$(TARGET)/pch-{lang}" + ) + return path + return f"$(obj).{self.toolset}/$(TARGET)/pch-{lang}/{path}" + + def Absolutify(self, path): + """Convert a subdirectory-relative path into a base-relative path. + Skips over paths that contain variables.""" + if "$(" in path: + # Don't call normpath in this case, as it might collapse the + # path too aggressively if it features '..'. However it's still + # important to strip trailing slashes. + return path.rstrip("/") + return os.path.normpath(os.path.join(self.path, path)) + + def ExpandInputRoot(self, template, expansion, dirname): + if "%(INPUT_ROOT)s" not in template and "%(INPUT_DIRNAME)s" not in template: + return template + path = template % { + "INPUT_ROOT": expansion, + "INPUT_DIRNAME": dirname, + } + return path + + def _InstallableTargetInstallPath(self): + """Returns the location of the final output for an installable target.""" + # Functionality removed for all platforms to match Xcode and hoist + # shared libraries into PRODUCT_DIR for users: + # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files + # rely on this. Emulate this behavior for mac. + # if self.type == "shared_library" and ( + # self.flavor != "mac" or self.toolset != "target" + # ): + # # Install all shared libs into a common directory (per toolset) for + # # convenient access with LD_LIBRARY_PATH. + # return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias) + if self.flavor == "zos" and self.type == "shared_library": + return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias) + + return "$(builddir)/" + self.alias + + +def WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files): + """Write the target to regenerate the Makefile.""" + options = params["options"] + build_files_args = [ + gyp.common.RelativePath(filename, options.toplevel_dir) + for filename in params["build_files_arg"] + ] + + gyp_binary = gyp.common.FixIfRelativePath( + params["gyp_binary"], options.toplevel_dir + ) + if not gyp_binary.startswith(os.sep): + gyp_binary = os.path.join(".", gyp_binary) + + root_makefile.write( + "quiet_cmd_regen_makefile = ACTION Regenerating $@\n" + "cmd_regen_makefile = cd $(srcdir); %(cmd)s\n" + "%(makefile_name)s: %(deps)s\n" + "\t$(call do_cmd,regen_makefile)\n\n" + % { + "makefile_name": makefile_name, + "deps": replace_sep( + " ".join(sorted(SourceifyAndQuoteSpaces(bf) for bf in build_files)) + ), + "cmd": replace_sep( + gyp.common.EncodePOSIXShellList( + [gyp_binary, "-fmake"] + + gyp.RegenerateFlags(options) + + build_files_args + ) + ), + } + ) + + +def PerformBuild(data, configurations, params): + options = params["options"] + for config in configurations: + arguments = ["make"] + if options.toplevel_dir and options.toplevel_dir != ".": + arguments += "-C", options.toplevel_dir + arguments.append("BUILDTYPE=" + config) + print(f"Building [{config}]: {arguments}") + subprocess.check_call(arguments) + + +def GenerateOutput(target_list, target_dicts, data, params): + options = params["options"] + flavor = gyp.common.GetFlavor(params) + generator_flags = params.get("generator_flags", {}) + builddir_name = generator_flags.get("output_dir", "out") + android_ndk_version = generator_flags.get("android_ndk_version", None) + default_target = generator_flags.get("default_target", "all") + + def CalculateMakefilePath(build_file, base_name): + """Determine where to write a Makefile for a given gyp file.""" + # Paths in gyp files are relative to the .gyp file, but we want + # paths relative to the source root for the master makefile. Grab + # the path of the .gyp file as the base to relativize against. + # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". + base_path = gyp.common.RelativePath(os.path.dirname(build_file), options.depth) + # We write the file in the base_path directory. + output_file = os.path.join(options.depth, base_path, base_name) + if options.generator_output: + output_file = os.path.join( + options.depth, options.generator_output, base_path, base_name + ) + base_path = gyp.common.RelativePath( + os.path.dirname(build_file), options.toplevel_dir + ) + return base_path, output_file + + # TODO: search for the first non-'Default' target. This can go + # away when we add verification that all targets have the + # necessary configurations. + default_configuration = None + toolsets = {target_dicts[target]["toolset"] for target in target_list} + for target in target_list: + spec = target_dicts[target] + if spec["default_configuration"] != "Default": + default_configuration = spec["default_configuration"] + break + if not default_configuration: + default_configuration = "Default" + + srcdir = "." + makefile_name = "Makefile" + options.suffix + makefile_path = os.path.join(options.toplevel_dir, makefile_name) + if options.generator_output: + global srcdir_prefix + makefile_path = os.path.join( + options.toplevel_dir, options.generator_output, makefile_name + ) + srcdir = replace_sep(gyp.common.RelativePath(srcdir, options.generator_output)) + srcdir_prefix = "$(srcdir)/" + + flock_command = "flock" + copy_archive_arguments = "-af" + makedep_arguments = "-MMD" + + # wasm-ld doesn't support --start-group/--end-group + link_commands = LINK_COMMANDS_LINUX + if flavor in ["wasi", "wasm"]: + link_commands = link_commands.replace(" -Wl,--start-group", "").replace( + " -Wl,--end-group", "" + ) + + CC_target = replace_sep(GetEnvironFallback(("CC_target", "CC"), "$(CC)")) + AR_target = replace_sep(GetEnvironFallback(("AR_target", "AR"), "$(AR)")) + CXX_target = replace_sep(GetEnvironFallback(("CXX_target", "CXX"), "$(CXX)")) + LINK_target = replace_sep(GetEnvironFallback(("LINK_target", "LINK"), "$(LINK)")) + PLI_target = replace_sep(GetEnvironFallback(("PLI_target", "PLI"), "pli")) + CC_host = replace_sep(GetEnvironFallback(("CC_host", "CC"), "gcc")) + AR_host = replace_sep(GetEnvironFallback(("AR_host", "AR"), "ar")) + CXX_host = replace_sep(GetEnvironFallback(("CXX_host", "CXX"), "g++")) + LINK_host = replace_sep(GetEnvironFallback(("LINK_host", "LINK"), "$(CXX.host)")) + PLI_host = replace_sep(GetEnvironFallback(("PLI_host", "PLI"), "pli")) + + header_params = { + "default_target": default_target, + "builddir": builddir_name, + "default_configuration": default_configuration, + "flock": flock_command, + "flock_index": 1, + "link_commands": link_commands, + "extra_commands": "", + "srcdir": srcdir, + "copy_archive_args": copy_archive_arguments, + "makedep_args": makedep_arguments, + "CC.target": CC_target, + "AR.target": AR_target, + "CXX.target": CXX_target, + "LINK.target": LINK_target, + "PLI.target": PLI_target, + "CC.host": CC_host, + "AR.host": AR_host, + "CXX.host": CXX_host, + "LINK.host": LINK_host, + "PLI.host": PLI_host, + } + if flavor == "mac": + flock_command = "%s gyp-mac-tool flock" % sys.executable + header_params.update( + { + "flock": flock_command, + "flock_index": 2, + "link_commands": LINK_COMMANDS_MAC, + "extra_commands": SHARED_HEADER_MAC_COMMANDS, + } + ) + elif flavor == "android": + header_params.update({"link_commands": LINK_COMMANDS_ANDROID}) + elif flavor == "zos": + copy_archive_arguments = "-fPR" + CC_target = GetEnvironFallback(("CC_target", "CC"), "njsc") + makedep_arguments = "-MMD" + if CC_target == "clang": + CC_host = GetEnvironFallback(("CC_host", "CC"), "clang") + CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "clang++") + CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "clang++") + elif CC_target == "ibm-clang64": + CC_host = GetEnvironFallback(("CC_host", "CC"), "ibm-clang64") + CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "ibm-clang++64") + CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "ibm-clang++64") + elif CC_target == "ibm-clang": + CC_host = GetEnvironFallback(("CC_host", "CC"), "ibm-clang") + CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "ibm-clang++") + CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "ibm-clang++") + else: + # Node.js versions prior to v18: + makedep_arguments = "-qmakedep=gcc" + CC_host = GetEnvironFallback(("CC_host", "CC"), "njsc") + CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "njsc++") + CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "njsc++") + header_params.update( + { + "copy_archive_args": copy_archive_arguments, + "makedep_args": makedep_arguments, + "link_commands": LINK_COMMANDS_OS390, + "extra_commands": SHARED_HEADER_OS390_COMMANDS, + "CC.target": CC_target, + "CXX.target": CXX_target, + "CC.host": CC_host, + "CXX.host": CXX_host, + } + ) + elif flavor == "solaris": + copy_archive_arguments = "-pPRf@" + header_params.update( + { + "copy_archive_args": copy_archive_arguments, + "flock": "%s gyp-flock-tool flock" % sys.executable, + "flock_index": 2, + } + ) + elif flavor == "freebsd": + # Note: OpenBSD has sysutils/flock. lockf seems to be FreeBSD specific. + header_params.update({"flock": "lockf"}) + elif flavor == "openbsd": + copy_archive_arguments = "-pPRf" + header_params.update({"copy_archive_args": copy_archive_arguments}) + elif flavor == "aix": + copy_archive_arguments = "-pPRf" + header_params.update( + { + "copy_archive_args": copy_archive_arguments, + "link_commands": LINK_COMMANDS_AIX, + "flock": "%s gyp-flock-tool flock" % sys.executable, + "flock_index": 2, + } + ) + elif flavor == "os400": + copy_archive_arguments = "-pPRf" + header_params.update( + { + "copy_archive_args": copy_archive_arguments, + "link_commands": LINK_COMMANDS_OS400, + "flock": "%s gyp-flock-tool flock" % sys.executable, + "flock_index": 2, + } + ) + + build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) + make_global_settings_array = data[build_file].get("make_global_settings", []) + wrappers = {} + for key, value in make_global_settings_array: + if key.endswith("_wrapper"): + wrappers[key[: -len("_wrapper")]] = "$(abspath %s)" % value + make_global_settings = "" + for key, value in make_global_settings_array: + if re.match(".*_wrapper", key): + continue + if value[0] != "$": + value = "$(abspath %s)" % value + wrapper = wrappers.get(key) + if wrapper: + value = f"{wrapper} {value}" + del wrappers[key] + if key in ("CC", "CC.host", "CXX", "CXX.host"): + make_global_settings += ( + "ifneq (,$(filter $(origin %s), undefined default))\n" % key + ) + # Let gyp-time envvars win over global settings. + env_key = key.replace(".", "_") # CC.host -> CC_host + if env_key in os.environ: + value = os.environ[env_key] + make_global_settings += f" {key} = {value}\n" + make_global_settings += "endif\n" + else: + make_global_settings += f"{key} ?= {value}\n" + # TODO(ukai): define cmd when only wrapper is specified in + # make_global_settings. + + header_params["make_global_settings"] = make_global_settings + + gyp.common.EnsureDirExists(makefile_path) + root_makefile = open(makefile_path, "w") + root_makefile.write(SHARED_HEADER % header_params) + # Currently any versions have the same effect, but in future the behavior + # could be different. + if android_ndk_version: + root_makefile.write( + "# Define LOCAL_PATH for build of Android applications.\n" + "LOCAL_PATH := $(call my-dir)\n" + "\n" + ) + for toolset in toolsets: + root_makefile.write("TOOLSET := %s\n" % toolset) + WriteRootHeaderSuffixRules(root_makefile) + + # Put build-time support tools next to the root Makefile. + dest_path = os.path.dirname(makefile_path) + gyp.common.CopyTool(flavor, dest_path) + + # Find the list of targets that derive from the gyp file(s) being built. + needed_targets = set() + for build_file in params["build_files"]: + for target in gyp.common.AllTargets(target_list, target_dicts, build_file): + needed_targets.add(target) + + build_files = set() + include_list = set() + for qualified_target in target_list: + build_file, target, toolset = gyp.common.ParseQualifiedTarget(qualified_target) + + this_make_global_settings = data[build_file].get("make_global_settings", []) + assert make_global_settings_array == this_make_global_settings, ( + "make_global_settings needs to be the same for all targets " + f"{this_make_global_settings} vs. {make_global_settings}" + ) + + build_files.add(gyp.common.RelativePath(build_file, options.toplevel_dir)) + included_files = data[build_file]["included_files"] + for included_file in included_files: + # The included_files entries are relative to the dir of the build file + # that included them, so we have to undo that and then make them relative + # to the root dir. + relative_include_file = gyp.common.RelativePath( + gyp.common.UnrelativePath(included_file, build_file), + options.toplevel_dir, + ) + abs_include_file = os.path.abspath(relative_include_file) + # If the include file is from the ~/.gyp dir, we should use absolute path + # so that relocating the src dir doesn't break the path. + if params["home_dot_gyp"] and abs_include_file.startswith( + params["home_dot_gyp"] + ): + build_files.add(abs_include_file) + else: + build_files.add(relative_include_file) + + base_path, output_file = CalculateMakefilePath( + build_file, target + "." + toolset + options.suffix + ".mk" + ) + + spec = target_dicts[qualified_target] + configs = spec["configurations"] + + if flavor == "mac": + gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) + + writer = MakefileWriter(generator_flags, flavor) + writer.Write( + qualified_target, + base_path, + output_file, + spec, + configs, + part_of_all=qualified_target in needed_targets, + ) + + # Our root_makefile lives at the source root. Compute the relative path + # from there to the output_file for including. + mkfile_rel_path = gyp.common.RelativePath( + output_file, os.path.dirname(makefile_path) + ) + include_list.add(mkfile_rel_path) + + # Write out per-gyp (sub-project) Makefiles. + depth_rel_path = gyp.common.RelativePath(options.depth, os.getcwd()) + for build_file in build_files: + # The paths in build_files were relativized above, so undo that before + # testing against the non-relativized items in target_list and before + # calculating the Makefile path. + build_file = os.path.join(depth_rel_path, build_file) + gyp_targets = [ + target_dicts[qualified_target]["target_name"] + for qualified_target in target_list + if qualified_target.startswith(build_file) + and qualified_target in needed_targets + ] + # Only generate Makefiles for gyp files with targets. + if not gyp_targets: + continue + base_path, output_file = CalculateMakefilePath( + build_file, os.path.splitext(os.path.basename(build_file))[0] + ".Makefile" + ) + makefile_rel_path = gyp.common.RelativePath( + os.path.dirname(makefile_path), os.path.dirname(output_file) + ) + writer.WriteSubMake(output_file, makefile_rel_path, gyp_targets, builddir_name) + + # Write out the sorted list of includes. + root_makefile.write("\n") + for include_file in sorted(include_list): + # We wrap each .mk include in an if statement so users can tell make to + # not load a file by setting NO_LOAD. The below make code says, only + # load the .mk file if the .mk filename doesn't start with a token in + # NO_LOAD. + root_makefile.write( + "ifeq ($(strip $(foreach prefix,$(NO_LOAD),\\\n" + " $(findstring $(join ^,$(prefix)),\\\n" + " $(join ^," + include_file + ")))),)\n" + ) + root_makefile.write(" include " + include_file + "\n") + root_makefile.write("endif\n") + root_makefile.write("\n") + + if not generator_flags.get("standalone") and generator_flags.get( + "auto_regeneration", True + ): + WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) + + root_makefile.write(SHARED_FOOTER) + + root_makefile.close() diff --git a/.pnpm-store/v11/files/4f/70f339e99e56133fc9427904a5b3913836a41bc60148f745df01c0ad69ee71771d05ae3f1710e1dafa2c453c25c83994e7eb8aa2b2c0a7b1504e3e239f7086 b/.pnpm-store/v11/files/4f/70f339e99e56133fc9427904a5b3913836a41bc60148f745df01c0ad69ee71771d05ae3f1710e1dafa2c453c25c83994e7eb8aa2b2c0a7b1504e3e239f7086 new file mode 100644 index 0000000000..9149f404a5 --- /dev/null +++ b/.pnpm-store/v11/files/4f/70f339e99e56133fc9427904a5b3913836a41bc60148f745df01c0ad69ee71771d05ae3f1710e1dafa2c453c25c83994e7eb8aa2b2c0a7b1504e3e239f7086 @@ -0,0 +1,365 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""New implementation of Visual Studio project generation.""" + +import hashlib +import os +import random +from operator import attrgetter + +import gyp.common + + +def cmp(x, y): + return (x > y) - (x < y) + + +# Initialize random number generator +random.seed() + +# GUIDs for project types +ENTRY_TYPE_GUIDS = { + "project": "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}", + "folder": "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", +} + +# ------------------------------------------------------------------------------ +# Helper functions + + +def MakeGuid(name, seed="msvs_new"): + """Returns a GUID for the specified target name. + + Args: + name: Target name. + seed: Seed for SHA-256 hash. + Returns: + A GUID-line string calculated from the name and seed. + + This generates something which looks like a GUID, but depends only on the + name and seed. This means the same name/seed will always generate the same + GUID, so that projects and solutions which refer to each other can explicitly + determine the GUID to refer to explicitly. It also means that the GUID will + not change when the project for a target is rebuilt. + """ + # Calculate a SHA-256 signature for the seed and name. + d = hashlib.sha256((str(seed) + str(name)).encode("utf-8")).hexdigest().upper() + # Convert most of the signature to GUID form (discard the rest) + guid = ( + "{" + + d[:8] + + "-" + + d[8:12] + + "-" + + d[12:16] + + "-" + + d[16:20] + + "-" + + d[20:32] + + "}" + ) + return guid + + +# ------------------------------------------------------------------------------ + + +class MSVSSolutionEntry: + def __cmp__(self, other): + # Sort by name then guid (so things are in order on vs2008). + return cmp((self.name, self.get_guid()), (other.name, other.get_guid())) + + +class MSVSFolder(MSVSSolutionEntry): + """Folder in a Visual Studio project or solution.""" + + def __init__(self, path, name=None, entries=None, guid=None, items=None): + """Initializes the folder. + + Args: + path: Full path to the folder. + name: Name of the folder. + entries: List of folder entries to nest inside this folder. May contain + Folder or Project objects. May be None, if the folder is empty. + guid: GUID to use for folder, if not None. + items: List of solution items to include in the folder project. May be + None, if the folder does not directly contain items. + """ + if name: + self.name = name + else: + # Use last layer. + self.name = os.path.basename(path) + + self.path = path + self.guid = guid + + # Copy passed lists (or set to empty lists) + self.entries = sorted(entries or [], key=attrgetter("path")) + self.items = list(items or []) + + self.entry_type_guid = ENTRY_TYPE_GUIDS["folder"] + + def get_guid(self): + if self.guid is None: + # Use consistent guids for folders (so things don't regenerate). + self.guid = MakeGuid(self.path, seed="msvs_folder") + return self.guid + + +# ------------------------------------------------------------------------------ + + +class MSVSProject(MSVSSolutionEntry): + """Visual Studio project.""" + + def __init__( + self, + path, + name=None, + dependencies=None, + guid=None, + spec=None, + build_file=None, + config_platform_overrides=None, + fixpath_prefix=None, + ): + """Initializes the project. + + Args: + path: Absolute path to the project file. + name: Name of project. If None, the name will be the same as the base + name of the project file. + dependencies: List of other Project objects this project is dependent + upon, if not None. + guid: GUID to use for project, if not None. + spec: Dictionary specifying how to build this project. + build_file: Filename of the .gyp file that the vcproj file comes from. + config_platform_overrides: optional dict of configuration platforms to + used in place of the default for this target. + fixpath_prefix: the path used to adjust the behavior of _fixpath + """ + self.path = path + self.guid = guid + self.spec = spec + self.build_file = build_file + # Use project filename if name not specified + self.name = name or os.path.splitext(os.path.basename(path))[0] + + # Copy passed lists (or set to empty lists) + self.dependencies = list(dependencies or []) + + self.entry_type_guid = ENTRY_TYPE_GUIDS["project"] + + if config_platform_overrides: + self.config_platform_overrides = config_platform_overrides + else: + self.config_platform_overrides = {} + self.fixpath_prefix = fixpath_prefix + self.msbuild_toolset = None + + def set_dependencies(self, dependencies): + self.dependencies = list(dependencies or []) + + def get_guid(self): + if self.guid is None: + # Set GUID from path + # TODO(rspangler): This is fragile. + # 1. We can't just use the project filename sans path, since there could + # be multiple projects with the same base name (for example, + # foo/unittest.vcproj and bar/unittest.vcproj). + # 2. The path needs to be relative to $SOURCE_ROOT, so that the project + # GUID is the same whether it's included from base/base.sln or + # foo/bar/baz/baz.sln. + # 3. The GUID needs to be the same each time this builder is invoked, so + # that we don't need to rebuild the solution when the project changes. + # 4. We should be able to handle pre-built project files by reading the + # GUID from the files. + self.guid = MakeGuid(self.name) + return self.guid + + def set_msbuild_toolset(self, msbuild_toolset): + self.msbuild_toolset = msbuild_toolset + + +# ------------------------------------------------------------------------------ + + +class MSVSSolution: + """Visual Studio solution.""" + + def __init__( + self, path, version, entries=None, variants=None, websiteProperties=True + ): + """Initializes the solution. + + Args: + path: Path to solution file. + version: Format version to emit. + entries: List of entries in solution. May contain Folder or Project + objects. May be None, if the folder is empty. + variants: List of build variant strings. If none, a default list will + be used. + websiteProperties: Flag to decide if the website properties section + is generated. + """ + self.path = path + self.websiteProperties = websiteProperties + self.version = version + + # Copy passed lists (or set to empty lists) + self.entries = list(entries or []) + + if variants: + # Copy passed list + self.variants = variants[:] + else: + # Use default + self.variants = ["Debug|Win32", "Release|Win32"] + # TODO(rspangler): Need to be able to handle a mapping of solution config + # to project config. Should we be able to handle variants being a dict, + # or add a separate variant_map variable? If it's a dict, we can't + # guarantee the order of variants since dict keys aren't ordered. + + # TODO(rspangler): Automatically write to disk for now; should delay until + # node-evaluation time. + self.Write() + + def Write(self, writer=gyp.common.WriteOnDiff): + """Writes the solution file to disk. + + Raises: + IndexError: An entry appears multiple times. + """ + # Walk the entry tree and collect all the folders and projects. + all_entries = set() + entries_to_check = self.entries[:] + while entries_to_check: + e = entries_to_check.pop(0) + + # If this entry has been visited, nothing to do. + if e in all_entries: + continue + + all_entries.add(e) + + # If this is a folder, check its entries too. + if isinstance(e, MSVSFolder): + entries_to_check += e.entries + + all_entries = sorted(all_entries, key=attrgetter("path")) + + # Open file and print header + f = writer(self.path) + f.write( + "Microsoft Visual Studio Solution File, " + "Format Version %s\r\n" % self.version.SolutionVersion() + ) + f.write("# %s\r\n" % self.version.Description()) + + # Project entries + sln_root = os.path.split(self.path)[0] + for e in all_entries: + relative_path = gyp.common.RelativePath(e.path, sln_root) + # msbuild does not accept an empty folder_name. + # use '.' in case relative_path is empty. + folder_name = relative_path.replace("/", "\\") or "." + f.write( + 'Project("%s") = "%s", "%s", "%s"\r\n' + % ( + e.entry_type_guid, # Entry type GUID + e.name, # Folder name + folder_name, # Folder name (again) + e.get_guid(), # Entry GUID + ) + ) + + # TODO(rspangler): Need a way to configure this stuff + if self.websiteProperties: + f.write( + "\tProjectSection(WebsiteProperties) = preProject\r\n" + '\t\tDebug.AspNetCompiler.Debug = "True"\r\n' + '\t\tRelease.AspNetCompiler.Debug = "False"\r\n' + "\tEndProjectSection\r\n" + ) + + if isinstance(e, MSVSFolder) and e.items: + f.write("\tProjectSection(SolutionItems) = preProject\r\n") + for i in e.items: + f.write(f"\t\t{i} = {i}\r\n") + f.write("\tEndProjectSection\r\n") + + if isinstance(e, MSVSProject) and e.dependencies: + f.write("\tProjectSection(ProjectDependencies) = postProject\r\n") + for d in e.dependencies: + f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n") + f.write("\tEndProjectSection\r\n") + + f.write("EndProject\r\n") + + # Global section + f.write("Global\r\n") + + # Configurations (variants) + f.write("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n") + for v in self.variants: + f.write(f"\t\t{v} = {v}\r\n") + f.write("\tEndGlobalSection\r\n") + + # Sort config guids for easier diffing of solution changes. + config_guids = [] + config_guids_overrides = {} + for e in all_entries: + if isinstance(e, MSVSProject): + config_guids.append(e.get_guid()) + config_guids_overrides[e.get_guid()] = e.config_platform_overrides + config_guids.sort() + + f.write("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n") + for g in config_guids: + for v in self.variants: + nv = config_guids_overrides[g].get(v, v) + # Pick which project configuration to build for this solution + # configuration. + f.write( + "\t\t%s.%s.ActiveCfg = %s\r\n" + % ( + g, # Project GUID + v, # Solution build configuration + nv, # Project build config for that solution config + ) + ) + + # Enable project in this solution configuration. + f.write( + "\t\t%s.%s.Build.0 = %s\r\n" + % ( + g, # Project GUID + v, # Solution build configuration + nv, # Project build config for that solution config + ) + ) + f.write("\tEndGlobalSection\r\n") + + # TODO(rspangler): Should be able to configure this stuff too (though I've + # never seen this be any different) + f.write("\tGlobalSection(SolutionProperties) = preSolution\r\n") + f.write("\t\tHideSolutionNode = FALSE\r\n") + f.write("\tEndGlobalSection\r\n") + + # Folder mappings + # Omit this section if there are no folders + if any(e.entries for e in all_entries if isinstance(e, MSVSFolder)): + f.write("\tGlobalSection(NestedProjects) = preSolution\r\n") + for e in all_entries: + if not isinstance(e, MSVSFolder): + continue # Does not apply to projects, only folders + for subentry in e.entries: + f.write(f"\t\t{subentry.get_guid()} = {e.get_guid()}\r\n") + f.write("\tEndGlobalSection\r\n") + + f.write("EndGlobal\r\n") + + f.close() diff --git a/.pnpm-store/v11/files/4f/cfd395f230d13cad1a7f525d1e9a9ea85b5da43d656fa0903b408d4865813e99e2be02527ff5d196c3b5ffe045ae0563e46ffb9b1886ae2a0f494879857d5c b/.pnpm-store/v11/files/4f/cfd395f230d13cad1a7f525d1e9a9ea85b5da43d656fa0903b408d4865813e99e2be02527ff5d196c3b5ffe045ae0563e46ffb9b1886ae2a0f494879857d5c new file mode 100644 index 0000000000..907193a4b9 --- /dev/null +++ b/.pnpm-store/v11/files/4f/cfd395f230d13cad1a7f525d1e9a9ea85b5da43d656fa0903b408d4865813e99e2be02527ff5d196c3b5ffe045ae0563e46ffb9b1886ae2a0f494879857d5c @@ -0,0 +1,178 @@ +import { basename } from 'node:path'; +import { Header } from './header.js'; +export class Pax { + atime; + mtime; + ctime; + charset; + comment; + gid; + uid; + gname; + uname; + linkpath; + dev; + ino; + nlink; + path; + size; + mode; + global; + constructor(obj, global = false) { + this.atime = obj.atime; + this.charset = obj.charset; + this.comment = obj.comment; + this.ctime = obj.ctime; + this.dev = obj.dev; + this.gid = obj.gid; + this.global = global; + this.gname = obj.gname; + this.ino = obj.ino; + this.linkpath = obj.linkpath; + this.mtime = obj.mtime; + this.nlink = obj.nlink; + this.path = obj.path; + this.size = obj.size; + this.uid = obj.uid; + this.uname = obj.uname; + } + encode() { + const body = this.encodeBody(); + if (body === '') { + return Buffer.allocUnsafe(0); + } + const bodyLen = Buffer.byteLength(body); + // round up to 512 bytes + // add 512 for header + const bufLen = 512 * Math.ceil(1 + bodyLen / 512); + const buf = Buffer.allocUnsafe(bufLen); + // 0-fill the header section, it might not hit every field + for (let i = 0; i < 512; i++) { + buf[i] = 0; + } + new Header({ + // XXX split the path + // then the path should be PaxHeader + basename, but less than 99, + // prepend with the dirname + /* c8 ignore start */ + path: ('PaxHeader/' + basename(this.path ?? '')).slice(0, 99), + /* c8 ignore stop */ + mode: this.mode || 0o644, + uid: this.uid, + gid: this.gid, + size: bodyLen, + mtime: this.mtime, + type: this.global ? 'GlobalExtendedHeader' : 'ExtendedHeader', + linkpath: '', + uname: this.uname || '', + gname: this.gname || '', + devmaj: 0, + devmin: 0, + atime: this.atime, + ctime: this.ctime, + }).encode(buf); + buf.write(body, 512, bodyLen, 'utf8'); + // null pad after the body + for (let i = bodyLen + 512; i < buf.length; i++) { + buf[i] = 0; + } + return buf; + } + encodeBody() { + return (this.encodeField('path') + + this.encodeField('ctime') + + this.encodeField('atime') + + this.encodeField('dev') + + this.encodeField('ino') + + this.encodeField('nlink') + + this.encodeField('charset') + + this.encodeField('comment') + + this.encodeField('gid') + + this.encodeField('gname') + + this.encodeField('linkpath') + + this.encodeField('mtime') + + this.encodeField('size') + + this.encodeField('uid') + + this.encodeField('uname')); + } + encodeField(field) { + if (this[field] === undefined) { + return ''; + } + const r = this[field]; + const v = r instanceof Date ? r.getTime() / 1000 : r; + const s = ' ' + + (field === 'dev' || field === 'ino' || field === 'nlink' ? + 'SCHILY.' + : '') + + field + + '=' + + v + + '\n'; + const byteLen = Buffer.byteLength(s); + // the digits includes the length of the digits in ascii base-10 + // so if it's 9 characters, then adding 1 for the 9 makes it 10 + // which makes it 11 chars. + let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1; + if (byteLen + digits >= Math.pow(10, digits)) { + digits += 1; + } + const len = digits + byteLen; + return len + s; + } + static parse(str, ex, g = false) { + return new Pax(merge(parseKV(str), ex), g); + } +} +const merge = (a, b) => b ? Object.assign({}, b, a) : a; +const parseKV = (str) => str + .replace(/\n$/, '') + .split('\n') + .reduce(parseKVLine, Object.create(null)); +const parseKVLine = (set, line) => { + const n = parseInt(line, 10); + // XXX Values with \n in them will fail this. + // Refactor to not be a naive line-by-line parse. + if (n !== Buffer.byteLength(line) + 1) { + return set; + } + line = line.slice((n + ' ').length); + const kv = line.split('='); + const r = kv.shift(); + if (!r) { + return set; + } + const k = r.replace(/^SCHILY\.(dev|ino|nlink)/, '$1'); + const v = kv.join('=').replace(/\0.*/, ''); + switch (k) { + case 'path': + case 'linkpath': + case 'type': + case 'charset': + case 'comment': + case 'gname': + case 'uname': + set[k] = v; + break; + case 'ctime': + case 'atime': + case 'mtime': + set[k] = new Date(Number(v) * 1000); + break; + case 'size': + const s = +v; + if (s >= 0) + set[k] = s; + break; + case 'gid': + case 'uid': + case 'dev': + case 'ino': + case 'nlink': + case 'mode': + set[k] = +v; + break; + } + return set; +}; +//# sourceMappingURL=pax.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/51/b24ead7ef02741924aa9dabb59f924fae8aceb0f5e7fff24ba0ff843dd20c5bc7ff718f410082929bb4383383d04b4a652e140763ac1b68c01d89ed3e590f6 b/.pnpm-store/v11/files/51/b24ead7ef02741924aa9dabb59f924fae8aceb0f5e7fff24ba0ff843dd20c5bc7ff718f410082929bb4383383d04b4a652e140763ac1b68c01d89ed3e590f6 new file mode 100644 index 0000000000..4be46a9067 --- /dev/null +++ b/.pnpm-store/v11/files/51/b24ead7ef02741924aa9dabb59f924fae8aceb0f5e7fff24ba0ff843dd20c5bc7ff718f410082929bb4383383d04b4a652e140763ac1b68c01d89ed3e590f6 @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Coveo Solutions Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/.pnpm-store/v11/files/52/0b60d1f4aa0359144dca93a2c43c0477288deeb53e2e06121d3c57b75a580b28e2efc61975a686574e43804fec035a006c62f70cb8ce8514c3bbf98bae9426 b/.pnpm-store/v11/files/52/0b60d1f4aa0359144dca93a2c43c0477288deeb53e2e06121d3c57b75a580b28e2efc61975a686574e43804fec035a006c62f70cb8ce8514c3bbf98bae9426 new file mode 100644 index 0000000000..01fe5ae383 --- /dev/null +++ b/.pnpm-store/v11/files/52/0b60d1f4aa0359144dca93a2c43c0477288deeb53e2e06121d3c57b75a580b28e2efc61975a686574e43804fec035a006c62f70cb8ce8514c3bbf98bae9426 @@ -0,0 +1,27 @@ +'use strict' + +const SemVer = require('../classes/semver') +const Range = require('../classes/range') + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} +module.exports = maxSatisfying diff --git a/.pnpm-store/v11/files/53/2dbe0120eef40b0cff6943461a28cb442cc4af05f00b7baa91865a02a6695534ea34abf5e0b70aa3f9608c4fe5c7005ebe398be423598a8feb2349a64a2ae5 b/.pnpm-store/v11/files/53/2dbe0120eef40b0cff6943461a28cb442cc4af05f00b7baa91865a02a6695534ea34abf5e0b70aa3f9608c4fe5c7005ebe398be423598a8feb2349a64a2ae5 new file mode 100644 index 0000000000..aa5e568ec2 --- /dev/null +++ b/.pnpm-store/v11/files/53/2dbe0120eef40b0cff6943461a28cb442cc4af05f00b7baa91865a02a6695534ea34abf5e0b70aa3f9608c4fe5c7005ebe398be423598a8feb2349a64a2ae5 @@ -0,0 +1,6 @@ +'use strict' + +const outside = require('./outside') +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr diff --git a/.pnpm-store/v11/files/53/4f34b75850cb0af205f32fed1a92f418b8147216ddae3f12fb8541b52bbe53136590e67f508d5ae285165dac58a2eb4993c2487ad901a38ac7fc7a48b85f9c b/.pnpm-store/v11/files/53/4f34b75850cb0af205f32fed1a92f418b8147216ddae3f12fb8541b52bbe53136590e67f508d5ae285165dac58a2eb4993c2487ad901a38ac7fc7a48b85f9c new file mode 100644 index 0000000000..0c7528fa65 --- /dev/null +++ b/.pnpm-store/v11/files/53/4f34b75850cb0af205f32fed1a92f418b8147216ddae3f12fb8541b52bbe53136590e67f508d5ae285165dac58a2eb4993c2487ad901a38ac7fc7a48b85f9c @@ -0,0 +1,32 @@ +'use strict' + +// We include a version number for the Dispatcher API. In case of breaking changes, +// this version number must be increased to avoid conflicts. +const globalDispatcher = Symbol.for('undici.globalDispatcher.1') +const { InvalidArgumentError } = require('./core/errors') +const Agent = require('./dispatcher/agent') + +if (getGlobalDispatcher() === undefined) { + setGlobalDispatcher(new Agent()) +} + +function setGlobalDispatcher (agent) { + if (!agent || typeof agent.dispatch !== 'function') { + throw new InvalidArgumentError('Argument agent must implement Agent') + } + Object.defineProperty(globalThis, globalDispatcher, { + value: agent, + writable: true, + enumerable: false, + configurable: false + }) +} + +function getGlobalDispatcher () { + return globalThis[globalDispatcher] +} + +module.exports = { + setGlobalDispatcher, + getGlobalDispatcher +} diff --git a/.pnpm-store/v11/files/53/9af313d7eb8eab08dec5be9da44a365f7e54349dc2eae0657060f3290e359af94193e665009770aa3ff156f58dd58c0847502b7004d670380b7b489ab5ede9 b/.pnpm-store/v11/files/53/9af313d7eb8eab08dec5be9da44a365f7e54349dc2eae0657060f3290e359af94193e665009770aa3ff156f58dd58c0847502b7004d670380b7b489ab5ede9 new file mode 100644 index 0000000000..bb7fdee44c --- /dev/null +++ b/.pnpm-store/v11/files/53/9af313d7eb8eab08dec5be9da44a365f7e54349dc2eae0657060f3290e359af94193e665009770aa3ff156f58dd58c0847502b7004d670380b7b489ab5ede9 @@ -0,0 +1,7 @@ +Copyright 2023 Abdullah Atta + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.pnpm-store/v11/files/54/22dd3ce62dc87e945909736a48244d2e8bd0034c9c9d5797b870f52ee5ec1f4c69dd33b55d8992cdb0e53342038f14df7200ea1ea40f45a2caf80bf2a0de7a b/.pnpm-store/v11/files/54/22dd3ce62dc87e945909736a48244d2e8bd0034c9c9d5797b870f52ee5ec1f4c69dd33b55d8992cdb0e53342038f14df7200ea1ea40f45a2caf80bf2a0de7a new file mode 100644 index 0000000000..16cee36bb5 --- /dev/null +++ b/.pnpm-store/v11/files/54/22dd3ce62dc87e945909736a48244d2e8bd0034c9c9d5797b870f52ee5ec1f4c69dd33b55d8992cdb0e53342038f14df7200ea1ea40f45a2caf80bf2a0de7a @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function fullJitter(delay) { + var jitteredDelay = Math.random() * delay; + return Math.round(jitteredDelay); +} +exports.fullJitter = fullJitter; +//# sourceMappingURL=full.jitter.js.map \ No newline at end of file diff --git a/.pnpm-store/v11/files/54/397c2f88a2440999bc2ffce86daef0b5a2657b1bafb23e5a81ebb655d8930c39dfaa4306ed6796f14bbce2391eccdec993b5cd853db58f9076f125296939bd b/.pnpm-store/v11/files/54/397c2f88a2440999bc2ffce86daef0b5a2657b1bafb23e5a81ebb655d8930c39dfaa4306ed6796f14bbce2391eccdec993b5cd853db58f9076f125296939bd new file mode 100644 index 0000000000..c2c2f75aa8 --- /dev/null +++ b/.pnpm-store/v11/files/54/397c2f88a2440999bc2ffce86daef0b5a2657b1bafb23e5a81ebb655d8930c39dfaa4306ed6796f14bbce2391eccdec993b5cd853db58f9076f125296939bd @@ -0,0 +1,172 @@ +# This file is dual licensed under the terms of the Apache License, Version +# 2.0, and the BSD License. See the LICENSE file in the root of this repository +# for complete details. + +import re +from typing import FrozenSet, NewType, Tuple, Union, cast + +from .tags import Tag, parse_tag +from .version import InvalidVersion, Version + +BuildTag = Union[Tuple[()], Tuple[int, str]] +NormalizedName = NewType("NormalizedName", str) + + +class InvalidName(ValueError): + """ + An invalid distribution name; users should refer to the packaging user guide. + """ + + +class InvalidWheelFilename(ValueError): + """ + An invalid wheel filename was found, users should refer to PEP 427. + """ + + +class InvalidSdistFilename(ValueError): + """ + An invalid sdist filename was found, users should refer to the packaging user guide. + """ + + +# Core metadata spec for `Name` +_validate_regex = re.compile( + r"^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$", re.IGNORECASE +) +_canonicalize_regex = re.compile(r"[-_.]+") +_normalized_regex = re.compile(r"^([a-z0-9]|[a-z0-9]([a-z0-9-](?!--))*[a-z0-9])$") +# PEP 427: The build number must start with a digit. +_build_tag_regex = re.compile(r"(\d+)(.*)") + + +def canonicalize_name(name: str, *, validate: bool = False) -> NormalizedName: + if validate and not _validate_regex.match(name): + raise InvalidName(f"name is invalid: {name!r}") + # This is taken from PEP 503. + value = _canonicalize_regex.sub("-", name).lower() + return cast(NormalizedName, value) + + +def is_normalized_name(name: str) -> bool: + return _normalized_regex.match(name) is not None + + +def canonicalize_version( + version: Union[Version, str], *, strip_trailing_zero: bool = True +) -> str: + """ + This is very similar to Version.__str__, but has one subtle difference + with the way it handles the release segment. + """ + if isinstance(version, str): + try: + parsed = Version(version) + except InvalidVersion: + # Legacy versions cannot be normalized + return version + else: + parsed = version + + parts = [] + + # Epoch + if parsed.epoch != 0: + parts.append(f"{parsed.epoch}!") + + # Release segment + release_segment = ".".join(str(x) for x in parsed.release) + if strip_trailing_zero: + # NB: This strips trailing '.0's to normalize + release_segment = re.sub(r"(\.0)+$", "", release_segment) + parts.append(release_segment) + + # Pre-release + if parsed.pre is not None: + parts.append("".join(str(x) for x in parsed.pre)) + + # Post-release + if parsed.post is not None: + parts.append(f".post{parsed.post}") + + # Development release + if parsed.dev is not None: + parts.append(f".dev{parsed.dev}") + + # Local version segment + if parsed.local is not None: + parts.append(f"+{parsed.local}") + + return "".join(parts) + + +def parse_wheel_filename( + filename: str, +) -> Tuple[NormalizedName, Version, BuildTag, FrozenSet[Tag]]: + if not filename.endswith(".whl"): + raise InvalidWheelFilename( + f"Invalid wheel filename (extension must be '.whl'): {filename}" + ) + + filename = filename[:-4] + dashes = filename.count("-") + if dashes not in (4, 5): + raise InvalidWheelFilename( + f"Invalid wheel filename (wrong number of parts): {filename}" + ) + + parts = filename.split("-", dashes - 2) + name_part = parts[0] + # See PEP 427 for the rules on escaping the project name. + if "__" in name_part or re.match(r"^[\w\d._]*$", name_part, re.UNICODE) is None: + raise InvalidWheelFilename(f"Invalid project name: {filename}") + name = canonicalize_name(name_part) + + try: + version = Version(parts[1]) + except InvalidVersion as e: + raise InvalidWheelFilename( + f"Invalid wheel filename (invalid version): {filename}" + ) from e + + if dashes == 5: + build_part = parts[2] + build_match = _build_tag_regex.match(build_part) + if build_match is None: + raise InvalidWheelFilename( + f"Invalid build number: {build_part} in '{filename}'" + ) + build = cast(BuildTag, (int(build_match.group(1)), build_match.group(2))) + else: + build = () + tags = parse_tag(parts[-1]) + return (name, version, build, tags) + + +def parse_sdist_filename(filename: str) -> Tuple[NormalizedName, Version]: + if filename.endswith(".tar.gz"): + file_stem = filename[: -len(".tar.gz")] + elif filename.endswith(".zip"): + file_stem = filename[: -len(".zip")] + else: + raise InvalidSdistFilename( + f"Invalid sdist filename (extension must be '.tar.gz' or '.zip'):" + f" {filename}" + ) + + # We are requiring a PEP 440 version, which cannot contain dashes, + # so we split on the last dash. + name_part, sep, version_part = file_stem.rpartition("-") + if not sep: + raise InvalidSdistFilename(f"Invalid sdist filename: {filename}") + + name = canonicalize_name(name_part) + + try: + version = Version(version_part) + except InvalidVersion as e: + raise InvalidSdistFilename( + f"Invalid sdist filename (invalid version): {filename}" + ) from e + + return (name, version) diff --git a/.pnpm-store/v11/files/54/55f32405783a564f794f5346e5d484166b60a21fd679acfe6b41ee8af059cffac857f90efe0164b81f3469e12df44713b90afc4ed75a149ae500dee3f86aa1 b/.pnpm-store/v11/files/54/55f32405783a564f794f5346e5d484166b60a21fd679acfe6b41ee8af059cffac857f90efe0164b81f3469e12df44713b90afc4ed75a149ae500dee3f86aa1 new file mode 100644 index 0000000000..5faab9bd0d --- /dev/null +++ b/.pnpm-store/v11/files/54/55f32405783a564f794f5346e5d484166b60a21fd679acfe6b41ee8af059cffac857f90efe0164b81f3469e12df44713b90afc4ed75a149ae500dee3f86aa1 @@ -0,0 +1,563 @@ +# This file is dual licensed under the terms of the Apache License, Version +# 2.0, and the BSD License. See the LICENSE file in the root of this repository +# for complete details. +""" +.. testsetup:: + + from packaging.version import parse, Version +""" + +import itertools +import re +from typing import Any, Callable, NamedTuple, Optional, SupportsInt, Tuple, Union + +from ._structures import Infinity, InfinityType, NegativeInfinity, NegativeInfinityType + +__all__ = ["VERSION_PATTERN", "parse", "Version", "InvalidVersion"] + +LocalType = Tuple[Union[int, str], ...] + +CmpPrePostDevType = Union[InfinityType, NegativeInfinityType, Tuple[str, int]] +CmpLocalType = Union[ + NegativeInfinityType, + Tuple[Union[Tuple[int, str], Tuple[NegativeInfinityType, Union[int, str]]], ...], +] +CmpKey = Tuple[ + int, + Tuple[int, ...], + CmpPrePostDevType, + CmpPrePostDevType, + CmpPrePostDevType, + CmpLocalType, +] +VersionComparisonMethod = Callable[[CmpKey, CmpKey], bool] + + +class _Version(NamedTuple): + epoch: int + release: Tuple[int, ...] + dev: Optional[Tuple[str, int]] + pre: Optional[Tuple[str, int]] + post: Optional[Tuple[str, int]] + local: Optional[LocalType] + + +def parse(version: str) -> "Version": + """Parse the given version string. + + >>> parse('1.0.dev1') + + + :param version: The version string to parse. + :raises InvalidVersion: When the version string is not a valid version. + """ + return Version(version) + + +class InvalidVersion(ValueError): + """Raised when a version string is not a valid version. + + >>> Version("invalid") + Traceback (most recent call last): + ... + packaging.version.InvalidVersion: Invalid version: 'invalid' + """ + + +class _BaseVersion: + _key: Tuple[Any, ...] + + def __hash__(self) -> int: + return hash(self._key) + + # Please keep the duplicated `isinstance` check + # in the six comparisons hereunder + # unless you find a way to avoid adding overhead function calls. + def __lt__(self, other: "_BaseVersion") -> bool: + if not isinstance(other, _BaseVersion): + return NotImplemented + + return self._key < other._key + + def __le__(self, other: "_BaseVersion") -> bool: + if not isinstance(other, _BaseVersion): + return NotImplemented + + return self._key <= other._key + + def __eq__(self, other: object) -> bool: + if not isinstance(other, _BaseVersion): + return NotImplemented + + return self._key == other._key + + def __ge__(self, other: "_BaseVersion") -> bool: + if not isinstance(other, _BaseVersion): + return NotImplemented + + return self._key >= other._key + + def __gt__(self, other: "_BaseVersion") -> bool: + if not isinstance(other, _BaseVersion): + return NotImplemented + + return self._key > other._key + + def __ne__(self, other: object) -> bool: + if not isinstance(other, _BaseVersion): + return NotImplemented + + return self._key != other._key + + +# Deliberately not anchored to the start and end of the string, to make it +# easier for 3rd party code to reuse +_VERSION_PATTERN = r""" + v? + (?: + (?:(?P[0-9]+)!)? # epoch + (?P[0-9]+(?:\.[0-9]+)*) # release segment + (?P
                                          # pre-release
+            [-_\.]?
+            (?Palpha|a|beta|b|preview|pre|c|rc)
+            [-_\.]?
+            (?P[0-9]+)?
+        )?
+        (?P                                         # post release
+            (?:-(?P[0-9]+))
+            |
+            (?:
+                [-_\.]?
+                (?Ppost|rev|r)
+                [-_\.]?
+                (?P[0-9]+)?
+            )
+        )?
+        (?P                                          # dev release
+            [-_\.]?
+            (?Pdev)
+            [-_\.]?
+            (?P[0-9]+)?
+        )?
+    )
+    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
+"""
+
+VERSION_PATTERN = _VERSION_PATTERN
+"""
+A string containing the regular expression used to match a valid version.
+
+The pattern is not anchored at either end, and is intended for embedding in larger
+expressions (for example, matching a version number as part of a file name). The
+regular expression should be compiled with the ``re.VERBOSE`` and ``re.IGNORECASE``
+flags set.
+
+:meta hide-value:
+"""
+
+
+class Version(_BaseVersion):
+    """This class abstracts handling of a project's versions.
+
+    A :class:`Version` instance is comparison aware and can be compared and
+    sorted using the standard Python interfaces.
+
+    >>> v1 = Version("1.0a5")
+    >>> v2 = Version("1.0")
+    >>> v1
+    
+    >>> v2
+    
+    >>> v1 < v2
+    True
+    >>> v1 == v2
+    False
+    >>> v1 > v2
+    False
+    >>> v1 >= v2
+    False
+    >>> v1 <= v2
+    True
+    """
+
+    _regex = re.compile(r"^\s*" + VERSION_PATTERN + r"\s*$", re.VERBOSE | re.IGNORECASE)
+    _key: CmpKey
+
+    def __init__(self, version: str) -> None:
+        """Initialize a Version object.
+
+        :param version:
+            The string representation of a version which will be parsed and normalized
+            before use.
+        :raises InvalidVersion:
+            If the ``version`` does not conform to PEP 440 in any way then this
+            exception will be raised.
+        """
+
+        # Validate the version and parse it into pieces
+        match = self._regex.search(version)
+        if not match:
+            raise InvalidVersion(f"Invalid version: '{version}'")
+
+        # Store the parsed out pieces of the version
+        self._version = _Version(
+            epoch=int(match.group("epoch")) if match.group("epoch") else 0,
+            release=tuple(int(i) for i in match.group("release").split(".")),
+            pre=_parse_letter_version(match.group("pre_l"), match.group("pre_n")),
+            post=_parse_letter_version(
+                match.group("post_l"), match.group("post_n1") or match.group("post_n2")
+            ),
+            dev=_parse_letter_version(match.group("dev_l"), match.group("dev_n")),
+            local=_parse_local_version(match.group("local")),
+        )
+
+        # Generate a key which will be used for sorting
+        self._key = _cmpkey(
+            self._version.epoch,
+            self._version.release,
+            self._version.pre,
+            self._version.post,
+            self._version.dev,
+            self._version.local,
+        )
+
+    def __repr__(self) -> str:
+        """A representation of the Version that shows all internal state.
+
+        >>> Version('1.0.0')
+        
+        """
+        return f""
+
+    def __str__(self) -> str:
+        """A string representation of the version that can be rounded-tripped.
+
+        >>> str(Version("1.0a5"))
+        '1.0a5'
+        """
+        parts = []
+
+        # Epoch
+        if self.epoch != 0:
+            parts.append(f"{self.epoch}!")
+
+        # Release segment
+        parts.append(".".join(str(x) for x in self.release))
+
+        # Pre-release
+        if self.pre is not None:
+            parts.append("".join(str(x) for x in self.pre))
+
+        # Post-release
+        if self.post is not None:
+            parts.append(f".post{self.post}")
+
+        # Development release
+        if self.dev is not None:
+            parts.append(f".dev{self.dev}")
+
+        # Local version segment
+        if self.local is not None:
+            parts.append(f"+{self.local}")
+
+        return "".join(parts)
+
+    @property
+    def epoch(self) -> int:
+        """The epoch of the version.
+
+        >>> Version("2.0.0").epoch
+        0
+        >>> Version("1!2.0.0").epoch
+        1
+        """
+        return self._version.epoch
+
+    @property
+    def release(self) -> Tuple[int, ...]:
+        """The components of the "release" segment of the version.
+
+        >>> Version("1.2.3").release
+        (1, 2, 3)
+        >>> Version("2.0.0").release
+        (2, 0, 0)
+        >>> Version("1!2.0.0.post0").release
+        (2, 0, 0)
+
+        Includes trailing zeroes but not the epoch or any pre-release / development /
+        post-release suffixes.
+        """
+        return self._version.release
+
+    @property
+    def pre(self) -> Optional[Tuple[str, int]]:
+        """The pre-release segment of the version.
+
+        >>> print(Version("1.2.3").pre)
+        None
+        >>> Version("1.2.3a1").pre
+        ('a', 1)
+        >>> Version("1.2.3b1").pre
+        ('b', 1)
+        >>> Version("1.2.3rc1").pre
+        ('rc', 1)
+        """
+        return self._version.pre
+
+    @property
+    def post(self) -> Optional[int]:
+        """The post-release number of the version.
+
+        >>> print(Version("1.2.3").post)
+        None
+        >>> Version("1.2.3.post1").post
+        1
+        """
+        return self._version.post[1] if self._version.post else None
+
+    @property
+    def dev(self) -> Optional[int]:
+        """The development number of the version.
+
+        >>> print(Version("1.2.3").dev)
+        None
+        >>> Version("1.2.3.dev1").dev
+        1
+        """
+        return self._version.dev[1] if self._version.dev else None
+
+    @property
+    def local(self) -> Optional[str]:
+        """The local version segment of the version.
+
+        >>> print(Version("1.2.3").local)
+        None
+        >>> Version("1.2.3+abc").local
+        'abc'
+        """
+        if self._version.local:
+            return ".".join(str(x) for x in self._version.local)
+        else:
+            return None
+
+    @property
+    def public(self) -> str:
+        """The public portion of the version.
+
+        >>> Version("1.2.3").public
+        '1.2.3'
+        >>> Version("1.2.3+abc").public
+        '1.2.3'
+        >>> Version("1.2.3+abc.dev1").public
+        '1.2.3'
+        """
+        return str(self).split("+", 1)[0]
+
+    @property
+    def base_version(self) -> str:
+        """The "base version" of the version.
+
+        >>> Version("1.2.3").base_version
+        '1.2.3'
+        >>> Version("1.2.3+abc").base_version
+        '1.2.3'
+        >>> Version("1!1.2.3+abc.dev1").base_version
+        '1!1.2.3'
+
+        The "base version" is the public version of the project without any pre or post
+        release markers.
+        """
+        parts = []
+
+        # Epoch
+        if self.epoch != 0:
+            parts.append(f"{self.epoch}!")
+
+        # Release segment
+        parts.append(".".join(str(x) for x in self.release))
+
+        return "".join(parts)
+
+    @property
+    def is_prerelease(self) -> bool:
+        """Whether this version is a pre-release.
+
+        >>> Version("1.2.3").is_prerelease
+        False
+        >>> Version("1.2.3a1").is_prerelease
+        True
+        >>> Version("1.2.3b1").is_prerelease
+        True
+        >>> Version("1.2.3rc1").is_prerelease
+        True
+        >>> Version("1.2.3dev1").is_prerelease
+        True
+        """
+        return self.dev is not None or self.pre is not None
+
+    @property
+    def is_postrelease(self) -> bool:
+        """Whether this version is a post-release.
+
+        >>> Version("1.2.3").is_postrelease
+        False
+        >>> Version("1.2.3.post1").is_postrelease
+        True
+        """
+        return self.post is not None
+
+    @property
+    def is_devrelease(self) -> bool:
+        """Whether this version is a development release.
+
+        >>> Version("1.2.3").is_devrelease
+        False
+        >>> Version("1.2.3.dev1").is_devrelease
+        True
+        """
+        return self.dev is not None
+
+    @property
+    def major(self) -> int:
+        """The first item of :attr:`release` or ``0`` if unavailable.
+
+        >>> Version("1.2.3").major
+        1
+        """
+        return self.release[0] if len(self.release) >= 1 else 0
+
+    @property
+    def minor(self) -> int:
+        """The second item of :attr:`release` or ``0`` if unavailable.
+
+        >>> Version("1.2.3").minor
+        2
+        >>> Version("1").minor
+        0
+        """
+        return self.release[1] if len(self.release) >= 2 else 0
+
+    @property
+    def micro(self) -> int:
+        """The third item of :attr:`release` or ``0`` if unavailable.
+
+        >>> Version("1.2.3").micro
+        3
+        >>> Version("1").micro
+        0
+        """
+        return self.release[2] if len(self.release) >= 3 else 0
+
+
+def _parse_letter_version(
+    letter: Optional[str], number: Union[str, bytes, SupportsInt, None]
+) -> Optional[Tuple[str, int]]:
+
+    if letter:
+        # We consider there to be an implicit 0 in a pre-release if there is
+        # not a numeral associated with it.
+        if number is None:
+            number = 0
+
+        # We normalize any letters to their lower case form
+        letter = letter.lower()
+
+        # We consider some words to be alternate spellings of other words and
+        # in those cases we want to normalize the spellings to our preferred
+        # spelling.
+        if letter == "alpha":
+            letter = "a"
+        elif letter == "beta":
+            letter = "b"
+        elif letter in ["c", "pre", "preview"]:
+            letter = "rc"
+        elif letter in ["rev", "r"]:
+            letter = "post"
+
+        return letter, int(number)
+    if not letter and number:
+        # We assume if we are given a number, but we are not given a letter
+        # then this is using the implicit post release syntax (e.g. 1.0-1)
+        letter = "post"
+
+        return letter, int(number)
+
+    return None
+
+
+_local_version_separators = re.compile(r"[\._-]")
+
+
+def _parse_local_version(local: Optional[str]) -> Optional[LocalType]:
+    """
+    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
+    """
+    if local is not None:
+        return tuple(
+            part.lower() if not part.isdigit() else int(part)
+            for part in _local_version_separators.split(local)
+        )
+    return None
+
+
+def _cmpkey(
+    epoch: int,
+    release: Tuple[int, ...],
+    pre: Optional[Tuple[str, int]],
+    post: Optional[Tuple[str, int]],
+    dev: Optional[Tuple[str, int]],
+    local: Optional[LocalType],
+) -> CmpKey:
+
+    # When we compare a release version, we want to compare it with all of the
+    # trailing zeros removed. So we'll use a reverse the list, drop all the now
+    # leading zeros until we come to something non zero, then take the rest
+    # re-reverse it back into the correct order and make it a tuple and use
+    # that for our sorting key.
+    _release = tuple(
+        reversed(list(itertools.dropwhile(lambda x: x == 0, reversed(release))))
+    )
+
+    # We need to "trick" the sorting algorithm to put 1.0.dev0 before 1.0a0.
+    # We'll do this by abusing the pre segment, but we _only_ want to do this
+    # if there is not a pre or a post segment. If we have one of those then
+    # the normal sorting rules will handle this case correctly.
+    if pre is None and post is None and dev is not None:
+        _pre: CmpPrePostDevType = NegativeInfinity
+    # Versions without a pre-release (except as noted above) should sort after
+    # those with one.
+    elif pre is None:
+        _pre = Infinity
+    else:
+        _pre = pre
+
+    # Versions without a post segment should sort before those with one.
+    if post is None:
+        _post: CmpPrePostDevType = NegativeInfinity
+
+    else:
+        _post = post
+
+    # Versions without a development segment should sort after those with one.
+    if dev is None:
+        _dev: CmpPrePostDevType = Infinity
+
+    else:
+        _dev = dev
+
+    if local is None:
+        # Versions without a local segment should sort before those with one.
+        _local: CmpLocalType = NegativeInfinity
+    else:
+        # Versions with a local segment need that segment parsed to implement
+        # the sorting rules in PEP440.
+        # - Alpha numeric segments sort before numeric segments
+        # - Alpha numeric segments sort lexicographically
+        # - Numeric segments sort numerically
+        # - Shorter versions sort before longer versions when the prefixes
+        #   match exactly
+        _local = tuple(
+            (i, "") if isinstance(i, int) else (NegativeInfinity, i) for i in local
+        )
+
+    return epoch, _release, _pre, _post, _dev, _local
diff --git a/.pnpm-store/v11/files/56/eecd4b43f47db844fce4b4e8fbc168d847fdc6ec6a7464fd6e81c290f6263d53a989a69a856102a7d09c8b3392b30ee06a521ec11f1ec21a904105d640e951 b/.pnpm-store/v11/files/56/eecd4b43f47db844fce4b4e8fbc168d847fdc6ec6a7464fd6e81c290f6263d53a989a69a856102a7d09c8b3392b30ee06a521ec11f1ec21a904105d640e951
new file mode 100644
index 0000000000..8fa17f5b9c
--- /dev/null
+++ b/.pnpm-store/v11/files/56/eecd4b43f47db844fce4b4e8fbc168d847fdc6ec6a7464fd6e81c290f6263d53a989a69a856102a7d09c8b3392b30ee06a521ec11f1ec21a904105d640e951
@@ -0,0 +1,34 @@
+// warning: extremely hot code path.
+// This has been meticulously optimized for use
+// within npm install on large package trees.
+// Do not edit without careful benchmarking.
+const normalizeCache = Object.create(null);
+// Limit the size of this. Very low-sophistication LRU cache
+const MAX = 10000;
+const cache = new Set();
+export const normalizeUnicode = (s) => {
+    if (!cache.has(s)) {
+        // shake out identical accents and ligatures
+        normalizeCache[s] = s
+            .normalize('NFD')
+            .toLocaleLowerCase('en')
+            .toLocaleUpperCase('en');
+    }
+    else {
+        cache.delete(s);
+    }
+    cache.add(s);
+    const ret = normalizeCache[s];
+    let i = cache.size - MAX;
+    // only prune when we're 10% over the max
+    if (i > MAX / 10) {
+        for (const s of cache) {
+            cache.delete(s);
+            delete normalizeCache[s];
+            if (--i <= 0)
+                break;
+        }
+    }
+    return ret;
+};
+//# sourceMappingURL=normalize-unicode.js.map
\ No newline at end of file
diff --git a/.pnpm-store/v11/files/57/5c5c84367663d5dab2dba30aa52f652f0c6fb6b64aba0c3f6dc2202807cf585e04f541272e949ed9e8364451879d7c8369c5391abf9dd12e14f14430059033 b/.pnpm-store/v11/files/57/5c5c84367663d5dab2dba30aa52f652f0c6fb6b64aba0c3f6dc2202807cf585e04f541272e949ed9e8364451879d7c8369c5391abf9dd12e14f14430059033
new file mode 100644
index 0000000000..1ce09630d3
--- /dev/null
+++ b/.pnpm-store/v11/files/57/5c5c84367663d5dab2dba30aa52f652f0c6fb6b64aba0c3f6dc2202807cf585e04f541272e949ed9e8364451879d7c8369c5391abf9dd12e14f14430059033
@@ -0,0 +1,14 @@
+"use strict";
+// When writing files on Windows, translate the characters to their
+// 0xf000 higher-encoded versions.
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.decode = exports.encode = void 0;
+const raw = ['|', '<', '>', '?', ':'];
+const win = raw.map(char => String.fromCodePoint(0xf000 + Number(char.codePointAt(0))));
+const toWin = new Map(raw.map((char, i) => [char, win[i]]));
+const toRaw = new Map(win.map((char, i) => [char, raw[i]]));
+const encode = (s) => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s);
+exports.encode = encode;
+const decode = (s) => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s);
+exports.decode = decode;
+//# sourceMappingURL=winchars.js.map
\ No newline at end of file
diff --git a/.pnpm-store/v11/files/57/5ff593cc854bf92313dfc717c776f6b8ff325a578a173ed1b34709c8c0681a225acb90b64260ce060299f3ae8714558afa39828ef756ccd6d88ab5d5b2f9ee b/.pnpm-store/v11/files/57/5ff593cc854bf92313dfc717c776f6b8ff325a578a173ed1b34709c8c0681a225acb90b64260ce060299f3ae8714558afa39828ef756ccd6d88ab5d5b2f9ee
new file mode 100644
index 0000000000..c33a6a4c5e
--- /dev/null
+++ b/.pnpm-store/v11/files/57/5ff593cc854bf92313dfc717c776f6b8ff325a578a173ed1b34709c8c0681a225acb90b64260ce060299f3ae8714558afa39828ef756ccd6d88ab5d5b2f9ee
@@ -0,0 +1,65 @@
+export const isCode = (c) => name.has(c);
+export const isName = (c) => code.has(c);
+/**
+ * types that are a normal file system entry, not metadata.
+ *
+ * These can be the subject of extended/globalExtended headers, long path
+ * names, long linkpath names, etc.
+ *
+ * Any other types are meta, and cannot be targetted by extended PAX headers.
+ */
+export const normalFsTypes = new Set([
+    '0',
+    '',
+    '1',
+    '2',
+    '3',
+    '4',
+    '5',
+    '6',
+    '7',
+    'D',
+]);
+// map types from key to human-friendly name
+export const name = new Map([
+    ['0', 'File'],
+    // same as File
+    ['', 'OldFile'],
+    ['1', 'Link'],
+    ['2', 'SymbolicLink'],
+    // Devices and FIFOs aren't fully supported
+    // they are parsed, but skipped when unpacking
+    ['3', 'CharacterDevice'],
+    ['4', 'BlockDevice'],
+    ['5', 'Directory'],
+    ['6', 'FIFO'],
+    // same as File
+    ['7', 'ContiguousFile'],
+    // pax headers
+    ['g', 'GlobalExtendedHeader'],
+    ['x', 'ExtendedHeader'],
+    // vendor-specific stuff
+    // skip
+    ['A', 'SolarisACL'],
+    // like 5, but with data, which should be skipped
+    ['D', 'GNUDumpDir'],
+    // metadata only, skip
+    ['I', 'Inode'],
+    // data = link path of next file
+    ['K', 'NextFileHasLongLinkpath'],
+    // data = path of next file
+    ['L', 'NextFileHasLongPath'],
+    // skip
+    ['M', 'ContinuationFile'],
+    // like L
+    ['N', 'OldGnuLongPath'],
+    // skip
+    ['S', 'SparseFile'],
+    // skip
+    ['V', 'TapeVolumeHeader'],
+    // like x
+    ['X', 'OldExtendedHeader'],
+]);
+// map the other direction
+export const code = new Map(Array.from(name).map(kv => [kv[1], kv[0]]));
+//# sourceMappingURL=types.js.map
\ No newline at end of file
diff --git a/.pnpm-store/v11/files/57/fd42c80a8db172734ca9d270348eb29825e52efb0619d53149084d6cd8cdbce8159abc2f89a3bc127aa7be44e223bcf1f43dd0f4b0de607dec2e80b1b5a1e4 b/.pnpm-store/v11/files/57/fd42c80a8db172734ca9d270348eb29825e52efb0619d53149084d6cd8cdbce8159abc2f89a3bc127aa7be44e223bcf1f43dd0f4b0de607dec2e80b1b5a1e4
new file mode 100644
index 0000000000..dff3cc8c50
--- /dev/null
+++ b/.pnpm-store/v11/files/57/fd42c80a8db172734ca9d270348eb29825e52efb0619d53149084d6cd8cdbce8159abc2f89a3bc127aa7be44e223bcf1f43dd0f4b0de607dec2e80b1b5a1e4
@@ -0,0 +1,23 @@
+'use strict'
+
+module.exports = clone
+
+var getPrototypeOf = Object.getPrototypeOf || function (obj) {
+  return obj.__proto__
+}
+
+function clone (obj) {
+  if (obj === null || typeof obj !== 'object')
+    return obj
+
+  if (obj instanceof Object)
+    var copy = { __proto__: getPrototypeOf(obj) }
+  else
+    var copy = Object.create(null)
+
+  Object.getOwnPropertyNames(obj).forEach(function (key) {
+    Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
+  })
+
+  return copy
+}
diff --git a/.pnpm-store/v11/files/59/2594320a0aa71f6b218d537733f39fd43b50eb8bd2ff2f07a7a0ab71d4b992b1caf2f4791cc49b98ea7c66807327e3361bd46b2bb8d783bca8e8469c3d60d9 b/.pnpm-store/v11/files/59/2594320a0aa71f6b218d537733f39fd43b50eb8bd2ff2f07a7a0ab71d4b992b1caf2f4791cc49b98ea7c66807327e3361bd46b2bb8d783bca8e8469c3d60d9
new file mode 100644
index 0000000000..9a24342b37
--- /dev/null
+++ b/.pnpm-store/v11/files/59/2594320a0aa71f6b218d537733f39fd43b50eb8bd2ff2f07a7a0ab71d4b992b1caf2f4791cc49b98ea7c66807327e3361bd46b2bb8d783bca8e8469c3d60d9
@@ -0,0 +1,34 @@
+const lib = require('./nopt-lib')
+const defaultTypeDefs = require('./type-defs')
+
+// This is the version of nopt's API that requires setting typeDefs and invalidHandler
+// on the required `nopt` object since it is a singleton. To not do a breaking change
+// an API that requires all options be passed in is located in `nopt-lib.js` and
+// exported here as lib.
+// TODO(breaking): make API only work in non-singleton mode
+
+module.exports = exports = nopt
+exports.clean = clean
+exports.typeDefs = defaultTypeDefs
+exports.lib = lib
+
+function nopt (types, shorthands, args = process.argv, slice = 2) {
+  return lib.nopt(args.slice(slice), {
+    types: types || {},
+    shorthands: shorthands || {},
+    typeDefs: exports.typeDefs,
+    invalidHandler: exports.invalidHandler,
+    unknownHandler: exports.unknownHandler,
+    abbrevHandler: exports.abbrevHandler,
+  })
+}
+
+function clean (data, types, typeDefs = exports.typeDefs) {
+  return lib.clean(data, {
+    types: types || {},
+    typeDefs,
+    invalidHandler: exports.invalidHandler,
+    unknownHandler: exports.unknownHandler,
+    abbrevHandler: exports.abbrevHandler,
+  })
+}
diff --git a/.pnpm-store/v11/files/59/3b960b9bbe9cdcda234903d6f6f9df5d4ef13fa33599c286a76d898f99ce3018f8f3afbcc18a5d5a62357e03d607aca8e571852ced3c6f28750c99031f1100 b/.pnpm-store/v11/files/59/3b960b9bbe9cdcda234903d6f6f9df5d4ef13fa33599c286a76d898f99ce3018f8f3afbcc18a5d5a62357e03d607aca8e571852ced3c6f28750c99031f1100
new file mode 100644
index 0000000000..754934568d
--- /dev/null
+++ b/.pnpm-store/v11/files/59/3b960b9bbe9cdcda234903d6f6f9df5d4ef13fa33599c286a76d898f99ce3018f8f3afbcc18a5d5a62357e03d607aca8e571852ced3c6f28750c99031f1100
@@ -0,0 +1,398 @@
+'use strict'
+const { Transform } = require('node:stream')
+const { isASCIINumber, isValidLastEventId } = require('./util')
+
+/**
+ * @type {number[]} BOM
+ */
+const BOM = [0xEF, 0xBB, 0xBF]
+/**
+ * @type {10} LF
+ */
+const LF = 0x0A
+/**
+ * @type {13} CR
+ */
+const CR = 0x0D
+/**
+ * @type {58} COLON
+ */
+const COLON = 0x3A
+/**
+ * @type {32} SPACE
+ */
+const SPACE = 0x20
+
+/**
+ * @typedef {object} EventSourceStreamEvent
+ * @type {object}
+ * @property {string} [event] The event type.
+ * @property {string} [data] The data of the message.
+ * @property {string} [id] A unique ID for the event.
+ * @property {string} [retry] The reconnection time, in milliseconds.
+ */
+
+/**
+ * @typedef eventSourceSettings
+ * @type {object}
+ * @property {string} lastEventId The last event ID received from the server.
+ * @property {string} origin The origin of the event source.
+ * @property {number} reconnectionTime The reconnection time, in milliseconds.
+ */
+
+class EventSourceStream extends Transform {
+  /**
+   * @type {eventSourceSettings}
+   */
+  state = null
+
+  /**
+   * Leading byte-order-mark check.
+   * @type {boolean}
+   */
+  checkBOM = true
+
+  /**
+   * @type {boolean}
+   */
+  crlfCheck = false
+
+  /**
+   * @type {boolean}
+   */
+  eventEndCheck = false
+
+  /**
+   * @type {Buffer}
+   */
+  buffer = null
+
+  pos = 0
+
+  event = {
+    data: undefined,
+    event: undefined,
+    id: undefined,
+    retry: undefined
+  }
+
+  /**
+   * @param {object} options
+   * @param {eventSourceSettings} options.eventSourceSettings
+   * @param {Function} [options.push]
+   */
+  constructor (options = {}) {
+    // Enable object mode as EventSourceStream emits objects of shape
+    // EventSourceStreamEvent
+    options.readableObjectMode = true
+
+    super(options)
+
+    this.state = options.eventSourceSettings || {}
+    if (options.push) {
+      this.push = options.push
+    }
+  }
+
+  /**
+   * @param {Buffer} chunk
+   * @param {string} _encoding
+   * @param {Function} callback
+   * @returns {void}
+   */
+  _transform (chunk, _encoding, callback) {
+    if (chunk.length === 0) {
+      callback()
+      return
+    }
+
+    // Cache the chunk in the buffer, as the data might not be complete while
+    // processing it
+    // TODO: Investigate if there is a more performant way to handle
+    // incoming chunks
+    // see: https://github.com/nodejs/undici/issues/2630
+    if (this.buffer) {
+      this.buffer = Buffer.concat([this.buffer, chunk])
+    } else {
+      this.buffer = chunk
+    }
+
+    // Strip leading byte-order-mark if we opened the stream and started
+    // the processing of the incoming data
+    if (this.checkBOM) {
+      switch (this.buffer.length) {
+        case 1:
+          // Check if the first byte is the same as the first byte of the BOM
+          if (this.buffer[0] === BOM[0]) {
+            // If it is, we need to wait for more data
+            callback()
+            return
+          }
+          // Set the checkBOM flag to false as we don't need to check for the
+          // BOM anymore
+          this.checkBOM = false
+
+          // The buffer only contains one byte so we need to wait for more data
+          callback()
+          return
+        case 2:
+          // Check if the first two bytes are the same as the first two bytes
+          // of the BOM
+          if (
+            this.buffer[0] === BOM[0] &&
+            this.buffer[1] === BOM[1]
+          ) {
+            // If it is, we need to wait for more data, because the third byte
+            // is needed to determine if it is the BOM or not
+            callback()
+            return
+          }
+
+          // Set the checkBOM flag to false as we don't need to check for the
+          // BOM anymore
+          this.checkBOM = false
+          break
+        case 3:
+          // Check if the first three bytes are the same as the first three
+          // bytes of the BOM
+          if (
+            this.buffer[0] === BOM[0] &&
+            this.buffer[1] === BOM[1] &&
+            this.buffer[2] === BOM[2]
+          ) {
+            // If it is, we can drop the buffered data, as it is only the BOM
+            this.buffer = Buffer.alloc(0)
+            // Set the checkBOM flag to false as we don't need to check for the
+            // BOM anymore
+            this.checkBOM = false
+
+            // Await more data
+            callback()
+            return
+          }
+          // If it is not the BOM, we can start processing the data
+          this.checkBOM = false
+          break
+        default:
+          // The buffer is longer than 3 bytes, so we can drop the BOM if it is
+          // present
+          if (
+            this.buffer[0] === BOM[0] &&
+            this.buffer[1] === BOM[1] &&
+            this.buffer[2] === BOM[2]
+          ) {
+            // Remove the BOM from the buffer
+            this.buffer = this.buffer.subarray(3)
+          }
+
+          // Set the checkBOM flag to false as we don't need to check for the
+          this.checkBOM = false
+          break
+      }
+    }
+
+    while (this.pos < this.buffer.length) {
+      // If the previous line ended with an end-of-line, we need to check
+      // if the next character is also an end-of-line.
+      if (this.eventEndCheck) {
+        // If the the current character is an end-of-line, then the event
+        // is finished and we can process it
+
+        // If the previous line ended with a carriage return, we need to
+        // check if the current character is a line feed and remove it
+        // from the buffer.
+        if (this.crlfCheck) {
+          // If the current character is a line feed, we can remove it
+          // from the buffer and reset the crlfCheck flag
+          if (this.buffer[this.pos] === LF) {
+            this.buffer = this.buffer.subarray(this.pos + 1)
+            this.pos = 0
+            this.crlfCheck = false
+
+            // It is possible that the line feed is not the end of the
+            // event. We need to check if the next character is an
+            // end-of-line character to determine if the event is
+            // finished. We simply continue the loop to check the next
+            // character.
+
+            // As we removed the line feed from the buffer and set the
+            // crlfCheck flag to false, we basically don't make any
+            // distinction between a line feed and a carriage return.
+            continue
+          }
+          this.crlfCheck = false
+        }
+
+        if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {
+          // If the current character is a carriage return, we need to
+          // set the crlfCheck flag to true, as we need to check if the
+          // next character is a line feed so we can remove it from the
+          // buffer
+          if (this.buffer[this.pos] === CR) {
+            this.crlfCheck = true
+          }
+
+          this.buffer = this.buffer.subarray(this.pos + 1)
+          this.pos = 0
+          if (
+            this.event.data !== undefined || this.event.event || this.event.id || this.event.retry) {
+            this.processEvent(this.event)
+          }
+          this.clearEvent()
+          continue
+        }
+        // If the current character is not an end-of-line, then the event
+        // is not finished and we have to reset the eventEndCheck flag
+        this.eventEndCheck = false
+        continue
+      }
+
+      // If the current character is an end-of-line, we can process the
+      // line
+      if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) {
+        // If the current character is a carriage return, we need to
+        // set the crlfCheck flag to true, as we need to check if the
+        // next character is a line feed
+        if (this.buffer[this.pos] === CR) {
+          this.crlfCheck = true
+        }
+
+        // In any case, we can process the line as we reached an
+        // end-of-line character
+        this.parseLine(this.buffer.subarray(0, this.pos), this.event)
+
+        // Remove the processed line from the buffer
+        this.buffer = this.buffer.subarray(this.pos + 1)
+        // Reset the position as we removed the processed line from the buffer
+        this.pos = 0
+        // A line was processed and this could be the end of the event. We need
+        // to check if the next line is empty to determine if the event is
+        // finished.
+        this.eventEndCheck = true
+        continue
+      }
+
+      this.pos++
+    }
+
+    callback()
+  }
+
+  /**
+   * @param {Buffer} line
+   * @param {EventStreamEvent} event
+   */
+  parseLine (line, event) {
+    // If the line is empty (a blank line)
+    // Dispatch the event, as defined below.
+    // This will be handled in the _transform method
+    if (line.length === 0) {
+      return
+    }
+
+    // If the line starts with a U+003A COLON character (:)
+    // Ignore the line.
+    const colonPosition = line.indexOf(COLON)
+    if (colonPosition === 0) {
+      return
+    }
+
+    let field = ''
+    let value = ''
+
+    // If the line contains a U+003A COLON character (:)
+    if (colonPosition !== -1) {
+      // Collect the characters on the line before the first U+003A COLON
+      // character (:), and let field be that string.
+      // TODO: Investigate if there is a more performant way to extract the
+      // field
+      // see: https://github.com/nodejs/undici/issues/2630
+      field = line.subarray(0, colonPosition).toString('utf8')
+
+      // Collect the characters on the line after the first U+003A COLON
+      // character (:), and let value be that string.
+      // If value starts with a U+0020 SPACE character, remove it from value.
+      let valueStart = colonPosition + 1
+      if (line[valueStart] === SPACE) {
+        ++valueStart
+      }
+      // TODO: Investigate if there is a more performant way to extract the
+      // value
+      // see: https://github.com/nodejs/undici/issues/2630
+      value = line.subarray(valueStart).toString('utf8')
+
+      // Otherwise, the string is not empty but does not contain a U+003A COLON
+      // character (:)
+    } else {
+      // Process the field using the steps described below, using the whole
+      // line as the field name, and the empty string as the field value.
+      field = line.toString('utf8')
+      value = ''
+    }
+
+    // Modify the event with the field name and value. The value is also
+    // decoded as UTF-8
+    switch (field) {
+      case 'data':
+        if (event[field] === undefined) {
+          event[field] = value
+        } else {
+          event[field] += `\n${value}`
+        }
+        break
+      case 'retry':
+        if (isASCIINumber(value)) {
+          event[field] = value
+        }
+        break
+      case 'id':
+        if (isValidLastEventId(value)) {
+          event[field] = value
+        }
+        break
+      case 'event':
+        if (value.length > 0) {
+          event[field] = value
+        }
+        break
+    }
+  }
+
+  /**
+   * @param {EventSourceStreamEvent} event
+   */
+  processEvent (event) {
+    if (event.retry && isASCIINumber(event.retry)) {
+      this.state.reconnectionTime = parseInt(event.retry, 10)
+    }
+
+    if (event.id && isValidLastEventId(event.id)) {
+      this.state.lastEventId = event.id
+    }
+
+    // only dispatch event, when data is provided
+    if (event.data !== undefined) {
+      this.push({
+        type: event.event || 'message',
+        options: {
+          data: event.data,
+          lastEventId: this.state.lastEventId,
+          origin: this.state.origin
+        }
+      })
+    }
+  }
+
+  clearEvent () {
+    this.event = {
+      data: undefined,
+      event: undefined,
+      id: undefined,
+      retry: undefined
+    }
+  }
+}
+
+module.exports = {
+  EventSourceStream
+}
diff --git a/.pnpm-store/v11/files/59/e88e07cb98da91c48ef90b41aa6da623710d3ba1161e3778dce79810c9f9bf27e947354474789a0567dfda6ab2a5345602432546d38127e7472bb7c4c68a55 b/.pnpm-store/v11/files/59/e88e07cb98da91c48ef90b41aa6da623710d3ba1161e3778dce79810c9f9bf27e947354474789a0567dfda6ab2a5345602432546d38127e7472bb7c4c68a55
new file mode 100644
index 0000000000..42bee33d9b
--- /dev/null
+++ b/.pnpm-store/v11/files/59/e88e07cb98da91c48ef90b41aa6da623710d3ba1161e3778dce79810c9f9bf27e947354474789a0567dfda6ab2a5345602432546d38127e7472bb7c4c68a55
@@ -0,0 +1,3970 @@
+# Copyright (c) 2012 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+import ntpath
+import os
+import posixpath
+import re
+import subprocess
+import sys
+from collections import OrderedDict
+
+import gyp.common
+import gyp.generator.ninja as ninja_generator
+from gyp import (
+    MSVSNew,
+    MSVSProject,
+    MSVSSettings,
+    MSVSToolFile,
+    MSVSUserFile,
+    MSVSUtil,
+    MSVSVersion,
+    easy_xml,
+)
+from gyp.common import GypError, OrderedSet
+
+# Regular expression for validating Visual Studio GUIDs.  If the GUID
+# contains lowercase hex letters, MSVS will be fine. However,
+# IncrediBuild BuildConsole will parse the solution file, but then
+# silently skip building the target causing hard to track down errors.
+# Note that this only happens with the BuildConsole, and does not occur
+# if IncrediBuild is executed from inside Visual Studio.  This regex
+# validates that the string looks like a GUID with all uppercase hex
+# letters.
+VALID_MSVS_GUID_CHARS = re.compile(r"^[A-F0-9\-]+$")
+
+generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()
+
+generator_default_variables = {
+    "DRIVER_PREFIX": "",
+    "DRIVER_SUFFIX": ".sys",
+    "EXECUTABLE_PREFIX": "",
+    "EXECUTABLE_SUFFIX": ".exe",
+    "STATIC_LIB_PREFIX": "",
+    "SHARED_LIB_PREFIX": "",
+    "STATIC_LIB_SUFFIX": ".lib",
+    "SHARED_LIB_SUFFIX": ".dll",
+    "INTERMEDIATE_DIR": "$(IntDir)",
+    "SHARED_INTERMEDIATE_DIR": "$(OutDir)/obj/global_intermediate",
+    "OS": "win",
+    "PRODUCT_DIR": "$(OutDir)",
+    "LIB_DIR": "$(OutDir)lib",
+    "RULE_INPUT_ROOT": "$(InputName)",
+    "RULE_INPUT_DIRNAME": "$(InputDir)",
+    "RULE_INPUT_EXT": "$(InputExt)",
+    "RULE_INPUT_NAME": "$(InputFileName)",
+    "RULE_INPUT_PATH": "$(InputPath)",
+    "CONFIGURATION_NAME": "$(ConfigurationName)",
+}
+
+
+# The msvs specific sections that hold paths
+generator_additional_path_sections = [
+    "msvs_cygwin_dirs",
+    "msvs_props",
+]
+
+
+generator_additional_non_configuration_keys = [
+    "msvs_cygwin_dirs",
+    "msvs_cygwin_shell",
+    "msvs_large_pdb",
+    "msvs_shard",
+    "msvs_external_builder",
+    "msvs_external_builder_out_dir",
+    "msvs_external_builder_build_cmd",
+    "msvs_external_builder_clean_cmd",
+    "msvs_external_builder_clcompile_cmd",
+    "msvs_enable_winrt",
+    "msvs_requires_importlibrary",
+    "msvs_enable_winphone",
+    "msvs_application_type_revision",
+    "msvs_target_platform_version",
+    "msvs_target_platform_minversion",
+]
+
+generator_filelist_paths = None
+
+# List of precompiled header related keys.
+precomp_keys = [
+    "msvs_precompiled_header",
+    "msvs_precompiled_source",
+]
+
+
+cached_username = None
+
+
+cached_domain = None
+
+
+# TODO(gspencer): Switch the os.environ calls to be
+# win32api.GetDomainName() and win32api.GetUserName() once the
+# python version in depot_tools has been updated to work on Vista
+# 64-bit.
+def _GetDomainAndUserName():
+    if sys.platform not in ("win32", "cygwin"):
+        return ("DOMAIN", "USERNAME")
+    global cached_username
+    global cached_domain
+    if not cached_domain or not cached_username:
+        domain = os.environ.get("USERDOMAIN")
+        username = os.environ.get("USERNAME")
+        if not domain or not username:
+            call = subprocess.Popen(
+                ["net", "config", "Workstation"], stdout=subprocess.PIPE
+            )
+            config = call.communicate()[0].decode("utf-8")
+            username_re = re.compile(r"^User name\s+(\S+)", re.MULTILINE)
+            username_match = username_re.search(config)
+            if username_match:
+                username = username_match.group(1)
+            domain_re = re.compile(r"^Logon domain\s+(\S+)", re.MULTILINE)
+            domain_match = domain_re.search(config)
+            if domain_match:
+                domain = domain_match.group(1)
+        cached_domain = domain
+        cached_username = username
+    return (cached_domain, cached_username)
+
+
+fixpath_prefix = None
+
+
+def _NormalizedSource(source):
+    """Normalize the path.
+
+    But not if that gets rid of a variable, as this may expand to something
+    larger than one directory.
+
+    Arguments:
+        source: The path to be normalize.d
+
+    Returns:
+        The normalized path.
+    """
+    normalized = os.path.normpath(source)
+    if source.count("$") == normalized.count("$"):
+        source = normalized
+    return source
+
+
+def _FixPath(path, separator="\\"):
+    """Convert paths to a form that will make sense in a vcproj file.
+
+    Arguments:
+      path: The path to convert, may contain / etc.
+    Returns:
+      The path with all slashes made into backslashes.
+    """
+    if (
+        fixpath_prefix
+        and path
+        and not os.path.isabs(path)
+        and path[0] != "$"
+        and not _IsWindowsAbsPath(path)
+    ):
+        path = os.path.join(fixpath_prefix, path)
+    if separator == "\\":
+        path = path.replace("/", "\\")
+    path = _NormalizedSource(path)
+    if separator == "/":
+        path = path.replace("\\", "/")
+    if path and path[-1] == separator:
+        path = path[:-1]
+    return path
+
+
+def _IsWindowsAbsPath(path):
+    """
+    On Cygwin systems Python needs a little help determining if a path
+    is an absolute Windows path or not, so that
+    it does not treat those as relative, which results in bad paths like:
+    '..\\C:\\\\some_source_code_file.cc'
+    """
+    return path.startswith(("c:", "C:"))
+
+
+def _FixPaths(paths, separator="\\"):
+    """Fix each of the paths of the list."""
+    return [_FixPath(i, separator) for i in paths]
+
+
+def _ConvertSourcesToFilterHierarchy(
+    sources, prefix=None, excluded=None, list_excluded=True, msvs_version=None
+):
+    """Converts a list split source file paths into a vcproj folder hierarchy.
+
+    Arguments:
+      sources: A list of source file paths split.
+      prefix: A list of source file path layers meant to apply to each of sources.
+      excluded: A set of excluded files.
+      msvs_version: A MSVSVersion object.
+
+    Returns:
+      A hierarchy of filenames and MSVSProject.Filter objects that matches the
+      layout of the source tree.
+      For example:
+      _ConvertSourcesToFilterHierarchy([['a', 'bob1.c'], ['b', 'bob2.c']],
+                                       prefix=['joe'])
+      -->
+      [MSVSProject.Filter('a', contents=['joe\\a\\bob1.c']),
+       MSVSProject.Filter('b', contents=['joe\\b\\bob2.c'])]
+    """
+    if not prefix:
+        prefix = []
+    result = []
+    excluded_result = []
+    folders = OrderedDict()
+    # Gather files into the final result, excluded, or folders.
+    for s in sources:
+        if len(s) == 1:
+            filename = _NormalizedSource("\\".join(prefix + s))
+            if filename in excluded:
+                excluded_result.append(filename)
+            else:
+                result.append(filename)
+        elif msvs_version and not msvs_version.UsesVcxproj():
+            # For MSVS 2008 and earlier, we need to process all files before walking
+            # the sub folders.
+            if not folders.get(s[0]):
+                folders[s[0]] = []
+            folders[s[0]].append(s[1:])
+        else:
+            contents = _ConvertSourcesToFilterHierarchy(
+                [s[1:]],
+                prefix + [s[0]],
+                excluded=excluded,
+                list_excluded=list_excluded,
+                msvs_version=msvs_version,
+            )
+            contents = MSVSProject.Filter(s[0], contents=contents)
+            result.append(contents)
+    # Add a folder for excluded files.
+    if excluded_result and list_excluded:
+        excluded_folder = MSVSProject.Filter(
+            "_excluded_files", contents=excluded_result
+        )
+        result.append(excluded_folder)
+
+    if msvs_version and msvs_version.UsesVcxproj():
+        return result
+
+    # Populate all the folders.
+    for f in folders:
+        contents = _ConvertSourcesToFilterHierarchy(
+            folders[f],
+            prefix=prefix + [f],
+            excluded=excluded,
+            list_excluded=list_excluded,
+            msvs_version=msvs_version,
+        )
+        contents = MSVSProject.Filter(f, contents=contents)
+        result.append(contents)
+    return result
+
+
+def _ToolAppend(tools, tool_name, setting, value, only_if_unset=False):
+    if not value:
+        return
+    _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset)
+
+
+def _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset=False):
+    # TODO(bradnelson): ugly hack, fix this more generally!!!
+    if "Directories" in setting or "Dependencies" in setting:
+        if isinstance(value, str):
+            value = value.replace("/", "\\")
+        else:
+            value = [i.replace("/", "\\") for i in value]
+    if not tools.get(tool_name):
+        tools[tool_name] = {}
+    tool = tools[tool_name]
+    if setting == "CompileAsWinRT":
+        return
+    if tool.get(setting):
+        if only_if_unset:
+            return
+        if isinstance(tool[setting], list) and isinstance(value, list):
+            tool[setting] += value
+        else:
+            raise TypeError(
+                'Appending "%s" to a non-list setting "%s" for tool "%s" is '
+                "not allowed, previous value: %s"
+                % (value, setting, tool_name, str(tool[setting]))
+            )
+    else:
+        tool[setting] = value
+
+
+def _ConfigTargetVersion(config_data):
+    return config_data.get("msvs_target_version", "Windows7")
+
+
+def _ConfigPlatform(config_data):
+    return config_data.get("msvs_configuration_platform", "Win32")
+
+
+def _ConfigBaseName(config_name, platform_name):
+    if config_name.endswith("_" + platform_name):
+        return config_name[0 : -len(platform_name) - 1]
+    else:
+        return config_name
+
+
+def _ConfigFullName(config_name, config_data):
+    platform_name = _ConfigPlatform(config_data)
+    return f"{_ConfigBaseName(config_name, platform_name)}|{platform_name}"
+
+
+def _ConfigWindowsTargetPlatformVersion(config_data, version):
+    target_ver = config_data.get("msvs_windows_target_platform_version")
+    if target_ver and re.match(r"^\d+", target_ver):
+        return target_ver
+    config_ver = config_data.get("msvs_windows_sdk_version")
+    vers = [config_ver] if config_ver else version.compatible_sdks
+    for ver in vers:
+        for key in [
+            r"HKLM\Software\Microsoft\Microsoft SDKs\Windows\%s",
+            r"HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%s",
+        ]:
+            sdk_dir = MSVSVersion._RegistryGetValue(key % ver, "InstallationFolder")
+            if not sdk_dir:
+                continue
+            version = MSVSVersion._RegistryGetValue(key % ver, "ProductVersion") or ""
+            # Find a matching entry in sdk_dir\include.
+            expected_sdk_dir = r"%s\include" % sdk_dir
+            names = sorted(
+                (
+                    x
+                    for x in (
+                        os.listdir(expected_sdk_dir)
+                        if os.path.isdir(expected_sdk_dir)
+                        else []
+                    )
+                    if x.startswith(version)
+                ),
+                reverse=True,
+            )
+            if names:
+                return names[0]
+            else:
+                print(
+                    "Warning: No include files found for detected "
+                    "Windows SDK version %s" % (version),
+                    file=sys.stdout,
+                )
+
+
+def _BuildCommandLineForRuleRaw(
+    spec, cmd, cygwin_shell, has_input_path, quote_cmd, do_setup_env
+):
+    if [x for x in cmd if "$(InputDir)" in x]:
+        input_dir_preamble = (
+            "set INPUTDIR=$(InputDir)\n"
+            "if NOT DEFINED INPUTDIR set INPUTDIR=.\\\n"
+            "set INPUTDIR=%INPUTDIR:~0,-1%\n"
+        )
+    else:
+        input_dir_preamble = ""
+
+    if cygwin_shell:
+        # Find path to cygwin.
+        cygwin_dir = _FixPath(spec.get("msvs_cygwin_dirs", ["."])[0])
+        # Prepare command.
+        direct_cmd = cmd
+        direct_cmd = [
+            i.replace("$(IntDir)", '`cygpath -m "${INTDIR}"`') for i in direct_cmd
+        ]
+        direct_cmd = [
+            i.replace("$(OutDir)", '`cygpath -m "${OUTDIR}"`') for i in direct_cmd
+        ]
+        direct_cmd = [
+            i.replace("$(InputDir)", '`cygpath -m "${INPUTDIR}"`') for i in direct_cmd
+        ]
+        if has_input_path:
+            direct_cmd = [
+                i.replace("$(InputPath)", '`cygpath -m "${INPUTPATH}"`')
+                for i in direct_cmd
+            ]
+        direct_cmd = ['\\"%s\\"' % i.replace('"', '\\\\\\"') for i in direct_cmd]
+        # direct_cmd = gyp.common.EncodePOSIXShellList(direct_cmd)
+        direct_cmd = " ".join(direct_cmd)
+        # TODO(quote):  regularize quoting path names throughout the module
+        cmd = ""
+        if do_setup_env:
+            cmd += 'call "$(ProjectDir)%(cygwin_dir)s\\setup_env.bat" && '
+        cmd += "set CYGWIN=nontsec&& "
+        if direct_cmd.find("NUMBER_OF_PROCESSORS") >= 0:
+            cmd += "set /a NUMBER_OF_PROCESSORS_PLUS_1=%%NUMBER_OF_PROCESSORS%%+1&& "
+        if direct_cmd.find("INTDIR") >= 0:
+            cmd += "set INTDIR=$(IntDir)&& "
+        if direct_cmd.find("OUTDIR") >= 0:
+            cmd += "set OUTDIR=$(OutDir)&& "
+        if has_input_path and direct_cmd.find("INPUTPATH") >= 0:
+            cmd += "set INPUTPATH=$(InputPath) && "
+        cmd += 'bash -c "%(cmd)s"'
+        cmd = cmd % {"cygwin_dir": cygwin_dir, "cmd": direct_cmd}
+        return input_dir_preamble + cmd
+    else:
+        # Convert cat --> type to mimic unix.
+        command = ["type"] if cmd[0] == "cat" else [cmd[0].replace("/", "\\")]
+        # Add call before command to ensure that commands can be tied together one
+        # after the other without aborting in Incredibuild, since IB makes a bat
+        # file out of the raw command string, and some commands (like python) are
+        # actually batch files themselves.
+        command.insert(0, "call")
+        # Fix the paths
+        # TODO(quote): This is a really ugly heuristic, and will miss path fixing
+        #              for arguments like "--arg=path", arg=path, or "/opt:path".
+        # If the argument starts with a slash or dash, or contains an equal sign,
+        # it's probably a command line switch.
+        # Return the path with forward slashes because the command using it might
+        # not support backslashes.
+        arguments = [
+            i if (i[:1] in "/-" or "=" in i) else _FixPath(i, "/") for i in cmd[1:]
+        ]
+        arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in arguments]
+        arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments]
+        if quote_cmd:
+            # Support a mode for using cmd directly.
+            # Convert any paths to native form (first element is used directly).
+            # TODO(quote):  regularize quoting path names throughout the module
+            command[1] = '"%s"' % command[1]
+            arguments = ['"%s"' % i for i in arguments]
+        # Collapse into a single command.
+        return input_dir_preamble + " ".join(command + arguments)
+
+
+def _BuildCommandLineForRule(spec, rule, has_input_path, do_setup_env):
+    # Currently this weird argument munging is used to duplicate the way a
+    # python script would need to be run as part of the chrome tree.
+    # Eventually we should add some sort of rule_default option to set this
+    # per project. For now the behavior chrome needs is the default.
+    mcs = rule.get("msvs_cygwin_shell")
+    if mcs is None:
+        mcs = int(spec.get("msvs_cygwin_shell", 1))
+    elif isinstance(mcs, str):
+        mcs = int(mcs)
+    quote_cmd = int(rule.get("msvs_quote_cmd", 1))
+    return _BuildCommandLineForRuleRaw(
+        spec, rule["action"], mcs, has_input_path, quote_cmd, do_setup_env=do_setup_env
+    )
+
+
+def _AddActionStep(actions_dict, inputs, outputs, description, command):
+    """Merge action into an existing list of actions.
+
+    Care must be taken so that actions which have overlapping inputs either don't
+    get assigned to the same input, or get collapsed into one.
+
+    Arguments:
+      actions_dict: dictionary keyed on input name, which maps to a list of
+        dicts describing the actions attached to that input file.
+      inputs: list of inputs
+      outputs: list of outputs
+      description: description of the action
+      command: command line to execute
+    """
+    # Require there to be at least one input (call sites will ensure this).
+    assert inputs
+
+    action = {
+        "inputs": inputs,
+        "outputs": outputs,
+        "description": description,
+        "command": command,
+    }
+
+    # Pick where to stick this action.
+    # While less than optimal in terms of build time, attach them to the first
+    # input for now.
+    chosen_input = inputs[0]
+
+    # Add it there.
+    if chosen_input not in actions_dict:
+        actions_dict[chosen_input] = []
+    actions_dict[chosen_input].append(action)
+
+
+def _AddCustomBuildToolForMSVS(
+    p, spec, primary_input, inputs, outputs, description, cmd
+):
+    """Add a custom build tool to execute something.
+
+    Arguments:
+      p: the target project
+      spec: the target project dict
+      primary_input: input file to attach the build tool to
+      inputs: list of inputs
+      outputs: list of outputs
+      description: description of the action
+      cmd: command line to execute
+    """
+    inputs = _FixPaths(inputs)
+    outputs = _FixPaths(outputs)
+    tool = MSVSProject.Tool(
+        "VCCustomBuildTool",
+        {
+            "Description": description,
+            "AdditionalDependencies": ";".join(inputs),
+            "Outputs": ";".join(outputs),
+            "CommandLine": cmd,
+        },
+    )
+    # Add to the properties of primary input for each config.
+    for config_name, c_data in spec["configurations"].items():
+        p.AddFileConfig(
+            _FixPath(primary_input), _ConfigFullName(config_name, c_data), tools=[tool]
+        )
+
+
+def _AddAccumulatedActionsToMSVS(p, spec, actions_dict):
+    """Add actions accumulated into an actions_dict, merging as needed.
+
+    Arguments:
+      p: the target project
+      spec: the target project dict
+      actions_dict: dictionary keyed on input name, which maps to a list of
+          dicts describing the actions attached to that input file.
+    """
+    for primary_input in actions_dict:
+        inputs = OrderedSet()
+        outputs = OrderedSet()
+        descriptions = []
+        commands = []
+        for action in actions_dict[primary_input]:
+            inputs.update(OrderedSet(action["inputs"]))
+            outputs.update(OrderedSet(action["outputs"]))
+            descriptions.append(action["description"])
+            commands.append(action["command"])
+        # Add the custom build step for one input file.
+        description = ", and also ".join(descriptions)
+        command = "\r\n".join(commands)
+        _AddCustomBuildToolForMSVS(
+            p,
+            spec,
+            primary_input=primary_input,
+            inputs=inputs,
+            outputs=outputs,
+            description=description,
+            cmd=command,
+        )
+
+
+def _RuleExpandPath(path, input_file):
+    """Given the input file to which a rule applied, string substitute a path.
+
+    Arguments:
+      path: a path to string expand
+      input_file: the file to which the rule applied.
+    Returns:
+      The string substituted path.
+    """
+    path = path.replace(
+        "$(InputName)", os.path.splitext(os.path.split(input_file)[1])[0]
+    )
+    path = path.replace("$(InputDir)", os.path.dirname(input_file))
+    path = path.replace(
+        "$(InputExt)", os.path.splitext(os.path.split(input_file)[1])[1]
+    )
+    path = path.replace("$(InputFileName)", os.path.split(input_file)[1])
+    path = path.replace("$(InputPath)", input_file)
+    return path
+
+
+def _FindRuleTriggerFiles(rule, sources):
+    """Find the list of files which a particular rule applies to.
+
+    Arguments:
+      rule: the rule in question
+      sources: the set of all known source files for this project
+    Returns:
+      The list of sources that trigger a particular rule.
+    """
+    return rule.get("rule_sources", [])
+
+
+def _RuleInputsAndOutputs(rule, trigger_file):
+    """Find the inputs and outputs generated by a rule.
+
+    Arguments:
+      rule: the rule in question.
+      trigger_file: the main trigger for this rule.
+    Returns:
+      The pair of (inputs, outputs) involved in this rule.
+    """
+    raw_inputs = _FixPaths(rule.get("inputs", []))
+    raw_outputs = _FixPaths(rule.get("outputs", []))
+    inputs = OrderedSet()
+    outputs = OrderedSet()
+    inputs.add(trigger_file)
+    for i in raw_inputs:
+        inputs.add(_RuleExpandPath(i, trigger_file))
+    for o in raw_outputs:
+        outputs.add(_RuleExpandPath(o, trigger_file))
+    return (inputs, outputs)
+
+
+def _GenerateNativeRulesForMSVS(p, rules, output_dir, spec, options):
+    """Generate a native rules file.
+
+    Arguments:
+      p: the target project
+      rules: the set of rules to include
+      output_dir: the directory in which the project/gyp resides
+      spec: the project dict
+      options: global generator options
+    """
+    rules_filename = "{}{}.rules".format(spec["target_name"], options.suffix)
+    rules_file = MSVSToolFile.Writer(
+        os.path.join(output_dir, rules_filename), spec["target_name"]
+    )
+    # Add each rule.
+    for r in rules:
+        rule_name = r["rule_name"]
+        rule_ext = r["extension"]
+        inputs = _FixPaths(r.get("inputs", []))
+        outputs = _FixPaths(r.get("outputs", []))
+        # Skip a rule with no action and no inputs.
+        if "action" not in r and not r.get("rule_sources", []):
+            continue
+        cmd = _BuildCommandLineForRule(spec, r, has_input_path=True, do_setup_env=True)
+        rules_file.AddCustomBuildRule(
+            name=rule_name,
+            description=r.get("message", rule_name),
+            extensions=[rule_ext],
+            additional_dependencies=inputs,
+            outputs=outputs,
+            cmd=cmd,
+        )
+    # Write out rules file.
+    rules_file.WriteIfChanged()
+
+    # Add rules file to project.
+    p.AddToolFile(rules_filename)
+
+
+def _Cygwinify(path):
+    path = path.replace("$(OutDir)", "$(OutDirCygwin)")
+    path = path.replace("$(IntDir)", "$(IntDirCygwin)")
+    return path
+
+
+def _GenerateExternalRules(rules, output_dir, spec, sources, options, actions_to_add):
+    """Generate an external makefile to do a set of rules.
+
+    Arguments:
+      rules: the list of rules to include
+      output_dir: path containing project and gyp files
+      spec: project specification data
+      sources: set of sources known
+      options: global generator options
+      actions_to_add: The list of actions we will add to.
+    """
+    filename = "{}_rules{}.mk".format(spec["target_name"], options.suffix)
+    mk_file = gyp.common.WriteOnDiff(os.path.join(output_dir, filename))
+    # Find cygwin style versions of some paths.
+    mk_file.write('OutDirCygwin:=$(shell cygpath -u "$(OutDir)")\n')
+    mk_file.write('IntDirCygwin:=$(shell cygpath -u "$(IntDir)")\n')
+    # Gather stuff needed to emit all: target.
+    all_inputs = OrderedSet()
+    all_outputs = OrderedSet()
+    all_output_dirs = OrderedSet()
+    first_outputs = []
+    for rule in rules:
+        trigger_files = _FindRuleTriggerFiles(rule, sources)
+        for tf in trigger_files:
+            inputs, outputs = _RuleInputsAndOutputs(rule, tf)
+            all_inputs.update(OrderedSet(inputs))
+            all_outputs.update(OrderedSet(outputs))
+            # Only use one target from each rule as the dependency for
+            # 'all' so we don't try to build each rule multiple times.
+            first_outputs.append(next(iter(outputs)))
+            # Get the unique output directories for this rule.
+            output_dirs = [os.path.split(i)[0] for i in outputs]
+            for od in output_dirs:
+                all_output_dirs.add(od)
+    first_outputs_cyg = [_Cygwinify(i) for i in first_outputs]
+    # Write out all: target, including mkdir for each output directory.
+    mk_file.write("all: %s\n" % " ".join(first_outputs_cyg))
+    for od in all_output_dirs:
+        if od:
+            mk_file.write('\tmkdir -p `cygpath -u "%s"`\n' % od)
+    mk_file.write("\n")
+    # Define how each output is generated.
+    for rule in rules:
+        trigger_files = _FindRuleTriggerFiles(rule, sources)
+        for tf in trigger_files:
+            # Get all the inputs and outputs for this rule for this trigger file.
+            inputs, outputs = _RuleInputsAndOutputs(rule, tf)
+            inputs = [_Cygwinify(i) for i in inputs]
+            outputs = [_Cygwinify(i) for i in outputs]
+            # Prepare the command line for this rule.
+            cmd = [_RuleExpandPath(c, tf) for c in rule["action"]]
+            cmd = ['"%s"' % i for i in cmd]
+            cmd = " ".join(cmd)
+            # Add it to the makefile.
+            mk_file.write("{}: {}\n".format(" ".join(outputs), " ".join(inputs)))
+            mk_file.write("\t%s\n\n" % cmd)
+    # Close up the file.
+    mk_file.close()
+
+    # Add makefile to list of sources.
+    sources.add(filename)
+    # Add a build action to call makefile.
+    cmd = [
+        "make",
+        "OutDir=$(OutDir)",
+        "IntDir=$(IntDir)",
+        "-j",
+        "${NUMBER_OF_PROCESSORS_PLUS_1}",
+        "-f",
+        filename,
+    ]
+    cmd = _BuildCommandLineForRuleRaw(spec, cmd, True, False, True, True)
+    # Insert makefile as 0'th input, so it gets the action attached there,
+    # as this is easier to understand from in the IDE.
+    all_inputs = list(all_inputs)
+    all_inputs.insert(0, filename)
+    _AddActionStep(
+        actions_to_add,
+        inputs=_FixPaths(all_inputs),
+        outputs=_FixPaths(all_outputs),
+        description="Running external rules for %s" % spec["target_name"],
+        command=cmd,
+    )
+
+
+def _EscapeEnvironmentVariableExpansion(s):
+    """Escapes % characters.
+
+    Escapes any % characters so that Windows-style environment variable
+    expansions will leave them alone.
+    See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile
+    to understand why we have to do this.
+
+    Args:
+        s: The string to be escaped.
+
+    Returns:
+        The escaped string.
+    """
+    s = s.replace("%", "%%")
+    return s
+
+
+quote_replacer_regex = re.compile(r'(\\*)"')
+
+
+def _EscapeCommandLineArgumentForMSVS(s):
+    """Escapes a Windows command-line argument.
+
+    So that the Win32 CommandLineToArgv function will turn the escaped result back
+    into the original string.
+    See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx
+    ("Parsing C++ Command-Line Arguments") to understand why we have to do
+    this.
+
+    Args:
+        s: the string to be escaped.
+    Returns:
+        the escaped string.
+    """
+
+    def _Replace(match):
+        # For a literal quote, CommandLineToArgv requires an odd number of
+        # backslashes preceding it, and it produces half as many literal backslashes
+        # (rounded down). So we need to produce 2n+1 backslashes.
+        return 2 * match.group(1) + '\\"'
+
+    # Escape all quotes so that they are interpreted literally.
+    s = quote_replacer_regex.sub(_Replace, s)
+    # Now add unescaped quotes so that any whitespace is interpreted literally.
+    s = '"' + s + '"'
+    return s
+
+
+delimiters_replacer_regex = re.compile(r"(\\*)([,;]+)")
+
+
+def _EscapeVCProjCommandLineArgListItem(s):
+    """Escapes command line arguments for MSVS.
+
+    The VCProj format stores string lists in a single string using commas and
+    semi-colons as separators, which must be quoted if they are to be
+    interpreted literally. However, command-line arguments may already have
+    quotes, and the VCProj parser is ignorant of the backslash escaping
+    convention used by CommandLineToArgv, so the command-line quotes and the
+    VCProj quotes may not be the same quotes. So to store a general
+    command-line argument in a VCProj list, we need to parse the existing
+    quoting according to VCProj's convention and quote any delimiters that are
+    not already quoted by that convention. The quotes that we add will also be
+    seen by CommandLineToArgv, so if backslashes precede them then we also have
+    to escape those backslashes according to the CommandLineToArgv
+    convention.
+
+    Args:
+        s: the string to be escaped.
+    Returns:
+        the escaped string.
+    """
+
+    def _Replace(match):
+        # For a non-literal quote, CommandLineToArgv requires an even number of
+        # backslashes preceding it, and it produces half as many literal
+        # backslashes. So we need to produce 2n backslashes.
+        return 2 * match.group(1) + '"' + match.group(2) + '"'
+
+    segments = s.split('"')
+    # The unquoted segments are at the even-numbered indices.
+    for i in range(0, len(segments), 2):
+        segments[i] = delimiters_replacer_regex.sub(_Replace, segments[i])
+    # Concatenate back into a single string
+    s = '"'.join(segments)
+    if len(segments) % 2 == 0:
+        # String ends while still quoted according to VCProj's convention. This
+        # means the delimiter and the next list item that follow this one in the
+        # .vcproj file will be misinterpreted as part of this item. There is nothing
+        # we can do about this. Adding an extra quote would correct the problem in
+        # the VCProj but cause the same problem on the final command-line. Moving
+        # the item to the end of the list does works, but that's only possible if
+        # there's only one such item. Let's just warn the user.
+        print(
+            "Warning: MSVS may misinterpret the odd number of " + "quotes in " + s,
+            file=sys.stderr,
+        )
+    return s
+
+
+def _EscapeCppDefineForMSVS(s):
+    """Escapes a CPP define so that it will reach the compiler unaltered."""
+    s = _EscapeEnvironmentVariableExpansion(s)
+    s = _EscapeCommandLineArgumentForMSVS(s)
+    s = _EscapeVCProjCommandLineArgListItem(s)
+    # cl.exe replaces literal # characters with = in preprocessor definitions for
+    # some reason. Octal-encode to work around that.
+    s = s.replace("#", "\\%03o" % ord("#"))
+    return s
+
+
+quote_replacer_regex2 = re.compile(r'(\\+)"')
+
+
+def _EscapeCommandLineArgumentForMSBuild(s):
+    """Escapes a Windows command-line argument for use by MSBuild."""
+
+    def _Replace(match):
+        return (len(match.group(1)) // 2 * 4) * "\\" + '\\"'
+
+    # Escape all quotes so that they are interpreted literally.
+    s = quote_replacer_regex2.sub(_Replace, s)
+    return s
+
+
+def _EscapeMSBuildSpecialCharacters(s):
+    escape_dictionary = {
+        "%": "%25",
+        "$": "%24",
+        "@": "%40",
+        "'": "%27",
+        ";": "%3B",
+        "?": "%3F",
+        "*": "%2A",
+    }
+    result = "".join([escape_dictionary.get(c, c) for c in s])
+    return result
+
+
+def _EscapeCppDefineForMSBuild(s):
+    """Escapes a CPP define so that it will reach the compiler unaltered."""
+    s = _EscapeEnvironmentVariableExpansion(s)
+    s = _EscapeCommandLineArgumentForMSBuild(s)
+    s = _EscapeMSBuildSpecialCharacters(s)
+    # cl.exe replaces literal # characters with = in preprocessor definitions for
+    # some reason. Octal-encode to work around that.
+    s = s.replace("#", "\\%03o" % ord("#"))
+    return s
+
+
+def _GenerateRulesForMSVS(
+    p, output_dir, options, spec, sources, excluded_sources, actions_to_add
+):
+    """Generate all the rules for a particular project.
+
+    Arguments:
+      p: the project
+      output_dir: directory to emit rules to
+      options: global options passed to the generator
+      spec: the specification for this project
+      sources: the set of all known source files in this project
+      excluded_sources: the set of sources excluded from normal processing
+      actions_to_add: deferred list of actions to add in
+    """
+    rules = spec.get("rules", [])
+    rules_native = [r for r in rules if not int(r.get("msvs_external_rule", 0))]
+    rules_external = [r for r in rules if int(r.get("msvs_external_rule", 0))]
+
+    # Handle rules that use a native rules file.
+    if rules_native:
+        _GenerateNativeRulesForMSVS(p, rules_native, output_dir, spec, options)
+
+    # Handle external rules (non-native rules).
+    if rules_external:
+        _GenerateExternalRules(
+            rules_external, output_dir, spec, sources, options, actions_to_add
+        )
+    _AdjustSourcesForRules(rules, sources, excluded_sources, False)
+
+
+def _AdjustSourcesForRules(rules, sources, excluded_sources, is_msbuild):
+    # Add outputs generated by each rule (if applicable).
+    for rule in rules:
+        # Add in the outputs from this rule.
+        trigger_files = _FindRuleTriggerFiles(rule, sources)
+        for trigger_file in trigger_files:
+            # Remove trigger_file from excluded_sources to let the rule be triggered
+            # (e.g. rule trigger ax_enums.idl is added to excluded_sources
+            # because it's also in an action's inputs in the same project)
+            excluded_sources.discard(_FixPath(trigger_file))
+            # Done if not processing outputs as sources.
+            if int(rule.get("process_outputs_as_sources", False)):
+                inputs, outputs = _RuleInputsAndOutputs(rule, trigger_file)
+                inputs = OrderedSet(_FixPaths(inputs))
+                outputs = OrderedSet(_FixPaths(outputs))
+                inputs.remove(_FixPath(trigger_file))
+                sources.update(inputs)
+                if not is_msbuild:
+                    excluded_sources.update(inputs)
+                sources.update(outputs)
+
+
+def _FilterActionsFromExcluded(excluded_sources, actions_to_add):
+    """Take inputs with actions attached out of the list of exclusions.
+
+    Arguments:
+      excluded_sources: list of source files not to be built.
+      actions_to_add: dict of actions keyed on source file they're attached to.
+    Returns:
+      excluded_sources with files that have actions attached removed.
+    """
+    must_keep = OrderedSet(_FixPaths(actions_to_add.keys()))
+    return [s for s in excluded_sources if s not in must_keep]
+
+
+def _GetDefaultConfiguration(spec):
+    return spec["configurations"][spec["default_configuration"]]
+
+
+def _GetGuidOfProject(proj_path, spec):
+    """Get the guid for the project.
+
+    Arguments:
+      proj_path: Path of the vcproj or vcxproj file to generate.
+      spec: The target dictionary containing the properties of the target.
+    Returns:
+      the guid.
+    Raises:
+      ValueError: if the specified GUID is invalid.
+    """
+    # Pluck out the default configuration.
+    default_config = _GetDefaultConfiguration(spec)
+    # Decide the guid of the project.
+    guid = default_config.get("msvs_guid")
+    if guid:
+        if VALID_MSVS_GUID_CHARS.match(guid) is None:
+            raise ValueError(
+                'Invalid MSVS guid: "%s".  Must match regex: "%s".'
+                % (guid, VALID_MSVS_GUID_CHARS.pattern)
+            )
+        guid = "{%s}" % guid
+    guid = guid or MSVSNew.MakeGuid(proj_path)
+    return guid
+
+
+def _GetMsbuildToolsetOfProject(proj_path, spec, version):
+    """Get the platform toolset for the project.
+
+    Arguments:
+      proj_path: Path of the vcproj or vcxproj file to generate.
+      spec: The target dictionary containing the properties of the target.
+      version: The MSVSVersion object.
+    Returns:
+      the platform toolset string or None.
+    """
+    # Pluck out the default configuration.
+    default_config = _GetDefaultConfiguration(spec)
+    toolset = default_config.get("msbuild_toolset")
+    if not toolset and version.DefaultToolset():
+        toolset = version.DefaultToolset()
+    if spec["type"] == "windows_driver":
+        toolset = "WindowsKernelModeDriver10.0"
+    return toolset
+
+
+def _GenerateProject(project, options, version, generator_flags, spec):
+    """Generates a vcproj file.
+
+    Arguments:
+      project: the MSVSProject object.
+      options: global generator options.
+      version: the MSVSVersion object.
+      generator_flags: dict of generator-specific flags.
+    Returns:
+      A list of source files that cannot be found on disk.
+    """
+    default_config = _GetDefaultConfiguration(project.spec)
+
+    # Skip emitting anything if told to with msvs_existing_vcproj option.
+    if default_config.get("msvs_existing_vcproj"):
+        return []
+
+    if version.UsesVcxproj():
+        return _GenerateMSBuildProject(project, options, version, generator_flags, spec)
+    else:
+        return _GenerateMSVSProject(project, options, version, generator_flags)
+
+
+def _GenerateMSVSProject(project, options, version, generator_flags):
+    """Generates a .vcproj file.  It may create .rules and .user files too.
+
+    Arguments:
+      project: The project object we will generate the file for.
+      options: Global options passed to the generator.
+      version: The VisualStudioVersion object.
+      generator_flags: dict of generator-specific flags.
+    """
+    spec = project.spec
+    gyp.common.EnsureDirExists(project.path)
+
+    platforms = _GetUniquePlatforms(spec)
+    p = MSVSProject.Writer(
+        project.path, version, spec["target_name"], project.guid, platforms
+    )
+
+    # Get directory project file is in.
+    project_dir = os.path.split(project.path)[0]
+    gyp_path = _NormalizedSource(project.build_file)
+    relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir)
+
+    config_type = _GetMSVSConfigurationType(spec, project.build_file)
+    for config_name, config in spec["configurations"].items():
+        _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config)
+
+    # Prepare list of sources and excluded sources.
+    gyp_file = os.path.split(project.build_file)[1]
+    sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, gyp_file)
+
+    # Add rules.
+    actions_to_add = {}
+    _GenerateRulesForMSVS(
+        p, project_dir, options, spec, sources, excluded_sources, actions_to_add
+    )
+    list_excluded = generator_flags.get("msvs_list_excluded_files", True)
+    sources, excluded_sources, excluded_idl = _AdjustSourcesAndConvertToFilterHierarchy(
+        spec, options, project_dir, sources, excluded_sources, list_excluded, version
+    )
+
+    # Add in files.
+    missing_sources = _VerifySourcesExist(sources, project_dir)
+    p.AddFiles(sources)
+
+    _AddToolFilesToMSVS(p, spec)
+    _HandlePreCompiledHeaders(p, sources, spec)
+    _AddActions(actions_to_add, spec, relative_path_of_gyp_file)
+    _AddCopies(actions_to_add, spec)
+    _WriteMSVSUserFile(project.path, version, spec)
+
+    # NOTE: this stanza must appear after all actions have been decided.
+    # Don't excluded sources with actions attached, or they won't run.
+    excluded_sources = _FilterActionsFromExcluded(excluded_sources, actions_to_add)
+    _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, list_excluded)
+    _AddAccumulatedActionsToMSVS(p, spec, actions_to_add)
+
+    # Write it out.
+    p.WriteIfChanged()
+
+    return missing_sources
+
+
+def _GetUniquePlatforms(spec):
+    """Returns the list of unique platforms for this spec, e.g ['win32', ...].
+
+    Arguments:
+      spec: The target dictionary containing the properties of the target.
+    Returns:
+      The MSVSUserFile object created.
+    """
+    # Gather list of unique platforms.
+    platforms = OrderedSet()
+    for configuration in spec["configurations"]:
+        platforms.add(_ConfigPlatform(spec["configurations"][configuration]))
+    platforms = list(platforms)
+    return platforms
+
+
+def _CreateMSVSUserFile(proj_path, version, spec):
+    """Generates a .user file for the user running this Gyp program.
+
+    Arguments:
+      proj_path: The path of the project file being created.  The .user file
+                 shares the same path (with an appropriate suffix).
+      version: The VisualStudioVersion object.
+      spec: The target dictionary containing the properties of the target.
+    Returns:
+      The MSVSUserFile object created.
+    """
+    (domain, username) = _GetDomainAndUserName()
+    vcuser_filename = ".".join([proj_path, domain, username, "user"])
+    user_file = MSVSUserFile.Writer(vcuser_filename, version, spec["target_name"])
+    return user_file
+
+
+def _GetMSVSConfigurationType(spec, build_file):
+    """Returns the configuration type for this project.
+
+    It's a number defined by Microsoft.  May raise an exception.
+
+    Args:
+        spec: The target dictionary containing the properties of the target.
+        build_file: The path of the gyp file.
+    Returns:
+        An integer, the configuration type.
+    """
+    try:
+        config_type = {
+            "executable": "1",  # .exe
+            "shared_library": "2",  # .dll
+            "loadable_module": "2",  # .dll
+            "static_library": "4",  # .lib
+            "windows_driver": "5",  # .sys
+            "none": "10",  # Utility type
+        }[spec["type"]]
+    except KeyError:
+        if spec.get("type"):
+            raise GypError(
+                "Target type %s is not a valid target type for "
+                "target %s in %s." % (spec["type"], spec["target_name"], build_file)
+            )
+        else:
+            raise GypError(
+                "Missing type field for target %s in %s."
+                % (spec["target_name"], build_file)
+            )
+    return config_type
+
+
+def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config):
+    """Adds a configuration to the MSVS project.
+
+    Many settings in a vcproj file are specific to a configuration.  This
+    function the main part of the vcproj file that's configuration specific.
+
+    Arguments:
+      p: The target project being generated.
+      spec: The target dictionary containing the properties of the target.
+      config_type: The configuration type, a number as defined by Microsoft.
+      config_name: The name of the configuration.
+      config: The dictionary that defines the special processing to be done
+              for this configuration.
+    """
+    # Get the information for this configuration
+    include_dirs, midl_include_dirs, resource_include_dirs = _GetIncludeDirs(config)
+    libraries = _GetLibraries(spec)
+    library_dirs = _GetLibraryDirs(config)
+    out_file, vc_tool, _ = _GetOutputFilePathAndTool(spec, msbuild=False)
+    defines = _GetDefines(config)
+    defines = [_EscapeCppDefineForMSVS(d) for d in defines]
+    disabled_warnings = _GetDisabledWarnings(config)
+    prebuild = config.get("msvs_prebuild")
+    postbuild = config.get("msvs_postbuild")
+    def_file = _GetModuleDefinition(spec)
+    precompiled_header = config.get("msvs_precompiled_header")
+
+    # Prepare the list of tools as a dictionary.
+    tools = {}
+    # Add in user specified msvs_settings.
+    msvs_settings = config.get("msvs_settings", {})
+    MSVSSettings.ValidateMSVSSettings(msvs_settings)
+
+    # Prevent default library inheritance from the environment.
+    _ToolAppend(tools, "VCLinkerTool", "AdditionalDependencies", ["$(NOINHERIT)"])
+
+    for tool in msvs_settings:
+        settings = config["msvs_settings"][tool]
+        for setting in settings:
+            _ToolAppend(tools, tool, setting, settings[setting])
+    # Add the information to the appropriate tool
+    _ToolAppend(tools, "VCCLCompilerTool", "AdditionalIncludeDirectories", include_dirs)
+    _ToolAppend(tools, "VCMIDLTool", "AdditionalIncludeDirectories", midl_include_dirs)
+    _ToolAppend(
+        tools,
+        "VCResourceCompilerTool",
+        "AdditionalIncludeDirectories",
+        resource_include_dirs,
+    )
+    # Add in libraries.
+    _ToolAppend(tools, "VCLinkerTool", "AdditionalDependencies", libraries)
+    _ToolAppend(tools, "VCLinkerTool", "AdditionalLibraryDirectories", library_dirs)
+    if out_file:
+        _ToolAppend(tools, vc_tool, "OutputFile", out_file, only_if_unset=True)
+    # Add defines.
+    _ToolAppend(tools, "VCCLCompilerTool", "PreprocessorDefinitions", defines)
+    _ToolAppend(tools, "VCResourceCompilerTool", "PreprocessorDefinitions", defines)
+    # Change program database directory to prevent collisions.
+    _ToolAppend(
+        tools,
+        "VCCLCompilerTool",
+        "ProgramDataBaseFileName",
+        "$(IntDir)$(ProjectName)\\vc80.pdb",
+        only_if_unset=True,
+    )
+    # Add disabled warnings.
+    _ToolAppend(tools, "VCCLCompilerTool", "DisableSpecificWarnings", disabled_warnings)
+    # Add Pre-build.
+    _ToolAppend(tools, "VCPreBuildEventTool", "CommandLine", prebuild)
+    # Add Post-build.
+    _ToolAppend(tools, "VCPostBuildEventTool", "CommandLine", postbuild)
+    # Turn on precompiled headers if appropriate.
+    if precompiled_header:
+        precompiled_header = os.path.split(precompiled_header)[1]
+        _ToolAppend(tools, "VCCLCompilerTool", "UsePrecompiledHeader", "2")
+        _ToolAppend(
+            tools, "VCCLCompilerTool", "PrecompiledHeaderThrough", precompiled_header
+        )
+        _ToolAppend(tools, "VCCLCompilerTool", "ForcedIncludeFiles", precompiled_header)
+    # Loadable modules don't generate import libraries;
+    # tell dependent projects to not expect one.
+    if spec["type"] == "loadable_module":
+        _ToolAppend(tools, "VCLinkerTool", "IgnoreImportLibrary", "true")
+    # Set the module definition file if any.
+    if def_file:
+        _ToolAppend(tools, "VCLinkerTool", "ModuleDefinitionFile", def_file)
+
+    _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name)
+
+
+def _GetIncludeDirs(config):
+    """Returns the list of directories to be used for #include directives.
+
+    Arguments:
+      config: The dictionary that defines the special processing to be done
+              for this configuration.
+    Returns:
+      The list of directory paths.
+    """
+    # TODO(bradnelson): include_dirs should really be flexible enough not to
+    #                   require this sort of thing.
+    include_dirs = config.get("include_dirs", []) + config.get(
+        "msvs_system_include_dirs", []
+    )
+    midl_include_dirs = config.get("midl_include_dirs", []) + config.get(
+        "msvs_system_include_dirs", []
+    )
+    resource_include_dirs = config.get("resource_include_dirs", include_dirs)
+    include_dirs = _FixPaths(include_dirs)
+    midl_include_dirs = _FixPaths(midl_include_dirs)
+    resource_include_dirs = _FixPaths(resource_include_dirs)
+    return include_dirs, midl_include_dirs, resource_include_dirs
+
+
+def _GetLibraryDirs(config):
+    """Returns the list of directories to be used for library search paths.
+
+    Arguments:
+      config: The dictionary that defines the special processing to be done
+              for this configuration.
+    Returns:
+      The list of directory paths.
+    """
+
+    library_dirs = config.get("library_dirs", [])
+    library_dirs = _FixPaths(library_dirs)
+    return library_dirs
+
+
+def _GetLibraries(spec):
+    """Returns the list of libraries for this configuration.
+
+    Arguments:
+      spec: The target dictionary containing the properties of the target.
+    Returns:
+      The list of directory paths.
+    """
+    libraries = spec.get("libraries", [])
+    # Strip out -l, as it is not used on windows (but is needed so we can pass
+    # in libraries that are assumed to be in the default library path).
+    # Also remove duplicate entries, leaving only the last duplicate, while
+    # preserving order.
+    found = OrderedSet()
+    unique_libraries_list = []
+    for entry in reversed(libraries):
+        library = re.sub(r"^\-l", "", entry)
+        if not os.path.splitext(library)[1]:
+            library += ".lib"
+        if library not in found:
+            found.add(library)
+            unique_libraries_list.append(library)
+    unique_libraries_list.reverse()
+    return unique_libraries_list
+
+
+def _GetOutputFilePathAndTool(spec, msbuild):
+    """Returns the path and tool to use for this target.
+
+    Figures out the path of the file this spec will create and the name of
+    the VC tool that will create it.
+
+    Arguments:
+      spec: The target dictionary containing the properties of the target.
+    Returns:
+      A triple of (file path, name of the vc tool, name of the msbuild tool)
+    """
+    # Select a name for the output file.
+    out_file = ""
+    vc_tool = ""
+    msbuild_tool = ""
+    output_file_map = {
+        "executable": ("VCLinkerTool", "Link", "$(OutDir)", ".exe"),
+        "shared_library": ("VCLinkerTool", "Link", "$(OutDir)", ".dll"),
+        "loadable_module": ("VCLinkerTool", "Link", "$(OutDir)", ".dll"),
+        "windows_driver": ("VCLinkerTool", "Link", "$(OutDir)", ".sys"),
+        "static_library": ("VCLibrarianTool", "Lib", "$(OutDir)lib\\", ".lib"),
+    }
+    output_file_props = output_file_map.get(spec["type"])
+    if output_file_props and int(spec.get("msvs_auto_output_file", 1)):
+        vc_tool, msbuild_tool, out_dir, suffix = output_file_props
+        if spec.get("standalone_static_library", 0):
+            out_dir = "$(OutDir)"
+        out_dir = spec.get("product_dir", out_dir)
+        product_extension = spec.get("product_extension")
+        if product_extension:
+            suffix = "." + product_extension
+        elif msbuild:
+            suffix = "$(TargetExt)"
+        prefix = spec.get("product_prefix", "")
+        product_name = spec.get("product_name", "$(ProjectName)")
+        out_file = ntpath.join(out_dir, prefix + product_name + suffix)
+    return out_file, vc_tool, msbuild_tool
+
+
+def _GetOutputTargetExt(spec):
+    """Returns the extension for this target, including the dot
+
+    If product_extension is specified, set target_extension to this to avoid
+    MSB8012, returns None otherwise. Ignores any target_extension settings in
+    the input files.
+
+    Arguments:
+      spec: The target dictionary containing the properties of the target.
+    Returns:
+      A string with the extension, or None
+    """
+    if target_extension := spec.get("product_extension"):
+        return "." + target_extension
+    return None
+
+
+def _GetDefines(config):
+    """Returns the list of preprocessor definitions for this configuration.
+
+    Arguments:
+      config: The dictionary that defines the special processing to be done
+              for this configuration.
+    Returns:
+      The list of preprocessor definitions.
+    """
+    defines = []
+    for d in config.get("defines", []):
+        fd = "=".join([str(dpart) for dpart in d]) if isinstance(d, list) else str(d)
+        defines.append(fd)
+    return defines
+
+
+def _GetDisabledWarnings(config):
+    return [str(i) for i in config.get("msvs_disabled_warnings", [])]
+
+
+def _GetModuleDefinition(spec):
+    def_file = ""
+    if spec["type"] in [
+        "shared_library",
+        "loadable_module",
+        "executable",
+        "windows_driver",
+    ]:
+        def_files = [s for s in spec.get("sources", []) if s.endswith(".def")]
+        if len(def_files) == 1:
+            def_file = _FixPath(def_files[0])
+        elif def_files:
+            raise ValueError(
+                "Multiple module definition files in one target, target %s lists "
+                "multiple .def files: %s" % (spec["target_name"], " ".join(def_files))
+            )
+    return def_file
+
+
+def _ConvertToolsToExpectedForm(tools):
+    """Convert tools to a form expected by Visual Studio.
+
+    Arguments:
+      tools: A dictionary of settings; the tool name is the key.
+    Returns:
+      A list of Tool objects.
+    """
+    tool_list = []
+    for tool, settings in tools.items():
+        # Collapse settings with lists.
+        settings_fixed = {}
+        for setting, value in settings.items():
+            if isinstance(value, list):
+                if (
+                    tool == "VCLinkerTool" and setting == "AdditionalDependencies"
+                ) or setting == "AdditionalOptions":
+                    settings_fixed[setting] = " ".join(value)
+                else:
+                    settings_fixed[setting] = ";".join(value)
+            else:
+                settings_fixed[setting] = value
+        # Add in this tool.
+        tool_list.append(MSVSProject.Tool(tool, settings_fixed))
+    return tool_list
+
+
+def _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name):
+    """Add to the project file the configuration specified by config.
+
+    Arguments:
+      p: The target project being generated.
+      spec: the target project dict.
+      tools: A dictionary of settings; the tool name is the key.
+      config: The dictionary that defines the special processing to be done
+              for this configuration.
+      config_type: The configuration type, a number as defined by Microsoft.
+      config_name: The name of the configuration.
+    """
+    attributes = _GetMSVSAttributes(spec, config, config_type)
+    # Add in this configuration.
+    tool_list = _ConvertToolsToExpectedForm(tools)
+    p.AddConfig(_ConfigFullName(config_name, config), attrs=attributes, tools=tool_list)
+
+
+def _GetMSVSAttributes(spec, config, config_type):
+    # Prepare configuration attributes.
+    prepared_attrs = {}
+    source_attrs = config.get("msvs_configuration_attributes", {})
+    for a in source_attrs:
+        prepared_attrs[a] = source_attrs[a]
+    # Add props files.
+    vsprops_dirs = config.get("msvs_props", [])
+    vsprops_dirs = _FixPaths(vsprops_dirs)
+    if vsprops_dirs:
+        prepared_attrs["InheritedPropertySheets"] = ";".join(vsprops_dirs)
+    # Set configuration type.
+    prepared_attrs["ConfigurationType"] = config_type
+    output_dir = prepared_attrs.get(
+        "OutputDirectory", "$(SolutionDir)$(ConfigurationName)"
+    )
+    prepared_attrs["OutputDirectory"] = _FixPath(output_dir) + "\\"
+    if "IntermediateDirectory" not in prepared_attrs:
+        intermediate = "$(ConfigurationName)\\obj\\$(ProjectName)"
+        prepared_attrs["IntermediateDirectory"] = _FixPath(intermediate) + "\\"
+    else:
+        intermediate = _FixPath(prepared_attrs["IntermediateDirectory"]) + "\\"
+        intermediate = MSVSSettings.FixVCMacroSlashes(intermediate)
+        prepared_attrs["IntermediateDirectory"] = intermediate
+    return prepared_attrs
+
+
+def _AddNormalizedSources(sources_set, sources_array):
+    sources_set.update(_NormalizedSource(s) for s in sources_array)
+
+
+def _PrepareListOfSources(spec, generator_flags, gyp_file):
+    """Prepare list of sources and excluded sources.
+
+    Besides the sources specified directly in the spec, adds the gyp file so
+    that a change to it will cause a re-compile. Also adds appropriate sources
+    for actions and copies. Assumes later stage will un-exclude files which
+    have custom build steps attached.
+
+    Arguments:
+      spec: The target dictionary containing the properties of the target.
+      gyp_file: The name of the gyp file.
+    Returns:
+      A pair of (list of sources, list of excluded sources).
+      The sources will be relative to the gyp file.
+    """
+    sources = OrderedSet()
+    _AddNormalizedSources(sources, spec.get("sources", []))
+    excluded_sources = OrderedSet()
+    # Add in the gyp file.
+    if not generator_flags.get("standalone"):
+        sources.add(gyp_file)
+
+    # Add in 'action' inputs and outputs.
+    for a in spec.get("actions", []):
+        inputs = a["inputs"]
+        inputs = [_NormalizedSource(i) for i in inputs]
+        # Add all inputs to sources and excluded sources.
+        inputs = OrderedSet(inputs)
+        sources.update(inputs)
+        if not spec.get("msvs_external_builder"):
+            excluded_sources.update(inputs)
+        if int(a.get("process_outputs_as_sources", False)):
+            _AddNormalizedSources(sources, a.get("outputs", []))
+    # Add in 'copies' inputs and outputs.
+    for cpy in spec.get("copies", []):
+        _AddNormalizedSources(sources, cpy.get("files", []))
+    return (sources, excluded_sources)
+
+
+def _AdjustSourcesAndConvertToFilterHierarchy(
+    spec, options, gyp_dir, sources, excluded_sources, list_excluded, version
+):
+    """Adjusts the list of sources and excluded sources.
+
+    Also converts the sets to lists.
+
+    Arguments:
+      spec: The target dictionary containing the properties of the target.
+      options: Global generator options.
+      gyp_dir: The path to the gyp file being processed.
+      sources: A set of sources to be included for this project.
+      excluded_sources: A set of sources to be excluded for this project.
+      version: A MSVSVersion object.
+    Returns:
+      A trio of (list of sources, list of excluded sources,
+                 path of excluded IDL file)
+    """
+    # Exclude excluded sources coming into the generator.
+    excluded_sources.update(OrderedSet(spec.get("sources_excluded", [])))
+    # Add excluded sources into sources for good measure.
+    sources.update(excluded_sources)
+    # Convert to proper windows form.
+    # NOTE: sources goes from being a set to a list here.
+    # NOTE: excluded_sources goes from being a set to a list here.
+    sources = _FixPaths(sources)
+    # Convert to proper windows form.
+    excluded_sources = _FixPaths(excluded_sources)
+
+    excluded_idl = _IdlFilesHandledNonNatively(spec, sources)
+
+    precompiled_related = _GetPrecompileRelatedFiles(spec)
+    # Find the excluded ones, minus the precompiled header related ones.
+    fully_excluded = [i for i in excluded_sources if i not in precompiled_related]
+
+    # Convert to folders and the right slashes.
+    sources = [i.split("\\") for i in sources]
+    sources = _ConvertSourcesToFilterHierarchy(
+        sources,
+        excluded=fully_excluded,
+        list_excluded=list_excluded,
+        msvs_version=version,
+    )
+
+    # Prune filters with a single child to flatten ugly directory structures
+    # such as ../../src/modules/module1 etc.
+    if version.UsesVcxproj():
+        while (
+            all(isinstance(s, MSVSProject.Filter) for s in sources)
+            and len({s.name for s in sources}) == 1
+        ):
+            assert all(len(s.contents) == 1 for s in sources)
+            sources = [s.contents[0] for s in sources]
+    else:
+        while len(sources) == 1 and isinstance(sources[0], MSVSProject.Filter):
+            sources = sources[0].contents
+
+    return sources, excluded_sources, excluded_idl
+
+
+def _IdlFilesHandledNonNatively(spec, sources):
+    # If any non-native rules use 'idl' as an extension exclude idl files.
+    # Gather a list here to use later.
+    using_idl = False
+    for rule in spec.get("rules", []):
+        if rule["extension"] == "idl" and int(rule.get("msvs_external_rule", 0)):
+            using_idl = True
+            break
+    excluded_idl = [i for i in sources if i.endswith(".idl")] if using_idl else []
+    return excluded_idl
+
+
+def _GetPrecompileRelatedFiles(spec):
+    # Gather a list of precompiled header related sources.
+    precompiled_related = []
+    for _, config in spec["configurations"].items():
+        for k in precomp_keys:
+            f = config.get(k)
+            if f:
+                precompiled_related.append(_FixPath(f))
+    return precompiled_related
+
+
+def _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, list_excluded):
+    exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl)
+    for file_name, excluded_configs in exclusions.items():
+        if not list_excluded and len(excluded_configs) == len(spec["configurations"]):
+            # If we're not listing excluded files, then they won't appear in the
+            # project, so don't try to configure them to be excluded.
+            pass
+        else:
+            for config_name, config in excluded_configs:
+                p.AddFileConfig(
+                    file_name,
+                    _ConfigFullName(config_name, config),
+                    {"ExcludedFromBuild": "true"},
+                )
+
+
+def _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl):
+    exclusions = {}
+    # Exclude excluded sources from being built.
+    for f in excluded_sources:
+        excluded_configs = []
+        for config_name, config in spec["configurations"].items():
+            precomped = [_FixPath(config.get(i, "")) for i in precomp_keys]
+            # Don't do this for ones that are precompiled header related.
+            if f not in precomped:
+                excluded_configs.append((config_name, config))
+        exclusions[f] = excluded_configs
+    # If any non-native rules use 'idl' as an extension exclude idl files.
+    # Exclude them now.
+    for f in excluded_idl:
+        excluded_configs = []
+        for config_name, config in spec["configurations"].items():
+            excluded_configs.append((config_name, config))
+        exclusions[f] = excluded_configs
+    return exclusions
+
+
+def _AddToolFilesToMSVS(p, spec):
+    # Add in tool files (rules).
+    tool_files = OrderedSet()
+    for _, config in spec["configurations"].items():
+        for f in config.get("msvs_tool_files", []):
+            tool_files.add(f)
+    for f in tool_files:
+        p.AddToolFile(f)
+
+
+def _HandlePreCompiledHeaders(p, sources, spec):
+    # Pre-compiled header source stubs need a different compiler flag
+    # (generate precompiled header) and any source file not of the same
+    # kind (i.e. C vs. C++) as the precompiled header source stub needs
+    # to have use of precompiled headers disabled.
+    extensions_excluded_from_precompile = []
+    for config_name, config in spec["configurations"].items():
+        source = config.get("msvs_precompiled_source")
+        if source:
+            source = _FixPath(source)
+            # UsePrecompiledHeader=1 for if using precompiled headers.
+            tool = MSVSProject.Tool("VCCLCompilerTool", {"UsePrecompiledHeader": "1"})
+            p.AddFileConfig(
+                source, _ConfigFullName(config_name, config), {}, tools=[tool]
+            )
+            _basename, extension = os.path.splitext(source)
+            if extension == ".c":
+                extensions_excluded_from_precompile = [".cc", ".cpp", ".cxx"]
+            else:
+                extensions_excluded_from_precompile = [".c"]
+
+    def DisableForSourceTree(source_tree):
+        for source in source_tree:
+            if isinstance(source, MSVSProject.Filter):
+                DisableForSourceTree(source.contents)
+            else:
+                _basename, extension = os.path.splitext(source)
+                if extension in extensions_excluded_from_precompile:
+                    for config_name, config in spec["configurations"].items():
+                        tool = MSVSProject.Tool(
+                            "VCCLCompilerTool",
+                            {
+                                "UsePrecompiledHeader": "0",
+                                "ForcedIncludeFiles": "$(NOINHERIT)",
+                            },
+                        )
+                        p.AddFileConfig(
+                            _FixPath(source),
+                            _ConfigFullName(config_name, config),
+                            {},
+                            tools=[tool],
+                        )
+
+    # Do nothing if there was no precompiled source.
+    if extensions_excluded_from_precompile:
+        DisableForSourceTree(sources)
+
+
+def _AddActions(actions_to_add, spec, relative_path_of_gyp_file):
+    # Add actions.
+    actions = spec.get("actions", [])
+    # Don't setup_env every time. When all the actions are run together in one
+    # batch file in VS, the PATH will grow too long.
+    # Membership in this set means that the cygwin environment has been set up,
+    # and does not need to be set up again.
+    have_setup_env = set()
+    for a in actions:
+        # Attach actions to the gyp file if nothing else is there.
+        inputs = a.get("inputs") or [relative_path_of_gyp_file]
+        attached_to = inputs[0]
+        need_setup_env = attached_to not in have_setup_env
+        cmd = _BuildCommandLineForRule(
+            spec, a, has_input_path=False, do_setup_env=need_setup_env
+        )
+        have_setup_env.add(attached_to)
+        # Add the action.
+        _AddActionStep(
+            actions_to_add,
+            inputs=inputs,
+            outputs=a.get("outputs", []),
+            description=a.get("message", a["action_name"]),
+            command=cmd,
+        )
+
+
+def _WriteMSVSUserFile(project_path, version, spec):
+    # Add run_as and test targets.
+    if "run_as" in spec:
+        run_as = spec["run_as"]
+        action = run_as.get("action", [])
+        environment = run_as.get("environment", [])
+        working_directory = run_as.get("working_directory", ".")
+    elif int(spec.get("test", 0)):
+        action = ["$(TargetPath)", "--gtest_print_time"]
+        environment = []
+        working_directory = "."
+    else:
+        return  # Nothing to add
+    # Write out the user file.
+    user_file = _CreateMSVSUserFile(project_path, version, spec)
+    for config_name, c_data in spec["configurations"].items():
+        user_file.AddDebugSettings(
+            _ConfigFullName(config_name, c_data), action, environment, working_directory
+        )
+    user_file.WriteIfChanged()
+
+
+def _AddCopies(actions_to_add, spec):
+    copies = _GetCopies(spec)
+    for inputs, outputs, cmd, description in copies:
+        _AddActionStep(
+            actions_to_add,
+            inputs=inputs,
+            outputs=outputs,
+            description=description,
+            command=cmd,
+        )
+
+
+def _GetCopies(spec):
+    copies = []
+    # Add copies.
+    for cpy in spec.get("copies", []):
+        for src in cpy.get("files", []):
+            dst = os.path.join(cpy["destination"], os.path.basename(src))
+            # _AddCustomBuildToolForMSVS() will call _FixPath() on the inputs and
+            # outputs, so do the same for our generated command line.
+            if src.endswith("/"):
+                src_bare = src[:-1]
+                base_dir = posixpath.split(src_bare)[0]
+                outer_dir = posixpath.split(src_bare)[1]
+                fixed_dst = _FixPath(dst)
+                full_dst = f'"{fixed_dst}\\{outer_dir}\\"'
+                cmd = (
+                    f'mkdir {full_dst} 2>nul & cd "{_FixPath(base_dir)}" '
+                    f'&& xcopy /e /f /y "{outer_dir}" {full_dst}'
+                )
+                copies.append(
+                    (
+                        [src],
+                        ["dummy_copies", dst],
+                        cmd,
+                        f"Copying {src} to {fixed_dst}",
+                    )
+                )
+            else:
+                fix_dst = _FixPath(cpy["destination"])
+                cmd = (
+                    f'mkdir "{fix_dst}" 2>nul & set ERRORLEVEL=0 & '
+                    f'copy /Y "{_FixPath(src)}" "{_FixPath(dst)}"'
+                )
+                copies.append(([src], [dst], cmd, f"Copying {src} to {fix_dst}"))
+    return copies
+
+
+def _GetPathDict(root, path):
+    # |path| will eventually be empty (in the recursive calls) if it was initially
+    # relative; otherwise it will eventually end up as '\', 'D:\', etc.
+    if not path or path.endswith(os.sep):
+        return root
+    parent, folder = os.path.split(path)
+    parent_dict = _GetPathDict(root, parent)
+    if folder not in parent_dict:
+        parent_dict[folder] = {}
+    return parent_dict[folder]
+
+
+def _DictsToFolders(base_path, bucket, flat):
+    # Convert to folders recursively.
+    children = []
+    for folder, contents in bucket.items():
+        if isinstance(contents, dict):
+            folder_children = _DictsToFolders(
+                os.path.join(base_path, folder), contents, flat
+            )
+            if flat:
+                children += folder_children
+            else:
+                folder_children = MSVSNew.MSVSFolder(
+                    os.path.join(base_path, folder),
+                    name="(" + folder + ")",
+                    entries=folder_children,
+                )
+                children.append(folder_children)
+        else:
+            children.append(contents)
+    return children
+
+
+def _CollapseSingles(parent, node):
+    # Recursively explorer the tree of dicts looking for projects which are
+    # the sole item in a folder which has the same name as the project. Bring
+    # such projects up one level.
+    if (
+        isinstance(node, dict)
+        and len(node) == 1
+        and next(iter(node)) == parent + ".vcproj"
+    ):
+        return node[next(iter(node))]
+    if not isinstance(node, dict):
+        return node
+    for child in node:
+        node[child] = _CollapseSingles(child, node[child])
+    return node
+
+
+def _GatherSolutionFolders(sln_projects, project_objects, flat):
+    root = {}
+    # Convert into a tree of dicts on path.
+    for p in sln_projects:
+        gyp_file, target = gyp.common.ParseQualifiedTarget(p)[0:2]
+        if p.endswith("#host"):
+            target += "_host"
+        gyp_dir = os.path.dirname(gyp_file)
+        path_dict = _GetPathDict(root, gyp_dir)
+        path_dict[target + ".vcproj"] = project_objects[p]
+    # Walk down from the top until we hit a folder that has more than one entry.
+    # In practice, this strips the top-level "src/" dir from the hierarchy in
+    # the solution.
+    while len(root) == 1 and isinstance(root[next(iter(root))], dict):
+        root = root[next(iter(root))]
+    # Collapse singles.
+    root = _CollapseSingles("", root)
+    # Merge buckets until everything is a root entry.
+    return _DictsToFolders("", root, flat)
+
+
+def _GetPathOfProject(qualified_target, spec, options, msvs_version):
+    default_config = _GetDefaultConfiguration(spec)
+    proj_filename = default_config.get("msvs_existing_vcproj")
+    if not proj_filename:
+        proj_filename = spec["target_name"]
+        if spec["toolset"] == "host":
+            proj_filename += "_host"
+        proj_filename = proj_filename + options.suffix + msvs_version.ProjectExtension()
+
+    build_file = gyp.common.BuildFile(qualified_target)
+    proj_path = os.path.join(os.path.dirname(build_file), proj_filename)
+    fix_prefix = None
+    if options.generator_output:
+        project_dir_path = os.path.dirname(os.path.abspath(proj_path))
+        proj_path = os.path.join(options.generator_output, proj_path)
+        fix_prefix = gyp.common.RelativePath(
+            project_dir_path, os.path.dirname(proj_path)
+        )
+    return proj_path, fix_prefix
+
+
+def _GetPlatformOverridesOfProject(spec):
+    # Prepare a dict indicating which project configurations are used for which
+    # solution configurations for this target.
+    config_platform_overrides = {}
+    for config_name, c in spec["configurations"].items():
+        config_fullname = _ConfigFullName(config_name, c)
+        platform = c.get("msvs_target_platform", _ConfigPlatform(c))
+        base_name = _ConfigBaseName(config_name, _ConfigPlatform(c))
+        fixed_config_fullname = f"{base_name}|{platform}"
+        if spec["toolset"] == "host" and generator_supports_multiple_toolsets:
+            fixed_config_fullname = f"{config_name}|x64"
+        config_platform_overrides[config_fullname] = fixed_config_fullname
+    return config_platform_overrides
+
+
+def _CreateProjectObjects(target_list, target_dicts, options, msvs_version):
+    """Create a MSVSProject object for the targets found in target list.
+
+    Arguments:
+      target_list: the list of targets to generate project objects for.
+      target_dicts: the dictionary of specifications.
+      options: global generator options.
+      msvs_version: the MSVSVersion object.
+    Returns:
+      A set of created projects, keyed by target.
+    """
+    global fixpath_prefix
+    # Generate each project.
+    projects = {}
+    for qualified_target in target_list:
+        spec = target_dicts[qualified_target]
+        proj_path, fixpath_prefix = _GetPathOfProject(
+            qualified_target, spec, options, msvs_version
+        )
+        guid = _GetGuidOfProject(proj_path, spec)
+        overrides = _GetPlatformOverridesOfProject(spec)
+        build_file = gyp.common.BuildFile(qualified_target)
+        # Create object for this project.
+        target_name = spec["target_name"]
+        if spec["toolset"] == "host":
+            target_name += "_host"
+        obj = MSVSNew.MSVSProject(
+            proj_path,
+            name=target_name,
+            guid=guid,
+            spec=spec,
+            build_file=build_file,
+            config_platform_overrides=overrides,
+            fixpath_prefix=fixpath_prefix,
+        )
+        # Set project toolset if any (MS build only)
+        if msvs_version.UsesVcxproj():
+            obj.set_msbuild_toolset(
+                _GetMsbuildToolsetOfProject(proj_path, spec, msvs_version)
+            )
+        projects[qualified_target] = obj
+    # Set all the dependencies, but not if we are using an external builder like
+    # ninja
+    for project in projects.values():
+        if not project.spec.get("msvs_external_builder"):
+            deps = project.spec.get("dependencies", [])
+            deps = [projects[d] for d in deps]
+            project.set_dependencies(deps)
+    return projects
+
+
+def _InitNinjaFlavor(params, target_list, target_dicts):
+    """Initialize targets for the ninja flavor.
+
+    This sets up the necessary variables in the targets to generate msvs projects
+    that use ninja as an external builder. The variables in the spec are only set
+    if they have not been set. This allows individual specs to override the
+    default values initialized here.
+    Arguments:
+      params: Params provided to the generator.
+      target_list: List of target pairs: 'base/base.gyp:base'.
+      target_dicts: Dict of target properties keyed on target pair.
+    """
+    for qualified_target in target_list:
+        spec = target_dicts[qualified_target]
+        if spec.get("msvs_external_builder"):
+            # The spec explicitly defined an external builder, so don't change it.
+            continue
+
+        path_to_ninja = spec.get("msvs_path_to_ninja", "ninja.exe")
+
+        spec["msvs_external_builder"] = "ninja"
+        if not spec.get("msvs_external_builder_out_dir"):
+            gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target)
+            gyp_dir = os.path.dirname(gyp_file)
+            configuration = "$(Configuration)"
+            if params.get("target_arch") == "x64":
+                configuration += "_x64"
+            if params.get("target_arch") == "arm64":
+                configuration += "_arm64"
+            spec["msvs_external_builder_out_dir"] = os.path.join(
+                gyp.common.RelativePath(params["options"].toplevel_dir, gyp_dir),
+                ninja_generator.ComputeOutputDir(params),
+                configuration,
+            )
+        if not spec.get("msvs_external_builder_build_cmd"):
+            spec["msvs_external_builder_build_cmd"] = [
+                path_to_ninja,
+                "-C",
+                "$(OutDir)",
+                "$(ProjectName)",
+            ]
+        if not spec.get("msvs_external_builder_clean_cmd"):
+            spec["msvs_external_builder_clean_cmd"] = [
+                path_to_ninja,
+                "-C",
+                "$(OutDir)",
+                "-tclean",
+                "$(ProjectName)",
+            ]
+
+
+def CalculateVariables(default_variables, params):
+    """Generated variables that require params to be known."""
+
+    generator_flags = params.get("generator_flags", {})
+
+    # Select project file format version (if unset, default to auto detecting).
+    msvs_version = MSVSVersion.SelectVisualStudioVersion(
+        generator_flags.get("msvs_version", "auto")
+    )
+    # Stash msvs_version for later (so we don't have to probe the system twice).
+    params["msvs_version"] = msvs_version
+
+    # Set a variable so conditions can be based on msvs_version.
+    default_variables["MSVS_VERSION"] = msvs_version.ShortName()
+
+    # To determine processor word size on Windows, in addition to checking
+    # PROCESSOR_ARCHITECTURE (which reflects the word size of the current
+    # process), it is also necessary to check PROCESSOR_ARCITEW6432 (which
+    # contains the actual word size of the system when running thru WOW64).
+    if (
+        os.environ.get("PROCESSOR_ARCHITECTURE", "").find("64") >= 0
+        or os.environ.get("PROCESSOR_ARCHITEW6432", "").find("64") >= 0
+    ):
+        default_variables["MSVS_OS_BITS"] = 64
+    else:
+        default_variables["MSVS_OS_BITS"] = 32
+
+    if gyp.common.GetFlavor(params) == "ninja":
+        default_variables["SHARED_INTERMEDIATE_DIR"] = "$(OutDir)gen"
+
+
+def PerformBuild(data, configurations, params):
+    options = params["options"]
+    msvs_version = params["msvs_version"]
+    devenv = os.path.join(msvs_version.path, "Common7", "IDE", "devenv.com")
+
+    for build_file, build_file_dict in data.items():
+        (build_file_root, build_file_ext) = os.path.splitext(build_file)
+        if build_file_ext != ".gyp":
+            continue
+        sln_path = build_file_root + options.suffix + ".sln"
+        if options.generator_output:
+            sln_path = os.path.join(options.generator_output, sln_path)
+
+    for config in configurations:
+        arguments = [devenv, sln_path, "/Build", config]
+        print(f"Building [{config}]: {arguments}")
+        subprocess.check_call(arguments)
+
+
+def CalculateGeneratorInputInfo(params):
+    if params.get("flavor") == "ninja":
+        toplevel = params["options"].toplevel_dir
+        qualified_out_dir = os.path.normpath(
+            os.path.join(
+                toplevel,
+                ninja_generator.ComputeOutputDir(params),
+                "gypfiles-msvs-ninja",
+            )
+        )
+
+        global generator_filelist_paths
+        generator_filelist_paths = {
+            "toplevel": toplevel,
+            "qualified_out_dir": qualified_out_dir,
+        }
+
+
+def GenerateOutput(target_list, target_dicts, data, params):
+    """Generate .sln and .vcproj files.
+
+    This is the entry point for this generator.
+    Arguments:
+      target_list: List of target pairs: 'base/base.gyp:base'.
+      target_dicts: Dict of target properties keyed on target pair.
+      data: Dictionary containing per .gyp data.
+    """
+    global fixpath_prefix
+
+    options = params["options"]
+
+    # Get the project file format version back out of where we stashed it in
+    # GeneratorCalculatedVariables.
+    msvs_version = params["msvs_version"]
+
+    generator_flags = params.get("generator_flags", {})
+
+    # Optionally shard targets marked with 'msvs_shard': SHARD_COUNT.
+    (target_list, target_dicts) = MSVSUtil.ShardTargets(target_list, target_dicts)
+
+    # Optionally use the large PDB workaround for targets marked with
+    # 'msvs_large_pdb': 1.
+    (target_list, target_dicts) = MSVSUtil.InsertLargePdbShims(
+        target_list, target_dicts, generator_default_variables
+    )
+
+    # Optionally configure each spec to use ninja as the external builder.
+    if params.get("flavor") == "ninja":
+        _InitNinjaFlavor(params, target_list, target_dicts)
+
+    # Prepare the set of configurations.
+    configs = set()
+    for qualified_target in target_list:
+        spec = target_dicts[qualified_target]
+        for config_name, config in spec["configurations"].items():
+            config_name = _ConfigFullName(config_name, config)
+            configs.add(config_name)
+            if config_name == "Release|arm64":
+                configs.add("Release|x64")
+    configs = list(configs)
+
+    # Figure out all the projects that will be generated and their guids
+    project_objects = _CreateProjectObjects(
+        target_list, target_dicts, options, msvs_version
+    )
+
+    # Generate each project.
+    missing_sources = []
+    for project in project_objects.values():
+        fixpath_prefix = project.fixpath_prefix
+        missing_sources.extend(
+            _GenerateProject(project, options, msvs_version, generator_flags, spec)
+        )
+    fixpath_prefix = None
+
+    for build_file in data:
+        # Validate build_file extension
+        target_only_configs = configs
+        if generator_supports_multiple_toolsets:
+            target_only_configs = [i for i in configs if i.endswith("arm64")]
+        if not build_file.endswith(".gyp"):
+            continue
+        sln_path = os.path.splitext(build_file)[0] + options.suffix + ".sln"
+        if options.generator_output:
+            sln_path = os.path.join(options.generator_output, sln_path)
+        # Get projects in the solution, and their dependents.
+        sln_projects = gyp.common.BuildFileTargets(target_list, build_file)
+        sln_projects += gyp.common.DeepDependencyTargets(target_dicts, sln_projects)
+        # Create folder hierarchy.
+        root_entries = _GatherSolutionFolders(
+            sln_projects, project_objects, flat=msvs_version.FlatSolution()
+        )
+        # Create solution.
+        sln = MSVSNew.MSVSSolution(
+            sln_path,
+            entries=root_entries,
+            variants=target_only_configs,
+            websiteProperties=False,
+            version=msvs_version,
+        )
+        sln.Write()
+
+    if missing_sources:
+        error_message = "Missing input files:\n" + "\n".join(set(missing_sources))
+        if generator_flags.get("msvs_error_on_missing_sources", False):
+            raise GypError(error_message)
+        else:
+            print("Warning: " + error_message, file=sys.stdout)
+
+
+def _GenerateMSBuildFiltersFile(
+    filters_path,
+    source_files,
+    rule_dependencies,
+    extension_to_rule_name,
+    platforms,
+    toolset,
+):
+    """Generate the filters file.
+
+    This file is used by Visual Studio to organize the presentation of source
+    files into folders.
+
+    Arguments:
+        filters_path: The path of the file to be created.
+        source_files: The hierarchical structure of all the sources.
+        extension_to_rule_name: A dictionary mapping file extensions to rules.
+    """
+    filter_group = []
+    source_group = []
+    _AppendFiltersForMSBuild(
+        "",
+        source_files,
+        rule_dependencies,
+        extension_to_rule_name,
+        platforms,
+        toolset,
+        filter_group,
+        source_group,
+    )
+    if filter_group:
+        content = [
+            "Project",
+            {
+                "ToolsVersion": "4.0",
+                "xmlns": "http://schemas.microsoft.com/developer/msbuild/2003",
+            },
+            ["ItemGroup"] + filter_group,
+            ["ItemGroup"] + source_group,
+        ]
+        easy_xml.WriteXmlIfChanged(content, filters_path, pretty=True, win32=True)
+    elif os.path.exists(filters_path):
+        # We don't need this filter anymore.  Delete the old filter file.
+        os.unlink(filters_path)
+
+
+def _AppendFiltersForMSBuild(
+    parent_filter_name,
+    sources,
+    rule_dependencies,
+    extension_to_rule_name,
+    platforms,
+    toolset,
+    filter_group,
+    source_group,
+):
+    """Creates the list of filters and sources to be added in the filter file.
+
+    Args:
+        parent_filter_name: The name of the filter under which the sources are
+            found.
+        sources: The hierarchy of filters and sources to process.
+        extension_to_rule_name: A dictionary mapping file extensions to rules.
+        filter_group: The list to which filter entries will be appended.
+        source_group: The list to which source entries will be appended.
+    """
+    for source in sources:
+        if isinstance(source, MSVSProject.Filter):
+            # We have a sub-filter.  Create the name of that sub-filter.
+            if not parent_filter_name:
+                filter_name = source.name
+            else:
+                filter_name = f"{parent_filter_name}\\{source.name}"
+            # Add the filter to the group.
+            filter_group.append(
+                [
+                    "Filter",
+                    {"Include": filter_name},
+                    ["UniqueIdentifier", MSVSNew.MakeGuid(source.name)],
+                ]
+            )
+            # Recurse and add its dependents.
+            _AppendFiltersForMSBuild(
+                filter_name,
+                source.contents,
+                rule_dependencies,
+                extension_to_rule_name,
+                platforms,
+                toolset,
+                filter_group,
+                source_group,
+            )
+        else:
+            # It's a source.  Create a source entry.
+            _, element = _MapFileToMsBuildSourceType(
+                source, rule_dependencies, extension_to_rule_name, platforms, toolset
+            )
+            source_entry = [element, {"Include": source}]
+            # Specify the filter it is part of, if any.
+            if parent_filter_name:
+                source_entry.append(["Filter", parent_filter_name])
+            source_group.append(source_entry)
+
+
+def _MapFileToMsBuildSourceType(
+    source, rule_dependencies, extension_to_rule_name, platforms, toolset
+):
+    """Returns the group and element type of the source file.
+
+    Arguments:
+        source: The source file name.
+        extension_to_rule_name: A dictionary mapping file extensions to rules.
+
+    Returns:
+        A pair of (group this file should be part of, the label of element)
+    """
+    _, ext = os.path.splitext(source)
+    ext = ext.lower()
+    if ext in extension_to_rule_name:
+        group = "rule"
+        element = extension_to_rule_name[ext]
+    elif ext in [".cc", ".cpp", ".c", ".cxx", ".mm"]:
+        group = "compile"
+        element = "ClCompile"
+    elif ext in [".h", ".hxx"]:
+        group = "include"
+        element = "ClInclude"
+    elif ext == ".rc":
+        group = "resource"
+        element = "ResourceCompile"
+    elif ext in [".s", ".asm"]:
+        group = "masm"
+        element = "MASM"
+        if "arm64" in platforms and toolset == "target":
+            element = "MARMASM"
+    elif ext == ".idl":
+        group = "midl"
+        element = "Midl"
+    elif source in rule_dependencies:
+        group = "rule_dependency"
+        element = "CustomBuild"
+    else:
+        group = "none"
+        element = "None"
+    return (group, element)
+
+
+def _GenerateRulesForMSBuild(
+    output_dir,
+    options,
+    spec,
+    sources,
+    excluded_sources,
+    props_files_of_rules,
+    targets_files_of_rules,
+    actions_to_add,
+    rule_dependencies,
+    extension_to_rule_name,
+):
+    # MSBuild rules are implemented using three files: an XML file, a .targets
+    # file and a .props file.
+    # For more details see:
+    # https://devblogs.microsoft.com/cppblog/quick-help-on-vs2010-custom-build-rule/
+    rules = spec.get("rules", [])
+    rules_native = [r for r in rules if not int(r.get("msvs_external_rule", 0))]
+    rules_external = [r for r in rules if int(r.get("msvs_external_rule", 0))]
+
+    msbuild_rules = []
+    for rule in rules_native:
+        # Skip a rule with no action and no inputs.
+        if "action" not in rule and not rule.get("rule_sources", []):
+            continue
+        msbuild_rule = MSBuildRule(rule, spec)
+        msbuild_rules.append(msbuild_rule)
+        rule_dependencies.update(msbuild_rule.additional_dependencies.split(";"))
+        extension_to_rule_name[msbuild_rule.extension] = msbuild_rule.rule_name
+    if msbuild_rules:
+        base = spec["target_name"] + options.suffix
+        props_name = base + ".props"
+        targets_name = base + ".targets"
+        xml_name = base + ".xml"
+
+        props_files_of_rules.add(props_name)
+        targets_files_of_rules.add(targets_name)
+
+        props_path = os.path.join(output_dir, props_name)
+        targets_path = os.path.join(output_dir, targets_name)
+        xml_path = os.path.join(output_dir, xml_name)
+
+        _GenerateMSBuildRulePropsFile(props_path, msbuild_rules)
+        _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules)
+        _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules)
+
+    if rules_external:
+        _GenerateExternalRules(
+            rules_external, output_dir, spec, sources, options, actions_to_add
+        )
+    _AdjustSourcesForRules(rules, sources, excluded_sources, True)
+
+
+class MSBuildRule:
+    """Used to store information used to generate an MSBuild rule.
+
+    Attributes:
+      rule_name: The rule name, sanitized to use in XML.
+      target_name: The name of the target.
+      after_targets: The name of the AfterTargets element.
+      before_targets: The name of the BeforeTargets element.
+      depends_on: The name of the DependsOn element.
+      compute_output: The name of the ComputeOutput element.
+      dirs_to_make: The name of the DirsToMake element.
+      inputs: The name of the _inputs element.
+      tlog: The name of the _tlog element.
+      extension: The extension this rule applies to.
+      description: The message displayed when this rule is invoked.
+      additional_dependencies: A string listing additional dependencies.
+      outputs: The outputs of this rule.
+      command: The command used to run the rule.
+    """
+
+    def __init__(self, rule, spec):
+        self.display_name = rule["rule_name"]
+        # Assure that the rule name is only characters and numbers
+        self.rule_name = re.sub(r"\W", "_", self.display_name)
+        # Create the various element names, following the example set by the
+        # Visual Studio 2008 to 2010 conversion.  I don't know if VS2010
+        # is sensitive to the exact names.
+        self.target_name = "_" + self.rule_name
+        self.after_targets = self.rule_name + "AfterTargets"
+        self.before_targets = self.rule_name + "BeforeTargets"
+        self.depends_on = self.rule_name + "DependsOn"
+        self.compute_output = "Compute%sOutput" % self.rule_name
+        self.dirs_to_make = self.rule_name + "DirsToMake"
+        self.inputs = self.rule_name + "_inputs"
+        self.tlog = self.rule_name + "_tlog"
+        self.extension = rule["extension"]
+        if not self.extension.startswith("."):
+            self.extension = "." + self.extension
+
+        self.description = MSVSSettings.ConvertVCMacrosToMSBuild(
+            rule.get("message", self.rule_name)
+        )
+        old_additional_dependencies = _FixPaths(rule.get("inputs", []))
+        self.additional_dependencies = ";".join(
+            [
+                MSVSSettings.ConvertVCMacrosToMSBuild(i)
+                for i in old_additional_dependencies
+            ]
+        )
+        old_outputs = _FixPaths(rule.get("outputs", []))
+        self.outputs = ";".join(
+            [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in old_outputs]
+        )
+        old_command = _BuildCommandLineForRule(
+            spec, rule, has_input_path=True, do_setup_env=True
+        )
+        self.command = MSVSSettings.ConvertVCMacrosToMSBuild(old_command)
+
+
+def _GenerateMSBuildRulePropsFile(props_path, msbuild_rules):
+    """Generate the .props file."""
+    content = [
+        "Project",
+        {"xmlns": "http://schemas.microsoft.com/developer/msbuild/2003"},
+    ]
+    for rule in msbuild_rules:
+        content.extend(
+            [
+                [
+                    "PropertyGroup",
+                    {
+                        "Condition": "'$(%s)' == '' and '$(%s)' == '' and "
+                        "'$(ConfigurationType)' != 'Makefile'"
+                        % (rule.before_targets, rule.after_targets)
+                    },
+                    [rule.before_targets, "Midl"],
+                    [rule.after_targets, "CustomBuild"],
+                ],
+                [
+                    "PropertyGroup",
+                    [
+                        rule.depends_on,
+                        {"Condition": "'$(ConfigurationType)' != 'Makefile'"},
+                        "_SelectedFiles;$(%s)" % rule.depends_on,
+                    ],
+                ],
+                [
+                    "ItemDefinitionGroup",
+                    [
+                        rule.rule_name,
+                        ["CommandLineTemplate", rule.command],
+                        ["Outputs", rule.outputs],
+                        ["ExecutionDescription", rule.description],
+                        ["AdditionalDependencies", rule.additional_dependencies],
+                    ],
+                ],
+            ]
+        )
+    easy_xml.WriteXmlIfChanged(content, props_path, pretty=True, win32=True)
+
+
+def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules):
+    """Generate the .targets file."""
+    content = [
+        "Project",
+        {"xmlns": "http://schemas.microsoft.com/developer/msbuild/2003"},
+    ]
+    item_group = [
+        "ItemGroup",
+        [
+            "PropertyPageSchema",
+            {"Include": "$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml"},
+        ],
+    ]
+    for rule in msbuild_rules:
+        item_group.append(
+            [
+                "AvailableItemName",
+                {"Include": rule.rule_name},
+                ["Targets", rule.target_name],
+            ]
+        )
+    content.append(item_group)
+
+    for rule in msbuild_rules:
+        content.append(
+            [
+                "UsingTask",
+                {
+                    "TaskName": rule.rule_name,
+                    "TaskFactory": "XamlTaskFactory",
+                    "AssemblyName": "Microsoft.Build.Tasks.v4.0",
+                },
+                ["Task", "$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml"],
+            ]
+        )
+    for rule in msbuild_rules:
+        rule_name = rule.rule_name
+        target_outputs = "%%(%s.Outputs)" % rule_name
+        target_inputs = (
+            "%%(%s.Identity);%%(%s.AdditionalDependencies);$(MSBuildProjectFile)"
+        ) % (rule_name, rule_name)
+        rule_inputs = "%%(%s.Identity)" % rule_name
+        extension_condition = (
+            "'%(Extension)'=='.obj' or "
+            "'%(Extension)'=='.res' or "
+            "'%(Extension)'=='.rsc' or "
+            "'%(Extension)'=='.lib'"
+        )
+        remove_section = [
+            "ItemGroup",
+            {"Condition": "'@(SelectedFiles)' != ''"},
+            [
+                rule_name,
+                {
+                    "Remove": "@(%s)" % rule_name,
+                    "Condition": "'%(Identity)' != '@(SelectedFiles)'",
+                },
+            ],
+        ]
+        inputs_section = [
+            "ItemGroup",
+            [rule.inputs, {"Include": "%%(%s.AdditionalDependencies)" % rule_name}],
+        ]
+        logging_section = [
+            "ItemGroup",
+            [
+                rule.tlog,
+                {
+                    "Include": "%%(%s.Outputs)" % rule_name,
+                    "Condition": (
+                        "'%%(%s.Outputs)' != '' and "
+                        "'%%(%s.ExcludedFromBuild)' != 'true'" % (rule_name, rule_name)
+                    ),
+                },
+                ["Source", "@(%s, '|')" % rule_name],
+                ["Inputs", "@(%s -> '%%(Fullpath)', ';')" % rule.inputs],
+            ],
+        ]
+        message_section = [
+            "Message",
+            {"Importance": "High", "Text": "%%(%s.ExecutionDescription)" % rule_name},
+        ]
+        write_tlog_section = [
+            "WriteLinesToFile",
+            {
+                "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != "
+                "'true'" % (rule.tlog, rule.tlog),
+                "File": "$(IntDir)$(ProjectName).write.1.tlog",
+                "Lines": "^%%(%s.Source);@(%s->'%%(Fullpath)')"
+                % (rule.tlog, rule.tlog),
+            },
+        ]
+        read_tlog_section = [
+            "WriteLinesToFile",
+            {
+                "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != "
+                "'true'" % (rule.tlog, rule.tlog),
+                "File": "$(IntDir)$(ProjectName).read.1.tlog",
+                "Lines": f"^%({rule.tlog}.Source);%({rule.tlog}.Inputs)",
+            },
+        ]
+        command_and_input_section = [
+            rule_name,
+            {
+                "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != "
+                "'true'" % (rule_name, rule_name),
+                "EchoOff": "true",
+                "StandardOutputImportance": "High",
+                "StandardErrorImportance": "High",
+                "CommandLineTemplate": "%%(%s.CommandLineTemplate)" % rule_name,
+                "AdditionalOptions": "%%(%s.AdditionalOptions)" % rule_name,
+                "Inputs": rule_inputs,
+            },
+        ]
+        content.extend(
+            [
+                [
+                    "Target",
+                    {
+                        "Name": rule.target_name,
+                        "BeforeTargets": "$(%s)" % rule.before_targets,
+                        "AfterTargets": "$(%s)" % rule.after_targets,
+                        "Condition": "'@(%s)' != ''" % rule_name,
+                        "DependsOnTargets": "$(%s);%s"
+                        % (rule.depends_on, rule.compute_output),
+                        "Outputs": target_outputs,
+                        "Inputs": target_inputs,
+                    },
+                    remove_section,
+                    inputs_section,
+                    logging_section,
+                    message_section,
+                    write_tlog_section,
+                    read_tlog_section,
+                    command_and_input_section,
+                ],
+                [
+                    "PropertyGroup",
+                    [
+                        "ComputeLinkInputsTargets",
+                        "$(ComputeLinkInputsTargets);",
+                        "%s;" % rule.compute_output,
+                    ],
+                    [
+                        "ComputeLibInputsTargets",
+                        "$(ComputeLibInputsTargets);",
+                        "%s;" % rule.compute_output,
+                    ],
+                ],
+                [
+                    "Target",
+                    {
+                        "Name": rule.compute_output,
+                        "Condition": "'@(%s)' != ''" % rule_name,
+                    },
+                    [
+                        "ItemGroup",
+                        [
+                            rule.dirs_to_make,
+                            {
+                                "Condition": "'@(%s)' != '' and "
+                                "'%%(%s.ExcludedFromBuild)' != 'true'"
+                                % (rule_name, rule_name),
+                                "Include": "%%(%s.Outputs)" % rule_name,
+                            },
+                        ],
+                        [
+                            "Link",
+                            {
+                                "Include": "%%(%s.Identity)" % rule.dirs_to_make,
+                                "Condition": extension_condition,
+                            },
+                        ],
+                        [
+                            "Lib",
+                            {
+                                "Include": "%%(%s.Identity)" % rule.dirs_to_make,
+                                "Condition": extension_condition,
+                            },
+                        ],
+                        [
+                            "ImpLib",
+                            {
+                                "Include": "%%(%s.Identity)" % rule.dirs_to_make,
+                                "Condition": extension_condition,
+                            },
+                        ],
+                    ],
+                    [
+                        "MakeDir",
+                        {
+                            "Directories": (
+                                "@(%s->'%%(RootDir)%%(Directory)')" % rule.dirs_to_make
+                            )
+                        },
+                    ],
+                ],
+            ]
+        )
+    easy_xml.WriteXmlIfChanged(content, targets_path, pretty=True, win32=True)
+
+
+def _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules):
+    # Generate the .xml file
+    content = [
+        "ProjectSchemaDefinitions",
+        {
+            "xmlns": (
+                "clr-namespace:Microsoft.Build.Framework.XamlTypes;"
+                "assembly=Microsoft.Build.Framework"
+            ),
+            "xmlns:x": "http://schemas.microsoft.com/winfx/2006/xaml",
+            "xmlns:sys": "clr-namespace:System;assembly=mscorlib",
+            "xmlns:transformCallback": "Microsoft.Cpp.Dev10.ConvertPropertyCallback",
+        },
+    ]
+    for rule in msbuild_rules:
+        content.extend(
+            [
+                [
+                    "Rule",
+                    {
+                        "Name": rule.rule_name,
+                        "PageTemplate": "tool",
+                        "DisplayName": rule.display_name,
+                        "Order": "200",
+                    },
+                    [
+                        "Rule.DataSource",
+                        [
+                            "DataSource",
+                            {"Persistence": "ProjectFile", "ItemType": rule.rule_name},
+                        ],
+                    ],
+                    [
+                        "Rule.Categories",
+                        [
+                            "Category",
+                            {"Name": "General"},
+                            ["Category.DisplayName", ["sys:String", "General"]],
+                        ],
+                        [
+                            "Category",
+                            {"Name": "Command Line", "Subtype": "CommandLine"},
+                            ["Category.DisplayName", ["sys:String", "Command Line"]],
+                        ],
+                    ],
+                    [
+                        "StringListProperty",
+                        {
+                            "Name": "Inputs",
+                            "Category": "Command Line",
+                            "IsRequired": "true",
+                            "Switch": " ",
+                        },
+                        [
+                            "StringListProperty.DataSource",
+                            [
+                                "DataSource",
+                                {
+                                    "Persistence": "ProjectFile",
+                                    "ItemType": rule.rule_name,
+                                    "SourceType": "Item",
+                                },
+                            ],
+                        ],
+                    ],
+                    [
+                        "StringProperty",
+                        {
+                            "Name": "CommandLineTemplate",
+                            "DisplayName": "Command Line",
+                            "Visible": "False",
+                            "IncludeInCommandLine": "False",
+                        },
+                    ],
+                    [
+                        "DynamicEnumProperty",
+                        {
+                            "Name": rule.before_targets,
+                            "Category": "General",
+                            "EnumProvider": "Targets",
+                            "IncludeInCommandLine": "False",
+                        },
+                        [
+                            "DynamicEnumProperty.DisplayName",
+                            ["sys:String", "Execute Before"],
+                        ],
+                        [
+                            "DynamicEnumProperty.Description",
+                            [
+                                "sys:String",
+                                "Specifies the targets for the build customization"
+                                " to run before.",
+                            ],
+                        ],
+                        [
+                            "DynamicEnumProperty.ProviderSettings",
+                            [
+                                "NameValuePair",
+                                {
+                                    "Name": "Exclude",
+                                    "Value": "^%s|^Compute" % rule.before_targets,
+                                },
+                            ],
+                        ],
+                        [
+                            "DynamicEnumProperty.DataSource",
+                            [
+                                "DataSource",
+                                {
+                                    "Persistence": "ProjectFile",
+                                    "HasConfigurationCondition": "true",
+                                },
+                            ],
+                        ],
+                    ],
+                    [
+                        "DynamicEnumProperty",
+                        {
+                            "Name": rule.after_targets,
+                            "Category": "General",
+                            "EnumProvider": "Targets",
+                            "IncludeInCommandLine": "False",
+                        },
+                        [
+                            "DynamicEnumProperty.DisplayName",
+                            ["sys:String", "Execute After"],
+                        ],
+                        [
+                            "DynamicEnumProperty.Description",
+                            [
+                                "sys:String",
+                                (
+                                    "Specifies the targets for the build customization"
+                                    " to run after."
+                                ),
+                            ],
+                        ],
+                        [
+                            "DynamicEnumProperty.ProviderSettings",
+                            [
+                                "NameValuePair",
+                                {
+                                    "Name": "Exclude",
+                                    "Value": "^%s|^Compute" % rule.after_targets,
+                                },
+                            ],
+                        ],
+                        [
+                            "DynamicEnumProperty.DataSource",
+                            [
+                                "DataSource",
+                                {
+                                    "Persistence": "ProjectFile",
+                                    "ItemType": "",
+                                    "HasConfigurationCondition": "true",
+                                },
+                            ],
+                        ],
+                    ],
+                    [
+                        "StringListProperty",
+                        {
+                            "Name": "Outputs",
+                            "DisplayName": "Outputs",
+                            "Visible": "False",
+                            "IncludeInCommandLine": "False",
+                        },
+                    ],
+                    [
+                        "StringProperty",
+                        {
+                            "Name": "ExecutionDescription",
+                            "DisplayName": "Execution Description",
+                            "Visible": "False",
+                            "IncludeInCommandLine": "False",
+                        },
+                    ],
+                    [
+                        "StringListProperty",
+                        {
+                            "Name": "AdditionalDependencies",
+                            "DisplayName": "Additional Dependencies",
+                            "IncludeInCommandLine": "False",
+                            "Visible": "false",
+                        },
+                    ],
+                    [
+                        "StringProperty",
+                        {
+                            "Subtype": "AdditionalOptions",
+                            "Name": "AdditionalOptions",
+                            "Category": "Command Line",
+                        },
+                        [
+                            "StringProperty.DisplayName",
+                            ["sys:String", "Additional Options"],
+                        ],
+                        [
+                            "StringProperty.Description",
+                            ["sys:String", "Additional Options"],
+                        ],
+                    ],
+                ],
+                [
+                    "ItemType",
+                    {"Name": rule.rule_name, "DisplayName": rule.display_name},
+                ],
+                [
+                    "FileExtension",
+                    {"Name": "*" + rule.extension, "ContentType": rule.rule_name},
+                ],
+                [
+                    "ContentType",
+                    {
+                        "Name": rule.rule_name,
+                        "DisplayName": "",
+                        "ItemType": rule.rule_name,
+                    },
+                ],
+            ]
+        )
+    easy_xml.WriteXmlIfChanged(content, xml_path, pretty=True, win32=True)
+
+
+def _GetConfigurationAndPlatform(name, settings, spec):
+    configuration = name.rsplit("_", 1)[0]
+    platform = settings.get("msvs_configuration_platform", "Win32")
+    if spec["toolset"] == "host" and platform == "arm64":
+        platform = "x64"  # Host-only tools are always built for x64
+    return (configuration, platform)
+
+
+def _GetConfigurationCondition(name, settings, spec):
+    return r"'$(Configuration)|$(Platform)'=='%s|%s'" % _GetConfigurationAndPlatform(
+        name, settings, spec
+    )
+
+
+def _GetMSBuildProjectConfigurations(configurations, spec):
+    group = ["ItemGroup", {"Label": "ProjectConfigurations"}]
+    for name, settings in sorted(configurations.items()):
+        configuration, platform = _GetConfigurationAndPlatform(name, settings, spec)
+        designation = f"{configuration}|{platform}"
+        group.append(
+            [
+                "ProjectConfiguration",
+                {"Include": designation},
+                ["Configuration", configuration],
+                ["Platform", platform],
+            ]
+        )
+    return [group]
+
+
+def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name):
+    namespace = os.path.splitext(gyp_file_name)[0]
+    properties = [
+        [
+            "PropertyGroup",
+            {"Label": "Globals"},
+            ["ProjectGuid", guid],
+            ["Keyword", "Win32Proj"],
+            ["RootNamespace", namespace],
+            ["IgnoreWarnCompileDuplicatedFilename", "true"],
+        ]
+    ]
+
+    if (
+        os.environ.get("PROCESSOR_ARCHITECTURE") == "AMD64"
+        or os.environ.get("PROCESSOR_ARCHITEW6432") == "AMD64"
+    ):
+        properties[0].append(["PreferredToolArchitecture", "x64"])
+
+    if spec.get("msvs_target_platform_version"):
+        target_platform_version = spec.get("msvs_target_platform_version")
+        properties[0].append(["WindowsTargetPlatformVersion", target_platform_version])
+        if spec.get("msvs_target_platform_minversion"):
+            target_platform_minversion = spec.get("msvs_target_platform_minversion")
+            properties[0].append(
+                ["WindowsTargetPlatformMinVersion", target_platform_minversion]
+            )
+        else:
+            properties[0].append(
+                ["WindowsTargetPlatformMinVersion", target_platform_version]
+            )
+
+    if spec.get("msvs_enable_winrt"):
+        properties[0].append(["DefaultLanguage", "en-US"])
+        properties[0].append(["AppContainerApplication", "true"])
+        if spec.get("msvs_application_type_revision"):
+            app_type_revision = spec.get("msvs_application_type_revision")
+            properties[0].append(["ApplicationTypeRevision", app_type_revision])
+        else:
+            properties[0].append(["ApplicationTypeRevision", "8.1"])
+        if spec.get("msvs_enable_winphone"):
+            properties[0].append(["ApplicationType", "Windows Phone"])
+        else:
+            properties[0].append(["ApplicationType", "Windows Store"])
+
+    platform_name = None
+    msvs_windows_sdk_version = None
+    for configuration in spec["configurations"].values():
+        platform_name = platform_name or _ConfigPlatform(configuration)
+        msvs_windows_sdk_version = (
+            msvs_windows_sdk_version
+            or _ConfigWindowsTargetPlatformVersion(configuration, version)
+        )
+        if platform_name and msvs_windows_sdk_version:
+            break
+    if msvs_windows_sdk_version:
+        properties[0].append(
+            ["WindowsTargetPlatformVersion", str(msvs_windows_sdk_version)]
+        )
+    elif version.compatible_sdks:
+        raise GypError(
+            "%s requires any SDK of %s version, but none were found"
+            % (version.description, version.compatible_sdks)
+        )
+
+    if platform_name == "ARM":
+        properties[0].append(["WindowsSDKDesktopARMSupport", "true"])
+
+    return properties
+
+
+def _GetMSBuildConfigurationDetails(spec, build_file):
+    properties = {}
+    for name, settings in spec["configurations"].items():
+        msbuild_attributes = _GetMSBuildAttributes(spec, settings, build_file)
+        condition = _GetConfigurationCondition(name, settings, spec)
+        character_set = msbuild_attributes.get("CharacterSet")
+        vctools_version = msbuild_attributes.get("VCToolsVersion")
+        config_type = msbuild_attributes.get("ConfigurationType")
+        _AddConditionalProperty(properties, condition, "ConfigurationType", config_type)
+        spectre_mitigation = msbuild_attributes.get("SpectreMitigation")
+        if spectre_mitigation:
+            _AddConditionalProperty(
+                properties, condition, "SpectreMitigation", spectre_mitigation
+            )
+        if config_type == "Driver":
+            _AddConditionalProperty(properties, condition, "DriverType", "WDM")
+            _AddConditionalProperty(
+                properties, condition, "TargetVersion", _ConfigTargetVersion(settings)
+            )
+        if character_set and "msvs_enable_winrt" not in spec:
+            _AddConditionalProperty(
+                properties, condition, "CharacterSet", character_set
+            )
+        if vctools_version and "msvs_enable_winrt" not in spec:
+            _AddConditionalProperty(
+                properties, condition, "VCToolsVersion", vctools_version
+            )
+    return _GetMSBuildPropertyGroup(spec, "Configuration", properties)
+
+
+def _GetMSBuildLocalProperties(msbuild_toolset):
+    # Currently the only local property we support is PlatformToolset
+    properties = {}
+    if msbuild_toolset:
+        properties = [
+            [
+                "PropertyGroup",
+                {"Label": "Locals"},
+                ["PlatformToolset", msbuild_toolset],
+            ]
+        ]
+    return properties
+
+
+def _GetMSBuildPropertySheets(configurations, spec):
+    user_props = r"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
+    additional_props = {}
+    props_specified = False
+    for name, settings in sorted(configurations.items()):
+        configuration = _GetConfigurationCondition(name, settings, spec)
+        if "msbuild_props" in settings:
+            additional_props[configuration] = _FixPaths(settings["msbuild_props"])
+            props_specified = True
+        else:
+            additional_props[configuration] = ""
+
+    if not props_specified:
+        return [
+            [
+                "ImportGroup",
+                {"Label": "PropertySheets"},
+                [
+                    "Import",
+                    {
+                        "Project": user_props,
+                        "Condition": "exists('%s')" % user_props,
+                        "Label": "LocalAppDataPlatform",
+                    },
+                ],
+            ]
+        ]
+    else:
+        sheets = []
+        for condition, props in additional_props.items():
+            import_group = [
+                "ImportGroup",
+                {"Label": "PropertySheets", "Condition": condition},
+                [
+                    "Import",
+                    {
+                        "Project": user_props,
+                        "Condition": "exists('%s')" % user_props,
+                        "Label": "LocalAppDataPlatform",
+                    },
+                ],
+            ]
+            for props_file in props:
+                import_group.append(["Import", {"Project": props_file}])
+            sheets.append(import_group)
+        return sheets
+
+
+def _ConvertMSVSBuildAttributes(spec, config, build_file):
+    config_type = _GetMSVSConfigurationType(spec, build_file)
+    msvs_attributes = _GetMSVSAttributes(spec, config, config_type)
+    msbuild_attributes = {}
+    for a in msvs_attributes:
+        if a in ["IntermediateDirectory", "OutputDirectory"]:
+            directory = MSVSSettings.ConvertVCMacrosToMSBuild(msvs_attributes[a])
+            if not directory.endswith("\\"):
+                directory += "\\"
+            msbuild_attributes[a] = directory
+        elif a == "CharacterSet":
+            msbuild_attributes[a] = _ConvertMSVSCharacterSet(msvs_attributes[a])
+        elif a == "ConfigurationType":
+            msbuild_attributes[a] = _ConvertMSVSConfigurationType(msvs_attributes[a])
+        elif a == "SpectreMitigation" or a == "VCToolsVersion":
+            msbuild_attributes[a] = msvs_attributes[a]
+        else:
+            print("Warning: Do not know how to convert MSVS attribute " + a)
+    return msbuild_attributes
+
+
+def _ConvertMSVSCharacterSet(char_set):
+    if char_set.isdigit():
+        char_set = {"0": "MultiByte", "1": "Unicode", "2": "MultiByte"}[char_set]
+    return char_set
+
+
+def _ConvertMSVSConfigurationType(config_type):
+    if config_type.isdigit():
+        config_type = {
+            "1": "Application",
+            "2": "DynamicLibrary",
+            "4": "StaticLibrary",
+            "5": "Driver",
+            "10": "Utility",
+        }[config_type]
+    return config_type
+
+
+def _GetMSBuildAttributes(spec, config, build_file):
+    if "msbuild_configuration_attributes" not in config:
+        msbuild_attributes = _ConvertMSVSBuildAttributes(spec, config, build_file)
+
+    else:
+        config_type = _GetMSVSConfigurationType(spec, build_file)
+        config_type = _ConvertMSVSConfigurationType(config_type)
+        msbuild_attributes = config.get("msbuild_configuration_attributes", {})
+        msbuild_attributes.setdefault("ConfigurationType", config_type)
+        output_dir = msbuild_attributes.get(
+            "OutputDirectory", "$(SolutionDir)$(Configuration)"
+        )
+        msbuild_attributes["OutputDirectory"] = _FixPath(output_dir) + "\\"
+        if "IntermediateDirectory" not in msbuild_attributes:
+            intermediate = _FixPath("$(Configuration)") + "\\"
+            msbuild_attributes["IntermediateDirectory"] = intermediate
+        if "CharacterSet" in msbuild_attributes:
+            msbuild_attributes["CharacterSet"] = _ConvertMSVSCharacterSet(
+                msbuild_attributes["CharacterSet"]
+            )
+    if "TargetName" not in msbuild_attributes:
+        prefix = spec.get("product_prefix", "")
+        product_name = spec.get("product_name", "$(ProjectName)")
+        target_name = prefix + product_name
+        msbuild_attributes["TargetName"] = target_name
+    if "TargetExt" not in msbuild_attributes and "product_extension" in spec:
+        ext = spec.get("product_extension")
+        msbuild_attributes["TargetExt"] = "." + ext
+
+    if spec.get("msvs_external_builder"):
+        external_out_dir = spec.get("msvs_external_builder_out_dir", ".")
+        msbuild_attributes["OutputDirectory"] = _FixPath(external_out_dir) + "\\"
+
+    # Make sure that 'TargetPath' matches 'Lib.OutputFile' or 'Link.OutputFile'
+    # (depending on the tool used) to avoid MSB8012 warning.
+    msbuild_tool_map = {
+        "executable": "Link",
+        "shared_library": "Link",
+        "loadable_module": "Link",
+        "windows_driver": "Link",
+        "static_library": "Lib",
+    }
+    if msbuild_tool := msbuild_tool_map.get(spec["type"]):
+        msbuild_settings = config["finalized_msbuild_settings"]
+        out_file = msbuild_settings[msbuild_tool].get("OutputFile")
+        if out_file:
+            msbuild_attributes["TargetPath"] = _FixPath(out_file)
+        target_ext = msbuild_settings[msbuild_tool].get("TargetExt")
+        if target_ext:
+            msbuild_attributes["TargetExt"] = target_ext
+
+    return msbuild_attributes
+
+
+def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file):
+    # TODO(jeanluc) We could optimize out the following and do it only if
+    # there are actions.
+    # TODO(jeanluc) Handle the equivalent of setting 'CYGWIN=nontsec'.
+    new_paths = []
+    if cygwin_dirs := spec.get("msvs_cygwin_dirs", ["."])[0]:
+        cyg_path = "$(MSBuildProjectDirectory)\\%s\\bin\\" % _FixPath(cygwin_dirs)
+        new_paths.append(cyg_path)
+        # TODO(jeanluc) Change the convention to have both a cygwin_dir and a
+        # python_dir.
+        python_path = cyg_path.replace("cygwin\\bin", "python_26")
+        new_paths.append(python_path)
+        if new_paths:
+            new_paths = "$(ExecutablePath);" + ";".join(new_paths)
+
+    properties = {}
+    for name, configuration in sorted(configurations.items()):
+        condition = _GetConfigurationCondition(name, configuration, spec)
+        attributes = _GetMSBuildAttributes(spec, configuration, build_file)
+        msbuild_settings = configuration["finalized_msbuild_settings"]
+        _AddConditionalProperty(
+            properties, condition, "IntDir", attributes["IntermediateDirectory"]
+        )
+        _AddConditionalProperty(
+            properties, condition, "OutDir", attributes["OutputDirectory"]
+        )
+        _AddConditionalProperty(
+            properties, condition, "TargetName", attributes["TargetName"]
+        )
+        if "TargetExt" in attributes:
+            _AddConditionalProperty(
+                properties, condition, "TargetExt", attributes["TargetExt"]
+            )
+
+        if attributes.get("TargetPath"):
+            _AddConditionalProperty(
+                properties, condition, "TargetPath", attributes["TargetPath"]
+            )
+        if attributes.get("TargetExt"):
+            _AddConditionalProperty(
+                properties, condition, "TargetExt", attributes["TargetExt"]
+            )
+
+        if new_paths:
+            _AddConditionalProperty(properties, condition, "ExecutablePath", new_paths)
+        tool_settings = msbuild_settings.get("", {})
+        for name, value in sorted(tool_settings.items()):
+            formatted_value = _GetValueFormattedForMSBuild("", name, value)
+            _AddConditionalProperty(properties, condition, name, formatted_value)
+    return _GetMSBuildPropertyGroup(spec, None, properties)
+
+
+def _AddConditionalProperty(properties, condition, name, value):
+    """Adds a property / conditional value pair to a dictionary.
+
+    Arguments:
+      properties: The dictionary to be modified.  The key is the name of the
+          property.  The value is itself a dictionary; its key is the value and
+          the value a list of condition for which this value is true.
+      condition: The condition under which the named property has the value.
+      name: The name of the property.
+      value: The value of the property.
+    """
+    if name not in properties:
+        properties[name] = {}
+    values = properties[name]
+    if value not in values:
+        values[value] = []
+    conditions = values[value]
+    conditions.append(condition)
+
+
+# Regex for msvs variable references ( i.e. $(FOO) ).
+MSVS_VARIABLE_REFERENCE = re.compile(r"\$\(([a-zA-Z_][a-zA-Z0-9_]*)\)")
+
+
+def _GetMSBuildPropertyGroup(spec, label, properties):
+    """Returns a PropertyGroup definition for the specified properties.
+
+    Arguments:
+      spec: The target project dict.
+      label: An optional label for the PropertyGroup.
+      properties: The dictionary to be converted.  The key is the name of the
+          property.  The value is itself a dictionary; its key is the value and
+          the value a list of condition for which this value is true.
+    """
+    group = ["PropertyGroup"]
+    if label:
+        group.append({"Label": label})
+    num_configurations = len(spec["configurations"])
+
+    def GetEdges(node):
+        # Use a definition of edges such that user_of_variable -> used_variable.
+        # This happens to be easier in this case, since a variable's
+        # definition contains all variables it references in a single string.
+        edges = set()
+        for value in sorted(properties[node].keys()):
+            # Add to edges all $(...) references to variables.
+            #
+            # Variable references that refer to names not in properties are excluded
+            # These can exist for instance to refer built in definitions like
+            # $(SolutionDir).
+            #
+            # Self references are ignored. Self reference is used in a few places to
+            # append to the default value. I.e. PATH=$(PATH);other_path
+            edges.update(
+                {
+                    v
+                    for v in MSVS_VARIABLE_REFERENCE.findall(value)
+                    if v in properties and v != node
+                }
+            )
+        return edges
+
+    properties_ordered = gyp.common.TopologicallySorted(properties.keys(), GetEdges)
+    # Walk properties in the reverse of a topological sort on
+    # user_of_variable -> used_variable as this ensures variables are
+    # defined before they are used.
+    # NOTE: reverse(topsort(DAG)) = topsort(reverse_edges(DAG))
+    for name in reversed(properties_ordered):
+        values = properties[name]
+        for value, conditions in sorted(values.items()):
+            if len(conditions) == num_configurations:
+                # If the value is the same all configurations,
+                # just add one unconditional entry.
+                group.append([name, value])
+            else:
+                for condition in conditions:
+                    group.append([name, {"Condition": condition}, value])
+    return [group]
+
+
+def _GetMSBuildToolSettingsSections(spec, configurations):
+    groups = []
+    for name, configuration in sorted(configurations.items()):
+        msbuild_settings = configuration["finalized_msbuild_settings"]
+        group = [
+            "ItemDefinitionGroup",
+            {"Condition": _GetConfigurationCondition(name, configuration, spec)},
+        ]
+        for tool_name, tool_settings in sorted(msbuild_settings.items()):
+            # Skip the tool named '' which is a holder of global settings handled
+            # by _GetMSBuildConfigurationGlobalProperties.
+            if tool_name and tool_settings:
+                tool = [tool_name]
+                for name, value in sorted(tool_settings.items()):
+                    formatted_value = _GetValueFormattedForMSBuild(
+                        tool_name, name, value
+                    )
+                    tool.append([name, formatted_value])
+                group.append(tool)
+        groups.append(group)
+    return groups
+
+
+def _FinalizeMSBuildSettings(spec, configuration):
+    if "msbuild_settings" in configuration:
+        converted = False
+        msbuild_settings = configuration["msbuild_settings"]
+        MSVSSettings.ValidateMSBuildSettings(msbuild_settings)
+    else:
+        converted = True
+        msvs_settings = configuration.get("msvs_settings", {})
+        msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(msvs_settings)
+    include_dirs, midl_include_dirs, resource_include_dirs = _GetIncludeDirs(
+        configuration
+    )
+    libraries = _GetLibraries(spec)
+    library_dirs = _GetLibraryDirs(configuration)
+    out_file, _, msbuild_tool = _GetOutputFilePathAndTool(spec, msbuild=True)
+    target_ext = _GetOutputTargetExt(spec)
+    defines = _GetDefines(configuration)
+    if converted:
+        # Visual Studio 2010 has TR1
+        defines = [d for d in defines if d != "_HAS_TR1=0"]
+        # Warn of ignored settings
+        ignored_settings = ["msvs_tool_files"]
+        for ignored_setting in ignored_settings:
+            value = configuration.get(ignored_setting)
+            if value:
+                print(
+                    "Warning: The automatic conversion to MSBuild does not handle "
+                    "%s.  Ignoring setting of %s" % (ignored_setting, str(value))
+                )
+
+    defines = [_EscapeCppDefineForMSBuild(d) for d in defines]
+    disabled_warnings = _GetDisabledWarnings(configuration)
+    prebuild = configuration.get("msvs_prebuild")
+    postbuild = configuration.get("msvs_postbuild")
+    def_file = _GetModuleDefinition(spec)
+
+    # Add the information to the appropriate tool
+    # TODO(jeanluc) We could optimize and generate these settings only if
+    # the corresponding files are found, e.g. don't generate ResourceCompile
+    # if you don't have any resources.
+    _ToolAppend(
+        msbuild_settings, "ClCompile", "AdditionalIncludeDirectories", include_dirs
+    )
+    _ToolAppend(
+        msbuild_settings, "Midl", "AdditionalIncludeDirectories", midl_include_dirs
+    )
+    _ToolAppend(
+        msbuild_settings,
+        "ResourceCompile",
+        "AdditionalIncludeDirectories",
+        resource_include_dirs,
+    )
+    # Add in libraries, note that even for empty libraries, we want this
+    # set, to prevent inheriting default libraries from the environment.
+    _ToolSetOrAppend(msbuild_settings, "Link", "AdditionalDependencies", libraries)
+    _ToolAppend(msbuild_settings, "Link", "AdditionalLibraryDirectories", library_dirs)
+    if out_file:
+        _ToolAppend(
+            msbuild_settings, msbuild_tool, "OutputFile", out_file, only_if_unset=True
+        )
+    if target_ext:
+        _ToolAppend(
+            msbuild_settings, msbuild_tool, "TargetExt", target_ext, only_if_unset=True
+        )
+    # Add defines.
+    _ToolAppend(msbuild_settings, "ClCompile", "PreprocessorDefinitions", defines)
+    _ToolAppend(msbuild_settings, "ResourceCompile", "PreprocessorDefinitions", defines)
+    # Add disabled warnings.
+    _ToolAppend(
+        msbuild_settings, "ClCompile", "DisableSpecificWarnings", disabled_warnings
+    )
+    # Turn on precompiled headers if appropriate.
+    if precompiled_header := configuration.get("msvs_precompiled_header"):
+        # While MSVC works with just file name eg. "v8_pch.h", ClangCL requires
+        # the full path eg. "tools/msvs/pch/v8_pch.h" to find the file.
+        # P.S. Only ClangCL defines msbuild_toolset, for MSVC it is None.
+        if configuration.get("msbuild_toolset") != "ClangCL":
+            precompiled_header = os.path.split(precompiled_header)[1]
+        _ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "Use")
+        _ToolAppend(
+            msbuild_settings, "ClCompile", "PrecompiledHeaderFile", precompiled_header
+        )
+        _ToolAppend(
+            msbuild_settings, "ClCompile", "ForcedIncludeFiles", [precompiled_header]
+        )
+    else:
+        _ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "NotUsing")
+    # Turn off WinRT compilation
+    _ToolAppend(msbuild_settings, "ClCompile", "CompileAsWinRT", "false")
+    # Turn on import libraries if appropriate
+    if spec.get("msvs_requires_importlibrary"):
+        _ToolAppend(msbuild_settings, "", "IgnoreImportLibrary", "false")
+    # Loadable modules don't generate import libraries;
+    # tell dependent projects to not expect one.
+    if spec["type"] == "loadable_module":
+        _ToolAppend(msbuild_settings, "", "IgnoreImportLibrary", "true")
+    # Set the module definition file if any.
+    if def_file:
+        _ToolAppend(msbuild_settings, "Link", "ModuleDefinitionFile", def_file)
+    configuration["finalized_msbuild_settings"] = msbuild_settings
+    if prebuild:
+        _ToolAppend(msbuild_settings, "PreBuildEvent", "Command", prebuild)
+    if postbuild:
+        _ToolAppend(msbuild_settings, "PostBuildEvent", "Command", postbuild)
+
+
+def _GetValueFormattedForMSBuild(tool_name, name, value):
+    if isinstance(value, list):
+        # For some settings, VS2010 does not automatically extends the settings
+        # TODO(jeanluc) Is this what we want?
+        if name in [
+            "AdditionalIncludeDirectories",
+            "AdditionalLibraryDirectories",
+            "AdditionalOptions",
+            "DelayLoadDLLs",
+            "DisableSpecificWarnings",
+            "PreprocessorDefinitions",
+        ]:
+            value.append("%%(%s)" % name)
+        # For most tools, entries in a list should be separated with ';' but some
+        # settings use a space.  Check for those first.
+        exceptions = {
+            "ClCompile": ["AdditionalOptions"],
+            "Link": ["AdditionalOptions"],
+            "Lib": ["AdditionalOptions"],
+        }
+        char = " " if name in exceptions.get(tool_name, []) else ";"
+        formatted_value = char.join(
+            [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in value]
+        )
+    else:
+        formatted_value = MSVSSettings.ConvertVCMacrosToMSBuild(value)
+    return formatted_value
+
+
+def _VerifySourcesExist(sources, root_dir):
+    """Verifies that all source files exist on disk.
+
+    Checks that all regular source files, i.e. not created at run time,
+    exist on disk.  Missing files cause needless recompilation but no otherwise
+    visible errors.
+
+    Arguments:
+      sources: A recursive list of Filter/file names.
+      root_dir: The root directory for the relative path names.
+    Returns:
+      A list of source files that cannot be found on disk.
+    """
+    missing_sources = []
+    for source in sources:
+        if isinstance(source, MSVSProject.Filter):
+            missing_sources.extend(_VerifySourcesExist(source.contents, root_dir))
+        elif "$" not in source:
+            full_path = os.path.join(root_dir, source)
+            if not os.path.exists(full_path):
+                missing_sources.append(full_path)
+    return missing_sources
+
+
+def _GetMSBuildSources(
+    spec,
+    sources,
+    exclusions,
+    rule_dependencies,
+    extension_to_rule_name,
+    actions_spec,
+    sources_handled_by_action,
+    list_excluded,
+):
+    groups = [
+        "none",
+        "masm",
+        "midl",
+        "include",
+        "compile",
+        "resource",
+        "rule",
+        "rule_dependency",
+    ]
+    grouped_sources = {}
+    for g in groups:
+        grouped_sources[g] = []
+
+    _AddSources2(
+        spec,
+        sources,
+        exclusions,
+        grouped_sources,
+        rule_dependencies,
+        extension_to_rule_name,
+        sources_handled_by_action,
+        list_excluded,
+    )
+    sources = []
+    for g in groups:
+        if grouped_sources[g]:
+            sources.append(["ItemGroup"] + grouped_sources[g])
+    if actions_spec:
+        sources.append(["ItemGroup"] + actions_spec)
+    return sources
+
+
+def _AddSources2(
+    spec,
+    sources,
+    exclusions,
+    grouped_sources,
+    rule_dependencies,
+    extension_to_rule_name,
+    sources_handled_by_action,
+    list_excluded,
+):
+    extensions_excluded_from_precompile = []
+    for source in sources:
+        if isinstance(source, MSVSProject.Filter):
+            _AddSources2(
+                spec,
+                source.contents,
+                exclusions,
+                grouped_sources,
+                rule_dependencies,
+                extension_to_rule_name,
+                sources_handled_by_action,
+                list_excluded,
+            )
+        elif source not in sources_handled_by_action:
+            detail = []
+            excluded_configurations = exclusions.get(source, [])
+            if len(excluded_configurations) == len(spec["configurations"]):
+                detail.append(["ExcludedFromBuild", "true"])
+            else:
+                for config_name, configuration in sorted(excluded_configurations):
+                    condition = _GetConfigurationCondition(config_name, configuration)
+                    detail.append(
+                        ["ExcludedFromBuild", {"Condition": condition}, "true"]
+                    )
+            # Add precompile if needed
+            for config_name, configuration in spec["configurations"].items():
+                precompiled_source = configuration.get("msvs_precompiled_source", "")
+                if precompiled_source != "":
+                    precompiled_source = _FixPath(precompiled_source)
+                    if not extensions_excluded_from_precompile:
+                        # If the precompiled header is generated by a C source,
+                        # we must not try to use it for C++ sources,
+                        # and vice versa.
+                        _basename, extension = os.path.splitext(precompiled_source)
+                        if extension == ".c":
+                            extensions_excluded_from_precompile = [
+                                ".cc",
+                                ".cpp",
+                                ".cxx",
+                            ]
+                        else:
+                            extensions_excluded_from_precompile = [".c"]
+
+                if precompiled_source == source:
+                    condition = _GetConfigurationCondition(
+                        config_name, configuration, spec
+                    )
+                    detail.append(
+                        ["PrecompiledHeader", {"Condition": condition}, "Create"]
+                    )
+                else:
+                    # Turn off precompiled header usage for source files of a
+                    # different type than the file that generated the
+                    # precompiled header.
+                    for extension in extensions_excluded_from_precompile:
+                        if source.endswith(extension):
+                            detail.append(["PrecompiledHeader", ""])
+                            detail.append(["ForcedIncludeFiles", ""])
+
+            group, element = _MapFileToMsBuildSourceType(
+                source,
+                rule_dependencies,
+                extension_to_rule_name,
+                _GetUniquePlatforms(spec),
+                spec["toolset"],
+            )
+            if group == "compile" and not os.path.isabs(source):
+                # Add an  value to support duplicate source
+                # file basenames, except for absolute paths to avoid paths
+                # with more than 260 characters.
+                file_name = os.path.splitext(source)[0] + ".obj"
+                if file_name.startswith("..\\"):
+                    file_name = re.sub(r"^(\.\.\\)+", "", file_name)
+                elif file_name.startswith("$("):
+                    file_name = re.sub(r"^\$\([^)]+\)\\", "", file_name)
+                detail.append(["ObjectFileName", "$(IntDir)\\" + file_name])
+            grouped_sources[group].append([element, {"Include": source}] + detail)
+
+
+def _GetMSBuildProjectReferences(project):
+    references = []
+    if project.dependencies:
+        group = ["ItemGroup"]
+        added_dependency_set = set()
+        for dependency in project.dependencies:
+            dependency_spec = dependency.spec
+            should_skip_dep = False
+            if project.spec["toolset"] == "target":
+                if dependency_spec["toolset"] == "host":
+                    if dependency_spec["type"] == "static_library":
+                        should_skip_dep = True
+            if dependency.name.startswith("run_"):
+                should_skip_dep = False
+            if should_skip_dep:
+                continue
+
+            canonical_name = dependency.name.replace("_host", "")
+            added_dependency_set.add(canonical_name)
+            guid = dependency.guid
+            project_dir = os.path.split(project.path)[0]
+            relative_path = gyp.common.RelativePath(dependency.path, project_dir)
+            project_ref = [
+                "ProjectReference",
+                {"Include": relative_path},
+                ["Project", guid],
+                ["ReferenceOutputAssembly", "false"],
+            ]
+            for config in dependency.spec.get("configurations", {}).values():
+                if config.get("msvs_use_library_dependency_inputs", 0):
+                    project_ref.append(["UseLibraryDependencyInputs", "true"])
+                    break
+                # If it's disabled in any config, turn it off in the reference.
+                if config.get("msvs_2010_disable_uldi_when_referenced", 0):
+                    project_ref.append(["UseLibraryDependencyInputs", "false"])
+                    break
+            group.append(project_ref)
+        references.append(group)
+    return references
+
+
+def _GenerateMSBuildProject(project, options, version, generator_flags, spec):
+    spec = project.spec
+    configurations = spec["configurations"]
+    toolset = spec["toolset"]
+    project_dir, project_file_name = os.path.split(project.path)
+    gyp.common.EnsureDirExists(project.path)
+    # Prepare list of sources and excluded sources.
+
+    gyp_file = os.path.split(project.build_file)[1]
+    sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, gyp_file)
+    # Add rules.
+    actions_to_add = {}
+    props_files_of_rules = set()
+    targets_files_of_rules = set()
+    rule_dependencies = set()
+    extension_to_rule_name = {}
+    list_excluded = generator_flags.get("msvs_list_excluded_files", True)
+    platforms = _GetUniquePlatforms(spec)
+
+    # Don't generate rules if we are using an external builder like ninja.
+    if not spec.get("msvs_external_builder"):
+        _GenerateRulesForMSBuild(
+            project_dir,
+            options,
+            spec,
+            sources,
+            excluded_sources,
+            props_files_of_rules,
+            targets_files_of_rules,
+            actions_to_add,
+            rule_dependencies,
+            extension_to_rule_name,
+        )
+    else:
+        rules = spec.get("rules", [])
+        _AdjustSourcesForRules(rules, sources, excluded_sources, True)
+
+    sources, excluded_sources, excluded_idl = _AdjustSourcesAndConvertToFilterHierarchy(
+        spec, options, project_dir, sources, excluded_sources, list_excluded, version
+    )
+
+    # Don't add actions if we are using an external builder like ninja.
+    if not spec.get("msvs_external_builder"):
+        _AddActions(actions_to_add, spec, project.build_file)
+        _AddCopies(actions_to_add, spec)
+
+        # NOTE: this stanza must appear after all actions have been decided.
+        # Don't excluded sources with actions attached, or they won't run.
+        excluded_sources = _FilterActionsFromExcluded(excluded_sources, actions_to_add)
+
+    exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl)
+    actions_spec, sources_handled_by_action = _GenerateActionsForMSBuild(
+        spec, actions_to_add
+    )
+
+    _GenerateMSBuildFiltersFile(
+        project.path + ".filters",
+        sources,
+        rule_dependencies,
+        extension_to_rule_name,
+        platforms,
+        toolset,
+    )
+    missing_sources = _VerifySourcesExist(sources, project_dir)
+
+    for configuration in configurations.values():
+        _FinalizeMSBuildSettings(spec, configuration)
+
+    # Add attributes to root element
+
+    import_default_section = [
+        ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.Default.props"}]
+    ]
+    import_cpp_props_section = [
+        ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.props"}]
+    ]
+    import_cpp_targets_section = [
+        ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.targets"}]
+    ]
+    import_masm_props_section = [
+        ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\masm.props"}]
+    ]
+    import_masm_targets_section = [
+        ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\masm.targets"}]
+    ]
+    import_marmasm_props_section = [
+        ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\marmasm.props"}]
+    ]
+    import_marmasm_targets_section = [
+        ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\marmasm.targets"}]
+    ]
+    macro_section = [["PropertyGroup", {"Label": "UserMacros"}]]
+
+    content = [
+        "Project",
+        {
+            "xmlns": "http://schemas.microsoft.com/developer/msbuild/2003",
+            "ToolsVersion": version.ProjectVersion(),
+            "DefaultTargets": "Build",
+        },
+    ]
+
+    content += _GetMSBuildProjectConfigurations(configurations, spec)
+    content += _GetMSBuildGlobalProperties(
+        spec, version, project.guid, project_file_name
+    )
+    content += import_default_section
+    content += _GetMSBuildConfigurationDetails(spec, project.build_file)
+    if spec.get("msvs_enable_winphone"):
+        content += _GetMSBuildLocalProperties("v120_wp81")
+    else:
+        content += _GetMSBuildLocalProperties(project.msbuild_toolset)
+    content += import_cpp_props_section
+    content += import_masm_props_section
+    if "arm64" in platforms and toolset == "target":
+        content += import_marmasm_props_section
+    content += _GetMSBuildExtensions(props_files_of_rules)
+    content += _GetMSBuildPropertySheets(configurations, spec)
+    content += macro_section
+    content += _GetMSBuildConfigurationGlobalProperties(
+        spec, configurations, project.build_file
+    )
+    content += _GetMSBuildToolSettingsSections(spec, configurations)
+    content += _GetMSBuildSources(
+        spec,
+        sources,
+        exclusions,
+        rule_dependencies,
+        extension_to_rule_name,
+        actions_spec,
+        sources_handled_by_action,
+        list_excluded,
+    )
+    content += _GetMSBuildProjectReferences(project)
+    content += import_cpp_targets_section
+    content += import_masm_targets_section
+    if "arm64" in platforms and toolset == "target":
+        content += import_marmasm_targets_section
+    content += _GetMSBuildExtensionTargets(targets_files_of_rules)
+
+    if spec.get("msvs_external_builder"):
+        content += _GetMSBuildExternalBuilderTargets(spec)
+
+    # TODO(jeanluc) File a bug to get rid of runas.  We had in MSVS:
+    # has_run_as = _WriteMSVSUserFile(project.path, version, spec)
+
+    easy_xml.WriteXmlIfChanged(content, project.path, pretty=True, win32=True)
+
+    return missing_sources
+
+
+def _GetMSBuildExternalBuilderTargets(spec):
+    """Return a list of MSBuild targets for external builders.
+
+    The "Build" and "Clean" targets are always generated.  If the spec contains
+    'msvs_external_builder_clcompile_cmd', then the "ClCompile" target will also
+    be generated, to support building selected C/C++ files.
+
+    Arguments:
+      spec: The gyp target spec.
+    Returns:
+      List of MSBuild 'Target' specs.
+    """
+    build_cmd = _BuildCommandLineForRuleRaw(
+        spec, spec["msvs_external_builder_build_cmd"], False, False, False, False
+    )
+    build_target = ["Target", {"Name": "Build"}]
+    build_target.append(["Exec", {"Command": build_cmd}])
+
+    clean_cmd = _BuildCommandLineForRuleRaw(
+        spec, spec["msvs_external_builder_clean_cmd"], False, False, False, False
+    )
+    clean_target = ["Target", {"Name": "Clean"}]
+    clean_target.append(["Exec", {"Command": clean_cmd}])
+
+    targets = [build_target, clean_target]
+
+    if spec.get("msvs_external_builder_clcompile_cmd"):
+        clcompile_cmd = _BuildCommandLineForRuleRaw(
+            spec,
+            spec["msvs_external_builder_clcompile_cmd"],
+            False,
+            False,
+            False,
+            False,
+        )
+        clcompile_target = ["Target", {"Name": "ClCompile"}]
+        clcompile_target.append(["Exec", {"Command": clcompile_cmd}])
+        targets.append(clcompile_target)
+
+    return targets
+
+
+def _GetMSBuildExtensions(props_files_of_rules):
+    extensions = ["ImportGroup", {"Label": "ExtensionSettings"}]
+    for props_file in props_files_of_rules:
+        extensions.append(["Import", {"Project": props_file}])
+    return [extensions]
+
+
+def _GetMSBuildExtensionTargets(targets_files_of_rules):
+    targets_node = ["ImportGroup", {"Label": "ExtensionTargets"}]
+    for targets_file in sorted(targets_files_of_rules):
+        targets_node.append(["Import", {"Project": targets_file}])
+    return [targets_node]
+
+
+def _GenerateActionsForMSBuild(spec, actions_to_add):
+    """Add actions accumulated into an actions_to_add, merging as needed.
+
+    Arguments:
+      spec: the target project dict
+      actions_to_add: dictionary keyed on input name, which maps to a list of
+          dicts describing the actions attached to that input file.
+
+    Returns:
+      A pair of (action specification, the sources handled by this action).
+    """
+    sources_handled_by_action = OrderedSet()
+    actions_spec = []
+    for primary_input, actions in actions_to_add.items():
+        if generator_supports_multiple_toolsets:
+            primary_input = primary_input.replace(".exe", "_host.exe")
+        inputs = OrderedSet()
+        outputs = OrderedSet()
+        descriptions = []
+        commands = []
+        for action in actions:
+
+            def fixup_host_exe(i):
+                if "$(OutDir)" in i:
+                    i = i.replace(".exe", "_host.exe")
+                return i
+
+            if generator_supports_multiple_toolsets:
+                action["inputs"] = [fixup_host_exe(i) for i in action["inputs"]]
+            inputs.update(OrderedSet(action["inputs"]))
+            outputs.update(OrderedSet(action["outputs"]))
+            descriptions.append(action["description"])
+            cmd = action["command"]
+            if generator_supports_multiple_toolsets:
+                cmd = cmd.replace(".exe", "_host.exe")
+            # For most actions, add 'call' so that actions that invoke batch files
+            # return and continue executing.  msbuild_use_call provides a way to
+            # disable this but I have not seen any adverse effect from doing that
+            # for everything.
+            if action.get("msbuild_use_call", True):
+                cmd = "call " + cmd
+            commands.append(cmd)
+        # Add the custom build action for one input file.
+        description = ", and also ".join(descriptions)
+
+        # We can't join the commands simply with && because the command line will
+        # get too long. See also _AddActions: cygwin's setup_env mustn't be called
+        # for every invocation or the command that sets the PATH will grow too
+        # long.
+        command = "\r\n".join(
+            [c + "\r\nif %errorlevel% neq 0 exit /b %errorlevel%" for c in commands]
+        )
+        _AddMSBuildAction(
+            spec,
+            primary_input,
+            inputs,
+            outputs,
+            command,
+            description,
+            sources_handled_by_action,
+            actions_spec,
+        )
+    return actions_spec, sources_handled_by_action
+
+
+def _AddMSBuildAction(
+    spec,
+    primary_input,
+    inputs,
+    outputs,
+    cmd,
+    description,
+    sources_handled_by_action,
+    actions_spec,
+):
+    command = MSVSSettings.ConvertVCMacrosToMSBuild(cmd)
+    primary_input = _FixPath(primary_input)
+    inputs_array = _FixPaths(inputs)
+    outputs_array = _FixPaths(outputs)
+    additional_inputs = ";".join([i for i in inputs_array if i != primary_input])
+    outputs = ";".join(outputs_array)
+    sources_handled_by_action.add(primary_input)
+    action_spec = ["CustomBuild", {"Include": primary_input}]
+    action_spec.extend(
+        # TODO(jeanluc) 'Document' for all or just if as_sources?
+        [
+            ["FileType", "Document"],
+            ["Command", command],
+            ["Message", description],
+            ["Outputs", outputs],
+        ]
+    )
+    if additional_inputs:
+        action_spec.append(["AdditionalInputs", additional_inputs])
+    actions_spec.append(action_spec)
diff --git a/.pnpm-store/v11/files/5a/33ef33a21850b73561b9ee7b53bd255af2577f54fdba77fb3d3037cf63f85930b4b3266ac40e8d95848cb333664ee91fd96c88071234619bd214e03bbb0bdb b/.pnpm-store/v11/files/5a/33ef33a21850b73561b9ee7b53bd255af2577f54fdba77fb3d3037cf63f85930b4b3266ac40e8d95848cb333664ee91fd96c88071234619bd214e03bbb0bdb
new file mode 100644
index 0000000000..5ac9d846dd
--- /dev/null
+++ b/.pnpm-store/v11/files/5a/33ef33a21850b73561b9ee7b53bd255af2577f54fdba77fb3d3037cf63f85930b4b3266ac40e8d95848cb333664ee91fd96c88071234619bd214e03bbb0bdb
@@ -0,0 +1,45 @@
+'use strict'
+
+const assert = require('node:assert')
+const { URLSerializer } = require('../fetch/data-url')
+const { isValidHeaderName } = require('../fetch/util')
+
+/**
+ * @see https://url.spec.whatwg.org/#concept-url-equals
+ * @param {URL} A
+ * @param {URL} B
+ * @param {boolean | undefined} excludeFragment
+ * @returns {boolean}
+ */
+function urlEquals (A, B, excludeFragment = false) {
+  const serializedA = URLSerializer(A, excludeFragment)
+
+  const serializedB = URLSerializer(B, excludeFragment)
+
+  return serializedA === serializedB
+}
+
+/**
+ * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262
+ * @param {string} header
+ */
+function getFieldValues (header) {
+  assert(header !== null)
+
+  const values = []
+
+  for (let value of header.split(',')) {
+    value = value.trim()
+
+    if (isValidHeaderName(value)) {
+      values.push(value)
+    }
+  }
+
+  return values
+}
+
+module.exports = {
+  urlEquals,
+  getFieldValues
+}
diff --git a/.pnpm-store/v11/files/5a/d197561f96ba658811463affa758e4a01d31d782b662874a6781321e437ca61962e340b56a0d9a0588c991d6e9caaaa406bb2e6ed3ede1b9345455d77406ad b/.pnpm-store/v11/files/5a/d197561f96ba658811463affa758e4a01d31d782b662874a6781321e437ca61962e340b56a0d9a0588c991d6e9caaaa406bb2e6ed3ede1b9345455d77406ad
new file mode 100644
index 0000000000..8838b81d33
--- /dev/null
+++ b/.pnpm-store/v11/files/5a/d197561f96ba658811463affa758e4a01d31d782b662874a6781321e437ca61962e340b56a0d9a0588c991d6e9caaaa406bb2e6ed3ede1b9345455d77406ad
@@ -0,0 +1,63 @@
+'use strict'
+
+const path = require('path')
+const log = require('./log')
+
+function findNodeDirectory (scriptLocation, processObj) {
+  // set dirname and process if not passed in
+  // this facilitates regression tests
+  if (scriptLocation === undefined) {
+    scriptLocation = __dirname
+  }
+  if (processObj === undefined) {
+    processObj = process
+  }
+
+  // Have a look to see what is above us, to try and work out where we are
+  const npmParentDirectory = path.join(scriptLocation, '../../../..')
+  log.verbose('node-gyp root', 'npm_parent_directory is ' +
+              path.basename(npmParentDirectory))
+  let nodeRootDir = ''
+
+  log.verbose('node-gyp root', 'Finding node root directory')
+  if (path.basename(npmParentDirectory) === 'deps') {
+    // We are in a build directory where this script lives in
+    // deps/npm/node_modules/node-gyp/lib
+    nodeRootDir = path.join(npmParentDirectory, '..')
+    log.verbose('node-gyp root', 'in build directory, root = ' +
+                nodeRootDir)
+  } else if (path.basename(npmParentDirectory) === 'node_modules') {
+    // We are in a node install directory where this script lives in
+    // lib/node_modules/npm/node_modules/node-gyp/lib or
+    // node_modules/npm/node_modules/node-gyp/lib depending on the
+    // platform
+    if (processObj.platform === 'win32') {
+      nodeRootDir = path.join(npmParentDirectory, '..')
+    } else {
+      nodeRootDir = path.join(npmParentDirectory, '../..')
+    }
+    log.verbose('node-gyp root', 'in install directory, root = ' +
+                nodeRootDir)
+  } else {
+    // We don't know where we are, try working it out from the location
+    // of the node binary
+    const nodeDir = path.dirname(processObj.execPath)
+    const directoryUp = path.basename(nodeDir)
+    if (directoryUp === 'bin') {
+      nodeRootDir = path.join(nodeDir, '..')
+    } else if (directoryUp === 'Release' || directoryUp === 'Debug') {
+      // If we are a recently built node, and the directory structure
+      // is that of a repository. If we are on Windows then we only need
+      // to go one level up, everything else, two
+      if (processObj.platform === 'win32') {
+        nodeRootDir = path.join(nodeDir, '..')
+      } else {
+        nodeRootDir = path.join(nodeDir, '../..')
+      }
+    }
+    // Else return the default blank, "".
+  }
+  return nodeRootDir
+}
+
+module.exports = findNodeDirectory
diff --git a/.pnpm-store/v11/files/5c/5db68314220af2f1e41d4e0f5179d44019ea2a81ef17a5bdac49fb778cca61562484ab42380954a07bf5def3b2c62176ea0ea8dde9fde15c74ff2a92782434 b/.pnpm-store/v11/files/5c/5db68314220af2f1e41d4e0f5179d44019ea2a81ef17a5bdac49fb778cca61562484ab42380954a07bf5def3b2c62176ea0ea8dde9fde15c74ff2a92782434
new file mode 100644
index 0000000000..6f9ec5e120
--- /dev/null
+++ b/.pnpm-store/v11/files/5c/5db68314220af2f1e41d4e0f5179d44019ea2a81ef17a5bdac49fb778cca61562484ab42380954a07bf5def3b2c62176ea0ea8dde9fde15c74ff2a92782434
@@ -0,0 +1,194 @@
+'use strict'
+
+const DispatcherBase = require('./dispatcher-base')
+const FixedQueue = require('./fixed-queue')
+const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require('../core/symbols')
+const PoolStats = require('./pool-stats')
+
+const kClients = Symbol('clients')
+const kNeedDrain = Symbol('needDrain')
+const kQueue = Symbol('queue')
+const kClosedResolve = Symbol('closed resolve')
+const kOnDrain = Symbol('onDrain')
+const kOnConnect = Symbol('onConnect')
+const kOnDisconnect = Symbol('onDisconnect')
+const kOnConnectionError = Symbol('onConnectionError')
+const kGetDispatcher = Symbol('get dispatcher')
+const kAddClient = Symbol('add client')
+const kRemoveClient = Symbol('remove client')
+const kStats = Symbol('stats')
+
+class PoolBase extends DispatcherBase {
+  constructor (opts) {
+    super(opts)
+
+    this[kQueue] = new FixedQueue()
+    this[kClients] = []
+    this[kQueued] = 0
+
+    const pool = this
+
+    this[kOnDrain] = function onDrain (origin, targets) {
+      const queue = pool[kQueue]
+
+      let needDrain = false
+
+      while (!needDrain) {
+        const item = queue.shift()
+        if (!item) {
+          break
+        }
+        pool[kQueued]--
+        needDrain = !this.dispatch(item.opts, item.handler)
+      }
+
+      this[kNeedDrain] = needDrain
+
+      if (!this[kNeedDrain] && pool[kNeedDrain]) {
+        pool[kNeedDrain] = false
+        pool.emit('drain', origin, [pool, ...targets])
+      }
+
+      if (pool[kClosedResolve] && queue.isEmpty()) {
+        Promise
+          .all(pool[kClients].map(c => c.close()))
+          .then(pool[kClosedResolve])
+      }
+    }
+
+    this[kOnConnect] = (origin, targets) => {
+      pool.emit('connect', origin, [pool, ...targets])
+    }
+
+    this[kOnDisconnect] = (origin, targets, err) => {
+      pool.emit('disconnect', origin, [pool, ...targets], err)
+    }
+
+    this[kOnConnectionError] = (origin, targets, err) => {
+      pool.emit('connectionError', origin, [pool, ...targets], err)
+    }
+
+    this[kStats] = new PoolStats(this)
+  }
+
+  get [kBusy] () {
+    return this[kNeedDrain]
+  }
+
+  get [kConnected] () {
+    return this[kClients].filter(client => client[kConnected]).length
+  }
+
+  get [kFree] () {
+    return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length
+  }
+
+  get [kPending] () {
+    let ret = this[kQueued]
+    for (const { [kPending]: pending } of this[kClients]) {
+      ret += pending
+    }
+    return ret
+  }
+
+  get [kRunning] () {
+    let ret = 0
+    for (const { [kRunning]: running } of this[kClients]) {
+      ret += running
+    }
+    return ret
+  }
+
+  get [kSize] () {
+    let ret = this[kQueued]
+    for (const { [kSize]: size } of this[kClients]) {
+      ret += size
+    }
+    return ret
+  }
+
+  get stats () {
+    return this[kStats]
+  }
+
+  async [kClose] () {
+    if (this[kQueue].isEmpty()) {
+      await Promise.all(this[kClients].map(c => c.close()))
+    } else {
+      await new Promise((resolve) => {
+        this[kClosedResolve] = resolve
+      })
+    }
+  }
+
+  async [kDestroy] (err) {
+    while (true) {
+      const item = this[kQueue].shift()
+      if (!item) {
+        break
+      }
+      item.handler.onError(err)
+    }
+
+    await Promise.all(this[kClients].map(c => c.destroy(err)))
+  }
+
+  [kDispatch] (opts, handler) {
+    const dispatcher = this[kGetDispatcher]()
+
+    if (!dispatcher) {
+      this[kNeedDrain] = true
+      this[kQueue].push({ opts, handler })
+      this[kQueued]++
+    } else if (!dispatcher.dispatch(opts, handler)) {
+      dispatcher[kNeedDrain] = true
+      this[kNeedDrain] = !this[kGetDispatcher]()
+    }
+
+    return !this[kNeedDrain]
+  }
+
+  [kAddClient] (client) {
+    client
+      .on('drain', this[kOnDrain])
+      .on('connect', this[kOnConnect])
+      .on('disconnect', this[kOnDisconnect])
+      .on('connectionError', this[kOnConnectionError])
+
+    this[kClients].push(client)
+
+    if (this[kNeedDrain]) {
+      queueMicrotask(() => {
+        if (this[kNeedDrain]) {
+          this[kOnDrain](client[kUrl], [this, client])
+        }
+      })
+    }
+
+    return this
+  }
+
+  [kRemoveClient] (client) {
+    client.close(() => {
+      const idx = this[kClients].indexOf(client)
+      if (idx !== -1) {
+        this[kClients].splice(idx, 1)
+      }
+    })
+
+    this[kNeedDrain] = this[kClients].some(dispatcher => (
+      !dispatcher[kNeedDrain] &&
+      dispatcher.closed !== true &&
+      dispatcher.destroyed !== true
+    ))
+  }
+}
+
+module.exports = {
+  PoolBase,
+  kClients,
+  kNeedDrain,
+  kAddClient,
+  kRemoveClient,
+  kGetDispatcher
+}
diff --git a/.pnpm-store/v11/files/5d/2fc301e1f557325dc6be4ce87ed861c055825898dde0f968985dcea110f154b152218e694fd021a8a68131954c11b2f24ebe0b1036baa45a785e4e095cc9cb b/.pnpm-store/v11/files/5d/2fc301e1f557325dc6be4ce87ed861c055825898dde0f968985dcea110f154b152218e694fd021a8a68131954c11b2f24ebe0b1036baa45a785e4e095cc9cb
new file mode 100644
index 0000000000..00a0abe691
--- /dev/null
+++ b/.pnpm-store/v11/files/5d/2fc301e1f557325dc6be4ce87ed861c055825898dde0f968985dcea110f154b152218e694fd021a8a68131954c11b2f24ebe0b1036baa45a785e4e095cc9cb
@@ -0,0 +1,230 @@
+'use strict'
+
+const gracefulFs = require('graceful-fs')
+const fs = gracefulFs.promises
+const path = require('path')
+const { glob } = require('tinyglobby')
+const log = require('./log')
+const which = require('which')
+const win = process.platform === 'win32'
+
+async function build (gyp, argv) {
+  let platformMake = 'make'
+  if (process.platform === 'aix') {
+    platformMake = 'gmake'
+  } else if (process.platform === 'os400') {
+    platformMake = 'gmake'
+  } else if (process.platform.indexOf('bsd') !== -1) {
+    platformMake = 'gmake'
+  } else if (win && argv.length > 0) {
+    argv = argv.map(function (target) {
+      return '/t:' + target
+    })
+  }
+
+  const makeCommand = gyp.opts.make || process.env.MAKE || platformMake
+  let command = win ? 'msbuild' : makeCommand
+  const jobs = gyp.opts.jobs || process.env.JOBS
+  let buildType
+  let config
+  let arch
+  let nodeDir
+  let guessedSolution
+  let python
+  let buildBinsDir
+
+  await loadConfigGypi()
+
+  /**
+   * Load the "config.gypi" file that was generated during "configure".
+   */
+
+  async function loadConfigGypi () {
+    let data
+    try {
+      const configPath = path.resolve('build', 'config.gypi')
+      data = await fs.readFile(configPath, 'utf8')
+    } catch (err) {
+      if (err.code === 'ENOENT') {
+        throw new Error('You must run `node-gyp configure` first!')
+      } else {
+        throw err
+      }
+    }
+
+    config = JSON.parse(data.replace(/#.+\n/, ''))
+
+    // get the 'arch', 'buildType', and 'nodeDir' vars from the config
+    buildType = config.target_defaults.default_configuration
+    arch = config.variables.target_arch
+    nodeDir = config.variables.nodedir
+    python = config.variables.python
+
+    if ('debug' in gyp.opts) {
+      buildType = gyp.opts.debug ? 'Debug' : 'Release'
+    }
+    if (!buildType) {
+      buildType = 'Release'
+    }
+
+    log.verbose('build type', buildType)
+    log.verbose('architecture', arch)
+    log.verbose('node dev dir', nodeDir)
+    log.verbose('python', python)
+
+    if (win) {
+      await findSolutionFile()
+    } else {
+      await doWhich()
+    }
+  }
+
+  /**
+   * On Windows, find the first build/*.sln file.
+   */
+
+  async function findSolutionFile () {
+    const files = await glob('build/*.sln', { expandDirectories: false })
+    if (files.length === 0) {
+      if (gracefulFs.existsSync('build/Makefile') ||
+          (await glob('build/*.mk', { expandDirectories: false })).length !== 0) {
+        command = makeCommand
+        await doWhich(false)
+        return
+      } else {
+        throw new Error('Could not find *.sln file or Makefile. Did you run "configure"?')
+      }
+    }
+    guessedSolution = files[0]
+    log.verbose('found first Solution file', guessedSolution)
+    await doWhich(true)
+  }
+
+  /**
+   * Uses node-which to locate the msbuild / make executable.
+   */
+
+  async function doWhich (msvs) {
+    // On Windows use msbuild provided by node-gyp configure
+    if (msvs) {
+      if (!config.variables.msbuild_path) {
+        throw new Error('MSBuild is not set, please run `node-gyp configure`.')
+      }
+      command = config.variables.msbuild_path
+      log.verbose('using MSBuild:', command)
+      await doBuild(msvs)
+      return
+    }
+
+    // First make sure we have the build command in the PATH
+    const execPath = await which(command)
+    log.verbose('`which` succeeded for `' + command + '`', execPath)
+    await doBuild(msvs)
+  }
+
+  /**
+   * Actually spawn the process and compile the module.
+   */
+
+  async function doBuild (msvs) {
+    // Enable Verbose build
+    const verbose = log.logger.isVisible('verbose')
+    let j
+
+    if (!msvs && verbose) {
+      argv.push('V=1')
+    }
+
+    if (msvs && !verbose) {
+      argv.push('/clp:Verbosity=minimal')
+    }
+
+    if (msvs) {
+      // Turn off the Microsoft logo on Windows
+      argv.push('/nologo')
+      // No lingering msbuild processes and open file handles
+      argv.push('/nodeReuse:false')
+    }
+
+    // Specify the build type, Release by default
+    if (msvs) {
+      // Convert .gypi config target_arch to MSBuild /Platform
+      // Since there are many ways to state '32-bit Intel', default to it.
+      // N.B. msbuild's Condition string equality tests are case-insensitive.
+      const archLower = arch.toLowerCase()
+      const p = archLower === 'x64'
+        ? 'x64'
+        : (archLower === 'arm'
+            ? 'ARM'
+            : (archLower === 'arm64' ? 'ARM64' : 'Win32'))
+      argv.push('/p:Configuration=' + buildType + ';Platform=' + p)
+      if (jobs) {
+        j = parseInt(jobs, 10)
+        if (!isNaN(j) && j > 0) {
+          argv.push('/m:' + j)
+        } else if (jobs.toUpperCase() === 'MAX') {
+          argv.push('/m:' + require('os').availableParallelism())
+        }
+      }
+    } else {
+      argv.push('BUILDTYPE=' + buildType)
+      // Invoke the Makefile in the 'build' dir.
+      argv.push('-C')
+      argv.push('build')
+      if (jobs) {
+        j = parseInt(jobs, 10)
+        if (!isNaN(j) && j > 0) {
+          argv.push('--jobs')
+          argv.push(j)
+        } else if (jobs.toUpperCase() === 'MAX') {
+          argv.push('--jobs')
+          argv.push(require('os').availableParallelism())
+        }
+      }
+    }
+
+    if (msvs) {
+      // did the user specify their own .sln file?
+      const hasSln = argv.some(function (arg) {
+        return path.extname(arg) === '.sln'
+      })
+      if (!hasSln) {
+        argv.unshift(gyp.opts.solution || guessedSolution)
+      }
+    }
+
+    if (!win) {
+      // Add build-time dependency symlinks (such as Python) to PATH
+      buildBinsDir = path.resolve('build', 'node_gyp_bins')
+      process.env.PATH = `${buildBinsDir}:${process.env.PATH}`
+      await fs.mkdir(buildBinsDir, { recursive: true })
+      const symlinkDestination = path.join(buildBinsDir, 'python3')
+      try {
+        await fs.unlink(symlinkDestination)
+      } catch (err) {
+        if (err.code !== 'ENOENT') throw err
+      }
+      await fs.symlink(python, symlinkDestination)
+      log.verbose('bin symlinks', `created symlink to "${python}" in "${buildBinsDir}" and added to PATH`)
+    }
+
+    const proc = gyp.spawn(command, argv)
+    await new Promise((resolve, reject) => proc.on('exit', async (code, signal) => {
+      if (buildBinsDir) {
+        // Clean up the build-time dependency symlinks:
+        await fs.rm(buildBinsDir, { recursive: true, maxRetries: 3 })
+      }
+
+      if (code !== 0) {
+        return reject(new Error('`' + command + '` failed with exit code: ' + code))
+      }
+      if (signal) {
+        return reject(new Error('`' + command + '` got signal: ' + signal))
+      }
+      resolve()
+    }))
+  }
+}
+
+module.exports = build
+module.exports.usage = 'Invokes `' + (win ? 'msbuild' : 'make') + '` and builds the module'
diff --git a/.pnpm-store/v11/files/5e/6104ef77480d1c3c25e263329944f7513443c0b332bd3fdb5bfc28ab3491dd484675a6ff5a3781f55527e1bf62b4a57d84561752ad42305d89b9bd8d5b1e53 b/.pnpm-store/v11/files/5e/6104ef77480d1c3c25e263329944f7513443c0b332bd3fdb5bfc28ab3491dd484675a6ff5a3781f55527e1bf62b4a57d84561752ad42305d89b9bd8d5b1e53
new file mode 100644
index 0000000000..03fd551d86
--- /dev/null
+++ b/.pnpm-store/v11/files/5e/6104ef77480d1c3c25e263329944f7513443c0b332bd3fdb5bfc28ab3491dd484675a6ff5a3781f55527e1bf62b4a57d84561752ad42305d89b9bd8d5b1e53
@@ -0,0 +1,11964 @@
+import { createRequire as _cr } from 'module';const require = _cr(import.meta.url); const __filename = import.meta.filename; const __dirname = import.meta.dirname;var _ew=process.emitWarning;process.emitWarning=function(w,...a){if(String(w).includes('SQLite')&&(a[0]==='ExperimentalWarning'||(a[0]&&a[0].type==='ExperimentalWarning')))return;return _ew.call(process,w,...a)};
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
+  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
+}) : x)(function(x) {
+  if (typeof require !== "undefined") return require.apply(this, arguments);
+  throw Error('Dynamic require of "' + x + '" is not supported');
+});
+var __commonJS = (cb, mod) => function __require2() {
+  try {
+    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
+  } catch (e) {
+    throw mod = 0, e;
+  }
+};
+var __copyProps = (to, from, except, desc) => {
+  if (from && typeof from === "object" || typeof from === "function") {
+    for (let key of __getOwnPropNames(from))
+      if (!__hasOwnProp.call(to, key) && key !== except)
+        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+  }
+  return to;
+};
+var __toESM = (mod, isNodeMode, target2) => (target2 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+  // If the importer is in node compatibility mode or this is not an ESM
+  // file that has been converted to a CommonJS file using a Babel-
+  // compatible transform (i.e. "__esModule" has not been set), then set
+  // "default" to the CommonJS "module.exports" for node compatibility.
+  isNodeMode || !mod || !mod.__esModule ? __defProp(target2, "default", { value: mod, enumerable: true }) : target2,
+  mod
+));
+
+// ../../../../../setup-pnpm/store/v11/links/@/graceful-fs/4.2.11/e60a23841f60609f733db41b2b1eced16c30ec8fe2e67c2a9b80e2dab0755700/node_modules/graceful-fs/polyfills.js
+var require_polyfills = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/graceful-fs/4.2.11/e60a23841f60609f733db41b2b1eced16c30ec8fe2e67c2a9b80e2dab0755700/node_modules/graceful-fs/polyfills.js"(exports, module) {
+    var constants2 = __require("constants");
+    var origCwd = process.cwd;
+    var cwd = null;
+    var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
+    process.cwd = function() {
+      if (!cwd)
+        cwd = origCwd.call(process);
+      return cwd;
+    };
+    try {
+      process.cwd();
+    } catch (er) {
+    }
+    if (typeof process.chdir === "function") {
+      chdir = process.chdir;
+      process.chdir = function(d) {
+        cwd = null;
+        chdir.call(process, d);
+      };
+      if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
+    }
+    var chdir;
+    module.exports = patch;
+    function patch(fs13) {
+      if (constants2.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
+        patchLchmod(fs13);
+      }
+      if (!fs13.lutimes) {
+        patchLutimes(fs13);
+      }
+      fs13.chown = chownFix(fs13.chown);
+      fs13.fchown = chownFix(fs13.fchown);
+      fs13.lchown = chownFix(fs13.lchown);
+      fs13.chmod = chmodFix(fs13.chmod);
+      fs13.fchmod = chmodFix(fs13.fchmod);
+      fs13.lchmod = chmodFix(fs13.lchmod);
+      fs13.chownSync = chownFixSync(fs13.chownSync);
+      fs13.fchownSync = chownFixSync(fs13.fchownSync);
+      fs13.lchownSync = chownFixSync(fs13.lchownSync);
+      fs13.chmodSync = chmodFixSync(fs13.chmodSync);
+      fs13.fchmodSync = chmodFixSync(fs13.fchmodSync);
+      fs13.lchmodSync = chmodFixSync(fs13.lchmodSync);
+      fs13.stat = statFix(fs13.stat);
+      fs13.fstat = statFix(fs13.fstat);
+      fs13.lstat = statFix(fs13.lstat);
+      fs13.statSync = statFixSync(fs13.statSync);
+      fs13.fstatSync = statFixSync(fs13.fstatSync);
+      fs13.lstatSync = statFixSync(fs13.lstatSync);
+      if (fs13.chmod && !fs13.lchmod) {
+        fs13.lchmod = function(path18, mode, cb) {
+          if (cb) process.nextTick(cb);
+        };
+        fs13.lchmodSync = function() {
+        };
+      }
+      if (fs13.chown && !fs13.lchown) {
+        fs13.lchown = function(path18, uid, gid, cb) {
+          if (cb) process.nextTick(cb);
+        };
+        fs13.lchownSync = function() {
+        };
+      }
+      if (platform === "win32") {
+        fs13.rename = typeof fs13.rename !== "function" ? fs13.rename : (function(fs$rename) {
+          function rename(from, to, cb) {
+            var start = Date.now();
+            var backoff = 0;
+            fs$rename(from, to, function CB(er) {
+              if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
+                setTimeout(function() {
+                  fs13.stat(to, function(stater, st) {
+                    if (stater && stater.code === "ENOENT")
+                      fs$rename(from, to, CB);
+                    else
+                      cb(er);
+                  });
+                }, backoff);
+                if (backoff < 100)
+                  backoff += 10;
+                return;
+              }
+              if (cb) cb(er);
+            });
+          }
+          if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
+          return rename;
+        })(fs13.rename);
+      }
+      fs13.read = typeof fs13.read !== "function" ? fs13.read : (function(fs$read) {
+        function read2(fd, buffer, offset, length, position3, callback_) {
+          var callback;
+          if (callback_ && typeof callback_ === "function") {
+            var eagCounter = 0;
+            callback = function(er, _, __) {
+              if (er && er.code === "EAGAIN" && eagCounter < 10) {
+                eagCounter++;
+                return fs$read.call(fs13, fd, buffer, offset, length, position3, callback);
+              }
+              callback_.apply(this, arguments);
+            };
+          }
+          return fs$read.call(fs13, fd, buffer, offset, length, position3, callback);
+        }
+        if (Object.setPrototypeOf) Object.setPrototypeOf(read2, fs$read);
+        return read2;
+      })(fs13.read);
+      fs13.readSync = typeof fs13.readSync !== "function" ? fs13.readSync : /* @__PURE__ */ (function(fs$readSync) {
+        return function(fd, buffer, offset, length, position3) {
+          var eagCounter = 0;
+          while (true) {
+            try {
+              return fs$readSync.call(fs13, fd, buffer, offset, length, position3);
+            } catch (er) {
+              if (er.code === "EAGAIN" && eagCounter < 10) {
+                eagCounter++;
+                continue;
+              }
+              throw er;
+            }
+          }
+        };
+      })(fs13.readSync);
+      function patchLchmod(fs14) {
+        fs14.lchmod = function(path18, mode, callback) {
+          fs14.open(
+            path18,
+            constants2.O_WRONLY | constants2.O_SYMLINK,
+            mode,
+            function(err, fd) {
+              if (err) {
+                if (callback) callback(err);
+                return;
+              }
+              fs14.fchmod(fd, mode, function(err2) {
+                fs14.close(fd, function(err22) {
+                  if (callback) callback(err2 || err22);
+                });
+              });
+            }
+          );
+        };
+        fs14.lchmodSync = function(path18, mode) {
+          var fd = fs14.openSync(path18, constants2.O_WRONLY | constants2.O_SYMLINK, mode);
+          var threw = true;
+          var ret;
+          try {
+            ret = fs14.fchmodSync(fd, mode);
+            threw = false;
+          } finally {
+            if (threw) {
+              try {
+                fs14.closeSync(fd);
+              } catch (er) {
+              }
+            } else {
+              fs14.closeSync(fd);
+            }
+          }
+          return ret;
+        };
+      }
+      function patchLutimes(fs14) {
+        if (constants2.hasOwnProperty("O_SYMLINK") && fs14.futimes) {
+          fs14.lutimes = function(path18, at, mt, cb) {
+            fs14.open(path18, constants2.O_SYMLINK, function(er, fd) {
+              if (er) {
+                if (cb) cb(er);
+                return;
+              }
+              fs14.futimes(fd, at, mt, function(er2) {
+                fs14.close(fd, function(er22) {
+                  if (cb) cb(er2 || er22);
+                });
+              });
+            });
+          };
+          fs14.lutimesSync = function(path18, at, mt) {
+            var fd = fs14.openSync(path18, constants2.O_SYMLINK);
+            var ret;
+            var threw = true;
+            try {
+              ret = fs14.futimesSync(fd, at, mt);
+              threw = false;
+            } finally {
+              if (threw) {
+                try {
+                  fs14.closeSync(fd);
+                } catch (er) {
+                }
+              } else {
+                fs14.closeSync(fd);
+              }
+            }
+            return ret;
+          };
+        } else if (fs14.futimes) {
+          fs14.lutimes = function(_a, _b, _c, cb) {
+            if (cb) process.nextTick(cb);
+          };
+          fs14.lutimesSync = function() {
+          };
+        }
+      }
+      function chmodFix(orig) {
+        if (!orig) return orig;
+        return function(target2, mode, cb) {
+          return orig.call(fs13, target2, mode, function(er) {
+            if (chownErOk(er)) er = null;
+            if (cb) cb.apply(this, arguments);
+          });
+        };
+      }
+      function chmodFixSync(orig) {
+        if (!orig) return orig;
+        return function(target2, mode) {
+          try {
+            return orig.call(fs13, target2, mode);
+          } catch (er) {
+            if (!chownErOk(er)) throw er;
+          }
+        };
+      }
+      function chownFix(orig) {
+        if (!orig) return orig;
+        return function(target2, uid, gid, cb) {
+          return orig.call(fs13, target2, uid, gid, function(er) {
+            if (chownErOk(er)) er = null;
+            if (cb) cb.apply(this, arguments);
+          });
+        };
+      }
+      function chownFixSync(orig) {
+        if (!orig) return orig;
+        return function(target2, uid, gid) {
+          try {
+            return orig.call(fs13, target2, uid, gid);
+          } catch (er) {
+            if (!chownErOk(er)) throw er;
+          }
+        };
+      }
+      function statFix(orig) {
+        if (!orig) return orig;
+        return function(target2, options, cb) {
+          if (typeof options === "function") {
+            cb = options;
+            options = null;
+          }
+          function callback(er, stats) {
+            if (stats) {
+              if (stats.uid < 0) stats.uid += 4294967296;
+              if (stats.gid < 0) stats.gid += 4294967296;
+            }
+            if (cb) cb.apply(this, arguments);
+          }
+          return options ? orig.call(fs13, target2, options, callback) : orig.call(fs13, target2, callback);
+        };
+      }
+      function statFixSync(orig) {
+        if (!orig) return orig;
+        return function(target2, options) {
+          var stats = options ? orig.call(fs13, target2, options) : orig.call(fs13, target2);
+          if (stats) {
+            if (stats.uid < 0) stats.uid += 4294967296;
+            if (stats.gid < 0) stats.gid += 4294967296;
+          }
+          return stats;
+        };
+      }
+      function chownErOk(er) {
+        if (!er)
+          return true;
+        if (er.code === "ENOSYS")
+          return true;
+        var nonroot = !process.getuid || process.getuid() !== 0;
+        if (nonroot) {
+          if (er.code === "EINVAL" || er.code === "EPERM")
+            return true;
+        }
+        return false;
+      }
+    }
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/graceful-fs/4.2.11/e60a23841f60609f733db41b2b1eced16c30ec8fe2e67c2a9b80e2dab0755700/node_modules/graceful-fs/legacy-streams.js
+var require_legacy_streams = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/graceful-fs/4.2.11/e60a23841f60609f733db41b2b1eced16c30ec8fe2e67c2a9b80e2dab0755700/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
+    var Stream = __require("stream").Stream;
+    module.exports = legacy;
+    function legacy(fs13) {
+      return {
+        ReadStream,
+        WriteStream
+      };
+      function ReadStream(path18, options) {
+        if (!(this instanceof ReadStream)) return new ReadStream(path18, options);
+        Stream.call(this);
+        var self2 = this;
+        this.path = path18;
+        this.fd = null;
+        this.readable = true;
+        this.paused = false;
+        this.flags = "r";
+        this.mode = 438;
+        this.bufferSize = 64 * 1024;
+        options = options || {};
+        var keys = Object.keys(options);
+        for (var index = 0, length = keys.length; index < length; index++) {
+          var key = keys[index];
+          this[key] = options[key];
+        }
+        if (this.encoding) this.setEncoding(this.encoding);
+        if (this.start !== void 0) {
+          if ("number" !== typeof this.start) {
+            throw TypeError("start must be a Number");
+          }
+          if (this.end === void 0) {
+            this.end = Infinity;
+          } else if ("number" !== typeof this.end) {
+            throw TypeError("end must be a Number");
+          }
+          if (this.start > this.end) {
+            throw new Error("start must be <= end");
+          }
+          this.pos = this.start;
+        }
+        if (this.fd !== null) {
+          process.nextTick(function() {
+            self2._read();
+          });
+          return;
+        }
+        fs13.open(this.path, this.flags, this.mode, function(err, fd) {
+          if (err) {
+            self2.emit("error", err);
+            self2.readable = false;
+            return;
+          }
+          self2.fd = fd;
+          self2.emit("open", fd);
+          self2._read();
+        });
+      }
+      function WriteStream(path18, options) {
+        if (!(this instanceof WriteStream)) return new WriteStream(path18, options);
+        Stream.call(this);
+        this.path = path18;
+        this.fd = null;
+        this.writable = true;
+        this.flags = "w";
+        this.encoding = "binary";
+        this.mode = 438;
+        this.bytesWritten = 0;
+        options = options || {};
+        var keys = Object.keys(options);
+        for (var index = 0, length = keys.length; index < length; index++) {
+          var key = keys[index];
+          this[key] = options[key];
+        }
+        if (this.start !== void 0) {
+          if ("number" !== typeof this.start) {
+            throw TypeError("start must be a Number");
+          }
+          if (this.start < 0) {
+            throw new Error("start must be >= zero");
+          }
+          this.pos = this.start;
+        }
+        this.busy = false;
+        this._queue = [];
+        if (this.fd === null) {
+          this._open = fs13.open;
+          this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
+          this.flush();
+        }
+      }
+    }
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/graceful-fs/4.2.11/e60a23841f60609f733db41b2b1eced16c30ec8fe2e67c2a9b80e2dab0755700/node_modules/graceful-fs/clone.js
+var require_clone = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/graceful-fs/4.2.11/e60a23841f60609f733db41b2b1eced16c30ec8fe2e67c2a9b80e2dab0755700/node_modules/graceful-fs/clone.js"(exports, module) {
+    "use strict";
+    module.exports = clone;
+    var getPrototypeOf = Object.getPrototypeOf || function(obj) {
+      return obj.__proto__;
+    };
+    function clone(obj) {
+      if (obj === null || typeof obj !== "object")
+        return obj;
+      if (obj instanceof Object)
+        var copy2 = { __proto__: getPrototypeOf(obj) };
+      else
+        var copy2 = /* @__PURE__ */ Object.create(null);
+      Object.getOwnPropertyNames(obj).forEach(function(key) {
+        Object.defineProperty(copy2, key, Object.getOwnPropertyDescriptor(obj, key));
+      });
+      return copy2;
+    }
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/graceful-fs/4.2.11/e60a23841f60609f733db41b2b1eced16c30ec8fe2e67c2a9b80e2dab0755700/node_modules/graceful-fs/graceful-fs.js
+var require_graceful_fs = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/graceful-fs/4.2.11/e60a23841f60609f733db41b2b1eced16c30ec8fe2e67c2a9b80e2dab0755700/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
+    var fs13 = __require("fs");
+    var polyfills = require_polyfills();
+    var legacy = require_legacy_streams();
+    var clone = require_clone();
+    var util9 = __require("util");
+    var gracefulQueue;
+    var previousSymbol;
+    if (typeof Symbol === "function" && typeof Symbol.for === "function") {
+      gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue");
+      previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous");
+    } else {
+      gracefulQueue = "___graceful-fs.queue";
+      previousSymbol = "___graceful-fs.previous";
+    }
+    function noop() {
+    }
+    function publishQueue(context, queue2) {
+      Object.defineProperty(context, gracefulQueue, {
+        get: function() {
+          return queue2;
+        }
+      });
+    }
+    var debug = noop;
+    if (util9.debuglog)
+      debug = util9.debuglog("gfs4");
+    else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
+      debug = function() {
+        var m = util9.format.apply(util9, arguments);
+        m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
+        console.error(m);
+      };
+    if (!fs13[gracefulQueue]) {
+      queue = global[gracefulQueue] || [];
+      publishQueue(fs13, queue);
+      fs13.close = (function(fs$close) {
+        function close(fd, cb) {
+          return fs$close.call(fs13, fd, function(err) {
+            if (!err) {
+              resetQueue();
+            }
+            if (typeof cb === "function")
+              cb.apply(this, arguments);
+          });
+        }
+        Object.defineProperty(close, previousSymbol, {
+          value: fs$close
+        });
+        return close;
+      })(fs13.close);
+      fs13.closeSync = (function(fs$closeSync) {
+        function closeSync(fd) {
+          fs$closeSync.apply(fs13, arguments);
+          resetQueue();
+        }
+        Object.defineProperty(closeSync, previousSymbol, {
+          value: fs$closeSync
+        });
+        return closeSync;
+      })(fs13.closeSync);
+      if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
+        process.on("exit", function() {
+          debug(fs13[gracefulQueue]);
+          __require("assert").equal(fs13[gracefulQueue].length, 0);
+        });
+      }
+    }
+    var queue;
+    if (!global[gracefulQueue]) {
+      publishQueue(global, fs13[gracefulQueue]);
+    }
+    module.exports = patch(clone(fs13));
+    if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs13.__patched) {
+      module.exports = patch(fs13);
+      fs13.__patched = true;
+    }
+    function patch(fs14) {
+      polyfills(fs14);
+      fs14.gracefulify = patch;
+      fs14.createReadStream = createReadStream;
+      fs14.createWriteStream = createWriteStream;
+      var fs$readFile = fs14.readFile;
+      fs14.readFile = readFile;
+      function readFile(path18, options, cb) {
+        if (typeof options === "function")
+          cb = options, options = null;
+        return go$readFile(path18, options, cb);
+        function go$readFile(path19, options2, cb2, startTime) {
+          return fs$readFile(path19, options2, function(err) {
+            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
+              enqueue([go$readFile, [path19, options2, cb2], err, startTime || Date.now(), Date.now()]);
+            else {
+              if (typeof cb2 === "function")
+                cb2.apply(this, arguments);
+            }
+          });
+        }
+      }
+      var fs$writeFile = fs14.writeFile;
+      fs14.writeFile = writeFile2;
+      function writeFile2(path18, data, options, cb) {
+        if (typeof options === "function")
+          cb = options, options = null;
+        return go$writeFile(path18, data, options, cb);
+        function go$writeFile(path19, data2, options2, cb2, startTime) {
+          return fs$writeFile(path19, data2, options2, function(err) {
+            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
+              enqueue([go$writeFile, [path19, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
+            else {
+              if (typeof cb2 === "function")
+                cb2.apply(this, arguments);
+            }
+          });
+        }
+      }
+      var fs$appendFile = fs14.appendFile;
+      if (fs$appendFile)
+        fs14.appendFile = appendFile;
+      function appendFile(path18, data, options, cb) {
+        if (typeof options === "function")
+          cb = options, options = null;
+        return go$appendFile(path18, data, options, cb);
+        function go$appendFile(path19, data2, options2, cb2, startTime) {
+          return fs$appendFile(path19, data2, options2, function(err) {
+            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
+              enqueue([go$appendFile, [path19, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
+            else {
+              if (typeof cb2 === "function")
+                cb2.apply(this, arguments);
+            }
+          });
+        }
+      }
+      var fs$copyFile = fs14.copyFile;
+      if (fs$copyFile)
+        fs14.copyFile = copyFile;
+      function copyFile(src2, dest, flags, cb) {
+        if (typeof flags === "function") {
+          cb = flags;
+          flags = 0;
+        }
+        return go$copyFile(src2, dest, flags, cb);
+        function go$copyFile(src3, dest2, flags2, cb2, startTime) {
+          return fs$copyFile(src3, dest2, flags2, function(err) {
+            if (err && (err.code === "EMFILE" || err.code === "ENFILE" || err.code === "EBUSY"))
+              enqueue([go$copyFile, [src3, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
+            else {
+              if (typeof cb2 === "function")
+                cb2.apply(this, arguments);
+            }
+          });
+        }
+      }
+      var fs$readdir = fs14.readdir;
+      fs14.readdir = readdir;
+      var noReaddirOptionVersions = /^v[0-5]\./;
+      function readdir(path18, options, cb) {
+        if (typeof options === "function")
+          cb = options, options = null;
+        var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path19, options2, cb2, startTime) {
+          return fs$readdir(path19, fs$readdirCallback(
+            path19,
+            options2,
+            cb2,
+            startTime
+          ));
+        } : function go$readdir2(path19, options2, cb2, startTime) {
+          return fs$readdir(path19, options2, fs$readdirCallback(
+            path19,
+            options2,
+            cb2,
+            startTime
+          ));
+        };
+        return go$readdir(path18, options, cb);
+        function fs$readdirCallback(path19, options2, cb2, startTime) {
+          return function(err, files) {
+            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
+              enqueue([
+                go$readdir,
+                [path19, options2, cb2],
+                err,
+                startTime || Date.now(),
+                Date.now()
+              ]);
+            else {
+              if (files && files.sort)
+                files.sort();
+              if (typeof cb2 === "function")
+                cb2.call(this, err, files);
+            }
+          };
+        }
+      }
+      if (process.version.substr(0, 4) === "v0.8") {
+        var legStreams = legacy(fs14);
+        ReadStream = legStreams.ReadStream;
+        WriteStream = legStreams.WriteStream;
+      }
+      var fs$ReadStream = fs14.ReadStream;
+      if (fs$ReadStream) {
+        ReadStream.prototype = Object.create(fs$ReadStream.prototype);
+        ReadStream.prototype.open = ReadStream$open;
+      }
+      var fs$WriteStream = fs14.WriteStream;
+      if (fs$WriteStream) {
+        WriteStream.prototype = Object.create(fs$WriteStream.prototype);
+        WriteStream.prototype.open = WriteStream$open;
+      }
+      Object.defineProperty(fs14, "ReadStream", {
+        get: function() {
+          return ReadStream;
+        },
+        set: function(val) {
+          ReadStream = val;
+        },
+        enumerable: true,
+        configurable: true
+      });
+      Object.defineProperty(fs14, "WriteStream", {
+        get: function() {
+          return WriteStream;
+        },
+        set: function(val) {
+          WriteStream = val;
+        },
+        enumerable: true,
+        configurable: true
+      });
+      var FileReadStream = ReadStream;
+      Object.defineProperty(fs14, "FileReadStream", {
+        get: function() {
+          return FileReadStream;
+        },
+        set: function(val) {
+          FileReadStream = val;
+        },
+        enumerable: true,
+        configurable: true
+      });
+      var FileWriteStream = WriteStream;
+      Object.defineProperty(fs14, "FileWriteStream", {
+        get: function() {
+          return FileWriteStream;
+        },
+        set: function(val) {
+          FileWriteStream = val;
+        },
+        enumerable: true,
+        configurable: true
+      });
+      function ReadStream(path18, options) {
+        if (this instanceof ReadStream)
+          return fs$ReadStream.apply(this, arguments), this;
+        else
+          return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
+      }
+      function ReadStream$open() {
+        var that = this;
+        open(that.path, that.flags, that.mode, function(err, fd) {
+          if (err) {
+            if (that.autoClose)
+              that.destroy();
+            that.emit("error", err);
+          } else {
+            that.fd = fd;
+            that.emit("open", fd);
+            that.read();
+          }
+        });
+      }
+      function WriteStream(path18, options) {
+        if (this instanceof WriteStream)
+          return fs$WriteStream.apply(this, arguments), this;
+        else
+          return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
+      }
+      function WriteStream$open() {
+        var that = this;
+        open(that.path, that.flags, that.mode, function(err, fd) {
+          if (err) {
+            that.destroy();
+            that.emit("error", err);
+          } else {
+            that.fd = fd;
+            that.emit("open", fd);
+          }
+        });
+      }
+      function createReadStream(path18, options) {
+        return new fs14.ReadStream(path18, options);
+      }
+      function createWriteStream(path18, options) {
+        return new fs14.WriteStream(path18, options);
+      }
+      var fs$open = fs14.open;
+      fs14.open = open;
+      function open(path18, flags, mode, cb) {
+        if (typeof mode === "function")
+          cb = mode, mode = null;
+        return go$open(path18, flags, mode, cb);
+        function go$open(path19, flags2, mode2, cb2, startTime) {
+          return fs$open(path19, flags2, mode2, function(err, fd) {
+            if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
+              enqueue([go$open, [path19, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
+            else {
+              if (typeof cb2 === "function")
+                cb2.apply(this, arguments);
+            }
+          });
+        }
+      }
+      return fs14;
+    }
+    function enqueue(elem) {
+      debug("ENQUEUE", elem[0].name, elem[1]);
+      fs13[gracefulQueue].push(elem);
+      retry();
+    }
+    var retryTimer;
+    function resetQueue() {
+      var now = Date.now();
+      for (var i = 0; i < fs13[gracefulQueue].length; ++i) {
+        if (fs13[gracefulQueue][i].length > 2) {
+          fs13[gracefulQueue][i][3] = now;
+          fs13[gracefulQueue][i][4] = now;
+        }
+      }
+      retry();
+    }
+    function retry() {
+      clearTimeout(retryTimer);
+      retryTimer = void 0;
+      if (fs13[gracefulQueue].length === 0)
+        return;
+      var elem = fs13[gracefulQueue].shift();
+      var fn = elem[0];
+      var args = elem[1];
+      var err = elem[2];
+      var startTime = elem[3];
+      var lastTime = elem[4];
+      if (startTime === void 0) {
+        debug("RETRY", fn.name, args);
+        fn.apply(null, args);
+      } else if (Date.now() - startTime >= 6e4) {
+        debug("TIMEOUT", fn.name, args);
+        var cb = args.pop();
+        if (typeof cb === "function")
+          cb.call(null, err);
+      } else {
+        var sinceAttempt = Date.now() - lastTime;
+        var sinceStart = Math.max(lastTime - startTime, 1);
+        var desiredDelay = Math.min(sinceStart * 1.2, 100);
+        if (sinceAttempt >= desiredDelay) {
+          debug("RETRY", fn.name, args);
+          fn.apply(null, args.concat([startTime]));
+        } else {
+          fs13[gracefulQueue].push(elem);
+        }
+      }
+      if (retryTimer === void 0) {
+        retryTimer = setTimeout(retry, 0);
+      }
+    }
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fast-safe-stringify/2.1.1/71177aa317bf9c10d6ba54feb1e03d154d670845bac275960b4cc587a01d5783/node_modules/fast-safe-stringify/index.js
+var require_fast_safe_stringify = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fast-safe-stringify/2.1.1/71177aa317bf9c10d6ba54feb1e03d154d670845bac275960b4cc587a01d5783/node_modules/fast-safe-stringify/index.js"(exports, module) {
+    module.exports = stringify;
+    stringify.default = stringify;
+    stringify.stable = deterministicStringify;
+    stringify.stableStringify = deterministicStringify;
+    var LIMIT_REPLACE_NODE = "[...]";
+    var CIRCULAR_REPLACE_NODE = "[Circular]";
+    var arr = [];
+    var replacerStack = [];
+    function defaultOptions2() {
+      return {
+        depthLimit: Number.MAX_SAFE_INTEGER,
+        edgesLimit: Number.MAX_SAFE_INTEGER
+      };
+    }
+    function stringify(obj, replacer, spacer, options) {
+      if (typeof options === "undefined") {
+        options = defaultOptions2();
+      }
+      decirc(obj, "", 0, [], void 0, 0, options);
+      var res;
+      try {
+        if (replacerStack.length === 0) {
+          res = JSON.stringify(obj, replacer, spacer);
+        } else {
+          res = JSON.stringify(obj, replaceGetterValues(replacer), spacer);
+        }
+      } catch (_) {
+        return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]");
+      } finally {
+        while (arr.length !== 0) {
+          var part = arr.pop();
+          if (part.length === 4) {
+            Object.defineProperty(part[0], part[1], part[3]);
+          } else {
+            part[0][part[1]] = part[2];
+          }
+        }
+      }
+      return res;
+    }
+    function setReplace(replace, val, k, parent) {
+      var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k);
+      if (propertyDescriptor.get !== void 0) {
+        if (propertyDescriptor.configurable) {
+          Object.defineProperty(parent, k, { value: replace });
+          arr.push([parent, k, val, propertyDescriptor]);
+        } else {
+          replacerStack.push([val, k, replace]);
+        }
+      } else {
+        parent[k] = replace;
+        arr.push([parent, k, val]);
+      }
+    }
+    function decirc(val, k, edgeIndex, stack, parent, depth, options) {
+      depth += 1;
+      var i;
+      if (typeof val === "object" && val !== null) {
+        for (i = 0; i < stack.length; i++) {
+          if (stack[i] === val) {
+            setReplace(CIRCULAR_REPLACE_NODE, val, k, parent);
+            return;
+          }
+        }
+        if (typeof options.depthLimit !== "undefined" && depth > options.depthLimit) {
+          setReplace(LIMIT_REPLACE_NODE, val, k, parent);
+          return;
+        }
+        if (typeof options.edgesLimit !== "undefined" && edgeIndex + 1 > options.edgesLimit) {
+          setReplace(LIMIT_REPLACE_NODE, val, k, parent);
+          return;
+        }
+        stack.push(val);
+        if (Array.isArray(val)) {
+          for (i = 0; i < val.length; i++) {
+            decirc(val[i], i, i, stack, val, depth, options);
+          }
+        } else {
+          var keys = Object.keys(val);
+          for (i = 0; i < keys.length; i++) {
+            var key = keys[i];
+            decirc(val[key], key, i, stack, val, depth, options);
+          }
+        }
+        stack.pop();
+      }
+    }
+    function compareFunction(a, b) {
+      if (a < b) {
+        return -1;
+      }
+      if (a > b) {
+        return 1;
+      }
+      return 0;
+    }
+    function deterministicStringify(obj, replacer, spacer, options) {
+      if (typeof options === "undefined") {
+        options = defaultOptions2();
+      }
+      var tmp = deterministicDecirc(obj, "", 0, [], void 0, 0, options) || obj;
+      var res;
+      try {
+        if (replacerStack.length === 0) {
+          res = JSON.stringify(tmp, replacer, spacer);
+        } else {
+          res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer);
+        }
+      } catch (_) {
+        return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]");
+      } finally {
+        while (arr.length !== 0) {
+          var part = arr.pop();
+          if (part.length === 4) {
+            Object.defineProperty(part[0], part[1], part[3]);
+          } else {
+            part[0][part[1]] = part[2];
+          }
+        }
+      }
+      return res;
+    }
+    function deterministicDecirc(val, k, edgeIndex, stack, parent, depth, options) {
+      depth += 1;
+      var i;
+      if (typeof val === "object" && val !== null) {
+        for (i = 0; i < stack.length; i++) {
+          if (stack[i] === val) {
+            setReplace(CIRCULAR_REPLACE_NODE, val, k, parent);
+            return;
+          }
+        }
+        try {
+          if (typeof val.toJSON === "function") {
+            return;
+          }
+        } catch (_) {
+          return;
+        }
+        if (typeof options.depthLimit !== "undefined" && depth > options.depthLimit) {
+          setReplace(LIMIT_REPLACE_NODE, val, k, parent);
+          return;
+        }
+        if (typeof options.edgesLimit !== "undefined" && edgeIndex + 1 > options.edgesLimit) {
+          setReplace(LIMIT_REPLACE_NODE, val, k, parent);
+          return;
+        }
+        stack.push(val);
+        if (Array.isArray(val)) {
+          for (i = 0; i < val.length; i++) {
+            deterministicDecirc(val[i], i, i, stack, val, depth, options);
+          }
+        } else {
+          var tmp = {};
+          var keys = Object.keys(val).sort(compareFunction);
+          for (i = 0; i < keys.length; i++) {
+            var key = keys[i];
+            deterministicDecirc(val[key], key, i, stack, val, depth, options);
+            tmp[key] = val[key];
+          }
+          if (typeof parent !== "undefined") {
+            arr.push([parent, k, val]);
+            parent[k] = tmp;
+          } else {
+            return tmp;
+          }
+        }
+        stack.pop();
+      }
+    }
+    function replaceGetterValues(replacer) {
+      replacer = typeof replacer !== "undefined" ? replacer : function(k, v) {
+        return v;
+      };
+      return function(key, val) {
+        if (replacerStack.length > 0) {
+          for (var i = 0; i < replacerStack.length; i++) {
+            var part = replacerStack[i];
+            if (part[1] === key && part[0] === val) {
+              val = part[2];
+              replacerStack.splice(i, 1);
+              break;
+            }
+          }
+        }
+        return replacer.call(this, key, val);
+      };
+    }
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/individual/3.0.0/82ec8ef054bfaf915092db8496dd7cdf5d8a529ff6202ce432d93772b51b5045/node_modules/individual/index.js
+var require_individual = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/individual/3.0.0/82ec8ef054bfaf915092db8496dd7cdf5d8a529ff6202ce432d93772b51b5045/node_modules/individual/index.js"(exports, module) {
+    "use strict";
+    var root = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {};
+    module.exports = Individual;
+    function Individual(key, value) {
+      if (key in root) {
+        return root[key];
+      }
+      root[key] = value;
+      return value;
+    }
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/bole/5.0.29/6922e0a3a11b46fb67db71b821bacb20a87db33d8d1fb079a84a148dc6373834/node_modules/bole/format.js
+var require_format = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/bole/5.0.29/6922e0a3a11b46fb67db71b821bacb20a87db33d8d1fb079a84a148dc6373834/node_modules/bole/format.js"(exports, module) {
+    var utilformat = __require("util").format;
+    function format(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) {
+      if (a16 !== void 0) {
+        return utilformat(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16);
+      }
+      if (a15 !== void 0) {
+        return utilformat(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15);
+      }
+      if (a14 !== void 0) {
+        return utilformat(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14);
+      }
+      if (a13 !== void 0) {
+        return utilformat(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
+      }
+      if (a12 !== void 0) {
+        return utilformat(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
+      }
+      if (a11 !== void 0) {
+        return utilformat(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11);
+      }
+      if (a10 !== void 0) {
+        return utilformat(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
+      }
+      if (a9 !== void 0) {
+        return utilformat(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+      }
+      if (a8 !== void 0) {
+        return utilformat(a1, a2, a3, a4, a5, a6, a7, a8);
+      }
+      if (a7 !== void 0) {
+        return utilformat(a1, a2, a3, a4, a5, a6, a7);
+      }
+      if (a6 !== void 0) {
+        return utilformat(a1, a2, a3, a4, a5, a6);
+      }
+      if (a5 !== void 0) {
+        return utilformat(a1, a2, a3, a4, a5);
+      }
+      if (a4 !== void 0) {
+        return utilformat(a1, a2, a3, a4);
+      }
+      if (a3 !== void 0) {
+        return utilformat(a1, a2, a3);
+      }
+      if (a2 !== void 0) {
+        return utilformat(a1, a2);
+      }
+      return a1;
+    }
+    module.exports = format;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/bole/5.0.29/6922e0a3a11b46fb67db71b821bacb20a87db33d8d1fb079a84a148dc6373834/node_modules/bole/bole.js
+var require_bole = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/bole/5.0.29/6922e0a3a11b46fb67db71b821bacb20a87db33d8d1fb079a84a148dc6373834/node_modules/bole/bole.js"(exports, module) {
+    "use strict";
+    var _stringify = require_fast_safe_stringify();
+    var individual = require_individual()("$$bole", { fastTime: false });
+    var format = require_format();
+    var levels = "debug info warn error".split(" ");
+    var os = __require("os");
+    var pid = process.pid;
+    var hasObjMode = false;
+    var scache = [];
+    var hostname;
+    try {
+      hostname = os.hostname();
+    } catch (e) {
+      hostname = os.version().indexOf("Windows 7 ") === 0 ? "windows7" : "hostname-unknown";
+    }
+    var hostnameSt = _stringify(hostname);
+    for (const level of levels) {
+      scache[level] = ',"hostname":' + hostnameSt + ',"pid":' + pid + ',"level":"' + level;
+      Number(scache[level]);
+      if (!Array.isArray(individual[level])) {
+        individual[level] = [];
+      }
+    }
+    function stackToString(e) {
+      let s = e.stack;
+      let ce;
+      if (typeof e.cause === "function" && (ce = e.cause())) {
+        s += "\nCaused by: " + stackToString(ce);
+      }
+      return s;
+    }
+    function errorToOut(err, out) {
+      out.err = {
+        name: err.name,
+        message: err.message,
+        code: err.code,
+        // perhaps
+        stack: stackToString(err)
+      };
+    }
+    function requestToOut(req2, out) {
+      out.req = {
+        method: req2.method,
+        url: req2.url,
+        headers: req2.headers,
+        remoteAddress: req2.connection.remoteAddress,
+        remotePort: req2.connection.remotePort
+      };
+    }
+    function objectToOut(obj, out) {
+      for (const k in obj) {
+        if (Object.prototype.hasOwnProperty.call(obj, k) && obj[k] !== void 0) {
+          out[k] = obj[k];
+        }
+      }
+    }
+    function objectMode(stream) {
+      return stream._writableState && stream._writableState.objectMode === true;
+    }
+    function stringify(level, name, message, obj) {
+      let s = '{"time":' + (individual.fastTime ? Date.now() : '"' + (/* @__PURE__ */ new Date()).toISOString() + '"') + scache[level] + '","name":' + name + (message !== void 0 ? ',"message":' + _stringify(message) : "");
+      for (const k in obj) {
+        s += "," + _stringify(k) + ":" + _stringify(obj[k]);
+      }
+      s += "}";
+      Number(s);
+      return s;
+    }
+    function extend(level, name, message, obj) {
+      const newObj = {
+        time: individual.fastTime ? Date.now() : (/* @__PURE__ */ new Date()).toISOString(),
+        hostname,
+        pid,
+        level,
+        name
+      };
+      if (message !== void 0) {
+        obj.message = message;
+      }
+      for (const k in obj) {
+        newObj[k] = obj[k];
+      }
+      return newObj;
+    }
+    function levelLogger(level, name) {
+      const outputs = individual[level];
+      const nameSt = _stringify(name);
+      return function namedLevelLogger(inp, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) {
+        if (outputs.length === 0) {
+          return;
+        }
+        const out = {};
+        let objectOut;
+        let i = 0;
+        const l = outputs.length;
+        let stringified;
+        let message;
+        if (typeof inp === "string" || inp == null) {
+          if (!(message = format(inp, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16))) {
+            message = void 0;
+          }
+        } else {
+          if (inp instanceof Error) {
+            if (typeof a2 === "object") {
+              objectToOut(a2, out);
+              errorToOut(inp, out);
+              if (!(message = format(a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16))) {
+                message = void 0;
+              }
+            } else {
+              errorToOut(inp, out);
+              if (!(message = format(a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16))) {
+                message = void 0;
+              }
+            }
+          } else {
+            if (!(message = format(a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16))) {
+              message = void 0;
+            }
+          }
+          if (typeof inp === "boolean") {
+            message = String(inp);
+          } else if (typeof inp === "object" && !(inp instanceof Error)) {
+            if (inp.method && inp.url && inp.headers && inp.socket) {
+              requestToOut(inp, out);
+            } else {
+              objectToOut(inp, out);
+            }
+          }
+        }
+        if (l === 1 && !hasObjMode) {
+          outputs[0].write(Buffer.from(stringify(level, nameSt, message, out) + "\n"));
+          return;
+        }
+        for (; i < l; i++) {
+          if (objectMode(outputs[i])) {
+            if (objectOut === void 0) {
+              objectOut = extend(level, name, message, out);
+            }
+            outputs[i].write(objectOut);
+          } else {
+            if (stringified === void 0) {
+              stringified = Buffer.from(stringify(level, nameSt, message, out) + "\n");
+            }
+            outputs[i].write(stringified);
+          }
+        }
+      };
+    }
+    function bole4(name) {
+      function boleLogger(subname) {
+        return bole4(name + ":" + subname);
+      }
+      function makeLogger(p, level) {
+        p[level] = levelLogger(level, name);
+        return p;
+      }
+      return levels.reduce(makeLogger, boleLogger);
+    }
+    bole4.output = function output(opt) {
+      let b = false;
+      if (Array.isArray(opt)) {
+        opt.forEach(bole4.output);
+        return bole4;
+      }
+      if (typeof opt.level !== "string") {
+        throw new TypeError('Must provide a "level" option');
+      }
+      for (const level of levels) {
+        if (!b && level === opt.level) {
+          b = true;
+        }
+        if (b) {
+          if (opt.stream && objectMode(opt.stream)) {
+            hasObjMode = true;
+          }
+          individual[level].push(opt.stream);
+        }
+      }
+      return bole4;
+    };
+    bole4.reset = function reset() {
+      for (const level of levels) {
+        individual[level].splice(0, individual[level].length);
+      }
+      individual.fastTime = false;
+      return bole4;
+    };
+    bole4.setFastTime = function setFastTime(b) {
+      if (!arguments.length) {
+        individual.fastTime = true;
+      } else {
+        individual.fastTime = b;
+      }
+      return bole4;
+    };
+    module.exports = bole4;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/split2/4.2.0/40e414c630ab7f443818aa50ee06a670a46fe60cf81f7f81a46733d76a4ce6ba/node_modules/split2/index.js
+var require_split2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/split2/4.2.0/40e414c630ab7f443818aa50ee06a670a46fe60cf81f7f81a46733d76a4ce6ba/node_modules/split2/index.js"(exports, module) {
+    "use strict";
+    var { Transform } = __require("stream");
+    var { StringDecoder } = __require("string_decoder");
+    var kLast = /* @__PURE__ */ Symbol("last");
+    var kDecoder = /* @__PURE__ */ Symbol("decoder");
+    function transform(chunk, enc, cb) {
+      let list;
+      if (this.overflow) {
+        const buf = this[kDecoder].write(chunk);
+        list = buf.split(this.matcher);
+        if (list.length === 1) return cb();
+        list.shift();
+        this.overflow = false;
+      } else {
+        this[kLast] += this[kDecoder].write(chunk);
+        list = this[kLast].split(this.matcher);
+      }
+      this[kLast] = list.pop();
+      for (let i = 0; i < list.length; i++) {
+        try {
+          push(this, this.mapper(list[i]));
+        } catch (error) {
+          return cb(error);
+        }
+      }
+      this.overflow = this[kLast].length > this.maxLength;
+      if (this.overflow && !this.skipOverflow) {
+        cb(new Error("maximum buffer reached"));
+        return;
+      }
+      cb();
+    }
+    function flush(cb) {
+      this[kLast] += this[kDecoder].end();
+      if (this[kLast]) {
+        try {
+          push(this, this.mapper(this[kLast]));
+        } catch (error) {
+          return cb(error);
+        }
+      }
+      cb();
+    }
+    function push(self2, val) {
+      if (val !== void 0) {
+        self2.push(val);
+      }
+    }
+    function noop(incoming) {
+      return incoming;
+    }
+    function split2(matcher, mapper, options) {
+      matcher = matcher || /\r?\n/;
+      mapper = mapper || noop;
+      options = options || {};
+      switch (arguments.length) {
+        case 1:
+          if (typeof matcher === "function") {
+            mapper = matcher;
+            matcher = /\r?\n/;
+          } else if (typeof matcher === "object" && !(matcher instanceof RegExp) && !matcher[Symbol.split]) {
+            options = matcher;
+            matcher = /\r?\n/;
+          }
+          break;
+        case 2:
+          if (typeof matcher === "function") {
+            options = mapper;
+            mapper = matcher;
+            matcher = /\r?\n/;
+          } else if (typeof mapper === "object") {
+            options = mapper;
+            mapper = noop;
+          }
+      }
+      options = Object.assign({}, options);
+      options.autoDestroy = true;
+      options.transform = transform;
+      options.flush = flush;
+      options.readableObjectMode = true;
+      const stream = new Transform(options);
+      stream[kLast] = "";
+      stream[kDecoder] = new StringDecoder("utf8");
+      stream.matcher = matcher;
+      stream.mapper = mapper;
+      stream.maxLength = options.maxLength;
+      stream.skipOverflow = options.skipOverflow || false;
+      stream.overflow = false;
+      stream._destroy = function(err, cb) {
+        this._writableState.errorEmitted = false;
+        cb(err);
+      };
+      return stream;
+    }
+    module.exports = split2;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/universalify/2.0.1/3983135594189f71b00fc07b6b17387b476e8a92e19ec2a61c1f0e0d68895f4d/node_modules/universalify/index.js
+var require_universalify = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/universalify/2.0.1/3983135594189f71b00fc07b6b17387b476e8a92e19ec2a61c1f0e0d68895f4d/node_modules/universalify/index.js"(exports) {
+    "use strict";
+    exports.fromCallback = function(fn) {
+      return Object.defineProperty(function(...args) {
+        if (typeof args[args.length - 1] === "function") fn.apply(this, args);
+        else {
+          return new Promise((resolve, reject) => {
+            args.push((err, res) => err != null ? reject(err) : resolve(res));
+            fn.apply(this, args);
+          });
+        }
+      }, "name", { value: fn.name });
+    };
+    exports.fromPromise = function(fn) {
+      return Object.defineProperty(function(...args) {
+        const cb = args[args.length - 1];
+        if (typeof cb !== "function") return fn.apply(this, args);
+        else {
+          args.pop();
+          fn.apply(this, args).then((r) => cb(null, r), cb);
+        }
+      }, "name", { value: fn.name });
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/fs/index.js
+var require_fs = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/fs/index.js"(exports) {
+    "use strict";
+    var u = require_universalify().fromCallback;
+    var fs13 = require_graceful_fs();
+    var api = [
+      "access",
+      "appendFile",
+      "chmod",
+      "chown",
+      "close",
+      "copyFile",
+      "cp",
+      "fchmod",
+      "fchown",
+      "fdatasync",
+      "fstat",
+      "fsync",
+      "ftruncate",
+      "futimes",
+      "glob",
+      "lchmod",
+      "lchown",
+      "lutimes",
+      "link",
+      "lstat",
+      "mkdir",
+      "mkdtemp",
+      "open",
+      "opendir",
+      "readdir",
+      "readFile",
+      "readlink",
+      "realpath",
+      "rename",
+      "rm",
+      "rmdir",
+      "stat",
+      "statfs",
+      "symlink",
+      "truncate",
+      "unlink",
+      "utimes",
+      "writeFile"
+    ].filter((key) => {
+      return typeof fs13[key] === "function";
+    });
+    Object.assign(exports, fs13);
+    api.forEach((method) => {
+      exports[method] = u(fs13[method]);
+    });
+    exports.exists = function(filename, callback) {
+      if (typeof callback === "function") {
+        return fs13.exists(filename, callback);
+      }
+      return new Promise((resolve) => {
+        return fs13.exists(filename, resolve);
+      });
+    };
+    exports.read = function(fd, buffer, offset, length, position3, callback) {
+      if (typeof callback === "function") {
+        return fs13.read(fd, buffer, offset, length, position3, callback);
+      }
+      return new Promise((resolve, reject) => {
+        fs13.read(fd, buffer, offset, length, position3, (err, bytesRead, buffer2) => {
+          if (err) return reject(err);
+          resolve({ bytesRead, buffer: buffer2 });
+        });
+      });
+    };
+    exports.write = function(fd, buffer, ...args) {
+      if (typeof args[args.length - 1] === "function") {
+        return fs13.write(fd, buffer, ...args);
+      }
+      return new Promise((resolve, reject) => {
+        fs13.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
+          if (err) return reject(err);
+          resolve({ bytesWritten, buffer: buffer2 });
+        });
+      });
+    };
+    exports.readv = function(fd, buffers, ...args) {
+      if (typeof args[args.length - 1] === "function") {
+        return fs13.readv(fd, buffers, ...args);
+      }
+      return new Promise((resolve, reject) => {
+        fs13.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
+          if (err) return reject(err);
+          resolve({ bytesRead, buffers: buffers2 });
+        });
+      });
+    };
+    exports.writev = function(fd, buffers, ...args) {
+      if (typeof args[args.length - 1] === "function") {
+        return fs13.writev(fd, buffers, ...args);
+      }
+      return new Promise((resolve, reject) => {
+        fs13.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
+          if (err) return reject(err);
+          resolve({ bytesWritten, buffers: buffers2 });
+        });
+      });
+    };
+    if (typeof fs13.realpath.native === "function") {
+      exports.realpath.native = u(fs13.realpath.native);
+    } else {
+      process.emitWarning(
+        "fs.realpath.native is not a function. Is fs being monkey-patched?",
+        "Warning",
+        "fs-extra-WARN0003"
+      );
+    }
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/mkdirs/utils.js
+var require_utils = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module) {
+    "use strict";
+    var path18 = __require("path");
+    module.exports.checkPath = function checkPath(pth) {
+      if (process.platform === "win32") {
+        const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path18.parse(pth).root, ""));
+        if (pathHasInvalidWinCharacters) {
+          const error = new Error(`Path contains invalid characters: ${pth}`);
+          error.code = "EINVAL";
+          throw error;
+        }
+      }
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/mkdirs/make-dir.js
+var require_make_dir = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module) {
+    "use strict";
+    var fs13 = require_fs();
+    var { checkPath } = require_utils();
+    var getMode = (options) => {
+      const defaults = { mode: 511 };
+      if (typeof options === "number") return options;
+      return { ...defaults, ...options }.mode;
+    };
+    module.exports.makeDir = async (dir, options) => {
+      checkPath(dir);
+      return fs13.mkdir(dir, {
+        mode: getMode(options),
+        recursive: true
+      });
+    };
+    module.exports.makeDirSync = (dir, options) => {
+      checkPath(dir);
+      return fs13.mkdirSync(dir, {
+        mode: getMode(options),
+        recursive: true
+      });
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/mkdirs/index.js
+var require_mkdirs = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var { makeDir: _makeDir, makeDirSync } = require_make_dir();
+    var makeDir = u(_makeDir);
+    module.exports = {
+      mkdirs: makeDir,
+      mkdirsSync: makeDirSync,
+      // alias
+      mkdirp: makeDir,
+      mkdirpSync: makeDirSync,
+      ensureDir: makeDir,
+      ensureDirSync: makeDirSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/path-exists/index.js
+var require_path_exists = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/path-exists/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var fs13 = require_fs();
+    function pathExists(path18) {
+      return fs13.access(path18).then(() => true).catch(() => false);
+    }
+    module.exports = {
+      pathExists: u(pathExists),
+      pathExistsSync: fs13.existsSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/util/utimes.js
+var require_utimes = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
+    "use strict";
+    var fs13 = require_fs();
+    var u = require_universalify().fromPromise;
+    async function utimesMillis(path18, atime, mtime) {
+      const fd = await fs13.open(path18, "r+");
+      let closeErr = null;
+      try {
+        await fs13.futimes(fd, atime, mtime);
+      } finally {
+        try {
+          await fs13.close(fd);
+        } catch (e) {
+          closeErr = e;
+        }
+      }
+      if (closeErr) {
+        throw closeErr;
+      }
+    }
+    function utimesMillisSync(path18, atime, mtime) {
+      const fd = fs13.openSync(path18, "r+");
+      fs13.futimesSync(fd, atime, mtime);
+      return fs13.closeSync(fd);
+    }
+    module.exports = {
+      utimesMillis: u(utimesMillis),
+      utimesMillisSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/util/stat.js
+var require_stat = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/util/stat.js"(exports, module) {
+    "use strict";
+    var fs13 = require_fs();
+    var path18 = __require("path");
+    var u = require_universalify().fromPromise;
+    function getStats(src2, dest, opts2) {
+      const statFunc = opts2.dereference ? (file) => fs13.stat(file, { bigint: true }) : (file) => fs13.lstat(file, { bigint: true });
+      return Promise.all([
+        statFunc(src2),
+        statFunc(dest).catch((err) => {
+          if (err.code === "ENOENT") return null;
+          throw err;
+        })
+      ]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
+    }
+    function getStatsSync(src2, dest, opts2) {
+      let destStat;
+      const statFunc = opts2.dereference ? (file) => fs13.statSync(file, { bigint: true }) : (file) => fs13.lstatSync(file, { bigint: true });
+      const srcStat = statFunc(src2);
+      try {
+        destStat = statFunc(dest);
+      } catch (err) {
+        if (err.code === "ENOENT") return { srcStat, destStat: null };
+        throw err;
+      }
+      return { srcStat, destStat };
+    }
+    async function checkPaths(src2, dest, funcName, opts2) {
+      const { srcStat, destStat } = await getStats(src2, dest, opts2);
+      if (destStat) {
+        if (areIdentical(srcStat, destStat)) {
+          const srcBaseName = path18.basename(src2);
+          const destBaseName = path18.basename(dest);
+          if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
+            return { srcStat, destStat, isChangingCase: true };
+          }
+          throw new Error("Source and destination must not be the same.");
+        }
+        if (srcStat.isDirectory() && !destStat.isDirectory()) {
+          throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src2}'.`);
+        }
+        if (!srcStat.isDirectory() && destStat.isDirectory()) {
+          throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src2}'.`);
+        }
+      }
+      if (srcStat.isDirectory() && isSrcSubdir(src2, dest)) {
+        throw new Error(errMsg(src2, dest, funcName));
+      }
+      return { srcStat, destStat };
+    }
+    function checkPathsSync(src2, dest, funcName, opts2) {
+      const { srcStat, destStat } = getStatsSync(src2, dest, opts2);
+      if (destStat) {
+        if (areIdentical(srcStat, destStat)) {
+          const srcBaseName = path18.basename(src2);
+          const destBaseName = path18.basename(dest);
+          if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
+            return { srcStat, destStat, isChangingCase: true };
+          }
+          throw new Error("Source and destination must not be the same.");
+        }
+        if (srcStat.isDirectory() && !destStat.isDirectory()) {
+          throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src2}'.`);
+        }
+        if (!srcStat.isDirectory() && destStat.isDirectory()) {
+          throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src2}'.`);
+        }
+      }
+      if (srcStat.isDirectory() && isSrcSubdir(src2, dest)) {
+        throw new Error(errMsg(src2, dest, funcName));
+      }
+      return { srcStat, destStat };
+    }
+    async function checkParentPaths(src2, srcStat, dest, funcName) {
+      const srcParent = path18.resolve(path18.dirname(src2));
+      const destParent = path18.resolve(path18.dirname(dest));
+      if (destParent === srcParent || destParent === path18.parse(destParent).root) return;
+      let destStat;
+      try {
+        destStat = await fs13.stat(destParent, { bigint: true });
+      } catch (err) {
+        if (err.code === "ENOENT") return;
+        throw err;
+      }
+      if (areIdentical(srcStat, destStat)) {
+        throw new Error(errMsg(src2, dest, funcName));
+      }
+      return checkParentPaths(src2, srcStat, destParent, funcName);
+    }
+    function checkParentPathsSync(src2, srcStat, dest, funcName) {
+      const srcParent = path18.resolve(path18.dirname(src2));
+      const destParent = path18.resolve(path18.dirname(dest));
+      if (destParent === srcParent || destParent === path18.parse(destParent).root) return;
+      let destStat;
+      try {
+        destStat = fs13.statSync(destParent, { bigint: true });
+      } catch (err) {
+        if (err.code === "ENOENT") return;
+        throw err;
+      }
+      if (areIdentical(srcStat, destStat)) {
+        throw new Error(errMsg(src2, dest, funcName));
+      }
+      return checkParentPathsSync(src2, srcStat, destParent, funcName);
+    }
+    function areIdentical(srcStat, destStat) {
+      return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
+    }
+    function isSrcSubdir(src2, dest) {
+      const srcArr = path18.resolve(src2).split(path18.sep).filter((i) => i);
+      const destArr = path18.resolve(dest).split(path18.sep).filter((i) => i);
+      return srcArr.every((cur, i) => destArr[i] === cur);
+    }
+    function errMsg(src2, dest, funcName) {
+      return `Cannot ${funcName} '${src2}' to a subdirectory of itself, '${dest}'.`;
+    }
+    module.exports = {
+      // checkPaths
+      checkPaths: u(checkPaths),
+      checkPathsSync,
+      // checkParent
+      checkParentPaths: u(checkParentPaths),
+      checkParentPathsSync,
+      // Misc
+      isSrcSubdir,
+      areIdentical
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/util/async.js
+var require_async = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/util/async.js"(exports, module) {
+    "use strict";
+    async function asyncIteratorConcurrentProcess(iterator, fn) {
+      const promises = [];
+      for await (const item of iterator) {
+        promises.push(
+          fn(item).then(
+            () => null,
+            (err) => err ?? new Error("unknown error")
+          )
+        );
+      }
+      await Promise.all(
+        promises.map(
+          (promise) => promise.then((possibleErr) => {
+            if (possibleErr !== null) throw possibleErr;
+          })
+        )
+      );
+    }
+    module.exports = {
+      asyncIteratorConcurrentProcess
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/copy/copy.js
+var require_copy = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/copy/copy.js"(exports, module) {
+    "use strict";
+    var fs13 = require_fs();
+    var path18 = __require("path");
+    var { mkdirs } = require_mkdirs();
+    var { pathExists } = require_path_exists();
+    var { utimesMillis } = require_utimes();
+    var stat = require_stat();
+    var { asyncIteratorConcurrentProcess } = require_async();
+    async function copy2(src2, dest, opts2 = {}) {
+      if (typeof opts2 === "function") {
+        opts2 = { filter: opts2 };
+      }
+      opts2.clobber = "clobber" in opts2 ? !!opts2.clobber : true;
+      opts2.overwrite = "overwrite" in opts2 ? !!opts2.overwrite : opts2.clobber;
+      if (opts2.preserveTimestamps && process.arch === "ia32") {
+        process.emitWarning(
+          "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n	see https://github.com/jprichardson/node-fs-extra/issues/269",
+          "Warning",
+          "fs-extra-WARN0001"
+        );
+      }
+      const { srcStat, destStat } = await stat.checkPaths(src2, dest, "copy", opts2);
+      await stat.checkParentPaths(src2, srcStat, dest, "copy");
+      const include = await runFilter(src2, dest, opts2);
+      if (!include) return;
+      const destParent = path18.dirname(dest);
+      const dirExists = await pathExists(destParent);
+      if (!dirExists) {
+        await mkdirs(destParent);
+      }
+      await getStatsAndPerformCopy(destStat, src2, dest, opts2);
+    }
+    async function runFilter(src2, dest, opts2) {
+      if (!opts2.filter) return true;
+      return opts2.filter(src2, dest);
+    }
+    async function getStatsAndPerformCopy(destStat, src2, dest, opts2) {
+      const statFn = opts2.dereference ? fs13.stat : fs13.lstat;
+      const srcStat = await statFn(src2);
+      if (srcStat.isDirectory()) return onDir(srcStat, destStat, src2, dest, opts2);
+      if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src2, dest, opts2);
+      if (srcStat.isSymbolicLink()) return onLink(destStat, src2, dest, opts2);
+      if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src2}`);
+      if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src2}`);
+      throw new Error(`Unknown file: ${src2}`);
+    }
+    async function onFile(srcStat, destStat, src2, dest, opts2) {
+      if (!destStat) return copyFile(srcStat, src2, dest, opts2);
+      if (opts2.overwrite) {
+        await fs13.unlink(dest);
+        return copyFile(srcStat, src2, dest, opts2);
+      }
+      if (opts2.errorOnExist) {
+        throw new Error(`'${dest}' already exists`);
+      }
+    }
+    async function copyFile(srcStat, src2, dest, opts2) {
+      await fs13.copyFile(src2, dest);
+      if (opts2.preserveTimestamps) {
+        if (fileIsNotWritable(srcStat.mode)) {
+          await makeFileWritable(dest, srcStat.mode);
+        }
+        const updatedSrcStat = await fs13.stat(src2);
+        await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
+      }
+      return fs13.chmod(dest, srcStat.mode);
+    }
+    function fileIsNotWritable(srcMode) {
+      return (srcMode & 128) === 0;
+    }
+    function makeFileWritable(dest, srcMode) {
+      return fs13.chmod(dest, srcMode | 128);
+    }
+    async function onDir(srcStat, destStat, src2, dest, opts2) {
+      if (!destStat) {
+        await fs13.mkdir(dest);
+      }
+      await asyncIteratorConcurrentProcess(await fs13.opendir(src2), async (item) => {
+        const srcItem = path18.join(src2, item.name);
+        const destItem = path18.join(dest, item.name);
+        const include = await runFilter(srcItem, destItem, opts2);
+        if (include) {
+          const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts2);
+          await getStatsAndPerformCopy(destStat2, srcItem, destItem, opts2);
+        }
+      });
+      if (!destStat) {
+        await fs13.chmod(dest, srcStat.mode);
+      }
+    }
+    async function onLink(destStat, src2, dest, opts2) {
+      let resolvedSrc = await fs13.readlink(src2);
+      if (opts2.dereference) {
+        resolvedSrc = path18.resolve(process.cwd(), resolvedSrc);
+      }
+      if (!destStat) {
+        return fs13.symlink(resolvedSrc, dest);
+      }
+      let resolvedDest = null;
+      try {
+        resolvedDest = await fs13.readlink(dest);
+      } catch (e) {
+        if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs13.symlink(resolvedSrc, dest);
+        throw e;
+      }
+      if (opts2.dereference) {
+        resolvedDest = path18.resolve(process.cwd(), resolvedDest);
+      }
+      if (resolvedSrc !== resolvedDest) {
+        if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
+          throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
+        }
+        if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
+          throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
+        }
+      }
+      await fs13.unlink(dest);
+      return fs13.symlink(resolvedSrc, dest);
+    }
+    module.exports = copy2;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/copy/copy-sync.js
+var require_copy_sync = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module) {
+    "use strict";
+    var fs13 = require_graceful_fs();
+    var path18 = __require("path");
+    var mkdirsSync = require_mkdirs().mkdirsSync;
+    var utimesMillisSync = require_utimes().utimesMillisSync;
+    var stat = require_stat();
+    function copySync2(src2, dest, opts2) {
+      if (typeof opts2 === "function") {
+        opts2 = { filter: opts2 };
+      }
+      opts2 = opts2 || {};
+      opts2.clobber = "clobber" in opts2 ? !!opts2.clobber : true;
+      opts2.overwrite = "overwrite" in opts2 ? !!opts2.overwrite : opts2.clobber;
+      if (opts2.preserveTimestamps && process.arch === "ia32") {
+        process.emitWarning(
+          "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n	see https://github.com/jprichardson/node-fs-extra/issues/269",
+          "Warning",
+          "fs-extra-WARN0002"
+        );
+      }
+      const { srcStat, destStat } = stat.checkPathsSync(src2, dest, "copy", opts2);
+      stat.checkParentPathsSync(src2, srcStat, dest, "copy");
+      if (opts2.filter && !opts2.filter(src2, dest)) return;
+      const destParent = path18.dirname(dest);
+      if (!fs13.existsSync(destParent)) mkdirsSync(destParent);
+      return getStats(destStat, src2, dest, opts2);
+    }
+    function getStats(destStat, src2, dest, opts2) {
+      const statSync = opts2.dereference ? fs13.statSync : fs13.lstatSync;
+      const srcStat = statSync(src2);
+      if (srcStat.isDirectory()) return onDir(srcStat, destStat, src2, dest, opts2);
+      else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src2, dest, opts2);
+      else if (srcStat.isSymbolicLink()) return onLink(destStat, src2, dest, opts2);
+      else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src2}`);
+      else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src2}`);
+      throw new Error(`Unknown file: ${src2}`);
+    }
+    function onFile(srcStat, destStat, src2, dest, opts2) {
+      if (!destStat) return copyFile(srcStat, src2, dest, opts2);
+      return mayCopyFile(srcStat, src2, dest, opts2);
+    }
+    function mayCopyFile(srcStat, src2, dest, opts2) {
+      if (opts2.overwrite) {
+        fs13.unlinkSync(dest);
+        return copyFile(srcStat, src2, dest, opts2);
+      } else if (opts2.errorOnExist) {
+        throw new Error(`'${dest}' already exists`);
+      }
+    }
+    function copyFile(srcStat, src2, dest, opts2) {
+      fs13.copyFileSync(src2, dest);
+      if (opts2.preserveTimestamps) handleTimestamps(srcStat.mode, src2, dest);
+      return setDestMode(dest, srcStat.mode);
+    }
+    function handleTimestamps(srcMode, src2, dest) {
+      if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);
+      return setDestTimestamps(src2, dest);
+    }
+    function fileIsNotWritable(srcMode) {
+      return (srcMode & 128) === 0;
+    }
+    function makeFileWritable(dest, srcMode) {
+      return setDestMode(dest, srcMode | 128);
+    }
+    function setDestMode(dest, srcMode) {
+      return fs13.chmodSync(dest, srcMode);
+    }
+    function setDestTimestamps(src2, dest) {
+      const updatedSrcStat = fs13.statSync(src2);
+      return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
+    }
+    function onDir(srcStat, destStat, src2, dest, opts2) {
+      if (!destStat) return mkDirAndCopy(srcStat.mode, src2, dest, opts2);
+      return copyDir(src2, dest, opts2);
+    }
+    function mkDirAndCopy(srcMode, src2, dest, opts2) {
+      fs13.mkdirSync(dest);
+      copyDir(src2, dest, opts2);
+      return setDestMode(dest, srcMode);
+    }
+    function copyDir(src2, dest, opts2) {
+      const dir = fs13.opendirSync(src2);
+      try {
+        let dirent;
+        while ((dirent = dir.readSync()) !== null) {
+          copyDirItem(dirent.name, src2, dest, opts2);
+        }
+      } finally {
+        dir.closeSync();
+      }
+    }
+    function copyDirItem(item, src2, dest, opts2) {
+      const srcItem = path18.join(src2, item);
+      const destItem = path18.join(dest, item);
+      if (opts2.filter && !opts2.filter(srcItem, destItem)) return;
+      const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts2);
+      return getStats(destStat, srcItem, destItem, opts2);
+    }
+    function onLink(destStat, src2, dest, opts2) {
+      let resolvedSrc = fs13.readlinkSync(src2);
+      if (opts2.dereference) {
+        resolvedSrc = path18.resolve(process.cwd(), resolvedSrc);
+      }
+      if (!destStat) {
+        return fs13.symlinkSync(resolvedSrc, dest);
+      } else {
+        let resolvedDest;
+        try {
+          resolvedDest = fs13.readlinkSync(dest);
+        } catch (err) {
+          if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs13.symlinkSync(resolvedSrc, dest);
+          throw err;
+        }
+        if (opts2.dereference) {
+          resolvedDest = path18.resolve(process.cwd(), resolvedDest);
+        }
+        if (resolvedSrc !== resolvedDest) {
+          if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
+            throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
+          }
+          if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
+            throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
+          }
+        }
+        return copyLink(resolvedSrc, dest);
+      }
+    }
+    function copyLink(resolvedSrc, dest) {
+      fs13.unlinkSync(dest);
+      return fs13.symlinkSync(resolvedSrc, dest);
+    }
+    module.exports = copySync2;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/copy/index.js
+var require_copy2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/copy/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    module.exports = {
+      copy: u(require_copy()),
+      copySync: require_copy_sync()
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/remove/index.js
+var require_remove = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/remove/index.js"(exports, module) {
+    "use strict";
+    var fs13 = require_graceful_fs();
+    var u = require_universalify().fromCallback;
+    function remove(path18, callback) {
+      fs13.rm(path18, { recursive: true, force: true }, callback);
+    }
+    function removeSync(path18) {
+      fs13.rmSync(path18, { recursive: true, force: true });
+    }
+    module.exports = {
+      remove: u(remove),
+      removeSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/empty/index.js
+var require_empty = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/empty/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var fs13 = require_fs();
+    var path18 = __require("path");
+    var mkdir = require_mkdirs();
+    var remove = require_remove();
+    var emptyDir = u(async function emptyDir2(dir) {
+      let items;
+      try {
+        items = await fs13.readdir(dir);
+      } catch {
+        return mkdir.mkdirs(dir);
+      }
+      return Promise.all(items.map((item) => remove.remove(path18.join(dir, item))));
+    });
+    function emptyDirSync(dir) {
+      let items;
+      try {
+        items = fs13.readdirSync(dir);
+      } catch {
+        return mkdir.mkdirsSync(dir);
+      }
+      items.forEach((item) => {
+        item = path18.join(dir, item);
+        remove.removeSync(item);
+      });
+    }
+    module.exports = {
+      emptyDirSync,
+      emptydirSync: emptyDirSync,
+      emptyDir,
+      emptydir: emptyDir
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/ensure/file.js
+var require_file = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/ensure/file.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var path18 = __require("path");
+    var fs13 = require_fs();
+    var mkdir = require_mkdirs();
+    async function createFile(file) {
+      let stats;
+      try {
+        stats = await fs13.stat(file);
+      } catch {
+      }
+      if (stats && stats.isFile()) return;
+      const dir = path18.dirname(file);
+      let dirStats = null;
+      try {
+        dirStats = await fs13.stat(dir);
+      } catch (err) {
+        if (err.code === "ENOENT") {
+          await mkdir.mkdirs(dir);
+          await fs13.writeFile(file, "");
+          return;
+        } else {
+          throw err;
+        }
+      }
+      if (dirStats.isDirectory()) {
+        await fs13.writeFile(file, "");
+      } else {
+        await fs13.readdir(dir);
+      }
+    }
+    function createFileSync(file) {
+      let stats;
+      try {
+        stats = fs13.statSync(file);
+      } catch {
+      }
+      if (stats && stats.isFile()) return;
+      const dir = path18.dirname(file);
+      try {
+        if (!fs13.statSync(dir).isDirectory()) {
+          fs13.readdirSync(dir);
+        }
+      } catch (err) {
+        if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
+        else throw err;
+      }
+      fs13.writeFileSync(file, "");
+    }
+    module.exports = {
+      createFile: u(createFile),
+      createFileSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/ensure/link.js
+var require_link = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/ensure/link.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var path18 = __require("path");
+    var fs13 = require_fs();
+    var mkdir = require_mkdirs();
+    var { pathExists } = require_path_exists();
+    var { areIdentical } = require_stat();
+    async function createLink(srcpath, dstpath) {
+      let dstStat;
+      try {
+        dstStat = await fs13.lstat(dstpath);
+      } catch {
+      }
+      let srcStat;
+      try {
+        srcStat = await fs13.lstat(srcpath);
+      } catch (err) {
+        err.message = err.message.replace("lstat", "ensureLink");
+        throw err;
+      }
+      if (dstStat && areIdentical(srcStat, dstStat)) return;
+      const dir = path18.dirname(dstpath);
+      const dirExists = await pathExists(dir);
+      if (!dirExists) {
+        await mkdir.mkdirs(dir);
+      }
+      await fs13.link(srcpath, dstpath);
+    }
+    function createLinkSync(srcpath, dstpath) {
+      let dstStat;
+      try {
+        dstStat = fs13.lstatSync(dstpath);
+      } catch {
+      }
+      try {
+        const srcStat = fs13.lstatSync(srcpath);
+        if (dstStat && areIdentical(srcStat, dstStat)) return;
+      } catch (err) {
+        err.message = err.message.replace("lstat", "ensureLink");
+        throw err;
+      }
+      const dir = path18.dirname(dstpath);
+      const dirExists = fs13.existsSync(dir);
+      if (dirExists) return fs13.linkSync(srcpath, dstpath);
+      mkdir.mkdirsSync(dir);
+      return fs13.linkSync(srcpath, dstpath);
+    }
+    module.exports = {
+      createLink: u(createLink),
+      createLinkSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/ensure/symlink-paths.js
+var require_symlink_paths = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module) {
+    "use strict";
+    var path18 = __require("path");
+    var fs13 = require_fs();
+    var { pathExists } = require_path_exists();
+    var u = require_universalify().fromPromise;
+    async function symlinkPaths(srcpath, dstpath) {
+      if (path18.isAbsolute(srcpath)) {
+        try {
+          await fs13.lstat(srcpath);
+        } catch (err) {
+          err.message = err.message.replace("lstat", "ensureSymlink");
+          throw err;
+        }
+        return {
+          toCwd: srcpath,
+          toDst: srcpath
+        };
+      }
+      const dstdir = path18.dirname(dstpath);
+      const relativeToDst = path18.join(dstdir, srcpath);
+      const exists = await pathExists(relativeToDst);
+      if (exists) {
+        return {
+          toCwd: relativeToDst,
+          toDst: srcpath
+        };
+      }
+      try {
+        await fs13.lstat(srcpath);
+      } catch (err) {
+        err.message = err.message.replace("lstat", "ensureSymlink");
+        throw err;
+      }
+      return {
+        toCwd: srcpath,
+        toDst: path18.relative(dstdir, srcpath)
+      };
+    }
+    function symlinkPathsSync(srcpath, dstpath) {
+      if (path18.isAbsolute(srcpath)) {
+        const exists2 = fs13.existsSync(srcpath);
+        if (!exists2) throw new Error("absolute srcpath does not exist");
+        return {
+          toCwd: srcpath,
+          toDst: srcpath
+        };
+      }
+      const dstdir = path18.dirname(dstpath);
+      const relativeToDst = path18.join(dstdir, srcpath);
+      const exists = fs13.existsSync(relativeToDst);
+      if (exists) {
+        return {
+          toCwd: relativeToDst,
+          toDst: srcpath
+        };
+      }
+      const srcExists = fs13.existsSync(srcpath);
+      if (!srcExists) throw new Error("relative srcpath does not exist");
+      return {
+        toCwd: srcpath,
+        toDst: path18.relative(dstdir, srcpath)
+      };
+    }
+    module.exports = {
+      symlinkPaths: u(symlinkPaths),
+      symlinkPathsSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/ensure/symlink-type.js
+var require_symlink_type = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module) {
+    "use strict";
+    var fs13 = require_fs();
+    var u = require_universalify().fromPromise;
+    async function symlinkType(srcpath, type) {
+      if (type) return type;
+      let stats;
+      try {
+        stats = await fs13.lstat(srcpath);
+      } catch {
+        return "file";
+      }
+      return stats && stats.isDirectory() ? "dir" : "file";
+    }
+    function symlinkTypeSync(srcpath, type) {
+      if (type) return type;
+      let stats;
+      try {
+        stats = fs13.lstatSync(srcpath);
+      } catch {
+        return "file";
+      }
+      return stats && stats.isDirectory() ? "dir" : "file";
+    }
+    module.exports = {
+      symlinkType: u(symlinkType),
+      symlinkTypeSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/ensure/symlink.js
+var require_symlink = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var path18 = __require("path");
+    var fs13 = require_fs();
+    var { mkdirs, mkdirsSync } = require_mkdirs();
+    var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
+    var { symlinkType, symlinkTypeSync } = require_symlink_type();
+    var { pathExists } = require_path_exists();
+    var { areIdentical } = require_stat();
+    async function createSymlink(srcpath, dstpath, type) {
+      let stats;
+      try {
+        stats = await fs13.lstat(dstpath);
+      } catch {
+      }
+      if (stats && stats.isSymbolicLink()) {
+        let srcStat;
+        if (path18.isAbsolute(srcpath)) {
+          srcStat = await fs13.stat(srcpath);
+        } else {
+          const dstdir = path18.dirname(dstpath);
+          const relativeToDst = path18.join(dstdir, srcpath);
+          try {
+            srcStat = await fs13.stat(relativeToDst);
+          } catch {
+            srcStat = await fs13.stat(srcpath);
+          }
+        }
+        const dstStat = await fs13.stat(dstpath);
+        if (areIdentical(srcStat, dstStat)) return;
+      }
+      const relative = await symlinkPaths(srcpath, dstpath);
+      srcpath = relative.toDst;
+      const toType = await symlinkType(relative.toCwd, type);
+      const dir = path18.dirname(dstpath);
+      if (!await pathExists(dir)) {
+        await mkdirs(dir);
+      }
+      return fs13.symlink(srcpath, dstpath, toType);
+    }
+    function createSymlinkSync2(srcpath, dstpath, type) {
+      let stats;
+      try {
+        stats = fs13.lstatSync(dstpath);
+      } catch {
+      }
+      if (stats && stats.isSymbolicLink()) {
+        let srcStat;
+        if (path18.isAbsolute(srcpath)) {
+          srcStat = fs13.statSync(srcpath);
+        } else {
+          const dstdir = path18.dirname(dstpath);
+          const relativeToDst = path18.join(dstdir, srcpath);
+          try {
+            srcStat = fs13.statSync(relativeToDst);
+          } catch {
+            srcStat = fs13.statSync(srcpath);
+          }
+        }
+        const dstStat = fs13.statSync(dstpath);
+        if (areIdentical(srcStat, dstStat)) return;
+      }
+      const relative = symlinkPathsSync(srcpath, dstpath);
+      srcpath = relative.toDst;
+      type = symlinkTypeSync(relative.toCwd, type);
+      const dir = path18.dirname(dstpath);
+      const exists = fs13.existsSync(dir);
+      if (exists) return fs13.symlinkSync(srcpath, dstpath, type);
+      mkdirsSync(dir);
+      return fs13.symlinkSync(srcpath, dstpath, type);
+    }
+    module.exports = {
+      createSymlink: u(createSymlink),
+      createSymlinkSync: createSymlinkSync2
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/ensure/index.js
+var require_ensure = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/ensure/index.js"(exports, module) {
+    "use strict";
+    var { createFile, createFileSync } = require_file();
+    var { createLink, createLinkSync } = require_link();
+    var { createSymlink, createSymlinkSync: createSymlinkSync2 } = require_symlink();
+    module.exports = {
+      // file
+      createFile,
+      createFileSync,
+      ensureFile: createFile,
+      ensureFileSync: createFileSync,
+      // link
+      createLink,
+      createLinkSync,
+      ensureLink: createLink,
+      ensureLinkSync: createLinkSync,
+      // symlink
+      createSymlink,
+      createSymlinkSync: createSymlinkSync2,
+      ensureSymlink: createSymlink,
+      ensureSymlinkSync: createSymlinkSync2
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/jsonfile/6.2.1/4eef6320b797a6391b2bd057b7f45a61f6df9e0461d95dbbea0e70d498ea3860/node_modules/jsonfile/utils.js
+var require_utils2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/jsonfile/6.2.1/4eef6320b797a6391b2bd057b7f45a61f6df9e0461d95dbbea0e70d498ea3860/node_modules/jsonfile/utils.js"(exports, module) {
+    function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
+      const EOF = finalEOL ? EOL : "";
+      const str = JSON.stringify(obj, replacer, spaces);
+      if (str === void 0) {
+        throw new TypeError(`Converting ${typeof obj} value to JSON is not supported`);
+      }
+      return str.replace(/\n/g, EOL) + EOF;
+    }
+    function stripBom2(content) {
+      if (Buffer.isBuffer(content)) content = content.toString("utf8");
+      return content.replace(/^\uFEFF/, "");
+    }
+    module.exports = { stringify, stripBom: stripBom2 };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/jsonfile/6.2.1/4eef6320b797a6391b2bd057b7f45a61f6df9e0461d95dbbea0e70d498ea3860/node_modules/jsonfile/index.js
+var require_jsonfile = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/jsonfile/6.2.1/4eef6320b797a6391b2bd057b7f45a61f6df9e0461d95dbbea0e70d498ea3860/node_modules/jsonfile/index.js"(exports, module) {
+    var _fs;
+    try {
+      _fs = require_graceful_fs();
+    } catch (_) {
+      _fs = __require("fs");
+    }
+    var universalify = require_universalify();
+    var { stringify, stripBom: stripBom2 } = require_utils2();
+    async function _readFile(file, options = {}) {
+      if (typeof options === "string") {
+        options = { encoding: options };
+      }
+      const fs13 = options.fs || _fs;
+      const shouldThrow = "throws" in options ? options.throws : true;
+      let data = await universalify.fromCallback(fs13.readFile)(file, options);
+      data = stripBom2(data);
+      let obj;
+      try {
+        obj = JSON.parse(data, options ? options.reviver : null);
+      } catch (err) {
+        if (shouldThrow) {
+          err.message = `${file}: ${err.message}`;
+          throw err;
+        } else {
+          return null;
+        }
+      }
+      return obj;
+    }
+    var readFile = universalify.fromPromise(_readFile);
+    function readFileSync(file, options = {}) {
+      if (typeof options === "string") {
+        options = { encoding: options };
+      }
+      const fs13 = options.fs || _fs;
+      const shouldThrow = "throws" in options ? options.throws : true;
+      try {
+        let content = fs13.readFileSync(file, options);
+        content = stripBom2(content);
+        return JSON.parse(content, options.reviver);
+      } catch (err) {
+        if (shouldThrow) {
+          err.message = `${file}: ${err.message}`;
+          throw err;
+        } else {
+          return null;
+        }
+      }
+    }
+    async function _writeFile(file, obj, options = {}) {
+      const fs13 = options.fs || _fs;
+      const str = stringify(obj, options);
+      await universalify.fromCallback(fs13.writeFile)(file, str, options);
+    }
+    var writeFile2 = universalify.fromPromise(_writeFile);
+    function writeFileSync(file, obj, options = {}) {
+      const fs13 = options.fs || _fs;
+      const str = stringify(obj, options);
+      return fs13.writeFileSync(file, str, options);
+    }
+    module.exports = {
+      readFile,
+      readFileSync,
+      writeFile: writeFile2,
+      writeFileSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/json/jsonfile.js
+var require_jsonfile2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module) {
+    "use strict";
+    var jsonFile = require_jsonfile();
+    module.exports = {
+      // jsonfile exports
+      readJson: jsonFile.readFile,
+      readJsonSync: jsonFile.readFileSync,
+      writeJson: jsonFile.writeFile,
+      writeJsonSync: jsonFile.writeFileSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/output-file/index.js
+var require_output_file = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/output-file/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var fs13 = require_fs();
+    var path18 = __require("path");
+    var mkdir = require_mkdirs();
+    var pathExists = require_path_exists().pathExists;
+    async function outputFile(file, data, encoding = "utf-8") {
+      const dir = path18.dirname(file);
+      if (!await pathExists(dir)) {
+        await mkdir.mkdirs(dir);
+      }
+      return fs13.writeFile(file, data, encoding);
+    }
+    function outputFileSync(file, ...args) {
+      const dir = path18.dirname(file);
+      if (!fs13.existsSync(dir)) {
+        mkdir.mkdirsSync(dir);
+      }
+      fs13.writeFileSync(file, ...args);
+    }
+    module.exports = {
+      outputFile: u(outputFile),
+      outputFileSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/json/output-json.js
+var require_output_json = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/json/output-json.js"(exports, module) {
+    "use strict";
+    var { stringify } = require_utils2();
+    var { outputFile } = require_output_file();
+    async function outputJson(file, data, options = {}) {
+      const str = stringify(data, options);
+      await outputFile(file, str, options);
+    }
+    module.exports = outputJson;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/json/output-json-sync.js
+var require_output_json_sync = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module) {
+    "use strict";
+    var { stringify } = require_utils2();
+    var { outputFileSync } = require_output_file();
+    function outputJsonSync(file, data, options) {
+      const str = stringify(data, options);
+      outputFileSync(file, str, options);
+    }
+    module.exports = outputJsonSync;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/json/index.js
+var require_json = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/json/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var jsonFile = require_jsonfile2();
+    jsonFile.outputJson = u(require_output_json());
+    jsonFile.outputJsonSync = require_output_json_sync();
+    jsonFile.outputJSON = jsonFile.outputJson;
+    jsonFile.outputJSONSync = jsonFile.outputJsonSync;
+    jsonFile.writeJSON = jsonFile.writeJson;
+    jsonFile.writeJSONSync = jsonFile.writeJsonSync;
+    jsonFile.readJSON = jsonFile.readJson;
+    jsonFile.readJSONSync = jsonFile.readJsonSync;
+    module.exports = jsonFile;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/move/move.js
+var require_move = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/move/move.js"(exports, module) {
+    "use strict";
+    var fs13 = require_fs();
+    var path18 = __require("path");
+    var { copy: copy2 } = require_copy2();
+    var { remove } = require_remove();
+    var { mkdirp } = require_mkdirs();
+    var { pathExists } = require_path_exists();
+    var stat = require_stat();
+    async function move(src2, dest, opts2 = {}) {
+      const overwrite = opts2.overwrite || opts2.clobber || false;
+      const { srcStat, isChangingCase = false } = await stat.checkPaths(src2, dest, "move", opts2);
+      await stat.checkParentPaths(src2, srcStat, dest, "move");
+      const destParent = path18.dirname(dest);
+      const parsedParentPath = path18.parse(destParent);
+      if (parsedParentPath.root !== destParent) {
+        await mkdirp(destParent);
+      }
+      return doRename(src2, dest, overwrite, isChangingCase);
+    }
+    async function doRename(src2, dest, overwrite, isChangingCase) {
+      if (!isChangingCase) {
+        if (overwrite) {
+          await remove(dest);
+        } else if (await pathExists(dest)) {
+          throw new Error("dest already exists.");
+        }
+      }
+      try {
+        await fs13.rename(src2, dest);
+      } catch (err) {
+        if (err.code !== "EXDEV") {
+          throw err;
+        }
+        await moveAcrossDevice(src2, dest, overwrite);
+      }
+    }
+    async function moveAcrossDevice(src2, dest, overwrite) {
+      const opts2 = {
+        overwrite,
+        errorOnExist: true,
+        preserveTimestamps: true
+      };
+      await copy2(src2, dest, opts2);
+      return remove(src2);
+    }
+    module.exports = move;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/move/move-sync.js
+var require_move_sync = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
+    "use strict";
+    var fs13 = require_graceful_fs();
+    var path18 = __require("path");
+    var copySync2 = require_copy2().copySync;
+    var removeSync = require_remove().removeSync;
+    var mkdirpSync = require_mkdirs().mkdirpSync;
+    var stat = require_stat();
+    function moveSync(src2, dest, opts2) {
+      opts2 = opts2 || {};
+      const overwrite = opts2.overwrite || opts2.clobber || false;
+      const { srcStat, isChangingCase = false } = stat.checkPathsSync(src2, dest, "move", opts2);
+      stat.checkParentPathsSync(src2, srcStat, dest, "move");
+      if (!isParentRoot(dest)) mkdirpSync(path18.dirname(dest));
+      return doRename(src2, dest, overwrite, isChangingCase);
+    }
+    function isParentRoot(dest) {
+      const parent = path18.dirname(dest);
+      const parsedPath = path18.parse(parent);
+      return parsedPath.root === parent;
+    }
+    function doRename(src2, dest, overwrite, isChangingCase) {
+      if (isChangingCase) return rename(src2, dest, overwrite);
+      if (overwrite) {
+        removeSync(dest);
+        return rename(src2, dest, overwrite);
+      }
+      if (fs13.existsSync(dest)) throw new Error("dest already exists.");
+      return rename(src2, dest, overwrite);
+    }
+    function rename(src2, dest, overwrite) {
+      try {
+        fs13.renameSync(src2, dest);
+      } catch (err) {
+        if (err.code !== "EXDEV") throw err;
+        return moveAcrossDevice(src2, dest, overwrite);
+      }
+    }
+    function moveAcrossDevice(src2, dest, overwrite) {
+      const opts2 = {
+        overwrite,
+        errorOnExist: true,
+        preserveTimestamps: true
+      };
+      copySync2(src2, dest, opts2);
+      return removeSync(src2);
+    }
+    module.exports = moveSync;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/move/index.js
+var require_move2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/move/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    module.exports = {
+      move: u(require_move()),
+      moveSync: require_move_sync()
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/index.js
+var require_lib = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.3.4/4cb0d718f8660ad2564c0d882d89a7255b59466c803fa7e6007de96d8c5aa18b/node_modules/fs-extra/lib/index.js"(exports, module) {
+    "use strict";
+    module.exports = {
+      // Export promiseified graceful-fs:
+      ...require_fs(),
+      // Export extra methods:
+      ...require_copy2(),
+      ...require_empty(),
+      ...require_ensure(),
+      ...require_json(),
+      ...require_mkdirs(),
+      ...require_move2(),
+      ...require_output_file(),
+      ...require_path_exists(),
+      ...require_remove()
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/is-windows/1.0.2/8de297753f5a2f0d3154b27e41b774686b53f5e3c186cf9f734f0a5ce4054b2e/node_modules/is-windows/index.js
+var require_is_windows = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/is-windows/1.0.2/8de297753f5a2f0d3154b27e41b774686b53f5e3c186cf9f734f0a5ce4054b2e/node_modules/is-windows/index.js"(exports, module) {
+    (function(factory) {
+      if (exports && typeof exports === "object" && typeof module !== "undefined") {
+        module.exports = factory();
+      } else if (typeof define === "function" && define.amd) {
+        define([], factory);
+      } else if (typeof window !== "undefined") {
+        window.isWindows = factory();
+      } else if (typeof global !== "undefined") {
+        global.isWindows = factory();
+      } else if (typeof self !== "undefined") {
+        self.isWindows = factory();
+      } else {
+        this.isWindows = factory();
+      }
+    })(function() {
+      "use strict";
+      return function isWindows2() {
+        return process && (process.platform === "win32" || /^(msys|cygwin)$/.test(process.env.OSTYPE));
+      };
+    });
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/validate-npm-package-name/7.0.2/814dcb947be9900c7df1d25263921c519f02120f3fc85aa99a69894e271e5507/node_modules/validate-npm-package-name/lib/builtin-modules.json
+var require_builtin_modules = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/validate-npm-package-name/7.0.2/814dcb947be9900c7df1d25263921c519f02120f3fc85aa99a69894e271e5507/node_modules/validate-npm-package-name/lib/builtin-modules.json"(exports, module) {
+    module.exports = ["_http_agent", "_http_client", "_http_common", "_http_incoming", "_http_outgoing", "_http_server", "_stream_duplex", "_stream_passthrough", "_stream_readable", "_stream_transform", "_stream_wrap", "_stream_writable", "_tls_common", "_tls_wrap", "assert", "assert/strict", "async_hooks", "buffer", "child_process", "cluster", "console", "constants", "crypto", "dgram", "diagnostics_channel", "dns", "dns/promises", "domain", "events", "fs", "fs/promises", "http", "http2", "https", "inspector", "inspector/promises", "module", "net", "os", "path", "path/posix", "path/win32", "perf_hooks", "process", "punycode", "querystring", "readline", "readline/promises", "repl", "stream", "stream/consumers", "stream/promises", "stream/web", "string_decoder", "sys", "timers", "timers/promises", "tls", "trace_events", "tty", "url", "util", "util/types", "v8", "vm", "wasi", "worker_threads", "zlib", "node:sea", "node:sqlite", "node:test", "node:test/reporters"];
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/validate-npm-package-name/7.0.2/814dcb947be9900c7df1d25263921c519f02120f3fc85aa99a69894e271e5507/node_modules/validate-npm-package-name/lib/index.js
+var require_lib2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/validate-npm-package-name/7.0.2/814dcb947be9900c7df1d25263921c519f02120f3fc85aa99a69894e271e5507/node_modules/validate-npm-package-name/lib/index.js"(exports, module) {
+    "use strict";
+    var builtins = require_builtin_modules();
+    var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");
+    var exclusionList = [
+      "node_modules",
+      "favicon.ico"
+    ];
+    function validate(name) {
+      var warnings = [];
+      var errors2 = [];
+      if (name === null) {
+        errors2.push("name cannot be null");
+        return done(warnings, errors2);
+      }
+      if (name === void 0) {
+        errors2.push("name cannot be undefined");
+        return done(warnings, errors2);
+      }
+      if (typeof name !== "string") {
+        errors2.push("name must be a string");
+        return done(warnings, errors2);
+      }
+      if (!name.length) {
+        errors2.push("name length must be greater than zero");
+      }
+      if (name.startsWith(".")) {
+        errors2.push("name cannot start with a period");
+      }
+      if (name.startsWith("-")) {
+        errors2.push("name cannot start with a hyphen");
+      }
+      if (name.match(/^_/)) {
+        errors2.push("name cannot start with an underscore");
+      }
+      if (name.trim() !== name) {
+        errors2.push("name cannot contain leading or trailing spaces");
+      }
+      exclusionList.forEach(function(excludedName) {
+        if (name.toLowerCase() === excludedName) {
+          errors2.push(excludedName + " is not a valid package name");
+        }
+      });
+      if (builtins.includes(name.toLowerCase())) {
+        warnings.push(name + " is a core module name");
+      }
+      if (name.length > 214) {
+        warnings.push("name can no longer contain more than 214 characters");
+      }
+      if (name.toLowerCase() !== name) {
+        warnings.push("name can no longer contain capital letters");
+      }
+      if (/[~'!()*]/.test(name.split("/").slice(-1)[0])) {
+        warnings.push(`name can no longer contain special characters ("~'!()*")`);
+      }
+      if (encodeURIComponent(name) !== name) {
+        var nameMatch = name.match(scopedPackagePattern);
+        if (nameMatch) {
+          var user = nameMatch[1];
+          var pkg = nameMatch[2];
+          if (pkg.startsWith(".")) {
+            errors2.push("name cannot start with a period");
+          }
+          if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) {
+            return done(warnings, errors2);
+          }
+        }
+        errors2.push("name can only contain URL-friendly characters");
+      }
+      return done(warnings, errors2);
+    }
+    var done = function(warnings, errors2) {
+      var result = {
+        validForNewPackages: errors2.length === 0 && warnings.length === 0,
+        validForOldPackages: errors2.length === 0,
+        warnings,
+        errors: errors2
+      };
+      if (!result.warnings.length) {
+        delete result.warnings;
+      }
+      if (!result.errors.length) {
+        delete result.errors;
+      }
+      return result;
+    };
+    module.exports = validate;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/is-gzip/2.0.0/82a8e17050fa38e95e62aa7580ddf517da43682e2ea1a94728382ef43c644d04/node_modules/is-gzip/index.js
+var require_is_gzip = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/is-gzip/2.0.0/82a8e17050fa38e95e62aa7580ddf517da43682e2ea1a94728382ef43c644d04/node_modules/is-gzip/index.js"(exports, module) {
+    "use strict";
+    module.exports = (buf) => {
+      if (!buf || buf.length < 3) {
+        return false;
+      }
+      return buf[0] === 31 && buf[1] === 139 && buf[2] === 8;
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/internal/constants.js
+var require_constants = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/internal/constants.js"(exports, module) {
+    "use strict";
+    var SEMVER_SPEC_VERSION = "2.0.0";
+    var MAX_LENGTH = 256;
+    var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
+    9007199254740991;
+    var MAX_SAFE_COMPONENT_LENGTH = 16;
+    var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
+    var RELEASE_TYPES = [
+      "major",
+      "premajor",
+      "minor",
+      "preminor",
+      "patch",
+      "prepatch",
+      "prerelease"
+    ];
+    module.exports = {
+      MAX_LENGTH,
+      MAX_SAFE_COMPONENT_LENGTH,
+      MAX_SAFE_BUILD_LENGTH,
+      MAX_SAFE_INTEGER,
+      RELEASE_TYPES,
+      SEMVER_SPEC_VERSION,
+      FLAG_INCLUDE_PRERELEASE: 1,
+      FLAG_LOOSE: 2
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/internal/debug.js
+var require_debug = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/internal/debug.js"(exports, module) {
+    "use strict";
+    var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
+    };
+    module.exports = debug;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/internal/re.js
+var require_re = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/internal/re.js"(exports, module) {
+    "use strict";
+    var {
+      MAX_SAFE_COMPONENT_LENGTH,
+      MAX_SAFE_BUILD_LENGTH,
+      MAX_LENGTH
+    } = require_constants();
+    var debug = require_debug();
+    exports = module.exports = {};
+    var re = exports.re = [];
+    var safeRe = exports.safeRe = [];
+    var src2 = exports.src = [];
+    var safeSrc = exports.safeSrc = [];
+    var t = exports.t = {};
+    var R = 0;
+    var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
+    var safeRegexReplacements = [
+      ["\\s", 1],
+      ["\\d", MAX_LENGTH],
+      [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
+    ];
+    var makeSafeRegex = (value) => {
+      for (const [token, max] of safeRegexReplacements) {
+        value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
+      }
+      return value;
+    };
+    var createToken = (name, value, isGlobal) => {
+      const safe = makeSafeRegex(value);
+      const index = R++;
+      debug(name, index, value);
+      t[name] = index;
+      src2[index] = value;
+      safeSrc[index] = safe;
+      re[index] = new RegExp(value, isGlobal ? "g" : void 0);
+      safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
+    };
+    createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
+    createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
+    createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
+    createToken("MAINVERSION", `(${src2[t.NUMERICIDENTIFIER]})\\.(${src2[t.NUMERICIDENTIFIER]})\\.(${src2[t.NUMERICIDENTIFIER]})`);
+    createToken("MAINVERSIONLOOSE", `(${src2[t.NUMERICIDENTIFIERLOOSE]})\\.(${src2[t.NUMERICIDENTIFIERLOOSE]})\\.(${src2[t.NUMERICIDENTIFIERLOOSE]})`);
+    createToken("PRERELEASEIDENTIFIER", `(?:${src2[t.NONNUMERICIDENTIFIER]}|${src2[t.NUMERICIDENTIFIER]})`);
+    createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src2[t.NONNUMERICIDENTIFIER]}|${src2[t.NUMERICIDENTIFIERLOOSE]})`);
+    createToken("PRERELEASE", `(?:-(${src2[t.PRERELEASEIDENTIFIER]}(?:\\.${src2[t.PRERELEASEIDENTIFIER]})*))`);
+    createToken("PRERELEASELOOSE", `(?:-?(${src2[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src2[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
+    createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
+    createToken("BUILD", `(?:\\+(${src2[t.BUILDIDENTIFIER]}(?:\\.${src2[t.BUILDIDENTIFIER]})*))`);
+    createToken("FULLPLAIN", `v?${src2[t.MAINVERSION]}${src2[t.PRERELEASE]}?${src2[t.BUILD]}?`);
+    createToken("FULL", `^${src2[t.FULLPLAIN]}$`);
+    createToken("LOOSEPLAIN", `[v=\\s]*${src2[t.MAINVERSIONLOOSE]}${src2[t.PRERELEASELOOSE]}?${src2[t.BUILD]}?`);
+    createToken("LOOSE", `^${src2[t.LOOSEPLAIN]}$`);
+    createToken("GTLT", "((?:<|>)?=?)");
+    createToken("XRANGEIDENTIFIERLOOSE", `${src2[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
+    createToken("XRANGEIDENTIFIER", `${src2[t.NUMERICIDENTIFIER]}|x|X|\\*`);
+    createToken("XRANGEPLAIN", `[v=\\s]*(${src2[t.XRANGEIDENTIFIER]})(?:\\.(${src2[t.XRANGEIDENTIFIER]})(?:\\.(${src2[t.XRANGEIDENTIFIER]})(?:${src2[t.PRERELEASE]})?${src2[t.BUILD]}?)?)?`);
+    createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src2[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src2[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src2[t.XRANGEIDENTIFIERLOOSE]})(?:${src2[t.PRERELEASELOOSE]})?${src2[t.BUILD]}?)?)?`);
+    createToken("XRANGE", `^${src2[t.GTLT]}\\s*${src2[t.XRANGEPLAIN]}$`);
+    createToken("XRANGELOOSE", `^${src2[t.GTLT]}\\s*${src2[t.XRANGEPLAINLOOSE]}$`);
+    createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
+    createToken("COERCE", `${src2[t.COERCEPLAIN]}(?:$|[^\\d])`);
+    createToken("COERCEFULL", src2[t.COERCEPLAIN] + `(?:${src2[t.PRERELEASE]})?(?:${src2[t.BUILD]})?(?:$|[^\\d])`);
+    createToken("COERCERTL", src2[t.COERCE], true);
+    createToken("COERCERTLFULL", src2[t.COERCEFULL], true);
+    createToken("LONETILDE", "(?:~>?)");
+    createToken("TILDETRIM", `(\\s*)${src2[t.LONETILDE]}\\s+`, true);
+    exports.tildeTrimReplace = "$1~";
+    createToken("TILDE", `^${src2[t.LONETILDE]}${src2[t.XRANGEPLAIN]}$`);
+    createToken("TILDELOOSE", `^${src2[t.LONETILDE]}${src2[t.XRANGEPLAINLOOSE]}$`);
+    createToken("LONECARET", "(?:\\^)");
+    createToken("CARETTRIM", `(\\s*)${src2[t.LONECARET]}\\s+`, true);
+    exports.caretTrimReplace = "$1^";
+    createToken("CARET", `^${src2[t.LONECARET]}${src2[t.XRANGEPLAIN]}$`);
+    createToken("CARETLOOSE", `^${src2[t.LONECARET]}${src2[t.XRANGEPLAINLOOSE]}$`);
+    createToken("COMPARATORLOOSE", `^${src2[t.GTLT]}\\s*(${src2[t.LOOSEPLAIN]})$|^$`);
+    createToken("COMPARATOR", `^${src2[t.GTLT]}\\s*(${src2[t.FULLPLAIN]})$|^$`);
+    createToken("COMPARATORTRIM", `(\\s*)${src2[t.GTLT]}\\s*(${src2[t.LOOSEPLAIN]}|${src2[t.XRANGEPLAIN]})`, true);
+    exports.comparatorTrimReplace = "$1$2$3";
+    createToken("HYPHENRANGE", `^\\s*(${src2[t.XRANGEPLAIN]})\\s+-\\s+(${src2[t.XRANGEPLAIN]})\\s*$`);
+    createToken("HYPHENRANGELOOSE", `^\\s*(${src2[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src2[t.XRANGEPLAINLOOSE]})\\s*$`);
+    createToken("STAR", "(<|>)?=?\\s*\\*");
+    createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
+    createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/internal/parse-options.js
+var require_parse_options = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/internal/parse-options.js"(exports, module) {
+    "use strict";
+    var looseOption = Object.freeze({ loose: true });
+    var emptyOpts = Object.freeze({});
+    var parseOptions = (options) => {
+      if (!options) {
+        return emptyOpts;
+      }
+      if (typeof options !== "object") {
+        return looseOption;
+      }
+      return options;
+    };
+    module.exports = parseOptions;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/internal/identifiers.js
+var require_identifiers = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/internal/identifiers.js"(exports, module) {
+    "use strict";
+    var numeric = /^[0-9]+$/;
+    var compareIdentifiers = (a, b) => {
+      if (typeof a === "number" && typeof b === "number") {
+        return a === b ? 0 : a < b ? -1 : 1;
+      }
+      const anum = numeric.test(a);
+      const bnum = numeric.test(b);
+      if (anum && bnum) {
+        a = +a;
+        b = +b;
+      }
+      return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
+    };
+    var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
+    module.exports = {
+      compareIdentifiers,
+      rcompareIdentifiers
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/classes/semver.js
+var require_semver = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/classes/semver.js"(exports, module) {
+    "use strict";
+    var debug = require_debug();
+    var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
+    var { safeRe: re, t } = require_re();
+    var parseOptions = require_parse_options();
+    var { compareIdentifiers } = require_identifiers();
+    var isPrereleaseIdentifier = (prerelease, identifier) => {
+      const identifiers = identifier.split(".");
+      if (identifiers.length > prerelease.length) {
+        return false;
+      }
+      for (let i = 0; i < identifiers.length; i++) {
+        if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
+          return false;
+        }
+      }
+      return true;
+    };
+    var SemVer = class _SemVer {
+      constructor(version, options) {
+        options = parseOptions(options);
+        if (version instanceof _SemVer) {
+          if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
+            return version;
+          } else {
+            version = version.version;
+          }
+        } else if (typeof version !== "string") {
+          throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
+        }
+        if (version.length > MAX_LENGTH) {
+          throw new TypeError(
+            `version is longer than ${MAX_LENGTH} characters`
+          );
+        }
+        debug("SemVer", version, options);
+        this.options = options;
+        this.loose = !!options.loose;
+        this.includePrerelease = !!options.includePrerelease;
+        const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
+        if (!m) {
+          throw new TypeError(`Invalid Version: ${version}`);
+        }
+        this.raw = version;
+        this.major = +m[1];
+        this.minor = +m[2];
+        this.patch = +m[3];
+        if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
+          throw new TypeError("Invalid major version");
+        }
+        if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
+          throw new TypeError("Invalid minor version");
+        }
+        if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
+          throw new TypeError("Invalid patch version");
+        }
+        if (!m[4]) {
+          this.prerelease = [];
+        } else {
+          this.prerelease = m[4].split(".").map((id) => {
+            if (/^[0-9]+$/.test(id)) {
+              const num = +id;
+              if (num >= 0 && num < MAX_SAFE_INTEGER) {
+                return num;
+              }
+            }
+            return id;
+          });
+        }
+        this.build = m[5] ? m[5].split(".") : [];
+        this.format();
+      }
+      format() {
+        this.version = `${this.major}.${this.minor}.${this.patch}`;
+        if (this.prerelease.length) {
+          this.version += `-${this.prerelease.join(".")}`;
+        }
+        return this.version;
+      }
+      toString() {
+        return this.version;
+      }
+      compare(other) {
+        debug("SemVer.compare", this.version, this.options, other);
+        if (!(other instanceof _SemVer)) {
+          if (typeof other === "string" && other === this.version) {
+            return 0;
+          }
+          other = new _SemVer(other, this.options);
+        }
+        if (other.version === this.version) {
+          return 0;
+        }
+        return this.compareMain(other) || this.comparePre(other);
+      }
+      compareMain(other) {
+        if (!(other instanceof _SemVer)) {
+          other = new _SemVer(other, this.options);
+        }
+        if (this.major < other.major) {
+          return -1;
+        }
+        if (this.major > other.major) {
+          return 1;
+        }
+        if (this.minor < other.minor) {
+          return -1;
+        }
+        if (this.minor > other.minor) {
+          return 1;
+        }
+        if (this.patch < other.patch) {
+          return -1;
+        }
+        if (this.patch > other.patch) {
+          return 1;
+        }
+        return 0;
+      }
+      comparePre(other) {
+        if (!(other instanceof _SemVer)) {
+          other = new _SemVer(other, this.options);
+        }
+        if (this.prerelease.length && !other.prerelease.length) {
+          return -1;
+        } else if (!this.prerelease.length && other.prerelease.length) {
+          return 1;
+        } else if (!this.prerelease.length && !other.prerelease.length) {
+          return 0;
+        }
+        let i = 0;
+        do {
+          const a = this.prerelease[i];
+          const b = other.prerelease[i];
+          debug("prerelease compare", i, a, b);
+          if (a === void 0 && b === void 0) {
+            return 0;
+          } else if (b === void 0) {
+            return 1;
+          } else if (a === void 0) {
+            return -1;
+          } else if (a === b) {
+            continue;
+          } else {
+            return compareIdentifiers(a, b);
+          }
+        } while (++i);
+      }
+      compareBuild(other) {
+        if (!(other instanceof _SemVer)) {
+          other = new _SemVer(other, this.options);
+        }
+        let i = 0;
+        do {
+          const a = this.build[i];
+          const b = other.build[i];
+          debug("build compare", i, a, b);
+          if (a === void 0 && b === void 0) {
+            return 0;
+          } else if (b === void 0) {
+            return 1;
+          } else if (a === void 0) {
+            return -1;
+          } else if (a === b) {
+            continue;
+          } else {
+            return compareIdentifiers(a, b);
+          }
+        } while (++i);
+      }
+      // preminor will bump the version up to the next minor release, and immediately
+      // down to pre-release. premajor and prepatch work the same way.
+      inc(release, identifier, identifierBase) {
+        if (release.startsWith("pre")) {
+          if (!identifier && identifierBase === false) {
+            throw new Error("invalid increment argument: identifier is empty");
+          }
+          if (identifier) {
+            const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
+            if (!match || match[1] !== identifier) {
+              throw new Error(`invalid identifier: ${identifier}`);
+            }
+          }
+        }
+        switch (release) {
+          case "premajor":
+            this.prerelease.length = 0;
+            this.patch = 0;
+            this.minor = 0;
+            this.major++;
+            this.inc("pre", identifier, identifierBase);
+            break;
+          case "preminor":
+            this.prerelease.length = 0;
+            this.patch = 0;
+            this.minor++;
+            this.inc("pre", identifier, identifierBase);
+            break;
+          case "prepatch":
+            this.prerelease.length = 0;
+            this.inc("patch", identifier, identifierBase);
+            this.inc("pre", identifier, identifierBase);
+            break;
+          // If the input is a non-prerelease version, this acts the same as
+          // prepatch.
+          case "prerelease":
+            if (this.prerelease.length === 0) {
+              this.inc("patch", identifier, identifierBase);
+            }
+            this.inc("pre", identifier, identifierBase);
+            break;
+          case "release":
+            if (this.prerelease.length === 0) {
+              throw new Error(`version ${this.raw} is not a prerelease`);
+            }
+            this.prerelease.length = 0;
+            break;
+          case "major":
+            if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
+              this.major++;
+            }
+            this.minor = 0;
+            this.patch = 0;
+            this.prerelease = [];
+            break;
+          case "minor":
+            if (this.patch !== 0 || this.prerelease.length === 0) {
+              this.minor++;
+            }
+            this.patch = 0;
+            this.prerelease = [];
+            break;
+          case "patch":
+            if (this.prerelease.length === 0) {
+              this.patch++;
+            }
+            this.prerelease = [];
+            break;
+          // This probably shouldn't be used publicly.
+          // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
+          case "pre": {
+            const base = Number(identifierBase) ? 1 : 0;
+            if (this.prerelease.length === 0) {
+              this.prerelease = [base];
+            } else {
+              let i = this.prerelease.length;
+              while (--i >= 0) {
+                if (typeof this.prerelease[i] === "number") {
+                  this.prerelease[i]++;
+                  i = -2;
+                }
+              }
+              if (i === -1) {
+                if (identifier === this.prerelease.join(".") && identifierBase === false) {
+                  throw new Error("invalid increment argument: identifier already exists");
+                }
+                this.prerelease.push(base);
+              }
+            }
+            if (identifier) {
+              let prerelease = [identifier, base];
+              if (identifierBase === false) {
+                prerelease = [identifier];
+              }
+              if (isPrereleaseIdentifier(this.prerelease, identifier)) {
+                const prereleaseBase = this.prerelease[identifier.split(".").length];
+                if (isNaN(prereleaseBase)) {
+                  this.prerelease = prerelease;
+                }
+              } else {
+                this.prerelease = prerelease;
+              }
+            }
+            break;
+          }
+          default:
+            throw new Error(`invalid increment argument: ${release}`);
+        }
+        this.raw = this.format();
+        if (this.build.length) {
+          this.raw += `+${this.build.join(".")}`;
+        }
+        return this;
+      }
+    };
+    module.exports = SemVer;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/parse.js
+var require_parse = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/parse.js"(exports, module) {
+    "use strict";
+    var SemVer = require_semver();
+    var parse2 = (version, options, throwErrors = false) => {
+      if (version instanceof SemVer) {
+        return version;
+      }
+      try {
+        return new SemVer(version, options);
+      } catch (er) {
+        if (!throwErrors) {
+          return null;
+        }
+        throw er;
+      }
+    };
+    module.exports = parse2;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/valid.js
+var require_valid = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/valid.js"(exports, module) {
+    "use strict";
+    var parse2 = require_parse();
+    var valid = (version, options) => {
+      const v = parse2(version, options);
+      return v ? v.version : null;
+    };
+    module.exports = valid;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/clean.js
+var require_clean = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/clean.js"(exports, module) {
+    "use strict";
+    var parse2 = require_parse();
+    var clean = (version, options) => {
+      const s = parse2(version.trim().replace(/^[=v]+/, ""), options);
+      return s ? s.version : null;
+    };
+    module.exports = clean;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/inc.js
+var require_inc = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/inc.js"(exports, module) {
+    "use strict";
+    var SemVer = require_semver();
+    var inc = (version, release, options, identifier, identifierBase) => {
+      if (typeof options === "string") {
+        identifierBase = identifier;
+        identifier = options;
+        options = void 0;
+      }
+      try {
+        return new SemVer(
+          version instanceof SemVer ? version.version : version,
+          options
+        ).inc(release, identifier, identifierBase).version;
+      } catch (er) {
+        return null;
+      }
+    };
+    module.exports = inc;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/diff.js
+var require_diff = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/diff.js"(exports, module) {
+    "use strict";
+    var parse2 = require_parse();
+    var diff = (version1, version2) => {
+      const v1 = parse2(version1, null, true);
+      const v2 = parse2(version2, null, true);
+      const comparison = v1.compare(v2);
+      if (comparison === 0) {
+        return null;
+      }
+      const v1Higher = comparison > 0;
+      const highVersion = v1Higher ? v1 : v2;
+      const lowVersion = v1Higher ? v2 : v1;
+      const highHasPre = !!highVersion.prerelease.length;
+      const lowHasPre = !!lowVersion.prerelease.length;
+      if (lowHasPre && !highHasPre) {
+        if (!lowVersion.patch && !lowVersion.minor) {
+          return "major";
+        }
+        if (lowVersion.compareMain(highVersion) === 0) {
+          if (lowVersion.minor && !lowVersion.patch) {
+            return "minor";
+          }
+          return "patch";
+        }
+      }
+      const prefix = highHasPre ? "pre" : "";
+      if (v1.major !== v2.major) {
+        return prefix + "major";
+      }
+      if (v1.minor !== v2.minor) {
+        return prefix + "minor";
+      }
+      if (v1.patch !== v2.patch) {
+        return prefix + "patch";
+      }
+      return "prerelease";
+    };
+    module.exports = diff;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/major.js
+var require_major = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/major.js"(exports, module) {
+    "use strict";
+    var SemVer = require_semver();
+    var major = (a, loose) => new SemVer(a, loose).major;
+    module.exports = major;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/minor.js
+var require_minor = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/minor.js"(exports, module) {
+    "use strict";
+    var SemVer = require_semver();
+    var minor = (a, loose) => new SemVer(a, loose).minor;
+    module.exports = minor;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/patch.js
+var require_patch = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/patch.js"(exports, module) {
+    "use strict";
+    var SemVer = require_semver();
+    var patch = (a, loose) => new SemVer(a, loose).patch;
+    module.exports = patch;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/prerelease.js
+var require_prerelease = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/prerelease.js"(exports, module) {
+    "use strict";
+    var parse2 = require_parse();
+    var prerelease = (version, options) => {
+      const parsed = parse2(version, options);
+      return parsed && parsed.prerelease.length ? parsed.prerelease : null;
+    };
+    module.exports = prerelease;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/compare.js
+var require_compare = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/compare.js"(exports, module) {
+    "use strict";
+    var SemVer = require_semver();
+    var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
+    module.exports = compare;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/rcompare.js
+var require_rcompare = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/rcompare.js"(exports, module) {
+    "use strict";
+    var compare = require_compare();
+    var rcompare = (a, b, loose) => compare(b, a, loose);
+    module.exports = rcompare;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/compare-loose.js
+var require_compare_loose = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/compare-loose.js"(exports, module) {
+    "use strict";
+    var compare = require_compare();
+    var compareLoose = (a, b) => compare(a, b, true);
+    module.exports = compareLoose;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/compare-build.js
+var require_compare_build = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/compare-build.js"(exports, module) {
+    "use strict";
+    var SemVer = require_semver();
+    var compareBuild = (a, b, loose) => {
+      const versionA = new SemVer(a, loose);
+      const versionB = new SemVer(b, loose);
+      return versionA.compare(versionB) || versionA.compareBuild(versionB);
+    };
+    module.exports = compareBuild;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/sort.js
+var require_sort = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/sort.js"(exports, module) {
+    "use strict";
+    var compareBuild = require_compare_build();
+    var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
+    module.exports = sort;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/rsort.js
+var require_rsort = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/rsort.js"(exports, module) {
+    "use strict";
+    var compareBuild = require_compare_build();
+    var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
+    module.exports = rsort;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/gt.js
+var require_gt = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/gt.js"(exports, module) {
+    "use strict";
+    var compare = require_compare();
+    var gt = (a, b, loose) => compare(a, b, loose) > 0;
+    module.exports = gt;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/lt.js
+var require_lt = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/lt.js"(exports, module) {
+    "use strict";
+    var compare = require_compare();
+    var lt = (a, b, loose) => compare(a, b, loose) < 0;
+    module.exports = lt;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/eq.js
+var require_eq = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/eq.js"(exports, module) {
+    "use strict";
+    var compare = require_compare();
+    var eq = (a, b, loose) => compare(a, b, loose) === 0;
+    module.exports = eq;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/neq.js
+var require_neq = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/neq.js"(exports, module) {
+    "use strict";
+    var compare = require_compare();
+    var neq = (a, b, loose) => compare(a, b, loose) !== 0;
+    module.exports = neq;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/gte.js
+var require_gte = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/gte.js"(exports, module) {
+    "use strict";
+    var compare = require_compare();
+    var gte = (a, b, loose) => compare(a, b, loose) >= 0;
+    module.exports = gte;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/lte.js
+var require_lte = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/lte.js"(exports, module) {
+    "use strict";
+    var compare = require_compare();
+    var lte = (a, b, loose) => compare(a, b, loose) <= 0;
+    module.exports = lte;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/cmp.js
+var require_cmp = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/cmp.js"(exports, module) {
+    "use strict";
+    var eq = require_eq();
+    var neq = require_neq();
+    var gt = require_gt();
+    var gte = require_gte();
+    var lt = require_lt();
+    var lte = require_lte();
+    var cmp = (a, op, b, loose) => {
+      switch (op) {
+        case "===":
+          if (typeof a === "object") {
+            a = a.version;
+          }
+          if (typeof b === "object") {
+            b = b.version;
+          }
+          return a === b;
+        case "!==":
+          if (typeof a === "object") {
+            a = a.version;
+          }
+          if (typeof b === "object") {
+            b = b.version;
+          }
+          return a !== b;
+        case "":
+        case "=":
+        case "==":
+          return eq(a, b, loose);
+        case "!=":
+          return neq(a, b, loose);
+        case ">":
+          return gt(a, b, loose);
+        case ">=":
+          return gte(a, b, loose);
+        case "<":
+          return lt(a, b, loose);
+        case "<=":
+          return lte(a, b, loose);
+        default:
+          throw new TypeError(`Invalid operator: ${op}`);
+      }
+    };
+    module.exports = cmp;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/coerce.js
+var require_coerce = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/coerce.js"(exports, module) {
+    "use strict";
+    var SemVer = require_semver();
+    var parse2 = require_parse();
+    var { safeRe: re, t } = require_re();
+    var coerce = (version, options) => {
+      if (version instanceof SemVer) {
+        return version;
+      }
+      if (typeof version === "number") {
+        version = String(version);
+      }
+      if (typeof version !== "string") {
+        return null;
+      }
+      options = options || {};
+      let match = null;
+      if (!options.rtl) {
+        match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
+      } else {
+        const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
+        let next;
+        while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
+          if (!match || next.index + next[0].length !== match.index + match[0].length) {
+            match = next;
+          }
+          coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
+        }
+        coerceRtlRegex.lastIndex = -1;
+      }
+      if (match === null) {
+        return null;
+      }
+      const major = match[2];
+      const minor = match[3] || "0";
+      const patch = match[4] || "0";
+      const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
+      const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
+      return parse2(`${major}.${minor}.${patch}${prerelease}${build}`, options);
+    };
+    module.exports = coerce;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/truncate.js
+var require_truncate = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/truncate.js"(exports, module) {
+    "use strict";
+    var parse2 = require_parse();
+    var constants2 = require_constants();
+    var SemVer = require_semver();
+    var truncate = (version, truncation, options) => {
+      if (!constants2.RELEASE_TYPES.includes(truncation)) {
+        return null;
+      }
+      const clonedVersion = cloneInputVersion(version, options);
+      return clonedVersion && doTruncation(clonedVersion, truncation);
+    };
+    var cloneInputVersion = (version, options) => {
+      const versionStringToParse = version instanceof SemVer ? version.version : version;
+      return parse2(versionStringToParse, options);
+    };
+    var doTruncation = (version, truncation) => {
+      if (isPrerelease(truncation)) {
+        return version.version;
+      }
+      version.prerelease = [];
+      switch (truncation) {
+        case "major":
+          version.minor = 0;
+          version.patch = 0;
+          break;
+        case "minor":
+          version.patch = 0;
+          break;
+      }
+      return version.format();
+    };
+    var isPrerelease = (type) => {
+      return type.startsWith("pre");
+    };
+    module.exports = truncate;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/internal/lrucache.js
+var require_lrucache = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/internal/lrucache.js"(exports, module) {
+    "use strict";
+    var LRUCache = class {
+      constructor() {
+        this.max = 1e3;
+        this.map = /* @__PURE__ */ new Map();
+      }
+      get(key) {
+        const value = this.map.get(key);
+        if (value === void 0) {
+          return void 0;
+        } else {
+          this.map.delete(key);
+          this.map.set(key, value);
+          return value;
+        }
+      }
+      delete(key) {
+        return this.map.delete(key);
+      }
+      set(key, value) {
+        const deleted = this.delete(key);
+        if (!deleted && value !== void 0) {
+          if (this.map.size >= this.max) {
+            const firstKey = this.map.keys().next().value;
+            this.delete(firstKey);
+          }
+          this.map.set(key, value);
+        }
+        return this;
+      }
+    };
+    module.exports = LRUCache;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/classes/range.js
+var require_range = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/classes/range.js"(exports, module) {
+    "use strict";
+    var SPACE_CHARACTERS = /\s+/g;
+    var Range = class _Range {
+      constructor(range, options) {
+        options = parseOptions(options);
+        if (range instanceof _Range) {
+          if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
+            return range;
+          } else {
+            return new _Range(range.raw, options);
+          }
+        }
+        if (range instanceof Comparator) {
+          this.raw = range.value;
+          this.set = [[range]];
+          this.formatted = void 0;
+          return this;
+        }
+        this.options = options;
+        this.loose = !!options.loose;
+        this.includePrerelease = !!options.includePrerelease;
+        this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
+        this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
+        if (!this.set.length) {
+          throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
+        }
+        if (this.set.length > 1) {
+          const first = this.set[0];
+          this.set = this.set.filter((c) => !isNullSet(c[0]));
+          if (this.set.length === 0) {
+            this.set = [first];
+          } else if (this.set.length > 1) {
+            for (const c of this.set) {
+              if (c.length === 1 && isAny(c[0])) {
+                this.set = [c];
+                break;
+              }
+            }
+          }
+        }
+        this.formatted = void 0;
+      }
+      get range() {
+        if (this.formatted === void 0) {
+          this.formatted = "";
+          for (let i = 0; i < this.set.length; i++) {
+            if (i > 0) {
+              this.formatted += "||";
+            }
+            const comps = this.set[i];
+            for (let k = 0; k < comps.length; k++) {
+              if (k > 0) {
+                this.formatted += " ";
+              }
+              this.formatted += comps[k].toString().trim();
+            }
+          }
+        }
+        return this.formatted;
+      }
+      format() {
+        return this.range;
+      }
+      toString() {
+        return this.range;
+      }
+      parseRange(range) {
+        range = range.replace(BUILDSTRIPRE, "");
+        const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
+        const memoKey = memoOpts + ":" + range;
+        const cached = cache.get(memoKey);
+        if (cached) {
+          return cached;
+        }
+        const loose = this.options.loose;
+        const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
+        range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
+        debug("hyphen replace", range);
+        range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
+        debug("comparator trim", range);
+        range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
+        debug("tilde trim", range);
+        range = range.replace(re[t.CARETTRIM], caretTrimReplace);
+        debug("caret trim", range);
+        let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
+        if (loose) {
+          rangeList = rangeList.filter((comp) => {
+            debug("loose invalid filter", comp, this.options);
+            return !!comp.match(re[t.COMPARATORLOOSE]);
+          });
+        }
+        debug("range list", rangeList);
+        const rangeMap = /* @__PURE__ */ new Map();
+        const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
+        for (const comp of comparators) {
+          if (isNullSet(comp)) {
+            return [comp];
+          }
+          rangeMap.set(comp.value, comp);
+        }
+        if (rangeMap.size > 1 && rangeMap.has("")) {
+          rangeMap.delete("");
+        }
+        const result = [...rangeMap.values()];
+        cache.set(memoKey, result);
+        return result;
+      }
+      intersects(range, options) {
+        if (!(range instanceof _Range)) {
+          throw new TypeError("a Range is required");
+        }
+        return this.set.some((thisComparators) => {
+          return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
+            return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
+              return rangeComparators.every((rangeComparator) => {
+                return thisComparator.intersects(rangeComparator, options);
+              });
+            });
+          });
+        });
+      }
+      // if ANY of the sets match ALL of its comparators, then pass
+      test(version) {
+        if (!version) {
+          return false;
+        }
+        if (typeof version === "string") {
+          try {
+            version = new SemVer(version, this.options);
+          } catch (er) {
+            return false;
+          }
+        }
+        for (let i = 0; i < this.set.length; i++) {
+          if (testSet(this.set[i], version, this.options)) {
+            return true;
+          }
+        }
+        return false;
+      }
+    };
+    module.exports = Range;
+    var LRU = require_lrucache();
+    var cache = new LRU();
+    var parseOptions = require_parse_options();
+    var Comparator = require_comparator();
+    var debug = require_debug();
+    var SemVer = require_semver();
+    var {
+      safeRe: re,
+      src: src2,
+      t,
+      comparatorTrimReplace,
+      tildeTrimReplace,
+      caretTrimReplace
+    } = require_re();
+    var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
+    var BUILDSTRIPRE = new RegExp(src2[t.BUILD], "g");
+    var isNullSet = (c) => c.value === "<0.0.0-0";
+    var isAny = (c) => c.value === "";
+    var isSatisfiable = (comparators, options) => {
+      let result = true;
+      const remainingComparators = comparators.slice();
+      let testComparator = remainingComparators.pop();
+      while (result && remainingComparators.length) {
+        result = remainingComparators.every((otherComparator) => {
+          return testComparator.intersects(otherComparator, options);
+        });
+        testComparator = remainingComparators.pop();
+      }
+      return result;
+    };
+    var parseComparator = (comp, options) => {
+      comp = comp.replace(re[t.BUILD], "");
+      debug("comp", comp, options);
+      comp = replaceCarets(comp, options);
+      debug("caret", comp);
+      comp = replaceTildes(comp, options);
+      debug("tildes", comp);
+      comp = replaceXRanges(comp, options);
+      debug("xrange", comp);
+      comp = replaceStars(comp, options);
+      debug("stars", comp);
+      return comp;
+    };
+    var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
+    var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
+    var replaceTildes = (comp, options) => {
+      return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
+    };
+    var replaceTilde = (comp, options) => {
+      const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
+      const z = options.includePrerelease ? "-0" : "";
+      return comp.replace(r, (_, M, m, p, pr) => {
+        debug("tilde", comp, _, M, m, p, pr);
+        let ret;
+        if (isX(M)) {
+          ret = "";
+        } else if (isX(m)) {
+          ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
+        } else if (isX(p)) {
+          ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
+        } else if (pr) {
+          debug("replaceTilde pr", pr);
+          ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
+        } else {
+          ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
+        }
+        debug("tilde return", ret);
+        return ret;
+      });
+    };
+    var replaceCarets = (comp, options) => {
+      return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
+    };
+    var replaceCaret = (comp, options) => {
+      debug("caret", comp, options);
+      const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
+      const z = options.includePrerelease ? "-0" : "";
+      return comp.replace(r, (_, M, m, p, pr) => {
+        debug("caret", comp, _, M, m, p, pr);
+        let ret;
+        if (isX(M)) {
+          ret = "";
+        } else if (isX(m)) {
+          ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
+        } else if (isX(p)) {
+          if (M === "0") {
+            ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
+          } else {
+            ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
+          }
+        } else if (pr) {
+          debug("replaceCaret pr", pr);
+          if (M === "0") {
+            if (m === "0") {
+              ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
+            } else {
+              ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
+            }
+          } else {
+            ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
+          }
+        } else {
+          debug("no pr");
+          if (M === "0") {
+            if (m === "0") {
+              ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
+            } else {
+              ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
+            }
+          } else {
+            ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
+          }
+        }
+        debug("caret return", ret);
+        return ret;
+      });
+    };
+    var replaceXRanges = (comp, options) => {
+      debug("replaceXRanges", comp, options);
+      return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
+    };
+    var replaceXRange = (comp, options) => {
+      comp = comp.trim();
+      const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
+      return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
+        debug("xRange", comp, ret, gtlt, M, m, p, pr);
+        if (invalidXRangeOrder(M, m, p)) {
+          return comp;
+        }
+        const xM = isX(M);
+        const xm = xM || isX(m);
+        const xp = xm || isX(p);
+        const anyX = xp;
+        if (gtlt === "=" && anyX) {
+          gtlt = "";
+        }
+        pr = options.includePrerelease ? "-0" : "";
+        if (xM) {
+          if (gtlt === ">" || gtlt === "<") {
+            ret = "<0.0.0-0";
+          } else {
+            ret = "*";
+          }
+        } else if (gtlt && anyX) {
+          if (xm) {
+            m = 0;
+          }
+          p = 0;
+          if (gtlt === ">") {
+            gtlt = ">=";
+            if (xm) {
+              M = +M + 1;
+              m = 0;
+              p = 0;
+            } else {
+              m = +m + 1;
+              p = 0;
+            }
+          } else if (gtlt === "<=") {
+            gtlt = "<";
+            if (xm) {
+              M = +M + 1;
+            } else {
+              m = +m + 1;
+            }
+          }
+          if (gtlt === "<") {
+            pr = "-0";
+          }
+          ret = `${gtlt + M}.${m}.${p}${pr}`;
+        } else if (xm) {
+          ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
+        } else if (xp) {
+          ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
+        }
+        debug("xRange return", ret);
+        return ret;
+      });
+    };
+    var replaceStars = (comp, options) => {
+      debug("replaceStars", comp, options);
+      return comp.trim().replace(re[t.STAR], "");
+    };
+    var replaceGTE0 = (comp, options) => {
+      debug("replaceGTE0", comp, options);
+      return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
+    };
+    var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
+      if (isX(fM)) {
+        from = "";
+      } else if (isX(fm)) {
+        from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
+      } else if (isX(fp)) {
+        from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
+      } else if (fpr) {
+        from = `>=${from}`;
+      } else {
+        from = `>=${from}${incPr ? "-0" : ""}`;
+      }
+      if (isX(tM)) {
+        to = "";
+      } else if (isX(tm)) {
+        to = `<${+tM + 1}.0.0-0`;
+      } else if (isX(tp)) {
+        to = `<${tM}.${+tm + 1}.0-0`;
+      } else if (tpr) {
+        to = `<=${tM}.${tm}.${tp}-${tpr}`;
+      } else if (incPr) {
+        to = `<${tM}.${tm}.${+tp + 1}-0`;
+      } else {
+        to = `<=${to}`;
+      }
+      return `${from} ${to}`.trim();
+    };
+    var testSet = (set, version, options) => {
+      for (let i = 0; i < set.length; i++) {
+        if (!set[i].test(version)) {
+          return false;
+        }
+      }
+      if (version.prerelease.length && !options.includePrerelease) {
+        for (let i = 0; i < set.length; i++) {
+          debug(set[i].semver);
+          if (set[i].semver === Comparator.ANY) {
+            continue;
+          }
+          if (set[i].semver.prerelease.length > 0) {
+            const allowed = set[i].semver;
+            if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
+              return true;
+            }
+          }
+        }
+        return false;
+      }
+      return true;
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/classes/comparator.js
+var require_comparator = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/classes/comparator.js"(exports, module) {
+    "use strict";
+    var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
+    var Comparator = class _Comparator {
+      static get ANY() {
+        return ANY;
+      }
+      constructor(comp, options) {
+        options = parseOptions(options);
+        if (comp instanceof _Comparator) {
+          if (comp.loose === !!options.loose) {
+            return comp;
+          } else {
+            comp = comp.value;
+          }
+        }
+        comp = comp.trim().split(/\s+/).join(" ");
+        debug("comparator", comp, options);
+        this.options = options;
+        this.loose = !!options.loose;
+        this.parse(comp);
+        if (this.semver === ANY) {
+          this.value = "";
+        } else {
+          this.value = this.operator + this.semver.version;
+        }
+        debug("comp", this);
+      }
+      parse(comp) {
+        const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
+        const m = comp.match(r);
+        if (!m) {
+          throw new TypeError(`Invalid comparator: ${comp}`);
+        }
+        this.operator = m[1] !== void 0 ? m[1] : "";
+        if (this.operator === "=") {
+          this.operator = "";
+        }
+        if (!m[2]) {
+          this.semver = ANY;
+        } else {
+          this.semver = new SemVer(m[2], this.options.loose);
+        }
+      }
+      toString() {
+        return this.value;
+      }
+      test(version) {
+        debug("Comparator.test", version, this.options.loose);
+        if (this.semver === ANY || version === ANY) {
+          return true;
+        }
+        if (typeof version === "string") {
+          try {
+            version = new SemVer(version, this.options);
+          } catch (er) {
+            return false;
+          }
+        }
+        return cmp(version, this.operator, this.semver, this.options);
+      }
+      intersects(comp, options) {
+        if (!(comp instanceof _Comparator)) {
+          throw new TypeError("a Comparator is required");
+        }
+        if (this.operator === "") {
+          if (this.value === "") {
+            return true;
+          }
+          return new Range(comp.value, options).test(this.value);
+        } else if (comp.operator === "") {
+          if (comp.value === "") {
+            return true;
+          }
+          return new Range(this.value, options).test(comp.semver);
+        }
+        options = parseOptions(options);
+        if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
+          return false;
+        }
+        if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
+          return false;
+        }
+        if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
+          return true;
+        }
+        if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
+          return true;
+        }
+        if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
+          return true;
+        }
+        if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
+          return true;
+        }
+        if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
+          return true;
+        }
+        return false;
+      }
+    };
+    module.exports = Comparator;
+    var parseOptions = require_parse_options();
+    var { safeRe: re, t } = require_re();
+    var cmp = require_cmp();
+    var debug = require_debug();
+    var SemVer = require_semver();
+    var Range = require_range();
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/satisfies.js
+var require_satisfies = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/functions/satisfies.js"(exports, module) {
+    "use strict";
+    var Range = require_range();
+    var satisfies = (version, range, options) => {
+      try {
+        range = new Range(range, options);
+      } catch (er) {
+        return false;
+      }
+      return range.test(version);
+    };
+    module.exports = satisfies;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/to-comparators.js
+var require_to_comparators = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/to-comparators.js"(exports, module) {
+    "use strict";
+    var Range = require_range();
+    var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
+    module.exports = toComparators;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/max-satisfying.js
+var require_max_satisfying = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
+    "use strict";
+    var SemVer = require_semver();
+    var Range = require_range();
+    var maxSatisfying = (versions, range, options) => {
+      let max = null;
+      let maxSV = null;
+      let rangeObj = null;
+      try {
+        rangeObj = new Range(range, options);
+      } catch (er) {
+        return null;
+      }
+      versions.forEach((v) => {
+        if (rangeObj.test(v)) {
+          if (!max || maxSV.compare(v) === -1) {
+            max = v;
+            maxSV = new SemVer(max, options);
+          }
+        }
+      });
+      return max;
+    };
+    module.exports = maxSatisfying;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/min-satisfying.js
+var require_min_satisfying = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
+    "use strict";
+    var SemVer = require_semver();
+    var Range = require_range();
+    var minSatisfying = (versions, range, options) => {
+      let min = null;
+      let minSV = null;
+      let rangeObj = null;
+      try {
+        rangeObj = new Range(range, options);
+      } catch (er) {
+        return null;
+      }
+      versions.forEach((v) => {
+        if (rangeObj.test(v)) {
+          if (!min || minSV.compare(v) === 1) {
+            min = v;
+            minSV = new SemVer(min, options);
+          }
+        }
+      });
+      return min;
+    };
+    module.exports = minSatisfying;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/min-version.js
+var require_min_version = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/min-version.js"(exports, module) {
+    "use strict";
+    var SemVer = require_semver();
+    var Range = require_range();
+    var gt = require_gt();
+    var minVersion = (range, loose) => {
+      range = new Range(range, loose);
+      let minver = new SemVer("0.0.0");
+      if (range.test(minver)) {
+        return minver;
+      }
+      minver = new SemVer("0.0.0-0");
+      if (range.test(minver)) {
+        return minver;
+      }
+      minver = null;
+      for (let i = 0; i < range.set.length; ++i) {
+        const comparators = range.set[i];
+        let setMin = null;
+        comparators.forEach((comparator) => {
+          const compver = new SemVer(comparator.semver.version);
+          switch (comparator.operator) {
+            case ">":
+              if (compver.prerelease.length === 0) {
+                compver.patch++;
+              } else {
+                compver.prerelease.push(0);
+              }
+              compver.raw = compver.format();
+            /* fallthrough */
+            case "":
+            case ">=":
+              if (!setMin || gt(compver, setMin)) {
+                setMin = compver;
+              }
+              break;
+            case "<":
+            case "<=":
+              break;
+            /* istanbul ignore next */
+            default:
+              throw new Error(`Unexpected operation: ${comparator.operator}`);
+          }
+        });
+        if (setMin && (!minver || gt(minver, setMin))) {
+          minver = setMin;
+        }
+      }
+      if (minver && range.test(minver)) {
+        return minver;
+      }
+      return null;
+    };
+    module.exports = minVersion;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/valid.js
+var require_valid2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/valid.js"(exports, module) {
+    "use strict";
+    var Range = require_range();
+    var validRange = (range, options) => {
+      try {
+        return new Range(range, options).range || "*";
+      } catch (er) {
+        return null;
+      }
+    };
+    module.exports = validRange;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/outside.js
+var require_outside = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/outside.js"(exports, module) {
+    "use strict";
+    var SemVer = require_semver();
+    var Comparator = require_comparator();
+    var { ANY } = Comparator;
+    var Range = require_range();
+    var satisfies = require_satisfies();
+    var gt = require_gt();
+    var lt = require_lt();
+    var lte = require_lte();
+    var gte = require_gte();
+    var outside = (version, range, hilo, options) => {
+      version = new SemVer(version, options);
+      range = new Range(range, options);
+      let gtfn, ltefn, ltfn, comp, ecomp;
+      switch (hilo) {
+        case ">":
+          gtfn = gt;
+          ltefn = lte;
+          ltfn = lt;
+          comp = ">";
+          ecomp = ">=";
+          break;
+        case "<":
+          gtfn = lt;
+          ltefn = gte;
+          ltfn = gt;
+          comp = "<";
+          ecomp = "<=";
+          break;
+        default:
+          throw new TypeError('Must provide a hilo val of "<" or ">"');
+      }
+      if (satisfies(version, range, options)) {
+        return false;
+      }
+      for (let i = 0; i < range.set.length; ++i) {
+        const comparators = range.set[i];
+        let high = null;
+        let low = null;
+        comparators.forEach((comparator) => {
+          if (comparator.semver === ANY) {
+            comparator = new Comparator(">=0.0.0");
+          }
+          high = high || comparator;
+          low = low || comparator;
+          if (gtfn(comparator.semver, high.semver, options)) {
+            high = comparator;
+          } else if (ltfn(comparator.semver, low.semver, options)) {
+            low = comparator;
+          }
+        });
+        if (high.operator === comp || high.operator === ecomp) {
+          return false;
+        }
+        if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
+          return false;
+        } else if (low.operator === ecomp && ltfn(version, low.semver)) {
+          return false;
+        }
+      }
+      return true;
+    };
+    module.exports = outside;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/gtr.js
+var require_gtr = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/gtr.js"(exports, module) {
+    "use strict";
+    var outside = require_outside();
+    var gtr = (version, range, options) => outside(version, range, ">", options);
+    module.exports = gtr;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/ltr.js
+var require_ltr = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/ltr.js"(exports, module) {
+    "use strict";
+    var outside = require_outside();
+    var ltr = (version, range, options) => outside(version, range, "<", options);
+    module.exports = ltr;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/intersects.js
+var require_intersects = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/intersects.js"(exports, module) {
+    "use strict";
+    var Range = require_range();
+    var intersects = (r1, r2, options) => {
+      r1 = new Range(r1, options);
+      r2 = new Range(r2, options);
+      return r1.intersects(r2, options);
+    };
+    module.exports = intersects;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/simplify.js
+var require_simplify = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/simplify.js"(exports, module) {
+    "use strict";
+    var satisfies = require_satisfies();
+    var compare = require_compare();
+    module.exports = (versions, range, options) => {
+      const set = [];
+      let first = null;
+      let prev = null;
+      const v = versions.sort((a, b) => compare(a, b, options));
+      for (const version of v) {
+        const included = satisfies(version, range, options);
+        if (included) {
+          prev = version;
+          if (!first) {
+            first = version;
+          }
+        } else {
+          if (prev) {
+            set.push([first, prev]);
+          }
+          prev = null;
+          first = null;
+        }
+      }
+      if (first) {
+        set.push([first, null]);
+      }
+      const ranges = [];
+      for (const [min, max] of set) {
+        if (min === max) {
+          ranges.push(min);
+        } else if (!max && min === v[0]) {
+          ranges.push("*");
+        } else if (!max) {
+          ranges.push(`>=${min}`);
+        } else if (min === v[0]) {
+          ranges.push(`<=${max}`);
+        } else {
+          ranges.push(`${min} - ${max}`);
+        }
+      }
+      const simplified = ranges.join(" || ");
+      const original = typeof range.raw === "string" ? range.raw : String(range);
+      return simplified.length < original.length ? simplified : range;
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/subset.js
+var require_subset = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/ranges/subset.js"(exports, module) {
+    "use strict";
+    var Range = require_range();
+    var Comparator = require_comparator();
+    var { ANY } = Comparator;
+    var satisfies = require_satisfies();
+    var compare = require_compare();
+    var subset = (sub, dom, options = {}) => {
+      if (sub === dom) {
+        return true;
+      }
+      sub = new Range(sub, options);
+      dom = new Range(dom, options);
+      let sawNonNull = false;
+      OUTER: for (const simpleSub of sub.set) {
+        for (const simpleDom of dom.set) {
+          const isSub = simpleSubset(simpleSub, simpleDom, options);
+          sawNonNull = sawNonNull || isSub !== null;
+          if (isSub) {
+            continue OUTER;
+          }
+        }
+        if (sawNonNull) {
+          return false;
+        }
+      }
+      return true;
+    };
+    var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
+    var minimumVersion = [new Comparator(">=0.0.0")];
+    var simpleSubset = (sub, dom, options) => {
+      if (sub === dom) {
+        return true;
+      }
+      if (sub.length === 1 && sub[0].semver === ANY) {
+        if (dom.length === 1 && dom[0].semver === ANY) {
+          return true;
+        } else if (options.includePrerelease) {
+          sub = minimumVersionWithPreRelease;
+        } else {
+          sub = minimumVersion;
+        }
+      }
+      if (dom.length === 1 && dom[0].semver === ANY) {
+        if (options.includePrerelease) {
+          return true;
+        } else {
+          dom = minimumVersion;
+        }
+      }
+      const eqSet = /* @__PURE__ */ new Set();
+      let gt, lt;
+      for (const c of sub) {
+        if (c.operator === ">" || c.operator === ">=") {
+          gt = higherGT(gt, c, options);
+        } else if (c.operator === "<" || c.operator === "<=") {
+          lt = lowerLT(lt, c, options);
+        } else {
+          eqSet.add(c.semver);
+        }
+      }
+      if (eqSet.size > 1) {
+        return null;
+      }
+      let gtltComp;
+      if (gt && lt) {
+        gtltComp = compare(gt.semver, lt.semver, options);
+        if (gtltComp > 0) {
+          return null;
+        } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
+          return null;
+        }
+      }
+      for (const eq of eqSet) {
+        if (gt && !satisfies(eq, String(gt), options)) {
+          return null;
+        }
+        if (lt && !satisfies(eq, String(lt), options)) {
+          return null;
+        }
+        for (const c of dom) {
+          if (!satisfies(eq, String(c), options)) {
+            return false;
+          }
+        }
+        return true;
+      }
+      let higher, lower;
+      let hasDomLT, hasDomGT;
+      let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
+      let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
+      if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
+        needDomLTPre = false;
+      }
+      for (const c of dom) {
+        hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
+        hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
+        if (gt) {
+          if (needDomGTPre) {
+            if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
+              needDomGTPre = false;
+            }
+          }
+          if (c.operator === ">" || c.operator === ">=") {
+            higher = higherGT(gt, c, options);
+            if (higher === c && higher !== gt) {
+              return false;
+            }
+          } else if (gt.operator === ">=" && !c.test(gt.semver)) {
+            return false;
+          }
+        }
+        if (lt) {
+          if (needDomLTPre) {
+            if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
+              needDomLTPre = false;
+            }
+          }
+          if (c.operator === "<" || c.operator === "<=") {
+            lower = lowerLT(lt, c, options);
+            if (lower === c && lower !== lt) {
+              return false;
+            }
+          } else if (lt.operator === "<=" && !c.test(lt.semver)) {
+            return false;
+          }
+        }
+        if (!c.operator && (lt || gt) && gtltComp !== 0) {
+          return false;
+        }
+      }
+      if (gt && hasDomLT && !lt && gtltComp !== 0) {
+        return false;
+      }
+      if (lt && hasDomGT && !gt && gtltComp !== 0) {
+        return false;
+      }
+      if (needDomGTPre || needDomLTPre) {
+        return false;
+      }
+      return true;
+    };
+    var higherGT = (a, b, options) => {
+      if (!a) {
+        return b;
+      }
+      const comp = compare(a.semver, b.semver, options);
+      return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
+    };
+    var lowerLT = (a, b, options) => {
+      if (!a) {
+        return b;
+      }
+      const comp = compare(a.semver, b.semver, options);
+      return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
+    };
+    module.exports = subset;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/index.js
+var require_semver2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/semver/7.8.5/50b76942b76b1567bb275b07b36d4efd1f7bc678ee222317e6ec7ff2c047c60d/node_modules/semver/index.js"(exports, module) {
+    "use strict";
+    var internalRe = require_re();
+    var constants2 = require_constants();
+    var SemVer = require_semver();
+    var identifiers = require_identifiers();
+    var parse2 = require_parse();
+    var valid = require_valid();
+    var clean = require_clean();
+    var inc = require_inc();
+    var diff = require_diff();
+    var major = require_major();
+    var minor = require_minor();
+    var patch = require_patch();
+    var prerelease = require_prerelease();
+    var compare = require_compare();
+    var rcompare = require_rcompare();
+    var compareLoose = require_compare_loose();
+    var compareBuild = require_compare_build();
+    var sort = require_sort();
+    var rsort = require_rsort();
+    var gt = require_gt();
+    var lt = require_lt();
+    var eq = require_eq();
+    var neq = require_neq();
+    var gte = require_gte();
+    var lte = require_lte();
+    var cmp = require_cmp();
+    var coerce = require_coerce();
+    var truncate = require_truncate();
+    var Comparator = require_comparator();
+    var Range = require_range();
+    var satisfies = require_satisfies();
+    var toComparators = require_to_comparators();
+    var maxSatisfying = require_max_satisfying();
+    var minSatisfying = require_min_satisfying();
+    var minVersion = require_min_version();
+    var validRange = require_valid2();
+    var outside = require_outside();
+    var gtr = require_gtr();
+    var ltr = require_ltr();
+    var intersects = require_intersects();
+    var simplifyRange = require_simplify();
+    var subset = require_subset();
+    module.exports = {
+      parse: parse2,
+      valid,
+      clean,
+      inc,
+      diff,
+      major,
+      minor,
+      patch,
+      prerelease,
+      compare,
+      rcompare,
+      compareLoose,
+      compareBuild,
+      sort,
+      rsort,
+      gt,
+      lt,
+      eq,
+      neq,
+      gte,
+      lte,
+      cmp,
+      coerce,
+      truncate,
+      Comparator,
+      Range,
+      satisfies,
+      toComparators,
+      maxSatisfying,
+      minSatisfying,
+      minVersion,
+      validRange,
+      outside,
+      gtr,
+      ltr,
+      intersects,
+      simplifyRange,
+      subset,
+      SemVer,
+      re: internalRe.re,
+      src: internalRe.src,
+      tokens: internalRe.t,
+      SEMVER_SPEC_VERSION: constants2.SEMVER_SPEC_VERSION,
+      RELEASE_TYPES: constants2.RELEASE_TYPES,
+      compareIdentifiers: identifiers.compareIdentifiers,
+      rcompareIdentifiers: identifiers.rcompareIdentifiers
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/fs/index.js
+var require_fs2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/fs/index.js"(exports) {
+    "use strict";
+    var u = require_universalify().fromCallback;
+    var fs13 = require_graceful_fs();
+    var api = [
+      "access",
+      "appendFile",
+      "chmod",
+      "chown",
+      "close",
+      "copyFile",
+      "cp",
+      "fchmod",
+      "fchown",
+      "fdatasync",
+      "fstat",
+      "fsync",
+      "ftruncate",
+      "futimes",
+      "glob",
+      "lchmod",
+      "lchown",
+      "lutimes",
+      "link",
+      "lstat",
+      "mkdir",
+      "mkdtemp",
+      "open",
+      "opendir",
+      "readdir",
+      "readFile",
+      "readlink",
+      "realpath",
+      "rename",
+      "rm",
+      "rmdir",
+      "stat",
+      "statfs",
+      "symlink",
+      "truncate",
+      "unlink",
+      "utimes",
+      "writeFile"
+    ].filter((key) => {
+      return typeof fs13[key] === "function";
+    });
+    Object.assign(exports, fs13);
+    api.forEach((method) => {
+      exports[method] = u(fs13[method]);
+    });
+    exports.exists = function(filename, callback) {
+      if (typeof callback === "function") {
+        return fs13.exists(filename, callback);
+      }
+      return new Promise((resolve) => {
+        return fs13.exists(filename, resolve);
+      });
+    };
+    exports.read = function(fd, buffer, offset, length, position3, callback) {
+      if (typeof callback === "function") {
+        return fs13.read(fd, buffer, offset, length, position3, callback);
+      }
+      return new Promise((resolve, reject) => {
+        fs13.read(fd, buffer, offset, length, position3, (err, bytesRead, buffer2) => {
+          if (err) return reject(err);
+          resolve({ bytesRead, buffer: buffer2 });
+        });
+      });
+    };
+    exports.write = function(fd, buffer, ...args) {
+      if (typeof args[args.length - 1] === "function") {
+        return fs13.write(fd, buffer, ...args);
+      }
+      return new Promise((resolve, reject) => {
+        fs13.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
+          if (err) return reject(err);
+          resolve({ bytesWritten, buffer: buffer2 });
+        });
+      });
+    };
+    exports.readv = function(fd, buffers, ...args) {
+      if (typeof args[args.length - 1] === "function") {
+        return fs13.readv(fd, buffers, ...args);
+      }
+      return new Promise((resolve, reject) => {
+        fs13.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
+          if (err) return reject(err);
+          resolve({ bytesRead, buffers: buffers2 });
+        });
+      });
+    };
+    exports.writev = function(fd, buffers, ...args) {
+      if (typeof args[args.length - 1] === "function") {
+        return fs13.writev(fd, buffers, ...args);
+      }
+      return new Promise((resolve, reject) => {
+        fs13.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
+          if (err) return reject(err);
+          resolve({ bytesWritten, buffers: buffers2 });
+        });
+      });
+    };
+    if (typeof fs13.realpath.native === "function") {
+      exports.realpath.native = u(fs13.realpath.native);
+    } else {
+      process.emitWarning(
+        "fs.realpath.native is not a function. Is fs being monkey-patched?",
+        "Warning",
+        "fs-extra-WARN0003"
+      );
+    }
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/mkdirs/utils.js
+var require_utils3 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module) {
+    "use strict";
+    var path18 = __require("path");
+    module.exports.checkPath = function checkPath(pth) {
+      if (process.platform === "win32") {
+        const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path18.parse(pth).root, ""));
+        if (pathHasInvalidWinCharacters) {
+          const error = new Error(`Path contains invalid characters: ${pth}`);
+          error.code = "EINVAL";
+          throw error;
+        }
+      }
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/mkdirs/make-dir.js
+var require_make_dir2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module) {
+    "use strict";
+    var fs13 = require_fs2();
+    var { checkPath } = require_utils3();
+    var getMode = (options) => {
+      const defaults = { mode: 511 };
+      if (typeof options === "number") return options;
+      return { ...defaults, ...options }.mode;
+    };
+    module.exports.makeDir = async (dir, options) => {
+      checkPath(dir);
+      return fs13.mkdir(dir, {
+        mode: getMode(options),
+        recursive: true
+      });
+    };
+    module.exports.makeDirSync = (dir, options) => {
+      checkPath(dir);
+      return fs13.mkdirSync(dir, {
+        mode: getMode(options),
+        recursive: true
+      });
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/mkdirs/index.js
+var require_mkdirs2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var { makeDir: _makeDir, makeDirSync } = require_make_dir2();
+    var makeDir = u(_makeDir);
+    module.exports = {
+      mkdirs: makeDir,
+      mkdirsSync: makeDirSync,
+      // alias
+      mkdirp: makeDir,
+      mkdirpSync: makeDirSync,
+      ensureDir: makeDir,
+      ensureDirSync: makeDirSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/path-exists/index.js
+var require_path_exists2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/path-exists/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var fs13 = require_fs2();
+    function pathExists(path18) {
+      return fs13.access(path18).then(() => true).catch(() => false);
+    }
+    module.exports = {
+      pathExists: u(pathExists),
+      pathExistsSync: fs13.existsSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/util/utimes.js
+var require_utimes2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
+    "use strict";
+    var fs13 = require_fs2();
+    var u = require_universalify().fromPromise;
+    async function utimesMillis(path18, atime, mtime) {
+      const fd = await fs13.open(path18, "r+");
+      let error = null;
+      try {
+        await fs13.futimes(fd, atime, mtime);
+      } catch (futimesErr) {
+        error = futimesErr;
+      } finally {
+        try {
+          await fs13.close(fd);
+        } catch (closeErr) {
+          if (!error) error = closeErr;
+        }
+      }
+      if (error) {
+        throw error;
+      }
+    }
+    function utimesMillisSync(path18, atime, mtime) {
+      const fd = fs13.openSync(path18, "r+");
+      let error = null;
+      try {
+        fs13.futimesSync(fd, atime, mtime);
+      } catch (futimesErr) {
+        error = futimesErr;
+      } finally {
+        try {
+          fs13.closeSync(fd);
+        } catch (closeErr) {
+          if (!error) error = closeErr;
+        }
+      }
+      if (error) {
+        throw error;
+      }
+    }
+    module.exports = {
+      utimesMillis: u(utimesMillis),
+      utimesMillisSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/util/stat.js
+var require_stat2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/util/stat.js"(exports, module) {
+    "use strict";
+    var fs13 = require_fs2();
+    var path18 = __require("path");
+    var u = require_universalify().fromPromise;
+    function getStats(src2, dest, opts2) {
+      const statFunc = opts2.dereference ? (file) => fs13.stat(file, { bigint: true }) : (file) => fs13.lstat(file, { bigint: true });
+      return Promise.all([
+        statFunc(src2),
+        statFunc(dest).catch((err) => {
+          if (err.code === "ENOENT") return null;
+          throw err;
+        })
+      ]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
+    }
+    function getStatsSync(src2, dest, opts2) {
+      let destStat;
+      const statFunc = opts2.dereference ? (file) => fs13.statSync(file, { bigint: true }) : (file) => fs13.lstatSync(file, { bigint: true });
+      const srcStat = statFunc(src2);
+      try {
+        destStat = statFunc(dest);
+      } catch (err) {
+        if (err.code === "ENOENT") return { srcStat, destStat: null };
+        throw err;
+      }
+      return { srcStat, destStat };
+    }
+    async function checkPaths(src2, dest, funcName, opts2) {
+      const { srcStat, destStat } = await getStats(src2, dest, opts2);
+      if (destStat) {
+        if (areIdentical(srcStat, destStat)) {
+          const srcBaseName = path18.basename(src2);
+          const destBaseName = path18.basename(dest);
+          if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
+            return { srcStat, destStat, isChangingCase: true };
+          }
+          throw new Error("Source and destination must not be the same.");
+        }
+        if (srcStat.isDirectory() && !destStat.isDirectory()) {
+          throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src2}'.`);
+        }
+        if (!srcStat.isDirectory() && destStat.isDirectory()) {
+          throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src2}'.`);
+        }
+      }
+      if (srcStat.isDirectory() && isSrcSubdir(src2, dest)) {
+        throw new Error(errMsg(src2, dest, funcName));
+      }
+      return { srcStat, destStat };
+    }
+    function checkPathsSync(src2, dest, funcName, opts2) {
+      const { srcStat, destStat } = getStatsSync(src2, dest, opts2);
+      if (destStat) {
+        if (areIdentical(srcStat, destStat)) {
+          const srcBaseName = path18.basename(src2);
+          const destBaseName = path18.basename(dest);
+          if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
+            return { srcStat, destStat, isChangingCase: true };
+          }
+          throw new Error("Source and destination must not be the same.");
+        }
+        if (srcStat.isDirectory() && !destStat.isDirectory()) {
+          throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src2}'.`);
+        }
+        if (!srcStat.isDirectory() && destStat.isDirectory()) {
+          throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src2}'.`);
+        }
+      }
+      if (srcStat.isDirectory() && isSrcSubdir(src2, dest)) {
+        throw new Error(errMsg(src2, dest, funcName));
+      }
+      return { srcStat, destStat };
+    }
+    async function checkParentPaths(src2, srcStat, dest, funcName) {
+      const srcParent = path18.resolve(path18.dirname(src2));
+      const destParent = path18.resolve(path18.dirname(dest));
+      if (destParent === srcParent || destParent === path18.parse(destParent).root) return;
+      let destStat;
+      try {
+        destStat = await fs13.stat(destParent, { bigint: true });
+      } catch (err) {
+        if (err.code === "ENOENT") return checkParentPaths(src2, srcStat, destParent, funcName);
+        throw err;
+      }
+      if (areIdentical(srcStat, destStat)) {
+        throw new Error(errMsg(src2, dest, funcName));
+      }
+      return checkParentPaths(src2, srcStat, destParent, funcName);
+    }
+    function checkParentPathsSync(src2, srcStat, dest, funcName) {
+      const srcParent = path18.resolve(path18.dirname(src2));
+      const destParent = path18.resolve(path18.dirname(dest));
+      if (destParent === srcParent || destParent === path18.parse(destParent).root) return;
+      let destStat;
+      try {
+        destStat = fs13.statSync(destParent, { bigint: true });
+      } catch (err) {
+        if (err.code === "ENOENT") return checkParentPathsSync(src2, srcStat, destParent, funcName);
+        throw err;
+      }
+      if (areIdentical(srcStat, destStat)) {
+        throw new Error(errMsg(src2, dest, funcName));
+      }
+      return checkParentPathsSync(src2, srcStat, destParent, funcName);
+    }
+    function areIdentical(srcStat, destStat) {
+      return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
+    }
+    function isSrcSubdir(src2, dest) {
+      const srcArr = path18.resolve(src2).split(path18.sep).filter((i) => i);
+      const destArr = path18.resolve(dest).split(path18.sep).filter((i) => i);
+      return srcArr.every((cur, i) => destArr[i] === cur);
+    }
+    function errMsg(src2, dest, funcName) {
+      return `Cannot ${funcName} '${src2}' to a subdirectory of itself, '${dest}'.`;
+    }
+    module.exports = {
+      // checkPaths
+      checkPaths: u(checkPaths),
+      checkPathsSync,
+      // checkParent
+      checkParentPaths: u(checkParentPaths),
+      checkParentPathsSync,
+      // Misc
+      isSrcSubdir,
+      areIdentical
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/util/async.js
+var require_async2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/util/async.js"(exports, module) {
+    "use strict";
+    async function asyncIteratorConcurrentProcess(iterator, fn) {
+      const promises = [];
+      for await (const item of iterator) {
+        promises.push(
+          fn(item).then(
+            () => null,
+            (err) => err ?? new Error("unknown error")
+          )
+        );
+      }
+      await Promise.all(
+        promises.map(
+          (promise) => promise.then((possibleErr) => {
+            if (possibleErr !== null) throw possibleErr;
+          })
+        )
+      );
+    }
+    module.exports = {
+      asyncIteratorConcurrentProcess
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/copy/copy.js
+var require_copy3 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/copy/copy.js"(exports, module) {
+    "use strict";
+    var fs13 = require_fs2();
+    var path18 = __require("path");
+    var { mkdirs } = require_mkdirs2();
+    var { pathExists } = require_path_exists2();
+    var { utimesMillis } = require_utimes2();
+    var stat = require_stat2();
+    var { asyncIteratorConcurrentProcess } = require_async2();
+    async function copy2(src2, dest, opts2 = {}) {
+      if (typeof opts2 === "function") {
+        opts2 = { filter: opts2 };
+      }
+      opts2.clobber = "clobber" in opts2 ? !!opts2.clobber : true;
+      opts2.overwrite = "overwrite" in opts2 ? !!opts2.overwrite : opts2.clobber;
+      if (opts2.preserveTimestamps && process.arch === "ia32") {
+        process.emitWarning(
+          "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n	see https://github.com/jprichardson/node-fs-extra/issues/269",
+          "Warning",
+          "fs-extra-WARN0001"
+        );
+      }
+      const { srcStat, destStat } = await stat.checkPaths(src2, dest, "copy", opts2);
+      await stat.checkParentPaths(src2, srcStat, dest, "copy");
+      const include = await runFilter(src2, dest, opts2);
+      if (!include) return;
+      const destParent = path18.dirname(dest);
+      const dirExists = await pathExists(destParent);
+      if (!dirExists) {
+        await mkdirs(destParent);
+      }
+      await getStatsAndPerformCopy(destStat, src2, dest, opts2);
+    }
+    async function runFilter(src2, dest, opts2) {
+      if (!opts2.filter) return true;
+      return opts2.filter(src2, dest);
+    }
+    async function getStatsAndPerformCopy(destStat, src2, dest, opts2) {
+      const statFn = opts2.dereference ? fs13.stat : fs13.lstat;
+      const srcStat = await statFn(src2);
+      if (srcStat.isDirectory()) return onDir(srcStat, destStat, src2, dest, opts2);
+      if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src2, dest, opts2);
+      if (srcStat.isSymbolicLink()) return onLink(destStat, src2, dest, opts2);
+      if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src2}`);
+      if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src2}`);
+      throw new Error(`Unknown file: ${src2}`);
+    }
+    async function onFile(srcStat, destStat, src2, dest, opts2) {
+      if (!destStat) return copyFile(srcStat, src2, dest, opts2);
+      if (opts2.overwrite) {
+        await fs13.unlink(dest);
+        return copyFile(srcStat, src2, dest, opts2);
+      }
+      if (opts2.errorOnExist) {
+        throw new Error(`'${dest}' already exists`);
+      }
+    }
+    async function copyFile(srcStat, src2, dest, opts2) {
+      await fs13.copyFile(src2, dest);
+      if (opts2.preserveTimestamps) {
+        if (fileIsNotWritable(srcStat.mode)) {
+          await makeFileWritable(dest, srcStat.mode);
+        }
+        const updatedSrcStat = await fs13.stat(src2);
+        await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
+      }
+      return fs13.chmod(dest, srcStat.mode);
+    }
+    function fileIsNotWritable(srcMode) {
+      return (srcMode & 128) === 0;
+    }
+    function makeFileWritable(dest, srcMode) {
+      return fs13.chmod(dest, srcMode | 128);
+    }
+    async function onDir(srcStat, destStat, src2, dest, opts2) {
+      if (!destStat) {
+        await fs13.mkdir(dest);
+      }
+      await asyncIteratorConcurrentProcess(await fs13.opendir(src2), async (item) => {
+        const srcItem = path18.join(src2, item.name);
+        const destItem = path18.join(dest, item.name);
+        const include = await runFilter(srcItem, destItem, opts2);
+        if (include) {
+          const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts2);
+          await getStatsAndPerformCopy(destStat2, srcItem, destItem, opts2);
+        }
+      });
+      if (!destStat) {
+        await fs13.chmod(dest, srcStat.mode);
+      }
+    }
+    async function onLink(destStat, src2, dest, opts2) {
+      let resolvedSrc = await fs13.readlink(src2);
+      if (opts2.dereference) {
+        resolvedSrc = path18.resolve(process.cwd(), resolvedSrc);
+      }
+      if (!destStat) {
+        return fs13.symlink(resolvedSrc, dest);
+      }
+      let resolvedDest = null;
+      try {
+        resolvedDest = await fs13.readlink(dest);
+      } catch (e) {
+        if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs13.symlink(resolvedSrc, dest);
+        throw e;
+      }
+      if (opts2.dereference) {
+        resolvedDest = path18.resolve(process.cwd(), resolvedDest);
+      }
+      if (resolvedSrc !== resolvedDest) {
+        if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
+          throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
+        }
+        if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
+          throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
+        }
+      }
+      await fs13.unlink(dest);
+      return fs13.symlink(resolvedSrc, dest);
+    }
+    module.exports = copy2;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/copy/copy-sync.js
+var require_copy_sync2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module) {
+    "use strict";
+    var fs13 = require_graceful_fs();
+    var path18 = __require("path");
+    var mkdirsSync = require_mkdirs2().mkdirsSync;
+    var utimesMillisSync = require_utimes2().utimesMillisSync;
+    var stat = require_stat2();
+    function copySync2(src2, dest, opts2) {
+      if (typeof opts2 === "function") {
+        opts2 = { filter: opts2 };
+      }
+      opts2 = opts2 || {};
+      opts2.clobber = "clobber" in opts2 ? !!opts2.clobber : true;
+      opts2.overwrite = "overwrite" in opts2 ? !!opts2.overwrite : opts2.clobber;
+      if (opts2.preserveTimestamps && process.arch === "ia32") {
+        process.emitWarning(
+          "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n	see https://github.com/jprichardson/node-fs-extra/issues/269",
+          "Warning",
+          "fs-extra-WARN0002"
+        );
+      }
+      const { srcStat, destStat } = stat.checkPathsSync(src2, dest, "copy", opts2);
+      stat.checkParentPathsSync(src2, srcStat, dest, "copy");
+      if (opts2.filter && !opts2.filter(src2, dest)) return;
+      const destParent = path18.dirname(dest);
+      if (!fs13.existsSync(destParent)) mkdirsSync(destParent);
+      return getStats(destStat, src2, dest, opts2);
+    }
+    function getStats(destStat, src2, dest, opts2) {
+      const statSync = opts2.dereference ? fs13.statSync : fs13.lstatSync;
+      const srcStat = statSync(src2);
+      if (srcStat.isDirectory()) return onDir(srcStat, destStat, src2, dest, opts2);
+      else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src2, dest, opts2);
+      else if (srcStat.isSymbolicLink()) return onLink(destStat, src2, dest, opts2);
+      else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src2}`);
+      else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src2}`);
+      throw new Error(`Unknown file: ${src2}`);
+    }
+    function onFile(srcStat, destStat, src2, dest, opts2) {
+      if (!destStat) return copyFile(srcStat, src2, dest, opts2);
+      return mayCopyFile(srcStat, src2, dest, opts2);
+    }
+    function mayCopyFile(srcStat, src2, dest, opts2) {
+      if (opts2.overwrite) {
+        fs13.unlinkSync(dest);
+        return copyFile(srcStat, src2, dest, opts2);
+      } else if (opts2.errorOnExist) {
+        throw new Error(`'${dest}' already exists`);
+      }
+    }
+    function copyFile(srcStat, src2, dest, opts2) {
+      fs13.copyFileSync(src2, dest);
+      if (opts2.preserveTimestamps) handleTimestamps(srcStat.mode, src2, dest);
+      return setDestMode(dest, srcStat.mode);
+    }
+    function handleTimestamps(srcMode, src2, dest) {
+      if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);
+      return setDestTimestamps(src2, dest);
+    }
+    function fileIsNotWritable(srcMode) {
+      return (srcMode & 128) === 0;
+    }
+    function makeFileWritable(dest, srcMode) {
+      return setDestMode(dest, srcMode | 128);
+    }
+    function setDestMode(dest, srcMode) {
+      return fs13.chmodSync(dest, srcMode);
+    }
+    function setDestTimestamps(src2, dest) {
+      const updatedSrcStat = fs13.statSync(src2);
+      return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
+    }
+    function onDir(srcStat, destStat, src2, dest, opts2) {
+      if (!destStat) return mkDirAndCopy(srcStat.mode, src2, dest, opts2);
+      return copyDir(src2, dest, opts2);
+    }
+    function mkDirAndCopy(srcMode, src2, dest, opts2) {
+      fs13.mkdirSync(dest);
+      copyDir(src2, dest, opts2);
+      return setDestMode(dest, srcMode);
+    }
+    function copyDir(src2, dest, opts2) {
+      const dir = fs13.opendirSync(src2);
+      try {
+        let dirent;
+        while ((dirent = dir.readSync()) !== null) {
+          copyDirItem(dirent.name, src2, dest, opts2);
+        }
+      } finally {
+        dir.closeSync();
+      }
+    }
+    function copyDirItem(item, src2, dest, opts2) {
+      const srcItem = path18.join(src2, item);
+      const destItem = path18.join(dest, item);
+      if (opts2.filter && !opts2.filter(srcItem, destItem)) return;
+      const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts2);
+      return getStats(destStat, srcItem, destItem, opts2);
+    }
+    function onLink(destStat, src2, dest, opts2) {
+      let resolvedSrc = fs13.readlinkSync(src2);
+      if (opts2.dereference) {
+        resolvedSrc = path18.resolve(process.cwd(), resolvedSrc);
+      }
+      if (!destStat) {
+        return fs13.symlinkSync(resolvedSrc, dest);
+      } else {
+        let resolvedDest;
+        try {
+          resolvedDest = fs13.readlinkSync(dest);
+        } catch (err) {
+          if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs13.symlinkSync(resolvedSrc, dest);
+          throw err;
+        }
+        if (opts2.dereference) {
+          resolvedDest = path18.resolve(process.cwd(), resolvedDest);
+        }
+        if (resolvedSrc !== resolvedDest) {
+          if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
+            throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
+          }
+          if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
+            throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
+          }
+        }
+        return copyLink(resolvedSrc, dest);
+      }
+    }
+    function copyLink(resolvedSrc, dest) {
+      fs13.unlinkSync(dest);
+      return fs13.symlinkSync(resolvedSrc, dest);
+    }
+    module.exports = copySync2;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/copy/index.js
+var require_copy4 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/copy/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    module.exports = {
+      copy: u(require_copy3()),
+      copySync: require_copy_sync2()
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/remove/index.js
+var require_remove2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/remove/index.js"(exports, module) {
+    "use strict";
+    var fs13 = require_graceful_fs();
+    var u = require_universalify().fromCallback;
+    function remove(path18, callback) {
+      fs13.rm(path18, { recursive: true, force: true }, callback);
+    }
+    function removeSync(path18) {
+      fs13.rmSync(path18, { recursive: true, force: true });
+    }
+    module.exports = {
+      remove: u(remove),
+      removeSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/empty/index.js
+var require_empty2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/empty/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var fs13 = require_fs2();
+    var path18 = __require("path");
+    var mkdir = require_mkdirs2();
+    var remove = require_remove2();
+    var emptyDir = u(async function emptyDir2(dir) {
+      let items;
+      try {
+        items = await fs13.readdir(dir);
+      } catch {
+        return mkdir.mkdirs(dir);
+      }
+      return Promise.all(items.map((item) => remove.remove(path18.join(dir, item))));
+    });
+    function emptyDirSync(dir) {
+      let items;
+      try {
+        items = fs13.readdirSync(dir);
+      } catch {
+        return mkdir.mkdirsSync(dir);
+      }
+      items.forEach((item) => {
+        item = path18.join(dir, item);
+        remove.removeSync(item);
+      });
+    }
+    module.exports = {
+      emptyDirSync,
+      emptydirSync: emptyDirSync,
+      emptyDir,
+      emptydir: emptyDir
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/ensure/file.js
+var require_file2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/ensure/file.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var path18 = __require("path");
+    var fs13 = require_fs2();
+    var mkdir = require_mkdirs2();
+    async function createFile(file) {
+      let stats;
+      try {
+        stats = await fs13.stat(file);
+      } catch {
+      }
+      if (stats && stats.isFile()) return;
+      const dir = path18.dirname(file);
+      let dirStats = null;
+      try {
+        dirStats = await fs13.stat(dir);
+      } catch (err) {
+        if (err.code === "ENOENT") {
+          await mkdir.mkdirs(dir);
+          await fs13.writeFile(file, "");
+          return;
+        } else {
+          throw err;
+        }
+      }
+      if (dirStats.isDirectory()) {
+        await fs13.writeFile(file, "");
+      } else {
+        await fs13.readdir(dir);
+      }
+    }
+    function createFileSync(file) {
+      let stats;
+      try {
+        stats = fs13.statSync(file);
+      } catch {
+      }
+      if (stats && stats.isFile()) return;
+      const dir = path18.dirname(file);
+      try {
+        if (!fs13.statSync(dir).isDirectory()) {
+          fs13.readdirSync(dir);
+        }
+      } catch (err) {
+        if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
+        else throw err;
+      }
+      fs13.writeFileSync(file, "");
+    }
+    module.exports = {
+      createFile: u(createFile),
+      createFileSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/ensure/link.js
+var require_link2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/ensure/link.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var path18 = __require("path");
+    var fs13 = require_fs2();
+    var mkdir = require_mkdirs2();
+    var { pathExists } = require_path_exists2();
+    var { areIdentical } = require_stat2();
+    async function createLink(srcpath, dstpath) {
+      let dstStat;
+      try {
+        dstStat = await fs13.lstat(dstpath, { bigint: true });
+      } catch {
+      }
+      let srcStat;
+      try {
+        srcStat = await fs13.lstat(srcpath, { bigint: true });
+      } catch (err) {
+        err.message = err.message.replace("lstat", "ensureLink");
+        throw err;
+      }
+      if (dstStat && areIdentical(srcStat, dstStat)) return;
+      const dir = path18.dirname(dstpath);
+      const dirExists = await pathExists(dir);
+      if (!dirExists) {
+        await mkdir.mkdirs(dir);
+      }
+      await fs13.link(srcpath, dstpath);
+    }
+    function createLinkSync(srcpath, dstpath) {
+      let dstStat;
+      try {
+        dstStat = fs13.lstatSync(dstpath, { bigint: true });
+      } catch {
+      }
+      try {
+        const srcStat = fs13.lstatSync(srcpath, { bigint: true });
+        if (dstStat && areIdentical(srcStat, dstStat)) return;
+      } catch (err) {
+        err.message = err.message.replace("lstat", "ensureLink");
+        throw err;
+      }
+      const dir = path18.dirname(dstpath);
+      const dirExists = fs13.existsSync(dir);
+      if (dirExists) return fs13.linkSync(srcpath, dstpath);
+      mkdir.mkdirsSync(dir);
+      return fs13.linkSync(srcpath, dstpath);
+    }
+    module.exports = {
+      createLink: u(createLink),
+      createLinkSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/ensure/symlink-paths.js
+var require_symlink_paths2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module) {
+    "use strict";
+    var path18 = __require("path");
+    var fs13 = require_fs2();
+    var { pathExists } = require_path_exists2();
+    var u = require_universalify().fromPromise;
+    async function symlinkPaths(srcpath, dstpath) {
+      if (path18.isAbsolute(srcpath)) {
+        try {
+          await fs13.lstat(srcpath);
+        } catch (err) {
+          err.message = err.message.replace("lstat", "ensureSymlink");
+          throw err;
+        }
+        return {
+          toCwd: srcpath,
+          toDst: srcpath
+        };
+      }
+      const dstdir = path18.dirname(dstpath);
+      const relativeToDst = path18.join(dstdir, srcpath);
+      const exists = await pathExists(relativeToDst);
+      if (exists) {
+        return {
+          toCwd: relativeToDst,
+          toDst: srcpath
+        };
+      }
+      try {
+        await fs13.lstat(srcpath);
+      } catch (err) {
+        err.message = err.message.replace("lstat", "ensureSymlink");
+        throw err;
+      }
+      return {
+        toCwd: srcpath,
+        toDst: path18.relative(dstdir, srcpath)
+      };
+    }
+    function symlinkPathsSync(srcpath, dstpath) {
+      if (path18.isAbsolute(srcpath)) {
+        const exists2 = fs13.existsSync(srcpath);
+        if (!exists2) throw new Error("absolute srcpath does not exist");
+        return {
+          toCwd: srcpath,
+          toDst: srcpath
+        };
+      }
+      const dstdir = path18.dirname(dstpath);
+      const relativeToDst = path18.join(dstdir, srcpath);
+      const exists = fs13.existsSync(relativeToDst);
+      if (exists) {
+        return {
+          toCwd: relativeToDst,
+          toDst: srcpath
+        };
+      }
+      const srcExists = fs13.existsSync(srcpath);
+      if (!srcExists) throw new Error("relative srcpath does not exist");
+      return {
+        toCwd: srcpath,
+        toDst: path18.relative(dstdir, srcpath)
+      };
+    }
+    module.exports = {
+      symlinkPaths: u(symlinkPaths),
+      symlinkPathsSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/ensure/symlink-type.js
+var require_symlink_type2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module) {
+    "use strict";
+    var fs13 = require_fs2();
+    var u = require_universalify().fromPromise;
+    async function symlinkType(srcpath, type) {
+      if (type) return type;
+      let stats;
+      try {
+        stats = await fs13.lstat(srcpath);
+      } catch {
+        return "file";
+      }
+      return stats && stats.isDirectory() ? "dir" : "file";
+    }
+    function symlinkTypeSync(srcpath, type) {
+      if (type) return type;
+      let stats;
+      try {
+        stats = fs13.lstatSync(srcpath);
+      } catch {
+        return "file";
+      }
+      return stats && stats.isDirectory() ? "dir" : "file";
+    }
+    module.exports = {
+      symlinkType: u(symlinkType),
+      symlinkTypeSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/ensure/symlink.js
+var require_symlink2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var path18 = __require("path");
+    var fs13 = require_fs2();
+    var { mkdirs, mkdirsSync } = require_mkdirs2();
+    var { symlinkPaths, symlinkPathsSync } = require_symlink_paths2();
+    var { symlinkType, symlinkTypeSync } = require_symlink_type2();
+    var { pathExists } = require_path_exists2();
+    var { areIdentical } = require_stat2();
+    async function createSymlink(srcpath, dstpath, type) {
+      let stats;
+      try {
+        stats = await fs13.lstat(dstpath);
+      } catch {
+      }
+      if (stats && stats.isSymbolicLink()) {
+        let srcStat;
+        if (path18.isAbsolute(srcpath)) {
+          srcStat = await fs13.stat(srcpath, { bigint: true });
+        } else {
+          const dstdir = path18.dirname(dstpath);
+          const relativeToDst = path18.join(dstdir, srcpath);
+          try {
+            srcStat = await fs13.stat(relativeToDst, { bigint: true });
+          } catch {
+            srcStat = await fs13.stat(srcpath, { bigint: true });
+          }
+        }
+        let dstStat;
+        try {
+          dstStat = await fs13.stat(dstpath, { bigint: true });
+        } catch (err) {
+          if (err.code !== "ENOENT") throw err;
+        }
+        if (dstStat && areIdentical(srcStat, dstStat)) return;
+      }
+      const relative = await symlinkPaths(srcpath, dstpath);
+      srcpath = relative.toDst;
+      const toType = await symlinkType(relative.toCwd, type);
+      const dir = path18.dirname(dstpath);
+      if (!await pathExists(dir)) {
+        await mkdirs(dir);
+      }
+      return fs13.symlink(srcpath, dstpath, toType);
+    }
+    function createSymlinkSync2(srcpath, dstpath, type) {
+      let stats;
+      try {
+        stats = fs13.lstatSync(dstpath);
+      } catch {
+      }
+      if (stats && stats.isSymbolicLink()) {
+        let srcStat;
+        if (path18.isAbsolute(srcpath)) {
+          srcStat = fs13.statSync(srcpath, { bigint: true });
+        } else {
+          const dstdir = path18.dirname(dstpath);
+          const relativeToDst = path18.join(dstdir, srcpath);
+          try {
+            srcStat = fs13.statSync(relativeToDst, { bigint: true });
+          } catch {
+            srcStat = fs13.statSync(srcpath, { bigint: true });
+          }
+        }
+        let dstStat;
+        try {
+          dstStat = fs13.statSync(dstpath, { bigint: true });
+        } catch (err) {
+          if (err.code !== "ENOENT") throw err;
+        }
+        if (dstStat && areIdentical(srcStat, dstStat)) return;
+      }
+      const relative = symlinkPathsSync(srcpath, dstpath);
+      srcpath = relative.toDst;
+      type = symlinkTypeSync(relative.toCwd, type);
+      const dir = path18.dirname(dstpath);
+      const exists = fs13.existsSync(dir);
+      if (exists) return fs13.symlinkSync(srcpath, dstpath, type);
+      mkdirsSync(dir);
+      return fs13.symlinkSync(srcpath, dstpath, type);
+    }
+    module.exports = {
+      createSymlink: u(createSymlink),
+      createSymlinkSync: createSymlinkSync2
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/ensure/index.js
+var require_ensure2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/ensure/index.js"(exports, module) {
+    "use strict";
+    var { createFile, createFileSync } = require_file2();
+    var { createLink, createLinkSync } = require_link2();
+    var { createSymlink, createSymlinkSync: createSymlinkSync2 } = require_symlink2();
+    module.exports = {
+      // file
+      createFile,
+      createFileSync,
+      ensureFile: createFile,
+      ensureFileSync: createFileSync,
+      // link
+      createLink,
+      createLinkSync,
+      ensureLink: createLink,
+      ensureLinkSync: createLinkSync,
+      // symlink
+      createSymlink,
+      createSymlinkSync: createSymlinkSync2,
+      ensureSymlink: createSymlink,
+      ensureSymlinkSync: createSymlinkSync2
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/json/jsonfile.js
+var require_jsonfile3 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module) {
+    "use strict";
+    var jsonFile = require_jsonfile();
+    module.exports = {
+      // jsonfile exports
+      readJson: jsonFile.readFile,
+      readJsonSync: jsonFile.readFileSync,
+      writeJson: jsonFile.writeFile,
+      writeJsonSync: jsonFile.writeFileSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/output-file/index.js
+var require_output_file2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/output-file/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var fs13 = require_fs2();
+    var path18 = __require("path");
+    var mkdir = require_mkdirs2();
+    var pathExists = require_path_exists2().pathExists;
+    async function outputFile(file, data, encoding = "utf-8") {
+      const dir = path18.dirname(file);
+      if (!await pathExists(dir)) {
+        await mkdir.mkdirs(dir);
+      }
+      return fs13.writeFile(file, data, encoding);
+    }
+    function outputFileSync(file, ...args) {
+      const dir = path18.dirname(file);
+      if (!fs13.existsSync(dir)) {
+        mkdir.mkdirsSync(dir);
+      }
+      fs13.writeFileSync(file, ...args);
+    }
+    module.exports = {
+      outputFile: u(outputFile),
+      outputFileSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/json/output-json.js
+var require_output_json2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/json/output-json.js"(exports, module) {
+    "use strict";
+    var { stringify } = require_utils2();
+    var { outputFile } = require_output_file2();
+    async function outputJson(file, data, options = {}) {
+      const str = stringify(data, options);
+      await outputFile(file, str, options);
+    }
+    module.exports = outputJson;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/json/output-json-sync.js
+var require_output_json_sync2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module) {
+    "use strict";
+    var { stringify } = require_utils2();
+    var { outputFileSync } = require_output_file2();
+    function outputJsonSync(file, data, options) {
+      const str = stringify(data, options);
+      outputFileSync(file, str, options);
+    }
+    module.exports = outputJsonSync;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/json/index.js
+var require_json2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/json/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    var jsonFile = require_jsonfile3();
+    jsonFile.outputJson = u(require_output_json2());
+    jsonFile.outputJsonSync = require_output_json_sync2();
+    jsonFile.outputJSON = jsonFile.outputJson;
+    jsonFile.outputJSONSync = jsonFile.outputJsonSync;
+    jsonFile.writeJSON = jsonFile.writeJson;
+    jsonFile.writeJSONSync = jsonFile.writeJsonSync;
+    jsonFile.readJSON = jsonFile.readJson;
+    jsonFile.readJSONSync = jsonFile.readJsonSync;
+    module.exports = jsonFile;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/move/move.js
+var require_move3 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/move/move.js"(exports, module) {
+    "use strict";
+    var fs13 = require_fs2();
+    var path18 = __require("path");
+    var { copy: copy2 } = require_copy4();
+    var { remove } = require_remove2();
+    var { mkdirp } = require_mkdirs2();
+    var { pathExists } = require_path_exists2();
+    var stat = require_stat2();
+    async function move(src2, dest, opts2 = {}) {
+      const overwrite = opts2.overwrite || opts2.clobber || false;
+      const { srcStat, isChangingCase = false } = await stat.checkPaths(src2, dest, "move", opts2);
+      await stat.checkParentPaths(src2, srcStat, dest, "move");
+      const destParent = path18.dirname(dest);
+      const parsedParentPath = path18.parse(destParent);
+      if (parsedParentPath.root !== destParent) {
+        await mkdirp(destParent);
+      }
+      return doRename(src2, dest, overwrite, isChangingCase);
+    }
+    async function doRename(src2, dest, overwrite, isChangingCase) {
+      if (!isChangingCase) {
+        if (overwrite) {
+          await remove(dest);
+        } else if (await pathExists(dest)) {
+          throw new Error("dest already exists.");
+        }
+      }
+      try {
+        await fs13.rename(src2, dest);
+      } catch (err) {
+        if (err.code !== "EXDEV") {
+          throw err;
+        }
+        await moveAcrossDevice(src2, dest, overwrite);
+      }
+    }
+    async function moveAcrossDevice(src2, dest, overwrite) {
+      const opts2 = {
+        overwrite,
+        errorOnExist: true,
+        preserveTimestamps: true
+      };
+      await copy2(src2, dest, opts2);
+      return remove(src2);
+    }
+    module.exports = move;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/move/move-sync.js
+var require_move_sync2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
+    "use strict";
+    var fs13 = require_graceful_fs();
+    var path18 = __require("path");
+    var copySync2 = require_copy4().copySync;
+    var removeSync = require_remove2().removeSync;
+    var mkdirpSync = require_mkdirs2().mkdirpSync;
+    var stat = require_stat2();
+    function moveSync(src2, dest, opts2) {
+      opts2 = opts2 || {};
+      const overwrite = opts2.overwrite || opts2.clobber || false;
+      const { srcStat, isChangingCase = false } = stat.checkPathsSync(src2, dest, "move", opts2);
+      stat.checkParentPathsSync(src2, srcStat, dest, "move");
+      if (!isParentRoot(dest)) mkdirpSync(path18.dirname(dest));
+      return doRename(src2, dest, overwrite, isChangingCase);
+    }
+    function isParentRoot(dest) {
+      const parent = path18.dirname(dest);
+      const parsedPath = path18.parse(parent);
+      return parsedPath.root === parent;
+    }
+    function doRename(src2, dest, overwrite, isChangingCase) {
+      if (isChangingCase) return rename(src2, dest, overwrite);
+      if (overwrite) {
+        removeSync(dest);
+        return rename(src2, dest, overwrite);
+      }
+      if (fs13.existsSync(dest)) throw new Error("dest already exists.");
+      return rename(src2, dest, overwrite);
+    }
+    function rename(src2, dest, overwrite) {
+      try {
+        fs13.renameSync(src2, dest);
+      } catch (err) {
+        if (err.code !== "EXDEV") throw err;
+        return moveAcrossDevice(src2, dest, overwrite);
+      }
+    }
+    function moveAcrossDevice(src2, dest, overwrite) {
+      const opts2 = {
+        overwrite,
+        errorOnExist: true,
+        preserveTimestamps: true
+      };
+      copySync2(src2, dest, opts2);
+      return removeSync(src2);
+    }
+    module.exports = moveSync;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/move/index.js
+var require_move4 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/move/index.js"(exports, module) {
+    "use strict";
+    var u = require_universalify().fromPromise;
+    module.exports = {
+      move: u(require_move3()),
+      moveSync: require_move_sync2()
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/index.js
+var require_lib3 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/fs-extra/11.4.0/e439e6fd4e4e9f79a9b4208fa39fea4dd6d7c4364cffe6989d0b5179d7e3aec7/node_modules/fs-extra/lib/index.js"(exports, module) {
+    "use strict";
+    module.exports = {
+      // Export promiseified graceful-fs:
+      ...require_fs2(),
+      // Export extra methods:
+      ...require_copy4(),
+      ...require_empty2(),
+      ...require_ensure2(),
+      ...require_json2(),
+      ...require_mkdirs2(),
+      ...require_move4(),
+      ...require_output_file2(),
+      ...require_path_exists2(),
+      ...require_remove2()
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/truncate-utf8-bytes/1.0.2/a125ab6f857e769c1c35dafd31e6b108b9a2517e088148da14ad32169c2567ee/node_modules/truncate-utf8-bytes/lib/truncate.js
+var require_truncate2 = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/truncate-utf8-bytes/1.0.2/a125ab6f857e769c1c35dafd31e6b108b9a2517e088148da14ad32169c2567ee/node_modules/truncate-utf8-bytes/lib/truncate.js"(exports, module) {
+    "use strict";
+    function isHighSurrogate(codePoint) {
+      return codePoint >= 55296 && codePoint <= 56319;
+    }
+    function isLowSurrogate(codePoint) {
+      return codePoint >= 56320 && codePoint <= 57343;
+    }
+    module.exports = function truncate(getLength, string, byteLength) {
+      if (typeof string !== "string") {
+        throw new Error("Input must be string");
+      }
+      var charLength = string.length;
+      var curByteLength = 0;
+      var codePoint;
+      var segment;
+      for (var i = 0; i < charLength; i += 1) {
+        codePoint = string.charCodeAt(i);
+        segment = string[i];
+        if (isHighSurrogate(codePoint) && isLowSurrogate(string.charCodeAt(i + 1))) {
+          i += 1;
+          segment += string[i];
+        }
+        curByteLength += getLength(segment);
+        if (curByteLength === byteLength) {
+          return string.slice(0, i + 1);
+        } else if (curByteLength > byteLength) {
+          return string.slice(0, i - segment.length + 1);
+        }
+      }
+      return string;
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/truncate-utf8-bytes/1.0.2/a125ab6f857e769c1c35dafd31e6b108b9a2517e088148da14ad32169c2567ee/node_modules/truncate-utf8-bytes/index.js
+var require_truncate_utf8_bytes = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/truncate-utf8-bytes/1.0.2/a125ab6f857e769c1c35dafd31e6b108b9a2517e088148da14ad32169c2567ee/node_modules/truncate-utf8-bytes/index.js"(exports, module) {
+    "use strict";
+    var truncate = require_truncate2();
+    var getLength = Buffer.byteLength.bind(Buffer);
+    module.exports = truncate.bind(null, getLength);
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/sanitize-filename/1.6.4/5f553bde92425a76e0b51eddf2a9a22faa7626146298aecdcafaf8de748aa2e6/node_modules/sanitize-filename/index.js
+var require_sanitize_filename = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/sanitize-filename/1.6.4/5f553bde92425a76e0b51eddf2a9a22faa7626146298aecdcafaf8de748aa2e6/node_modules/sanitize-filename/index.js"(exports, module) {
+    "use strict";
+    var truncate = require_truncate_utf8_bytes();
+    var illegalRe = /[\/\?<>\\:\*\|"]/g;
+    var controlRe = /[\x00-\x1f\x80-\x9f]/g;
+    var reservedRe = /^\.+$/;
+    var windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i;
+    function replaceTrailingDotsAndSpaces(str, replacement) {
+      var end = str.length;
+      while (end > 0 && (str[end - 1] === "." || str[end - 1] === " ")) end--;
+      return end < str.length ? str.slice(0, end) + replacement : str;
+    }
+    function sanitize(input, replacement) {
+      if (typeof input !== "string") {
+        throw new Error("Input must be string");
+      }
+      var sanitized = input.replace(illegalRe, replacement).replace(controlRe, replacement).replace(reservedRe, replacement).replace(windowsReservedRe, replacement);
+      sanitized = replaceTrailingDotsAndSpaces(sanitized, replacement);
+      return truncate(sanitized, 255);
+    }
+    module.exports = function(input, options) {
+      var replacement = options && options.replacement || "";
+      var output = sanitize(input, replacement);
+      if (replacement === "") {
+        return output;
+      }
+      return sanitize(output, "");
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/detect-libc/2.1.2/a1e36129e998f9971b8906296c04a9314f612077e4f1e2a4342793f735c2fb37/node_modules/detect-libc/lib/process.js
+var require_process = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/detect-libc/2.1.2/a1e36129e998f9971b8906296c04a9314f612077e4f1e2a4342793f735c2fb37/node_modules/detect-libc/lib/process.js"(exports, module) {
+    "use strict";
+    var isLinux = () => process.platform === "linux";
+    var report = null;
+    var getReport = () => {
+      if (!report) {
+        if (isLinux() && process.report) {
+          const orig = process.report.excludeNetwork;
+          process.report.excludeNetwork = true;
+          report = process.report.getReport();
+          process.report.excludeNetwork = orig;
+        } else {
+          report = {};
+        }
+      }
+      return report;
+    };
+    module.exports = { isLinux, getReport };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/detect-libc/2.1.2/a1e36129e998f9971b8906296c04a9314f612077e4f1e2a4342793f735c2fb37/node_modules/detect-libc/lib/filesystem.js
+var require_filesystem = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/detect-libc/2.1.2/a1e36129e998f9971b8906296c04a9314f612077e4f1e2a4342793f735c2fb37/node_modules/detect-libc/lib/filesystem.js"(exports, module) {
+    "use strict";
+    var fs13 = __require("fs");
+    var LDD_PATH = "/usr/bin/ldd";
+    var SELF_PATH = "/proc/self/exe";
+    var MAX_LENGTH = 2048;
+    var readFileSync = (path18) => {
+      const fd = fs13.openSync(path18, "r");
+      const buffer = Buffer.alloc(MAX_LENGTH);
+      const bytesRead = fs13.readSync(fd, buffer, 0, MAX_LENGTH, 0);
+      fs13.close(fd, () => {
+      });
+      return buffer.subarray(0, bytesRead);
+    };
+    var readFile = (path18) => new Promise((resolve, reject) => {
+      fs13.open(path18, "r", (err, fd) => {
+        if (err) {
+          reject(err);
+        } else {
+          const buffer = Buffer.alloc(MAX_LENGTH);
+          fs13.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
+            resolve(buffer.subarray(0, bytesRead));
+            fs13.close(fd, () => {
+            });
+          });
+        }
+      });
+    });
+    module.exports = {
+      LDD_PATH,
+      SELF_PATH,
+      readFileSync,
+      readFile
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/detect-libc/2.1.2/a1e36129e998f9971b8906296c04a9314f612077e4f1e2a4342793f735c2fb37/node_modules/detect-libc/lib/elf.js
+var require_elf = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/detect-libc/2.1.2/a1e36129e998f9971b8906296c04a9314f612077e4f1e2a4342793f735c2fb37/node_modules/detect-libc/lib/elf.js"(exports, module) {
+    "use strict";
+    var interpreterPath = (elf) => {
+      if (elf.length < 64) {
+        return null;
+      }
+      if (elf.readUInt32BE(0) !== 2135247942) {
+        return null;
+      }
+      if (elf.readUInt8(4) !== 2) {
+        return null;
+      }
+      if (elf.readUInt8(5) !== 1) {
+        return null;
+      }
+      const offset = elf.readUInt32LE(32);
+      const size = elf.readUInt16LE(54);
+      const count = elf.readUInt16LE(56);
+      for (let i = 0; i < count; i++) {
+        const headerOffset = offset + i * size;
+        const type = elf.readUInt32LE(headerOffset);
+        if (type === 3) {
+          const fileOffset = elf.readUInt32LE(headerOffset + 8);
+          const fileSize = elf.readUInt32LE(headerOffset + 32);
+          return elf.subarray(fileOffset, fileOffset + fileSize).toString().replace(/\0.*$/g, "");
+        }
+      }
+      return null;
+    };
+    module.exports = {
+      interpreterPath
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/detect-libc/2.1.2/a1e36129e998f9971b8906296c04a9314f612077e4f1e2a4342793f735c2fb37/node_modules/detect-libc/lib/detect-libc.js
+var require_detect_libc = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/detect-libc/2.1.2/a1e36129e998f9971b8906296c04a9314f612077e4f1e2a4342793f735c2fb37/node_modules/detect-libc/lib/detect-libc.js"(exports, module) {
+    "use strict";
+    var childProcess = __require("child_process");
+    var { isLinux, getReport } = require_process();
+    var { LDD_PATH, SELF_PATH, readFile, readFileSync } = require_filesystem();
+    var { interpreterPath } = require_elf();
+    var cachedFamilyInterpreter;
+    var cachedFamilyFilesystem;
+    var cachedVersionFilesystem;
+    var command = "getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true";
+    var commandOut = "";
+    var safeCommand = () => {
+      if (!commandOut) {
+        return new Promise((resolve) => {
+          childProcess.exec(command, (err, out) => {
+            commandOut = err ? " " : out;
+            resolve(commandOut);
+          });
+        });
+      }
+      return commandOut;
+    };
+    var safeCommandSync = () => {
+      if (!commandOut) {
+        try {
+          commandOut = childProcess.execSync(command, { encoding: "utf8" });
+        } catch (_err) {
+          commandOut = " ";
+        }
+      }
+      return commandOut;
+    };
+    var GLIBC = "glibc";
+    var RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i;
+    var MUSL = "musl";
+    var isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
+    var familyFromReport = () => {
+      const report = getReport();
+      if (report.header && report.header.glibcVersionRuntime) {
+        return GLIBC;
+      }
+      if (Array.isArray(report.sharedObjects)) {
+        if (report.sharedObjects.some(isFileMusl)) {
+          return MUSL;
+        }
+      }
+      return null;
+    };
+    var familyFromCommand = (out) => {
+      const [getconf, ldd1] = out.split(/[\r\n]+/);
+      if (getconf && getconf.includes(GLIBC)) {
+        return GLIBC;
+      }
+      if (ldd1 && ldd1.includes(MUSL)) {
+        return MUSL;
+      }
+      return null;
+    };
+    var familyFromInterpreterPath = (path18) => {
+      if (path18) {
+        if (path18.includes("/ld-musl-")) {
+          return MUSL;
+        } else if (path18.includes("/ld-linux-")) {
+          return GLIBC;
+        }
+      }
+      return null;
+    };
+    var getFamilyFromLddContent = (content) => {
+      content = content.toString();
+      if (content.includes("musl")) {
+        return MUSL;
+      }
+      if (content.includes("GNU C Library")) {
+        return GLIBC;
+      }
+      return null;
+    };
+    var familyFromFilesystem = async () => {
+      if (cachedFamilyFilesystem !== void 0) {
+        return cachedFamilyFilesystem;
+      }
+      cachedFamilyFilesystem = null;
+      try {
+        const lddContent = await readFile(LDD_PATH);
+        cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
+      } catch (e) {
+      }
+      return cachedFamilyFilesystem;
+    };
+    var familyFromFilesystemSync = () => {
+      if (cachedFamilyFilesystem !== void 0) {
+        return cachedFamilyFilesystem;
+      }
+      cachedFamilyFilesystem = null;
+      try {
+        const lddContent = readFileSync(LDD_PATH);
+        cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
+      } catch (e) {
+      }
+      return cachedFamilyFilesystem;
+    };
+    var familyFromInterpreter = async () => {
+      if (cachedFamilyInterpreter !== void 0) {
+        return cachedFamilyInterpreter;
+      }
+      cachedFamilyInterpreter = null;
+      try {
+        const selfContent = await readFile(SELF_PATH);
+        const path18 = interpreterPath(selfContent);
+        cachedFamilyInterpreter = familyFromInterpreterPath(path18);
+      } catch (e) {
+      }
+      return cachedFamilyInterpreter;
+    };
+    var familyFromInterpreterSync = () => {
+      if (cachedFamilyInterpreter !== void 0) {
+        return cachedFamilyInterpreter;
+      }
+      cachedFamilyInterpreter = null;
+      try {
+        const selfContent = readFileSync(SELF_PATH);
+        const path18 = interpreterPath(selfContent);
+        cachedFamilyInterpreter = familyFromInterpreterPath(path18);
+      } catch (e) {
+      }
+      return cachedFamilyInterpreter;
+    };
+    var family = async () => {
+      let family2 = null;
+      if (isLinux()) {
+        family2 = await familyFromInterpreter();
+        if (!family2) {
+          family2 = await familyFromFilesystem();
+          if (!family2) {
+            family2 = familyFromReport();
+          }
+          if (!family2) {
+            const out = await safeCommand();
+            family2 = familyFromCommand(out);
+          }
+        }
+      }
+      return family2;
+    };
+    var familySync = () => {
+      let family2 = null;
+      if (isLinux()) {
+        family2 = familyFromInterpreterSync();
+        if (!family2) {
+          family2 = familyFromFilesystemSync();
+          if (!family2) {
+            family2 = familyFromReport();
+          }
+          if (!family2) {
+            const out = safeCommandSync();
+            family2 = familyFromCommand(out);
+          }
+        }
+      }
+      return family2;
+    };
+    var isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC;
+    var isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC;
+    var versionFromFilesystem = async () => {
+      if (cachedVersionFilesystem !== void 0) {
+        return cachedVersionFilesystem;
+      }
+      cachedVersionFilesystem = null;
+      try {
+        const lddContent = await readFile(LDD_PATH);
+        const versionMatch = lddContent.match(RE_GLIBC_VERSION);
+        if (versionMatch) {
+          cachedVersionFilesystem = versionMatch[1];
+        }
+      } catch (e) {
+      }
+      return cachedVersionFilesystem;
+    };
+    var versionFromFilesystemSync = () => {
+      if (cachedVersionFilesystem !== void 0) {
+        return cachedVersionFilesystem;
+      }
+      cachedVersionFilesystem = null;
+      try {
+        const lddContent = readFileSync(LDD_PATH);
+        const versionMatch = lddContent.match(RE_GLIBC_VERSION);
+        if (versionMatch) {
+          cachedVersionFilesystem = versionMatch[1];
+        }
+      } catch (e) {
+      }
+      return cachedVersionFilesystem;
+    };
+    var versionFromReport = () => {
+      const report = getReport();
+      if (report.header && report.header.glibcVersionRuntime) {
+        return report.header.glibcVersionRuntime;
+      }
+      return null;
+    };
+    var versionSuffix = (s) => s.trim().split(/\s+/)[1];
+    var versionFromCommand = (out) => {
+      const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/);
+      if (getconf && getconf.includes(GLIBC)) {
+        return versionSuffix(getconf);
+      }
+      if (ldd1 && ldd2 && ldd1.includes(MUSL)) {
+        return versionSuffix(ldd2);
+      }
+      return null;
+    };
+    var version = async () => {
+      let version2 = null;
+      if (isLinux()) {
+        version2 = await versionFromFilesystem();
+        if (!version2) {
+          version2 = versionFromReport();
+        }
+        if (!version2) {
+          const out = await safeCommand();
+          version2 = versionFromCommand(out);
+        }
+      }
+      return version2;
+    };
+    var versionSync = () => {
+      let version2 = null;
+      if (isLinux()) {
+        version2 = versionFromFilesystemSync();
+        if (!version2) {
+          version2 = versionFromReport();
+        }
+        if (!version2) {
+          const out = safeCommandSync();
+          version2 = versionFromCommand(out);
+        }
+      }
+      return version2;
+    };
+    module.exports = {
+      GLIBC,
+      MUSL,
+      family,
+      familySync,
+      isNonGlibcLinux,
+      isNonGlibcLinuxSync,
+      version,
+      versionSync
+    };
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/node-gyp-build-optional-packages/5.2.2/e2d2fc28f4d0eaa7fac1904123db86f87839f4cdd1ffc0e2b124adc9c1d9f616/node_modules/node-gyp-build-optional-packages/node-gyp-build.js
+var require_node_gyp_build = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/node-gyp-build-optional-packages/5.2.2/e2d2fc28f4d0eaa7fac1904123db86f87839f4cdd1ffc0e2b124adc9c1d9f616/node_modules/node-gyp-build-optional-packages/node-gyp-build.js"(exports, module) {
+    var fs13 = __require("fs");
+    var path18 = __require("path");
+    var url = __require("url");
+    var os = __require("os");
+    var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
+    var vars = process.config && process.config.variables || {};
+    var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
+    var versions = process.versions;
+    var abi = versions.modules;
+    if (versions.deno || process.isBun) {
+      abi = "unsupported";
+    }
+    var runtime = isElectron() ? "electron" : isNwjs() ? "node-webkit" : "node";
+    var arch = process.env.npm_config_arch || os.arch();
+    var platform = process.env.npm_config_platform || os.platform();
+    var libc = process.env.LIBC || (isMusl(platform) ? "musl" : "glibc");
+    var armv = process.env.ARM_VERSION || (arch === "arm64" ? "8" : vars.arm_version) || "";
+    var uv = (versions.uv || "").split(".")[0];
+    module.exports = load;
+    function load(dir) {
+      return runtimeRequire(load.resolve(dir));
+    }
+    load.resolve = load.path = function(dir) {
+      dir = path18.resolve(dir || ".");
+      var packageName = "";
+      var packageNameError;
+      try {
+        packageName = runtimeRequire(path18.join(dir, "package.json")).name;
+        var varName = packageName.toUpperCase().replace(/-/g, "_");
+        if (process.env[varName + "_PREBUILD"]) dir = process.env[varName + "_PREBUILD"];
+      } catch (err) {
+        packageNameError = err;
+      }
+      if (!prebuildsOnly) {
+        var release = getFirst(path18.join(dir, "build/Release"), matchBuild);
+        if (release) return release;
+        var debug = getFirst(path18.join(dir, "build/Debug"), matchBuild);
+        if (debug) return debug;
+      }
+      var prebuild = resolve(dir);
+      if (prebuild) return prebuild;
+      var nearby = resolve(path18.dirname(process.execPath));
+      if (nearby) return nearby;
+      var platformPackage = (packageName[0] == "@" ? "" : "@" + packageName + "/") + packageName + "-" + platform + "-" + arch;
+      var packageResolutionError;
+      try {
+        var prebuildPackage = path18.dirname(__require("module").createRequire(url.pathToFileURL(path18.join(dir, "package.json"))).resolve(platformPackage));
+        return resolveFile(prebuildPackage);
+      } catch (error) {
+        packageResolutionError = error;
+      }
+      var target2 = [
+        "platform=" + platform,
+        "arch=" + arch,
+        "runtime=" + runtime,
+        "abi=" + abi,
+        "uv=" + uv,
+        armv ? "armv=" + armv : "",
+        "libc=" + libc,
+        "node=" + process.versions.node,
+        process.versions.electron ? "electron=" + process.versions.electron : "",
+        typeof __webpack_require__ === "function" ? "webpack=true" : ""
+        // eslint-disable-line
+      ].filter(Boolean).join(" ");
+      let errMessage = "No native build was found for " + target2 + "\n    attempted loading from: " + dir + " and package: " + platformPackage + "\n";
+      if (packageNameError) {
+        errMessage += "Error finding package.json: " + packageNameError.message + "\n";
+      }
+      if (packageResolutionError) {
+        errMessage += "Error resolving package: " + packageResolutionError.message + "\n";
+      }
+      throw new Error(errMessage);
+      function resolve(dir2) {
+        var tuples = readdirSync(path18.join(dir2, "prebuilds")).map(parseTuple);
+        var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
+        if (!tuple) return;
+        return resolveFile(path18.join(dir2, "prebuilds", tuple.name));
+      }
+      function resolveFile(prebuilds) {
+        var parsed = readdirSync(prebuilds).map(parseTags);
+        var candidates = parsed.filter(matchTags(runtime, abi));
+        var winner = candidates.sort(compareTags(runtime))[0];
+        if (winner) return path18.join(prebuilds, winner.file);
+      }
+    };
+    function readdirSync(dir) {
+      try {
+        return fs13.readdirSync(dir);
+      } catch (err) {
+        return [];
+      }
+    }
+    function getFirst(dir, filter) {
+      var files = readdirSync(dir).filter(filter);
+      return files[0] && path18.join(dir, files[0]);
+    }
+    function matchBuild(name) {
+      return /\.node$/.test(name);
+    }
+    function parseTuple(name) {
+      var arr = name.split("-");
+      if (arr.length !== 2) return;
+      var platform2 = arr[0];
+      var architectures = arr[1].split("+");
+      if (!platform2) return;
+      if (!architectures.length) return;
+      if (!architectures.every(Boolean)) return;
+      return { name, platform: platform2, architectures };
+    }
+    function matchTuple(platform2, arch2) {
+      return function(tuple) {
+        if (tuple == null) return false;
+        if (tuple.platform !== platform2) return false;
+        return tuple.architectures.includes(arch2);
+      };
+    }
+    function compareTuples(a, b) {
+      return a.architectures.length - b.architectures.length;
+    }
+    function parseTags(file) {
+      var arr = file.split(".");
+      var extension = arr.pop();
+      var tags = { file, specificity: 0 };
+      if (extension !== "node") return;
+      for (var i = 0; i < arr.length; i++) {
+        var tag = arr[i];
+        if (tag === "node" || tag === "electron" || tag === "node-webkit") {
+          tags.runtime = tag;
+        } else if (tag === "napi") {
+          tags.napi = true;
+        } else if (tag.slice(0, 3) === "abi") {
+          tags.abi = tag.slice(3);
+        } else if (tag.slice(0, 2) === "uv") {
+          tags.uv = tag.slice(2);
+        } else if (tag.slice(0, 4) === "armv") {
+          tags.armv = tag.slice(4);
+        } else if (tag === "glibc" || tag === "musl") {
+          tags.libc = tag;
+        } else {
+          continue;
+        }
+        tags.specificity++;
+      }
+      return tags;
+    }
+    function matchTags(runtime2, abi2) {
+      return function(tags) {
+        if (tags == null) return false;
+        if (tags.runtime !== runtime2 && !runtimeAgnostic(tags)) return false;
+        if (tags.abi !== abi2 && !tags.napi) return false;
+        if (tags.uv && tags.uv !== uv) return false;
+        if (tags.armv && tags.armv !== armv) return false;
+        if (tags.libc && tags.libc !== libc) return false;
+        return true;
+      };
+    }
+    function runtimeAgnostic(tags) {
+      return tags.runtime === "node" && tags.napi;
+    }
+    function compareTags(runtime2) {
+      return function(a, b) {
+        if (a.runtime !== b.runtime) {
+          return a.runtime === runtime2 ? -1 : 1;
+        } else if (a.abi !== b.abi) {
+          return a.abi ? -1 : 1;
+        } else if (a.specificity !== b.specificity) {
+          return a.specificity > b.specificity ? -1 : 1;
+        } else {
+          return 0;
+        }
+      };
+    }
+    function isNwjs() {
+      return !!(process.versions && process.versions.nw);
+    }
+    function isElectron() {
+      if (process.versions && process.versions.electron) return true;
+      if (process.env.ELECTRON_RUN_AS_NODE) return true;
+      return typeof window !== "undefined" && window.process && window.process.type === "renderer";
+    }
+    function isMusl(platform2) {
+      if (platform2 !== "linux") return false;
+      const { familySync, MUSL } = require_detect_libc();
+      return familySync() === MUSL;
+    }
+    load.parseTags = parseTags;
+    load.matchTags = matchTags;
+    load.compareTags = compareTags;
+    load.parseTuple = parseTuple;
+    load.matchTuple = matchTuple;
+    load.compareTuples = compareTuples;
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/node-gyp-build-optional-packages/5.2.2/e2d2fc28f4d0eaa7fac1904123db86f87839f4cdd1ffc0e2b124adc9c1d9f616/node_modules/node-gyp-build-optional-packages/index.js
+var require_node_gyp_build_optional_packages = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/node-gyp-build-optional-packages/5.2.2/e2d2fc28f4d0eaa7fac1904123db86f87839f4cdd1ffc0e2b124adc9c1d9f616/node_modules/node-gyp-build-optional-packages/index.js"(exports, module) {
+    var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
+    if (typeof runtimeRequire.addon === "function") {
+      module.exports = runtimeRequire.addon.bind(runtimeRequire);
+    } else {
+      module.exports = require_node_gyp_build();
+    }
+  }
+});
+
+// ../../../../../setup-pnpm/store/v11/links/@/msgpackr-extract/3.0.4/5f2fa3b3518dffb11d9500f22a2d0750c582db5a973c2486eb1a697b6439d322/node_modules/msgpackr-extract/index.js
+var require_msgpackr_extract = __commonJS({
+  "../../../../../setup-pnpm/store/v11/links/@/msgpackr-extract/3.0.4/5f2fa3b3518dffb11d9500f22a2d0750c582db5a973c2486eb1a697b6439d322/node_modules/msgpackr-extract/index.js"(exports, module) {
+    module.exports = require_node_gyp_build_optional_packages()(__dirname);
+  }
+});
+
+// ../worker/lib/start.js
+import crypto5 from "node:crypto";
+import fs12 from "node:fs";
+import path17 from "node:path";
+import util8 from "node:util";
+import { parentPort } from "node:worker_threads";
+
+// ../building/pkg-requires-build/lib/index.js
+function pkgRequiresBuild(manifest, filesIndex) {
+  return Boolean(manifest?.scripts != null && (Boolean(manifest.scripts.preinstall) || Boolean(manifest.scripts.install) || Boolean(manifest.scripts.postinstall)) || filesIncludeInstallScripts(filesIndex));
+}
+function filesIncludeInstallScripts(filesIndex) {
+  const keys = filesIndex instanceof Map ? filesIndex.keys() : Object.keys(filesIndex);
+  for (const filename of keys) {
+    if (filename === "binding.gyp") {
+      return true;
+    }
+    if (filename.match(/^\.hooks[\\/]/) != null) {
+      return true;
+    }
+  }
+  return false;
+}
+
+// ../core/constants/lib/index.js
+var LOCKFILE_MAJOR_VERSION = "9";
+var LOCKFILE_VERSION = `${LOCKFILE_MAJOR_VERSION}.0`;
+var ENGINE_NAME = `${process.platform};${process.arch};node${process.version.split(".")[0].substring(1)}`;
+var BUILTIN_NAMED_REGISTRIES = Object.freeze({
+  gh: "https://npm.pkg.github.com/",
+  npmjs: "https://registry.npmjs.org/"
+});
+
+// ../core/error/lib/index.js
+var PnpmError = class extends Error {
+  code;
+  hint;
+  attempts;
+  prefix;
+  pkgsStack;
+  constructor(code, message, opts2) {
+    super(message, { cause: opts2?.cause });
+    this.code = code.startsWith("ERR_PNPM_") ? code : `ERR_PNPM_${code}`;
+    this.hint = opts2?.hint;
+    this.attempts = opts2?.attempts;
+  }
+};
+
+// ../crypto/integrity/lib/index.js
+var INTEGRITY_REGEX = /^([^-]+)-([a-z0-9+/=]+)$/i;
+function parseIntegrity(integrity) {
+  const match = integrity.match(INTEGRITY_REGEX);
+  if (!match) {
+    throw new PnpmError("INVALID_INTEGRITY", `Invalid integrity format: expected "algo-base64hash", got "${integrity}"`);
+  }
+  const hexDigest = Buffer.from(match[2], "base64").toString("hex");
+  if (hexDigest.length === 0) {
+    throw new PnpmError("INVALID_INTEGRITY", "Invalid integrity: base64 hash decoded to empty digest");
+  }
+  return { algorithm: match[1], hexDigest };
+}
+function formatIntegrity(algorithm, hexDigest) {
+  return `${algorithm}-${Buffer.from(hexDigest, "hex").toString("base64")}`;
+}
+
+// ../fs/hard-link-dir/lib/index.js
+import assert from "node:assert";
+import fs3 from "node:fs";
+import path3 from "node:path";
+import util2 from "node:util";
+
+// ../fs/graceful-fs/lib/index.js
+var import_graceful_fs = __toESM(require_graceful_fs(), 1);
+import util, { promisify } from "node:util";
+var lib_default = {
+  chmod: promisify(import_graceful_fs.default.chmod),
+  copyFile: promisify(import_graceful_fs.default.copyFile),
+  copyFileSync: withEagainRetry(import_graceful_fs.default.copyFileSync),
+  createReadStream: import_graceful_fs.default.createReadStream,
+  link: promisify(import_graceful_fs.default.link),
+  linkSync: withEagainRetry(import_graceful_fs.default.linkSync),
+  mkdir: promisify(import_graceful_fs.default.mkdir),
+  mkdirSync: withEagainRetry(import_graceful_fs.default.mkdirSync),
+  renameSync: withEagainRetry(import_graceful_fs.default.renameSync),
+  readFile: promisify(import_graceful_fs.default.readFile),
+  readFileSync: import_graceful_fs.default.readFileSync,
+  readdirSync: import_graceful_fs.default.readdirSync,
+  stat: promisify(import_graceful_fs.default.stat),
+  statSync: import_graceful_fs.default.statSync,
+  unlink: promisify(import_graceful_fs.default.unlink),
+  unlinkSync: import_graceful_fs.default.unlinkSync,
+  writeFile: promisify(import_graceful_fs.default.writeFile),
+  writeFileSync: withEagainRetry(import_graceful_fs.default.writeFileSync)
+};
+function withEagainRetry(fn, maxRetries = 15) {
+  return (...args) => {
+    let attempts = 0;
+    while (attempts <= maxRetries) {
+      try {
+        return fn(...args);
+      } catch (err) {
+        if (util.types.isNativeError(err) && "code" in err && err.code === "EAGAIN" && attempts < maxRetries) {
+          attempts++;
+          const delay = Math.min(Math.pow(2, attempts), 300);
+          Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, delay);
+          continue;
+        }
+        throw err;
+      }
+    }
+    throw new Error("Unreachable");
+  };
+}
+
+// ../core/logger/lib/logger.js
+var import_bole = __toESM(require_bole(), 1);
+import_bole.default.setFastTime();
+var logger = (0, import_bole.default)("pnpm");
+var globalLogger = (0, import_bole.default)("pnpm:global");
+function globalWarn(message) {
+  globalLogger.warn(message);
+}
+function globalInfo(message) {
+  globalLogger.info(message);
+}
+
+// ../core/logger/lib/streamParser.js
+var import_bole2 = __toESM(require_bole(), 1);
+
+// ../core/logger/lib/ndjsonParse.js
+var import_split2 = __toESM(require_split2(), 1);
+var opts = { strict: true };
+function parse() {
+  function parseRow(row) {
+    try {
+      if (row)
+        return JSON.parse(row);
+    } catch (_e) {
+      if (opts.strict) {
+        this.emit("error", new Error(`Could not parse row "${row.length > 50 ? `${row.slice(0, 50)}...` : row}"`));
+      }
+    }
+  }
+  return (0, import_split2.default)(parseRow, opts);
+}
+
+// ../core/logger/lib/streamParser.js
+var streamParser = createStreamParser();
+function createStreamParser() {
+  const sp = parse();
+  import_bole2.default.output([
+    {
+      level: "debug",
+      stream: sp
+    }
+  ]);
+  return sp;
+}
+
+// ../core/logger/lib/writeToConsole.js
+var import_bole3 = __toESM(require_bole(), 1);
+
+// ../../../../../setup-pnpm/store/v11/links/@/path-temp/3.0.0/8b4b1aa7fd55674c92bd1b76de62ec746ab9b416377d8b2ecb6a51c4d56db367/node_modules/path-temp/index.js
+import path from "node:path";
+
+// ../../../../../setup-pnpm/store/v11/links/@/crypto-random-string/4.0.0/62825d7a2c34eedb81d0d583bb2f53f6aba7872f7f7458f24e1bf78c432f86ed/node_modules/crypto-random-string/index.js
+import { promisify as promisify2 } from "util";
+import crypto from "crypto";
+var randomBytesAsync = promisify2(crypto.randomBytes);
+var urlSafeCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split("");
+var numericCharacters = "0123456789".split("");
+var distinguishableCharacters = "CDEHKMPRTUWXY012458".split("");
+var asciiPrintableCharacters = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~".split("");
+var alphanumericCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split("");
+var generateForCustomCharacters = (length, characters) => {
+  const characterCount = characters.length;
+  const maxValidSelector = Math.floor(65536 / characterCount) * characterCount - 1;
+  const entropyLength = 2 * Math.ceil(1.1 * length);
+  let string = "";
+  let stringLength = 0;
+  while (stringLength < length) {
+    const entropy = crypto.randomBytes(entropyLength);
+    let entropyPosition = 0;
+    while (entropyPosition < entropyLength && stringLength < length) {
+      const entropyValue = entropy.readUInt16LE(entropyPosition);
+      entropyPosition += 2;
+      if (entropyValue > maxValidSelector) {
+        continue;
+      }
+      string += characters[entropyValue % characterCount];
+      stringLength++;
+    }
+  }
+  return string;
+};
+var generateForCustomCharactersAsync = async (length, characters) => {
+  const characterCount = characters.length;
+  const maxValidSelector = Math.floor(65536 / characterCount) * characterCount - 1;
+  const entropyLength = 2 * Math.ceil(1.1 * length);
+  let string = "";
+  let stringLength = 0;
+  while (stringLength < length) {
+    const entropy = await randomBytesAsync(entropyLength);
+    let entropyPosition = 0;
+    while (entropyPosition < entropyLength && stringLength < length) {
+      const entropyValue = entropy.readUInt16LE(entropyPosition);
+      entropyPosition += 2;
+      if (entropyValue > maxValidSelector) {
+        continue;
+      }
+      string += characters[entropyValue % characterCount];
+      stringLength++;
+    }
+  }
+  return string;
+};
+var generateRandomBytes = (byteLength, type, length) => crypto.randomBytes(byteLength).toString(type).slice(0, length);
+var generateRandomBytesAsync = async (byteLength, type, length) => {
+  const buffer = await randomBytesAsync(byteLength);
+  return buffer.toString(type).slice(0, length);
+};
+var allowedTypes = /* @__PURE__ */ new Set([
+  void 0,
+  "hex",
+  "base64",
+  "url-safe",
+  "numeric",
+  "distinguishable",
+  "ascii-printable",
+  "alphanumeric"
+]);
+var createGenerator = (generateForCustomCharacters2, generateRandomBytes2) => ({ length, type, characters }) => {
+  if (!(length >= 0 && Number.isFinite(length))) {
+    throw new TypeError("Expected a `length` to be a non-negative finite number");
+  }
+  if (type !== void 0 && characters !== void 0) {
+    throw new TypeError("Expected either `type` or `characters`");
+  }
+  if (characters !== void 0 && typeof characters !== "string") {
+    throw new TypeError("Expected `characters` to be string");
+  }
+  if (!allowedTypes.has(type)) {
+    throw new TypeError(`Unknown type: ${type}`);
+  }
+  if (type === void 0 && characters === void 0) {
+    type = "hex";
+  }
+  if (type === "hex" || type === void 0 && characters === void 0) {
+    return generateRandomBytes2(Math.ceil(length * 0.5), "hex", length);
+  }
+  if (type === "base64") {
+    return generateRandomBytes2(Math.ceil(length * 0.75), "base64", length);
+  }
+  if (type === "url-safe") {
+    return generateForCustomCharacters2(length, urlSafeCharacters);
+  }
+  if (type === "numeric") {
+    return generateForCustomCharacters2(length, numericCharacters);
+  }
+  if (type === "distinguishable") {
+    return generateForCustomCharacters2(length, distinguishableCharacters);
+  }
+  if (type === "ascii-printable") {
+    return generateForCustomCharacters2(length, asciiPrintableCharacters);
+  }
+  if (type === "alphanumeric") {
+    return generateForCustomCharacters2(length, alphanumericCharacters);
+  }
+  if (characters.length === 0) {
+    throw new TypeError("Expected `characters` string length to be greater than or equal to 1");
+  }
+  if (characters.length > 65536) {
+    throw new TypeError("Expected `characters` string length to be less or equal to 65536");
+  }
+  return generateForCustomCharacters2(length, characters.split(""));
+};
+var cryptoRandomString = createGenerator(generateForCustomCharacters, generateRandomBytes);
+cryptoRandomString.async = createGenerator(generateForCustomCharactersAsync, generateRandomBytesAsync);
+var crypto_random_string_default = cryptoRandomString;
+
+// ../../../../../setup-pnpm/store/v11/links/@/unique-string/3.0.0/a866cc9b5c54cfdb51fd873a65f819a8cf9cedf7f734bec6917212cc97bd4e56/node_modules/unique-string/index.js
+function uniqueString() {
+  return crypto_random_string_default({ length: 32 });
+}
+
+// ../../../../../setup-pnpm/store/v11/links/@/path-temp/3.0.0/8b4b1aa7fd55674c92bd1b76de62ec746ab9b416377d8b2ecb6a51c4d56db367/node_modules/path-temp/index.js
+import { threadId } from "node:worker_threads";
+function pathTemp(folder) {
+  return path.join(folder, `_tmp_${process.pid}_${uniqueString()}`);
+}
+function fastPathTemp(file) {
+  return path.join(path.dirname(file), `${path.basename(file)}_tmp_${process.pid}_${threadId}`);
+}
+
+// ../../../../../setup-pnpm/store/v11/links/@/rename-overwrite/7.0.1/87428b418e43a94bf7c7f463bfc62ae5e0dc2e0a72cb36b94d07cf207fc3347b/node_modules/rename-overwrite/index.js
+var import_fs_extra = __toESM(require_lib(), 1);
+import crypto2 from "node:crypto";
+import fs2 from "node:fs";
+import path2 from "node:path";
+
+// ../../../../../setup-pnpm/store/v11/links/@zkochan/rimraf/4.0.0/e7aeecc18d1d120ecda04415cbe146a0ad1e4d158a9823e79bfdce5ee3173719/node_modules/@zkochan/rimraf/index.js
+import fs from "node:fs";
+function rimrafSync(p) {
+  try {
+    fs.rmSync(p, { recursive: true, force: true, maxRetries: 3 });
+  } catch (err) {
+    if (err.code === "ENOENT") return;
+    throw err;
+  }
+}
+
+// ../../../../../setup-pnpm/store/v11/links/@/rename-overwrite/7.0.1/87428b418e43a94bf7c7f463bfc62ae5e0dc2e0a72cb36b94d07cf207fc3347b/node_modules/rename-overwrite/index.js
+var { copySync, copy } = import_fs_extra.default;
+function renameOverwriteSync(oldPath, newPath, retry = 0) {
+  try {
+    fs2.renameSync(oldPath, newPath);
+  } catch (err) {
+    retry++;
+    if (retry > 3) throw err;
+    switch (err.code) {
+      // Windows Antivirus issues
+      case "EPERM":
+      case "EACCESS":
+      case "EBUSY": {
+        try {
+          rimrafSync(newPath);
+        } catch {
+        }
+        const start = Date.now();
+        let backoff = 0;
+        let lastError = err;
+        while (Date.now() - start < 6e4 && (lastError.code === "EPERM" || lastError.code === "EACCESS" || lastError.code === "EBUSY")) {
+          const waitUntil = Date.now() + backoff;
+          while (waitUntil > Date.now()) {
+          }
+          try {
+            fs2.renameSync(oldPath, newPath);
+            return;
+          } catch (err2) {
+            lastError = err2;
+          }
+          if (backoff < 100) {
+            backoff += 10;
+          }
+        }
+        throw lastError;
+      }
+      case "ENOTEMPTY":
+      case "EEXIST":
+      case "ENOTDIR":
+        try {
+          swapRenameSync(oldPath, newPath);
+        } catch {
+          rimrafSync(newPath);
+          fs2.renameSync(oldPath, newPath);
+        }
+        break;
+      case "ENOENT":
+        fs2.mkdirSync(path2.dirname(newPath), { recursive: true });
+        renameOverwriteSync(oldPath, newPath, retry);
+        return;
+      // Crossing filesystem boundaries so rename is not available
+      case "EXDEV":
+        try {
+          rimrafSync(newPath);
+        } catch (rimrafErr) {
+          if (rimrafErr.code !== "ENOENT") {
+            throw rimrafErr;
+          }
+        }
+        copySync(oldPath, newPath);
+        rimrafSync(oldPath);
+        break;
+      default:
+        throw err;
+    }
+  }
+}
+function tempPath(p) {
+  return `${p}_${process.pid.toString(16)}_${crypto2.randomBytes(4).toString("hex")}`;
+}
+function swapRenameSync(oldPath, newPath) {
+  const temp = tempPath(newPath);
+  fs2.renameSync(newPath, temp);
+  try {
+    fs2.renameSync(oldPath, newPath);
+  } catch (err) {
+    try {
+      fs2.renameSync(temp, newPath);
+    } catch {
+    }
+    throw err;
+  }
+  try {
+    rimrafSync(temp);
+  } catch {
+  }
+}
+
+// ../fs/hard-link-dir/lib/index.js
+function hardLinkDir(src2, destDirs) {
+  if (destDirs.length === 0)
+    return;
+  const filteredDestDirs = [];
+  const tempDestDirs = [];
+  for (const destDir of destDirs) {
+    if (path3.relative(destDir, src2) === "") {
+      continue;
+    }
+    filteredDestDirs.push(destDir);
+    tempDestDirs.push(pathTemp(path3.dirname(destDir)));
+  }
+  _hardLinkDir(src2, tempDestDirs, true);
+  for (let i = 0; i < filteredDestDirs.length; i++) {
+    renameOverwriteSync(tempDestDirs[i], filteredDestDirs[i]);
+  }
+}
+function _hardLinkDir(src2, destDirs, isRoot) {
+  let files = [];
+  try {
+    files = fs3.readdirSync(src2);
+  } catch (err) {
+    if (!isRoot || !(util2.types.isNativeError(err) && "code" in err && err.code === "ENOENT"))
+      throw err;
+    globalWarn(`Source directory not found when creating hardLinks for: ${src2}. Creating destinations as empty: ${destDirs.join(", ")}`);
+    for (const dir of destDirs) {
+      lib_default.mkdirSync(dir, { recursive: true });
+    }
+    return;
+  }
+  for (const file of files) {
+    if (file === "node_modules")
+      continue;
+    const srcFile = path3.join(src2, file);
+    if (fs3.lstatSync(srcFile).isDirectory()) {
+      const destSubdirs = destDirs.map((destDir) => {
+        const destSubdir = path3.join(destDir, file);
+        try {
+          lib_default.mkdirSync(destSubdir, { recursive: true });
+        } catch (err) {
+          if (!(util2.types.isNativeError(err) && "code" in err && err.code === "EEXIST"))
+            throw err;
+        }
+        return destSubdir;
+      });
+      _hardLinkDir(srcFile, destSubdirs);
+      continue;
+    }
+    for (const destDir of destDirs) {
+      const destFile = path3.join(destDir, file);
+      try {
+        linkOrCopyFile(srcFile, destFile);
+      } catch (err) {
+        if (util2.types.isNativeError(err) && "code" in err && err.code === "ENOENT") {
+          continue;
+        }
+        throw err;
+      }
+    }
+  }
+}
+function linkOrCopyFile(srcFile, destFile) {
+  try {
+    linkOrCopy(srcFile, destFile);
+  } catch (err) {
+    assert(util2.types.isNativeError(err));
+    if ("code" in err && err.code === "ENOENT") {
+      lib_default.mkdirSync(path3.dirname(destFile), { recursive: true });
+      linkOrCopy(srcFile, destFile);
+      return;
+    }
+    if (!("code" in err && err.code === "EEXIST")) {
+      throw err;
+    }
+  }
+}
+function linkOrCopy(srcFile, destFile) {
+  try {
+    lib_default.linkSync(srcFile, destFile);
+  } catch (err) {
+    if (util2.types.isNativeError(err) && "code" in err && (err.code === "EXDEV" || err.code === "ENOENT")) {
+      lib_default.copyFileSync(srcFile, destFile);
+    } else {
+      throw err;
+    }
+  }
+}
+
+// ../core/core-loggers/lib/contextLogger.js
+var contextLogger = logger("context");
+
+// ../core/core-loggers/lib/deprecationLogger.js
+var deprecationLogger = logger("deprecation");
+
+// ../core/core-loggers/lib/executionTimeLogger.js
+var executionTimeLogger = logger("execution-time");
+
+// ../core/core-loggers/lib/fetchingProgressLogger.js
+var fetchingProgressLogger = logger("fetching-progress");
+
+// ../core/core-loggers/lib/hookLogger.js
+var hookLogger = logger("hook");
+
+// ../core/core-loggers/lib/ignoredScriptsLogger.js
+var ignoredScriptsLogger = logger("ignored-scripts");
+
+// ../core/core-loggers/lib/installCheckLogger.js
+var installCheckLogger = logger("install-check");
+
+// ../core/core-loggers/lib/installingConfigDeps.js
+var installingConfigDepsLogger = logger("installing-config-deps");
+
+// ../core/core-loggers/lib/lifecycleLogger.js
+var lifecycleLogger = logger("lifecycle");
+
+// ../core/core-loggers/lib/linkLogger.js
+var linkLogger = logger("link");
+
+// ../core/core-loggers/lib/lockfileVerificationLogger.js
+var lockfileVerificationLogger = logger("lockfile-verification");
+
+// ../core/core-loggers/lib/packageImportMethodLogger.js
+var packageImportMethodLogger = logger("package-import-method");
+
+// ../core/core-loggers/lib/packageManifestLogger.js
+var packageManifestLogger = logger("package-manifest");
+
+// ../core/core-loggers/lib/peerDependencyIssues.js
+var peerDependencyIssuesLogger = logger("peer-dependency-issues");
+
+// ../core/core-loggers/lib/progressLogger.js
+var progressLogger = logger("progress");
+
+// ../core/core-loggers/lib/promptLogger.js
+var promptLogger = logger("prompt");
+
+// ../core/core-loggers/lib/removalLogger.js
+var removalLogger = logger("removal");
+
+// ../core/core-loggers/lib/requestRetryLogger.js
+var requestRetryLogger = logger("request-retry");
+
+// ../core/core-loggers/lib/rootLogger.js
+var rootLogger = logger("root");
+
+// ../core/core-loggers/lib/scopeLogger.js
+var scopeLogger = logger("scope");
+
+// ../core/core-loggers/lib/skippedOptionalDependencyLogger.js
+var skippedOptionalDependencyLogger = logger("skipped-optional-dependency");
+
+// ../core/core-loggers/lib/stageLogger.js
+var stageLogger = logger("stage");
+
+// ../core/core-loggers/lib/statsLogger.js
+var statsLogger = logger("stats");
+
+// ../core/core-loggers/lib/summaryLogger.js
+var summaryLogger = logger("summary");
+
+// ../core/core-loggers/lib/updateCheckLogger.js
+var updateCheckLogger = logger("update-check");
+
+// ../../../../../setup-pnpm/store/v11/links/@/better-path-resolve/2.0.0/e066f8a0a157777f698ec4707dc0026edc830ea8827eeb29a3d32906ea207d48/node_modules/better-path-resolve/index.js
+var import_is_windows = __toESM(require_is_windows(), 1);
+import path4 from "node:path";
+var betterPathResolve = (0, import_is_windows.default)() ? winResolve : path4.resolve;
+function winResolve(p) {
+  if (arguments.length === 0) return path4.resolve();
+  if (typeof p !== "string") {
+    return path4.resolve(p);
+  }
+  if (p[1] === ":") {
+    const cc = p[0].charCodeAt();
+    if (cc < 65 || cc > 90) {
+      p = `${p[0].toUpperCase()}${p.substr(1)}`;
+    }
+  }
+  if (p.endsWith(":")) {
+    return p;
+  }
+  return path4.resolve(p);
+}
+
+// ../../../../../setup-pnpm/store/v11/links/@/symlink-dir/10.0.1/99651a995e6d76e095bc87316473b0e784f9c820abf21dbac80a697d2ae16c64/node_modules/symlink-dir/dist/index.js
+import { promises as fs4, symlinkSync, mkdirSync, readlinkSync, unlinkSync } from "fs";
+import { types } from "util";
+import pathLib from "path";
+var IS_WINDOWS = process.platform === "win32" || /^(msys|cygwin)$/.test(process.env.OSTYPE);
+function resolveSrcOnWinJunction(src2) {
+  return `${src2}\\`;
+}
+function resolveSrcOnTrueSymlink(src2, dest) {
+  return pathLib.relative(pathLib.dirname(dest), src2);
+}
+function symlinkDirSync(target2, path18, opts2) {
+  path18 = betterPathResolve(path18);
+  target2 = betterPathResolve(target2);
+  if (target2 === path18)
+    throw new Error(`Symlink path is the same as the target path (${target2})`);
+  return forceSymlinkSync(target2, path18, opts2);
+}
+function isExistingSymlinkUpToDate(wantedTarget, path18, linkString) {
+  const existingTarget = pathLib.isAbsolute(linkString) ? linkString : pathLib.join(pathLib.dirname(path18), linkString);
+  return pathLib.relative(wantedTarget, existingTarget) === "";
+}
+var createSymlinkAsync;
+var createSymlinkSync;
+if (IS_WINDOWS) {
+  createSymlinkAsync = async (target2, path18) => {
+    try {
+      await createTrueSymlinkAsync(target2, path18);
+      createSymlinkSync = createTrueSymlinkSync;
+      createSymlinkAsync = createTrueSymlinkAsync;
+    } catch (err) {
+      if (err.code === "EPERM") {
+        await createJunctionAsync(target2, path18);
+        createSymlinkSync = createJunctionSync;
+        createSymlinkAsync = createJunctionAsync;
+      } else {
+        throw err;
+      }
+    }
+  };
+  createSymlinkSync = (target2, path18) => {
+    try {
+      createTrueSymlinkSync(target2, path18);
+      createSymlinkSync = createTrueSymlinkSync;
+      createSymlinkAsync = createTrueSymlinkAsync;
+    } catch (err) {
+      if (err.code === "EPERM") {
+        createJunctionSync(target2, path18);
+        createSymlinkSync = createJunctionSync;
+        createSymlinkAsync = createJunctionAsync;
+      } else {
+        throw err;
+      }
+    }
+  };
+} else {
+  createSymlinkAsync = createTrueSymlinkAsync;
+  createSymlinkSync = createTrueSymlinkSync;
+}
+function createTrueSymlinkAsync(target2, path18) {
+  return fs4.symlink(resolveSrcOnTrueSymlink(target2, path18), path18, "dir");
+}
+function createTrueSymlinkSync(target2, path18) {
+  symlinkSync(resolveSrcOnTrueSymlink(target2, path18), path18, "dir");
+}
+function createJunctionAsync(target2, path18) {
+  return fs4.symlink(resolveSrcOnWinJunction(target2), path18, "junction");
+}
+function createJunctionSync(target2, path18) {
+  symlinkSync(resolveSrcOnWinJunction(target2), path18, "junction");
+}
+function forceSymlinkSync(target2, path18, opts2) {
+  let initialErr;
+  try {
+    if (opts2?.noJunction === true) {
+      createTrueSymlinkSync(target2, path18);
+    } else {
+      createSymlinkSync(target2, path18);
+    }
+    return { reused: false };
+  } catch (err) {
+    initialErr = err;
+    switch (err.code) {
+      case "ENOENT":
+        try {
+          mkdirSync(pathLib.dirname(path18), { recursive: true });
+        } catch (mkdirError) {
+          mkdirError.message = `Error while trying to symlink "${target2}" to "${path18}". The error happened while trying to create the parent directory for the symlink target. Details: ${mkdirError}`;
+          throw mkdirError;
+        }
+        forceSymlinkSync(target2, path18, opts2);
+        return { reused: false };
+      case "EEXIST":
+      case "EISDIR":
+        break;
+      default:
+        throw err;
+    }
+  }
+  let linkString;
+  try {
+    linkString = readlinkSync(path18);
+  } catch (err) {
+    if (opts2?.overwrite === false) {
+      throw initialErr;
+    }
+    const parentDir = pathLib.dirname(path18);
+    let warn;
+    if (opts2?.renameTried) {
+      unlinkSync(path18);
+      warn = `Symlink wanted name was occupied by directory or file. Old entity removed: "${parentDir}${pathLib.sep}{${pathLib.basename(path18)}".`;
+    } else {
+      const ignore = `.ignored_${pathLib.basename(path18)}`;
+      try {
+        renameOverwriteSync(path18, pathLib.join(parentDir, ignore));
+      } catch (error) {
+        if (types.isNativeError(error) && "code" in error && error.code === "ENOENT") {
+          throw initialErr;
+        }
+        throw error;
+      }
+      warn = `Symlink wanted name was occupied by directory or file. Old entity moved: "${parentDir}${pathLib.sep}{${pathLib.basename(path18)} => ${ignore}".`;
+    }
+    return {
+      ...forceSymlinkSync(target2, path18, { ...opts2, renameTried: true }),
+      warn
+    };
+  }
+  if (isExistingSymlinkUpToDate(target2, path18, linkString)) {
+    return { reused: true };
+  }
+  if (opts2?.overwrite === false) {
+    throw initialErr;
+  }
+  try {
+    unlinkSync(path18);
+  } catch (error) {
+    if (!types.isNativeError(error) || !("code" in error) || error.code !== "ENOENT") {
+      throw error;
+    }
+  }
+  return forceSymlinkSync(target2, path18, opts2);
+}
+
+// ../fs/symlink-dependency/lib/safeJoinModulesDir.js
+var import_validate_npm_package_name = __toESM(require_lib2(), 1);
+import path5 from "node:path";
+function safeJoinModulesDir(modulesDir, alias) {
+  if (!(0, import_validate_npm_package_name.default)(alias).validForOldPackages) {
+    throw invalidDependencyNameError(modulesDir, alias);
+  }
+  const link = path5.join(modulesDir, alias);
+  const resolvedDir = path5.resolve(modulesDir);
+  const resolvedLink = path5.resolve(link);
+  if (resolvedLink === resolvedDir || !resolvedLink.startsWith(resolvedDir + path5.sep)) {
+    throw invalidDependencyNameError(modulesDir, alias, resolvedLink);
+  }
+  return link;
+}
+function invalidDependencyNameError(modulesDir, alias, resolvedLink) {
+  const detail = resolvedLink ? ` (it resolves to ${resolvedLink})` : "";
+  const error = new Error(`Refusing to place a dependency under ${modulesDir} with the invalid alias ${JSON.stringify(alias)}${detail}`);
+  error.code = "ERR_PNPM_INVALID_DEPENDENCY_NAME";
+  return error;
+}
+
+// ../fs/symlink-dependency/lib/index.js
+function symlinkDependencySync(dependencyRealLocation, destModulesDir, importAs) {
+  const link = safeJoinModulesDir(destModulesDir, importAs);
+  linkLogger.debug({ target: dependencyRealLocation, link });
+  return symlinkDirSync(dependencyRealLocation, link);
+}
+
+// ../store/cafs/lib/index.js
+import crypto4 from "node:crypto";
+
+// ../store/cafs/lib/addFilesFromDir.js
+import fs5, {} from "node:fs";
+import path7 from "node:path";
+import util3 from "node:util";
+
+// ../../../../../setup-pnpm/store/v11/links/@/is-subdir/2.0.0/86b3cd44735afb9f459dad7b43ddfc23f1a21495323a3fb38b9ab590c29f23ce/node_modules/is-subdir/index.js
+import path6 from "node:path";
+function isSubdir(parentDir, subdir) {
+  const rParent = `${betterPathResolve(parentDir)}${path6.sep}`;
+  const rDir = `${betterPathResolve(subdir)}${path6.sep}`;
+  return rDir.startsWith(rParent);
+}
+
+// ../../../../../setup-pnpm/store/v11/links/@/strip-bom/5.0.0/c5abc9f591760d7581de2026bc6da7f255db82a0b75d02fcc6cebf460005b3e6/node_modules/strip-bom/index.js
+function stripBom(string) {
+  if (typeof string !== "string") {
+    throw new TypeError(`Expected a string, got ${typeof string}`);
+  }
+  if (string.charCodeAt(0) === 65279) {
+    return string.slice(1);
+  }
+  return string;
+}
+
+// ../store/cafs/lib/parseJson.js
+function parseJsonBufferSync(buffer) {
+  return JSON.parse(stripBom(buffer.toString()));
+}
+
+// ../store/cafs/lib/addFilesFromDir.js
+function addFilesFromDir(addBuffer, dirname, opts2 = {}) {
+  const filesIndex = /* @__PURE__ */ new Map();
+  let manifest;
+  let files;
+  const resolvedRoot = fs5.realpathSync(dirname);
+  if (opts2.files) {
+    files = [];
+    for (const file of opts2.files) {
+      const absolutePath = path7.join(dirname, file);
+      const stat = getStatIfContained(absolutePath, resolvedRoot);
+      if (!stat) {
+        continue;
+      }
+      files.push({
+        absolutePath,
+        relativePath: file,
+        stat
+      });
+    }
+  } else {
+    files = findFilesInDir(dirname, resolvedRoot, opts2);
+  }
+  for (const { absolutePath, relativePath, stat } of files) {
+    const buffer = lib_default.readFileSync(absolutePath);
+    if (opts2.readManifest && relativePath === "package.json") {
+      manifest = parseJsonBufferSync(buffer);
+    }
+    const mode = stat.mode & 511;
+    filesIndex.set(relativePath, {
+      mode,
+      size: stat.size,
+      ...addBuffer(buffer, mode)
+    });
+  }
+  return { manifest, filesIndex };
+}
+function getStatIfContained(absolutePath, rootDir) {
+  let lstat;
+  try {
+    lstat = fs5.lstatSync(absolutePath);
+  } catch (err) {
+    if (util3.types.isNativeError(err) && "code" in err && err.code === "ENOENT") {
+      return null;
+    }
+    throw err;
+  }
+  if (lstat.isSymbolicLink()) {
+    return getSymlinkStatIfContained(absolutePath, rootDir)?.stat ?? null;
+  }
+  return lstat;
+}
+function getSymlinkStatIfContained(absolutePath, rootDir) {
+  let realPath;
+  try {
+    realPath = fs5.realpathSync(absolutePath);
+  } catch (err) {
+    if (util3.types.isNativeError(err) && "code" in err && err.code === "ENOENT") {
+      return null;
+    }
+    throw err;
+  }
+  if (!isSubdir(rootDir, realPath)) {
+    return null;
+  }
+  return { stat: fs5.statSync(realPath), realPath };
+}
+function findFilesInDir(dir, rootDir, opts2) {
+  const files = [];
+  const ctx = {
+    filesList: files,
+    includeNodeModules: opts2.includeNodeModules ?? false,
+    rootDir,
+    visited: /* @__PURE__ */ new Set([rootDir])
+  };
+  findFiles(ctx, dir, "", rootDir);
+  return files;
+}
+function findFiles(ctx, dir, relativeDir, currentRealPath) {
+  const files = fs5.readdirSync(dir, { withFileTypes: true });
+  for (const file of files) {
+    const relativeSubdir = `${relativeDir}${relativeDir ? "/" : ""}${file.name}`;
+    const absolutePath = path7.join(dir, file.name);
+    let nextRealDir;
+    if (file.isSymbolicLink()) {
+      const res = getSymlinkStatIfContained(absolutePath, ctx.rootDir);
+      if (!res) {
+        continue;
+      }
+      if (res.stat.isDirectory()) {
+        nextRealDir = res.realPath;
+      } else {
+        ctx.filesList.push({
+          relativePath: relativeSubdir,
+          absolutePath,
+          stat: res.stat
+        });
+        continue;
+      }
+    } else if (file.isDirectory()) {
+      nextRealDir = path7.join(currentRealPath, file.name);
+    }
+    if (nextRealDir) {
+      if (ctx.visited.has(nextRealDir))
+        continue;
+      if (relativeDir !== "" || file.name !== "node_modules" || ctx.includeNodeModules) {
+        ctx.visited.add(nextRealDir);
+        findFiles(ctx, absolutePath, relativeSubdir, nextRealDir);
+        ctx.visited.delete(nextRealDir);
+      }
+      continue;
+    }
+    let stat;
+    try {
+      stat = fs5.statSync(absolutePath);
+    } catch (err) {
+      if (util3.types.isNativeError(err) && "code" in err && err.code === "ENOENT") {
+        continue;
+      }
+      throw err;
+    }
+    ctx.filesList.push({
+      relativePath: relativeSubdir,
+      absolutePath,
+      stat
+    });
+  }
+}
+
+// ../store/cafs/lib/addFilesFromTarball.js
+var import_is_gzip = __toESM(require_is_gzip(), 1);
+import { gunzipSync } from "node:zlib";
+
+// ../store/cafs/lib/parseTarball.js
+import path8 from "node:path";
+var ZERO = "0".charCodeAt(0);
+var FILE_TYPE_HARD_LINK = "1".charCodeAt(0);
+var FILE_TYPE_SYMLINK = "2".charCodeAt(0);
+var FILE_TYPE_DIRECTORY = "5".charCodeAt(0);
+var SPACE = " ".charCodeAt(0);
+var SLASH = "/".charCodeAt(0);
+var BACKSLASH = "\\".charCodeAt(0);
+var FILE_TYPE_PAX_HEADER = "x".charCodeAt(0);
+var FILE_TYPE_PAX_GLOBAL_HEADER = "g".charCodeAt(0);
+var FILE_TYPE_LONGLINK = "L".charCodeAt(0);
+var MODE_OFFSET = 100;
+var FILE_SIZE_OFFSET = 124;
+var CHECKSUM_OFFSET = 148;
+var FILE_TYPE_OFFSET = 156;
+var PREFIX_OFFSET = 345;
+function parseTarball(buffer) {
+  const files = /* @__PURE__ */ new Map();
+  let pathTrimmed = false;
+  let mode = 0;
+  let fileSize = 0;
+  let fileType = 0;
+  let prefix = "";
+  let fileName = "";
+  let longLinkPath = "";
+  let paxHeaderPath = "";
+  let paxHeaderFileSize;
+  let blockBytes = 0;
+  let blockStart = 0;
+  while (buffer[blockStart] !== 0) {
+    fileType = buffer[blockStart + FILE_TYPE_OFFSET];
+    if (paxHeaderFileSize !== void 0) {
+      fileSize = paxHeaderFileSize;
+      paxHeaderFileSize = void 0;
+    } else {
+      fileSize = parseOctal(blockStart + FILE_SIZE_OFFSET, 12);
+    }
+    blockBytes = (fileSize & ~511) + (fileSize & 511 ? 1024 : 512);
+    const expectedCheckSum = parseOctal(blockStart + CHECKSUM_OFFSET, 8);
+    const actualCheckSum = checkSum(blockStart);
+    if (expectedCheckSum !== actualCheckSum) {
+      throw new Error(`Invalid checksum for TAR header at offset ${blockStart}. Expected ${expectedCheckSum}, got ${actualCheckSum}`);
+    }
+    pathTrimmed = false;
+    if (longLinkPath) {
+      fileName = longLinkPath;
+      longLinkPath = "";
+    } else if (paxHeaderPath) {
+      fileName = paxHeaderPath;
+      paxHeaderPath = "";
+    } else {
+      prefix = parseString(blockStart + PREFIX_OFFSET, 155);
+      if (prefix && !pathTrimmed) {
+        pathTrimmed = true;
+        prefix = "";
+      }
+      fileName = parseString(blockStart, MODE_OFFSET);
+      if (prefix) {
+        fileName = `${prefix}/${fileName}`;
+      }
+    }
+    if (fileName.includes("./") || fileName.includes(".\\")) {
+      fileName = path8.posix.join("/", fileName.replaceAll("\\", "/")).slice(1);
+    }
+    switch (fileType) {
+      case 0:
+      case ZERO:
+      case FILE_TYPE_HARD_LINK:
+        mode = parseOctal(blockStart + MODE_OFFSET, 8);
+        files.set(fileName.replaceAll("//", "/"), { offset: blockStart + 512, mode, size: fileSize });
+        break;
+      case FILE_TYPE_DIRECTORY:
+      case FILE_TYPE_SYMLINK:
+        break;
+      case FILE_TYPE_PAX_HEADER:
+        parsePaxHeader(blockStart + 512, fileSize, false);
+        break;
+      case FILE_TYPE_PAX_GLOBAL_HEADER:
+        parsePaxHeader(blockStart + 512, fileSize, true);
+        break;
+      case FILE_TYPE_LONGLINK: {
+        longLinkPath = buffer.toString("utf8", blockStart + 512, blockStart + 512 + fileSize).replace(/\0.*/, "");
+        const slashIndex = longLinkPath.indexOf("/");
+        if (slashIndex >= 0) {
+          longLinkPath = longLinkPath.slice(slashIndex + 1);
+        }
+        break;
+      }
+      default:
+        throw new Error(`Unsupported file type ${fileType} for file ${fileName}.`);
+    }
+    blockStart += blockBytes;
+  }
+  return { files, buffer: buffer.buffer };
+  function checkSum(offset) {
+    let sum = 256;
+    let i = offset;
+    const checksumStart = offset + 148;
+    const checksumEnd = offset + 156;
+    const blockEnd = offset + 512;
+    for (; i < checksumStart; i++) {
+      sum += buffer[i];
+    }
+    for (i = checksumEnd; i < blockEnd; i++) {
+      sum += buffer[i];
+    }
+    return sum;
+  }
+  function parsePaxHeader(offset, length, global2) {
+    const end = offset + length;
+    let i = offset;
+    while (i < end) {
+      const lineStart = i;
+      while (i < end && buffer[i] !== SPACE) {
+        i++;
+      }
+      const strLen = buffer.toString("utf-8", lineStart, i);
+      const len = parseInt(strLen, 10);
+      if (!len) {
+        throw new Error(`Invalid length in PAX record: ${strLen}`);
+      }
+      i++;
+      const lineEnd = lineStart + len;
+      const record = buffer.toString("utf-8", i, lineEnd - 1);
+      i = lineEnd;
+      const equalSign = record.indexOf("=");
+      const keyword = record.slice(0, equalSign);
+      if (keyword === "path") {
+        const slashIndex = record.indexOf("/", equalSign + 1);
+        if (global2) {
+          throw new Error(`Unexpected global PAX path: ${record}`);
+        }
+        paxHeaderPath = record.slice(slashIndex >= 0 ? slashIndex + 1 : equalSign + 1);
+      } else if (keyword === "size") {
+        const size = parseInt(record.slice(equalSign + 1), 10);
+        if (isNaN(size) || size < 0) {
+          throw new Error(`Invalid size in PAX record: ${record}`);
+        }
+        if (global2) {
+          throw new Error(`Unexpected global PAX file size: ${record}`);
+        }
+        paxHeaderFileSize = size;
+      } else {
+        continue;
+      }
+    }
+  }
+  function parseString(offset, length) {
+    let end = offset;
+    const max = length + offset;
+    for (let char = buffer[end]; char !== 0 && end !== max; char = buffer[++end]) {
+      if (!pathTrimmed && (char === SLASH || char === BACKSLASH)) {
+        pathTrimmed = true;
+        offset = end + 1;
+      }
+    }
+    return buffer.toString("utf8", offset, end);
+  }
+  function parseOctal(offset, length) {
+    const val = buffer.subarray(offset, offset + length);
+    offset = 0;
+    while (offset < val.length && val[offset] === SPACE)
+      offset++;
+    const end = clamp(indexOf(val, SPACE, offset, val.length), val.length, val.length);
+    while (offset < end && val[offset] === 0)
+      offset++;
+    if (end === offset)
+      return 0;
+    return parseInt(val.subarray(offset, end).toString(), 8);
+  }
+}
+function indexOf(block, num, offset, end) {
+  for (; offset < end; offset++) {
+    if (block[offset] === num)
+      return offset;
+  }
+  return end;
+}
+function clamp(index, len, defaultValue) {
+  if (typeof index !== "number")
+    return defaultValue;
+  index = ~~index;
+  if (index >= len)
+    return len;
+  if (index >= 0)
+    return index;
+  index += len;
+  if (index >= 0)
+    return index;
+  return 0;
+}
+
+// ../store/cafs/lib/addFilesFromTarball.js
+function addFilesFromTarball(addBufferToCafs2, tarballBuffer, readManifest, ignore) {
+  const tarContent = (0, import_is_gzip.default)(tarballBuffer) ? gunzipSync(tarballBuffer, { chunkSize: 128 * 1024 }) : Buffer.isBuffer(tarballBuffer) ? tarballBuffer : Buffer.from(tarballBuffer);
+  const { files } = parseTarball(tarContent);
+  const filesIndex = /* @__PURE__ */ new Map();
+  let manifestBuffer;
+  for (const [relativePath, { mode, offset, size }] of files) {
+    if (ignore?.(relativePath))
+      continue;
+    const fileBuffer = tarContent.subarray(offset, offset + size);
+    if (readManifest && relativePath === "package.json") {
+      manifestBuffer = fileBuffer;
+    }
+    filesIndex.set(relativePath, {
+      mode,
+      size,
+      ...addBufferToCafs2(fileBuffer, mode)
+    });
+  }
+  return {
+    filesIndex,
+    manifest: manifestBuffer ? parseJsonBufferSync(manifestBuffer) : void 0
+  };
+}
+
+// ../store/cafs/lib/checkPkgFilesIntegrity.js
+import crypto3 from "node:crypto";
+import fs6 from "node:fs";
+import util4 from "node:util";
+
+// ../store/cafs/lib/getFilePathInCafs.js
+import path9 from "node:path";
+var SEP = path9.sep;
+var modeIsExecutable = (mode) => (mode & 73) !== 0;
+function getFilePathByModeInCafs(storeDir, hexDigest, mode) {
+  const fileType = modeIsExecutable(mode) ? "exec" : "nonexec";
+  return `${storeDir}${SEP}${contentPathFromHex(fileType, hexDigest)}`;
+}
+function contentPathFromHex(fileType, hex) {
+  const p = `files${SEP}${hex.slice(0, 2)}${SEP}${hex.slice(2)}`;
+  switch (fileType) {
+    case "exec":
+      return `${p}-exec`;
+    case "nonexec":
+      return p;
+  }
+}
+
+// ../store/cafs/lib/checkPkgFilesIntegrity.js
+global["verifiedFileIntegrity"] = 0;
+function checkPkgFilesIntegrity(storeDir, pkgIndex) {
+  const verifiedFilesCache = /* @__PURE__ */ new Set();
+  const _checkFilesIntegrity = checkFilesIntegrity.bind(null, verifiedFilesCache, storeDir, pkgIndex.algo);
+  const verified = _checkFilesIntegrity(pkgIndex.files);
+  if (!verified.passed)
+    return verified;
+  const sideEffectsMaps = /* @__PURE__ */ new Map();
+  if (pkgIndex.sideEffects) {
+    for (const [sideEffectName, { added, deleted }] of pkgIndex.sideEffects) {
+      if (added) {
+        const result = _checkFilesIntegrity(added);
+        if (!result.passed) {
+          continue;
+        } else {
+          sideEffectsMaps.set(sideEffectName, { added: result.filesMap, deleted });
+        }
+      } else if (deleted) {
+        sideEffectsMaps.set(sideEffectName, { deleted });
+      }
+    }
+  }
+  return {
+    ...verified,
+    sideEffectsMaps: sideEffectsMaps.size > 0 ? sideEffectsMaps : void 0
+  };
+}
+function buildFileMapsFromIndex(storeDir, pkgIndex) {
+  const filesMap = /* @__PURE__ */ new Map();
+  for (const [f, fstat] of pkgIndex.files) {
+    const filename = getFilePathByModeInCafs(storeDir, fstat.digest, fstat.mode);
+    filesMap.set(f, filename);
+  }
+  const sideEffectsMaps = /* @__PURE__ */ new Map();
+  if (pkgIndex.sideEffects) {
+    for (const [sideEffectName, { added, deleted }] of pkgIndex.sideEffects) {
+      const sideEffectEntry = {};
+      if (added) {
+        const addedFilesMap = /* @__PURE__ */ new Map();
+        for (const [f, fstat] of added) {
+          const filename = getFilePathByModeInCafs(storeDir, fstat.digest, fstat.mode);
+          addedFilesMap.set(f, filename);
+        }
+        sideEffectEntry.added = addedFilesMap;
+      }
+      if (deleted) {
+        sideEffectEntry.deleted = deleted;
+      }
+      sideEffectsMaps.set(sideEffectName, sideEffectEntry);
+    }
+  }
+  return {
+    passed: true,
+    filesMap,
+    sideEffectsMaps: sideEffectsMaps.size > 0 ? sideEffectsMaps : void 0
+  };
+}
+function checkFilesIntegrity(verifiedFilesCache, storeDir, algo, files) {
+  let allVerified = true;
+  const filesMap = /* @__PURE__ */ new Map();
+  for (const [f, fstat] of files) {
+    if (!fstat.digest) {
+      throw new PnpmError("MISSING_CONTENT_DIGEST", `Content digest is missing for ${f}`);
+    }
+    const filename = getFilePathByModeInCafs(storeDir, fstat.digest, fstat.mode);
+    filesMap.set(f, filename);
+    if (verifiedFilesCache.has(filename))
+      continue;
+    const passed = verifyFile(filename, fstat, algo);
+    if (passed) {
+      verifiedFilesCache.add(filename);
+    } else {
+      allVerified = false;
+    }
+  }
+  return {
+    passed: allVerified,
+    filesMap
+  };
+}
+function verifyFile(filename, fstat, algorithm) {
+  const currentFile = checkFile(filename, fstat.checkedAt);
+  if (currentFile == null)
+    return false;
+  if (currentFile.isModified) {
+    if (currentFile.size !== fstat.size) {
+      rimrafSync(filename);
+      return false;
+    }
+    const passed = verifyFileIntegrity(filename, { digest: fstat.digest, algorithm });
+    if (!passed) {
+      lib_default.unlinkSync(filename);
+    }
+    return passed;
+  }
+  return true;
+}
+function verifyFileIntegrity(filename, integrity) {
+  global["verifiedFileIntegrity"]++;
+  let data;
+  try {
+    data = lib_default.readFileSync(filename);
+  } catch (err) {
+    if (util4.types.isNativeError(err) && "code" in err && err.code === "ENOENT") {
+      return false;
+    }
+    throw err;
+  }
+  try {
+    return crypto3.hash(integrity.algorithm, data, "hex") === integrity.digest;
+  } catch {
+    return false;
+  }
+}
+function checkFile(filename, checkedAt) {
+  try {
+    const { mtimeMs, size } = fs6.statSync(filename);
+    return {
+      isModified: mtimeMs - (checkedAt ?? 0) > 100,
+      size
+    };
+  } catch (err) {
+    if (util4.types.isNativeError(err) && "code" in err && err.code === "ENOENT")
+      return null;
+    throw err;
+  }
+}
+
+// ../store/cafs/lib/normalizeBundledManifest.js
+var import_semver = __toESM(require_semver2(), 1);
+var BUNDLED_MANIFEST_FIELDS = [
+  "bin",
+  "bundledDependencies",
+  "bundleDependencies",
+  "cpu",
+  "dependencies",
+  "devDependencies",
+  "directories",
+  "engines",
+  "libc",
+  "name",
+  "optionalDependencies",
+  "os",
+  "peerDependencies",
+  "peerDependenciesMeta"
+];
+var LIFECYCLE_SCRIPTS = ["preinstall", "install", "postinstall"];
+function normalizeBundledManifest(manifest) {
+  let result;
+  for (const key of BUNDLED_MANIFEST_FIELDS) {
+    if (manifest[key] != null) {
+      if (!result)
+        result = {};
+      result[key] = manifest[key];
+    }
+  }
+  let scripts;
+  if (manifest.scripts) {
+    for (const key of LIFECYCLE_SCRIPTS) {
+      if (manifest.scripts[key]) {
+        if (!scripts)
+          scripts = {};
+        scripts[key] = manifest.scripts[key];
+      }
+    }
+  }
+  if (!result && !scripts)
+    return void 0;
+  return {
+    version: import_semver.default.clean(manifest.version ?? "0.0.0", { loose: true }) ?? manifest.version,
+    ...result,
+    ...scripts ? { scripts } : {}
+  };
+}
+
+// ../store/cafs/lib/writeBufferToCafs.js
+import fs7 from "node:fs";
+import path11 from "node:path";
+import util5 from "node:util";
+import workerThreads from "node:worker_threads";
+
+// ../store/cafs/lib/writeFile.js
+import path10 from "node:path";
+var dirs = /* @__PURE__ */ new Set();
+function writeFile(fileDest, buffer, mode) {
+  makeDirForFile(fileDest);
+  lib_default.writeFileSync(fileDest, buffer, { mode });
+}
+function writeFileExclusive(fileDest, buffer, mode) {
+  makeDirForFile(fileDest);
+  lib_default.writeFileSync(fileDest, buffer, { mode, flag: "wx" });
+}
+function makeDirForFile(fileDest) {
+  const dir = path10.dirname(fileDest);
+  if (!dirs.has(dir)) {
+    lib_default.mkdirSync(dir, { recursive: true });
+    dirs.add(dir);
+  }
+}
+
+// ../store/cafs/lib/writeBufferToCafs.js
+function writeBufferToCafs(locker, storeDir, buffer, fileDest, mode, integrity) {
+  fileDest = path11.join(storeDir, fileDest);
+  if (locker.has(fileDest)) {
+    return {
+      checkedAt: locker.get(fileDest),
+      filePath: fileDest
+    };
+  }
+  const checkedAt = writeOrCheck(fileDest, buffer, mode, integrity);
+  locker.set(fileDest, checkedAt);
+  return {
+    checkedAt,
+    filePath: fileDest
+  };
+}
+function writeOrCheck(fileDest, buffer, mode, integrity) {
+  const existingFile = fs7.statSync(fileDest, { throwIfNoEntry: false });
+  if (existingFile) {
+    if (verifyFileIntegrity(fileDest, integrity)) {
+      return Date.now();
+    }
+    return writeFileAtomic(fileDest, buffer, mode);
+  }
+  try {
+    writeFileExclusive(fileDest, buffer, mode);
+  } catch (err) {
+    if (util5.types.isNativeError(err) && "code" in err && err.code === "EEXIST") {
+      if (verifyFileIntegrity(fileDest, integrity)) {
+        return Date.now();
+      }
+      return writeFileAtomic(fileDest, buffer, mode);
+    }
+    throw err;
+  }
+  return Date.now();
+}
+function writeFileAtomic(fileDest, buffer, mode) {
+  const temp = pathTemp2(fileDest);
+  writeFile(temp, buffer, mode);
+  optimisticRenameOverwrite(temp, fileDest);
+  return Date.now();
+}
+function optimisticRenameOverwrite(temp, fileDest) {
+  try {
+    renameOverwriteSync(temp, fileDest);
+  } catch (err) {
+    if (!(util5.types.isNativeError(err) && "code" in err && err.code === "ENOENT") || !fs7.existsSync(fileDest))
+      throw err;
+  }
+}
+function pathTemp2(file) {
+  const basename = removeSuffix(path11.basename(file));
+  return path11.join(path11.dirname(file), `${basename}${process.pid}${workerThreads.threadId}`);
+}
+function removeSuffix(filePath) {
+  const dashPosition = filePath.indexOf("-");
+  if (dashPosition === -1)
+    return filePath;
+  const withoutSuffix = filePath.substring(0, dashPosition);
+  if (filePath.substring(dashPosition) === "-exec") {
+    return `${withoutSuffix}x`;
+  }
+  return withoutSuffix;
+}
+
+// ../core/types/lib/misc.js
+var DEPENDENCIES_FIELDS = [
+  "optionalDependencies",
+  "dependencies",
+  "devDependencies"
+];
+var DEPENDENCIES_OR_PEER_FIELDS = [
+  ...DEPENDENCIES_FIELDS,
+  "peerDependencies"
+];
+
+// ../store/cafs/lib/index.js
+var HASH_ALGORITHM = "sha512";
+function createCafs(storeDir, { ignoreFile, cafsLocker: cafsLocker2 } = {}) {
+  const _writeBufferToCafs = writeBufferToCafs.bind(null, cafsLocker2 ?? /* @__PURE__ */ new Map(), storeDir);
+  const addBuffer = addBufferToCafs.bind(null, _writeBufferToCafs);
+  return {
+    addFilesFromDir: addFilesFromDir.bind(null, addBuffer),
+    addFilesFromTarball: (tarballBuffer, readManifest, callIgnore) => addFilesFromTarball(addBuffer, tarballBuffer, readManifest, combineIgnore(ignoreFile, callIgnore)),
+    addFile: addBuffer,
+    getFilePathByModeInCafs: getFilePathByModeInCafs.bind(null, storeDir)
+  };
+}
+function combineIgnore(a, b) {
+  if (!a)
+    return b;
+  if (!b)
+    return a;
+  return (filename) => a(filename) || b(filename);
+}
+function addBufferToCafs(writeBufferToCafs2, buffer, mode) {
+  const digest = crypto4.hash(HASH_ALGORITHM, buffer, "hex");
+  const isExecutable = modeIsExecutable(mode);
+  const fileDest = contentPathFromHex(isExecutable ? "exec" : "nonexec", digest);
+  const { checkedAt, filePath } = writeBufferToCafs2(buffer, fileDest, isExecutable ? 493 : void 0, { digest, algorithm: HASH_ALGORITHM });
+  return { checkedAt, filePath, digest };
+}
+
+// ../store/create-cafs-store/lib/index.js
+import { promises as fs10 } from "node:fs";
+import path16 from "node:path";
+
+// ../fs/indexed-pkg-importer/lib/index.js
+import assert2 from "node:assert";
+import { constants, existsSync } from "node:fs";
+import path15 from "node:path";
+import util7 from "node:util";
+
+// ../fs/indexed-pkg-importer/lib/importIndexedDir.js
+import fs9 from "node:fs";
+import path13 from "node:path";
+import util6 from "node:util";
+var import_fs_extra2 = __toESM(require_lib3(), 1);
+
+// ../../../../../setup-pnpm/store/v11/links/@/make-empty-dir/4.0.0/3607722a2f7d328bdf182e4db3290941113e732fd2d785b1a5837ab89bb24489/node_modules/make-empty-dir/index.js
+import fs8 from "node:fs";
+import path12 from "node:path";
+function makeEmptyDirSync(dir, opts2) {
+  if (opts2 && opts2.recursive) {
+    fs8.mkdirSync(path12.dirname(dir), { recursive: true });
+  }
+  try {
+    fs8.mkdirSync(dir);
+    return "created";
+  } catch (err) {
+    if (err.code === "EEXIST") {
+      removeContentsOfDirSync(dir);
+      return "emptied";
+    }
+    throw err;
+  }
+}
+function removeContentsOfDirSync(dir) {
+  const items = fs8.readdirSync(dir);
+  for (const item of items) {
+    rimrafSync(path12.join(dir, item));
+  }
+}
+
+// ../fs/indexed-pkg-importer/lib/importIndexedDir.js
+var import_sanitize_filename = __toESM(require_sanitize_filename(), 1);
+var filenameConflictsLogger = logger("_filename-conflicts");
+function importIndexedDir(importer, newDir, filenames, opts2) {
+  if (!opts2.keepModulesDir) {
+    if (opts2.safeToSkip) {
+      try {
+        fs9.mkdirSync(newDir, { recursive: true });
+        tryImportIndexedDir(importer, newDir, filenames);
+        return;
+      } catch (err) {
+        if (util6.types.isNativeError(err) && "code" in err && err.code === "EEXIST" && allFilesMatch(newDir, filenames)) {
+          return;
+        }
+      }
+    } else if (tryExclusiveImport(importer, newDir, filenames)) {
+      return;
+    }
+  }
+  const stage = fastPathTemp(newDir);
+  try {
+    makeEmptyDirSync(stage, { recursive: true });
+    tryImportIndexedDir({ importFile: importer.importFile, importFileAtomic: importer.importFile }, stage, filenames);
+    if (opts2.keepModulesDir) {
+      moveOrMergeModulesDirs(path13.join(newDir, "node_modules"), path13.join(stage, "node_modules"));
+    }
+  } catch (err) {
+    try {
+      rimrafSync(stage);
+    } catch {
+    }
+    if (util6.types.isNativeError(err) && "code" in err && err.code === "EEXIST") {
+      const { uniqueFileMap, conflictingFileNames } = getUniqueFileMap(filenames);
+      if (conflictingFileNames.size === 0)
+        throw err;
+      filenameConflictsLogger.debug({
+        conflicts: Object.fromEntries(conflictingFileNames),
+        writingTo: newDir
+      });
+      globalWarn(`Not all files were linked to "${path13.relative(process.cwd(), newDir)}". Some of the files have equal names in different case, which is an issue on case-insensitive filesystems. The conflicting file names are: ${JSON.stringify(Object.fromEntries(conflictingFileNames))}`);
+      importIndexedDir(importer, newDir, uniqueFileMap, opts2);
+      return;
+    }
+    if (util6.types.isNativeError(err) && "code" in err && err.code === "ENOENT") {
+      if (retryWithSanitizedFilenames(importer, newDir, filenames, opts2))
+        return;
+      throw err;
+    }
+    throw err;
+  }
+  if (opts2.safeToSkip) {
+    try {
+      fs9.renameSync(stage, newDir);
+      return;
+    } catch (err) {
+      if (util6.types.isNativeError(err) && "code" in err && (err.code === "ENOTEMPTY" || err.code === "EEXIST" || err.code === "EPERM")) {
+        if (allFilesMatch(newDir, filenames)) {
+          try {
+            rimrafSync(stage);
+          } catch {
+          }
+          return;
+        }
+      }
+    }
+  }
+  try {
+    renameOverwriteSync(stage, newDir);
+  } catch (renameErr) {
+    try {
+      rimrafSync(stage);
+    } catch {
+    }
+    throw renameErr;
+  }
+}
+function tryExclusiveImport(importer, newDir, filenames) {
+  fs9.mkdirSync(path13.dirname(newDir), { recursive: true });
+  try {
+    fs9.mkdirSync(newDir);
+  } catch (err) {
+    if (util6.types.isNativeError(err) && "code" in err && err.code === "EEXIST")
+      return false;
+    throw err;
+  }
+  try {
+    tryImportIndexedDir(importer, newDir, filenames);
+    return true;
+  } catch {
+    try {
+      rimrafSync(newDir);
+    } catch {
+    }
+    return false;
+  }
+}
+function allFilesMatch(dir, filenames) {
+  for (const [f, src2] of filenames) {
+    const target2 = path13.join(dir, f);
+    try {
+      const targetStat = lib_default.statSync(target2);
+      const srcStat = lib_default.statSync(src2);
+      if (targetStat.ino === srcStat.ino && targetStat.dev === srcStat.dev)
+        continue;
+      if (targetStat.size !== srcStat.size) {
+        globalInfo(`Re-importing "${dir}" because file "${f}" has a different size`);
+        return false;
+      }
+      if (!lib_default.readFileSync(target2).equals(lib_default.readFileSync(src2))) {
+        globalInfo(`Re-importing "${dir}" because file "${f}" has different content`);
+        return false;
+      }
+    } catch {
+      globalInfo(`Re-importing "${dir}" because file "${f}" is missing or unreadable`);
+      return false;
+    }
+  }
+  return true;
+}
+function retryWithSanitizedFilenames(importer, newDir, filenames, opts2) {
+  const { sanitizedFilenames, invalidFilenames } = sanitizeFilenames(filenames);
+  if (invalidFilenames.length === 0)
+    return false;
+  globalWarn(`The package linked to "${path13.relative(process.cwd(), newDir)}" had files with invalid names: ${invalidFilenames.join(", ")}. They were renamed.`);
+  importIndexedDir(importer, newDir, sanitizedFilenames, opts2);
+  return true;
+}
+function sanitizeFilenames(filenames) {
+  const sanitizedFilenames = /* @__PURE__ */ new Map();
+  const invalidFilenames = [];
+  for (const [filename, src2] of filenames) {
+    const sanitizedFilename = filename.split("/").map((f) => (0, import_sanitize_filename.default)(f)).join("/");
+    if (sanitizedFilename !== filename) {
+      invalidFilenames.push(filename);
+    }
+    sanitizedFilenames.set(sanitizedFilename, src2);
+  }
+  return { sanitizedFilenames, invalidFilenames };
+}
+function tryImportIndexedDir({ importFile, importFileAtomic }, newDir, filenames) {
+  const allDirs = /* @__PURE__ */ new Set();
+  for (const f of filenames.keys()) {
+    const dir = path13.dirname(f);
+    if (dir === ".")
+      continue;
+    allDirs.add(dir);
+  }
+  Array.from(allDirs).sort((d1, d2) => d1.length - d2.length).forEach((dir) => fs9.mkdirSync(path13.join(newDir, dir), { recursive: true }));
+  let packageJsonSrc;
+  for (const [f, src2] of filenames) {
+    if (f === "package.json") {
+      packageJsonSrc = src2;
+      continue;
+    }
+    importFile(src2, path13.join(newDir, f));
+  }
+  if (packageJsonSrc !== void 0) {
+    importFileAtomic(packageJsonSrc, path13.join(newDir, "package.json"));
+  }
+}
+function getUniqueFileMap(fileMap) {
+  const lowercaseFiles = /* @__PURE__ */ new Map();
+  const conflictingFileNames = /* @__PURE__ */ new Map();
+  const uniqueFileMap = /* @__PURE__ */ new Map();
+  for (const filename of Array.from(fileMap.keys()).sort()) {
+    const lowercaseFilename = filename.toLowerCase();
+    if (lowercaseFiles.has(lowercaseFilename)) {
+      conflictingFileNames.set(filename, lowercaseFiles.get(lowercaseFilename));
+      continue;
+    }
+    lowercaseFiles.set(lowercaseFilename, filename);
+    uniqueFileMap.set(filename, fileMap.get(filename));
+  }
+  return {
+    conflictingFileNames,
+    uniqueFileMap
+  };
+}
+function moveOrMergeModulesDirs(src2, dest) {
+  try {
+    renameEvenAcrossDevices(src2, dest);
+  } catch (err) {
+    switch (util6.types.isNativeError(err) && "code" in err && err.code) {
+      case "ENOENT":
+        return;
+      case "ENOTEMPTY":
+      case "EPERM":
+        mergeModulesDirs(src2, dest);
+        return;
+      default:
+        throw err;
+    }
+  }
+}
+function renameEvenAcrossDevices(src2, dest) {
+  try {
+    lib_default.renameSync(src2, dest);
+  } catch (err) {
+    if (!(util6.types.isNativeError(err) && "code" in err && err.code === "EXDEV"))
+      throw err;
+    import_fs_extra2.default.copySync(src2, dest);
+  }
+}
+function mergeModulesDirs(src2, dest) {
+  const srcFiles = fs9.readdirSync(src2);
+  const destFiles = new Set(fs9.readdirSync(dest));
+  const filesToMove = srcFiles.filter((file) => !destFiles.has(file));
+  for (const file of filesToMove) {
+    renameEvenAcrossDevices(path13.join(src2, file), path13.join(dest, file));
+  }
+}
+
+// ../fs/indexed-pkg-importer/lib/removeQuarantine.js
+import { execFileSync } from "node:child_process";
+import path14 from "node:path";
+var QUARANTINE_ATTR = "com.apple.quarantine";
+var NATIVE_BINARY_EXTENSIONS = /* @__PURE__ */ new Set([".node", ".dylib", ".so"]);
+var MAX_ARG_BYTES = 1e5;
+function isNativeBinary(filePath) {
+  return NATIVE_BINARY_EXTENSIONS.has(path14.extname(filePath).toLowerCase());
+}
+function removeQuarantine(filePaths) {
+  if (process.platform !== "darwin")
+    return;
+  for (const chunk of chunkByArgSize(filePaths)) {
+    removeQuarantineFromChunk(chunk);
+  }
+}
+function removeQuarantineFromChunk(filePaths) {
+  try {
+    execFileSync("/usr/bin/xattr", ["-d", QUARANTINE_ATTR, ...filePaths], {
+      stdio: ["ignore", "ignore", "pipe"]
+    });
+  } catch (err) {
+    const realErrors = getStderr(err).split("\n").filter((line) => line.trim() !== "" && !line.includes("No such xattr") && !line.includes("No such file"));
+    if (realErrors.length > 0) {
+      globalWarn(`Failed to remove the macOS quarantine attribute:
+${realErrors.join("\n")}`);
+    }
+  }
+}
+function chunkByArgSize(filePaths) {
+  const chunks = [];
+  let chunk = [];
+  let chunkBytes = 0;
+  for (const filePath of filePaths) {
+    const bytes = Buffer.byteLength(filePath) + 1;
+    if (chunk.length > 0 && chunkBytes + bytes > MAX_ARG_BYTES) {
+      chunks.push(chunk);
+      chunk = [];
+      chunkBytes = 0;
+    }
+    chunk.push(filePath);
+    chunkBytes += bytes;
+  }
+  if (chunk.length > 0)
+    chunks.push(chunk);
+  return chunks;
+}
+function getStderr(err) {
+  if (typeof err === "object" && err !== null && "stderr" in err) {
+    const stderr = err.stderr;
+    if (stderr != null)
+      return stderr.toString();
+  }
+  return err instanceof Error ? err.message : String(err);
+}
+
+// ../fs/indexed-pkg-importer/lib/index.js
+function createIndexedPkgImporter(packageImportMethod) {
+  const importPackage2 = createImportPackage(packageImportMethod);
+  return importPackage2;
+}
+function createImportPackage(packageImportMethod) {
+  switch (packageImportMethod ?? "auto") {
+    case "clone":
+      packageImportMethodLogger.debug({ method: "clone" });
+      return createClonePkg();
+    case "hardlink":
+      packageImportMethodLogger.debug({ method: "hardlink" });
+      return hardlinkPkg.bind(null, linkOrCopy2);
+    case "auto": {
+      return createAutoImporter();
+    }
+    case "clone-or-copy":
+      return createCloneOrCopyImporter();
+    case "copy":
+      packageImportMethodLogger.debug({ method: "copy" });
+      return copyPkg;
+    default:
+      throw new Error(`Unknown package import method ${packageImportMethod}`);
+  }
+}
+function createAutoImporter() {
+  let auto = initialAuto;
+  return (to, opts2) => auto(to, opts2);
+  function initialAuto(to, opts2) {
+    if (process.platform !== "win32") {
+      try {
+        if (!tryClonePkg(to, opts2))
+          return void 0;
+        packageImportMethodLogger.debug({ method: "clone" });
+        auto = createClonePkg();
+        return "clone";
+      } catch {
+      }
+    }
+    try {
+      if (!hardlinkPkg(lib_default.linkSync, to, opts2))
+        return void 0;
+      packageImportMethodLogger.debug({ method: "hardlink" });
+      auto = hardlinkPkg.bind(null, linkOrCopy2);
+      return "hardlink";
+    } catch (err) {
+      assert2(util7.types.isNativeError(err));
+      if (err.message.startsWith("EXDEV: cross-device link not permitted")) {
+        globalWarn(err.message);
+        globalInfo("Falling back to copying packages from store");
+        packageImportMethodLogger.debug({ method: "copy" });
+        auto = copyPkg;
+        return auto(to, opts2);
+      }
+      packageImportMethodLogger.debug({ method: "hardlink" });
+      auto = hardlinkPkg.bind(null, linkOrCopy2);
+      return auto(to, opts2);
+    }
+  }
+}
+function createCloneOrCopyImporter() {
+  let auto = initialAuto;
+  return (to, opts2) => auto(to, opts2);
+  function initialAuto(to, opts2) {
+    try {
+      if (!tryClonePkg(to, opts2))
+        return void 0;
+      packageImportMethodLogger.debug({ method: "clone" });
+      auto = createClonePkg();
+      return "clone";
+    } catch {
+    }
+    packageImportMethodLogger.debug({ method: "copy" });
+    auto = copyPkg;
+    return auto(to, opts2);
+  }
+}
+function tryClonePkg(to, opts2) {
+  if (opts2.resolvedFrom !== "store" || opts2.force || !pkgExistsAtTargetDir(to, opts2.filesMap)) {
+    const clone = createCloneFunction();
+    importIndexedDir({ importFile: clone, importFileAtomic: clone }, to, opts2.filesMap, opts2);
+    removeQuarantineFromNativeBinaries(to, opts2);
+    return "clone";
+  }
+  return void 0;
+}
+function createClonePkg() {
+  const clone = createCloneFunction();
+  const withFallback = (fallback) => (src2, dest) => {
+    try {
+      clone(src2, dest);
+    } catch (err) {
+      if (util7.types.isNativeError(err) && "code" in err && err.code === "ENOTSUP") {
+        fallback(src2, dest);
+        return;
+      }
+      throw err;
+    }
+  };
+  const importer = {
+    importFile: withFallback(resilientCopyFileSync),
+    importFileAtomic: withFallback(atomicCopyFileSync)
+  };
+  return (to, opts2) => {
+    if (opts2.resolvedFrom !== "store" || opts2.force || !pkgExistsAtTargetDir(to, opts2.filesMap)) {
+      importIndexedDir(importer, to, opts2.filesMap, opts2);
+      removeQuarantineFromNativeBinaries(to, opts2);
+      return "clone";
+    }
+    return void 0;
+  };
+}
+function pkgExistsAtTargetDir(targetDir, filesMap) {
+  return existsSync(path15.join(targetDir, pickFileFromFilesMap(filesMap)));
+}
+function pickFileFromFilesMap(filesMap) {
+  if (filesMap.has("package.json")) {
+    return "package.json";
+  }
+  if (filesMap.size === 0) {
+    throw new Error("pickFileFromFilesMap cannot pick a file from an empty FilesMap");
+  }
+  return filesMap.keys().next().value;
+}
+var _cloneFunction;
+function createCloneFunction() {
+  if (_cloneFunction)
+    return _cloneFunction;
+  if (process.platform === "darwin" || process.platform === "win32") {
+    const { reflinkFileSync } = __require("@reflink/reflink");
+    _cloneFunction = (fr, to) => {
+      try {
+        reflinkFileSync(fr, to);
+      } catch (err) {
+        if (!util7.types.isNativeError(err) || !("code" in err) || err.code !== "EEXIST")
+          throw err;
+      }
+    };
+  } else {
+    _cloneFunction = (src2, dest) => {
+      try {
+        lib_default.copyFileSync(src2, dest, constants.COPYFILE_FICLONE_FORCE);
+      } catch (err) {
+        if (!(util7.types.isNativeError(err) && "code" in err && err.code === "EEXIST"))
+          throw err;
+      }
+    };
+  }
+  return _cloneFunction;
+}
+function hardlinkPkg(importFile, to, opts2) {
+  if (opts2.force || shouldRelinkPkg(to, opts2)) {
+    importIndexedDir({ importFile, importFileAtomic: importFile }, to, opts2.filesMap, opts2);
+    removeQuarantineFromNativeBinaries(to, opts2);
+    return "hardlink";
+  }
+  return void 0;
+}
+function shouldRelinkPkg(to, opts2) {
+  if (opts2.disableRelinkLocalDirDeps && opts2.resolvedFrom === "local-dir") {
+    try {
+      const files = lib_default.readdirSync(to);
+      return files.length === 0 || files.length === 1 && files[0] === "node_modules";
+    } catch {
+      return true;
+    }
+  }
+  return opts2.resolvedFrom !== "store" || !pkgLinkedToStore(opts2.filesMap, to);
+}
+function linkOrCopy2(existingPath, newPath) {
+  try {
+    lib_default.linkSync(existingPath, newPath);
+  } catch (err) {
+    if (util7.types.isNativeError(err) && "code" in err && err.code === "EEXIST")
+      return;
+    resilientCopyFileSync(existingPath, newPath);
+  }
+}
+function resilientCopyFileSync(src2, dest) {
+  try {
+    lib_default.copyFileSync(src2, dest);
+  } catch (err) {
+    if (util7.types.isNativeError(err) && "code" in err && err.code === "ENOTSUP") {
+      const srcMode = lib_default.statSync(src2).mode;
+      lib_default.writeFileSync(dest, lib_default.readFileSync(src2), { mode: srcMode });
+    } else {
+      throw err;
+    }
+  }
+}
+function pkgLinkedToStore(filesMap, linkedPkgDir) {
+  const filename = pickFileFromFilesMap(filesMap);
+  const linkedFile = path15.join(linkedPkgDir, filename);
+  let stats0;
+  try {
+    stats0 = lib_default.statSync(linkedFile);
+  } catch (err) {
+    if (util7.types.isNativeError(err) && "code" in err && err.code === "ENOENT")
+      return false;
+  }
+  const stats1 = lib_default.statSync(filesMap.get(filename));
+  if (stats0.ino === stats1.ino)
+    return true;
+  globalInfo(`Relinking ${linkedPkgDir} from the store`);
+  return false;
+}
+function copyPkg(to, opts2) {
+  if (opts2.resolvedFrom !== "store" || opts2.force || !pkgExistsAtTargetDir(to, opts2.filesMap)) {
+    importIndexedDir({ importFile: resilientCopyFileSync, importFileAtomic: atomicCopyFileSync }, to, opts2.filesMap, opts2);
+    removeQuarantineFromNativeBinaries(to, opts2);
+    return "copy";
+  }
+  return void 0;
+}
+function atomicCopyFileSync(src2, dest) {
+  const tmp = fastPathTemp(dest);
+  try {
+    resilientCopyFileSync(src2, tmp);
+  } catch (err) {
+    try {
+      lib_default.unlinkSync(tmp);
+    } catch {
+    }
+    throw err;
+  }
+  renameOverwriteSync(tmp, dest);
+}
+function removeQuarantineFromNativeBinaries(to, opts2) {
+  if (process.platform !== "darwin" || opts2.resolvedFrom !== "store")
+    return;
+  const nativeBinaries = [];
+  for (const file of opts2.filesMap.keys()) {
+    if (isNativeBinary(file)) {
+      nativeBinaries.push(path15.join(to, file));
+    }
+  }
+  removeQuarantine(nativeBinaries);
+}
+
+// ../../../../../setup-pnpm/store/v11/links/@/mimic-function/5.0.1/42ffd44e2cba19e8e133b2bdc7d5939811fa14bc8061d1a5739a299c53ffa2b6/node_modules/mimic-function/index.js
+var copyProperty = (to, from, property, ignoreNonConfigurable) => {
+  if (property === "length" || property === "prototype") {
+    return;
+  }
+  if (property === "arguments" || property === "caller") {
+    return;
+  }
+  const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
+  const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
+  if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
+    return;
+  }
+  Object.defineProperty(to, property, fromDescriptor);
+};
+var canCopyProperty = function(toDescriptor, fromDescriptor) {
+  return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
+};
+var changePrototype = (to, from) => {
+  const fromPrototype = Object.getPrototypeOf(from);
+  if (fromPrototype === Object.getPrototypeOf(to)) {
+    return;
+  }
+  Object.setPrototypeOf(to, fromPrototype);
+};
+var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
+${fromBody}`;
+var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
+var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
+var changeToString = (to, from, name) => {
+  const withName = name === "" ? "" : `with ${name.trim()}() `;
+  const newToString = wrappedToString.bind(null, withName, from.toString());
+  Object.defineProperty(newToString, "name", toStringName);
+  const { writable, enumerable, configurable } = toStringDescriptor;
+  Object.defineProperty(to, "toString", { value: newToString, writable, enumerable, configurable });
+};
+function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
+  const { name } = to;
+  for (const property of Reflect.ownKeys(from)) {
+    copyProperty(to, from, property, ignoreNonConfigurable);
+  }
+  changePrototype(to, from);
+  changeToString(to, from, name);
+  return to;
+}
+
+// ../../../../../setup-pnpm/store/v11/links/@/memoize/11.0.0/1da59602ab45e19a3ba2c86ed324b17bdd4d6b8ab4664663e3c8557861e28a28/node_modules/memoize/distribution/index.js
+var maxTimeoutValue = 2147483647;
+var cacheStore = /* @__PURE__ */ new WeakMap();
+var cacheTimerStore = /* @__PURE__ */ new WeakMap();
+var cacheKeyStore = /* @__PURE__ */ new WeakMap();
+function getValidCacheItem(cache, key) {
+  const item = cache.get(key);
+  if (!item) {
+    return void 0;
+  }
+  if (item.maxAge <= Date.now()) {
+    cache.delete(key);
+    return void 0;
+  }
+  return item;
+}
+function validateMaxAge(value, source) {
+  if (value === Number.POSITIVE_INFINITY) {
+    return;
+  }
+  if (!Number.isFinite(value)) {
+    if (source === "`maxAge` option") {
+      throw new TypeError("The `maxAge` option must be a finite number, `0`, or `Infinity`.");
+    }
+    throw new TypeError("The `maxAge` function must return a finite number, `0`, or `Infinity`.");
+  }
+  if (value > maxTimeoutValue) {
+    if (source === "`maxAge` option") {
+      throw new TypeError(`The \`maxAge\` option cannot exceed ${maxTimeoutValue}.`);
+    }
+    throw new TypeError(`The \`maxAge\` function result cannot exceed ${maxTimeoutValue}.`);
+  }
+}
+function memoize(function_, { cacheKey, cache = /* @__PURE__ */ new Map(), maxAge } = {}) {
+  if (typeof maxAge === "number") {
+    validateMaxAge(maxAge, "`maxAge` option");
+    if (maxAge <= 0) {
+      return function_;
+    }
+  }
+  const memoized = function(...arguments_) {
+    const key = cacheKey ? cacheKey(arguments_) : arguments_[0];
+    const cacheItem = getValidCacheItem(cache, key);
+    if (cacheItem) {
+      return cacheItem.data;
+    }
+    const result = function_.apply(this, arguments_);
+    const computedMaxAge = typeof maxAge === "function" ? maxAge(...arguments_) : maxAge;
+    if (computedMaxAge !== void 0 && computedMaxAge !== Number.POSITIVE_INFINITY) {
+      validateMaxAge(computedMaxAge, "`maxAge` function result");
+      if (computedMaxAge <= 0) {
+        return result;
+      }
+    }
+    cache.set(key, {
+      data: result,
+      maxAge: computedMaxAge === void 0 || computedMaxAge === Number.POSITIVE_INFINITY ? Number.POSITIVE_INFINITY : Date.now() + computedMaxAge
+    });
+    if (computedMaxAge !== void 0 && computedMaxAge !== Number.POSITIVE_INFINITY) {
+      const timer = setTimeout(() => {
+        cache.delete(key);
+        cacheTimerStore.get(memoized)?.delete(timer);
+      }, computedMaxAge);
+      timer.unref?.();
+      const timers = cacheTimerStore.get(memoized) ?? /* @__PURE__ */ new Set();
+      timers.add(timer);
+      cacheTimerStore.set(memoized, timers);
+    }
+    return result;
+  };
+  mimicFunction(memoized, function_, {
+    ignoreNonConfigurable: true
+  });
+  cacheStore.set(memoized, cache);
+  cacheKeyStore.set(memoized, cacheKey ?? ((arguments_) => arguments_[0]));
+  return memoized;
+}
+
+// ../store/create-cafs-store/lib/index.js
+function createPackageImporter(opts2) {
+  const cachedImporterCreator = opts2.importIndexedPackage ? () => opts2.importIndexedPackage : memoize(createIndexedPkgImporter);
+  const packageImportMethod = opts2.packageImportMethod;
+  const gfm = getFlatMap.bind(null, opts2.storeDir);
+  return (to, opts3) => {
+    const { filesMap, isBuilt } = gfm(opts3.filesResponse, opts3.sideEffectsCacheKey);
+    const willBeBuilt = !isBuilt && opts3.requiresBuild;
+    const pkgImportMethod = willBeBuilt ? "clone-or-copy" : opts3.filesResponse.packageImportMethod ?? packageImportMethod;
+    const impPkg = cachedImporterCreator(pkgImportMethod);
+    const importMethod = impPkg(to, {
+      disableRelinkLocalDirDeps: opts3.disableRelinkLocalDirDeps,
+      filesMap,
+      resolvedFrom: opts3.filesResponse.resolvedFrom,
+      force: opts3.force,
+      keepModulesDir: Boolean(opts3.keepModulesDir),
+      safeToSkip: opts3.safeToSkip
+    });
+    return { importMethod, isBuilt };
+  };
+}
+function getFlatMap(storeDir, filesResponse, targetEngine) {
+  if (targetEngine && filesResponse.sideEffectsMaps?.has(targetEngine)) {
+    const sideEffectMap = filesResponse.sideEffectsMaps.get(targetEngine);
+    const filesMap = applySideEffectsDiffWithMaps(filesResponse.filesMap, sideEffectMap);
+    return {
+      filesMap,
+      isBuilt: true
+    };
+  }
+  return {
+    filesMap: filesResponse.filesMap,
+    isBuilt: false
+  };
+}
+function applySideEffectsDiffWithMaps(baseFiles, { added, deleted }) {
+  const filesWithSideEffects = /* @__PURE__ */ new Map();
+  if (added) {
+    for (const [name, filePath] of added.entries()) {
+      filesWithSideEffects.set(name, filePath);
+    }
+  }
+  for (const [fileName, filePath] of baseFiles) {
+    if (!deleted?.includes(fileName) && !filesWithSideEffects.has(fileName)) {
+      filesWithSideEffects.set(fileName, filePath);
+    }
+  }
+  return filesWithSideEffects;
+}
+function createCafsStore(storeDir, opts2) {
+  const baseTempDir = path16.join(storeDir, "tmp");
+  const importPackage2 = createPackageImporter({
+    importIndexedPackage: opts2?.importPackage,
+    packageImportMethod: opts2?.packageImportMethod,
+    storeDir
+  });
+  return {
+    ...createCafs(storeDir, opts2),
+    storeDir,
+    importPackage: importPackage2,
+    tempDir: async () => {
+      await fs10.mkdir(baseTempDir, { recursive: true });
+      return fs10.mkdtemp(path16.join(baseTempDir, "_tmp_"));
+    }
+  };
+}
+
+// ../store/index/lib/index.js
+import fs11 from "node:fs";
+import { createRequire as createRequire2 } from "node:module";
+import { pathToFileURL } from "node:url";
+
+// ../../../../../setup-pnpm/store/v11/links/@/msgpackr/2.0.5/120f9075aeb95a409234328542916ec7ee3248f89cf91e593ced8e5252fd92a6/node_modules/msgpackr/unpack.js
+var decoder;
+try {
+  decoder = new TextDecoder();
+} catch (error) {
+}
+var src;
+var srcEnd;
+var position = 0;
+var EMPTY_ARRAY = [];
+var strings = EMPTY_ARRAY;
+var stringPosition = 0;
+var currentUnpackr = {};
+var currentStructures;
+var srcString;
+var srcStringStart = 0;
+var srcStringEnd = 0;
+var bundledStrings;
+var referenceMap;
+var currentExtensions = [];
+var dataView;
+var defaultOptions = {
+  useRecords: false,
+  mapsAsObjects: true
+};
+var C1Type = class {
+};
+var C1 = new C1Type();
+C1.name = "MessagePack 0xC1";
+var sequentialMode = false;
+var inlineObjectReadThreshold = 2;
+var Unpackr = class _Unpackr {
+  constructor(options) {
+    if (options) {
+      if (options.useRecords === false && options.mapsAsObjects === void 0)
+        options.mapsAsObjects = true;
+      if (options.sequential && options.trusted !== false) {
+        options.trusted = true;
+        if (!options.structures && options.useRecords != false) {
+          options.structures = [];
+          if (!options.maxSharedStructures)
+            options.maxSharedStructures = 0;
+        }
+      }
+      if (options.structures)
+        options.structures.sharedLength = options.structures.length;
+      else if (options.getStructures) {
+        (options.structures = []).uninitialized = true;
+        options.structures.sharedLength = 0;
+      }
+      if (options.int64AsNumber) {
+        options.int64AsType = "number";
+      }
+    }
+    Object.assign(this, options);
+  }
+  unpack(source, options) {
+    if (src) {
+      return saveState(() => {
+        clearSource();
+        return this ? this.unpack(source, options) : _Unpackr.prototype.unpack.call(defaultOptions, source, options);
+      });
+    }
+    if (!source.buffer && source.constructor === ArrayBuffer)
+      source = typeof Buffer !== "undefined" ? Buffer.from(source) : new Uint8Array(source);
+    if (typeof options === "object") {
+      srcEnd = options.end || source.length;
+      position = options.start || 0;
+    } else {
+      position = 0;
+      srcEnd = options > -1 ? options : source.length;
+    }
+    stringPosition = 0;
+    srcStringEnd = 0;
+    srcString = null;
+    strings = EMPTY_ARRAY;
+    bundledStrings = null;
+    src = source;
+    try {
+      dataView = source.dataView || (source.dataView = new DataView(source.buffer, source.byteOffset, source.byteLength));
+    } catch (error) {
+      src = null;
+      if (source instanceof Uint8Array)
+        throw error;
+      throw new Error("Source must be a Uint8Array or Buffer but was a " + (source && typeof source == "object" ? source.constructor.name : typeof source));
+    }
+    if (this instanceof _Unpackr) {
+      currentUnpackr = this;
+      if (this.structures) {
+        currentStructures = this.structures;
+        return checkedRead(options);
+      } else if (!currentStructures || currentStructures.length > 0) {
+        currentStructures = [];
+      }
+    } else {
+      currentUnpackr = defaultOptions;
+      if (!currentStructures || currentStructures.length > 0)
+        currentStructures = [];
+    }
+    return checkedRead(options);
+  }
+  unpackMultiple(source, forEach) {
+    let values, lastPosition = 0;
+    try {
+      sequentialMode = true;
+      let size = source.length;
+      let value = this ? this.unpack(source, size) : defaultUnpackr.unpack(source, size);
+      if (forEach) {
+        if (forEach(value, lastPosition, position) === false) return;
+        while (position < size) {
+          lastPosition = position;
+          if (forEach(checkedRead(), lastPosition, position) === false) {
+            return;
+          }
+        }
+      } else {
+        values = [value];
+        while (position < size) {
+          lastPosition = position;
+          values.push(checkedRead());
+        }
+        return values;
+      }
+    } catch (error) {
+      error.lastPosition = lastPosition;
+      error.values = values;
+      throw error;
+    } finally {
+      sequentialMode = false;
+      clearSource();
+    }
+  }
+  _mergeStructures(loadedStructures, existingStructures) {
+    if (this._onLoadedStructures)
+      loadedStructures = this._onLoadedStructures(loadedStructures);
+    loadedStructures = loadedStructures || [];
+    if (Object.isFrozen(loadedStructures))
+      loadedStructures = loadedStructures.map((structure) => structure.slice(0));
+    for (let i = 0, l = loadedStructures.length; i < l; i++) {
+      let structure = loadedStructures[i];
+      if (structure) {
+        structure.isShared = true;
+        if (i >= 32)
+          structure.highByte = i - 32 >> 5;
+      }
+    }
+    loadedStructures.sharedLength = loadedStructures.length;
+    for (let id in existingStructures || []) {
+      if (id >= 0) {
+        let structure = loadedStructures[id];
+        let existing = existingStructures[id];
+        if (existing) {
+          if (structure)
+            (loadedStructures.restoreStructures || (loadedStructures.restoreStructures = []))[id] = structure;
+          loadedStructures[id] = existing;
+        }
+      }
+    }
+    return this.structures = loadedStructures;
+  }
+  decode(source, options) {
+    return this.unpack(source, options);
+  }
+};
+function checkedRead(options) {
+  try {
+    if (!currentUnpackr.trusted && !sequentialMode) {
+      let sharedLength = currentStructures.sharedLength || 0;
+      if (sharedLength < currentStructures.length)
+        currentStructures.length = sharedLength;
+    }
+    let result;
+    if (currentUnpackr._readStruct && src[position] < 64 && src[position] >= 32) {
+      result = currentUnpackr._readStruct(src, position, srcEnd);
+      src = null;
+      if (!(options && options.lazy) && result)
+        result = result.toJSON();
+      position = srcEnd;
+    } else
+      result = read();
+    if (bundledStrings) {
+      position = bundledStrings.postBundlePosition;
+      bundledStrings = null;
+    }
+    if (sequentialMode)
+      currentStructures.restoreStructures = null;
+    if (position == srcEnd) {
+      if (currentStructures && currentStructures.restoreStructures)
+        restoreStructures();
+      currentStructures = null;
+      src = null;
+      if (referenceMap)
+        referenceMap = null;
+    } else if (position > srcEnd) {
+      throw new Error("Unexpected end of MessagePack data");
+    } else if (!sequentialMode) {
+      let jsonView;
+      try {
+        jsonView = JSON.stringify(result, (_, value) => typeof value === "bigint" ? `${value}n` : value).slice(0, 100);
+      } catch (error) {
+        jsonView = "(JSON view not available " + error + ")";
+      }
+      throw new Error("Data read, but end of buffer not reached " + jsonView);
+    }
+    return result;
+  } catch (error) {
+    if (currentStructures && currentStructures.restoreStructures)
+      restoreStructures();
+    clearSource();
+    if (error instanceof RangeError || error.message.startsWith("Unexpected end of buffer") || position > srcEnd) {
+      error.incomplete = true;
+    }
+    throw error;
+  }
+}
+function restoreStructures() {
+  for (let id in currentStructures.restoreStructures) {
+    currentStructures[id] = currentStructures.restoreStructures[id];
+  }
+  currentStructures.restoreStructures = null;
+}
+function read() {
+  let token = src[position++];
+  if (token < 160) {
+    if (token < 128) {
+      if (token < 64)
+        return token;
+      else {
+        let structure = currentStructures[token & 63] || currentUnpackr.getStructures && loadStructures()[token & 63];
+        if (structure) {
+          if (!structure.read) {
+            structure.read = createStructureReader(structure, token & 63);
+          }
+          return structure.read();
+        } else
+          return token;
+      }
+    } else if (token < 144) {
+      token -= 128;
+      if (currentUnpackr.mapsAsObjects) {
+        let object = {};
+        for (let i = 0; i < token; i++) {
+          let key = readKey();
+          if (key === "__proto__")
+            key = "__proto_";
+          object[key] = read();
+        }
+        return object;
+      } else {
+        let map = /* @__PURE__ */ new Map();
+        for (let i = 0; i < token; i++) {
+          map.set(read(), read());
+        }
+        return map;
+      }
+    } else {
+      token -= 144;
+      let array = new Array(token);
+      for (let i = 0; i < token; i++) {
+        array[i] = read();
+      }
+      if (currentUnpackr.freezeData)
+        return Object.freeze(array);
+      return array;
+    }
+  } else if (token < 192) {
+    let length = token - 160;
+    if (srcStringEnd >= position) {
+      return srcString.slice(position - srcStringStart, (position += length) - srcStringStart);
+    }
+    if (srcStringEnd == 0 && srcEnd < 140) {
+      let string = length < 16 ? shortStringInJS(length) : longStringInJS(length);
+      if (string != null)
+        return string;
+    }
+    return readFixedString(length);
+  } else {
+    let value;
+    switch (token) {
+      case 192:
+        return null;
+      case 193:
+        if (bundledStrings) {
+          value = read();
+          if (value > 0)
+            return bundledStrings[1].slice(bundledStrings.position1, bundledStrings.position1 += value);
+          else
+            return bundledStrings[0].slice(bundledStrings.position0, bundledStrings.position0 -= value);
+        }
+        return C1;
+      // "never-used", return special object to denote that
+      case 194:
+        return false;
+      case 195:
+        return true;
+      case 196:
+        value = src[position++];
+        if (value === void 0)
+          throw new Error("Unexpected end of buffer");
+        return readBin(value);
+      case 197:
+        value = dataView.getUint16(position);
+        position += 2;
+        return readBin(value);
+      case 198:
+        value = dataView.getUint32(position);
+        position += 4;
+        return readBin(value);
+      case 199:
+        return readExt(src[position++]);
+      case 200:
+        value = dataView.getUint16(position);
+        position += 2;
+        return readExt(value);
+      case 201:
+        value = dataView.getUint32(position);
+        position += 4;
+        return readExt(value);
+      case 202:
+        value = dataView.getFloat32(position);
+        if (currentUnpackr.useFloat32 > 2) {
+          let multiplier = mult10[(src[position] & 127) << 1 | src[position + 1] >> 7];
+          position += 4;
+          return (multiplier * value + (value > 0 ? 0.5 : -0.5) >> 0) / multiplier;
+        }
+        position += 4;
+        return value;
+      case 203:
+        value = dataView.getFloat64(position);
+        position += 8;
+        return value;
+      // uint handlers
+      case 204:
+        return src[position++];
+      case 205:
+        value = dataView.getUint16(position);
+        position += 2;
+        return value;
+      case 206:
+        value = dataView.getUint32(position);
+        position += 4;
+        return value;
+      case 207:
+        if (currentUnpackr.int64AsType === "number") {
+          value = dataView.getUint32(position) * 4294967296;
+          value += dataView.getUint32(position + 4);
+        } else if (currentUnpackr.int64AsType === "string") {
+          value = dataView.getBigUint64(position).toString();
+        } else if (currentUnpackr.int64AsType === "auto") {
+          value = dataView.getBigUint64(position);
+          if (value <= BigInt(2) << BigInt(52)) value = Number(value);
+        } else
+          value = dataView.getBigUint64(position);
+        position += 8;
+        return value;
+      // int handlers
+      case 208:
+        return dataView.getInt8(position++);
+      case 209:
+        value = dataView.getInt16(position);
+        position += 2;
+        return value;
+      case 210:
+        value = dataView.getInt32(position);
+        position += 4;
+        return value;
+      case 211:
+        if (currentUnpackr.int64AsType === "number") {
+          value = dataView.getInt32(position) * 4294967296;
+          value += dataView.getUint32(position + 4);
+        } else if (currentUnpackr.int64AsType === "string") {
+          value = dataView.getBigInt64(position).toString();
+        } else if (currentUnpackr.int64AsType === "auto") {
+          value = dataView.getBigInt64(position);
+          if (value >= BigInt(-2) << BigInt(52) && value <= BigInt(2) << BigInt(52)) value = Number(value);
+        } else
+          value = dataView.getBigInt64(position);
+        position += 8;
+        return value;
+      case 212:
+        value = src[position++];
+        if (value == 114) {
+          return recordDefinition(src[position++] & 63);
+        } else {
+          let extension = currentExtensions[value];
+          if (extension) {
+            if (extension.read) {
+              position++;
+              return extension.read(read());
+            } else if (extension.noBuffer) {
+              position++;
+              return extension();
+            } else
+              return extension(src.subarray(position, ++position));
+          } else
+            throw new Error("Unknown extension " + value);
+        }
+      case 213:
+        value = src[position];
+        if (value == 114) {
+          position++;
+          return recordDefinition(src[position++] & 63, src[position++]);
+        } else
+          return readExt(2);
+      case 214:
+        return readExt(4);
+      case 215:
+        return readExt(8);
+      case 216:
+        return readExt(16);
+      case 217:
+        value = src[position++];
+        if (srcStringEnd >= position) {
+          return srcString.slice(position - srcStringStart, (position += value) - srcStringStart);
+        }
+        return readString8(value);
+      case 218:
+        value = dataView.getUint16(position);
+        position += 2;
+        if (srcStringEnd >= position) {
+          return srcString.slice(position - srcStringStart, (position += value) - srcStringStart);
+        }
+        return readString16(value);
+      case 219:
+        value = dataView.getUint32(position);
+        position += 4;
+        if (srcStringEnd >= position) {
+          return srcString.slice(position - srcStringStart, (position += value) - srcStringStart);
+        }
+        return readString32(value);
+      case 220:
+        value = dataView.getUint16(position);
+        position += 2;
+        return readArray(value);
+      case 221:
+        value = dataView.getUint32(position);
+        position += 4;
+        return readArray(value);
+      case 222:
+        value = dataView.getUint16(position);
+        position += 2;
+        return readMap(value);
+      case 223:
+        value = dataView.getUint32(position);
+        position += 4;
+        return readMap(value);
+      default:
+        if (token >= 224)
+          return token - 256;
+        if (token === void 0) {
+          let error = new Error("Unexpected end of MessagePack data");
+          error.incomplete = true;
+          throw error;
+        }
+        throw new Error("Unknown MessagePack token " + token);
+    }
+  }
+}
+var validName = /^[a-zA-Z_$][a-zA-Z\d_$]*$/;
+function createStructureReader(structure, firstId) {
+  function readObject() {
+    if (readObject.count++ > inlineObjectReadThreshold) {
+      let optimizedReadObject;
+      try {
+        optimizedReadObject = structure.read = new Function("r", "return function(){return " + (currentUnpackr.freezeData ? "Object.freeze" : "") + "({" + structure.map((key) => key === "__proto__" ? "__proto_:r()" : validName.test(key) ? key + ":r()" : "[" + JSON.stringify(key) + "]:r()").join(",") + "})}")(read);
+      } catch (error) {
+        inlineObjectReadThreshold = Infinity;
+        return readObject();
+      }
+      structure.read0 = optimizedReadObject;
+      if (structure.highByte === 0)
+        structure.read = createSecondByteReader(firstId, structure.read);
+      return optimizedReadObject();
+    }
+    let object = {};
+    for (let i = 0, l = structure.length; i < l; i++) {
+      let key = structure[i];
+      if (key === "__proto__")
+        key = "__proto_";
+      object[key] = read();
+    }
+    if (currentUnpackr.freezeData)
+      return Object.freeze(object);
+    return object;
+  }
+  readObject.count = 0;
+  structure.read0 = readObject;
+  if (structure.highByte === 0) {
+    return createSecondByteReader(firstId, readObject);
+  }
+  return readObject;
+}
+var createSecondByteReader = (firstId, read0) => {
+  return function() {
+    let highByte = src[position++];
+    if (highByte === 0)
+      return read0();
+    let id = firstId < 32 ? -(firstId + (highByte << 5)) : firstId + (highByte << 5);
+    let structure = currentStructures[id] || loadStructures()[id];
+    if (!structure) {
+      throw new Error("Record id is not defined for " + id);
+    }
+    if (!structure.read)
+      structure.read = createStructureReader(structure, firstId);
+    return structure.read();
+  };
+};
+function loadStructures() {
+  let loadedStructures = saveState(() => {
+    src = null;
+    return currentUnpackr.getStructures();
+  });
+  return currentStructures = currentUnpackr._mergeStructures(loadedStructures, currentStructures);
+}
+var readFixedString = readStringJS;
+var readString8 = readStringJS;
+var readString16 = readStringJS;
+var readString32 = readStringJS;
+var isNativeAccelerationEnabled = false;
+function setExtractor(extractStrings) {
+  isNativeAccelerationEnabled = true;
+  readFixedString = readString(1);
+  readString8 = readString(2);
+  readString16 = readString(3);
+  readString32 = readString(5);
+  function readString(headerLength) {
+    return function readString2(length) {
+      let string = strings[stringPosition++];
+      if (string == null) {
+        if (bundledStrings)
+          return readStringJS(length);
+        let byteOffset = src.byteOffset;
+        let extraction = extractStrings(position - headerLength + byteOffset, srcEnd + byteOffset, src.buffer);
+        if (typeof extraction == "string") {
+          string = extraction;
+          strings = EMPTY_ARRAY;
+        } else {
+          strings = extraction;
+          stringPosition = 1;
+          srcStringEnd = 1;
+          string = strings[0];
+          if (string === void 0)
+            throw new Error("Unexpected end of buffer");
+        }
+      }
+      let srcStringLength = string.length;
+      if (srcStringLength <= length) {
+        position += length;
+        return string;
+      }
+      srcString = string;
+      srcStringStart = position;
+      srcStringEnd = position + srcStringLength;
+      position += length;
+      return string.slice(0, length);
+    };
+  }
+}
+function readStringJS(length) {
+  let result;
+  if (length < 16) {
+    if (result = shortStringInJS(length))
+      return result;
+  }
+  if (length > 64 && decoder)
+    return decoder.decode(src.subarray(position, position += length));
+  const end = position + length;
+  const units = [];
+  result = "";
+  while (position < end) {
+    const byte1 = src[position++];
+    if ((byte1 & 128) === 0) {
+      units.push(byte1);
+    } else if ((byte1 & 224) === 192) {
+      if (byte1 < 194 || position >= end || (src[position] & 192) !== 128) {
+        units.push(65533);
+      } else {
+        const byte2 = src[position++] & 63;
+        units.push((byte1 & 31) << 6 | byte2);
+      }
+    } else if ((byte1 & 240) === 224) {
+      const byte2 = position < end ? src[position] : 0;
+      if (position >= end || (byte2 & 192) !== 128 || byte1 === 224 && byte2 < 160 || byte1 === 237 && byte2 >= 160) {
+        units.push(65533);
+      } else {
+        position++;
+        if (position >= end || (src[position] & 192) !== 128) {
+          units.push(65533);
+        } else {
+          const byte3 = src[position++] & 63;
+          units.push((byte1 & 31) << 12 | (byte2 & 63) << 6 | byte3);
+        }
+      }
+    } else if ((byte1 & 248) === 240) {
+      const byte2 = position < end ? src[position] : 0;
+      if (byte1 > 244 || position >= end || (byte2 & 192) !== 128 || byte1 === 240 && byte2 < 144 || byte1 === 244 && byte2 >= 144) {
+        units.push(65533);
+      } else {
+        position++;
+        if (position >= end || (src[position] & 192) !== 128) {
+          units.push(65533);
+        } else {
+          const byte3 = src[position++] & 63;
+          if (position >= end || (src[position] & 192) !== 128) {
+            units.push(65533);
+          } else {
+            const byte4 = src[position++] & 63;
+            let unit = (byte1 & 7) << 18 | (byte2 & 63) << 12 | byte3 << 6 | byte4;
+            unit -= 65536;
+            units.push(unit >>> 10 & 1023 | 55296);
+            units.push(56320 | unit & 1023);
+          }
+        }
+      }
+    } else {
+      units.push(65533);
+    }
+    if (units.length >= 4096) {
+      result += fromCharCode.apply(String, units);
+      units.length = 0;
+    }
+  }
+  if (units.length > 0) {
+    result += fromCharCode.apply(String, units);
+  }
+  return result;
+}
+function readArray(length) {
+  let array = new Array(length);
+  for (let i = 0; i < length; i++) {
+    array[i] = read();
+  }
+  if (currentUnpackr.freezeData)
+    return Object.freeze(array);
+  return array;
+}
+function readMap(length) {
+  if (currentUnpackr.mapsAsObjects) {
+    let object = {};
+    for (let i = 0; i < length; i++) {
+      let key = readKey();
+      if (key === "__proto__")
+        key = "__proto_";
+      object[key] = read();
+    }
+    return object;
+  } else {
+    let map = /* @__PURE__ */ new Map();
+    for (let i = 0; i < length; i++) {
+      map.set(read(), read());
+    }
+    return map;
+  }
+}
+var fromCharCode = String.fromCharCode;
+function longStringInJS(length) {
+  let start = position;
+  let bytes = new Array(length);
+  for (let i = 0; i < length; i++) {
+    const byte = src[position++];
+    if ((byte & 128) > 0) {
+      position = start;
+      return;
+    }
+    bytes[i] = byte;
+  }
+  return fromCharCode.apply(String, bytes);
+}
+function shortStringInJS(length) {
+  if (length < 4) {
+    if (length < 2) {
+      if (length === 0)
+        return "";
+      else {
+        let a = src[position++];
+        if ((a & 128) > 1) {
+          position -= 1;
+          return;
+        }
+        return fromCharCode(a);
+      }
+    } else {
+      let a = src[position++];
+      let b = src[position++];
+      if ((a & 128) > 0 || (b & 128) > 0) {
+        position -= 2;
+        return;
+      }
+      if (length < 3)
+        return fromCharCode(a, b);
+      let c = src[position++];
+      if ((c & 128) > 0) {
+        position -= 3;
+        return;
+      }
+      return fromCharCode(a, b, c);
+    }
+  } else {
+    let a = src[position++];
+    let b = src[position++];
+    let c = src[position++];
+    let d = src[position++];
+    if ((a & 128) > 0 || (b & 128) > 0 || (c & 128) > 0 || (d & 128) > 0) {
+      position -= 4;
+      return;
+    }
+    if (length < 6) {
+      if (length === 4)
+        return fromCharCode(a, b, c, d);
+      else {
+        let e = src[position++];
+        if ((e & 128) > 0) {
+          position -= 5;
+          return;
+        }
+        return fromCharCode(a, b, c, d, e);
+      }
+    } else if (length < 8) {
+      let e = src[position++];
+      let f = src[position++];
+      if ((e & 128) > 0 || (f & 128) > 0) {
+        position -= 6;
+        return;
+      }
+      if (length < 7)
+        return fromCharCode(a, b, c, d, e, f);
+      let g = src[position++];
+      if ((g & 128) > 0) {
+        position -= 7;
+        return;
+      }
+      return fromCharCode(a, b, c, d, e, f, g);
+    } else {
+      let e = src[position++];
+      let f = src[position++];
+      let g = src[position++];
+      let h = src[position++];
+      if ((e & 128) > 0 || (f & 128) > 0 || (g & 128) > 0 || (h & 128) > 0) {
+        position -= 8;
+        return;
+      }
+      if (length < 10) {
+        if (length === 8)
+          return fromCharCode(a, b, c, d, e, f, g, h);
+        else {
+          let i = src[position++];
+          if ((i & 128) > 0) {
+            position -= 9;
+            return;
+          }
+          return fromCharCode(a, b, c, d, e, f, g, h, i);
+        }
+      } else if (length < 12) {
+        let i = src[position++];
+        let j = src[position++];
+        if ((i & 128) > 0 || (j & 128) > 0) {
+          position -= 10;
+          return;
+        }
+        if (length < 11)
+          return fromCharCode(a, b, c, d, e, f, g, h, i, j);
+        let k = src[position++];
+        if ((k & 128) > 0) {
+          position -= 11;
+          return;
+        }
+        return fromCharCode(a, b, c, d, e, f, g, h, i, j, k);
+      } else {
+        let i = src[position++];
+        let j = src[position++];
+        let k = src[position++];
+        let l = src[position++];
+        if ((i & 128) > 0 || (j & 128) > 0 || (k & 128) > 0 || (l & 128) > 0) {
+          position -= 12;
+          return;
+        }
+        if (length < 14) {
+          if (length === 12)
+            return fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l);
+          else {
+            let m = src[position++];
+            if ((m & 128) > 0) {
+              position -= 13;
+              return;
+            }
+            return fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l, m);
+          }
+        } else {
+          let m = src[position++];
+          let n = src[position++];
+          if ((m & 128) > 0 || (n & 128) > 0) {
+            position -= 14;
+            return;
+          }
+          if (length < 15)
+            return fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l, m, n);
+          let o = src[position++];
+          if ((o & 128) > 0) {
+            position -= 15;
+            return;
+          }
+          return fromCharCode(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
+        }
+      }
+    }
+  }
+}
+function readOnlyJSString() {
+  let token = src[position++];
+  let length;
+  if (token < 192) {
+    length = token - 160;
+  } else {
+    switch (token) {
+      case 217:
+        length = src[position++];
+        break;
+      case 218:
+        length = dataView.getUint16(position);
+        position += 2;
+        break;
+      case 219:
+        length = dataView.getUint32(position);
+        position += 4;
+        break;
+      default:
+        throw new Error("Expected string");
+    }
+  }
+  return readStringJS(length);
+}
+function readBin(length) {
+  return currentUnpackr.copyBuffers ? (
+    // specifically use the copying slice (not the node one)
+    Uint8Array.prototype.slice.call(src, position, position += length)
+  ) : src.subarray(position, position += length);
+}
+function readExt(length) {
+  let type = src[position++];
+  if (currentExtensions[type]) {
+    let end;
+    return currentExtensions[type](src.subarray(position, end = position += length), (readPosition) => {
+      position = readPosition;
+      try {
+        return read();
+      } finally {
+        position = end;
+      }
+    });
+  } else
+    throw new Error("Unknown extension type " + type);
+}
+var keyCache = new Array(4096);
+function readKey() {
+  let length = src[position++];
+  if (length >= 160 && length < 192) {
+    length = length - 160;
+    if (srcStringEnd >= position)
+      return srcString.slice(position - srcStringStart, (position += length) - srcStringStart);
+    else if (!(srcStringEnd == 0 && srcEnd < 180))
+      return readFixedString(length);
+  } else {
+    position--;
+    return asSafeString(read());
+  }
+  let key = (length << 5 ^ (length > 1 ? dataView.getUint16(position) : length > 0 ? src[position] : 0)) & 4095;
+  let entry = keyCache[key];
+  let checkPosition = position;
+  let end = position + length - 3;
+  let chunk;
+  let i = 0;
+  if (entry && entry.bytes == length) {
+    while (checkPosition < end) {
+      chunk = dataView.getUint32(checkPosition);
+      if (chunk != entry[i++]) {
+        checkPosition = 1879048192;
+        break;
+      }
+      checkPosition += 4;
+    }
+    end += 3;
+    while (checkPosition < end) {
+      chunk = src[checkPosition++];
+      if (chunk != entry[i++]) {
+        checkPosition = 1879048192;
+        break;
+      }
+    }
+    if (checkPosition === end) {
+      position = checkPosition;
+      return entry.string;
+    }
+    end -= 3;
+    checkPosition = position;
+  }
+  entry = [];
+  keyCache[key] = entry;
+  entry.bytes = length;
+  while (checkPosition < end) {
+    chunk = dataView.getUint32(checkPosition);
+    entry.push(chunk);
+    checkPosition += 4;
+  }
+  end += 3;
+  while (checkPosition < end) {
+    chunk = src[checkPosition++];
+    entry.push(chunk);
+  }
+  let string = length < 16 ? shortStringInJS(length) : longStringInJS(length);
+  if (string != null)
+    return entry.string = string;
+  return entry.string = readFixedString(length);
+}
+function asSafeString(property) {
+  if (typeof property === "string") return property;
+  if (typeof property === "number" || typeof property === "boolean" || typeof property === "bigint") return property.toString();
+  if (property == null) return property + "";
+  if (currentUnpackr.allowArraysInMapKeys && Array.isArray(property) && property.flat().every((item) => ["string", "number", "boolean", "bigint"].includes(typeof item))) {
+    return property.flat().toString();
+  }
+  throw new Error(`Invalid property type for record: ${typeof property}`);
+}
+var recordDefinition = (id, highByte) => {
+  let structure = read().map(asSafeString);
+  let firstByte = id;
+  if (highByte !== void 0) {
+    id = id < 32 ? -((highByte << 5) + id) : (highByte << 5) + id;
+    structure.highByte = highByte;
+  }
+  let existingStructure = currentStructures[id];
+  if (existingStructure && (existingStructure.isShared || sequentialMode)) {
+    (currentStructures.restoreStructures || (currentStructures.restoreStructures = []))[id] = existingStructure;
+  }
+  currentStructures[id] = structure;
+  structure.read = createStructureReader(structure, firstByte);
+  return (structure.read0 || structure.read)();
+};
+currentExtensions[0] = () => {
+};
+currentExtensions[0].noBuffer = true;
+currentExtensions[66] = (data) => {
+  let headLength = data.byteLength % 8 || 8;
+  let head = BigInt(data[0] & 128 ? data[0] - 256 : data[0]);
+  for (let i = 1; i < headLength; i++) {
+    head <<= BigInt(8);
+    head += BigInt(data[i]);
+  }
+  if (data.byteLength !== headLength) {
+    let view = new DataView(data.buffer, data.byteOffset, data.byteLength);
+    let decode2 = (start, end) => {
+      let length = end - start;
+      if (length <= 40) {
+        let out = view.getBigUint64(start);
+        for (let i = start + 8; i < end; i += 8) {
+          out <<= BigInt(64);
+          out |= view.getBigUint64(i);
+        }
+        return out;
+      }
+      let middle = start + (length >> 4 << 3);
+      let left = decode2(start, middle);
+      let right = decode2(middle, end);
+      return left << BigInt((end - middle) * 8) | right;
+    };
+    head = head << BigInt((view.byteLength - headLength) * 8) | decode2(headLength, view.byteLength);
+  }
+  return head;
+};
+var errors = {
+  Error,
+  EvalError,
+  RangeError,
+  ReferenceError,
+  SyntaxError,
+  TypeError,
+  URIError,
+  AggregateError: typeof AggregateError === "function" ? AggregateError : null
+};
+currentExtensions[101] = () => {
+  let data = read();
+  if (!errors[data[0]]) {
+    let error = Error(data[1], { cause: data[2] });
+    error.name = data[0];
+    return error;
+  }
+  return errors[data[0]](data[1], { cause: data[2] });
+};
+currentExtensions[105] = (data) => {
+  if (currentUnpackr.structuredClone === false) throw new Error("Structured clone extension is disabled");
+  let id = dataView.getUint32(position - 4);
+  if (!referenceMap)
+    referenceMap = /* @__PURE__ */ new Map();
+  let token = src[position];
+  let target2;
+  if (token >= 144 && token < 160 || token == 220 || token == 221)
+    target2 = [];
+  else if (token >= 128 && token < 144 || token == 222 || token == 223)
+    target2 = /* @__PURE__ */ new Map();
+  else if ((token >= 199 && token <= 201 || token >= 212 && token <= 216) && src[position + 1] === 115)
+    target2 = /* @__PURE__ */ new Set();
+  else
+    target2 = {};
+  let refEntry = { target: target2 };
+  referenceMap.set(id, refEntry);
+  let targetProperties = read();
+  if (!refEntry.used) {
+    return refEntry.target = targetProperties;
+  } else {
+    Object.assign(target2, targetProperties);
+  }
+  if (target2 instanceof Map)
+    for (let [k, v] of targetProperties.entries()) target2.set(k, v);
+  if (target2 instanceof Set)
+    for (let i of Array.from(targetProperties)) target2.add(i);
+  return target2;
+};
+currentExtensions[112] = (data) => {
+  if (currentUnpackr.structuredClone === false) throw new Error("Structured clone extension is disabled");
+  let id = dataView.getUint32(position - 4);
+  let refEntry = referenceMap.get(id);
+  refEntry.used = true;
+  return refEntry.target;
+};
+currentExtensions[115] = () => new Set(read());
+var typedArrays = ["Int8", "Uint8", "Uint8Clamped", "Int16", "Uint16", "Int32", "Uint32", "Float32", "Float64", "BigInt64", "BigUint64"].map((type) => type + "Array");
+var glbl = typeof globalThis === "object" ? globalThis : window;
+currentExtensions[116] = (data) => {
+  let typeCode = data[0];
+  let buffer = Uint8Array.prototype.slice.call(data, 1).buffer;
+  let typedArrayName = typedArrays[typeCode];
+  if (!typedArrayName) {
+    if (typeCode === 16) return buffer;
+    if (typeCode === 17) return new DataView(buffer);
+    throw new Error("Could not find typed array for code " + typeCode);
+  }
+  return new glbl[typedArrayName](buffer);
+};
+currentExtensions[120] = () => {
+  let data = read();
+  return new RegExp(data[0], data[1]);
+};
+var TEMP_BUNDLE = [];
+currentExtensions[98] = (data) => {
+  let dataSize = (data[0] << 24) + (data[1] << 16) + (data[2] << 8) + data[3];
+  let dataPosition = position;
+  position += dataSize - data.length;
+  bundledStrings = TEMP_BUNDLE;
+  bundledStrings = [readOnlyJSString(), readOnlyJSString()];
+  bundledStrings.position0 = 0;
+  bundledStrings.position1 = 0;
+  bundledStrings.postBundlePosition = position;
+  position = dataPosition;
+  return read();
+};
+currentExtensions[255] = (data) => {
+  if (data.length == 4)
+    return new Date((data[0] * 16777216 + (data[1] << 16) + (data[2] << 8) + data[3]) * 1e3);
+  else if (data.length == 8)
+    return new Date(
+      ((data[0] << 22) + (data[1] << 14) + (data[2] << 6) + (data[3] >> 2)) / 1e6 + ((data[3] & 3) * 4294967296 + data[4] * 16777216 + (data[5] << 16) + (data[6] << 8) + data[7]) * 1e3
+    );
+  else if (data.length == 12)
+    return new Date(
+      ((data[0] << 24) + (data[1] << 16) + (data[2] << 8) + data[3]) / 1e6 + ((data[4] & 128 ? -281474976710656 : 0) + data[6] * 1099511627776 + data[7] * 4294967296 + data[8] * 16777216 + (data[9] << 16) + (data[10] << 8) + data[11]) * 1e3
+    );
+  else
+    return /* @__PURE__ */ new Date("invalid");
+};
+function saveState(callback) {
+  if (currentUnpackr && currentUnpackr._onSaveState)
+    currentUnpackr._onSaveState();
+  let savedSrcEnd = srcEnd;
+  let savedPosition = position;
+  let savedStringPosition = stringPosition;
+  let savedSrcStringStart = srcStringStart;
+  let savedSrcStringEnd = srcStringEnd;
+  let savedSrcString = srcString;
+  let savedStrings = strings;
+  let savedReferenceMap = referenceMap;
+  let savedBundledStrings = bundledStrings;
+  let savedSrc = new Uint8Array(src.slice(0, srcEnd));
+  let savedStructures = currentStructures;
+  let savedStructuresContents = currentStructures.slice(0, currentStructures.length);
+  let savedPackr = currentUnpackr;
+  let savedSequentialMode = sequentialMode;
+  let value = callback();
+  srcEnd = savedSrcEnd;
+  position = savedPosition;
+  stringPosition = savedStringPosition;
+  srcStringStart = savedSrcStringStart;
+  srcStringEnd = savedSrcStringEnd;
+  srcString = savedSrcString;
+  strings = savedStrings;
+  referenceMap = savedReferenceMap;
+  bundledStrings = savedBundledStrings;
+  src = savedSrc;
+  sequentialMode = savedSequentialMode;
+  currentStructures = savedStructures;
+  currentStructures.splice(0, currentStructures.length, ...savedStructuresContents);
+  currentUnpackr = savedPackr;
+  dataView = new DataView(src.buffer, src.byteOffset, src.byteLength);
+  return value;
+}
+function clearSource() {
+  src = null;
+  referenceMap = null;
+  currentStructures = null;
+}
+var mult10 = new Array(147);
+for (let i = 0; i < 256; i++) {
+  mult10[i] = +("1e" + Math.floor(45.15 - i * 0.30103));
+}
+var defaultUnpackr = new Unpackr({ useRecords: false });
+var unpack = defaultUnpackr.unpack;
+var unpackMultiple = defaultUnpackr.unpackMultiple;
+var decode = defaultUnpackr.unpack;
+var FLOAT32_OPTIONS = {
+  NEVER: 0,
+  ALWAYS: 1,
+  DECIMAL_ROUND: 3,
+  DECIMAL_FIT: 4
+};
+var f32Array = new Float32Array(1);
+var u8Array = new Uint8Array(f32Array.buffer, 0, 4);
+Unpackr.SUPPORTS_STRUCT_HOOKS = true;
+
+// ../../../../../setup-pnpm/store/v11/links/@/msgpackr/2.0.5/120f9075aeb95a409234328542916ec7ee3248f89cf91e593ced8e5252fd92a6/node_modules/msgpackr/pack.js
+var textEncoder;
+try {
+  textEncoder = new TextEncoder();
+} catch (error) {
+}
+var extensions;
+var extensionClasses;
+var hasNodeBuffer = typeof Buffer !== "undefined";
+var ByteArrayAllocate = hasNodeBuffer ? function(length) {
+  return Buffer.allocUnsafeSlow(length);
+} : Uint8Array;
+var ByteArray = hasNodeBuffer ? Buffer : Uint8Array;
+var MAX_BUFFER_SIZE = hasNodeBuffer ? 4294967296 : 2144337920;
+var target;
+var keysTarget;
+var targetView;
+var position2 = 0;
+var safeEnd;
+var bundledStrings2 = null;
+var MAX_BUNDLE_SIZE = 21760;
+var hasNonLatin = /[\u0080-\uFFFF]/;
+var RECORD_SYMBOL = /* @__PURE__ */ Symbol("record-id");
+var Packr = class extends Unpackr {
+  constructor(options) {
+    super(options);
+    this.offset = 0;
+    let typeBuffer;
+    let start;
+    let hasSharedUpdate;
+    let structures;
+    let referenceMap2;
+    let encodeUtf8 = ByteArray.prototype.utf8Write ? function(string, position3) {
+      return target.utf8Write(string, position3, target.byteLength - position3);
+    } : textEncoder && textEncoder.encodeInto ? function(string, position3) {
+      return textEncoder.encodeInto(string, target.subarray(position3)).written;
+    } : false;
+    let packr2 = this;
+    if (!options)
+      options = {};
+    let isSequential = options && options.sequential;
+    let hasSharedStructures = options.structures || options.saveStructures;
+    let maxSharedStructures = options.maxSharedStructures;
+    if (maxSharedStructures == null)
+      maxSharedStructures = hasSharedStructures ? 32 : 0;
+    if (maxSharedStructures > 8160)
+      throw new Error("Maximum maxSharedStructure is 8160");
+    if (options.structuredClone && options.moreTypes == void 0) {
+      this.moreTypes = true;
+    }
+    let maxOwnStructures = options.maxOwnStructures;
+    if (maxOwnStructures == null)
+      maxOwnStructures = hasSharedStructures ? 32 : 64;
+    if (!this.structures && options.useRecords != false)
+      this.structures = [];
+    let useTwoByteRecords = maxSharedStructures > 32 || maxOwnStructures + maxSharedStructures > 64;
+    let sharedLimitId = maxSharedStructures + 64;
+    let maxStructureId = maxSharedStructures + maxOwnStructures + 64;
+    if (maxStructureId > 8256) {
+      throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");
+    }
+    let recordIdsToRemove = [];
+    let transitionsCount = 0;
+    let serializationsSinceTransitionRebuild = 0;
+    this.pack = this.encode = function(value, encodeOptions) {
+      if (!target) {
+        target = new ByteArrayAllocate(8192);
+        targetView = target.dataView || (target.dataView = new DataView(target.buffer, 0, 8192));
+        position2 = 0;
+      }
+      safeEnd = target.length - 10;
+      if (safeEnd - position2 < 2048) {
+        target = new ByteArrayAllocate(target.length);
+        targetView = target.dataView || (target.dataView = new DataView(target.buffer, 0, target.length));
+        safeEnd = target.length - 10;
+        position2 = 0;
+      } else
+        position2 = position2 + 7 & 2147483640;
+      start = position2;
+      if (encodeOptions & RESERVE_START_SPACE) position2 += encodeOptions & 255;
+      referenceMap2 = packr2.structuredClone ? /* @__PURE__ */ new Map() : null;
+      if (packr2.bundleStrings && typeof value !== "string") {
+        bundledStrings2 = [];
+        bundledStrings2.size = Infinity;
+      } else
+        bundledStrings2 = null;
+      structures = packr2.structures;
+      if (structures) {
+        if (structures.uninitialized)
+          structures = packr2._mergeStructures(packr2.getStructures());
+        let sharedLength = structures.sharedLength || 0;
+        if (sharedLength > maxSharedStructures) {
+          throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to " + structures.sharedLength);
+        }
+        if (!structures.transitions) {
+          structures.transitions = /* @__PURE__ */ Object.create(null);
+          for (let i = 0; i < sharedLength; i++) {
+            let keys = structures[i];
+            if (!keys)
+              continue;
+            let nextTransition, transition = structures.transitions;
+            for (let j = 0, l = keys.length; j < l; j++) {
+              let key = keys[j];
+              nextTransition = transition[key];
+              if (!nextTransition) {
+                nextTransition = transition[key] = /* @__PURE__ */ Object.create(null);
+              }
+              transition = nextTransition;
+            }
+            transition[RECORD_SYMBOL] = i + 64;
+          }
+          this.lastNamedStructuresLength = sharedLength;
+        }
+        if (!isSequential) {
+          structures.nextId = sharedLength + 64;
+        }
+      }
+      if (hasSharedUpdate)
+        hasSharedUpdate = false;
+      let encodingError;
+      try {
+        if (packr2._writeStruct && value && typeof value === "object") {
+          if (value.constructor === Object) writeStruct(value);
+          else if (value.constructor !== Map && !Array.isArray(value) && !extensionClasses.some((extClass) => value instanceof extClass)) {
+            writeStruct(value.toJSON ? value.toJSON() : value);
+          } else pack2(value);
+        } else
+          pack2(value);
+        let lastBundle = bundledStrings2;
+        if (bundledStrings2)
+          writeBundles(start, pack2, 0);
+        if (referenceMap2 && referenceMap2.idsToInsert) {
+          let idsToInsert = referenceMap2.idsToInsert.sort((a, b) => a.offset > b.offset ? 1 : -1);
+          let i = idsToInsert.length;
+          let incrementPosition = -1;
+          while (lastBundle && i > 0) {
+            let insertionPoint = idsToInsert[--i].offset + start;
+            if (insertionPoint < lastBundle.stringsPosition + start && incrementPosition === -1)
+              incrementPosition = 0;
+            if (insertionPoint > lastBundle.position + start) {
+              if (incrementPosition >= 0)
+                incrementPosition += 6;
+            } else {
+              if (incrementPosition >= 0) {
+                targetView.setUint32(
+                  lastBundle.position + start,
+                  targetView.getUint32(lastBundle.position + start) + incrementPosition
+                );
+                incrementPosition = -1;
+              }
+              lastBundle = lastBundle.previous;
+              i++;
+            }
+          }
+          if (incrementPosition >= 0 && lastBundle) {
+            targetView.setUint32(
+              lastBundle.position + start,
+              targetView.getUint32(lastBundle.position + start) + incrementPosition
+            );
+          }
+          position2 += idsToInsert.length * 6;
+          if (position2 > safeEnd)
+            makeRoom(position2);
+          packr2.offset = position2;
+          let serialized = insertIds(target.subarray(start, position2), idsToInsert);
+          referenceMap2 = null;
+          return serialized;
+        }
+        packr2.offset = position2;
+        if (encodeOptions & REUSE_BUFFER_MODE) {
+          target.start = start;
+          target.end = position2;
+          return target;
+        }
+        return target.subarray(start, position2);
+      } catch (error) {
+        encodingError = error;
+        throw error;
+      } finally {
+        if (structures) {
+          resetStructures();
+          if (hasSharedUpdate && packr2.saveStructures) {
+            let sharedLength = structures.sharedLength || 0;
+            let returnBuffer = target.subarray(start, position2);
+            let newSharedData = (packr2._prepareStructures || prepareStructures)(structures, packr2);
+            if (!encodingError) {
+              if (packr2.saveStructures(newSharedData, newSharedData.isCompatible) === false) {
+                structures.uninitialized = true;
+                return packr2.pack(value, encodeOptions);
+              }
+              packr2.lastNamedStructuresLength = sharedLength;
+              if (target.length > 1073741824) target = null;
+              return returnBuffer;
+            }
+          }
+        }
+        if (target.length > 1073741824) target = null;
+        if (encodeOptions & RESET_BUFFER_MODE)
+          position2 = start;
+      }
+    };
+    const resetStructures = () => {
+      if (serializationsSinceTransitionRebuild < 10)
+        serializationsSinceTransitionRebuild++;
+      let sharedLength = structures.sharedLength || 0;
+      if (structures.length > sharedLength && !isSequential)
+        structures.length = sharedLength;
+      if (transitionsCount > 1e4) {
+        structures.transitions = null;
+        serializationsSinceTransitionRebuild = 0;
+        transitionsCount = 0;
+        if (recordIdsToRemove.length > 0)
+          recordIdsToRemove = [];
+      } else if (recordIdsToRemove.length > 0 && !isSequential) {
+        for (let i = 0, l = recordIdsToRemove.length; i < l; i++) {
+          recordIdsToRemove[i][RECORD_SYMBOL] = 0;
+        }
+        recordIdsToRemove = [];
+      }
+    };
+    const packArray = (value) => {
+      var length = value.length;
+      if (length < 16) {
+        target[position2++] = 144 | length;
+      } else if (length < 65536) {
+        target[position2++] = 220;
+        target[position2++] = length >> 8;
+        target[position2++] = length & 255;
+      } else {
+        target[position2++] = 221;
+        targetView.setUint32(position2, length);
+        position2 += 4;
+      }
+      for (let i = 0; i < length; i++) {
+        pack2(value[i]);
+      }
+    };
+    const pack2 = (value) => {
+      if (position2 > safeEnd)
+        target = makeRoom(position2);
+      var type = typeof value;
+      var length;
+      if (type === "string") {
+        let strLength = value.length;
+        if (bundledStrings2 && strLength >= 4 && strLength < 4096) {
+          if ((bundledStrings2.size += strLength) > MAX_BUNDLE_SIZE) {
+            let extStart;
+            let maxBytes2 = (bundledStrings2[0] ? bundledStrings2[0].length * 3 + bundledStrings2[1].length : 0) + 10;
+            if (position2 + maxBytes2 > safeEnd)
+              target = makeRoom(position2 + maxBytes2);
+            let lastBundle;
+            if (bundledStrings2.position) {
+              lastBundle = bundledStrings2;
+              target[position2] = 200;
+              position2 += 3;
+              target[position2++] = 98;
+              extStart = position2 - start;
+              position2 += 4;
+              writeBundles(start, pack2, 0);
+              targetView.setUint16(extStart + start - 3, position2 - start - extStart);
+            } else {
+              target[position2++] = 214;
+              target[position2++] = 98;
+              extStart = position2 - start;
+              position2 += 4;
+            }
+            bundledStrings2 = ["", ""];
+            bundledStrings2.previous = lastBundle;
+            bundledStrings2.size = 0;
+            bundledStrings2.position = extStart;
+          }
+          let twoByte = hasNonLatin.test(value);
+          bundledStrings2[twoByte ? 0 : 1] += value;
+          target[position2++] = 193;
+          pack2(twoByte ? -strLength : strLength);
+          return;
+        }
+        let headerSize;
+        if (strLength < 32) {
+          headerSize = 1;
+        } else if (strLength < 256) {
+          headerSize = 2;
+        } else if (strLength < 65536) {
+          headerSize = 3;
+        } else {
+          headerSize = 5;
+        }
+        let maxBytes = strLength * 3;
+        if (position2 + maxBytes > safeEnd)
+          target = makeRoom(position2 + maxBytes);
+        if (strLength < 64 || !encodeUtf8) {
+          let i, c1, c2, strPosition = position2 + headerSize;
+          for (i = 0; i < strLength; i++) {
+            c1 = value.charCodeAt(i);
+            if (c1 < 128) {
+              target[strPosition++] = c1;
+            } else if (c1 < 2048) {
+              target[strPosition++] = c1 >> 6 | 192;
+              target[strPosition++] = c1 & 63 | 128;
+            } else if ((c1 & 64512) === 55296 && ((c2 = value.charCodeAt(i + 1)) & 64512) === 56320) {
+              c1 = 65536 + ((c1 & 1023) << 10) + (c2 & 1023);
+              i++;
+              target[strPosition++] = c1 >> 18 | 240;
+              target[strPosition++] = c1 >> 12 & 63 | 128;
+              target[strPosition++] = c1 >> 6 & 63 | 128;
+              target[strPosition++] = c1 & 63 | 128;
+            } else {
+              target[strPosition++] = c1 >> 12 | 224;
+              target[strPosition++] = c1 >> 6 & 63 | 128;
+              target[strPosition++] = c1 & 63 | 128;
+            }
+          }
+          length = strPosition - position2 - headerSize;
+        } else {
+          length = encodeUtf8(value, position2 + headerSize);
+        }
+        if (length < 32) {
+          target[position2++] = 160 | length;
+        } else if (length < 256) {
+          if (headerSize < 2) {
+            target.copyWithin(position2 + 2, position2 + 1, position2 + 1 + length);
+          }
+          target[position2++] = 217;
+          target[position2++] = length;
+        } else if (length < 65536) {
+          if (headerSize < 3) {
+            target.copyWithin(position2 + 3, position2 + 2, position2 + 2 + length);
+          }
+          target[position2++] = 218;
+          target[position2++] = length >> 8;
+          target[position2++] = length & 255;
+        } else {
+          if (headerSize < 5) {
+            target.copyWithin(position2 + 5, position2 + 3, position2 + 3 + length);
+          }
+          target[position2++] = 219;
+          targetView.setUint32(position2, length);
+          position2 += 4;
+        }
+        position2 += length;
+      } else if (type === "number") {
+        if (value >>> 0 === value) {
+          if (value < 32 || value < 128 && this.useRecords === false || value < 64 && !this._writeStruct) {
+            target[position2++] = value;
+          } else if (value < 256) {
+            target[position2++] = 204;
+            target[position2++] = value;
+          } else if (value < 65536) {
+            target[position2++] = 205;
+            target[position2++] = value >> 8;
+            target[position2++] = value & 255;
+          } else {
+            target[position2++] = 206;
+            targetView.setUint32(position2, value);
+            position2 += 4;
+          }
+        } else if (value >> 0 === value) {
+          if (value >= -32) {
+            target[position2++] = 256 + value;
+          } else if (value >= -128) {
+            target[position2++] = 208;
+            target[position2++] = value + 256;
+          } else if (value >= -32768) {
+            target[position2++] = 209;
+            targetView.setInt16(position2, value);
+            position2 += 2;
+          } else {
+            target[position2++] = 210;
+            targetView.setInt32(position2, value);
+            position2 += 4;
+          }
+        } else {
+          let useFloat32;
+          if ((useFloat32 = this.useFloat32) > 0 && value < 4294967296 && value >= -2147483648) {
+            target[position2++] = 202;
+            targetView.setFloat32(position2, value);
+            let xShifted;
+            if (useFloat32 < 4 || // this checks for rounding of numbers that were encoded in 32-bit float to nearest significant decimal digit that could be preserved
+            (xShifted = value * mult10[(target[position2] & 127) << 1 | target[position2 + 1] >> 7]) >> 0 === xShifted) {
+              position2 += 4;
+              return;
+            } else
+              position2--;
+          }
+          target[position2++] = 203;
+          targetView.setFloat64(position2, value);
+          position2 += 8;
+        }
+      } else if (type === "object" || type === "function") {
+        if (!value)
+          target[position2++] = 192;
+        else {
+          if (referenceMap2) {
+            let referee = referenceMap2.get(value);
+            if (referee) {
+              if (!referee.id) {
+                let idsToInsert = referenceMap2.idsToInsert || (referenceMap2.idsToInsert = []);
+                referee.id = idsToInsert.push(referee);
+              }
+              target[position2++] = 214;
+              target[position2++] = 112;
+              targetView.setUint32(position2, referee.id);
+              position2 += 4;
+              return;
+            } else
+              referenceMap2.set(value, { offset: position2 - start });
+          }
+          let constructor = value.constructor;
+          if (constructor === Object) {
+            writeObject(value);
+          } else if (constructor === Array) {
+            packArray(value);
+          } else if (constructor === Map) {
+            if (this.mapAsEmptyObject) target[position2++] = 128;
+            else {
+              length = value.size;
+              if (length < 16) {
+                target[position2++] = 128 | length;
+              } else if (length < 65536) {
+                target[position2++] = 222;
+                target[position2++] = length >> 8;
+                target[position2++] = length & 255;
+              } else {
+                target[position2++] = 223;
+                targetView.setUint32(position2, length);
+                position2 += 4;
+              }
+              for (let [key, entryValue] of value) {
+                pack2(key);
+                pack2(entryValue);
+              }
+            }
+          } else {
+            for (let i = 0, l = extensions.length; i < l; i++) {
+              let extensionClass = extensionClasses[i];
+              if (value instanceof extensionClass) {
+                let extension = extensions[i];
+                if (extension.write) {
+                  if (extension.type) {
+                    target[position2++] = 212;
+                    target[position2++] = extension.type;
+                    target[position2++] = 0;
+                  }
+                  let writeResult = extension.write.call(this, value);
+                  if (writeResult === value) {
+                    if (Array.isArray(value)) {
+                      packArray(value);
+                    } else {
+                      writeObject(value);
+                    }
+                  } else {
+                    pack2(writeResult);
+                  }
+                  return;
+                }
+                let currentTarget = target;
+                let currentTargetView = targetView;
+                let currentPosition = position2;
+                target = null;
+                let result;
+                try {
+                  result = extension.pack.call(this, value, (size) => {
+                    target = currentTarget;
+                    currentTarget = null;
+                    position2 += size;
+                    if (position2 > safeEnd)
+                      makeRoom(position2);
+                    return {
+                      target,
+                      targetView,
+                      position: position2 - size
+                    };
+                  }, pack2);
+                } finally {
+                  if (currentTarget) {
+                    target = currentTarget;
+                    targetView = currentTargetView;
+                    position2 = currentPosition;
+                    safeEnd = target.length - 10;
+                  }
+                }
+                if (result) {
+                  if (result.length + position2 > safeEnd)
+                    makeRoom(result.length + position2);
+                  position2 = writeExtensionData(result, target, position2, extension.type);
+                }
+                return;
+              }
+            }
+            if (Array.isArray(value)) {
+              packArray(value);
+            } else {
+              if (value.toJSON) {
+                const json = value.toJSON();
+                if (json !== value)
+                  return pack2(json);
+              }
+              if (type === "function")
+                return pack2(this.writeFunction && this.writeFunction(value));
+              writeObject(value);
+            }
+          }
+        }
+      } else if (type === "boolean") {
+        target[position2++] = value ? 195 : 194;
+      } else if (type === "bigint") {
+        if (value < 9223372036854776e3 && value >= -9223372036854776e3) {
+          target[position2++] = 211;
+          targetView.setBigInt64(position2, value);
+        } else if (value < 18446744073709552e3 && value > 0) {
+          target[position2++] = 207;
+          targetView.setBigUint64(position2, value);
+        } else {
+          if (this.largeBigIntToFloat) {
+            target[position2++] = 203;
+            targetView.setFloat64(position2, Number(value));
+          } else if (this.largeBigIntToString) {
+            return pack2(value.toString());
+          } else if (this.useBigIntExtension || this.moreTypes) {
+            let empty = value < 0 ? BigInt(-1) : BigInt(0);
+            let array;
+            if (value >> BigInt(65536) === empty) {
+              let mask = BigInt(18446744073709552e3) - BigInt(1);
+              let chunks = [];
+              while (true) {
+                chunks.push(value & mask);
+                if (value >> BigInt(63) === empty) break;
+                value >>= BigInt(64);
+              }
+              array = new Uint8Array(new BigUint64Array(chunks).buffer);
+              array.reverse();
+            } else {
+              let invert = value < 0;
+              let string = (invert ? ~value : value).toString(16);
+              if (string.length % 2) {
+                string = "0" + string;
+              } else if (parseInt(string.charAt(0), 16) >= 8) {
+                string = "00" + string;
+              }
+              if (hasNodeBuffer) {
+                array = Buffer.from(string, "hex");
+              } else {
+                array = new Uint8Array(string.length / 2);
+                for (let i = 0; i < array.length; i++) {
+                  array[i] = parseInt(string.slice(i * 2, i * 2 + 2), 16);
+                }
+              }
+              if (invert) {
+                for (let i = 0; i < array.length; i++) array[i] = ~array[i];
+              }
+            }
+            if (array.length + position2 > safeEnd)
+              makeRoom(array.length + position2);
+            position2 = writeExtensionData(array, target, position2, 66);
+            return;
+          } else {
+            throw new RangeError(value + " was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string");
+          }
+        }
+        position2 += 8;
+      } else if (type === "undefined") {
+        if (this.encodeUndefinedAsNil)
+          target[position2++] = 192;
+        else {
+          target[position2++] = 212;
+          target[position2++] = 0;
+          target[position2++] = 0;
+        }
+      } else {
+        throw new Error("Unknown type: " + type);
+      }
+    };
+    const writePlainObject = this.variableMapSize || this.coercibleKeyAsNumber || this.skipValues ? (object) => {
+      let keys;
+      if (this.skipValues) {
+        keys = [];
+        for (let key2 in object) {
+          if ((typeof object.hasOwnProperty !== "function" || object.hasOwnProperty(key2)) && !this.skipValues.includes(object[key2]))
+            keys.push(key2);
+        }
+      } else {
+        keys = Object.keys(object);
+      }
+      let length = keys.length;
+      if (length < 16) {
+        target[position2++] = 128 | length;
+      } else if (length < 65536) {
+        target[position2++] = 222;
+        target[position2++] = length >> 8;
+        target[position2++] = length & 255;
+      } else {
+        target[position2++] = 223;
+        targetView.setUint32(position2, length);
+        position2 += 4;
+      }
+      let key;
+      if (this.coercibleKeyAsNumber) {
+        for (let i = 0; i < length; i++) {
+          key = keys[i];
+          let num = Number(key);
+          pack2(isNaN(num) ? key : num);
+          pack2(object[key]);
+        }
+      } else {
+        for (let i = 0; i < length; i++) {
+          pack2(key = keys[i]);
+          pack2(object[key]);
+        }
+      }
+    } : (object) => {
+      target[position2++] = 222;
+      let objectOffset = position2 - start;
+      position2 += 2;
+      let size = 0;
+      for (let key in object) {
+        if (typeof object.hasOwnProperty !== "function" || object.hasOwnProperty(key)) {
+          pack2(key);
+          pack2(object[key]);
+          size++;
+        }
+      }
+      if (size > 65535) {
+        throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');
+      }
+      target[objectOffset++ + start] = size >> 8;
+      target[objectOffset + start] = size & 255;
+    };
+    const writeRecord = this.useRecords === false ? writePlainObject : options.progressiveRecords && !useTwoByteRecords ? (
+      // this is about 2% faster for highly stable structures, since it only requires one for-in loop (but much more expensive when new structure needs to be written)
+      (object) => {
+        let nextTransition, transition = structures.transitions || (structures.transitions = /* @__PURE__ */ Object.create(null));
+        let objectOffset = position2++ - start;
+        let wroteKeys;
+        for (let key in object) {
+          if (typeof object.hasOwnProperty !== "function" || object.hasOwnProperty(key)) {
+            nextTransition = transition[key];
+            if (nextTransition)
+              transition = nextTransition;
+            else {
+              let keys = Object.keys(object);
+              let lastTransition = transition;
+              transition = structures.transitions;
+              let newTransitions = 0;
+              for (let i = 0, l = keys.length; i < l; i++) {
+                let key2 = keys[i];
+                nextTransition = transition[key2];
+                if (!nextTransition) {
+                  nextTransition = transition[key2] = /* @__PURE__ */ Object.create(null);
+                  newTransitions++;
+                }
+                transition = nextTransition;
+              }
+              if (objectOffset + start + 1 == position2) {
+                position2--;
+                newRecord(transition, keys, newTransitions);
+              } else
+                insertNewRecord(transition, keys, objectOffset, newTransitions);
+              wroteKeys = true;
+              transition = lastTransition[key];
+            }
+            pack2(object[key]);
+          }
+        }
+        if (!wroteKeys) {
+          let recordId = transition[RECORD_SYMBOL];
+          if (recordId)
+            target[objectOffset + start] = recordId;
+          else
+            insertNewRecord(transition, Object.keys(object), objectOffset, 0);
+        }
+      }
+    ) : (object) => {
+      let nextTransition, transition = structures.transitions || (structures.transitions = /* @__PURE__ */ Object.create(null));
+      let newTransitions = 0;
+      for (let key in object) if (typeof object.hasOwnProperty !== "function" || object.hasOwnProperty(key)) {
+        nextTransition = transition[key];
+        if (!nextTransition) {
+          nextTransition = transition[key] = /* @__PURE__ */ Object.create(null);
+          newTransitions++;
+        }
+        transition = nextTransition;
+      }
+      let recordId = transition[RECORD_SYMBOL];
+      if (recordId) {
+        if (recordId >= 96 && useTwoByteRecords) {
+          target[position2++] = ((recordId -= 96) & 31) + 96;
+          target[position2++] = recordId >> 5;
+        } else
+          target[position2++] = recordId;
+      } else {
+        newRecord(transition, transition.__keys__ || Object.keys(object), newTransitions);
+      }
+      for (let key in object)
+        if (typeof object.hasOwnProperty !== "function" || object.hasOwnProperty(key)) {
+          pack2(object[key]);
+        }
+    };
+    const checkUseRecords = typeof this.useRecords == "function" && this.useRecords;
+    const writeObject = checkUseRecords ? (object) => {
+      checkUseRecords(object) ? writeRecord(object) : writePlainObject(object);
+    } : writeRecord;
+    const writeStruct = (object) => {
+      let newPosition = packr2._writeStruct(object, target, start, position2, structures, makeRoom, (value, newPosition2, notifySharedUpdate) => {
+        if (notifySharedUpdate)
+          return hasSharedUpdate = true;
+        position2 = newPosition2;
+        let startTarget = target;
+        pack2(value);
+        resetStructures();
+        if (startTarget !== target) {
+          return { position: position2, targetView, target };
+        }
+        return position2;
+      });
+      if (newPosition === 0)
+        return writeObject(object);
+      position2 = newPosition;
+    };
+    const makeRoom = (end) => {
+      let newSize;
+      if (end > 16777216) {
+        if (end - start > MAX_BUFFER_SIZE)
+          throw new Error("Packed buffer would be larger than maximum buffer size");
+        newSize = Math.min(
+          MAX_BUFFER_SIZE,
+          Math.round(Math.max((end - start) * (end > 67108864 ? 1.25 : 2), 4194304) / 4096) * 4096
+        );
+      } else
+        newSize = (Math.max(end - start << 2, target.length - 1) >> 12) + 1 << 12;
+      let newBuffer = new ByteArrayAllocate(newSize);
+      targetView = newBuffer.dataView || (newBuffer.dataView = new DataView(newBuffer.buffer, 0, newSize));
+      end = Math.min(end, target.length);
+      if (target.copy)
+        target.copy(newBuffer, 0, start, end);
+      else
+        newBuffer.set(target.slice(start, end));
+      position2 -= start;
+      start = 0;
+      safeEnd = newBuffer.length - 10;
+      return target = newBuffer;
+    };
+    const newRecord = (transition, keys, newTransitions) => {
+      let recordId = structures.nextId;
+      if (!recordId)
+        recordId = 64;
+      if (recordId < sharedLimitId && this.shouldShareStructure && !this.shouldShareStructure(keys)) {
+        recordId = structures.nextOwnId;
+        if (!(recordId < maxStructureId))
+          recordId = sharedLimitId;
+        structures.nextOwnId = recordId + 1;
+      } else {
+        if (recordId >= maxStructureId)
+          recordId = sharedLimitId;
+        structures.nextId = recordId + 1;
+      }
+      let highByte = keys.highByte = recordId >= 96 && useTwoByteRecords ? recordId - 96 >> 5 : -1;
+      transition[RECORD_SYMBOL] = recordId;
+      transition.__keys__ = keys;
+      structures[recordId - 64] = keys;
+      if (recordId < sharedLimitId) {
+        keys.isShared = true;
+        structures.sharedLength = recordId - 63;
+        hasSharedUpdate = true;
+        if (highByte >= 0) {
+          target[position2++] = (recordId & 31) + 96;
+          target[position2++] = highByte;
+        } else {
+          target[position2++] = recordId;
+        }
+      } else {
+        if (highByte >= 0) {
+          target[position2++] = 213;
+          target[position2++] = 114;
+          target[position2++] = (recordId & 31) + 96;
+          target[position2++] = highByte;
+        } else {
+          target[position2++] = 212;
+          target[position2++] = 114;
+          target[position2++] = recordId;
+        }
+        if (newTransitions)
+          transitionsCount += serializationsSinceTransitionRebuild * newTransitions;
+        if (recordIdsToRemove.length >= maxOwnStructures)
+          recordIdsToRemove.shift()[RECORD_SYMBOL] = 0;
+        recordIdsToRemove.push(transition);
+        pack2(keys);
+      }
+    };
+    const insertNewRecord = (transition, keys, insertionOffset, newTransitions) => {
+      let mainTarget = target;
+      let mainPosition = position2;
+      let mainSafeEnd = safeEnd;
+      let mainStart = start;
+      target = keysTarget;
+      position2 = 0;
+      start = 0;
+      if (!target)
+        keysTarget = target = new ByteArrayAllocate(8192);
+      safeEnd = target.length - 10;
+      newRecord(transition, keys, newTransitions);
+      keysTarget = target;
+      let keysPosition = position2;
+      target = mainTarget;
+      position2 = mainPosition;
+      safeEnd = mainSafeEnd;
+      start = mainStart;
+      if (keysPosition > 1) {
+        let newEnd = position2 + keysPosition - 1;
+        if (newEnd > safeEnd)
+          makeRoom(newEnd);
+        let insertionPosition = insertionOffset + start;
+        target.copyWithin(insertionPosition + keysPosition, insertionPosition + 1, position2);
+        target.set(keysTarget.slice(0, keysPosition), insertionPosition);
+        position2 = newEnd;
+      } else {
+        target[insertionOffset + start] = keysTarget[0];
+      }
+    };
+  }
+  useBuffer(buffer) {
+    target = buffer;
+    target.dataView || (target.dataView = new DataView(target.buffer, target.byteOffset, target.byteLength));
+    targetView = target.dataView;
+    position2 = 0;
+  }
+  set position(value) {
+    position2 = value;
+  }
+  get position() {
+    return position2;
+  }
+  clearSharedData() {
+    if (this.structures)
+      this.structures = [];
+    if (this.typedStructs)
+      this.typedStructs = [];
+  }
+};
+extensionClasses = [Date, Set, Error, RegExp, ArrayBuffer, Object.getPrototypeOf(Uint8Array.prototype).constructor, DataView, C1Type];
+extensions = [{
+  pack(date, allocateForWrite, pack2) {
+    let seconds = date.getTime() / 1e3;
+    if ((this.useTimestamp32 || date.getMilliseconds() === 0) && seconds >= 0 && seconds < 4294967296) {
+      let { target: target2, targetView: targetView2, position: position3 } = allocateForWrite(6);
+      target2[position3++] = 214;
+      target2[position3++] = 255;
+      targetView2.setUint32(position3, seconds);
+    } else if (seconds > 0 && seconds < 4294967296) {
+      let { target: target2, targetView: targetView2, position: position3 } = allocateForWrite(10);
+      target2[position3++] = 215;
+      target2[position3++] = 255;
+      targetView2.setUint32(position3, date.getMilliseconds() * 4e6 + (seconds / 1e3 / 4294967296 >> 0));
+      targetView2.setUint32(position3 + 4, seconds);
+    } else if (isNaN(seconds)) {
+      if (this.onInvalidDate) {
+        allocateForWrite(0);
+        return pack2(this.onInvalidDate());
+      }
+      let { target: target2, targetView: targetView2, position: position3 } = allocateForWrite(3);
+      target2[position3++] = 212;
+      target2[position3++] = 255;
+      target2[position3++] = 255;
+    } else {
+      let { target: target2, targetView: targetView2, position: position3 } = allocateForWrite(15);
+      target2[position3++] = 199;
+      target2[position3++] = 12;
+      target2[position3++] = 255;
+      targetView2.setUint32(position3, date.getMilliseconds() * 1e6);
+      targetView2.setBigInt64(position3 + 4, BigInt(Math.floor(seconds)));
+    }
+  }
+}, {
+  pack(set, allocateForWrite, pack2) {
+    if (this.setAsEmptyObject) {
+      allocateForWrite(0);
+      return pack2({});
+    }
+    let array = Array.from(set);
+    let { target: target2, position: position3 } = allocateForWrite(this.moreTypes ? 3 : 0);
+    if (this.moreTypes) {
+      target2[position3++] = 212;
+      target2[position3++] = 115;
+      target2[position3++] = 0;
+    }
+    pack2(array);
+  }
+}, {
+  pack(error, allocateForWrite, pack2) {
+    let { target: target2, position: position3 } = allocateForWrite(this.moreTypes ? 3 : 0);
+    if (this.moreTypes) {
+      target2[position3++] = 212;
+      target2[position3++] = 101;
+      target2[position3++] = 0;
+    }
+    pack2([error.name, error.message, error.cause]);
+  }
+}, {
+  pack(regex, allocateForWrite, pack2) {
+    let { target: target2, position: position3 } = allocateForWrite(this.moreTypes ? 3 : 0);
+    if (this.moreTypes) {
+      target2[position3++] = 212;
+      target2[position3++] = 120;
+      target2[position3++] = 0;
+    }
+    pack2([regex.source, regex.flags]);
+  }
+}, {
+  pack(arrayBuffer, allocateForWrite) {
+    if (this.moreTypes)
+      writeExtBuffer(arrayBuffer, 16, allocateForWrite);
+    else
+      writeBuffer(hasNodeBuffer ? Buffer.from(arrayBuffer) : new Uint8Array(arrayBuffer), allocateForWrite);
+  }
+}, {
+  pack(typedArray, allocateForWrite) {
+    let constructor = typedArray.constructor;
+    if (constructor !== ByteArray && this.moreTypes)
+      writeExtBuffer(typedArray, typedArrays.indexOf(constructor.name), allocateForWrite);
+    else
+      writeBuffer(typedArray, allocateForWrite);
+  }
+}, {
+  pack(arrayBuffer, allocateForWrite) {
+    if (this.moreTypes)
+      writeExtBuffer(arrayBuffer, 17, allocateForWrite);
+    else
+      writeBuffer(hasNodeBuffer ? Buffer.from(arrayBuffer) : new Uint8Array(arrayBuffer), allocateForWrite);
+  }
+}, {
+  pack(c1, allocateForWrite) {
+    let { target: target2, position: position3 } = allocateForWrite(1);
+    target2[position3] = 193;
+  }
+}];
+function writeExtBuffer(typedArray, type, allocateForWrite, encode2) {
+  let length = typedArray.byteLength;
+  if (length + 1 < 256) {
+    var { target: target2, position: position3 } = allocateForWrite(4 + length);
+    target2[position3++] = 199;
+    target2[position3++] = length + 1;
+  } else if (length + 1 < 65536) {
+    var { target: target2, position: position3 } = allocateForWrite(5 + length);
+    target2[position3++] = 200;
+    target2[position3++] = length + 1 >> 8;
+    target2[position3++] = length + 1 & 255;
+  } else {
+    var { target: target2, position: position3, targetView: targetView2 } = allocateForWrite(7 + length);
+    target2[position3++] = 201;
+    targetView2.setUint32(position3, length + 1);
+    position3 += 4;
+  }
+  target2[position3++] = 116;
+  target2[position3++] = type;
+  if (!typedArray.buffer) typedArray = new Uint8Array(typedArray);
+  target2.set(new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength), position3);
+}
+function writeBuffer(buffer, allocateForWrite) {
+  let length = buffer.byteLength;
+  var target2, position3;
+  if (length < 256) {
+    var { target: target2, position: position3 } = allocateForWrite(length + 2);
+    target2[position3++] = 196;
+    target2[position3++] = length;
+  } else if (length < 65536) {
+    var { target: target2, position: position3 } = allocateForWrite(length + 3);
+    target2[position3++] = 197;
+    target2[position3++] = length >> 8;
+    target2[position3++] = length & 255;
+  } else {
+    var { target: target2, position: position3, targetView: targetView2 } = allocateForWrite(length + 5);
+    target2[position3++] = 198;
+    targetView2.setUint32(position3, length);
+    position3 += 4;
+  }
+  target2.set(buffer, position3);
+}
+function writeExtensionData(result, target2, position3, type) {
+  let length = result.length;
+  switch (length) {
+    case 1:
+      target2[position3++] = 212;
+      break;
+    case 2:
+      target2[position3++] = 213;
+      break;
+    case 4:
+      target2[position3++] = 214;
+      break;
+    case 8:
+      target2[position3++] = 215;
+      break;
+    case 16:
+      target2[position3++] = 216;
+      break;
+    default:
+      if (length < 256) {
+        target2[position3++] = 199;
+        target2[position3++] = length;
+      } else if (length < 65536) {
+        target2[position3++] = 200;
+        target2[position3++] = length >> 8;
+        target2[position3++] = length & 255;
+      } else {
+        target2[position3++] = 201;
+        target2[position3++] = length >> 24;
+        target2[position3++] = length >> 16 & 255;
+        target2[position3++] = length >> 8 & 255;
+        target2[position3++] = length & 255;
+      }
+  }
+  target2[position3++] = type;
+  target2.set(result, position3);
+  position3 += length;
+  return position3;
+}
+function insertIds(serialized, idsToInsert) {
+  let nextId;
+  let distanceToMove = idsToInsert.length * 6;
+  let lastEnd = serialized.length - distanceToMove;
+  while (nextId = idsToInsert.pop()) {
+    let offset = nextId.offset;
+    let id = nextId.id;
+    serialized.copyWithin(offset + distanceToMove, offset, lastEnd);
+    distanceToMove -= 6;
+    let position3 = offset + distanceToMove;
+    serialized[position3++] = 214;
+    serialized[position3++] = 105;
+    serialized[position3++] = id >> 24;
+    serialized[position3++] = id >> 16 & 255;
+    serialized[position3++] = id >> 8 & 255;
+    serialized[position3++] = id & 255;
+    lastEnd = offset;
+  }
+  return serialized;
+}
+function writeBundles(start, pack2, incrementPosition) {
+  if (bundledStrings2.length > 0) {
+    targetView.setUint32(bundledStrings2.position + start, position2 + incrementPosition - bundledStrings2.position - start);
+    bundledStrings2.stringsPosition = position2 - start;
+    let writeStrings = bundledStrings2;
+    bundledStrings2 = null;
+    pack2(writeStrings[0]);
+    pack2(writeStrings[1]);
+  }
+}
+function prepareStructures(structures, packr2) {
+  structures.isCompatible = (existingStructures) => {
+    let compatible = !existingStructures || (packr2.lastNamedStructuresLength || 0) === existingStructures.length;
+    if (!compatible)
+      packr2._mergeStructures(existingStructures);
+    return compatible;
+  };
+  return structures;
+}
+Packr.SUPPORTS_STRUCT_HOOKS = true;
+var defaultPackr = new Packr({ useRecords: false });
+var pack = defaultPackr.pack;
+var encode = defaultPackr.pack;
+var { NEVER, ALWAYS, DECIMAL_ROUND, DECIMAL_FIT } = FLOAT32_OPTIONS;
+var REUSE_BUFFER_MODE = 512;
+var RESET_BUFFER_MODE = 1024;
+var RESERVE_START_SPACE = 2048;
+
+// ../../../../../setup-pnpm/store/v11/links/@/msgpackr/2.0.5/120f9075aeb95a409234328542916ec7ee3248f89cf91e593ced8e5252fd92a6/node_modules/msgpackr/node-index.js
+import { createRequire } from "module";
+var nativeAccelerationDisabled = process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED !== void 0 && process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED.toLowerCase() === "true";
+if (!nativeAccelerationDisabled) {
+  let extractor;
+  try {
+    if (typeof __require == "function")
+      extractor = require_msgpackr_extract();
+    else
+      extractor = createRequire(import.meta.url)("msgpackr-extract");
+    if (extractor)
+      setExtractor(extractor.extractStrings);
+  } catch (error) {
+  }
+}
+
+// ../store/index/lib/index.js
+var FROZEN_STORE_WRITE_MESSAGE = "Cannot write to the package store because frozenStore is enabled (the store is opened read-only). This indicates the store is missing content the install needs.";
+var req = createRequire2(import.meta.url);
+var { DatabaseSync } = req("node:sqlite");
+var packr = new Packr({
+  useRecords: true,
+  moreTypes: true
+});
+var SQLITE_BUSY = 5;
+var RETRY_DELAY_MS = 50;
+var MAX_RETRIES = 100;
+function sqliteRetry(fn) {
+  for (let attempt = 0; ; attempt++) {
+    try {
+      return fn();
+    } catch (err) {
+      if (isSqliteBusy(err) && attempt < MAX_RETRIES) {
+        sleepSync(RETRY_DELAY_MS);
+        continue;
+      }
+      throw err;
+    }
+  }
+}
+function isSqliteBusy(err) {
+  return (err?.errcode & 255) === SQLITE_BUSY;
+}
+var sleepBuffer = new Int32Array(new SharedArrayBuffer(4));
+function sleepSync(ms) {
+  Atomics.wait(sleepBuffer, 0, 0, ms);
+}
+function packForStorage(data) {
+  return packr.pack(data);
+}
+var openInstances = /* @__PURE__ */ new Set();
+var StoreIndex = class {
+  db;
+  closed = false;
+  pendingWrites = [];
+  flushScheduled = false;
+  stmtGet;
+  stmtSet;
+  stmtDel;
+  stmtHas;
+  stmtAll;
+  stmtKeys;
+  exitHandler;
+  constructor(storeDir) {
+    this.openDatabase(storeDir);
+    this.prepareStatements();
+    this.exitHandler = () => this.close();
+    const currentMax = process.getMaxListeners();
+    if (currentMax !== 0 && currentMax < openInstances.size + 11) {
+      process.setMaxListeners(Math.max(currentMax + 10, openInstances.size + 11));
+    }
+    process.on("exit", this.exitHandler);
+    openInstances.add(this);
+  }
+  /** Open the SQLite connection. Overridden by {@link ReadOnlyStoreIndex}. */
+  openDatabase(storeDir) {
+    fs11.mkdirSync(storeDir, { recursive: true });
+    this.db = new DatabaseSync(`${storeDir}/index.db`);
+    this.db.exec("PRAGMA busy_timeout=5000");
+    sqliteRetry(() => {
+      this.db.exec("PRAGMA journal_mode=WAL");
+      this.db.exec("PRAGMA synchronous=NORMAL");
+      this.db.exec("PRAGMA mmap_size=536870912");
+      this.db.exec("PRAGMA cache_size=-32000");
+      this.db.exec("PRAGMA temp_store=MEMORY");
+      this.db.exec("PRAGMA wal_autocheckpoint=10000");
+      this.db.exec(`
+        CREATE TABLE IF NOT EXISTS package_index (
+          key TEXT PRIMARY KEY,
+          data BLOB NOT NULL
+        ) WITHOUT ROWID
+      `);
+    });
+  }
+  /** Prepare the prepared statements. Overridden by {@link ReadOnlyStoreIndex} to skip the write statements. */
+  prepareStatements() {
+    this.stmtGet = this.db.prepare("SELECT data FROM package_index WHERE key = ?");
+    this.stmtSet = this.db.prepare("INSERT OR REPLACE INTO package_index (key, data) VALUES (?, ?)");
+    this.stmtDel = this.db.prepare("DELETE FROM package_index WHERE key = ?");
+    this.stmtHas = this.db.prepare("SELECT 1 FROM package_index WHERE key = ?");
+    this.stmtAll = this.db.prepare("SELECT key, data FROM package_index");
+    this.stmtKeys = this.db.prepare("SELECT key FROM package_index");
+  }
+  get(key) {
+    const row = sqliteRetry(() => this.stmtGet.get(key));
+    if (row) {
+      return packr.unpack(row.data);
+    }
+    return void 0;
+  }
+  /**
+   * Get the raw msgpack-encoded buffer for a key without decoding.
+   */
+  getRaw(key) {
+    const row = sqliteRetry(() => this.stmtGet.get(key));
+    return row?.data;
+  }
+  set(key, data) {
+    const buffer = packr.pack(data);
+    sqliteRetry(() => {
+      this.stmtSet.run(key, buffer);
+    });
+  }
+  delete(key) {
+    let result;
+    sqliteRetry(() => {
+      result = this.stmtDel.run(key);
+    });
+    return result.changes > 0;
+  }
+  has(key) {
+    return sqliteRetry(() => this.stmtHas.get(key)) != null;
+  }
+  /**
+   * Iterate over all index entries.
+   * Yields [key, data] pairs where key is `integrity\tpkgId`.
+   */
+  *entries() {
+    for (const row of this.stmtAll.iterate()) {
+      yield [row.key, packr.unpack(row.data)];
+    }
+  }
+  /**
+   * Iterate over all index keys without decoding values.
+   * Much faster than entries() when only keys are needed.
+   */
+  *keys() {
+    for (const row of this.stmtKeys.iterate()) {
+      yield row.key;
+    }
+  }
+  /**
+   * Queue pre-packed writes to be flushed on the next tick.
+   * Used by the fetch phase for throughput.
+   */
+  queueWrites(writes) {
+    for (const w of writes) {
+      this.pendingWrites.push(w);
+    }
+    if (!this.flushScheduled) {
+      this.flushScheduled = true;
+      process.nextTick(() => this.flush());
+    }
+  }
+  /**
+   * Flush all pending queued writes immediately.
+   */
+  flush() {
+    this.flushScheduled = false;
+    if (this.pendingWrites.length === 0)
+      return;
+    this.setRawMany(this.pendingWrites);
+    this.pendingWrites = [];
+  }
+  /**
+   * Write multiple pre-packed entries in a single transaction.
+   * The buffers must already be msgpack-encoded.
+   */
+  setRawMany(entries) {
+    if (this.closed || entries.length === 0)
+      return;
+    if (entries.length === 1) {
+      sqliteRetry(() => {
+        this.stmtSet.run(entries[0].key, entries[0].buffer);
+      });
+      return;
+    }
+    sqliteRetry(() => {
+      this.db.exec("BEGIN IMMEDIATE");
+      let committed = false;
+      try {
+        for (const { key, buffer } of entries) {
+          this.stmtSet.run(key, buffer);
+        }
+        this.db.exec("COMMIT");
+        committed = true;
+      } finally {
+        if (!committed) {
+          try {
+            this.db.exec("ROLLBACK");
+          } catch {
+          }
+        }
+      }
+    });
+  }
+  /**
+   * Delete multiple index entries in a single transaction,
+   * then VACUUM to reclaim disk space.
+   */
+  deleteMany(keys) {
+    if (keys.length === 0)
+      return;
+    if (keys.length === 1) {
+      this.delete(keys[0]);
+      this.db.exec("VACUUM");
+      return;
+    }
+    sqliteRetry(() => {
+      this.db.exec("BEGIN IMMEDIATE");
+      let committed = false;
+      try {
+        for (const key of keys) {
+          this.stmtDel.run(key);
+        }
+        this.db.exec("COMMIT");
+        committed = true;
+      } finally {
+        if (!committed) {
+          try {
+            this.db.exec("ROLLBACK");
+          } catch {
+          }
+        }
+      }
+    });
+    this.db.exec("VACUUM");
+  }
+  checkpoint() {
+    this.flush();
+    sqliteRetry(() => {
+      this.db.exec("PRAGMA wal_checkpoint(TRUNCATE)");
+    });
+  }
+  close() {
+    if (this.closed)
+      return;
+    this.flush();
+    this.closed = true;
+    openInstances.delete(this);
+    process.removeListener("exit", this.exitHandler);
+    this.optimizeBeforeClose();
+    try {
+      this.db.close();
+    } catch {
+    }
+  }
+  /** Run `PRAGMA optimize` before closing. Overridden by {@link ReadOnlyStoreIndex} to skip it (the DB is immutable). */
+  optimizeBeforeClose() {
+    try {
+      this.db.exec("PRAGMA optimize");
+    } catch {
+    }
+  }
+};
+var ReadOnlyStoreIndex = class extends StoreIndex {
+  openDatabase(storeDir) {
+    if (!nodeSupportsImmutableSqliteUri()) {
+      throw new PnpmError("FROZEN_STORE_UNSUPPORTED_NODE", `frozenStore opens the store index read-only via a SQLite "immutable" URI, which requires Node.js >=22.15.0, >=23.11.0, or >=24.0.0, but the current version is ${process.versions.node}. Upgrade Node.js, or run without frozenStore.`);
+    }
+    this.db = new DatabaseSync(immutableSqliteUri(`${storeDir}/index.db`));
+  }
+  prepareStatements() {
+    this.stmtGet = this.db.prepare("SELECT data FROM package_index WHERE key = ?");
+    this.stmtHas = this.db.prepare("SELECT 1 FROM package_index WHERE key = ?");
+    this.stmtAll = this.db.prepare("SELECT key, data FROM package_index");
+    this.stmtKeys = this.db.prepare("SELECT key FROM package_index");
+  }
+  optimizeBeforeClose() {
+  }
+  set(_key, _data) {
+    this.throwReadOnly();
+  }
+  delete(_key) {
+    this.throwReadOnly();
+  }
+  queueWrites(_writes) {
+    this.throwReadOnly();
+  }
+  setRawMany(_entries) {
+    this.throwReadOnly();
+  }
+  deleteMany(_keys) {
+    this.throwReadOnly();
+  }
+  checkpoint() {
+    this.throwReadOnly();
+  }
+  throwReadOnly() {
+    throw new PnpmError("FROZEN_STORE_WRITE", FROZEN_STORE_WRITE_MESSAGE);
+  }
+};
+function immutableSqliteUri(dbPath) {
+  const url = pathToFileURL(dbPath);
+  url.searchParams.set("immutable", "1");
+  return url.href;
+}
+function nodeSupportsImmutableSqliteUri() {
+  const [major, minor] = process.versions.node.split(".", 2).map(Number);
+  if (major < 22)
+    return false;
+  if (major === 22)
+    return minor >= 15;
+  if (major === 23)
+    return minor >= 11;
+  return true;
+}
+
+// ../worker/lib/equalOrSemverEqual.js
+var import_semver2 = __toESM(require_semver2(), 1);
+function equalOrSemverEqual(version1, version2) {
+  if (version1 === version2)
+    return true;
+  try {
+    return import_semver2.default.eq(version1, version2, { loose: true });
+  } catch {
+    return false;
+  }
+}
+
+// ../worker/lib/start.js
+function startWorker() {
+  process.on("uncaughtException", (err) => {
+    console.error(err);
+  });
+  parentPort.on("message", handleMessage);
+}
+var cafsCache = /* @__PURE__ */ new Map();
+var cafsStoreCache = /* @__PURE__ */ new Map();
+var cafsLocker = /* @__PURE__ */ new Map();
+var storeIndexCache = /* @__PURE__ */ new Map();
+function getStoreIndex(storeDir, frozen = false) {
+  const cacheKey = frozen ? `${storeDir}\0frozen` : storeDir;
+  if (!storeIndexCache.has(cacheKey)) {
+    storeIndexCache.set(cacheKey, frozen ? new ReadOnlyStoreIndex(storeDir) : new StoreIndex(storeDir));
+  }
+  return storeIndexCache.get(cacheKey);
+}
+async function handleMessage(message) {
+  if (message === false) {
+    parentPort.off("message", handleMessage);
+    for (const idx of storeIndexCache.values()) {
+      idx.close();
+    }
+    storeIndexCache.clear();
+    process.exit(0);
+  }
+  try {
+    switch (message.type) {
+      case "extract": {
+        parentPort.postMessage(addTarballToStore(message));
+        break;
+      }
+      case "link": {
+        parentPort.postMessage(importPackage(message));
+        break;
+      }
+      case "add-dir": {
+        parentPort.postMessage(addFilesFromDir2(message));
+        break;
+      }
+      case "init-store": {
+        parentPort.postMessage(initStore(message));
+        break;
+      }
+      case "readPkgFromCafs": {
+        const { storeDir, filesIndexFile, verifyStoreIntegrity, expectedPkg, strictStorePkgContentCheck, frozenStore } = message;
+        const pkgFilesIndex = getStoreIndex(storeDir, frozenStore).get(filesIndexFile);
+        if (!pkgFilesIndex) {
+          parentPort.postMessage({
+            status: "success",
+            value: {
+              verified: false,
+              pkgFilesIndex: null
+            }
+          });
+          return;
+        }
+        const warnings = [];
+        if (expectedPkg) {
+          if (pkgFilesIndex.manifest?.name != null && expectedPkg.name != null && pkgFilesIndex.manifest.name.toLowerCase() !== expectedPkg.name.toLowerCase() || pkgFilesIndex.manifest?.version != null && expectedPkg.version != null && !equalOrSemverEqual(pkgFilesIndex.manifest.version, expectedPkg.version)) {
+            const msg = "Package name or version mismatch found while reading from the store.";
+            const hint = `This means that either the lockfile is broken or the package metadata (name and version) inside the package's package.json file doesn't match the metadata in the registry. Expected package: ${expectedPkg.name}@${expectedPkg.version}. Actual package in the store: ${pkgFilesIndex.manifest?.name}@${pkgFilesIndex.manifest?.version}.`;
+            if (strictStorePkgContentCheck ?? true) {
+              throw new PnpmError("UNEXPECTED_PKG_CONTENT_IN_STORE", msg, {
+                hint: `${hint}
+
+If you want to ignore this issue, set strictStorePkgContentCheck to false in your configuration`
+              });
+            } else {
+              warnings.push(`${msg} ${hint}`);
+            }
+          }
+        }
+        let verifyResult;
+        if (verifyStoreIntegrity) {
+          verifyResult = checkPkgFilesIntegrity(storeDir, pkgFilesIndex);
+        } else {
+          verifyResult = buildFileMapsFromIndex(storeDir, pkgFilesIndex);
+        }
+        const bundledManifest = pkgFilesIndex.manifest;
+        const requiresBuild = pkgFilesIndex.requiresBuild ?? pkgRequiresBuild(bundledManifest, verifyResult.filesMap);
+        parentPort.postMessage({
+          status: "success",
+          warnings,
+          value: {
+            verified: verifyResult.passed,
+            bundledManifest,
+            files: {
+              filesMap: verifyResult.filesMap,
+              sideEffectsMaps: verifyResult.sideEffectsMaps,
+              resolvedFrom: "store",
+              requiresBuild
+            }
+          }
+        });
+        break;
+      }
+      case "symlinkAllModules": {
+        parentPort.postMessage(symlinkAllModules(message));
+        break;
+      }
+      case "hardLinkDir": {
+        hardLinkDir(message.src, message.destDirs);
+        parentPort.postMessage({ status: "success" });
+        break;
+      }
+    }
+  } catch (e) {
+    parentPort.postMessage({
+      status: "error",
+      error: {
+        code: e.code,
+        message: e.message ?? e.toString(),
+        hint: e.hint
+      }
+    });
+  }
+}
+function addTarballToStore({ buffer, storeDir, integrity, filesIndexFile, appendManifest, ignoreFilePattern }) {
+  if (integrity) {
+    const { algorithm, hexDigest } = parseIntegrity(integrity);
+    const calculatedHash = crypto5.hash(algorithm, buffer, "hex");
+    if (calculatedHash !== hexDigest) {
+      return {
+        status: "error",
+        error: {
+          type: "integrity_validation_failed",
+          algorithm,
+          expected: integrity,
+          found: formatIntegrity(algorithm, calculatedHash)
+        }
+      };
+    }
+  }
+  if (!cafsCache.has(storeDir)) {
+    cafsCache.set(storeDir, createCafs(storeDir));
+  }
+  const cafs = cafsCache.get(storeDir);
+  const ignore = ignoreFilePattern ? makeIgnoreFromPattern(ignoreFilePattern) : void 0;
+  let { filesIndex, manifest } = cafs.addFilesFromTarball(buffer, true, ignore);
+  if (appendManifest && manifest == null) {
+    manifest = appendManifest;
+    addManifestToCafs(cafs, filesIndex, appendManifest);
+  } else if (!filesIndex.has("package.json")) {
+    addPlaceholderPackageJsonToCafs(cafs, filesIndex);
+  }
+  const { filesIntegrity, filesMap } = processFilesIndex(filesIndex);
+  const bundledManifest = manifest != null ? normalizeBundledManifest(manifest) : void 0;
+  const requiresBuild = pkgRequiresBuild(bundledManifest, filesIntegrity);
+  const pkgFilesIndex = {
+    requiresBuild,
+    manifest: bundledManifest,
+    algo: HASH_ALGORITHM,
+    files: filesIntegrity
+  };
+  return {
+    status: "success",
+    value: {
+      filesMap,
+      manifest: bundledManifest,
+      requiresBuild,
+      integrity: integrity ?? calcIntegrity(buffer)
+    },
+    indexWrites: [{ key: filesIndexFile, buffer: packToShared(pkgFilesIndex) }]
+  };
+}
+function calcIntegrity(buffer) {
+  const calculatedHash = crypto5.hash("sha512", buffer, "hex");
+  return formatIntegrity("sha512", calculatedHash);
+}
+function makeIgnoreFromPattern(pattern) {
+  let regex;
+  try {
+    regex = new RegExp(pattern);
+  } catch (err) {
+    const detail = util8.types.isNativeError(err) ? `: ${err.message}` : "";
+    throw new PnpmError("INVALID_IGNORE_FILE_PATTERN", `Invalid ignoreFilePattern regex${detail}: ${pattern}`);
+  }
+  return (filename) => regex.test(filename);
+}
+function packToShared(data) {
+  const packed = packForStorage(data);
+  const shared = new SharedArrayBuffer(packed.byteLength);
+  const view = new Uint8Array(shared);
+  view.set(packed);
+  return view;
+}
+function initStore({ storeDir }) {
+  fs12.mkdirSync(storeDir, { recursive: true });
+  const hexChars = "0123456789abcdef".split("");
+  const filesDirPath = path17.join(storeDir, "files");
+  try {
+    fs12.mkdirSync(filesDirPath);
+  } catch {
+  }
+  for (const hex1 of hexChars) {
+    for (const hex2 of hexChars) {
+      try {
+        fs12.mkdirSync(path17.join(filesDirPath, `${hex1}${hex2}`));
+      } catch {
+      }
+    }
+  }
+  return { status: "success" };
+}
+function addFilesFromDir2({ appendManifest, dir, files, filesIndexFile, includeNodeModules, sideEffectsCacheKey, storeDir }) {
+  if (!cafsCache.has(storeDir)) {
+    cafsCache.set(storeDir, createCafs(storeDir));
+  }
+  const cafs = cafsCache.get(storeDir);
+  let { filesIndex, manifest } = cafs.addFilesFromDir(dir, {
+    files,
+    includeNodeModules,
+    readManifest: true
+  });
+  if (appendManifest && manifest == null) {
+    manifest = appendManifest;
+    addManifestToCafs(cafs, filesIndex, appendManifest);
+  } else if (!filesIndex.has("package.json")) {
+    addPlaceholderPackageJsonToCafs(cafs, filesIndex);
+  }
+  const { filesIntegrity, filesMap } = processFilesIndex(filesIndex);
+  const bundledManifest = manifest != null ? normalizeBundledManifest(manifest) : void 0;
+  let requiresBuild;
+  let indexWrites;
+  if (sideEffectsCacheKey) {
+    const existingFilesIndex = getStoreIndex(storeDir).get(filesIndexFile);
+    if (!existingFilesIndex) {
+      return {
+        status: "success",
+        value: {
+          filesMap,
+          manifest: bundledManifest,
+          requiresBuild: pkgRequiresBuild(manifest, filesMap)
+        }
+      };
+    }
+    if (!existingFilesIndex.sideEffects) {
+      existingFilesIndex.sideEffects = /* @__PURE__ */ new Map();
+    }
+    if (existingFilesIndex.algo !== HASH_ALGORITHM) {
+      throw new PnpmError("ALGO_MISMATCH", `Algorithm mismatch: package index uses "${existingFilesIndex.algo}" but side effects were computed with "${HASH_ALGORITHM}"`);
+    }
+    existingFilesIndex.sideEffects.set(sideEffectsCacheKey, calculateDiff(existingFilesIndex.files, filesIntegrity));
+    if (existingFilesIndex.requiresBuild == null) {
+      requiresBuild = pkgRequiresBuild(manifest, filesMap);
+    } else {
+      requiresBuild = existingFilesIndex.requiresBuild;
+    }
+    indexWrites = [{ key: filesIndexFile, buffer: packToShared(existingFilesIndex) }];
+  } else {
+    requiresBuild = pkgRequiresBuild(bundledManifest, filesIntegrity);
+    const pkgFilesIndex = {
+      requiresBuild,
+      manifest: bundledManifest,
+      algo: HASH_ALGORITHM,
+      files: filesIntegrity
+    };
+    indexWrites = [{ key: filesIndexFile, buffer: packToShared(pkgFilesIndex) }];
+  }
+  return { status: "success", value: { filesMap, manifest: bundledManifest, requiresBuild }, indexWrites };
+}
+function addManifestToCafs(cafs, filesIndex, manifest) {
+  const fileBuffer = Buffer.from(JSON.stringify(manifest, null, 2), "utf8");
+  const mode = 420;
+  filesIndex.set("package.json", {
+    mode,
+    size: fileBuffer.length,
+    ...cafs.addFile(fileBuffer, mode)
+  });
+}
+var PLACEHOLDER_PACKAGE_JSON = Buffer.from(JSON.stringify({ _pnpmPlaceholder: "This file was generated by pnpm. The original package did not contain a package.json." }), "utf8");
+function addPlaceholderPackageJsonToCafs(cafs, filesIndex) {
+  const mode = 420;
+  filesIndex.set("package.json", {
+    mode,
+    size: PLACEHOLDER_PACKAGE_JSON.length,
+    ...cafs.addFile(PLACEHOLDER_PACKAGE_JSON, mode)
+  });
+}
+function calculateDiff(baseFiles, sideEffectsFiles) {
+  const deleted = [];
+  const added = /* @__PURE__ */ new Map();
+  const allFiles = /* @__PURE__ */ new Set([...baseFiles.keys(), ...sideEffectsFiles.keys()]);
+  for (const file of allFiles) {
+    if (!sideEffectsFiles.has(file)) {
+      deleted.push(file);
+    } else if (!baseFiles.has(file) || baseFiles.get(file).digest !== sideEffectsFiles.get(file).digest || baseFiles.get(file).mode !== sideEffectsFiles.get(file).mode) {
+      added.set(file, sideEffectsFiles.get(file));
+    }
+  }
+  const diff = {};
+  if (deleted.length > 0) {
+    diff.deleted = deleted;
+  }
+  if (added.size > 0) {
+    diff.added = added;
+  }
+  return diff;
+}
+function processFilesIndex(filesIndex) {
+  const filesIntegrity = /* @__PURE__ */ new Map();
+  const filesMap = /* @__PURE__ */ new Map();
+  for (const [k, { checkedAt, filePath, digest, mode, size }] of filesIndex) {
+    filesIntegrity.set(k, {
+      checkedAt,
+      digest,
+      mode,
+      size
+    });
+    filesMap.set(k, filePath);
+  }
+  return { filesIntegrity, filesMap };
+}
+function importPackage({ storeDir, packageImportMethod, filesResponse, sideEffectsCacheKey, targetDir, requiresBuild, force, keepModulesDir, disableRelinkLocalDirDeps, safeToSkip }) {
+  const cacheKey = JSON.stringify({ storeDir, packageImportMethod });
+  if (!cafsStoreCache.has(cacheKey)) {
+    cafsStoreCache.set(cacheKey, createCafsStore(storeDir, { packageImportMethod, cafsLocker }));
+  }
+  const cafsStore = cafsStoreCache.get(cacheKey);
+  const { importMethod, isBuilt } = cafsStore.importPackage(targetDir, {
+    filesResponse,
+    force,
+    disableRelinkLocalDirDeps,
+    requiresBuild,
+    sideEffectsCacheKey,
+    keepModulesDir,
+    safeToSkip
+  });
+  return { status: "success", value: { isBuilt, importMethod } };
+}
+function symlinkAllModules(opts2) {
+  for (const dep of opts2.deps) {
+    for (const [alias, pkgDir] of Object.entries(dep.children)) {
+      if (alias !== dep.name) {
+        symlinkDependencySync(pkgDir, dep.modules, alias);
+      }
+    }
+  }
+  return { status: "success" };
+}
+
+// ../worker/lib/worker.js
+startWorker();
+/*! Bundled license information:
+
+is-windows/index.js:
+  (*!
+   * is-windows 
+   *
+   * Copyright © 2015-2018, Jon Schlinkert.
+   * Released under the MIT License.
+   *)
+*/
diff --git a/.pnpm-store/v11/files/5e/a82725ad5fcc2b557edacb4c4383aef7877a482d7026e6532388daf8cfd44c078c89acec991bcf23a523686b7eef648e5b6227586447e5867b332939e5f0c1 b/.pnpm-store/v11/files/5e/a82725ad5fcc2b557edacb4c4383aef7877a482d7026e6532388daf8cfd44c078c89acec991bcf23a523686b7eef648e5b6227586447e5867b332939e5f0c1
new file mode 100644
index 0000000000..94448327ae
--- /dev/null
+++ b/.pnpm-store/v11/files/5e/a82725ad5fcc2b557edacb4c4383aef7877a482d7026e6532388daf8cfd44c078c89acec991bcf23a523686b7eef648e5b6227586447e5867b332939e5f0c1
@@ -0,0 +1,1030 @@
+# This file is dual licensed under the terms of the Apache License, Version
+# 2.0, and the BSD License. See the LICENSE file in the root of this repository
+# for complete details.
+"""
+.. testsetup::
+
+    from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
+    from packaging.version import Version
+"""
+
+import abc
+import itertools
+import re
+from typing import (
+    Callable,
+    Iterable,
+    Iterator,
+    List,
+    Optional,
+    Set,
+    Tuple,
+    TypeVar,
+    Union,
+)
+
+from .utils import canonicalize_version
+from .version import Version
+
+UnparsedVersion = Union[Version, str]
+UnparsedVersionVar = TypeVar("UnparsedVersionVar", bound=UnparsedVersion)
+CallableOperator = Callable[[Version, str], bool]
+
+
+def _coerce_version(version: UnparsedVersion) -> Version:
+    if not isinstance(version, Version):
+        version = Version(version)
+    return version
+
+
+class InvalidSpecifier(ValueError):
+    """
+    Raised when attempting to create a :class:`Specifier` with a specifier
+    string that is invalid.
+
+    >>> Specifier("lolwat")
+    Traceback (most recent call last):
+        ...
+    packaging.specifiers.InvalidSpecifier: Invalid specifier: 'lolwat'
+    """
+
+
+class BaseSpecifier(metaclass=abc.ABCMeta):
+    @abc.abstractmethod
+    def __str__(self) -> str:
+        """
+        Returns the str representation of this Specifier-like object. This
+        should be representative of the Specifier itself.
+        """
+
+    @abc.abstractmethod
+    def __hash__(self) -> int:
+        """
+        Returns a hash value for this Specifier-like object.
+        """
+
+    @abc.abstractmethod
+    def __eq__(self, other: object) -> bool:
+        """
+        Returns a boolean representing whether or not the two Specifier-like
+        objects are equal.
+
+        :param other: The other object to check against.
+        """
+
+    @property
+    @abc.abstractmethod
+    def prereleases(self) -> Optional[bool]:
+        """Whether or not pre-releases as a whole are allowed.
+
+        This can be set to either ``True`` or ``False`` to explicitly enable or disable
+        prereleases or it can be set to ``None`` (the default) to use default semantics.
+        """
+
+    @prereleases.setter
+    def prereleases(self, value: bool) -> None:
+        """Setter for :attr:`prereleases`.
+
+        :param value: The value to set.
+        """
+
+    @abc.abstractmethod
+    def contains(self, item: str, prereleases: Optional[bool] = None) -> bool:
+        """
+        Determines if the given item is contained within this specifier.
+        """
+
+    @abc.abstractmethod
+    def filter(
+        self, iterable: Iterable[UnparsedVersionVar], prereleases: Optional[bool] = None
+    ) -> Iterator[UnparsedVersionVar]:
+        """
+        Takes an iterable of items and filters them so that only items which
+        are contained within this specifier are allowed in it.
+        """
+
+
+class Specifier(BaseSpecifier):
+    """This class abstracts handling of version specifiers.
+
+    .. tip::
+
+        It is generally not required to instantiate this manually. You should instead
+        prefer to work with :class:`SpecifierSet` instead, which can parse
+        comma-separated version specifiers (which is what package metadata contains).
+    """
+
+    _operator_regex_str = r"""
+        (?P(~=|==|!=|<=|>=|<|>|===))
+        """
+    _version_regex_str = r"""
+        (?P
+            (?:
+                # The identity operators allow for an escape hatch that will
+                # do an exact string match of the version you wish to install.
+                # This will not be parsed by PEP 440 and we cannot determine
+                # any semantic meaning from it. This operator is discouraged
+                # but included entirely as an escape hatch.
+                (?<====)  # Only match for the identity operator
+                \s*
+                [^\s;)]*  # The arbitrary version can be just about anything,
+                          # we match everything except for whitespace, a
+                          # semi-colon for marker support, and a closing paren
+                          # since versions can be enclosed in them.
+            )
+            |
+            (?:
+                # The (non)equality operators allow for wild card and local
+                # versions to be specified so we have to define these two
+                # operators separately to enable that.
+                (?<===|!=)            # Only match for equals and not equals
+
+                \s*
+                v?
+                (?:[0-9]+!)?          # epoch
+                [0-9]+(?:\.[0-9]+)*   # release
+
+                # You cannot use a wild card and a pre-release, post-release, a dev or
+                # local version together so group them with a | and make them optional.
+                (?:
+                    \.\*  # Wild card syntax of .*
+                    |
+                    (?:                                  # pre release
+                        [-_\.]?
+                        (alpha|beta|preview|pre|a|b|c|rc)
+                        [-_\.]?
+                        [0-9]*
+                    )?
+                    (?:                                  # post release
+                        (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
+                    )?
+                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
+                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
+                )?
+            )
+            |
+            (?:
+                # The compatible operator requires at least two digits in the
+                # release segment.
+                (?<=~=)               # Only match for the compatible operator
+
+                \s*
+                v?
+                (?:[0-9]+!)?          # epoch
+                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
+                (?:                   # pre release
+                    [-_\.]?
+                    (alpha|beta|preview|pre|a|b|c|rc)
+                    [-_\.]?
+                    [0-9]*
+                )?
+                (?:                                   # post release
+                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
+                )?
+                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
+            )
+            |
+            (?:
+                # All other operators only allow a sub set of what the
+                # (non)equality operators do. Specifically they do not allow
+                # local versions to be specified nor do they allow the prefix
+                # matching wild cards.
+                (?=": "greater_than_equal",
+        "<": "less_than",
+        ">": "greater_than",
+        "===": "arbitrary",
+    }
+
+    def __init__(self, spec: str = "", prereleases: Optional[bool] = None) -> None:
+        """Initialize a Specifier instance.
+
+        :param spec:
+            The string representation of a specifier which will be parsed and
+            normalized before use.
+        :param prereleases:
+            This tells the specifier if it should accept prerelease versions if
+            applicable or not. The default of ``None`` will autodetect it from the
+            given specifiers.
+        :raises InvalidSpecifier:
+            If the given specifier is invalid (i.e. bad syntax).
+        """
+        match = self._regex.search(spec)
+        if not match:
+            raise InvalidSpecifier(f"Invalid specifier: '{spec}'")
+
+        self._spec: Tuple[str, str] = (
+            match.group("operator").strip(),
+            match.group("version").strip(),
+        )
+
+        # Store whether or not this Specifier should accept prereleases
+        self._prereleases = prereleases
+
+    # https://github.com/python/mypy/pull/13475#pullrequestreview-1079784515
+    @property  # type: ignore[override]
+    def prereleases(self) -> bool:
+        # If there is an explicit prereleases set for this, then we'll just
+        # blindly use that.
+        if self._prereleases is not None:
+            return self._prereleases
+
+        # Look at all of our specifiers and determine if they are inclusive
+        # operators, and if they are if they are including an explicit
+        # prerelease.
+        operator, version = self._spec
+        if operator in ["==", ">=", "<=", "~=", "==="]:
+            # The == specifier can include a trailing .*, if it does we
+            # want to remove before parsing.
+            if operator == "==" and version.endswith(".*"):
+                version = version[:-2]
+
+            # Parse the version, and if it is a pre-release than this
+            # specifier allows pre-releases.
+            if Version(version).is_prerelease:
+                return True
+
+        return False
+
+    @prereleases.setter
+    def prereleases(self, value: bool) -> None:
+        self._prereleases = value
+
+    @property
+    def operator(self) -> str:
+        """The operator of this specifier.
+
+        >>> Specifier("==1.2.3").operator
+        '=='
+        """
+        return self._spec[0]
+
+    @property
+    def version(self) -> str:
+        """The version of this specifier.
+
+        >>> Specifier("==1.2.3").version
+        '1.2.3'
+        """
+        return self._spec[1]
+
+    def __repr__(self) -> str:
+        """A representation of the Specifier that shows all internal state.
+
+        >>> Specifier('>=1.0.0')
+        =1.0.0')>
+        >>> Specifier('>=1.0.0', prereleases=False)
+        =1.0.0', prereleases=False)>
+        >>> Specifier('>=1.0.0', prereleases=True)
+        =1.0.0', prereleases=True)>
+        """
+        pre = (
+            f", prereleases={self.prereleases!r}"
+            if self._prereleases is not None
+            else ""
+        )
+
+        return f"<{self.__class__.__name__}({str(self)!r}{pre})>"
+
+    def __str__(self) -> str:
+        """A string representation of the Specifier that can be round-tripped.
+
+        >>> str(Specifier('>=1.0.0'))
+        '>=1.0.0'
+        >>> str(Specifier('>=1.0.0', prereleases=False))
+        '>=1.0.0'
+        """
+        return "{}{}".format(*self._spec)
+
+    @property
+    def _canonical_spec(self) -> Tuple[str, str]:
+        canonical_version = canonicalize_version(
+            self._spec[1],
+            strip_trailing_zero=(self._spec[0] != "~="),
+        )
+        return self._spec[0], canonical_version
+
+    def __hash__(self) -> int:
+        return hash(self._canonical_spec)
+
+    def __eq__(self, other: object) -> bool:
+        """Whether or not the two Specifier-like objects are equal.
+
+        :param other: The other object to check against.
+
+        The value of :attr:`prereleases` is ignored.
+
+        >>> Specifier("==1.2.3") == Specifier("== 1.2.3.0")
+        True
+        >>> (Specifier("==1.2.3", prereleases=False) ==
+        ...  Specifier("==1.2.3", prereleases=True))
+        True
+        >>> Specifier("==1.2.3") == "==1.2.3"
+        True
+        >>> Specifier("==1.2.3") == Specifier("==1.2.4")
+        False
+        >>> Specifier("==1.2.3") == Specifier("~=1.2.3")
+        False
+        """
+        if isinstance(other, str):
+            try:
+                other = self.__class__(str(other))
+            except InvalidSpecifier:
+                return NotImplemented
+        elif not isinstance(other, self.__class__):
+            return NotImplemented
+
+        return self._canonical_spec == other._canonical_spec
+
+    def _get_operator(self, op: str) -> CallableOperator:
+        operator_callable: CallableOperator = getattr(
+            self, f"_compare_{self._operators[op]}"
+        )
+        return operator_callable
+
+    def _compare_compatible(self, prospective: Version, spec: str) -> bool:
+
+        # Compatible releases have an equivalent combination of >= and ==. That
+        # is that ~=2.2 is equivalent to >=2.2,==2.*. This allows us to
+        # implement this in terms of the other specifiers instead of
+        # implementing it ourselves. The only thing we need to do is construct
+        # the other specifiers.
+
+        # We want everything but the last item in the version, but we want to
+        # ignore suffix segments.
+        prefix = _version_join(
+            list(itertools.takewhile(_is_not_suffix, _version_split(spec)))[:-1]
+        )
+
+        # Add the prefix notation to the end of our string
+        prefix += ".*"
+
+        return self._get_operator(">=")(prospective, spec) and self._get_operator("==")(
+            prospective, prefix
+        )
+
+    def _compare_equal(self, prospective: Version, spec: str) -> bool:
+
+        # We need special logic to handle prefix matching
+        if spec.endswith(".*"):
+            # In the case of prefix matching we want to ignore local segment.
+            normalized_prospective = canonicalize_version(
+                prospective.public, strip_trailing_zero=False
+            )
+            # Get the normalized version string ignoring the trailing .*
+            normalized_spec = canonicalize_version(spec[:-2], strip_trailing_zero=False)
+            # Split the spec out by bangs and dots, and pretend that there is
+            # an implicit dot in between a release segment and a pre-release segment.
+            split_spec = _version_split(normalized_spec)
+
+            # Split the prospective version out by bangs and dots, and pretend
+            # that there is an implicit dot in between a release segment and
+            # a pre-release segment.
+            split_prospective = _version_split(normalized_prospective)
+
+            # 0-pad the prospective version before shortening it to get the correct
+            # shortened version.
+            padded_prospective, _ = _pad_version(split_prospective, split_spec)
+
+            # Shorten the prospective version to be the same length as the spec
+            # so that we can determine if the specifier is a prefix of the
+            # prospective version or not.
+            shortened_prospective = padded_prospective[: len(split_spec)]
+
+            return shortened_prospective == split_spec
+        else:
+            # Convert our spec string into a Version
+            spec_version = Version(spec)
+
+            # If the specifier does not have a local segment, then we want to
+            # act as if the prospective version also does not have a local
+            # segment.
+            if not spec_version.local:
+                prospective = Version(prospective.public)
+
+            return prospective == spec_version
+
+    def _compare_not_equal(self, prospective: Version, spec: str) -> bool:
+        return not self._compare_equal(prospective, spec)
+
+    def _compare_less_than_equal(self, prospective: Version, spec: str) -> bool:
+
+        # NB: Local version identifiers are NOT permitted in the version
+        # specifier, so local version labels can be universally removed from
+        # the prospective version.
+        return Version(prospective.public) <= Version(spec)
+
+    def _compare_greater_than_equal(self, prospective: Version, spec: str) -> bool:
+
+        # NB: Local version identifiers are NOT permitted in the version
+        # specifier, so local version labels can be universally removed from
+        # the prospective version.
+        return Version(prospective.public) >= Version(spec)
+
+    def _compare_less_than(self, prospective: Version, spec_str: str) -> bool:
+
+        # Convert our spec to a Version instance, since we'll want to work with
+        # it as a version.
+        spec = Version(spec_str)
+
+        # Check to see if the prospective version is less than the spec
+        # version. If it's not we can short circuit and just return False now
+        # instead of doing extra unneeded work.
+        if not prospective < spec:
+            return False
+
+        # This special case is here so that, unless the specifier itself
+        # includes is a pre-release version, that we do not accept pre-release
+        # versions for the version mentioned in the specifier (e.g. <3.1 should
+        # not match 3.1.dev0, but should match 3.0.dev0).
+        if not spec.is_prerelease and prospective.is_prerelease:
+            if Version(prospective.base_version) == Version(spec.base_version):
+                return False
+
+        # If we've gotten to here, it means that prospective version is both
+        # less than the spec version *and* it's not a pre-release of the same
+        # version in the spec.
+        return True
+
+    def _compare_greater_than(self, prospective: Version, spec_str: str) -> bool:
+
+        # Convert our spec to a Version instance, since we'll want to work with
+        # it as a version.
+        spec = Version(spec_str)
+
+        # Check to see if the prospective version is greater than the spec
+        # version. If it's not we can short circuit and just return False now
+        # instead of doing extra unneeded work.
+        if not prospective > spec:
+            return False
+
+        # This special case is here so that, unless the specifier itself
+        # includes is a post-release version, that we do not accept
+        # post-release versions for the version mentioned in the specifier
+        # (e.g. >3.1 should not match 3.0.post0, but should match 3.2.post0).
+        if not spec.is_postrelease and prospective.is_postrelease:
+            if Version(prospective.base_version) == Version(spec.base_version):
+                return False
+
+        # Ensure that we do not allow a local version of the version mentioned
+        # in the specifier, which is technically greater than, to match.
+        if prospective.local is not None:
+            if Version(prospective.base_version) == Version(spec.base_version):
+                return False
+
+        # If we've gotten to here, it means that prospective version is both
+        # greater than the spec version *and* it's not a pre-release of the
+        # same version in the spec.
+        return True
+
+    def _compare_arbitrary(self, prospective: Version, spec: str) -> bool:
+        return str(prospective).lower() == str(spec).lower()
+
+    def __contains__(self, item: Union[str, Version]) -> bool:
+        """Return whether or not the item is contained in this specifier.
+
+        :param item: The item to check for.
+
+        This is used for the ``in`` operator and behaves the same as
+        :meth:`contains` with no ``prereleases`` argument passed.
+
+        >>> "1.2.3" in Specifier(">=1.2.3")
+        True
+        >>> Version("1.2.3") in Specifier(">=1.2.3")
+        True
+        >>> "1.0.0" in Specifier(">=1.2.3")
+        False
+        >>> "1.3.0a1" in Specifier(">=1.2.3")
+        False
+        >>> "1.3.0a1" in Specifier(">=1.2.3", prereleases=True)
+        True
+        """
+        return self.contains(item)
+
+    def contains(
+        self, item: UnparsedVersion, prereleases: Optional[bool] = None
+    ) -> bool:
+        """Return whether or not the item is contained in this specifier.
+
+        :param item:
+            The item to check for, which can be a version string or a
+            :class:`Version` instance.
+        :param prereleases:
+            Whether or not to match prereleases with this Specifier. If set to
+            ``None`` (the default), it uses :attr:`prereleases` to determine
+            whether or not prereleases are allowed.
+
+        >>> Specifier(">=1.2.3").contains("1.2.3")
+        True
+        >>> Specifier(">=1.2.3").contains(Version("1.2.3"))
+        True
+        >>> Specifier(">=1.2.3").contains("1.0.0")
+        False
+        >>> Specifier(">=1.2.3").contains("1.3.0a1")
+        False
+        >>> Specifier(">=1.2.3", prereleases=True).contains("1.3.0a1")
+        True
+        >>> Specifier(">=1.2.3").contains("1.3.0a1", prereleases=True)
+        True
+        """
+
+        # Determine if prereleases are to be allowed or not.
+        if prereleases is None:
+            prereleases = self.prereleases
+
+        # Normalize item to a Version, this allows us to have a shortcut for
+        # "2.0" in Specifier(">=2")
+        normalized_item = _coerce_version(item)
+
+        # Determine if we should be supporting prereleases in this specifier
+        # or not, if we do not support prereleases than we can short circuit
+        # logic if this version is a prereleases.
+        if normalized_item.is_prerelease and not prereleases:
+            return False
+
+        # Actually do the comparison to determine if this item is contained
+        # within this Specifier or not.
+        operator_callable: CallableOperator = self._get_operator(self.operator)
+        return operator_callable(normalized_item, self.version)
+
+    def filter(
+        self, iterable: Iterable[UnparsedVersionVar], prereleases: Optional[bool] = None
+    ) -> Iterator[UnparsedVersionVar]:
+        """Filter items in the given iterable, that match the specifier.
+
+        :param iterable:
+            An iterable that can contain version strings and :class:`Version` instances.
+            The items in the iterable will be filtered according to the specifier.
+        :param prereleases:
+            Whether or not to allow prereleases in the returned iterator. If set to
+            ``None`` (the default), it will be intelligently decide whether to allow
+            prereleases or not (based on the :attr:`prereleases` attribute, and
+            whether the only versions matching are prereleases).
+
+        This method is smarter than just ``filter(Specifier().contains, [...])``
+        because it implements the rule from :pep:`440` that a prerelease item
+        SHOULD be accepted if no other versions match the given specifier.
+
+        >>> list(Specifier(">=1.2.3").filter(["1.2", "1.3", "1.5a1"]))
+        ['1.3']
+        >>> list(Specifier(">=1.2.3").filter(["1.2", "1.2.3", "1.3", Version("1.4")]))
+        ['1.2.3', '1.3', ]
+        >>> list(Specifier(">=1.2.3").filter(["1.2", "1.5a1"]))
+        ['1.5a1']
+        >>> list(Specifier(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True))
+        ['1.3', '1.5a1']
+        >>> list(Specifier(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"]))
+        ['1.3', '1.5a1']
+        """
+
+        yielded = False
+        found_prereleases = []
+
+        kw = {"prereleases": prereleases if prereleases is not None else True}
+
+        # Attempt to iterate over all the values in the iterable and if any of
+        # them match, yield them.
+        for version in iterable:
+            parsed_version = _coerce_version(version)
+
+            if self.contains(parsed_version, **kw):
+                # If our version is a prerelease, and we were not set to allow
+                # prereleases, then we'll store it for later in case nothing
+                # else matches this specifier.
+                if parsed_version.is_prerelease and not (
+                    prereleases or self.prereleases
+                ):
+                    found_prereleases.append(version)
+                # Either this is not a prerelease, or we should have been
+                # accepting prereleases from the beginning.
+                else:
+                    yielded = True
+                    yield version
+
+        # Now that we've iterated over everything, determine if we've yielded
+        # any values, and if we have not and we have any prereleases stored up
+        # then we will go ahead and yield the prereleases.
+        if not yielded and found_prereleases:
+            for version in found_prereleases:
+                yield version
+
+
+_prefix_regex = re.compile(r"^([0-9]+)((?:a|b|c|rc)[0-9]+)$")
+
+
+def _version_split(version: str) -> List[str]:
+    """Split version into components.
+
+    The split components are intended for version comparison. The logic does
+    not attempt to retain the original version string, so joining the
+    components back with :func:`_version_join` may not produce the original
+    version string.
+    """
+    result: List[str] = []
+
+    epoch, _, rest = version.rpartition("!")
+    result.append(epoch or "0")
+
+    for item in rest.split("."):
+        match = _prefix_regex.search(item)
+        if match:
+            result.extend(match.groups())
+        else:
+            result.append(item)
+    return result
+
+
+def _version_join(components: List[str]) -> str:
+    """Join split version components into a version string.
+
+    This function assumes the input came from :func:`_version_split`, where the
+    first component must be the epoch (either empty or numeric), and all other
+    components numeric.
+    """
+    epoch, *rest = components
+    return f"{epoch}!{'.'.join(rest)}"
+
+
+def _is_not_suffix(segment: str) -> bool:
+    return not any(
+        segment.startswith(prefix) for prefix in ("dev", "a", "b", "rc", "post")
+    )
+
+
+def _pad_version(left: List[str], right: List[str]) -> Tuple[List[str], List[str]]:
+    left_split, right_split = [], []
+
+    # Get the release segment of our versions
+    left_split.append(list(itertools.takewhile(lambda x: x.isdigit(), left)))
+    right_split.append(list(itertools.takewhile(lambda x: x.isdigit(), right)))
+
+    # Get the rest of our versions
+    left_split.append(left[len(left_split[0]) :])
+    right_split.append(right[len(right_split[0]) :])
+
+    # Insert our padding
+    left_split.insert(1, ["0"] * max(0, len(right_split[0]) - len(left_split[0])))
+    right_split.insert(1, ["0"] * max(0, len(left_split[0]) - len(right_split[0])))
+
+    return (list(itertools.chain(*left_split)), list(itertools.chain(*right_split)))
+
+
+class SpecifierSet(BaseSpecifier):
+    """This class abstracts handling of a set of version specifiers.
+
+    It can be passed a single specifier (``>=3.0``), a comma-separated list of
+    specifiers (``>=3.0,!=3.1``), or no specifier at all.
+    """
+
+    def __init__(
+        self, specifiers: str = "", prereleases: Optional[bool] = None
+    ) -> None:
+        """Initialize a SpecifierSet instance.
+
+        :param specifiers:
+            The string representation of a specifier or a comma-separated list of
+            specifiers which will be parsed and normalized before use.
+        :param prereleases:
+            This tells the SpecifierSet if it should accept prerelease versions if
+            applicable or not. The default of ``None`` will autodetect it from the
+            given specifiers.
+
+        :raises InvalidSpecifier:
+            If the given ``specifiers`` are not parseable than this exception will be
+            raised.
+        """
+
+        # Split on `,` to break each individual specifier into it's own item, and
+        # strip each item to remove leading/trailing whitespace.
+        split_specifiers = [s.strip() for s in specifiers.split(",") if s.strip()]
+
+        # Parsed each individual specifier, attempting first to make it a
+        # Specifier.
+        parsed: Set[Specifier] = set()
+        for specifier in split_specifiers:
+            parsed.add(Specifier(specifier))
+
+        # Turn our parsed specifiers into a frozen set and save them for later.
+        self._specs = frozenset(parsed)
+
+        # Store our prereleases value so we can use it later to determine if
+        # we accept prereleases or not.
+        self._prereleases = prereleases
+
+    @property
+    def prereleases(self) -> Optional[bool]:
+        # If we have been given an explicit prerelease modifier, then we'll
+        # pass that through here.
+        if self._prereleases is not None:
+            return self._prereleases
+
+        # If we don't have any specifiers, and we don't have a forced value,
+        # then we'll just return None since we don't know if this should have
+        # pre-releases or not.
+        if not self._specs:
+            return None
+
+        # Otherwise we'll see if any of the given specifiers accept
+        # prereleases, if any of them do we'll return True, otherwise False.
+        return any(s.prereleases for s in self._specs)
+
+    @prereleases.setter
+    def prereleases(self, value: bool) -> None:
+        self._prereleases = value
+
+    def __repr__(self) -> str:
+        """A representation of the specifier set that shows all internal state.
+
+        Note that the ordering of the individual specifiers within the set may not
+        match the input string.
+
+        >>> SpecifierSet('>=1.0.0,!=2.0.0')
+        =1.0.0')>
+        >>> SpecifierSet('>=1.0.0,!=2.0.0', prereleases=False)
+        =1.0.0', prereleases=False)>
+        >>> SpecifierSet('>=1.0.0,!=2.0.0', prereleases=True)
+        =1.0.0', prereleases=True)>
+        """
+        pre = (
+            f", prereleases={self.prereleases!r}"
+            if self._prereleases is not None
+            else ""
+        )
+
+        return f""
+
+    def __str__(self) -> str:
+        """A string representation of the specifier set that can be round-tripped.
+
+        Note that the ordering of the individual specifiers within the set may not
+        match the input string.
+
+        >>> str(SpecifierSet(">=1.0.0,!=1.0.1"))
+        '!=1.0.1,>=1.0.0'
+        >>> str(SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False))
+        '!=1.0.1,>=1.0.0'
+        """
+        return ",".join(sorted(str(s) for s in self._specs))
+
+    def __hash__(self) -> int:
+        return hash(self._specs)
+
+    def __and__(self, other: Union["SpecifierSet", str]) -> "SpecifierSet":
+        """Return a SpecifierSet which is a combination of the two sets.
+
+        :param other: The other object to combine with.
+
+        >>> SpecifierSet(">=1.0.0,!=1.0.1") & '<=2.0.0,!=2.0.1'
+        =1.0.0')>
+        >>> SpecifierSet(">=1.0.0,!=1.0.1") & SpecifierSet('<=2.0.0,!=2.0.1')
+        =1.0.0')>
+        """
+        if isinstance(other, str):
+            other = SpecifierSet(other)
+        elif not isinstance(other, SpecifierSet):
+            return NotImplemented
+
+        specifier = SpecifierSet()
+        specifier._specs = frozenset(self._specs | other._specs)
+
+        if self._prereleases is None and other._prereleases is not None:
+            specifier._prereleases = other._prereleases
+        elif self._prereleases is not None and other._prereleases is None:
+            specifier._prereleases = self._prereleases
+        elif self._prereleases == other._prereleases:
+            specifier._prereleases = self._prereleases
+        else:
+            raise ValueError(
+                "Cannot combine SpecifierSets with True and False prerelease "
+                "overrides."
+            )
+
+        return specifier
+
+    def __eq__(self, other: object) -> bool:
+        """Whether or not the two SpecifierSet-like objects are equal.
+
+        :param other: The other object to check against.
+
+        The value of :attr:`prereleases` is ignored.
+
+        >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.1")
+        True
+        >>> (SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False) ==
+        ...  SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True))
+        True
+        >>> SpecifierSet(">=1.0.0,!=1.0.1") == ">=1.0.0,!=1.0.1"
+        True
+        >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0")
+        False
+        >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.2")
+        False
+        """
+        if isinstance(other, (str, Specifier)):
+            other = SpecifierSet(str(other))
+        elif not isinstance(other, SpecifierSet):
+            return NotImplemented
+
+        return self._specs == other._specs
+
+    def __len__(self) -> int:
+        """Returns the number of specifiers in this specifier set."""
+        return len(self._specs)
+
+    def __iter__(self) -> Iterator[Specifier]:
+        """
+        Returns an iterator over all the underlying :class:`Specifier` instances
+        in this specifier set.
+
+        >>> sorted(SpecifierSet(">=1.0.0,!=1.0.1"), key=str)
+        [, =1.0.0')>]
+        """
+        return iter(self._specs)
+
+    def __contains__(self, item: UnparsedVersion) -> bool:
+        """Return whether or not the item is contained in this specifier.
+
+        :param item: The item to check for.
+
+        This is used for the ``in`` operator and behaves the same as
+        :meth:`contains` with no ``prereleases`` argument passed.
+
+        >>> "1.2.3" in SpecifierSet(">=1.0.0,!=1.0.1")
+        True
+        >>> Version("1.2.3") in SpecifierSet(">=1.0.0,!=1.0.1")
+        True
+        >>> "1.0.1" in SpecifierSet(">=1.0.0,!=1.0.1")
+        False
+        >>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1")
+        False
+        >>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True)
+        True
+        """
+        return self.contains(item)
+
+    def contains(
+        self,
+        item: UnparsedVersion,
+        prereleases: Optional[bool] = None,
+        installed: Optional[bool] = None,
+    ) -> bool:
+        """Return whether or not the item is contained in this SpecifierSet.
+
+        :param item:
+            The item to check for, which can be a version string or a
+            :class:`Version` instance.
+        :param prereleases:
+            Whether or not to match prereleases with this SpecifierSet. If set to
+            ``None`` (the default), it uses :attr:`prereleases` to determine
+            whether or not prereleases are allowed.
+
+        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.2.3")
+        True
+        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains(Version("1.2.3"))
+        True
+        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.0.1")
+        False
+        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1")
+        False
+        >>> SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True).contains("1.3.0a1")
+        True
+        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1", prereleases=True)
+        True
+        """
+        # Ensure that our item is a Version instance.
+        if not isinstance(item, Version):
+            item = Version(item)
+
+        # Determine if we're forcing a prerelease or not, if we're not forcing
+        # one for this particular filter call, then we'll use whatever the
+        # SpecifierSet thinks for whether or not we should support prereleases.
+        if prereleases is None:
+            prereleases = self.prereleases
+
+        # We can determine if we're going to allow pre-releases by looking to
+        # see if any of the underlying items supports them. If none of them do
+        # and this item is a pre-release then we do not allow it and we can
+        # short circuit that here.
+        # Note: This means that 1.0.dev1 would not be contained in something
+        #       like >=1.0.devabc however it would be in >=1.0.debabc,>0.0.dev0
+        if not prereleases and item.is_prerelease:
+            return False
+
+        if installed and item.is_prerelease:
+            item = Version(item.base_version)
+
+        # We simply dispatch to the underlying specs here to make sure that the
+        # given version is contained within all of them.
+        # Note: This use of all() here means that an empty set of specifiers
+        #       will always return True, this is an explicit design decision.
+        return all(s.contains(item, prereleases=prereleases) for s in self._specs)
+
+    def filter(
+        self, iterable: Iterable[UnparsedVersionVar], prereleases: Optional[bool] = None
+    ) -> Iterator[UnparsedVersionVar]:
+        """Filter items in the given iterable, that match the specifiers in this set.
+
+        :param iterable:
+            An iterable that can contain version strings and :class:`Version` instances.
+            The items in the iterable will be filtered according to the specifier.
+        :param prereleases:
+            Whether or not to allow prereleases in the returned iterator. If set to
+            ``None`` (the default), it will be intelligently decide whether to allow
+            prereleases or not (based on the :attr:`prereleases` attribute, and
+            whether the only versions matching are prereleases).
+
+        This method is smarter than just ``filter(SpecifierSet(...).contains, [...])``
+        because it implements the rule from :pep:`440` that a prerelease item
+        SHOULD be accepted if no other versions match the given specifier.
+
+        >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", "1.5a1"]))
+        ['1.3']
+        >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", Version("1.4")]))
+        ['1.3', ]
+        >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.5a1"]))
+        []
+        >>> list(SpecifierSet(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True))
+        ['1.3', '1.5a1']
+        >>> list(SpecifierSet(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"]))
+        ['1.3', '1.5a1']
+
+        An "empty" SpecifierSet will filter items based on the presence of prerelease
+        versions in the set.
+
+        >>> list(SpecifierSet("").filter(["1.3", "1.5a1"]))
+        ['1.3']
+        >>> list(SpecifierSet("").filter(["1.5a1"]))
+        ['1.5a1']
+        >>> list(SpecifierSet("", prereleases=True).filter(["1.3", "1.5a1"]))
+        ['1.3', '1.5a1']
+        >>> list(SpecifierSet("").filter(["1.3", "1.5a1"], prereleases=True))
+        ['1.3', '1.5a1']
+        """
+        # Determine if we're forcing a prerelease or not, if we're not forcing
+        # one for this particular filter call, then we'll use whatever the
+        # SpecifierSet thinks for whether or not we should support prereleases.
+        if prereleases is None:
+            prereleases = self.prereleases
+
+        # If we have any specifiers, then we want to wrap our iterable in the
+        # filter method for each one, this will act as a logical AND amongst
+        # each specifier.
+        if self._specs:
+            for spec in self._specs:
+                iterable = spec.filter(iterable, prereleases=bool(prereleases))
+            return iter(iterable)
+        # If we do not have any specifiers, then we need to have a rough filter
+        # which will filter out any pre-releases, unless there are no final
+        # releases.
+        else:
+            filtered: List[UnparsedVersionVar] = []
+            found_prereleases: List[UnparsedVersionVar] = []
+
+            for item in iterable:
+                parsed_version = _coerce_version(item)
+
+                # Store any item which is a pre-release for later unless we've
+                # already found a final version or we are accepting prereleases
+                if parsed_version.is_prerelease and not prereleases:
+                    if not filtered:
+                        found_prereleases.append(item)
+                else:
+                    filtered.append(item)
+
+            # If we've found no items except for pre-releases, then we'll go
+            # ahead and use the pre-releases
+            if not filtered and found_prereleases and prereleases is None:
+                return iter(found_prereleases)
+
+            return iter(filtered)
diff --git a/.pnpm-store/v11/files/5e/adb69279a7cacc96e921f79cdbe6ce2eec6bb937c0df8e54b390ca70ba3b1b6fba09886d34d64803fa6cf54ba6d9a020af40540b0d57c8b32fa68655e6e6cb b/.pnpm-store/v11/files/5e/adb69279a7cacc96e921f79cdbe6ce2eec6bb937c0df8e54b390ca70ba3b1b6fba09886d34d64803fa6cf54ba6d9a020af40540b0d57c8b32fa68655e6e6cb
new file mode 100644
index 0000000000..26f220c64c
--- /dev/null
+++ b/.pnpm-store/v11/files/5e/adb69279a7cacc96e921f79cdbe6ce2eec6bb937c0df8e54b390ca70ba3b1b6fba09886d34d64803fa6cf54ba6d9a020af40540b0d57c8b32fa68655e6e6cb
@@ -0,0 +1,44 @@
+'use strict'
+
+module.exports = class DecoratorHandler {
+  #handler
+
+  constructor (handler) {
+    if (typeof handler !== 'object' || handler === null) {
+      throw new TypeError('handler must be an object')
+    }
+    this.#handler = handler
+  }
+
+  onConnect (...args) {
+    return this.#handler.onConnect?.(...args)
+  }
+
+  onError (...args) {
+    return this.#handler.onError?.(...args)
+  }
+
+  onUpgrade (...args) {
+    return this.#handler.onUpgrade?.(...args)
+  }
+
+  onResponseStarted (...args) {
+    return this.#handler.onResponseStarted?.(...args)
+  }
+
+  onHeaders (...args) {
+    return this.#handler.onHeaders?.(...args)
+  }
+
+  onData (...args) {
+    return this.#handler.onData?.(...args)
+  }
+
+  onComplete (...args) {
+    return this.#handler.onComplete?.(...args)
+  }
+
+  onBodySent (...args) {
+    return this.#handler.onBodySent?.(...args)
+  }
+}
diff --git a/.pnpm-store/v11/files/5e/ec1fb70785393cc05c3bd052b1662d85be07fbb288f6eecaa6304870cea3b2f3e7c52ad8beb111db25b80b3e55006a5cf5e38f5ecd9c806994a4e92647863a b/.pnpm-store/v11/files/5e/ec1fb70785393cc05c3bd052b1662d85be07fbb288f6eecaa6304870cea3b2f3e7c52ad8beb111db25b80b3e55006a5cf5e38f5ecd9c806994a4e92647863a
new file mode 100644
index 0000000000..655d7dbc0d
--- /dev/null
+++ b/.pnpm-store/v11/files/5e/ec1fb70785393cc05c3bd052b1662d85be07fbb288f6eecaa6304870cea3b2f3e7c52ad8beb111db25b80b3e55006a5cf5e38f5ecd9c806994a4e92647863a
@@ -0,0 +1,136 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ReadEntry = void 0;
+const minipass_1 = require("minipass");
+const normalize_windows_path_js_1 = require("./normalize-windows-path.js");
+class ReadEntry extends minipass_1.Minipass {
+    extended;
+    globalExtended;
+    header;
+    startBlockSize;
+    blockRemain;
+    remain;
+    type;
+    meta = false;
+    ignore = false;
+    path;
+    mode;
+    uid;
+    gid;
+    uname;
+    gname;
+    size = 0;
+    mtime;
+    atime;
+    ctime;
+    linkpath;
+    dev;
+    ino;
+    nlink;
+    invalid = false;
+    absolute;
+    unsupported = false;
+    constructor(header, ex, gex) {
+        super({});
+        // read entries always start life paused.  this is to avoid the
+        // situation where Minipass's auto-ending empty streams results
+        // in an entry ending before we're ready for it.
+        this.pause();
+        this.extended = ex;
+        this.globalExtended = gex;
+        this.header = header;
+        /* c8 ignore start */
+        this.remain = header.size ?? 0;
+        /* c8 ignore stop */
+        this.startBlockSize = 512 * Math.ceil(this.remain / 512);
+        this.blockRemain = this.startBlockSize;
+        this.type = header.type;
+        switch (this.type) {
+            case 'File':
+            case 'OldFile':
+            case 'Link':
+            case 'SymbolicLink':
+            case 'CharacterDevice':
+            case 'BlockDevice':
+            case 'Directory':
+            case 'FIFO':
+            case 'ContiguousFile':
+            case 'GNUDumpDir':
+                break;
+            case 'NextFileHasLongLinkpath':
+            case 'NextFileHasLongPath':
+            case 'OldGnuLongPath':
+            case 'GlobalExtendedHeader':
+            case 'ExtendedHeader':
+            case 'OldExtendedHeader':
+                this.meta = true;
+                break;
+            // NOTE: gnutar and bsdtar treat unrecognized types as 'File'
+            // it may be worth doing the same, but with a warning.
+            default:
+                this.ignore = true;
+        }
+        /* c8 ignore start */
+        if (!header.path) {
+            throw new Error('no path provided for tar.ReadEntry');
+        }
+        /* c8 ignore stop */
+        this.path = (0, normalize_windows_path_js_1.normalizeWindowsPath)(header.path);
+        this.mode = header.mode;
+        if (this.mode) {
+            this.mode = this.mode & 0o7777;
+        }
+        this.uid = header.uid;
+        this.gid = header.gid;
+        this.uname = header.uname;
+        this.gname = header.gname;
+        this.size = this.remain;
+        this.mtime = header.mtime;
+        this.atime = header.atime;
+        this.ctime = header.ctime;
+        /* c8 ignore start */
+        this.linkpath =
+            header.linkpath ? (0, normalize_windows_path_js_1.normalizeWindowsPath)(header.linkpath) : undefined;
+        /* c8 ignore stop */
+        this.uname = header.uname;
+        this.gname = header.gname;
+        if (ex) {
+            this.#slurp(ex);
+        }
+        if (gex) {
+            this.#slurp(gex, true);
+        }
+    }
+    write(data) {
+        const writeLen = data.length;
+        if (writeLen > this.blockRemain) {
+            throw new Error('writing more to entry than is appropriate');
+        }
+        const r = this.remain;
+        const br = this.blockRemain;
+        this.remain = Math.max(0, r - writeLen);
+        this.blockRemain = Math.max(0, br - writeLen);
+        if (this.ignore) {
+            return true;
+        }
+        if (r >= writeLen) {
+            return super.write(data);
+        }
+        // r < writeLen
+        return super.write(data.subarray(0, r));
+    }
+    #slurp(ex, gex = false) {
+        if (ex.path)
+            ex.path = (0, normalize_windows_path_js_1.normalizeWindowsPath)(ex.path);
+        if (ex.linkpath)
+            ex.linkpath = (0, normalize_windows_path_js_1.normalizeWindowsPath)(ex.linkpath);
+        Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => {
+            // we slurp in everything except for the path attribute in
+            // a global extended header, because that's weird. Also, any
+            // null/undefined values are ignored.
+            return !(v === null || v === undefined || (k === 'path' && gex));
+        })));
+    }
+}
+exports.ReadEntry = ReadEntry;
+//# sourceMappingURL=read-entry.js.map
\ No newline at end of file
diff --git a/.pnpm-store/v11/files/5f/354b4031f4dd9fb19eac8bc165099d6aed5807037fb9aa19e3f12e8882437c7d3be410850532bad451beb8fde8ff71544ef658db2649d22bfddcc9bcbd5995 b/.pnpm-store/v11/files/5f/354b4031f4dd9fb19eac8bc165099d6aed5807037fb9aa19e3f12e8882437c7d3be410850532bad451beb8fde8ff71544ef658db2649d22bfddcc9bcbd5995
new file mode 100644
index 0000000000..ca408e153a
--- /dev/null
+++ b/.pnpm-store/v11/files/5f/354b4031f4dd9fb19eac8bc165099d6aed5807037fb9aa19e3f12e8882437c7d3be410850532bad451beb8fde8ff71544ef658db2649d22bfddcc9bcbd5995
@@ -0,0 +1,352 @@
+'use strict'
+
+/**
+ * @param {string} value
+ * @returns {boolean}
+ */
+function isCTLExcludingHtab (value) {
+  for (let i = 0; i < value.length; ++i) {
+    const code = value.charCodeAt(i)
+
+    if (
+      (code >= 0x00 && code <= 0x08) ||
+      (code >= 0x0A && code <= 0x1F) ||
+      code === 0x7F
+    ) {
+      return true
+    }
+  }
+  return false
+}
+
+/**
+ CHAR           = 
+ token          = 1*
+ separators     = "(" | ")" | "<" | ">" | "@"
+                | "," | ";" | ":" | "\" | <">
+                | "/" | "[" | "]" | "?" | "="
+                | "{" | "}" | SP | HT
+ * @param {string} name
+ */
+function validateCookieName (name) {
+  for (let i = 0; i < name.length; ++i) {
+    const code = name.charCodeAt(i)
+
+    if (
+      code < 0x21 || // exclude CTLs (0-31), SP and HT
+      code > 0x7E || // exclude non-ascii and DEL
+      code === 0x22 || // "
+      code === 0x28 || // (
+      code === 0x29 || // )
+      code === 0x3C || // <
+      code === 0x3E || // >
+      code === 0x40 || // @
+      code === 0x2C || // ,
+      code === 0x3B || // ;
+      code === 0x3A || // :
+      code === 0x5C || // \
+      code === 0x2F || // /
+      code === 0x5B || // [
+      code === 0x5D || // ]
+      code === 0x3F || // ?
+      code === 0x3D || // =
+      code === 0x7B || // {
+      code === 0x7D // }
+    ) {
+      throw new Error('Invalid cookie name')
+    }
+  }
+}
+
+/**
+ cookie-value      = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
+ cookie-octet      = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
+                       ; US-ASCII characters excluding CTLs,
+                       ; whitespace DQUOTE, comma, semicolon,
+                       ; and backslash
+ * @param {string} value
+ */
+function validateCookieValue (value) {
+  let len = value.length
+  let i = 0
+
+  // if the value is wrapped in DQUOTE
+  if (value[0] === '"') {
+    if (len === 1 || value[len - 1] !== '"') {
+      throw new Error('Invalid cookie value')
+    }
+    --len
+    ++i
+  }
+
+  while (i < len) {
+    const code = value.charCodeAt(i++)
+
+    if (
+      code < 0x21 || // exclude CTLs (0-31)
+      code > 0x7E || // non-ascii and DEL (127)
+      code === 0x22 || // "
+      code === 0x2C || // ,
+      code === 0x3B || // ;
+      code === 0x5C // \
+    ) {
+      throw new Error('Invalid cookie value')
+    }
+  }
+}
+
+/**
+ * path-value        = 
+ * @param {string} path
+ */
+function validateCookiePath (path) {
+  for (let i = 0; i < path.length; ++i) {
+    const code = path.charCodeAt(i)
+
+    if (
+      code < 0x20 || // exclude CTLs (0-31)
+      code > 0x7E || // exclude DEL and non-ascii
+      code === 0x3B // ;
+    ) {
+      throw new Error('Invalid cookie path')
+    }
+  }
+}
+
+/**
+ *  ::=  | 
+ *
+ *  ::= any one of the 52 alphabetic characters A through Z in
+ * upper case and a through z in lower case
+ *
+ *  ::= any one of the ten digits 0 through 9r
+ *
+ * @see https://www.rfc-editor.org/rfc/rfc1034#section-3.5
+ * @param {number} code
+ */
+function isLetterOrDigit (code) {
+  return (
+    (code >= 0x30 && code <= 0x39) || // 0-9
+    (code >= 0x41 && code <= 0x5A) || // A-Z
+    (code >= 0x61 && code <= 0x7A) // a-z
+  )
+}
+
+/**
+ * Validates a cookie domain against the "preferred name syntax".
+ *
+ *       ::=  | " "
+ *    ::=