diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5913489..82e5100 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,9 +14,17 @@ jobs: - uses: actions/checkout@v3 - name: Setup PDM uses: ./ + id: setup-pdm with: python-version: ${{ matrix.python-version }} + - name: Check output + run: | + echo ${{ steps.setup-pdm.outputs.pdm-bin }} + echo ${{ steps.setup-pdm.outputs.pdm-version }} + echo ${{ steps.setup-pdm.outputs.python-path }} + echo ${{ steps.setup-pdm.outputs.python-version }} + - name: Install dependencies run: pdm install -v && pdm info diff --git a/README.md b/README.md index 0aef949..91bfb30 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ steps: - uses: pdm-project/setup-pdm@main name: Setup PDM with: - python-version: 3.8 # Version range or exact version of a Python version to use, the same as actions/setup-python + python-version: 3.9 # Version range or exact version of a Python version to use, the same as actions/setup-python architecture: x64 # The target architecture (x86, x64) of the Python interpreter. the same as actions/setup-python - version: 1.4.0 # The version of PDM to install. Leave it as empty to use the latest version from PyPI + version: 1.4.0 # The version of PDM to install. Leave it as empty to use the latest version from PyPI, or 'head' to use the latest version from GitHub prerelease: true # Allow prerelease versions to be installed enable-pep582: true # Enable PEP 582 package loading globally - name: Install dependencies @@ -28,3 +28,19 @@ steps: ``` You don't need `actions/setup-python` actually. + +## Action Outputs + +This action also exposes the following outputs: + +```yaml +outputs: + python-version: + description: "The installed Python or PyPy version. Useful when given a version range as input." + python-path: + description: "The absolute path to the Python or PyPy executable." + pdm-version: + description: "The installed PDM version." + pdm-bin: + description: "The absolute path to the PDM executable." +``` diff --git a/action.yml b/action.yml index f636636..96f37e0 100644 --- a/action.yml +++ b/action.yml @@ -15,10 +15,7 @@ inputs: default: ${{ github.token }} required: false version: - description: The version of PDM to install. - required: false - ref: - description: The Ref of GitHub Repository + description: The version of PDM to install, or 'head' to install from the main branch. required: false prerelease: description: Allow prerelease versions to be installed @@ -28,6 +25,15 @@ inputs: description: "Enable PEP 582 package loading globally." default: "true" required: false +outputs: + python-version: + description: "The installed Python or PyPy version. Useful when given a version range as input." + python-path: + description: "The absolute path to the Python or PyPy executable." + pdm-version: + description: "The installed PDM version." + pdm-bin: + description: "The absolute path to the PDM executable." runs: using: "node16" main: "dist/setup-pdm.js" diff --git a/dist/setup-pdm.js b/dist/setup-pdm.js index 047c50d..3bdd1eb 100644 --- a/dist/setup-pdm.js +++ b/dist/setup-pdm.js @@ -107,11 +107,11 @@ var require_command = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.issue = exports.issueCommand = void 0; - var os3 = __importStar(require("os")); + var os4 = __importStar(require("os")); var utils_1 = require_utils(); function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os3.EOL); + process.stdout.write(cmd.toString() + os4.EOL); } exports.issueCommand = issueCommand; function issue(name, message = "") { @@ -380,8 +380,8 @@ var require_v35 = __commonJS({ } var DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; exports.DNS = DNS; - var URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; - exports.URL = URL2; + var URL4 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; + exports.URL = URL4; function _default(name, version, hashfunc) { function generateUUID(value, namespace, buf, offset) { if (typeof value === "string") { @@ -413,7 +413,7 @@ var require_v35 = __commonJS({ } catch (err) { } generateUUID.DNS = DNS; - generateUUID.URL = URL2; + generateUUID.URL = URL4; return generateUUID; } } @@ -686,7 +686,7 @@ var require_file_command = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; var fs4 = __importStar(require("fs")); - var os3 = __importStar(require("os")); + var os4 = __importStar(require("os")); var uuid_1 = require_dist(); var utils_1 = require_utils(); function issueFileCommand(command, message) { @@ -697,7 +697,7 @@ var require_file_command = __commonJS({ if (!fs4.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs4.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os3.EOL}`, { + fs4.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os4.EOL}`, { encoding: "utf8" }); } @@ -711,7 +711,7 @@ var require_file_command = __commonJS({ if (convertedValue.includes(delimiter)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return `${key}<<${delimiter}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`; + return `${key}<<${delimiter}${os4.EOL}${convertedValue}${os4.EOL}${delimiter}`; } exports.prepareKeyValueMessage = prepareKeyValueMessage; } @@ -777,12 +777,12 @@ var require_proxy = __commonJS({ var require_tunnel = __commonJS({ "node_modules/.pnpm/tunnel@0.0.6/node_modules/tunnel/lib/tunnel.js"(exports) { "use strict"; - var net = require("net"); + var net2 = require("net"); var tls = require("tls"); - var http = require("http"); - var https = require("https"); + var http3 = require("http"); + var https2 = require("https"); var events = require("events"); - var assert = require("assert"); + var assert2 = require("assert"); var util = require("util"); exports.httpOverHttp = httpOverHttp; exports.httpsOverHttp = httpsOverHttp; @@ -790,24 +790,24 @@ var require_tunnel = __commonJS({ exports.httpsOverHttps = httpsOverHttps; function httpOverHttp(options) { var agent = new TunnelingAgent(options); - agent.request = http.request; + agent.request = http3.request; return agent; } function httpsOverHttp(options) { var agent = new TunnelingAgent(options); - agent.request = http.request; + agent.request = http3.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function httpOverHttps(options) { var agent = new TunnelingAgent(options); - agent.request = https.request; + agent.request = https2.request; return agent; } function httpsOverHttps(options) { var agent = new TunnelingAgent(options); - agent.request = https.request; + agent.request = https2.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; @@ -816,7 +816,7 @@ var require_tunnel = __commonJS({ var self2 = this; self2.options = options || {}; self2.proxyOptions = self2.options.proxy || {}; - self2.maxSockets = self2.options.maxSockets || http.Agent.defaultMaxSockets; + self2.maxSockets = self2.options.maxSockets || http3.Agent.defaultMaxSockets; self2.requests = []; self2.sockets = []; self2.on("free", function onFree(socket, host, port, localAddress) { @@ -876,7 +876,7 @@ var require_tunnel = __commonJS({ connectOptions.headers = connectOptions.headers || {}; connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); } - debug4("making CONNECT request"); + debug5("making CONNECT request"); var connectReq = self2.request(connectOptions); connectReq.useChunkedEncodingByDefault = false; connectReq.once("response", onResponse); @@ -896,7 +896,7 @@ var require_tunnel = __commonJS({ connectReq.removeAllListeners(); socket.removeAllListeners(); if (res.statusCode !== 200) { - debug4( + debug5( "tunneling socket could not be established, statusCode=%d", res.statusCode ); @@ -908,7 +908,7 @@ var require_tunnel = __commonJS({ return; } if (head.length > 0) { - debug4("got illegal response body from proxy"); + debug5("got illegal response body from proxy"); socket.destroy(); var error2 = new Error("got illegal response body from proxy"); error2.code = "ECONNRESET"; @@ -916,13 +916,13 @@ var require_tunnel = __commonJS({ self2.removeSocket(placeholder); return; } - debug4("tunneling connection has established"); + debug5("tunneling connection has established"); self2.sockets[self2.sockets.indexOf(placeholder)] = socket; return cb(socket); } function onError(cause) { connectReq.removeAllListeners(); - debug4( + debug5( "tunneling socket could not be established, cause=%s\n", cause.message, cause.stack @@ -984,9 +984,9 @@ var require_tunnel = __commonJS({ } return target; } - var debug4; + var debug5; if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { - debug4 = function() { + debug5 = function() { var args = Array.prototype.slice.call(arguments); if (typeof args[0] === "string") { args[0] = "TUNNEL: " + args[0]; @@ -996,10 +996,10 @@ var require_tunnel = __commonJS({ console.error.apply(console, args); }; } else { - debug4 = function() { + debug5 = function() { }; } - exports.debug = debug4; + exports.debug = debug5; } }); @@ -1071,8 +1071,8 @@ var require_lib = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; - var http = __importStar(require("http")); - var https = __importStar(require("https")); + var http3 = __importStar(require("http")); + var https2 = __importStar(require("https")); var pm = __importStar(require_proxy()); var tunnel = __importStar(require_tunnel2()); var HttpCodes; @@ -1240,9 +1240,9 @@ var require_lib = __commonJS({ return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } - sendStream(verb, requestUrl, stream, additionalHeaders) { + sendStream(verb, requestUrl, stream2, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); + return this.request(verb, requestUrl, stream2, additionalHeaders); }); } getJson(requestUrl, additionalHeaders = {}) { @@ -1412,7 +1412,7 @@ var require_lib = __commonJS({ const info8 = {}; info8.parsedUrl = requestUrl; const usingSsl = info8.parsedUrl.protocol === "https:"; - info8.httpModule = usingSsl ? https : http; + info8.httpModule = usingSsl ? https2 : http3; const defaultPort = usingSsl ? 443 : 80; info8.options = {}; info8.options.host = info8.parsedUrl.hostname; @@ -1433,14 +1433,14 @@ var require_lib = __commonJS({ } _mergeHeaders(headers) { if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + return Object.assign({}, lowercaseKeys2(this.requestOptions.headers), lowercaseKeys2(headers || {})); } - return lowercaseKeys(headers || {}); + return lowercaseKeys2(headers || {}); } _getExistingOrDefaultHeader(additionalHeaders, header, _default) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + clientHeader = lowercaseKeys2(this.requestOptions.headers)[header]; } return additionalHeaders[header] || clientHeader || _default; } @@ -1460,7 +1460,7 @@ var require_lib = __commonJS({ const usingSsl = parsedUrl.protocol === "https:"; let maxSockets = 100; if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + maxSockets = this.requestOptions.maxSockets || http3.globalAgent.maxSockets; } if (proxyUrl && proxyUrl.hostname) { const agentOptions = { @@ -1482,11 +1482,11 @@ var require_lib = __commonJS({ } if (this._keepAlive && !agent) { const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + agent = usingSsl ? new https2.Agent(options) : new http3.Agent(options); this._agent = agent; } if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; + agent = usingSsl ? https2.globalAgent : http3.globalAgent; } if (usingSsl && this._ignoreSslError) { agent.options = Object.assign(agent.options || {}, { @@ -1558,7 +1558,7 @@ var require_lib = __commonJS({ } }; exports.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + var lowercaseKeys2 = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); @@ -2036,7 +2036,7 @@ var require_core = __commonJS({ var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os3 = __importStar(require("os")); + var os4 = __importStar(require("os")); var path7 = __importStar(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; @@ -2058,7 +2058,7 @@ var require_core = __commonJS({ command_1.issueCommand("add-mask", {}, secret); } exports.setSecret = setSecret; - function addPath3(inputPath) { + function addPath4(inputPath) { const filePath = process.env["GITHUB_PATH"] || ""; if (filePath) { file_command_1.issueFileCommand("PATH", inputPath); @@ -2067,7 +2067,7 @@ var require_core = __commonJS({ } process.env["PATH"] = `${inputPath}${path7.delimiter}${process.env["PATH"]}`; } - exports.addPath = addPath3; + exports.addPath = addPath4; function getInput3(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; if (options && options.required && !val) { @@ -2099,15 +2099,15 @@ var require_core = __commonJS({ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } exports.getBooleanInput = getBooleanInput; - function setOutput3(name, value) { + function setOutput4(name, value) { const filePath = process.env["GITHUB_OUTPUT"] || ""; if (filePath) { return file_command_1.issueFileCommand("OUTPUT", file_command_1.prepareKeyValueMessage(name, value)); } - process.stdout.write(os3.EOL); + process.stdout.write(os4.EOL); command_1.issueCommand("set-output", { name }, utils_1.toCommandValue(value)); } - exports.setOutput = setOutput3; + exports.setOutput = setOutput4; function setCommandEcho(enabled) { command_1.issue("echo", enabled ? "on" : "off"); } @@ -2121,10 +2121,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); return process.env["RUNNER_DEBUG"] === "1"; } exports.isDebug = isDebug; - function debug4(message) { + function debug5(message) { command_1.issueCommand("debug", {}, message); } - exports.debug = debug4; + exports.debug = debug5; function error2(message, properties = {}) { command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); } @@ -2138,7 +2138,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } exports.notice = notice; function info8(message) { - process.stdout.write(message + os3.EOL); + process.stdout.write(message + os4.EOL); } exports.info = info8; function startGroup(name) { @@ -2720,7 +2720,7 @@ var require_toolrunner = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.argStringToArray = exports.ToolRunner = void 0; - var os3 = __importStar(require("os")); + var os4 = __importStar(require("os")); var events = __importStar(require("events")); var child = __importStar(require("child_process")); var path7 = __importStar(require("path")); @@ -2775,12 +2775,12 @@ var require_toolrunner = __commonJS({ _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); - let n = s.indexOf(os3.EOL); + let n = s.indexOf(os4.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); - s = s.substring(n + os3.EOL.length); - n = s.indexOf(os3.EOL); + s = s.substring(n + os4.EOL.length); + n = s.indexOf(os4.EOL); } return s; } catch (err) { @@ -2940,7 +2940,7 @@ var require_toolrunner = __commonJS({ } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os3.EOL); + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os4.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on("debug", (message) => { @@ -3215,7 +3215,7 @@ var require_exec = __commonJS({ }); } exports.exec = exec8; - function getExecOutput3(commandLine, args, options) { + function getExecOutput2(commandLine, args, options) { var _a, _b; return __awaiter(this, void 0, void 0, function* () { let stdout = ""; @@ -3247,7 +3247,7 @@ var require_exec = __commonJS({ }; }); } - exports.getExecOutput = getExecOutput3; + exports.getExecOutput = getExecOutput2; } }); @@ -3841,13 +3841,13 @@ var require_minimatch = __commonJS({ m.Minimatch = function Minimatch2(pattern, options) { return new orig.Minimatch(pattern, ext(def, options)); }; - m.Minimatch.defaults = function defaults(options) { + m.Minimatch.defaults = function defaults2(options) { return orig.defaults(ext(def, options)).Minimatch; }; m.filter = function filter2(pattern, options) { return orig.filter(pattern, ext(def, options)); }; - m.defaults = function defaults(options) { + m.defaults = function defaults2(options) { return orig.defaults(ext(def, options)); }; m.makeRe = function makeRe2(pattern, options) { @@ -3911,7 +3911,7 @@ var require_minimatch = __commonJS({ this.parseNegate(); var set = this.globSet = this.braceExpand(); if (options.debug) - this.debug = function debug4() { + this.debug = function debug5() { console.error.apply(console, arguments); }; this.debug(this.pattern, set); @@ -4499,7 +4499,7 @@ var require_internal_pattern = __commonJS({ }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Pattern = void 0; - var os3 = __importStar(require("os")); + var os4 = __importStar(require("os")); var path7 = __importStar(require("path")); var pathHelper = __importStar(require_internal_path_helper()); var assert_1 = __importDefault(require("assert")); @@ -4580,7 +4580,7 @@ var require_internal_pattern = __commonJS({ if (pattern === "." || pattern.startsWith(`.${path7.sep}`)) { pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1); } else if (pattern === "~" || pattern.startsWith(`~${path7.sep}`)) { - homedir = homedir || os3.homedir(); + homedir = homedir || os4.homedir(); assert_1.default(homedir, "Unable to determine HOME directory"); assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); pattern = Pattern.globEscape(homedir) + pattern.substr(1); @@ -4968,12 +4968,12 @@ var require_glob = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.create = void 0; var internal_globber_1 = require_internal_globber(); - function create(patterns, options) { + function create2(patterns, options) { return __awaiter(this, void 0, void 0, function* () { return yield internal_globber_1.DefaultGlobber.create(patterns, options); }); } - exports.create = create; + exports.create = create2; } }); @@ -4981,15 +4981,15 @@ var require_glob = __commonJS({ var require_semver = __commonJS({ "node_modules/.pnpm/semver@6.3.0/node_modules/semver/semver.js"(exports, module2) { exports = module2.exports = SemVer; - var debug4; + var debug5; if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug4 = function() { + debug5 = function() { var args = Array.prototype.slice.call(arguments, 0); args.unshift("SEMVER"); console.log.apply(console, args); }; } else { - debug4 = function() { + debug5 = function() { }; } exports.SEMVER_SPEC_VERSION = "2.0.0"; @@ -5086,7 +5086,7 @@ var require_semver = __commonJS({ tok("STAR"); src[t.STAR] = "(<|>)?=?\\s*\\*"; for (i = 0; i < R; i++) { - debug4(i, src[i]); + debug5(i, src[i]); if (!re[i]) { re[i] = new RegExp(src[i]); } @@ -5152,7 +5152,7 @@ var require_semver = __commonJS({ if (!(this instanceof SemVer)) { return new SemVer(version, options); } - debug4("SemVer", version, options); + debug5("SemVer", version, options); this.options = options; this.loose = !!options.loose; var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); @@ -5199,7 +5199,7 @@ var require_semver = __commonJS({ return this.version; }; SemVer.prototype.compare = function(other) { - debug4("SemVer.compare", this.version, this.options, other); + debug5("SemVer.compare", this.version, this.options, other); if (!(other instanceof SemVer)) { other = new SemVer(other, this.options); } @@ -5226,7 +5226,7 @@ var require_semver = __commonJS({ do { var a = this.prerelease[i2]; var b = other.prerelease[i2]; - debug4("prerelease compare", i2, a, b); + debug5("prerelease compare", i2, a, b); if (a === void 0 && b === void 0) { return 0; } else if (b === void 0) { @@ -5248,7 +5248,7 @@ var require_semver = __commonJS({ do { var a = this.build[i2]; var b = other.build[i2]; - debug4("prerelease compare", i2, a, b); + debug5("prerelease compare", i2, a, b); if (a === void 0 && b === void 0) { return 0; } else if (b === void 0) { @@ -5390,12 +5390,12 @@ var require_semver = __commonJS({ function rcompareIdentifiers(a, b) { return compareIdentifiers(b, a); } - exports.major = major3; - function major3(a, loose) { + exports.major = major4; + function major4(a, loose) { return new SemVer(a, loose).major; } - exports.minor = minor3; - function minor3(a, loose) { + exports.minor = minor4; + function minor4(a, loose) { return new SemVer(a, loose).minor; } exports.patch = patch; @@ -5507,7 +5507,7 @@ var require_semver = __commonJS({ if (!(this instanceof Comparator)) { return new Comparator(comp, options); } - debug4("comparator", comp, options); + debug5("comparator", comp, options); this.options = options; this.loose = !!options.loose; this.parse(comp); @@ -5516,7 +5516,7 @@ var require_semver = __commonJS({ } else { this.value = this.operator + this.semver.version; } - debug4("comp", this); + debug5("comp", this); } var ANY = {}; Comparator.prototype.parse = function(comp) { @@ -5539,7 +5539,7 @@ var require_semver = __commonJS({ return this.value; }; Comparator.prototype.test = function(version) { - debug4("Comparator.test", version, this.options.loose); + debug5("Comparator.test", version, this.options.loose); if (this.semver === ANY || version === ANY) { return true; } @@ -5633,9 +5633,9 @@ var require_semver = __commonJS({ range = range.trim(); var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; range = range.replace(hr, hyphenReplace); - debug4("hyphen replace", range); + debug5("hyphen replace", range); range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); - debug4("comparator trim", range, re[t.COMPARATORTRIM]); + debug5("comparator trim", range, re[t.COMPARATORTRIM]); range = range.replace(re[t.TILDETRIM], tildeTrimReplace); range = range.replace(re[t.CARETTRIM], caretTrimReplace); range = range.split(/\s+/).join(" "); @@ -5688,15 +5688,15 @@ var require_semver = __commonJS({ }); } function parseComparator(comp, options) { - debug4("comp", comp, options); + debug5("comp", comp, options); comp = replaceCarets(comp, options); - debug4("caret", comp); + debug5("caret", comp); comp = replaceTildes(comp, options); - debug4("tildes", comp); + debug5("tildes", comp); comp = replaceXRanges(comp, options); - debug4("xrange", comp); + debug5("xrange", comp); comp = replaceStars(comp, options); - debug4("stars", comp); + debug5("stars", comp); return comp; } function isX(id) { @@ -5710,7 +5710,7 @@ var require_semver = __commonJS({ function replaceTilde(comp, options) { var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; return comp.replace(r, function(_, M, m, p, pr) { - debug4("tilde", comp, _, M, m, p, pr); + debug5("tilde", comp, _, M, m, p, pr); var ret; if (isX(M)) { ret = ""; @@ -5719,12 +5719,12 @@ var require_semver = __commonJS({ } else if (isX(p)) { ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0"; } else if (pr) { - debug4("replaceTilde pr", pr); + debug5("replaceTilde pr", pr); ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; } else { ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; } - debug4("tilde return", ret); + debug5("tilde return", ret); return ret; }); } @@ -5734,10 +5734,10 @@ var require_semver = __commonJS({ }).join(" "); } function replaceCaret(comp, options) { - debug4("caret", comp, options); + debug5("caret", comp, options); var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; return comp.replace(r, function(_, M, m, p, pr) { - debug4("caret", comp, _, M, m, p, pr); + debug5("caret", comp, _, M, m, p, pr); var ret; if (isX(M)) { ret = ""; @@ -5750,7 +5750,7 @@ var require_semver = __commonJS({ ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0"; } } else if (pr) { - debug4("replaceCaret pr", pr); + debug5("replaceCaret pr", pr); if (M === "0") { if (m === "0") { ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1); @@ -5761,7 +5761,7 @@ var require_semver = __commonJS({ ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0"; } } else { - debug4("no pr"); + debug5("no pr"); if (M === "0") { if (m === "0") { ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1); @@ -5772,12 +5772,12 @@ var require_semver = __commonJS({ ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; } } - debug4("caret return", ret); + debug5("caret return", ret); return ret; }); } function replaceXRanges(comp, options) { - debug4("replaceXRanges", comp, options); + debug5("replaceXRanges", comp, options); return comp.split(/\s+/).map(function(comp2) { return replaceXRange(comp2, options); }).join(" "); @@ -5786,7 +5786,7 @@ var require_semver = __commonJS({ comp = comp.trim(); var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - debug4("xRange", comp, ret, gtlt, M, m, p, pr); + debug5("xRange", comp, ret, gtlt, M, m, p, pr); var xM = isX(M); var xm = xM || isX(m); var xp = xm || isX(p); @@ -5830,12 +5830,12 @@ var require_semver = __commonJS({ } else if (xp) { ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr; } - debug4("xRange return", ret); + debug5("xRange return", ret); return ret; }); } function replaceStars(comp, options) { - debug4("replaceStars", comp, options); + debug5("replaceStars", comp, options); return comp.trim().replace(re[t.STAR], ""); } function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { @@ -5887,7 +5887,7 @@ var require_semver = __commonJS({ } if (version.prerelease.length && !options.includePrerelease) { for (i2 = 0; i2 < set.length; i2++) { - debug4(set[i2].semver); + debug5(set[i2].semver); if (set[i2].semver === ANY) { continue; } @@ -6108,9 +6108,9 @@ var require_semver = __commonJS({ // node_modules/.pnpm/uuid@3.4.0/node_modules/uuid/lib/rng.js var require_rng2 = __commonJS({ "node_modules/.pnpm/uuid@3.4.0/node_modules/uuid/lib/rng.js"(exports, module2) { - var crypto = require("crypto"); + var crypto2 = require("crypto"); module2.exports = function nodeRNG() { - return crypto.randomBytes(16); + return crypto2.randomBytes(16); }; } }); @@ -6511,8 +6511,8 @@ var require_tslib = __commonJS({ var __makeTemplateObject; var __importStar; var __importDefault; - var __classPrivateFieldGet; - var __classPrivateFieldSet; + var __classPrivateFieldGet2; + var __classPrivateFieldSet2; var __classPrivateFieldIn; var __createBinding; (function(factory) { @@ -6877,14 +6877,14 @@ var require_tslib = __commonJS({ __importDefault = function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; - __classPrivateFieldGet = function(receiver, state, kind, f) { + __classPrivateFieldGet2 = function(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; - __classPrivateFieldSet = function(receiver, state, value, kind, f) { + __classPrivateFieldSet2 = function(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) @@ -6920,8 +6920,8 @@ var require_tslib = __commonJS({ exporter("__makeTemplateObject", __makeTemplateObject); exporter("__importStar", __importStar); exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); + exporter("__classPrivateFieldGet", __classPrivateFieldGet2); + exporter("__classPrivateFieldSet", __classPrivateFieldSet2); exporter("__classPrivateFieldIn", __classPrivateFieldIn); }); } @@ -7007,11 +7007,11 @@ var require_defaults = __commonJS({ var require_Utility = __commonJS({ "node_modules/.pnpm/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/Utility.js"(exports, module2) { (function() { - var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject, slice = [].slice, hasProp = {}.hasOwnProperty; + var assign, getValue, isArray, isEmpty, isFunction2, isObject, isPlainObject2, slice = [].slice, hasProp = {}.hasOwnProperty; assign = function() { var i, key, len, source, sources, target; target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : []; - if (isFunction(Object.assign)) { + if (isFunction2(Object.assign)) { Object.assign.apply(null, arguments); } else { for (i = 0, len = sources.length; i < len; i++) { @@ -7027,7 +7027,7 @@ var require_Utility = __commonJS({ } return target; }; - isFunction = function(val) { + isFunction2 = function(val) { return !!val && Object.prototype.toString.call(val) === "[object Function]"; }; isObject = function(val) { @@ -7035,7 +7035,7 @@ var require_Utility = __commonJS({ return !!val && ((ref = typeof val) === "function" || ref === "object"); }; isArray = function(val) { - if (isFunction(Array.isArray)) { + if (isFunction2(Array.isArray)) { return Array.isArray(val); } else { return Object.prototype.toString.call(val) === "[object Array]"; @@ -7054,23 +7054,23 @@ var require_Utility = __commonJS({ return true; } }; - isPlainObject = function(val) { + isPlainObject2 = function(val) { var ctor, proto; return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && typeof ctor === "function" && ctor instanceof ctor && Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object); }; getValue = function(obj) { - if (isFunction(obj.valueOf)) { + if (isFunction2(obj.valueOf)) { return obj.valueOf(); } else { return obj; } }; module2.exports.assign = assign; - module2.exports.isFunction = isFunction; + module2.exports.isFunction = isFunction2; module2.exports.isObject = isObject; module2.exports.isArray = isArray; module2.exports.isEmpty = isEmpty; - module2.exports.isPlainObject = isPlainObject; + module2.exports.isPlainObject = isPlainObject2; module2.exports.getValue = getValue; }).call(exports); } @@ -7384,7 +7384,7 @@ var require_XMLNamedNodeMap = __commonJS({ var require_XMLElement = __commonJS({ "node_modules/.pnpm/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLElement.js"(exports, module2) { (function() { - var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject, ref, extend = function(child, parent) { + var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction2, isObject, ref, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; @@ -7397,7 +7397,7 @@ var require_XMLElement = __commonJS({ child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; - ref = require_Utility(), isObject = ref.isObject, isFunction = ref.isFunction, getValue = ref.getValue; + ref = require_Utility(), isObject = ref.isObject, isFunction2 = ref.isFunction, getValue = ref.getValue; XMLNode = require_XMLNode(); NodeType = require_NodeType(); XMLAttribute = require_XMLAttribute(); @@ -7512,7 +7512,7 @@ var require_XMLElement = __commonJS({ this.attribute(attName, attValue); } } else { - if (isFunction(value)) { + if (isFunction2(value)) { value = value.apply(); } if (this.options.keepNullAttributes && value == null) { @@ -8541,8 +8541,8 @@ var require_DocumentPosition = __commonJS({ var require_XMLNode = __commonJS({ "node_modules/.pnpm/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLNode.js"(exports, module2) { (function() { - var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, ref1, hasProp = {}.hasOwnProperty; - ref1 = require_Utility(), isObject = ref1.isObject, isFunction = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue; + var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction2, isObject, ref1, hasProp = {}.hasOwnProperty; + ref1 = require_Utility(), isObject = ref1.isObject, isFunction2 = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue; XMLElement = null; XMLCData = null; XMLComment = null; @@ -8696,14 +8696,14 @@ var require_XMLNode = __commonJS({ item = name[j]; lastChild = this.element(item); } - } else if (isFunction(name)) { + } else if (isFunction2(name)) { lastChild = this.element(name.apply()); } else if (isObject(name)) { for (key in name) { if (!hasProp.call(name, key)) continue; val = name[key]; - if (isFunction(val)) { + if (isFunction2(val)) { val = val.apply(); } if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) { @@ -8886,7 +8886,7 @@ var require_XMLNode = __commonJS({ this.instruction(insTarget, insValue); } } else { - if (isFunction(value)) { + if (isFunction2(value)) { value = value.apply(); } instruction = new XMLProcessingInstruction(this, target, value); @@ -9906,7 +9906,7 @@ var require_XMLStringWriter = __commonJS({ var require_XMLDocument = __commonJS({ "node_modules/.pnpm/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLDocument.js"(exports, module2) { (function() { - var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject, extend = function(child, parent) { + var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject2, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; @@ -9919,7 +9919,7 @@ var require_XMLDocument = __commonJS({ child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; - isPlainObject = require_Utility().isPlainObject; + isPlainObject2 = require_Utility().isPlainObject; XMLDOMImplementation = require_XMLDOMImplementation(); XMLDOMConfiguration = require_XMLDOMConfiguration(); XMLNode = require_XMLNode(); @@ -10029,7 +10029,7 @@ var require_XMLDocument = __commonJS({ writerOptions = {}; if (!writer) { writer = this.options.writer; - } else if (isPlainObject(writer)) { + } else if (isPlainObject2(writer)) { writerOptions = writer; writer = this.options.writer; } @@ -10114,8 +10114,8 @@ var require_XMLDocument = __commonJS({ var require_XMLDocumentCB = __commonJS({ "node_modules/.pnpm/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLDocumentCB.js"(exports, module2) { (function() { - var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject, ref, hasProp = {}.hasOwnProperty; - ref = require_Utility(), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject, getValue = ref.getValue; + var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction2, isObject, isPlainObject2, ref, hasProp = {}.hasOwnProperty; + ref = require_Utility(), isObject = ref.isObject, isFunction2 = ref.isFunction, isPlainObject2 = ref.isPlainObject, getValue = ref.getValue; NodeType = require_NodeType(); XMLDocument = require_XMLDocument(); XMLElement = require_XMLElement(); @@ -10143,7 +10143,7 @@ var require_XMLDocumentCB = __commonJS({ writerOptions = {}; if (!options.writer) { options.writer = new XMLStringWriter(); - } else if (isPlainObject(options.writer)) { + } else if (isPlainObject2(options.writer)) { writerOptions = options.writer; options.writer = new XMLStringWriter(); } @@ -10241,7 +10241,7 @@ var require_XMLDocumentCB = __commonJS({ if (this.currentNode && this.currentNode.type === NodeType.DocType) { this.dtdElement.apply(this, arguments); } else { - if (Array.isArray(name) || isObject(name) || isFunction(name)) { + if (Array.isArray(name) || isObject(name) || isFunction2(name)) { oldValidationFlag = this.options.noValidation; this.options.noValidation = true; root = new XMLDocument(this.options).element("TEMP_ROOT"); @@ -10277,7 +10277,7 @@ var require_XMLDocumentCB = __commonJS({ this.attribute(attName, attValue); } } else { - if (isFunction(value)) { + if (isFunction2(value)) { value = value.apply(); } if (this.options.keepNullAttributes && value == null) { @@ -10338,7 +10338,7 @@ var require_XMLDocumentCB = __commonJS({ this.instruction(insTarget, insValue); } } else { - if (isFunction(value)) { + if (isFunction2(value)) { value = value.apply(); } node = new XMLProcessingInstruction(this, target, value); @@ -10602,8 +10602,8 @@ var require_XMLStreamWriter = __commonJS({ WriterState = require_WriterState(); module2.exports = XMLStreamWriter = function(superClass) { extend(XMLStreamWriter2, superClass); - function XMLStreamWriter2(stream, options) { - this.stream = stream; + function XMLStreamWriter2(stream2, options) { + this.stream = stream2; XMLStreamWriter2.__super__.constructor.call(this, options); } XMLStreamWriter2.prototype.endline = function(node, options, level) { @@ -10753,8 +10753,8 @@ var require_XMLStreamWriter = __commonJS({ var require_lib2 = __commonJS({ "node_modules/.pnpm/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/index.js"(exports, module2) { (function() { - var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref; - ref = require_Utility(), assign = ref.assign, isFunction = ref.isFunction; + var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction2, ref; + ref = require_Utility(), assign = ref.assign, isFunction2 = ref.isFunction; XMLDOMImplementation = require_XMLDOMImplementation(); XMLDocument = require_XMLDocument(); XMLDocumentCB = require_XMLDocumentCB(); @@ -10780,7 +10780,7 @@ var require_lib2 = __commonJS({ }; module2.exports.begin = function(options, onData, onEnd) { var ref1; - if (isFunction(options)) { + if (isFunction2(options)) { ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1]; options = {}; } @@ -10793,8 +10793,8 @@ var require_lib2 = __commonJS({ module2.exports.stringWriter = function(options) { return new XMLStringWriter(options); }; - module2.exports.streamWriter = function(stream, options) { - return new XMLStreamWriter(stream, options); + module2.exports.streamWriter = function(stream2, options) { + return new XMLStreamWriter(stream2, options); }; module2.exports.implementation = new XMLDOMImplementation(); module2.exports.nodeType = NodeType; @@ -10808,9 +10808,9 @@ var require_builder = __commonJS({ "node_modules/.pnpm/xml2js@0.4.23/node_modules/xml2js/lib/builder.js"(exports) { (function() { "use strict"; - var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA, hasProp = {}.hasOwnProperty; + var builder, defaults2, escapeCDATA, requiresCDATA, wrapCDATA, hasProp = {}.hasOwnProperty; builder = require_lib2(); - defaults = require_defaults().defaults; + defaults2 = require_defaults().defaults; requiresCDATA = function(entry) { return typeof entry === "string" && (entry.indexOf("&") >= 0 || entry.indexOf(">") >= 0 || entry.indexOf("<") >= 0); }; @@ -10824,7 +10824,7 @@ var require_builder = __commonJS({ function Builder(opts) { var key, ref, value; this.options = {}; - ref = defaults["0.2"]; + ref = defaults2["0.2"]; for (key in ref) { if (!hasProp.call(ref, key)) continue; @@ -10842,7 +10842,7 @@ var require_builder = __commonJS({ var attrkey, charkey, render, rootElement, rootName; attrkey = this.options.attrkey; charkey = this.options.charkey; - if (Object.keys(rootObj).length === 1 && this.options.rootName === defaults["0.2"].rootName) { + if (Object.keys(rootObj).length === 1 && this.options.rootName === defaults2["0.2"].rootName) { rootName = Object.keys(rootObj)[0]; rootObj = rootObj[rootName]; } else { @@ -12384,7 +12384,7 @@ var require_parser = __commonJS({ "node_modules/.pnpm/xml2js@0.4.23/node_modules/xml2js/lib/parser.js"(exports) { (function() { "use strict"; - var bom, defaults, events, isEmpty, processItem, processors, sax, setImmediate2, bind = function(fn, me) { + var bom, defaults2, events, isEmpty, processItem, processors, sax, setImmediate2, bind = function(fn, me) { return function() { return fn.apply(me, arguments); }; @@ -12406,15 +12406,15 @@ var require_parser = __commonJS({ bom = require_bom(); processors = require_processors(); setImmediate2 = require("timers").setImmediate; - defaults = require_defaults().defaults; + defaults2 = require_defaults().defaults; isEmpty = function(thing) { return typeof thing === "object" && thing != null && Object.keys(thing).length === 0; }; processItem = function(processors2, item, key) { - var i, len, process2; + var i, len, process4; for (i = 0, len = processors2.length; i < len; i++) { - process2 = processors2[i]; - item = process2(item, key); + process4 = processors2[i]; + item = process4(item, key); } return item; }; @@ -12431,7 +12431,7 @@ var require_parser = __commonJS({ return new exports.Parser(opts); } this.options = {}; - ref = defaults["0.2"]; + ref = defaults2["0.2"]; for (key in ref) { if (!hasProp.call(ref, key)) continue; @@ -12767,7 +12767,7 @@ var require_xml2js = __commonJS({ "node_modules/.pnpm/xml2js@0.4.23/node_modules/xml2js/lib/xml2js.js"(exports) { (function() { "use strict"; - var builder, defaults, parser, processors, extend = function(child, parent) { + var builder, defaults2, parser, processors, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; @@ -12780,11 +12780,11 @@ var require_xml2js = __commonJS({ child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; - defaults = require_defaults(); + defaults2 = require_defaults(); builder = require_builder(); parser = require_parser(); processors = require_processors(); - exports.defaults = defaults.defaults; + exports.defaults = defaults2.defaults; exports.processors = processors; exports.ValidationError = function(superClass) { extend(ValidationError, superClass); @@ -12859,7 +12859,7 @@ var require_dist2 = __commonJS({ } abortedMap.set(signal, true); } - var AbortError = class extends Error { + var AbortError2 = class extends Error { constructor(message) { super(message); this.name = "AbortError"; @@ -12892,15 +12892,15 @@ var require_dist2 = __commonJS({ } static timeout(ms) { const signal = new AbortSignal(); - const timer = setTimeout(abortSignal, ms, signal); - if (typeof timer.unref === "function") { - timer.unref(); + const timer2 = setTimeout(abortSignal, ms, signal); + if (typeof timer2.unref === "function") { + timer2.unref(); } return signal; } }; exports.AbortController = AbortController; - exports.AbortError = AbortError; + exports.AbortError = AbortError2; exports.AbortSignal = AbortSignal; } }); @@ -12911,7 +12911,7 @@ var require_dist3 = __commonJS({ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var abortController = require_dist2(); - var crypto = require("crypto"); + var crypto2 = require("crypto"); var _a; var isNode = typeof process !== "undefined" && Boolean(process.version) && Boolean((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node); function isDefined(thing) { @@ -12932,9 +12932,9 @@ var require_dist3 = __commonJS({ return isDefined(thing) && typeof thing === "object" && property in thing; } var StandardAbortMessage = "The operation was aborted."; - function delay(timeInMs, options) { + function delay2(timeInMs, options) { return new Promise((resolve, reject) => { - let timer = void 0; + let timer2 = void 0; let onAborted = void 0; const rejectOnAbort = () => { var _a2; @@ -12946,8 +12946,8 @@ var require_dist3 = __commonJS({ } }; onAborted = () => { - if (isDefined(timer)) { - clearTimeout(timer); + if (isDefined(timer2)) { + clearTimeout(timer2); } removeListeners(); return rejectOnAbort(); @@ -12955,7 +12955,7 @@ var require_dist3 = __commonJS({ if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { return rejectOnAbort(); } - timer = setTimeout(() => { + timer2 = setTimeout(() => { removeListeners(); resolve(); }, timeInMs); @@ -13000,14 +13000,14 @@ var require_dist3 = __commonJS({ } async function computeSha256Hmac(key, stringToSign, encoding) { const decodedKey = Buffer.from(key, "base64"); - return crypto.createHmac("sha256", decodedKey).update(stringToSign).digest(encoding); + return crypto2.createHmac("sha256", decodedKey).update(stringToSign).digest(encoding); } async function computeSha256Hash(content, encoding) { - return crypto.createHash("sha256").update(content).digest(encoding); + return crypto2.createHash("sha256").update(content).digest(encoding); } exports.computeSha256Hash = computeSha256Hash; exports.computeSha256Hmac = computeSha256Hmac; - exports.delay = delay; + exports.delay = delay2; exports.getErrorMessage = getErrorMessage; exports.getRandomIntegerInclusive = getRandomIntegerInclusive; exports.isDefined = isDefined; @@ -13028,9 +13028,9 @@ var require_dist4 = __commonJS({ return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex; } var util = _interopDefault(require("util")); - var os3 = require("os"); + var os4 = require("os"); function log(message, ...args) { - process.stderr.write(`${util.format(message, ...args)}${os3.EOL}`); + process.stderr.write(`${util.format(message, ...args)}${os4.EOL}`); } var debugEnvVariable = typeof process !== "undefined" && process.env && process.env.DEBUG || void 0; var enabledString; @@ -13087,14 +13087,14 @@ var require_dist4 = __commonJS({ return result; } function createDebugger(namespace) { - const newDebugger = Object.assign(debug4, { + const newDebugger = Object.assign(debug5, { enabled: enabled(namespace), destroy, log: debugObj.log, namespace, extend }); - function debug4(...args) { + function debug5(...args) { if (!newDebugger.enabled) { return; } @@ -13884,7 +13884,7 @@ var require_url_parse = __commonJS({ url.href = url.toString(); return url; } - function toString2(stringify) { + function toString3(stringify) { if (!stringify || "function" !== typeof stringify) stringify = qs.stringify; var query, url = this, host = url.host, protocol = url.protocol; @@ -13913,7 +13913,7 @@ var require_url_parse = __commonJS({ result += url.hash; return result; } - Url.prototype = { set, toString: toString2 }; + Url.prototype = { set, toString: toString3 }; Url.extractProtocol = extractProtocol; Url.location = lolcation; Url.trimLeft = trimLeft; @@ -23652,7 +23652,7 @@ var require_utilHelper = __commonJS({ exports.getUtilInspect = function getUtilInspect(fallback, options = {}) { const _requireUtil = options.requireUtil || requireUtil; const util = _requireUtil(); - return function inspect(value, showHidden, depth) { + return function inspect2(value, showHidden, depth) { return util ? util.inspect(value, showHidden, depth) : fallback(value); }; }; @@ -23859,7 +23859,7 @@ var require_memstore = __commonJS({ var require_validators = __commonJS({ "node_modules/.pnpm/tough-cookie@4.1.2/node_modules/tough-cookie/lib/validators.js"(exports) { "use strict"; - function isFunction(data) { + function isFunction2(data) { return typeof data === "function"; } function isNonEmptyString(data) { @@ -23888,7 +23888,7 @@ var require_validators = __commonJS({ return typeof data === "number" && data % 1 === 0; } function validate(bool, cb, options) { - if (!isFunction(cb)) { + if (!isFunction2(cb)) { options = cb; cb = null; } @@ -23908,7 +23908,7 @@ var require_validators = __commonJS({ } }; exports.ParameterError = ParameterError; - exports.isFunction = isFunction; + exports.isFunction = isFunction2; exports.isNonEmptyString = isNonEmptyString; exports.isDate = isDate; exports.isEmptyString = isEmptyString; @@ -24773,9 +24773,9 @@ var require_cookie = __commonJS({ return cb(new Error(SAME_SITE_CONTEXT_VAL_ERR)); } } - let http = options.http; - if (http == null) { - http = true; + let http3 = options.http; + if (http3 == null) { + http3 = true; } const now = options.now || Date.now(); const expireCheck = options.expire !== false; @@ -24797,7 +24797,7 @@ var require_cookie = __commonJS({ if (c.secure && !secure) { return false; } - if (c.httpOnly && !http) { + if (c.httpOnly && !http3) { return false; } if (sameSiteLevel) { @@ -25203,26 +25203,26 @@ var require_combined_stream = __commonJS({ } return combinedStream; }; - CombinedStream.isStreamLike = function(stream) { - return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream); + CombinedStream.isStreamLike = function(stream2) { + return typeof stream2 !== "function" && typeof stream2 !== "string" && typeof stream2 !== "boolean" && typeof stream2 !== "number" && !Buffer.isBuffer(stream2); }; - CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); + CombinedStream.prototype.append = function(stream2) { + var isStreamLike = CombinedStream.isStreamLike(stream2); if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { + if (!(stream2 instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream2, { maxDataSize: Infinity, pauseStream: this.pauseStreams }); - stream.on("data", this._checkDataSize.bind(this)); - stream = newStream; + stream2.on("data", this._checkDataSize.bind(this)); + stream2 = newStream; } - this._handleErrors(stream); + this._handleErrors(stream2); if (this.pauseStreams) { - stream.pause(); + stream2.pause(); } } - this._streams.push(stream); + this._streams.push(stream2); return this; }; CombinedStream.prototype.pipe = function(dest, options) { @@ -25247,40 +25247,40 @@ var require_combined_stream = __commonJS({ } }; CombinedStream.prototype._realGetNext = function() { - var stream = this._streams.shift(); - if (typeof stream == "undefined") { + var stream2 = this._streams.shift(); + if (typeof stream2 == "undefined") { this.end(); return; } - if (typeof stream !== "function") { - this._pipeNext(stream); + if (typeof stream2 !== "function") { + this._pipeNext(stream2); return; } - var getStream = stream; - getStream(function(stream2) { - var isStreamLike = CombinedStream.isStreamLike(stream2); + var getStream2 = stream2; + getStream2(function(stream3) { + var isStreamLike = CombinedStream.isStreamLike(stream3); if (isStreamLike) { - stream2.on("data", this._checkDataSize.bind(this)); - this._handleErrors(stream2); + stream3.on("data", this._checkDataSize.bind(this)); + this._handleErrors(stream3); } - this._pipeNext(stream2); + this._pipeNext(stream3); }.bind(this)); }; - CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; - var isStreamLike = CombinedStream.isStreamLike(stream); + CombinedStream.prototype._pipeNext = function(stream2) { + this._currentStream = stream2; + var isStreamLike = CombinedStream.isStreamLike(stream2); if (isStreamLike) { - stream.on("end", this._getNext.bind(this)); - stream.pipe(this, { end: false }); + stream2.on("end", this._getNext.bind(this)); + stream2.pipe(this, { end: false }); return; } - var value = stream; + var value = stream2; this.write(value); this._getNext(); }; - CombinedStream.prototype._handleErrors = function(stream) { + CombinedStream.prototype._handleErrors = function(stream2) { var self2 = this; - stream.on("error", function(err) { + stream2.on("error", function(err) { self2._emitError(err); }); }; @@ -25329,11 +25329,11 @@ var require_combined_stream = __commonJS({ CombinedStream.prototype._updateDataSize = function() { this.dataSize = 0; var self2 = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { + this._streams.forEach(function(stream2) { + if (!stream2.dataSize) { return; } - self2.dataSize += stream.dataSize; + self2.dataSize += stream2.dataSize; }); if (this._currentStream && this._currentStream.dataSize) { this.dataSize += this._currentStream.dataSize; @@ -33944,7 +33944,7 @@ var require_mime_types = __commonJS({ } return exports.types[extension2] || false; } - function populateMaps(extensions, types) { + function populateMaps(extensions, types2) { var preference = ["nginx", "apache", void 0, "iana"]; Object.keys(db).forEach(function forEachMimeType(type) { var mime = db[type]; @@ -33955,14 +33955,14 @@ var require_mime_types = __commonJS({ extensions[type] = exts; for (var i = 0; i < exts.length; i++) { var extension2 = exts[i]; - if (types[extension2]) { - var from = preference.indexOf(db[types[extension2]].source); + if (types2[extension2]) { + var from = preference.indexOf(db[types2[extension2]].source); var to = preference.indexOf(mime.source); - if (types[extension2] !== "application/octet-stream" && (from > to || from === to && types[extension2].substr(0, 12) === "application/")) { + if (types2[extension2] !== "application/octet-stream" && (from > to || from === to && types2[extension2].substr(0, 12) === "application/")) { continue; } } - types[extension2] = type; + types2[extension2] = type; } }); } @@ -34196,8 +34196,8 @@ var require_form_data = __commonJS({ var CombinedStream = require_combined_stream(); var util = require("util"); var path7 = require("path"); - var http = require("http"); - var https = require("https"); + var http3 = require("http"); + var https2 = require("https"); var parseUrl = require("url").parse; var fs4 = require("fs"); var Stream = require("stream").Stream; @@ -34446,7 +34446,7 @@ var require_form_data = __commonJS({ }); }; FormData.prototype.submit = function(params, cb) { - var request, options, defaults = { method: "post" }; + var request, options, defaults2 = { method: "post" }; if (typeof params == "string") { params = parseUrl(params); options = populate({ @@ -34454,18 +34454,18 @@ var require_form_data = __commonJS({ path: params.pathname, host: params.hostname, protocol: params.protocol - }, defaults); + }, defaults2); } else { - options = populate(params, defaults); + options = populate(params, defaults2); if (!options.port) { options.port = options.protocol == "https:" ? 443 : 80; } } options.headers = this.getHeaders(params.headers); if (options.protocol == "https:") { - request = https.request(options); + request = https2.request(options); } else { - request = http.request(options); + request = http3.request(options); } this.getLength(function(err, length) { if (err && err !== "Unknown stream") { @@ -36085,8 +36085,8 @@ var require_URL = __commonJS({ var utils = require_utils2(); var Impl = require_URL_impl(); var impl = utils.implSymbol; - function URL2(url) { - if (!this || this[impl] || !(this instanceof URL2)) { + function URL4(url) { + if (!this || this[impl] || !(this instanceof URL4)) { throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function."); } if (arguments.length < 1) { @@ -36102,7 +36102,7 @@ var require_URL = __commonJS({ } module2.exports.setup(this, args); } - URL2.prototype.toJSON = function toJSON() { + URL4.prototype.toJSON = function toJSON() { if (!this || !module2.exports.is(this)) { throw new TypeError("Illegal invocation"); } @@ -36112,7 +36112,7 @@ var require_URL = __commonJS({ } return this[impl].toJSON.apply(this[impl], args); }; - Object.defineProperty(URL2.prototype, "href", { + Object.defineProperty(URL4.prototype, "href", { get() { return this[impl].href; }, @@ -36123,20 +36123,20 @@ var require_URL = __commonJS({ enumerable: true, configurable: true }); - URL2.prototype.toString = function() { + URL4.prototype.toString = function() { if (!this || !module2.exports.is(this)) { throw new TypeError("Illegal invocation"); } return this.href; }; - Object.defineProperty(URL2.prototype, "origin", { + Object.defineProperty(URL4.prototype, "origin", { get() { return this[impl].origin; }, enumerable: true, configurable: true }); - Object.defineProperty(URL2.prototype, "protocol", { + Object.defineProperty(URL4.prototype, "protocol", { get() { return this[impl].protocol; }, @@ -36147,7 +36147,7 @@ var require_URL = __commonJS({ enumerable: true, configurable: true }); - Object.defineProperty(URL2.prototype, "username", { + Object.defineProperty(URL4.prototype, "username", { get() { return this[impl].username; }, @@ -36158,7 +36158,7 @@ var require_URL = __commonJS({ enumerable: true, configurable: true }); - Object.defineProperty(URL2.prototype, "password", { + Object.defineProperty(URL4.prototype, "password", { get() { return this[impl].password; }, @@ -36169,7 +36169,7 @@ var require_URL = __commonJS({ enumerable: true, configurable: true }); - Object.defineProperty(URL2.prototype, "host", { + Object.defineProperty(URL4.prototype, "host", { get() { return this[impl].host; }, @@ -36180,7 +36180,7 @@ var require_URL = __commonJS({ enumerable: true, configurable: true }); - Object.defineProperty(URL2.prototype, "hostname", { + Object.defineProperty(URL4.prototype, "hostname", { get() { return this[impl].hostname; }, @@ -36191,7 +36191,7 @@ var require_URL = __commonJS({ enumerable: true, configurable: true }); - Object.defineProperty(URL2.prototype, "port", { + Object.defineProperty(URL4.prototype, "port", { get() { return this[impl].port; }, @@ -36202,7 +36202,7 @@ var require_URL = __commonJS({ enumerable: true, configurable: true }); - Object.defineProperty(URL2.prototype, "pathname", { + Object.defineProperty(URL4.prototype, "pathname", { get() { return this[impl].pathname; }, @@ -36213,7 +36213,7 @@ var require_URL = __commonJS({ enumerable: true, configurable: true }); - Object.defineProperty(URL2.prototype, "search", { + Object.defineProperty(URL4.prototype, "search", { get() { return this[impl].search; }, @@ -36224,7 +36224,7 @@ var require_URL = __commonJS({ enumerable: true, configurable: true }); - Object.defineProperty(URL2.prototype, "hash", { + Object.defineProperty(URL4.prototype, "hash", { get() { return this[impl].hash; }, @@ -36240,7 +36240,7 @@ var require_URL = __commonJS({ return !!obj && obj[impl] instanceof Impl.implementation; }, create(constructorArgs, privateData) { - let obj = Object.create(URL2.prototype); + let obj = Object.create(URL4.prototype); this.setup(obj, constructorArgs, privateData); return obj; }, @@ -36251,10 +36251,10 @@ var require_URL = __commonJS({ obj[impl] = new Impl.implementation(constructorArgs, privateData); obj[impl][utils.wrapperSymbol] = obj; }, - interface: URL2, + interface: URL4, expose: { - Window: { URL: URL2 }, - Worker: { URL: URL2 } + Window: { URL: URL4 }, + Worker: { URL: URL4 } } }; } @@ -36285,10 +36285,10 @@ var require_lib4 = __commonJS({ return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex; } var Stream = _interopDefault(require("stream")); - var http = _interopDefault(require("http")); + var http3 = _interopDefault(require("http")); var Url = _interopDefault(require("url")); var whatwgUrl = _interopDefault(require_public_api()); - var https = _interopDefault(require("https")); + var https2 = _interopDefault(require("https")); var zlib = _interopDefault(require("zlib")); var Readable = Stream.Readable; var BUFFER = Symbol("buffer"); @@ -36720,10 +36720,10 @@ var require_lib4 = __commonJS({ var MAP = Symbol("map"); var Headers = class { constructor() { - let init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0; + let init2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0; this[MAP] = /* @__PURE__ */ Object.create(null); - if (init instanceof Headers) { - const rawHeaders = init.raw(); + if (init2 instanceof Headers) { + const rawHeaders = init2.raw(); const headerNames = Object.keys(rawHeaders); for (const headerName of headerNames) { for (const value of rawHeaders[headerName]) { @@ -36732,16 +36732,16 @@ var require_lib4 = __commonJS({ } return; } - if (init == null) + if (init2 == null) ; - else if (typeof init === "object") { - const method = init[Symbol.iterator]; + else if (typeof init2 === "object") { + const method = init2[Symbol.iterator]; if (method != null) { if (typeof method !== "function") { throw new TypeError("Header pairs must be iterable"); } const pairs = []; - for (const pair of init) { + for (const pair of init2) { if (typeof pair !== "object" || typeof pair[Symbol.iterator] !== "function") { throw new TypeError("Each header pair must be iterable"); } @@ -36754,8 +36754,8 @@ var require_lib4 = __commonJS({ this.append(pair[0], pair[1]); } } else { - for (const key of Object.keys(init)) { - const value = init[key]; + for (const key of Object.keys(init2)) { + const value = init2[key]; this.append(key, value); } } @@ -36929,8 +36929,8 @@ var require_lib4 = __commonJS({ return headers; } var INTERNALS$1 = Symbol("Response internals"); - var STATUS_CODES = http.STATUS_CODES; - var Response = class { + var STATUS_CODES = http3.STATUS_CODES; + var Response2 = class { constructor() { let body = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; @@ -36970,7 +36970,7 @@ var require_lib4 = __commonJS({ return this[INTERNALS$1].headers; } clone() { - return new Response(clone(this), { + return new Response2(clone(this), { url: this.url, status: this.status, statusText: this.statusText, @@ -36980,8 +36980,8 @@ var require_lib4 = __commonJS({ }); } }; - Body.mixIn(Response.prototype); - Object.defineProperties(Response.prototype, { + Body.mixIn(Response2.prototype); + Object.defineProperties(Response2.prototype, { url: { enumerable: true }, status: { enumerable: true }, ok: { enumerable: true }, @@ -36990,35 +36990,35 @@ var require_lib4 = __commonJS({ headers: { enumerable: true }, clone: { enumerable: true } }); - Object.defineProperty(Response.prototype, Symbol.toStringTag, { + Object.defineProperty(Response2.prototype, Symbol.toStringTag, { value: "Response", writable: false, enumerable: false, configurable: true }); var INTERNALS$2 = Symbol("Request internals"); - var URL2 = Url.URL || whatwgUrl.URL; + var URL4 = Url.URL || whatwgUrl.URL; var parse_url = Url.parse; var format_url = Url.format; function parseURL(urlStr) { if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { - urlStr = new URL2(urlStr).toString(); + urlStr = new URL4(urlStr).toString(); } return parse_url(urlStr); } var streamDestructionSupported = "destroy" in Stream.Readable.prototype; - function isRequest(input) { + function isRequest2(input) { return typeof input === "object" && typeof input[INTERNALS$2] === "object"; } function isAbortSignal(signal) { const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal); return !!(proto && proto.constructor.name === "AbortSignal"); } - var Request = class { + var Request2 = class { constructor(input) { - let init = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + let init2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; let parsedURL; - if (!isRequest(input)) { + if (!isRequest2(input)) { if (input && input.href) { parsedURL = parseURL(input.href); } else { @@ -37028,40 +37028,40 @@ var require_lib4 = __commonJS({ } else { parsedURL = parseURL(input.url); } - let method = init.method || input.method || "GET"; + let method = init2.method || input.method || "GET"; method = method.toUpperCase(); - if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) { + if ((init2.body != null || isRequest2(input) && input.body !== null) && (method === "GET" || method === "HEAD")) { throw new TypeError("Request with GET/HEAD method cannot have body"); } - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; + let inputBody = init2.body != null ? init2.body : isRequest2(input) && input.body !== null ? clone(input) : null; Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 + timeout: init2.timeout || input.timeout || 0, + size: init2.size || input.size || 0 }); - const headers = new Headers(init.headers || input.headers || {}); + const headers = new Headers(init2.headers || input.headers || {}); if (inputBody != null && !headers.has("Content-Type")) { const contentType = extractContentType(inputBody); if (contentType) { headers.append("Content-Type", contentType); } } - let signal = isRequest(input) ? input.signal : null; - if ("signal" in init) - signal = init.signal; + let signal = isRequest2(input) ? input.signal : null; + if ("signal" in init2) + signal = init2.signal; if (signal != null && !isAbortSignal(signal)) { throw new TypeError("Expected signal to be an instanceof AbortSignal"); } this[INTERNALS$2] = { method, - redirect: init.redirect || input.redirect || "follow", + redirect: init2.redirect || input.redirect || "follow", headers, parsedURL, signal }; - this.follow = init.follow !== void 0 ? init.follow : input.follow !== void 0 ? input.follow : 20; - this.compress = init.compress !== void 0 ? init.compress : input.compress !== void 0 ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; + this.follow = init2.follow !== void 0 ? init2.follow : input.follow !== void 0 ? input.follow : 20; + this.compress = init2.compress !== void 0 ? init2.compress : input.compress !== void 0 ? input.compress : true; + this.counter = init2.counter || input.counter || 0; + this.agent = init2.agent || input.agent; } get method() { return this[INTERNALS$2].method; @@ -37079,17 +37079,17 @@ var require_lib4 = __commonJS({ return this[INTERNALS$2].signal; } clone() { - return new Request(this); + return new Request2(this); } }; - Body.mixIn(Request.prototype); - Object.defineProperty(Request.prototype, Symbol.toStringTag, { + Body.mixIn(Request2.prototype); + Object.defineProperty(Request2.prototype, Symbol.toStringTag, { value: "Request", writable: false, enumerable: false, configurable: true }); - Object.defineProperties(Request.prototype, { + Object.defineProperties(Request2.prototype, { method: { enumerable: true }, url: { enumerable: true }, headers: { enumerable: true }, @@ -37144,15 +37144,15 @@ var require_lib4 = __commonJS({ agent }); } - function AbortError(message) { + function AbortError2(message) { Error.call(this, message); this.type = "aborted"; this.message = message; Error.captureStackTrace(this, this.constructor); } - AbortError.prototype = Object.create(Error.prototype); - AbortError.prototype.constructor = AbortError; - AbortError.prototype.name = "AbortError"; + AbortError2.prototype = Object.create(Error.prototype); + AbortError2.prototype.constructor = AbortError2; + AbortError2.prototype.name = "AbortError"; var URL$1 = Url.URL || whatwgUrl.URL; var PassThrough$1 = Stream.PassThrough; var isDomainOrSubdomain = function isDomainOrSubdomain2(destination, original) { @@ -37166,13 +37166,13 @@ var require_lib4 = __commonJS({ } Body.Promise = fetch.Promise; return new fetch.Promise(function(resolve, reject) { - const request = new Request(url, opts); + const request = new Request2(url, opts); const options = getNodeRequestOptions(request); - const send = (options.protocol === "https:" ? https : http).request; + const send = (options.protocol === "https:" ? https2 : http3).request; const signal = request.signal; let response = null; const abort = function abort2() { - let error2 = new AbortError("The user aborted a request."); + let error2 = new AbortError2("The user aborted a request."); reject(error2); if (request.body && request.body instanceof Stream.Readable) { request.body.destroy(error2); @@ -37277,7 +37277,7 @@ var require_lib4 = __commonJS({ requestOpts.body = void 0; requestOpts.headers.delete("content-length"); } - resolve(fetch(new Request(locationURL, requestOpts))); + resolve(fetch(new Request2(locationURL, requestOpts))); finalize(); return; } @@ -37298,7 +37298,7 @@ var require_lib4 = __commonJS({ }; const codings = headers.get("Content-Encoding"); if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); + response = new Response2(body, response_options); resolve(response); return; } @@ -37308,7 +37308,7 @@ var require_lib4 = __commonJS({ }; if (codings == "gzip" || codings == "x-gzip") { body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); + response = new Response2(body, response_options); resolve(response); return; } @@ -37320,18 +37320,18 @@ var require_lib4 = __commonJS({ } else { body = body.pipe(zlib.createInflateRaw()); } - response = new Response(body, response_options); + response = new Response2(body, response_options); resolve(response); }); return; } if (codings == "br" && typeof zlib.createBrotliDecompress === "function") { body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); + response = new Response2(body, response_options); resolve(response); return; } - response = new Response(body, response_options); + response = new Response2(body, response_options); resolve(response); }); writeToStream(req, request); @@ -37345,8 +37345,8 @@ var require_lib4 = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports; exports.Headers = Headers; - exports.Request = Request; - exports.Response = Response; + exports.Request = Request2; + exports.Response = Response2; exports.FetchError = FetchError; } }); @@ -37514,8 +37514,8 @@ var require_global_utils = __commonJS({ var platform_1 = require_platform(); var version_1 = require_version3(); var semver_1 = require_semver2(); - var major3 = version_1.VERSION.split(".")[0]; - var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("opentelemetry.js.api." + major3); + var major4 = version_1.VERSION.split(".")[0]; + var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("opentelemetry.js.api." + major4); var _global = platform_1._globalThis; function registerGlobal(type, instance, diag, allowOverride) { var _a; @@ -37749,8 +37749,8 @@ var require_baggage_impl = __commonJS({ Object.defineProperty(exports, "__esModule", { value: true }); exports.BaggageImpl = void 0; var BaggageImpl = function() { - function BaggageImpl2(entries) { - this._entries = entries ? new Map(entries) : /* @__PURE__ */ new Map(); + function BaggageImpl2(entries2) { + this._entries = entries2 ? new Map(entries2) : /* @__PURE__ */ new Map(); } BaggageImpl2.prototype.getEntry = function(key) { var entry = this._entries.get(key); @@ -37816,11 +37816,11 @@ var require_utils3 = __commonJS({ var baggage_impl_1 = require_baggage_impl(); var symbol_1 = require_symbol(); var diag = diag_1.DiagAPI.instance(); - function createBaggage(entries) { - if (entries === void 0) { - entries = {}; + function createBaggage(entries2) { + if (entries2 === void 0) { + entries2 = {}; } - return new baggage_impl_1.BaggageImpl(new Map(Object.entries(entries))); + return new baggage_impl_1.BaggageImpl(new Map(Object.entries(entries2))); } exports.createBaggage = createBaggage; function baggageEntryMetadataFromString(str) { @@ -39009,12 +39009,12 @@ var require_dist7 = __commonJS({ var coreUtil = require_dist3(); var logger$1 = require_dist4(); var coreAuth = require_dist5(); - var os3 = require("os"); - var http = require("http"); - var https = require("https"); + var os4 = require("os"); + var http3 = require("http"); + var https2 = require("https"); var tough = require_cookie(); var tunnel = require_tunnel2(); - var stream = require("stream"); + var stream2 = require("stream"); var FormData = require_form_data(); var node_fetch = require_lib4(); var coreTracing = require_dist6(); @@ -39042,9 +39042,9 @@ var require_dist7 = __commonJS({ return Object.freeze(n); } var xml2js__namespace = /* @__PURE__ */ _interopNamespace(xml2js); - var os__namespace = /* @__PURE__ */ _interopNamespace(os3); - var http__namespace = /* @__PURE__ */ _interopNamespace(http); - var https__namespace = /* @__PURE__ */ _interopNamespace(https); + var os__namespace = /* @__PURE__ */ _interopNamespace(os4); + var http__namespace = /* @__PURE__ */ _interopNamespace(http3); + var https__namespace = /* @__PURE__ */ _interopNamespace(https2); var tough__namespace = /* @__PURE__ */ _interopNamespace(tough); var tunnel__namespace = /* @__PURE__ */ _interopNamespace(tunnel); var FormData__default = /* @__PURE__ */ _interopDefaultLegacy(FormData); @@ -39980,7 +39980,7 @@ var require_dist7 = __commonJS({ return false; } var WebResource = class { - constructor(url, method, body, query, headers, streamResponseBody, withCredentials, abortSignal, timeout, onUploadProgress, onDownloadProgress, proxySettings, keepAlive, decompressResponse, streamResponseStatusCodes) { + constructor(url, method, body, query, headers, streamResponseBody, withCredentials, abortSignal, timeout, onUploadProgress, onDownloadProgress, proxySettings, keepAlive, decompressResponse2, streamResponseStatusCodes) { this.streamResponseBody = streamResponseBody; this.streamResponseStatusCodes = streamResponseStatusCodes; this.url = url || ""; @@ -39996,7 +39996,7 @@ var require_dist7 = __commonJS({ this.onDownloadProgress = onDownloadProgress; this.proxySettings = proxySettings; this.keepAlive = keepAlive; - this.decompressResponse = decompressResponse; + this.decompressResponse = decompressResponse2; this.requestId = this.headers.get("x-ms-client-request-id") || generateUuid(); } validateRequestProperties() { @@ -40785,7 +40785,7 @@ var require_dist7 = __commonJS({ function getCachedAgent(isHttps, agentCache) { return isHttps ? agentCache.httpsAgent : agentCache.httpAgent; } - var ReportTransform = class extends stream.Transform { + var ReportTransform = class extends stream2.Transform { constructor(progressCallback) { super(); this.progressCallback = progressCallback; @@ -40801,14 +40801,14 @@ var require_dist7 = __commonJS({ function isReadableStream(body) { return body && typeof body.pipe === "function"; } - function isStreamComplete(stream2, aborter) { + function isStreamComplete(stream3, aborter) { return new Promise((resolve) => { - stream2.once("close", () => { + stream3.once("close", () => { aborter === null || aborter === void 0 ? void 0 : aborter.abort(); resolve(); }); - stream2.once("end", resolve); - stream2.once("error", resolve); + stream3.once("end", resolve); + stream3.once("error", resolve); }); } function parseHeaders(headers) { @@ -40988,8 +40988,8 @@ var require_dist7 = __commonJS({ return isHttps ? https__namespace.globalAgent : http__namespace.globalAgent; } } - async fetch(input, init) { - return node_fetch__default["default"](input, init); + async fetch(input, init2) { + return node_fetch__default["default"](input, init2); } async prepareRequest(httpRequest) { const requestInit = {}; @@ -41407,9 +41407,9 @@ var require_dist7 = __commonJS({ return retryData; } var StandardAbortMessage$1 = "The operation was aborted."; - function delay(delayInMs, value, options) { + function delay2(delayInMs, value, options) { return new Promise((resolve, reject) => { - let timer = void 0; + let timer2 = void 0; let onAborted = void 0; const rejectOnAbort = () => { return reject(new abortController.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage$1)); @@ -41420,8 +41420,8 @@ var require_dist7 = __commonJS({ } }; onAborted = () => { - if (coreUtil.isDefined(timer)) { - clearTimeout(timer); + if (coreUtil.isDefined(timer2)) { + clearTimeout(timer2); } removeListeners(); return rejectOnAbort(); @@ -41429,7 +41429,7 @@ var require_dist7 = __commonJS({ if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { return rejectOnAbort(); } - timer = setTimeout(() => { + timer2 = setTimeout(() => { removeListeners(); resolve(value); }, delayInMs); @@ -41485,7 +41485,7 @@ var require_dist7 = __commonJS({ if (!isAborted && shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, response)) { logger.info(`Retrying request in ${retryData.retryInterval}`); try { - await delay(retryData.retryInterval); + await delay2(retryData.retryInterval); const res = await policy._nextPolicy.sendRequest(request.clone()); return retry$1(policy, request, res, retryData); } catch (err) { @@ -41657,7 +41657,7 @@ var require_dist7 = __commonJS({ } let token = await tryGetAccessToken(); while (token === null) { - await delay(retryIntervalInMs); + await delay2(retryIntervalInMs); token = await tryGetAccessToken(); } return token; @@ -41994,7 +41994,7 @@ var require_dist7 = __commonJS({ if (res.parsedBody && obj.registrationState && obj.registrationState === "Registered") { return true; } else { - await delay(policy._retryTimeout * 1e3); + await delay2(policy._retryTimeout * 1e3); return getRegistrationStatus(policy, url, originalRequest); } } @@ -42046,7 +42046,7 @@ var require_dist7 = __commonJS({ } if (shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, operationResponse, err)) { try { - await delay(retryData.retryInterval); + await delay2(retryData.retryInterval); return policy._nextPolicy.sendRequest(request.clone()); } catch (nestedErr) { return retry(policy, request, operationResponse, nestedErr, retryData); @@ -42089,7 +42089,7 @@ var require_dist7 = __commonJS({ const delayInMs = ThrottlingRetryPolicy.parseRetryAfterHeader(retryAfterHeader); if (delayInMs) { this.numberOfRetries += 1; - await delay(delayInMs, void 0, { + await delay2(delayInMs, void 0, { abortSignal: httpRequest.abortSignal, abortErrorMsg: StandardAbortMessage }); @@ -42848,7 +42848,7 @@ var require_dist7 = __commonJS({ exports.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; exports.createPipelineFromOptions = createPipelineFromOptions; exports.createSpanFunction = createSpanFunction; - exports.delay = delay; + exports.delay = delay2; exports.deserializationPolicy = deserializationPolicy; exports.deserializeResponseBody = deserializeResponseBody; exports.disableResponseDecompressionPolicy = disableResponseDecompressionPolicy; @@ -43007,8 +43007,8 @@ var require_dist9 = __commonJS({ return processResult ? processResult(response, state) : response; } async function initOperation(inputs) { - const { init, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); + const { init: init2, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init2(); if (operationLocation) withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); const config = { @@ -43352,7 +43352,7 @@ var require_dist9 = __commonJS({ }); function buildCreatePoller(inputs) { const { getOperationLocation: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, getResourceLocation: getResourceLocation2, getPollingInterval, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { + return async ({ init: init2, poll }, options) => { const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; const stateProxy = createStateProxy$1(); const withOperationLocation = withOperationLocationCallback ? (() => { @@ -43366,7 +43366,7 @@ var require_dist9 = __commonJS({ }; })() : void 0; const state = restoreFrom ? deserializeState(restoreFrom) : await initOperation({ - init, + init: init2, stateProxy, processResult, getOperationStatus: getStatusFromInitialResponse2, @@ -43402,9 +43402,9 @@ var require_dist9 = __commonJS({ if (!poller.isDone()) { await poller.poll({ abortSignal }); while (!poller.isDone()) { - const delay = delayMs(currentPollIntervalInMs); - cancelJob = delay.cancel; - await delay; + const delay2 = delayMs(currentPollIntervalInMs); + cancelJob = delay2.cancel; + await delay2; await poller.poll({ abortSignal }); } } @@ -43722,9 +43722,9 @@ var require_dist10 = __commonJS({ var coreTracing = require_dist6(); var logger$1 = require_dist4(); var abortController = require_dist2(); - var os3 = require("os"); - var crypto = require("crypto"); - var stream = require("stream"); + var os4 = require("os"); + var crypto2 = require("crypto"); + var stream2 = require("stream"); require_dist8(); var coreLro = require_dist9(); var events = require("events"); @@ -43751,7 +43751,7 @@ var require_dist10 = __commonJS({ return Object.freeze(n); } var coreHttp__namespace = /* @__PURE__ */ _interopNamespace(coreHttp); - var os__namespace = /* @__PURE__ */ _interopNamespace(os3); + var os__namespace = /* @__PURE__ */ _interopNamespace(os4); var fs__namespace = /* @__PURE__ */ _interopNamespace(fs4); var util__namespace = /* @__PURE__ */ _interopNamespace(util); var BlobServiceProperties = { @@ -56864,7 +56864,7 @@ var require_dist10 = __commonJS({ const res = blockIDPrefix + padStart(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); return base64encode(res); } - async function delay(timeInMs, aborter, abortError) { + async function delay2(timeInMs, aborter, abortError) { return new Promise((resolve, reject) => { let timeout; const abortHandler = () => { @@ -57536,7 +57536,7 @@ var require_dist10 = __commonJS({ delayTimeInMs = Math.random() * 1e3; } logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR); + return delay2(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR); } }; var StorageRetryPolicyFactory = class { @@ -57898,7 +57898,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this); } computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + return crypto2.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); } }; var packageName = "azure-storage-blob"; @@ -58243,7 +58243,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.key = Buffer.from(userDelegationKey.value, "base64"); } computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + return crypto2.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); } }; function ipRangeToString(ipRange) { @@ -58921,7 +58921,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var RetriableReadableStream = class extends stream.Readable { + var RetriableReadableStream = class extends stream2.Readable { constructor(source, getter, offset, count, options = {}) { super({ highWaterMark: options.highWaterMark }); this.retries = 0; @@ -59144,23 +59144,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; var AVRO_CODEC_KEY = "avro.codec"; var AVRO_SCHEMA_KEY = "avro.schema"; var AvroParser = class { - static async readFixedBytes(stream2, length, options = {}) { - const bytes = await stream2.read(length, { abortSignal: options.abortSignal }); + static async readFixedBytes(stream3, length, options = {}) { + const bytes = await stream3.read(length, { abortSignal: options.abortSignal }); if (bytes.length !== length) { throw new Error("Hit stream end."); } return bytes; } - static async readByte(stream2, options = {}) { - const buf = await AvroParser.readFixedBytes(stream2, 1, options); + static async readByte(stream3, options = {}) { + const buf = await AvroParser.readFixedBytes(stream3, 1, options); return buf[0]; } - static async readZigZagLong(stream2, options = {}) { + static async readZigZagLong(stream3, options = {}) { let zigZagEncoded = 0; let significanceInBit = 0; let byte, haveMoreByte, significanceInFloat; do { - byte = await AvroParser.readByte(stream2, options); + byte = await AvroParser.readByte(stream3, options); haveMoreByte = byte & 128; zigZagEncoded |= (byte & 127) << significanceInBit; significanceInBit += 7; @@ -59169,7 +59169,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; zigZagEncoded = zigZagEncoded; significanceInFloat = 268435456; do { - byte = await AvroParser.readByte(stream2, options); + byte = await AvroParser.readByte(stream3, options); zigZagEncoded += (byte & 127) * significanceInFloat; significanceInFloat *= 128; } while (byte & 128); @@ -59181,17 +59181,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return zigZagEncoded >> 1 ^ -(zigZagEncoded & 1); } - static async readLong(stream2, options = {}) { - return AvroParser.readZigZagLong(stream2, options); + static async readLong(stream3, options = {}) { + return AvroParser.readZigZagLong(stream3, options); } - static async readInt(stream2, options = {}) { - return AvroParser.readZigZagLong(stream2, options); + static async readInt(stream3, options = {}) { + return AvroParser.readZigZagLong(stream3, options); } static async readNull() { return null; } - static async readBoolean(stream2, options = {}) { - const b = await AvroParser.readByte(stream2, options); + static async readBoolean(stream3, options = {}) { + const b = await AvroParser.readByte(stream3, options); if (b === 1) { return true; } else if (b === 0) { @@ -59200,53 +59200,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Byte was not a boolean."); } } - static async readFloat(stream2, options = {}) { - const u8arr = await AvroParser.readFixedBytes(stream2, 4, options); + static async readFloat(stream3, options = {}) { + const u8arr = await AvroParser.readFixedBytes(stream3, 4, options); const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); return view.getFloat32(0, true); } - static async readDouble(stream2, options = {}) { - const u8arr = await AvroParser.readFixedBytes(stream2, 8, options); + static async readDouble(stream3, options = {}) { + const u8arr = await AvroParser.readFixedBytes(stream3, 8, options); const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); return view.getFloat64(0, true); } - static async readBytes(stream2, options = {}) { - const size = await AvroParser.readLong(stream2, options); + static async readBytes(stream3, options = {}) { + const size = await AvroParser.readLong(stream3, options); if (size < 0) { throw new Error("Bytes size was negative."); } - return stream2.read(size, { abortSignal: options.abortSignal }); + return stream3.read(size, { abortSignal: options.abortSignal }); } - static async readString(stream2, options = {}) { - const u8arr = await AvroParser.readBytes(stream2, options); + static async readString(stream3, options = {}) { + const u8arr = await AvroParser.readBytes(stream3, options); const utf8decoder = new TextDecoder(); return utf8decoder.decode(u8arr); } - static async readMapPair(stream2, readItemMethod, options = {}) { - const key = await AvroParser.readString(stream2, options); - const value = await readItemMethod(stream2, options); + static async readMapPair(stream3, readItemMethod, options = {}) { + const key = await AvroParser.readString(stream3, options); + const value = await readItemMethod(stream3, options); return { key, value }; } - static async readMap(stream2, readItemMethod, options = {}) { + static async readMap(stream3, readItemMethod, options = {}) { const readPairMethod = (s, opts = {}) => { return AvroParser.readMapPair(s, readItemMethod, opts); }; - const pairs = await AvroParser.readArray(stream2, readPairMethod, options); + const pairs = await AvroParser.readArray(stream3, readPairMethod, options); const dict = {}; for (const pair of pairs) { dict[pair.key] = pair.value; } return dict; } - static async readArray(stream2, readItemMethod, options = {}) { + static async readArray(stream3, readItemMethod, options = {}) { const items = []; - for (let count = await AvroParser.readLong(stream2, options); count !== 0; count = await AvroParser.readLong(stream2, options)) { + for (let count = await AvroParser.readLong(stream3, options); count !== 0; count = await AvroParser.readLong(stream3, options)) { if (count < 0) { - await AvroParser.readLong(stream2, options); + await AvroParser.readLong(stream3, options); count = -count; } while (count--) { - const item = await readItemMethod(stream2, options); + const item = await readItemMethod(stream3, options); items.push(item); } } @@ -59348,24 +59348,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; super(); this._primitive = primitive; } - read(stream2, options = {}) { + read(stream3, options = {}) { switch (this._primitive) { case AvroPrimitive.NULL: return AvroParser.readNull(); case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream2, options); + return AvroParser.readBoolean(stream3, options); case AvroPrimitive.INT: - return AvroParser.readInt(stream2, options); + return AvroParser.readInt(stream3, options); case AvroPrimitive.LONG: - return AvroParser.readLong(stream2, options); + return AvroParser.readLong(stream3, options); case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream2, options); + return AvroParser.readFloat(stream3, options); case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream2, options); + return AvroParser.readDouble(stream3, options); case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream2, options); + return AvroParser.readBytes(stream3, options); case AvroPrimitive.STRING: - return AvroParser.readString(stream2, options); + return AvroParser.readString(stream3, options); default: throw new Error("Unknown Avro Primitive"); } @@ -59376,19 +59376,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; super(); this._symbols = symbols; } - async read(stream2, options = {}) { - const value = await AvroParser.readInt(stream2, options); + async read(stream3, options = {}) { + const value = await AvroParser.readInt(stream3, options); return this._symbols[value]; } }; var AvroUnionType = class extends AvroType { - constructor(types) { + constructor(types2) { super(); - this._types = types; + this._types = types2; } - async read(stream2, options = {}) { - const typeIndex = await AvroParser.readInt(stream2, options); - return this._types[typeIndex].read(stream2, options); + async read(stream3, options = {}) { + const typeIndex = await AvroParser.readInt(stream3, options); + return this._types[typeIndex].read(stream3, options); } }; var AvroMapType = class extends AvroType { @@ -59396,11 +59396,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; super(); this._itemType = itemType; } - read(stream2, options = {}) { + read(stream3, options = {}) { const readItemMethod = (s, opts) => { return this._itemType.read(s, opts); }; - return AvroParser.readMap(stream2, readItemMethod, options); + return AvroParser.readMap(stream3, readItemMethod, options); } }; var AvroRecordType = class extends AvroType { @@ -59409,12 +59409,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this._fields = fields; this._name = name; } - async read(stream2, options = {}) { + async read(stream3, options = {}) { const record = {}; record["$schema"] = this._name; for (const key in this._fields) { if (Object.prototype.hasOwnProperty.call(this._fields, key)) { - record[key] = await this._fields[key].read(stream2, options); + record[key] = await this._fields[key].read(stream3, options); } } return record; @@ -59595,7 +59595,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobQuickQueryStream = class extends stream.Readable { + var BlobQuickQueryStream = class extends stream2.Readable { constructor(source, options = {}) { super(); this.avroPaused = true; @@ -59934,7 +59934,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return makeBlobBeginCopyFromURLPollOperation(state); }; - var toString2 = function toString3() { + var toString3 = function toString4() { return JSON.stringify({ state: this.state }, (key, value) => { if (key === "blobClient") { return void 0; @@ -59946,7 +59946,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return { state: Object.assign({}, state), cancel, - toString: toString2, + toString: toString3, update }; } @@ -60027,7 +60027,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BuffersStream = class extends stream.Readable { + var BuffersStream = class extends stream2.Readable { constructor(buffers, byteLength, options) { super(options); this.buffers = buffers; @@ -60264,16 +60264,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - async function streamToBuffer(stream2, buffer, offset, end, encoding) { + async function streamToBuffer(stream3, buffer, offset, end, encoding) { let pos = 0; const count = end - offset; return new Promise((resolve, reject) => { - stream2.on("readable", () => { + stream3.on("readable", () => { if (pos >= count) { resolve(); return; } - let chunk = stream2.read(); + let chunk = stream3.read(); if (!chunk) { return; } @@ -60284,21 +60284,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream2.on("end", () => { + stream3.on("end", () => { if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } resolve(); }); - stream2.on("error", reject); + stream3.on("error", reject); }); } - async function streamToBuffer2(stream2, buffer, encoding) { + async function streamToBuffer2(stream3, buffer, encoding) { let pos = 0; const bufferSize = buffer.length; return new Promise((resolve, reject) => { - stream2.on("readable", () => { - let chunk = stream2.read(); + stream3.on("readable", () => { + let chunk = stream3.read(); if (!chunk) { return; } @@ -60312,10 +60312,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream2.on("end", () => { + stream3.on("end", () => { resolve(pos); }); - stream2.on("error", reject); + stream3.on("error", reject); }); } async function readStreamToLocalFile(rs, file) { @@ -60774,8 +60774,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; customerProvidedKey: options.customerProvidedKey, tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) }); - const stream2 = response.readableStreamBody; - await streamToBuffer(stream2, buffer, off - offset, chunkEnd - offset); + const stream3 = response.readableStreamBody; + await streamToBuffer(stream3, buffer, off - offset, chunkEnd - offset); transferProgress += chunkEnd - off; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress }); @@ -61391,7 +61391,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; span.end(); } } - async uploadStream(stream2, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + async uploadStream(stream3, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { if (!options.blobHTTPHeaders) { options.blobHTTPHeaders = {}; } @@ -61405,7 +61405,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; let transferProgress = 0; const blockList = []; const scheduler = new BufferScheduler( - stream2, + stream3, bufferSize, maxConcurrency, async (body2, length) => { @@ -63694,7 +63694,7 @@ var require_requestUtils = __commonJS({ return new Promise((resolve) => setTimeout(resolve, milliseconds)); }); } - function retry(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = void 0) { + function retry(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay, onError = void 0) { return __awaiter(this, void 0, void 0, function* () { let errorMessage = ""; let attempt = 1; @@ -63726,21 +63726,21 @@ var require_requestUtils = __commonJS({ core8.debug(`${name} - Error is not retryable`); break; } - yield sleep(delay); + yield sleep(delay2); attempt++; } throw Error(`${name} failed: ${errorMessage}`); }); } exports.retry = retry; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { + function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { return __awaiter(this, void 0, void 0, function* () { return yield retry( name, method, (response) => response.statusCode, maxAttempts, - delay, + delay2, (error2) => { if (error2 instanceof http_client_1.HttpClientError) { return { @@ -63757,9 +63757,9 @@ var require_requestUtils = __commonJS({ }); } exports.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { + function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { return __awaiter(this, void 0, void 0, function* () { - return yield retry(name, method, (response) => response.message.statusCode, maxAttempts, delay); + return yield retry(name, method, (response) => response.message.statusCode, maxAttempts, delay2); }); } exports.retryHttpClientResponse = retryHttpClientResponse; @@ -63815,7 +63815,7 @@ var require_downloadUtils = __commonJS({ var storage_blob_1 = require_dist10(); var buffer = __importStar(require("buffer")); var fs4 = __importStar(require("fs")); - var stream = __importStar(require("stream")); + var stream2 = __importStar(require("stream")); var util = __importStar(require("util")); var utils = __importStar(require_cacheUtils()); var constants_1 = require_constants(); @@ -63823,7 +63823,7 @@ var require_downloadUtils = __commonJS({ var abort_controller_1 = require_dist2(); function pipeResponseToStream(response, output) { return __awaiter(this, void 0, void 0, function* () { - const pipeline = util.promisify(stream.pipeline); + const pipeline = util.promisify(stream2.pipeline); yield pipeline(response.message, output); }); } @@ -64091,7 +64091,7 @@ var require_cacheHttpClient = __commonJS({ var core8 = __importStar(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); - var crypto = __importStar(require("crypto")); + var crypto2 = __importStar(require("crypto")); var fs4 = __importStar(require("fs")); var url_1 = require("url"); var utils = __importStar(require_cacheUtils()); @@ -64128,7 +64128,7 @@ var require_cacheHttpClient = __commonJS({ function getCacheVersion(paths, compressionMethod) { const components = paths.concat(!compressionMethod || compressionMethod === constants_1.CompressionMethod.Gzip ? [] : [compressionMethod]); components.push(versionSalt); - return crypto.createHash("sha256").update(components.join("|")).digest("hex"); + return crypto2.createHash("sha256").update(components.join("|")).digest("hex"); } exports.getCacheVersion = getCacheVersion; function getCacheEntry(keys, paths, options) { @@ -64653,9 +64653,9 @@ var require_constants2 = __commonJS({ // node_modules/.pnpm/semver@7.3.8/node_modules/semver/internal/debug.js var require_debug = __commonJS({ "node_modules/.pnpm/semver@7.3.8/node_modules/semver/internal/debug.js"(exports, module2) { - var debug4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + var debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { }; - module2.exports = debug4; + module2.exports = debug5; } }); @@ -64663,7 +64663,7 @@ var require_debug = __commonJS({ var require_re = __commonJS({ "node_modules/.pnpm/semver@7.3.8/node_modules/semver/internal/re.js"(exports, module2) { var { MAX_SAFE_COMPONENT_LENGTH } = require_constants2(); - var debug4 = require_debug(); + var debug5 = require_debug(); exports = module2.exports = {}; var re = exports.re = []; var src = exports.src = []; @@ -64671,7 +64671,7 @@ var require_re = __commonJS({ var R = 0; var createToken = (name, value, isGlobal) => { const index = R++; - debug4(name, index, value); + debug5(name, index, value); t[name] = index; src[index] = value; re[index] = new RegExp(value, isGlobal ? "g" : void 0); @@ -64758,7 +64758,7 @@ var require_identifiers = __commonJS({ // node_modules/.pnpm/semver@7.3.8/node_modules/semver/classes/semver.js var require_semver3 = __commonJS({ "node_modules/.pnpm/semver@7.3.8/node_modules/semver/classes/semver.js"(exports, module2) { - var debug4 = require_debug(); + var debug5 = require_debug(); var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants2(); var { re, t } = require_re(); var parseOptions = require_parse_options(); @@ -64780,7 +64780,7 @@ var require_semver3 = __commonJS({ `version is longer than ${MAX_LENGTH} characters` ); } - debug4("SemVer", version, options); + debug5("SemVer", version, options); this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; @@ -64828,7 +64828,7 @@ var require_semver3 = __commonJS({ return this.version; } compare(other) { - debug4("SemVer.compare", this.version, this.options, other); + debug5("SemVer.compare", this.version, this.options, other); if (!(other instanceof SemVer)) { if (typeof other === "string" && other === this.version) { return 0; @@ -64861,7 +64861,7 @@ var require_semver3 = __commonJS({ do { const a = this.prerelease[i]; const b = other.prerelease[i]; - debug4("prerelease compare", i, a, b); + debug5("prerelease compare", i, a, b); if (a === void 0 && b === void 0) { return 0; } else if (b === void 0) { @@ -64883,7 +64883,7 @@ var require_semver3 = __commonJS({ do { const a = this.build[i]; const b = other.build[i]; - debug4("prerelease compare", i, a, b); + debug5("prerelease compare", i, a, b); if (a === void 0 && b === void 0) { return 0; } else if (b === void 0) { @@ -65109,8 +65109,8 @@ var require_diff = __commonJS({ var require_major = __commonJS({ "node_modules/.pnpm/semver@7.3.8/node_modules/semver/functions/major.js"(exports, module2) { var SemVer = require_semver3(); - var major3 = (a, loose) => new SemVer(a, loose).major; - module2.exports = major3; + var major4 = (a, loose) => new SemVer(a, loose).major; + module2.exports = major4; } }); @@ -65118,8 +65118,8 @@ var require_major = __commonJS({ var require_minor = __commonJS({ "node_modules/.pnpm/semver@7.3.8/node_modules/semver/functions/minor.js"(exports, module2) { var SemVer = require_semver3(); - var minor3 = (a, loose) => new SemVer(a, loose).minor; - module2.exports = minor3; + var minor4 = (a, loose) => new SemVer(a, loose).minor; + module2.exports = minor4; } }); @@ -66040,20 +66040,20 @@ var require_range = __commonJS({ const loose = this.options.loose; const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); - debug4("hyphen replace", range); + debug5("hyphen replace", range); range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); - debug4("comparator trim", range); + debug5("comparator trim", range); range = range.replace(re[t.TILDETRIM], tildeTrimReplace); range = range.replace(re[t.CARETTRIM], caretTrimReplace); range = range.split(/\s+/).join(" "); 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) => { - debug4("loose invalid filter", comp, this.options); + debug5("loose invalid filter", comp, this.options); return !!comp.match(re[t.COMPARATORLOOSE]); }); } - debug4("range list", rangeList); + debug5("range list", rangeList); const rangeMap = /* @__PURE__ */ new Map(); const comparators = rangeList.map((comp) => new Comparator(comp, this.options)); for (const comp of comparators) { @@ -66107,7 +66107,7 @@ var require_range = __commonJS({ var cache2 = new LRU({ max: 1e3 }); var parseOptions = require_parse_options(); var Comparator = require_comparator(); - var debug4 = require_debug(); + var debug5 = require_debug(); var SemVer = require_semver3(); var { re, @@ -66131,15 +66131,15 @@ var require_range = __commonJS({ return result; }; var parseComparator = (comp, options) => { - debug4("comp", comp, options); + debug5("comp", comp, options); comp = replaceCarets(comp, options); - debug4("caret", comp); + debug5("caret", comp); comp = replaceTildes(comp, options); - debug4("tildes", comp); + debug5("tildes", comp); comp = replaceXRanges(comp, options); - debug4("xrange", comp); + debug5("xrange", comp); comp = replaceStars(comp, options); - debug4("stars", comp); + debug5("stars", comp); return comp; }; var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; @@ -66149,7 +66149,7 @@ var require_range = __commonJS({ var replaceTilde = (comp, options) => { const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; return comp.replace(r, (_, M, m, p, pr) => { - debug4("tilde", comp, _, M, m, p, pr); + debug5("tilde", comp, _, M, m, p, pr); let ret; if (isX(M)) { ret = ""; @@ -66158,12 +66158,12 @@ var require_range = __commonJS({ } else if (isX(p)) { ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; } else if (pr) { - debug4("replaceTilde pr", pr); + debug5("replaceTilde pr", pr); ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; } else { ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; } - debug4("tilde return", ret); + debug5("tilde return", ret); return ret; }); }; @@ -66171,11 +66171,11 @@ var require_range = __commonJS({ return replaceCaret(c, options); }).join(" "); var replaceCaret = (comp, options) => { - debug4("caret", comp, options); + debug5("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) => { - debug4("caret", comp, _, M, m, p, pr); + debug5("caret", comp, _, M, m, p, pr); let ret; if (isX(M)) { ret = ""; @@ -66188,7 +66188,7 @@ var require_range = __commonJS({ ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; } } else if (pr) { - debug4("replaceCaret pr", pr); + debug5("replaceCaret pr", pr); if (M === "0") { if (m === "0") { ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; @@ -66199,7 +66199,7 @@ var require_range = __commonJS({ ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; } } else { - debug4("no pr"); + debug5("no pr"); if (M === "0") { if (m === "0") { ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; @@ -66210,12 +66210,12 @@ var require_range = __commonJS({ ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; } } - debug4("caret return", ret); + debug5("caret return", ret); return ret; }); }; var replaceXRanges = (comp, options) => { - debug4("replaceXRanges", comp, options); + debug5("replaceXRanges", comp, options); return comp.split(/\s+/).map((c) => { return replaceXRange(c, options); }).join(" "); @@ -66224,7 +66224,7 @@ var require_range = __commonJS({ comp = comp.trim(); const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug4("xRange", comp, ret, gtlt, M, m, p, pr); + debug5("xRange", comp, ret, gtlt, M, m, p, pr); const xM = isX(M); const xm = xM || isX(m); const xp = xm || isX(p); @@ -66271,16 +66271,16 @@ var require_range = __commonJS({ } else if (xp) { ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; } - debug4("xRange return", ret); + debug5("xRange return", ret); return ret; }); }; var replaceStars = (comp, options) => { - debug4("replaceStars", comp, options); + debug5("replaceStars", comp, options); return comp.trim().replace(re[t.STAR], ""); }; var replaceGTE0 = (comp, options) => { - debug4("replaceGTE0", comp, options); + debug5("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, tb) => { @@ -66318,7 +66318,7 @@ var require_range = __commonJS({ } if (version.prerelease.length && !options.includePrerelease) { for (let i = 0; i < set.length; i++) { - debug4(set[i].semver); + debug5(set[i].semver); if (set[i].semver === Comparator.ANY) { continue; } @@ -66353,7 +66353,7 @@ var require_comparator = __commonJS({ comp = comp.value; } } - debug4("comparator", comp, options); + debug5("comparator", comp, options); this.options = options; this.loose = !!options.loose; this.parse(comp); @@ -66362,7 +66362,7 @@ var require_comparator = __commonJS({ } else { this.value = this.operator + this.semver.version; } - debug4("comp", this); + debug5("comp", this); } parse(comp) { const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; @@ -66384,7 +66384,7 @@ var require_comparator = __commonJS({ return this.value; } test(version) { - debug4("Comparator.test", version, this.options.loose); + debug5("Comparator.test", version, this.options.loose); if (this.semver === ANY || version === ANY) { return true; } @@ -66431,7 +66431,7 @@ var require_comparator = __commonJS({ var parseOptions = require_parse_options(); var { re, t } = require_re(); var cmp = require_cmp(); - var debug4 = require_debug(); + var debug5 = require_debug(); var SemVer = require_semver3(); var Range = require_range(); } @@ -66909,8 +66909,8 @@ var require_semver4 = __commonJS({ var clean = require_clean(); var inc = require_inc(); var diff = require_diff(); - var major3 = require_major(); - var minor3 = require_minor(); + var major4 = require_major(); + var minor4 = require_minor(); var patch = require_patch(); var prerelease = require_prerelease(); var compare2 = require_compare(); @@ -66947,8 +66947,8 @@ var require_semver4 = __commonJS({ clean, inc, diff, - major: major3, - minor: minor3, + major: major4, + minor: minor4, patch, prerelease, compare: compare2, @@ -66990,6 +66990,2854 @@ var require_semver4 = __commonJS({ } }); +// node_modules/.pnpm/defer-to-connect@2.0.1/node_modules/defer-to-connect/dist/source/index.js +var require_source = __commonJS({ + "node_modules/.pnpm/defer-to-connect@2.0.1/node_modules/defer-to-connect/dist/source/index.js"(exports, module2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + function isTLSSocket(socket) { + return socket.encrypted; + } + var deferToConnect2 = (socket, fn) => { + let listeners; + if (typeof fn === "function") { + const connect = fn; + listeners = { connect }; + } else { + listeners = fn; + } + const hasConnectListener = typeof listeners.connect === "function"; + const hasSecureConnectListener = typeof listeners.secureConnect === "function"; + const hasCloseListener = typeof listeners.close === "function"; + const onConnect = () => { + if (hasConnectListener) { + listeners.connect(); + } + if (isTLSSocket(socket) && hasSecureConnectListener) { + if (socket.authorized) { + listeners.secureConnect(); + } else if (!socket.authorizationError) { + socket.once("secureConnect", listeners.secureConnect); + } + } + if (hasCloseListener) { + socket.once("close", listeners.close); + } + }; + if (socket.writable && !socket.connecting) { + onConnect(); + } else if (socket.connecting) { + socket.once("connect", onConnect); + } else if (socket.destroyed && hasCloseListener) { + listeners.close(socket._hadError); + } + }; + exports.default = deferToConnect2; + module2.exports = deferToConnect2; + module2.exports.default = deferToConnect2; + } +}); + +// node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +var require_buffer_stream = __commonJS({ + "node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js"(exports, module2) { + "use strict"; + var { PassThrough: PassThroughStream2 } = require("stream"); + module2.exports = (options) => { + options = { ...options }; + const { array } = options; + let { encoding } = options; + const isBuffer = encoding === "buffer"; + let objectMode = false; + if (array) { + objectMode = !(encoding || isBuffer); + } else { + encoding = encoding || "utf8"; + } + if (isBuffer) { + encoding = null; + } + const stream2 = new PassThroughStream2({ objectMode }); + if (encoding) { + stream2.setEncoding(encoding); + } + let length = 0; + const chunks = []; + stream2.on("data", (chunk) => { + chunks.push(chunk); + if (objectMode) { + length = chunks.length; + } else { + length += chunk.length; + } + }); + stream2.getBufferedValue = () => { + if (array) { + return chunks; + } + return isBuffer ? Buffer.concat(chunks, length) : chunks.join(""); + }; + stream2.getBufferedLength = () => length; + return stream2; + }; + } +}); + +// node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +var require_get_stream = __commonJS({ + "node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js"(exports, module2) { + "use strict"; + var { constants: BufferConstants } = require("buffer"); + var stream2 = require("stream"); + var { promisify: promisify4 } = require("util"); + var bufferStream = require_buffer_stream(); + var streamPipelinePromisified = promisify4(stream2.pipeline); + var MaxBufferError = class extends Error { + constructor() { + super("maxBuffer exceeded"); + this.name = "MaxBufferError"; + } + }; + async function getStream2(inputStream, options) { + if (!inputStream) { + throw new Error("Expected a stream"); + } + options = { + maxBuffer: Infinity, + ...options + }; + const { maxBuffer } = options; + const stream3 = bufferStream(options); + await new Promise((resolve, reject) => { + const rejectPromise = (error2) => { + if (error2 && stream3.getBufferedLength() <= BufferConstants.MAX_LENGTH) { + error2.bufferedData = stream3.getBufferedValue(); + } + reject(error2); + }; + (async () => { + try { + await streamPipelinePromisified(inputStream, stream3); + resolve(); + } catch (error2) { + rejectPromise(error2); + } + })(); + stream3.on("data", () => { + if (stream3.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }); + return stream3.getBufferedValue(); + } + module2.exports = getStream2; + module2.exports.buffer = (stream3, options) => getStream2(stream3, { ...options, encoding: "buffer" }); + module2.exports.array = (stream3, options) => getStream2(stream3, { ...options, array: true }); + module2.exports.MaxBufferError = MaxBufferError; + } +}); + +// node_modules/.pnpm/http-cache-semantics@4.1.0/node_modules/http-cache-semantics/index.js +var require_http_cache_semantics = __commonJS({ + "node_modules/.pnpm/http-cache-semantics@4.1.0/node_modules/http-cache-semantics/index.js"(exports, module2) { + "use strict"; + var statusCodeCacheableByDefault = /* @__PURE__ */ new Set([ + 200, + 203, + 204, + 206, + 300, + 301, + 404, + 405, + 410, + 414, + 501 + ]); + var understoodStatuses = /* @__PURE__ */ new Set([ + 200, + 203, + 204, + 300, + 301, + 302, + 303, + 307, + 308, + 404, + 405, + 410, + 414, + 501 + ]); + var errorStatusCodes = /* @__PURE__ */ new Set([ + 500, + 502, + 503, + 504 + ]); + var hopByHopHeaders = { + date: true, + connection: true, + "keep-alive": true, + "proxy-authenticate": true, + "proxy-authorization": true, + te: true, + trailer: true, + "transfer-encoding": true, + upgrade: true + }; + var excludedFromRevalidationUpdate = { + "content-length": true, + "content-encoding": true, + "transfer-encoding": true, + "content-range": true + }; + function toNumberOrZero(s) { + const n = parseInt(s, 10); + return isFinite(n) ? n : 0; + } + function isErrorResponse(response) { + if (!response) { + return true; + } + return errorStatusCodes.has(response.status); + } + function parseCacheControl(header) { + const cc = {}; + if (!header) + return cc; + const parts = header.trim().split(/\s*,\s*/); + for (const part of parts) { + const [k, v] = part.split(/\s*=\s*/, 2); + cc[k] = v === void 0 ? true : v.replace(/^"|"$/g, ""); + } + return cc; + } + function formatCacheControl(cc) { + let parts = []; + for (const k in cc) { + const v = cc[k]; + parts.push(v === true ? k : k + "=" + v); + } + if (!parts.length) { + return void 0; + } + return parts.join(", "); + } + module2.exports = class CachePolicy { + constructor(req, res, { + shared, + cacheHeuristic, + immutableMinTimeToLive, + ignoreCargoCult, + _fromObject + } = {}) { + if (_fromObject) { + this._fromObject(_fromObject); + return; + } + if (!res || !res.headers) { + throw Error("Response headers missing"); + } + this._assertRequestHasHeaders(req); + this._responseTime = this.now(); + this._isShared = shared !== false; + this._cacheHeuristic = void 0 !== cacheHeuristic ? cacheHeuristic : 0.1; + this._immutableMinTtl = void 0 !== immutableMinTimeToLive ? immutableMinTimeToLive : 24 * 3600 * 1e3; + this._status = "status" in res ? res.status : 200; + this._resHeaders = res.headers; + this._rescc = parseCacheControl(res.headers["cache-control"]); + this._method = "method" in req ? req.method : "GET"; + this._url = req.url; + this._host = req.headers.host; + this._noAuthorization = !req.headers.authorization; + this._reqHeaders = res.headers.vary ? req.headers : null; + this._reqcc = parseCacheControl(req.headers["cache-control"]); + if (ignoreCargoCult && "pre-check" in this._rescc && "post-check" in this._rescc) { + delete this._rescc["pre-check"]; + delete this._rescc["post-check"]; + delete this._rescc["no-cache"]; + delete this._rescc["no-store"]; + delete this._rescc["must-revalidate"]; + this._resHeaders = Object.assign({}, this._resHeaders, { + "cache-control": formatCacheControl(this._rescc) + }); + delete this._resHeaders.expires; + delete this._resHeaders.pragma; + } + if (res.headers["cache-control"] == null && /no-cache/.test(res.headers.pragma)) { + this._rescc["no-cache"] = true; + } + } + now() { + return Date.now(); + } + storable() { + return !!(!this._reqcc["no-store"] && ("GET" === this._method || "HEAD" === this._method || "POST" === this._method && this._hasExplicitExpiration()) && understoodStatuses.has(this._status) && !this._rescc["no-store"] && (!this._isShared || !this._rescc.private) && (!this._isShared || this._noAuthorization || this._allowsStoringAuthenticated()) && (this._resHeaders.expires || this._rescc["max-age"] || this._isShared && this._rescc["s-maxage"] || this._rescc.public || statusCodeCacheableByDefault.has(this._status))); + } + _hasExplicitExpiration() { + return this._isShared && this._rescc["s-maxage"] || this._rescc["max-age"] || this._resHeaders.expires; + } + _assertRequestHasHeaders(req) { + if (!req || !req.headers) { + throw Error("Request headers missing"); + } + } + satisfiesWithoutRevalidation(req) { + this._assertRequestHasHeaders(req); + const requestCC = parseCacheControl(req.headers["cache-control"]); + if (requestCC["no-cache"] || /no-cache/.test(req.headers.pragma)) { + return false; + } + if (requestCC["max-age"] && this.age() > requestCC["max-age"]) { + return false; + } + if (requestCC["min-fresh"] && this.timeToLive() < 1e3 * requestCC["min-fresh"]) { + return false; + } + if (this.stale()) { + const allowsStale = requestCC["max-stale"] && !this._rescc["must-revalidate"] && (true === requestCC["max-stale"] || requestCC["max-stale"] > this.age() - this.maxAge()); + if (!allowsStale) { + return false; + } + } + return this._requestMatches(req, false); + } + _requestMatches(req, allowHeadMethod) { + return (!this._url || this._url === req.url) && this._host === req.headers.host && (!req.method || this._method === req.method || allowHeadMethod && "HEAD" === req.method) && this._varyMatches(req); + } + _allowsStoringAuthenticated() { + return this._rescc["must-revalidate"] || this._rescc.public || this._rescc["s-maxage"]; + } + _varyMatches(req) { + if (!this._resHeaders.vary) { + return true; + } + if (this._resHeaders.vary === "*") { + return false; + } + const fields = this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/); + for (const name of fields) { + if (req.headers[name] !== this._reqHeaders[name]) + return false; + } + return true; + } + _copyWithoutHopByHopHeaders(inHeaders) { + const headers = {}; + for (const name in inHeaders) { + if (hopByHopHeaders[name]) + continue; + headers[name] = inHeaders[name]; + } + if (inHeaders.connection) { + const tokens = inHeaders.connection.trim().split(/\s*,\s*/); + for (const name of tokens) { + delete headers[name]; + } + } + if (headers.warning) { + const warnings = headers.warning.split(/,/).filter((warning2) => { + return !/^\s*1[0-9][0-9]/.test(warning2); + }); + if (!warnings.length) { + delete headers.warning; + } else { + headers.warning = warnings.join(",").trim(); + } + } + return headers; + } + responseHeaders() { + const headers = this._copyWithoutHopByHopHeaders(this._resHeaders); + const age = this.age(); + if (age > 3600 * 24 && !this._hasExplicitExpiration() && this.maxAge() > 3600 * 24) { + headers.warning = (headers.warning ? `${headers.warning}, ` : "") + '113 - "rfc7234 5.5.4"'; + } + headers.age = `${Math.round(age)}`; + headers.date = new Date(this.now()).toUTCString(); + return headers; + } + date() { + const serverDate = Date.parse(this._resHeaders.date); + if (isFinite(serverDate)) { + return serverDate; + } + return this._responseTime; + } + age() { + let age = this._ageValue(); + const residentTime = (this.now() - this._responseTime) / 1e3; + return age + residentTime; + } + _ageValue() { + return toNumberOrZero(this._resHeaders.age); + } + maxAge() { + if (!this.storable() || this._rescc["no-cache"]) { + return 0; + } + if (this._isShared && (this._resHeaders["set-cookie"] && !this._rescc.public && !this._rescc.immutable)) { + return 0; + } + if (this._resHeaders.vary === "*") { + return 0; + } + if (this._isShared) { + if (this._rescc["proxy-revalidate"]) { + return 0; + } + if (this._rescc["s-maxage"]) { + return toNumberOrZero(this._rescc["s-maxage"]); + } + } + if (this._rescc["max-age"]) { + return toNumberOrZero(this._rescc["max-age"]); + } + const defaultMinTtl = this._rescc.immutable ? this._immutableMinTtl : 0; + const serverDate = this.date(); + if (this._resHeaders.expires) { + const expires = Date.parse(this._resHeaders.expires); + if (Number.isNaN(expires) || expires < serverDate) { + return 0; + } + return Math.max(defaultMinTtl, (expires - serverDate) / 1e3); + } + if (this._resHeaders["last-modified"]) { + const lastModified = Date.parse(this._resHeaders["last-modified"]); + if (isFinite(lastModified) && serverDate > lastModified) { + return Math.max( + defaultMinTtl, + (serverDate - lastModified) / 1e3 * this._cacheHeuristic + ); + } + } + return defaultMinTtl; + } + timeToLive() { + const age = this.maxAge() - this.age(); + const staleIfErrorAge = age + toNumberOrZero(this._rescc["stale-if-error"]); + const staleWhileRevalidateAge = age + toNumberOrZero(this._rescc["stale-while-revalidate"]); + return Math.max(0, age, staleIfErrorAge, staleWhileRevalidateAge) * 1e3; + } + stale() { + return this.maxAge() <= this.age(); + } + _useStaleIfError() { + return this.maxAge() + toNumberOrZero(this._rescc["stale-if-error"]) > this.age(); + } + useStaleWhileRevalidate() { + return this.maxAge() + toNumberOrZero(this._rescc["stale-while-revalidate"]) > this.age(); + } + static fromObject(obj) { + return new this(void 0, void 0, { _fromObject: obj }); + } + _fromObject(obj) { + if (this._responseTime) + throw Error("Reinitialized"); + if (!obj || obj.v !== 1) + throw Error("Invalid serialization"); + this._responseTime = obj.t; + this._isShared = obj.sh; + this._cacheHeuristic = obj.ch; + this._immutableMinTtl = obj.imm !== void 0 ? obj.imm : 24 * 3600 * 1e3; + this._status = obj.st; + this._resHeaders = obj.resh; + this._rescc = obj.rescc; + this._method = obj.m; + this._url = obj.u; + this._host = obj.h; + this._noAuthorization = obj.a; + this._reqHeaders = obj.reqh; + this._reqcc = obj.reqcc; + } + toObject() { + return { + v: 1, + t: this._responseTime, + sh: this._isShared, + ch: this._cacheHeuristic, + imm: this._immutableMinTtl, + st: this._status, + resh: this._resHeaders, + rescc: this._rescc, + m: this._method, + u: this._url, + h: this._host, + a: this._noAuthorization, + reqh: this._reqHeaders, + reqcc: this._reqcc + }; + } + revalidationHeaders(incomingReq) { + this._assertRequestHasHeaders(incomingReq); + const headers = this._copyWithoutHopByHopHeaders(incomingReq.headers); + delete headers["if-range"]; + if (!this._requestMatches(incomingReq, true) || !this.storable()) { + delete headers["if-none-match"]; + delete headers["if-modified-since"]; + return headers; + } + if (this._resHeaders.etag) { + headers["if-none-match"] = headers["if-none-match"] ? `${headers["if-none-match"]}, ${this._resHeaders.etag}` : this._resHeaders.etag; + } + const forbidsWeakValidators = headers["accept-ranges"] || headers["if-match"] || headers["if-unmodified-since"] || this._method && this._method != "GET"; + if (forbidsWeakValidators) { + delete headers["if-modified-since"]; + if (headers["if-none-match"]) { + const etags = headers["if-none-match"].split(/,/).filter((etag) => { + return !/^\s*W\//.test(etag); + }); + if (!etags.length) { + delete headers["if-none-match"]; + } else { + headers["if-none-match"] = etags.join(",").trim(); + } + } + } else if (this._resHeaders["last-modified"] && !headers["if-modified-since"]) { + headers["if-modified-since"] = this._resHeaders["last-modified"]; + } + return headers; + } + revalidatedPolicy(request, response) { + this._assertRequestHasHeaders(request); + if (this._useStaleIfError() && isErrorResponse(response)) { + return { + modified: false, + matches: false, + policy: this + }; + } + if (!response || !response.headers) { + throw Error("Response headers missing"); + } + let matches = false; + if (response.status !== void 0 && response.status != 304) { + matches = false; + } else if (response.headers.etag && !/^\s*W\//.test(response.headers.etag)) { + matches = this._resHeaders.etag && this._resHeaders.etag.replace(/^\s*W\//, "") === response.headers.etag; + } else if (this._resHeaders.etag && response.headers.etag) { + matches = this._resHeaders.etag.replace(/^\s*W\//, "") === response.headers.etag.replace(/^\s*W\//, ""); + } else if (this._resHeaders["last-modified"]) { + matches = this._resHeaders["last-modified"] === response.headers["last-modified"]; + } else { + if (!this._resHeaders.etag && !this._resHeaders["last-modified"] && !response.headers.etag && !response.headers["last-modified"]) { + matches = true; + } + } + if (!matches) { + return { + policy: new this.constructor(request, response), + modified: response.status != 304, + matches: false + }; + } + const headers = {}; + for (const k in this._resHeaders) { + headers[k] = k in response.headers && !excludedFromRevalidationUpdate[k] ? response.headers[k] : this._resHeaders[k]; + } + const newResponse = Object.assign({}, response, { + status: this._status, + method: this._method, + headers + }); + return { + policy: new this.constructor(request, newResponse, { + shared: this._isShared, + cacheHeuristic: this._cacheHeuristic, + immutableMinTimeToLive: this._immutableMinTtl + }), + modified: false, + matches: true + }; + } + }; + } +}); + +// node_modules/.pnpm/json-buffer@3.0.1/node_modules/json-buffer/index.js +var require_json_buffer = __commonJS({ + "node_modules/.pnpm/json-buffer@3.0.1/node_modules/json-buffer/index.js"(exports) { + exports.stringify = function stringify(o) { + if ("undefined" == typeof o) + return o; + if (o && Buffer.isBuffer(o)) + return JSON.stringify(":base64:" + o.toString("base64")); + if (o && o.toJSON) + o = o.toJSON(); + if (o && "object" === typeof o) { + var s = ""; + var array = Array.isArray(o); + s = array ? "[" : "{"; + var first = true; + for (var k in o) { + var ignore = "function" == typeof o[k] || !array && "undefined" === typeof o[k]; + if (Object.hasOwnProperty.call(o, k) && !ignore) { + if (!first) + s += ","; + first = false; + if (array) { + if (o[k] == void 0) + s += "null"; + else + s += stringify(o[k]); + } else if (o[k] !== void 0) { + s += stringify(k) + ":" + stringify(o[k]); + } + } + } + s += array ? "]" : "}"; + return s; + } else if ("string" === typeof o) { + return JSON.stringify(/^:/.test(o) ? ":" + o : o); + } else if ("undefined" === typeof o) { + return "null"; + } else + return JSON.stringify(o); + }; + exports.parse = function(s) { + return JSON.parse(s, function(key, value) { + if ("string" === typeof value) { + if (/^:base64:/.test(value)) + return Buffer.from(value.substring(8), "base64"); + else + return /^:/.test(value) ? value.substring(1) : value; + } + return value; + }); + }; + } +}); + +// node_modules/.pnpm/keyv@4.5.0/node_modules/keyv/src/index.js +var require_src2 = __commonJS({ + "node_modules/.pnpm/keyv@4.5.0/node_modules/keyv/src/index.js"(exports, module2) { + "use strict"; + var EventEmitter3 = require("events"); + var JSONB = require_json_buffer(); + var loadStore = (options) => { + const adapters = { + redis: "@keyv/redis", + rediss: "@keyv/redis", + mongodb: "@keyv/mongo", + mongo: "@keyv/mongo", + sqlite: "@keyv/sqlite", + postgresql: "@keyv/postgres", + postgres: "@keyv/postgres", + mysql: "@keyv/mysql", + etcd: "@keyv/etcd", + offline: "@keyv/offline", + tiered: "@keyv/tiered" + }; + if (options.adapter || options.uri) { + const adapter = options.adapter || /^[^:+]*/.exec(options.uri)[0]; + return new (require(adapters[adapter]))(options); + } + return /* @__PURE__ */ new Map(); + }; + var iterableAdapters = [ + "sqlite", + "postgres", + "mysql", + "mongo", + "redis", + "tiered" + ]; + var Keyv2 = class extends EventEmitter3 { + constructor(uri, { emitErrors = true, ...options } = {}) { + super(); + this.opts = { + namespace: "keyv", + serialize: JSONB.stringify, + deserialize: JSONB.parse, + ...typeof uri === "string" ? { uri } : uri, + ...options + }; + if (!this.opts.store) { + const adapterOptions = { ...this.opts }; + this.opts.store = loadStore(adapterOptions); + } + if (this.opts.compression) { + const compression = this.opts.compression; + const { serialize, deserialize } = compression.opts; + this.opts.serialize = serialize; + this.opts.deserialize = deserialize; + } + if (typeof this.opts.store.on === "function" && emitErrors) { + this.opts.store.on("error", (error2) => this.emit("error", error2)); + } + this.opts.store.namespace = this.opts.namespace; + const generateIterator = (iterator) => async function* () { + for await (const [key, raw] of typeof iterator === "function" ? iterator(this.opts.store.namespace) : iterator) { + const data = this.opts.deserialize(raw); + if (this.opts.store.namespace && !key.includes(this.opts.store.namespace)) { + continue; + } + if (typeof data.expires === "number" && Date.now() > data.expires) { + this.delete(key); + continue; + } + yield [this._getKeyUnprefix(key), data.value]; + } + }; + if (typeof this.opts.store[Symbol.iterator] === "function" && this.opts.store instanceof Map) { + this.iterator = generateIterator(this.opts.store); + } else if (typeof this.opts.store.iterator === "function" && this.opts.store.opts && this._checkIterableAdaptar()) { + this.iterator = generateIterator(this.opts.store.iterator.bind(this.opts.store)); + } + } + _checkIterableAdaptar() { + return iterableAdapters.includes(this.opts.store.opts.dialect) || iterableAdapters.findIndex((element) => this.opts.store.opts.url.includes(element)) >= 0; + } + _getKeyPrefix(key) { + return `${this.opts.namespace}:${key}`; + } + _getKeyPrefixArray(keys) { + return keys.map((key) => `${this.opts.namespace}:${key}`); + } + _getKeyUnprefix(key) { + return key.split(":").splice(1).join(":"); + } + get(key, options) { + const { store } = this.opts; + const isArray = Array.isArray(key); + const keyPrefixed = isArray ? this._getKeyPrefixArray(key) : this._getKeyPrefix(key); + if (isArray && store.getMany === void 0) { + const promises = []; + for (const key2 of keyPrefixed) { + promises.push( + Promise.resolve().then(() => store.get(key2)).then((data) => typeof data === "string" ? this.opts.deserialize(data) : data).then((data) => { + if (data === void 0 || data === null) { + return void 0; + } + if (typeof data.expires === "number" && Date.now() > data.expires) { + return this.delete(key2).then(() => void 0); + } + return options && options.raw ? data : data.value; + }) + ); + } + return Promise.allSettled(promises).then((values) => { + const data = []; + for (const value of values) { + data.push(value.value); + } + return data; + }); + } + return Promise.resolve().then(() => isArray ? store.getMany(keyPrefixed) : store.get(keyPrefixed)).then((data) => typeof data === "string" ? this.opts.deserialize(data) : data).then((data) => { + if (data === void 0 || data === null) { + return void 0; + } + if (isArray) { + const result = []; + for (let row of data) { + if (typeof row === "string") { + row = this.opts.deserialize(row); + } + if (row === void 0 || row === null) { + result.push(void 0); + continue; + } + if (typeof row.expires === "number" && Date.now() > row.expires) { + this.delete(key).then(() => void 0); + result.push(void 0); + } else { + result.push(options && options.raw ? row : row.value); + } + } + return result; + } + if (typeof data.expires === "number" && Date.now() > data.expires) { + return this.delete(key).then(() => void 0); + } + return options && options.raw ? data : data.value; + }); + } + set(key, value, ttl2) { + const keyPrefixed = this._getKeyPrefix(key); + if (typeof ttl2 === "undefined") { + ttl2 = this.opts.ttl; + } + if (ttl2 === 0) { + ttl2 = void 0; + } + const { store } = this.opts; + return Promise.resolve().then(() => { + const expires = typeof ttl2 === "number" ? Date.now() + ttl2 : null; + if (typeof value === "symbol") { + this.emit("error", "symbol cannot be serialized"); + } + value = { value, expires }; + return this.opts.serialize(value); + }).then((value2) => store.set(keyPrefixed, value2, ttl2)).then(() => true); + } + delete(key) { + const { store } = this.opts; + if (Array.isArray(key)) { + const keyPrefixed2 = this._getKeyPrefixArray(key); + if (store.deleteMany === void 0) { + const promises = []; + for (const key2 of keyPrefixed2) { + promises.push(store.delete(key2)); + } + return Promise.allSettled(promises).then((values) => values.every((x) => x.value === true)); + } + return Promise.resolve().then(() => store.deleteMany(keyPrefixed2)); + } + const keyPrefixed = this._getKeyPrefix(key); + return Promise.resolve().then(() => store.delete(keyPrefixed)); + } + clear() { + const { store } = this.opts; + return Promise.resolve().then(() => store.clear()); + } + has(key) { + const keyPrefixed = this._getKeyPrefix(key); + const { store } = this.opts; + return Promise.resolve().then(async () => { + if (typeof store.has === "function") { + return store.has(keyPrefixed); + } + const value = await store.get(keyPrefixed); + return value !== void 0; + }); + } + disconnect() { + const { store } = this.opts; + if (typeof store.disconnect === "function") { + return store.disconnect(); + } + } + }; + module2.exports = Keyv2; + } +}); + +// node_modules/.pnpm/mimic-response@3.1.0/node_modules/mimic-response/index.js +var require_mimic_response = __commonJS({ + "node_modules/.pnpm/mimic-response@3.1.0/node_modules/mimic-response/index.js"(exports, module2) { + "use strict"; + var knownProperties2 = [ + "aborted", + "complete", + "headers", + "httpVersion", + "httpVersionMinor", + "httpVersionMajor", + "method", + "rawHeaders", + "rawTrailers", + "setTimeout", + "socket", + "statusCode", + "statusMessage", + "trailers", + "url" + ]; + module2.exports = (fromStream, toStream) => { + if (toStream._readableState.autoDestroy) { + throw new Error("The second stream must have the `autoDestroy` option set to `false`"); + } + const fromProperties = new Set(Object.keys(fromStream).concat(knownProperties2)); + const properties = {}; + for (const property of fromProperties) { + if (property in toStream) { + continue; + } + properties[property] = { + get() { + const value = fromStream[property]; + const isFunction2 = typeof value === "function"; + return isFunction2 ? value.bind(fromStream) : value; + }, + set(value) { + fromStream[property] = value; + }, + enumerable: true, + configurable: false + }; + } + Object.defineProperties(toStream, properties); + fromStream.once("aborted", () => { + toStream.destroy(); + toStream.emit("aborted"); + }); + fromStream.once("close", () => { + if (fromStream.complete) { + if (toStream.readable) { + toStream.once("end", () => { + toStream.emit("close"); + }); + } else { + toStream.emit("close"); + } + } else { + toStream.emit("close"); + } + }); + return toStream; + }; + } +}); + +// node_modules/.pnpm/decompress-response@6.0.0/node_modules/decompress-response/index.js +var require_decompress_response = __commonJS({ + "node_modules/.pnpm/decompress-response@6.0.0/node_modules/decompress-response/index.js"(exports, module2) { + "use strict"; + var { Transform, PassThrough } = require("stream"); + var zlib = require("zlib"); + var mimicResponse2 = require_mimic_response(); + module2.exports = (response) => { + const contentEncoding = (response.headers["content-encoding"] || "").toLowerCase(); + if (!["gzip", "deflate", "br"].includes(contentEncoding)) { + return response; + } + const isBrotli = contentEncoding === "br"; + if (isBrotli && typeof zlib.createBrotliDecompress !== "function") { + response.destroy(new Error("Brotli is not supported on Node.js < 12")); + return response; + } + let isEmpty = true; + const checker = new Transform({ + transform(data, _encoding, callback) { + isEmpty = false; + callback(null, data); + }, + flush(callback) { + callback(); + } + }); + const finalStream = new PassThrough({ + autoDestroy: false, + destroy(error2, callback) { + response.destroy(); + callback(error2); + } + }); + const decompressStream = isBrotli ? zlib.createBrotliDecompress() : zlib.createUnzip(); + decompressStream.once("error", (error2) => { + if (isEmpty && !response.readable) { + finalStream.end(); + return; + } + finalStream.destroy(error2); + }); + mimicResponse2(response, finalStream); + response.pipe(checker).pipe(decompressStream).pipe(finalStream); + return finalStream; + }; + } +}); + +// node_modules/.pnpm/quick-lru@5.1.1/node_modules/quick-lru/index.js +var require_quick_lru = __commonJS({ + "node_modules/.pnpm/quick-lru@5.1.1/node_modules/quick-lru/index.js"(exports, module2) { + "use strict"; + var QuickLRU = class { + constructor(options = {}) { + if (!(options.maxSize && options.maxSize > 0)) { + throw new TypeError("`maxSize` must be a number greater than 0"); + } + this.maxSize = options.maxSize; + this.onEviction = options.onEviction; + this.cache = /* @__PURE__ */ new Map(); + this.oldCache = /* @__PURE__ */ new Map(); + this._size = 0; + } + _set(key, value) { + this.cache.set(key, value); + this._size++; + if (this._size >= this.maxSize) { + this._size = 0; + if (typeof this.onEviction === "function") { + for (const [key2, value2] of this.oldCache.entries()) { + this.onEviction(key2, value2); + } + } + this.oldCache = this.cache; + this.cache = /* @__PURE__ */ new Map(); + } + } + get(key) { + if (this.cache.has(key)) { + return this.cache.get(key); + } + if (this.oldCache.has(key)) { + const value = this.oldCache.get(key); + this.oldCache.delete(key); + this._set(key, value); + return value; + } + } + set(key, value) { + if (this.cache.has(key)) { + this.cache.set(key, value); + } else { + this._set(key, value); + } + return this; + } + has(key) { + return this.cache.has(key) || this.oldCache.has(key); + } + peek(key) { + if (this.cache.has(key)) { + return this.cache.get(key); + } + if (this.oldCache.has(key)) { + return this.oldCache.get(key); + } + } + delete(key) { + const deleted = this.cache.delete(key); + if (deleted) { + this._size--; + } + return this.oldCache.delete(key) || deleted; + } + clear() { + this.cache.clear(); + this.oldCache.clear(); + this._size = 0; + } + *keys() { + for (const [key] of this) { + yield key; + } + } + *values() { + for (const [, value] of this) { + yield value; + } + } + *[Symbol.iterator]() { + for (const item of this.cache) { + yield item; + } + for (const item of this.oldCache) { + const [key] = item; + if (!this.cache.has(key)) { + yield item; + } + } + } + get size() { + let oldCacheSize = 0; + for (const key of this.oldCache.keys()) { + if (!this.cache.has(key)) { + oldCacheSize++; + } + } + return Math.min(this._size + oldCacheSize, this.maxSize); + } + }; + module2.exports = QuickLRU; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/delay-async-destroy.js +var require_delay_async_destroy = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/delay-async-destroy.js"(exports, module2) { + "use strict"; + module2.exports = (stream2) => { + if (stream2.listenerCount("error") !== 0) { + return stream2; + } + stream2.__destroy = stream2._destroy; + stream2._destroy = (...args) => { + const callback = args.pop(); + stream2.__destroy(...args, async (error2) => { + await Promise.resolve(); + callback(error2); + }); + }; + const onError = (error2) => { + Promise.resolve().then(() => { + stream2.emit("error", error2); + }); + }; + stream2.once("error", onError); + Promise.resolve().then(() => { + stream2.off("error", onError); + }); + return stream2; + }; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/agent.js +var require_agent = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/agent.js"(exports, module2) { + "use strict"; + var { URL: URL4 } = require("url"); + var EventEmitter3 = require("events"); + var tls = require("tls"); + var http22 = require("http2"); + var QuickLRU = require_quick_lru(); + var delayAsyncDestroy = require_delay_async_destroy(); + var kCurrentStreamCount = Symbol("currentStreamCount"); + var kRequest = Symbol("request"); + var kOriginSet = Symbol("cachedOriginSet"); + var kGracefullyClosing = Symbol("gracefullyClosing"); + var kLength = Symbol("length"); + var nameKeys = [ + "createConnection", + "maxDeflateDynamicTableSize", + "maxSettings", + "maxSessionMemory", + "maxHeaderListPairs", + "maxOutstandingPings", + "maxReservedRemoteStreams", + "maxSendHeaderBlockLength", + "paddingStrategy", + "peerMaxConcurrentStreams", + "settings", + "family", + "localAddress", + "rejectUnauthorized", + "pskCallback", + "minDHSize", + "path", + "socket", + "ca", + "cert", + "sigalgs", + "ciphers", + "clientCertEngine", + "crl", + "dhparam", + "ecdhCurve", + "honorCipherOrder", + "key", + "privateKeyEngine", + "privateKeyIdentifier", + "maxVersion", + "minVersion", + "pfx", + "secureOptions", + "secureProtocol", + "sessionIdContext", + "ticketKeys" + ]; + var getSortedIndex = (array, value, compare2) => { + let low = 0; + let high = array.length; + while (low < high) { + const mid = low + high >>> 1; + if (compare2(array[mid], value)) { + low = mid + 1; + } else { + high = mid; + } + } + return low; + }; + var compareSessions = (a, b) => a.remoteSettings.maxConcurrentStreams > b.remoteSettings.maxConcurrentStreams; + var closeCoveredSessions = (where, session) => { + for (let index = 0; index < where.length; index++) { + const coveredSession = where[index]; + if (coveredSession[kOriginSet].length > 0 && coveredSession[kOriginSet].length < session[kOriginSet].length && coveredSession[kOriginSet].every((origin) => session[kOriginSet].includes(origin)) && coveredSession[kCurrentStreamCount] + session[kCurrentStreamCount] <= session.remoteSettings.maxConcurrentStreams) { + gracefullyClose(coveredSession); + } + } + }; + var closeSessionIfCovered = (where, coveredSession) => { + for (let index = 0; index < where.length; index++) { + const session = where[index]; + if (coveredSession[kOriginSet].length > 0 && coveredSession[kOriginSet].length < session[kOriginSet].length && coveredSession[kOriginSet].every((origin) => session[kOriginSet].includes(origin)) && coveredSession[kCurrentStreamCount] + session[kCurrentStreamCount] <= session.remoteSettings.maxConcurrentStreams) { + gracefullyClose(coveredSession); + return true; + } + } + return false; + }; + var gracefullyClose = (session) => { + session[kGracefullyClosing] = true; + if (session[kCurrentStreamCount] === 0) { + session.close(); + } + }; + var Agent = class extends EventEmitter3 { + constructor({ timeout = 0, maxSessions = Number.POSITIVE_INFINITY, maxEmptySessions = 10, maxCachedTlsSessions = 100 } = {}) { + super(); + this.sessions = {}; + this.queue = {}; + this.timeout = timeout; + this.maxSessions = maxSessions; + this.maxEmptySessions = maxEmptySessions; + this._emptySessionCount = 0; + this._sessionCount = 0; + this.settings = { + enablePush: false, + initialWindowSize: 1024 * 1024 * 32 + }; + this.tlsSessionCache = new QuickLRU({ maxSize: maxCachedTlsSessions }); + } + get protocol() { + return "https:"; + } + normalizeOptions(options) { + let normalized = ""; + for (let index = 0; index < nameKeys.length; index++) { + const key = nameKeys[index]; + normalized += ":"; + if (options && options[key] !== void 0) { + normalized += options[key]; + } + } + return normalized; + } + _processQueue() { + if (this._sessionCount >= this.maxSessions) { + this.closeEmptySessions(this.maxSessions - this._sessionCount + 1); + return; + } + for (const normalizedOptions in this.queue) { + for (const normalizedOrigin in this.queue[normalizedOptions]) { + const item = this.queue[normalizedOptions][normalizedOrigin]; + if (!item.completed) { + item.completed = true; + item(); + } + } + } + } + _isBetterSession(thisStreamCount, thatStreamCount) { + return thisStreamCount > thatStreamCount; + } + _accept(session, listeners, normalizedOrigin, options) { + let index = 0; + while (index < listeners.length && session[kCurrentStreamCount] < session.remoteSettings.maxConcurrentStreams) { + listeners[index].resolve(session); + index++; + } + listeners.splice(0, index); + if (listeners.length > 0) { + this.getSession(normalizedOrigin, options, listeners); + listeners.length = 0; + } + } + getSession(origin, options, listeners) { + return new Promise((resolve, reject) => { + if (Array.isArray(listeners) && listeners.length > 0) { + listeners = [...listeners]; + resolve(); + } else { + listeners = [{ resolve, reject }]; + } + try { + if (typeof origin === "string") { + origin = new URL4(origin); + } else if (!(origin instanceof URL4)) { + throw new TypeError("The `origin` argument needs to be a string or an URL object"); + } + if (options) { + const { servername } = options; + const { hostname } = origin; + if (servername && hostname !== servername) { + throw new Error(`Origin ${hostname} differs from servername ${servername}`); + } + } + } catch (error2) { + for (let index = 0; index < listeners.length; index++) { + listeners[index].reject(error2); + } + return; + } + const normalizedOptions = this.normalizeOptions(options); + const normalizedOrigin = origin.origin; + if (normalizedOptions in this.sessions) { + const sessions = this.sessions[normalizedOptions]; + let maxConcurrentStreams = -1; + let currentStreamsCount = -1; + let optimalSession; + for (let index = 0; index < sessions.length; index++) { + const session = sessions[index]; + const sessionMaxConcurrentStreams = session.remoteSettings.maxConcurrentStreams; + if (sessionMaxConcurrentStreams < maxConcurrentStreams) { + break; + } + if (!session[kOriginSet].includes(normalizedOrigin)) { + continue; + } + const sessionCurrentStreamsCount = session[kCurrentStreamCount]; + if (sessionCurrentStreamsCount >= sessionMaxConcurrentStreams || session[kGracefullyClosing] || session.destroyed) { + continue; + } + if (!optimalSession) { + maxConcurrentStreams = sessionMaxConcurrentStreams; + } + if (this._isBetterSession(sessionCurrentStreamsCount, currentStreamsCount)) { + optimalSession = session; + currentStreamsCount = sessionCurrentStreamsCount; + } + } + if (optimalSession) { + this._accept(optimalSession, listeners, normalizedOrigin, options); + return; + } + } + if (normalizedOptions in this.queue) { + if (normalizedOrigin in this.queue[normalizedOptions]) { + this.queue[normalizedOptions][normalizedOrigin].listeners.push(...listeners); + return; + } + } else { + this.queue[normalizedOptions] = { + [kLength]: 0 + }; + } + const removeFromQueue = () => { + if (normalizedOptions in this.queue && this.queue[normalizedOptions][normalizedOrigin] === entry) { + delete this.queue[normalizedOptions][normalizedOrigin]; + if (--this.queue[normalizedOptions][kLength] === 0) { + delete this.queue[normalizedOptions]; + } + } + }; + const entry = async () => { + this._sessionCount++; + const name = `${normalizedOrigin}:${normalizedOptions}`; + let receivedSettings = false; + let socket; + try { + const computedOptions = { ...options }; + if (computedOptions.settings === void 0) { + computedOptions.settings = this.settings; + } + if (computedOptions.session === void 0) { + computedOptions.session = this.tlsSessionCache.get(name); + } + const createConnection = computedOptions.createConnection || this.createConnection; + socket = await createConnection.call(this, origin, computedOptions); + computedOptions.createConnection = () => socket; + const session = http22.connect(origin, computedOptions); + session[kCurrentStreamCount] = 0; + session[kGracefullyClosing] = false; + const getOriginSet = () => { + const { socket: socket2 } = session; + let originSet; + if (socket2.servername === false) { + socket2.servername = socket2.remoteAddress; + originSet = session.originSet; + socket2.servername = false; + } else { + originSet = session.originSet; + } + return originSet; + }; + const isFree = () => session[kCurrentStreamCount] < session.remoteSettings.maxConcurrentStreams; + session.socket.once("session", (tlsSession) => { + this.tlsSessionCache.set(name, tlsSession); + }); + session.once("error", (error2) => { + for (let index = 0; index < listeners.length; index++) { + listeners[index].reject(error2); + } + this.tlsSessionCache.delete(name); + }); + session.setTimeout(this.timeout, () => { + session.destroy(); + }); + session.once("close", () => { + this._sessionCount--; + if (receivedSettings) { + this._emptySessionCount--; + const where = this.sessions[normalizedOptions]; + if (where.length === 1) { + delete this.sessions[normalizedOptions]; + } else { + where.splice(where.indexOf(session), 1); + } + } else { + removeFromQueue(); + const error2 = new Error("Session closed without receiving a SETTINGS frame"); + error2.code = "HTTP2WRAPPER_NOSETTINGS"; + for (let index = 0; index < listeners.length; index++) { + listeners[index].reject(error2); + } + } + this._processQueue(); + }); + const processListeners = () => { + const queue = this.queue[normalizedOptions]; + if (!queue) { + return; + } + const originSet = session[kOriginSet]; + for (let index = 0; index < originSet.length; index++) { + const origin2 = originSet[index]; + if (origin2 in queue) { + const { listeners: listeners2, completed } = queue[origin2]; + let index2 = 0; + while (index2 < listeners2.length && isFree()) { + listeners2[index2].resolve(session); + index2++; + } + queue[origin2].listeners.splice(0, index2); + if (queue[origin2].listeners.length === 0 && !completed) { + delete queue[origin2]; + if (--queue[kLength] === 0) { + delete this.queue[normalizedOptions]; + break; + } + } + if (!isFree()) { + break; + } + } + } + }; + session.on("origin", () => { + session[kOriginSet] = getOriginSet() || []; + session[kGracefullyClosing] = false; + closeSessionIfCovered(this.sessions[normalizedOptions], session); + if (session[kGracefullyClosing] || !isFree()) { + return; + } + processListeners(); + if (!isFree()) { + return; + } + closeCoveredSessions(this.sessions[normalizedOptions], session); + }); + session.once("remoteSettings", () => { + if (entry.destroyed) { + const error2 = new Error("Agent has been destroyed"); + for (let index = 0; index < listeners.length; index++) { + listeners[index].reject(error2); + } + session.destroy(); + return; + } + if (session.setLocalWindowSize) { + session.setLocalWindowSize(1024 * 1024 * 4); + } + session[kOriginSet] = getOriginSet() || []; + if (session.socket.encrypted) { + const mainOrigin = session[kOriginSet][0]; + if (mainOrigin !== normalizedOrigin) { + const error2 = new Error(`Requested origin ${normalizedOrigin} does not match server ${mainOrigin}`); + for (let index = 0; index < listeners.length; index++) { + listeners[index].reject(error2); + } + session.destroy(); + return; + } + } + removeFromQueue(); + { + const where = this.sessions; + if (normalizedOptions in where) { + const sessions = where[normalizedOptions]; + sessions.splice(getSortedIndex(sessions, session, compareSessions), 0, session); + } else { + where[normalizedOptions] = [session]; + } + } + receivedSettings = true; + this._emptySessionCount++; + this.emit("session", session); + this._accept(session, listeners, normalizedOrigin, options); + if (session[kCurrentStreamCount] === 0 && this._emptySessionCount > this.maxEmptySessions) { + this.closeEmptySessions(this._emptySessionCount - this.maxEmptySessions); + } + session.on("remoteSettings", () => { + if (!isFree()) { + return; + } + processListeners(); + if (!isFree()) { + return; + } + closeCoveredSessions(this.sessions[normalizedOptions], session); + }); + }); + session[kRequest] = session.request; + session.request = (headers, streamOptions) => { + if (session[kGracefullyClosing]) { + throw new Error("The session is gracefully closing. No new streams are allowed."); + } + const stream2 = session[kRequest](headers, streamOptions); + session.ref(); + if (session[kCurrentStreamCount]++ === 0) { + this._emptySessionCount--; + } + stream2.once("close", () => { + if (--session[kCurrentStreamCount] === 0) { + this._emptySessionCount++; + session.unref(); + if (this._emptySessionCount > this.maxEmptySessions || session[kGracefullyClosing]) { + session.close(); + return; + } + } + if (session.destroyed || session.closed) { + return; + } + if (isFree() && !closeSessionIfCovered(this.sessions[normalizedOptions], session)) { + closeCoveredSessions(this.sessions[normalizedOptions], session); + processListeners(); + if (session[kCurrentStreamCount] === 0) { + this._processQueue(); + } + } + }); + return stream2; + }; + } catch (error2) { + removeFromQueue(); + this._sessionCount--; + for (let index = 0; index < listeners.length; index++) { + listeners[index].reject(error2); + } + } + }; + entry.listeners = listeners; + entry.completed = false; + entry.destroyed = false; + this.queue[normalizedOptions][normalizedOrigin] = entry; + this.queue[normalizedOptions][kLength]++; + this._processQueue(); + }); + } + request(origin, options, headers, streamOptions) { + return new Promise((resolve, reject) => { + this.getSession(origin, options, [{ + reject, + resolve: (session) => { + try { + const stream2 = session.request(headers, streamOptions); + delayAsyncDestroy(stream2); + resolve(stream2); + } catch (error2) { + reject(error2); + } + } + }]); + }); + } + async createConnection(origin, options) { + return Agent.connect(origin, options); + } + static connect(origin, options) { + options.ALPNProtocols = ["h2"]; + const port = origin.port || 443; + const host = origin.hostname; + if (typeof options.servername === "undefined") { + options.servername = host; + } + const socket = tls.connect(port, host, options); + if (options.socket) { + socket._peername = { + family: void 0, + address: void 0, + port + }; + } + return socket; + } + closeEmptySessions(maxCount = Number.POSITIVE_INFINITY) { + let closedCount = 0; + const { sessions } = this; + for (const key in sessions) { + const thisSessions = sessions[key]; + for (let index = 0; index < thisSessions.length; index++) { + const session = thisSessions[index]; + if (session[kCurrentStreamCount] === 0) { + closedCount++; + session.close(); + if (closedCount >= maxCount) { + return closedCount; + } + } + } + } + return closedCount; + } + destroy(reason) { + const { sessions, queue } = this; + for (const key in sessions) { + const thisSessions = sessions[key]; + for (let index = 0; index < thisSessions.length; index++) { + thisSessions[index].destroy(reason); + } + } + for (const normalizedOptions in queue) { + const entries2 = queue[normalizedOptions]; + for (const normalizedOrigin in entries2) { + entries2[normalizedOrigin].destroyed = true; + } + } + this.queue = {}; + this.tlsSessionCache.clear(); + } + get emptySessionCount() { + return this._emptySessionCount; + } + get pendingSessionCount() { + return this._sessionCount - this._emptySessionCount; + } + get sessionCount() { + return this._sessionCount; + } + }; + Agent.kCurrentStreamCount = kCurrentStreamCount; + Agent.kGracefullyClosing = kGracefullyClosing; + module2.exports = { + Agent, + globalAgent: new Agent() + }; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/incoming-message.js +var require_incoming_message = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/incoming-message.js"(exports, module2) { + "use strict"; + var { Readable } = require("stream"); + var IncomingMessage = class extends Readable { + constructor(socket, highWaterMark) { + super({ + emitClose: false, + autoDestroy: true, + highWaterMark + }); + this.statusCode = null; + this.statusMessage = ""; + this.httpVersion = "2.0"; + this.httpVersionMajor = 2; + this.httpVersionMinor = 0; + this.headers = {}; + this.trailers = {}; + this.req = null; + this.aborted = false; + this.complete = false; + this.upgrade = null; + this.rawHeaders = []; + this.rawTrailers = []; + this.socket = socket; + this._dumped = false; + } + get connection() { + return this.socket; + } + set connection(value) { + this.socket = value; + } + _destroy(error2, callback) { + if (!this.readableEnded) { + this.aborted = true; + } + callback(); + this.req._request.destroy(error2); + } + setTimeout(ms, callback) { + this.req.setTimeout(ms, callback); + return this; + } + _dump() { + if (!this._dumped) { + this._dumped = true; + this.removeAllListeners("data"); + this.resume(); + } + } + _read() { + if (this.req) { + this.req._request.resume(); + } + } + }; + module2.exports = IncomingMessage; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/proxy-events.js +var require_proxy_events = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/proxy-events.js"(exports, module2) { + "use strict"; + module2.exports = (from, to, events) => { + for (const event of events) { + from.on(event, (...args) => to.emit(event, ...args)); + } + }; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/errors.js +var require_errors = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/errors.js"(exports, module2) { + "use strict"; + var makeError = (Base, key, getMessage) => { + module2.exports[key] = class NodeError extends Base { + constructor(...args) { + super(typeof getMessage === "string" ? getMessage : getMessage(args)); + this.name = `${super.name} [${key}]`; + this.code = key; + } + }; + }; + makeError(TypeError, "ERR_INVALID_ARG_TYPE", (args) => { + const type = args[0].includes(".") ? "property" : "argument"; + let valid = args[1]; + const isManyTypes = Array.isArray(valid); + if (isManyTypes) { + valid = `${valid.slice(0, -1).join(", ")} or ${valid.slice(-1)}`; + } + return `The "${args[0]}" ${type} must be ${isManyTypes ? "one of" : "of"} type ${valid}. Received ${typeof args[2]}`; + }); + makeError( + TypeError, + "ERR_INVALID_PROTOCOL", + (args) => `Protocol "${args[0]}" not supported. Expected "${args[1]}"` + ); + makeError( + Error, + "ERR_HTTP_HEADERS_SENT", + (args) => `Cannot ${args[0]} headers after they are sent to the client` + ); + makeError( + TypeError, + "ERR_INVALID_HTTP_TOKEN", + (args) => `${args[0]} must be a valid HTTP token [${args[1]}]` + ); + makeError( + TypeError, + "ERR_HTTP_INVALID_HEADER_VALUE", + (args) => `Invalid value "${args[0]} for header "${args[1]}"` + ); + makeError( + TypeError, + "ERR_INVALID_CHAR", + (args) => `Invalid character in ${args[0]} [${args[1]}]` + ); + makeError( + Error, + "ERR_HTTP2_NO_SOCKET_MANIPULATION", + "HTTP/2 sockets should not be directly manipulated (e.g. read and written)" + ); + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +var require_is_request_pseudo_header = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js"(exports, module2) { + "use strict"; + module2.exports = (header) => { + switch (header) { + case ":method": + case ":scheme": + case ":authority": + case ":path": + return true; + default: + return false; + } + }; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/validate-header-name.js +var require_validate_header_name = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/validate-header-name.js"(exports, module2) { + "use strict"; + var { ERR_INVALID_HTTP_TOKEN } = require_errors(); + var isRequestPseudoHeader = require_is_request_pseudo_header(); + var isValidHttpToken = /^[\^`\-\w!#$%&*+.|~]+$/; + module2.exports = (name) => { + if (typeof name !== "string" || !isValidHttpToken.test(name) && !isRequestPseudoHeader(name)) { + throw new ERR_INVALID_HTTP_TOKEN("Header name", name); + } + }; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/validate-header-value.js +var require_validate_header_value = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/validate-header-value.js"(exports, module2) { + "use strict"; + var { + ERR_HTTP_INVALID_HEADER_VALUE, + ERR_INVALID_CHAR + } = require_errors(); + var isInvalidHeaderValue = /[^\t\u0020-\u007E\u0080-\u00FF]/; + module2.exports = (name, value) => { + if (typeof value === "undefined") { + throw new ERR_HTTP_INVALID_HEADER_VALUE(value, name); + } + if (isInvalidHeaderValue.test(value)) { + throw new ERR_INVALID_CHAR("header content", name); + } + }; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js +var require_proxy_socket_handler = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js"(exports, module2) { + "use strict"; + var { ERR_HTTP2_NO_SOCKET_MANIPULATION } = require_errors(); + var proxySocketHandler = { + has(stream2, property) { + const reference = stream2.session === void 0 ? stream2 : stream2.session.socket; + return property in stream2 || property in reference; + }, + get(stream2, property) { + switch (property) { + case "on": + case "once": + case "end": + case "emit": + case "destroy": + return stream2[property].bind(stream2); + case "writable": + case "destroyed": + return stream2[property]; + case "readable": + if (stream2.destroyed) { + return false; + } + return stream2.readable; + case "setTimeout": { + const { session } = stream2; + if (session !== void 0) { + return session.setTimeout.bind(session); + } + return stream2.setTimeout.bind(stream2); + } + case "write": + case "read": + case "pause": + case "resume": + throw new ERR_HTTP2_NO_SOCKET_MANIPULATION(); + default: { + const reference = stream2.session === void 0 ? stream2 : stream2.session.socket; + const value = reference[property]; + return typeof value === "function" ? value.bind(reference) : value; + } + } + }, + getPrototypeOf(stream2) { + if (stream2.session !== void 0) { + return Reflect.getPrototypeOf(stream2.session.socket); + } + return Reflect.getPrototypeOf(stream2); + }, + set(stream2, property, value) { + switch (property) { + case "writable": + case "readable": + case "destroyed": + case "on": + case "once": + case "end": + case "emit": + case "destroy": + stream2[property] = value; + return true; + case "setTimeout": { + const { session } = stream2; + if (session === void 0) { + stream2.setTimeout = value; + } else { + session.setTimeout = value; + } + return true; + } + case "write": + case "read": + case "pause": + case "resume": + throw new ERR_HTTP2_NO_SOCKET_MANIPULATION(); + default: { + const reference = stream2.session === void 0 ? stream2 : stream2.session.socket; + reference[property] = value; + return true; + } + } + } + }; + module2.exports = proxySocketHandler; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/client-request.js +var require_client_request = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/client-request.js"(exports, module2) { + "use strict"; + var { URL: URL4, urlToHttpOptions } = require("url"); + var http22 = require("http2"); + var { Writable } = require("stream"); + var { Agent, globalAgent } = require_agent(); + var IncomingMessage = require_incoming_message(); + var proxyEvents2 = require_proxy_events(); + var { + ERR_INVALID_ARG_TYPE, + ERR_INVALID_PROTOCOL, + ERR_HTTP_HEADERS_SENT + } = require_errors(); + var validateHeaderName = require_validate_header_name(); + var validateHeaderValue = require_validate_header_value(); + var proxySocketHandler = require_proxy_socket_handler(); + var { + HTTP2_HEADER_STATUS, + HTTP2_HEADER_METHOD, + HTTP2_HEADER_PATH, + HTTP2_HEADER_AUTHORITY, + HTTP2_METHOD_CONNECT + } = http22.constants; + var kHeaders = Symbol("headers"); + var kOrigin = Symbol("origin"); + var kSession = Symbol("session"); + var kOptions = Symbol("options"); + var kFlushedHeaders = Symbol("flushedHeaders"); + var kJobs = Symbol("jobs"); + var kPendingAgentPromise = Symbol("pendingAgentPromise"); + var ClientRequest = class extends Writable { + constructor(input, options, callback) { + super({ + autoDestroy: false, + emitClose: false + }); + if (typeof input === "string") { + input = urlToHttpOptions(new URL4(input)); + } else if (input instanceof URL4) { + input = urlToHttpOptions(input); + } else { + input = { ...input }; + } + if (typeof options === "function" || options === void 0) { + callback = options; + options = input; + } else { + options = Object.assign(input, options); + } + if (options.h2session) { + this[kSession] = options.h2session; + if (this[kSession].destroyed) { + throw new Error("The session has been closed already"); + } + this.protocol = this[kSession].socket.encrypted ? "https:" : "http:"; + } else if (options.agent === false) { + this.agent = new Agent({ maxEmptySessions: 0 }); + } else if (typeof options.agent === "undefined" || options.agent === null) { + this.agent = globalAgent; + } else if (typeof options.agent.request === "function") { + this.agent = options.agent; + } else { + throw new ERR_INVALID_ARG_TYPE("options.agent", ["http2wrapper.Agent-like Object", "undefined", "false"], options.agent); + } + if (this.agent) { + this.protocol = this.agent.protocol; + } + if (options.protocol && options.protocol !== this.protocol) { + throw new ERR_INVALID_PROTOCOL(options.protocol, this.protocol); + } + if (!options.port) { + options.port = options.defaultPort || this.agent && this.agent.defaultPort || 443; + } + options.host = options.hostname || options.host || "localhost"; + delete options.hostname; + const { timeout } = options; + options.timeout = void 0; + this[kHeaders] = /* @__PURE__ */ Object.create(null); + this[kJobs] = []; + this[kPendingAgentPromise] = void 0; + this.socket = null; + this.connection = null; + this.method = options.method || "GET"; + if (!(this.method === "CONNECT" && (options.path === "/" || options.path === void 0))) { + this.path = options.path; + } + this.res = null; + this.aborted = false; + this.reusedSocket = false; + const { headers } = options; + if (headers) { + for (const header in headers) { + this.setHeader(header, headers[header]); + } + } + if (options.auth && !("authorization" in this[kHeaders])) { + this[kHeaders].authorization = "Basic " + Buffer.from(options.auth).toString("base64"); + } + options.session = options.tlsSession; + options.path = options.socketPath; + this[kOptions] = options; + this[kOrigin] = new URL4(`${this.protocol}//${options.servername || options.host}:${options.port}`); + const reuseSocket = options._reuseSocket; + if (reuseSocket) { + options.createConnection = (...args) => { + if (reuseSocket.destroyed) { + return this.agent.createConnection(...args); + } + return reuseSocket; + }; + this.agent.getSession(this[kOrigin], this[kOptions]).catch(() => { + }); + } + if (timeout) { + this.setTimeout(timeout); + } + if (callback) { + this.once("response", callback); + } + this[kFlushedHeaders] = false; + } + get method() { + return this[kHeaders][HTTP2_HEADER_METHOD]; + } + set method(value) { + if (value) { + this[kHeaders][HTTP2_HEADER_METHOD] = value.toUpperCase(); + } + } + get path() { + const header = this.method === "CONNECT" ? HTTP2_HEADER_AUTHORITY : HTTP2_HEADER_PATH; + return this[kHeaders][header]; + } + set path(value) { + if (value) { + const header = this.method === "CONNECT" ? HTTP2_HEADER_AUTHORITY : HTTP2_HEADER_PATH; + this[kHeaders][header] = value; + } + } + get host() { + return this[kOrigin].hostname; + } + set host(_value) { + } + get _mustNotHaveABody() { + return this.method === "GET" || this.method === "HEAD" || this.method === "DELETE"; + } + _write(chunk, encoding, callback) { + if (this._mustNotHaveABody) { + callback(new Error("The GET, HEAD and DELETE methods must NOT have a body")); + return; + } + this.flushHeaders(); + const callWrite = () => this._request.write(chunk, encoding, callback); + if (this._request) { + callWrite(); + } else { + this[kJobs].push(callWrite); + } + } + _final(callback) { + this.flushHeaders(); + const callEnd = () => { + if (this._mustNotHaveABody || this.method === "CONNECT") { + callback(); + return; + } + this._request.end(callback); + }; + if (this._request) { + callEnd(); + } else { + this[kJobs].push(callEnd); + } + } + abort() { + if (this.res && this.res.complete) { + return; + } + if (!this.aborted) { + process.nextTick(() => this.emit("abort")); + } + this.aborted = true; + this.destroy(); + } + async _destroy(error2, callback) { + if (this.res) { + this.res._dump(); + } + if (this._request) { + this._request.destroy(); + } else { + process.nextTick(() => { + this.emit("close"); + }); + } + try { + await this[kPendingAgentPromise]; + } catch (internalError) { + if (this.aborted) { + error2 = internalError; + } + } + callback(error2); + } + async flushHeaders() { + if (this[kFlushedHeaders] || this.destroyed) { + return; + } + this[kFlushedHeaders] = true; + const isConnectMethod = this.method === HTTP2_METHOD_CONNECT; + const onStream = (stream2) => { + this._request = stream2; + if (this.destroyed) { + stream2.destroy(); + return; + } + if (!isConnectMethod) { + proxyEvents2(stream2, this, ["timeout", "continue"]); + } + stream2.once("error", (error2) => { + this.destroy(error2); + }); + stream2.once("aborted", () => { + const { res } = this; + if (res) { + res.aborted = true; + res.emit("aborted"); + res.destroy(); + } else { + this.destroy(new Error("The server aborted the HTTP/2 stream")); + } + }); + const onResponse = (headers, flags, rawHeaders) => { + const response = new IncomingMessage(this.socket, stream2.readableHighWaterMark); + this.res = response; + response.url = `${this[kOrigin].origin}${this.path}`; + response.req = this; + response.statusCode = headers[HTTP2_HEADER_STATUS]; + response.headers = headers; + response.rawHeaders = rawHeaders; + response.once("end", () => { + response.complete = true; + response.socket = null; + response.connection = null; + }); + if (isConnectMethod) { + response.upgrade = true; + if (this.emit("connect", response, stream2, Buffer.alloc(0))) { + this.emit("close"); + } else { + stream2.destroy(); + } + } else { + stream2.on("data", (chunk) => { + if (!response._dumped && !response.push(chunk)) { + stream2.pause(); + } + }); + stream2.once("end", () => { + if (!this.aborted) { + response.push(null); + } + }); + if (!this.emit("response", response)) { + response._dump(); + } + } + }; + stream2.once("response", onResponse); + stream2.once("headers", (headers) => this.emit("information", { statusCode: headers[HTTP2_HEADER_STATUS] })); + stream2.once("trailers", (trailers, flags, rawTrailers) => { + const { res } = this; + if (res === null) { + onResponse(trailers, flags, rawTrailers); + return; + } + res.trailers = trailers; + res.rawTrailers = rawTrailers; + }); + stream2.once("close", () => { + const { aborted, res } = this; + if (res) { + if (aborted) { + res.aborted = true; + res.emit("aborted"); + res.destroy(); + } + const finish = () => { + res.emit("close"); + this.destroy(); + this.emit("close"); + }; + if (res.readable) { + res.once("end", finish); + } else { + finish(); + } + return; + } + if (!this.destroyed) { + this.destroy(new Error("The HTTP/2 stream has been early terminated")); + this.emit("close"); + return; + } + this.destroy(); + this.emit("close"); + }); + this.socket = new Proxy(stream2, proxySocketHandler); + for (const job of this[kJobs]) { + job(); + } + this.emit("socket", this.socket); + }; + if (!(HTTP2_HEADER_AUTHORITY in this[kHeaders]) && !isConnectMethod) { + this[kHeaders][HTTP2_HEADER_AUTHORITY] = this[kOrigin].host; + } + if (this[kSession]) { + try { + onStream(this[kSession].request(this[kHeaders])); + } catch (error2) { + this.destroy(error2); + } + } else { + this.reusedSocket = true; + try { + const promise = this.agent.request(this[kOrigin], this[kOptions], this[kHeaders]); + this[kPendingAgentPromise] = promise; + onStream(await promise); + this[kPendingAgentPromise] = false; + } catch (error2) { + this[kPendingAgentPromise] = false; + this.destroy(error2); + } + } + } + get connection() { + return this.socket; + } + set connection(value) { + this.socket = value; + } + getHeaderNames() { + return Object.keys(this[kHeaders]); + } + hasHeader(name) { + if (typeof name !== "string") { + throw new ERR_INVALID_ARG_TYPE("name", "string", name); + } + return Boolean(this[kHeaders][name.toLowerCase()]); + } + getHeader(name) { + if (typeof name !== "string") { + throw new ERR_INVALID_ARG_TYPE("name", "string", name); + } + return this[kHeaders][name.toLowerCase()]; + } + get headersSent() { + return this[kFlushedHeaders]; + } + removeHeader(name) { + if (typeof name !== "string") { + throw new ERR_INVALID_ARG_TYPE("name", "string", name); + } + if (this.headersSent) { + throw new ERR_HTTP_HEADERS_SENT("remove"); + } + delete this[kHeaders][name.toLowerCase()]; + } + setHeader(name, value) { + if (this.headersSent) { + throw new ERR_HTTP_HEADERS_SENT("set"); + } + validateHeaderName(name); + validateHeaderValue(name, value); + const lowercased = name.toLowerCase(); + if (lowercased === "connection") { + if (value.toLowerCase() === "keep-alive") { + return; + } + throw new Error(`Invalid 'connection' header: ${value}`); + } + if (lowercased === "host" && this.method === "CONNECT") { + this[kHeaders][HTTP2_HEADER_AUTHORITY] = value; + } else { + this[kHeaders][lowercased] = value; + } + } + setNoDelay() { + } + setSocketKeepAlive() { + } + setTimeout(ms, callback) { + const applyTimeout = () => this._request.setTimeout(ms, callback); + if (this._request) { + applyTimeout(); + } else { + this[kJobs].push(applyTimeout); + } + return this; + } + get maxHeadersCount() { + if (!this.destroyed && this._request) { + return this._request.session.localSettings.maxHeaderListSize; + } + return void 0; + } + set maxHeadersCount(_value) { + } + }; + module2.exports = ClientRequest; + } +}); + +// node_modules/.pnpm/resolve-alpn@1.2.1/node_modules/resolve-alpn/index.js +var require_resolve_alpn = __commonJS({ + "node_modules/.pnpm/resolve-alpn@1.2.1/node_modules/resolve-alpn/index.js"(exports, module2) { + "use strict"; + var tls = require("tls"); + module2.exports = (options = {}, connect = tls.connect) => new Promise((resolve, reject) => { + let timeout = false; + let socket; + const callback = async () => { + await socketPromise; + socket.off("timeout", onTimeout); + socket.off("error", reject); + if (options.resolveSocket) { + resolve({ alpnProtocol: socket.alpnProtocol, socket, timeout }); + if (timeout) { + await Promise.resolve(); + socket.emit("timeout"); + } + } else { + socket.destroy(); + resolve({ alpnProtocol: socket.alpnProtocol, timeout }); + } + }; + const onTimeout = async () => { + timeout = true; + callback(); + }; + const socketPromise = (async () => { + try { + socket = await connect(options, callback); + socket.on("error", reject); + socket.once("timeout", onTimeout); + } catch (error2) { + reject(error2); + } + })(); + }); + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/calculate-server-name.js +var require_calculate_server_name = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/calculate-server-name.js"(exports, module2) { + "use strict"; + var { isIP } = require("net"); + var assert2 = require("assert"); + var getHost = (host) => { + if (host[0] === "[") { + const idx2 = host.indexOf("]"); + assert2(idx2 !== -1); + return host.slice(1, idx2); + } + const idx = host.indexOf(":"); + if (idx === -1) { + return host; + } + return host.slice(0, idx); + }; + module2.exports = (host) => { + const servername = getHost(host); + if (isIP(servername)) { + return ""; + } + return servername; + }; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/auto.js +var require_auto = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/auto.js"(exports, module2) { + "use strict"; + var { URL: URL4, urlToHttpOptions } = require("url"); + var http3 = require("http"); + var https2 = require("https"); + var resolveALPN = require_resolve_alpn(); + var QuickLRU = require_quick_lru(); + var { Agent, globalAgent } = require_agent(); + var Http2ClientRequest = require_client_request(); + var calculateServerName = require_calculate_server_name(); + var delayAsyncDestroy = require_delay_async_destroy(); + var cache2 = new QuickLRU({ maxSize: 100 }); + var queue = /* @__PURE__ */ new Map(); + var installSocket = (agent, socket, options) => { + socket._httpMessage = { shouldKeepAlive: true }; + const onFree = () => { + agent.emit("free", socket, options); + }; + socket.on("free", onFree); + const onClose = () => { + agent.removeSocket(socket, options); + }; + socket.on("close", onClose); + const onTimeout = () => { + const { freeSockets } = agent; + for (const sockets of Object.values(freeSockets)) { + if (sockets.includes(socket)) { + socket.destroy(); + return; + } + } + }; + socket.on("timeout", onTimeout); + const onRemove = () => { + agent.removeSocket(socket, options); + socket.off("close", onClose); + socket.off("free", onFree); + socket.off("timeout", onTimeout); + socket.off("agentRemove", onRemove); + }; + socket.on("agentRemove", onRemove); + agent.emit("free", socket, options); + }; + var createResolveProtocol = (cache3, queue2 = /* @__PURE__ */ new Map(), connect = void 0) => { + return async (options) => { + const name = `${options.host}:${options.port}:${options.ALPNProtocols.sort()}`; + if (!cache3.has(name)) { + if (queue2.has(name)) { + const result = await queue2.get(name); + return { alpnProtocol: result.alpnProtocol }; + } + const { path: path7 } = options; + options.path = options.socketPath; + const resultPromise = resolveALPN(options, connect); + queue2.set(name, resultPromise); + try { + const result = await resultPromise; + cache3.set(name, result.alpnProtocol); + queue2.delete(name); + options.path = path7; + return result; + } catch (error2) { + queue2.delete(name); + options.path = path7; + throw error2; + } + } + return { alpnProtocol: cache3.get(name) }; + }; + }; + var defaultResolveProtocol = createResolveProtocol(cache2, queue); + module2.exports = async (input, options, callback) => { + if (typeof input === "string") { + input = urlToHttpOptions(new URL4(input)); + } else if (input instanceof URL4) { + input = urlToHttpOptions(input); + } else { + input = { ...input }; + } + if (typeof options === "function" || options === void 0) { + callback = options; + options = input; + } else { + options = Object.assign(input, options); + } + options.ALPNProtocols = options.ALPNProtocols || ["h2", "http/1.1"]; + if (!Array.isArray(options.ALPNProtocols) || options.ALPNProtocols.length === 0) { + throw new Error("The `ALPNProtocols` option must be an Array with at least one entry"); + } + options.protocol = options.protocol || "https:"; + const isHttps = options.protocol === "https:"; + options.host = options.hostname || options.host || "localhost"; + options.session = options.tlsSession; + options.servername = options.servername || calculateServerName(options.headers && options.headers.host || options.host); + options.port = options.port || (isHttps ? 443 : 80); + options._defaultAgent = isHttps ? https2.globalAgent : http3.globalAgent; + const resolveProtocol = options.resolveProtocol || defaultResolveProtocol; + let { agent } = options; + if (agent !== void 0 && agent !== false && agent.constructor.name !== "Object") { + throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties"); + } + if (isHttps) { + options.resolveSocket = true; + let { socket, alpnProtocol, timeout } = await resolveProtocol(options); + if (timeout) { + if (socket) { + socket.destroy(); + } + const error2 = new Error(`Timed out resolving ALPN: ${options.timeout} ms`); + error2.code = "ETIMEDOUT"; + error2.ms = options.timeout; + throw error2; + } + if (socket && options.createConnection) { + socket.destroy(); + socket = void 0; + } + delete options.resolveSocket; + const isHttp2 = alpnProtocol === "h2"; + if (agent) { + agent = isHttp2 ? agent.http2 : agent.https; + options.agent = agent; + } + if (agent === void 0) { + agent = isHttp2 ? globalAgent : https2.globalAgent; + } + if (socket) { + if (agent === false) { + socket.destroy(); + } else { + const defaultCreateConnection = (isHttp2 ? Agent : https2.Agent).prototype.createConnection; + if (agent.createConnection === defaultCreateConnection) { + if (isHttp2) { + options._reuseSocket = socket; + } else { + installSocket(agent, socket, options); + } + } else { + socket.destroy(); + } + } + } + if (isHttp2) { + return delayAsyncDestroy(new Http2ClientRequest(options, callback)); + } + } else if (agent) { + options.agent = agent.http; + } + return delayAsyncDestroy(http3.request(options, callback)); + }; + module2.exports.protocolCache = cache2; + module2.exports.resolveProtocol = defaultResolveProtocol; + module2.exports.createResolveProtocol = createResolveProtocol; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/js-stream-socket.js +var require_js_stream_socket = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/js-stream-socket.js"(exports, module2) { + "use strict"; + var stream2 = require("stream"); + var tls = require("tls"); + var JSStreamSocket = new tls.TLSSocket(new stream2.PassThrough())._handle._parentWrap.constructor; + module2.exports = JSStreamSocket; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/unexpected-status-code-error.js +var require_unexpected_status_code_error = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/unexpected-status-code-error.js"(exports, module2) { + "use strict"; + var UnexpectedStatusCodeError = class extends Error { + constructor(statusCode) { + super(`The proxy server rejected the request with status code ${statusCode}`); + this.statusCode = statusCode; + } + }; + module2.exports = UnexpectedStatusCodeError; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/check-type.js +var require_check_type = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/utils/check-type.js"(exports, module2) { + "use strict"; + var checkType = (name, value, types2) => { + const valid = types2.some((type) => { + const typeofType = typeof type; + if (typeofType === "string") { + return typeof value === type; + } + return value instanceof type; + }); + if (!valid) { + const names = types2.map((type) => typeof type === "string" ? type : type.name); + throw new TypeError(`Expected '${name}' to be a type of ${names.join(" or ")}, got ${typeof value}`); + } + }; + module2.exports = checkType; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/initialize.js +var require_initialize = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/initialize.js"(exports, module2) { + "use strict"; + var { URL: URL4 } = require("url"); + var checkType = require_check_type(); + module2.exports = (self2, proxyOptions) => { + checkType("proxyOptions", proxyOptions, ["object"]); + checkType("proxyOptions.headers", proxyOptions.headers, ["object", "undefined"]); + checkType("proxyOptions.raw", proxyOptions.raw, ["boolean", "undefined"]); + checkType("proxyOptions.url", proxyOptions.url, [URL4, "string"]); + const url = new URL4(proxyOptions.url); + self2.proxyOptions = { + raw: true, + ...proxyOptions, + headers: { ...proxyOptions.headers }, + url + }; + }; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/get-auth-headers.js +var require_get_auth_headers = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/get-auth-headers.js"(exports, module2) { + "use strict"; + module2.exports = (self2) => { + const { username, password } = self2.proxyOptions.url; + if (username || password) { + const data = `${username}:${password}`; + const authorization = `Basic ${Buffer.from(data).toString("base64")}`; + return { + "proxy-authorization": authorization, + authorization + }; + } + return {}; + }; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/h1-over-h2.js +var require_h1_over_h2 = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/h1-over-h2.js"(exports, module2) { + "use strict"; + var tls = require("tls"); + var http3 = require("http"); + var https2 = require("https"); + var JSStreamSocket = require_js_stream_socket(); + var { globalAgent } = require_agent(); + var UnexpectedStatusCodeError = require_unexpected_status_code_error(); + var initialize = require_initialize(); + var getAuthorizationHeaders = require_get_auth_headers(); + var createConnection = (self2, options, callback) => { + (async () => { + try { + const { proxyOptions } = self2; + const { url, headers, raw } = proxyOptions; + const stream2 = await globalAgent.request(url, proxyOptions, { + ...getAuthorizationHeaders(self2), + ...headers, + ":method": "CONNECT", + ":authority": `${options.host}:${options.port}` + }); + stream2.once("error", callback); + stream2.once("response", (headers2) => { + const statusCode = headers2[":status"]; + if (statusCode !== 200) { + callback(new UnexpectedStatusCodeError(statusCode)); + return; + } + const encrypted = self2 instanceof https2.Agent; + if (raw && encrypted) { + options.socket = stream2; + const secureStream = tls.connect(options); + secureStream.once("close", () => { + stream2.destroy(); + }); + callback(null, secureStream); + return; + } + const socket = new JSStreamSocket(stream2); + socket.encrypted = false; + socket._handle.getpeername = (out) => { + out.family = void 0; + out.address = void 0; + out.port = void 0; + }; + callback(null, socket); + }); + } catch (error2) { + callback(error2); + } + })(); + }; + var HttpOverHttp2 = class extends http3.Agent { + constructor(options) { + super(options); + initialize(this, options.proxyOptions); + } + createConnection(options, callback) { + createConnection(this, options, callback); + } + }; + var HttpsOverHttp2 = class extends https2.Agent { + constructor(options) { + super(options); + initialize(this, options.proxyOptions); + } + createConnection(options, callback) { + createConnection(this, options, callback); + } + }; + module2.exports = { + HttpOverHttp2, + HttpsOverHttp2 + }; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/h2-over-hx.js +var require_h2_over_hx = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/h2-over-hx.js"(exports, module2) { + "use strict"; + var { Agent } = require_agent(); + var JSStreamSocket = require_js_stream_socket(); + var UnexpectedStatusCodeError = require_unexpected_status_code_error(); + var initialize = require_initialize(); + var Http2OverHttpX = class extends Agent { + constructor(options) { + super(options); + initialize(this, options.proxyOptions); + } + async createConnection(origin, options) { + const authority = `${origin.hostname}:${origin.port || 443}`; + const [stream2, statusCode] = await this._getProxyStream(authority); + if (statusCode !== 200) { + throw new UnexpectedStatusCodeError(statusCode); + } + if (this.proxyOptions.raw) { + options.socket = stream2; + } else { + const socket = new JSStreamSocket(stream2); + socket.encrypted = false; + socket._handle.getpeername = (out) => { + out.family = void 0; + out.address = void 0; + out.port = void 0; + }; + return socket; + } + return super.createConnection(origin, options); + } + }; + module2.exports = Http2OverHttpX; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/h2-over-h2.js +var require_h2_over_h2 = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/h2-over-h2.js"(exports, module2) { + "use strict"; + var { globalAgent } = require_agent(); + var Http2OverHttpX = require_h2_over_hx(); + var getAuthorizationHeaders = require_get_auth_headers(); + var getStatusCode = (stream2) => new Promise((resolve, reject) => { + stream2.once("error", reject); + stream2.once("response", (headers) => { + stream2.off("error", reject); + resolve(headers[":status"]); + }); + }); + var Http2OverHttp2 = class extends Http2OverHttpX { + async _getProxyStream(authority) { + const { proxyOptions } = this; + const headers = { + ...getAuthorizationHeaders(this), + ...proxyOptions.headers, + ":method": "CONNECT", + ":authority": authority + }; + const stream2 = await globalAgent.request(proxyOptions.url, proxyOptions, headers); + const statusCode = await getStatusCode(stream2); + return [stream2, statusCode]; + } + }; + module2.exports = Http2OverHttp2; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/h2-over-h1.js +var require_h2_over_h1 = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/proxies/h2-over-h1.js"(exports, module2) { + "use strict"; + var http3 = require("http"); + var https2 = require("https"); + var Http2OverHttpX = require_h2_over_hx(); + var getAuthorizationHeaders = require_get_auth_headers(); + var getStream2 = (request) => new Promise((resolve, reject) => { + const onConnect = (response, socket, head) => { + socket.unshift(head); + request.off("error", reject); + resolve([socket, response.statusCode]); + }; + request.once("error", reject); + request.once("connect", onConnect); + }); + var Http2OverHttp = class extends Http2OverHttpX { + async _getProxyStream(authority) { + const { proxyOptions } = this; + const { url, headers } = this.proxyOptions; + const network = url.protocol === "https:" ? https2 : http3; + const request = network.request({ + ...proxyOptions, + hostname: url.hostname, + port: url.port, + path: authority, + headers: { + ...getAuthorizationHeaders(this), + ...headers, + host: authority + }, + method: "CONNECT" + }).end(); + return getStream2(request); + } + }; + module2.exports = { + Http2OverHttp, + Http2OverHttps: Http2OverHttp + }; + } +}); + +// node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/index.js +var require_source2 = __commonJS({ + "node_modules/.pnpm/http2-wrapper@2.1.11/node_modules/http2-wrapper/source/index.js"(exports, module2) { + "use strict"; + var http22 = require("http2"); + var { + Agent, + globalAgent + } = require_agent(); + var ClientRequest = require_client_request(); + var IncomingMessage = require_incoming_message(); + var auto = require_auto(); + var { + HttpOverHttp2, + HttpsOverHttp2 + } = require_h1_over_h2(); + var Http2OverHttp2 = require_h2_over_h2(); + var { + Http2OverHttp, + Http2OverHttps + } = require_h2_over_h1(); + var validateHeaderName = require_validate_header_name(); + var validateHeaderValue = require_validate_header_value(); + var request = (url, options, callback) => new ClientRequest(url, options, callback); + var get = (url, options, callback) => { + const req = new ClientRequest(url, options, callback); + req.end(); + return req; + }; + module2.exports = { + ...http22, + ClientRequest, + IncomingMessage, + Agent, + globalAgent, + request, + get, + auto, + proxies: { + HttpOverHttp2, + HttpsOverHttp2, + Http2OverHttp2, + Http2OverHttp, + Http2OverHttps + }, + validateHeaderName, + validateHeaderValue + }; + } +}); + // node_modules/.pnpm/@actions+tool-cache@1.7.2/node_modules/@actions/tool-cache/lib/manifest.js var require_manifest = __commonJS({ "node_modules/.pnpm/@actions+tool-cache@1.7.2/node_modules/@actions/tool-cache/lib/manifest.js"(exports, module2) { @@ -67053,12 +69901,12 @@ var require_manifest = __commonJS({ exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0; var semver5 = __importStar(require_semver()); var core_1 = require_core(); - var os3 = require("os"); + var os4 = require("os"); var cp = require("child_process"); var fs4 = require("fs"); function _findMatch(versionSpec, stable, candidates, archFilter) { return __awaiter(this, void 0, void 0, function* () { - const platFilter = os3.platform(); + const platFilter = os4.platform(); let result; let match; let file; @@ -67095,7 +69943,7 @@ var require_manifest = __commonJS({ } exports._findMatch = _findMatch; function _getOsVersion() { - const plat = os3.platform(); + const plat = os4.platform(); let version = ""; if (plat === "darwin") { version = cp.execSync("sw_vers -productVersion").toString(); @@ -67189,8 +70037,8 @@ var require_http_client = __commonJS({ "node_modules/.pnpm/@actions+http-client@1.0.11/node_modules/@actions/http-client/index.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - var http = require("http"); - var https = require("https"); + var http3 = require("http"); + var https2 = require("https"); var pm = require_proxy2(); var tunnel; var HttpCodes; @@ -67342,8 +70190,8 @@ var require_http_client = __commonJS({ head(requestUrl, additionalHeaders) { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return this.request(verb, requestUrl, stream, additionalHeaders); + sendStream(verb, requestUrl, stream2, additionalHeaders) { + return this.request(verb, requestUrl, stream2, additionalHeaders); } async getJson(requestUrl, additionalHeaders = {}) { additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); @@ -67494,7 +70342,7 @@ var require_http_client = __commonJS({ const info8 = {}; info8.parsedUrl = requestUrl; const usingSsl = info8.parsedUrl.protocol === "https:"; - info8.httpModule = usingSsl ? https : http; + info8.httpModule = usingSsl ? https2 : http3; const defaultPort = usingSsl ? 443 : 80; info8.options = {}; info8.options.host = info8.parsedUrl.hostname; @@ -67514,17 +70362,17 @@ var require_http_client = __commonJS({ return info8; } _mergeHeaders(headers) { - const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + const lowercaseKeys2 = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); + return Object.assign({}, lowercaseKeys2(this.requestOptions.headers), lowercaseKeys2(headers)); } - return lowercaseKeys(headers || {}); + return lowercaseKeys2(headers || {}); } _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + const lowercaseKeys2 = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + clientHeader = lowercaseKeys2(this.requestOptions.headers)[header]; } return additionalHeaders[header] || clientHeader || _default; } @@ -67544,7 +70392,7 @@ var require_http_client = __commonJS({ const usingSsl = parsedUrl.protocol === "https:"; let maxSockets = 100; if (!!this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + maxSockets = this.requestOptions.maxSockets || http3.globalAgent.maxSockets; } if (useProxy) { if (!tunnel) { @@ -67573,11 +70421,11 @@ var require_http_client = __commonJS({ } if (this._keepAlive && !agent) { const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + agent = usingSsl ? new https2.Agent(options) : new http3.Agent(options); this._agent = agent; } if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; + agent = usingSsl ? https2.globalAgent : http3.globalAgent; } if (usingSsl && this._ignoreSslError) { agent.options = Object.assign(agent.options || {}, { @@ -67823,24 +70671,24 @@ var require_tool_cache = __commonJS({ var io = __importStar(require_io()); var fs4 = __importStar(require("fs")); var mm = __importStar(require_manifest()); - var os3 = __importStar(require("os")); + var os4 = __importStar(require("os")); var path7 = __importStar(require("path")); var httpm2 = __importStar(require_http_client()); var semver5 = __importStar(require_semver()); - var stream = __importStar(require("stream")); + var stream2 = __importStar(require("stream")); var util = __importStar(require("util")); var v4_1 = __importDefault(require_v42()); var exec_1 = require_exec(); var assert_1 = require("assert"); var retry_helper_1 = require_retry_helper(); - var HTTPError = class extends Error { + var HTTPError2 = class extends Error { constructor(httpStatusCode) { super(`Unexpected HTTP response: ${httpStatusCode}`); this.httpStatusCode = httpStatusCode; Object.setPrototypeOf(this, new.target.prototype); } }; - exports.HTTPError = HTTPError; + exports.HTTPError = HTTPError2; var IS_WINDOWS2 = process.platform === "win32"; var IS_MAC2 = process.platform === "darwin"; var userAgent = "actions/tool-cache"; @@ -67857,7 +70705,7 @@ var require_tool_cache = __commonJS({ return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () { return yield downloadToolAttempt(url, dest || "", auth, headers); }), (err) => { - if (err instanceof HTTPError && err.httpStatusCode) { + if (err instanceof HTTPError2 && err.httpStatusCode) { if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { return false; } @@ -67872,7 +70720,7 @@ var require_tool_cache = __commonJS({ if (fs4.existsSync(dest)) { throw new Error(`Destination file path ${dest} already exists`); } - const http = new httpm2.HttpClient(userAgent, [], { + const http3 = new httpm2.HttpClient(userAgent, [], { allowRetries: false }); if (auth) { @@ -67882,13 +70730,13 @@ var require_tool_cache = __commonJS({ } headers.authorization = auth; } - const response = yield http.get(url, headers); + const response = yield http3.get(url, headers); if (response.message.statusCode !== 200) { - const err = new HTTPError(response.message.statusCode); + const err = new HTTPError2(response.message.statusCode); core8.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw err; } - const pipeline = util.promisify(stream.pipeline); + const pipeline = util.promisify(stream2.pipeline); const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); const readStream = responseMessageFactory(); let succeeded = false; @@ -68102,7 +70950,7 @@ var require_tool_cache = __commonJS({ function cacheDir2(sourceDir, tool, version, arch2) { return __awaiter(this, void 0, void 0, function* () { version = semver5.clean(version) || version; - arch2 = arch2 || os3.arch(); + arch2 = arch2 || os4.arch(); core8.debug(`Caching tool ${tool} ${version} ${arch2}`); core8.debug(`source dir: ${sourceDir}`); if (!fs4.statSync(sourceDir).isDirectory()) { @@ -68121,7 +70969,7 @@ var require_tool_cache = __commonJS({ function cacheFile(sourceFile, targetFile, tool, version, arch2) { return __awaiter(this, void 0, void 0, function* () { version = semver5.clean(version) || version; - arch2 = arch2 || os3.arch(); + arch2 = arch2 || os4.arch(); core8.debug(`Caching tool ${tool} ${version} ${arch2}`); core8.debug(`source file: ${sourceFile}`); if (!fs4.statSync(sourceFile).isFile()) { @@ -68143,7 +70991,7 @@ var require_tool_cache = __commonJS({ if (!versionSpec) { throw new Error("versionSpec parameter is required"); } - arch2 = arch2 || os3.arch(); + arch2 = arch2 || os4.arch(); if (!isExplicitVersion(versionSpec)) { const localVersions = findAllVersions(toolName, arch2); const match = evaluateVersions(localVersions, versionSpec); @@ -68166,7 +71014,7 @@ var require_tool_cache = __commonJS({ exports.find = find3; function findAllVersions(toolName, arch2) { const versions = []; - arch2 = arch2 || os3.arch(); + arch2 = arch2 || os4.arch(); const toolPath = path7.join(_getCacheDirectory(), toolName); if (fs4.existsSync(toolPath)) { const children2 = fs4.readdirSync(toolPath); @@ -68186,13 +71034,13 @@ var require_tool_cache = __commonJS({ return __awaiter(this, void 0, void 0, function* () { let releases = []; const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm2.HttpClient("tool-cache"); + const http3 = new httpm2.HttpClient("tool-cache"); const headers = {}; if (auth) { core8.debug("set auth"); headers.authorization = auth; } - const response = yield http.getJson(treeUrl, headers); + const response = yield http3.getJson(treeUrl, headers); if (!response.result) { return releases; } @@ -68204,7 +71052,7 @@ var require_tool_cache = __commonJS({ } } headers["accept"] = "application/vnd.github.VERSION.raw"; - let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody(); + let versionsRaw = yield (yield http3.get(manifestUrl, headers)).readBody(); if (versionsRaw) { versionsRaw = versionsRaw.replace(/^\uFEFF/, ""); try { @@ -68217,7 +71065,7 @@ var require_tool_cache = __commonJS({ }); } exports.getManifestFromRepo = getManifestFromRepo2; - function findFromManifest2(versionSpec, stable, manifest, archFilter = os3.arch()) { + function findFromManifest2(versionSpec, stable, manifest, archFilter = os4.arch()) { return __awaiter(this, void 0, void 0, function* () { const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); return match; @@ -68304,13 +71152,12 @@ var require_tool_cache = __commonJS({ }); // src/setup-pdm.ts -var os2 = __toESM(require("os")); -var import_fs3 = require("fs"); +var os3 = __toESM(require("os")); var import_path = __toESM(require("path")); var core7 = __toESM(require_core()); var exec6 = __toESM(require_exec()); -// node_modules/.pnpm/github.com+actions+setup-python@13ae5bb136fac2878aff31522b9efb785519f984/node_modules/setup-python/src/utils.ts +// node_modules/.pnpm/github.com+actions+setup-python@8bcd2560e267a43fbd8ff66c50da8a61825a0782/node_modules/setup-python/src/utils.ts var cache = __toESM(require_cache()); var core = __toESM(require_core()); var import_fs = __toESM(require("fs")); @@ -68362,17 +71209,4596 @@ function validatePythonVersionFormatForPyPy(version) { // src/setup-pdm.ts var import_parse = __toESM(require_parse2()); -var import_intersects = __toESM(require_intersects()); // src/utils.ts var core6 = __toESM(require_core()); -// node_modules/.pnpm/github.com+actions+setup-python@13ae5bb136fac2878aff31522b9efb785519f984/node_modules/setup-python/src/find-python.ts -var os = __toESM(require("os")); +// node_modules/.pnpm/@sindresorhus+is@5.3.0/node_modules/@sindresorhus/is/dist/index.js +var typedArrayTypeNames = [ + "Int8Array", + "Uint8Array", + "Uint8ClampedArray", + "Int16Array", + "Uint16Array", + "Int32Array", + "Uint32Array", + "Float32Array", + "Float64Array", + "BigInt64Array", + "BigUint64Array" +]; +function isTypedArrayName(name) { + return typedArrayTypeNames.includes(name); +} +var objectTypeNames = [ + "Function", + "Generator", + "AsyncGenerator", + "GeneratorFunction", + "AsyncGeneratorFunction", + "AsyncFunction", + "Observable", + "Array", + "Buffer", + "Blob", + "Object", + "RegExp", + "Date", + "Error", + "Map", + "Set", + "WeakMap", + "WeakSet", + "WeakRef", + "ArrayBuffer", + "SharedArrayBuffer", + "DataView", + "Promise", + "URL", + "FormData", + "URLSearchParams", + "HTMLElement", + "NaN", + ...typedArrayTypeNames +]; +function isObjectTypeName(name) { + return objectTypeNames.includes(name); +} +var primitiveTypeNames = [ + "null", + "undefined", + "string", + "number", + "bigint", + "boolean", + "symbol" +]; +function isPrimitiveTypeName(name) { + return primitiveTypeNames.includes(name); +} +function isOfType(type) { + return (value) => typeof value === type; +} +var { toString: toString2 } = Object.prototype; +var getObjectType = (value) => { + const objectTypeName = toString2.call(value).slice(8, -1); + if (/HTML\w+Element/.test(objectTypeName) && is.domElement(value)) { + return "HTMLElement"; + } + if (isObjectTypeName(objectTypeName)) { + return objectTypeName; + } + return void 0; +}; +var isObjectOfType = (type) => (value) => getObjectType(value) === type; +function is(value) { + if (value === null) { + return "null"; + } + switch (typeof value) { + case "undefined": + return "undefined"; + case "string": + return "string"; + case "number": + return Number.isNaN(value) ? "NaN" : "number"; + case "boolean": + return "boolean"; + case "function": + return "Function"; + case "bigint": + return "bigint"; + case "symbol": + return "symbol"; + default: + } + if (is.observable(value)) { + return "Observable"; + } + if (is.array(value)) { + return "Array"; + } + if (is.buffer(value)) { + return "Buffer"; + } + const tagType = getObjectType(value); + if (tagType) { + return tagType; + } + if (value instanceof String || value instanceof Boolean || value instanceof Number) { + throw new TypeError("Please don't use object wrappers for primitive types"); + } + return "Object"; +} +is.undefined = isOfType("undefined"); +is.string = isOfType("string"); +var isNumberType = isOfType("number"); +is.number = (value) => isNumberType(value) && !is.nan(value); +is.bigint = isOfType("bigint"); +is.function_ = isOfType("function"); +is.null_ = (value) => value === null; +is.class_ = (value) => is.function_(value) && value.toString().startsWith("class "); +is.boolean = (value) => value === true || value === false; +is.symbol = isOfType("symbol"); +is.numericString = (value) => is.string(value) && !is.emptyStringOrWhitespace(value) && !Number.isNaN(Number(value)); +is.array = (value, assertion) => { + if (!Array.isArray(value)) { + return false; + } + if (!is.function_(assertion)) { + return true; + } + return value.every((element) => assertion(element)); +}; +is.buffer = (value) => value?.constructor?.isBuffer?.(value) ?? false; +is.blob = (value) => isObjectOfType("Blob")(value); +is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); +is.object = (value) => !is.null_(value) && (typeof value === "object" || is.function_(value)); +is.iterable = (value) => is.function_(value?.[Symbol.iterator]); +is.asyncIterable = (value) => is.function_(value?.[Symbol.asyncIterator]); +is.generator = (value) => is.iterable(value) && is.function_(value?.next) && is.function_(value?.throw); +is.asyncGenerator = (value) => is.asyncIterable(value) && is.function_(value.next) && is.function_(value.throw); +is.nativePromise = (value) => isObjectOfType("Promise")(value); +var hasPromiseApi = (value) => is.function_(value?.then) && is.function_(value?.catch); +is.promise = (value) => is.nativePromise(value) || hasPromiseApi(value); +is.generatorFunction = isObjectOfType("GeneratorFunction"); +is.asyncGeneratorFunction = (value) => getObjectType(value) === "AsyncGeneratorFunction"; +is.asyncFunction = (value) => getObjectType(value) === "AsyncFunction"; +is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty("prototype"); +is.regExp = isObjectOfType("RegExp"); +is.date = isObjectOfType("Date"); +is.error = isObjectOfType("Error"); +is.map = (value) => isObjectOfType("Map")(value); +is.set = (value) => isObjectOfType("Set")(value); +is.weakMap = (value) => isObjectOfType("WeakMap")(value); +is.weakSet = (value) => isObjectOfType("WeakSet")(value); +is.weakRef = (value) => isObjectOfType("WeakRef")(value); +is.int8Array = isObjectOfType("Int8Array"); +is.uint8Array = isObjectOfType("Uint8Array"); +is.uint8ClampedArray = isObjectOfType("Uint8ClampedArray"); +is.int16Array = isObjectOfType("Int16Array"); +is.uint16Array = isObjectOfType("Uint16Array"); +is.int32Array = isObjectOfType("Int32Array"); +is.uint32Array = isObjectOfType("Uint32Array"); +is.float32Array = isObjectOfType("Float32Array"); +is.float64Array = isObjectOfType("Float64Array"); +is.bigInt64Array = isObjectOfType("BigInt64Array"); +is.bigUint64Array = isObjectOfType("BigUint64Array"); +is.arrayBuffer = isObjectOfType("ArrayBuffer"); +is.sharedArrayBuffer = isObjectOfType("SharedArrayBuffer"); +is.dataView = isObjectOfType("DataView"); +is.enumCase = (value, targetEnum) => Object.values(targetEnum).includes(value); +is.directInstanceOf = (instance, class_) => Object.getPrototypeOf(instance) === class_.prototype; +is.urlInstance = (value) => isObjectOfType("URL")(value); +is.urlString = (value) => { + if (!is.string(value)) { + return false; + } + try { + new URL(value); + return true; + } catch { + return false; + } +}; +is.truthy = (value) => Boolean(value); +is.falsy = (value) => !value; +is.nan = (value) => Number.isNaN(value); +is.primitive = (value) => is.null_(value) || isPrimitiveTypeName(typeof value); +is.integer = (value) => Number.isInteger(value); +is.safeInteger = (value) => Number.isSafeInteger(value); +is.plainObject = (value) => { + if (typeof value !== "object" || value === null) { + return false; + } + const prototype = Object.getPrototypeOf(value); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value); +}; +is.typedArray = (value) => isTypedArrayName(getObjectType(value)); +var isValidLength = (value) => is.safeInteger(value) && value >= 0; +is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length); +is.inRange = (value, range) => { + if (is.number(range)) { + return value >= Math.min(0, range) && value <= Math.max(range, 0); + } + if (is.array(range) && range.length === 2) { + return value >= Math.min(...range) && value <= Math.max(...range); + } + throw new TypeError(`Invalid range: ${JSON.stringify(range)}`); +}; +var NODE_TYPE_ELEMENT = 1; +var DOM_PROPERTIES_TO_CHECK = [ + "innerHTML", + "ownerDocument", + "style", + "attributes", + "nodeValue" +]; +is.domElement = (value) => is.object(value) && value.nodeType === NODE_TYPE_ELEMENT && is.string(value.nodeName) && !is.plainObject(value) && DOM_PROPERTIES_TO_CHECK.every((property) => property in value); +is.observable = (value) => { + if (!value) { + return false; + } + if (value === value[Symbol.observable]?.()) { + return true; + } + if (value === value["@@observable"]?.()) { + return true; + } + return false; +}; +is.nodeStream = (value) => is.object(value) && is.function_(value.pipe) && !is.observable(value); +is.infinite = (value) => value === Number.POSITIVE_INFINITY || value === Number.NEGATIVE_INFINITY; +var isAbsoluteMod2 = (remainder) => (value) => is.integer(value) && Math.abs(value % 2) === remainder; +is.evenInteger = isAbsoluteMod2(0); +is.oddInteger = isAbsoluteMod2(1); +is.emptyArray = (value) => is.array(value) && value.length === 0; +is.nonEmptyArray = (value) => is.array(value) && value.length > 0; +is.emptyString = (value) => is.string(value) && value.length === 0; +var isWhiteSpaceString = (value) => is.string(value) && !/\S/.test(value); +is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value); +is.nonEmptyString = (value) => is.string(value) && value.length > 0; +is.nonEmptyStringAndNotWhitespace = (value) => is.string(value) && !is.emptyStringOrWhitespace(value); +is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0; +is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0; +is.emptySet = (value) => is.set(value) && value.size === 0; +is.nonEmptySet = (value) => is.set(value) && value.size > 0; +is.emptyMap = (value) => is.map(value) && value.size === 0; +is.nonEmptyMap = (value) => is.map(value) && value.size > 0; +is.propertyKey = (value) => is.any([is.string, is.number, is.symbol], value); +is.formData = (value) => isObjectOfType("FormData")(value); +is.urlSearchParams = (value) => isObjectOfType("URLSearchParams")(value); +var predicateOnArray = (method, predicate, values) => { + if (!is.function_(predicate)) { + throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); + } + if (values.length === 0) { + throw new TypeError("Invalid number of values"); + } + return method.call(values, predicate); +}; +is.any = (predicate, ...values) => { + const predicates = is.array(predicate) ? predicate : [predicate]; + return predicates.some((singlePredicate) => predicateOnArray(Array.prototype.some, singlePredicate, values)); +}; +is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); +var assertType = (condition, description, value, options = {}) => { + if (!condition) { + const { multipleValues } = options; + const valuesMessage = multipleValues ? `received values of types ${[ + ...new Set(value.map((singleValue) => `\`${is(singleValue)}\``)) + ].join(", ")}` : `received value of type \`${is(value)}\``; + throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`); + } +}; +var assert = { + undefined: (value) => assertType(is.undefined(value), "undefined", value), + string: (value) => assertType(is.string(value), "string", value), + number: (value) => assertType(is.number(value), "number", value), + bigint: (value) => assertType(is.bigint(value), "bigint", value), + function_: (value) => assertType(is.function_(value), "Function", value), + null_: (value) => assertType(is.null_(value), "null", value), + class_: (value) => assertType(is.class_(value), "Class", value), + boolean: (value) => assertType(is.boolean(value), "boolean", value), + symbol: (value) => assertType(is.symbol(value), "symbol", value), + numericString: (value) => assertType(is.numericString(value), "string with a number", value), + array: (value, assertion) => { + const assert2 = assertType; + assert2(is.array(value), "Array", value); + if (assertion) { + value.forEach(assertion); + } + }, + buffer: (value) => assertType(is.buffer(value), "Buffer", value), + blob: (value) => assertType(is.blob(value), "Blob", value), + nullOrUndefined: (value) => assertType(is.nullOrUndefined(value), "null or undefined", value), + object: (value) => assertType(is.object(value), "Object", value), + iterable: (value) => assertType(is.iterable(value), "Iterable", value), + asyncIterable: (value) => assertType(is.asyncIterable(value), "AsyncIterable", value), + generator: (value) => assertType(is.generator(value), "Generator", value), + asyncGenerator: (value) => assertType(is.asyncGenerator(value), "AsyncGenerator", value), + nativePromise: (value) => assertType(is.nativePromise(value), "native Promise", value), + promise: (value) => assertType(is.promise(value), "Promise", value), + generatorFunction: (value) => assertType(is.generatorFunction(value), "GeneratorFunction", value), + asyncGeneratorFunction: (value) => assertType(is.asyncGeneratorFunction(value), "AsyncGeneratorFunction", value), + asyncFunction: (value) => assertType(is.asyncFunction(value), "AsyncFunction", value), + boundFunction: (value) => assertType(is.boundFunction(value), "Function", value), + regExp: (value) => assertType(is.regExp(value), "RegExp", value), + date: (value) => assertType(is.date(value), "Date", value), + error: (value) => assertType(is.error(value), "Error", value), + map: (value) => assertType(is.map(value), "Map", value), + set: (value) => assertType(is.set(value), "Set", value), + weakMap: (value) => assertType(is.weakMap(value), "WeakMap", value), + weakSet: (value) => assertType(is.weakSet(value), "WeakSet", value), + weakRef: (value) => assertType(is.weakRef(value), "WeakRef", value), + int8Array: (value) => assertType(is.int8Array(value), "Int8Array", value), + uint8Array: (value) => assertType(is.uint8Array(value), "Uint8Array", value), + uint8ClampedArray: (value) => assertType(is.uint8ClampedArray(value), "Uint8ClampedArray", value), + int16Array: (value) => assertType(is.int16Array(value), "Int16Array", value), + uint16Array: (value) => assertType(is.uint16Array(value), "Uint16Array", value), + int32Array: (value) => assertType(is.int32Array(value), "Int32Array", value), + uint32Array: (value) => assertType(is.uint32Array(value), "Uint32Array", value), + float32Array: (value) => assertType(is.float32Array(value), "Float32Array", value), + float64Array: (value) => assertType(is.float64Array(value), "Float64Array", value), + bigInt64Array: (value) => assertType(is.bigInt64Array(value), "BigInt64Array", value), + bigUint64Array: (value) => assertType(is.bigUint64Array(value), "BigUint64Array", value), + arrayBuffer: (value) => assertType(is.arrayBuffer(value), "ArrayBuffer", value), + sharedArrayBuffer: (value) => assertType(is.sharedArrayBuffer(value), "SharedArrayBuffer", value), + dataView: (value) => assertType(is.dataView(value), "DataView", value), + enumCase: (value, targetEnum) => assertType(is.enumCase(value, targetEnum), "EnumCase", value), + urlInstance: (value) => assertType(is.urlInstance(value), "URL", value), + urlString: (value) => assertType(is.urlString(value), "string with a URL", value), + truthy: (value) => assertType(is.truthy(value), "truthy", value), + falsy: (value) => assertType(is.falsy(value), "falsy", value), + nan: (value) => assertType(is.nan(value), "NaN", value), + primitive: (value) => assertType(is.primitive(value), "primitive", value), + integer: (value) => assertType(is.integer(value), "integer", value), + safeInteger: (value) => assertType(is.safeInteger(value), "integer", value), + plainObject: (value) => assertType(is.plainObject(value), "plain object", value), + typedArray: (value) => assertType(is.typedArray(value), "TypedArray", value), + arrayLike: (value) => assertType(is.arrayLike(value), "array-like", value), + domElement: (value) => assertType(is.domElement(value), "HTMLElement", value), + observable: (value) => assertType(is.observable(value), "Observable", value), + nodeStream: (value) => assertType(is.nodeStream(value), "Node.js Stream", value), + infinite: (value) => assertType(is.infinite(value), "infinite number", value), + emptyArray: (value) => assertType(is.emptyArray(value), "empty array", value), + nonEmptyArray: (value) => assertType(is.nonEmptyArray(value), "non-empty array", value), + emptyString: (value) => assertType(is.emptyString(value), "empty string", value), + emptyStringOrWhitespace: (value) => assertType(is.emptyStringOrWhitespace(value), "empty string or whitespace", value), + nonEmptyString: (value) => assertType(is.nonEmptyString(value), "non-empty string", value), + nonEmptyStringAndNotWhitespace: (value) => assertType(is.nonEmptyStringAndNotWhitespace(value), "non-empty string and not whitespace", value), + emptyObject: (value) => assertType(is.emptyObject(value), "empty object", value), + nonEmptyObject: (value) => assertType(is.nonEmptyObject(value), "non-empty object", value), + emptySet: (value) => assertType(is.emptySet(value), "empty set", value), + nonEmptySet: (value) => assertType(is.nonEmptySet(value), "non-empty set", value), + emptyMap: (value) => assertType(is.emptyMap(value), "empty map", value), + nonEmptyMap: (value) => assertType(is.nonEmptyMap(value), "non-empty map", value), + propertyKey: (value) => assertType(is.propertyKey(value), "PropertyKey", value), + formData: (value) => assertType(is.formData(value), "FormData", value), + urlSearchParams: (value) => assertType(is.urlSearchParams(value), "URLSearchParams", value), + evenInteger: (value) => assertType(is.evenInteger(value), "even integer", value), + oddInteger: (value) => assertType(is.oddInteger(value), "odd integer", value), + directInstanceOf: (instance, class_) => assertType(is.directInstanceOf(instance, class_), "T", instance), + inRange: (value, range) => assertType(is.inRange(value, range), "in range", value), + any: (predicate, ...values) => assertType(is.any(predicate, ...values), "predicate returns truthy for any value", values, { multipleValues: true }), + all: (predicate, ...values) => assertType(is.all(predicate, ...values), "predicate returns truthy for all values", values, { multipleValues: true }) +}; +Object.defineProperties(is, { + class: { + value: is.class_ + }, + function: { + value: is.function_ + }, + null: { + value: is.null_ + } +}); +Object.defineProperties(assert, { + class: { + value: assert.class_ + }, + function: { + value: assert.function_ + }, + null: { + value: assert.null_ + } +}); +var dist_default = is; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/as-promise/index.js +var import_node_events2 = require("node:events"); + +// node_modules/.pnpm/p-cancelable@3.0.0/node_modules/p-cancelable/index.js +var CancelError = class extends Error { + constructor(reason) { + super(reason || "Promise was canceled"); + this.name = "CancelError"; + } + get isCanceled() { + return true; + } +}; +var PCancelable = class { + static fn(userFunction) { + return (...arguments_) => { + return new PCancelable((resolve, reject, onCancel) => { + arguments_.push(onCancel); + userFunction(...arguments_).then(resolve, reject); + }); + }; + } + constructor(executor) { + this._cancelHandlers = []; + this._isPending = true; + this._isCanceled = false; + this._rejectOnCancel = true; + this._promise = new Promise((resolve, reject) => { + this._reject = reject; + const onResolve = (value) => { + if (!this._isCanceled || !onCancel.shouldReject) { + this._isPending = false; + resolve(value); + } + }; + const onReject = (error2) => { + this._isPending = false; + reject(error2); + }; + const onCancel = (handler) => { + if (!this._isPending) { + throw new Error("The `onCancel` handler was attached after the promise settled."); + } + this._cancelHandlers.push(handler); + }; + Object.defineProperties(onCancel, { + shouldReject: { + get: () => this._rejectOnCancel, + set: (boolean) => { + this._rejectOnCancel = boolean; + } + } + }); + executor(onResolve, onReject, onCancel); + }); + } + then(onFulfilled, onRejected) { + return this._promise.then(onFulfilled, onRejected); + } + catch(onRejected) { + return this._promise.catch(onRejected); + } + finally(onFinally) { + return this._promise.finally(onFinally); + } + cancel(reason) { + if (!this._isPending || this._isCanceled) { + return; + } + this._isCanceled = true; + if (this._cancelHandlers.length > 0) { + try { + for (const handler of this._cancelHandlers) { + handler(); + } + } catch (error2) { + this._reject(error2); + return; + } + } + if (this._rejectOnCancel) { + this._reject(new CancelError(reason)); + } + } + get isCanceled() { + return this._isCanceled; + } +}; +Object.setPrototypeOf(PCancelable.prototype, Promise.prototype); + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/errors.js +function isRequest(x) { + return dist_default.object(x) && "_onResponse" in x; +} +var RequestError = class extends Error { + constructor(message, error2, self2) { + super(message); + Object.defineProperty(this, "input", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "code", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "stack", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "response", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "request", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "timings", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Error.captureStackTrace(this, this.constructor); + this.name = "RequestError"; + this.code = error2.code ?? "ERR_GOT_REQUEST_ERROR"; + this.input = error2.input; + if (isRequest(self2)) { + Object.defineProperty(this, "request", { + enumerable: false, + value: self2 + }); + Object.defineProperty(this, "response", { + enumerable: false, + value: self2.response + }); + this.options = self2.options; + } else { + this.options = self2; + } + this.timings = this.request?.timings; + if (dist_default.string(error2.stack) && dist_default.string(this.stack)) { + const indexOfMessage = this.stack.indexOf(this.message) + this.message.length; + const thisStackTrace = this.stack.slice(indexOfMessage).split("\n").reverse(); + const errorStackTrace = error2.stack.slice(error2.stack.indexOf(error2.message) + error2.message.length).split("\n").reverse(); + while (errorStackTrace.length > 0 && errorStackTrace[0] === thisStackTrace[0]) { + thisStackTrace.shift(); + } + this.stack = `${this.stack.slice(0, indexOfMessage)}${thisStackTrace.reverse().join("\n")}${errorStackTrace.reverse().join("\n")}`; + } + } +}; +var MaxRedirectsError = class extends RequestError { + constructor(request) { + super(`Redirected ${request.options.maxRedirects} times. Aborting.`, {}, request); + this.name = "MaxRedirectsError"; + this.code = "ERR_TOO_MANY_REDIRECTS"; + } +}; +var HTTPError = class extends RequestError { + constructor(response) { + super(`Response code ${response.statusCode} (${response.statusMessage})`, {}, response.request); + this.name = "HTTPError"; + this.code = "ERR_NON_2XX_3XX_RESPONSE"; + } +}; +var CacheError = class extends RequestError { + constructor(error2, request) { + super(error2.message, error2, request); + this.name = "CacheError"; + this.code = this.code === "ERR_GOT_REQUEST_ERROR" ? "ERR_CACHE_ACCESS" : this.code; + } +}; +var UploadError = class extends RequestError { + constructor(error2, request) { + super(error2.message, error2, request); + this.name = "UploadError"; + this.code = this.code === "ERR_GOT_REQUEST_ERROR" ? "ERR_UPLOAD" : this.code; + } +}; +var TimeoutError = class extends RequestError { + constructor(error2, timings, request) { + super(error2.message, error2, request); + Object.defineProperty(this, "timings", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "event", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + this.name = "TimeoutError"; + this.event = error2.event; + this.timings = timings; + } +}; +var ReadError = class extends RequestError { + constructor(error2, request) { + super(error2.message, error2, request); + this.name = "ReadError"; + this.code = this.code === "ERR_GOT_REQUEST_ERROR" ? "ERR_READING_RESPONSE_STREAM" : this.code; + } +}; +var RetryError = class extends RequestError { + constructor(request) { + super("Retrying", {}, request); + this.name = "RetryError"; + this.code = "ERR_RETRYING"; + } +}; +var AbortError = class extends RequestError { + constructor(request) { + super("This operation was aborted.", {}, request); + this.code = "ERR_ABORTED"; + this.name = "AbortError"; + } +}; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/index.js +var import_node_process2 = __toESM(require("node:process"), 1); +var import_node_buffer2 = require("node:buffer"); +var import_node_stream3 = require("node:stream"); +var import_node_url3 = require("node:url"); +var import_node_http2 = __toESM(require("node:http"), 1); + +// node_modules/.pnpm/@szmarczak+http-timer@5.0.1/node_modules/@szmarczak/http-timer/dist/source/index.js +var import_events = require("events"); +var import_util = require("util"); +var import_defer_to_connect = __toESM(require_source(), 1); +var timer = (request) => { + if (request.timings) { + return request.timings; + } + const timings = { + start: Date.now(), + socket: void 0, + lookup: void 0, + connect: void 0, + secureConnect: void 0, + upload: void 0, + response: void 0, + end: void 0, + error: void 0, + abort: void 0, + phases: { + wait: void 0, + dns: void 0, + tcp: void 0, + tls: void 0, + request: void 0, + firstByte: void 0, + download: void 0, + total: void 0 + } + }; + request.timings = timings; + const handleError = (origin) => { + origin.once(import_events.errorMonitor, () => { + timings.error = Date.now(); + timings.phases.total = timings.error - timings.start; + }); + }; + handleError(request); + const onAbort = () => { + timings.abort = Date.now(); + timings.phases.total = timings.abort - timings.start; + }; + request.prependOnceListener("abort", onAbort); + const onSocket = (socket) => { + timings.socket = Date.now(); + timings.phases.wait = timings.socket - timings.start; + if (import_util.types.isProxy(socket)) { + return; + } + const lookupListener = () => { + timings.lookup = Date.now(); + timings.phases.dns = timings.lookup - timings.socket; + }; + socket.prependOnceListener("lookup", lookupListener); + (0, import_defer_to_connect.default)(socket, { + connect: () => { + timings.connect = Date.now(); + if (timings.lookup === void 0) { + socket.removeListener("lookup", lookupListener); + timings.lookup = timings.connect; + timings.phases.dns = timings.lookup - timings.socket; + } + timings.phases.tcp = timings.connect - timings.lookup; + }, + secureConnect: () => { + timings.secureConnect = Date.now(); + timings.phases.tls = timings.secureConnect - timings.connect; + } + }); + }; + if (request.socket) { + onSocket(request.socket); + } else { + request.prependOnceListener("socket", onSocket); + } + const onUpload = () => { + timings.upload = Date.now(); + timings.phases.request = timings.upload - (timings.secureConnect ?? timings.connect); + }; + if (request.writableFinished) { + onUpload(); + } else { + request.prependOnceListener("finish", onUpload); + } + request.prependOnceListener("response", (response) => { + timings.response = Date.now(); + timings.phases.firstByte = timings.response - timings.upload; + response.timings = timings; + handleError(response); + response.prependOnceListener("end", () => { + request.off("abort", onAbort); + response.off("aborted", onAbort); + if (timings.phases.total) { + return; + } + timings.end = Date.now(); + timings.phases.download = timings.end - timings.response; + timings.phases.total = timings.end - timings.start; + }); + response.prependOnceListener("aborted", onAbort); + }); + return timings; +}; +var source_default = timer; + +// node_modules/.pnpm/cacheable-request@10.2.2/node_modules/cacheable-request/dist/index.js +var import_node_events = __toESM(require("node:events"), 1); +var import_node_url = __toESM(require("node:url"), 1); +var import_node_crypto = __toESM(require("node:crypto"), 1); +var import_node_stream2 = __toESM(require("node:stream"), 1); + +// node_modules/.pnpm/normalize-url@7.2.0/node_modules/normalize-url/index.js +var DATA_URL_DEFAULT_MIME_TYPE = "text/plain"; +var DATA_URL_DEFAULT_CHARSET = "us-ascii"; +var testParameter = (name, filters) => filters.some((filter) => filter instanceof RegExp ? filter.test(name) : filter === name); +var normalizeDataURL = (urlString, { stripHash }) => { + const match = /^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(urlString); + if (!match) { + throw new Error(`Invalid URL: ${urlString}`); + } + let { type, data, hash } = match.groups; + const mediaType = type.split(";"); + hash = stripHash ? "" : hash; + let isBase64 = false; + if (mediaType[mediaType.length - 1] === "base64") { + mediaType.pop(); + isBase64 = true; + } + const mimeType = (mediaType.shift() || "").toLowerCase(); + const attributes = mediaType.map((attribute) => { + let [key, value = ""] = attribute.split("=").map((string) => string.trim()); + if (key === "charset") { + value = value.toLowerCase(); + if (value === DATA_URL_DEFAULT_CHARSET) { + return ""; + } + } + return `${key}${value ? `=${value}` : ""}`; + }).filter(Boolean); + const normalizedMediaType = [ + ...attributes + ]; + if (isBase64) { + normalizedMediaType.push("base64"); + } + if (normalizedMediaType.length > 0 || mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE) { + normalizedMediaType.unshift(mimeType); + } + return `data:${normalizedMediaType.join(";")},${isBase64 ? data.trim() : data}${hash ? `#${hash}` : ""}`; +}; +function normalizeUrl(urlString, options) { + options = { + defaultProtocol: "http:", + normalizeProtocol: true, + forceHttp: false, + forceHttps: false, + stripAuthentication: true, + stripHash: false, + stripTextFragment: true, + stripWWW: true, + removeQueryParameters: [/^utm_\w+/i], + removeTrailingSlash: true, + removeSingleSlash: true, + removeDirectoryIndex: false, + removeExplicitPort: false, + sortQueryParameters: true, + ...options + }; + urlString = urlString.trim(); + if (/^data:/i.test(urlString)) { + return normalizeDataURL(urlString, options); + } + if (/^view-source:/i.test(urlString)) { + throw new Error("`view-source:` is not supported as it is a non-standard protocol"); + } + const hasRelativeProtocol = urlString.startsWith("//"); + const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString); + if (!isRelativeUrl) { + urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, options.defaultProtocol); + } + const urlObject = new URL(urlString); + if (options.forceHttp && options.forceHttps) { + throw new Error("The `forceHttp` and `forceHttps` options cannot be used together"); + } + if (options.forceHttp && urlObject.protocol === "https:") { + urlObject.protocol = "http:"; + } + if (options.forceHttps && urlObject.protocol === "http:") { + urlObject.protocol = "https:"; + } + if (options.stripAuthentication) { + urlObject.username = ""; + urlObject.password = ""; + } + if (options.stripHash) { + urlObject.hash = ""; + } else if (options.stripTextFragment) { + urlObject.hash = urlObject.hash.replace(/#?:~:text.*?$/i, ""); + } + if (urlObject.pathname) { + const protocolRegex = /\b[a-z][a-z\d+\-.]{1,50}:\/\//g; + let lastIndex = 0; + let result = ""; + for (; ; ) { + const match = protocolRegex.exec(urlObject.pathname); + if (!match) { + break; + } + const protocol = match[0]; + const protocolAtIndex = match.index; + const intermediate = urlObject.pathname.slice(lastIndex, protocolAtIndex); + result += intermediate.replace(/\/{2,}/g, "/"); + result += protocol; + lastIndex = protocolAtIndex + protocol.length; + } + const remnant = urlObject.pathname.slice(lastIndex, urlObject.pathname.length); + result += remnant.replace(/\/{2,}/g, "/"); + urlObject.pathname = result; + } + if (urlObject.pathname) { + try { + urlObject.pathname = decodeURI(urlObject.pathname); + } catch { + } + } + if (options.removeDirectoryIndex === true) { + options.removeDirectoryIndex = [/^index\.[a-z]+$/]; + } + if (Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) { + let pathComponents = urlObject.pathname.split("/"); + const lastComponent = pathComponents[pathComponents.length - 1]; + if (testParameter(lastComponent, options.removeDirectoryIndex)) { + pathComponents = pathComponents.slice(0, -1); + urlObject.pathname = pathComponents.slice(1).join("/") + "/"; + } + } + if (urlObject.hostname) { + urlObject.hostname = urlObject.hostname.replace(/\.$/, ""); + if (options.stripWWW && /^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(urlObject.hostname)) { + urlObject.hostname = urlObject.hostname.replace(/^www\./, ""); + } + } + if (Array.isArray(options.removeQueryParameters)) { + for (const key of [...urlObject.searchParams.keys()]) { + if (testParameter(key, options.removeQueryParameters)) { + urlObject.searchParams.delete(key); + } + } + } + if (!Array.isArray(options.keepQueryParameters) && options.removeQueryParameters === true) { + urlObject.search = ""; + } + if (Array.isArray(options.keepQueryParameters) && options.keepQueryParameters.length > 0) { + for (const key of [...urlObject.searchParams.keys()]) { + if (!testParameter(key, options.keepQueryParameters)) { + urlObject.searchParams.delete(key); + } + } + } + if (options.sortQueryParameters) { + urlObject.searchParams.sort(); + try { + urlObject.search = decodeURIComponent(urlObject.search); + } catch { + } + } + if (options.removeTrailingSlash) { + urlObject.pathname = urlObject.pathname.replace(/\/$/, ""); + } + if (options.removeExplicitPort && urlObject.port) { + urlObject.port = ""; + } + const oldUrlString = urlString; + urlString = urlObject.toString(); + if (!options.removeSingleSlash && urlObject.pathname === "/" && !oldUrlString.endsWith("/") && urlObject.hash === "") { + urlString = urlString.replace(/\/$/, ""); + } + if ((options.removeTrailingSlash || urlObject.pathname === "/") && urlObject.hash === "" && options.removeSingleSlash) { + urlString = urlString.replace(/\/$/, ""); + } + if (hasRelativeProtocol && !options.normalizeProtocol) { + urlString = urlString.replace(/^http:\/\//, "//"); + } + if (options.stripProtocol) { + urlString = urlString.replace(/^(?:https?:)?\/\//, ""); + } + return urlString; +} + +// node_modules/.pnpm/cacheable-request@10.2.2/node_modules/cacheable-request/dist/index.js +var import_get_stream = __toESM(require_get_stream(), 1); +var import_http_cache_semantics = __toESM(require_http_cache_semantics(), 1); + +// node_modules/.pnpm/responselike@3.0.0/node_modules/responselike/index.js +var import_node_stream = require("node:stream"); + +// node_modules/.pnpm/lowercase-keys@3.0.0/node_modules/lowercase-keys/index.js +function lowercaseKeys(object) { + return Object.fromEntries(Object.entries(object).map(([key, value]) => [key.toLowerCase(), value])); +} + +// node_modules/.pnpm/responselike@3.0.0/node_modules/responselike/index.js +var Response = class extends import_node_stream.Readable { + statusCode; + headers; + body; + url; + constructor({ statusCode, headers, body, url }) { + if (typeof statusCode !== "number") { + throw new TypeError("Argument `statusCode` should be a number"); + } + if (typeof headers !== "object") { + throw new TypeError("Argument `headers` should be an object"); + } + if (!(body instanceof Uint8Array)) { + throw new TypeError("Argument `body` should be a buffer"); + } + if (typeof url !== "string") { + throw new TypeError("Argument `url` should be a string"); + } + super({ + read() { + this.push(body); + this.push(null); + } + }); + this.statusCode = statusCode; + this.headers = lowercaseKeys(headers); + this.body = body; + this.url = url; + } +}; + +// node_modules/.pnpm/cacheable-request@10.2.2/node_modules/cacheable-request/dist/index.js +var import_keyv = __toESM(require_src2(), 1); + +// node_modules/.pnpm/mimic-response@4.0.0/node_modules/mimic-response/index.js +var knownProperties = [ + "aborted", + "complete", + "headers", + "httpVersion", + "httpVersionMinor", + "httpVersionMajor", + "method", + "rawHeaders", + "rawTrailers", + "setTimeout", + "socket", + "statusCode", + "statusMessage", + "trailers", + "url" +]; +function mimicResponse(fromStream, toStream) { + if (toStream._readableState.autoDestroy) { + throw new Error("The second stream must have the `autoDestroy` option set to `false`"); + } + const fromProperties = /* @__PURE__ */ new Set([...Object.keys(fromStream), ...knownProperties]); + const properties = {}; + for (const property of fromProperties) { + if (property in toStream) { + continue; + } + properties[property] = { + get() { + const value = fromStream[property]; + const isFunction2 = typeof value === "function"; + return isFunction2 ? value.bind(fromStream) : value; + }, + set(value) { + fromStream[property] = value; + }, + enumerable: true, + configurable: false + }; + } + Object.defineProperties(toStream, properties); + fromStream.once("aborted", () => { + toStream.destroy(); + toStream.emit("aborted"); + }); + fromStream.once("close", () => { + if (fromStream.complete) { + if (toStream.readable) { + toStream.once("end", () => { + toStream.emit("close"); + }); + } else { + toStream.emit("close"); + } + } else { + toStream.emit("close"); + } + }); + return toStream; +} + +// node_modules/.pnpm/cacheable-request@10.2.2/node_modules/cacheable-request/dist/types.js +var RequestError2 = class extends Error { + constructor(error2) { + super(error2.message); + Object.assign(this, error2); + } +}; +var CacheError2 = class extends Error { + constructor(error2) { + super(error2.message); + Object.assign(this, error2); + } +}; + +// node_modules/.pnpm/cacheable-request@10.2.2/node_modules/cacheable-request/dist/index.js +var CacheableRequest = class { + constructor(cacheRequest, cacheAdapter) { + this.hooks = /* @__PURE__ */ new Map(); + this.request = () => (options, cb) => { + let url; + if (typeof options === "string") { + url = normalizeUrlObject(import_node_url.default.parse(options)); + options = {}; + } else if (options instanceof import_node_url.default.URL) { + url = normalizeUrlObject(import_node_url.default.parse(options.toString())); + options = {}; + } else { + const [pathname, ...searchParts] = (options.path ?? "").split("?"); + const search = searchParts.length > 0 ? `?${searchParts.join("?")}` : ""; + url = normalizeUrlObject({ ...options, pathname, search }); + } + options = { + headers: {}, + method: "GET", + cache: true, + strictTtl: false, + automaticFailover: false, + ...options, + ...urlObjectToRequestOptions(url) + }; + options.headers = Object.fromEntries(entries(options.headers).map(([key2, value]) => [key2.toLowerCase(), value])); + const ee = new import_node_events.default(); + const normalizedUrlString = normalizeUrl(import_node_url.default.format(url), { + stripWWW: false, + removeTrailingSlash: false, + stripAuthentication: false + }); + let key = `${options.method}:${normalizedUrlString}`; + if (options.body && options.method !== void 0 && ["POST", "PATCH", "PUT"].includes(options.method)) { + if (options.body instanceof import_node_stream2.default.Readable) { + options.cache = false; + } else { + key += `:${import_node_crypto.default.createHash("md5").update(options.body).digest("hex")}`; + } + } + let revalidate = false; + let madeRequest = false; + const makeRequest = (options_) => { + madeRequest = true; + let requestErrored = false; + let requestErrorCallback = () => { + }; + const requestErrorPromise = new Promise((resolve) => { + requestErrorCallback = () => { + if (!requestErrored) { + requestErrored = true; + resolve(); + } + }; + }); + const handler = async (response) => { + if (revalidate) { + response.status = response.statusCode; + const revalidatedPolicy = import_http_cache_semantics.default.fromObject(revalidate.cachePolicy).revalidatedPolicy(options_, response); + if (!revalidatedPolicy.modified) { + response.resume(); + await new Promise((resolve) => { + response.once("end", resolve); + }); + const headers = convertHeaders(revalidatedPolicy.policy.responseHeaders()); + response = new Response({ statusCode: revalidate.statusCode, headers, body: revalidate.body, url: revalidate.url }); + response.cachePolicy = revalidatedPolicy.policy; + response.fromCache = true; + } + } + if (!response.fromCache) { + response.cachePolicy = new import_http_cache_semantics.default(options_, response, options_); + response.fromCache = false; + } + let clonedResponse; + if (options_.cache && response.cachePolicy.storable()) { + clonedResponse = cloneResponse(response); + (async () => { + try { + const bodyPromise = import_get_stream.default.buffer(response); + await Promise.race([ + requestErrorPromise, + new Promise((resolve) => response.once("end", resolve)) + ]); + const body = await bodyPromise; + let value = { + url: response.url, + statusCode: response.fromCache ? revalidate.statusCode : response.statusCode, + body, + cachePolicy: response.cachePolicy.toObject() + }; + let ttl2 = options_.strictTtl ? response.cachePolicy.timeToLive() : void 0; + if (options_.maxTtl) { + ttl2 = ttl2 ? Math.min(ttl2, options_.maxTtl) : options_.maxTtl; + } + if (this.hooks.size > 0) { + for (const key_ of this.hooks.keys()) { + value = await this.runHook(key_, value, response); + } + } + await this.cache.set(key, value, ttl2); + } catch (error2) { + ee.emit("error", new CacheError2(error2)); + } + })(); + } else if (options_.cache && revalidate) { + (async () => { + try { + await this.cache.delete(key); + } catch (error2) { + ee.emit("error", new CacheError2(error2)); + } + })(); + } + ee.emit("response", clonedResponse ?? response); + if (typeof cb === "function") { + cb(clonedResponse ?? response); + } + }; + try { + const request_ = this.cacheRequest(options_, handler); + request_.once("error", requestErrorCallback); + request_.once("abort", requestErrorCallback); + ee.emit("request", request_); + } catch (error2) { + ee.emit("error", new RequestError2(error2)); + } + }; + (async () => { + const get = async (options_) => { + await Promise.resolve(); + const cacheEntry = options_.cache ? await this.cache.get(key) : void 0; + if (typeof cacheEntry === "undefined" && !options_.forceRefresh) { + makeRequest(options_); + return; + } + const policy = import_http_cache_semantics.default.fromObject(cacheEntry.cachePolicy); + if (policy.satisfiesWithoutRevalidation(options_) && !options_.forceRefresh) { + const headers = convertHeaders(policy.responseHeaders()); + const response = new Response({ statusCode: cacheEntry.statusCode, headers, body: cacheEntry.body, url: cacheEntry.url }); + response.cachePolicy = policy; + response.fromCache = true; + ee.emit("response", response); + if (typeof cb === "function") { + cb(response); + } + } else if (policy.satisfiesWithoutRevalidation(options_) && Date.now() >= policy.timeToLive() && options_.forceRefresh) { + await this.cache.delete(key); + options_.headers = policy.revalidationHeaders(options_); + makeRequest(options_); + } else { + revalidate = cacheEntry; + options_.headers = policy.revalidationHeaders(options_); + makeRequest(options_); + } + }; + const errorHandler = (error2) => ee.emit("error", new CacheError2(error2)); + if (this.cache instanceof import_keyv.default) { + const cachek = this.cache; + cachek.once("error", errorHandler); + ee.on("error", () => cachek.removeListener("error", errorHandler)); + } + try { + await get(options); + } catch (error2) { + if (options.automaticFailover && !madeRequest) { + makeRequest(options); + } + ee.emit("error", new CacheError2(error2)); + } + })(); + return ee; + }; + this.addHook = (name, fn) => { + if (!this.hooks.has(name)) { + this.hooks.set(name, fn); + } + }; + this.removeHook = (name) => this.hooks.delete(name); + this.getHook = (name) => this.hooks.get(name); + this.runHook = async (name, ...args) => this.hooks.get(name)?.(...args); + if (cacheAdapter instanceof import_keyv.default) { + this.cache = cacheAdapter; + } else if (typeof cacheAdapter === "string") { + this.cache = new import_keyv.default({ + uri: cacheAdapter, + namespace: "cacheable-request" + }); + } else { + this.cache = new import_keyv.default({ + store: cacheAdapter, + namespace: "cacheable-request" + }); + } + this.request = this.request.bind(this); + this.cacheRequest = cacheRequest; + } +}; +var entries = Object.entries; +var cloneResponse = (response) => { + const clone = new import_node_stream2.PassThrough({ autoDestroy: false }); + mimicResponse(response, clone); + return response.pipe(clone); +}; +var urlObjectToRequestOptions = (url) => { + const options = { ...url }; + options.path = `${url.pathname || "/"}${url.search || ""}`; + delete options.pathname; + delete options.search; + return options; +}; +var normalizeUrlObject = (url) => ({ + protocol: url.protocol, + auth: url.auth, + hostname: url.hostname || url.host || "localhost", + port: url.port, + pathname: url.pathname, + search: url.search +}); +var convertHeaders = (headers) => { + const result = []; + for (const name of Object.keys(headers)) { + result[name.toLowerCase()] = headers[name]; + } + return result; +}; +var dist_default2 = CacheableRequest; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/index.js +var import_decompress_response = __toESM(require_decompress_response(), 1); +var import_get_stream2 = __toESM(require_get_stream(), 1); + +// node_modules/.pnpm/form-data-encoder@2.1.3/node_modules/form-data-encoder/lib/util/createBoundary.js +var alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"; +function createBoundary() { + let size = 16; + let res = ""; + while (size--) { + res += alphabet[Math.random() * alphabet.length << 0]; + } + return res; +} + +// node_modules/.pnpm/form-data-encoder@2.1.3/node_modules/form-data-encoder/lib/util/normalizeValue.js +var normalizeValue = (value) => String(value).replace(/\r|\n/g, (match, i, str) => { + if (match === "\r" && str[i + 1] !== "\n" || match === "\n" && str[i - 1] !== "\r") { + return "\r\n"; + } + return match; +}); + +// node_modules/.pnpm/form-data-encoder@2.1.3/node_modules/form-data-encoder/lib/util/isPlainObject.js +var getType = (value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); +function isPlainObject(value) { + if (getType(value) !== "object") { + return false; + } + const pp = Object.getPrototypeOf(value); + if (pp === null || pp === void 0) { + return true; + } + const Ctor = pp.constructor && pp.constructor.toString(); + return Ctor === Object.toString(); +} + +// node_modules/.pnpm/form-data-encoder@2.1.3/node_modules/form-data-encoder/lib/util/proxyHeaders.js +function getProperty(target, prop) { + if (typeof prop === "string") { + for (const [name, value] of Object.entries(target)) { + if (prop.toLowerCase() === name.toLowerCase()) { + return value; + } + } + } + return void 0; +} +var proxyHeaders = (object) => new Proxy(object, { + get: (target, prop) => getProperty(target, prop), + has: (target, prop) => getProperty(target, prop) !== void 0 +}); + +// node_modules/.pnpm/form-data-encoder@2.1.3/node_modules/form-data-encoder/lib/util/isFunction.js +var isFunction = (value) => typeof value === "function"; + +// node_modules/.pnpm/form-data-encoder@2.1.3/node_modules/form-data-encoder/lib/util/isFormData.js +var isFormData = (value) => Boolean(value && isFunction(value.constructor) && value[Symbol.toStringTag] === "FormData" && isFunction(value.append) && isFunction(value.getAll) && isFunction(value.entries) && isFunction(value[Symbol.iterator])); + +// node_modules/.pnpm/form-data-encoder@2.1.3/node_modules/form-data-encoder/lib/util/escapeName.js +var escapeName = (name) => String(name).replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/"/g, "%22"); + +// node_modules/.pnpm/form-data-encoder@2.1.3/node_modules/form-data-encoder/lib/util/isFile.js +var isFile = (value) => Boolean(value && typeof value === "object" && isFunction(value.constructor) && value[Symbol.toStringTag] === "File" && isFunction(value.stream) && value.name != null); + +// node_modules/.pnpm/form-data-encoder@2.1.3/node_modules/form-data-encoder/lib/FormDataEncoder.js +var __classPrivateFieldSet = function(receiver, state, value, kind, f) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; +}; +var __classPrivateFieldGet = function(receiver, state, kind, f) { + if (kind === "a" && !f) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var _FormDataEncoder_instances; +var _FormDataEncoder_CRLF; +var _FormDataEncoder_CRLF_BYTES; +var _FormDataEncoder_CRLF_BYTES_LENGTH; +var _FormDataEncoder_DASHES; +var _FormDataEncoder_encoder; +var _FormDataEncoder_footer; +var _FormDataEncoder_form; +var _FormDataEncoder_options; +var _FormDataEncoder_getFieldHeader; +var _FormDataEncoder_getContentLength; +var defaultOptions = { + enableAdditionalHeaders: false +}; +var readonlyProp = { writable: false, configurable: false }; +var FormDataEncoder = class { + constructor(form, boundaryOrOptions, options) { + _FormDataEncoder_instances.add(this); + _FormDataEncoder_CRLF.set(this, "\r\n"); + _FormDataEncoder_CRLF_BYTES.set(this, void 0); + _FormDataEncoder_CRLF_BYTES_LENGTH.set(this, void 0); + _FormDataEncoder_DASHES.set(this, "-".repeat(2)); + _FormDataEncoder_encoder.set(this, new TextEncoder()); + _FormDataEncoder_footer.set(this, void 0); + _FormDataEncoder_form.set(this, void 0); + _FormDataEncoder_options.set(this, void 0); + if (!isFormData(form)) { + throw new TypeError("Expected first argument to be a FormData instance."); + } + let boundary; + if (isPlainObject(boundaryOrOptions)) { + options = boundaryOrOptions; + } else { + boundary = boundaryOrOptions; + } + if (!boundary) { + boundary = createBoundary(); + } + if (typeof boundary !== "string") { + throw new TypeError("Expected boundary argument to be a string."); + } + if (options && !isPlainObject(options)) { + throw new TypeError("Expected options argument to be an object."); + } + __classPrivateFieldSet(this, _FormDataEncoder_form, Array.from(form.entries()), "f"); + __classPrivateFieldSet(this, _FormDataEncoder_options, { ...defaultOptions, ...options }, "f"); + __classPrivateFieldSet(this, _FormDataEncoder_CRLF_BYTES, __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")), "f"); + __classPrivateFieldSet(this, _FormDataEncoder_CRLF_BYTES_LENGTH, __classPrivateFieldGet(this, _FormDataEncoder_CRLF_BYTES, "f").byteLength, "f"); + this.boundary = `form-data-boundary-${boundary}`; + this.contentType = `multipart/form-data; boundary=${this.boundary}`; + __classPrivateFieldSet(this, _FormDataEncoder_footer, __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(`${__classPrivateFieldGet(this, _FormDataEncoder_DASHES, "f")}${this.boundary}${__classPrivateFieldGet(this, _FormDataEncoder_DASHES, "f")}${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f").repeat(2)}`), "f"); + const headers = { + "Content-Type": this.contentType + }; + const contentLength = __classPrivateFieldGet(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getContentLength).call(this); + if (contentLength) { + this.contentLength = contentLength; + headers["Content-Length"] = contentLength; + } + this.headers = proxyHeaders(Object.freeze(headers)); + Object.defineProperties(this, { + boundary: readonlyProp, + contentType: readonlyProp, + contentLength: readonlyProp, + headers: readonlyProp + }); + } + getContentLength() { + return this.contentLength == null ? void 0 : Number(this.contentLength); + } + *values() { + for (const [name, raw] of __classPrivateFieldGet(this, _FormDataEncoder_form, "f")) { + const value = isFile(raw) ? raw : __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(normalizeValue(raw)); + yield __classPrivateFieldGet(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getFieldHeader).call(this, name, value); + yield value; + yield __classPrivateFieldGet(this, _FormDataEncoder_CRLF_BYTES, "f"); + } + yield __classPrivateFieldGet(this, _FormDataEncoder_footer, "f"); + } + async *encode() { + for (const part of this.values()) { + if (isFile(part)) { + yield* part.stream(); + } else { + yield part; + } + } + } + [(_FormDataEncoder_CRLF = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_CRLF_BYTES = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_CRLF_BYTES_LENGTH = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_DASHES = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_encoder = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_footer = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_form = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_options = /* @__PURE__ */ new WeakMap(), _FormDataEncoder_instances = /* @__PURE__ */ new WeakSet(), _FormDataEncoder_getFieldHeader = function _FormDataEncoder_getFieldHeader2(name, value) { + let header = ""; + header += `${__classPrivateFieldGet(this, _FormDataEncoder_DASHES, "f")}${this.boundary}${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")}`; + header += `Content-Disposition: form-data; name="${escapeName(name)}"`; + if (isFile(value)) { + header += `; filename="${escapeName(value.name)}"${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")}`; + header += `Content-Type: ${value.type || "application/octet-stream"}`; + } + const size = isFile(value) ? value.size : value.byteLength; + if (__classPrivateFieldGet(this, _FormDataEncoder_options, "f").enableAdditionalHeaders === true && size != null && !isNaN(size)) { + header += `${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f")}Content-Length: ${isFile(value) ? value.size : value.byteLength}`; + } + return __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(`${header}${__classPrivateFieldGet(this, _FormDataEncoder_CRLF, "f").repeat(2)}`); + }, _FormDataEncoder_getContentLength = function _FormDataEncoder_getContentLength2() { + let length = 0; + for (const [name, raw] of __classPrivateFieldGet(this, _FormDataEncoder_form, "f")) { + const value = isFile(raw) ? raw : __classPrivateFieldGet(this, _FormDataEncoder_encoder, "f").encode(normalizeValue(raw)); + const size = isFile(value) ? value.size : value.byteLength; + if (size == null || isNaN(size)) { + return void 0; + } + length += __classPrivateFieldGet(this, _FormDataEncoder_instances, "m", _FormDataEncoder_getFieldHeader).call(this, name, value).byteLength; + length += size; + length += __classPrivateFieldGet(this, _FormDataEncoder_CRLF_BYTES_LENGTH, "f"); + } + return String(length + __classPrivateFieldGet(this, _FormDataEncoder_footer, "f").byteLength); + }, Symbol.iterator)]() { + return this.values(); + } + [Symbol.asyncIterator]() { + return this.encode(); + } +}; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/utils/get-body-size.js +var import_node_buffer = require("node:buffer"); +var import_node_util = require("node:util"); + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/utils/is-form-data.js +function isFormData2(body) { + return dist_default.nodeStream(body) && dist_default.function_(body.getBoundary); +} + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/utils/get-body-size.js +async function getBodySize(body, headers) { + if (headers && "content-length" in headers) { + return Number(headers["content-length"]); + } + if (!body) { + return 0; + } + if (dist_default.string(body)) { + return import_node_buffer.Buffer.byteLength(body); + } + if (dist_default.buffer(body)) { + return body.length; + } + if (isFormData2(body)) { + return (0, import_node_util.promisify)(body.getLength.bind(body))(); + } + return void 0; +} + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/utils/proxy-events.js +function proxyEvents(from, to, events) { + const eventFunctions = {}; + for (const event of events) { + const eventFunction = (...args) => { + to.emit(event, ...args); + }; + eventFunctions[event] = eventFunction; + from.on(event, eventFunction); + } + return () => { + for (const [event, eventFunction] of Object.entries(eventFunctions)) { + from.off(event, eventFunction); + } + }; +} + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/timed-out.js +var import_node_net = __toESM(require("node:net"), 1); + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/utils/unhandle.js +function unhandle() { + const handlers = []; + return { + once(origin, event, fn) { + origin.once(event, fn); + handlers.push({ origin, event, fn }); + }, + unhandleAll() { + for (const handler of handlers) { + const { origin, event, fn } = handler; + origin.removeListener(event, fn); + } + handlers.length = 0; + } + }; +} + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/timed-out.js +var reentry = Symbol("reentry"); +var noop = () => { +}; +var TimeoutError2 = class extends Error { + constructor(threshold, event) { + super(`Timeout awaiting '${event}' for ${threshold}ms`); + Object.defineProperty(this, "event", { + enumerable: true, + configurable: true, + writable: true, + value: event + }); + Object.defineProperty(this, "code", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + this.name = "TimeoutError"; + this.code = "ETIMEDOUT"; + } +}; +function timedOut(request, delays, options) { + if (reentry in request) { + return noop; + } + request[reentry] = true; + const cancelers = []; + const { once, unhandleAll } = unhandle(); + const addTimeout = (delay2, callback, event) => { + const timeout = setTimeout(callback, delay2, delay2, event); + timeout.unref?.(); + const cancel = () => { + clearTimeout(timeout); + }; + cancelers.push(cancel); + return cancel; + }; + const { host, hostname } = options; + const timeoutHandler = (delay2, event) => { + request.destroy(new TimeoutError2(delay2, event)); + }; + const cancelTimeouts = () => { + for (const cancel of cancelers) { + cancel(); + } + unhandleAll(); + }; + request.once("error", (error2) => { + cancelTimeouts(); + if (request.listenerCount("error") === 0) { + throw error2; + } + }); + if (typeof delays.request !== "undefined") { + const cancelTimeout = addTimeout(delays.request, timeoutHandler, "request"); + once(request, "response", (response) => { + once(response, "end", cancelTimeout); + }); + } + if (typeof delays.socket !== "undefined") { + const { socket } = delays; + const socketTimeoutHandler = () => { + timeoutHandler(socket, "socket"); + }; + request.setTimeout(socket, socketTimeoutHandler); + cancelers.push(() => { + request.removeListener("timeout", socketTimeoutHandler); + }); + } + const hasLookup = typeof delays.lookup !== "undefined"; + const hasConnect = typeof delays.connect !== "undefined"; + const hasSecureConnect = typeof delays.secureConnect !== "undefined"; + const hasSend = typeof delays.send !== "undefined"; + if (hasLookup || hasConnect || hasSecureConnect || hasSend) { + once(request, "socket", (socket) => { + const { socketPath } = request; + if (socket.connecting) { + const hasPath = Boolean(socketPath ?? import_node_net.default.isIP(hostname ?? host ?? "") !== 0); + if (hasLookup && !hasPath && typeof socket.address().address === "undefined") { + const cancelTimeout = addTimeout(delays.lookup, timeoutHandler, "lookup"); + once(socket, "lookup", cancelTimeout); + } + if (hasConnect) { + const timeConnect = () => addTimeout(delays.connect, timeoutHandler, "connect"); + if (hasPath) { + once(socket, "connect", timeConnect()); + } else { + once(socket, "lookup", (error2) => { + if (error2 === null) { + once(socket, "connect", timeConnect()); + } + }); + } + } + if (hasSecureConnect && options.protocol === "https:") { + once(socket, "connect", () => { + const cancelTimeout = addTimeout(delays.secureConnect, timeoutHandler, "secureConnect"); + once(socket, "secureConnect", cancelTimeout); + }); + } + } + if (hasSend) { + const timeRequest = () => addTimeout(delays.send, timeoutHandler, "send"); + if (socket.connecting) { + once(socket, "connect", () => { + once(request, "upload-complete", timeRequest()); + }); + } else { + once(request, "upload-complete", timeRequest()); + } + } + }); + } + if (typeof delays.response !== "undefined") { + once(request, "upload-complete", () => { + const cancelTimeout = addTimeout(delays.response, timeoutHandler, "response"); + once(request, "response", cancelTimeout); + }); + } + if (typeof delays.read !== "undefined") { + once(request, "response", (response) => { + const cancelTimeout = addTimeout(delays.read, timeoutHandler, "read"); + once(response, "end", cancelTimeout); + }); + } + return cancelTimeouts; +} + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/utils/url-to-options.js +function urlToOptions(url) { + url = url; + const options = { + protocol: url.protocol, + hostname: dist_default.string(url.hostname) && url.hostname.startsWith("[") ? url.hostname.slice(1, -1) : url.hostname, + host: url.host, + hash: url.hash, + search: url.search, + pathname: url.pathname, + href: url.href, + path: `${url.pathname || ""}${url.search || ""}` + }; + if (dist_default.string(url.port) && url.port.length > 0) { + options.port = Number(url.port); + } + if (url.username || url.password) { + options.auth = `${url.username || ""}:${url.password || ""}`; + } + return options; +} + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/utils/weakable-map.js +var WeakableMap = class { + constructor() { + Object.defineProperty(this, "weakMap", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "map", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + this.weakMap = /* @__PURE__ */ new WeakMap(); + this.map = /* @__PURE__ */ new Map(); + } + set(key, value) { + if (typeof key === "object") { + this.weakMap.set(key, value); + } else { + this.map.set(key, value); + } + } + get(key) { + if (typeof key === "object") { + return this.weakMap.get(key); + } + return this.map.get(key); + } + has(key) { + if (typeof key === "object") { + return this.weakMap.has(key); + } + return this.map.has(key); + } +}; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/calculate-retry-delay.js +var calculateRetryDelay = ({ attemptCount, retryOptions, error: error2, retryAfter, computedValue }) => { + if (error2.name === "RetryError") { + return 1; + } + if (attemptCount > retryOptions.limit) { + return 0; + } + const hasMethod = retryOptions.methods.includes(error2.options.method); + const hasErrorCode = retryOptions.errorCodes.includes(error2.code); + const hasStatusCode = error2.response && retryOptions.statusCodes.includes(error2.response.statusCode); + if (!hasMethod || !hasErrorCode && !hasStatusCode) { + return 0; + } + if (error2.response) { + if (retryAfter) { + if (retryAfter > computedValue) { + return 0; + } + return retryAfter; + } + if (error2.response.statusCode === 413) { + return 0; + } + } + const noise = Math.random() * retryOptions.noise; + return Math.min(2 ** (attemptCount - 1) * 1e3, retryOptions.backoffLimit) + noise; +}; +var calculate_retry_delay_default = calculateRetryDelay; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/options.js +var import_node_process = __toESM(require("node:process"), 1); +var import_node_util3 = require("node:util"); +var import_node_url2 = require("node:url"); +var import_node_tls = require("node:tls"); +var import_node_http = __toESM(require("node:http"), 1); +var import_node_https = __toESM(require("node:https"), 1); + +// node_modules/.pnpm/cacheable-lookup@7.0.0/node_modules/cacheable-lookup/source/index.js +var import_node_dns = require("node:dns"); +var import_node_util2 = require("node:util"); +var import_node_os = __toESM(require("node:os"), 1); +var { Resolver: AsyncResolver } = import_node_dns.promises; +var kCacheableLookupCreateConnection = Symbol("cacheableLookupCreateConnection"); +var kCacheableLookupInstance = Symbol("cacheableLookupInstance"); +var kExpires = Symbol("expires"); +var supportsALL = typeof import_node_dns.ALL === "number"; +var verifyAgent = (agent) => { + if (!(agent && typeof agent.createConnection === "function")) { + throw new Error("Expected an Agent instance as the first argument"); + } +}; +var map4to6 = (entries2) => { + for (const entry of entries2) { + if (entry.family === 6) { + continue; + } + entry.address = `::ffff:${entry.address}`; + entry.family = 6; + } +}; +var getIfaceInfo = () => { + let has4 = false; + let has6 = false; + for (const device of Object.values(import_node_os.default.networkInterfaces())) { + for (const iface of device) { + if (iface.internal) { + continue; + } + if (iface.family === "IPv6") { + has6 = true; + } else { + has4 = true; + } + if (has4 && has6) { + return { has4, has6 }; + } + } + } + return { has4, has6 }; +}; +var isIterable = (map) => { + return Symbol.iterator in map; +}; +var ignoreNoResultErrors = (dnsPromise) => { + return dnsPromise.catch((error2) => { + if (error2.code === "ENODATA" || error2.code === "ENOTFOUND" || error2.code === "ENOENT") { + return []; + } + throw error2; + }); +}; +var ttl = { ttl: true }; +var all = { all: true }; +var all4 = { all: true, family: 4 }; +var all6 = { all: true, family: 6 }; +var CacheableLookup = class { + constructor({ + cache: cache2 = /* @__PURE__ */ new Map(), + maxTtl = Infinity, + fallbackDuration = 3600, + errorTtl = 0.15, + resolver = new AsyncResolver(), + lookup = import_node_dns.lookup + } = {}) { + this.maxTtl = maxTtl; + this.errorTtl = errorTtl; + this._cache = cache2; + this._resolver = resolver; + this._dnsLookup = lookup && (0, import_node_util2.promisify)(lookup); + this.stats = { + cache: 0, + query: 0 + }; + if (this._resolver instanceof AsyncResolver) { + this._resolve4 = this._resolver.resolve4.bind(this._resolver); + this._resolve6 = this._resolver.resolve6.bind(this._resolver); + } else { + this._resolve4 = (0, import_node_util2.promisify)(this._resolver.resolve4.bind(this._resolver)); + this._resolve6 = (0, import_node_util2.promisify)(this._resolver.resolve6.bind(this._resolver)); + } + this._iface = getIfaceInfo(); + this._pending = {}; + this._nextRemovalTime = false; + this._hostnamesToFallback = /* @__PURE__ */ new Set(); + this.fallbackDuration = fallbackDuration; + if (fallbackDuration > 0) { + const interval = setInterval(() => { + this._hostnamesToFallback.clear(); + }, fallbackDuration * 1e3); + if (interval.unref) { + interval.unref(); + } + this._fallbackInterval = interval; + } + this.lookup = this.lookup.bind(this); + this.lookupAsync = this.lookupAsync.bind(this); + } + set servers(servers) { + this.clear(); + this._resolver.setServers(servers); + } + get servers() { + return this._resolver.getServers(); + } + lookup(hostname, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else if (typeof options === "number") { + options = { + family: options + }; + } + if (!callback) { + throw new Error("Callback must be a function."); + } + this.lookupAsync(hostname, options).then((result) => { + if (options.all) { + callback(null, result); + } else { + callback(null, result.address, result.family, result.expires, result.ttl, result.source); + } + }, callback); + } + async lookupAsync(hostname, options = {}) { + if (typeof options === "number") { + options = { + family: options + }; + } + let cached = await this.query(hostname); + if (options.family === 6) { + const filtered = cached.filter((entry) => entry.family === 6); + if (options.hints & import_node_dns.V4MAPPED) { + if (supportsALL && options.hints & import_node_dns.ALL || filtered.length === 0) { + map4to6(cached); + } else { + cached = filtered; + } + } else { + cached = filtered; + } + } else if (options.family === 4) { + cached = cached.filter((entry) => entry.family === 4); + } + if (options.hints & import_node_dns.ADDRCONFIG) { + const { _iface } = this; + cached = cached.filter((entry) => entry.family === 6 ? _iface.has6 : _iface.has4); + } + if (cached.length === 0) { + const error2 = new Error(`cacheableLookup ENOTFOUND ${hostname}`); + error2.code = "ENOTFOUND"; + error2.hostname = hostname; + throw error2; + } + if (options.all) { + return cached; + } + return cached[0]; + } + async query(hostname) { + let source = "cache"; + let cached = await this._cache.get(hostname); + if (cached) { + this.stats.cache++; + } + if (!cached) { + const pending = this._pending[hostname]; + if (pending) { + this.stats.cache++; + cached = await pending; + } else { + source = "query"; + const newPromise = this.queryAndCache(hostname); + this._pending[hostname] = newPromise; + this.stats.query++; + try { + cached = await newPromise; + } finally { + delete this._pending[hostname]; + } + } + } + cached = cached.map((entry) => { + return { ...entry, source }; + }); + return cached; + } + async _resolve(hostname) { + const [A, AAAA] = await Promise.all([ + ignoreNoResultErrors(this._resolve4(hostname, ttl)), + ignoreNoResultErrors(this._resolve6(hostname, ttl)) + ]); + let aTtl = 0; + let aaaaTtl = 0; + let cacheTtl = 0; + const now = Date.now(); + for (const entry of A) { + entry.family = 4; + entry.expires = now + entry.ttl * 1e3; + aTtl = Math.max(aTtl, entry.ttl); + } + for (const entry of AAAA) { + entry.family = 6; + entry.expires = now + entry.ttl * 1e3; + aaaaTtl = Math.max(aaaaTtl, entry.ttl); + } + if (A.length > 0) { + if (AAAA.length > 0) { + cacheTtl = Math.min(aTtl, aaaaTtl); + } else { + cacheTtl = aTtl; + } + } else { + cacheTtl = aaaaTtl; + } + return { + entries: [ + ...A, + ...AAAA + ], + cacheTtl + }; + } + async _lookup(hostname) { + try { + const [A, AAAA] = await Promise.all([ + ignoreNoResultErrors(this._dnsLookup(hostname, all4)), + ignoreNoResultErrors(this._dnsLookup(hostname, all6)) + ]); + return { + entries: [ + ...A, + ...AAAA + ], + cacheTtl: 0 + }; + } catch { + return { + entries: [], + cacheTtl: 0 + }; + } + } + async _set(hostname, data, cacheTtl) { + if (this.maxTtl > 0 && cacheTtl > 0) { + cacheTtl = Math.min(cacheTtl, this.maxTtl) * 1e3; + data[kExpires] = Date.now() + cacheTtl; + try { + await this._cache.set(hostname, data, cacheTtl); + } catch (error2) { + this.lookupAsync = async () => { + const cacheError = new Error("Cache Error. Please recreate the CacheableLookup instance."); + cacheError.cause = error2; + throw cacheError; + }; + } + if (isIterable(this._cache)) { + this._tick(cacheTtl); + } + } + } + async queryAndCache(hostname) { + if (this._hostnamesToFallback.has(hostname)) { + return this._dnsLookup(hostname, all); + } + let query = await this._resolve(hostname); + if (query.entries.length === 0 && this._dnsLookup) { + query = await this._lookup(hostname); + if (query.entries.length !== 0 && this.fallbackDuration > 0) { + this._hostnamesToFallback.add(hostname); + } + } + const cacheTtl = query.entries.length === 0 ? this.errorTtl : query.cacheTtl; + await this._set(hostname, query.entries, cacheTtl); + return query.entries; + } + _tick(ms) { + const nextRemovalTime = this._nextRemovalTime; + if (!nextRemovalTime || ms < nextRemovalTime) { + clearTimeout(this._removalTimeout); + this._nextRemovalTime = ms; + this._removalTimeout = setTimeout(() => { + this._nextRemovalTime = false; + let nextExpiry = Infinity; + const now = Date.now(); + for (const [hostname, entries2] of this._cache) { + const expires = entries2[kExpires]; + if (now >= expires) { + this._cache.delete(hostname); + } else if (expires < nextExpiry) { + nextExpiry = expires; + } + } + if (nextExpiry !== Infinity) { + this._tick(nextExpiry - now); + } + }, ms); + if (this._removalTimeout.unref) { + this._removalTimeout.unref(); + } + } + } + install(agent) { + verifyAgent(agent); + if (kCacheableLookupCreateConnection in agent) { + throw new Error("CacheableLookup has been already installed"); + } + agent[kCacheableLookupCreateConnection] = agent.createConnection; + agent[kCacheableLookupInstance] = this; + agent.createConnection = (options, callback) => { + if (!("lookup" in options)) { + options.lookup = this.lookup; + } + return agent[kCacheableLookupCreateConnection](options, callback); + }; + } + uninstall(agent) { + verifyAgent(agent); + if (agent[kCacheableLookupCreateConnection]) { + if (agent[kCacheableLookupInstance] !== this) { + throw new Error("The agent is not owned by this CacheableLookup instance"); + } + agent.createConnection = agent[kCacheableLookupCreateConnection]; + delete agent[kCacheableLookupCreateConnection]; + delete agent[kCacheableLookupInstance]; + } + } + updateInterfaceInfo() { + const { _iface } = this; + this._iface = getIfaceInfo(); + if (_iface.has4 && !this._iface.has4 || _iface.has6 && !this._iface.has6) { + this._cache.clear(); + } + } + clear(hostname) { + if (hostname) { + this._cache.delete(hostname); + return; + } + this._cache.clear(); + } +}; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/options.js +var import_http2_wrapper = __toESM(require_source2(), 1); + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/parse-link-header.js +function parseLinkHeader(link) { + const parsed = []; + const items = link.split(","); + for (const item of items) { + const [rawUriReference, ...rawLinkParameters] = item.split(";"); + const trimmedUriReference = rawUriReference.trim(); + if (trimmedUriReference[0] !== "<" || trimmedUriReference[trimmedUriReference.length - 1] !== ">") { + throw new Error(`Invalid format of the Link header reference: ${trimmedUriReference}`); + } + const reference = trimmedUriReference.slice(1, -1); + const parameters = {}; + if (rawLinkParameters.length === 0) { + throw new Error(`Unexpected end of Link header parameters: ${rawLinkParameters.join(";")}`); + } + for (const rawParameter of rawLinkParameters) { + const trimmedRawParameter = rawParameter.trim(); + const center = trimmedRawParameter.indexOf("="); + if (center === -1) { + throw new Error(`Failed to parse Link header: ${link}`); + } + const name = trimmedRawParameter.slice(0, center).trim(); + const value = trimmedRawParameter.slice(center + 1).trim(); + parameters[name] = value; + } + parsed.push({ + reference, + parameters + }); + } + return parsed; +} + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/options.js +var [major, minor] = import_node_process.default.versions.node.split(".").map(Number); +function validateSearchParameters(searchParameters) { + for (const key in searchParameters) { + const value = searchParameters[key]; + assert.any([dist_default.string, dist_default.number, dist_default.boolean, dist_default.null_, dist_default.undefined], value); + } +} +var globalCache = /* @__PURE__ */ new Map(); +var globalDnsCache; +var getGlobalDnsCache = () => { + if (globalDnsCache) { + return globalDnsCache; + } + globalDnsCache = new CacheableLookup(); + return globalDnsCache; +}; +var defaultInternals = { + request: void 0, + agent: { + http: void 0, + https: void 0, + http2: void 0 + }, + h2session: void 0, + decompress: true, + timeout: { + connect: void 0, + lookup: void 0, + read: void 0, + request: void 0, + response: void 0, + secureConnect: void 0, + send: void 0, + socket: void 0 + }, + prefixUrl: "", + body: void 0, + form: void 0, + json: void 0, + cookieJar: void 0, + ignoreInvalidCookies: false, + searchParams: void 0, + dnsLookup: void 0, + dnsCache: void 0, + context: {}, + hooks: { + init: [], + beforeRequest: [], + beforeError: [], + beforeRedirect: [], + beforeRetry: [], + afterResponse: [] + }, + followRedirect: true, + maxRedirects: 10, + cache: void 0, + throwHttpErrors: true, + username: "", + password: "", + http2: false, + allowGetBody: false, + headers: { + "user-agent": "got (https://github.com/sindresorhus/got)" + }, + methodRewriting: false, + dnsLookupIpVersion: void 0, + parseJson: JSON.parse, + stringifyJson: JSON.stringify, + retry: { + limit: 2, + methods: [ + "GET", + "PUT", + "HEAD", + "DELETE", + "OPTIONS", + "TRACE" + ], + statusCodes: [ + 408, + 413, + 429, + 500, + 502, + 503, + 504, + 521, + 522, + 524 + ], + errorCodes: [ + "ETIMEDOUT", + "ECONNRESET", + "EADDRINUSE", + "ECONNREFUSED", + "EPIPE", + "ENOTFOUND", + "ENETUNREACH", + "EAI_AGAIN" + ], + maxRetryAfter: void 0, + calculateDelay: ({ computedValue }) => computedValue, + backoffLimit: Number.POSITIVE_INFINITY, + noise: 100 + }, + localAddress: void 0, + method: "GET", + createConnection: void 0, + cacheOptions: { + shared: void 0, + cacheHeuristic: void 0, + immutableMinTimeToLive: void 0, + ignoreCargoCult: void 0 + }, + https: { + alpnProtocols: void 0, + rejectUnauthorized: void 0, + checkServerIdentity: void 0, + certificateAuthority: void 0, + key: void 0, + certificate: void 0, + passphrase: void 0, + pfx: void 0, + ciphers: void 0, + honorCipherOrder: void 0, + minVersion: void 0, + maxVersion: void 0, + signatureAlgorithms: void 0, + tlsSessionLifetime: void 0, + dhparam: void 0, + ecdhCurve: void 0, + certificateRevocationLists: void 0 + }, + encoding: void 0, + resolveBodyOnly: false, + isStream: false, + responseType: "text", + url: void 0, + pagination: { + transform(response) { + if (response.request.options.responseType === "json") { + return response.body; + } + return JSON.parse(response.body); + }, + paginate({ response }) { + const rawLinkHeader = response.headers.link; + if (typeof rawLinkHeader !== "string" || rawLinkHeader.trim() === "") { + return false; + } + const parsed = parseLinkHeader(rawLinkHeader); + const next = parsed.find((entry) => entry.parameters.rel === "next" || entry.parameters.rel === '"next"'); + if (next) { + return { + url: new import_node_url2.URL(next.reference, response.url) + }; + } + return false; + }, + filter: () => true, + shouldContinue: () => true, + countLimit: Number.POSITIVE_INFINITY, + backoff: 0, + requestLimit: 1e4, + stackAllItems: false + }, + setHost: true, + maxHeaderSize: void 0, + signal: void 0, + enableUnixSockets: true +}; +var cloneInternals = (internals) => { + const { hooks, retry } = internals; + const result = { + ...internals, + context: { ...internals.context }, + cacheOptions: { ...internals.cacheOptions }, + https: { ...internals.https }, + agent: { ...internals.agent }, + headers: { ...internals.headers }, + retry: { + ...retry, + errorCodes: [...retry.errorCodes], + methods: [...retry.methods], + statusCodes: [...retry.statusCodes] + }, + timeout: { ...internals.timeout }, + hooks: { + init: [...hooks.init], + beforeRequest: [...hooks.beforeRequest], + beforeError: [...hooks.beforeError], + beforeRedirect: [...hooks.beforeRedirect], + beforeRetry: [...hooks.beforeRetry], + afterResponse: [...hooks.afterResponse] + }, + searchParams: internals.searchParams ? new import_node_url2.URLSearchParams(internals.searchParams) : void 0, + pagination: { ...internals.pagination } + }; + if (result.url !== void 0) { + result.prefixUrl = ""; + } + return result; +}; +var cloneRaw = (raw) => { + const { hooks, retry } = raw; + const result = { ...raw }; + if (dist_default.object(raw.context)) { + result.context = { ...raw.context }; + } + if (dist_default.object(raw.cacheOptions)) { + result.cacheOptions = { ...raw.cacheOptions }; + } + if (dist_default.object(raw.https)) { + result.https = { ...raw.https }; + } + if (dist_default.object(raw.cacheOptions)) { + result.cacheOptions = { ...result.cacheOptions }; + } + if (dist_default.object(raw.agent)) { + result.agent = { ...raw.agent }; + } + if (dist_default.object(raw.headers)) { + result.headers = { ...raw.headers }; + } + if (dist_default.object(retry)) { + result.retry = { ...retry }; + if (dist_default.array(retry.errorCodes)) { + result.retry.errorCodes = [...retry.errorCodes]; + } + if (dist_default.array(retry.methods)) { + result.retry.methods = [...retry.methods]; + } + if (dist_default.array(retry.statusCodes)) { + result.retry.statusCodes = [...retry.statusCodes]; + } + } + if (dist_default.object(raw.timeout)) { + result.timeout = { ...raw.timeout }; + } + if (dist_default.object(hooks)) { + result.hooks = { + ...hooks + }; + if (dist_default.array(hooks.init)) { + result.hooks.init = [...hooks.init]; + } + if (dist_default.array(hooks.beforeRequest)) { + result.hooks.beforeRequest = [...hooks.beforeRequest]; + } + if (dist_default.array(hooks.beforeError)) { + result.hooks.beforeError = [...hooks.beforeError]; + } + if (dist_default.array(hooks.beforeRedirect)) { + result.hooks.beforeRedirect = [...hooks.beforeRedirect]; + } + if (dist_default.array(hooks.beforeRetry)) { + result.hooks.beforeRetry = [...hooks.beforeRetry]; + } + if (dist_default.array(hooks.afterResponse)) { + result.hooks.afterResponse = [...hooks.afterResponse]; + } + } + if (dist_default.object(raw.pagination)) { + result.pagination = { ...raw.pagination }; + } + return result; +}; +var getHttp2TimeoutOption = (internals) => { + const delays = [internals.timeout.socket, internals.timeout.connect, internals.timeout.lookup, internals.timeout.request, internals.timeout.secureConnect].filter((delay2) => typeof delay2 === "number"); + if (delays.length > 0) { + return Math.min(...delays); + } + return void 0; +}; +var init = (options, withOptions, self2) => { + const initHooks = options.hooks?.init; + if (initHooks) { + for (const hook of initHooks) { + hook(withOptions, self2); + } + } +}; +var Options = class { + constructor(input, options, defaults2) { + Object.defineProperty(this, "_unixOptions", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_internals", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_merging", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_init", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + assert.any([dist_default.string, dist_default.urlInstance, dist_default.object, dist_default.undefined], input); + assert.any([dist_default.object, dist_default.undefined], options); + assert.any([dist_default.object, dist_default.undefined], defaults2); + if (input instanceof Options || options instanceof Options) { + throw new TypeError("The defaults must be passed as the third argument"); + } + this._internals = cloneInternals(defaults2?._internals ?? defaults2 ?? defaultInternals); + this._init = [...defaults2?._init ?? []]; + this._merging = false; + this._unixOptions = void 0; + try { + if (dist_default.plainObject(input)) { + try { + this.merge(input); + this.merge(options); + } finally { + this.url = input.url; + } + } else { + try { + this.merge(options); + } finally { + if (options?.url !== void 0) { + if (input === void 0) { + this.url = options.url; + } else { + throw new TypeError("The `url` option is mutually exclusive with the `input` argument"); + } + } else if (input !== void 0) { + this.url = input; + } + } + } + } catch (error2) { + error2.options = this; + throw error2; + } + } + merge(options) { + if (!options) { + return; + } + if (options instanceof Options) { + for (const init2 of options._init) { + this.merge(init2); + } + return; + } + options = cloneRaw(options); + init(this, options, this); + init(options, options, this); + this._merging = true; + if ("isStream" in options) { + this.isStream = options.isStream; + } + try { + let push = false; + for (const key in options) { + if (key === "mutableDefaults" || key === "handlers") { + continue; + } + if (key === "url") { + continue; + } + if (!(key in this)) { + throw new Error(`Unexpected option: ${key}`); + } + this[key] = options[key]; + push = true; + } + if (push) { + this._init.push(options); + } + } finally { + this._merging = false; + } + } + get request() { + return this._internals.request; + } + set request(value) { + assert.any([dist_default.function_, dist_default.undefined], value); + this._internals.request = value; + } + get agent() { + return this._internals.agent; + } + set agent(value) { + assert.plainObject(value); + for (const key in value) { + if (!(key in this._internals.agent)) { + throw new TypeError(`Unexpected agent option: ${key}`); + } + assert.any([dist_default.object, dist_default.undefined], value[key]); + } + if (this._merging) { + Object.assign(this._internals.agent, value); + } else { + this._internals.agent = { ...value }; + } + } + get h2session() { + return this._internals.h2session; + } + set h2session(value) { + this._internals.h2session = value; + } + get decompress() { + return this._internals.decompress; + } + set decompress(value) { + assert.boolean(value); + this._internals.decompress = value; + } + get timeout() { + return this._internals.timeout; + } + set timeout(value) { + assert.plainObject(value); + for (const key in value) { + if (!(key in this._internals.timeout)) { + throw new Error(`Unexpected timeout option: ${key}`); + } + assert.any([dist_default.number, dist_default.undefined], value[key]); + } + if (this._merging) { + Object.assign(this._internals.timeout, value); + } else { + this._internals.timeout = { ...value }; + } + } + get prefixUrl() { + return this._internals.prefixUrl; + } + set prefixUrl(value) { + assert.any([dist_default.string, dist_default.urlInstance], value); + if (value === "") { + this._internals.prefixUrl = ""; + return; + } + value = value.toString(); + if (!value.endsWith("/")) { + value += "/"; + } + if (this._internals.prefixUrl && this._internals.url) { + const { href } = this._internals.url; + this._internals.url.href = value + href.slice(this._internals.prefixUrl.length); + } + this._internals.prefixUrl = value; + } + get body() { + return this._internals.body; + } + set body(value) { + assert.any([dist_default.string, dist_default.buffer, dist_default.nodeStream, dist_default.generator, dist_default.asyncGenerator, isFormData, dist_default.undefined], value); + if (dist_default.nodeStream(value)) { + assert.truthy(value.readable); + } + if (value !== void 0) { + assert.undefined(this._internals.form); + assert.undefined(this._internals.json); + } + this._internals.body = value; + } + get form() { + return this._internals.form; + } + set form(value) { + assert.any([dist_default.plainObject, dist_default.undefined], value); + if (value !== void 0) { + assert.undefined(this._internals.body); + assert.undefined(this._internals.json); + } + this._internals.form = value; + } + get json() { + return this._internals.json; + } + set json(value) { + if (value !== void 0) { + assert.undefined(this._internals.body); + assert.undefined(this._internals.form); + } + this._internals.json = value; + } + get url() { + return this._internals.url; + } + set url(value) { + assert.any([dist_default.string, dist_default.urlInstance, dist_default.undefined], value); + if (value === void 0) { + this._internals.url = void 0; + return; + } + if (dist_default.string(value) && value.startsWith("/")) { + throw new Error("`url` must not start with a slash"); + } + const urlString = `${this.prefixUrl}${value.toString()}`; + const url = new import_node_url2.URL(urlString); + this._internals.url = url; + decodeURI(urlString); + if (url.protocol === "unix:") { + url.href = `http://unix${url.pathname}${url.search}`; + } + if (url.protocol !== "http:" && url.protocol !== "https:") { + const error2 = new Error(`Unsupported protocol: ${url.protocol}`); + error2.code = "ERR_UNSUPPORTED_PROTOCOL"; + throw error2; + } + if (this._internals.username) { + url.username = this._internals.username; + this._internals.username = ""; + } + if (this._internals.password) { + url.password = this._internals.password; + this._internals.password = ""; + } + if (this._internals.searchParams) { + url.search = this._internals.searchParams.toString(); + this._internals.searchParams = void 0; + } + if (url.hostname === "unix") { + if (!this._internals.enableUnixSockets) { + throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled"); + } + const matches = /(?.+?):(?.+)/.exec(`${url.pathname}${url.search}`); + if (matches?.groups) { + const { socketPath, path: path7 } = matches.groups; + this._unixOptions = { + socketPath, + path: path7, + host: "" + }; + } else { + this._unixOptions = void 0; + } + return; + } + this._unixOptions = void 0; + } + get cookieJar() { + return this._internals.cookieJar; + } + set cookieJar(value) { + assert.any([dist_default.object, dist_default.undefined], value); + if (value === void 0) { + this._internals.cookieJar = void 0; + return; + } + let { setCookie, getCookieString } = value; + assert.function_(setCookie); + assert.function_(getCookieString); + if (setCookie.length === 4 && getCookieString.length === 0) { + setCookie = (0, import_node_util3.promisify)(setCookie.bind(value)); + getCookieString = (0, import_node_util3.promisify)(getCookieString.bind(value)); + this._internals.cookieJar = { + setCookie, + getCookieString + }; + } else { + this._internals.cookieJar = value; + } + } + get signal() { + return this._internals.signal; + } + set signal(value) { + assert.object(value); + this._internals.signal = value; + } + get ignoreInvalidCookies() { + return this._internals.ignoreInvalidCookies; + } + set ignoreInvalidCookies(value) { + assert.boolean(value); + this._internals.ignoreInvalidCookies = value; + } + get searchParams() { + if (this._internals.url) { + return this._internals.url.searchParams; + } + if (this._internals.searchParams === void 0) { + this._internals.searchParams = new import_node_url2.URLSearchParams(); + } + return this._internals.searchParams; + } + set searchParams(value) { + assert.any([dist_default.string, dist_default.object, dist_default.undefined], value); + const url = this._internals.url; + if (value === void 0) { + this._internals.searchParams = void 0; + if (url) { + url.search = ""; + } + return; + } + const searchParameters = this.searchParams; + let updated; + if (dist_default.string(value)) { + updated = new import_node_url2.URLSearchParams(value); + } else if (value instanceof import_node_url2.URLSearchParams) { + updated = value; + } else { + validateSearchParameters(value); + updated = new import_node_url2.URLSearchParams(); + for (const key in value) { + const entry = value[key]; + if (entry === null) { + updated.append(key, ""); + } else if (entry === void 0) { + searchParameters.delete(key); + } else { + updated.append(key, entry); + } + } + } + if (this._merging) { + for (const key of updated.keys()) { + searchParameters.delete(key); + } + for (const [key, value2] of updated) { + searchParameters.append(key, value2); + } + } else if (url) { + url.search = searchParameters.toString(); + } else { + this._internals.searchParams = searchParameters; + } + } + get searchParameters() { + throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead."); + } + set searchParameters(_value) { + throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead."); + } + get dnsLookup() { + return this._internals.dnsLookup; + } + set dnsLookup(value) { + assert.any([dist_default.function_, dist_default.undefined], value); + this._internals.dnsLookup = value; + } + get dnsCache() { + return this._internals.dnsCache; + } + set dnsCache(value) { + assert.any([dist_default.object, dist_default.boolean, dist_default.undefined], value); + if (value === true) { + this._internals.dnsCache = getGlobalDnsCache(); + } else if (value === false) { + this._internals.dnsCache = void 0; + } else { + this._internals.dnsCache = value; + } + } + get context() { + return this._internals.context; + } + set context(value) { + assert.object(value); + if (this._merging) { + Object.assign(this._internals.context, value); + } else { + this._internals.context = { ...value }; + } + } + get hooks() { + return this._internals.hooks; + } + set hooks(value) { + assert.object(value); + for (const knownHookEvent in value) { + if (!(knownHookEvent in this._internals.hooks)) { + throw new Error(`Unexpected hook event: ${knownHookEvent}`); + } + const typedKnownHookEvent = knownHookEvent; + const hooks = value[typedKnownHookEvent]; + assert.any([dist_default.array, dist_default.undefined], hooks); + if (hooks) { + for (const hook of hooks) { + assert.function_(hook); + } + } + if (this._merging) { + if (hooks) { + this._internals.hooks[typedKnownHookEvent].push(...hooks); + } + } else { + if (!hooks) { + throw new Error(`Missing hook event: ${knownHookEvent}`); + } + this._internals.hooks[knownHookEvent] = [...hooks]; + } + } + } + get followRedirect() { + return this._internals.followRedirect; + } + set followRedirect(value) { + assert.boolean(value); + this._internals.followRedirect = value; + } + get followRedirects() { + throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead."); + } + set followRedirects(_value) { + throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead."); + } + get maxRedirects() { + return this._internals.maxRedirects; + } + set maxRedirects(value) { + assert.number(value); + this._internals.maxRedirects = value; + } + get cache() { + return this._internals.cache; + } + set cache(value) { + assert.any([dist_default.object, dist_default.string, dist_default.boolean, dist_default.undefined], value); + if (value === true) { + this._internals.cache = globalCache; + } else if (value === false) { + this._internals.cache = void 0; + } else { + this._internals.cache = value; + } + } + get throwHttpErrors() { + return this._internals.throwHttpErrors; + } + set throwHttpErrors(value) { + assert.boolean(value); + this._internals.throwHttpErrors = value; + } + get username() { + const url = this._internals.url; + const value = url ? url.username : this._internals.username; + return decodeURIComponent(value); + } + set username(value) { + assert.string(value); + const url = this._internals.url; + const fixedValue = encodeURIComponent(value); + if (url) { + url.username = fixedValue; + } else { + this._internals.username = fixedValue; + } + } + get password() { + const url = this._internals.url; + const value = url ? url.password : this._internals.password; + return decodeURIComponent(value); + } + set password(value) { + assert.string(value); + const url = this._internals.url; + const fixedValue = encodeURIComponent(value); + if (url) { + url.password = fixedValue; + } else { + this._internals.password = fixedValue; + } + } + get http2() { + return this._internals.http2; + } + set http2(value) { + assert.boolean(value); + this._internals.http2 = value; + } + get allowGetBody() { + return this._internals.allowGetBody; + } + set allowGetBody(value) { + assert.boolean(value); + this._internals.allowGetBody = value; + } + get headers() { + return this._internals.headers; + } + set headers(value) { + assert.plainObject(value); + if (this._merging) { + Object.assign(this._internals.headers, lowercaseKeys(value)); + } else { + this._internals.headers = lowercaseKeys(value); + } + } + get methodRewriting() { + return this._internals.methodRewriting; + } + set methodRewriting(value) { + assert.boolean(value); + this._internals.methodRewriting = value; + } + get dnsLookupIpVersion() { + return this._internals.dnsLookupIpVersion; + } + set dnsLookupIpVersion(value) { + if (value !== void 0 && value !== 4 && value !== 6) { + throw new TypeError(`Invalid DNS lookup IP version: ${value}`); + } + this._internals.dnsLookupIpVersion = value; + } + get parseJson() { + return this._internals.parseJson; + } + set parseJson(value) { + assert.function_(value); + this._internals.parseJson = value; + } + get stringifyJson() { + return this._internals.stringifyJson; + } + set stringifyJson(value) { + assert.function_(value); + this._internals.stringifyJson = value; + } + get retry() { + return this._internals.retry; + } + set retry(value) { + assert.plainObject(value); + assert.any([dist_default.function_, dist_default.undefined], value.calculateDelay); + assert.any([dist_default.number, dist_default.undefined], value.maxRetryAfter); + assert.any([dist_default.number, dist_default.undefined], value.limit); + assert.any([dist_default.array, dist_default.undefined], value.methods); + assert.any([dist_default.array, dist_default.undefined], value.statusCodes); + assert.any([dist_default.array, dist_default.undefined], value.errorCodes); + assert.any([dist_default.number, dist_default.undefined], value.noise); + if (value.noise && Math.abs(value.noise) > 100) { + throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${value.noise}`); + } + for (const key in value) { + if (!(key in this._internals.retry)) { + throw new Error(`Unexpected retry option: ${key}`); + } + } + if (this._merging) { + Object.assign(this._internals.retry, value); + } else { + this._internals.retry = { ...value }; + } + const { retry } = this._internals; + retry.methods = [...new Set(retry.methods.map((method) => method.toUpperCase()))]; + retry.statusCodes = [...new Set(retry.statusCodes)]; + retry.errorCodes = [...new Set(retry.errorCodes)]; + } + get localAddress() { + return this._internals.localAddress; + } + set localAddress(value) { + assert.any([dist_default.string, dist_default.undefined], value); + this._internals.localAddress = value; + } + get method() { + return this._internals.method; + } + set method(value) { + assert.string(value); + this._internals.method = value.toUpperCase(); + } + get createConnection() { + return this._internals.createConnection; + } + set createConnection(value) { + assert.any([dist_default.function_, dist_default.undefined], value); + this._internals.createConnection = value; + } + get cacheOptions() { + return this._internals.cacheOptions; + } + set cacheOptions(value) { + assert.plainObject(value); + assert.any([dist_default.boolean, dist_default.undefined], value.shared); + assert.any([dist_default.number, dist_default.undefined], value.cacheHeuristic); + assert.any([dist_default.number, dist_default.undefined], value.immutableMinTimeToLive); + assert.any([dist_default.boolean, dist_default.undefined], value.ignoreCargoCult); + for (const key in value) { + if (!(key in this._internals.cacheOptions)) { + throw new Error(`Cache option \`${key}\` does not exist`); + } + } + if (this._merging) { + Object.assign(this._internals.cacheOptions, value); + } else { + this._internals.cacheOptions = { ...value }; + } + } + get https() { + return this._internals.https; + } + set https(value) { + assert.plainObject(value); + assert.any([dist_default.boolean, dist_default.undefined], value.rejectUnauthorized); + assert.any([dist_default.function_, dist_default.undefined], value.checkServerIdentity); + assert.any([dist_default.string, dist_default.object, dist_default.array, dist_default.undefined], value.certificateAuthority); + assert.any([dist_default.string, dist_default.object, dist_default.array, dist_default.undefined], value.key); + assert.any([dist_default.string, dist_default.object, dist_default.array, dist_default.undefined], value.certificate); + assert.any([dist_default.string, dist_default.undefined], value.passphrase); + assert.any([dist_default.string, dist_default.buffer, dist_default.array, dist_default.undefined], value.pfx); + assert.any([dist_default.array, dist_default.undefined], value.alpnProtocols); + assert.any([dist_default.string, dist_default.undefined], value.ciphers); + assert.any([dist_default.string, dist_default.buffer, dist_default.undefined], value.dhparam); + assert.any([dist_default.string, dist_default.undefined], value.signatureAlgorithms); + assert.any([dist_default.string, dist_default.undefined], value.minVersion); + assert.any([dist_default.string, dist_default.undefined], value.maxVersion); + assert.any([dist_default.boolean, dist_default.undefined], value.honorCipherOrder); + assert.any([dist_default.number, dist_default.undefined], value.tlsSessionLifetime); + assert.any([dist_default.string, dist_default.undefined], value.ecdhCurve); + assert.any([dist_default.string, dist_default.buffer, dist_default.array, dist_default.undefined], value.certificateRevocationLists); + for (const key in value) { + if (!(key in this._internals.https)) { + throw new Error(`HTTPS option \`${key}\` does not exist`); + } + } + if (this._merging) { + Object.assign(this._internals.https, value); + } else { + this._internals.https = { ...value }; + } + } + get encoding() { + return this._internals.encoding; + } + set encoding(value) { + if (value === null) { + throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead"); + } + assert.any([dist_default.string, dist_default.undefined], value); + this._internals.encoding = value; + } + get resolveBodyOnly() { + return this._internals.resolveBodyOnly; + } + set resolveBodyOnly(value) { + assert.boolean(value); + this._internals.resolveBodyOnly = value; + } + get isStream() { + return this._internals.isStream; + } + set isStream(value) { + assert.boolean(value); + this._internals.isStream = value; + } + get responseType() { + return this._internals.responseType; + } + set responseType(value) { + if (value === void 0) { + this._internals.responseType = "text"; + return; + } + if (value !== "text" && value !== "buffer" && value !== "json") { + throw new Error(`Invalid \`responseType\` option: ${value}`); + } + this._internals.responseType = value; + } + get pagination() { + return this._internals.pagination; + } + set pagination(value) { + assert.object(value); + if (this._merging) { + Object.assign(this._internals.pagination, value); + } else { + this._internals.pagination = value; + } + } + get auth() { + throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead."); + } + set auth(_value) { + throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead."); + } + get setHost() { + return this._internals.setHost; + } + set setHost(value) { + assert.boolean(value); + this._internals.setHost = value; + } + get maxHeaderSize() { + return this._internals.maxHeaderSize; + } + set maxHeaderSize(value) { + assert.any([dist_default.number, dist_default.undefined], value); + this._internals.maxHeaderSize = value; + } + get enableUnixSockets() { + return this._internals.enableUnixSockets; + } + set enableUnixSockets(value) { + assert.boolean(value); + this._internals.enableUnixSockets = value; + } + toJSON() { + return { ...this._internals }; + } + [Symbol.for("nodejs.util.inspect.custom")](_depth, options) { + return (0, import_node_util3.inspect)(this._internals, options); + } + createNativeRequestOptions() { + const internals = this._internals; + const url = internals.url; + let agent; + if (url.protocol === "https:") { + agent = internals.http2 ? internals.agent : internals.agent.https; + } else { + agent = internals.agent.http; + } + const { https: https2 } = internals; + let { pfx } = https2; + if (dist_default.array(pfx) && dist_default.plainObject(pfx[0])) { + pfx = pfx.map((object) => ({ + buf: object.buffer, + passphrase: object.passphrase + })); + } + return { + ...internals.cacheOptions, + ...this._unixOptions, + ALPNProtocols: https2.alpnProtocols, + ca: https2.certificateAuthority, + cert: https2.certificate, + key: https2.key, + passphrase: https2.passphrase, + pfx: https2.pfx, + rejectUnauthorized: https2.rejectUnauthorized, + checkServerIdentity: https2.checkServerIdentity ?? import_node_tls.checkServerIdentity, + ciphers: https2.ciphers, + honorCipherOrder: https2.honorCipherOrder, + minVersion: https2.minVersion, + maxVersion: https2.maxVersion, + sigalgs: https2.signatureAlgorithms, + sessionTimeout: https2.tlsSessionLifetime, + dhparam: https2.dhparam, + ecdhCurve: https2.ecdhCurve, + crl: https2.certificateRevocationLists, + lookup: internals.dnsLookup ?? internals.dnsCache?.lookup, + family: internals.dnsLookupIpVersion, + agent, + setHost: internals.setHost, + method: internals.method, + maxHeaderSize: internals.maxHeaderSize, + localAddress: internals.localAddress, + headers: internals.headers, + createConnection: internals.createConnection, + timeout: internals.http2 ? getHttp2TimeoutOption(internals) : void 0, + h2session: internals.h2session + }; + } + getRequestFunction() { + const url = this._internals.url; + const { request } = this._internals; + if (!request && url) { + return this.getFallbackRequestFunction(); + } + return request; + } + getFallbackRequestFunction() { + const url = this._internals.url; + if (!url) { + return; + } + if (url.protocol === "https:") { + if (this._internals.http2) { + if (major < 15 || major === 15 && minor < 10) { + const error2 = new Error("To use the `http2` option, install Node.js 15.10.0 or above"); + error2.code = "EUNSUPPORTED"; + throw error2; + } + return import_http2_wrapper.default.auto; + } + return import_node_https.default.request; + } + return import_node_http.default.request; + } + freeze() { + const options = this._internals; + Object.freeze(options); + Object.freeze(options.hooks); + Object.freeze(options.hooks.afterResponse); + Object.freeze(options.hooks.beforeError); + Object.freeze(options.hooks.beforeRedirect); + Object.freeze(options.hooks.beforeRequest); + Object.freeze(options.hooks.beforeRetry); + Object.freeze(options.hooks.init); + Object.freeze(options.https); + Object.freeze(options.cacheOptions); + Object.freeze(options.agent); + Object.freeze(options.headers); + Object.freeze(options.timeout); + Object.freeze(options.retry); + Object.freeze(options.retry.errorCodes); + Object.freeze(options.retry.methods); + Object.freeze(options.retry.statusCodes); + } +}; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/response.js +var isResponseOk = (response) => { + const { statusCode } = response; + const limitStatusCode = response.request.options.followRedirect ? 299 : 399; + return statusCode >= 200 && statusCode <= limitStatusCode || statusCode === 304; +}; +var ParseError = class extends RequestError { + constructor(error2, response) { + const { options } = response.request; + super(`${error2.message} in "${options.url.toString()}"`, error2, response.request); + this.name = "ParseError"; + this.code = "ERR_BODY_PARSE_FAILURE"; + } +}; +var parseBody = (response, responseType, parseJson, encoding) => { + const { rawBody } = response; + try { + if (responseType === "text") { + return rawBody.toString(encoding); + } + if (responseType === "json") { + return rawBody.length === 0 ? "" : parseJson(rawBody.toString(encoding)); + } + if (responseType === "buffer") { + return rawBody; + } + } catch (error2) { + throw new ParseError(error2, response); + } + throw new ParseError({ + message: `Unknown body type '${responseType}'`, + name: "Error" + }, response); +}; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/utils/is-client-request.js +function isClientRequest(clientRequest) { + return clientRequest.writable && !clientRequest.writableEnded; +} +var is_client_request_default = isClientRequest; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/utils/is-unix-socket-url.js +function isUnixSocketURL(url) { + return url.protocol === "unix:" || url.hostname === "unix"; +} + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/core/index.js +var supportsBrotli = dist_default.string(import_node_process2.default.versions.brotli); +var methodsWithoutBody = /* @__PURE__ */ new Set(["GET", "HEAD"]); +var cacheableStore = new WeakableMap(); +var redirectCodes = /* @__PURE__ */ new Set([300, 301, 302, 303, 304, 307, 308]); +var proxiedRequestEvents = [ + "socket", + "connect", + "continue", + "information", + "upgrade" +]; +var noop2 = () => { +}; +var Request = class extends import_node_stream3.Duplex { + constructor(url, options, defaults2) { + super({ + autoDestroy: false, + highWaterMark: 0 + }); + Object.defineProperty(this, "constructor", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_noPipe", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "options", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "response", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "requestUrl", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "redirectUrls", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "retryCount", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_stopRetry", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_downloadedSize", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_uploadedSize", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_stopReading", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_pipedServerResponses", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_request", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_responseSize", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_bodySize", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_unproxyEvents", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_isFromCache", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_cannotHaveBody", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_triggerRead", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_cancelTimeouts", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_nativeResponse", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_flushed", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_aborted", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "_requestInitialized", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + this._downloadedSize = 0; + this._uploadedSize = 0; + this._stopReading = false; + this._pipedServerResponses = /* @__PURE__ */ new Set(); + this._cannotHaveBody = false; + this._unproxyEvents = noop2; + this._triggerRead = false; + this._cancelTimeouts = noop2; + this._jobs = []; + this._flushed = false; + this._requestInitialized = false; + this._aborted = false; + this.redirectUrls = []; + this.retryCount = 0; + this._stopRetry = noop2; + this.on("pipe", (source) => { + if (source.headers) { + Object.assign(this.options.headers, source.headers); + } + }); + this.on("newListener", (event) => { + if (event === "retry" && this.listenerCount("retry") > 0) { + throw new Error("A retry listener has been attached already."); + } + }); + try { + this.options = new Options(url, options, defaults2); + if (!this.options.url) { + if (this.options.prefixUrl === "") { + throw new TypeError("Missing `url` property"); + } + this.options.url = ""; + } + this.requestUrl = this.options.url; + } catch (error2) { + const { options: options2 } = error2; + if (options2) { + this.options = options2; + } + this.flush = async () => { + this.flush = async () => { + }; + this.destroy(error2); + }; + return; + } + if (this.options.signal?.aborted) { + this.destroy(new AbortError(this)); + } + this.options.signal?.addEventListener("abort", () => { + this.destroy(new AbortError(this)); + }); + const { body } = this.options; + if (dist_default.nodeStream(body)) { + body.once("error", (error2) => { + if (this._flushed) { + this._beforeError(new UploadError(error2, this)); + } else { + this.flush = async () => { + this.flush = async () => { + }; + this._beforeError(new UploadError(error2, this)); + }; + } + }); + } + } + async flush() { + if (this._flushed) { + return; + } + this._flushed = true; + try { + await this._finalizeBody(); + if (this.destroyed) { + return; + } + await this._makeRequest(); + if (this.destroyed) { + this._request?.destroy(); + return; + } + for (const job of this._jobs) { + job(); + } + this._jobs.length = 0; + this._requestInitialized = true; + } catch (error2) { + this._beforeError(error2); + } + } + _beforeError(error2) { + if (this._stopReading) { + return; + } + const { response, options } = this; + const attemptCount = this.retryCount + (error2.name === "RetryError" ? 0 : 1); + this._stopReading = true; + if (!(error2 instanceof RequestError)) { + error2 = new RequestError(error2.message, error2, this); + } + const typedError = error2; + void (async () => { + if (response?.readable && !response.rawBody && !this._request?.socket?.destroyed) { + response.setEncoding(this.readableEncoding); + const success = await this._setRawBody(response); + if (success) { + response.body = response.rawBody.toString(); + } + } + if (this.listenerCount("retry") !== 0) { + let backoff; + try { + let retryAfter; + if (response && "retry-after" in response.headers) { + retryAfter = Number(response.headers["retry-after"]); + if (Number.isNaN(retryAfter)) { + retryAfter = Date.parse(response.headers["retry-after"]) - Date.now(); + if (retryAfter <= 0) { + retryAfter = 1; + } + } else { + retryAfter *= 1e3; + } + } + const retryOptions = options.retry; + backoff = await retryOptions.calculateDelay({ + attemptCount, + retryOptions, + error: typedError, + retryAfter, + computedValue: calculate_retry_delay_default({ + attemptCount, + retryOptions, + error: typedError, + retryAfter, + computedValue: retryOptions.maxRetryAfter ?? options.timeout.request ?? Number.POSITIVE_INFINITY + }) + }); + } catch (error_) { + void this._error(new RequestError(error_.message, error_, this)); + return; + } + if (backoff) { + await new Promise((resolve) => { + const timeout = setTimeout(resolve, backoff); + this._stopRetry = () => { + clearTimeout(timeout); + resolve(); + }; + }); + if (this.destroyed) { + return; + } + try { + for (const hook of this.options.hooks.beforeRetry) { + await hook(typedError, this.retryCount + 1); + } + } catch (error_) { + void this._error(new RequestError(error_.message, error2, this)); + return; + } + if (this.destroyed) { + return; + } + this.destroy(); + this.emit("retry", this.retryCount + 1, error2, (updatedOptions) => { + const request = new Request(options.url, updatedOptions, options); + request.retryCount = this.retryCount + 1; + import_node_process2.default.nextTick(() => { + void request.flush(); + }); + return request; + }); + return; + } + } + void this._error(typedError); + })(); + } + _read() { + this._triggerRead = true; + const { response } = this; + if (response && !this._stopReading) { + if (response.readableLength) { + this._triggerRead = false; + } + let data; + while ((data = response.read()) !== null) { + this._downloadedSize += data.length; + const progress = this.downloadProgress; + if (progress.percent < 1) { + this.emit("downloadProgress", progress); + } + this.push(data); + } + } + } + _write(chunk, encoding, callback) { + const write = () => { + this._writeRequest(chunk, encoding, callback); + }; + if (this._requestInitialized) { + write(); + } else { + this._jobs.push(write); + } + } + _final(callback) { + const endRequest = () => { + if (!this._request || this._request.destroyed) { + callback(); + return; + } + this._request.end((error2) => { + if (this._request._writableState?.errored) { + return; + } + if (!error2) { + this._bodySize = this._uploadedSize; + this.emit("uploadProgress", this.uploadProgress); + this._request.emit("upload-complete"); + } + callback(error2); + }); + }; + if (this._requestInitialized) { + endRequest(); + } else { + this._jobs.push(endRequest); + } + } + _destroy(error2, callback) { + this._stopReading = true; + this.flush = async () => { + }; + this._stopRetry(); + this._cancelTimeouts(); + if (this.options) { + const { body } = this.options; + if (dist_default.nodeStream(body)) { + body.destroy(); + } + } + if (this._request) { + this._request.destroy(); + } + if (error2 !== null && !dist_default.undefined(error2) && !(error2 instanceof RequestError)) { + error2 = new RequestError(error2.message, error2, this); + } + callback(error2); + } + pipe(destination, options) { + if (destination instanceof import_node_http2.ServerResponse) { + this._pipedServerResponses.add(destination); + } + return super.pipe(destination, options); + } + unpipe(destination) { + if (destination instanceof import_node_http2.ServerResponse) { + this._pipedServerResponses.delete(destination); + } + super.unpipe(destination); + return this; + } + async _finalizeBody() { + const { options } = this; + const { headers } = options; + const isForm = !dist_default.undefined(options.form); + const isJSON = !dist_default.undefined(options.json); + const isBody = !dist_default.undefined(options.body); + const cannotHaveBody = methodsWithoutBody.has(options.method) && !(options.method === "GET" && options.allowGetBody); + this._cannotHaveBody = cannotHaveBody; + if (isForm || isJSON || isBody) { + if (cannotHaveBody) { + throw new TypeError(`The \`${options.method}\` method cannot be used with a body`); + } + const noContentType = !dist_default.string(headers["content-type"]); + if (isBody) { + if (isFormData(options.body)) { + const encoder = new FormDataEncoder(options.body); + if (noContentType) { + headers["content-type"] = encoder.headers["Content-Type"]; + } + if ("Content-Length" in encoder.headers) { + headers["content-length"] = encoder.headers["Content-Length"]; + } + options.body = encoder.encode(); + } + if (isFormData2(options.body) && noContentType) { + headers["content-type"] = `multipart/form-data; boundary=${options.body.getBoundary()}`; + } + } else if (isForm) { + if (noContentType) { + headers["content-type"] = "application/x-www-form-urlencoded"; + } + const { form } = options; + options.form = void 0; + options.body = new import_node_url3.URLSearchParams(form).toString(); + } else { + if (noContentType) { + headers["content-type"] = "application/json"; + } + const { json } = options; + options.json = void 0; + options.body = options.stringifyJson(json); + } + const uploadBodySize = await getBodySize(options.body, options.headers); + if (dist_default.undefined(headers["content-length"]) && dist_default.undefined(headers["transfer-encoding"]) && !cannotHaveBody && !dist_default.undefined(uploadBodySize)) { + headers["content-length"] = String(uploadBodySize); + } + } + if (options.responseType === "json" && !("accept" in options.headers)) { + options.headers.accept = "application/json"; + } + this._bodySize = Number(headers["content-length"]) || void 0; + } + async _onResponseBase(response) { + if (this.isAborted) { + return; + } + const { options } = this; + const { url } = options; + this._nativeResponse = response; + if (options.decompress) { + response = (0, import_decompress_response.default)(response); + } + const statusCode = response.statusCode; + const typedResponse = response; + typedResponse.statusMessage = typedResponse.statusMessage ? typedResponse.statusMessage : import_node_http2.default.STATUS_CODES[statusCode]; + typedResponse.url = options.url.toString(); + typedResponse.requestUrl = this.requestUrl; + typedResponse.redirectUrls = this.redirectUrls; + typedResponse.request = this; + typedResponse.isFromCache = this._nativeResponse.fromCache ?? false; + typedResponse.ip = this.ip; + typedResponse.retryCount = this.retryCount; + typedResponse.ok = isResponseOk(typedResponse); + this._isFromCache = typedResponse.isFromCache; + this._responseSize = Number(response.headers["content-length"]) || void 0; + this.response = typedResponse; + response.once("end", () => { + this._responseSize = this._downloadedSize; + this.emit("downloadProgress", this.downloadProgress); + }); + response.once("error", (error2) => { + this._aborted = true; + response.destroy(); + this._beforeError(new ReadError(error2, this)); + }); + response.once("aborted", () => { + this._aborted = true; + this._beforeError(new ReadError({ + name: "Error", + message: "The server aborted pending request", + code: "ECONNRESET" + }, this)); + }); + this.emit("downloadProgress", this.downloadProgress); + const rawCookies = response.headers["set-cookie"]; + if (dist_default.object(options.cookieJar) && rawCookies) { + let promises = rawCookies.map(async (rawCookie) => options.cookieJar.setCookie(rawCookie, url.toString())); + if (options.ignoreInvalidCookies) { + promises = promises.map(async (promise) => { + try { + await promise; + } catch { + } + }); + } + try { + await Promise.all(promises); + } catch (error2) { + this._beforeError(error2); + return; + } + } + if (this.isAborted) { + return; + } + if (options.followRedirect && response.headers.location && redirectCodes.has(statusCode)) { + response.resume(); + this._cancelTimeouts(); + this._unproxyEvents(); + if (this.redirectUrls.length >= options.maxRedirects) { + this._beforeError(new MaxRedirectsError(this)); + return; + } + this._request = void 0; + const updatedOptions = new Options(void 0, void 0, this.options); + const serverRequestedGet = statusCode === 303 && updatedOptions.method !== "GET" && updatedOptions.method !== "HEAD"; + const canRewrite = statusCode !== 307 && statusCode !== 308; + const userRequestedGet = updatedOptions.methodRewriting && canRewrite; + if (serverRequestedGet || userRequestedGet) { + updatedOptions.method = "GET"; + updatedOptions.body = void 0; + updatedOptions.json = void 0; + updatedOptions.form = void 0; + delete updatedOptions.headers["content-length"]; + } + try { + const redirectBuffer = import_node_buffer2.Buffer.from(response.headers.location, "binary").toString(); + const redirectUrl = new import_node_url3.URL(redirectBuffer, url); + if (!isUnixSocketURL(url) && isUnixSocketURL(redirectUrl)) { + this._beforeError(new RequestError("Cannot redirect to UNIX socket", {}, this)); + return; + } + if (redirectUrl.hostname !== url.hostname || redirectUrl.port !== url.port) { + if ("host" in updatedOptions.headers) { + delete updatedOptions.headers.host; + } + if ("cookie" in updatedOptions.headers) { + delete updatedOptions.headers.cookie; + } + if ("authorization" in updatedOptions.headers) { + delete updatedOptions.headers.authorization; + } + if (updatedOptions.username || updatedOptions.password) { + updatedOptions.username = ""; + updatedOptions.password = ""; + } + } else { + redirectUrl.username = updatedOptions.username; + redirectUrl.password = updatedOptions.password; + } + this.redirectUrls.push(redirectUrl); + updatedOptions.prefixUrl = ""; + updatedOptions.url = redirectUrl; + for (const hook of updatedOptions.hooks.beforeRedirect) { + await hook(updatedOptions, typedResponse); + } + this.emit("redirect", updatedOptions, typedResponse); + this.options = updatedOptions; + await this._makeRequest(); + } catch (error2) { + this._beforeError(error2); + return; + } + return; + } + if (options.isStream && options.throwHttpErrors && !isResponseOk(typedResponse)) { + this._beforeError(new HTTPError(typedResponse)); + return; + } + response.on("readable", () => { + if (this._triggerRead) { + this._read(); + } + }); + this.on("resume", () => { + response.resume(); + }); + this.on("pause", () => { + response.pause(); + }); + response.once("end", () => { + this.push(null); + }); + if (this._noPipe) { + const success = await this._setRawBody(); + if (success) { + this.emit("response", response); + } + return; + } + this.emit("response", response); + for (const destination of this._pipedServerResponses) { + if (destination.headersSent) { + continue; + } + for (const key in response.headers) { + const isAllowed = options.decompress ? key !== "content-encoding" : true; + const value = response.headers[key]; + if (isAllowed) { + destination.setHeader(key, value); + } + } + destination.statusCode = statusCode; + } + } + async _setRawBody(from = this) { + if (from.readableEnded) { + return false; + } + try { + const rawBody = await (0, import_get_stream2.buffer)(from); + if (!this.isAborted) { + this.response.rawBody = rawBody; + return true; + } + } catch { + } + return false; + } + async _onResponse(response) { + try { + await this._onResponseBase(response); + } catch (error2) { + this._beforeError(error2); + } + } + _onRequest(request) { + const { options } = this; + const { timeout, url } = options; + source_default(request); + if (this.options.http2) { + request.setTimeout(0); + } + this._cancelTimeouts = timedOut(request, timeout, url); + const responseEventName = options.cache ? "cacheableResponse" : "response"; + request.once(responseEventName, (response) => { + void this._onResponse(response); + }); + request.once("error", (error2) => { + this._aborted = true; + request.destroy(); + error2 = error2 instanceof TimeoutError2 ? new TimeoutError(error2, this.timings, this) : new RequestError(error2.message, error2, this); + this._beforeError(error2); + }); + this._unproxyEvents = proxyEvents(request, this, proxiedRequestEvents); + this._request = request; + this.emit("uploadProgress", this.uploadProgress); + this._sendBody(); + this.emit("request", request); + } + async _asyncWrite(chunk) { + return new Promise((resolve, reject) => { + super.write(chunk, (error2) => { + if (error2) { + reject(error2); + return; + } + resolve(); + }); + }); + } + _sendBody() { + const { body } = this.options; + const currentRequest = this.redirectUrls.length === 0 ? this : this._request ?? this; + if (dist_default.nodeStream(body)) { + body.pipe(currentRequest); + } else if (dist_default.generator(body) || dist_default.asyncGenerator(body)) { + (async () => { + try { + for await (const chunk of body) { + await this._asyncWrite(chunk); + } + super.end(); + } catch (error2) { + this._beforeError(error2); + } + })(); + } else if (!dist_default.undefined(body)) { + this._writeRequest(body, void 0, () => { + }); + currentRequest.end(); + } else if (this._cannotHaveBody || this._noPipe) { + currentRequest.end(); + } + } + _prepareCache(cache2) { + if (!cacheableStore.has(cache2)) { + const cacheableRequest = new dist_default2((requestOptions, handler) => { + const result = requestOptions._request(requestOptions, handler); + if (dist_default.promise(result)) { + result.once = (event, handler2) => { + if (event === "error") { + (async () => { + try { + await result; + } catch (error2) { + handler2(error2); + } + })(); + } else if (event === "abort") { + (async () => { + try { + const request = await result; + request.once("abort", handler2); + } catch { + } + })(); + } else { + throw new Error(`Unknown HTTP2 promise event: ${event}`); + } + return result; + }; + } + return result; + }, cache2); + cacheableStore.set(cache2, cacheableRequest.request()); + } + } + async _createCacheableRequest(url, options) { + return new Promise((resolve, reject) => { + Object.assign(options, urlToOptions(url)); + let request; + const cacheRequest = cacheableStore.get(options.cache)(options, async (response) => { + response._readableState.autoDestroy = false; + if (request) { + const fix = () => { + if (response.req) { + response.complete = response.req.res.complete; + } + }; + response.prependOnceListener("end", fix); + fix(); + (await request).emit("cacheableResponse", response); + } + resolve(response); + }); + cacheRequest.once("error", reject); + cacheRequest.once("request", async (requestOrPromise) => { + request = requestOrPromise; + resolve(request); + }); + }); + } + async _makeRequest() { + const { options } = this; + const { headers, username, password } = options; + const cookieJar = options.cookieJar; + for (const key in headers) { + if (dist_default.undefined(headers[key])) { + delete headers[key]; + } else if (dist_default.null_(headers[key])) { + throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${key}\` header`); + } + } + if (options.decompress && dist_default.undefined(headers["accept-encoding"])) { + headers["accept-encoding"] = supportsBrotli ? "gzip, deflate, br" : "gzip, deflate"; + } + if (username || password) { + const credentials = import_node_buffer2.Buffer.from(`${username}:${password}`).toString("base64"); + headers.authorization = `Basic ${credentials}`; + } + if (cookieJar) { + const cookieString = await cookieJar.getCookieString(options.url.toString()); + if (dist_default.nonEmptyString(cookieString)) { + headers.cookie = cookieString; + } + } + options.prefixUrl = ""; + let request; + for (const hook of options.hooks.beforeRequest) { + const result = await hook(options); + if (!dist_default.undefined(result)) { + request = () => result; + break; + } + } + if (!request) { + request = options.getRequestFunction(); + } + const url = options.url; + this._requestOptions = options.createNativeRequestOptions(); + if (options.cache) { + this._requestOptions._request = request; + this._requestOptions.cache = options.cache; + this._requestOptions.body = options.body; + this._prepareCache(options.cache); + } + const fn = options.cache ? this._createCacheableRequest : request; + try { + let requestOrResponse = fn(url, this._requestOptions); + if (dist_default.promise(requestOrResponse)) { + requestOrResponse = await requestOrResponse; + } + if (dist_default.undefined(requestOrResponse)) { + requestOrResponse = options.getFallbackRequestFunction()(url, this._requestOptions); + if (dist_default.promise(requestOrResponse)) { + requestOrResponse = await requestOrResponse; + } + } + if (is_client_request_default(requestOrResponse)) { + this._onRequest(requestOrResponse); + } else if (this.writable) { + this.once("finish", () => { + void this._onResponse(requestOrResponse); + }); + this._sendBody(); + } else { + void this._onResponse(requestOrResponse); + } + } catch (error2) { + if (error2 instanceof CacheError2) { + throw new CacheError(error2, this); + } + throw error2; + } + } + async _error(error2) { + try { + if (error2 instanceof HTTPError && !this.options.throwHttpErrors) { + } else { + for (const hook of this.options.hooks.beforeError) { + error2 = await hook(error2); + } + } + } catch (error_) { + error2 = new RequestError(error_.message, error_, this); + } + this.destroy(error2); + } + _writeRequest(chunk, encoding, callback) { + if (!this._request || this._request.destroyed) { + return; + } + this._request.write(chunk, encoding, (error2) => { + if (!error2 && !this._request.destroyed) { + this._uploadedSize += import_node_buffer2.Buffer.byteLength(chunk, encoding); + const progress = this.uploadProgress; + if (progress.percent < 1) { + this.emit("uploadProgress", progress); + } + } + callback(error2); + }); + } + get ip() { + return this.socket?.remoteAddress; + } + get isAborted() { + return this._aborted; + } + get socket() { + return this._request?.socket ?? void 0; + } + get downloadProgress() { + let percent; + if (this._responseSize) { + percent = this._downloadedSize / this._responseSize; + } else if (this._responseSize === this._downloadedSize) { + percent = 1; + } else { + percent = 0; + } + return { + percent, + transferred: this._downloadedSize, + total: this._responseSize + }; + } + get uploadProgress() { + let percent; + if (this._bodySize) { + percent = this._uploadedSize / this._bodySize; + } else if (this._bodySize === this._uploadedSize) { + percent = 1; + } else { + percent = 0; + } + return { + percent, + transferred: this._uploadedSize, + total: this._bodySize + }; + } + get timings() { + return this._request?.timings; + } + get isFromCache() { + return this._isFromCache; + } + get reusedSocket() { + return this._request?.reusedSocket; + } +}; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/as-promise/types.js +var CancelError2 = class extends RequestError { + constructor(request) { + super("Promise was canceled", {}, request); + this.name = "CancelError"; + this.code = "ERR_CANCELED"; + } + get isCanceled() { + return true; + } +}; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/as-promise/index.js +var proxiedRequestEvents2 = [ + "request", + "response", + "redirect", + "uploadProgress", + "downloadProgress" +]; +function asPromise(firstRequest) { + let globalRequest; + let globalResponse; + let normalizedOptions; + const emitter = new import_node_events2.EventEmitter(); + const promise = new PCancelable((resolve, reject, onCancel) => { + onCancel(() => { + globalRequest.destroy(); + }); + onCancel.shouldReject = false; + onCancel(() => { + reject(new CancelError2(globalRequest)); + }); + const makeRequest = (retryCount) => { + onCancel(() => { + }); + const request = firstRequest ?? new Request(void 0, void 0, normalizedOptions); + request.retryCount = retryCount; + request._noPipe = true; + globalRequest = request; + request.once("response", async (response) => { + const contentEncoding = (response.headers["content-encoding"] ?? "").toLowerCase(); + const isCompressed = contentEncoding === "gzip" || contentEncoding === "deflate" || contentEncoding === "br"; + const { options } = request; + if (isCompressed && !options.decompress) { + response.body = response.rawBody; + } else { + try { + response.body = parseBody(response, options.responseType, options.parseJson, options.encoding); + } catch (error2) { + response.body = response.rawBody.toString(); + if (isResponseOk(response)) { + request._beforeError(error2); + return; + } + } + } + try { + const hooks = options.hooks.afterResponse; + for (const [index, hook] of hooks.entries()) { + response = await hook(response, async (updatedOptions) => { + options.merge(updatedOptions); + options.prefixUrl = ""; + if (updatedOptions.url) { + options.url = updatedOptions.url; + } + options.hooks.afterResponse = options.hooks.afterResponse.slice(0, index); + throw new RetryError(request); + }); + if (!(dist_default.object(response) && dist_default.number(response.statusCode) && !dist_default.nullOrUndefined(response.body))) { + throw new TypeError("The `afterResponse` hook returned an invalid value"); + } + } + } catch (error2) { + request._beforeError(error2); + return; + } + globalResponse = response; + if (!isResponseOk(response)) { + request._beforeError(new HTTPError(response)); + return; + } + request.destroy(); + resolve(request.options.resolveBodyOnly ? response.body : response); + }); + const onError = (error2) => { + if (promise.isCanceled) { + return; + } + const { options } = request; + if (error2 instanceof HTTPError && !options.throwHttpErrors) { + const { response } = error2; + request.destroy(); + resolve(request.options.resolveBodyOnly ? response.body : response); + return; + } + reject(error2); + }; + request.once("error", onError); + const previousBody = request.options?.body; + request.once("retry", (newRetryCount, error2) => { + firstRequest = void 0; + const newBody = request.options.body; + if (previousBody === newBody && dist_default.nodeStream(newBody)) { + error2.message = "Cannot retry with consumed body stream"; + onError(error2); + return; + } + normalizedOptions = request.options; + makeRequest(newRetryCount); + }); + proxyEvents(request, emitter, proxiedRequestEvents2); + if (dist_default.undefined(firstRequest)) { + void request.flush(); + } + }; + makeRequest(0); + }); + promise.on = (event, fn) => { + emitter.on(event, fn); + return promise; + }; + promise.off = (event, fn) => { + emitter.off(event, fn); + return promise; + }; + const shortcut = (responseType) => { + const newPromise = (async () => { + await promise; + const { options } = globalResponse.request; + return parseBody(globalResponse, responseType, options.parseJson, options.encoding); + })(); + Object.defineProperties(newPromise, Object.getOwnPropertyDescriptors(promise)); + return newPromise; + }; + promise.json = () => { + if (globalRequest.options) { + const { headers } = globalRequest.options; + if (!globalRequest.writableFinished && !("accept" in headers)) { + headers.accept = "application/json"; + } + } + return shortcut("json"); + }; + promise.buffer = () => shortcut("buffer"); + promise.text = () => shortcut("text"); + return promise; +} + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/create.js +var delay = async (ms) => new Promise((resolve) => { + setTimeout(resolve, ms); +}); +var isGotInstance = (value) => dist_default.function_(value); +var aliases = [ + "get", + "post", + "put", + "patch", + "head", + "delete" +]; +var create = (defaults2) => { + defaults2 = { + options: new Options(void 0, void 0, defaults2.options), + handlers: [...defaults2.handlers], + mutableDefaults: defaults2.mutableDefaults + }; + Object.defineProperty(defaults2, "mutableDefaults", { + enumerable: true, + configurable: false, + writable: false + }); + const got2 = (url, options, defaultOptions2 = defaults2.options) => { + const request = new Request(url, options, defaultOptions2); + let promise; + const lastHandler = (normalized) => { + request.options = normalized; + request._noPipe = !normalized.isStream; + void request.flush(); + if (normalized.isStream) { + return request; + } + if (!promise) { + promise = asPromise(request); + } + return promise; + }; + let iteration = 0; + const iterateHandlers = (newOptions) => { + const handler = defaults2.handlers[iteration++] ?? lastHandler; + const result = handler(newOptions, iterateHandlers); + if (dist_default.promise(result) && !request.options.isStream) { + if (!promise) { + promise = asPromise(request); + } + if (result !== promise) { + const descriptors = Object.getOwnPropertyDescriptors(promise); + for (const key in descriptors) { + if (key in result) { + delete descriptors[key]; + } + } + Object.defineProperties(result, descriptors); + result.cancel = promise.cancel; + } + } + return result; + }; + return iterateHandlers(request.options); + }; + got2.extend = (...instancesOrOptions) => { + const options = new Options(void 0, void 0, defaults2.options); + const handlers = [...defaults2.handlers]; + let mutableDefaults; + for (const value of instancesOrOptions) { + if (isGotInstance(value)) { + options.merge(value.defaults.options); + handlers.push(...value.defaults.handlers); + mutableDefaults = value.defaults.mutableDefaults; + } else { + options.merge(value); + if (value.handlers) { + handlers.push(...value.handlers); + } + mutableDefaults = value.mutableDefaults; + } + } + return create({ + options, + handlers, + mutableDefaults: Boolean(mutableDefaults) + }); + }; + const paginateEach = async function* (url, options) { + let normalizedOptions = new Options(url, options, defaults2.options); + normalizedOptions.resolveBodyOnly = false; + const { pagination } = normalizedOptions; + assert.function_(pagination.transform); + assert.function_(pagination.shouldContinue); + assert.function_(pagination.filter); + assert.function_(pagination.paginate); + assert.number(pagination.countLimit); + assert.number(pagination.requestLimit); + assert.number(pagination.backoff); + const allItems = []; + let { countLimit } = pagination; + let numberOfRequests = 0; + while (numberOfRequests < pagination.requestLimit) { + if (numberOfRequests !== 0) { + await delay(pagination.backoff); + } + const response = await got2(void 0, void 0, normalizedOptions); + const parsed = await pagination.transform(response); + const currentItems = []; + assert.array(parsed); + for (const item of parsed) { + if (pagination.filter({ item, currentItems, allItems })) { + if (!pagination.shouldContinue({ item, currentItems, allItems })) { + return; + } + yield item; + if (pagination.stackAllItems) { + allItems.push(item); + } + currentItems.push(item); + if (--countLimit <= 0) { + return; + } + } + } + const optionsToMerge = pagination.paginate({ + response, + currentItems, + allItems + }); + if (optionsToMerge === false) { + return; + } + if (optionsToMerge === response.request.options) { + normalizedOptions = response.request.options; + } else { + normalizedOptions.merge(optionsToMerge); + assert.any([dist_default.urlInstance, dist_default.undefined], optionsToMerge.url); + if (optionsToMerge.url !== void 0) { + normalizedOptions.prefixUrl = ""; + normalizedOptions.url = optionsToMerge.url; + } + } + numberOfRequests++; + } + }; + got2.paginate = paginateEach; + got2.paginate.all = async (url, options) => { + const results = []; + for await (const item of paginateEach(url, options)) { + results.push(item); + } + return results; + }; + got2.paginate.each = paginateEach; + got2.stream = (url, options) => got2(url, { ...options, isStream: true }); + for (const method of aliases) { + got2[method] = (url, options) => got2(url, { ...options, method }); + got2.stream[method] = (url, options) => got2(url, { ...options, method, isStream: true }); + } + if (!defaults2.mutableDefaults) { + Object.freeze(defaults2.handlers); + defaults2.options.freeze(); + } + Object.defineProperty(got2, "defaults", { + value: defaults2, + writable: false, + configurable: false, + enumerable: true + }); + return got2; +}; +var create_default = create; + +// node_modules/.pnpm/got@12.5.2/node_modules/got/dist/source/index.js +var defaults = { + options: new Options(), + handlers: [], + mutableDefaults: false +}; +var got = create_default(defaults); +var source_default2 = got; + +// src/utils.ts +var import_fs3 = require("fs"); + +// node_modules/.pnpm/github.com+actions+setup-python@8bcd2560e267a43fbd8ff66c50da8a61825a0782/node_modules/setup-python/src/find-python.ts +var os2 = __toESM(require("os")); var path3 = __toESM(require("path")); var semver2 = __toESM(require_semver4()); -// node_modules/.pnpm/github.com+actions+setup-python@13ae5bb136fac2878aff31522b9efb785519f984/node_modules/setup-python/src/install-python.ts +// node_modules/.pnpm/github.com+actions+setup-python@8bcd2560e267a43fbd8ff66c50da8a61825a0782/node_modules/setup-python/src/install-python.ts var path2 = __toESM(require("path")); var core2 = __toESM(require_core()); var tc = __toESM(require_tool_cache()); @@ -68444,7 +75870,7 @@ async function installCpythonFromRelease(release) { await installPython(pythonExtractedFolder); } -// node_modules/.pnpm/github.com+actions+setup-python@13ae5bb136fac2878aff31522b9efb785519f984/node_modules/setup-python/src/find-python.ts +// node_modules/.pnpm/github.com+actions+setup-python@8bcd2560e267a43fbd8ff66c50da8a61825a0782/node_modules/setup-python/src/find-python.ts var core3 = __toESM(require_core()); var tc2 = __toESM(require_tool_cache()); function binDir(installDir) { @@ -68500,7 +75926,7 @@ async function useCpythonVersion(version, architecture, updateEnvironment, check [ `Version ${version} with arch ${architecture} not found`, `The list of all available versions can be found here: ${MANIFEST_URL}` - ].join(os.EOL) + ].join(os2.EOL) ); } const _binDir = binDir(installDir); @@ -68528,12 +75954,12 @@ async function useCpythonVersion(version, architecture, updateEnvironment, check core3.addPath(_binDir); if (IS_WINDOWS) { const version2 = path3.basename(path3.dirname(installDir)); - const major3 = semver2.major(version2); - const minor3 = semver2.minor(version2); + const major4 = semver2.major(version2); + const minor4 = semver2.minor(version2); const userScriptsDir = path3.join( process.env["APPDATA"] || "", "Python", - `Python${major3}${minor3}`, + `Python${major4}${minor4}`, "Scripts" ); core3.addPath(userScriptsDir); @@ -68558,10 +75984,10 @@ function pythonVersionToSemantic(versionSpec) { return versionSpec.replace(prereleaseVersion, "$1-$2"); } -// node_modules/.pnpm/github.com+actions+setup-python@13ae5bb136fac2878aff31522b9efb785519f984/node_modules/setup-python/src/find-pypy.ts +// node_modules/.pnpm/github.com+actions+setup-python@8bcd2560e267a43fbd8ff66c50da8a61825a0782/node_modules/setup-python/src/find-pypy.ts var path5 = __toESM(require("path")); -// node_modules/.pnpm/github.com+actions+setup-python@13ae5bb136fac2878aff31522b9efb785519f984/node_modules/setup-python/src/install-pypy.ts +// node_modules/.pnpm/github.com+actions+setup-python@8bcd2560e267a43fbd8ff66c50da8a61825a0782/node_modules/setup-python/src/install-pypy.ts var path4 = __toESM(require("path")); var core4 = __toESM(require_core()); var tc3 = __toESM(require_tool_cache()); @@ -68615,8 +76041,8 @@ async function installPyPy(pypyVersion, pythonVersion, architecture, releases) { } async function getAvailablePyPyVersions() { const url = "https://downloads.python.org/pypy/versions.json"; - const http = new httpm.HttpClient("tool-cache"); - const response = await http.getJson(url); + const http3 = new httpm.HttpClient("tool-cache"); + const response = await http3.getJson(url); if (!response.result) { throw new Error( `Unable to retrieve the list of available PyPy versions from '${url}'` @@ -68667,7 +76093,7 @@ function findRelease(releases, pythonVersion, pypyVersion, architecture) { ); const isPyPyNightly = isNightlyKeyword(pypyVersion) && isNightlyKeyword(item.pypy_version); const isPyPyVersionSatisfied = isPyPyNightly || semver3.satisfies(pypyVersionToSemantic(item.pypy_version), pypyVersion); - const isArchPresent = item.files && (IS_WINDOWS ? isArchPresentForWindows(item) : isArchPresentForMacOrLinux(item, architecture, process.platform)); + const isArchPresent = item.files && (IS_WINDOWS ? isArchPresentForWindows(item, architecture) : isArchPresentForMacOrLinux(item, architecture, process.platform)); return isPythonVersionSatisfied && isPyPyVersionSatisfied && isArchPresent; }); if (filterReleases.length === 0) { @@ -68683,7 +76109,7 @@ function findRelease(releases, pythonVersion, pypyVersion, architecture) { ); }); const foundRelease = sortedReleases[0]; - const foundAsset = IS_WINDOWS ? findAssetForWindows(foundRelease) : findAssetForMacOrLinux(foundRelease, architecture, process.platform); + const foundAsset = IS_WINDOWS ? findAssetForWindows(foundRelease, architecture) : findAssetForMacOrLinux(foundRelease, architecture, process.platform); return { foundAsset, resolvedPythonVersion: foundRelease.python_version, @@ -68698,9 +76124,10 @@ function pypyVersionToSemantic(versionSpec) { const prereleaseVersion = /(\d+\.\d+\.\d+)((?:a|b|rc))(\d*)/g; return versionSpec.replace(prereleaseVersion, "$1-$2.$3"); } -function isArchPresentForWindows(item) { +function isArchPresentForWindows(item, architecture) { + architecture = replaceX32toX86(architecture); return item.files.some( - (file) => WINDOWS_ARCHS.includes(file.arch) && WINDOWS_PLATFORMS.includes(file.platform) + (file) => WINDOWS_PLATFORMS.includes(file.platform) && file.arch === architecture ); } function isArchPresentForMacOrLinux(item, architecture, platform) { @@ -68708,9 +76135,10 @@ function isArchPresentForMacOrLinux(item, architecture, platform) { (file) => file.arch === architecture && file.platform === platform ); } -function findAssetForWindows(releases) { +function findAssetForWindows(releases, architecture) { + architecture = replaceX32toX86(architecture); return releases.files.find( - (item) => WINDOWS_ARCHS.includes(item.arch) && WINDOWS_PLATFORMS.includes(item.platform) + (item) => WINDOWS_PLATFORMS.includes(item.platform) && item.arch === architecture ); } function findAssetForMacOrLinux(releases, architecture, platform) { @@ -68718,8 +76146,14 @@ function findAssetForMacOrLinux(releases, architecture, platform) { (item) => item.arch === architecture && item.platform === platform ); } +function replaceX32toX86(architecture) { + if (architecture === "x32") { + architecture = "x86"; + } + return architecture; +} -// node_modules/.pnpm/github.com+actions+setup-python@13ae5bb136fac2878aff31522b9efb785519f984/node_modules/setup-python/src/find-pypy.ts +// node_modules/.pnpm/github.com+actions+setup-python@8bcd2560e267a43fbd8ff66c50da8a61825a0782/node_modules/setup-python/src/find-pypy.ts var semver4 = __toESM(require_semver4()); var core5 = __toESM(require_core()); var tc4 = __toESM(require_tool_cache()); @@ -68858,6 +76292,15 @@ function findPyPyInstallDirForWindows(pythonVersion) { function isPyPyVersion(versionSpec) { return versionSpec.startsWith("pypy"); } +function fetchUrlAsBuffer(url) { + return __async(this, null, function* () { + const response = yield source_default2(url); + if (!response.ok) { + throw new Error(`Failed to fetch ${url}`); + } + return Buffer.from(response.body); + }); +} function findPythonVersion(version, architecture) { return __async(this, null, function* () { let pythonVersion = ""; @@ -68886,13 +76329,16 @@ function findPythonVersion(version, architecture) { } }); } +function readFile(filePath) { + return __async(this, null, function* () { + return yield import_fs3.promises.readFile(filePath, "utf8"); + }); +} // src/setup-pdm.ts -var PDM_PYTHON_REQUIRES = ">=3.7"; -var GITHUB_REPO = "https://github.com/pdm-project/pdm.git"; -function getPep582Path(version) { - const installDir = process.env.pythonLocation || ""; - const parsedVersion = (0, import_parse.default)(version); +var INSTALL_SCRIPT_URL = "https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py"; +function getPep582Path(installDir, pythonVersion) { + const parsedVersion = (0, import_parse.default)(pythonVersion); if (IS_WINDOWS) { return import_path.default.resolve(installDir, "Lib/site-packages/pdm/pep582"); } else { @@ -68901,34 +76347,32 @@ function getPep582Path(version) { } function run() { return __async(this, null, function* () { - const arch2 = core7.getInput("architecture") || os2.arch(); + const arch2 = core7.getInput("architecture") || os3.arch(); const pdmVersion = core7.getInput("version"); const pythonVersion = core7.getInput("python-version"); - const versionCompatible = (0, import_intersects.default)(PDM_PYTHON_REQUIRES, pythonVersion); - const ref = core7.getInput("ref"); - const pdmPackage = pdmVersion ? `pdm==${pdmVersion}` : ref ? `pdm @ git+${GITHUB_REPO}@${ref}` : "pdm"; - const cmdArgs = ["-m", "pip", "install", "-U", pdmPackage]; + const cmdArgs = ["-"]; if (core7.getInput("prerelease") === "true") { - cmdArgs.push("--pre"); + cmdArgs.push("--prerelease"); } + if (pdmVersion) { + cmdArgs.push("--version", pdmVersion); + } + cmdArgs.push("-o", "install-output.json"); try { - let installedPython = yield findPythonVersion(versionCompatible ? pythonVersion : PDM_PYTHON_REQUIRES, arch2); - yield exec6.exec("python", cmdArgs); + yield exec6.exec("python", cmdArgs, { input: yield fetchUrlAsBuffer(INSTALL_SCRIPT_URL) }); + const installOutput = JSON.parse(yield readFile("install-output.json")); + core7.debug(`Install output: ${installOutput}`); + core7.setOutput("pdm-version", installOutput.pdm_version); + core7.setOutput("pdm-bin", import_path.default.join(installOutput.install_location, installOutput.pdm_bin)); + core7.addPath(import_path.default.dirname(installOutput.pdm_bin)); if (core7.getInput("enable-pep582") === "true") { - core7.exportVariable("PYTHONPATH", getPep582Path(installedPython)); + core7.exportVariable("PYTHONPATH", getPep582Path(installOutput.install_location, installOutput.install_python_version)); } - if (!versionCompatible) { - installedPython = yield findPythonVersion(pythonVersion, arch2); - } - const pythonBin = import_path.default.join(process.env.pythonLocation, IS_WINDOWS ? "python.exe" : "bin/python").replace(/\\/g, "/"); - yield import_fs3.promises.writeFile(".pdm.toml", `[python] -path="${pythonBin}" -`); - const { stdout: pdmVersionOutput } = yield exec6.getExecOutput("pdm --version"); + const installedPython = yield findPythonVersion(pythonVersion, arch2); if (process.platform === "linux") { core7.exportVariable("LD_PRELOAD", "/lib/x86_64-linux-gnu/libgcc_s.so.1"); } - core7.info(`Successfully setup ${pdmVersionOutput} with Python ${installedPython}`); + core7.info(`Successfully setup ${installOutput.pdm_version} with Python ${installedPython}`); const matchersPath = import_path.default.join(__dirname, "..", ".github"); core7.info(`##[add-matcher]${import_path.default.join(matchersPath, "python.json")}`); } catch (error2) { diff --git a/package.json b/package.json index 2974973..6618a04 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "dependencies": { "@actions/core": "^1.10.0", "@actions/exec": "^1.1.1", + "got": "^12.5.2", "semver": "^7.3.8", "setup-python": "actions/setup-python" }, diff --git a/src/setup-pdm.ts b/src/setup-pdm.ts index 0d7a9cf..07311cb 100644 --- a/src/setup-pdm.ts +++ b/src/setup-pdm.ts @@ -1,19 +1,21 @@ import * as os from 'os' -import { promises as fs } from 'fs' import path from 'path' import * as core from '@actions/core' import * as exec from '@actions/exec' import { IS_WINDOWS } from 'setup-python/src/utils' import semParse from 'semver/functions/parse' -import semIntersect from 'semver/ranges/intersects' -import { findPythonVersion } from './utils' +import * as utils from './utils' -const PDM_PYTHON_REQUIRES = '>=3.7' -const GITHUB_REPO = 'https://github.com/pdm-project/pdm.git' +const INSTALL_SCRIPT_URL = 'https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py' +interface InstallOutput { + pdm_version: string; + pdm_bin: string; + install_python_version: string; + install_location: string; +} -function getPep582Path(version: string): string { - const installDir = process.env.pythonLocation || '' - const parsedVersion = semParse(version)! +function getPep582Path(installDir: string, pythonVersion: string): string { + const parsedVersion = semParse(pythonVersion)! if (IS_WINDOWS) { return path.resolve(installDir, 'Lib/site-packages/pdm/pep582') } else { @@ -25,30 +27,33 @@ async function run(): Promise { const arch = core.getInput('architecture') || os.arch() const pdmVersion = core.getInput('version') const pythonVersion = core.getInput('python-version') - const versionCompatible = semIntersect(PDM_PYTHON_REQUIRES, pythonVersion) - const ref = core.getInput('ref') - const pdmPackage = pdmVersion ? `pdm==${pdmVersion}` : ref ? `pdm @ git+${GITHUB_REPO}@${ref}` : 'pdm' - const cmdArgs = ['-m', 'pip', 'install', '-U', pdmPackage] + const cmdArgs = ['-'] if (core.getInput('prerelease') === 'true') { - cmdArgs.push('--pre') + cmdArgs.push('--prerelease') } + if (pdmVersion) { + cmdArgs.push('--version', pdmVersion) + } + cmdArgs.push('-o', 'install-output.json') + // Use the default python version installed with the runner try { - let installedPython = await findPythonVersion(versionCompatible ? pythonVersion : PDM_PYTHON_REQUIRES, arch) - await exec.exec('python', cmdArgs) + await exec.exec('python', cmdArgs, { input: await utils.fetchUrlAsBuffer(INSTALL_SCRIPT_URL) }) + const installOutput: InstallOutput = JSON.parse(await utils.readFile('install-output.json')) + core.debug(`Install output: ${installOutput}`) + core.setOutput('pdm-version', installOutput.pdm_version) + core.setOutput('pdm-bin', path.join(installOutput.install_location, installOutput.pdm_bin)) + core.addPath(path.dirname(installOutput.pdm_bin)) if (core.getInput('enable-pep582') === 'true') { - core.exportVariable('PYTHONPATH', getPep582Path(installedPython)) + core.exportVariable('PYTHONPATH', getPep582Path(installOutput.install_location, installOutput.install_python_version)) } - if (!versionCompatible) { - installedPython = await findPythonVersion(pythonVersion, arch) - } - const pythonBin = path.join(process.env.pythonLocation as string, IS_WINDOWS ? 'python.exe' : 'bin/python').replace(/\\/g, '/') - await fs.writeFile('.pdm.toml', `[python]\npath="${pythonBin}"\n`) - const { stdout: pdmVersionOutput } = await exec.getExecOutput('pdm --version') + + const installedPython = await utils.findPythonVersion(pythonVersion, arch) + if (process.platform === 'linux') { // See https://github.com/actions/virtual-environments/issues/2803 core.exportVariable('LD_PRELOAD', '/lib/x86_64-linux-gnu/libgcc_s.so.1') } - core.info(`Successfully setup ${pdmVersionOutput} with Python ${installedPython}`) + core.info(`Successfully setup ${installOutput.pdm_version} with Python ${installedPython}`) const matchersPath = path.join(__dirname, '..', '.github') core.info(`##[add-matcher]${path.join(matchersPath, 'python.json')}`) } catch (error: any) { diff --git a/src/utils.ts b/src/utils.ts index c04ee44..9464de0 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,12 +1,22 @@ import * as core from '@actions/core'; +import got from 'got'; +import { promises as fs } from 'fs'; import { useCpythonVersion } from 'setup-python/src/find-python'; import { findPyPyVersion } from 'setup-python/src/find-pypy'; -function isPyPyVersion(versionSpec: string) { +function isPyPyVersion(versionSpec: string): boolean { return versionSpec.startsWith('pypy'); } +export async function fetchUrlAsBuffer(url: string): Promise { + const response = await got(url); + if (!response.ok) { + throw new Error(`Failed to fetch ${url}`); + } + return Buffer.from(response.body); +} + export async function findPythonVersion(version: string, architecture: string): Promise { let pythonVersion = ''; @@ -34,3 +44,8 @@ export async function findPythonVersion(version: string, architecture: string): return installed.version; } } + +export async function readFile(filePath: string): Promise { + return await fs.readFile(filePath, 'utf8'); +} +