var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __esm = (fn2, res) => function __init() { return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res; }; var __commonJS = (cb2, mod) => function __require() { return mod || (0, cb2[__getOwnPropNames(cb2)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all2) => { for (var name2 in all2) __defProp(target, name2, { get: all2[name2], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __accessCheck = (obj, member, msg) => { if (!member.has(obj)) throw TypeError("Cannot " + msg); }; var __privateGet = (obj, member, getter) => { __accessCheck(obj, member, "read from private field"); return getter ? getter.call(obj) : member.get(obj); }; var __privateAdd = (obj, member, value) => { if (member.has(obj)) throw TypeError("Cannot add the same private member more than once"); member instanceof WeakSet ? member.add(obj) : member.set(obj, value); }; var __privateSet = (obj, member, value, setter) => { __accessCheck(obj, member, "write to private field"); setter ? setter.call(obj, value) : member.set(obj, value); return value; }; // import_meta_url.js var import_meta_url; var init_import_meta_url = __esm({ "import_meta_url.js"() { import_meta_url = require("url").pathToFileURL(__filename); } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/symbols.js var require_symbols = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/symbols.js"(exports2, module3) { init_import_meta_url(); module3.exports = { kClose: Symbol("close"), kDestroy: Symbol("destroy"), kDispatch: Symbol("dispatch"), kUrl: Symbol("url"), kWriting: Symbol("writing"), kResuming: Symbol("resuming"), kQueue: Symbol("queue"), kConnect: Symbol("connect"), kConnecting: Symbol("connecting"), kHeadersList: Symbol("headers list"), kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), kKeepAliveTimeoutValue: Symbol("keep alive timeout"), kKeepAlive: Symbol("keep alive"), kHeadersTimeout: Symbol("headers timeout"), kBodyTimeout: Symbol("body timeout"), kServerName: Symbol("server name"), kLocalAddress: Symbol("local address"), kHost: Symbol("host"), kNoRef: Symbol("no ref"), kBodyUsed: Symbol("used"), kRunning: Symbol("running"), kBlocking: Symbol("blocking"), kPending: Symbol("pending"), kSize: Symbol("size"), kBusy: Symbol("busy"), kQueued: Symbol("queued"), kFree: Symbol("free"), kConnected: Symbol("connected"), kClosed: Symbol("closed"), kNeedDrain: Symbol("need drain"), kReset: Symbol("reset"), kDestroyed: Symbol.for("nodejs.stream.destroyed"), kMaxHeadersSize: Symbol("max headers size"), kRunningIdx: Symbol("running index"), kPendingIdx: Symbol("pending index"), kError: Symbol("error"), kClients: Symbol("clients"), kClient: Symbol("client"), kParser: Symbol("parser"), kOnDestroyed: Symbol("destroy callbacks"), kPipelining: Symbol("pipelining"), kSocket: Symbol("socket"), kHostHeader: Symbol("host header"), kConnector: Symbol("connector"), kStrictContentLength: Symbol("strict content length"), kMaxRedirections: Symbol("maxRedirections"), kMaxRequests: Symbol("maxRequestsPerClient"), kProxy: Symbol("proxy agent options"), kCounter: Symbol("socket request counter"), kInterceptors: Symbol("dispatch interceptors"), kMaxResponseSize: Symbol("max response size"), kHTTP2Session: Symbol("http2Session"), kHTTP2SessionState: Symbol("http2Session state"), kHTTP2BuildRequest: Symbol("http2 build request"), kHTTP1BuildRequest: Symbol("http1 build request"), kHTTP2CopyHeaders: Symbol("http2 copy headers"), kHTTPConnVersion: Symbol("http connection version"), kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), kConstruct: Symbol("constructable") }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/errors.js var require_errors = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/errors.js"(exports2, module3) { "use strict"; init_import_meta_url(); var UndiciError = class extends Error { constructor(message) { super(message); this.name = "UndiciError"; this.code = "UND_ERR"; } }; __name(UndiciError, "UndiciError"); var ConnectTimeoutError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, ConnectTimeoutError); this.name = "ConnectTimeoutError"; this.message = message || "Connect Timeout Error"; this.code = "UND_ERR_CONNECT_TIMEOUT"; } }; __name(ConnectTimeoutError, "ConnectTimeoutError"); var HeadersTimeoutError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, HeadersTimeoutError); this.name = "HeadersTimeoutError"; this.message = message || "Headers Timeout Error"; this.code = "UND_ERR_HEADERS_TIMEOUT"; } }; __name(HeadersTimeoutError, "HeadersTimeoutError"); var HeadersOverflowError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, HeadersOverflowError); this.name = "HeadersOverflowError"; this.message = message || "Headers Overflow Error"; this.code = "UND_ERR_HEADERS_OVERFLOW"; } }; __name(HeadersOverflowError, "HeadersOverflowError"); var BodyTimeoutError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, BodyTimeoutError); this.name = "BodyTimeoutError"; this.message = message || "Body Timeout Error"; this.code = "UND_ERR_BODY_TIMEOUT"; } }; __name(BodyTimeoutError, "BodyTimeoutError"); var ResponseStatusCodeError = class extends UndiciError { constructor(message, statusCode, headers, body) { super(message); Error.captureStackTrace(this, ResponseStatusCodeError); this.name = "ResponseStatusCodeError"; this.message = message || "Response Status Code Error"; this.code = "UND_ERR_RESPONSE_STATUS_CODE"; this.body = body; this.status = statusCode; this.statusCode = statusCode; this.headers = headers; } }; __name(ResponseStatusCodeError, "ResponseStatusCodeError"); var InvalidArgumentError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, InvalidArgumentError); this.name = "InvalidArgumentError"; this.message = message || "Invalid Argument Error"; this.code = "UND_ERR_INVALID_ARG"; } }; __name(InvalidArgumentError, "InvalidArgumentError"); var InvalidReturnValueError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, InvalidReturnValueError); this.name = "InvalidReturnValueError"; this.message = message || "Invalid Return Value Error"; this.code = "UND_ERR_INVALID_RETURN_VALUE"; } }; __name(InvalidReturnValueError, "InvalidReturnValueError"); var RequestAbortedError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, RequestAbortedError); this.name = "AbortError"; this.message = message || "Request aborted"; this.code = "UND_ERR_ABORTED"; } }; __name(RequestAbortedError, "RequestAbortedError"); var InformationalError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, InformationalError); this.name = "InformationalError"; this.message = message || "Request information"; this.code = "UND_ERR_INFO"; } }; __name(InformationalError, "InformationalError"); var RequestContentLengthMismatchError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, RequestContentLengthMismatchError); this.name = "RequestContentLengthMismatchError"; this.message = message || "Request body length does not match content-length header"; this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"; } }; __name(RequestContentLengthMismatchError, "RequestContentLengthMismatchError"); var ResponseContentLengthMismatchError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, ResponseContentLengthMismatchError); this.name = "ResponseContentLengthMismatchError"; this.message = message || "Response body length does not match content-length header"; this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH"; } }; __name(ResponseContentLengthMismatchError, "ResponseContentLengthMismatchError"); var ClientDestroyedError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, ClientDestroyedError); this.name = "ClientDestroyedError"; this.message = message || "The client is destroyed"; this.code = "UND_ERR_DESTROYED"; } }; __name(ClientDestroyedError, "ClientDestroyedError"); var ClientClosedError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, ClientClosedError); this.name = "ClientClosedError"; this.message = message || "The client is closed"; this.code = "UND_ERR_CLOSED"; } }; __name(ClientClosedError, "ClientClosedError"); var SocketError = class extends UndiciError { constructor(message, socket) { super(message); Error.captureStackTrace(this, SocketError); this.name = "SocketError"; this.message = message || "Socket error"; this.code = "UND_ERR_SOCKET"; this.socket = socket; } }; __name(SocketError, "SocketError"); var NotSupportedError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, NotSupportedError); this.name = "NotSupportedError"; this.message = message || "Not supported error"; this.code = "UND_ERR_NOT_SUPPORTED"; } }; __name(NotSupportedError, "NotSupportedError"); var BalancedPoolMissingUpstreamError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, NotSupportedError); this.name = "MissingUpstreamError"; this.message = message || "No upstream has been added to the BalancedPool"; this.code = "UND_ERR_BPL_MISSING_UPSTREAM"; } }; __name(BalancedPoolMissingUpstreamError, "BalancedPoolMissingUpstreamError"); var HTTPParserError = class extends Error { constructor(message, code, data) { super(message); Error.captureStackTrace(this, HTTPParserError); this.name = "HTTPParserError"; this.code = code ? `HPE_${code}` : void 0; this.data = data ? data.toString() : void 0; } }; __name(HTTPParserError, "HTTPParserError"); var ResponseExceededMaxSizeError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, ResponseExceededMaxSizeError); this.name = "ResponseExceededMaxSizeError"; this.message = message || "Response content exceeded max size"; this.code = "UND_ERR_RES_EXCEEDED_MAX_SIZE"; } }; __name(ResponseExceededMaxSizeError, "ResponseExceededMaxSizeError"); var RequestRetryError = class extends UndiciError { constructor(message, code, { headers, data }) { super(message); Error.captureStackTrace(this, RequestRetryError); this.name = "RequestRetryError"; this.message = message || "Request retry error"; this.code = "UND_ERR_REQ_RETRY"; this.statusCode = code; this.data = data; this.headers = headers; } }; __name(RequestRetryError, "RequestRetryError"); module3.exports = { HTTPParserError, UndiciError, HeadersTimeoutError, HeadersOverflowError, BodyTimeoutError, RequestContentLengthMismatchError, ConnectTimeoutError, ResponseStatusCodeError, InvalidArgumentError, InvalidReturnValueError, RequestAbortedError, ClientDestroyedError, ClientClosedError, InformationalError, SocketError, NotSupportedError, ResponseContentLengthMismatchError, BalancedPoolMissingUpstreamError, ResponseExceededMaxSizeError, RequestRetryError }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/constants.js var require_constants = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/constants.js"(exports2, module3) { "use strict"; init_import_meta_url(); var headerNameLowerCasedRecord = {}; var wellknownHeaderNames = [ "Accept", "Accept-Encoding", "Accept-Language", "Accept-Ranges", "Access-Control-Allow-Credentials", "Access-Control-Allow-Headers", "Access-Control-Allow-Methods", "Access-Control-Allow-Origin", "Access-Control-Expose-Headers", "Access-Control-Max-Age", "Access-Control-Request-Headers", "Access-Control-Request-Method", "Age", "Allow", "Alt-Svc", "Alt-Used", "Authorization", "Cache-Control", "Clear-Site-Data", "Connection", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-Range", "Content-Security-Policy", "Content-Security-Policy-Report-Only", "Content-Type", "Cookie", "Cross-Origin-Embedder-Policy", "Cross-Origin-Opener-Policy", "Cross-Origin-Resource-Policy", "Date", "Device-Memory", "Downlink", "ECT", "ETag", "Expect", "Expect-CT", "Expires", "Forwarded", "From", "Host", "If-Match", "If-Modified-Since", "If-None-Match", "If-Range", "If-Unmodified-Since", "Keep-Alive", "Last-Modified", "Link", "Location", "Max-Forwards", "Origin", "Permissions-Policy", "Pragma", "Proxy-Authenticate", "Proxy-Authorization", "RTT", "Range", "Referer", "Referrer-Policy", "Refresh", "Retry-After", "Sec-WebSocket-Accept", "Sec-WebSocket-Extensions", "Sec-WebSocket-Key", "Sec-WebSocket-Protocol", "Sec-WebSocket-Version", "Server", "Server-Timing", "Service-Worker-Allowed", "Service-Worker-Navigation-Preload", "Set-Cookie", "SourceMap", "Strict-Transport-Security", "Supports-Loading-Mode", "TE", "Timing-Allow-Origin", "Trailer", "Transfer-Encoding", "Upgrade", "Upgrade-Insecure-Requests", "User-Agent", "Vary", "Via", "WWW-Authenticate", "X-Content-Type-Options", "X-DNS-Prefetch-Control", "X-Frame-Options", "X-Permitted-Cross-Domain-Policies", "X-Powered-By", "X-Requested-With", "X-XSS-Protection" ]; for (let i5 = 0; i5 < wellknownHeaderNames.length; ++i5) { const key = wellknownHeaderNames[i5]; const lowerCasedKey = key.toLowerCase(); headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = lowerCasedKey; } Object.setPrototypeOf(headerNameLowerCasedRecord, null); module3.exports = { wellknownHeaderNames, headerNameLowerCasedRecord }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/util.js var require_util = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/util.js"(exports2, module3) { "use strict"; init_import_meta_url(); var assert38 = require("assert"); var { kDestroyed, kBodyUsed } = require_symbols(); var { IncomingMessage } = require("http"); var stream2 = require("stream"); var net2 = require("net"); var { InvalidArgumentError } = require_errors(); var { Blob: Blob6 } = require("buffer"); var nodeUtil = require("util"); var { stringify } = require("querystring"); var { headerNameLowerCasedRecord } = require_constants(); var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v7) => Number(v7)); function nop() { } __name(nop, "nop"); function isStream2(obj) { return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function"; } __name(isStream2, "isStream"); function isBlobLike(object) { return Blob6 && object instanceof Blob6 || object && typeof object === "object" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]); } __name(isBlobLike, "isBlobLike"); function buildURL(url4, queryParams) { if (url4.includes("?") || url4.includes("#")) { throw new Error('Query params cannot be passed when url already contains "?" or "#".'); } const stringified = stringify(queryParams); if (stringified) { url4 += "?" + stringified; } return url4; } __name(buildURL, "buildURL"); function parseURL2(url4) { if (typeof url4 === "string") { url4 = new URL(url4); if (!/^https?:/.test(url4.origin || url4.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); } return url4; } if (!url4 || typeof url4 !== "object") { throw new InvalidArgumentError("Invalid URL: The URL argument must be a non-null object."); } if (!/^https?:/.test(url4.origin || url4.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); } if (!(url4 instanceof URL)) { if (url4.port != null && url4.port !== "" && !Number.isFinite(parseInt(url4.port))) { throw new InvalidArgumentError("Invalid URL: port must be a valid integer or a string representation of an integer."); } if (url4.path != null && typeof url4.path !== "string") { throw new InvalidArgumentError("Invalid URL path: the path must be a string or null/undefined."); } if (url4.pathname != null && typeof url4.pathname !== "string") { throw new InvalidArgumentError("Invalid URL pathname: the pathname must be a string or null/undefined."); } if (url4.hostname != null && typeof url4.hostname !== "string") { throw new InvalidArgumentError("Invalid URL hostname: the hostname must be a string or null/undefined."); } if (url4.origin != null && typeof url4.origin !== "string") { throw new InvalidArgumentError("Invalid URL origin: the origin must be a string or null/undefined."); } const port = url4.port != null ? url4.port : url4.protocol === "https:" ? 443 : 80; let origin = url4.origin != null ? url4.origin : `${url4.protocol}//${url4.hostname}:${port}`; let path72 = url4.path != null ? url4.path : `${url4.pathname || ""}${url4.search || ""}`; if (origin.endsWith("/")) { origin = origin.substring(0, origin.length - 1); } if (path72 && !path72.startsWith("/")) { path72 = `/${path72}`; } url4 = new URL(origin + path72); } return url4; } __name(parseURL2, "parseURL"); function parseOrigin(url4) { url4 = parseURL2(url4); if (url4.pathname !== "/" || url4.search || url4.hash) { throw new InvalidArgumentError("invalid url"); } return url4; } __name(parseOrigin, "parseOrigin"); function getHostname(host) { if (host[0] === "[") { const idx2 = host.indexOf("]"); assert38(idx2 !== -1); return host.substring(1, idx2); } const idx = host.indexOf(":"); if (idx === -1) return host; return host.substring(0, idx); } __name(getHostname, "getHostname"); function getServerName(host) { if (!host) { return null; } assert38.strictEqual(typeof host, "string"); const servername = getHostname(host); if (net2.isIP(servername)) { return ""; } return servername; } __name(getServerName, "getServerName"); function deepClone(obj) { return JSON.parse(JSON.stringify(obj)); } __name(deepClone, "deepClone"); function isAsyncIterable(obj) { return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function"); } __name(isAsyncIterable, "isAsyncIterable"); function isIterable(obj) { return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function")); } __name(isIterable, "isIterable"); function bodyLength(body) { if (body == null) { return 0; } else if (isStream2(body)) { const state2 = body._readableState; return state2 && state2.objectMode === false && state2.ended === true && Number.isFinite(state2.length) ? state2.length : null; } else if (isBlobLike(body)) { return body.size != null ? body.size : null; } else if (isBuffer(body)) { return body.byteLength; } return null; } __name(bodyLength, "bodyLength"); function isDestroyed(stream3) { return !stream3 || !!(stream3.destroyed || stream3[kDestroyed]); } __name(isDestroyed, "isDestroyed"); function isReadableAborted(stream3) { const state2 = stream3 && stream3._readableState; return isDestroyed(stream3) && state2 && !state2.endEmitted; } __name(isReadableAborted, "isReadableAborted"); function destroy(stream3, err) { if (stream3 == null || !isStream2(stream3) || isDestroyed(stream3)) { return; } if (typeof stream3.destroy === "function") { if (Object.getPrototypeOf(stream3).constructor === IncomingMessage) { stream3.socket = null; } stream3.destroy(err); } else if (err) { process.nextTick((stream4, err2) => { stream4.emit("error", err2); }, stream3, err); } if (stream3.destroyed !== true) { stream3[kDestroyed] = true; } } __name(destroy, "destroy"); var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; function parseKeepAliveTimeout(val2) { const m6 = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m6 ? parseInt(m6[1], 10) * 1e3 : null; } __name(parseKeepAliveTimeout, "parseKeepAliveTimeout"); function headerNameToString(value) { return headerNameLowerCasedRecord[value] || value.toLowerCase(); } __name(headerNameToString, "headerNameToString"); function parseHeaders2(headers, obj = {}) { if (!Array.isArray(headers)) return headers; for (let i5 = 0; i5 < headers.length; i5 += 2) { const key = headers[i5].toString().toLowerCase(); let val2 = obj[key]; if (!val2) { if (Array.isArray(headers[i5 + 1])) { obj[key] = headers[i5 + 1].map((x6) => x6.toString("utf8")); } else { obj[key] = headers[i5 + 1].toString("utf8"); } } else { if (!Array.isArray(val2)) { val2 = [val2]; obj[key] = val2; } val2.push(headers[i5 + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { obj["content-disposition"] = Buffer.from(obj["content-disposition"]).toString("latin1"); } return obj; } __name(parseHeaders2, "parseHeaders"); function parseRawHeaders(headers) { const ret = []; let hasContentLength = false; let contentDispositionIdx = -1; for (let n6 = 0; n6 < headers.length; n6 += 2) { const key = headers[n6 + 0].toString(); const val2 = headers[n6 + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { ret.push(key, val2); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { contentDispositionIdx = ret.push(key, val2) - 1; } else { ret.push(key, val2); } } if (hasContentLength && contentDispositionIdx !== -1) { ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString("latin1"); } return ret; } __name(parseRawHeaders, "parseRawHeaders"); function isBuffer(buffer) { return buffer instanceof Uint8Array || Buffer.isBuffer(buffer); } __name(isBuffer, "isBuffer"); function validateHandler(handler31, method, upgrade) { if (!handler31 || typeof handler31 !== "object") { throw new InvalidArgumentError("handler must be an object"); } if (typeof handler31.onConnect !== "function") { throw new InvalidArgumentError("invalid onConnect method"); } if (typeof handler31.onError !== "function") { throw new InvalidArgumentError("invalid onError method"); } if (typeof handler31.onBodySent !== "function" && handler31.onBodySent !== void 0) { throw new InvalidArgumentError("invalid onBodySent method"); } if (upgrade || method === "CONNECT") { if (typeof handler31.onUpgrade !== "function") { throw new InvalidArgumentError("invalid onUpgrade method"); } } else { if (typeof handler31.onHeaders !== "function") { throw new InvalidArgumentError("invalid onHeaders method"); } if (typeof handler31.onData !== "function") { throw new InvalidArgumentError("invalid onData method"); } if (typeof handler31.onComplete !== "function") { throw new InvalidArgumentError("invalid onComplete method"); } } } __name(validateHandler, "validateHandler"); function isDisturbed(body) { return !!(body && (stream2.isDisturbed ? stream2.isDisturbed(body) || body[kBodyUsed] : body[kBodyUsed] || body.readableDidRead || body._readableState && body._readableState.dataEmitted || isReadableAborted(body))); } __name(isDisturbed, "isDisturbed"); function isErrored(body) { return !!(body && (stream2.isErrored ? stream2.isErrored(body) : /state: 'errored'/.test( nodeUtil.inspect(body) ))); } __name(isErrored, "isErrored"); function isReadable(body) { return !!(body && (stream2.isReadable ? stream2.isReadable(body) : /state: 'readable'/.test( nodeUtil.inspect(body) ))); } __name(isReadable, "isReadable"); function getSocketInfo(socket) { return { localAddress: socket.localAddress, localPort: socket.localPort, remoteAddress: socket.remoteAddress, remotePort: socket.remotePort, remoteFamily: socket.remoteFamily, timeout: socket.timeout, bytesWritten: socket.bytesWritten, bytesRead: socket.bytesRead }; } __name(getSocketInfo, "getSocketInfo"); async function* convertIterableToBuffer(iterable) { for await (const chunk of iterable) { yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk); } } __name(convertIterableToBuffer, "convertIterableToBuffer"); var ReadableStream3; function ReadableStreamFrom(iterable) { if (!ReadableStream3) { ReadableStream3 = require("stream/web").ReadableStream; } if (ReadableStream3.from) { return ReadableStream3.from(convertIterableToBuffer(iterable)); } let iterator; return new ReadableStream3( { async start() { iterator = iterable[Symbol.asyncIterator](); }, async pull(controller) { const { done, value } = await iterator.next(); if (done) { queueMicrotask(() => { controller.close(); }); } else { const buf = Buffer.isBuffer(value) ? value : Buffer.from(value); controller.enqueue(new Uint8Array(buf)); } return controller.desiredSize > 0; }, async cancel(reason) { await iterator.return(); } }, 0 ); } __name(ReadableStreamFrom, "ReadableStreamFrom"); function isFormDataLike(object) { return object && typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && object[Symbol.toStringTag] === "FormData"; } __name(isFormDataLike, "isFormDataLike"); function throwIfAborted(signal) { if (!signal) { return; } if (typeof signal.throwIfAborted === "function") { signal.throwIfAborted(); } else { if (signal.aborted) { const err = new Error("The operation was aborted"); err.name = "AbortError"; throw err; } } } __name(throwIfAborted, "throwIfAborted"); function addAbortListener(signal, listener) { if ("addEventListener" in signal) { signal.addEventListener("abort", listener, { once: true }); return () => signal.removeEventListener("abort", listener); } signal.addListener("abort", listener); return () => signal.removeListener("abort", listener); } __name(addAbortListener, "addAbortListener"); var hasToWellFormed = !!String.prototype.toWellFormed; function toUSVString(val2) { if (hasToWellFormed) { return `${val2}`.toWellFormed(); } else if (nodeUtil.toUSVString) { return nodeUtil.toUSVString(val2); } return `${val2}`; } __name(toUSVString, "toUSVString"); function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; const m6 = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null; return m6 ? { start: parseInt(m6[1]), end: m6[2] ? parseInt(m6[2]) : null, size: m6[3] ? parseInt(m6[3]) : null } : null; } __name(parseRangeHeader, "parseRangeHeader"); var kEnumerableProperty = /* @__PURE__ */ Object.create(null); kEnumerableProperty.enumerable = true; module3.exports = { kEnumerableProperty, nop, isDisturbed, isErrored, isReadable, toUSVString, isReadableAborted, isBlobLike, parseOrigin, parseURL: parseURL2, getServerName, isStream: isStream2, isIterable, isAsyncIterable, isDestroyed, headerNameToString, parseRawHeaders, parseHeaders: parseHeaders2, parseKeepAliveTimeout, destroy, bodyLength, deepClone, ReadableStreamFrom, isBuffer, validateHandler, getSocketInfo, isFormDataLike, buildURL, throwIfAborted, addAbortListener, parseRangeHeader, nodeMajor, nodeMinor, nodeHasAutoSelectFamily: nodeMajor > 18 || nodeMajor === 18 && nodeMinor >= 13, safeHTTPMethods: ["GET", "HEAD", "OPTIONS", "TRACE"] }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/timers.js var require_timers = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/timers.js"(exports2, module3) { "use strict"; init_import_meta_url(); var fastNow = Date.now(); var fastNowTimeout; var fastTimers = []; function onTimeout() { fastNow = Date.now(); let len = fastTimers.length; let idx = 0; while (idx < len) { const timer = fastTimers[idx]; if (timer.state === 0) { timer.state = fastNow + timer.delay; } else if (timer.state > 0 && fastNow >= timer.state) { timer.state = -1; timer.callback(timer.opaque); } if (timer.state === -1) { timer.state = -2; if (idx !== len - 1) { fastTimers[idx] = fastTimers.pop(); } else { fastTimers.pop(); } len -= 1; } else { idx += 1; } } if (fastTimers.length > 0) { refreshTimeout(); } } __name(onTimeout, "onTimeout"); function refreshTimeout() { if (fastNowTimeout && fastNowTimeout.refresh) { fastNowTimeout.refresh(); } else { clearTimeout(fastNowTimeout); fastNowTimeout = setTimeout(onTimeout, 1e3); if (fastNowTimeout.unref) { fastNowTimeout.unref(); } } } __name(refreshTimeout, "refreshTimeout"); var Timeout = class { constructor(callback, delay, opaque) { this.callback = callback; this.delay = delay; this.opaque = opaque; this.state = -2; this.refresh(); } refresh() { if (this.state === -2) { fastTimers.push(this); if (!fastNowTimeout || fastTimers.length === 1) { refreshTimeout(); } } this.state = 0; } clear() { this.state = -1; } }; __name(Timeout, "Timeout"); module3.exports = { setTimeout(callback, delay, opaque) { return delay < 1e3 ? setTimeout(callback, delay, opaque) : new Timeout(callback, delay, opaque); }, clearTimeout(timeout2) { if (timeout2 instanceof Timeout) { timeout2.clear(); } else { clearTimeout(timeout2); } } }; } }); // ../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js var require_sbmh = __commonJS({ "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/deps/streamsearch/sbmh.js"(exports2, module3) { "use strict"; init_import_meta_url(); var EventEmitter5 = require("node:events").EventEmitter; var inherits = require("node:util").inherits; function SBMH(needle) { if (typeof needle === "string") { needle = Buffer.from(needle); } if (!Buffer.isBuffer(needle)) { throw new TypeError("The needle has to be a String or a Buffer."); } const needleLength = needle.length; if (needleLength === 0) { throw new Error("The needle cannot be an empty String/Buffer."); } if (needleLength > 256) { throw new Error("The needle cannot have a length bigger than 256."); } this.maxMatches = Infinity; this.matches = 0; this._occ = new Array(256).fill(needleLength); this._lookbehind_size = 0; this._needle = needle; this._bufpos = 0; this._lookbehind = Buffer.alloc(needleLength); for (var i5 = 0; i5 < needleLength - 1; ++i5) { this._occ[needle[i5]] = needleLength - 1 - i5; } } __name(SBMH, "SBMH"); inherits(SBMH, EventEmitter5); SBMH.prototype.reset = function() { this._lookbehind_size = 0; this.matches = 0; this._bufpos = 0; }; SBMH.prototype.push = function(chunk, pos) { if (!Buffer.isBuffer(chunk)) { chunk = Buffer.from(chunk, "binary"); } const chlen = chunk.length; this._bufpos = pos || 0; let r7; while (r7 !== chlen && this.matches < this.maxMatches) { r7 = this._sbmh_feed(chunk); } return r7; }; SBMH.prototype._sbmh_feed = function(data) { const len = data.length; const needle = this._needle; const needleLength = needle.length; const lastNeedleChar = needle[needleLength - 1]; let pos = -this._lookbehind_size; let ch2; if (pos < 0) { while (pos < 0 && pos <= len - needleLength) { ch2 = this._sbmh_lookup_char(data, pos + needleLength - 1); if (ch2 === lastNeedleChar && this._sbmh_memcmp(data, pos, needleLength - 1)) { this._lookbehind_size = 0; ++this.matches; this.emit("info", true); return this._bufpos = pos + needleLength; } pos += this._occ[ch2]; } if (pos < 0) { while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos; } } if (pos >= 0) { this.emit("info", false, this._lookbehind, 0, this._lookbehind_size); this._lookbehind_size = 0; } else { const bytesToCutOff = this._lookbehind_size + pos; if (bytesToCutOff > 0) { this.emit("info", false, this._lookbehind, 0, bytesToCutOff); } this._lookbehind.copy( this._lookbehind, 0, bytesToCutOff, this._lookbehind_size - bytesToCutOff ); this._lookbehind_size -= bytesToCutOff; data.copy(this._lookbehind, this._lookbehind_size); this._lookbehind_size += len; this._bufpos = len; return len; } } pos += (pos >= 0) * this._bufpos; if (data.indexOf(needle, pos) !== -1) { pos = data.indexOf(needle, pos); ++this.matches; if (pos > 0) { this.emit("info", true, data, this._bufpos, pos); } else { this.emit("info", true); } return this._bufpos = pos + needleLength; } else { pos = len - needleLength; } while (pos < len && (data[pos] !== needle[0] || Buffer.compare( data.subarray(pos, pos + len - pos), needle.subarray(0, len - pos) ) !== 0)) { ++pos; } if (pos < len) { data.copy(this._lookbehind, 0, pos, pos + (len - pos)); this._lookbehind_size = len - pos; } if (pos > 0) { this.emit("info", false, data, this._bufpos, pos < len ? pos : len); } this._bufpos = len; return len; }; SBMH.prototype._sbmh_lookup_char = function(data, pos) { return pos < 0 ? this._lookbehind[this._lookbehind_size + pos] : data[pos]; }; SBMH.prototype._sbmh_memcmp = function(data, pos, len) { for (var i5 = 0; i5 < len; ++i5) { if (this._sbmh_lookup_char(data, pos + i5) !== this._needle[i5]) { return false; } } return true; }; module3.exports = SBMH; } }); // ../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js var require_PartStream = __commonJS({ "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js"(exports2, module3) { "use strict"; init_import_meta_url(); var inherits = require("node:util").inherits; var ReadableStream3 = require("node:stream").Readable; function PartStream(opts) { ReadableStream3.call(this, opts); } __name(PartStream, "PartStream"); inherits(PartStream, ReadableStream3); PartStream.prototype._read = function(n6) { }; module3.exports = PartStream; } }); // ../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/getLimit.js var require_getLimit = __commonJS({ "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/getLimit.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = /* @__PURE__ */ __name(function getLimit(limits, name2, defaultLimit) { if (!limits || limits[name2] === void 0 || limits[name2] === null) { return defaultLimit; } if (typeof limits[name2] !== "number" || isNaN(limits[name2])) { throw new TypeError("Limit " + name2 + " is not a valid number"); } return limits[name2]; }, "getLimit"); } }); // ../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js var require_HeaderParser = __commonJS({ "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js"(exports2, module3) { "use strict"; init_import_meta_url(); var EventEmitter5 = require("node:events").EventEmitter; var inherits = require("node:util").inherits; var getLimit = require_getLimit(); var StreamSearch = require_sbmh(); var B_DCRLF = Buffer.from("\r\n\r\n"); var RE_CRLF = /\r\n/g; var RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/; function HeaderParser(cfg) { EventEmitter5.call(this); cfg = cfg || {}; const self2 = this; this.nread = 0; this.maxed = false; this.npairs = 0; this.maxHeaderPairs = getLimit(cfg, "maxHeaderPairs", 2e3); this.maxHeaderSize = getLimit(cfg, "maxHeaderSize", 80 * 1024); this.buffer = ""; this.header = {}; this.finished = false; this.ss = new StreamSearch(B_DCRLF); this.ss.on("info", function(isMatch, data, start, end) { if (data && !self2.maxed) { if (self2.nread + end - start >= self2.maxHeaderSize) { end = self2.maxHeaderSize - self2.nread + start; self2.nread = self2.maxHeaderSize; self2.maxed = true; } else { self2.nread += end - start; } self2.buffer += data.toString("binary", start, end); } if (isMatch) { self2._finish(); } }); } __name(HeaderParser, "HeaderParser"); inherits(HeaderParser, EventEmitter5); HeaderParser.prototype.push = function(data) { const r7 = this.ss.push(data); if (this.finished) { return r7; } }; HeaderParser.prototype.reset = function() { this.finished = false; this.buffer = ""; this.header = {}; this.ss.reset(); }; HeaderParser.prototype._finish = function() { if (this.buffer) { this._parseHeader(); } this.ss.matches = this.ss.maxMatches; const header = this.header; this.header = {}; this.buffer = ""; this.finished = true; this.nread = this.npairs = 0; this.maxed = false; this.emit("header", header); }; HeaderParser.prototype._parseHeader = function() { if (this.npairs === this.maxHeaderPairs) { return; } const lines = this.buffer.split(RE_CRLF); const len = lines.length; let m6, h6; for (var i5 = 0; i5 < len; ++i5) { if (lines[i5].length === 0) { continue; } if (lines[i5][0] === " " || lines[i5][0] === " ") { if (h6) { this.header[h6][this.header[h6].length - 1] += lines[i5]; continue; } } const posColon = lines[i5].indexOf(":"); if (posColon === -1 || posColon === 0) { return; } m6 = RE_HDR.exec(lines[i5]); h6 = m6[1].toLowerCase(); this.header[h6] = this.header[h6] || []; this.header[h6].push(m6[2] || ""); if (++this.npairs === this.maxHeaderPairs) { break; } } }; module3.exports = HeaderParser; } }); // ../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js var require_Dicer = __commonJS({ "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js"(exports2, module3) { "use strict"; init_import_meta_url(); var WritableStream = require("node:stream").Writable; var inherits = require("node:util").inherits; var StreamSearch = require_sbmh(); var PartStream = require_PartStream(); var HeaderParser = require_HeaderParser(); var DASH = 45; var B_ONEDASH = Buffer.from("-"); var B_CRLF = Buffer.from("\r\n"); var EMPTY_FN2 = /* @__PURE__ */ __name(function() { }, "EMPTY_FN"); function Dicer(cfg) { if (!(this instanceof Dicer)) { return new Dicer(cfg); } WritableStream.call(this, cfg); if (!cfg || !cfg.headerFirst && typeof cfg.boundary !== "string") { throw new TypeError("Boundary required"); } if (typeof cfg.boundary === "string") { this.setBoundary(cfg.boundary); } else { this._bparser = void 0; } this._headerFirst = cfg.headerFirst; this._dashes = 0; this._parts = 0; this._finished = false; this._realFinish = false; this._isPreamble = true; this._justMatched = false; this._firstWrite = true; this._inHeader = true; this._part = void 0; this._cb = void 0; this._ignoreData = false; this._partOpts = { highWaterMark: cfg.partHwm }; this._pause = false; const self2 = this; this._hparser = new HeaderParser(cfg); this._hparser.on("header", function(header) { self2._inHeader = false; self2._part.emit("header", header); }); } __name(Dicer, "Dicer"); inherits(Dicer, WritableStream); Dicer.prototype.emit = function(ev) { if (ev === "finish" && !this._realFinish) { if (!this._finished) { const self2 = this; process.nextTick(function() { self2.emit("error", new Error("Unexpected end of multipart data")); if (self2._part && !self2._ignoreData) { const type = self2._isPreamble ? "Preamble" : "Part"; self2._part.emit("error", new Error(type + " terminated early due to unexpected end of multipart data")); self2._part.push(null); process.nextTick(function() { self2._realFinish = true; self2.emit("finish"); self2._realFinish = false; }); return; } self2._realFinish = true; self2.emit("finish"); self2._realFinish = false; }); } } else { WritableStream.prototype.emit.apply(this, arguments); } }; Dicer.prototype._write = function(data, encoding, cb2) { if (!this._hparser && !this._bparser) { return cb2(); } if (this._headerFirst && this._isPreamble) { if (!this._part) { this._part = new PartStream(this._partOpts); if (this.listenerCount("preamble") !== 0) { this.emit("preamble", this._part); } else { this._ignore(); } } const r7 = this._hparser.push(data); if (!this._inHeader && r7 !== void 0 && r7 < data.length) { data = data.slice(r7); } else { return cb2(); } } if (this._firstWrite) { this._bparser.push(B_CRLF); this._firstWrite = false; } this._bparser.push(data); if (this._pause) { this._cb = cb2; } else { cb2(); } }; Dicer.prototype.reset = function() { this._part = void 0; this._bparser = void 0; this._hparser = void 0; }; Dicer.prototype.setBoundary = function(boundary) { const self2 = this; this._bparser = new StreamSearch("\r\n--" + boundary); this._bparser.on("info", function(isMatch, data, start, end) { self2._oninfo(isMatch, data, start, end); }); }; Dicer.prototype._ignore = function() { if (this._part && !this._ignoreData) { this._ignoreData = true; this._part.on("error", EMPTY_FN2); this._part.resume(); } }; Dicer.prototype._oninfo = function(isMatch, data, start, end) { let buf; const self2 = this; let i5 = 0; let r7; let shouldWriteMore = true; if (!this._part && this._justMatched && data) { while (this._dashes < 2 && start + i5 < end) { if (data[start + i5] === DASH) { ++i5; ++this._dashes; } else { if (this._dashes) { buf = B_ONEDASH; } this._dashes = 0; break; } } if (this._dashes === 2) { if (start + i5 < end && this.listenerCount("trailer") !== 0) { this.emit("trailer", data.slice(start + i5, end)); } this.reset(); this._finished = true; if (self2._parts === 0) { self2._realFinish = true; self2.emit("finish"); self2._realFinish = false; } } if (this._dashes) { return; } } if (this._justMatched) { this._justMatched = false; } if (!this._part) { this._part = new PartStream(this._partOpts); this._part._read = function(n6) { self2._unpause(); }; if (this._isPreamble && this.listenerCount("preamble") !== 0) { this.emit("preamble", this._part); } else if (this._isPreamble !== true && this.listenerCount("part") !== 0) { this.emit("part", this._part); } else { this._ignore(); } if (!this._isPreamble) { this._inHeader = true; } } if (data && start < end && !this._ignoreData) { if (this._isPreamble || !this._inHeader) { if (buf) { shouldWriteMore = this._part.push(buf); } shouldWriteMore = this._part.push(data.slice(start, end)); if (!shouldWriteMore) { this._pause = true; } } else if (!this._isPreamble && this._inHeader) { if (buf) { this._hparser.push(buf); } r7 = this._hparser.push(data.slice(start, end)); if (!this._inHeader && r7 !== void 0 && r7 < end) { this._oninfo(false, data, start + r7, end); } } } if (isMatch) { this._hparser.reset(); if (this._isPreamble) { this._isPreamble = false; } else { if (start !== end) { ++this._parts; this._part.on("end", function() { if (--self2._parts === 0) { if (self2._finished) { self2._realFinish = true; self2.emit("finish"); self2._realFinish = false; } else { self2._unpause(); } } }); } } this._part.push(null); this._part = void 0; this._ignoreData = false; this._justMatched = true; this._dashes = 0; } }; Dicer.prototype._unpause = function() { if (!this._pause) { return; } this._pause = false; if (this._cb) { const cb2 = this._cb; this._cb = void 0; cb2(); } }; module3.exports = Dicer; } }); // ../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/decodeText.js var require_decodeText = __commonJS({ "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/decodeText.js"(exports2, module3) { "use strict"; init_import_meta_url(); var utf8Decoder = new TextDecoder("utf-8"); var textDecoders = /* @__PURE__ */ new Map([ ["utf-8", utf8Decoder], ["utf8", utf8Decoder] ]); function getDecoder(charset) { let lc; while (true) { switch (charset) { case "utf-8": case "utf8": return decoders.utf8; case "latin1": case "ascii": case "us-ascii": case "iso-8859-1": case "iso8859-1": case "iso88591": case "iso_8859-1": case "windows-1252": case "iso_8859-1:1987": case "cp1252": case "x-cp1252": return decoders.latin1; case "utf16le": case "utf-16le": case "ucs2": case "ucs-2": return decoders.utf16le; case "base64": return decoders.base64; default: if (lc === void 0) { lc = true; charset = charset.toLowerCase(); continue; } return decoders.other.bind(charset); } } } __name(getDecoder, "getDecoder"); var decoders = { utf8: (data, sourceEncoding) => { if (data.length === 0) { return ""; } if (typeof data === "string") { data = Buffer.from(data, sourceEncoding); } return data.utf8Slice(0, data.length); }, latin1: (data, sourceEncoding) => { if (data.length === 0) { return ""; } if (typeof data === "string") { return data; } return data.latin1Slice(0, data.length); }, utf16le: (data, sourceEncoding) => { if (data.length === 0) { return ""; } if (typeof data === "string") { data = Buffer.from(data, sourceEncoding); } return data.ucs2Slice(0, data.length); }, base64: (data, sourceEncoding) => { if (data.length === 0) { return ""; } if (typeof data === "string") { data = Buffer.from(data, sourceEncoding); } return data.base64Slice(0, data.length); }, other: (data, sourceEncoding) => { if (data.length === 0) { return ""; } if (typeof data === "string") { data = Buffer.from(data, sourceEncoding); } if (textDecoders.has(exports2.toString())) { try { return textDecoders.get(exports2).decode(data); } catch { } } return typeof data === "string" ? data : data.toString(); } }; function decodeText(text, sourceEncoding, destEncoding) { if (text) { return getDecoder(destEncoding)(text, sourceEncoding); } return text; } __name(decodeText, "decodeText"); module3.exports = decodeText; } }); // ../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/parseParams.js var require_parseParams = __commonJS({ "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/parseParams.js"(exports2, module3) { "use strict"; init_import_meta_url(); var decodeText = require_decodeText(); var RE_ENCODED = /%[a-fA-F0-9][a-fA-F0-9]/g; var EncodedLookup = { "%00": "\0", "%01": "", "%02": "", "%03": "", "%04": "", "%05": "", "%06": "", "%07": "\x07", "%08": "\b", "%09": " ", "%0a": "\n", "%0A": "\n", "%0b": "\v", "%0B": "\v", "%0c": "\f", "%0C": "\f", "%0d": "\r", "%0D": "\r", "%0e": "", "%0E": "", "%0f": "", "%0F": "", "%10": "", "%11": "", "%12": "", "%13": "", "%14": "", "%15": "", "%16": "", "%17": "", "%18": "", "%19": "", "%1a": "", "%1A": "", "%1b": "\x1B", "%1B": "\x1B", "%1c": "", "%1C": "", "%1d": "", "%1D": "", "%1e": "", "%1E": "", "%1f": "", "%1F": "", "%20": " ", "%21": "!", "%22": '"', "%23": "#", "%24": "$", "%25": "%", "%26": "&", "%27": "'", "%28": "(", "%29": ")", "%2a": "*", "%2A": "*", "%2b": "+", "%2B": "+", "%2c": ",", "%2C": ",", "%2d": "-", "%2D": "-", "%2e": ".", "%2E": ".", "%2f": "/", "%2F": "/", "%30": "0", "%31": "1", "%32": "2", "%33": "3", "%34": "4", "%35": "5", "%36": "6", "%37": "7", "%38": "8", "%39": "9", "%3a": ":", "%3A": ":", "%3b": ";", "%3B": ";", "%3c": "<", "%3C": "<", "%3d": "=", "%3D": "=", "%3e": ">", "%3E": ">", "%3f": "?", "%3F": "?", "%40": "@", "%41": "A", "%42": "B", "%43": "C", "%44": "D", "%45": "E", "%46": "F", "%47": "G", "%48": "H", "%49": "I", "%4a": "J", "%4A": "J", "%4b": "K", "%4B": "K", "%4c": "L", "%4C": "L", "%4d": "M", "%4D": "M", "%4e": "N", "%4E": "N", "%4f": "O", "%4F": "O", "%50": "P", "%51": "Q", "%52": "R", "%53": "S", "%54": "T", "%55": "U", "%56": "V", "%57": "W", "%58": "X", "%59": "Y", "%5a": "Z", "%5A": "Z", "%5b": "[", "%5B": "[", "%5c": "\\", "%5C": "\\", "%5d": "]", "%5D": "]", "%5e": "^", "%5E": "^", "%5f": "_", "%5F": "_", "%60": "`", "%61": "a", "%62": "b", "%63": "c", "%64": "d", "%65": "e", "%66": "f", "%67": "g", "%68": "h", "%69": "i", "%6a": "j", "%6A": "j", "%6b": "k", "%6B": "k", "%6c": "l", "%6C": "l", "%6d": "m", "%6D": "m", "%6e": "n", "%6E": "n", "%6f": "o", "%6F": "o", "%70": "p", "%71": "q", "%72": "r", "%73": "s", "%74": "t", "%75": "u", "%76": "v", "%77": "w", "%78": "x", "%79": "y", "%7a": "z", "%7A": "z", "%7b": "{", "%7B": "{", "%7c": "|", "%7C": "|", "%7d": "}", "%7D": "}", "%7e": "~", "%7E": "~", "%7f": "\x7F", "%7F": "\x7F", "%80": "\x80", "%81": "\x81", "%82": "\x82", "%83": "\x83", "%84": "\x84", "%85": "\x85", "%86": "\x86", "%87": "\x87", "%88": "\x88", "%89": "\x89", "%8a": "\x8A", "%8A": "\x8A", "%8b": "\x8B", "%8B": "\x8B", "%8c": "\x8C", "%8C": "\x8C", "%8d": "\x8D", "%8D": "\x8D", "%8e": "\x8E", "%8E": "\x8E", "%8f": "\x8F", "%8F": "\x8F", "%90": "\x90", "%91": "\x91", "%92": "\x92", "%93": "\x93", "%94": "\x94", "%95": "\x95", "%96": "\x96", "%97": "\x97", "%98": "\x98", "%99": "\x99", "%9a": "\x9A", "%9A": "\x9A", "%9b": "\x9B", "%9B": "\x9B", "%9c": "\x9C", "%9C": "\x9C", "%9d": "\x9D", "%9D": "\x9D", "%9e": "\x9E", "%9E": "\x9E", "%9f": "\x9F", "%9F": "\x9F", "%a0": "\xA0", "%A0": "\xA0", "%a1": "\xA1", "%A1": "\xA1", "%a2": "\xA2", "%A2": "\xA2", "%a3": "\xA3", "%A3": "\xA3", "%a4": "\xA4", "%A4": "\xA4", "%a5": "\xA5", "%A5": "\xA5", "%a6": "\xA6", "%A6": "\xA6", "%a7": "\xA7", "%A7": "\xA7", "%a8": "\xA8", "%A8": "\xA8", "%a9": "\xA9", "%A9": "\xA9", "%aa": "\xAA", "%Aa": "\xAA", "%aA": "\xAA", "%AA": "\xAA", "%ab": "\xAB", "%Ab": "\xAB", "%aB": "\xAB", "%AB": "\xAB", "%ac": "\xAC", "%Ac": "\xAC", "%aC": "\xAC", "%AC": "\xAC", "%ad": "\xAD", "%Ad": "\xAD", "%aD": "\xAD", "%AD": "\xAD", "%ae": "\xAE", "%Ae": "\xAE", "%aE": "\xAE", "%AE": "\xAE", "%af": "\xAF", "%Af": "\xAF", "%aF": "\xAF", "%AF": "\xAF", "%b0": "\xB0", "%B0": "\xB0", "%b1": "\xB1", "%B1": "\xB1", "%b2": "\xB2", "%B2": "\xB2", "%b3": "\xB3", "%B3": "\xB3", "%b4": "\xB4", "%B4": "\xB4", "%b5": "\xB5", "%B5": "\xB5", "%b6": "\xB6", "%B6": "\xB6", "%b7": "\xB7", "%B7": "\xB7", "%b8": "\xB8", "%B8": "\xB8", "%b9": "\xB9", "%B9": "\xB9", "%ba": "\xBA", "%Ba": "\xBA", "%bA": "\xBA", "%BA": "\xBA", "%bb": "\xBB", "%Bb": "\xBB", "%bB": "\xBB", "%BB": "\xBB", "%bc": "\xBC", "%Bc": "\xBC", "%bC": "\xBC", "%BC": "\xBC", "%bd": "\xBD", "%Bd": "\xBD", "%bD": "\xBD", "%BD": "\xBD", "%be": "\xBE", "%Be": "\xBE", "%bE": "\xBE", "%BE": "\xBE", "%bf": "\xBF", "%Bf": "\xBF", "%bF": "\xBF", "%BF": "\xBF", "%c0": "\xC0", "%C0": "\xC0", "%c1": "\xC1", "%C1": "\xC1", "%c2": "\xC2", "%C2": "\xC2", "%c3": "\xC3", "%C3": "\xC3", "%c4": "\xC4", "%C4": "\xC4", "%c5": "\xC5", "%C5": "\xC5", "%c6": "\xC6", "%C6": "\xC6", "%c7": "\xC7", "%C7": "\xC7", "%c8": "\xC8", "%C8": "\xC8", "%c9": "\xC9", "%C9": "\xC9", "%ca": "\xCA", "%Ca": "\xCA", "%cA": "\xCA", "%CA": "\xCA", "%cb": "\xCB", "%Cb": "\xCB", "%cB": "\xCB", "%CB": "\xCB", "%cc": "\xCC", "%Cc": "\xCC", "%cC": "\xCC", "%CC": "\xCC", "%cd": "\xCD", "%Cd": "\xCD", "%cD": "\xCD", "%CD": "\xCD", "%ce": "\xCE", "%Ce": "\xCE", "%cE": "\xCE", "%CE": "\xCE", "%cf": "\xCF", "%Cf": "\xCF", "%cF": "\xCF", "%CF": "\xCF", "%d0": "\xD0", "%D0": "\xD0", "%d1": "\xD1", "%D1": "\xD1", "%d2": "\xD2", "%D2": "\xD2", "%d3": "\xD3", "%D3": "\xD3", "%d4": "\xD4", "%D4": "\xD4", "%d5": "\xD5", "%D5": "\xD5", "%d6": "\xD6", "%D6": "\xD6", "%d7": "\xD7", "%D7": "\xD7", "%d8": "\xD8", "%D8": "\xD8", "%d9": "\xD9", "%D9": "\xD9", "%da": "\xDA", "%Da": "\xDA", "%dA": "\xDA", "%DA": "\xDA", "%db": "\xDB", "%Db": "\xDB", "%dB": "\xDB", "%DB": "\xDB", "%dc": "\xDC", "%Dc": "\xDC", "%dC": "\xDC", "%DC": "\xDC", "%dd": "\xDD", "%Dd": "\xDD", "%dD": "\xDD", "%DD": "\xDD", "%de": "\xDE", "%De": "\xDE", "%dE": "\xDE", "%DE": "\xDE", "%df": "\xDF", "%Df": "\xDF", "%dF": "\xDF", "%DF": "\xDF", "%e0": "\xE0", "%E0": "\xE0", "%e1": "\xE1", "%E1": "\xE1", "%e2": "\xE2", "%E2": "\xE2", "%e3": "\xE3", "%E3": "\xE3", "%e4": "\xE4", "%E4": "\xE4", "%e5": "\xE5", "%E5": "\xE5", "%e6": "\xE6", "%E6": "\xE6", "%e7": "\xE7", "%E7": "\xE7", "%e8": "\xE8", "%E8": "\xE8", "%e9": "\xE9", "%E9": "\xE9", "%ea": "\xEA", "%Ea": "\xEA", "%eA": "\xEA", "%EA": "\xEA", "%eb": "\xEB", "%Eb": "\xEB", "%eB": "\xEB", "%EB": "\xEB", "%ec": "\xEC", "%Ec": "\xEC", "%eC": "\xEC", "%EC": "\xEC", "%ed": "\xED", "%Ed": "\xED", "%eD": "\xED", "%ED": "\xED", "%ee": "\xEE", "%Ee": "\xEE", "%eE": "\xEE", "%EE": "\xEE", "%ef": "\xEF", "%Ef": "\xEF", "%eF": "\xEF", "%EF": "\xEF", "%f0": "\xF0", "%F0": "\xF0", "%f1": "\xF1", "%F1": "\xF1", "%f2": "\xF2", "%F2": "\xF2", "%f3": "\xF3", "%F3": "\xF3", "%f4": "\xF4", "%F4": "\xF4", "%f5": "\xF5", "%F5": "\xF5", "%f6": "\xF6", "%F6": "\xF6", "%f7": "\xF7", "%F7": "\xF7", "%f8": "\xF8", "%F8": "\xF8", "%f9": "\xF9", "%F9": "\xF9", "%fa": "\xFA", "%Fa": "\xFA", "%fA": "\xFA", "%FA": "\xFA", "%fb": "\xFB", "%Fb": "\xFB", "%fB": "\xFB", "%FB": "\xFB", "%fc": "\xFC", "%Fc": "\xFC", "%fC": "\xFC", "%FC": "\xFC", "%fd": "\xFD", "%Fd": "\xFD", "%fD": "\xFD", "%FD": "\xFD", "%fe": "\xFE", "%Fe": "\xFE", "%fE": "\xFE", "%FE": "\xFE", "%ff": "\xFF", "%Ff": "\xFF", "%fF": "\xFF", "%FF": "\xFF" }; function encodedReplacer(match2) { return EncodedLookup[match2]; } __name(encodedReplacer, "encodedReplacer"); var STATE_KEY = 0; var STATE_VALUE = 1; var STATE_CHARSET = 2; var STATE_LANG = 3; function parseParams(str) { const res = []; let state2 = STATE_KEY; let charset = ""; let inquote = false; let escaping = false; let p6 = 0; let tmp = ""; const len = str.length; for (var i5 = 0; i5 < len; ++i5) { const char = str[i5]; if (char === "\\" && inquote) { if (escaping) { escaping = false; } else { escaping = true; continue; } } else if (char === '"') { if (!escaping) { if (inquote) { inquote = false; state2 = STATE_KEY; } else { inquote = true; } continue; } else { escaping = false; } } else { if (escaping && inquote) { tmp += "\\"; } escaping = false; if ((state2 === STATE_CHARSET || state2 === STATE_LANG) && char === "'") { if (state2 === STATE_CHARSET) { state2 = STATE_LANG; charset = tmp.substring(1); } else { state2 = STATE_VALUE; } tmp = ""; continue; } else if (state2 === STATE_KEY && (char === "*" || char === "=") && res.length) { state2 = char === "*" ? STATE_CHARSET : STATE_VALUE; res[p6] = [tmp, void 0]; tmp = ""; continue; } else if (!inquote && char === ";") { state2 = STATE_KEY; if (charset) { if (tmp.length) { tmp = decodeText( tmp.replace(RE_ENCODED, encodedReplacer), "binary", charset ); } charset = ""; } else if (tmp.length) { tmp = decodeText(tmp, "binary", "utf8"); } if (res[p6] === void 0) { res[p6] = tmp; } else { res[p6][1] = tmp; } tmp = ""; ++p6; continue; } else if (!inquote && (char === " " || char === " ")) { continue; } } tmp += char; } if (charset && tmp.length) { tmp = decodeText( tmp.replace(RE_ENCODED, encodedReplacer), "binary", charset ); } else if (tmp) { tmp = decodeText(tmp, "binary", "utf8"); } if (res[p6] === void 0) { if (tmp) { res[p6] = tmp; } } else { res[p6][1] = tmp; } return res; } __name(parseParams, "parseParams"); module3.exports = parseParams; } }); // ../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/basename.js var require_basename = __commonJS({ "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/basename.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = /* @__PURE__ */ __name(function basename7(path72) { if (typeof path72 !== "string") { return ""; } for (var i5 = path72.length - 1; i5 >= 0; --i5) { switch (path72.charCodeAt(i5)) { case 47: case 92: path72 = path72.slice(i5 + 1); return path72 === ".." || path72 === "." ? "" : path72; } } return path72 === ".." || path72 === "." ? "" : path72; }, "basename"); } }); // ../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/types/multipart.js var require_multipart = __commonJS({ "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/types/multipart.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { Readable: Readable8 } = require("node:stream"); var { inherits } = require("node:util"); var Dicer = require_Dicer(); var parseParams = require_parseParams(); var decodeText = require_decodeText(); var basename7 = require_basename(); var getLimit = require_getLimit(); var RE_BOUNDARY = /^boundary$/i; var RE_FIELD = /^form-data$/i; var RE_CHARSET = /^charset$/i; var RE_FILENAME = /^filename$/i; var RE_NAME = /^name$/i; Multipart.detect = /^multipart\/form-data/i; function Multipart(boy, cfg) { let i5; let len; const self2 = this; let boundary; const limits = cfg.limits; const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => contentType === "application/octet-stream" || fileName !== void 0); const parsedConType = cfg.parsedConType || []; const defCharset = cfg.defCharset || "utf8"; const preservePath = cfg.preservePath; const fileOpts = { highWaterMark: cfg.fileHwm }; for (i5 = 0, len = parsedConType.length; i5 < len; ++i5) { if (Array.isArray(parsedConType[i5]) && RE_BOUNDARY.test(parsedConType[i5][0])) { boundary = parsedConType[i5][1]; break; } } function checkFinished() { if (nends === 0 && finished && !boy._done) { finished = false; self2.end(); } } __name(checkFinished, "checkFinished"); if (typeof boundary !== "string") { throw new Error("Multipart: Boundary not found"); } const fieldSizeLimit = getLimit(limits, "fieldSize", 1 * 1024 * 1024); const fileSizeLimit = getLimit(limits, "fileSize", Infinity); const filesLimit = getLimit(limits, "files", Infinity); const fieldsLimit = getLimit(limits, "fields", Infinity); const partsLimit = getLimit(limits, "parts", Infinity); const headerPairsLimit = getLimit(limits, "headerPairs", 2e3); const headerSizeLimit = getLimit(limits, "headerSize", 80 * 1024); let nfiles = 0; let nfields = 0; let nends = 0; let curFile; let curField; let finished = false; this._needDrain = false; this._pause = false; this._cb = void 0; this._nparts = 0; this._boy = boy; const parserCfg = { boundary, maxHeaderPairs: headerPairsLimit, maxHeaderSize: headerSizeLimit, partHwm: fileOpts.highWaterMark, highWaterMark: cfg.highWaterMark }; this.parser = new Dicer(parserCfg); this.parser.on("drain", function() { self2._needDrain = false; if (self2._cb && !self2._pause) { const cb2 = self2._cb; self2._cb = void 0; cb2(); } }).on("part", /* @__PURE__ */ __name(function onPart(part) { if (++self2._nparts > partsLimit) { self2.parser.removeListener("part", onPart); self2.parser.on("part", skipPart); boy.hitPartsLimit = true; boy.emit("partsLimit"); return skipPart(part); } if (curField) { const field = curField; field.emit("end"); field.removeAllListeners("end"); } part.on("header", function(header) { let contype; let fieldname; let parsed; let charset; let encoding; let filename; let nsize = 0; if (header["content-type"]) { parsed = parseParams(header["content-type"][0]); if (parsed[0]) { contype = parsed[0].toLowerCase(); for (i5 = 0, len = parsed.length; i5 < len; ++i5) { if (RE_CHARSET.test(parsed[i5][0])) { charset = parsed[i5][1].toLowerCase(); break; } } } } if (contype === void 0) { contype = "text/plain"; } if (charset === void 0) { charset = defCharset; } if (header["content-disposition"]) { parsed = parseParams(header["content-disposition"][0]); if (!RE_FIELD.test(parsed[0])) { return skipPart(part); } for (i5 = 0, len = parsed.length; i5 < len; ++i5) { if (RE_NAME.test(parsed[i5][0])) { fieldname = parsed[i5][1]; } else if (RE_FILENAME.test(parsed[i5][0])) { filename = parsed[i5][1]; if (!preservePath) { filename = basename7(filename); } } } } else { return skipPart(part); } if (header["content-transfer-encoding"]) { encoding = header["content-transfer-encoding"][0].toLowerCase(); } else { encoding = "7bit"; } let onData, onEnd; if (isPartAFile(fieldname, contype, filename)) { if (nfiles === filesLimit) { if (!boy.hitFilesLimit) { boy.hitFilesLimit = true; boy.emit("filesLimit"); } return skipPart(part); } ++nfiles; if (boy.listenerCount("file") === 0) { self2.parser._ignore(); return; } ++nends; const file = new FileStream(fileOpts); curFile = file; file.on("end", function() { --nends; self2._pause = false; checkFinished(); if (self2._cb && !self2._needDrain) { const cb2 = self2._cb; self2._cb = void 0; cb2(); } }); file._read = function(n6) { if (!self2._pause) { return; } self2._pause = false; if (self2._cb && !self2._needDrain) { const cb2 = self2._cb; self2._cb = void 0; cb2(); } }; boy.emit("file", fieldname, file, filename, encoding, contype); onData = /* @__PURE__ */ __name(function(data) { if ((nsize += data.length) > fileSizeLimit) { const extralen = fileSizeLimit - nsize + data.length; if (extralen > 0) { file.push(data.slice(0, extralen)); } file.truncated = true; file.bytesRead = fileSizeLimit; part.removeAllListeners("data"); file.emit("limit"); return; } else if (!file.push(data)) { self2._pause = true; } file.bytesRead = nsize; }, "onData"); onEnd = /* @__PURE__ */ __name(function() { curFile = void 0; file.push(null); }, "onEnd"); } else { if (nfields === fieldsLimit) { if (!boy.hitFieldsLimit) { boy.hitFieldsLimit = true; boy.emit("fieldsLimit"); } return skipPart(part); } ++nfields; ++nends; let buffer = ""; let truncated = false; curField = part; onData = /* @__PURE__ */ __name(function(data) { if ((nsize += data.length) > fieldSizeLimit) { const extralen = fieldSizeLimit - (nsize - data.length); buffer += data.toString("binary", 0, extralen); truncated = true; part.removeAllListeners("data"); } else { buffer += data.toString("binary"); } }, "onData"); onEnd = /* @__PURE__ */ __name(function() { curField = void 0; if (buffer.length) { buffer = decodeText(buffer, "binary", charset); } boy.emit("field", fieldname, buffer, false, truncated, encoding, contype); --nends; checkFinished(); }, "onEnd"); } part._readableState.sync = false; part.on("data", onData); part.on("end", onEnd); }).on("error", function(err) { if (curFile) { curFile.emit("error", err); } }); }, "onPart")).on("error", function(err) { boy.emit("error", err); }).on("finish", function() { finished = true; checkFinished(); }); } __name(Multipart, "Multipart"); Multipart.prototype.write = function(chunk, cb2) { const r7 = this.parser.write(chunk); if (r7 && !this._pause) { cb2(); } else { this._needDrain = !r7; this._cb = cb2; } }; Multipart.prototype.end = function() { const self2 = this; if (self2.parser.writable) { self2.parser.end(); } else if (!self2._boy._done) { process.nextTick(function() { self2._boy._done = true; self2._boy.emit("finish"); }); } }; function skipPart(part) { part.resume(); } __name(skipPart, "skipPart"); function FileStream(opts) { Readable8.call(this, opts); this.bytesRead = 0; this.truncated = false; } __name(FileStream, "FileStream"); inherits(FileStream, Readable8); FileStream.prototype._read = function(n6) { }; module3.exports = Multipart; } }); // ../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/Decoder.js var require_Decoder = __commonJS({ "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/Decoder.js"(exports2, module3) { "use strict"; init_import_meta_url(); var RE_PLUS = /\+/g; var HEX = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; function Decoder() { this.buffer = void 0; } __name(Decoder, "Decoder"); Decoder.prototype.write = function(str) { str = str.replace(RE_PLUS, " "); let res = ""; let i5 = 0; let p6 = 0; const len = str.length; for (; i5 < len; ++i5) { if (this.buffer !== void 0) { if (!HEX[str.charCodeAt(i5)]) { res += "%" + this.buffer; this.buffer = void 0; --i5; } else { this.buffer += str[i5]; ++p6; if (this.buffer.length === 2) { res += String.fromCharCode(parseInt(this.buffer, 16)); this.buffer = void 0; } } } else if (str[i5] === "%") { if (i5 > p6) { res += str.substring(p6, i5); p6 = i5; } this.buffer = ""; ++p6; } } if (p6 < len && this.buffer === void 0) { res += str.substring(p6); } return res; }; Decoder.prototype.reset = function() { this.buffer = void 0; }; module3.exports = Decoder; } }); // ../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/types/urlencoded.js var require_urlencoded = __commonJS({ "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/types/urlencoded.js"(exports2, module3) { "use strict"; init_import_meta_url(); var Decoder = require_Decoder(); var decodeText = require_decodeText(); var getLimit = require_getLimit(); var RE_CHARSET = /^charset$/i; UrlEncoded.detect = /^application\/x-www-form-urlencoded/i; function UrlEncoded(boy, cfg) { const limits = cfg.limits; const parsedConType = cfg.parsedConType; this.boy = boy; this.fieldSizeLimit = getLimit(limits, "fieldSize", 1 * 1024 * 1024); this.fieldNameSizeLimit = getLimit(limits, "fieldNameSize", 100); this.fieldsLimit = getLimit(limits, "fields", Infinity); let charset; for (var i5 = 0, len = parsedConType.length; i5 < len; ++i5) { if (Array.isArray(parsedConType[i5]) && RE_CHARSET.test(parsedConType[i5][0])) { charset = parsedConType[i5][1].toLowerCase(); break; } } if (charset === void 0) { charset = cfg.defCharset || "utf8"; } this.decoder = new Decoder(); this.charset = charset; this._fields = 0; this._state = "key"; this._checkingBytes = true; this._bytesKey = 0; this._bytesVal = 0; this._key = ""; this._val = ""; this._keyTrunc = false; this._valTrunc = false; this._hitLimit = false; } __name(UrlEncoded, "UrlEncoded"); UrlEncoded.prototype.write = function(data, cb2) { if (this._fields === this.fieldsLimit) { if (!this.boy.hitFieldsLimit) { this.boy.hitFieldsLimit = true; this.boy.emit("fieldsLimit"); } return cb2(); } let idxeq; let idxamp; let i5; let p6 = 0; const len = data.length; while (p6 < len) { if (this._state === "key") { idxeq = idxamp = void 0; for (i5 = p6; i5 < len; ++i5) { if (!this._checkingBytes) { ++p6; } if (data[i5] === 61) { idxeq = i5; break; } else if (data[i5] === 38) { idxamp = i5; break; } if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) { this._hitLimit = true; break; } else if (this._checkingBytes) { ++this._bytesKey; } } if (idxeq !== void 0) { if (idxeq > p6) { this._key += this.decoder.write(data.toString("binary", p6, idxeq)); } this._state = "val"; this._hitLimit = false; this._checkingBytes = true; this._val = ""; this._bytesVal = 0; this._valTrunc = false; this.decoder.reset(); p6 = idxeq + 1; } else if (idxamp !== void 0) { ++this._fields; let key; const keyTrunc = this._keyTrunc; if (idxamp > p6) { key = this._key += this.decoder.write(data.toString("binary", p6, idxamp)); } else { key = this._key; } this._hitLimit = false; this._checkingBytes = true; this._key = ""; this._bytesKey = 0; this._keyTrunc = false; this.decoder.reset(); if (key.length) { this.boy.emit( "field", decodeText(key, "binary", this.charset), "", keyTrunc, false ); } p6 = idxamp + 1; if (this._fields === this.fieldsLimit) { return cb2(); } } else if (this._hitLimit) { if (i5 > p6) { this._key += this.decoder.write(data.toString("binary", p6, i5)); } p6 = i5; if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) { this._checkingBytes = false; this._keyTrunc = true; } } else { if (p6 < len) { this._key += this.decoder.write(data.toString("binary", p6)); } p6 = len; } } else { idxamp = void 0; for (i5 = p6; i5 < len; ++i5) { if (!this._checkingBytes) { ++p6; } if (data[i5] === 38) { idxamp = i5; break; } if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) { this._hitLimit = true; break; } else if (this._checkingBytes) { ++this._bytesVal; } } if (idxamp !== void 0) { ++this._fields; if (idxamp > p6) { this._val += this.decoder.write(data.toString("binary", p6, idxamp)); } this.boy.emit( "field", decodeText(this._key, "binary", this.charset), decodeText(this._val, "binary", this.charset), this._keyTrunc, this._valTrunc ); this._state = "key"; this._hitLimit = false; this._checkingBytes = true; this._key = ""; this._bytesKey = 0; this._keyTrunc = false; this.decoder.reset(); p6 = idxamp + 1; if (this._fields === this.fieldsLimit) { return cb2(); } } else if (this._hitLimit) { if (i5 > p6) { this._val += this.decoder.write(data.toString("binary", p6, i5)); } p6 = i5; if (this._val === "" && this.fieldSizeLimit === 0 || (this._bytesVal = this._val.length) === this.fieldSizeLimit) { this._checkingBytes = false; this._valTrunc = true; } } else { if (p6 < len) { this._val += this.decoder.write(data.toString("binary", p6)); } p6 = len; } } } cb2(); }; UrlEncoded.prototype.end = function() { if (this.boy._done) { return; } if (this._state === "key" && this._key.length > 0) { this.boy.emit( "field", decodeText(this._key, "binary", this.charset), "", this._keyTrunc, false ); } else if (this._state === "val") { this.boy.emit( "field", decodeText(this._key, "binary", this.charset), decodeText(this._val, "binary", this.charset), this._keyTrunc, this._valTrunc ); } this.boy._done = true; this.boy.emit("finish"); }; module3.exports = UrlEncoded; } }); // ../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/main.js var require_main = __commonJS({ "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/main.js"(exports2, module3) { "use strict"; init_import_meta_url(); var WritableStream = require("node:stream").Writable; var { inherits } = require("node:util"); var Dicer = require_Dicer(); var MultipartParser = require_multipart(); var UrlencodedParser = require_urlencoded(); var parseParams = require_parseParams(); function Busboy(opts) { if (!(this instanceof Busboy)) { return new Busboy(opts); } if (typeof opts !== "object") { throw new TypeError("Busboy expected an options-Object."); } if (typeof opts.headers !== "object") { throw new TypeError("Busboy expected an options-Object with headers-attribute."); } if (typeof opts.headers["content-type"] !== "string") { throw new TypeError("Missing Content-Type-header."); } const { headers, ...streamOptions } = opts; this.opts = { autoDestroy: false, ...streamOptions }; WritableStream.call(this, this.opts); this._done = false; this._parser = this.getParserByHeaders(headers); this._finished = false; } __name(Busboy, "Busboy"); inherits(Busboy, WritableStream); Busboy.prototype.emit = function(ev) { if (ev === "finish") { if (!this._done) { this._parser?.end(); return; } else if (this._finished) { return; } this._finished = true; } WritableStream.prototype.emit.apply(this, arguments); }; Busboy.prototype.getParserByHeaders = function(headers) { const parsed = parseParams(headers["content-type"]); const cfg = { defCharset: this.opts.defCharset, fileHwm: this.opts.fileHwm, headers, highWaterMark: this.opts.highWaterMark, isPartAFile: this.opts.isPartAFile, limits: this.opts.limits, parsedConType: parsed, preservePath: this.opts.preservePath }; if (MultipartParser.detect.test(parsed[0])) { return new MultipartParser(this, cfg); } if (UrlencodedParser.detect.test(parsed[0])) { return new UrlencodedParser(this, cfg); } throw new Error("Unsupported Content-Type."); }; Busboy.prototype._write = function(chunk, encoding, cb2) { this._parser.write(chunk, cb2); }; module3.exports = Busboy; module3.exports.default = Busboy; module3.exports.Busboy = Busboy; module3.exports.Dicer = Dicer; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/constants.js var require_constants2 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/constants.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { MessageChannel, receiveMessageOnPort } = require("worker_threads"); var corsSafeListedMethods = ["GET", "HEAD", "POST"]; var corsSafeListedMethodsSet = new Set(corsSafeListedMethods); var nullBodyStatus = [101, 204, 205, 304]; var redirectStatus = [301, 302, 303, 307, 308]; var redirectStatusSet = new Set(redirectStatus); var badPorts = [ "1", "7", "9", "11", "13", "15", "17", "19", "20", "21", "22", "23", "25", "37", "42", "43", "53", "69", "77", "79", "87", "95", "101", "102", "103", "104", "109", "110", "111", "113", "115", "117", "119", "123", "135", "137", "139", "143", "161", "179", "389", "427", "465", "512", "513", "514", "515", "526", "530", "531", "532", "540", "548", "554", "556", "563", "587", "601", "636", "989", "990", "993", "995", "1719", "1720", "1723", "2049", "3659", "4045", "5060", "5061", "6000", "6566", "6665", "6666", "6667", "6668", "6669", "6697", "10080" ]; var badPortsSet = new Set(badPorts); var referrerPolicy = [ "", "no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url" ]; var referrerPolicySet = new Set(referrerPolicy); var requestRedirect = ["follow", "manual", "error"]; var safeMethods = ["GET", "HEAD", "OPTIONS", "TRACE"]; var safeMethodsSet = new Set(safeMethods); var requestMode = ["navigate", "same-origin", "no-cors", "cors"]; var requestCredentials = ["omit", "same-origin", "include"]; var requestCache = [ "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" ]; var requestBodyHeader = [ "content-encoding", "content-language", "content-location", "content-type", // See https://github.com/nodejs/undici/issues/2021 // 'Content-Length' is a forbidden header name, which is typically // removed in the Headers implementation. However, undici doesn't // filter out headers, so we add it here. "content-length" ]; var requestDuplex = [ "half" ]; var forbiddenMethods = ["CONNECT", "TRACE", "TRACK"]; var forbiddenMethodsSet = new Set(forbiddenMethods); var subresource = [ "audio", "audioworklet", "font", "image", "manifest", "paintworklet", "script", "style", "track", "video", "xslt", "" ]; var subresourceSet = new Set(subresource); var DOMException2 = globalThis.DOMException ?? (() => { try { atob("~"); } catch (err) { return Object.getPrototypeOf(err).constructor; } })(); var channel; var structuredClone = globalThis.structuredClone ?? // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js // structuredClone was added in v17.0.0, but fetch supports v16.8 /* @__PURE__ */ __name(function structuredClone2(value, options32 = void 0) { if (arguments.length === 0) { throw new TypeError("missing argument"); } if (!channel) { channel = new MessageChannel(); } channel.port1.unref(); channel.port2.unref(); channel.port1.postMessage(value, options32?.transfer); return receiveMessageOnPort(channel.port2).message; }, "structuredClone"); module3.exports = { DOMException: DOMException2, structuredClone, subresource, forbiddenMethods, requestBodyHeader, referrerPolicy, requestRedirect, requestMode, requestCredentials, requestCache, redirectStatus, corsSafeListedMethods, nullBodyStatus, safeMethods, badPorts, requestDuplex, subresourceSet, badPortsSet, redirectStatusSet, corsSafeListedMethodsSet, safeMethodsSet, forbiddenMethodsSet, referrerPolicySet }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/global.js var require_global = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/global.js"(exports2, module3) { "use strict"; init_import_meta_url(); var globalOrigin = Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } __name(getGlobalOrigin, "getGlobalOrigin"); function setGlobalOrigin(newOrigin) { if (newOrigin === void 0) { Object.defineProperty(globalThis, globalOrigin, { value: void 0, writable: true, enumerable: false, configurable: false }); return; } const parsedURL = new URL(newOrigin); if (parsedURL.protocol !== "http:" && parsedURL.protocol !== "https:") { throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`); } Object.defineProperty(globalThis, globalOrigin, { value: parsedURL, writable: true, enumerable: false, configurable: false }); } __name(setGlobalOrigin, "setGlobalOrigin"); module3.exports = { getGlobalOrigin, setGlobalOrigin }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/util.js var require_util2 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/util.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants2(); var { getGlobalOrigin } = require_global(); var { performance: performance2 } = require("perf_hooks"); var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util(); var assert38 = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; var crypto8; try { crypto8 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; supportedHashes = crypto8.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { const urlList = response.urlList; const length = urlList.length; return length === 0 ? null : urlList[length - 1].toString(); } __name(responseURL, "responseURL"); function responseLocationURL(response, requestFragment) { if (!redirectStatusSet.has(response.status)) { return null; } let location = response.headersList.get("location"); if (location !== null && isValidHeaderValue(location)) { location = new URL(location, responseURL(response)); } if (location && !location.hash) { location.hash = requestFragment; } return location; } __name(responseLocationURL, "responseLocationURL"); function requestCurrentURL(request4) { return request4.urlList[request4.urlList.length - 1]; } __name(requestCurrentURL, "requestCurrentURL"); function requestBadPort(request4) { const url4 = requestCurrentURL(request4); if (urlIsHttpHttpsScheme(url4) && badPortsSet.has(url4.port)) { return "blocked"; } return "allowed"; } __name(requestBadPort, "requestBadPort"); function isErrorLike(object) { return object instanceof Error || (object?.constructor?.name === "Error" || object?.constructor?.name === "DOMException"); } __name(isErrorLike, "isErrorLike"); function isValidReasonPhrase(statusText) { for (let i5 = 0; i5 < statusText.length; ++i5) { const c6 = statusText.charCodeAt(i5); if (!(c6 === 9 || // HTAB c6 >= 32 && c6 <= 126 || // SP / VCHAR c6 >= 128 && c6 <= 255)) { return false; } } return true; } __name(isValidReasonPhrase, "isValidReasonPhrase"); function isTokenCharCode(c6) { switch (c6) { case 34: case 40: case 41: case 44: case 47: case 58: case 59: case 60: case 61: case 62: case 63: case 64: case 91: case 92: case 93: case 123: case 125: return false; default: return c6 >= 33 && c6 <= 126; } } __name(isTokenCharCode, "isTokenCharCode"); function isValidHTTPToken(characters) { if (characters.length === 0) { return false; } for (let i5 = 0; i5 < characters.length; ++i5) { if (!isTokenCharCode(characters.charCodeAt(i5))) { return false; } } return true; } __name(isValidHTTPToken, "isValidHTTPToken"); function isValidHeaderName(potentialValue) { return isValidHTTPToken(potentialValue); } __name(isValidHeaderName, "isValidHeaderName"); function isValidHeaderValue(potentialValue) { if (potentialValue.startsWith(" ") || potentialValue.startsWith(" ") || potentialValue.endsWith(" ") || potentialValue.endsWith(" ")) { return false; } if (potentialValue.includes("\0") || potentialValue.includes("\r") || potentialValue.includes("\n")) { return false; } return true; } __name(isValidHeaderValue, "isValidHeaderValue"); function setRequestReferrerPolicyOnRedirect(request4, actualResponse) { const { headersList } = actualResponse; const policyHeader = (headersList.get("referrer-policy") ?? "").split(","); let policy = ""; if (policyHeader.length > 0) { for (let i5 = policyHeader.length; i5 !== 0; i5--) { const token = policyHeader[i5 - 1].trim(); if (referrerPolicyTokens.has(token)) { policy = token; break; } } } if (policy !== "") { request4.referrerPolicy = policy; } } __name(setRequestReferrerPolicyOnRedirect, "setRequestReferrerPolicyOnRedirect"); function crossOriginResourcePolicyCheck() { return "allowed"; } __name(crossOriginResourcePolicyCheck, "crossOriginResourcePolicyCheck"); function corsCheck() { return "success"; } __name(corsCheck, "corsCheck"); function TAOCheck() { return "success"; } __name(TAOCheck, "TAOCheck"); function appendFetchMetadata(httpRequest2) { let header = null; header = httpRequest2.mode; httpRequest2.headersList.set("sec-fetch-mode", header); } __name(appendFetchMetadata, "appendFetchMetadata"); function appendRequestOriginHeader(request4) { let serializedOrigin = request4.origin; if (request4.responseTainting === "cors" || request4.mode === "websocket") { if (serializedOrigin) { request4.headersList.append("origin", serializedOrigin); } } else if (request4.method !== "GET" && request4.method !== "HEAD") { switch (request4.referrerPolicy) { case "no-referrer": serializedOrigin = null; break; case "no-referrer-when-downgrade": case "strict-origin": case "strict-origin-when-cross-origin": if (request4.origin && urlHasHttpsScheme(request4.origin) && !urlHasHttpsScheme(requestCurrentURL(request4))) { serializedOrigin = null; } break; case "same-origin": if (!sameOrigin(request4, requestCurrentURL(request4))) { serializedOrigin = null; } break; default: } if (serializedOrigin) { request4.headersList.append("origin", serializedOrigin); } } } __name(appendRequestOriginHeader, "appendRequestOriginHeader"); function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { return performance2.now(); } __name(coarsenedSharedCurrentTime, "coarsenedSharedCurrentTime"); function createOpaqueTimingInfo(timingInfo) { return { startTime: timingInfo.startTime ?? 0, redirectStartTime: 0, redirectEndTime: 0, postRedirectStartTime: timingInfo.startTime ?? 0, finalServiceWorkerStartTime: 0, finalNetworkResponseStartTime: 0, finalNetworkRequestStartTime: 0, endTime: 0, encodedBodySize: 0, decodedBodySize: 0, finalConnectionTimingInfo: null }; } __name(createOpaqueTimingInfo, "createOpaqueTimingInfo"); function makePolicyContainer() { return { referrerPolicy: "strict-origin-when-cross-origin" }; } __name(makePolicyContainer, "makePolicyContainer"); function clonePolicyContainer(policyContainer) { return { referrerPolicy: policyContainer.referrerPolicy }; } __name(clonePolicyContainer, "clonePolicyContainer"); function determineRequestsReferrer(request4) { const policy = request4.referrerPolicy; assert38(policy); let referrerSource = null; if (request4.referrer === "client") { const globalOrigin = getGlobalOrigin(); if (!globalOrigin || globalOrigin.origin === "null") { return "no-referrer"; } referrerSource = new URL(globalOrigin); } else if (request4.referrer instanceof URL) { referrerSource = request4.referrer; } let referrerURL = stripURLForReferrer(referrerSource); const referrerOrigin = stripURLForReferrer(referrerSource, true); if (referrerURL.toString().length > 4096) { referrerURL = referrerOrigin; } const areSameOrigin = sameOrigin(request4, referrerURL); const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request4.url); switch (policy) { case "origin": return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true); case "unsafe-url": return referrerURL; case "same-origin": return areSameOrigin ? referrerOrigin : "no-referrer"; case "origin-when-cross-origin": return areSameOrigin ? referrerURL : referrerOrigin; case "strict-origin-when-cross-origin": { const currentURL = requestCurrentURL(request4); if (sameOrigin(referrerURL, currentURL)) { return referrerURL; } if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { return "no-referrer"; } return referrerOrigin; } case "strict-origin": case "no-referrer-when-downgrade": default: return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin; } } __name(determineRequestsReferrer, "determineRequestsReferrer"); function stripURLForReferrer(url4, originOnly) { assert38(url4 instanceof URL); if (url4.protocol === "file:" || url4.protocol === "about:" || url4.protocol === "blank:") { return "no-referrer"; } url4.username = ""; url4.password = ""; url4.hash = ""; if (originOnly) { url4.pathname = ""; url4.search = ""; } return url4; } __name(stripURLForReferrer, "stripURLForReferrer"); function isURLPotentiallyTrustworthy(url4) { if (!(url4 instanceof URL)) { return false; } if (url4.href === "about:blank" || url4.href === "about:srcdoc") { return true; } if (url4.protocol === "data:") return true; if (url4.protocol === "file:") return true; return isOriginPotentiallyTrustworthy(url4.origin); function isOriginPotentiallyTrustworthy(origin) { if (origin == null || origin === "null") return false; const originAsURL = new URL(origin); if (originAsURL.protocol === "https:" || originAsURL.protocol === "wss:") { return true; } if (/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(originAsURL.hostname) || (originAsURL.hostname === "localhost" || originAsURL.hostname.includes("localhost.")) || originAsURL.hostname.endsWith(".localhost")) { return true; } return false; } __name(isOriginPotentiallyTrustworthy, "isOriginPotentiallyTrustworthy"); } __name(isURLPotentiallyTrustworthy, "isURLPotentiallyTrustworthy"); function bytesMatch(bytes, metadataList) { if (crypto8 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); if (parsedMetadata === "no metadata") { return true; } if (parsedMetadata.length === 0) { return true; } const strongest = getStrongestMetadata(parsedMetadata); const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest); for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; let actualValue = crypto8.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); } else { actualValue = actualValue.slice(0, -1); } } if (compareBase64Mixed(actualValue, expectedValue)) { return true; } } return false; } __name(bytesMatch, "bytesMatch"); var parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i; function parseMetadata(metadata) { const result = []; let empty2 = true; for (const token of metadata.split(" ")) { empty2 = false; const parsedToken = parseHashWithOptions.exec(token); if (parsedToken === null || parsedToken.groups === void 0 || parsedToken.groups.algo === void 0) { continue; } const algorithm = parsedToken.groups.algo.toLowerCase(); if (supportedHashes.includes(algorithm)) { result.push(parsedToken.groups); } } if (empty2 === true) { return "no metadata"; } return result; } __name(parseMetadata, "parseMetadata"); function getStrongestMetadata(metadataList) { let algorithm = metadataList[0].algo; if (algorithm[3] === "5") { return algorithm; } for (let i5 = 1; i5 < metadataList.length; ++i5) { const metadata = metadataList[i5]; if (metadata.algo[3] === "5") { algorithm = "sha512"; break; } else if (algorithm[3] === "3") { continue; } else if (metadata.algo[3] === "3") { algorithm = "sha384"; } } return algorithm; } __name(getStrongestMetadata, "getStrongestMetadata"); function filterMetadataListByAlgorithm(metadataList, algorithm) { if (metadataList.length === 1) { return metadataList; } let pos = 0; for (let i5 = 0; i5 < metadataList.length; ++i5) { if (metadataList[i5].algo === algorithm) { metadataList[pos++] = metadataList[i5]; } } metadataList.length = pos; return metadataList; } __name(filterMetadataListByAlgorithm, "filterMetadataListByAlgorithm"); function compareBase64Mixed(actualValue, expectedValue) { if (actualValue.length !== expectedValue.length) { return false; } for (let i5 = 0; i5 < actualValue.length; ++i5) { if (actualValue[i5] !== expectedValue[i5]) { if (actualValue[i5] === "+" && expectedValue[i5] === "-" || actualValue[i5] === "/" && expectedValue[i5] === "_") { continue; } return false; } } return true; } __name(compareBase64Mixed, "compareBase64Mixed"); function tryUpgradeRequestToAPotentiallyTrustworthyURL(request4) { } __name(tryUpgradeRequestToAPotentiallyTrustworthyURL, "tryUpgradeRequestToAPotentiallyTrustworthyURL"); function sameOrigin(A3, B3) { if (A3.origin === B3.origin && A3.origin === "null") { return true; } if (A3.protocol === B3.protocol && A3.hostname === B3.hostname && A3.port === B3.port) { return true; } return false; } __name(sameOrigin, "sameOrigin"); function createDeferredPromise() { let res; let rej; const promise = new Promise((resolve25, reject) => { res = resolve25; rej = reject; }); return { promise, resolve: res, reject: rej }; } __name(createDeferredPromise, "createDeferredPromise"); function isAborted2(fetchParams) { return fetchParams.controller.state === "aborted"; } __name(isAborted2, "isAborted"); function isCancelled(fetchParams) { return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated"; } __name(isCancelled, "isCancelled"); var normalizeMethodRecord = { delete: "DELETE", DELETE: "DELETE", get: "GET", GET: "GET", head: "HEAD", HEAD: "HEAD", options: "OPTIONS", OPTIONS: "OPTIONS", post: "POST", POST: "POST", put: "PUT", PUT: "PUT" }; Object.setPrototypeOf(normalizeMethodRecord, null); function normalizeMethod(method) { return normalizeMethodRecord[method.toLowerCase()] ?? method; } __name(normalizeMethod, "normalizeMethod"); function serializeJavascriptValueToJSONString(value) { const result = JSON.stringify(value); if (result === void 0) { throw new TypeError("Value is not JSON serializable"); } assert38(typeof result === "string"); return result; } __name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString"); var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); function makeIterator(iterator, name2, kind) { const object = { index: 0, kind, target: iterator }; const i5 = { next() { if (Object.getPrototypeOf(this) !== i5) { throw new TypeError( `'next' called on an object that does not implement interface ${name2} Iterator.` ); } const { index, kind: kind2, target } = object; const values = target(); const len = values.length; if (index >= len) { return { value: void 0, done: true }; } const pair = values[index]; object.index = index + 1; return iteratorResult(pair, kind2); }, // The class string of an iterator prototype object for a given interface is the // result of concatenating the identifier of the interface and the string " Iterator". [Symbol.toStringTag]: `${name2} Iterator` }; Object.setPrototypeOf(i5, esIteratorPrototype); return Object.setPrototypeOf({}, i5); } __name(makeIterator, "makeIterator"); function iteratorResult(pair, kind) { let result; switch (kind) { case "key": { result = pair[0]; break; } case "value": { result = pair[1]; break; } case "key+value": { result = pair; break; } } return { value: result, done: false }; } __name(iteratorResult, "iteratorResult"); async function fullyReadBody(body, processBody, processBodyError) { const successSteps = processBody; const errorSteps = processBodyError; let reader; try { reader = body.stream.getReader(); } catch (e7) { errorSteps(e7); return; } try { const result = await readAllBytes(reader); successSteps(result); } catch (e7) { errorSteps(e7); } } __name(fullyReadBody, "fullyReadBody"); var ReadableStream3 = globalThis.ReadableStream; function isReadableStreamLike(stream2) { if (!ReadableStream3) { ReadableStream3 = require("stream/web").ReadableStream; } return stream2 instanceof ReadableStream3 || stream2[Symbol.toStringTag] === "ReadableStream" && typeof stream2.tee === "function"; } __name(isReadableStreamLike, "isReadableStreamLike"); var MAXIMUM_ARGUMENT_LENGTH = 65535; function isomorphicDecode(input) { if (input.length < MAXIMUM_ARGUMENT_LENGTH) { return String.fromCharCode(...input); } return input.reduce((previous, current) => previous + String.fromCharCode(current), ""); } __name(isomorphicDecode, "isomorphicDecode"); function readableStreamClose(controller) { try { controller.close(); } catch (err) { if (!err.message.includes("Controller is already closed")) { throw err; } } } __name(readableStreamClose, "readableStreamClose"); function isomorphicEncode(input) { for (let i5 = 0; i5 < input.length; i5++) { assert38(input.charCodeAt(i5) <= 255); } return input; } __name(isomorphicEncode, "isomorphicEncode"); async function readAllBytes(reader) { const bytes = []; let byteLength = 0; while (true) { const { done, value: chunk } = await reader.read(); if (done) { return Buffer.concat(bytes, byteLength); } if (!isUint8Array(chunk)) { throw new TypeError("Received non-Uint8Array chunk"); } bytes.push(chunk); byteLength += chunk.length; } } __name(readAllBytes, "readAllBytes"); function urlIsLocal(url4) { assert38("protocol" in url4); const protocol = url4.protocol; return protocol === "about:" || protocol === "blob:" || protocol === "data:"; } __name(urlIsLocal, "urlIsLocal"); function urlHasHttpsScheme(url4) { if (typeof url4 === "string") { return url4.startsWith("https:"); } return url4.protocol === "https:"; } __name(urlHasHttpsScheme, "urlHasHttpsScheme"); function urlIsHttpHttpsScheme(url4) { assert38("protocol" in url4); const protocol = url4.protocol; return protocol === "http:" || protocol === "https:"; } __name(urlIsHttpHttpsScheme, "urlIsHttpHttpsScheme"); var hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)); module3.exports = { isAborted: isAborted2, isCancelled, createDeferredPromise, ReadableStreamFrom, toUSVString, tryUpgradeRequestToAPotentiallyTrustworthyURL, coarsenedSharedCurrentTime, determineRequestsReferrer, makePolicyContainer, clonePolicyContainer, appendFetchMetadata, appendRequestOriginHeader, TAOCheck, corsCheck, crossOriginResourcePolicyCheck, createOpaqueTimingInfo, setRequestReferrerPolicyOnRedirect, isValidHTTPToken, requestBadPort, requestCurrentURL, responseURL, responseLocationURL, isBlobLike, isURLPotentiallyTrustworthy, isValidReasonPhrase, sameOrigin, normalizeMethod, serializeJavascriptValueToJSONString, makeIterator, isValidHeaderName, isValidHeaderValue, hasOwn, isErrorLike, fullyReadBody, bytesMatch, isReadableStreamLike, readableStreamClose, isomorphicEncode, isomorphicDecode, urlIsLocal, urlHasHttpsScheme, urlIsHttpHttpsScheme, readAllBytes, normalizeMethodRecord, parseMetadata }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/symbols.js var require_symbols2 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/symbols.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = { kUrl: Symbol("url"), kHeaders: Symbol("headers"), kSignal: Symbol("signal"), kState: Symbol("state"), kGuard: Symbol("guard"), kRealm: Symbol("realm") }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/webidl.js var require_webidl = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/webidl.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { types } = require("util"); var { hasOwn, toUSVString } = require_util2(); var webidl = {}; webidl.converters = {}; webidl.util = {}; webidl.errors = {}; webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; webidl.errors.conversionFailed = function(context2) { const plural2 = context2.types.length === 1 ? "" : " one of"; const message = `${context2.argument} could not be converted to${plural2}: ${context2.types.join(", ")}.`; return webidl.errors.exception({ header: context2.prefix, message }); }; webidl.errors.invalidArgument = function(context2) { return webidl.errors.exception({ header: context2.prefix, message: `"${context2.value}" is an invalid ${context2.type}.` }); }; webidl.brandCheck = function(V3, I4, opts = void 0) { if (opts?.strict !== false && !(V3 instanceof I4)) { throw new TypeError("Illegal invocation"); } else { return V3?.[Symbol.toStringTag] === I4.prototype[Symbol.toStringTag]; } }; webidl.argumentLengthCheck = function({ length }, min, ctx) { if (length < min) { throw webidl.errors.exception({ message: `${min} argument${min !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`, ...ctx }); } }; webidl.illegalConstructor = function() { throw webidl.errors.exception({ header: "TypeError", message: "Illegal constructor" }); }; webidl.util.Type = function(V3) { switch (typeof V3) { case "undefined": return "Undefined"; case "boolean": return "Boolean"; case "string": return "String"; case "symbol": return "Symbol"; case "number": return "Number"; case "bigint": return "BigInt"; case "function": case "object": { if (V3 === null) { return "Null"; } return "Object"; } } }; webidl.util.ConvertToInt = function(V3, bitLength, signedness, opts = {}) { let upperBound; let lowerBound2; if (bitLength === 64) { upperBound = Math.pow(2, 53) - 1; if (signedness === "unsigned") { lowerBound2 = 0; } else { lowerBound2 = Math.pow(-2, 53) + 1; } } else if (signedness === "unsigned") { lowerBound2 = 0; upperBound = Math.pow(2, bitLength) - 1; } else { lowerBound2 = Math.pow(-2, bitLength) - 1; upperBound = Math.pow(2, bitLength - 1) - 1; } let x6 = Number(V3); if (x6 === 0) { x6 = 0; } if (opts.enforceRange === true) { if (Number.isNaN(x6) || x6 === Number.POSITIVE_INFINITY || x6 === Number.NEGATIVE_INFINITY) { throw webidl.errors.exception({ header: "Integer conversion", message: `Could not convert ${V3} to an integer.` }); } x6 = webidl.util.IntegerPart(x6); if (x6 < lowerBound2 || x6 > upperBound) { throw webidl.errors.exception({ header: "Integer conversion", message: `Value must be between ${lowerBound2}-${upperBound}, got ${x6}.` }); } return x6; } if (!Number.isNaN(x6) && opts.clamp === true) { x6 = Math.min(Math.max(x6, lowerBound2), upperBound); if (Math.floor(x6) % 2 === 0) { x6 = Math.floor(x6); } else { x6 = Math.ceil(x6); } return x6; } if (Number.isNaN(x6) || x6 === 0 && Object.is(0, x6) || x6 === Number.POSITIVE_INFINITY || x6 === Number.NEGATIVE_INFINITY) { return 0; } x6 = webidl.util.IntegerPart(x6); x6 = x6 % Math.pow(2, bitLength); if (signedness === "signed" && x6 >= Math.pow(2, bitLength) - 1) { return x6 - Math.pow(2, bitLength); } return x6; }; webidl.util.IntegerPart = function(n6) { const r7 = Math.floor(Math.abs(n6)); if (n6 < 0) { return -1 * r7; } return r7; }; webidl.sequenceConverter = function(converter) { return (V3) => { if (webidl.util.Type(V3) !== "Object") { throw webidl.errors.exception({ header: "Sequence", message: `Value of type ${webidl.util.Type(V3)} is not an Object.` }); } const method = V3?.[Symbol.iterator]?.(); const seq = []; if (method === void 0 || typeof method.next !== "function") { throw webidl.errors.exception({ header: "Sequence", message: "Object is not an iterator." }); } while (true) { const { done, value } = method.next(); if (done) { break; } seq.push(converter(value)); } return seq; }; }; webidl.recordConverter = function(keyConverter, valueConverter) { return (O3) => { if (webidl.util.Type(O3) !== "Object") { throw webidl.errors.exception({ header: "Record", message: `Value of type ${webidl.util.Type(O3)} is not an Object.` }); } const result = {}; if (!types.isProxy(O3)) { const keys2 = Object.keys(O3); for (const key of keys2) { const typedKey = keyConverter(key); const typedValue = valueConverter(O3[key]); result[typedKey] = typedValue; } return result; } const keys = Reflect.ownKeys(O3); for (const key of keys) { const desc = Reflect.getOwnPropertyDescriptor(O3, key); if (desc?.enumerable) { const typedKey = keyConverter(key); const typedValue = valueConverter(O3[key]); result[typedKey] = typedValue; } } return result; }; }; webidl.interfaceConverter = function(i5) { return (V3, opts = {}) => { if (opts.strict !== false && !(V3 instanceof i5)) { throw webidl.errors.exception({ header: i5.name, message: `Expected ${V3} to be an instance of ${i5.name}.` }); } return V3; }; }; webidl.dictionaryConverter = function(converters) { return (dictionary) => { const type = webidl.util.Type(dictionary); const dict = {}; if (type === "Null" || type === "Undefined") { return dict; } else if (type !== "Object") { throw webidl.errors.exception({ header: "Dictionary", message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` }); } for (const options32 of converters) { const { key, defaultValue, required, converter } = options32; if (required === true) { if (!hasOwn(dictionary, key)) { throw webidl.errors.exception({ header: "Dictionary", message: `Missing required key "${key}".` }); } } let value = dictionary[key]; const hasDefault = hasOwn(options32, "defaultValue"); if (hasDefault && value !== null) { value = value ?? defaultValue; } if (required || hasDefault || value !== void 0) { value = converter(value); if (options32.allowedValues && !options32.allowedValues.includes(value)) { throw webidl.errors.exception({ header: "Dictionary", message: `${value} is not an accepted type. Expected one of ${options32.allowedValues.join(", ")}.` }); } dict[key] = value; } } return dict; }; }; webidl.nullableConverter = function(converter) { return (V3) => { if (V3 === null) { return V3; } return converter(V3); }; }; webidl.converters.DOMString = function(V3, opts = {}) { if (V3 === null && opts.legacyNullToEmptyString) { return ""; } if (typeof V3 === "symbol") { throw new TypeError("Could not convert argument of type symbol to string."); } return String(V3); }; webidl.converters.ByteString = function(V3) { const x6 = webidl.converters.DOMString(V3); for (let index = 0; index < x6.length; index++) { if (x6.charCodeAt(index) > 255) { throw new TypeError( `Cannot convert argument to a ByteString because the character at index ${index} has a value of ${x6.charCodeAt(index)} which is greater than 255.` ); } } return x6; }; webidl.converters.USVString = toUSVString; webidl.converters.boolean = function(V3) { const x6 = Boolean(V3); return x6; }; webidl.converters.any = function(V3) { return V3; }; webidl.converters["long long"] = function(V3) { const x6 = webidl.util.ConvertToInt(V3, 64, "signed"); return x6; }; webidl.converters["unsigned long long"] = function(V3) { const x6 = webidl.util.ConvertToInt(V3, 64, "unsigned"); return x6; }; webidl.converters["unsigned long"] = function(V3) { const x6 = webidl.util.ConvertToInt(V3, 32, "unsigned"); return x6; }; webidl.converters["unsigned short"] = function(V3, opts) { const x6 = webidl.util.ConvertToInt(V3, 16, "unsigned", opts); return x6; }; webidl.converters.ArrayBuffer = function(V3, opts = {}) { if (webidl.util.Type(V3) !== "Object" || !types.isAnyArrayBuffer(V3)) { throw webidl.errors.conversionFailed({ prefix: `${V3}`, argument: `${V3}`, types: ["ArrayBuffer"] }); } if (opts.allowShared === false && types.isSharedArrayBuffer(V3)) { throw webidl.errors.exception({ header: "ArrayBuffer", message: "SharedArrayBuffer is not allowed." }); } return V3; }; webidl.converters.TypedArray = function(V3, T3, opts = {}) { if (webidl.util.Type(V3) !== "Object" || !types.isTypedArray(V3) || V3.constructor.name !== T3.name) { throw webidl.errors.conversionFailed({ prefix: `${T3.name}`, argument: `${V3}`, types: [T3.name] }); } if (opts.allowShared === false && types.isSharedArrayBuffer(V3.buffer)) { throw webidl.errors.exception({ header: "ArrayBuffer", message: "SharedArrayBuffer is not allowed." }); } return V3; }; webidl.converters.DataView = function(V3, opts = {}) { if (webidl.util.Type(V3) !== "Object" || !types.isDataView(V3)) { throw webidl.errors.exception({ header: "DataView", message: "Object is not a DataView." }); } if (opts.allowShared === false && types.isSharedArrayBuffer(V3.buffer)) { throw webidl.errors.exception({ header: "ArrayBuffer", message: "SharedArrayBuffer is not allowed." }); } return V3; }; webidl.converters.BufferSource = function(V3, opts = {}) { if (types.isAnyArrayBuffer(V3)) { return webidl.converters.ArrayBuffer(V3, opts); } if (types.isTypedArray(V3)) { return webidl.converters.TypedArray(V3, V3.constructor); } if (types.isDataView(V3)) { return webidl.converters.DataView(V3, opts); } throw new TypeError(`Could not convert ${V3} to a BufferSource.`); }; webidl.converters["sequence"] = webidl.sequenceConverter( webidl.converters.ByteString ); webidl.converters["sequence>"] = webidl.sequenceConverter( webidl.converters["sequence"] ); webidl.converters["record"] = webidl.recordConverter( webidl.converters.ByteString, webidl.converters.ByteString ); module3.exports = { webidl }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/dataURL.js var require_dataURL = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/dataURL.js"(exports2, module3) { init_import_meta_url(); var assert38 = require("assert"); var { atob: atob2 } = require("buffer"); var { isomorphicDecode } = require_util2(); var encoder = new TextEncoder(); var HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/; var HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/; var HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/; function dataURLProcessor(dataURL) { assert38(dataURL.protocol === "data:"); let input = URLSerializer(dataURL, true); input = input.slice(5); const position = { position: 0 }; let mimeType = collectASequenceOfCodePointsFast( ",", input, position ); const mimeTypeLength = mimeType.length; mimeType = removeASCIIWhitespace(mimeType, true, true); if (position.position >= input.length) { return "failure"; } position.position++; const encodedBody = input.slice(mimeTypeLength + 1); let body = stringPercentDecode(encodedBody); if (/;(\u0020){0,}base64$/i.test(mimeType)) { const stringBody = isomorphicDecode(body); body = forgivingBase64(stringBody); if (body === "failure") { return "failure"; } mimeType = mimeType.slice(0, -6); mimeType = mimeType.replace(/(\u0020)+$/, ""); mimeType = mimeType.slice(0, -1); } if (mimeType.startsWith(";")) { mimeType = "text/plain" + mimeType; } let mimeTypeRecord = parseMIMEType(mimeType); if (mimeTypeRecord === "failure") { mimeTypeRecord = parseMIMEType("text/plain;charset=US-ASCII"); } return { mimeType: mimeTypeRecord, body }; } __name(dataURLProcessor, "dataURLProcessor"); function URLSerializer(url4, excludeFragment = false) { if (!excludeFragment) { return url4.href; } const href = url4.href; const hashLength = url4.hash.length; return hashLength === 0 ? href : href.substring(0, href.length - hashLength); } __name(URLSerializer, "URLSerializer"); function collectASequenceOfCodePoints(condition, input, position) { let result = ""; while (position.position < input.length && condition(input[position.position])) { result += input[position.position]; position.position++; } return result; } __name(collectASequenceOfCodePoints, "collectASequenceOfCodePoints"); function collectASequenceOfCodePointsFast(char, input, position) { const idx = input.indexOf(char, position.position); const start = position.position; if (idx === -1) { position.position = input.length; return input.slice(start); } position.position = idx; return input.slice(start, position.position); } __name(collectASequenceOfCodePointsFast, "collectASequenceOfCodePointsFast"); function stringPercentDecode(input) { const bytes = encoder.encode(input); return percentDecode(bytes); } __name(stringPercentDecode, "stringPercentDecode"); function percentDecode(input) { const output = []; for (let i5 = 0; i5 < input.length; i5++) { const byte = input[i5]; if (byte !== 37) { output.push(byte); } else if (byte === 37 && !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i5 + 1], input[i5 + 2]))) { output.push(37); } else { const nextTwoBytes = String.fromCharCode(input[i5 + 1], input[i5 + 2]); const bytePoint = Number.parseInt(nextTwoBytes, 16); output.push(bytePoint); i5 += 2; } } return Uint8Array.from(output); } __name(percentDecode, "percentDecode"); function parseMIMEType(input) { input = removeHTTPWhitespace(input, true, true); const position = { position: 0 }; const type = collectASequenceOfCodePointsFast( "/", input, position ); if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) { return "failure"; } if (position.position > input.length) { return "failure"; } position.position++; let subtype = collectASequenceOfCodePointsFast( ";", input, position ); subtype = removeHTTPWhitespace(subtype, false, true); if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) { return "failure"; } const typeLowercase = type.toLowerCase(); const subtypeLowercase = subtype.toLowerCase(); const mimeType = { type: typeLowercase, subtype: subtypeLowercase, /** @type {Map} */ parameters: /* @__PURE__ */ new Map(), // https://mimesniff.spec.whatwg.org/#mime-type-essence essence: `${typeLowercase}/${subtypeLowercase}` }; while (position.position < input.length) { position.position++; collectASequenceOfCodePoints( // https://fetch.spec.whatwg.org/#http-whitespace (char) => HTTP_WHITESPACE_REGEX.test(char), input, position ); let parameterName = collectASequenceOfCodePoints( (char) => char !== ";" && char !== "=", input, position ); parameterName = parameterName.toLowerCase(); if (position.position < input.length) { if (input[position.position] === ";") { continue; } position.position++; } if (position.position > input.length) { break; } let parameterValue = null; if (input[position.position] === '"') { parameterValue = collectAnHTTPQuotedString(input, position, true); collectASequenceOfCodePointsFast( ";", input, position ); } else { parameterValue = collectASequenceOfCodePointsFast( ";", input, position ); parameterValue = removeHTTPWhitespace(parameterValue, false, true); if (parameterValue.length === 0) { continue; } } if (parameterName.length !== 0 && HTTP_TOKEN_CODEPOINTS.test(parameterName) && (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && !mimeType.parameters.has(parameterName)) { mimeType.parameters.set(parameterName, parameterValue); } } return mimeType; } __name(parseMIMEType, "parseMIMEType"); function forgivingBase64(data) { data = data.replace(/[\u0009\u000A\u000C\u000D\u0020]/g, ""); if (data.length % 4 === 0) { data = data.replace(/=?=$/, ""); } if (data.length % 4 === 1) { return "failure"; } if (/[^+/0-9A-Za-z]/.test(data)) { return "failure"; } const binary = atob2(data); const bytes = new Uint8Array(binary.length); for (let byte = 0; byte < binary.length; byte++) { bytes[byte] = binary.charCodeAt(byte); } return bytes; } __name(forgivingBase64, "forgivingBase64"); function collectAnHTTPQuotedString(input, position, extractValue) { const positionStart = position.position; let value = ""; assert38(input[position.position] === '"'); position.position++; while (true) { value += collectASequenceOfCodePoints( (char) => char !== '"' && char !== "\\", input, position ); if (position.position >= input.length) { break; } const quoteOrBackslash = input[position.position]; position.position++; if (quoteOrBackslash === "\\") { if (position.position >= input.length) { value += "\\"; break; } value += input[position.position]; position.position++; } else { assert38(quoteOrBackslash === '"'); break; } } if (extractValue) { return value; } return input.slice(positionStart, position.position); } __name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString"); function serializeAMimeType(mimeType) { assert38(mimeType !== "failure"); const { parameters, essence } = mimeType; let serialization = essence; for (let [name2, value] of parameters.entries()) { serialization += ";"; serialization += name2; serialization += "="; if (!HTTP_TOKEN_CODEPOINTS.test(value)) { value = value.replace(/(\\|")/g, "\\$1"); value = '"' + value; value += '"'; } serialization += value; } return serialization; } __name(serializeAMimeType, "serializeAMimeType"); function isHTTPWhiteSpace(char) { return char === "\r" || char === "\n" || char === " " || char === " "; } __name(isHTTPWhiteSpace, "isHTTPWhiteSpace"); function removeHTTPWhitespace(str, leading = true, trailing = true) { let lead = 0; let trail = str.length - 1; if (leading) { for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++) ; } if (trailing) { for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--) ; } return str.slice(lead, trail + 1); } __name(removeHTTPWhitespace, "removeHTTPWhitespace"); function isASCIIWhitespace(char) { return char === "\r" || char === "\n" || char === " " || char === "\f" || char === " "; } __name(isASCIIWhitespace, "isASCIIWhitespace"); function removeASCIIWhitespace(str, leading = true, trailing = true) { let lead = 0; let trail = str.length - 1; if (leading) { for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++) ; } if (trailing) { for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--) ; } return str.slice(lead, trail + 1); } __name(removeASCIIWhitespace, "removeASCIIWhitespace"); module3.exports = { dataURLProcessor, URLSerializer, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, stringPercentDecode, parseMIMEType, collectAnHTTPQuotedString, serializeAMimeType }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/file.js var require_file = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/file.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { Blob: Blob6, File: NativeFile } = require("buffer"); var { types } = require("util"); var { kState } = require_symbols2(); var { isBlobLike } = require_util2(); var { webidl } = require_webidl(); var { parseMIMEType, serializeAMimeType } = require_dataURL(); var { kEnumerableProperty } = require_util(); var encoder = new TextEncoder(); var File8 = class extends Blob6 { constructor(fileBits, fileName, options32 = {}) { webidl.argumentLengthCheck(arguments, 2, { header: "File constructor" }); fileBits = webidl.converters["sequence"](fileBits); fileName = webidl.converters.USVString(fileName); options32 = webidl.converters.FilePropertyBag(options32); const n6 = fileName; let t7 = options32.type; let d6; substep: { if (t7) { t7 = parseMIMEType(t7); if (t7 === "failure") { t7 = ""; break substep; } t7 = serializeAMimeType(t7).toLowerCase(); } d6 = options32.lastModified; } super(processBlobParts(fileBits, options32), { type: t7 }); this[kState] = { name: n6, lastModified: d6, type: t7 }; } get name() { webidl.brandCheck(this, File8); return this[kState].name; } get lastModified() { webidl.brandCheck(this, File8); return this[kState].lastModified; } get type() { webidl.brandCheck(this, File8); return this[kState].type; } }; __name(File8, "File"); var FileLike = class { constructor(blobLike, fileName, options32 = {}) { const n6 = fileName; const t7 = options32.type; const d6 = options32.lastModified ?? Date.now(); this[kState] = { blobLike, name: n6, type: t7, lastModified: d6 }; } stream(...args) { webidl.brandCheck(this, FileLike); return this[kState].blobLike.stream(...args); } arrayBuffer(...args) { webidl.brandCheck(this, FileLike); return this[kState].blobLike.arrayBuffer(...args); } slice(...args) { webidl.brandCheck(this, FileLike); return this[kState].blobLike.slice(...args); } text(...args) { webidl.brandCheck(this, FileLike); return this[kState].blobLike.text(...args); } get size() { webidl.brandCheck(this, FileLike); return this[kState].blobLike.size; } get type() { webidl.brandCheck(this, FileLike); return this[kState].blobLike.type; } get name() { webidl.brandCheck(this, FileLike); return this[kState].name; } get lastModified() { webidl.brandCheck(this, FileLike); return this[kState].lastModified; } get [Symbol.toStringTag]() { return "File"; } }; __name(FileLike, "FileLike"); Object.defineProperties(File8.prototype, { [Symbol.toStringTag]: { value: "File", configurable: true }, name: kEnumerableProperty, lastModified: kEnumerableProperty }); webidl.converters.Blob = webidl.interfaceConverter(Blob6); webidl.converters.BlobPart = function(V3, opts) { if (webidl.util.Type(V3) === "Object") { if (isBlobLike(V3)) { return webidl.converters.Blob(V3, { strict: false }); } if (ArrayBuffer.isView(V3) || types.isAnyArrayBuffer(V3)) { return webidl.converters.BufferSource(V3, opts); } } return webidl.converters.USVString(V3, opts); }; webidl.converters["sequence"] = webidl.sequenceConverter( webidl.converters.BlobPart ); webidl.converters.FilePropertyBag = webidl.dictionaryConverter([ { key: "lastModified", converter: webidl.converters["long long"], get defaultValue() { return Date.now(); } }, { key: "type", converter: webidl.converters.DOMString, defaultValue: "" }, { key: "endings", converter: (value) => { value = webidl.converters.DOMString(value); value = value.toLowerCase(); if (value !== "native") { value = "transparent"; } return value; }, defaultValue: "transparent" } ]); function processBlobParts(parts, options32) { const bytes = []; for (const element of parts) { if (typeof element === "string") { let s5 = element; if (options32.endings === "native") { s5 = convertLineEndingsNative(s5); } bytes.push(encoder.encode(s5)); } else if (types.isAnyArrayBuffer(element) || types.isTypedArray(element)) { if (!element.buffer) { bytes.push(new Uint8Array(element)); } else { bytes.push( new Uint8Array(element.buffer, element.byteOffset, element.byteLength) ); } } else if (isBlobLike(element)) { bytes.push(element); } } return bytes; } __name(processBlobParts, "processBlobParts"); function convertLineEndingsNative(s5) { let nativeLineEnding = "\n"; if (process.platform === "win32") { nativeLineEnding = "\r\n"; } return s5.replace(/\r?\n/g, nativeLineEnding); } __name(convertLineEndingsNative, "convertLineEndingsNative"); function isFileLike(object) { return NativeFile && object instanceof NativeFile || object instanceof File8 || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File"; } __name(isFileLike, "isFileLike"); module3.exports = { File: File8, FileLike, isFileLike }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/formdata.js var require_formdata = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/formdata.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { isBlobLike, toUSVString, makeIterator } = require_util2(); var { kState } = require_symbols2(); var { File: UndiciFile, FileLike, isFileLike } = require_file(); var { webidl } = require_webidl(); var { Blob: Blob6, File: NativeFile } = require("buffer"); var File8 = NativeFile ?? UndiciFile; var FormData11 = class { constructor(form) { if (form !== void 0) { throw webidl.errors.conversionFailed({ prefix: "FormData constructor", argument: "Argument 1", types: ["undefined"] }); } this[kState] = []; } append(name2, value, filename = void 0) { webidl.brandCheck(this, FormData11); webidl.argumentLengthCheck(arguments, 2, { header: "FormData.append" }); if (arguments.length === 3 && !isBlobLike(value)) { throw new TypeError( "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" ); } name2 = webidl.converters.USVString(name2); value = isBlobLike(value) ? webidl.converters.Blob(value, { strict: false }) : webidl.converters.USVString(value); filename = arguments.length === 3 ? webidl.converters.USVString(filename) : void 0; const entry = makeEntry(name2, value, filename); this[kState].push(entry); } delete(name2) { webidl.brandCheck(this, FormData11); webidl.argumentLengthCheck(arguments, 1, { header: "FormData.delete" }); name2 = webidl.converters.USVString(name2); this[kState] = this[kState].filter((entry) => entry.name !== name2); } get(name2) { webidl.brandCheck(this, FormData11); webidl.argumentLengthCheck(arguments, 1, { header: "FormData.get" }); name2 = webidl.converters.USVString(name2); const idx = this[kState].findIndex((entry) => entry.name === name2); if (idx === -1) { return null; } return this[kState][idx].value; } getAll(name2) { webidl.brandCheck(this, FormData11); webidl.argumentLengthCheck(arguments, 1, { header: "FormData.getAll" }); name2 = webidl.converters.USVString(name2); return this[kState].filter((entry) => entry.name === name2).map((entry) => entry.value); } has(name2) { webidl.brandCheck(this, FormData11); webidl.argumentLengthCheck(arguments, 1, { header: "FormData.has" }); name2 = webidl.converters.USVString(name2); return this[kState].findIndex((entry) => entry.name === name2) !== -1; } set(name2, value, filename = void 0) { webidl.brandCheck(this, FormData11); webidl.argumentLengthCheck(arguments, 2, { header: "FormData.set" }); if (arguments.length === 3 && !isBlobLike(value)) { throw new TypeError( "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" ); } name2 = webidl.converters.USVString(name2); value = isBlobLike(value) ? webidl.converters.Blob(value, { strict: false }) : webidl.converters.USVString(value); filename = arguments.length === 3 ? toUSVString(filename) : void 0; const entry = makeEntry(name2, value, filename); const idx = this[kState].findIndex((entry2) => entry2.name === name2); if (idx !== -1) { this[kState] = [ ...this[kState].slice(0, idx), entry, ...this[kState].slice(idx + 1).filter((entry2) => entry2.name !== name2) ]; } else { this[kState].push(entry); } } entries() { webidl.brandCheck(this, FormData11); return makeIterator( () => this[kState].map((pair) => [pair.name, pair.value]), "FormData", "key+value" ); } keys() { webidl.brandCheck(this, FormData11); return makeIterator( () => this[kState].map((pair) => [pair.name, pair.value]), "FormData", "key" ); } values() { webidl.brandCheck(this, FormData11); return makeIterator( () => this[kState].map((pair) => [pair.name, pair.value]), "FormData", "value" ); } /** * @param {(value: string, key: string, self: FormData) => void} callbackFn * @param {unknown} thisArg */ forEach(callbackFn, thisArg = globalThis) { webidl.brandCheck(this, FormData11); webidl.argumentLengthCheck(arguments, 1, { header: "FormData.forEach" }); if (typeof callbackFn !== "function") { throw new TypeError( "Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'." ); } for (const [key, value] of this) { callbackFn.apply(thisArg, [value, key, this]); } } }; __name(FormData11, "FormData"); FormData11.prototype[Symbol.iterator] = FormData11.prototype.entries; Object.defineProperties(FormData11.prototype, { [Symbol.toStringTag]: { value: "FormData", configurable: true } }); function makeEntry(name2, value, filename) { name2 = Buffer.from(name2).toString("utf8"); if (typeof value === "string") { value = Buffer.from(value).toString("utf8"); } else { if (!isFileLike(value)) { value = value instanceof Blob6 ? new File8([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type }); } if (filename !== void 0) { const options32 = { type: value.type, lastModified: value.lastModified }; value = NativeFile && value instanceof NativeFile || value instanceof UndiciFile ? new File8([value], filename, options32) : new FileLike(value, filename, options32); } } return { name: name2, value }; } __name(makeEntry, "makeEntry"); module3.exports = { FormData: FormData11 }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/body.js var require_body = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/body.js"(exports2, module3) { "use strict"; init_import_meta_url(); var Busboy = require_main(); var util5 = require_util(); var { ReadableStreamFrom, isBlobLike, isReadableStreamLike, readableStreamClose, createDeferredPromise, fullyReadBody } = require_util2(); var { FormData: FormData11 } = require_formdata(); var { kState } = require_symbols2(); var { webidl } = require_webidl(); var { DOMException: DOMException2, structuredClone } = require_constants2(); var { Blob: Blob6, File: NativeFile } = require("buffer"); var { kBodyUsed } = require_symbols(); var assert38 = require("assert"); var { isErrored } = require_util(); var { isUint8Array, isArrayBuffer: isArrayBuffer3 } = require("util/types"); var { File: UndiciFile } = require_file(); var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { const crypto8 = require("node:crypto"); random = /* @__PURE__ */ __name((max) => crypto8.randomInt(0, max), "random"); } catch { random = /* @__PURE__ */ __name((max) => Math.floor(Math.random(max)), "random"); } var ReadableStream3 = globalThis.ReadableStream; var File8 = NativeFile ?? UndiciFile; var textEncoder = new TextEncoder(); var textDecoder = new TextDecoder(); function extractBody(object, keepalive = false) { if (!ReadableStream3) { ReadableStream3 = require("stream/web").ReadableStream; } let stream2 = null; if (object instanceof ReadableStream3) { stream2 = object; } else if (isBlobLike(object)) { stream2 = object.stream(); } else { stream2 = new ReadableStream3({ async pull(controller) { controller.enqueue( typeof source === "string" ? textEncoder.encode(source) : source ); queueMicrotask(() => readableStreamClose(controller)); }, start() { }, type: void 0 }); } assert38(isReadableStreamLike(stream2)); let action = null; let source = null; let length = null; let type = null; if (typeof object === "string") { source = object; type = "text/plain;charset=UTF-8"; } else if (object instanceof URLSearchParams) { source = object.toString(); type = "application/x-www-form-urlencoded;charset=UTF-8"; } else if (isArrayBuffer3(object)) { source = new Uint8Array(object.slice()); } else if (ArrayBuffer.isView(object)) { source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)); } else if (util5.isFormDataLike(object)) { const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; const prefix = `--${boundary}\r Content-Disposition: form-data`; const escape2 = /* @__PURE__ */ __name((str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), "escape"); const normalizeLinefeeds = /* @__PURE__ */ __name((value) => value.replace(/\r?\n|\r/g, "\r\n"), "normalizeLinefeeds"); const blobParts = []; const rn = new Uint8Array([13, 10]); length = 0; let hasUnknownSizeValue = false; for (const [name2, value] of object) { if (typeof value === "string") { const chunk2 = textEncoder.encode(prefix + `; name="${escape2(normalizeLinefeeds(name2))}"\r \r ${normalizeLinefeeds(value)}\r `); blobParts.push(chunk2); length += chunk2.byteLength; } else { const chunk2 = textEncoder.encode(`${prefix}; name="${escape2(normalizeLinefeeds(name2))}"` + (value.name ? `; filename="${escape2(value.name)}"` : "") + `\r Content-Type: ${value.type || "application/octet-stream"}\r \r `); blobParts.push(chunk2, value, rn); if (typeof value.size === "number") { length += chunk2.byteLength + value.size + rn.byteLength; } else { hasUnknownSizeValue = true; } } } const chunk = textEncoder.encode(`--${boundary}--`); blobParts.push(chunk); length += chunk.byteLength; if (hasUnknownSizeValue) { length = null; } source = object; action = /* @__PURE__ */ __name(async function* () { for (const part of blobParts) { if (part.stream) { yield* part.stream(); } else { yield part; } } }, "action"); type = "multipart/form-data; boundary=" + boundary; } else if (isBlobLike(object)) { source = object; length = object.size; if (object.type) { type = object.type; } } else if (typeof object[Symbol.asyncIterator] === "function") { if (keepalive) { throw new TypeError("keepalive"); } if (util5.isDisturbed(object) || object.locked) { throw new TypeError( "Response body object should not be disturbed or locked" ); } stream2 = object instanceof ReadableStream3 ? object : ReadableStreamFrom(object); } if (typeof source === "string" || util5.isBuffer(source)) { length = Buffer.byteLength(source); } if (action != null) { let iterator; stream2 = new ReadableStream3({ async start() { iterator = action(object)[Symbol.asyncIterator](); }, async pull(controller) { const { value, done } = await iterator.next(); if (done) { queueMicrotask(() => { controller.close(); }); } else { if (!isErrored(stream2)) { controller.enqueue(new Uint8Array(value)); } } return controller.desiredSize > 0; }, async cancel(reason) { await iterator.return(); }, type: void 0 }); } const body = { stream: stream2, source, length }; return [body, type]; } __name(extractBody, "extractBody"); function safelyExtractBody(object, keepalive = false) { if (!ReadableStream3) { ReadableStream3 = require("stream/web").ReadableStream; } if (object instanceof ReadableStream3) { assert38(!util5.isDisturbed(object), "The body has already been consumed."); assert38(!object.locked, "The stream is locked."); } return extractBody(object, keepalive); } __name(safelyExtractBody, "safelyExtractBody"); function cloneBody(body) { const [out1, out2] = body.stream.tee(); const out2Clone = structuredClone(out2, { transfer: [out2] }); const [, finalClone] = out2Clone.tee(); body.stream = out1; return { stream: finalClone, length: body.length, source: body.source }; } __name(cloneBody, "cloneBody"); async function* consumeBody(body) { if (body) { if (isUint8Array(body)) { yield body; } else { const stream2 = body.stream; if (util5.isDisturbed(stream2)) { throw new TypeError("The body has already been consumed."); } if (stream2.locked) { throw new TypeError("The stream is locked."); } stream2[kBodyUsed] = true; yield* stream2; } } } __name(consumeBody, "consumeBody"); function throwIfAborted(state2) { if (state2.aborted) { throw new DOMException2("The operation was aborted.", "AbortError"); } } __name(throwIfAborted, "throwIfAborted"); function bodyMixinMethods(instance) { const methods = { blob() { return specConsumeBody(this, (bytes) => { let mimeType = bodyMimeType(this); if (mimeType === "failure") { mimeType = ""; } else if (mimeType) { mimeType = serializeAMimeType(mimeType); } return new Blob6([bytes], { type: mimeType }); }, instance); }, arrayBuffer() { return specConsumeBody(this, (bytes) => { return new Uint8Array(bytes).buffer; }, instance); }, text() { return specConsumeBody(this, utf8DecodeBytes, instance); }, json() { return specConsumeBody(this, parseJSONFromBytes, instance); }, async formData() { webidl.brandCheck(this, instance); throwIfAborted(this[kState]); const contentType = this.headers.get("Content-Type"); if (/multipart\/form-data/.test(contentType)) { const headers = {}; for (const [key, value] of this.headers) headers[key.toLowerCase()] = value; const responseFormData = new FormData11(); let busboy; try { busboy = new Busboy({ headers, preservePath: true }); } catch (err) { throw new DOMException2(`${err}`, "AbortError"); } busboy.on("field", (name2, value) => { responseFormData.append(name2, value); }); busboy.on("file", (name2, value, filename, encoding, mimeType) => { const chunks = []; if (encoding === "base64" || encoding.toLowerCase() === "base64") { let base64chunk = ""; value.on("data", (chunk) => { base64chunk += chunk.toString().replace(/[\r\n]/gm, ""); const end = base64chunk.length - base64chunk.length % 4; chunks.push(Buffer.from(base64chunk.slice(0, end), "base64")); base64chunk = base64chunk.slice(end); }); value.on("end", () => { chunks.push(Buffer.from(base64chunk, "base64")); responseFormData.append(name2, new File8(chunks, filename, { type: mimeType })); }); } else { value.on("data", (chunk) => { chunks.push(chunk); }); value.on("end", () => { responseFormData.append(name2, new File8(chunks, filename, { type: mimeType })); }); } }); const busboyResolve = new Promise((resolve25, reject) => { busboy.on("finish", resolve25); busboy.on("error", (err) => reject(new TypeError(err))); }); if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk); busboy.end(); await busboyResolve; return responseFormData; } else if (/application\/x-www-form-urlencoded/.test(contentType)) { let entries; try { let text = ""; const streamingDecoder = new TextDecoder("utf-8", { ignoreBOM: true }); for await (const chunk of consumeBody(this[kState].body)) { if (!isUint8Array(chunk)) { throw new TypeError("Expected Uint8Array chunk"); } text += streamingDecoder.decode(chunk, { stream: true }); } text += streamingDecoder.decode(); entries = new URLSearchParams(text); } catch (err) { throw Object.assign(new TypeError(), { cause: err }); } const formData = new FormData11(); for (const [name2, value] of entries) { formData.append(name2, value); } return formData; } else { await Promise.resolve(); throwIfAborted(this[kState]); throw webidl.errors.exception({ header: `${instance.name}.formData`, message: "Could not parse content as FormData." }); } } }; return methods; } __name(bodyMixinMethods, "bodyMixinMethods"); function mixinBody(prototype) { Object.assign(prototype.prototype, bodyMixinMethods(prototype)); } __name(mixinBody, "mixinBody"); async function specConsumeBody(object, convertBytesToJSValue, instance) { webidl.brandCheck(object, instance); throwIfAborted(object[kState]); if (bodyUnusable(object[kState].body)) { throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); const errorSteps = /* @__PURE__ */ __name((error2) => promise.reject(error2), "errorSteps"); const successSteps = /* @__PURE__ */ __name((data) => { try { promise.resolve(convertBytesToJSValue(data)); } catch (e7) { errorSteps(e7); } }, "successSteps"); if (object[kState].body == null) { successSteps(new Uint8Array()); return promise.promise; } await fullyReadBody(object[kState].body, successSteps, errorSteps); return promise.promise; } __name(specConsumeBody, "specConsumeBody"); function bodyUnusable(body) { return body != null && (body.stream.locked || util5.isDisturbed(body.stream)); } __name(bodyUnusable, "bodyUnusable"); function utf8DecodeBytes(buffer) { if (buffer.length === 0) { return ""; } if (buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) { buffer = buffer.subarray(3); } const output = textDecoder.decode(buffer); return output; } __name(utf8DecodeBytes, "utf8DecodeBytes"); function parseJSONFromBytes(bytes) { return JSON.parse(utf8DecodeBytes(bytes)); } __name(parseJSONFromBytes, "parseJSONFromBytes"); function bodyMimeType(object) { const { headersList } = object[kState]; const contentType = headersList.get("content-type"); if (contentType === null) { return "failure"; } return parseMIMEType(contentType); } __name(bodyMimeType, "bodyMimeType"); module3.exports = { extractBody, safelyExtractBody, cloneBody, mixinBody }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/request.js var require_request = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/request.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { InvalidArgumentError, NotSupportedError } = require_errors(); var assert38 = require("assert"); var { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require_symbols(); var util5 = require_util(); var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; var kHandler = Symbol("handler"); var channels = {}; var extractBody; try { const diagnosticsChannel = require("diagnostics_channel"); channels.create = diagnosticsChannel.channel("undici:request:create"); channels.bodySent = diagnosticsChannel.channel("undici:request:bodySent"); channels.headers = diagnosticsChannel.channel("undici:request:headers"); channels.trailers = diagnosticsChannel.channel("undici:request:trailers"); channels.error = diagnosticsChannel.channel("undici:request:error"); } catch { channels.create = { hasSubscribers: false }; channels.bodySent = { hasSubscribers: false }; channels.headers = { hasSubscribers: false }; channels.trailers = { hasSubscribers: false }; channels.error = { hasSubscribers: false }; } var Request4 = class { constructor(origin, { path: path72, method, body, headers, query, idempotent, blocking, upgrade, headersTimeout, bodyTimeout, reset, throwOnError, expectContinue }, handler31) { if (typeof path72 !== "string") { throw new InvalidArgumentError("path must be a string"); } else if (path72[0] !== "/" && !(path72.startsWith("http://") || path72.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); } else if (invalidPathRegex.exec(path72) !== null) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { throw new InvalidArgumentError("method must be a string"); } else if (tokenRegExp.exec(method) === null) { throw new InvalidArgumentError("invalid request method"); } if (upgrade && typeof upgrade !== "string") { throw new InvalidArgumentError("upgrade must be a string"); } if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { throw new InvalidArgumentError("invalid headersTimeout"); } if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { throw new InvalidArgumentError("invalid bodyTimeout"); } if (reset != null && typeof reset !== "boolean") { throw new InvalidArgumentError("invalid reset"); } if (expectContinue != null && typeof expectContinue !== "boolean") { throw new InvalidArgumentError("invalid expectContinue"); } this.headersTimeout = headersTimeout; this.bodyTimeout = bodyTimeout; this.throwOnError = throwOnError === true; this.method = method; this.abort = null; if (body == null) { this.body = null; } else if (util5.isStream(body)) { this.body = body; const rState = this.body._readableState; if (!rState || !rState.autoDestroy) { this.endHandler = /* @__PURE__ */ __name(function autoDestroy() { util5.destroy(this); }, "autoDestroy"); this.body.on("end", this.endHandler); } this.errorHandler = (err) => { if (this.abort) { this.abort(err); } else { this.error = err; } }; this.body.on("error", this.errorHandler); } else if (util5.isBuffer(body)) { this.body = body.byteLength ? body : null; } else if (ArrayBuffer.isView(body)) { this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null; } else if (body instanceof ArrayBuffer) { this.body = body.byteLength ? Buffer.from(body) : null; } else if (typeof body === "string") { this.body = body.length ? Buffer.from(body) : null; } else if (util5.isFormDataLike(body) || util5.isIterable(body) || util5.isBlobLike(body)) { this.body = body; } else { throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable"); } this.completed = false; this.aborted = false; this.upgrade = upgrade || null; this.path = query ? util5.buildURL(path72, query) : path72; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; this.reset = reset == null ? null : reset; this.host = null; this.contentLength = null; this.contentType = null; this.headers = ""; this.expectContinue = expectContinue != null ? expectContinue : false; if (Array.isArray(headers)) { if (headers.length % 2 !== 0) { throw new InvalidArgumentError("headers array must be even"); } for (let i5 = 0; i5 < headers.length; i5 += 2) { processHeader(this, headers[i5], headers[i5 + 1]); } } else if (headers && typeof headers === "object") { const keys = Object.keys(headers); for (let i5 = 0; i5 < keys.length; i5++) { const key = keys[i5]; processHeader(this, key, headers[key]); } } else if (headers != null) { throw new InvalidArgumentError("headers must be an object or an array"); } if (util5.isFormDataLike(this.body)) { if (util5.nodeMajor < 16 || util5.nodeMajor === 16 && util5.nodeMinor < 8) { throw new InvalidArgumentError("Form-Data bodies are only supported in node v16.8 and newer."); } if (!extractBody) { extractBody = require_body().extractBody; } const [bodyStream, contentType] = extractBody(body); if (this.contentType == null) { this.contentType = contentType; this.headers += `content-type: ${contentType}\r `; } this.body = bodyStream.stream; this.contentLength = bodyStream.length; } else if (util5.isBlobLike(body) && this.contentType == null && body.type) { this.contentType = body.type; this.headers += `content-type: ${body.type}\r `; } util5.validateHandler(handler31, method, upgrade); this.servername = util5.getServerName(this.host); this[kHandler] = handler31; if (channels.create.hasSubscribers) { channels.create.publish({ request: this }); } } onBodySent(chunk) { if (this[kHandler].onBodySent) { try { return this[kHandler].onBodySent(chunk); } catch (err) { this.abort(err); } } } onRequestSent() { if (channels.bodySent.hasSubscribers) { channels.bodySent.publish({ request: this }); } if (this[kHandler].onRequestSent) { try { return this[kHandler].onRequestSent(); } catch (err) { this.abort(err); } } } onConnect(abort) { assert38(!this.aborted); assert38(!this.completed); if (this.error) { abort(this.error); } else { this.abort = abort; return this[kHandler].onConnect(abort); } } onHeaders(statusCode, headers, resume, statusText) { assert38(!this.aborted); assert38(!this.completed); if (channels.headers.hasSubscribers) { channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); } try { return this[kHandler].onHeaders(statusCode, headers, resume, statusText); } catch (err) { this.abort(err); } } onData(chunk) { assert38(!this.aborted); assert38(!this.completed); try { return this[kHandler].onData(chunk); } catch (err) { this.abort(err); return false; } } onUpgrade(statusCode, headers, socket) { assert38(!this.aborted); assert38(!this.completed); return this[kHandler].onUpgrade(statusCode, headers, socket); } onComplete(trailers) { this.onFinally(); assert38(!this.aborted); this.completed = true; if (channels.trailers.hasSubscribers) { channels.trailers.publish({ request: this, trailers }); } try { return this[kHandler].onComplete(trailers); } catch (err) { this.onError(err); } } onError(error2) { this.onFinally(); if (channels.error.hasSubscribers) { channels.error.publish({ request: this, error: error2 }); } if (this.aborted) { return; } this.aborted = true; return this[kHandler].onError(error2); } onFinally() { if (this.errorHandler) { this.body.off("error", this.errorHandler); this.errorHandler = null; } if (this.endHandler) { this.body.off("end", this.endHandler); this.endHandler = null; } } // TODO: adjust to support H2 addHeader(key, value) { processHeader(this, key, value); return this; } static [kHTTP1BuildRequest](origin, opts, handler31) { return new Request4(origin, opts, handler31); } static [kHTTP2BuildRequest](origin, opts, handler31) { const headers = opts.headers; opts = { ...opts, headers: null }; const request4 = new Request4(origin, opts, handler31); request4.headers = {}; if (Array.isArray(headers)) { if (headers.length % 2 !== 0) { throw new InvalidArgumentError("headers array must be even"); } for (let i5 = 0; i5 < headers.length; i5 += 2) { processHeader(request4, headers[i5], headers[i5 + 1], true); } } else if (headers && typeof headers === "object") { const keys = Object.keys(headers); for (let i5 = 0; i5 < keys.length; i5++) { const key = keys[i5]; processHeader(request4, key, headers[key], true); } } else if (headers != null) { throw new InvalidArgumentError("headers must be an object or an array"); } return request4; } static [kHTTP2CopyHeaders](raw) { const rawHeaders = raw.split("\r\n"); const headers = {}; for (const header of rawHeaders) { const [key, value] = header.split(": "); if (value == null || value.length === 0) continue; if (headers[key]) headers[key] += `,${value}`; else headers[key] = value; } return headers; } }; __name(Request4, "Request"); function processHeaderValue(key, val2, skipAppend) { if (val2 && typeof val2 === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } val2 = val2 != null ? `${val2}` : ""; if (headerCharRegex.exec(val2) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } return skipAppend ? val2 : `${key}: ${val2}\r `; } __name(processHeaderValue, "processHeaderValue"); function processHeader(request4, key, val2, skipAppend = false) { if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { throw new InvalidArgumentError(`invalid ${key} header`); } else if (val2 === void 0) { return; } if (request4.host === null && key.length === 4 && key.toLowerCase() === "host") { if (headerCharRegex.exec(val2) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } request4.host = val2; } else if (request4.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { request4.contentLength = parseInt(val2, 10); if (!Number.isFinite(request4.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request4.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { request4.contentType = val2; if (skipAppend) request4.headers[key] = processHeaderValue(key, val2, skipAppend); else request4.headers += processHeaderValue(key, val2); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { const value = typeof val2 === "string" ? val2.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { request4.reset = true; } } else if (key.length === 10 && key.toLowerCase() === "keep-alive") { throw new InvalidArgumentError("invalid keep-alive header"); } else if (key.length === 7 && key.toLowerCase() === "upgrade") { throw new InvalidArgumentError("invalid upgrade header"); } else if (key.length === 6 && key.toLowerCase() === "expect") { throw new NotSupportedError("expect header not supported"); } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { if (Array.isArray(val2)) { for (let i5 = 0; i5 < val2.length; i5++) { if (skipAppend) { if (request4.headers[key]) request4.headers[key] += `,${processHeaderValue(key, val2[i5], skipAppend)}`; else request4.headers[key] = processHeaderValue(key, val2[i5], skipAppend); } else { request4.headers += processHeaderValue(key, val2[i5]); } } } else { if (skipAppend) request4.headers[key] = processHeaderValue(key, val2, skipAppend); else request4.headers += processHeaderValue(key, val2); } } } __name(processHeader, "processHeader"); module3.exports = Request4; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/dispatcher.js var require_dispatcher = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/dispatcher.js"(exports2, module3) { "use strict"; init_import_meta_url(); var EventEmitter5 = require("events"); var Dispatcher2 = class extends EventEmitter5 { dispatch() { throw new Error("not implemented"); } close() { throw new Error("not implemented"); } destroy() { throw new Error("not implemented"); } }; __name(Dispatcher2, "Dispatcher"); module3.exports = Dispatcher2; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/dispatcher-base.js var require_dispatcher_base = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/dispatcher-base.js"(exports2, module3) { "use strict"; init_import_meta_url(); var Dispatcher2 = require_dispatcher(); var { ClientDestroyedError, ClientClosedError, InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); var kDestroyed = Symbol("destroyed"); var kClosed = Symbol("closed"); var kOnDestroyed = Symbol("onDestroyed"); var kOnClosed = Symbol("onClosed"); var kInterceptedDispatch = Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher2 { constructor() { super(); this[kDestroyed] = false; this[kOnDestroyed] = null; this[kClosed] = false; this[kOnClosed] = []; } get destroyed() { return this[kDestroyed]; } get closed() { return this[kClosed]; } get interceptors() { return this[kInterceptors]; } set interceptors(newInterceptors) { if (newInterceptors) { for (let i5 = newInterceptors.length - 1; i5 >= 0; i5--) { const interceptor = this[kInterceptors][i5]; if (typeof interceptor !== "function") { throw new InvalidArgumentError("interceptor must be an function"); } } } this[kInterceptors] = newInterceptors; } close(callback) { if (callback === void 0) { return new Promise((resolve25, reject) => { this.close((err, data) => { return err ? reject(err) : resolve25(data); }); }); } if (typeof callback !== "function") { throw new InvalidArgumentError("invalid callback"); } if (this[kDestroyed]) { queueMicrotask(() => callback(new ClientDestroyedError(), null)); return; } if (this[kClosed]) { if (this[kOnClosed]) { this[kOnClosed].push(callback); } else { queueMicrotask(() => callback(null, null)); } return; } this[kClosed] = true; this[kOnClosed].push(callback); const onClosed = /* @__PURE__ */ __name(() => { const callbacks = this[kOnClosed]; this[kOnClosed] = null; for (let i5 = 0; i5 < callbacks.length; i5++) { callbacks[i5](null, null); } }, "onClosed"); this[kClose]().then(() => this.destroy()).then(() => { queueMicrotask(onClosed); }); } destroy(err, callback) { if (typeof err === "function") { callback = err; err = null; } if (callback === void 0) { return new Promise((resolve25, reject) => { this.destroy(err, (err2, data) => { return err2 ? ( /* istanbul ignore next: should never error */ reject(err2) ) : resolve25(data); }); }); } if (typeof callback !== "function") { throw new InvalidArgumentError("invalid callback"); } if (this[kDestroyed]) { if (this[kOnDestroyed]) { this[kOnDestroyed].push(callback); } else { queueMicrotask(() => callback(null, null)); } return; } if (!err) { err = new ClientDestroyedError(); } this[kDestroyed] = true; this[kOnDestroyed] = this[kOnDestroyed] || []; this[kOnDestroyed].push(callback); const onDestroyed = /* @__PURE__ */ __name(() => { const callbacks = this[kOnDestroyed]; this[kOnDestroyed] = null; for (let i5 = 0; i5 < callbacks.length; i5++) { callbacks[i5](null, null); } }, "onDestroyed"); this[kDestroy](err).then(() => { queueMicrotask(onDestroyed); }); } [kInterceptedDispatch](opts, handler31) { if (!this[kInterceptors] || this[kInterceptors].length === 0) { this[kInterceptedDispatch] = this[kDispatch]; return this[kDispatch](opts, handler31); } let dispatch = this[kDispatch].bind(this); for (let i5 = this[kInterceptors].length - 1; i5 >= 0; i5--) { dispatch = this[kInterceptors][i5](dispatch); } this[kInterceptedDispatch] = dispatch; return dispatch(opts, handler31); } dispatch(opts, handler31) { if (!handler31 || typeof handler31 !== "object") { throw new InvalidArgumentError("handler must be an object"); } try { if (!opts || typeof opts !== "object") { throw new InvalidArgumentError("opts must be an object."); } if (this[kDestroyed] || this[kOnDestroyed]) { throw new ClientDestroyedError(); } if (this[kClosed]) { throw new ClientClosedError(); } return this[kInterceptedDispatch](opts, handler31); } catch (err) { if (typeof handler31.onError !== "function") { throw new InvalidArgumentError("invalid onError method"); } handler31.onError(err); return false; } } }; __name(DispatcherBase, "DispatcherBase"); module3.exports = DispatcherBase; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/connect.js var require_connect = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/core/connect.js"(exports2, module3) { "use strict"; init_import_meta_url(); var net2 = require("net"); var assert38 = require("assert"); var util5 = require_util(); var { InvalidArgumentError, ConnectTimeoutError } = require_errors(); var tls; var SessionCache; if (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) { SessionCache = /* @__PURE__ */ __name(class WeakSessionCache { constructor(maxCachedSessions) { this._maxCachedSessions = maxCachedSessions; this._sessionCache = /* @__PURE__ */ new Map(); this._sessionRegistry = new global.FinalizationRegistry((key) => { if (this._sessionCache.size < this._maxCachedSessions) { return; } const ref = this._sessionCache.get(key); if (ref !== void 0 && ref.deref() === void 0) { this._sessionCache.delete(key); } }); } get(sessionKey) { const ref = this._sessionCache.get(sessionKey); return ref ? ref.deref() : null; } set(sessionKey, session) { if (this._maxCachedSessions === 0) { return; } this._sessionCache.set(sessionKey, new WeakRef(session)); this._sessionRegistry.register(session, sessionKey); } }, "WeakSessionCache"); } else { SessionCache = /* @__PURE__ */ __name(class SimpleSessionCache { constructor(maxCachedSessions) { this._maxCachedSessions = maxCachedSessions; this._sessionCache = /* @__PURE__ */ new Map(); } get(sessionKey) { return this._sessionCache.get(sessionKey); } set(sessionKey, session) { if (this._maxCachedSessions === 0) { return; } if (this._sessionCache.size >= this._maxCachedSessions) { const { value: oldestKey } = this._sessionCache.keys().next(); this._sessionCache.delete(oldestKey); } this._sessionCache.set(sessionKey, session); } }, "SimpleSessionCache"); } function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout: timeout2, ...opts }) { if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero"); } const options32 = { path: socketPath, ...opts }; const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions); timeout2 = timeout2 == null ? 1e4 : timeout2; allowH2 = allowH2 != null ? allowH2 : false; return /* @__PURE__ */ __name(function connect({ hostname: hostname2, host, protocol, port, servername, localAddress, httpSocket }, callback) { let socket; if (protocol === "https:") { if (!tls) { tls = require("tls"); } servername = servername || options32.servername || util5.getServerName(host) || null; const sessionKey = servername || hostname2; const session = sessionCache.get(sessionKey) || null; assert38(sessionKey); socket = tls.connect({ highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... ...options32, servername, session, localAddress, // TODO(HTTP/2): Add support for h2c ALPNProtocols: allowH2 ? ["http/1.1", "h2"] : ["http/1.1"], socket: httpSocket, // upgrade socket connection port: port || 443, host: hostname2 }); socket.on("session", function(session2) { sessionCache.set(sessionKey, session2); }); } else { assert38(!httpSocket, "httpSocket can only be sent on TLS update"); socket = net2.connect({ highWaterMark: 64 * 1024, // Same as nodejs fs streams. ...options32, localAddress, port: port || 80, host: hostname2 }); } if (options32.keepAlive == null || options32.keepAlive) { const keepAliveInitialDelay = options32.keepAliveInitialDelay === void 0 ? 6e4 : options32.keepAliveInitialDelay; socket.setKeepAlive(true, keepAliveInitialDelay); } const cancelTimeout = setupTimeout2(() => onConnectTimeout(socket), timeout2); socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() { cancelTimeout(); if (callback) { const cb2 = callback; callback = null; cb2(null, this); } }).on("error", function(err) { cancelTimeout(); if (callback) { const cb2 = callback; callback = null; cb2(err); } }); return socket; }, "connect"); } __name(buildConnector, "buildConnector"); function setupTimeout2(onConnectTimeout2, timeout2) { if (!timeout2) { return () => { }; } let s1 = null; let s22 = null; const timeoutId = setTimeout(() => { s1 = setImmediate(() => { if (process.platform === "win32") { s22 = setImmediate(() => onConnectTimeout2()); } else { onConnectTimeout2(); } }); }, timeout2); return () => { clearTimeout(timeoutId); clearImmediate(s1); clearImmediate(s22); }; } __name(setupTimeout2, "setupTimeout"); function onConnectTimeout(socket) { util5.destroy(socket, new ConnectTimeoutError()); } __name(onConnectTimeout, "onConnectTimeout"); module3.exports = buildConnector; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/llhttp/utils.js var require_utils = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/llhttp/utils.js"(exports2) { "use strict"; init_import_meta_url(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.enumToMap = void 0; function enumToMap(obj) { const res = {}; Object.keys(obj).forEach((key) => { const value = obj[key]; if (typeof value === "number") { res[key] = value; } }); return res; } __name(enumToMap, "enumToMap"); exports2.enumToMap = enumToMap; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/llhttp/constants.js var require_constants3 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/llhttp/constants.js"(exports2) { "use strict"; init_import_meta_url(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SPECIAL_HEADERS = exports2.HEADER_STATE = exports2.MINOR = exports2.MAJOR = exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS = exports2.TOKEN = exports2.STRICT_TOKEN = exports2.HEX = exports2.URL_CHAR = exports2.STRICT_URL_CHAR = exports2.USERINFO_CHARS = exports2.MARK = exports2.ALPHANUM = exports2.NUM = exports2.HEX_MAP = exports2.NUM_MAP = exports2.ALPHA = exports2.FINISH = exports2.H_METHOD_MAP = exports2.METHOD_MAP = exports2.METHODS_RTSP = exports2.METHODS_ICE = exports2.METHODS_HTTP = exports2.METHODS = exports2.LENIENT_FLAGS = exports2.FLAGS = exports2.TYPE = exports2.ERROR = void 0; var utils_1 = require_utils(); var ERROR; (function(ERROR2) { ERROR2[ERROR2["OK"] = 0] = "OK"; ERROR2[ERROR2["INTERNAL"] = 1] = "INTERNAL"; ERROR2[ERROR2["STRICT"] = 2] = "STRICT"; ERROR2[ERROR2["LF_EXPECTED"] = 3] = "LF_EXPECTED"; ERROR2[ERROR2["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; ERROR2[ERROR2["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; ERROR2[ERROR2["INVALID_METHOD"] = 6] = "INVALID_METHOD"; ERROR2[ERROR2["INVALID_URL"] = 7] = "INVALID_URL"; ERROR2[ERROR2["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; ERROR2[ERROR2["INVALID_VERSION"] = 9] = "INVALID_VERSION"; ERROR2[ERROR2["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; ERROR2[ERROR2["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; ERROR2[ERROR2["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; ERROR2[ERROR2["INVALID_STATUS"] = 13] = "INVALID_STATUS"; ERROR2[ERROR2["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; ERROR2[ERROR2["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; ERROR2[ERROR2["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; ERROR2[ERROR2["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; ERROR2[ERROR2["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; ERROR2[ERROR2["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; ERROR2[ERROR2["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; ERROR2[ERROR2["PAUSED"] = 21] = "PAUSED"; ERROR2[ERROR2["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; ERROR2[ERROR2["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; ERROR2[ERROR2["USER"] = 24] = "USER"; })(ERROR = exports2.ERROR || (exports2.ERROR = {})); var TYPE; (function(TYPE2) { TYPE2[TYPE2["BOTH"] = 0] = "BOTH"; TYPE2[TYPE2["REQUEST"] = 1] = "REQUEST"; TYPE2[TYPE2["RESPONSE"] = 2] = "RESPONSE"; })(TYPE = exports2.TYPE || (exports2.TYPE = {})); var FLAGS; (function(FLAGS2) { FLAGS2[FLAGS2["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; FLAGS2[FLAGS2["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; FLAGS2[FLAGS2["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; FLAGS2[FLAGS2["CHUNKED"] = 8] = "CHUNKED"; FLAGS2[FLAGS2["UPGRADE"] = 16] = "UPGRADE"; FLAGS2[FLAGS2["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; FLAGS2[FLAGS2["SKIPBODY"] = 64] = "SKIPBODY"; FLAGS2[FLAGS2["TRAILING"] = 128] = "TRAILING"; FLAGS2[FLAGS2["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; })(FLAGS = exports2.FLAGS || (exports2.FLAGS = {})); var LENIENT_FLAGS; (function(LENIENT_FLAGS2) { LENIENT_FLAGS2[LENIENT_FLAGS2["HEADERS"] = 1] = "HEADERS"; LENIENT_FLAGS2[LENIENT_FLAGS2["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; LENIENT_FLAGS2[LENIENT_FLAGS2["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; })(LENIENT_FLAGS = exports2.LENIENT_FLAGS || (exports2.LENIENT_FLAGS = {})); var METHODS; (function(METHODS2) { METHODS2[METHODS2["DELETE"] = 0] = "DELETE"; METHODS2[METHODS2["GET"] = 1] = "GET"; METHODS2[METHODS2["HEAD"] = 2] = "HEAD"; METHODS2[METHODS2["POST"] = 3] = "POST"; METHODS2[METHODS2["PUT"] = 4] = "PUT"; METHODS2[METHODS2["CONNECT"] = 5] = "CONNECT"; METHODS2[METHODS2["OPTIONS"] = 6] = "OPTIONS"; METHODS2[METHODS2["TRACE"] = 7] = "TRACE"; METHODS2[METHODS2["COPY"] = 8] = "COPY"; METHODS2[METHODS2["LOCK"] = 9] = "LOCK"; METHODS2[METHODS2["MKCOL"] = 10] = "MKCOL"; METHODS2[METHODS2["MOVE"] = 11] = "MOVE"; METHODS2[METHODS2["PROPFIND"] = 12] = "PROPFIND"; METHODS2[METHODS2["PROPPATCH"] = 13] = "PROPPATCH"; METHODS2[METHODS2["SEARCH"] = 14] = "SEARCH"; METHODS2[METHODS2["UNLOCK"] = 15] = "UNLOCK"; METHODS2[METHODS2["BIND"] = 16] = "BIND"; METHODS2[METHODS2["REBIND"] = 17] = "REBIND"; METHODS2[METHODS2["UNBIND"] = 18] = "UNBIND"; METHODS2[METHODS2["ACL"] = 19] = "ACL"; METHODS2[METHODS2["REPORT"] = 20] = "REPORT"; METHODS2[METHODS2["MKACTIVITY"] = 21] = "MKACTIVITY"; METHODS2[METHODS2["CHECKOUT"] = 22] = "CHECKOUT"; METHODS2[METHODS2["MERGE"] = 23] = "MERGE"; METHODS2[METHODS2["M-SEARCH"] = 24] = "M-SEARCH"; METHODS2[METHODS2["NOTIFY"] = 25] = "NOTIFY"; METHODS2[METHODS2["SUBSCRIBE"] = 26] = "SUBSCRIBE"; METHODS2[METHODS2["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; METHODS2[METHODS2["PATCH"] = 28] = "PATCH"; METHODS2[METHODS2["PURGE"] = 29] = "PURGE"; METHODS2[METHODS2["MKCALENDAR"] = 30] = "MKCALENDAR"; METHODS2[METHODS2["LINK"] = 31] = "LINK"; METHODS2[METHODS2["UNLINK"] = 32] = "UNLINK"; METHODS2[METHODS2["SOURCE"] = 33] = "SOURCE"; METHODS2[METHODS2["PRI"] = 34] = "PRI"; METHODS2[METHODS2["DESCRIBE"] = 35] = "DESCRIBE"; METHODS2[METHODS2["ANNOUNCE"] = 36] = "ANNOUNCE"; METHODS2[METHODS2["SETUP"] = 37] = "SETUP"; METHODS2[METHODS2["PLAY"] = 38] = "PLAY"; METHODS2[METHODS2["PAUSE"] = 39] = "PAUSE"; METHODS2[METHODS2["TEARDOWN"] = 40] = "TEARDOWN"; METHODS2[METHODS2["GET_PARAMETER"] = 41] = "GET_PARAMETER"; METHODS2[METHODS2["SET_PARAMETER"] = 42] = "SET_PARAMETER"; METHODS2[METHODS2["REDIRECT"] = 43] = "REDIRECT"; METHODS2[METHODS2["RECORD"] = 44] = "RECORD"; METHODS2[METHODS2["FLUSH"] = 45] = "FLUSH"; })(METHODS = exports2.METHODS || (exports2.METHODS = {})); exports2.METHODS_HTTP = [ METHODS.DELETE, METHODS.GET, METHODS.HEAD, METHODS.POST, METHODS.PUT, METHODS.CONNECT, METHODS.OPTIONS, METHODS.TRACE, METHODS.COPY, METHODS.LOCK, METHODS.MKCOL, METHODS.MOVE, METHODS.PROPFIND, METHODS.PROPPATCH, METHODS.SEARCH, METHODS.UNLOCK, METHODS.BIND, METHODS.REBIND, METHODS.UNBIND, METHODS.ACL, METHODS.REPORT, METHODS.MKACTIVITY, METHODS.CHECKOUT, METHODS.MERGE, METHODS["M-SEARCH"], METHODS.NOTIFY, METHODS.SUBSCRIBE, METHODS.UNSUBSCRIBE, METHODS.PATCH, METHODS.PURGE, METHODS.MKCALENDAR, METHODS.LINK, METHODS.UNLINK, METHODS.PRI, // TODO(indutny): should we allow it with HTTP? METHODS.SOURCE ]; exports2.METHODS_ICE = [ METHODS.SOURCE ]; exports2.METHODS_RTSP = [ METHODS.OPTIONS, METHODS.DESCRIBE, METHODS.ANNOUNCE, METHODS.SETUP, METHODS.PLAY, METHODS.PAUSE, METHODS.TEARDOWN, METHODS.GET_PARAMETER, METHODS.SET_PARAMETER, METHODS.REDIRECT, METHODS.RECORD, METHODS.FLUSH, // For AirPlay METHODS.GET, METHODS.POST ]; exports2.METHOD_MAP = utils_1.enumToMap(METHODS); exports2.H_METHOD_MAP = {}; Object.keys(exports2.METHOD_MAP).forEach((key) => { if (/^H/.test(key)) { exports2.H_METHOD_MAP[key] = exports2.METHOD_MAP[key]; } }); var FINISH; (function(FINISH2) { FINISH2[FINISH2["SAFE"] = 0] = "SAFE"; FINISH2[FINISH2["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; FINISH2[FINISH2["UNSAFE"] = 2] = "UNSAFE"; })(FINISH = exports2.FINISH || (exports2.FINISH = {})); exports2.ALPHA = []; for (let i5 = "A".charCodeAt(0); i5 <= "Z".charCodeAt(0); i5++) { exports2.ALPHA.push(String.fromCharCode(i5)); exports2.ALPHA.push(String.fromCharCode(i5 + 32)); } exports2.NUM_MAP = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9 }; exports2.HEX_MAP = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15 }; exports2.NUM = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" ]; exports2.ALPHANUM = exports2.ALPHA.concat(exports2.NUM); exports2.MARK = ["-", "_", ".", "!", "~", "*", "'", "(", ")"]; exports2.USERINFO_CHARS = exports2.ALPHANUM.concat(exports2.MARK).concat(["%", ";", ":", "&", "=", "+", "$", ","]); exports2.STRICT_URL_CHAR = [ "!", '"', "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", ":", ";", "<", "=", ">", "@", "[", "\\", "]", "^", "_", "`", "{", "|", "}", "~" ].concat(exports2.ALPHANUM); exports2.URL_CHAR = exports2.STRICT_URL_CHAR.concat([" ", "\f"]); for (let i5 = 128; i5 <= 255; i5++) { exports2.URL_CHAR.push(i5); } exports2.HEX = exports2.NUM.concat(["a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"]); exports2.STRICT_TOKEN = [ "!", "#", "$", "%", "&", "'", "*", "+", "-", ".", "^", "_", "`", "|", "~" ].concat(exports2.ALPHANUM); exports2.TOKEN = exports2.STRICT_TOKEN.concat([" "]); exports2.HEADER_CHARS = [" "]; for (let i5 = 32; i5 <= 255; i5++) { if (i5 !== 127) { exports2.HEADER_CHARS.push(i5); } } exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS.filter((c6) => c6 !== 44); exports2.MAJOR = exports2.NUM_MAP; exports2.MINOR = exports2.MAJOR; var HEADER_STATE; (function(HEADER_STATE2) { HEADER_STATE2[HEADER_STATE2["GENERAL"] = 0] = "GENERAL"; HEADER_STATE2[HEADER_STATE2["CONNECTION"] = 1] = "CONNECTION"; HEADER_STATE2[HEADER_STATE2["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; HEADER_STATE2[HEADER_STATE2["UPGRADE"] = 4] = "UPGRADE"; HEADER_STATE2[HEADER_STATE2["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; HEADER_STATE2[HEADER_STATE2["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; HEADER_STATE2[HEADER_STATE2["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; })(HEADER_STATE = exports2.HEADER_STATE || (exports2.HEADER_STATE = {})); exports2.SPECIAL_HEADERS = { "connection": HEADER_STATE.CONNECTION, "content-length": HEADER_STATE.CONTENT_LENGTH, "proxy-connection": HEADER_STATE.CONNECTION, "transfer-encoding": HEADER_STATE.TRANSFER_ENCODING, "upgrade": HEADER_STATE.UPGRADE }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/handler/RedirectHandler.js var require_RedirectHandler = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/handler/RedirectHandler.js"(exports2, module3) { "use strict"; init_import_meta_url(); var util5 = require_util(); var { kBodyUsed } = require_symbols(); var assert38 = require("assert"); var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; var kBody = Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; this[kBodyUsed] = false; } async *[Symbol.asyncIterator]() { assert38(!this[kBodyUsed], "disturbed"); this[kBodyUsed] = true; yield* this[kBody]; } }; __name(BodyAsyncIterable, "BodyAsyncIterable"); var RedirectHandler = class { constructor(dispatch, maxRedirections, opts, handler31) { if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { throw new InvalidArgumentError("maxRedirections must be a positive number"); } util5.validateHandler(handler31, opts.method, opts.upgrade); this.dispatch = dispatch; this.location = null; this.abort = null; this.opts = { ...opts, maxRedirections: 0 }; this.maxRedirections = maxRedirections; this.handler = handler31; this.history = []; if (util5.isStream(this.opts.body)) { if (util5.bodyLength(this.opts.body) === 0) { this.opts.body.on("data", function() { assert38(false); }); } if (typeof this.opts.body.readableDidRead !== "boolean") { this.opts.body[kBodyUsed] = false; EE.prototype.on.call(this.opts.body, "data", function() { this[kBodyUsed] = true; }); } } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") { this.opts.body = new BodyAsyncIterable(this.opts.body); } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util5.isIterable(this.opts.body)) { this.opts.body = new BodyAsyncIterable(this.opts.body); } } onConnect(abort) { this.abort = abort; this.handler.onConnect(abort, { history: this.history }); } onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } onError(error2) { this.handler.onError(error2); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util5.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); if (this.opts.origin) { this.history.push(new URL(this.opts.path, this.opts.origin)); } if (!this.location) { return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util5.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); const path72 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); this.opts.path = path72; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; if (statusCode === 303 && this.opts.method !== "HEAD") { this.opts.method = "GET"; this.opts.body = null; } } onData(chunk) { if (this.location) { } else { return this.handler.onData(chunk); } } onComplete(trailers) { if (this.location) { this.location = null; this.abort = null; this.dispatch(this.opts, this); } else { this.handler.onComplete(trailers); } } onBodySent(chunk) { if (this.handler.onBodySent) { this.handler.onBodySent(chunk); } } }; __name(RedirectHandler, "RedirectHandler"); function parseLocation(statusCode, headers) { if (redirectableStatusCodes.indexOf(statusCode) === -1) { return null; } for (let i5 = 0; i5 < headers.length; i5 += 2) { if (headers[i5].toString().toLowerCase() === "location") { return headers[i5 + 1]; } } } __name(parseLocation, "parseLocation"); function shouldRemoveHeader(header, removeContent, unknownOrigin) { if (header.length === 4) { return util5.headerNameToString(header) === "host"; } if (removeContent && util5.headerNameToString(header).startsWith("content-")) { return true; } if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { const name2 = util5.headerNameToString(header); return name2 === "authorization" || name2 === "cookie" || name2 === "proxy-authorization"; } return false; } __name(shouldRemoveHeader, "shouldRemoveHeader"); function cleanRequestHeaders(headers, removeContent, unknownOrigin) { const ret = []; if (Array.isArray(headers)) { for (let i5 = 0; i5 < headers.length; i5 += 2) { if (!shouldRemoveHeader(headers[i5], removeContent, unknownOrigin)) { ret.push(headers[i5], headers[i5 + 1]); } } } else if (headers && typeof headers === "object") { for (const key of Object.keys(headers)) { if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { ret.push(key, headers[key]); } } } else { assert38(headers == null, "headers must be an object or an array"); } return ret; } __name(cleanRequestHeaders, "cleanRequestHeaders"); module3.exports = RedirectHandler; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/interceptor/redirectInterceptor.js var require_redirectInterceptor = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/interceptor/redirectInterceptor.js"(exports2, module3) { "use strict"; init_import_meta_url(); var RedirectHandler = require_RedirectHandler(); function createRedirectInterceptor({ maxRedirections: defaultMaxRedirections }) { return (dispatch) => { return /* @__PURE__ */ __name(function Intercept(opts, handler31) { const { maxRedirections = defaultMaxRedirections } = opts; if (!maxRedirections) { return dispatch(opts, handler31); } const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler31); opts = { ...opts, maxRedirections: 0 }; return dispatch(opts, redirectHandler); }, "Intercept"); }; } __name(createRedirectInterceptor, "createRedirectInterceptor"); module3.exports = createRedirectInterceptor; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/llhttp/llhttp-wasm.js var require_llhttp_wasm = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/llhttp/llhttp-wasm.js"(exports2, module3) { init_import_meta_url(); module3.exports = "AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJs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ADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt0B2gEB2QECAwQFBgcICQoLDA0O2AEPENcBERLWARMUFRYXGBkaG+AB3wEcHR7VAR8gISIjJCXUASYnKCkqKyzTAdIBLS7RAdABLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVG2wFHSElKzwHOAUvNAUzMAU1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4ABgQGCAYMBhAGFAYYBhwGIAYkB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QAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAc8B0AHRAdIB0wHUAdUB1gHXAdgB2QHaAdsB3AHdAd4B4AHhAeIB4wHkAeUB5gHnAegB6QHqAesB7AHtAe4B7wHwAfEB8gHzAZkCpAKwAv4C/gILIAEiBCACRw3zAUHdASEQDP8DCyABIhAgAkcN3QFBwwEhEAz+AwsgASIBIAJHDZABQfcAIRAM/QMLIAEiASACRw2GAUHvACEQDPwDCyABIgEgAkcNf0HqACEQDPsDCyABIgEgAkcNe0HoACEQDPoDCyABIgEgAkcNeEHmACEQDPkDCyABIgEgAkcNGkEYIRAM+AMLIAEiASACRw0UQRIhEAz3AwsgASIBIAJHDVlBxQAhEAz2AwsgASIBIAJHDUpBPyEQDPUDCyABIgEgAkcNSEE8IRAM9AMLIAEiASACRw1BQTEhEAzzAwsgAC0ALkEBRg3rAwyHAgsgACABIgEgAhDAgICAAEEBRw3mASAAQgA3AyAM5wELIAAgASIBIAIQtICAgAAiEA3nASABIQEM9QILAkAgASIBIAJHDQBBBiEQDPADCyAAIAFBAWoiASACELuAgIAAIhAN6AEgASEBDDELIABCADcDIEESIRAM1QMLIAEiECACRw0rQR0hEAztAwsCQCABIgEgAkYNACABQQFqIQFBECEQDNQDC0EHIRAM7AMLIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN5QFBCCEQDOsDCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEUIRAM0gMLQQkhEAzqAwsgASEBIAApAyBQDeQBIAEhAQzyAgsCQCABIgEgAkcNAEELIRAM6QMLIAAgAUEBaiIBIAIQtoCAgAAiEA3lASABIQEM8gILIAAgASIBIAIQuICAgAAiEA3lASABIQEM8gILIAAgASIBIAIQuICAgAAiEA3mASABIQEMDQsgACABIgEgAhC6gICAACIQDecBIAEhAQzwAgsCQCABIgEgAkcNAEEPIRAM5QMLIAEtAAAiEEE7Rg0IIBBBDUcN6AEgAUEBaiEBDO8CCyAAIAEiASACELqAgIAAIhAN6AEgASEBDPICCwNAAkAgAS0AAEHwtYCAAGotAAAiEEEBRg0AIBBBAkcN6wEgACgCBCEQIABBADYCBCAAIBAgAUEBaiIBELmAgIAAIhAN6gEgASEBDPQCCyABQQFqIgEgAkcNAAtBEiEQDOIDCyAAIAEiASACELqAgIAAIhAN6QEgASEBDAoLIAEiASACRw0GQRshEAzgAwsCQCABIgEgAkcNAEEWIRAM4AMLIABBioCAgAA2AgggACABNgIEIAAgASACELiAgIAAIhAN6gEgASEBQSAhEAzGAwsCQCABIgEgAkYNAANAAkAgAS0AAEHwt4CAAGotAAAiEEECRg0AAkAgEEF/ag4E5QHsAQDrAewBCyABQQFqIQFBCCEQDMgDCyABQQFqIgEgAkcNAAtBFSEQDN8DC0EVIRAM3gMLA0ACQCABLQAAQfC5gIAAai0AACIQQQJGDQAgEEF/ag4E3gHsAeAB6wHsAQsgAUEBaiIBIAJHDQALQRghEAzdAwsCQCABIgEgAkYNACAAQYuAgIAANgIIIAAgATYCBCABIQFBByEQDMQDC0EZIRAM3AMLIAFBAWohAQwCCwJAIAEiFCACRw0AQRohEAzbAwsgFCEBAkAgFC0AAEFzag4U3QLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gIA7gILQQAhECAAQQA2AhwgAEGvi4CAADYCECAAQQI2AgwgACAUQQFqNgIUDNoDCwJAIAEtAAAiEEE7Rg0AIBBBDUcN6AEgAUEBaiEBDOUCCyABQQFqIQELQSIhEAy/AwsCQCABIhAgAkcNAEEcIRAM2AMLQgAhESAQIQEgEC0AAEFQag435wHmAQECAwQFBgcIAAAAAAAAAAkKCwwNDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxAREhMUAAtBHiEQDL0DC0ICIREM5QELQgMhEQzkAQtCBCERDOMBC0IFIREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELAkAgASIQIAJHDQBBKSEQDLcDCyAQLQAAIgFBIEYNFCABQQlHDdMBIBBBAWohAQwVCwJAIAEiASACRg0AIAFBAWohAQwXC0EqIRAMtQMLAkAgASIQIAJHDQBBKyEQDLUDCwJAIBAtAAAiAUEJRg0AIAFBIEcN1QELIAAtACxBCEYN0wEgECEBDJEDCwJAIAEiASACRw0AQSwhEAy0AwsgAS0AAEEKRw3VASABQQFqIQEMyQILIAEiDiACRw3VAUEvIRAMsgMLA0ACQCABLQAAIhBBIEYNAAJAIBBBdmoOBADcAdwBANoBCyABIQEM4AELIAFBAWoiASACRw0AC0ExIRAMsQMLQTIhECABIhQgAkYNsAMgAiAUayAAKAIAIgFqIRUgFCABa0EDaiEWAkADQCAULQAAIhdBIHIgFyAXQb9/akH/AXFBGkkbQf8BcSABQfC7gIAAai0AAEcNAQJAIAFBA0cNAEEGIQEMlgMLIAFBAWohASAUQQFqIhQgAkcNAAsgACAVNgIADLEDCyAAQQA2AgAgFCEBDNkBC0EzIRAgASIUIAJGDa8DIAIgFGsgACgCACIBaiEVIBQgAWtBCGohFgJAA0AgFC0AACIXQSByIBcgF0G/f2pB/wFxQRpJG0H/AXEgAUH0u4CAAGotAABHDQECQCABQQhHDQBBBSEBDJUDCyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFTYCAAywAwsgAEEANgIAIBQhAQzYAQtBNCEQIAEiFCACRg2uAyACIBRrIAAoAgAiAWohFSAUIAFrQQVqIRYCQANAIBQtAAAiF0EgciAXIBdBv39qQf8BcUEaSRtB/wFxIAFB0MKAgABqLQAARw0BAkAgAUEFRw0AQQchAQyUAwsgAUEBaiEBIBRBAWoiFCACRw0ACyAAIBU2AgAMrwMLIABBADYCACAUIQEM1wELAkAgASIBIAJGDQADQAJAIAEtAABBgL6AgABqLQAAIhBBAUYNACAQQQJGDQogASEBDN0BCyABQQFqIgEgAkcNAAtBMCEQDK4DC0EwIRAMrQMLAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgRg0AIBBBdmoOBNkB2gHaAdkB2gELIAFBAWoiASACRw0AC0E4IRAMrQMLQTghEAysAwsDQAJAIAEtAAAiEEEgRg0AIBBBCUcNAwsgAUEBaiIBIAJHDQALQTwhEAyrAwsDQAJAIAEtAAAiEEEgRg0AAkACQCAQQXZqDgTaAQEB2gEACyAQQSxGDdsBCyABIQEMBAsgAUEBaiIBIAJHDQALQT8hEAyqAwsgASEBDNsBC0HAACEQIAEiFCACRg2oAyACIBRrIAAoAgAiAWohFiAUIAFrQQZqIRcCQANAIBQtAABBIHIgAUGAwICAAGotAABHDQEgAUEGRg2OAyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFjYCAAypAwsgAEEANgIAIBQhAQtBNiEQDI4DCwJAIAEiDyACRw0AQcEAIRAMpwMLIABBjICAgAA2AgggACAPNgIEIA8hASAALQAsQX9qDgTNAdUB1wHZAYcDCyABQQFqIQEMzAELAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgciAQIBBBv39qQf8BcUEaSRtB/wFxIhBBCUYNACAQQSBGDQACQAJAAkACQCAQQZ1/ag4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIRAMkQMLIAFBAWohAUEyIRAMkAMLIAFBAWohAUEzIRAMjwMLIAEhAQzQAQsgAUEBaiIBIAJHDQALQTUhEAylAwtBNSEQDKQDCwJAIAEiASACRg0AA0ACQCABLQAAQYC8gIAAai0AAEEBRg0AIAEhAQzTAQsgAUEBaiIBIAJHDQALQT0hEAykAwtBPSEQDKMDCyAAIAEiASACELCAgIAAIhAN1gEgASEBDAELIBBBAWohAQtBPCEQDIcDCwJAIAEiASACRw0AQcIAIRAMoAMLAkADQAJAIAEtAABBd2oOGAAC/gL+AoQD/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4CAP4CCyABQQFqIgEgAkcNAAtBwgAhEAygAwsgAUEBaiEBIAAtAC1BAXFFDb0BIAEhAQtBLCEQDIUDCyABIgEgAkcN0wFBxAAhEAydAwsDQAJAIAEtAABBkMCAgABqLQAAQQFGDQAgASEBDLcCCyABQQFqIgEgAkcNAAtBxQAhEAycAwsgDS0AACIQQSBGDbMBIBBBOkcNgQMgACgCBCEBIABBADYCBCAAIAEgDRCvgICAACIBDdABIA1BAWohAQyzAgtBxwAhECABIg0gAkYNmgMgAiANayAAKAIAIgFqIRYgDSABa0EFaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGQwoCAAGotAABHDYADIAFBBUYN9AIgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMmgMLQcgAIRAgASINIAJGDZkDIAIgDWsgACgCACIBaiEWIA0gAWtBCWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBlsKAgABqLQAARw3/AgJAIAFBCUcNAEECIQEM9QILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJkDCwJAIAEiDSACRw0AQckAIRAMmQMLAkACQCANLQAAIgFBIHIgASABQb9/akH/AXFBGkkbQf8BcUGSf2oOBwCAA4ADgAOAA4ADAYADCyANQQFqIQFBPiEQDIADCyANQQFqIQFBPyEQDP8CC0HKACEQIAEiDSACRg2XAyACIA1rIAAoAgAiAWohFiANIAFrQQFqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQaDCgIAAai0AAEcN/QIgAUEBRg3wAiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyXAwtBywAhECABIg0gAkYNlgMgAiANayAAKAIAIgFqIRYgDSABa0EOaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGiwoCAAGotAABHDfwCIAFBDkYN8AIgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMlgMLQcwAIRAgASINIAJGDZUDIAIgDWsgACgCACIBaiEWIA0gAWtBD2ohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBwMKAgABqLQAARw37AgJAIAFBD0cNAEEDIQEM8QILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJUDC0HNACEQIAEiDSACRg2UAyACIA1rIAAoAgAiAWohFiANIAFrQQVqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQdDCgIAAai0AAEcN+gICQCABQQVHDQBBBCEBDPACCyABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyUAwsCQCABIg0gAkcNAEHOACEQDJQDCwJAAkACQAJAIA0tAAAiAUEgciABIAFBv39qQf8BcUEaSRtB/wFxQZ1/ag4TAP0C/QL9Av0C/QL9Av0C/QL9Av0C/QL9AgH9Av0C/QICA/0CCyANQQFqIQFBwQAhEAz9AgsgDUEBaiEBQcIAIRAM/AILIA1BAWohAUHDACEQDPsCCyANQQFqIQFBxAAhEAz6AgsCQCABIgEgAkYNACAAQY2AgIAANgIIIAAgATYCBCABIQFBxQAhEAz6AgtBzwAhEAySAwsgECEBAkACQCAQLQAAQXZqDgQBqAKoAgCoAgsgEEEBaiEBC0EnIRAM+AILAkAgASIBIAJHDQBB0QAhEAyRAwsCQCABLQAAQSBGDQAgASEBDI0BCyABQQFqIQEgAC0ALUEBcUUNxwEgASEBDIwBCyABIhcgAkcNyAFB0gAhEAyPAwtB0wAhECABIhQgAkYNjgMgAiAUayAAKAIAIgFqIRYgFCABa0EBaiEXA0AgFC0AACABQdbCgIAAai0AAEcNzAEgAUEBRg3HASABQQFqIQEgFEEBaiIUIAJHDQALIAAgFjYCAAyOAwsCQCABIgEgAkcNAEHVACEQDI4DCyABLQAAQQpHDcwBIAFBAWohAQzHAQsCQCABIgEgAkcNAEHWACEQDI0DCwJAAkAgAS0AAEF2ag4EAM0BzQEBzQELIAFBAWohAQzHAQsgAUEBaiEBQcoAIRAM8wILIAAgASIBIAIQroCAgAAiEA3LASABIQFBzQAhEAzyAgsgAC0AKUEiRg2FAwymAgsCQCABIgEgAkcNAEHbACEQDIoDC0EAIRRBASEXQQEhFkEAIRACQAJAAkACQAJAAkACQAJAAkAgAS0AAEFQag4K1AHTAQABAgMEBQYI1QELQQIhEAwGC0EDIRAMBQtBBCEQDAQLQQUhEAwDC0EGIRAMAgtBByEQDAELQQghEAtBACEXQQAhFkEAIRQMzAELQQkhEEEBIRRBACEXQQAhFgzLAQsCQCABIgEgAkcNAEHdACEQDIkDCyABLQAAQS5HDcwBIAFBAWohAQymAgsgASIBIAJHDcwBQd8AIRAMhwMLAkAgASIBIAJGDQAgAEGOgICAADYCCCAAIAE2AgQgASEBQdAAIRAM7gILQeAAIRAMhgMLQeEAIRAgASIBIAJGDYUDIAIgAWsgACgCACIUaiEWIAEgFGtBA2ohFwNAIAEtAAAgFEHiwoCAAGotAABHDc0BIBRBA0YNzAEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMhQMLQeIAIRAgASIBIAJGDYQDIAIgAWsgACgCACIUaiEWIAEgFGtBAmohFwNAIAEtAAAgFEHmwoCAAGotAABHDcwBIBRBAkYNzgEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMhAMLQeMAIRAgASIBIAJGDYMDIAIgAWsgACgCACIUaiEWIAEgFGtBA2ohFwNAIAEtAAAgFEHpwoCAAGotAABHDcsBIBRBA0YNzgEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMgwMLAkAgASIBIAJHDQBB5QAhEAyDAwsgACABQQFqIgEgAhCogICAACIQDc0BIAEhAUHWACEQDOkCCwJAIAEiASACRg0AA0ACQCABLQAAIhBBIEYNAAJAAkACQCAQQbh/ag4LAAHPAc8BzwHPAc8BzwHPAc8BAs8BCyABQQFqIQFB0gAhEAztAgsgAUEBaiEBQdMAIRAM7AILIAFBAWohAUHUACEQDOsCCyABQQFqIgEgAkcNAAtB5AAhEAyCAwtB5AAhEAyBAwsDQAJAIAEtAABB8MKAgABqLQAAIhBBAUYNACAQQX5qDgPPAdAB0QHSAQsgAUEBaiIBIAJHDQALQeYAIRAMgAMLAkAgASIBIAJGDQAgAUEBaiEBDAMLQecAIRAM/wILA0ACQCABLQAAQfDEgIAAai0AACIQQQFGDQACQCAQQX5qDgTSAdMB1AEA1QELIAEhAUHXACEQDOcCCyABQQFqIgEgAkcNAAtB6AAhEAz+AgsCQCABIgEgAkcNAEHpACEQDP4CCwJAIAEtAAAiEEF2ag4augHVAdUBvAHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHKAdUB1QEA0wELIAFBAWohAQtBBiEQDOMCCwNAAkAgAS0AAEHwxoCAAGotAABBAUYNACABIQEMngILIAFBAWoiASACRw0AC0HqACEQDPsCCwJAIAEiASACRg0AIAFBAWohAQwDC0HrACEQDPoCCwJAIAEiASACRw0AQewAIRAM+gILIAFBAWohAQwBCwJAIAEiASACRw0AQe0AIRAM+QILIAFBAWohAQtBBCEQDN4CCwJAIAEiFCACRw0AQe4AIRAM9wILIBQhAQJAAkACQCAULQAAQfDIgIAAai0AAEF/ag4H1AHVAdYBAJwCAQLXAQsgFEEBaiEBDAoLIBRBAWohAQzNAQtBACEQIABBADYCHCAAQZuSgIAANgIQIABBBzYCDCAAIBRBAWo2AhQM9gILAkADQAJAIAEtAABB8MiAgABqLQAAIhBBBEYNAAJAAkAgEEF/ag4H0gHTAdQB2QEABAHZAQsgASEBQdoAIRAM4AILIAFBAWohAUHcACEQDN8CCyABQQFqIgEgAkcNAAtB7wAhEAz2AgsgAUEBaiEBDMsBCwJAIAEiFCACRw0AQfAAIRAM9QILIBQtAABBL0cN1AEgFEEBaiEBDAYLAkAgASIUIAJHDQBB8QAhEAz0AgsCQCAULQAAIgFBL0cNACAUQQFqIQFB3QAhEAzbAgsgAUF2aiIEQRZLDdMBQQEgBHRBiYCAAnFFDdMBDMoCCwJAIAEiASACRg0AIAFBAWohAUHeACEQDNoCC0HyACEQDPICCwJAIAEiFCACRw0AQfQAIRAM8gILIBQhAQJAIBQtAABB8MyAgABqLQAAQX9qDgPJApQCANQBC0HhACEQDNgCCwJAIAEiFCACRg0AA0ACQCAULQAAQfDKgIAAai0AACIBQQNGDQACQCABQX9qDgLLAgDVAQsgFCEBQd8AIRAM2gILIBRBAWoiFCACRw0AC0HzACEQDPECC0HzACEQDPACCwJAIAEiASACRg0AIABBj4CAgAA2AgggACABNgIEIAEhAUHgACEQDNcCC0H1ACEQDO8CCwJAIAEiASACRw0AQfYAIRAM7wILIABBj4CAgAA2AgggACABNgIEIAEhAQtBAyEQDNQCCwNAIAEtAABBIEcNwwIgAUEBaiIBIAJHDQALQfcAIRAM7AILAkAgASIBIAJHDQBB+AAhEAzsAgsgAS0AAEEgRw3OASABQQFqIQEM7wELIAAgASIBIAIQrICAgAAiEA3OASABIQEMjgILAkAgASIEIAJHDQBB+gAhEAzqAgsgBC0AAEHMAEcN0QEgBEEBaiEBQRMhEAzPAQsCQCABIgQgAkcNAEH7ACEQDOkCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRADQCAELQAAIAFB8M6AgABqLQAARw3QASABQQVGDc4BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQfsAIRAM6AILAkAgASIEIAJHDQBB/AAhEAzoAgsCQAJAIAQtAABBvX9qDgwA0QHRAdEB0QHRAdEB0QHRAdEB0QEB0QELIARBAWohAUHmACEQDM8CCyAEQQFqIQFB5wAhEAzOAgsCQCABIgQgAkcNAEH9ACEQDOcCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDc8BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH9ACEQDOcCCyAAQQA2AgAgEEEBaiEBQRAhEAzMAQsCQCABIgQgAkcNAEH+ACEQDOYCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUH2zoCAAGotAABHDc4BIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH+ACEQDOYCCyAAQQA2AgAgEEEBaiEBQRYhEAzLAQsCQCABIgQgAkcNAEH/ACEQDOUCCyACIARrIAAoAgAiAWohFCAEIAFrQQNqIRACQANAIAQtAAAgAUH8zoCAAGotAABHDc0BIAFBA0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH/ACEQDOUCCyAAQQA2AgAgEEEBaiEBQQUhEAzKAQsCQCABIgQgAkcNAEGAASEQDOQCCyAELQAAQdkARw3LASAEQQFqIQFBCCEQDMkBCwJAIAEiBCACRw0AQYEBIRAM4wILAkACQCAELQAAQbJ/ag4DAMwBAcwBCyAEQQFqIQFB6wAhEAzKAgsgBEEBaiEBQewAIRAMyQILAkAgASIEIAJHDQBBggEhEAziAgsCQAJAIAQtAABBuH9qDggAywHLAcsBywHLAcsBAcsBCyAEQQFqIQFB6gAhEAzJAgsgBEEBaiEBQe0AIRAMyAILAkAgASIEIAJHDQBBgwEhEAzhAgsgAiAEayAAKAIAIgFqIRAgBCABa0ECaiEUAkADQCAELQAAIAFBgM+AgABqLQAARw3JASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBA2AgBBgwEhEAzhAgtBACEQIABBADYCACAUQQFqIQEMxgELAkAgASIEIAJHDQBBhAEhEAzgAgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBg8+AgABqLQAARw3IASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBhAEhEAzgAgsgAEEANgIAIBBBAWohAUEjIRAMxQELAkAgASIEIAJHDQBBhQEhEAzfAgsCQAJAIAQtAABBtH9qDggAyAHIAcgByAHIAcgBAcgBCyAEQQFqIQFB7wAhEAzGAgsgBEEBaiEBQfAAIRAMxQILAkAgASIEIAJHDQBBhgEhEAzeAgsgBC0AAEHFAEcNxQEgBEEBaiEBDIMCCwJAIAEiBCACRw0AQYcBIRAM3QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQYjPgIAAai0AAEcNxQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYcBIRAM3QILIABBADYCACAQQQFqIQFBLSEQDMIBCwJAIAEiBCACRw0AQYgBIRAM3AILIAIgBGsgACgCACIBaiEUIAQgAWtBCGohEAJAA0AgBC0AACABQdDPgIAAai0AAEcNxAEgAUEIRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYgBIRAM3AILIABBADYCACAQQQFqIQFBKSEQDMEBCwJAIAEiASACRw0AQYkBIRAM2wILQQEhECABLQAAQd8ARw3AASABQQFqIQEMgQILAkAgASIEIAJHDQBBigEhEAzaAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQA0AgBC0AACABQYzPgIAAai0AAEcNwQEgAUEBRg2vAiABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGKASEQDNkCCwJAIAEiBCACRw0AQYsBIRAM2QILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQY7PgIAAai0AAEcNwQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYsBIRAM2QILIABBADYCACAQQQFqIQFBAiEQDL4BCwJAIAEiBCACRw0AQYwBIRAM2AILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfDPgIAAai0AAEcNwAEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYwBIRAM2AILIABBADYCACAQQQFqIQFBHyEQDL0BCwJAIAEiBCACRw0AQY0BIRAM1wILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfLPgIAAai0AAEcNvwEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQY0BIRAM1wILIABBADYCACAQQQFqIQFBCSEQDLwBCwJAIAEiBCACRw0AQY4BIRAM1gILAkACQCAELQAAQbd/ag4HAL8BvwG/Ab8BvwEBvwELIARBAWohAUH4ACEQDL0CCyAEQQFqIQFB+QAhEAy8AgsCQCABIgQgAkcNAEGPASEQDNUCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGRz4CAAGotAABHDb0BIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGPASEQDNUCCyAAQQA2AgAgEEEBaiEBQRghEAy6AQsCQCABIgQgAkcNAEGQASEQDNQCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUGXz4CAAGotAABHDbwBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGQASEQDNQCCyAAQQA2AgAgEEEBaiEBQRchEAy5AQsCQCABIgQgAkcNAEGRASEQDNMCCyACIARrIAAoAgAiAWohFCAEIAFrQQZqIRACQANAIAQtAAAgAUGaz4CAAGotAABHDbsBIAFBBkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGRASEQDNMCCyAAQQA2AgAgEEEBaiEBQRUhEAy4AQsCQCABIgQgAkcNAEGSASEQDNICCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGhz4CAAGotAABHDboBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGSASEQDNICCyAAQQA2AgAgEEEBaiEBQR4hEAy3AQsCQCABIgQgAkcNAEGTASEQDNECCyAELQAAQcwARw24ASAEQQFqIQFBCiEQDLYBCwJAIAQgAkcNAEGUASEQDNACCwJAAkAgBC0AAEG/f2oODwC5AbkBuQG5AbkBuQG5AbkBuQG5AbkBuQG5AQG5AQsgBEEBaiEBQf4AIRAMtwILIARBAWohAUH/ACEQDLYCCwJAIAQgAkcNAEGVASEQDM8CCwJAAkAgBC0AAEG/f2oOAwC4AQG4AQsgBEEBaiEBQf0AIRAMtgILIARBAWohBEGAASEQDLUCCwJAIAQgAkcNAEGWASEQDM4CCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUGnz4CAAGotAABHDbYBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGWASEQDM4CCyAAQQA2AgAgEEEBaiEBQQshEAyzAQsCQCAEIAJHDQBBlwEhEAzNAgsCQAJAAkACQCAELQAAQVNqDiMAuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AQG4AbgBuAG4AbgBArgBuAG4AQO4AQsgBEEBaiEBQfsAIRAMtgILIARBAWohAUH8ACEQDLUCCyAEQQFqIQRBgQEhEAy0AgsgBEEBaiEEQYIBIRAMswILAkAgBCACRw0AQZgBIRAMzAILIAIgBGsgACgCACIBaiEUIAQgAWtBBGohEAJAA0AgBC0AACABQanPgIAAai0AAEcNtAEgAUEERg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZgBIRAMzAILIABBADYCACAQQQFqIQFBGSEQDLEBCwJAIAQgAkcNAEGZASEQDMsCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGuz4CAAGotAABHDbMBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGZASEQDMsCCyAAQQA2AgAgEEEBaiEBQQYhEAywAQsCQCAEIAJHDQBBmgEhEAzKAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBtM+AgABqLQAARw2yASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmgEhEAzKAgsgAEEANgIAIBBBAWohAUEcIRAMrwELAkAgBCACRw0AQZsBIRAMyQILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQbbPgIAAai0AAEcNsQEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZsBIRAMyQILIABBADYCACAQQQFqIQFBJyEQDK4BCwJAIAQgAkcNAEGcASEQDMgCCwJAAkAgBC0AAEGsf2oOAgABsQELIARBAWohBEGGASEQDK8CCyAEQQFqIQRBhwEhEAyuAgsCQCAEIAJHDQBBnQEhEAzHAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBuM+AgABqLQAARw2vASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBnQEhEAzHAgsgAEEANgIAIBBBAWohAUEmIRAMrAELAkAgBCACRw0AQZ4BIRAMxgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQbrPgIAAai0AAEcNrgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZ4BIRAMxgILIABBADYCACAQQQFqIQFBAyEQDKsBCwJAIAQgAkcNAEGfASEQDMUCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDa0BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGfASEQDMUCCyAAQQA2AgAgEEEBaiEBQQwhEAyqAQsCQCAEIAJHDQBBoAEhEAzEAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFBvM+AgABqLQAARw2sASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBoAEhEAzEAgsgAEEANgIAIBBBAWohAUENIRAMqQELAkAgBCACRw0AQaEBIRAMwwILAkACQCAELQAAQbp/ag4LAKwBrAGsAawBrAGsAawBrAGsAQGsAQsgBEEBaiEEQYsBIRAMqgILIARBAWohBEGMASEQDKkCCwJAIAQgAkcNAEGiASEQDMICCyAELQAAQdAARw2pASAEQQFqIQQM6QELAkAgBCACRw0AQaMBIRAMwQILAkACQCAELQAAQbd/ag4HAaoBqgGqAaoBqgEAqgELIARBAWohBEGOASEQDKgCCyAEQQFqIQFBIiEQDKYBCwJAIAQgAkcNAEGkASEQDMACCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUHAz4CAAGotAABHDagBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGkASEQDMACCyAAQQA2AgAgEEEBaiEBQR0hEAylAQsCQCAEIAJHDQBBpQEhEAy/AgsCQAJAIAQtAABBrn9qDgMAqAEBqAELIARBAWohBEGQASEQDKYCCyAEQQFqIQFBBCEQDKQBCwJAIAQgAkcNAEGmASEQDL4CCwJAAkACQAJAAkAgBC0AAEG/f2oOFQCqAaoBqgGqAaoBqgGqAaoBqgGqAQGqAaoBAqoBqgEDqgGqAQSqAQsgBEEBaiEEQYgBIRAMqAILIARBAWohBEGJASEQDKcCCyAEQQFqIQRBigEhEAymAgsgBEEBaiEEQY8BIRAMpQILIARBAWohBEGRASEQDKQCCwJAIAQgAkcNAEGnASEQDL0CCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDaUBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGnASEQDL0CCyAAQQA2AgAgEEEBaiEBQREhEAyiAQsCQCAEIAJHDQBBqAEhEAy8AgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBws+AgABqLQAARw2kASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBqAEhEAy8AgsgAEEANgIAIBBBAWohAUEsIRAMoQELAkAgBCACRw0AQakBIRAMuwILIAIgBGsgACgCACIBaiEUIAQgAWtBBGohEAJAA0AgBC0AACABQcXPgIAAai0AAEcNowEgAUEERg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQakBIRAMuwILIABBADYCACAQQQFqIQFBKyEQDKABCwJAIAQgAkcNAEGqASEQDLoCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHKz4CAAGotAABHDaIBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGqASEQDLoCCyAAQQA2AgAgEEEBaiEBQRQhEAyfAQsCQCAEIAJHDQBBqwEhEAy5AgsCQAJAAkACQCAELQAAQb5/ag4PAAECpAGkAaQBpAGkAaQBpAGkAaQBpAGkAQOkAQsgBEEBaiEEQZMBIRAMogILIARBAWohBEGUASEQDKECCyAEQQFqIQRBlQEhEAygAgsgBEEBaiEEQZYBIRAMnwILAkAgBCACRw0AQawBIRAMuAILIAQtAABBxQBHDZ8BIARBAWohBAzgAQsCQCAEIAJHDQBBrQEhEAy3AgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBzc+AgABqLQAARw2fASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBrQEhEAy3AgsgAEEANgIAIBBBAWohAUEOIRAMnAELAkAgBCACRw0AQa4BIRAMtgILIAQtAABB0ABHDZ0BIARBAWohAUElIRAMmwELAkAgBCACRw0AQa8BIRAMtQILIAIgBGsgACgCACIBaiEUIAQgAWtBCGohEAJAA0AgBC0AACABQdDPgIAAai0AAEcNnQEgAUEIRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQa8BIRAMtQILIABBADYCACAQQQFqIQFBKiEQDJoBCwJAIAQgAkcNAEGwASEQDLQCCwJAAkAgBC0AAEGrf2oOCwCdAZ0BnQGdAZ0BnQGdAZ0BnQEBnQELIARBAWohBEGaASEQDJsCCyAEQQFqIQRBmwEhEAyaAgsCQCAEIAJHDQBBsQEhEAyzAgsCQAJAIAQtAABBv39qDhQAnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBAZwBCyAEQQFqIQRBmQEhEAyaAgsgBEEBaiEEQZwBIRAMmQILAkAgBCACRw0AQbIBIRAMsgILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQdnPgIAAai0AAEcNmgEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbIBIRAMsgILIABBADYCACAQQQFqIQFBISEQDJcBCwJAIAQgAkcNAEGzASEQDLECCyACIARrIAAoAgAiAWohFCAEIAFrQQZqIRACQANAIAQtAAAgAUHdz4CAAGotAABHDZkBIAFBBkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGzASEQDLECCyAAQQA2AgAgEEEBaiEBQRohEAyWAQsCQCAEIAJHDQBBtAEhEAywAgsCQAJAAkAgBC0AAEG7f2oOEQCaAZoBmgGaAZoBmgGaAZoBmgEBmgGaAZoBmgGaAQKaAQsgBEEBaiEEQZ0BIRAMmAILIARBAWohBEGeASEQDJcCCyAEQQFqIQRBnwEhEAyWAgsCQCAEIAJHDQBBtQEhEAyvAgsgAiAEayAAKAIAIgFqIRQgBCABa0EFaiEQAkADQCAELQAAIAFB5M+AgABqLQAARw2XASABQQVGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBtQEhEAyvAgsgAEEANgIAIBBBAWohAUEoIRAMlAELAkAgBCACRw0AQbYBIRAMrgILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQerPgIAAai0AAEcNlgEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbYBIRAMrgILIABBADYCACAQQQFqIQFBByEQDJMBCwJAIAQgAkcNAEG3ASEQDK0CCwJAAkAgBC0AAEG7f2oODgCWAZYBlgGWAZYBlgGWAZYBlgGWAZYBlgEBlgELIARBAWohBEGhASEQDJQCCyAEQQFqIQRBogEhEAyTAgsCQCAEIAJHDQBBuAEhEAysAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFB7c+AgABqLQAARw2UASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBuAEhEAysAgsgAEEANgIAIBBBAWohAUESIRAMkQELAkAgBCACRw0AQbkBIRAMqwILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfDPgIAAai0AAEcNkwEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbkBIRAMqwILIABBADYCACAQQQFqIQFBICEQDJABCwJAIAQgAkcNAEG6ASEQDKoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUHyz4CAAGotAABHDZIBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG6ASEQDKoCCyAAQQA2AgAgEEEBaiEBQQ8hEAyPAQsCQCAEIAJHDQBBuwEhEAypAgsCQAJAIAQtAABBt39qDgcAkgGSAZIBkgGSAQGSAQsgBEEBaiEEQaUBIRAMkAILIARBAWohBEGmASEQDI8CCwJAIAQgAkcNAEG8ASEQDKgCCyACIARrIAAoAgAiAWohFCAEIAFrQQdqIRACQANAIAQtAAAgAUH0z4CAAGotAABHDZABIAFBB0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG8ASEQDKgCCyAAQQA2AgAgEEEBaiEBQRshEAyNAQsCQCAEIAJHDQBBvQEhEAynAgsCQAJAAkAgBC0AAEG+f2oOEgCRAZEBkQGRAZEBkQGRAZEBkQEBkQGRAZEBkQGRAZEBApEBCyAEQQFqIQRBpAEhEAyPAgsgBEEBaiEEQacBIRAMjgILIARBAWohBEGoASEQDI0CCwJAIAQgAkcNAEG+ASEQDKYCCyAELQAAQc4ARw2NASAEQQFqIQQMzwELAkAgBCACRw0AQb8BIRAMpQILAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgBC0AAEG/f2oOFQABAgOcAQQFBpwBnAGcAQcICQoLnAEMDQ4PnAELIARBAWohAUHoACEQDJoCCyAEQQFqIQFB6QAhEAyZAgsgBEEBaiEBQe4AIRAMmAILIARBAWohAUHyACEQDJcCCyAEQQFqIQFB8wAhEAyWAgsgBEEBaiEBQfYAIRAMlQILIARBAWohAUH3ACEQDJQCCyAEQQFqIQFB+gAhEAyTAgsgBEEBaiEEQYMBIRAMkgILIARBAWohBEGEASEQDJECCyAEQQFqIQRBhQEhEAyQAgsgBEEBaiEEQZIBIRAMjwILIARBAWohBEGYASEQDI4CCyAEQQFqIQRBoAEhEAyNAgsgBEEBaiEEQaMBIRAMjAILIARBAWohBEGqASEQDIsCCwJAIAQgAkYNACAAQZCAgIAANgIIIAAgBDYCBEGrASEQDIsCC0HAASEQDKMCCyAAIAUgAhCqgICAACIBDYsBIAUhAQxcCwJAIAYgAkYNACAGQQFqIQUMjQELQcIBIRAMoQILA0ACQCAQLQAAQXZqDgSMAQAAjwEACyAQQQFqIhAgAkcNAAtBwwEhEAygAgsCQCAHIAJGDQAgAEGRgICAADYCCCAAIAc2AgQgByEBQQEhEAyHAgtBxAEhEAyfAgsCQCAHIAJHDQBBxQEhEAyfAgsCQAJAIActAABBdmoOBAHOAc4BAM4BCyAHQQFqIQYMjQELIAdBAWohBQyJAQsCQCAHIAJHDQBBxgEhEAyeAgsCQAJAIActAABBdmoOFwGPAY8BAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAQCPAQsgB0EBaiEHC0GwASEQDIQCCwJAIAggAkcNAEHIASEQDJ0CCyAILQAAQSBHDY0BIABBADsBMiAIQQFqIQFBswEhEAyDAgsgASEXAkADQCAXIgcgAkYNASAHLQAAQVBqQf8BcSIQQQpPDcwBAkAgAC8BMiIUQZkzSw0AIAAgFEEKbCIUOwEyIBBB//8DcyAUQf7/A3FJDQAgB0EBaiEXIAAgFCAQaiIQOwEyIBBB//8DcUHoB0kNAQsLQQAhECAAQQA2AhwgAEHBiYCAADYCECAAQQ02AgwgACAHQQFqNgIUDJwCC0HHASEQDJsCCyAAIAggAhCugICAACIQRQ3KASAQQRVHDYwBIABByAE2AhwgACAINgIUIABByZeAgAA2AhAgAEEVNgIMQQAhEAyaAgsCQCAJIAJHDQBBzAEhEAyaAgtBACEUQQEhF0EBIRZBACEQAkACQAJAAkACQAJAAkACQAJAIAktAABBUGoOCpYBlQEAAQIDBAUGCJcBC0ECIRAMBgtBAyEQDAULQQQhEAwEC0EFIRAMAwtBBiEQDAILQQchEAwBC0EIIRALQQAhF0EAIRZBACEUDI4BC0EJIRBBASEUQQAhF0EAIRYMjQELAkAgCiACRw0AQc4BIRAMmQILIAotAABBLkcNjgEgCkEBaiEJDMoBCyALIAJHDY4BQdABIRAMlwILAkAgCyACRg0AIABBjoCAgAA2AgggACALNgIEQbcBIRAM/gELQdEBIRAMlgILAkAgBCACRw0AQdIBIRAMlgILIAIgBGsgACgCACIQaiEUIAQgEGtBBGohCwNAIAQtAAAgEEH8z4CAAGotAABHDY4BIBBBBEYN6QEgEEEBaiEQIARBAWoiBCACRw0ACyAAIBQ2AgBB0gEhEAyVAgsgACAMIAIQrICAgAAiAQ2NASAMIQEMuAELAkAgBCACRw0AQdQBIRAMlAILIAIgBGsgACgCACIQaiEUIAQgEGtBAWohDANAIAQtAAAgEEGB0ICAAGotAABHDY8BIBBBAUYNjgEgEEEBaiEQIARBAWoiBCACRw0ACyAAIBQ2AgBB1AEhEAyTAgsCQCAEIAJHDQBB1gEhEAyTAgsgAiAEayAAKAIAIhBqIRQgBCAQa0ECaiELA0AgBC0AACAQQYPQgIAAai0AAEcNjgEgEEECRg2QASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHWASEQDJICCwJAIAQgAkcNAEHXASEQDJICCwJAAkAgBC0AAEG7f2oOEACPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BAY8BCyAEQQFqIQRBuwEhEAz5AQsgBEEBaiEEQbwBIRAM+AELAkAgBCACRw0AQdgBIRAMkQILIAQtAABByABHDYwBIARBAWohBAzEAQsCQCAEIAJGDQAgAEGQgICAADYCCCAAIAQ2AgRBvgEhEAz3AQtB2QEhEAyPAgsCQCAEIAJHDQBB2gEhEAyPAgsgBC0AAEHIAEYNwwEgAEEBOgAoDLkBCyAAQQI6AC8gACAEIAIQpoCAgAAiEA2NAUHCASEQDPQBCyAALQAoQX9qDgK3AbkBuAELA0ACQCAELQAAQXZqDgQAjgGOAQCOAQsgBEEBaiIEIAJHDQALQd0BIRAMiwILIABBADoALyAALQAtQQRxRQ2EAgsgAEEAOgAvIABBAToANCABIQEMjAELIBBBFUYN2gEgAEEANgIcIAAgATYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAMiAILAkAgACAQIAIQtICAgAAiBA0AIBAhAQyBAgsCQCAEQRVHDQAgAEEDNgIcIAAgEDYCFCAAQbCYgIAANgIQIABBFTYCDEEAIRAMiAILIABBADYCHCAAIBA2AhQgAEGnjoCAADYCECAAQRI2AgxBACEQDIcCCyAQQRVGDdYBIABBADYCHCAAIAE2AhQgAEHajYCAADYCECAAQRQ2AgxBACEQDIYCCyAAKAIEIRcgAEEANgIEIBAgEadqIhYhASAAIBcgECAWIBQbIhAQtYCAgAAiFEUNjQEgAEEHNgIcIAAgEDYCFCAAIBQ2AgxBACEQDIUCCyAAIAAvATBBgAFyOwEwIAEhAQtBKiEQDOoBCyAQQRVGDdEBIABBADYCHCAAIAE2AhQgAEGDjICAADYCECAAQRM2AgxBACEQDIICCyAQQRVGDc8BIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDIECCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyNAQsgAEEMNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDIACCyAQQRVGDcwBIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDP8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyMAQsgAEENNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDP4BCyAQQRVGDckBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDP0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQuYCAgAAiEA0AIAFBAWohAQyLAQsgAEEONgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPwBCyAAQQA2AhwgACABNgIUIABBwJWAgAA2AhAgAEECNgIMQQAhEAz7AQsgEEEVRg3FASAAQQA2AhwgACABNgIUIABBxoyAgAA2AhAgAEEjNgIMQQAhEAz6AQsgAEEQNgIcIAAgATYCFCAAIBA2AgxBACEQDPkBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQuYCAgAAiBA0AIAFBAWohAQzxAQsgAEERNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPgBCyAQQRVGDcEBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDPcBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQuYCAgAAiEA0AIAFBAWohAQyIAQsgAEETNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPYBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQuYCAgAAiBA0AIAFBAWohAQztAQsgAEEUNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPUBCyAQQRVGDb0BIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDPQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyGAQsgAEEWNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPMBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQt4CAgAAiBA0AIAFBAWohAQzpAQsgAEEXNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPIBCyAAQQA2AhwgACABNgIUIABBzZOAgAA2AhAgAEEMNgIMQQAhEAzxAQtCASERCyAQQQFqIQECQCAAKQMgIhJC//////////8PVg0AIAAgEkIEhiARhDcDICABIQEMhAELIABBADYCHCAAIAE2AhQgAEGtiYCAADYCECAAQQw2AgxBACEQDO8BCyAAQQA2AhwgACAQNgIUIABBzZOAgAA2AhAgAEEMNgIMQQAhEAzuAQsgACgCBCEXIABBADYCBCAQIBGnaiIWIQEgACAXIBAgFiAUGyIQELWAgIAAIhRFDXMgAEEFNgIcIAAgEDYCFCAAIBQ2AgxBACEQDO0BCyAAQQA2AhwgACAQNgIUIABBqpyAgAA2AhAgAEEPNgIMQQAhEAzsAQsgACAQIAIQtICAgAAiAQ0BIBAhAQtBDiEQDNEBCwJAIAFBFUcNACAAQQI2AhwgACAQNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAzqAQsgAEEANgIcIAAgEDYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAM6QELIAFBAWohEAJAIAAvATAiAUGAAXFFDQACQCAAIBAgAhC7gICAACIBDQAgECEBDHALIAFBFUcNugEgAEEFNgIcIAAgEDYCFCAAQfmXgIAANgIQIABBFTYCDEEAIRAM6QELAkAgAUGgBHFBoARHDQAgAC0ALUECcQ0AIABBADYCHCAAIBA2AhQgAEGWk4CAADYCECAAQQQ2AgxBACEQDOkBCyAAIBAgAhC9gICAABogECEBAkACQAJAAkACQCAAIBAgAhCzgICAAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIABBAToALgsgACAALwEwQcAAcjsBMCAQIQELQSYhEAzRAQsgAEEjNgIcIAAgEDYCFCAAQaWWgIAANgIQIABBFTYCDEEAIRAM6QELIABBADYCHCAAIBA2AhQgAEHVi4CAADYCECAAQRE2AgxBACEQDOgBCyAALQAtQQFxRQ0BQcMBIRAMzgELAkAgDSACRg0AA0ACQCANLQAAQSBGDQAgDSEBDMQBCyANQQFqIg0gAkcNAAtBJSEQDOcBC0ElIRAM5gELIAAoAgQhBCAAQQA2AgQgACAEIA0Qr4CAgAAiBEUNrQEgAEEmNgIcIAAgBDYCDCAAIA1BAWo2AhRBACEQDOUBCyAQQRVGDasBIABBADYCHCAAIAE2AhQgAEH9jYCAADYCECAAQR02AgxBACEQDOQBCyAAQSc2AhwgACABNgIUIAAgEDYCDEEAIRAM4wELIBAhAUEBIRQCQAJAAkACQAJAAkACQCAALQAsQX5qDgcGBQUDAQIABQsgACAALwEwQQhyOwEwDAMLQQIhFAwBC0EEIRQLIABBAToALCAAIAAvATAgFHI7ATALIBAhAQtBKyEQDMoBCyAAQQA2AhwgACAQNgIUIABBq5KAgAA2AhAgAEELNgIMQQAhEAziAQsgAEEANgIcIAAgATYCFCAAQeGPgIAANgIQIABBCjYCDEEAIRAM4QELIABBADoALCAQIQEMvQELIBAhAUEBIRQCQAJAAkACQAJAIAAtACxBe2oOBAMBAgAFCyAAIAAvATBBCHI7ATAMAwtBAiEUDAELQQQhFAsgAEEBOgAsIAAgAC8BMCAUcjsBMAsgECEBC0EpIRAMxQELIABBADYCHCAAIAE2AhQgAEHwlICAADYCECAAQQM2AgxBACEQDN0BCwJAIA4tAABBDUcNACAAKAIEIQEgAEEANgIEAkAgACABIA4QsYCAgAAiAQ0AIA5BAWohAQx1CyAAQSw2AhwgACABNgIMIAAgDkEBajYCFEEAIRAM3QELIAAtAC1BAXFFDQFBxAEhEAzDAQsCQCAOIAJHDQBBLSEQDNwBCwJAAkADQAJAIA4tAABBdmoOBAIAAAMACyAOQQFqIg4gAkcNAAtBLSEQDN0BCyAAKAIEIQEgAEEANgIEAkAgACABIA4QsYCAgAAiAQ0AIA4hAQx0CyAAQSw2AhwgACAONgIUIAAgATYCDEEAIRAM3AELIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDkEBaiEBDHMLIABBLDYCHCAAIAE2AgwgACAOQQFqNgIUQQAhEAzbAQsgACgCBCEEIABBADYCBCAAIAQgDhCxgICAACIEDaABIA4hAQzOAQsgEEEsRw0BIAFBAWohEEEBIQECQAJAAkACQAJAIAAtACxBe2oOBAMBAgQACyAQIQEMBAtBAiEBDAELQQQhAQsgAEEBOgAsIAAgAC8BMCABcjsBMCAQIQEMAQsgACAALwEwQQhyOwEwIBAhAQtBOSEQDL8BCyAAQQA6ACwgASEBC0E0IRAMvQELIAAgAC8BMEEgcjsBMCABIQEMAgsgACgCBCEEIABBADYCBAJAIAAgBCABELGAgIAAIgQNACABIQEMxwELIABBNzYCHCAAIAE2AhQgACAENgIMQQAhEAzUAQsgAEEIOgAsIAEhAQtBMCEQDLkBCwJAIAAtAChBAUYNACABIQEMBAsgAC0ALUEIcUUNkwEgASEBDAMLIAAtADBBIHENlAFBxQEhEAy3AQsCQCAPIAJGDQACQANAAkAgDy0AAEFQaiIBQf8BcUEKSQ0AIA8hAUE1IRAMugELIAApAyAiEUKZs+bMmbPmzBlWDQEgACARQgp+IhE3AyAgESABrUL/AYMiEkJ/hVYNASAAIBEgEnw3AyAgD0EBaiIPIAJHDQALQTkhEAzRAQsgACgCBCECIABBADYCBCAAIAIgD0EBaiIEELGAgIAAIgINlQEgBCEBDMMBC0E5IRAMzwELAkAgAC8BMCIBQQhxRQ0AIAAtAChBAUcNACAALQAtQQhxRQ2QAQsgACABQff7A3FBgARyOwEwIA8hAQtBNyEQDLQBCyAAIAAvATBBEHI7ATAMqwELIBBBFUYNiwEgAEEANgIcIAAgATYCFCAAQfCOgIAANgIQIABBHDYCDEEAIRAMywELIABBwwA2AhwgACABNgIMIAAgDUEBajYCFEEAIRAMygELAkAgAS0AAEE6Rw0AIAAoAgQhECAAQQA2AgQCQCAAIBAgARCvgICAACIQDQAgAUEBaiEBDGMLIABBwwA2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAMygELIABBADYCHCAAIAE2AhQgAEGxkYCAADYCECAAQQo2AgxBACEQDMkBCyAAQQA2AhwgACABNgIUIABBoJmAgAA2AhAgAEEeNgIMQQAhEAzIAQsgAEEANgIACyAAQYASOwEqIAAgF0EBaiIBIAIQqICAgAAiEA0BIAEhAQtBxwAhEAysAQsgEEEVRw2DASAAQdEANgIcIAAgATYCFCAAQeOXgIAANgIQIABBFTYCDEEAIRAMxAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDF4LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMwwELIABBADYCHCAAIBQ2AhQgAEHBqICAADYCECAAQQc2AgwgAEEANgIAQQAhEAzCAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMXQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAzBAQtBACEQIABBADYCHCAAIAE2AhQgAEGAkYCAADYCECAAQQk2AgwMwAELIBBBFUYNfSAAQQA2AhwgACABNgIUIABBlI2AgAA2AhAgAEEhNgIMQQAhEAy/AQtBASEWQQAhF0EAIRRBASEQCyAAIBA6ACsgAUEBaiEBAkACQCAALQAtQRBxDQACQAJAAkAgAC0AKg4DAQACBAsgFkUNAwwCCyAUDQEMAgsgF0UNAQsgACgCBCEQIABBADYCBAJAIAAgECABEK2AgIAAIhANACABIQEMXAsgAEHYADYCHCAAIAE2AhQgACAQNgIMQQAhEAy+AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMrQELIABB2QA2AhwgACABNgIUIAAgBDYCDEEAIRAMvQELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKsBCyAAQdoANgIcIAAgATYCFCAAIAQ2AgxBACEQDLwBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQypAQsgAEHcADYCHCAAIAE2AhQgACAENgIMQQAhEAy7AQsCQCABLQAAQVBqIhBB/wFxQQpPDQAgACAQOgAqIAFBAWohAUHPACEQDKIBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQynAQsgAEHeADYCHCAAIAE2AhQgACAENgIMQQAhEAy6AQsgAEEANgIAIBdBAWohAQJAIAAtAClBI08NACABIQEMWQsgAEEANgIcIAAgATYCFCAAQdOJgIAANgIQIABBCDYCDEEAIRAMuQELIABBADYCAAtBACEQIABBADYCHCAAIAE2AhQgAEGQs4CAADYCECAAQQg2AgwMtwELIABBADYCACAXQQFqIQECQCAALQApQSFHDQAgASEBDFYLIABBADYCHCAAIAE2AhQgAEGbioCAADYCECAAQQg2AgxBACEQDLYBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKSIQQV1qQQtPDQAgASEBDFULAkAgEEEGSw0AQQEgEHRBygBxRQ0AIAEhAQxVC0EAIRAgAEEANgIcIAAgATYCFCAAQfeJgIAANgIQIABBCDYCDAy1AQsgEEEVRg1xIABBADYCHCAAIAE2AhQgAEG5jYCAADYCECAAQRo2AgxBACEQDLQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxUCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLMBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAU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YWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21ldGhvZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lYCBjYWxsYmFjayBlcnJvcgBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNlcnZlcgBJbnZhbGlkIGhlYWRlciB2YWx1ZSBjaGFyAEludmFsaWQgaGVhZGVyIGZpZWxkIGNoYXIAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl92ZXJzaW9uAEludmFsaWQgbWlub3IgdmVyc2lvbgBJbnZhbGlkIG1ham9yIHZlcnNpb24ARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgdmVyc2lvbgBFeHBlY3RlZCBDUkxGIGFmdGVyIHZlcnNpb24ASW52YWxpZCBIVFRQIHZlcnNpb24ASW52YWxpZCBoZWFkZXIgdG9rZW4AU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl91cmwASW52YWxpZCBjaGFyYWN0ZXJzIGluIHVybABVbmV4cGVjdGVkIHN0YXJ0IGNoYXIgaW4gdXJsAERvdWJsZSBAIGluIHVybABFbXB0eSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXJhY3RlciBpbiBDb250ZW50LUxlbmd0aABEdXBsaWNhdGUgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyIGluIHVybCBwYXRoAENvbnRlbnQtTGVuZ3RoIGNhbid0IGJlIHByZXNlbnQgd2l0aCBUcmFuc2Zlci1FbmNvZGluZwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBzaXplAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX3ZhbHVlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgdmFsdWUATWlzc2luZyBleHBlY3RlZCBMRiBhZnRlciBoZWFkZXIgdmFsdWUASW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fbmFtZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIG5hbWUAUGF1c2Ugb24gQ09OTkVDVC9VcGdyYWRlAFBhdXNlIG9uIFBSSS9VcGdyYWRlAEV4cGVjdGVkIEhUVFAvMiBDb25uZWN0aW9uIFByZWZhY2UAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9tZXRob2QARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgbWV0aG9kAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX2ZpZWxkAFBhdXNlZABJbnZhbGlkIHdvcmQgZW5jb3VudGVyZWQASW52YWxpZCBtZXRob2QgZW5jb3VudGVyZWQAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzY2hlbWEAUmVxdWVzdCBoYXMgaW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX0NIVU5LX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX05BTUVfQ09NUExFVEUASFBFX0NCX01FU1NBR0VfQ09NUExFVEUASFBFX0NCX01FVEhPRF9DT01QTEVURQBIUEVfQ0JfSEVBREVSX0ZJRUxEX0NPTVBMRVRFAERFTEVURQBIUEVfSU5WQUxJRF9FT0ZfU1RBVEUASU5WQUxJRF9TU0xfQ0VSVElGSUNBVEUAUEFVU0UATk9fUkVTUE9OU0UAVU5TVVBQT1JURURfTUVESUFfVFlQRQBHT05FAE5PVF9BQ0NFUFRBQkxFAFNFUlZJQ0VfVU5BVkFJTEFCTEUAUkFOR0VfTk9UX1NBVElTRklBQkxFAE9SSUdJTl9JU19VTlJFQUNIQUJMRQBSRVNQT05TRV9JU19TVEFMRQBQVVJHRQBNRVJHRQBSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFAFJFUVVFU1RfSEVBREVSX1RPT19MQVJHRQBQQVlMT0FEX1RPT19MQVJHRQBJTlNVRkZJQ0lFTlRfU1RPUkFHRQBIUEVfUEFVU0VEX1VQR1JBREUASFBFX1BBVVNFRF9IMl9VUEdSQURFAFNPVVJDRQBBTk5PVU5DRQBUUkFDRQBIUEVfVU5FWFBFQ1RFRF9TUEFDRQBERVNDUklCRQBVTlNVQlNDUklCRQBSRUNPUkQASFBFX0lOVkFMSURfTUVUSE9EAE5PVF9GT1VORABQUk9QRklORABVTkJJTkQAUkVCSU5EAFVOQVVUSE9SSVpFRABNRVRIT0RfTk9UX0FMTE9XRUQASFRUUF9WRVJTSU9OX05PVF9TVVBQT1JURUQAQUxSRUFEWV9SRVBPUlRFRABBQ0NFUFRFRABOT1RfSU1QTEVNRU5URUQATE9PUF9ERVRFQ1RFRABIUEVfQ1JfRVhQRUNURUQASFBFX0xGX0VYUEVDVEVEAENSRUFURUQASU1fVVNFRABIUEVfUEFVU0VEAFRJTUVPVVRfT0NDVVJFRABQQVlNRU5UX1JFUVVJUkVEAFBSRUNPTkRJVElPTl9SRVFVSVJFRABQUk9YWV9BVVRIRU5USUNBVElPTl9SRVFVSVJFRABORVRXT1JLX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAExFTkdUSF9SRVFVSVJFRABTU0xfQ0VSVElGSUNBVEVfUkVRVUlSRUQAVVBHUkFERV9SRVFVSVJFRABQQUdFX0VYUElSRUQAUFJFQ09ORElUSU9OX0ZBSUxFRABFWFBFQ1RBVElPTl9GQUlMRUQAUkVWQUxJREFUSU9OX0ZBSUxFRABTU0xfSEFORFNIQUtFX0ZBSUxFRABMT0NLRUQAVFJBTlNGT1JNQVRJT05fQVBQTElFRABOT1RfTU9ESUZJRUQATk9UX0VYVEVOREVEAEJBTkRXSURUSF9MSU1JVF9FWENFRURFRABTSVRFX0lTX09WRVJMT0FERUQASEVBRABFeHBlY3RlZCBIVFRQLwAAXhMAACYTAAAwEAAA8BcAAJ0TAAAVEgAAORcAAPASAAAKEAAAdRIAAK0SAACCEwAATxQAAH8QAACgFQAAIxQAAIkSAACLFAAATRUAANQRAADPFAAAEBgAAMkWAADcFgAAwREAAOAXAAC7FAAAdBQAAHwVAADlFAAACBcAAB8QAABlFQAAoxQAACgVAAACFQAAmRUAACwQAACLGQAATw8AANQOAABqEAAAzhAAAAIXAACJDgAAbhMAABwTAABmFAAAVhcAAMETAADNEwAAbBMAAGgXAABmFwAAXxcAACITAADODwAAaQ4AANgOAABjFgAAyxMAAKoOAAAoFwAAJhcAAMUTAABdFgAA6BEAAGcTAABlEwAA8hYAAHMTAAAdFwAA+RYAAPMRAADPDgAAzhUAAAwSAACzEQAApREAAGEQAAAyFwAAuxMAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIDAgICAgIAAAICAAICAAICAgICAgICAgIABAAAAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbG9zZWVlcC1hbGl2ZQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEAAAEBAAEBAAEBAQEBAQEBAQEAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AAAAAAAAAAAAAAAAAAAByYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AAAAAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQIAAQMAAAAAAAAAAAAAAAAAAAAAAAAEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAQAAAgAAAAAAAAAAAAAAAAAAAAAAAAMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAIAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOT1VOQ0VFQ0tPVVRORUNURVRFQ1JJQkVMVVNIRVRFQURTRUFSQ0hSR0VDVElWSVRZTEVOREFSVkVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8="; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js var require_llhttp_simd_wasm = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js"(exports2, module3) { init_import_meta_url(); module3.exports = "AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJs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IAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbbAUdISUrPAc4BS80BTMwBTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEB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QAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB4fICEjJSg/QEFERUZHSElKS0xNT1BRUlPeA1dZW1xdYGJlZmdoaWprbG1vcHFyc3R1dnd4eXp7fH1+gAGCAYUBhgGHAYkBiwGMAY0BjgGPAZABkQGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgHHAcgByQHKAcsBzAHNAc4BzwHQAdEB0gHTAdQB1QHWAdcB2AHZAdoB2wHcAd0B3gHgAeEB4gHjAeQB5QHmAecB6AHpAeoB6wHsAe0B7gHvAfAB8QHyAfMBmQKkArAC/gL+AgsgASIEIAJHDfMBQd0BIRAM/wMLIAEiECACRw3dAUHDASEQDP4DCyABIgEgAkcNkAFB9wAhEAz9AwsgASIBIAJHDYYBQe8AIRAM/AMLIAEiASACRw1/QeoAIRAM+wMLIAEiASACRw17QegAIRAM+gMLIAEiASACRw14QeYAIRAM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQAAIhBBAkYNACAQQX9qDgTeAewB4AHrAewBCyABQQFqIgEgAkcNAAtBGCEQDN0DCwJAIAEiASACRg0AIABBi4CAgAA2AgggACABNgIEIAEhAUEHIRAMxAMLQRkhEAzcAwsgAUEBaiEBDAILAkAgASIUIAJHDQBBGiEQDNsDCyAUIQECQCAULQAAQXNqDhTdAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAgDuAgtBACEQIABBADYCHCAAQa+LgIAANgIQIABBAjYCDCAAIBRBAWo2AhQM2gMLAkAgAS0AACIQQTtGDQAgEEENRw3oASABQQFqIQEM5QILIAFBAWohAQtBIiEQDL8DCwJAIAEiECACRw0AQRwhEAzYAwtCACERIBAhASAQLQAAQVBqDjfnAeYBAQIDBAUGBwgAAAAAAAAACQoLDA0OAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPEBESExQAC0EeIRAMvQMLQgIhEQzlAQtCAyERDOQBC0IEIREM4wELQgUhEQziAQtCBiERDOEBC0IHIREM4AELQgghEQzfAQtCCSERDN4BC0IKIREM3QELQgshEQzcAQtCDCERDNsBC0INIREM2gELQg4hEQzZAQtCDyERDNgBC0IKIREM1wELQgshEQzWAQtCDCERDNUBC0INIREM1AELQg4hEQzTAQtCDyERDNIBC0IAIRECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAtAABBUGoON+UB5AEAAQIDBAUGB+YB5gHmAeYB5gHmAeYBCAkKCwwN5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAQ4PEBESE+YBC0ICIREM5AELQgMhEQzjAQtCBCERDOIBC0IFIREM4QELQgYhEQzgAQtCByERDN8BC0IIIREM3gELQgkhEQzdAQtCCiERDNwBC0ILIREM2wELQgwhEQzaAQtCDSERDNkBC0IOIREM2AELQg8hEQzXAQtCCiERDNYBC0ILIREM1QELQgwhEQzUAQtCDSERDNMBC0IOIREM0gELQg8hEQzRAQsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3SAUEfIRAMwAMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQSQhEAynAwtBICEQDL8DCyAAIAEiECACEL6AgIAAQX9qDgW2AQDFAgHRAdIBC0ERIRAMpAMLIABBAToALyAQIQEMuwMLIAEiASACRw3SAUEkIRAMuwMLIAEiDSACRw0eQcYAIRAMugMLIAAgASIBIAIQsoCAgAAiEA3UASABIQEMtQELIAEiECACRw0mQdAAIRAMuAMLAkAgASIBIAJHDQBBKCEQDLgDCyAAQQA2AgQgAEGMgICAADYCCCAAIAEgARCxgICAACIQDdMBIAEhAQzYAQsCQCABIhAgAkcNAEEpIRAMtwMLIBAtAAAiAUEgRg0UIAFBCUcN0wEgEEEBaiEBDBULAkAgASIBIAJGDQAgAUEBaiEBDBcLQSohEAy1AwsCQCABIhAgAkcNAEErIRAMtQMLAkAgEC0AACIBQQlGDQAgAUEgRw3VAQsgAC0ALEEIRg3TASAQIQEMkQMLAkAgASIBIAJHDQBBLCEQDLQDCyABLQAAQQpHDdUBIAFBAWohAQzJAgsgASIOIAJHDdUBQS8hEAyyAwsDQAJAIAEtAAAiEEEgRg0AAkAgEEF2ag4EANwB3AEA2gELIAEhAQzgAQsgAUEBaiIBIAJHDQALQTEhEAyxAwtBMiEQIAEiFCACRg2wAyACIBRrIAAoAgAiAWohFSAUIAFrQQNqIRYCQANAIBQtAAAiF0EgciAXIBdBv39qQf8BcUEaSRtB/wFxIAFB8LuAgABqLQAARw0BAkAgAUEDRw0AQQYhAQyWAwsgAUEBaiEBIBRBAWoiFCACRw0ACyAAIBU2AgAMsQMLIABBADYCACAUIQEM2QELQTMhECABIhQgAkYNrwMgAiAUayAAKAIAIgFqIRUgFCABa0EIaiEWAkADQCAULQAAIhdBIHIgFyAXQb9/akH/AXFBGkkbQf8BcSABQfS7gIAAai0AAEcNAQJAIAFBCEcNAEEFIQEMlQMLIAFBAWohASAUQQFqIhQgAkcNAAsgACAVNgIADLADCyAAQQA2AgAgFCEBDNgBC0E0IRAgASIUIAJGDa4DIAIgFGsgACgCACIBaiEVIBQgAWtBBWohFgJAA0AgFC0AACIXQSByIBcgF0G/f2pB/wFxQRpJG0H/AXEgAUHQwoCAAGotAABHDQECQCABQQVHDQBBByEBDJQDCyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFTYCAAyvAwsgAEEANgIAIBQhAQzXAQsCQCABIgEgAkYNAANAAkAgAS0AAEGAvoCAAGotAAAiEEEBRg0AIBBBAkYNCiABIQEM3QELIAFBAWoiASACRw0AC0EwIRAMrgMLQTAhEAytAwsCQCABIgEgAkYNAANAAkAgAS0AACIQQSBGDQAgEEF2ag4E2QHaAdoB2QHaAQsgAUEBaiIBIAJHDQALQTghEAytAwtBOCEQDKwDCwNAAkAgAS0AACIQQSBGDQAgEEEJRw0DCyABQQFqIgEgAkcNAAtBPCEQDKsDCwNAAkAgAS0AACIQQSBGDQACQAJAIBBBdmoOBNoBAQHaAQALIBBBLEYN2wELIAEhAQwECyABQQFqIgEgAkcNAAtBPyEQDKoDCyABIQEM2wELQcAAIRAgASIUIAJGDagDIAIgFGsgACgCACIBaiEWIBQgAWtBBmohFwJAA0AgFC0AAEEgciABQYDAgIAAai0AAEcNASABQQZGDY4DIAFBAWohASAUQQFqIhQgAkcNAAsgACAWNgIADKkDCyAAQQA2AgAgFCEBC0E2IRAMjgMLAkAgASIPIAJHDQBBwQAhEAynAwsgAEGMgICAADYCCCAAIA82AgQgDyEBIAAtACxBf2oOBM0B1QHXAdkBhwMLIAFBAWohAQzMAQsCQCABIgEgAkYNAANAAkAgAS0AACIQQSByIBAgEEG/f2pB/wFxQRpJG0H/AXEiEEEJRg0AIBBBIEYNAAJAAkACQAJAIBBBnX9qDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTEhEAyRAwsgAUEBaiEBQTIhEAyQAwsgAUEBaiEBQTMhEAyPAwsgASEBDNABCyABQQFqIgEgAkcNAAtBNSEQDKUDC0E1IRAMpAMLAkAgASIBIAJGDQADQAJAIAEtAABBgLyAgABqLQAAQQFGDQAgASEBDNMBCyABQQFqIgEgAkcNAAtBPSEQDKQDC0E9IRAMowMLIAAgASIBIAIQsICAgAAiEA3WASABIQEMAQsgEEEBaiEBC0E8IRAMhwMLAkAgASIBIAJHDQBBwgAhEAygAwsCQANAAkAgAS0AAEF3ag4YAAL+Av4ChAP+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gIA/gILIAFBAWoiASACRw0AC0HCACEQDKADCyABQQFqIQEgAC0ALUEBcUUNvQEgASEBC0EsIRAMhQMLIAEiASACRw3TAUHEACEQDJ0DCwNAAkAgAS0AAEGQwICAAGotAABBAUYNACABIQEMtwILIAFBAWoiASACRw0AC0HFACEQDJwDCyANLQAAIhBBIEYNswEgEEE6Rw2BAyAAKAIEIQEgAEEANgIEIAAgASANEK+AgIAAIgEN0AEgDUEBaiEBDLMCC0HHACEQIAEiDSACRg2aAyACIA1rIAAoAgAiAWohFiANIAFrQQVqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQZDCgIAAai0AAEcNgAMgAUEFRg30AiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyaAwtByAAhECABIg0gAkYNmQMgAiANayAAKAIAIgFqIRYgDSABa0EJaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGWwoCAAGotAABHDf8CAkAgAUEJRw0AQQIhAQz1AgsgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMmQMLAkAgASINIAJHDQBByQAhEAyZAwsCQAJAIA0tAAAiAUEgciABIAFBv39qQf8BcUEaSRtB/wFxQZJ/ag4HAIADgAOAA4ADgAMBgAMLIA1BAWohAUE+IRAMgAMLIA1BAWohAUE/IRAM/wILQcoAIRAgASINIAJGDZcDIAIgDWsgACgCACIBaiEWIA0gAWtBAWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBoMKAgABqLQAARw39AiABQQFGDfACIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJcDC0HLACEQIAEiDSACRg2WAyACIA1rIAAoAgAiAWohFiANIAFrQQ5qIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQaLCgIAAai0AAEcN/AIgAUEORg3wAiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyWAwtBzAAhECABIg0gAkYNlQMgAiANayAAKAIAIgFqIRYgDSABa0EPaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUHAwoCAAGotAABHDfsCAkAgAUEPRw0AQQMhAQzxAgsgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMlQMLQc0AIRAgASINIAJGDZQDIAIgDWsgACgCACIBaiEWIA0gAWtBBWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFB0MKAgABqLQAARw36AgJAIAFBBUcNAEEEIQEM8AILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJQDCwJAIAEiDSACRw0AQc4AIRAMlAMLAkACQAJAAkAgDS0AACIBQSByIAEgAUG/f2pB/wFxQRpJG0H/AXFBnX9qDhMA/QL9Av0C/QL9Av0C/QL9Av0C/QL9Av0CAf0C/QL9AgID/QILIA1BAWohAUHBACEQDP0CCyANQQFqIQFBwgAhEAz8AgsgDUEBaiEBQcMAIRAM+wILIA1BAWohAUHEACEQDPoCCwJAIAEiASACRg0AIABBjYCAgAA2AgggACABNgIEIAEhAUHFACEQDPoCC0HPACEQDJIDCyAQIQECQAJAIBAtAABBdmoOBAGoAqgCAKgCCyAQQQFqIQELQSchEAz4AgsCQCABIgEgAkcNAEHRACEQDJEDCwJAIAEtAABBIEYNACABIQEMjQELIAFBAWohASAALQAtQQFxRQ3HASABIQEMjAELIAEiFyACRw3IAUHSACEQDI8DC0HTACEQIAEiFCACRg2OAyACIBRrIAAoAgAiAWohFiAUIAFrQQFqIRcDQCAULQAAIAFB1sKAgABqLQAARw3MASABQQFGDccBIAFBAWohASAUQQFqIhQgAkcNAAsgACAWNgIADI4DCwJAIAEiASACRw0AQdUAIRAMjgMLIAEtAABBCkcNzAEgAUEBaiEBDMcBCwJAIAEiASACRw0AQdYAIRAMjQMLAkACQCABLQAAQXZqDgQAzQHNAQHNAQsgAUEBaiEBDMcBCyABQQFqIQFBygAhEAzzAgsgACABIgEgAhCugICAACIQDcsBIAEhAUHNACEQDPICCyAALQApQSJGDYUDDKYCCwJAIAEiASACRw0AQdsAIRAMigMLQQAhFEEBIRdBASEWQQAhEAJAAkACQAJAAkACQAJAAkACQCABLQAAQVBqDgrUAdMBAAECAwQFBgjVAQtBAiEQDAYLQQMhEAwFC0EEIRAMBAtBBSEQDAMLQQYhEAwCC0EHIRAMAQtBCCEQC0EAIRdBACEWQQAhFAzMAQtBCSEQQQEhFEEAIRdBACEWDMsBCwJAIAEiASACRw0AQd0AIRAMiQMLIAEtAABBLkcNzAEgAUEBaiEBDKYCCyABIgEgAkcNzAFB3wAhEAyHAwsCQCABIgEgAkYNACAAQY6AgIAANgIIIAAgATYCBCABIQFB0AAhEAzuAgtB4AAhEAyGAwtB4QAhECABIgEgAkYNhQMgAiABayAAKAIAIhRqIRYgASAUa0EDaiEXA0AgAS0AACAUQeLCgIAAai0AAEcNzQEgFEEDRg3MASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyFAwtB4gAhECABIgEgAkYNhAMgAiABayAAKAIAIhRqIRYgASAUa0ECaiEXA0AgAS0AACAUQebCgIAAai0AAEcNzAEgFEECRg3OASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyEAwtB4wAhECABIgEgAkYNgwMgAiABayAAKAIAIhRqIRYgASAUa0EDaiEXA0AgAS0AACAUQenCgIAAai0AAEcNywEgFEEDRg3OASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyDAwsCQCABIgEgAkcNAEHlACEQDIMDCyAAIAFBAWoiASACEKiAgIAAIhANzQEgASEBQdYAIRAM6QILAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgRg0AAkACQAJAIBBBuH9qDgsAAc8BzwHPAc8BzwHPAc8BzwECzwELIAFBAWohAUHSACEQDO0CCyABQQFqIQFB0wAhEAzsAgsgAUEBaiEBQdQAIRAM6wILIAFBAWoiASACRw0AC0HkACEQDIIDC0HkACEQDIEDCwNAAkAgAS0AAEHwwoCAAGotAAAiEEEBRg0AIBBBfmoOA88B0AHRAdIBCyABQQFqIgEgAkcNAAtB5gAhEAyAAwsCQCABIgEgAkYNACABQQFqIQEMAwtB5wAhEAz/AgsDQAJAIAEtAABB8MSAgABqLQAAIhBBAUYNAAJAIBBBfmoOBNIB0wHUAQDVAQsgASEBQdcAIRAM5wILIAFBAWoiASACRw0AC0HoACEQDP4CCwJAIAEiASACRw0AQekAIRAM/gILAkAgAS0AACIQQXZqDhq6AdUB1QG8AdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAcoB1QHVAQDTAQsgAUEBaiEBC0EGIRAM4wILA0ACQCABLQAAQfDGgIAAai0AAEEBRg0AIAEhAQyeAgsgAUEBaiIBIAJHDQALQeoAIRAM+wILAkAgASIBIAJGDQAgAUEBaiEBDAMLQesAIRAM+gILAkAgASIBIAJHDQBB7AAhEAz6AgsgAUEBaiEBDAELAkAgASIBIAJHDQBB7QAhEAz5AgsgAUEBaiEBC0EEIRAM3gILAkAgASIUIAJHDQBB7gAhEAz3AgsgFCEBAkACQAJAIBQtAABB8MiAgABqLQAAQX9qDgfUAdUB1gEAnAIBAtcBCyAUQQFqIQEMCgsgFEEBaiEBDM0BC0EAIRAgAEEANgIcIABBm5KAgAA2AhAgAEEHNgIMIAAgFEEBajYCFAz2AgsCQANAAkAgAS0AAEHwyICAAGotAAAiEEEERg0AAkACQCAQQX9qDgfSAdMB1AHZAQAEAdkBCyABIQFB2gAhEAzgAgsgAUEBaiEBQdwAIRAM3wILIAFBAWoiASACRw0AC0HvACEQDPYCCyABQQFqIQEMywELAkAgASIUIAJHDQBB8AAhEAz1AgsgFC0AAEEvRw3UASAUQQFqIQEMBgsCQCABIhQgAkcNAEHxACEQDPQCCwJAIBQtAAAiAUEvRw0AIBRBAWohAUHdACEQDNsCCyABQXZqIgRBFksN0wFBASAEdEGJgIACcUUN0wEMygILAkAgASIBIAJGDQAgAUEBaiEBQd4AIRAM2gILQfIAIRAM8gILAkAgASIUIAJHDQBB9AAhEAzyAgsgFCEBAkAgFC0AAEHwzICAAGotAABBf2oOA8kClAIA1AELQeEAIRAM2AILAkAgASIUIAJGDQADQAJAIBQtAABB8MqAgABqLQAAIgFBA0YNAAJAIAFBf2oOAssCANUBCyAUIQFB3wAhEAzaAgsgFEEBaiIUIAJHDQALQfMAIRAM8QILQfMAIRAM8AILAkAgASIBIAJGDQAgAEGPgICAADYCCCAAIAE2AgQgASEBQeAAIRAM1wILQfUAIRAM7wILAkAgASIBIAJHDQBB9gAhEAzvAgsgAEGPgICAADYCCCAAIAE2AgQgASEBC0EDIRAM1AILA0AgAS0AAEEgRw3DAiABQQFqIgEgAkcNAAtB9wAhEAzsAgsCQCABIgEgAkcNAEH4ACEQDOwCCyABLQAAQSBHDc4BIAFBAWohAQzvAQsgACABIgEgAhCsgICAACIQDc4BIAEhAQyOAgsCQCABIgQgAkcNAEH6ACEQDOoCCyAELQAAQcwARw3RASAEQQFqIQFBEyEQDM8BCwJAIAEiBCACRw0AQfsAIRAM6QILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEANAIAQtAAAgAUHwzoCAAGotAABHDdABIAFBBUYNzgEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBB+wAhEAzoAgsCQCABIgQgAkcNAEH8ACEQDOgCCwJAAkAgBC0AAEG9f2oODADRAdEB0QHRAdEB0QHRAdEB0QHRAQHRAQsgBEEBaiEBQeYAIRAMzwILIARBAWohAUHnACEQDM4CCwJAIAEiBCACRw0AQf0AIRAM5wILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNzwEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf0AIRAM5wILIABBADYCACAQQQFqIQFBECEQDMwBCwJAIAEiBCACRw0AQf4AIRAM5gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQfbOgIAAai0AAEcNzgEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf4AIRAM5gILIABBADYCACAQQQFqIQFBFiEQDMsBCwJAIAEiBCACRw0AQf8AIRAM5QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQfzOgIAAai0AAEcNzQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf8AIRAM5QILIABBADYCACAQQQFqIQFBBSEQDMoBCwJAIAEiBCACRw0AQYABIRAM5AILIAQtAABB2QBHDcsBIARBAWohAUEIIRAMyQELAkAgASIEIAJHDQBBgQEhEAzjAgsCQAJAIAQtAABBsn9qDgMAzAEBzAELIARBAWohAUHrACEQDMoCCyAEQQFqIQFB7AAhEAzJAgsCQCABIgQgAkcNAEGCASEQDOICCwJAAkAgBC0AAEG4f2oOCADLAcsBywHLAcsBywEBywELIARBAWohAUHqACEQDMkCCyAEQQFqIQFB7QAhEAzIAgsCQCABIgQgAkcNAEGDASEQDOECCyACIARrIAAoAgAiAWohECAEIAFrQQJqIRQCQANAIAQtAAAgAUGAz4CAAGotAABHDckBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgEDYCAEGDASEQDOECC0EAIRAgAEEANgIAIBRBAWohAQzGAQsCQCABIgQgAkcNAEGEASEQDOACCyACIARrIAAoAgAiAWohFCAEIAFrQQRqIRACQANAIAQtAAAgAUGDz4CAAGotAABHDcgBIAFBBEYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGEASEQDOACCyAAQQA2AgAgEEEBaiEBQSMhEAzFAQsCQCABIgQgAkcNAEGFASEQDN8CCwJAAkAgBC0AAEG0f2oOCADIAcgByAHIAcgByAEByAELIARBAWohAUHvACEQDMYCCyAEQQFqIQFB8AAhEAzFAgsCQCABIgQgAkcNAEGGASEQDN4CCyAELQAAQcUARw3FASAEQQFqIQEMgwILAkAgASIEIAJHDQBBhwEhEAzdAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFBiM+AgABqLQAARw3FASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBhwEhEAzdAgsgAEEANgIAIBBBAWohAUEtIRAMwgELAkAgASIEIAJHDQBBiAEhEAzcAgsgAiAEayAAKAIAIgFqIRQgBCABa0EIaiEQAkADQCAELQAAIAFB0M+AgABqLQAARw3EASABQQhGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBiAEhEAzcAgsgAEEANgIAIBBBAWohAUEpIRAMwQELAkAgASIBIAJHDQBBiQEhEAzbAgtBASEQIAEtAABB3wBHDcABIAFBAWohAQyBAgsCQCABIgQgAkcNAEGKASEQDNoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRADQCAELQAAIAFBjM+AgABqLQAARw3BASABQQFGDa8CIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYoBIRAM2QILAkAgASIEIAJHDQBBiwEhEAzZAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBjs+AgABqLQAARw3BASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBiwEhEAzZAgsgAEEANgIAIBBBAWohAUECIRAMvgELAkAgASIEIAJHDQBBjAEhEAzYAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8M+AgABqLQAARw3AASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBjAEhEAzYAgsgAEEANgIAIBBBAWohAUEfIRAMvQELAkAgASIEIAJHDQBBjQEhEAzXAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8s+AgABqLQAARw2/ASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBjQEhEAzXAgsgAEEANgIAIBBBAWohAUEJIRAMvAELAkAgASIEIAJHDQBBjgEhEAzWAgsCQAJAIAQtAABBt39qDgcAvwG/Ab8BvwG/AQG/AQsgBEEBaiEBQfgAIRAMvQILIARBAWohAUH5ACEQDLwCCwJAIAEiBCACRw0AQY8BIRAM1QILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQZHPgIAAai0AAEcNvQEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQY8BIRAM1QILIABBADYCACAQQQFqIQFBGCEQDLoBCwJAIAEiBCACRw0AQZABIRAM1AILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQZfPgIAAai0AAEcNvAEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZABIRAM1AILIABBADYCACAQQQFqIQFBFyEQDLkBCwJAIAEiBCACRw0AQZEBIRAM0wILIAIgBGsgACgCACIBaiEUIAQgAWtBBmohEAJAA0AgBC0AACABQZrPgIAAai0AAEcNuwEgAUEGRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZEBIRAM0wILIABBADYCACAQQQFqIQFBFSEQDLgBCwJAIAEiBCACRw0AQZIBIRAM0gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQaHPgIAAai0AAEcNugEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZIBIRAM0gILIABBADYCACAQQQFqIQFBHiEQDLcBCwJAIAEiBCACRw0AQZMBIRAM0QILIAQtAABBzABHDbgBIARBAWohAUEKIRAMtgELAkAgBCACRw0AQZQBIRAM0AILAkACQCAELQAAQb9/ag4PALkBuQG5AbkBuQG5AbkBuQG5AbkBuQG5AbkBAbkBCyAEQQFqIQFB/gAhEAy3AgsgBEEBaiEBQf8AIRAMtgILAkAgBCACRw0AQZUBIRAMzwILAkACQCAELQAAQb9/ag4DALgBAbgBCyAEQQFqIQFB/QAhEAy2AgsgBEEBaiEEQYABIRAMtQILAkAgBCACRw0AQZYBIRAMzgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQafPgIAAai0AAEcNtgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZYBIRAMzgILIABBADYCACAQQQFqIQFBCyEQDLMBCwJAIAQgAkcNAEGXASEQDM0CCwJAAkACQAJAIAQtAABBU2oOIwC4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBAbgBuAG4AbgBuAECuAG4AbgBA7gBCyAEQQFqIQFB+wAhEAy2AgsgBEEBaiEBQfwAIRAMtQILIARBAWohBEGBASEQDLQCCyAEQQFqIQRBggEhEAyzAgsCQCAEIAJHDQBBmAEhEAzMAgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBqc+AgABqLQAARw20ASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmAEhEAzMAgsgAEEANgIAIBBBAWohAUEZIRAMsQELAkAgBCACRw0AQZkBIRAMywILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQa7PgIAAai0AAEcNswEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZkBIRAMywILIABBADYCACAQQQFqIQFBBiEQDLABCwJAIAQgAkcNAEGaASEQDMoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUG0z4CAAGotAABHDbIBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGaASEQDMoCCyAAQQA2AgAgEEEBaiEBQRwhEAyvAQsCQCAEIAJHDQBBmwEhEAzJAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBts+AgABqLQAARw2xASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmwEhEAzJAgsgAEEANgIAIBBBAWohAUEnIRAMrgELAkAgBCACRw0AQZwBIRAMyAILAkACQCAELQAAQax/ag4CAAGxAQsgBEEBaiEEQYYBIRAMrwILIARBAWohBEGHASEQDK4CCwJAIAQgAkcNAEGdASEQDMcCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUG4z4CAAGotAABHDa8BIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGdASEQDMcCCyAAQQA2AgAgEEEBaiEBQSYhEAysAQsCQCAEIAJHDQBBngEhEAzGAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBus+AgABqLQAARw2uASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBngEhEAzGAgsgAEEANgIAIBBBAWohAUEDIRAMqwELAkAgBCACRw0AQZ8BIRAMxQILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNrQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZ8BIRAMxQILIABBADYCACAQQQFqIQFBDCEQDKoBCwJAIAQgAkcNAEGgASEQDMQCCyACIARrIAAoAgAiAWohFCAEIAFrQQNqIRACQANAIAQtAAAgAUG8z4CAAGotAABHDawBIAFBA0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGgASEQDMQCCyAAQQA2AgAgEEEBaiEBQQ0hEAypAQsCQCAEIAJHDQBBoQEhEAzDAgsCQAJAIAQtAABBun9qDgsArAGsAawBrAGsAawBrAGsAawBAawBCyAEQQFqIQRBiwEhEAyqAgsgBEEBaiEEQYwBIRAMqQILAkAgBCACRw0AQaIBIRAMwgILIAQtAABB0ABHDakBIARBAWohBAzpAQsCQCAEIAJHDQBBowEhEAzBAgsCQAJAIAQtAABBt39qDgcBqgGqAaoBqgGqAQCqAQsgBEEBaiEEQY4BIRAMqAILIARBAWohAUEiIRAMpgELAkAgBCACRw0AQaQBIRAMwAILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQcDPgIAAai0AAEcNqAEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQaQBIRAMwAILIABBADYCACAQQQFqIQFBHSEQDKUBCwJAIAQgAkcNAEGlASEQDL8CCwJAAkAgBC0AAEGuf2oOAwCoAQGoAQsgBEEBaiEEQZABIRAMpgILIARBAWohAUEEIRAMpAELAkAgBCACRw0AQaYBIRAMvgILAkACQAJAAkACQCAELQAAQb9/ag4VAKoBqgGqAaoBqgGqAaoBqgGqAaoBAaoBqgECqgGqAQOqAaoBBKoBCyAEQQFqIQRBiAEhEAyoAgsgBEEBaiEEQYkBIRAMpwILIARBAWohBEGKASEQDKYCCyAEQQFqIQRBjwEhEAylAgsgBEEBaiEEQZEBIRAMpAILAkAgBCACRw0AQacBIRAMvQILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNpQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQacBIRAMvQILIABBADYCACAQQQFqIQFBESEQDKIBCwJAIAQgAkcNAEGoASEQDLwCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHCz4CAAGotAABHDaQBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGoASEQDLwCCyAAQQA2AgAgEEEBaiEBQSwhEAyhAQsCQCAEIAJHDQBBqQEhEAy7AgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBxc+AgABqLQAARw2jASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBqQEhEAy7AgsgAEEANgIAIBBBAWohAUErIRAMoAELAkAgBCACRw0AQaoBIRAMugILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQcrPgIAAai0AAEcNogEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQaoBIRAMugILIABBADYCACAQQQFqIQFBFCEQDJ8BCwJAIAQgAkcNAEGrASEQDLkCCwJAAkACQAJAIAQtAABBvn9qDg8AAQKkAaQBpAGkAaQBpAGkAaQBpAGkAaQBA6QBCyAEQQFqIQRBkwEhEAyiAgsgBEEBaiEEQZQBIRAMoQILIARBAWohBEGVASEQDKACCyAEQQFqIQRBlgEhEAyfAgsCQCAEIAJHDQBBrAEhEAy4AgsgBC0AAEHFAEcNnwEgBEEBaiEEDOABCwJAIAQgAkcNAEGtASEQDLcCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHNz4CAAGotAABHDZ8BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGtASEQDLcCCyAAQQA2AgAgEEEBaiEBQQ4hEAycAQsCQCAEIAJHDQBBrgEhEAy2AgsgBC0AAEHQAEcNnQEgBEEBaiEBQSUhEAybAQsCQCAEIAJHDQBBrwEhEAy1AgsgAiAEayAAKAIAIgFqIRQgBCABa0EIaiEQAkADQCAELQAAIAFB0M+AgABqLQAARw2dASABQQhGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBrwEhEAy1AgsgAEEANgIAIBBBAWohAUEqIRAMmgELAkAgBCACRw0AQbABIRAMtAILAkACQCAELQAAQat/ag4LAJ0BnQGdAZ0BnQGdAZ0BnQGdAQGdAQsgBEEBaiEEQZoBIRAMmwILIARBAWohBEGbASEQDJoCCwJAIAQgAkcNAEGxASEQDLMCCwJAAkAgBC0AAEG/f2oOFACcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAEBnAELIARBAWohBEGZASEQDJoCCyAEQQFqIQRBnAEhEAyZAgsCQCAEIAJHDQBBsgEhEAyyAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFB2c+AgABqLQAARw2aASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBsgEhEAyyAgsgAEEANgIAIBBBAWohAUEhIRAMlwELAkAgBCACRw0AQbMBIRAMsQILIAIgBGsgACgCACIBaiEUIAQgAWtBBmohEAJAA0AgBC0AACABQd3PgIAAai0AAEcNmQEgAUEGRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbMBIRAMsQILIABBADYCACAQQQFqIQFBGiEQDJYBCwJAIAQgAkcNAEG0ASEQDLACCwJAAkACQCAELQAAQbt/ag4RAJoBmgGaAZoBmgGaAZoBmgGaAQGaAZoBmgGaAZoBApoBCyAEQQFqIQRBnQEhEAyYAgsgBEEBaiEEQZ4BIRAMlwILIARBAWohBEGfASEQDJYCCwJAIAQgAkcNAEG1ASEQDK8CCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUHkz4CAAGotAABHDZcBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG1ASEQDK8CCyAAQQA2AgAgEEEBaiEBQSghEAyUAQsCQCAEIAJHDQBBtgEhEAyuAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFB6s+AgABqLQAARw2WASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBtgEhEAyuAgsgAEEANgIAIBBBAWohAUEHIRAMkwELAkAgBCACRw0AQbcBIRAMrQILAkACQCAELQAAQbt/ag4OAJYBlgGWAZYBlgGWAZYBlgGWAZYBlgGWAQGWAQsgBEEBaiEEQaEBIRAMlAILIARBAWohBEGiASEQDJMCCwJAIAQgAkcNAEG4ASEQDKwCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDZQBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG4ASEQDKwCCyAAQQA2AgAgEEEBaiEBQRIhEAyRAQsCQCAEIAJHDQBBuQEhEAyrAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8M+AgABqLQAARw2TASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBuQEhEAyrAgsgAEEANgIAIBBBAWohAUEgIRAMkAELAkAgBCACRw0AQboBIRAMqgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfLPgIAAai0AAEcNkgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQboBIRAMqgILIABBADYCACAQQQFqIQFBDyEQDI8BCwJAIAQgAkcNAEG7ASEQDKkCCwJAAkAgBC0AAEG3f2oOBwCSAZIBkgGSAZIBAZIBCyAEQQFqIQRBpQEhEAyQAgsgBEEBaiEEQaYBIRAMjwILAkAgBCACRw0AQbwBIRAMqAILIAIgBGsgACgCACIBaiEUIAQgAWtBB2ohEAJAA0AgBC0AACABQfTPgIAAai0AAEcNkAEgAUEHRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbwBIRAMqAILIABBADYCACAQQQFqIQFBGyEQDI0BCwJAIAQgAkcNAEG9ASEQDKcCCwJAAkACQCAELQAAQb5/ag4SAJEBkQGRAZEBkQGRAZEBkQGRAQGRAZEBkQGRAZEBkQECkQELIARBAWohBEGkASEQDI8CCyAEQQFqIQRBpwEhEAyOAgsgBEEBaiEEQagBIRAMjQILAkAgBCACRw0AQb4BIRAMpgILIAQtAABBzgBHDY0BIARBAWohBAzPAQsCQCAEIAJHDQBBvwEhEAylAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAELQAAQb9/ag4VAAECA5wBBAUGnAGcAZwBBwgJCgucAQwNDg+cAQsgBEEBaiEBQegAIRAMmgILIARBAWohAUHpACEQDJkCCyAEQQFqIQFB7gAhEAyYAgsgBEEBaiEBQfIAIRAMlwILIARBAWohAUHzACEQDJYCCyAEQQFqIQFB9gAhEAyVAgsgBEEBaiEBQfcAIRAMlAILIARBAWohAUH6ACEQDJMCCyAEQQFqIQRBgwEhEAySAgsgBEEBaiEEQYQBIRAMkQILIARBAWohBEGFASEQDJACCyAEQQFqIQRBkgEhEAyPAgsgBEEBaiEEQZgBIRAMjgILIARBAWohBEGgASEQDI0CCyAEQQFqIQRBowEhEAyMAgsgBEEBaiEEQaoBIRAMiwILAkAgBCACRg0AIABBkICAgAA2AgggACAENgIEQasBIRAMiwILQcABIRAMowILIAAgBSACEKqAgIAAIgENiwEgBSEBDFwLAkAgBiACRg0AIAZBAWohBQyNAQtBwgEhEAyhAgsDQAJAIBAtAABBdmoOBIwBAACPAQALIBBBAWoiECACRw0AC0HDASEQDKACCwJAIAcgAkYNACAAQZGAgIAANgIIIAAgBzYCBCAHIQFBASEQDIcCC0HEASEQDJ8CCwJAIAcgAkcNAEHFASEQDJ8CCwJAAkAgBy0AAEF2ag4EAc4BzgEAzgELIAdBAWohBgyNAQsgB0EBaiEFDIkBCwJAIAcgAkcNAEHGASEQDJ4CCwJAAkAgBy0AAEF2ag4XAY8BjwEBjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BAI8BCyAHQQFqIQcLQbABIRAMhAILAkAgCCACRw0AQcgBIRAMnQILIAgtAABBIEcNjQEgAEEAOwEyIAhBAWohAUGzASEQDIMCCyABIRcCQANAIBciByACRg0BIActAABBUGpB/wFxIhBBCk8NzAECQCAALwEyIhRBmTNLDQAgACAUQQpsIhQ7ATIgEEH//wNzIBRB/v8DcUkNACAHQQFqIRcgACAUIBBqIhA7ATIgEEH//wNxQegHSQ0BCwtBACEQIABBADYCHCAAQcGJgIAANgIQIABBDTYCDCAAIAdBAWo2AhQMnAILQccBIRAMmwILIAAgCCACEK6AgIAAIhBFDcoBIBBBFUcNjAEgAEHIATYCHCAAIAg2AhQgAEHJl4CAADYCECAAQRU2AgxBACEQDJoCCwJAIAkgAkcNAEHMASEQDJoCC0EAIRRBASEXQQEhFkEAIRACQAJAAkACQAJAAkACQAJAAkAgCS0AAEFQag4KlgGVAQABAgMEBQYIlwELQQIhEAwGC0EDIRAMBQtBBCEQDAQLQQUhEAwDC0EGIRAMAgtBByEQDAELQQghEAtBACEXQQAhFkEAIRQMjgELQQkhEEEBIRRBACEXQQAhFgyNAQsCQCAKIAJHDQBBzgEhEAyZAgsgCi0AAEEuRw2OASAKQQFqIQkMygELIAsgAkcNjgFB0AEhEAyXAgsCQCALIAJGDQAgAEGOgICAADYCCCAAIAs2AgRBtwEhEAz+AQtB0QEhEAyWAgsCQCAEIAJHDQBB0gEhEAyWAgsgAiAEayAAKAIAIhBqIRQgBCAQa0EEaiELA0AgBC0AACAQQfzPgIAAai0AAEcNjgEgEEEERg3pASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHSASEQDJUCCyAAIAwgAhCsgICAACIBDY0BIAwhAQy4AQsCQCAEIAJHDQBB1AEhEAyUAgsgAiAEayAAKAIAIhBqIRQgBCAQa0EBaiEMA0AgBC0AACAQQYHQgIAAai0AAEcNjwEgEEEBRg2OASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHUASEQDJMCCwJAIAQgAkcNAEHWASEQDJMCCyACIARrIAAoAgAiEGohFCAEIBBrQQJqIQsDQCAELQAAIBBBg9CAgABqLQAARw2OASAQQQJGDZABIBBBAWohECAEQQFqIgQgAkcNAAsgACAUNgIAQdYBIRAMkgILAkAgBCACRw0AQdcBIRAMkgILAkACQCAELQAAQbt/ag4QAI8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwEBjwELIARBAWohBEG7ASEQDPkBCyAEQQFqIQRBvAEhEAz4AQsCQCAEIAJHDQBB2AEhEAyRAgsgBC0AAEHIAEcNjAEgBEEBaiEEDMQBCwJAIAQgAkYNACAAQZCAgIAANgIIIAAgBDYCBEG+ASEQDPcBC0HZASEQDI8CCwJAIAQgAkcNAEHaASEQDI8CCyAELQAAQcgARg3DASAAQQE6ACgMuQELIABBAjoALyAAIAQgAhCmgICAACIQDY0BQcIBIRAM9AELIAAtAChBf2oOArcBuQG4AQsDQAJAIAQtAABBdmoOBACOAY4BAI4BCyAEQQFqIgQgAkcNAAtB3QEhEAyLAgsgAEEAOgAvIAAtAC1BBHFFDYQCCyAAQQA6AC8gAEEBOgA0IAEhAQyMAQsgEEEVRg3aASAAQQA2AhwgACABNgIUIABBp46AgAA2AhAgAEESNgIMQQAhEAyIAgsCQCAAIBAgAhC0gICAACIEDQAgECEBDIECCwJAIARBFUcNACAAQQM2AhwgACAQNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAyIAgsgAEEANgIcIAAgEDYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAMhwILIBBBFUYN1gEgAEEANgIcIAAgATYCFCAAQdqNgIAANgIQIABBFDYCDEEAIRAMhgILIAAoAgQhFyAAQQA2AgQgECARp2oiFiEBIAAgFyAQIBYgFBsiEBC1gICAACIURQ2NASAAQQc2AhwgACAQNgIUIAAgFDYCDEEAIRAMhQILIAAgAC8BMEGAAXI7ATAgASEBC0EqIRAM6gELIBBBFUYN0QEgAEEANgIcIAAgATYCFCAAQYOMgIAANgIQIABBEzYCDEEAIRAMggILIBBBFUYNzwEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAMgQILIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDI0BCyAAQQw2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAMgAILIBBBFUYNzAEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAM/wELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDIwBCyAAQQ02AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM/gELIBBBFUYNyQEgAEEANgIcIAAgATYCFCAAQcaMgIAANgIQIABBIzYCDEEAIRAM/QELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC5gICAACIQDQAgAUEBaiEBDIsBCyAAQQ42AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM/AELIABBADYCHCAAIAE2AhQgAEHAlYCAADYCECAAQQI2AgxBACEQDPsBCyAQQRVGDcUBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDPoBCyAAQRA2AhwgACABNgIUIAAgEDYCDEEAIRAM+QELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC5gICAACIEDQAgAUEBaiEBDPEBCyAAQRE2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM+AELIBBBFUYNwQEgAEEANgIcIAAgATYCFCAAQcaMgIAANgIQIABBIzYCDEEAIRAM9wELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC5gICAACIQDQAgAUEBaiEBDIgBCyAAQRM2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM9gELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC5gICAACIEDQAgAUEBaiEBDO0BCyAAQRQ2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM9QELIBBBFUYNvQEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAM9AELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDIYBCyAAQRY2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM8wELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC3gICAACIEDQAgAUEBaiEBDOkBCyAAQRc2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM8gELIABBADYCHCAAIAE2AhQgAEHNk4CAADYCECAAQQw2AgxBACEQDPEBC0IBIRELIBBBAWohAQJAIAApAyAiEkL//////////w9WDQAgACASQgSGIBGENwMgIAEhAQyEAQsgAEEANgIcIAAgATYCFCAAQa2JgIAANgIQIABBDDYCDEEAIRAM7wELIABBADYCHCAAIBA2AhQgAEHNk4CAADYCECAAQQw2AgxBACEQDO4BCyAAKAIEIRcgAEEANgIEIBAgEadqIhYhASAAIBcgECAWIBQbIhAQtYCAgAAiFEUNcyAAQQU2AhwgACAQNgIUIAAgFDYCDEEAIRAM7QELIABBADYCHCAAIBA2AhQgAEGqnICAADYCECAAQQ82AgxBACEQDOwBCyAAIBAgAhC0gICAACIBDQEgECEBC0EOIRAM0QELAkAgAUEVRw0AIABBAjYCHCAAIBA2AhQgAEGwmICAADYCECAAQRU2AgxBACEQDOoBCyAAQQA2AhwgACAQNgIUIABBp46AgAA2AhAgAEESNgIMQQAhEAzpAQsgAUEBaiEQAkAgAC8BMCIBQYABcUUNAAJAIAAgECACELuAgIAAIgENACAQIQEMcAsgAUEVRw26ASAAQQU2AhwgACAQNgIUIABB+ZeAgAA2AhAgAEEVNgIMQQAhEAzpAQsCQCABQaAEcUGgBEcNACAALQAtQQJxDQAgAEEANgIcIAAgEDYCFCAAQZaTgIAANgIQIABBBDYCDEEAIRAM6QELIAAgECACEL2AgIAAGiAQIQECQAJAAkACQAJAIAAgECACELOAgIAADhYCAQAEBAQEBAQEBAQEBAQEBAQEBAQDBAsgAEEBOgAuCyAAIAAvATBBwAByOwEwIBAhAQtBJiEQDNEBCyAAQSM2AhwgACAQNgIUIABBpZaAgAA2AhAgAEEVNgIMQQAhEAzpAQsgAEEANgIcIAAgEDYCFCAAQdWLgIAANgIQIABBETYCDEEAIRAM6AELIAAtAC1BAXFFDQFBwwEhEAzOAQsCQCANIAJGDQADQAJAIA0tAABBIEYNACANIQEMxAELIA1BAWoiDSACRw0AC0ElIRAM5wELQSUhEAzmAQsgACgCBCEEIABBADYCBCAAIAQgDRCvgICAACIERQ2tASAAQSY2AhwgACAENgIMIAAgDUEBajYCFEEAIRAM5QELIBBBFUYNqwEgAEEANgIcIAAgATYCFCAAQf2NgIAANgIQIABBHTYCDEEAIRAM5AELIABBJzYCHCAAIAE2AhQgACAQNgIMQQAhEAzjAQsgECEBQQEhFAJAAkACQAJAAkACQAJAIAAtACxBfmoOBwYFBQMBAgAFCyAAIAAvATBBCHI7ATAMAwtBAiEUDAELQQQhFAsgAEEBOgAsIAAgAC8BMCAUcjsBMAsgECEBC0ErIRAMygELIABBADYCHCAAIBA2AhQgAEGrkoCAADYCECAAQQs2AgxBACEQDOIBCyAAQQA2AhwgACABNgIUIABB4Y+AgAA2AhAgAEEKNgIMQQAhEAzhAQsgAEEAOgAsIBAhAQy9AQsgECEBQQEhFAJAAkACQAJAAkAgAC0ALEF7ag4EAwECAAULIAAgAC8BMEEIcjsBMAwDC0ECIRQMAQtBBCEUCyAAQQE6ACwgACAALwEwIBRyOwEwCyAQIQELQSkhEAzFAQsgAEEANgIcIAAgATYCFCAAQfCUgIAANgIQIABBAzYCDEEAIRAM3QELAkAgDi0AAEENRw0AIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDkEBaiEBDHULIABBLDYCHCAAIAE2AgwgACAOQQFqNgIUQQAhEAzdAQsgAC0ALUEBcUUNAUHEASEQDMMBCwJAIA4gAkcNAEEtIRAM3AELAkACQANAAkAgDi0AAEF2ag4EAgAAAwALIA5BAWoiDiACRw0AC0EtIRAM3QELIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDiEBDHQLIABBLDYCHCAAIA42AhQgACABNgIMQQAhEAzcAQsgACgCBCEBIABBADYCBAJAIAAgASAOELGAgIAAIgENACAOQQFqIQEMcwsgAEEsNgIcIAAgATYCDCAAIA5BAWo2AhRBACEQDNsBCyAAKAIEIQQgAEEANgIEIAAgBCAOELGAgIAAIgQNoAEgDiEBDM4BCyAQQSxHDQEgAUEBaiEQQQEhAQJAAkACQAJAAkAgAC0ALEF7ag4EAwECBAALIBAhAQwEC0ECIQEMAQtBBCEBCyAAQQE6ACwgACAALwEwIAFyOwEwIBAhAQwBCyAAIAAvATBBCHI7ATAgECEBC0E5IRAMvwELIABBADoALCABIQELQTQhEAy9AQsgACAALwEwQSByOwEwIAEhAQwCCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQsYCAgAAiBA0AIAEhAQzHAQsgAEE3NgIcIAAgATYCFCAAIAQ2AgxBACEQDNQBCyAAQQg6ACwgASEBC0EwIRAMuQELAkAgAC0AKEEBRg0AIAEhAQwECyAALQAtQQhxRQ2TASABIQEMAwsgAC0AMEEgcQ2UAUHFASEQDLcBCwJAIA8gAkYNAAJAA0ACQCAPLQAAQVBqIgFB/wFxQQpJDQAgDyEBQTUhEAy6AQsgACkDICIRQpmz5syZs+bMGVYNASAAIBFCCn4iETcDICARIAGtQv8BgyISQn+FVg0BIAAgESASfDcDICAPQQFqIg8gAkcNAAtBOSEQDNEBCyAAKAIEIQIgAEEANgIEIAAgAiAPQQFqIgQQsYCAgAAiAg2VASAEIQEMwwELQTkhEAzPAQsCQCAALwEwIgFBCHFFDQAgAC0AKEEBRw0AIAAtAC1BCHFFDZABCyAAIAFB9/sDcUGABHI7ATAgDyEBC0E3IRAMtAELIAAgAC8BMEEQcjsBMAyrAQsgEEEVRg2LASAAQQA2AhwgACABNgIUIABB8I6AgAA2AhAgAEEcNgIMQQAhEAzLAQsgAEHDADYCHCAAIAE2AgwgACANQQFqNgIUQQAhEAzKAQsCQCABLQAAQTpHDQAgACgCBCEQIABBADYCBAJAIAAgECABEK+AgIAAIhANACABQQFqIQEMYwsgAEHDADYCHCAAIBA2AgwgACABQQFqNgIUQQAhEAzKAQsgAEEANgIcIAAgATYCFCAAQbGRgIAANgIQIABBCjYCDEEAIRAMyQELIABBADYCHCAAIAE2AhQgAEGgmYCAADYCECAAQR42AgxBACEQDMgBCyAAQQA2AgALIABBgBI7ASogACAXQQFqIgEgAhCogICAACIQDQEgASEBC0HHACEQDKwBCyAQQRVHDYMBIABB0QA2AhwgACABNgIUIABB45eAgAA2AhAgAEEVNgIMQQAhEAzEAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMXgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAzDAQsgAEEANgIcIAAgFDYCFCAAQcGogIAANgIQIABBBzYCDCAAQQA2AgBBACEQDMIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxdCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDMEBC0EAIRAgAEEANgIcIAAgATYCFCAAQYCRgIAANgIQIABBCTYCDAzAAQsgEEEVRg19IABBADYCHCAAIAE2AhQgAEGUjYCAADYCECAAQSE2AgxBACEQDL8BC0EBIRZBACEXQQAhFEEBIRALIAAgEDoAKyABQQFqIQECQAJAIAAtAC1BEHENAAJAAkACQCAALQAqDgMBAAIECyAWRQ0DDAILIBQNAQwCCyAXRQ0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQrYCAgAAiEA0AIAEhAQxcCyAAQdgANgIcIAAgATYCFCAAIBA2AgxBACEQDL4BCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQytAQsgAEHZADYCHCAAIAE2AhQgACAENgIMQQAhEAy9AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMqwELIABB2gA2AhwgACABNgIUIAAgBDYCDEEAIRAMvAELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKkBCyAAQdwANgIcIAAgATYCFCAAIAQ2AgxBACEQDLsBCwJAIAEtAABBUGoiEEH/AXFBCk8NACAAIBA6ACogAUEBaiEBQc8AIRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAynAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAymAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMRgsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAylAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHSADYCHCAAIBQ2AhQgACABNgIMQQAhEAykAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHTADYCHCAAIBQ2AhQgACABNgIMQQAhEAyjAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMQwsgAEHlADYCHCAAIBQ2AhQgACABNgIMQQAhEAyiAQsgAEEANgIcIAAgFDYCFCAAQcOPgIAANgIQIABBBzYCDEEAIRAMoQELIABBADYCHCAAIAE2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKABC0EAIRAgAEEANgIcIAAgFDYCFCAAQYycgIAANgIQIABBBzYCDAyfAQsgAEEANgIcIAAgFDYCFCAAQYycgIAANgIQIABBBzYCDEEAIRAMngELIABBADYCHCAAIBQ2AhQgAEH+kYCAADYCECAAQQc2AgxBACEQDJ0BCyAAQQA2AhwgACABNgIUIABBjpuAgAA2AhAgAEEGNgIMQQAhEAycAQsgEEEVRg1XIABBADYCHCAAIAE2AhQgAEHMjoCAADYCECAAQSA2AgxBACEQDJsBCyAAQQA2AgAgEEEBaiEBQSQhEAsgACAQOgApIAAoAgQhECAAQQA2AgQgACAQIAEQq4CAgAAiEA1UIAEhAQw+CyAAQQA2AgALQQAhECAAQQA2AhwgACAENgIUIABB8ZuAgAA2AhAgAEEGNgIMDJcBCyABQRVGDVAgAEEANgIcIAAgBTYCFCAAQfCMgIAANgIQIABBGzYCDEEAIRAMlgELIAAoAgQhBSAAQQA2AgQgACAFIBAQqYCAgAAiBQ0BIBBBAWohBQtBrQEhEAx7CyAAQcEBNgIcIAAgBTYCDCAAIBBBAWo2AhRBACEQDJMBCyAAKAIEIQYgAEEANgIEIAAgBiAQEKmAgIAAIgYNASAQQQFqIQYLQa4BIRAMeAsgAEHCATYCHCAAIAY2AgwgACAQQQFqNgIUQQAhEAyQAQsgAEEANgIcIAAgBzYCFCAAQZeLgIAANgIQIABBDTYCDEEAIRAMjwELIABBADYCHCAAIAg2AhQgAEHjkICAADYCECAAQQk2AgxBACEQDI4BCyAAQQA2AhwgACAINgIUIABBlI2AgAA2AhAgAEEhNgIMQQAhEAyNAQtBASEWQQAhF0EAIRRBASEQCyAAIBA6ACsgCUEBaiEIAkACQCAALQAtQRBxDQACQAJAAkAgAC0AKg4DAQACBAsgFkUNAwwCCyAUDQEMAgsgF0UNAQsgACgCBCEQIABBADYCBCAAIBAgCBCtgICAACIQRQ09IABByQE2AhwgACAINgIUIAAgEDYCDEEAIRAMjAELIAAoAgQhBCAAQQA2AgQgACAEIAgQrYCAgAAiBEUNdiAAQcoBNgIcIAAgCDYCFCAAIAQ2AgxBACEQDIsBCyAAKAIEIQQgAEEANgIEIAAgBCAJEK2AgIAAIgRFDXQgAEHLATYCHCAAIAk2AhQgACAENgIMQQAhEAyKAQsgACgCBCEEIABBADYCBCAAIAQgChCtgICAACIERQ1yIABBzQE2AhwgACAKNgIUIAAgBDYCDEEAIRAMiQELAkAgCy0AAEFQaiIQQf8BcUEKTw0AIAAgEDoAKiALQQFqIQpBtgEhEAxwCyAAKAIEIQQgAEEANgIEIAAgBCALEK2AgIAAIgRFDXAgAEHPATYCHCAAIAs2AhQgACAENgIMQQAhEAyIAQsgAEEANgIcIAAgBDYCFCAAQZCzgIAANgIQIABBCDYCDCAAQQA2AgBBACEQDIcBCyABQRVGDT8gAEEANgIcIAAgDDYCFCAAQcyOgIAANgIQIABBIDYCDEEAIRAMhgELIABBgQQ7ASggACgCBCEQIABCADcDACAAIBAgDEEBaiIMEKuAgIAAIhBFDTggAEHTATYCHCAAIAw2AhQgACAQNgIMQQAhEAyFAQsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQdibgIAANgIQIABBCDYCDAyDAQsgACgCBCEQIABCADcDACAAIBAgC0EBaiILEKuAgIAAIhANAUHGASEQDGkLIABBAjoAKAxVCyAAQdUBNgIcIAAgCzYCFCAAIBA2AgxBACEQDIABCyAQQRVGDTcgAEEANgIcIAAgBDYCFCAAQaSMgIAANgIQIABBEDYCDEEAIRAMfwsgAC0ANEEBRw00IAAgBCACELyAgIAAIhBFDTQgEEEVRw01IABB3AE2AhwgACAENgIUIABB1ZaAgAA2AhAgAEEVNgIMQQAhEAx+C0EAIRAgAEEANgIcIABBr4uAgAA2AhAgAEECNgIMIAAgFEEBajYCFAx9C0EAIRAMYwtBAiEQDGILQQ0hEAxhC0EPIRAMYAtBJSEQDF8LQRMhEAxeC0EVIRAMXQtBFiEQDFwLQRchEAxbC0EYIRAMWgtBGSEQDFkLQRohEAxYC0EbIRAMVwtBHCEQDFYLQR0hEAxVC0EfIRAMVAtBISEQDFMLQSMhEAxSC0HGACEQDFELQS4hEAxQC0EvIRAMTwtBOyEQDE4LQT0hEAxNC0HIACEQDEwLQckAIRAMSwtBywAhEAxKC0HMACEQDEkLQc4AIRAMSAtB0QAhEAxHC0HVACEQDEYLQdgAIRAMRQtB2QAhEAxEC0HbACEQDEMLQeQAIRAMQgtB5QAhEAxBC0HxACEQDEALQfQAIRAMPwtBjQEhEAw+C0GXASEQDD0LQakBIRAMPAtBrAEhEAw7C0HAASEQDDoLQbkBIRAMOQtBrwEhEAw4C0GxASEQDDcLQbIBIRAMNgtBtAEhEAw1C0G1ASEQDDQLQboBIRAMMwtBvQEhEAwyC0G/ASEQDDELQcEBIRAMMAsgAEEANgIcIAAgBDYCFCAAQemLgIAANgIQIABBHzYCDEEAIRAMSAsgAEHbATYCHCAAIAQ2AhQgAEH6loCAADYCECAAQRU2AgxBACEQDEcLIABB+AA2AhwgACAMNgIUIABBypiAgAA2AhAgAEEVNgIMQQAhEAxGCyAAQdEANgIcIAAgBTYCFCAAQbCXgIAANgIQIABBFTYCDEEAIRAMRQsgAEH5ADYCHCAAIAE2AhQgACAQNgIMQQAhEAxECyAAQfgANgIcIAAgATYCFCAAQcqYgIAANgIQIABBFTYCDEEAIRAMQwsgAEHkADYCHCAAIAE2AhQgAEHjl4CAADYCECAAQRU2AgxBACEQDEILIABB1wA2AhwgACABNgIUIABByZeAgAA2AhAgAEEVNgIMQQAhEAxBCyAAQQA2AhwgACABNgIUIABBuY2AgAA2AhAgAEEaNgIMQQAhEAxACyAAQcIANgIcIAAgATYCFCAAQeOYgIAANgIQIABBFTYCDEEAIRAMPwsgAEEANgIEIAAgDyAPELGAgIAAIgRFDQEgAEE6NgIcIAAgBDYCDCAAIA9BAWo2AhRBACEQDD4LIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCxgICAACIERQ0AIABBOzYCHCAAIAQ2AgwgACABQQFqNgIUQQAhEAw+CyABQQFqIQEMLQsgD0EBaiEBDC0LIABBADYCHCAAIA82AhQgAEHkkoCAADYCECAAQQQ2AgxBACEQDDsLIABBNjYCHCAAIAQ2AhQgACACNgIMQQAhEAw6CyAAQS42AhwgACAONgIUIAAgBDYCDEEAIRAMOQsgAEHQADYCHCAAIAE2AhQgAEGRmICAADYCECAAQRU2AgxBACEQDDgLIA1BAWohAQwsCyAAQRU2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAw2CyAAQRs2AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAw1CyAAQQ82AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAw0CyAAQQs2AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAwzCyAAQRo2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAwyCyAAQQs2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAwxCyAAQQo2AhwgACABNgIUIABB5JaAgAA2AhAgAEEVNgIMQQAhEAwwCyAAQR42AhwgACABNgIUIABB+ZeAgAA2AhAgAEEVNgIMQQAhEAwvCyAAQQA2AhwgACAQNgIUIABB2o2AgAA2AhAgAEEUNgIMQQAhEAwuCyAAQQQ2AhwgACABNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAwtCyAAQQA2AgAgC0EBaiELC0G4ASEQDBILIABBADYCACAQQQFqIQFB9QAhEAwRCyABIQECQCAALQApQQVHDQBB4wAhEAwRC0HiACEQDBALQQAhECAAQQA2AhwgAEHkkYCAADYCECAAQQc2AgwgACAUQQFqNgIUDCgLIABBADYCACAXQQFqIQFBwAAhEAwOC0EBIQELIAAgAToALCAAQQA2AgAgF0EBaiEBC0EoIRAMCwsgASEBC0E4IRAMCQsCQCABIg8gAkYNAANAAkAgDy0AAEGAvoCAAGotAAAiAUEBRg0AIAFBAkcNAyAPQQFqIQEMBAsgD0EBaiIPIAJHDQALQT4hEAwiC0E+IRAMIQsgAEEAOgAsIA8hAQwBC0ELIRAMBgtBOiEQDAULIAFBAWohAUEtIRAMBAsgACABOgAsIABBADYCACAWQQFqIQFBDCEQDAMLIABBADYCACAXQQFqIQFBCiEQDAILIABBADYCAAsgAEEAOgAsIA0hAUEJIRAMAAsLQQAhECAAQQA2AhwgACALNgIUIABBzZCAgAA2AhAgAEEJNgIMDBcLQQAhECAAQQA2AhwgACAKNgIUIABB6YqAgAA2AhAgAEEJNgIMDBYLQQAhECAAQQA2AhwgACAJNgIUIABBt5CAgAA2AhAgAEEJNgIMDBULQQAhECAAQQA2AhwgACAINgIUIABBnJGAgAA2AhAgAEEJNgIMDBQLQQAhECAAQQA2AhwgACABNgIUIABBzZCAgAA2AhAgAEEJNgIMDBMLQQAhECAAQQA2AhwgACABNgIUIABB6YqAgAA2AhAgAEEJNgIMDBILQQAhECAAQQA2AhwgACABNgIUIABBt5CAgAA2AhAgAEEJNgIMDBELQQAhECAAQQA2AhwgACABNgIUIABBnJGAgAA2AhAgAEEJNgIMDBALQQAhECAAQQA2AhwgACABNgIUIABBl5WAgAA2AhAgAEEPNgIMDA8LQQAhECAAQQA2AhwgACABNgIUIABBl5WAgAA2AhAgAEEPNgIMDA4LQQAhECAAQQA2AhwgACABNgIUIABBwJKAgAA2AhAgAEELNgIMDA0LQQAhECAAQQA2AhwgACABNgIUIABBlYmAgAA2AhAgAEELNgIMDAwLQQAhECAAQQA2AhwgACABNgIUIABB4Y+AgAA2AhAgAEEKNgIMDAsLQQAhECAAQQA2AhwgACABNgIUIABB+4+AgAA2AhAgAEEKNgIMDAoLQQAhECAAQQA2AhwgACABNgIUIABB8ZmAgAA2AhAgAEECNgIMDAkLQQAhECAAQQA2AhwgACABNgIUIABBxJSAgAA2AhAgAEECNgIMDAgLQQAhECAAQQA2AhwgACABNgIUIABB8pWAgAA2AhAgAEECNgIMDAcLIABBAjYCHCAAIAE2AhQgAEGcmoCAADYCECAAQRY2AgxBACEQDAYLQQEhEAwFC0HUACEQIAEiBCACRg0EIANBCGogACAEIAJB2MKAgABBChDFgICAACADKAIMIQQgAygCCA4DAQQCAAsQyoCAgAAACyAAQQA2AhwgAEG1moCAADYCECAAQRc2AgwgACAEQQFqNgIUQQAhEAwCCyAAQQA2AhwgACAENgIUIABBypqAgAA2AhAgAEEJNgIMQQAhEAwBCwJAIAEiBCACRw0AQSIhEAwBCyAAQYmAgIAANgIIIAAgBDYCBEEhIRALIANBEGokgICAgAAgEAuvAQECfyABKAIAIQYCQAJAIAIgA0YNACAEIAZqIQQgBiADaiACayEHIAIgBkF/cyAFaiIGaiEFA0ACQCACLQAAIAQtAABGDQBBAiEEDAMLAkAgBg0AQQAhBCAFIQIMAwsgBkF/aiEGIARBAWohBCACQQFqIgIgA0cNAAsgByEGIAMhAgsgAEEBNgIAIAEgBjYCACAAIAI2AgQPCyABQQA2AgAgACAENgIAIAAgAjYCBAsKACAAEMeAgIAAC/I2AQt/I4CAgIAAQRBrIgEkgICAgAACQEEAKAKg0ICAAA0AQQAQy4CAgABBgNSEgABrIgJB2QBJDQBBACEDAkBBACgC4NOAgAAiBA0AQQBCfzcC7NOAgABBAEKAgISAgIDAADcC5NOAgABBACABQQhqQXBxQdiq1aoFcyIENgLg04CAAEEAQQA2AvTTgIAAQQBBADYCxNOAgAALQQAgAjYCzNOAgABBAEGA1ISAADYCyNOAgABBAEGA1ISAADYCmNCAgABBACAENgKs0ICAAEEAQX82AqjQgIAAA0AgA0HE0ICAAGogA0G40ICAAGoiBDYCACAEIANBsNCAgABqIgU2AgAgA0G80ICAAGogBTYCACADQczQgIAAaiADQcDQgIAAaiIFNgIAIAUgBDYCACADQdTQgIAAaiADQcjQgIAAaiIENgIAIAQgBTYCACADQdDQgIAAaiAENgIAIANBIGoiA0GAAkcNAAtBgNSEgABBeEGA1ISAAGtBD3FBAEGA1ISAAEEIakEPcRsiA2oiBEEEaiACQUhqIgUgA2siA0EBcjYCAEEAQQAoAvDTgIAANgKk0ICAAEEAIAM2ApTQgIAAQQAgBDYCoNCAgABBgNSEgAAgBWpBODYCBAsCQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAUsNAAJAQQAoAojQgIAAIgZBECAAQRNqQXBxIABBC0kbIgJBA3YiBHYiA0EDcUUNAAJAAkAgA0EBcSAEckEBcyIFQQN0IgRBsNCAgABqIgMgBEG40ICAAGooAgAiBCgCCCICRw0AQQAgBkF+IAV3cTYCiNCAgAAMAQsgAyACNgIIIAIgAzYCDAsgBEEIaiEDIAQgBUEDdCIFQQNyNgIEIAQgBWoiBCAEKAIEQQFyNgIEDAwLIAJBACgCkNCAgAAiB00NAQJAIANFDQACQAJAIAMgBHRBAiAEdCIDQQAgA2tycSIDQQAgA2txQX9qIgMgA0EMdkEQcSIDdiIEQQV2QQhxIgUgA3IgBCAFdiIDQQJ2QQRxIgRyIAMgBHYiA0EBdkECcSIEciADIAR2IgNBAXZBAXEiBHIgAyAEdmoiBEEDdCIDQbDQgIAAaiIFIANBuNCAgABqKAIAIgMoAggiAEcNAEEAIAZBfiAEd3EiBjYCiNCAgAAMAQsgBSAANgIIIAAgBTYCDAsgAyACQQNyNgIEIAMgBEEDdCIEaiAEIAJrIgU2AgAgAyACaiIAIAVBAXI2AgQCQCAHRQ0AIAdBeHFBsNCAgABqIQJBACgCnNCAgAAhBAJAAkAgBkEBIAdBA3Z0IghxDQBBACAGIAhyNgKI0ICAACACIQgMAQsgAigCCCEICyAIIAQ2AgwgAiAENgIIIAQgAjYCDCAEIAg2AggLIANBCGohA0EAIAA2ApzQgIAAQQAgBTYCkNCAgAAMDAtBACgCjNCAgAAiCUUNASAJQQAgCWtxQX9qIgMgA0EMdkEQcSIDdiIEQQV2QQhxIgUgA3IgBCAFdiIDQQJ2QQRxIgRyIAMgBHYiA0EBdkECcSIEciADIAR2IgNBAXZBAXEiBHIgAyAEdmpBAnRBuNKAgABqKAIAIgAoAgRBeHEgAmshBCAAIQUCQANAAkAgBSgCECIDDQAgBUEUaigCACIDRQ0CCyADKAIEQXhxIAJrIgUgBCAFIARJIgUbIQQgAyAAIAUbIQAgAyEFDAALCyAAKAIYIQoCQCAAKAIMIgggAEYNACAAKAIIIgNBACgCmNCAgABJGiAIIAM2AgggAyAINgIMDAsLAkAgAEEUaiIFKAIAIgMNACAAKAIQIgNFDQMgAEEQaiEFCwNAIAUhCyADIghBFGoiBSgCACIDDQAgCEEQaiEFIAgoAhAiAw0ACyALQQA2AgAMCgtBfyECIABBv39LDQAgAEETaiIDQXBxIQJBACgCjNCAgAAiB0UNAEEAIQsCQCACQYACSQ0AQR8hCyACQf///wdLDQAgA0EIdiIDIANBgP4/akEQdkEIcSIDdCIEIARBgOAfakEQdkEEcSIEdCIFIAVBgIAPakEQdkECcSIFdEEPdiADIARyIAVyayIDQQF0IAIgA0EVanZBAXFyQRxqIQsLQQAgAmshBAJAAkACQAJAIAtBAnRBuNKAgABqKAIAIgUNAEEAIQNBACEIDAELQQAhAyACQQBBGSALQQF2ayALQR9GG3QhAEEAIQgDQAJAIAUoAgRBeHEgAmsiBiAETw0AIAYhBCAFIQggBg0AQQAhBCAFIQggBSEDDAMLIAMgBUEUaigCACIGIAYgBSAAQR12QQRxakEQaigCACIFRhsgAyAGGyEDIABBAXQhACAFDQALCwJAIAMgCHINAEEAIQhBAiALdCIDQQAgA2tyIAdxIgNFDQMgA0EAIANrcUF/aiIDIANBDHZBEHEiA3YiBUEFdkEIcSIAIANyIAUgAHYiA0ECdkEEcSIFciADIAV2IgNBAXZBAnEiBXIgAyAFdiIDQQF2QQFxIgVyIAMgBXZqQQJ0QbjSgIAAaigCACEDCyADRQ0BCwNAIAMoAgRBeHEgAmsiBiAESSEAAkAgAygCECIFDQAgA0EUaigCACEFCyAGIAQgABshBCADIAggABshCCAFIQMgBQ0ACwsgCEUNACAEQQAoApDQgIAAIAJrTw0AIAgoAhghCwJAIAgoAgwiACAIRg0AIAgoAggiA0EAKAKY0ICAAEkaIAAgAzYCCCADIAA2AgwMCQsCQCAIQRRqIgUoAgAiAw0AIAgoAhAiA0UNAyAIQRBqIQULA0AgBSEGIAMiAEEUaiIFKAIAIgMNACAAQRBqIQUgACgCECIDDQALIAZBADYCAAwICwJAQQAoApDQgIAAIgMgAkkNAEEAKAKc0ICAACEEAkACQCADIAJrIgVBEEkNACAEIAJqIgAgBUEBcjYCBEEAIAU2ApDQgIAAQQAgADYCnNCAgAAgBCADaiAFNgIAIAQgAkEDcjYCBAwBCyAEIANBA3I2AgQgBCADaiIDIAMoAgRBAXI2AgRBAEEANgKc0ICAAEEAQQA2ApDQgIAACyAEQQhqIQMMCgsCQEEAKAKU0ICAACIAIAJNDQBBACgCoNCAgAAiAyACaiIEIAAgAmsiBUEBcjYCBEEAIAU2ApTQgIAAQQAgBDYCoNCAgAAgAyACQQNyNgIEIANBCGohAwwKCwJAAkBBACgC4NOAgABFDQBBACgC6NOAgAAhBAwBC0EAQn83AuzTgIAAQQBCgICEgICAwAA3AuTTgIAAQQAgAUEMakFwcUHYqtWqBXM2AuDTgIAAQQBBADYC9NOAgABBAEEANgLE04CAAEGAgAQhBAtBACEDAkAgBCACQccAaiIHaiIGQQAgBGsiC3EiCCACSw0AQQBBMDYC+NOAgAAMCgsCQEEAKALA04CAACIDRQ0AAkBBACgCuNOAgAAiBCAIaiIFIARNDQAgBSADTQ0BC0EAIQNBAEEwNgL404CAAAwKC0EALQDE04CAAEEEcQ0EAkACQAJAQQAoAqDQgIAAIgRFDQBByNOAgAAhAwNAAkAgAygCACIFIARLDQAgBSADKAIEaiAESw0DCyADKAIIIgMNAAsLQQAQy4CAgAAiAEF/Rg0FIAghBgJAQQAoAuTTgIAAIgNBf2oiBCAAcUUNACAIIABrIAQgAGpBACADa3FqIQYLIAYgAk0NBSAGQf7///8HSw0FAkBBACgCwNOAgAAiA0UNAEEAKAK404CAACIEIAZqIgUgBE0NBiAFIANLDQYLIAYQy4CAgAAiAyAARw0BDAcLIAYgAGsgC3EiBkH+////B0sNBCAGEMuAgIAAIgAgAygCACADKAIEakYNAyAAIQMLAkAgA0F/Rg0AIAJByABqIAZNDQACQCAHIAZrQQAoAujTgIAAIgRqQQAgBGtxIgRB/v///wdNDQAgAyEADAcLAkAgBBDLgICAAEF/Rg0AIAQgBmohBiADIQAMBwtBACAGaxDLgICAABoMBAsgAyEAIANBf0cNBQwDC0EAIQgMBwtBACEADAULIABBf0cNAgtBAEEAKALE04CAAEEEcjYCxNOAgAALIAhB/v///wdLDQEgCBDLgICAACEAQQAQy4CAgAAhAyAAQX9GDQEgA0F/Rg0BIAAgA08NASADIABrIgYgAkE4ak0NAQtBAEEAKAK404CAACAGaiIDNgK404CAAAJAIANBACgCvNOAgABNDQBBACADNgK804CAAAsCQAJAAkACQEEAKAKg0ICAACIERQ0AQcjTgIAAIQMDQCAAIAMoAgAiBSADKAIEIghqRg0CIAMoAggiAw0ADAMLCwJAAkBBACgCmNCAgAAiA0UNACAAIANPDQELQQAgADYCmNCAgAALQQAhA0EAIAY2AszTgIAAQQAgADYCyNOAgABBAEF/NgKo0ICAAEEAQQAoAuDTgIAANgKs0ICAAEEAQQA2AtTTgIAAA0AgA0HE0ICAAGogA0G40ICAAGoiBDYCACAEIANBsNCAgABqIgU2AgAgA0G80ICAAGogBTYCACADQczQgIAAaiADQcDQgIAAaiIFNgIAIAUgBDYCACADQdTQgIAAaiADQcjQgIAAaiIENgIAIAQgBTYCACADQdDQgIAAaiAENgIAIANBIGoiA0GAAkcNAAsgAEF4IABrQQ9xQQAgAEEIakEPcRsiA2oiBCAGQUhqIgUgA2siA0EBcjYCBEEAQQAoAvDTgIAANgKk0ICAAEEAIAM2ApTQgIAAQQAgBDYCoNCAgAAgACAFakE4NgIEDAILIAMtAAxBCHENACAEIAVJDQAgBCAATw0AIARBeCAEa0EPcUEAIARBCGpBD3EbIgVqIgBBACgClNCAgAAgBmoiCyAFayIFQQFyNgIEIAMgCCAGajYCBEEAQQAoAvDTgIAANgKk0ICAAEEAIAU2ApTQgIAAQQAgADYCoNCAgAAgBCALakE4NgIEDAELAkAgAEEAKAKY0ICAACIITw0AQQAgADYCmNCAgAAgACEICyAAIAZqIQVByNOAgAAhAwJAAkACQAJAAkACQAJAA0AgAygCACAFRg0BIAMoAggiAw0ADAILCyADLQAMQQhxRQ0BC0HI04CAACEDA0ACQCADKAIAIgUgBEsNACAFIAMoAgRqIgUgBEsNAwsgAygCCCEDDAALCyADIAA2AgAgAyADKAIEIAZqNgIEIABBeCAAa0EPcUEAIABBCGpBD3EbaiILIAJBA3I2AgQgBUF4IAVrQQ9xQQAgBUEIakEPcRtqIgYgCyACaiICayEDAkAgBiAERw0AQQAgAjYCoNCAgABBAEEAKAKU0ICAACADaiIDNgKU0ICAACACIANBAXI2AgQMAwsCQCAGQQAoApzQgIAARw0AQQAgAjYCnNCAgABBAEEAKAKQ0ICAACADaiIDNgKQ0ICAACACIANBAXI2AgQgAiADaiADNgIADAMLAkAgBigCBCIEQQNxQQFHDQAgBEF4cSEHAkACQCAEQf8BSw0AIAYoAggiBSAEQQN2IghBA3RBsNCAgABqIgBGGgJAIAYoAgwiBCAFRw0AQQBBACgCiNCAgABBfiAId3E2AojQgIAADAILIAQgAEYaIAQgBTYCCCAFIAQ2AgwMAQsgBigCGCEJAkACQCAGKAIMIgAgBkYNACAGKAIIIgQgCEkaIAAgBDYCCCAEIAA2AgwMAQsCQCAGQRRqIgQoAgAiBQ0AIAZBEGoiBCgCACIFDQBBACEADAELA0AgBCEIIAUiAEEUaiIEKAIAIgUNACAAQRBqIQQgACgCECIFDQALIAhBADYCAAsgCUUNAAJAAkAgBiAGKAIcIgVBAnRBuNKAgABqIgQoAgBHDQAgBCAANgIAIAANAUEAQQAoAozQgIAAQX4gBXdxNgKM0ICAAAwCCyAJQRBBFCAJKAIQIAZGG2ogADYCACAARQ0BCyAAIAk2AhgCQCAGKAIQIgRFDQAgACAENgIQIAQgADYCGAsgBigCFCIERQ0AIABBFGogBDYCACAEIAA2AhgLIAcgA2ohAyAGIAdqIgYoAgQhBAsgBiAEQX5xNgIEIAIgA2ogAzYCACACIANBAXI2AgQCQCADQf8BSw0AIANBeHFBsNCAgABqIQQCQAJAQQAoAojQgIAAIgVBASADQQN2dCIDcQ0AQQAgBSADcjYCiNCAgAAgBCEDDAELIAQoAgghAwsgAyACNgIMIAQgAjYCCCACIAQ2AgwgAiADNgIIDAMLQR8hBAJAIANB////B0sNACADQQh2IgQgBEGA/j9qQRB2QQhxIgR0IgUgBUGA4B9qQRB2QQRxIgV0IgAgAEGAgA9qQRB2QQJxIgB0QQ92IAQgBXIgAHJrIgRBAXQgAyAEQRVqdkEBcXJBHGohBAsgAiAENgIcIAJCADcCECAEQQJ0QbjSgIAAaiEFAkBBACgCjNCAgAAiAEEBIAR0IghxDQAgBSACNgIAQQAgACAIcjYCjNCAgAAgAiAFNgIYIAIgAjYCCCACIAI2AgwMAwsgA0EAQRkgBEEBdmsgBEEfRht0IQQgBSgCACEAA0AgACIFKAIEQXhxIANGDQIgBEEddiEAIARBAXQhBCAFIABBBHFqQRBqIggoAgAiAA0ACyAIIAI2AgAgAiAFNgIYIAIgAjYCDCACIAI2AggMAgsgAEF4IABrQQ9xQQAgAEEIakEPcRsiA2oiCyAGQUhqIgggA2siA0EBcjYCBCAAIAhqQTg2AgQgBCAFQTcgBWtBD3FBACAFQUlqQQ9xG2pBQWoiCCAIIARBEGpJGyIIQSM2AgRBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAs2AqDQgIAAIAhBEGpBACkC0NOAgAA3AgAgCEEAKQLI04CAADcCCEEAIAhBCGo2AtDTgIAAQQAgBjYCzNOAgABBACAANgLI04CAAEEAQQA2AtTTgIAAIAhBJGohAwNAIANBBzYCACADQQRqIgMgBUkNAAsgCCAERg0DIAggCCgCBEF+cTYCBCAIIAggBGsiADYCACAEIABBAXI2AgQCQCAAQf8BSw0AIABBeHFBsNCAgABqIQMCQAJAQQAoAojQgIAAIgVBASAAQQN2dCIAcQ0AQQAgBSAAcjYCiNCAgAAgAyEFDAELIAMoAgghBQsgBSAENgIMIAMgBDYCCCAEIAM2AgwgBCAFNgIIDAQLQR8hAwJAIABB////B0sNACAAQQh2IgMgA0GA/j9qQRB2QQhxIgN0IgUgBUGA4B9qQRB2QQRxIgV0IgggCEGAgA9qQRB2QQJxIgh0QQ92IAMgBXIgCHJrIgNBAXQgACADQRVqdkEBcXJBHGohAwsgBCADNgIcIARCADcCECADQQJ0QbjSgIAAaiEFAkBBACgCjNCAgAAiCEEBIAN0IgZxDQAgBSAENgIAQQAgCCAGcjYCjNCAgAAgBCAFNgIYIAQgBDYCCCAEIAQ2AgwMBAsgAEEAQRkgA0EBdmsgA0EfRht0IQMgBSgCACEIA0AgCCIFKAIEQXhxIABGDQMgA0EddiEIIANBAXQhAyAFIAhBBHFqQRBqIgYoAgAiCA0ACyAGIAQ2AgAgBCAFNgIYIAQgBDYCDCAEIAQ2AggMAwsgBSgCCCIDIAI2AgwgBSACNgIIIAJBADYCGCACIAU2AgwgAiADNgIICyALQQhqIQMMBQsgBSgCCCIDIAQ2AgwgBSAENgIIIARBADYCGCAEIAU2AgwgBCADNgIIC0EAKAKU0ICAACIDIAJNDQBBACgCoNCAgAAiBCACaiIFIAMgAmsiA0EBcjYCBEEAIAM2ApTQgIAAQQAgBTYCoNCAgAAgBCACQQNyNgIEIARBCGohAwwDC0EAIQNBAEEwNgL404CAAAwCCwJAIAtFDQACQAJAIAggCCgCHCIFQQJ0QbjSgIAAaiIDKAIARw0AIAMgADYCACAADQFBACAHQX4gBXdxIgc2AozQgIAADAILIAtBEEEUIAsoAhAgCEYbaiAANgIAIABFDQELIAAgCzYCGAJAIAgoAhAiA0UNACAAIAM2AhAgAyAANgIYCyAIQRRqKAIAIgNFDQAgAEEUaiADNgIAIAMgADYCGAsCQAJAIARBD0sNACAIIAQgAmoiA0EDcjYCBCAIIANqIgMgAygCBEEBcjYCBAwBCyAIIAJqIgAgBEEBcjYCBCAIIAJBA3I2AgQgACAEaiAENgIAAkAgBEH/AUsNACAEQXhxQbDQgIAAaiEDAkACQEEAKAKI0ICAACIFQQEgBEEDdnQiBHENAEEAIAUgBHI2AojQgIAAIAMhBAwBCyADKAIIIQQLIAQgADYCDCADIAA2AgggACADNgIMIAAgBDYCCAwBC0EfIQMCQCAEQf///wdLDQAgBEEIdiIDIANBgP4/akEQdkEIcSIDdCIFIAVBgOAfakEQdkEEcSIFdCICIAJBgIAPakEQdkECcSICdEEPdiADIAVyIAJyayIDQQF0IAQgA0EVanZBAXFyQRxqIQMLIAAgAzYCHCAAQgA3AhAgA0ECdEG40oCAAGohBQJAIAdBASADdCICcQ0AIAUgADYCAEEAIAcgAnI2AozQgIAAIAAgBTYCGCAAIAA2AgggACAANgIMDAELIARBAEEZIANBAXZrIANBH0YbdCEDIAUoAgAhAgJAA0AgAiIFKAIEQXhxIARGDQEgA0EddiECIANBAXQhAyAFIAJBBHFqQRBqIgYoAgAiAg0ACyAGIAA2AgAgACAFNgIYIAAgADYCDCAAIAA2AggMAQsgBSgCCCIDIAA2AgwgBSAANgIIIABBADYCGCAAIAU2AgwgACADNgIICyAIQQhqIQMMAQsCQCAKRQ0AAkACQCAAIAAoAhwiBUECdEG40oCAAGoiAygCAEcNACADIAg2AgAgCA0BQQAgCUF+IAV3cTYCjNCAgAAMAgsgCkEQQRQgCigCECAARhtqIAg2AgAgCEUNAQsgCCAKNgIYAkAgACgCECIDRQ0AIAggAzYCECADIAg2AhgLIABBFGooAgAiA0UNACAIQRRqIAM2AgAgAyAINgIYCwJAAkAgBEEPSw0AIAAgBCACaiIDQQNyNgIEIAAgA2oiAyADKAIEQQFyNgIEDAELIAAgAmoiBSAEQQFyNgIEIAAgAkEDcjYCBCAFIARqIAQ2AgACQCAHRQ0AIAdBeHFBsNCAgABqIQJBACgCnNCAgAAhAwJAAkBBASAHQQN2dCIIIAZxDQBBACAIIAZyNgKI0ICAACACIQgMAQsgAigCCCEICyAIIAM2AgwgAiADNgIIIAMgAjYCDCADIAg2AggLQQAgBTYCnNCAgABBACAENgKQ0ICAAAsgAEEIaiEDCyABQRBqJICAgIAAIAMLCgAgABDJgICAAAviDQEHfwJAIABFDQAgAEF4aiIBIABBfGooAgAiAkF4cSIAaiEDAkAgAkEBcQ0AIAJBA3FFDQEgASABKAIAIgJrIgFBACgCmNCAgAAiBEkNASACIABqIQACQCABQQAoApzQgIAARg0AAkAgAkH/AUsNACABKAIIIgQgAkEDdiIFQQN0QbDQgIAAaiIGRhoCQCABKAIMIgIgBEcNAEEAQQAoAojQgIAAQX4gBXdxNgKI0ICAAAwDCyACIAZGGiACIAQ2AgggBCACNgIMDAILIAEoAhghBwJAAkAgASgCDCIGIAFGDQAgASgCCCICIARJGiAGIAI2AgggAiAGNgIMDAELAkAgAUEUaiICKAIAIgQNACABQRBqIgIoAgAiBA0AQQAhBgwBCwNAIAIhBSAEIgZBFGoiAigCACIEDQAgBkEQaiECIAYoAhAiBA0ACyAFQQA2AgALIAdFDQECQAJAIAEgASgCHCIEQQJ0QbjSgIAAaiICKAIARw0AIAIgBjYCACAGDQFBAEEAKAKM0ICAAEF+IAR3cTYCjNCAgAAMAwsgB0EQQRQgBygCECABRhtqIAY2AgAgBkUNAgsgBiAHNgIYAkAgASgCECICRQ0AIAYgAjYCECACIAY2AhgLIAEoAhQiAkUNASAGQRRqIAI2AgAgAiAGNgIYDAELIAMoAgQiAkEDcUEDRw0AIAMgAkF+cTYCBEEAIAA2ApDQgIAAIAEgAGogADYCACABIABBAXI2AgQPCyABIANPDQAgAygCBCICQQFxRQ0AAkACQCACQQJxDQACQCADQQAoAqDQgIAARw0AQQAgATYCoNCAgABBAEEAKAKU0ICAACAAaiIANgKU0ICAACABIABBAXI2AgQgAUEAKAKc0ICAAEcNA0EAQQA2ApDQgIAAQQBBADYCnNCAgAAPCwJAIANBACgCnNCAgABHDQBBACABNgKc0ICAAEEAQQAoApDQgIAAIABqIgA2ApDQgIAAIAEgAEEBcjYCBCABIABqIAA2AgAPCyACQXhxIABqIQACQAJAIAJB/wFLDQAgAygCCCIEIAJBA3YiBUEDdEGw0ICAAGoiBkYaAkAgAygCDCICIARHDQBBAEEAKAKI0ICAAEF+IAV3cTYCiNCAgAAMAgsgAiAGRhogAiAENgIIIAQgAjYCDAwBCyADKAIYIQcCQAJAIAMoAgwiBiADRg0AIAMoAggiAkEAKAKY0ICAAEkaIAYgAjYCCCACIAY2AgwMAQsCQCADQRRqIgIoAgAiBA0AIANBEGoiAigCACIEDQBBACEGDAELA0AgAiEFIAQiBkEUaiICKAIAIgQNACAGQRBqIQIgBigCECIEDQALIAVBADYCAAsgB0UNAAJAAkAgAyADKAIcIgRBAnRBuNKAgABqIgIoAgBHDQAgAiAGNgIAIAYNAUEAQQAoAozQgIAAQX4gBHdxNgKM0ICAAAwCCyAHQRBBFCAHKAIQIANGG2ogBjYCACAGRQ0BCyAGIAc2AhgCQCADKAIQIgJFDQAgBiACNgIQIAIgBjYCGAsgAygCFCICRQ0AIAZBFGogAjYCACACIAY2AhgLIAEgAGogADYCACABIABBAXI2AgQgAUEAKAKc0ICAAEcNAUEAIAA2ApDQgIAADwsgAyACQX5xNgIEIAEgAGogADYCACABIABBAXI2AgQLAkAgAEH/AUsNACAAQXhxQbDQgIAAaiECAkACQEEAKAKI0ICAACIEQQEgAEEDdnQiAHENAEEAIAQgAHI2AojQgIAAIAIhAAwBCyACKAIIIQALIAAgATYCDCACIAE2AgggASACNgIMIAEgADYCCA8LQR8hAgJAIABB////B0sNACAAQQh2IgIgAkGA/j9qQRB2QQhxIgJ0IgQgBEGA4B9qQRB2QQRxIgR0IgYgBkGAgA9qQRB2QQJxIgZ0QQ92IAIgBHIgBnJrIgJBAXQgACACQRVqdkEBcXJBHGohAgsgASACNgIcIAFCADcCECACQQJ0QbjSgIAAaiEEAkACQEEAKAKM0ICAACIGQQEgAnQiA3ENACAEIAE2AgBBACAGIANyNgKM0ICAACABIAQ2AhggASABNgIIIAEgATYCDAwBCyAAQQBBGSACQQF2ayACQR9GG3QhAiAEKAIAIQYCQANAIAYiBCgCBEF4cSAARg0BIAJBHXYhBiACQQF0IQIgBCAGQQRxakEQaiIDKAIAIgYNAAsgAyABNgIAIAEgBDYCGCABIAE2AgwgASABNgIIDAELIAQoAggiACABNgIMIAQgATYCCCABQQA2AhggASAENgIMIAEgADYCCAtBAEEAKAKo0ICAAEF/aiIBQX8gARs2AqjQgIAACwsEAAAAC04AAkAgAA0APwBBEHQPCwJAIABB//8DcQ0AIABBf0wNAAJAIABBEHZAACIAQX9HDQBBAEEwNgL404CAAEF/DwsgAEEQdA8LEMqAgIAAAAvyAgIDfwF+AkAgAkUNACAAIAE6AAAgAiAAaiIDQX9qIAE6AAAgAkEDSQ0AIAAgAToAAiAAIAE6AAEgA0F9aiABOgAAIANBfmogAToAACACQQdJDQAgACABOgADIANBfGogAToAACACQQlJDQAgAEEAIABrQQNxIgRqIgMgAUH/AXFBgYKECGwiATYCACADIAIgBGtBfHEiBGoiAkF8aiABNgIAIARBCUkNACADIAE2AgggAyABNgIEIAJBeGogATYCACACQXRqIAE2AgAgBEEZSQ0AIAMgATYCGCADIAE2AhQgAyABNgIQIAMgATYCDCACQXBqIAE2AgAgAkFsaiABNgIAIAJBaGogATYCACACQWRqIAE2AgAgBCADQQRxQRhyIgVrIgJBIEkNACABrUKBgICAEH4hBiADIAVqIQEDQCABIAY3AxggASAGNwMQIAEgBjcDCCABIAY3AwAgAUEgaiEBIAJBYGoiAkEfSw0ACwsgAAsLjkgBAEGACAuGSAEAAAACAAAAAwAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAYAAAAHAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsb3NlZWVwLWFsaXZlAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgAAAAAAAAAAAAAAAAAAAHJhbnNmZXItZW5jb2RpbmdwZ3JhZGUNCg0KDQpTTQ0KDQpUVFAvQ0UvVFNQLwAAAAAAAAAAAAAAAAECAAEDAAAAAAAAAAAAAAAAAAAAAAAABAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAABAAACAAAAAAAAAAAAAAAAAAAAAAAAAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=="; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/client.js var require_client = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/client.js"(exports2, module3) { "use strict"; init_import_meta_url(); var assert38 = require("assert"); var net2 = require("net"); var http5 = require("http"); var { pipeline } = require("stream"); var util5 = require_util(); var timers = require_timers(); var Request4 = require_request(); var DispatcherBase = require_dispatcher_base(); var { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, InvalidArgumentError, RequestAbortedError, HeadersTimeoutError, HeadersOverflowError, SocketError, InformationalError, BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError, ClientDestroyedError } = require_errors(); var buildConnector = require_connect(); var { kUrl, kReset: kReset2, kServerName, kClient, kBusy, kParser, kConnect, kBlocking, kResuming, kRunning, kPending, kSize, kWriting, kQueue, kConnected, kConnecting, kNeedDrain, kNoRef, kKeepAliveDefaultTimeout, kHostHeader, kPendingIdx, kRunningIdx, kError, kPipelining, kSocket, kKeepAliveTimeoutValue, kMaxHeadersSize, kKeepAliveMaxTimeout, kKeepAliveTimeoutThreshold, kHeadersTimeout, kBodyTimeout, kStrictContentLength, kConnector, kMaxRedirections, kMaxRequests, kCounter, kClose, kDestroy, kDispatch, kInterceptors, kLocalAddress, kMaxResponseSize, kHTTPConnVersion, // HTTP2 kHost, kHTTP2Session, kHTTP2SessionState, kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require_symbols(); var http22; try { http22 = require("http2"); } catch { http22 = { constants: {} }; } var { constants: { HTTP2_HEADER_AUTHORITY, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_SCHEME, HTTP2_HEADER_CONTENT_LENGTH, HTTP2_HEADER_EXPECT, HTTP2_HEADER_STATUS } } = http22; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; var kClosedResolve = Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); channels.sendHeaders = diagnosticsChannel.channel("undici:client:sendHeaders"); channels.beforeConnect = diagnosticsChannel.channel("undici:client:beforeConnect"); channels.connectError = diagnosticsChannel.channel("undici:client:connectError"); channels.connected = diagnosticsChannel.channel("undici:client:connected"); } catch { channels.sendHeaders = { hasSubscribers: false }; channels.beforeConnect = { hasSubscribers: false }; channels.connectError = { hasSubscribers: false }; channels.connected = { hasSubscribers: false }; } var Client2 = class extends DispatcherBase { /** * * @param {string|URL} url * @param {import('../types/client').Client.Options} options */ constructor(url4, { interceptors, maxHeaderSize, headersTimeout, socketTimeout, requestTimeout: requestTimeout2, connectTimeout, bodyTimeout, idleTimeout, keepAlive, keepAliveTimeout, maxKeepAliveTimeout, keepAliveMaxTimeout, keepAliveTimeoutThreshold, socketPath, pipelining, tls, strictContentLength, maxCachedSessions, maxRedirections, connect: connect2, maxRequestsPerClient, localAddress, maxResponseSize, autoSelectFamily, autoSelectFamilyAttemptTimeout, // h2 allowH2, maxConcurrentStreams } = {}) { super(); if (keepAlive !== void 0) { throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead"); } if (socketTimeout !== void 0) { throw new InvalidArgumentError("unsupported socketTimeout, use headersTimeout & bodyTimeout instead"); } if (requestTimeout2 !== void 0) { throw new InvalidArgumentError("unsupported requestTimeout, use headersTimeout & bodyTimeout instead"); } if (idleTimeout !== void 0) { throw new InvalidArgumentError("unsupported idleTimeout, use keepAliveTimeout instead"); } if (maxKeepAliveTimeout !== void 0) { throw new InvalidArgumentError("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead"); } if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { throw new InvalidArgumentError("invalid maxHeaderSize"); } if (socketPath != null && typeof socketPath !== "string") { throw new InvalidArgumentError("invalid socketPath"); } if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { throw new InvalidArgumentError("invalid connectTimeout"); } if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { throw new InvalidArgumentError("invalid keepAliveTimeout"); } if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { throw new InvalidArgumentError("invalid keepAliveMaxTimeout"); } if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { throw new InvalidArgumentError("invalid keepAliveTimeoutThreshold"); } if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { throw new InvalidArgumentError("headersTimeout must be a positive integer or zero"); } if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { throw new InvalidArgumentError("bodyTimeout must be a positive integer or zero"); } if (connect2 != null && typeof connect2 !== "function" && typeof connect2 !== "object") { throw new InvalidArgumentError("connect must be a function or an object"); } if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { throw new InvalidArgumentError("maxRedirections must be a positive number"); } if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { throw new InvalidArgumentError("maxRequestsPerClient must be a positive number"); } if (localAddress != null && (typeof localAddress !== "string" || net2.isIP(localAddress) === 0)) { throw new InvalidArgumentError("localAddress must be valid string IP address"); } if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { throw new InvalidArgumentError("maxResponseSize must be a positive number"); } if (autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)) { throw new InvalidArgumentError("autoSelectFamilyAttemptTimeout must be a positive number"); } if (allowH2 != null && typeof allowH2 !== "boolean") { throw new InvalidArgumentError("allowH2 must be a valid boolean value"); } if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== "number" || maxConcurrentStreams < 1)) { throw new InvalidArgumentError("maxConcurrentStreams must be a possitive integer, greater than 0"); } if (typeof connect2 !== "function") { connect2 = buildConnector({ ...tls, maxCachedSessions, allowH2, socketPath, timeout: connectTimeout, ...util5.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, ...connect2 }); } this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) ? interceptors.Client : [createRedirectInterceptor({ maxRedirections })]; this[kUrl] = util5.parseOrigin(url4); this[kConnector] = connect2; this[kSocket] = null; this[kPipelining] = pipelining != null ? pipelining : 1; this[kMaxHeadersSize] = maxHeaderSize || http5.maxHeaderSize; this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout; this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout; this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold; this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]; this[kServerName] = null; this[kLocalAddress] = localAddress != null ? localAddress : null; this[kResuming] = 0; this[kNeedDrain] = 0; this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}\r `; this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 3e5; this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 3e5; this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength; this[kMaxRedirections] = maxRedirections; this[kMaxRequests] = maxRequestsPerClient; this[kClosedResolve] = null; this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1; this[kHTTPConnVersion] = "h1"; this[kHTTP2Session] = null; this[kHTTP2SessionState] = !allowH2 ? null : { // streams: null, // Fixed queue of streams - For future support of `push` openStreams: 0, // Keep track of them to decide wether or not unref the session maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server }; this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}`; this[kQueue] = []; this[kRunningIdx] = 0; this[kPendingIdx] = 0; } get pipelining() { return this[kPipelining]; } set pipelining(value) { this[kPipelining] = value; resume(this, true); } get [kPending]() { return this[kQueue].length - this[kPendingIdx]; } get [kRunning]() { return this[kPendingIdx] - this[kRunningIdx]; } get [kSize]() { return this[kQueue].length - this[kRunningIdx]; } get [kConnected]() { return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed; } get [kBusy]() { const socket = this[kSocket]; return socket && (socket[kReset2] || socket[kWriting] || socket[kBlocking]) || this[kSize] >= (this[kPipelining] || 1) || this[kPending] > 0; } /* istanbul ignore: only used for test */ [kConnect](cb2) { connect(this); this.once("connect", cb2); } [kDispatch](opts, handler31) { const origin = opts.origin || this[kUrl].origin; const request4 = this[kHTTPConnVersion] === "h2" ? Request4[kHTTP2BuildRequest](origin, opts, handler31) : Request4[kHTTP1BuildRequest](origin, opts, handler31); this[kQueue].push(request4); if (this[kResuming]) { } else if (util5.bodyLength(request4.body) == null && util5.isIterable(request4.body)) { this[kResuming] = 1; process.nextTick(resume, this); } else { resume(this, true); } if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { this[kNeedDrain] = 2; } return this[kNeedDrain] < 2; } async [kClose]() { return new Promise((resolve25) => { if (!this[kSize]) { resolve25(null); } else { this[kClosedResolve] = resolve25; } }); } async [kDestroy](err) { return new Promise((resolve25) => { const requests = this[kQueue].splice(this[kPendingIdx]); for (let i5 = 0; i5 < requests.length; i5++) { const request4 = requests[i5]; errorRequest(this, request4, err); } const callback = /* @__PURE__ */ __name(() => { if (this[kClosedResolve]) { this[kClosedResolve](); this[kClosedResolve] = null; } resolve25(); }, "callback"); if (this[kHTTP2Session] != null) { util5.destroy(this[kHTTP2Session], err); this[kHTTP2Session] = null; this[kHTTP2SessionState] = null; } if (!this[kSocket]) { queueMicrotask(callback); } else { util5.destroy(this[kSocket].on("close", callback), err); } resume(this); }); } }; __name(Client2, "Client"); function onHttp2SessionError(err) { assert38(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); this[kSocket][kError] = err; onError(this[kClient], err); } __name(onHttp2SessionError, "onHttp2SessionError"); function onHttp2FrameError(type, code, id) { const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`); if (id === 0) { this[kSocket][kError] = err; onError(this[kClient], err); } } __name(onHttp2FrameError, "onHttp2FrameError"); function onHttp2SessionEnd() { util5.destroy(this, new SocketError("other side closed")); util5.destroy(this[kSocket], new SocketError("other side closed")); } __name(onHttp2SessionEnd, "onHttp2SessionEnd"); function onHTTP2GoAway(code) { const client = this[kClient]; const err = new InformationalError(`HTTP/2: "GOAWAY" frame received with code ${code}`); client[kSocket] = null; client[kHTTP2Session] = null; if (client.destroyed) { assert38(this[kPending] === 0); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i5 = 0; i5 < requests.length; i5++) { const request4 = requests[i5]; errorRequest(this, request4, err); } } else if (client[kRunning] > 0) { const request4 = client[kQueue][client[kRunningIdx]]; client[kQueue][client[kRunningIdx]++] = null; errorRequest(client, request4, err); } client[kPendingIdx] = client[kRunningIdx]; assert38(client[kRunning] === 0); client.emit( "disconnect", client[kUrl], [client], err ); resume(client); } __name(onHTTP2GoAway, "onHTTP2GoAway"); var constants4 = require_constants3(); var createRedirectInterceptor = require_redirectInterceptor(); var EMPTY_BUF = Buffer.alloc(0); async function lazyllhttp() { const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0; let mod; try { mod = await WebAssembly.compile(Buffer.from(require_llhttp_simd_wasm(), "base64")); } catch (e7) { mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || require_llhttp_wasm(), "base64")); } return await WebAssembly.instantiate(mod, { env: { /* eslint-disable camelcase */ wasm_on_url: (p6, at2, len) => { return 0; }, wasm_on_status: (p6, at2, len) => { assert38.strictEqual(currentParser.ptr, p6); const start = at2 - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_message_begin: (p6) => { assert38.strictEqual(currentParser.ptr, p6); return currentParser.onMessageBegin() || 0; }, wasm_on_header_field: (p6, at2, len) => { assert38.strictEqual(currentParser.ptr, p6); const start = at2 - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_header_value: (p6, at2, len) => { assert38.strictEqual(currentParser.ptr, p6); const start = at2 - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_headers_complete: (p6, statusCode, upgrade, shouldKeepAlive) => { assert38.strictEqual(currentParser.ptr, p6); return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0; }, wasm_on_body: (p6, at2, len) => { assert38.strictEqual(currentParser.ptr, p6); const start = at2 - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_message_complete: (p6) => { assert38.strictEqual(currentParser.ptr, p6); return currentParser.onMessageComplete() || 0; } /* eslint-enable camelcase */ } }); } __name(lazyllhttp, "lazyllhttp"); var llhttpInstance = null; var llhttpPromise = lazyllhttp(); llhttpPromise.catch(); var currentParser = null; var currentBufferRef = null; var currentBufferSize = 0; var currentBufferPtr = null; var TIMEOUT_HEADERS = 1; var TIMEOUT_BODY = 2; var TIMEOUT_IDLE = 3; var Parser2 = class { constructor(client, socket, { exports: exports3 }) { assert38(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); this.llhttp = exports3; this.ptr = this.llhttp.llhttp_alloc(constants4.TYPE.RESPONSE); this.client = client; this.socket = socket; this.timeout = null; this.timeoutValue = null; this.timeoutType = null; this.statusCode = null; this.statusText = ""; this.upgrade = false; this.headers = []; this.headersSize = 0; this.headersMaxSize = client[kMaxHeadersSize]; this.shouldKeepAlive = false; this.paused = false; this.resume = this.resume.bind(this); this.bytesRead = 0; this.keepAlive = ""; this.contentLength = ""; this.connection = ""; this.maxResponseSize = client[kMaxResponseSize]; } setTimeout(value, type) { this.timeoutType = type; if (value !== this.timeoutValue) { timers.clearTimeout(this.timeout); if (value) { this.timeout = timers.setTimeout(onParserTimeout, value, this); if (this.timeout.unref) { this.timeout.unref(); } } else { this.timeout = null; } this.timeoutValue = value; } else if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); } } } resume() { if (this.socket.destroyed || !this.paused) { return; } assert38(this.ptr != null); assert38(currentParser == null); this.llhttp.llhttp_resume(this.ptr); assert38(this.timeoutType === TIMEOUT_BODY); if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); } } this.paused = false; this.execute(this.socket.read() || EMPTY_BUF); this.readMore(); } readMore() { while (!this.paused && this.ptr) { const chunk = this.socket.read(); if (chunk === null) { break; } this.execute(chunk); } } execute(data) { assert38(this.ptr != null); assert38(currentParser == null); assert38(!this.paused); const { socket, llhttp } = this; if (data.length > currentBufferSize) { if (currentBufferPtr) { llhttp.free(currentBufferPtr); } currentBufferSize = Math.ceil(data.length / 4096) * 4096; currentBufferPtr = llhttp.malloc(currentBufferSize); } new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data); try { let ret; try { currentBufferRef = data; currentParser = this; ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length); } catch (err) { throw err; } finally { currentParser = null; currentBufferRef = null; } const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; if (ret === constants4.ERROR.PAUSED_UPGRADE) { this.onUpgrade(data.slice(offset)); } else if (ret === constants4.ERROR.PAUSED) { this.paused = true; socket.unshift(data.slice(offset)); } else if (ret !== constants4.ERROR.OK) { const ptr = llhttp.llhttp_get_error_reason(this.ptr); let message = ""; if (ptr) { const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0); message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")"; } throw new HTTPParserError(message, constants4.ERROR[ret], data.slice(offset)); } } catch (err) { util5.destroy(socket, err); } } destroy() { assert38(this.ptr != null); assert38(currentParser == null); this.llhttp.llhttp_free(this.ptr); this.ptr = null; timers.clearTimeout(this.timeout); this.timeout = null; this.timeoutValue = null; this.timeoutType = null; this.paused = false; } onStatus(buf) { this.statusText = buf.toString(); } onMessageBegin() { const { socket, client } = this; if (socket.destroyed) { return -1; } const request4 = client[kQueue][client[kRunningIdx]]; if (!request4) { return -1; } } onHeaderField(buf) { const len = this.headers.length; if ((len & 1) === 0) { this.headers.push(buf); } else { this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); } this.trackHeader(buf.length); } onHeaderValue(buf) { let len = this.headers.length; if ((len & 1) === 1) { this.headers.push(buf); len += 1; } else { this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); } const key = this.headers[len - 2]; if (key.length === 10 && key.toString().toLowerCase() === "keep-alive") { this.keepAlive += buf.toString(); } else if (key.length === 10 && key.toString().toLowerCase() === "connection") { this.connection += buf.toString(); } else if (key.length === 14 && key.toString().toLowerCase() === "content-length") { this.contentLength += buf.toString(); } this.trackHeader(buf.length); } trackHeader(len) { this.headersSize += len; if (this.headersSize >= this.headersMaxSize) { util5.destroy(this.socket, new HeadersOverflowError()); } } onUpgrade(head) { const { upgrade, client, socket, headers, statusCode } = this; assert38(upgrade); const request4 = client[kQueue][client[kRunningIdx]]; assert38(request4); assert38(!socket.destroyed); assert38(socket === client[kSocket]); assert38(!this.paused); assert38(request4.upgrade || request4.method === "CONNECT"); this.statusCode = null; this.statusText = ""; this.shouldKeepAlive = null; assert38(this.headers.length % 2 === 0); this.headers = []; this.headersSize = 0; socket.unshift(head); socket[kParser].destroy(); socket[kParser] = null; socket[kClient] = null; socket[kError] = null; socket.removeListener("error", onSocketError).removeListener("readable", onSocketReadable).removeListener("end", onSocketEnd).removeListener("close", onSocketClose); client[kSocket] = null; client[kQueue][client[kRunningIdx]++] = null; client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade")); try { request4.onUpgrade(statusCode, headers, socket); } catch (err) { util5.destroy(socket, err); } resume(client); } onHeadersComplete(statusCode, upgrade, shouldKeepAlive) { const { client, socket, headers, statusText } = this; if (socket.destroyed) { return -1; } const request4 = client[kQueue][client[kRunningIdx]]; if (!request4) { return -1; } assert38(!this.upgrade); assert38(this.statusCode < 200); if (statusCode === 100) { util5.destroy(socket, new SocketError("bad response", util5.getSocketInfo(socket))); return -1; } if (upgrade && !request4.upgrade) { util5.destroy(socket, new SocketError("bad upgrade", util5.getSocketInfo(socket))); return -1; } assert38.strictEqual(this.timeoutType, TIMEOUT_HEADERS); this.statusCode = statusCode; this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. request4.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive"; if (this.statusCode >= 200) { const bodyTimeout = request4.bodyTimeout != null ? request4.bodyTimeout : client[kBodyTimeout]; this.setTimeout(bodyTimeout, TIMEOUT_BODY); } else if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); } } if (request4.method === "CONNECT") { assert38(client[kRunning] === 1); this.upgrade = true; return 2; } if (upgrade) { assert38(client[kRunning] === 1); this.upgrade = true; return 2; } assert38(this.headers.length % 2 === 0); this.headers = []; this.headersSize = 0; if (this.shouldKeepAlive && client[kPipelining]) { const keepAliveTimeout = this.keepAlive ? util5.parseKeepAliveTimeout(this.keepAlive) : null; if (keepAliveTimeout != null) { const timeout2 = Math.min( keepAliveTimeout - client[kKeepAliveTimeoutThreshold], client[kKeepAliveMaxTimeout] ); if (timeout2 <= 0) { socket[kReset2] = true; } else { client[kKeepAliveTimeoutValue] = timeout2; } } else { client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]; } } else { socket[kReset2] = true; } const pause = request4.onHeaders(statusCode, headers, this.resume, statusText) === false; if (request4.aborted) { return -1; } if (request4.method === "HEAD") { return 1; } if (statusCode < 200) { return 1; } if (socket[kBlocking]) { socket[kBlocking] = false; resume(client); } return pause ? constants4.ERROR.PAUSED : 0; } onBody(buf) { const { client, socket, statusCode, maxResponseSize } = this; if (socket.destroyed) { return -1; } const request4 = client[kQueue][client[kRunningIdx]]; assert38(request4); assert38.strictEqual(this.timeoutType, TIMEOUT_BODY); if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); } } assert38(statusCode >= 200); if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { util5.destroy(socket, new ResponseExceededMaxSizeError()); return -1; } this.bytesRead += buf.length; if (request4.onData(buf) === false) { return constants4.ERROR.PAUSED; } } onMessageComplete() { const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this; if (socket.destroyed && (!statusCode || shouldKeepAlive)) { return -1; } if (upgrade) { return; } const request4 = client[kQueue][client[kRunningIdx]]; assert38(request4); assert38(statusCode >= 100); this.statusCode = null; this.statusText = ""; this.bytesRead = 0; this.contentLength = ""; this.keepAlive = ""; this.connection = ""; assert38(this.headers.length % 2 === 0); this.headers = []; this.headersSize = 0; if (statusCode < 200) { return; } if (request4.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) { util5.destroy(socket, new ResponseContentLengthMismatchError()); return -1; } request4.onComplete(headers); client[kQueue][client[kRunningIdx]++] = null; if (socket[kWriting]) { assert38.strictEqual(client[kRunning], 0); util5.destroy(socket, new InformationalError("reset")); return constants4.ERROR.PAUSED; } else if (!shouldKeepAlive) { util5.destroy(socket, new InformationalError("reset")); return constants4.ERROR.PAUSED; } else if (socket[kReset2] && client[kRunning] === 0) { util5.destroy(socket, new InformationalError("reset")); return constants4.ERROR.PAUSED; } else if (client[kPipelining] === 1) { setImmediate(resume, client); } else { resume(client); } } }; __name(Parser2, "Parser"); function onParserTimeout(parser2) { const { socket, timeoutType, client } = parser2; if (timeoutType === TIMEOUT_HEADERS) { if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { assert38(!parser2.paused, "cannot be paused while waiting for headers"); util5.destroy(socket, new HeadersTimeoutError()); } } else if (timeoutType === TIMEOUT_BODY) { if (!parser2.paused) { util5.destroy(socket, new BodyTimeoutError()); } } else if (timeoutType === TIMEOUT_IDLE) { assert38(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); util5.destroy(socket, new InformationalError("socket idle timeout")); } } __name(onParserTimeout, "onParserTimeout"); function onSocketReadable() { const { [kParser]: parser2 } = this; if (parser2) { parser2.readMore(); } } __name(onSocketReadable, "onSocketReadable"); function onSocketError(err) { const { [kClient]: client, [kParser]: parser2 } = this; assert38(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); if (client[kHTTPConnVersion] !== "h2") { if (err.code === "ECONNRESET" && parser2.statusCode && !parser2.shouldKeepAlive) { parser2.onMessageComplete(); return; } } this[kError] = err; onError(this[kClient], err); } __name(onSocketError, "onSocketError"); function onError(client, err) { if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { assert38(client[kPendingIdx] === client[kRunningIdx]); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i5 = 0; i5 < requests.length; i5++) { const request4 = requests[i5]; errorRequest(client, request4, err); } assert38(client[kSize] === 0); } } __name(onError, "onError"); function onSocketEnd() { const { [kParser]: parser2, [kClient]: client } = this; if (client[kHTTPConnVersion] !== "h2") { if (parser2.statusCode && !parser2.shouldKeepAlive) { parser2.onMessageComplete(); return; } } util5.destroy(this, new SocketError("other side closed", util5.getSocketInfo(this))); } __name(onSocketEnd, "onSocketEnd"); function onSocketClose() { const { [kClient]: client, [kParser]: parser2 } = this; if (client[kHTTPConnVersion] === "h1" && parser2) { if (!this[kError] && parser2.statusCode && !parser2.shouldKeepAlive) { parser2.onMessageComplete(); } this[kParser].destroy(); this[kParser] = null; } const err = this[kError] || new SocketError("closed", util5.getSocketInfo(this)); client[kSocket] = null; if (client.destroyed) { assert38(client[kPending] === 0); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i5 = 0; i5 < requests.length; i5++) { const request4 = requests[i5]; errorRequest(client, request4, err); } } else if (client[kRunning] > 0 && err.code !== "UND_ERR_INFO") { const request4 = client[kQueue][client[kRunningIdx]]; client[kQueue][client[kRunningIdx]++] = null; errorRequest(client, request4, err); } client[kPendingIdx] = client[kRunningIdx]; assert38(client[kRunning] === 0); client.emit("disconnect", client[kUrl], [client], err); resume(client); } __name(onSocketClose, "onSocketClose"); async function connect(client) { assert38(!client[kConnecting]); assert38(!client[kSocket]); let { host, hostname: hostname2, protocol, port } = client[kUrl]; if (hostname2[0] === "[") { const idx = hostname2.indexOf("]"); assert38(idx !== -1); const ip = hostname2.substring(1, idx); assert38(net2.isIP(ip)); hostname2 = ip; } client[kConnecting] = true; if (channels.beforeConnect.hasSubscribers) { channels.beforeConnect.publish({ connectParams: { host, hostname: hostname2, protocol, port, servername: client[kServerName], localAddress: client[kLocalAddress] }, connector: client[kConnector] }); } try { const socket = await new Promise((resolve25, reject) => { client[kConnector]({ host, hostname: hostname2, protocol, port, servername: client[kServerName], localAddress: client[kLocalAddress] }, (err, socket2) => { if (err) { reject(err); } else { resolve25(socket2); } }); }); if (client.destroyed) { util5.destroy(socket.on("error", () => { }), new ClientDestroyedError()); return; } client[kConnecting] = false; assert38(socket); const isH22 = socket.alpnProtocol === "h2"; if (isH22) { if (!h2ExperimentalWarned) { h2ExperimentalWarned = true; process.emitWarning("H2 support is experimental, expect them to change at any time.", { code: "UNDICI-H2" }); } const session = http22.connect(client[kUrl], { createConnection: () => socket, peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams }); client[kHTTPConnVersion] = "h2"; session[kClient] = client; session[kSocket] = socket; session.on("error", onHttp2SessionError); session.on("frameError", onHttp2FrameError); session.on("end", onHttp2SessionEnd); session.on("goaway", onHTTP2GoAway); session.on("close", onSocketClose); session.unref(); client[kHTTP2Session] = session; socket[kHTTP2Session] = session; } else { if (!llhttpInstance) { llhttpInstance = await llhttpPromise; llhttpPromise = null; } socket[kNoRef] = false; socket[kWriting] = false; socket[kReset2] = false; socket[kBlocking] = false; socket[kParser] = new Parser2(client, socket, llhttpInstance); } socket[kCounter] = 0; socket[kMaxRequests] = client[kMaxRequests]; socket[kClient] = client; socket[kError] = null; socket.on("error", onSocketError).on("readable", onSocketReadable).on("end", onSocketEnd).on("close", onSocketClose); client[kSocket] = socket; if (channels.connected.hasSubscribers) { channels.connected.publish({ connectParams: { host, hostname: hostname2, protocol, port, servername: client[kServerName], localAddress: client[kLocalAddress] }, connector: client[kConnector], socket }); } client.emit("connect", client[kUrl], [client]); } catch (err) { if (client.destroyed) { return; } client[kConnecting] = false; if (channels.connectError.hasSubscribers) { channels.connectError.publish({ connectParams: { host, hostname: hostname2, protocol, port, servername: client[kServerName], localAddress: client[kLocalAddress] }, connector: client[kConnector], error: err }); } if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { assert38(client[kRunning] === 0); while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { const request4 = client[kQueue][client[kPendingIdx]++]; errorRequest(client, request4, err); } } else { onError(client, err); } client.emit("connectionError", client[kUrl], [client], err); } resume(client); } __name(connect, "connect"); function emitDrain(client) { client[kNeedDrain] = 0; client.emit("drain", client[kUrl], [client]); } __name(emitDrain, "emitDrain"); function resume(client, sync) { if (client[kResuming] === 2) { return; } client[kResuming] = 2; _resume(client, sync); client[kResuming] = 0; if (client[kRunningIdx] > 256) { client[kQueue].splice(0, client[kRunningIdx]); client[kPendingIdx] -= client[kRunningIdx]; client[kRunningIdx] = 0; } } __name(resume, "resume"); function _resume(client, sync) { while (true) { if (client.destroyed) { assert38(client[kPending] === 0); return; } if (client[kClosedResolve] && !client[kSize]) { client[kClosedResolve](); client[kClosedResolve] = null; return; } const socket = client[kSocket]; if (socket && !socket.destroyed && socket.alpnProtocol !== "h2") { if (client[kSize] === 0) { if (!socket[kNoRef] && socket.unref) { socket.unref(); socket[kNoRef] = true; } } else if (socket[kNoRef] && socket.ref) { socket.ref(); socket[kNoRef] = false; } if (client[kSize] === 0) { if (socket[kParser].timeoutType !== TIMEOUT_IDLE) { socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE); } } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { const request5 = client[kQueue][client[kRunningIdx]]; const headersTimeout = request5.headersTimeout != null ? request5.headersTimeout : client[kHeadersTimeout]; socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS); } } } if (client[kBusy]) { client[kNeedDrain] = 2; } else if (client[kNeedDrain] === 2) { if (sync) { client[kNeedDrain] = 1; process.nextTick(emitDrain, client); } else { emitDrain(client); } continue; } if (client[kPending] === 0) { return; } if (client[kRunning] >= (client[kPipelining] || 1)) { return; } const request4 = client[kQueue][client[kPendingIdx]]; if (client[kUrl].protocol === "https:" && client[kServerName] !== request4.servername) { if (client[kRunning] > 0) { return; } client[kServerName] = request4.servername; if (socket && socket.servername !== request4.servername) { util5.destroy(socket, new InformationalError("servername changed")); return; } } if (client[kConnecting]) { return; } if (!socket && !client[kHTTP2Session]) { connect(client); return; } if (socket.destroyed || socket[kWriting] || socket[kReset2] || socket[kBlocking]) { return; } if (client[kRunning] > 0 && !request4.idempotent) { return; } if (client[kRunning] > 0 && (request4.upgrade || request4.method === "CONNECT")) { return; } if (client[kRunning] > 0 && util5.bodyLength(request4.body) !== 0 && (util5.isStream(request4.body) || util5.isAsyncIterable(request4.body))) { return; } if (!request4.aborted && write(client, request4)) { client[kPendingIdx]++; } else { client[kQueue].splice(client[kPendingIdx], 1); } } } __name(_resume, "_resume"); function shouldSendContentLength(method) { return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } __name(shouldSendContentLength, "shouldSendContentLength"); function write(client, request4) { if (client[kHTTPConnVersion] === "h2") { writeH2(client, client[kHTTP2Session], request4); return; } const { body, method, path: path72, host, upgrade, headers, blocking, reset } = request4; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); } const bodyLength = util5.bodyLength(body); let contentLength = bodyLength; if (contentLength === null) { contentLength = request4.contentLength; } if (contentLength === 0 && !expectsPayload) { contentLength = null; } if (shouldSendContentLength(method) && contentLength > 0 && request4.contentLength !== null && request4.contentLength !== contentLength) { if (client[kStrictContentLength]) { errorRequest(client, request4, new RequestContentLengthMismatchError()); return false; } process.emitWarning(new RequestContentLengthMismatchError()); } const socket = client[kSocket]; try { request4.onConnect((err) => { if (request4.aborted || request4.completed) { return; } errorRequest(client, request4, err || new RequestAbortedError()); util5.destroy(socket, new InformationalError("aborted")); }); } catch (err) { errorRequest(client, request4, err); } if (request4.aborted) { return false; } if (method === "HEAD") { socket[kReset2] = true; } if (upgrade || method === "CONNECT") { socket[kReset2] = true; } if (reset != null) { socket[kReset2] = reset; } if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { socket[kReset2] = true; } if (blocking) { socket[kBlocking] = true; } let header = `${method} ${path72} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r `; } else { header += client[kHostHeader]; } if (upgrade) { header += `connection: upgrade\r upgrade: ${upgrade}\r `; } else if (client[kPipelining] && !socket[kReset2]) { header += "connection: keep-alive\r\n"; } else { header += "connection: close\r\n"; } if (headers) { header += headers; } if (channels.sendHeaders.hasSubscribers) { channels.sendHeaders.publish({ request: request4, headers: header, socket }); } if (!body || bodyLength === 0) { if (contentLength === 0) { socket.write(`${header}content-length: 0\r \r `, "latin1"); } else { assert38(contentLength === null, "no body must not have content length"); socket.write(`${header}\r `, "latin1"); } request4.onRequestSent(); } else if (util5.isBuffer(body)) { assert38(contentLength === body.byteLength, "buffer body must have content length"); socket.cork(); socket.write(`${header}content-length: ${contentLength}\r \r `, "latin1"); socket.write(body); socket.uncork(); request4.onBodySent(body); request4.onRequestSent(); if (!expectsPayload) { socket[kReset2] = true; } } else if (util5.isBlobLike(body)) { if (typeof body.stream === "function") { writeIterable({ body: body.stream(), client, request: request4, socket, contentLength, header, expectsPayload }); } else { writeBlob({ body, client, request: request4, socket, contentLength, header, expectsPayload }); } } else if (util5.isStream(body)) { writeStream({ body, client, request: request4, socket, contentLength, header, expectsPayload }); } else if (util5.isIterable(body)) { writeIterable({ body, client, request: request4, socket, contentLength, header, expectsPayload }); } else { assert38(false); } return true; } __name(write, "write"); function writeH2(client, session, request4) { const { body, method, path: path72, host, upgrade, expectContinue, signal, headers: reqHeaders } = request4; let headers; if (typeof reqHeaders === "string") headers = Request4[kHTTP2CopyHeaders](reqHeaders.trim()); else headers = reqHeaders; if (upgrade) { errorRequest(client, request4, new Error("Upgrade not supported for H2")); return false; } try { request4.onConnect((err) => { if (request4.aborted || request4.completed) { return; } errorRequest(client, request4, err || new RequestAbortedError()); }); } catch (err) { errorRequest(client, request4, err); } if (request4.aborted) { return false; } let stream2; const h2State = client[kHTTP2SessionState]; headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]; headers[HTTP2_HEADER_METHOD] = method; if (method === "CONNECT") { session.ref(); stream2 = session.request(headers, { endStream: false, signal }); if (stream2.id && !stream2.pending) { request4.onUpgrade(null, null, stream2); ++h2State.openStreams; } else { stream2.once("ready", () => { request4.onUpgrade(null, null, stream2); ++h2State.openStreams; }); } stream2.once("close", () => { h2State.openStreams -= 1; if (h2State.openStreams === 0) session.unref(); }); return true; } headers[HTTP2_HEADER_PATH] = path72; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); } let contentLength = util5.bodyLength(body); if (contentLength == null) { contentLength = request4.contentLength; } if (contentLength === 0 || !expectsPayload) { contentLength = null; } if (shouldSendContentLength(method) && contentLength > 0 && request4.contentLength != null && request4.contentLength !== contentLength) { if (client[kStrictContentLength]) { errorRequest(client, request4, new RequestContentLengthMismatchError()); return false; } process.emitWarning(new RequestContentLengthMismatchError()); } if (contentLength != null) { assert38(body, "no body must not have content length"); headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`; } session.ref(); const shouldEndStream = method === "GET" || method === "HEAD"; if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = "100-continue"; stream2 = session.request(headers, { endStream: shouldEndStream, signal }); stream2.once("continue", writeBodyH2); } else { stream2 = session.request(headers, { endStream: shouldEndStream, signal }); writeBodyH2(); } ++h2State.openStreams; stream2.once("response", (headers2) => { const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2; if (request4.onHeaders(Number(statusCode), realHeaders, stream2.resume.bind(stream2), "") === false) { stream2.pause(); } }); stream2.once("end", () => { request4.onComplete([]); }); stream2.on("data", (chunk) => { if (request4.onData(chunk) === false) { stream2.pause(); } }); stream2.once("close", () => { h2State.openStreams -= 1; if (h2State.openStreams === 0) { session.unref(); } }); stream2.once("error", function(err) { if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1; util5.destroy(stream2, err); } }); stream2.once("frameError", (type, code) => { const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`); errorRequest(client, request4, err); if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1; util5.destroy(stream2, err); } }); return true; function writeBodyH2() { if (!body) { request4.onRequestSent(); } else if (util5.isBuffer(body)) { assert38(contentLength === body.byteLength, "buffer body must have content length"); stream2.cork(); stream2.write(body); stream2.uncork(); stream2.end(); request4.onBodySent(body); request4.onRequestSent(); } else if (util5.isBlobLike(body)) { if (typeof body.stream === "function") { writeIterable({ client, request: request4, contentLength, h2stream: stream2, expectsPayload, body: body.stream(), socket: client[kSocket], header: "" }); } else { writeBlob({ body, client, request: request4, contentLength, expectsPayload, h2stream: stream2, header: "", socket: client[kSocket] }); } } else if (util5.isStream(body)) { writeStream({ body, client, request: request4, contentLength, expectsPayload, socket: client[kSocket], h2stream: stream2, header: "" }); } else if (util5.isIterable(body)) { writeIterable({ body, client, request: request4, contentLength, expectsPayload, header: "", h2stream: stream2, socket: client[kSocket] }); } else { assert38(false); } } __name(writeBodyH2, "writeBodyH2"); } __name(writeH2, "writeH2"); function writeStream({ h2stream, body, client, request: request4, socket, contentLength, header, expectsPayload }) { assert38(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); if (client[kHTTPConnVersion] === "h2") { let onPipeData = function(chunk) { request4.onBodySent(chunk); }; __name(onPipeData, "onPipeData"); const pipe = pipeline( body, h2stream, (err) => { if (err) { util5.destroy(body, err); util5.destroy(h2stream, err); } else { request4.onRequestSent(); } } ); pipe.on("data", onPipeData); pipe.once("end", () => { pipe.removeListener("data", onPipeData); util5.destroy(pipe); }); return; } let finished = false; const writer = new AsyncWriter({ socket, request: request4, contentLength, client, expectsPayload, header }); const onData = /* @__PURE__ */ __name(function(chunk) { if (finished) { return; } try { if (!writer.write(chunk) && this.pause) { this.pause(); } } catch (err) { util5.destroy(this, err); } }, "onData"); const onDrain = /* @__PURE__ */ __name(function() { if (finished) { return; } if (body.resume) { body.resume(); } }, "onDrain"); const onAbort = /* @__PURE__ */ __name(function() { if (finished) { return; } const err = new RequestAbortedError(); queueMicrotask(() => onFinished(err)); }, "onAbort"); const onFinished = /* @__PURE__ */ __name(function(err) { if (finished) { return; } finished = true; assert38(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); socket.off("drain", onDrain).off("error", onFinished); body.removeListener("data", onData).removeListener("end", onFinished).removeListener("error", onFinished).removeListener("close", onAbort); if (!err) { try { writer.end(); } catch (er) { err = er; } } writer.destroy(err); if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { util5.destroy(body, err); } else { util5.destroy(body); } }, "onFinished"); body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onAbort); if (body.resume) { body.resume(); } socket.on("drain", onDrain).on("error", onFinished); } __name(writeStream, "writeStream"); async function writeBlob({ h2stream, body, client, request: request4, socket, contentLength, header, expectsPayload }) { assert38(contentLength === body.size, "blob body must have content length"); const isH22 = client[kHTTPConnVersion] === "h2"; try { if (contentLength != null && contentLength !== body.size) { throw new RequestContentLengthMismatchError(); } const buffer = Buffer.from(await body.arrayBuffer()); if (isH22) { h2stream.cork(); h2stream.write(buffer); h2stream.uncork(); } else { socket.cork(); socket.write(`${header}content-length: ${contentLength}\r \r `, "latin1"); socket.write(buffer); socket.uncork(); } request4.onBodySent(buffer); request4.onRequestSent(); if (!expectsPayload) { socket[kReset2] = true; } resume(client); } catch (err) { util5.destroy(isH22 ? h2stream : socket, err); } } __name(writeBlob, "writeBlob"); async function writeIterable({ h2stream, body, client, request: request4, socket, contentLength, header, expectsPayload }) { assert38(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); let callback = null; function onDrain() { if (callback) { const cb2 = callback; callback = null; cb2(); } } __name(onDrain, "onDrain"); const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve25, reject) => { assert38(callback === null); if (socket[kError]) { reject(socket[kError]); } else { callback = resolve25; } }), "waitForDrain"); if (client[kHTTPConnVersion] === "h2") { h2stream.on("close", onDrain).on("drain", onDrain); try { for await (const chunk of body) { if (socket[kError]) { throw socket[kError]; } const res = h2stream.write(chunk); request4.onBodySent(chunk); if (!res) { await waitForDrain(); } } } catch (err) { h2stream.destroy(err); } finally { request4.onRequestSent(); h2stream.end(); h2stream.off("close", onDrain).off("drain", onDrain); } return; } socket.on("close", onDrain).on("drain", onDrain); const writer = new AsyncWriter({ socket, request: request4, contentLength, client, expectsPayload, header }); try { for await (const chunk of body) { if (socket[kError]) { throw socket[kError]; } if (!writer.write(chunk)) { await waitForDrain(); } } writer.end(); } catch (err) { writer.destroy(err); } finally { socket.off("close", onDrain).off("drain", onDrain); } } __name(writeIterable, "writeIterable"); var AsyncWriter = class { constructor({ socket, request: request4, contentLength, client, expectsPayload, header }) { this.socket = socket; this.request = request4; this.contentLength = contentLength; this.client = client; this.bytesWritten = 0; this.expectsPayload = expectsPayload; this.header = header; socket[kWriting] = true; } write(chunk) { const { socket, request: request4, contentLength, client, bytesWritten, expectsPayload, header } = this; if (socket[kError]) { throw socket[kError]; } if (socket.destroyed) { return false; } const len = Buffer.byteLength(chunk); if (!len) { return true; } if (contentLength !== null && bytesWritten + len > contentLength) { if (client[kStrictContentLength]) { throw new RequestContentLengthMismatchError(); } process.emitWarning(new RequestContentLengthMismatchError()); } socket.cork(); if (bytesWritten === 0) { if (!expectsPayload) { socket[kReset2] = true; } if (contentLength === null) { socket.write(`${header}transfer-encoding: chunked\r `, "latin1"); } else { socket.write(`${header}content-length: ${contentLength}\r \r `, "latin1"); } } if (contentLength === null) { socket.write(`\r ${len.toString(16)}\r `, "latin1"); } this.bytesWritten += len; const ret = socket.write(chunk); socket.uncork(); request4.onBodySent(chunk); if (!ret) { if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { if (socket[kParser].timeout.refresh) { socket[kParser].timeout.refresh(); } } } return ret; } end() { const { socket, contentLength, client, bytesWritten, expectsPayload, header, request: request4 } = this; request4.onRequestSent(); socket[kWriting] = false; if (socket[kError]) { throw socket[kError]; } if (socket.destroyed) { return; } if (bytesWritten === 0) { if (expectsPayload) { socket.write(`${header}content-length: 0\r \r `, "latin1"); } else { socket.write(`${header}\r `, "latin1"); } } else if (contentLength === null) { socket.write("\r\n0\r\n\r\n", "latin1"); } if (contentLength !== null && bytesWritten !== contentLength) { if (client[kStrictContentLength]) { throw new RequestContentLengthMismatchError(); } else { process.emitWarning(new RequestContentLengthMismatchError()); } } if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { if (socket[kParser].timeout.refresh) { socket[kParser].timeout.refresh(); } } resume(client); } destroy(err) { const { socket, client } = this; socket[kWriting] = false; if (err) { assert38(client[kRunning] <= 1, "pipeline should only contain this request"); util5.destroy(socket, err); } } }; __name(AsyncWriter, "AsyncWriter"); function errorRequest(client, request4, err) { try { request4.onError(err); assert38(request4.aborted); } catch (err2) { client.emit("error", err2); } } __name(errorRequest, "errorRequest"); module3.exports = Client2; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/node/fixed-queue.js var require_fixed_queue = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/node/fixed-queue.js"(exports2, module3) { "use strict"; init_import_meta_url(); var kSize = 2048; var kMask = kSize - 1; var FixedCircularBuffer = class { constructor() { this.bottom = 0; this.top = 0; this.list = new Array(kSize); this.next = null; } isEmpty() { return this.top === this.bottom; } isFull() { return (this.top + 1 & kMask) === this.bottom; } push(data) { this.list[this.top] = data; this.top = this.top + 1 & kMask; } shift() { const nextItem = this.list[this.bottom]; if (nextItem === void 0) return null; this.list[this.bottom] = void 0; this.bottom = this.bottom + 1 & kMask; return nextItem; } }; __name(FixedCircularBuffer, "FixedCircularBuffer"); module3.exports = /* @__PURE__ */ __name(class FixedQueue { constructor() { this.head = this.tail = new FixedCircularBuffer(); } isEmpty() { return this.head.isEmpty(); } push(data) { if (this.head.isFull()) { this.head = this.head.next = new FixedCircularBuffer(); } this.head.push(data); } shift() { const tail = this.tail; const next = tail.shift(); if (tail.isEmpty() && tail.next !== null) { this.tail = tail.next; } return next; } }, "FixedQueue"); } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/pool-stats.js var require_pool_stats = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/pool-stats.js"(exports2, module3) { init_import_meta_url(); var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); var kPool = Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; } get connected() { return this[kPool][kConnected]; } get free() { return this[kPool][kFree]; } get pending() { return this[kPool][kPending]; } get queued() { return this[kPool][kQueued]; } get running() { return this[kPool][kRunning]; } get size() { return this[kPool][kSize]; } }; __name(PoolStats, "PoolStats"); module3.exports = PoolStats; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/pool-base.js var require_pool_base = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/pool-base.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DispatcherBase = require_dispatcher_base(); var FixedQueue = require_fixed_queue(); var { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require_symbols(); var PoolStats = require_pool_stats(); var kClients = Symbol("clients"); var kNeedDrain = Symbol("needDrain"); var kQueue = Symbol("queue"); var kClosedResolve = Symbol("closed resolve"); var kOnDrain = Symbol("onDrain"); var kOnConnect = Symbol("onConnect"); var kOnDisconnect = Symbol("onDisconnect"); var kOnConnectionError = Symbol("onConnectionError"); var kGetDispatcher = Symbol("get dispatcher"); var kAddClient = Symbol("add client"); var kRemoveClient = Symbol("remove client"); var kStats = Symbol("stats"); var PoolBase = class extends DispatcherBase { constructor() { super(); this[kQueue] = new FixedQueue(); this[kClients] = []; this[kQueued] = 0; const pool = this; this[kOnDrain] = /* @__PURE__ */ __name(function onDrain(origin, targets) { const queue = pool[kQueue]; let needDrain = false; while (!needDrain) { const item = queue.shift(); if (!item) { break; } pool[kQueued]--; needDrain = !this.dispatch(item.opts, item.handler); } this[kNeedDrain] = needDrain; if (!this[kNeedDrain] && pool[kNeedDrain]) { pool[kNeedDrain] = false; pool.emit("drain", origin, [pool, ...targets]); } if (pool[kClosedResolve] && queue.isEmpty()) { Promise.all(pool[kClients].map((c6) => c6.close())).then(pool[kClosedResolve]); } }, "onDrain"); this[kOnConnect] = (origin, targets) => { pool.emit("connect", origin, [pool, ...targets]); }; this[kOnDisconnect] = (origin, targets, err) => { pool.emit("disconnect", origin, [pool, ...targets], err); }; this[kOnConnectionError] = (origin, targets, err) => { pool.emit("connectionError", origin, [pool, ...targets], err); }; this[kStats] = new PoolStats(this); } get [kBusy]() { return this[kNeedDrain]; } get [kConnected]() { return this[kClients].filter((client) => client[kConnected]).length; } get [kFree]() { return this[kClients].filter((client) => client[kConnected] && !client[kNeedDrain]).length; } get [kPending]() { let ret = this[kQueued]; for (const { [kPending]: pending } of this[kClients]) { ret += pending; } return ret; } get [kRunning]() { let ret = 0; for (const { [kRunning]: running } of this[kClients]) { ret += running; } return ret; } get [kSize]() { let ret = this[kQueued]; for (const { [kSize]: size } of this[kClients]) { ret += size; } return ret; } get stats() { return this[kStats]; } async [kClose]() { if (this[kQueue].isEmpty()) { return Promise.all(this[kClients].map((c6) => c6.close())); } else { return new Promise((resolve25) => { this[kClosedResolve] = resolve25; }); } } async [kDestroy](err) { while (true) { const item = this[kQueue].shift(); if (!item) { break; } item.handler.onError(err); } return Promise.all(this[kClients].map((c6) => c6.destroy(err))); } [kDispatch](opts, handler31) { const dispatcher = this[kGetDispatcher](); if (!dispatcher) { this[kNeedDrain] = true; this[kQueue].push({ opts, handler: handler31 }); this[kQueued]++; } else if (!dispatcher.dispatch(opts, handler31)) { dispatcher[kNeedDrain] = true; this[kNeedDrain] = !this[kGetDispatcher](); } return !this[kNeedDrain]; } [kAddClient](client) { client.on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); this[kClients].push(client); if (this[kNeedDrain]) { process.nextTick(() => { if (this[kNeedDrain]) { this[kOnDrain](client[kUrl], [this, client]); } }); } return this; } [kRemoveClient](client) { client.close(() => { const idx = this[kClients].indexOf(client); if (idx !== -1) { this[kClients].splice(idx, 1); } }); this[kNeedDrain] = this[kClients].some((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true); } }; __name(PoolBase, "PoolBase"); module3.exports = { PoolBase, kClients, kNeedDrain, kAddClient, kRemoveClient, kGetDispatcher }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/pool.js var require_pool = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/pool.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { PoolBase, kClients, kNeedDrain, kAddClient, kGetDispatcher } = require_pool_base(); var Client2 = require_client(); var { InvalidArgumentError } = require_errors(); var util5 = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); var kOptions = Symbol("options"); var kConnections = Symbol("connections"); var kFactory = Symbol("factory"); function defaultFactory(origin, opts) { return new Client2(origin, opts); } __name(defaultFactory, "defaultFactory"); var Pool = class extends PoolBase { constructor(origin, { connections, factory = defaultFactory, connect, connectTimeout, tls, maxCachedSessions, socketPath, autoSelectFamily, autoSelectFamilyAttemptTimeout, allowH2, ...options32 } = {}) { super(); if (connections != null && (!Number.isFinite(connections) || connections < 0)) { throw new InvalidArgumentError("invalid connections"); } if (typeof factory !== "function") { throw new InvalidArgumentError("factory must be a function."); } if (connect != null && typeof connect !== "function" && typeof connect !== "object") { throw new InvalidArgumentError("connect must be a function or an object"); } if (typeof connect !== "function") { connect = buildConnector({ ...tls, maxCachedSessions, allowH2, socketPath, timeout: connectTimeout, ...util5.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, ...connect }); } this[kInterceptors] = options32.interceptors && options32.interceptors.Pool && Array.isArray(options32.interceptors.Pool) ? options32.interceptors.Pool : []; this[kConnections] = connections || null; this[kUrl] = util5.parseOrigin(origin); this[kOptions] = { ...util5.deepClone(options32), connect, allowH2 }; this[kOptions].interceptors = options32.interceptors ? { ...options32.interceptors } : void 0; this[kFactory] = factory; } [kGetDispatcher]() { let dispatcher = this[kClients].find((dispatcher2) => !dispatcher2[kNeedDrain]); if (dispatcher) { return dispatcher; } if (!this[kConnections] || this[kClients].length < this[kConnections]) { dispatcher = this[kFactory](this[kUrl], this[kOptions]); this[kAddClient](dispatcher); } return dispatcher; } }; __name(Pool, "Pool"); module3.exports = Pool; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/balanced-pool.js var require_balanced_pool = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/balanced-pool.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { BalancedPoolMissingUpstreamError, InvalidArgumentError } = require_errors(); var { PoolBase, kClients, kNeedDrain, kAddClient, kRemoveClient, kGetDispatcher } = require_pool_base(); var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); var kFactory = Symbol("factory"); var kOptions = Symbol("options"); var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); var kCurrentWeight = Symbol("kCurrentWeight"); var kIndex = Symbol("kIndex"); var kWeight = Symbol("kWeight"); var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); var kErrorPenalty = Symbol("kErrorPenalty"); function getGreatestCommonDivisor(a5, b6) { if (b6 === 0) return a5; return getGreatestCommonDivisor(b6, a5 % b6); } __name(getGreatestCommonDivisor, "getGreatestCommonDivisor"); function defaultFactory(origin, opts) { return new Pool(origin, opts); } __name(defaultFactory, "defaultFactory"); var BalancedPool = class extends PoolBase { constructor(upstreams = [], { factory = defaultFactory, ...opts } = {}) { super(); this[kOptions] = opts; this[kIndex] = -1; this[kCurrentWeight] = 0; this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100; this[kErrorPenalty] = this[kOptions].errorPenalty || 15; if (!Array.isArray(upstreams)) { upstreams = [upstreams]; } if (typeof factory !== "function") { throw new InvalidArgumentError("factory must be a function."); } this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) ? opts.interceptors.BalancedPool : []; this[kFactory] = factory; for (const upstream of upstreams) { this.addUpstream(upstream); } this._updateBalancedPoolStats(); } addUpstream(upstream) { const upstreamOrigin = parseOrigin(upstream).origin; if (this[kClients].find((pool2) => pool2[kUrl].origin === upstreamOrigin && pool2.closed !== true && pool2.destroyed !== true)) { return this; } const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])); this[kAddClient](pool); pool.on("connect", () => { pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]); }); pool.on("connectionError", () => { pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); this._updateBalancedPoolStats(); }); pool.on("disconnect", (...args) => { const err = args[2]; if (err && err.code === "UND_ERR_SOCKET") { pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); this._updateBalancedPoolStats(); } }); for (const client of this[kClients]) { client[kWeight] = this[kMaxWeightPerServer]; } this._updateBalancedPoolStats(); return this; } _updateBalancedPoolStats() { this[kGreatestCommonDivisor] = this[kClients].map((p6) => p6[kWeight]).reduce(getGreatestCommonDivisor, 0); } removeUpstream(upstream) { const upstreamOrigin = parseOrigin(upstream).origin; const pool = this[kClients].find((pool2) => pool2[kUrl].origin === upstreamOrigin && pool2.closed !== true && pool2.destroyed !== true); if (pool) { this[kRemoveClient](pool); } return this; } get upstreams() { return this[kClients].filter((dispatcher) => dispatcher.closed !== true && dispatcher.destroyed !== true).map((p6) => p6[kUrl].origin); } [kGetDispatcher]() { if (this[kClients].length === 0) { throw new BalancedPoolMissingUpstreamError(); } const dispatcher = this[kClients].find((dispatcher2) => !dispatcher2[kNeedDrain] && dispatcher2.closed !== true && dispatcher2.destroyed !== true); if (!dispatcher) { return; } const allClientsBusy = this[kClients].map((pool) => pool[kNeedDrain]).reduce((a5, b6) => a5 && b6, true); if (allClientsBusy) { return; } let counter = 0; let maxWeightIndex = this[kClients].findIndex((pool) => !pool[kNeedDrain]); while (counter++ < this[kClients].length) { this[kIndex] = (this[kIndex] + 1) % this[kClients].length; const pool = this[kClients][this[kIndex]]; if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) { maxWeightIndex = this[kIndex]; } if (this[kIndex] === 0) { this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]; if (this[kCurrentWeight] <= 0) { this[kCurrentWeight] = this[kMaxWeightPerServer]; } } if (pool[kWeight] >= this[kCurrentWeight] && !pool[kNeedDrain]) { return pool; } } this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]; this[kIndex] = maxWeightIndex; return this[kClients][maxWeightIndex]; } }; __name(BalancedPool, "BalancedPool"); module3.exports = BalancedPool; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/compat/dispatcher-weakref.js var require_dispatcher_weakref = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/compat/dispatcher-weakref.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { kConnected, kSize } = require_symbols(); var CompatWeakRef = class { constructor(value) { this.value = value; } deref() { return this.value[kConnected] === 0 && this.value[kSize] === 0 ? void 0 : this.value; } }; __name(CompatWeakRef, "CompatWeakRef"); var CompatFinalizer = class { constructor(finalizer) { this.finalizer = finalizer; } register(dispatcher, key) { if (dispatcher.on) { dispatcher.on("disconnect", () => { if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) { this.finalizer(key); } }); } } }; __name(CompatFinalizer, "CompatFinalizer"); module3.exports = function() { if (process.env.NODE_V8_COVERAGE) { return { WeakRef: CompatWeakRef, FinalizationRegistry: CompatFinalizer }; } return { WeakRef: global.WeakRef || CompatWeakRef, FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer }; }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/agent.js var require_agent = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/agent.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { InvalidArgumentError } = require_errors(); var { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols(); var DispatcherBase = require_dispatcher_base(); var Pool = require_pool(); var Client2 = require_client(); var util5 = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); var kOnConnect = Symbol("onConnect"); var kOnDisconnect = Symbol("onDisconnect"); var kOnConnectionError = Symbol("onConnectionError"); var kMaxRedirections = Symbol("maxRedirections"); var kOnDrain = Symbol("onDrain"); var kFactory = Symbol("factory"); var kFinalizer = Symbol("finalizer"); var kOptions = Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client2(origin, opts) : new Pool(origin, opts); } __name(defaultFactory, "defaultFactory"); var Agent = class extends DispatcherBase { constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options32 } = {}) { super(); if (typeof factory !== "function") { throw new InvalidArgumentError("factory must be a function."); } if (connect != null && typeof connect !== "function" && typeof connect !== "object") { throw new InvalidArgumentError("connect must be a function or an object"); } if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { throw new InvalidArgumentError("maxRedirections must be a positive number"); } if (connect && typeof connect !== "function") { connect = { ...connect }; } this[kInterceptors] = options32.interceptors && options32.interceptors.Agent && Array.isArray(options32.interceptors.Agent) ? options32.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })]; this[kOptions] = { ...util5.deepClone(options32), connect }; this[kOptions].interceptors = options32.interceptors ? { ...options32.interceptors } : void 0; this[kMaxRedirections] = maxRedirections; this[kFactory] = factory; this[kClients] = /* @__PURE__ */ new Map(); this[kFinalizer] = new FinalizationRegistry( /* istanbul ignore next: gc is undeterministic */ (key) => { const ref = this[kClients].get(key); if (ref !== void 0 && ref.deref() === void 0) { this[kClients].delete(key); } } ); const agent = this; this[kOnDrain] = (origin, targets) => { agent.emit("drain", origin, [agent, ...targets]); }; this[kOnConnect] = (origin, targets) => { agent.emit("connect", origin, [agent, ...targets]); }; this[kOnDisconnect] = (origin, targets, err) => { agent.emit("disconnect", origin, [agent, ...targets], err); }; this[kOnConnectionError] = (origin, targets, err) => { agent.emit("connectionError", origin, [agent, ...targets], err); }; } get [kRunning]() { let ret = 0; for (const ref of this[kClients].values()) { const client = ref.deref(); if (client) { ret += client[kRunning]; } } return ret; } [kDispatch](opts, handler31) { let key; if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) { key = String(opts.origin); } else { throw new InvalidArgumentError("opts.origin must be a non-empty string or URL."); } const ref = this[kClients].get(key); let dispatcher = ref ? ref.deref() : null; if (!dispatcher) { dispatcher = this[kFactory](opts.origin, this[kOptions]).on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); this[kClients].set(key, new WeakRef2(dispatcher)); this[kFinalizer].register(dispatcher, key); } return dispatcher.dispatch(opts, handler31); } async [kClose]() { const closePromises = []; for (const ref of this[kClients].values()) { const client = ref.deref(); if (client) { closePromises.push(client.close()); } } await Promise.all(closePromises); } async [kDestroy](err) { const destroyPromises = []; for (const ref of this[kClients].values()) { const client = ref.deref(); if (client) { destroyPromises.push(client.destroy(err)); } } await Promise.all(destroyPromises); } }; __name(Agent, "Agent"); module3.exports = Agent; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/readable.js var require_readable = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/readable.js"(exports2, module3) { "use strict"; init_import_meta_url(); var assert38 = require("assert"); var { Readable: Readable8 } = require("stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require_errors(); var util5 = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob6; var kConsume = Symbol("kConsume"); var kReading = Symbol("kReading"); var kBody = Symbol("kBody"); var kAbort = Symbol("abort"); var kContentType = Symbol("kContentType"); var noop = /* @__PURE__ */ __name(() => { }, "noop"); module3.exports = /* @__PURE__ */ __name(class BodyReadable extends Readable8 { constructor({ resume, abort, contentType = "", highWaterMark = 64 * 1024 // Same as nodejs fs streams. }) { super({ autoDestroy: true, read: resume, highWaterMark }); this._readableState.dataEmitted = false; this[kAbort] = abort; this[kConsume] = null; this[kBody] = null; this[kContentType] = contentType; this[kReading] = false; } destroy(err) { if (this.destroyed) { return this; } if (!err && !this._readableState.endEmitted) { err = new RequestAbortedError(); } if (err) { this[kAbort](); } return super.destroy(err); } emit(ev, ...args) { if (ev === "data") { this._readableState.dataEmitted = true; } else if (ev === "error") { this._readableState.errorEmitted = true; } return super.emit(ev, ...args); } on(ev, ...args) { if (ev === "data" || ev === "readable") { this[kReading] = true; } return super.on(ev, ...args); } addListener(ev, ...args) { return this.on(ev, ...args); } off(ev, ...args) { const ret = super.off(ev, ...args); if (ev === "data" || ev === "readable") { this[kReading] = this.listenerCount("data") > 0 || this.listenerCount("readable") > 0; } return ret; } removeListener(ev, ...args) { return this.off(ev, ...args); } push(chunk) { if (this[kConsume] && chunk !== null && this.readableLength === 0) { consumePush(this[kConsume], chunk); return this[kReading] ? super.push(chunk) : true; } return super.push(chunk); } // https://fetch.spec.whatwg.org/#dom-body-text async text() { return consume(this, "text"); } // https://fetch.spec.whatwg.org/#dom-body-json async json() { return consume(this, "json"); } // https://fetch.spec.whatwg.org/#dom-body-blob async blob() { return consume(this, "blob"); } // https://fetch.spec.whatwg.org/#dom-body-arraybuffer async arrayBuffer() { return consume(this, "arrayBuffer"); } // https://fetch.spec.whatwg.org/#dom-body-formdata async formData() { throw new NotSupportedError(); } // https://fetch.spec.whatwg.org/#dom-body-bodyused get bodyUsed() { return util5.isDisturbed(this); } // https://fetch.spec.whatwg.org/#dom-body-body get body() { if (!this[kBody]) { this[kBody] = ReadableStreamFrom(this); if (this[kConsume]) { this[kBody].getReader(); assert38(this[kBody].locked); } } return this[kBody]; } dump(opts) { let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144; const signal = opts && opts.signal; if (signal) { try { if (typeof signal !== "object" || !("aborted" in signal)) { throw new InvalidArgumentError("signal must be an AbortSignal"); } util5.throwIfAborted(signal); } catch (err) { return Promise.reject(err); } } if (this.closed) { return Promise.resolve(null); } return new Promise((resolve25, reject) => { const signalListenerCleanup = signal ? util5.addAbortListener(signal, () => { this.destroy(); }) : noop; this.on("close", function() { signalListenerCleanup(); if (signal && signal.aborted) { reject(signal.reason || Object.assign(new Error("The operation was aborted"), { name: "AbortError" })); } else { resolve25(null); } }).on("error", noop).on("data", function(chunk) { limit -= chunk.length; if (limit <= 0) { this.destroy(); } }).resume(); }); } }, "BodyReadable"); function isLocked(self2) { return self2[kBody] && self2[kBody].locked === true || self2[kConsume]; } __name(isLocked, "isLocked"); function isUnusable(self2) { return util5.isDisturbed(self2) || isLocked(self2); } __name(isUnusable, "isUnusable"); async function consume(stream2, type) { if (isUnusable(stream2)) { throw new TypeError("unusable"); } assert38(!stream2[kConsume]); return new Promise((resolve25, reject) => { stream2[kConsume] = { type, stream: stream2, resolve: resolve25, reject, length: 0, body: [] }; stream2.on("error", function(err) { consumeFinish(this[kConsume], err); }).on("close", function() { if (this[kConsume].body !== null) { consumeFinish(this[kConsume], new RequestAbortedError()); } }); process.nextTick(consumeStart, stream2[kConsume]); }); } __name(consume, "consume"); function consumeStart(consume2) { if (consume2.body === null) { return; } const { _readableState: state2 } = consume2.stream; for (const chunk of state2.buffer) { consumePush(consume2, chunk); } if (state2.endEmitted) { consumeEnd(this[kConsume]); } else { consume2.stream.on("end", function() { consumeEnd(this[kConsume]); }); } consume2.stream.resume(); while (consume2.stream.read() != null) { } } __name(consumeStart, "consumeStart"); function consumeEnd(consume2) { const { type, body, resolve: resolve25, stream: stream2, length } = consume2; try { if (type === "text") { resolve25(toUSVString(Buffer.concat(body))); } else if (type === "json") { resolve25(JSON.parse(Buffer.concat(body))); } else if (type === "arrayBuffer") { const dst = new Uint8Array(length); let pos = 0; for (const buf of body) { dst.set(buf, pos); pos += buf.byteLength; } resolve25(dst.buffer); } else if (type === "blob") { if (!Blob6) { Blob6 = require("buffer").Blob; } resolve25(new Blob6(body, { type: stream2[kContentType] })); } consumeFinish(consume2); } catch (err) { stream2.destroy(err); } } __name(consumeEnd, "consumeEnd"); function consumePush(consume2, chunk) { consume2.length += chunk.length; consume2.body.push(chunk); } __name(consumePush, "consumePush"); function consumeFinish(consume2, err) { if (consume2.body === null) { return; } if (err) { consume2.reject(err); } else { consume2.resolve(); } consume2.type = null; consume2.stream = null; consume2.resolve = null; consume2.reject = null; consume2.length = 0; consume2.body = null; } __name(consumeFinish, "consumeFinish"); } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/util.js var require_util3 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/util.js"(exports2, module3) { init_import_meta_url(); var assert38 = require("assert"); var { ResponseStatusCodeError } = require_errors(); var { toUSVString } = require_util(); async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) { assert38(body); let chunks = []; let limit = 0; for await (const chunk of body) { chunks.push(chunk); limit += chunk.length; if (limit > 128 * 1024) { chunks = null; break; } } if (statusCode === 204 || !contentType || !chunks) { process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers)); return; } try { if (contentType.startsWith("application/json")) { const payload = JSON.parse(toUSVString(Buffer.concat(chunks))); process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers, payload)); return; } if (contentType.startsWith("text/")) { const payload = toUSVString(Buffer.concat(chunks)); process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers, payload)); return; } } catch (err) { } process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`, statusCode, headers)); } __name(getResolveErrorBodyCallback, "getResolveErrorBodyCallback"); module3.exports = { getResolveErrorBodyCallback }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/abort-signal.js var require_abort_signal = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/abort-signal.js"(exports2, module3) { init_import_meta_url(); var { addAbortListener } = require_util(); var { RequestAbortedError } = require_errors(); var kListener = Symbol("kListener"); var kSignal = Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); } else { self2.onError(new RequestAbortedError()); } } __name(abort, "abort"); function addSignal(self2, signal) { self2[kSignal] = null; self2[kListener] = null; if (!signal) { return; } if (signal.aborted) { abort(self2); return; } self2[kSignal] = signal; self2[kListener] = () => { abort(self2); }; addAbortListener(self2[kSignal], self2[kListener]); } __name(addSignal, "addSignal"); function removeSignal(self2) { if (!self2[kSignal]) { return; } if ("removeEventListener" in self2[kSignal]) { self2[kSignal].removeEventListener("abort", self2[kListener]); } else { self2[kSignal].removeListener("abort", self2[kListener]); } self2[kSignal] = null; self2[kListener] = null; } __name(removeSignal, "removeSignal"); module3.exports = { addSignal, removeSignal }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/api-request.js var require_api_request = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/api-request.js"(exports2, module3) { "use strict"; init_import_meta_url(); var Readable8 = require_readable(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var util5 = require_util(); var { getResolveErrorBodyCallback } = require_util3(); var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var RequestHandler = class extends AsyncResource { constructor(opts, callback) { if (!opts || typeof opts !== "object") { throw new InvalidArgumentError("invalid opts"); } const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts; try { if (typeof callback !== "function") { throw new InvalidArgumentError("invalid callback"); } if (highWaterMark && (typeof highWaterMark !== "number" || highWaterMark < 0)) { throw new InvalidArgumentError("invalid highWaterMark"); } if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); } if (method === "CONNECT") { throw new InvalidArgumentError("invalid method"); } if (onInfo && typeof onInfo !== "function") { throw new InvalidArgumentError("invalid onInfo callback"); } super("UNDICI_REQUEST"); } catch (err) { if (util5.isStream(body)) { util5.destroy(body.on("error", util5.nop), err); } throw err; } this.responseHeaders = responseHeaders || null; this.opaque = opaque || null; this.callback = callback; this.res = null; this.abort = null; this.body = body; this.trailers = {}; this.context = null; this.onInfo = onInfo || null; this.throwOnError = throwOnError; this.highWaterMark = highWaterMark; if (util5.isStream(body)) { body.on("error", (err) => { this.onError(err); }); } addSignal(this, signal); } onConnect(abort, context2) { if (!this.callback) { throw new RequestAbortedError(); } this.abort = abort; this.context = context2; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const { callback, opaque, abort, context: context2, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); } return; } const parsedHeaders = responseHeaders === "raw" ? util5.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; const body = new Readable8({ resume, abort, contentType, highWaterMark }); this.callback = null; this.res = body; if (callback !== null) { if (this.throwOnError && statusCode >= 400) { this.runInAsyncScope( getResolveErrorBodyCallback, null, { callback, body, contentType, statusCode, statusMessage, headers } ); } else { this.runInAsyncScope(callback, null, null, { statusCode, headers, trailers: this.trailers, opaque, body, context: context2 }); } } } onData(chunk) { const { res } = this; return res.push(chunk); } onComplete(trailers) { const { res } = this; removeSignal(this); util5.parseHeaders(trailers, this.trailers); res.push(null); } onError(err) { const { res, callback, body, opaque } = this; removeSignal(this); if (callback) { this.callback = null; queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }); }); } if (res) { this.res = null; queueMicrotask(() => { util5.destroy(res, err); }); } if (body) { this.body = null; util5.destroy(body, err); } } }; __name(RequestHandler, "RequestHandler"); function request4(opts, callback) { if (callback === void 0) { return new Promise((resolve25, reject) => { request4.call(this, opts, (err, data) => { return err ? reject(err) : resolve25(data); }); }); } try { this.dispatch(opts, new RequestHandler(opts, callback)); } catch (err) { if (typeof callback !== "function") { throw err; } const opaque = opts && opts.opaque; queueMicrotask(() => callback(err, { opaque })); } } __name(request4, "request"); module3.exports = request4; module3.exports.RequestHandler = RequestHandler; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/api-stream.js var require_api_stream = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/api-stream.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { finished, PassThrough: PassThrough3 } = require("stream"); var { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError } = require_errors(); var util5 = require_util(); var { getResolveErrorBodyCallback } = require_util3(); var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var StreamHandler = class extends AsyncResource { constructor(opts, factory, callback) { if (!opts || typeof opts !== "object") { throw new InvalidArgumentError("invalid opts"); } const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts; try { if (typeof callback !== "function") { throw new InvalidArgumentError("invalid callback"); } if (typeof factory !== "function") { throw new InvalidArgumentError("invalid factory"); } if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); } if (method === "CONNECT") { throw new InvalidArgumentError("invalid method"); } if (onInfo && typeof onInfo !== "function") { throw new InvalidArgumentError("invalid onInfo callback"); } super("UNDICI_STREAM"); } catch (err) { if (util5.isStream(body)) { util5.destroy(body.on("error", util5.nop), err); } throw err; } this.responseHeaders = responseHeaders || null; this.opaque = opaque || null; this.factory = factory; this.callback = callback; this.res = null; this.abort = null; this.context = null; this.trailers = null; this.body = body; this.onInfo = onInfo || null; this.throwOnError = throwOnError || false; if (util5.isStream(body)) { body.on("error", (err) => { this.onError(err); }); } addSignal(this, signal); } onConnect(abort, context2) { if (!this.callback) { throw new RequestAbortedError(); } this.abort = abort; this.context = context2; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const { factory, opaque, context: context2, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); } return; } this.factory = null; let res; if (this.throwOnError && statusCode >= 400) { const parsedHeaders = responseHeaders === "raw" ? util5.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; res = new PassThrough3(); this.callback = null; this.runInAsyncScope( getResolveErrorBodyCallback, null, { callback, body: res, contentType, statusCode, statusMessage, headers } ); } else { if (factory === null) { return; } res = this.runInAsyncScope(factory, null, { statusCode, headers, opaque, context: context2 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); } finished(res, { readable: false }, (err) => { const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this; this.res = null; if (err || !res2.readable) { util5.destroy(res2, err); } this.callback = null; this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers }); if (err) { abort(); } }); } res.on("drain", resume); this.res = res; const needDrain = res.writableNeedDrain !== void 0 ? res.writableNeedDrain : res._writableState && res._writableState.needDrain; return needDrain !== true; } onData(chunk) { const { res } = this; return res ? res.write(chunk) : true; } onComplete(trailers) { const { res } = this; removeSignal(this); if (!res) { return; } this.trailers = util5.parseHeaders(trailers); res.end(); } onError(err) { const { res, callback, opaque, body } = this; removeSignal(this); this.factory = null; if (res) { this.res = null; util5.destroy(res, err); } else if (callback) { this.callback = null; queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }); }); } if (body) { this.body = null; util5.destroy(body, err); } } }; __name(StreamHandler, "StreamHandler"); function stream2(opts, factory, callback) { if (callback === void 0) { return new Promise((resolve25, reject) => { stream2.call(this, opts, factory, (err, data) => { return err ? reject(err) : resolve25(data); }); }); } try { this.dispatch(opts, new StreamHandler(opts, factory, callback)); } catch (err) { if (typeof callback !== "function") { throw err; } const opaque = opts && opts.opaque; queueMicrotask(() => callback(err, { opaque })); } } __name(stream2, "stream"); module3.exports = stream2; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/api-pipeline.js var require_api_pipeline = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/api-pipeline.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { Readable: Readable8, Duplex, PassThrough: PassThrough3 } = require("stream"); var { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError } = require_errors(); var util5 = require_util(); var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert38 = require("assert"); var kResume = Symbol("resume"); var PipelineRequest = class extends Readable8 { constructor() { super({ autoDestroy: true }); this[kResume] = null; } _read() { const { [kResume]: resume } = this; if (resume) { this[kResume] = null; resume(); } } _destroy(err, callback) { this._read(); callback(err); } }; __name(PipelineRequest, "PipelineRequest"); var PipelineResponse = class extends Readable8 { constructor(resume) { super({ autoDestroy: true }); this[kResume] = resume; } _read() { this[kResume](); } _destroy(err, callback) { if (!err && !this._readableState.endEmitted) { err = new RequestAbortedError(); } callback(err); } }; __name(PipelineResponse, "PipelineResponse"); var PipelineHandler = class extends AsyncResource { constructor(opts, handler31) { if (!opts || typeof opts !== "object") { throw new InvalidArgumentError("invalid opts"); } if (typeof handler31 !== "function") { throw new InvalidArgumentError("invalid handler"); } const { signal, method, opaque, onInfo, responseHeaders } = opts; if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); } if (method === "CONNECT") { throw new InvalidArgumentError("invalid method"); } if (onInfo && typeof onInfo !== "function") { throw new InvalidArgumentError("invalid onInfo callback"); } super("UNDICI_PIPELINE"); this.opaque = opaque || null; this.responseHeaders = responseHeaders || null; this.handler = handler31; this.abort = null; this.context = null; this.onInfo = onInfo || null; this.req = new PipelineRequest().on("error", util5.nop); this.ret = new Duplex({ readableObjectMode: opts.objectMode, autoDestroy: true, read: () => { const { body } = this; if (body && body.resume) { body.resume(); } }, write: (chunk, encoding, callback) => { const { req } = this; if (req.push(chunk, encoding) || req._readableState.destroyed) { callback(); } else { req[kResume] = callback; } }, destroy: (err, callback) => { const { body, req, res, ret, abort } = this; if (!err && !ret._readableState.endEmitted) { err = new RequestAbortedError(); } if (abort && err) { abort(); } util5.destroy(body, err); util5.destroy(req, err); util5.destroy(res, err); removeSignal(this); callback(err); } }).on("prefinish", () => { const { req } = this; req.push(null); }); this.res = null; addSignal(this, signal); } onConnect(abort, context2) { const { ret, res } = this; assert38(!res, "pipeline cannot be retried"); if (ret.destroyed) { throw new RequestAbortedError(); } this.abort = abort; this.context = context2; } onHeaders(statusCode, rawHeaders, resume) { const { opaque, handler: handler31, context: context2 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders); this.onInfo({ statusCode, headers }); } return; } this.res = new PipelineResponse(resume); let body; try { this.handler = null; const headers = this.responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders); body = this.runInAsyncScope(handler31, null, { statusCode, headers, opaque, body: this.res, context: context2 }); } catch (err) { this.res.on("error", util5.nop); throw err; } if (!body || typeof body.on !== "function") { throw new InvalidReturnValueError("expected Readable"); } body.on("data", (chunk) => { const { ret, body: body2 } = this; if (!ret.push(chunk) && body2.pause) { body2.pause(); } }).on("error", (err) => { const { ret } = this; util5.destroy(ret, err); }).on("end", () => { const { ret } = this; ret.push(null); }).on("close", () => { const { ret } = this; if (!ret._readableState.ended) { util5.destroy(ret, new RequestAbortedError()); } }); this.body = body; } onData(chunk) { const { res } = this; return res.push(chunk); } onComplete(trailers) { const { res } = this; res.push(null); } onError(err) { const { ret } = this; this.handler = null; util5.destroy(ret, err); } }; __name(PipelineHandler, "PipelineHandler"); function pipeline(opts, handler31) { try { const pipelineHandler = new PipelineHandler(opts, handler31); this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler); return pipelineHandler.ret; } catch (err) { return new PassThrough3().destroy(err); } } __name(pipeline, "pipeline"); module3.exports = pipeline; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/api-upgrade.js var require_api_upgrade = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/api-upgrade.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors(); var { AsyncResource } = require("async_hooks"); var util5 = require_util(); var { addSignal, removeSignal } = require_abort_signal(); var assert38 = require("assert"); var UpgradeHandler = class extends AsyncResource { constructor(opts, callback) { if (!opts || typeof opts !== "object") { throw new InvalidArgumentError("invalid opts"); } if (typeof callback !== "function") { throw new InvalidArgumentError("invalid callback"); } const { signal, opaque, responseHeaders } = opts; if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); } super("UNDICI_UPGRADE"); this.responseHeaders = responseHeaders || null; this.opaque = opaque || null; this.callback = callback; this.abort = null; this.context = null; addSignal(this, signal); } onConnect(abort, context2) { if (!this.callback) { throw new RequestAbortedError(); } this.abort = abort; this.context = null; } onHeaders() { throw new SocketError("bad upgrade", null); } onUpgrade(statusCode, rawHeaders, socket) { const { callback, opaque, context: context2 } = this; assert38.strictEqual(statusCode, 101); removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders); this.runInAsyncScope(callback, null, null, { headers, socket, opaque, context: context2 }); } onError(err) { const { callback, opaque } = this; removeSignal(this); if (callback) { this.callback = null; queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }); }); } } }; __name(UpgradeHandler, "UpgradeHandler"); function upgrade(opts, callback) { if (callback === void 0) { return new Promise((resolve25, reject) => { upgrade.call(this, opts, (err, data) => { return err ? reject(err) : resolve25(data); }); }); } try { const upgradeHandler = new UpgradeHandler(opts, callback); this.dispatch({ ...opts, method: opts.method || "GET", upgrade: opts.protocol || "Websocket" }, upgradeHandler); } catch (err) { if (typeof callback !== "function") { throw err; } const opaque = opts && opts.opaque; queueMicrotask(() => callback(err, { opaque })); } } __name(upgrade, "upgrade"); module3.exports = upgrade; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/api-connect.js var require_api_connect = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/api-connect.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { AsyncResource } = require("async_hooks"); var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors(); var util5 = require_util(); var { addSignal, removeSignal } = require_abort_signal(); var ConnectHandler = class extends AsyncResource { constructor(opts, callback) { if (!opts || typeof opts !== "object") { throw new InvalidArgumentError("invalid opts"); } if (typeof callback !== "function") { throw new InvalidArgumentError("invalid callback"); } const { signal, opaque, responseHeaders } = opts; if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") { throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget"); } super("UNDICI_CONNECT"); this.opaque = opaque || null; this.responseHeaders = responseHeaders || null; this.callback = callback; this.abort = null; addSignal(this, signal); } onConnect(abort, context2) { if (!this.callback) { throw new RequestAbortedError(); } this.abort = abort; this.context = context2; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { const { callback, opaque, context: context2 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; if (headers != null) { headers = this.responseHeaders === "raw" ? util5.parseRawHeaders(rawHeaders) : util5.parseHeaders(rawHeaders); } this.runInAsyncScope(callback, null, null, { statusCode, headers, socket, opaque, context: context2 }); } onError(err) { const { callback, opaque } = this; removeSignal(this); if (callback) { this.callback = null; queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }); }); } } }; __name(ConnectHandler, "ConnectHandler"); function connect(opts, callback) { if (callback === void 0) { return new Promise((resolve25, reject) => { connect.call(this, opts, (err, data) => { return err ? reject(err) : resolve25(data); }); }); } try { const connectHandler = new ConnectHandler(opts, callback); this.dispatch({ ...opts, method: "CONNECT" }, connectHandler); } catch (err) { if (typeof callback !== "function") { throw err; } const opaque = opts && opts.opaque; queueMicrotask(() => callback(err, { opaque })); } } __name(connect, "connect"); module3.exports = connect; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/index.js var require_api = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/api/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports.request = require_api_request(); module3.exports.stream = require_api_stream(); module3.exports.pipeline = require_api_pipeline(); module3.exports.upgrade = require_api_upgrade(); module3.exports.connect = require_api_connect(); } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-errors.js var require_mock_errors = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-errors.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { UndiciError } = require_errors(); var MockNotMatchedError = class extends UndiciError { constructor(message) { super(message); Error.captureStackTrace(this, MockNotMatchedError); this.name = "MockNotMatchedError"; this.message = message || "The request does not match any registered mock dispatches"; this.code = "UND_MOCK_ERR_MOCK_NOT_MATCHED"; } }; __name(MockNotMatchedError, "MockNotMatchedError"); module3.exports = { MockNotMatchedError }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-symbols.js var require_mock_symbols = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-symbols.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = { kAgent: Symbol("agent"), kOptions: Symbol("options"), kFactory: Symbol("factory"), kDispatches: Symbol("dispatches"), kDispatchKey: Symbol("dispatch key"), kDefaultHeaders: Symbol("default headers"), kDefaultTrailers: Symbol("default trailers"), kContentLength: Symbol("content length"), kMockAgent: Symbol("mock agent"), kMockAgentSet: Symbol("mock agent set"), kMockAgentGet: Symbol("mock agent get"), kMockDispatch: Symbol("mock dispatch"), kClose: Symbol("close"), kOriginalClose: Symbol("original agent close"), kOrigin: Symbol("origin"), kIsMockActive: Symbol("is mock active"), kNetConnect: Symbol("net connect"), kGetNetConnect: Symbol("get net connect"), kConnected: Symbol("connected") }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-utils.js var require_mock_utils = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-utils.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { MockNotMatchedError } = require_mock_errors(); var { kDispatches, kMockAgent, kOriginalDispatch, kOrigin, kGetNetConnect } = require_mock_symbols(); var { buildURL, nop } = require_util(); var { STATUS_CODES } = require("http"); var { types: { isPromise: isPromise2 } } = require("util"); function matchValue(match2, value) { if (typeof match2 === "string") { return match2 === value; } if (match2 instanceof RegExp) { return match2.test(value); } if (typeof match2 === "function") { return match2(value) === true; } return false; } __name(matchValue, "matchValue"); function lowerCaseEntries(headers) { return Object.fromEntries( Object.entries(headers).map(([headerName, headerValue]) => { return [headerName.toLocaleLowerCase(), headerValue]; }) ); } __name(lowerCaseEntries, "lowerCaseEntries"); function getHeaderByName(headers, key) { if (Array.isArray(headers)) { for (let i5 = 0; i5 < headers.length; i5 += 2) { if (headers[i5].toLocaleLowerCase() === key.toLocaleLowerCase()) { return headers[i5 + 1]; } } return void 0; } else if (typeof headers.get === "function") { return headers.get(key); } else { return lowerCaseEntries(headers)[key.toLocaleLowerCase()]; } } __name(getHeaderByName, "getHeaderByName"); function buildHeadersFromArray(headers) { const clone = headers.slice(); const entries = []; for (let index = 0; index < clone.length; index += 2) { entries.push([clone[index], clone[index + 1]]); } return Object.fromEntries(entries); } __name(buildHeadersFromArray, "buildHeadersFromArray"); function matchHeaders(mockDispatch2, headers) { if (typeof mockDispatch2.headers === "function") { if (Array.isArray(headers)) { headers = buildHeadersFromArray(headers); } return mockDispatch2.headers(headers ? lowerCaseEntries(headers) : {}); } if (typeof mockDispatch2.headers === "undefined") { return true; } if (typeof headers !== "object" || typeof mockDispatch2.headers !== "object") { return false; } for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch2.headers)) { const headerValue = getHeaderByName(headers, matchHeaderName); if (!matchValue(matchHeaderValue, headerValue)) { return false; } } return true; } __name(matchHeaders, "matchHeaders"); function safeUrl(path72) { if (typeof path72 !== "string") { return path72; } const pathSegments = path72.split("?"); if (pathSegments.length !== 2) { return path72; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } __name(safeUrl, "safeUrl"); function matchKey(mockDispatch2, { path: path72, method, body, headers }) { const pathMatch = matchValue(mockDispatch2.path, path72); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); return pathMatch && methodMatch && bodyMatch && headersMatch; } __name(matchKey, "matchKey"); function getResponseData(data) { if (Buffer.isBuffer(data)) { return data; } else if (typeof data === "object") { return JSON.stringify(data); } else { return data.toString(); } } __name(getResponseData, "getResponseData"); function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath2 = typeof basePath === "string" ? safeUrl(basePath) : basePath; let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path72 }) => matchValue(safeUrl(path72), resolvedPath2)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath2}'`); } matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`); } matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== "undefined" ? matchValue(body, key.body) : true); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`); } matchedMockDispatches = matchedMockDispatches.filter((mockDispatch2) => matchHeaders(mockDispatch2, key.headers)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === "object" ? JSON.stringify(key.headers) : key.headers}'`); } return matchedMockDispatches[0]; } __name(getMockDispatch, "getMockDispatch"); function addMockDispatch(mockDispatches, key, data) { const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }; const replyData = typeof data === "function" ? { callback: data } : { ...data }; const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }; mockDispatches.push(newMockDispatch); return newMockDispatch; } __name(addMockDispatch, "addMockDispatch"); function deleteMockDispatch(mockDispatches, key) { const index = mockDispatches.findIndex((dispatch) => { if (!dispatch.consumed) { return false; } return matchKey(dispatch, key); }); if (index !== -1) { mockDispatches.splice(index, 1); } } __name(deleteMockDispatch, "deleteMockDispatch"); function buildKey(opts) { const { path: path72, method, body, headers, query } = opts; return { path: path72, method, body, headers, query }; } __name(buildKey, "buildKey"); function generateKeyValues(data) { return Object.entries(data).reduce((keyValuePairs, [key, value]) => [ ...keyValuePairs, Buffer.from(`${key}`), Array.isArray(value) ? value.map((x6) => Buffer.from(`${x6}`)) : Buffer.from(`${value}`) ], []); } __name(generateKeyValues, "generateKeyValues"); function getStatusText(statusCode) { return STATUS_CODES[statusCode] || "unknown"; } __name(getStatusText, "getStatusText"); async function getResponse(body) { const buffers = []; for await (const data of body) { buffers.push(data); } return Buffer.concat(buffers).toString("utf8"); } __name(getResponse, "getResponse"); function mockDispatch(opts, handler31) { const key = buildKey(opts); const mockDispatch2 = getMockDispatch(this[kDispatches], key); mockDispatch2.timesInvoked++; if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } const { data: { statusCode, data, headers, trailers, error: error2 }, delay, persist } = mockDispatch2; const { timesInvoked, times } = mockDispatch2; mockDispatch2.consumed = !persist && timesInvoked >= times; mockDispatch2.pending = timesInvoked < times; if (error2 !== null) { deleteMockDispatch(this[kDispatches], key); handler31.onError(error2); return true; } if (typeof delay === "number" && delay > 0) { setTimeout(() => { handleReply(this[kDispatches]); }, delay); } else { handleReply(this[kDispatches]); } function handleReply(mockDispatches, _data5 = data) { const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers; const body = typeof _data5 === "function" ? _data5({ ...opts, headers: optsHeaders }) : _data5; if (isPromise2(body)) { body.then((newData) => handleReply(mockDispatches, newData)); return; } const responseData = getResponseData(body); const responseHeaders = generateKeyValues(headers); const responseTrailers = generateKeyValues(trailers); handler31.abort = nop; handler31.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode)); handler31.onData(Buffer.from(responseData)); handler31.onComplete(responseTrailers); deleteMockDispatch(mockDispatches, key); } __name(handleReply, "handleReply"); function resume() { } __name(resume, "resume"); return true; } __name(mockDispatch, "mockDispatch"); function buildMockDispatch() { const agent = this[kMockAgent]; const origin = this[kOrigin]; const originalDispatch = this[kOriginalDispatch]; return /* @__PURE__ */ __name(function dispatch(opts, handler31) { if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler31); } catch (error2) { if (error2 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler31); } else { throw new MockNotMatchedError(`${error2.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { throw error2; } } } else { originalDispatch.call(this, opts, handler31); } }, "dispatch"); } __name(buildMockDispatch, "buildMockDispatch"); function checkNetConnect(netConnect, origin) { const url4 = new URL(origin); if (netConnect === true) { return true; } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url4.host))) { return true; } return false; } __name(checkNetConnect, "checkNetConnect"); function buildMockOptions(opts) { if (opts) { const { agent, ...mockOptions } = opts; return mockOptions; } } __name(buildMockOptions, "buildMockOptions"); module3.exports = { getResponseData, getMockDispatch, addMockDispatch, deleteMockDispatch, buildKey, generateKeyValues, matchValue, getResponse, getStatusText, mockDispatch, buildMockDispatch, checkNetConnect, buildMockOptions, getHeaderByName }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-interceptor.js var require_mock_interceptor = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-interceptor.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { getResponseData, buildKey, addMockDispatch } = require_mock_utils(); var { kDispatches, kDispatchKey, kDefaultHeaders, kDefaultTrailers, kContentLength, kMockDispatch } = require_mock_symbols(); var { InvalidArgumentError } = require_errors(); var { buildURL } = require_util(); var MockScope = class { constructor(mockDispatch) { this[kMockDispatch] = mockDispatch; } /** * Delay a reply by a set amount in ms. */ delay(waitInMs) { if (typeof waitInMs !== "number" || !Number.isInteger(waitInMs) || waitInMs <= 0) { throw new InvalidArgumentError("waitInMs must be a valid integer > 0"); } this[kMockDispatch].delay = waitInMs; return this; } /** * For a defined reply, never mark as consumed. */ persist() { this[kMockDispatch].persist = true; return this; } /** * Allow one to define a reply for a set amount of matching requests. */ times(repeatTimes) { if (typeof repeatTimes !== "number" || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { throw new InvalidArgumentError("repeatTimes must be a valid integer > 0"); } this[kMockDispatch].times = repeatTimes; return this; } }; __name(MockScope, "MockScope"); var MockInterceptor = class { constructor(opts, mockDispatches) { if (typeof opts !== "object") { throw new InvalidArgumentError("opts must be an object"); } if (typeof opts.path === "undefined") { throw new InvalidArgumentError("opts.path must be defined"); } if (typeof opts.method === "undefined") { opts.method = "GET"; } if (typeof opts.path === "string") { if (opts.query) { opts.path = buildURL(opts.path, opts.query); } else { const parsedURL = new URL(opts.path, "data://"); opts.path = parsedURL.pathname + parsedURL.search; } } if (typeof opts.method === "string") { opts.method = opts.method.toUpperCase(); } this[kDispatchKey] = buildKey(opts); this[kDispatches] = mockDispatches; this[kDefaultHeaders] = {}; this[kDefaultTrailers] = {}; this[kContentLength] = false; } createMockScopeDispatchData(statusCode, data, responseOptions = {}) { const responseData = getResponseData(data); const contentLength = this[kContentLength] ? { "content-length": responseData.length } : {}; const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }; const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }; return { statusCode, data, headers, trailers }; } validateReplyParameters(statusCode, data, responseOptions) { if (typeof statusCode === "undefined") { throw new InvalidArgumentError("statusCode must be defined"); } if (typeof data === "undefined") { throw new InvalidArgumentError("data must be defined"); } if (typeof responseOptions !== "object") { throw new InvalidArgumentError("responseOptions must be an object"); } } /** * Mock an undici request with a defined reply. */ reply(replyData) { if (typeof replyData === "function") { const wrappedDefaultsCallback = /* @__PURE__ */ __name((opts) => { const resolvedData = replyData(opts); if (typeof resolvedData !== "object") { throw new InvalidArgumentError("reply options callback must return an object"); } const { statusCode: statusCode2, data: data2 = "", responseOptions: responseOptions2 = {} } = resolvedData; this.validateReplyParameters(statusCode2, data2, responseOptions2); return { ...this.createMockScopeDispatchData(statusCode2, data2, responseOptions2) }; }, "wrappedDefaultsCallback"); const newMockDispatch2 = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback); return new MockScope(newMockDispatch2); } const [statusCode, data = "", responseOptions = {}] = [...arguments]; this.validateReplyParameters(statusCode, data, responseOptions); const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions); const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData); return new MockScope(newMockDispatch); } /** * Mock an undici request with a defined error. */ replyWithError(error2) { if (typeof error2 === "undefined") { throw new InvalidArgumentError("error must be defined"); } const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error2 }); return new MockScope(newMockDispatch); } /** * Set default reply headers on the interceptor for subsequent replies */ defaultReplyHeaders(headers) { if (typeof headers === "undefined") { throw new InvalidArgumentError("headers must be defined"); } this[kDefaultHeaders] = headers; return this; } /** * Set default reply trailers on the interceptor for subsequent replies */ defaultReplyTrailers(trailers) { if (typeof trailers === "undefined") { throw new InvalidArgumentError("trailers must be defined"); } this[kDefaultTrailers] = trailers; return this; } /** * Set reply content length header for replies on the interceptor */ replyContentLength() { this[kContentLength] = true; return this; } }; __name(MockInterceptor, "MockInterceptor"); module3.exports.MockInterceptor = MockInterceptor; module3.exports.MockScope = MockScope; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-client.js var require_mock_client = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-client.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { promisify: promisify3 } = require("util"); var Client2 = require_client(); var { buildMockDispatch } = require_mock_utils(); var { kDispatches, kMockAgent, kClose, kOriginalClose, kOrigin, kOriginalDispatch, kConnected } = require_mock_symbols(); var { MockInterceptor } = require_mock_interceptor(); var Symbols = require_symbols(); var { InvalidArgumentError } = require_errors(); var MockClient = class extends Client2 { constructor(origin, opts) { super(origin, opts); if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") { throw new InvalidArgumentError("Argument opts.agent must implement Agent"); } this[kMockAgent] = opts.agent; this[kOrigin] = origin; this[kDispatches] = []; this[kConnected] = 1; this[kOriginalDispatch] = this.dispatch; this[kOriginalClose] = this.close.bind(this); this.dispatch = buildMockDispatch.call(this); this.close = this[kClose]; } get [Symbols.kConnected]() { return this[kConnected]; } /** * Sets up the base interceptor for mocking replies from undici. */ intercept(opts) { return new MockInterceptor(opts, this[kDispatches]); } async [kClose]() { await promisify3(this[kOriginalClose])(); this[kConnected] = 0; this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); } }; __name(MockClient, "MockClient"); module3.exports = MockClient; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-pool.js var require_mock_pool = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-pool.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { promisify: promisify3 } = require("util"); var Pool = require_pool(); var { buildMockDispatch } = require_mock_utils(); var { kDispatches, kMockAgent, kClose, kOriginalClose, kOrigin, kOriginalDispatch, kConnected } = require_mock_symbols(); var { MockInterceptor } = require_mock_interceptor(); var Symbols = require_symbols(); var { InvalidArgumentError } = require_errors(); var MockPool = class extends Pool { constructor(origin, opts) { super(origin, opts); if (!opts || !opts.agent || typeof opts.agent.dispatch !== "function") { throw new InvalidArgumentError("Argument opts.agent must implement Agent"); } this[kMockAgent] = opts.agent; this[kOrigin] = origin; this[kDispatches] = []; this[kConnected] = 1; this[kOriginalDispatch] = this.dispatch; this[kOriginalClose] = this.close.bind(this); this.dispatch = buildMockDispatch.call(this); this.close = this[kClose]; } get [Symbols.kConnected]() { return this[kConnected]; } /** * Sets up the base interceptor for mocking replies from undici. */ intercept(opts) { return new MockInterceptor(opts, this[kDispatches]); } async [kClose]() { await promisify3(this[kOriginalClose])(); this[kConnected] = 0; this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); } }; __name(MockPool, "MockPool"); module3.exports = MockPool; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/pluralizer.js var require_pluralizer = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/pluralizer.js"(exports2, module3) { "use strict"; init_import_meta_url(); var singulars = { pronoun: "it", is: "is", was: "was", this: "this" }; var plurals = { pronoun: "they", is: "are", was: "were", this: "these" }; module3.exports = /* @__PURE__ */ __name(class Pluralizer { constructor(singular, plural2) { this.singular = singular; this.plural = plural2; } pluralize(count) { const one = count === 1; const keys = one ? singulars : plurals; const noun = one ? this.singular : this.plural; return { ...keys, count, noun }; } }, "Pluralizer"); } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/pending-interceptors-formatter.js var require_pending_interceptors_formatter = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/pending-interceptors-formatter.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { Transform } = require("stream"); var { Console: Console2 } = require("console"); module3.exports = /* @__PURE__ */ __name(class PendingInterceptorsFormatter { constructor({ disableColors } = {}) { this.transform = new Transform({ transform(chunk, _enc, cb2) { cb2(null, chunk); } }); this.logger = new Console2({ stdout: this.transform, inspectOptions: { colors: !disableColors && !process.env.CI } }); } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( ({ method, path: path72, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, Path: path72, "Status code": statusCode, Persistent: persist ? "\u2705" : "\u274C", Invocations: timesInvoked, Remaining: persist ? Infinity : times - timesInvoked }) ); this.logger.table(withPrettyHeaders); return this.transform.read().toString(); } }, "PendingInterceptorsFormatter"); } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-agent.js var require_mock_agent = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-agent.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { kClients } = require_symbols(); var Agent = require_agent(); var { kAgent, kMockAgentSet, kMockAgentGet, kDispatches, kIsMockActive, kNetConnect, kGetNetConnect, kOptions, kFactory } = require_mock_symbols(); var MockClient = require_mock_client(); var MockPool = require_mock_pool(); var { matchValue, buildMockOptions } = require_mock_utils(); var { InvalidArgumentError, UndiciError } = require_errors(); var Dispatcher2 = require_dispatcher(); var Pluralizer = require_pluralizer(); var PendingInterceptorsFormatter = require_pending_interceptors_formatter(); var FakeWeakRef = class { constructor(value) { this.value = value; } deref() { return this.value; } }; __name(FakeWeakRef, "FakeWeakRef"); var MockAgent = class extends Dispatcher2 { constructor(opts) { super(opts); this[kNetConnect] = true; this[kIsMockActive] = true; if (opts && opts.agent && typeof opts.agent.dispatch !== "function") { throw new InvalidArgumentError("Argument opts.agent must implement Agent"); } const agent = opts && opts.agent ? opts.agent : new Agent(opts); this[kAgent] = agent; this[kClients] = agent[kClients]; this[kOptions] = buildMockOptions(opts); } get(origin) { let dispatcher = this[kMockAgentGet](origin); if (!dispatcher) { dispatcher = this[kFactory](origin); this[kMockAgentSet](origin, dispatcher); } return dispatcher; } dispatch(opts, handler31) { this.get(opts.origin); return this[kAgent].dispatch(opts, handler31); } async close() { await this[kAgent].close(); this[kClients].clear(); } deactivate() { this[kIsMockActive] = false; } activate() { this[kIsMockActive] = true; } enableNetConnect(matcher) { if (typeof matcher === "string" || typeof matcher === "function" || matcher instanceof RegExp) { if (Array.isArray(this[kNetConnect])) { this[kNetConnect].push(matcher); } else { this[kNetConnect] = [matcher]; } } else if (typeof matcher === "undefined") { this[kNetConnect] = true; } else { throw new InvalidArgumentError("Unsupported matcher. Must be one of String|Function|RegExp."); } } disableNetConnect() { this[kNetConnect] = false; } // This is required to bypass issues caused by using global symbols - see: // https://github.com/nodejs/undici/issues/1447 get isMockActive() { return this[kIsMockActive]; } [kMockAgentSet](origin, dispatcher) { this[kClients].set(origin, new FakeWeakRef(dispatcher)); } [kFactory](origin) { const mockOptions = Object.assign({ agent: this }, this[kOptions]); return this[kOptions] && this[kOptions].connections === 1 ? new MockClient(origin, mockOptions) : new MockPool(origin, mockOptions); } [kMockAgentGet](origin) { const ref = this[kClients].get(origin); if (ref) { return ref.deref(); } if (typeof origin !== "string") { const dispatcher = this[kFactory]("http://localhost:9999"); this[kMockAgentSet](origin, dispatcher); return dispatcher; } for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) { const nonExplicitDispatcher = nonExplicitRef.deref(); if (nonExplicitDispatcher && typeof keyMatcher !== "string" && matchValue(keyMatcher, origin)) { const dispatcher = this[kFactory](origin); this[kMockAgentSet](origin, dispatcher); dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]; return dispatcher; } } } [kGetNetConnect]() { return this[kNetConnect]; } pendingInterceptors() { const mockAgentClients = this[kClients]; return Array.from(mockAgentClients.entries()).flatMap(([origin, scope]) => scope.deref()[kDispatches].map((dispatch) => ({ ...dispatch, origin }))).filter(({ pending }) => pending); } assertNoPendingInterceptors({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { const pending = this.pendingInterceptors(); if (pending.length === 0) { return; } const pluralizer = new Pluralizer("interceptor", "interceptors").pluralize(pending.length); throw new UndiciError(` ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: ${pendingInterceptorsFormatter.format(pending)} `.trim()); } }; __name(MockAgent, "MockAgent"); module3.exports = MockAgent; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/proxy-agent.js var require_proxy_agent = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/proxy-agent.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { kProxy, kClose, kDestroy, kInterceptors } = require_symbols(); var { URL: URL7 } = require("url"); var Agent = require_agent(); var Pool = require_pool(); var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); var kAgent = Symbol("proxy agent"); var kClient = Symbol("proxy client"); var kProxyHeaders = Symbol("proxy headers"); var kRequestTls = Symbol("request tls settings"); var kProxyTls = Symbol("proxy tls settings"); var kConnectEndpoint = Symbol("connect endpoint function"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } __name(defaultProtocolPort, "defaultProtocolPort"); function buildProxyOptions(opts) { if (typeof opts === "string") { opts = { uri: opts }; } if (!opts || !opts.uri) { throw new InvalidArgumentError("Proxy opts.uri is mandatory"); } return { uri: opts.uri, protocol: opts.protocol || "https" }; } __name(buildProxyOptions, "buildProxyOptions"); function defaultFactory(origin, opts) { return new Pool(origin, opts); } __name(defaultFactory, "defaultFactory"); var ProxyAgent2 = class extends DispatcherBase { constructor(opts) { super(opts); this[kProxy] = buildProxyOptions(opts); this[kAgent] = new Agent(opts); this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) ? opts.interceptors.ProxyAgent : []; if (typeof opts === "string") { opts = { uri: opts }; } if (!opts || !opts.uri) { throw new InvalidArgumentError("Proxy opts.uri is mandatory"); } const { clientFactory = defaultFactory } = opts; if (typeof clientFactory !== "function") { throw new InvalidArgumentError("Proxy opts.clientFactory must be a function."); } this[kRequestTls] = opts.requestTls; this[kProxyTls] = opts.proxyTls; this[kProxyHeaders] = opts.headers || {}; const resolvedUrl = new URL7(opts.uri); const { origin, port, host, username, password } = resolvedUrl; if (opts.auth && opts.token) { throw new InvalidArgumentError("opts.auth cannot be used in combination with opts.token"); } else if (opts.auth) { this[kProxyHeaders]["proxy-authorization"] = `Basic ${opts.auth}`; } else if (opts.token) { this[kProxyHeaders]["proxy-authorization"] = opts.token; } else if (username && password) { this[kProxyHeaders]["proxy-authorization"] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString("base64")}`; } const connect = buildConnector({ ...opts.proxyTls }); this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }); this[kClient] = clientFactory(resolvedUrl, { connect }); this[kAgent] = new Agent({ ...opts, connect: async (opts2, callback) => { let requestedHost = opts2.host; if (!opts2.port) { requestedHost += `:${defaultProtocolPort(opts2.protocol)}`; } try { const { socket, statusCode } = await this[kClient].connect({ origin, port, path: requestedHost, signal: opts2.signal, headers: { ...this[kProxyHeaders], host } }); if (statusCode !== 200) { socket.on("error", () => { }).destroy(); callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)); } if (opts2.protocol !== "https:") { callback(null, socket); return; } let servername; if (this[kRequestTls]) { servername = this[kRequestTls].servername; } else { servername = opts2.servername; } this[kConnectEndpoint]({ ...opts2, servername, httpSocket: socket }, callback); } catch (err) { callback(err); } } }); } dispatch(opts, handler31) { const { host } = new URL7(opts.origin); const headers = buildHeaders(opts.headers); throwIfProxyAuthIsSent(headers); return this[kAgent].dispatch( { ...opts, headers: { ...headers, host } }, handler31 ); } async [kClose]() { await this[kAgent].close(); await this[kClient].close(); } async [kDestroy]() { await this[kAgent].destroy(); await this[kClient].destroy(); } }; __name(ProxyAgent2, "ProxyAgent"); function buildHeaders(headers) { if (Array.isArray(headers)) { const headersPair = {}; for (let i5 = 0; i5 < headers.length; i5 += 2) { headersPair[headers[i5]] = headers[i5 + 1]; } return headersPair; } return headers; } __name(buildHeaders, "buildHeaders"); function throwIfProxyAuthIsSent(headers) { const existProxyAuth = headers && Object.keys(headers).find((key) => key.toLowerCase() === "proxy-authorization"); if (existProxyAuth) { throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); } } __name(throwIfProxyAuthIsSent, "throwIfProxyAuthIsSent"); module3.exports = ProxyAgent2; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/handler/RetryHandler.js var require_RetryHandler = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/handler/RetryHandler.js"(exports2, module3) { init_import_meta_url(); var assert38 = require("assert"); var { kRetryHandlerDefaultRetry } = require_symbols(); var { RequestRetryError } = require_errors(); var { isDisturbed, parseHeaders: parseHeaders2, parseRangeHeader } = require_util(); function calculateRetryAfterHeader(retryAfter) { const current = Date.now(); const diff = new Date(retryAfter).getTime() - current; return diff; } __name(calculateRetryAfterHeader, "calculateRetryAfterHeader"); var RetryHandler = class { constructor(opts, handlers2) { const { retryOptions, ...dispatchOpts } = opts; const { // Retry scoped retry: retryFn, maxRetries, maxTimeout, minTimeout, timeoutFactor, // Response scoped methods, errorCodes, retryAfter, statusCodes } = retryOptions ?? {}; this.dispatch = handlers2.dispatch; this.handler = handlers2.handler; this.opts = dispatchOpts; this.abort = null; this.aborted = false; this.retryOpts = { retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry], retryAfter: retryAfter ?? true, maxTimeout: maxTimeout ?? 30 * 1e3, // 30s, timeout: minTimeout ?? 500, // .5s timeoutFactor: timeoutFactor ?? 2, maxRetries: maxRetries ?? 5, // What errors we should retry methods: methods ?? ["GET", "HEAD", "OPTIONS", "PUT", "DELETE", "TRACE"], // Indicates which errors to retry statusCodes: statusCodes ?? [500, 502, 503, 504, 429], // List of errors to retry errorCodes: errorCodes ?? [ "ECONNRESET", "ECONNREFUSED", "ENOTFOUND", "ENETDOWN", "ENETUNREACH", "EHOSTDOWN", "EHOSTUNREACH", "EPIPE" ] }; this.retryCount = 0; this.start = 0; this.end = null; this.etag = null; this.resume = null; this.handler.onConnect((reason) => { this.aborted = true; if (this.abort) { this.abort(reason); } else { this.reason = reason; } }); } onRequestSent() { if (this.handler.onRequestSent) { this.handler.onRequestSent(); } } onUpgrade(statusCode, headers, socket) { if (this.handler.onUpgrade) { this.handler.onUpgrade(statusCode, headers, socket); } } onConnect(abort) { if (this.aborted) { abort(this.reason); } else { this.abort = abort; } } onBodySent(chunk) { if (this.handler.onBodySent) return this.handler.onBodySent(chunk); } static [kRetryHandlerDefaultRetry](err, { state: state2, opts }, cb2) { const { statusCode, code, headers } = err; const { method, retryOptions } = opts; const { maxRetries, timeout: timeout2, maxTimeout, timeoutFactor, statusCodes, errorCodes, methods } = retryOptions; let { counter, currentTimeout } = state2; currentTimeout = currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout2; if (code && code !== "UND_ERR_REQ_RETRY" && code !== "UND_ERR_SOCKET" && !errorCodes.includes(code)) { cb2(err); return; } if (Array.isArray(methods) && !methods.includes(method)) { cb2(err); return; } if (statusCode != null && Array.isArray(statusCodes) && !statusCodes.includes(statusCode)) { cb2(err); return; } if (counter > maxRetries) { cb2(err); return; } let retryAfterHeader = headers != null && headers["retry-after"]; if (retryAfterHeader) { retryAfterHeader = Number(retryAfterHeader); retryAfterHeader = isNaN(retryAfterHeader) ? calculateRetryAfterHeader(retryAfterHeader) : retryAfterHeader * 1e3; } const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(currentTimeout * timeoutFactor ** counter, maxTimeout); state2.currentTimeout = retryTimeout; setTimeout(() => cb2(null), retryTimeout); } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const headers = parseHeaders2(rawHeaders); this.retryCount += 1; if (statusCode >= 300) { this.abort( new RequestRetryError("Request failed", statusCode, { headers, count: this.retryCount }) ); return false; } if (this.resume != null) { this.resume = null; if (statusCode !== 206) { return true; } const contentRange = parseRangeHeader(headers["content-range"]); if (!contentRange) { this.abort( new RequestRetryError("Content-Range mismatch", statusCode, { headers, count: this.retryCount }) ); return false; } if (this.etag != null && this.etag !== headers.etag) { this.abort( new RequestRetryError("ETag mismatch", statusCode, { headers, count: this.retryCount }) ); return false; } const { start, size, end = size } = contentRange; assert38(this.start === start, "content-range mismatch"); assert38(this.end == null || this.end === end, "content-range mismatch"); this.resume = resume; return true; } if (this.end == null) { if (statusCode === 206) { const range = parseRangeHeader(headers["content-range"]); if (range == null) { return this.handler.onHeaders( statusCode, rawHeaders, resume, statusMessage ); } const { start, size, end = size } = range; assert38( start != null && Number.isFinite(start) && this.start !== start, "content-range mismatch" ); assert38(Number.isFinite(start)); assert38( end != null && Number.isFinite(end) && this.end !== end, "invalid content-length" ); this.start = start; this.end = end; } if (this.end == null) { const contentLength = headers["content-length"]; this.end = contentLength != null ? Number(contentLength) : null; } assert38(Number.isFinite(this.start)); assert38( this.end == null || Number.isFinite(this.end), "invalid content-length" ); this.resume = resume; this.etag = headers.etag != null ? headers.etag : null; return this.handler.onHeaders( statusCode, rawHeaders, resume, statusMessage ); } const err = new RequestRetryError("Request failed", statusCode, { headers, count: this.retryCount }); this.abort(err); return false; } onData(chunk) { this.start += chunk.length; return this.handler.onData(chunk); } onComplete(rawTrailers) { this.retryCount = 0; return this.handler.onComplete(rawTrailers); } onError(err) { if (this.aborted || isDisturbed(this.opts.body)) { return this.handler.onError(err); } this.retryOpts.retry( err, { state: { counter: this.retryCount++, currentTimeout: this.retryAfter }, opts: { retryOptions: this.retryOpts, ...this.opts } }, onRetry.bind(this) ); function onRetry(err2) { if (err2 != null || this.aborted || isDisturbed(this.opts.body)) { return this.handler.onError(err2); } if (this.start !== 0) { this.opts = { ...this.opts, headers: { ...this.opts.headers, range: `bytes=${this.start}-${this.end ?? ""}` } }; } try { this.dispatch(this.opts, this); } catch (err3) { this.handler.onError(err3); } } __name(onRetry, "onRetry"); } }; __name(RetryHandler, "RetryHandler"); module3.exports = RetryHandler; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/global.js var require_global2 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/global.js"(exports2, module3) { "use strict"; init_import_meta_url(); var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher2() === void 0) { setGlobalDispatcher2(new Agent()); } function setGlobalDispatcher2(agent) { if (!agent || typeof agent.dispatch !== "function") { throw new InvalidArgumentError("Argument agent must implement Agent"); } Object.defineProperty(globalThis, globalDispatcher, { value: agent, writable: true, enumerable: false, configurable: false }); } __name(setGlobalDispatcher2, "setGlobalDispatcher"); function getGlobalDispatcher2() { return globalThis[globalDispatcher]; } __name(getGlobalDispatcher2, "getGlobalDispatcher"); module3.exports = { setGlobalDispatcher: setGlobalDispatcher2, getGlobalDispatcher: getGlobalDispatcher2 }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/handler/DecoratorHandler.js var require_DecoratorHandler = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/handler/DecoratorHandler.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = /* @__PURE__ */ __name(class DecoratorHandler { constructor(handler31) { this.handler = handler31; } onConnect(...args) { return this.handler.onConnect(...args); } onError(...args) { return this.handler.onError(...args); } onUpgrade(...args) { return this.handler.onUpgrade(...args); } onHeaders(...args) { return this.handler.onHeaders(...args); } onData(...args) { return this.handler.onData(...args); } onComplete(...args) { return this.handler.onComplete(...args); } onBodySent(...args) { return this.handler.onBodySent(...args); } }, "DecoratorHandler"); } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/headers.js var require_headers = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/headers.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { kHeadersList, kConstruct } = require_symbols(); var { kGuard } = require_symbols2(); var { kEnumerableProperty } = require_util(); var { makeIterator, isValidHeaderName, isValidHeaderValue } = require_util2(); var { webidl } = require_webidl(); var assert38 = require("assert"); var kHeadersMap = Symbol("headers map"); var kHeadersSortedMap = Symbol("headers map sorted"); function isHTTPWhiteSpaceCharCode(code) { return code === 10 || code === 13 || code === 9 || code === 32; } __name(isHTTPWhiteSpaceCharCode, "isHTTPWhiteSpaceCharCode"); function headerValueNormalize(potentialValue) { let i5 = 0; let j6 = potentialValue.length; while (j6 > i5 && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j6 - 1))) --j6; while (j6 > i5 && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i5))) ++i5; return i5 === 0 && j6 === potentialValue.length ? potentialValue : potentialValue.substring(i5, j6); } __name(headerValueNormalize, "headerValueNormalize"); function fill2(headers, object) { if (Array.isArray(object)) { for (let i5 = 0; i5 < object.length; ++i5) { const header = object[i5]; if (header.length !== 2) { throw webidl.errors.exception({ header: "Headers constructor", message: `expected name/value pair to be length 2, found ${header.length}.` }); } appendHeader(headers, header[0], header[1]); } } else if (typeof object === "object" && object !== null) { const keys = Object.keys(object); for (let i5 = 0; i5 < keys.length; ++i5) { appendHeader(headers, keys[i5], object[keys[i5]]); } } else { throw webidl.errors.conversionFailed({ prefix: "Headers constructor", argument: "Argument 1", types: ["sequence>", "record"] }); } } __name(fill2, "fill"); function appendHeader(headers, name2, value) { value = headerValueNormalize(value); if (!isValidHeaderName(name2)) { throw webidl.errors.invalidArgument({ prefix: "Headers.append", value: name2, type: "header name" }); } else if (!isValidHeaderValue(value)) { throw webidl.errors.invalidArgument({ prefix: "Headers.append", value, type: "header value" }); } if (headers[kGuard] === "immutable") { throw new TypeError("immutable"); } else if (headers[kGuard] === "request-no-cors") { } return headers[kHeadersList].append(name2, value); } __name(appendHeader, "appendHeader"); var HeadersList = class { /** @type {[string, string][]|null} */ cookies = null; constructor(init2) { if (init2 instanceof HeadersList) { this[kHeadersMap] = new Map(init2[kHeadersMap]); this[kHeadersSortedMap] = init2[kHeadersSortedMap]; this.cookies = init2.cookies === null ? null : [...init2.cookies]; } else { this[kHeadersMap] = new Map(init2); this[kHeadersSortedMap] = null; } } // https://fetch.spec.whatwg.org/#header-list-contains contains(name2) { name2 = name2.toLowerCase(); return this[kHeadersMap].has(name2); } clear() { this[kHeadersMap].clear(); this[kHeadersSortedMap] = null; this.cookies = null; } // https://fetch.spec.whatwg.org/#concept-header-list-append append(name2, value) { this[kHeadersSortedMap] = null; const lowercaseName = name2.toLowerCase(); const exists = this[kHeadersMap].get(lowercaseName); if (exists) { const delimiter = lowercaseName === "cookie" ? "; " : ", "; this[kHeadersMap].set(lowercaseName, { name: exists.name, value: `${exists.value}${delimiter}${value}` }); } else { this[kHeadersMap].set(lowercaseName, { name: name2, value }); } if (lowercaseName === "set-cookie") { this.cookies ??= []; this.cookies.push(value); } } // https://fetch.spec.whatwg.org/#concept-header-list-set set(name2, value) { this[kHeadersSortedMap] = null; const lowercaseName = name2.toLowerCase(); if (lowercaseName === "set-cookie") { this.cookies = [value]; } this[kHeadersMap].set(lowercaseName, { name: name2, value }); } // https://fetch.spec.whatwg.org/#concept-header-list-delete delete(name2) { this[kHeadersSortedMap] = null; name2 = name2.toLowerCase(); if (name2 === "set-cookie") { this.cookies = null; } this[kHeadersMap].delete(name2); } // https://fetch.spec.whatwg.org/#concept-header-list-get get(name2) { const value = this[kHeadersMap].get(name2.toLowerCase()); return value === void 0 ? null : value.value; } *[Symbol.iterator]() { for (const [name2, { value }] of this[kHeadersMap]) { yield [name2, value]; } } get entries() { const headers = {}; if (this[kHeadersMap].size) { for (const { name: name2, value } of this[kHeadersMap].values()) { headers[name2] = value; } } return headers; } }; __name(HeadersList, "HeadersList"); var Headers6 = class { constructor(init2 = void 0) { if (init2 === kConstruct) { return; } this[kHeadersList] = new HeadersList(); this[kGuard] = "none"; if (init2 !== void 0) { init2 = webidl.converters.HeadersInit(init2); fill2(this, init2); } } // https://fetch.spec.whatwg.org/#dom-headers-append append(name2, value) { webidl.brandCheck(this, Headers6); webidl.argumentLengthCheck(arguments, 2, { header: "Headers.append" }); name2 = webidl.converters.ByteString(name2); value = webidl.converters.ByteString(value); return appendHeader(this, name2, value); } // https://fetch.spec.whatwg.org/#dom-headers-delete delete(name2) { webidl.brandCheck(this, Headers6); webidl.argumentLengthCheck(arguments, 1, { header: "Headers.delete" }); name2 = webidl.converters.ByteString(name2); if (!isValidHeaderName(name2)) { throw webidl.errors.invalidArgument({ prefix: "Headers.delete", value: name2, type: "header name" }); } if (this[kGuard] === "immutable") { throw new TypeError("immutable"); } else if (this[kGuard] === "request-no-cors") { } if (!this[kHeadersList].contains(name2)) { return; } this[kHeadersList].delete(name2); } // https://fetch.spec.whatwg.org/#dom-headers-get get(name2) { webidl.brandCheck(this, Headers6); webidl.argumentLengthCheck(arguments, 1, { header: "Headers.get" }); name2 = webidl.converters.ByteString(name2); if (!isValidHeaderName(name2)) { throw webidl.errors.invalidArgument({ prefix: "Headers.get", value: name2, type: "header name" }); } return this[kHeadersList].get(name2); } // https://fetch.spec.whatwg.org/#dom-headers-has has(name2) { webidl.brandCheck(this, Headers6); webidl.argumentLengthCheck(arguments, 1, { header: "Headers.has" }); name2 = webidl.converters.ByteString(name2); if (!isValidHeaderName(name2)) { throw webidl.errors.invalidArgument({ prefix: "Headers.has", value: name2, type: "header name" }); } return this[kHeadersList].contains(name2); } // https://fetch.spec.whatwg.org/#dom-headers-set set(name2, value) { webidl.brandCheck(this, Headers6); webidl.argumentLengthCheck(arguments, 2, { header: "Headers.set" }); name2 = webidl.converters.ByteString(name2); value = webidl.converters.ByteString(value); value = headerValueNormalize(value); if (!isValidHeaderName(name2)) { throw webidl.errors.invalidArgument({ prefix: "Headers.set", value: name2, type: "header name" }); } else if (!isValidHeaderValue(value)) { throw webidl.errors.invalidArgument({ prefix: "Headers.set", value, type: "header value" }); } if (this[kGuard] === "immutable") { throw new TypeError("immutable"); } else if (this[kGuard] === "request-no-cors") { } this[kHeadersList].set(name2, value); } // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie getSetCookie() { webidl.brandCheck(this, Headers6); const list = this[kHeadersList].cookies; if (list) { return [...list]; } return []; } // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine get [kHeadersSortedMap]() { if (this[kHeadersList][kHeadersSortedMap]) { return this[kHeadersList][kHeadersSortedMap]; } const headers = []; const names = [...this[kHeadersList]].sort((a5, b6) => a5[0] < b6[0] ? -1 : 1); const cookies = this[kHeadersList].cookies; for (let i5 = 0; i5 < names.length; ++i5) { const [name2, value] = names[i5]; if (name2 === "set-cookie") { for (let j6 = 0; j6 < cookies.length; ++j6) { headers.push([name2, cookies[j6]]); } } else { assert38(value !== null); headers.push([name2, value]); } } this[kHeadersList][kHeadersSortedMap] = headers; return headers; } keys() { webidl.brandCheck(this, Headers6); if (this[kGuard] === "immutable") { const value = this[kHeadersSortedMap]; return makeIterator( () => value, "Headers", "key" ); } return makeIterator( () => [...this[kHeadersSortedMap].values()], "Headers", "key" ); } values() { webidl.brandCheck(this, Headers6); if (this[kGuard] === "immutable") { const value = this[kHeadersSortedMap]; return makeIterator( () => value, "Headers", "value" ); } return makeIterator( () => [...this[kHeadersSortedMap].values()], "Headers", "value" ); } entries() { webidl.brandCheck(this, Headers6); if (this[kGuard] === "immutable") { const value = this[kHeadersSortedMap]; return makeIterator( () => value, "Headers", "key+value" ); } return makeIterator( () => [...this[kHeadersSortedMap].values()], "Headers", "key+value" ); } /** * @param {(value: string, key: string, self: Headers) => void} callbackFn * @param {unknown} thisArg */ forEach(callbackFn, thisArg = globalThis) { webidl.brandCheck(this, Headers6); webidl.argumentLengthCheck(arguments, 1, { header: "Headers.forEach" }); if (typeof callbackFn !== "function") { throw new TypeError( "Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'." ); } for (const [key, value] of this) { callbackFn.apply(thisArg, [value, key, this]); } } [Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, Headers6); return this[kHeadersList]; } }; __name(Headers6, "Headers"); Headers6.prototype[Symbol.iterator] = Headers6.prototype.entries; Object.defineProperties(Headers6.prototype, { append: kEnumerableProperty, delete: kEnumerableProperty, get: kEnumerableProperty, has: kEnumerableProperty, set: kEnumerableProperty, getSetCookie: kEnumerableProperty, keys: kEnumerableProperty, values: kEnumerableProperty, entries: kEnumerableProperty, forEach: kEnumerableProperty, [Symbol.iterator]: { enumerable: false }, [Symbol.toStringTag]: { value: "Headers", configurable: true } }); webidl.converters.HeadersInit = function(V3) { if (webidl.util.Type(V3) === "Object") { if (V3[Symbol.iterator]) { return webidl.converters["sequence>"](V3); } return webidl.converters["record"](V3); } throw webidl.errors.conversionFailed({ prefix: "Headers constructor", argument: "Argument 1", types: ["sequence>", "record"] }); }; module3.exports = { fill: fill2, Headers: Headers6, HeadersList }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/response.js var require_response = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/response.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { Headers: Headers6, HeadersList, fill: fill2 } = require_headers(); var { extractBody, cloneBody, mixinBody } = require_body(); var util5 = require_util(); var { kEnumerableProperty } = util5; var { isValidReasonPhrase, isCancelled, isAborted: isAborted2, isBlobLike, serializeJavascriptValueToJSONString, isErrorLike, isomorphicEncode } = require_util2(); var { redirectStatusSet, nullBodyStatus, DOMException: DOMException2 } = require_constants2(); var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); var { webidl } = require_webidl(); var { FormData: FormData11 } = require_formdata(); var { getGlobalOrigin } = require_global(); var { URLSerializer } = require_dataURL(); var { kHeadersList, kConstruct } = require_symbols(); var assert38 = require("assert"); var { types } = require("util"); var ReadableStream3 = globalThis.ReadableStream || require("stream/web").ReadableStream; var textEncoder = new TextEncoder("utf-8"); var Response13 = class { // Creates network error Response. static error() { const relevantRealm = { settingsObject: {} }; const responseObject = new Response13(); responseObject[kState] = makeNetworkError(); responseObject[kRealm] = relevantRealm; responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList; responseObject[kHeaders][kGuard] = "immutable"; responseObject[kHeaders][kRealm] = relevantRealm; return responseObject; } // https://fetch.spec.whatwg.org/#dom-response-json static json(data, init2 = {}) { webidl.argumentLengthCheck(arguments, 1, { header: "Response.json" }); if (init2 !== null) { init2 = webidl.converters.ResponseInit(init2); } const bytes = textEncoder.encode( serializeJavascriptValueToJSONString(data) ); const body = extractBody(bytes); const relevantRealm = { settingsObject: {} }; const responseObject = new Response13(); responseObject[kRealm] = relevantRealm; responseObject[kHeaders][kGuard] = "response"; responseObject[kHeaders][kRealm] = relevantRealm; initializeResponse(responseObject, init2, { body: body[0], type: "application/json" }); return responseObject; } // Creates a redirect Response that redirects to url with status status. static redirect(url4, status2 = 302) { const relevantRealm = { settingsObject: {} }; webidl.argumentLengthCheck(arguments, 1, { header: "Response.redirect" }); url4 = webidl.converters.USVString(url4); status2 = webidl.converters["unsigned short"](status2); let parsedURL; try { parsedURL = new URL(url4, getGlobalOrigin()); } catch (err) { throw Object.assign(new TypeError("Failed to parse URL from " + url4), { cause: err }); } if (!redirectStatusSet.has(status2)) { throw new RangeError("Invalid status code " + status2); } const responseObject = new Response13(); responseObject[kRealm] = relevantRealm; responseObject[kHeaders][kGuard] = "immutable"; responseObject[kHeaders][kRealm] = relevantRealm; responseObject[kState].status = status2; const value = isomorphicEncode(URLSerializer(parsedURL)); responseObject[kState].headersList.append("location", value); return responseObject; } // https://fetch.spec.whatwg.org/#dom-response constructor(body = null, init2 = {}) { if (body !== null) { body = webidl.converters.BodyInit(body); } init2 = webidl.converters.ResponseInit(init2); this[kRealm] = { settingsObject: {} }; this[kState] = makeResponse({}); this[kHeaders] = new Headers6(kConstruct); this[kHeaders][kGuard] = "response"; this[kHeaders][kHeadersList] = this[kState].headersList; this[kHeaders][kRealm] = this[kRealm]; let bodyWithType = null; if (body != null) { const [extractedBody, type] = extractBody(body); bodyWithType = { body: extractedBody, type }; } initializeResponse(this, init2, bodyWithType); } // Returns response’s type, e.g., "cors". get type() { webidl.brandCheck(this, Response13); return this[kState].type; } // Returns response’s URL, if it has one; otherwise the empty string. get url() { webidl.brandCheck(this, Response13); const urlList = this[kState].urlList; const url4 = urlList[urlList.length - 1] ?? null; if (url4 === null) { return ""; } return URLSerializer(url4, true); } // Returns whether response was obtained through a redirect. get redirected() { webidl.brandCheck(this, Response13); return this[kState].urlList.length > 1; } // Returns response’s status. get status() { webidl.brandCheck(this, Response13); return this[kState].status; } // Returns whether response’s status is an ok status. get ok() { webidl.brandCheck(this, Response13); return this[kState].status >= 200 && this[kState].status <= 299; } // Returns response’s status message. get statusText() { webidl.brandCheck(this, Response13); return this[kState].statusText; } // Returns response’s headers as Headers. get headers() { webidl.brandCheck(this, Response13); return this[kHeaders]; } get body() { webidl.brandCheck(this, Response13); return this[kState].body ? this[kState].body.stream : null; } get bodyUsed() { webidl.brandCheck(this, Response13); return !!this[kState].body && util5.isDisturbed(this[kState].body.stream); } // Returns a clone of response. clone() { webidl.brandCheck(this, Response13); if (this.bodyUsed || this.body && this.body.locked) { throw webidl.errors.exception({ header: "Response.clone", message: "Body has already been consumed." }); } const clonedResponse = cloneResponse(this[kState]); const clonedResponseObject = new Response13(); clonedResponseObject[kState] = clonedResponse; clonedResponseObject[kRealm] = this[kRealm]; clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList; clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]; clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]; return clonedResponseObject; } }; __name(Response13, "Response"); mixinBody(Response13); Object.defineProperties(Response13.prototype, { type: kEnumerableProperty, url: kEnumerableProperty, status: kEnumerableProperty, ok: kEnumerableProperty, redirected: kEnumerableProperty, statusText: kEnumerableProperty, headers: kEnumerableProperty, clone: kEnumerableProperty, body: kEnumerableProperty, bodyUsed: kEnumerableProperty, [Symbol.toStringTag]: { value: "Response", configurable: true } }); Object.defineProperties(Response13, { json: kEnumerableProperty, redirect: kEnumerableProperty, error: kEnumerableProperty }); function cloneResponse(response) { if (response.internalResponse) { return filterResponse( cloneResponse(response.internalResponse), response.type ); } const newResponse = makeResponse({ ...response, body: null }); if (response.body != null) { newResponse.body = cloneBody(response.body); } return newResponse; } __name(cloneResponse, "cloneResponse"); function makeResponse(init2) { return { aborted: false, rangeRequested: false, timingAllowPassed: false, requestIncludesCredentials: false, type: "default", status: 200, timingInfo: null, cacheState: "", statusText: "", ...init2, headersList: init2.headersList ? new HeadersList(init2.headersList) : new HeadersList(), urlList: init2.urlList ? [...init2.urlList] : [] }; } __name(makeResponse, "makeResponse"); function makeNetworkError(reason) { const isError2 = isErrorLike(reason); return makeResponse({ type: "error", status: 0, error: isError2 ? reason : new Error(reason ? String(reason) : reason), aborted: reason && reason.name === "AbortError" }); } __name(makeNetworkError, "makeNetworkError"); function makeFilteredResponse(response, state2) { state2 = { internalResponse: response, ...state2 }; return new Proxy(response, { get(target, p6) { return p6 in state2 ? state2[p6] : target[p6]; }, set(target, p6, value) { assert38(!(p6 in state2)); target[p6] = value; return true; } }); } __name(makeFilteredResponse, "makeFilteredResponse"); function filterResponse(response, type) { if (type === "basic") { return makeFilteredResponse(response, { type: "basic", headersList: response.headersList }); } else if (type === "cors") { return makeFilteredResponse(response, { type: "cors", headersList: response.headersList }); } else if (type === "opaque") { return makeFilteredResponse(response, { type: "opaque", urlList: Object.freeze([]), status: 0, statusText: "", body: null }); } else if (type === "opaqueredirect") { return makeFilteredResponse(response, { type: "opaqueredirect", status: 0, statusText: "", headersList: [], body: null }); } else { assert38(false); } } __name(filterResponse, "filterResponse"); function makeAppropriateNetworkError(fetchParams, err = null) { assert38(isCancelled(fetchParams)); return isAborted2(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err })); } __name(makeAppropriateNetworkError, "makeAppropriateNetworkError"); function initializeResponse(response, init2, body) { if (init2.status !== null && (init2.status < 200 || init2.status > 599)) { throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.'); } if ("statusText" in init2 && init2.statusText != null) { if (!isValidReasonPhrase(String(init2.statusText))) { throw new TypeError("Invalid statusText"); } } if ("status" in init2 && init2.status != null) { response[kState].status = init2.status; } if ("statusText" in init2 && init2.statusText != null) { response[kState].statusText = init2.statusText; } if ("headers" in init2 && init2.headers != null) { fill2(response[kHeaders], init2.headers); } if (body) { if (nullBodyStatus.includes(response.status)) { throw webidl.errors.exception({ header: "Response constructor", message: "Invalid response status code " + response.status }); } response[kState].body = body.body; if (body.type != null && !response[kState].headersList.contains("Content-Type")) { response[kState].headersList.append("content-type", body.type); } } } __name(initializeResponse, "initializeResponse"); webidl.converters.ReadableStream = webidl.interfaceConverter( ReadableStream3 ); webidl.converters.FormData = webidl.interfaceConverter( FormData11 ); webidl.converters.URLSearchParams = webidl.interfaceConverter( URLSearchParams ); webidl.converters.XMLHttpRequestBodyInit = function(V3) { if (typeof V3 === "string") { return webidl.converters.USVString(V3); } if (isBlobLike(V3)) { return webidl.converters.Blob(V3, { strict: false }); } if (types.isArrayBuffer(V3) || types.isTypedArray(V3) || types.isDataView(V3)) { return webidl.converters.BufferSource(V3); } if (util5.isFormDataLike(V3)) { return webidl.converters.FormData(V3, { strict: false }); } if (V3 instanceof URLSearchParams) { return webidl.converters.URLSearchParams(V3); } return webidl.converters.DOMString(V3); }; webidl.converters.BodyInit = function(V3) { if (V3 instanceof ReadableStream3) { return webidl.converters.ReadableStream(V3); } if (V3?.[Symbol.asyncIterator]) { return V3; } return webidl.converters.XMLHttpRequestBodyInit(V3); }; webidl.converters.ResponseInit = webidl.dictionaryConverter([ { key: "status", converter: webidl.converters["unsigned short"], defaultValue: 200 }, { key: "statusText", converter: webidl.converters.ByteString, defaultValue: "" }, { key: "headers", converter: webidl.converters.HeadersInit } ]); module3.exports = { makeNetworkError, makeResponse, makeAppropriateNetworkError, filterResponse, Response: Response13, cloneResponse }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/request.js var require_request2 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/request.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { extractBody, mixinBody, cloneBody } = require_body(); var { Headers: Headers6, fill: fillHeaders, HeadersList } = require_headers(); var { FinalizationRegistry } = require_dispatcher_weakref()(); var util5 = require_util(); var { isValidHTTPToken, sameOrigin, normalizeMethod, makePolicyContainer, normalizeMethodRecord } = require_util2(); var { forbiddenMethodsSet, corsSafeListedMethodsSet, referrerPolicy, requestRedirect, requestMode, requestCredentials, requestCache, requestDuplex } = require_constants2(); var { kEnumerableProperty } = util5; var { kHeaders, kSignal, kState, kGuard, kRealm } = require_symbols2(); var { webidl } = require_webidl(); var { getGlobalOrigin } = require_global(); var { URLSerializer } = require_dataURL(); var { kHeadersList, kConstruct } = require_symbols(); var assert38 = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream3 = globalThis.TransformStream; var kAbortController = Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); var Request4 = class { // https://fetch.spec.whatwg.org/#dom-request constructor(input, init2 = {}) { if (input === kConstruct) { return; } webidl.argumentLengthCheck(arguments, 1, { header: "Request constructor" }); input = webidl.converters.RequestInfo(input); init2 = webidl.converters.RequestInit(init2); this[kRealm] = { settingsObject: { baseUrl: getGlobalOrigin(), get origin() { return this.baseUrl?.origin; }, policyContainer: makePolicyContainer() } }; let request4 = null; let fallbackMode = null; const baseUrl = this[kRealm].settingsObject.baseUrl; let signal = null; if (typeof input === "string") { let parsedURL; try { parsedURL = new URL(input, baseUrl); } catch (err) { throw new TypeError("Failed to parse URL from " + input, { cause: err }); } if (parsedURL.username || parsedURL.password) { throw new TypeError( "Request cannot be constructed from a URL that includes credentials: " + input ); } request4 = makeRequest({ urlList: [parsedURL] }); fallbackMode = "cors"; } else { assert38(input instanceof Request4); request4 = input[kState]; signal = input[kSignal]; } const origin = this[kRealm].settingsObject.origin; let window2 = "client"; if (request4.window?.constructor?.name === "EnvironmentSettingsObject" && sameOrigin(request4.window, origin)) { window2 = request4.window; } if (init2.window != null) { throw new TypeError(`'window' option '${window2}' must be null`); } if ("window" in init2) { window2 = "no-window"; } request4 = makeRequest({ // URL request’s URL. // undici implementation note: this is set as the first item in request's urlList in makeRequest // method request’s method. method: request4.method, // header list A copy of request’s header list. // undici implementation note: headersList is cloned in makeRequest headersList: request4.headersList, // unsafe-request flag Set. unsafeRequest: request4.unsafeRequest, // client This’s relevant settings object. client: this[kRealm].settingsObject, // window window. window: window2, // priority request’s priority. priority: request4.priority, // origin request’s origin. The propagation of the origin is only significant for navigation requests // being handled by a service worker. In this scenario a request can have an origin that is different // from the current client. origin: request4.origin, // referrer request’s referrer. referrer: request4.referrer, // referrer policy request’s referrer policy. referrerPolicy: request4.referrerPolicy, // mode request’s mode. mode: request4.mode, // credentials mode request’s credentials mode. credentials: request4.credentials, // cache mode request’s cache mode. cache: request4.cache, // redirect mode request’s redirect mode. redirect: request4.redirect, // integrity metadata request’s integrity metadata. integrity: request4.integrity, // keepalive request’s keepalive. keepalive: request4.keepalive, // reload-navigation flag request’s reload-navigation flag. reloadNavigation: request4.reloadNavigation, // history-navigation flag request’s history-navigation flag. historyNavigation: request4.historyNavigation, // URL list A clone of request’s URL list. urlList: [...request4.urlList] }); const initHasKey = Object.keys(init2).length !== 0; if (initHasKey) { if (request4.mode === "navigate") { request4.mode = "same-origin"; } request4.reloadNavigation = false; request4.historyNavigation = false; request4.origin = "client"; request4.referrer = "client"; request4.referrerPolicy = ""; request4.url = request4.urlList[request4.urlList.length - 1]; request4.urlList = [request4.url]; } if (init2.referrer !== void 0) { const referrer = init2.referrer; if (referrer === "") { request4.referrer = "no-referrer"; } else { let parsedReferrer; try { parsedReferrer = new URL(referrer, baseUrl); } catch (err) { throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err }); } if (parsedReferrer.protocol === "about:" && parsedReferrer.hostname === "client" || origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl)) { request4.referrer = "client"; } else { request4.referrer = parsedReferrer; } } } if (init2.referrerPolicy !== void 0) { request4.referrerPolicy = init2.referrerPolicy; } let mode; if (init2.mode !== void 0) { mode = init2.mode; } else { mode = fallbackMode; } if (mode === "navigate") { throw webidl.errors.exception({ header: "Request constructor", message: "invalid request mode navigate." }); } if (mode != null) { request4.mode = mode; } if (init2.credentials !== void 0) { request4.credentials = init2.credentials; } if (init2.cache !== void 0) { request4.cache = init2.cache; } if (request4.cache === "only-if-cached" && request4.mode !== "same-origin") { throw new TypeError( "'only-if-cached' can be set only with 'same-origin' mode" ); } if (init2.redirect !== void 0) { request4.redirect = init2.redirect; } if (init2.integrity != null) { request4.integrity = String(init2.integrity); } if (init2.keepalive !== void 0) { request4.keepalive = Boolean(init2.keepalive); } if (init2.method !== void 0) { let method = init2.method; if (!isValidHTTPToken(method)) { throw new TypeError(`'${method}' is not a valid HTTP method.`); } if (forbiddenMethodsSet.has(method.toUpperCase())) { throw new TypeError(`'${method}' HTTP method is unsupported.`); } method = normalizeMethodRecord[method] ?? normalizeMethod(method); request4.method = method; } if (init2.signal !== void 0) { signal = init2.signal; } this[kState] = request4; const ac2 = new AbortController(); this[kSignal] = ac2.signal; this[kSignal][kRealm] = this[kRealm]; if (signal != null) { if (!signal || typeof signal.aborted !== "boolean" || typeof signal.addEventListener !== "function") { throw new TypeError( "Failed to construct 'Request': member signal is not of type AbortSignal." ); } if (signal.aborted) { ac2.abort(signal.reason); } else { this[kAbortController] = ac2; const acRef = new WeakRef(ac2); const abort = /* @__PURE__ */ __name(function() { const ac3 = acRef.deref(); if (ac3 !== void 0) { ac3.abort(this.reason); } }, "abort"); try { if (typeof getMaxListeners === "function" && getMaxListeners(signal) === defaultMaxListeners) { setMaxListeners(100, signal); } else if (getEventListeners(signal, "abort").length >= defaultMaxListeners) { setMaxListeners(100, signal); } } catch { } util5.addAbortListener(signal, abort); requestFinalizer.register(ac2, { signal, abort }); } } this[kHeaders] = new Headers6(kConstruct); this[kHeaders][kHeadersList] = request4.headersList; this[kHeaders][kGuard] = "request"; this[kHeaders][kRealm] = this[kRealm]; if (mode === "no-cors") { if (!corsSafeListedMethodsSet.has(request4.method)) { throw new TypeError( `'${request4.method} is unsupported in no-cors mode.` ); } this[kHeaders][kGuard] = "request-no-cors"; } if (initHasKey) { const headersList = this[kHeaders][kHeadersList]; const headers = init2.headers !== void 0 ? init2.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { for (const [key, val2] of headers) { headersList.append(key, val2); } headersList.cookies = headers.cookies; } else { fillHeaders(this[kHeaders], headers); } } const inputBody = input instanceof Request4 ? input[kState].body : null; if ((init2.body != null || inputBody != null) && (request4.method === "GET" || request4.method === "HEAD")) { throw new TypeError("Request with GET/HEAD method cannot have body."); } let initBody = null; if (init2.body != null) { const [extractedBody, contentType] = extractBody( init2.body, request4.keepalive ); initBody = extractedBody; if (contentType && !this[kHeaders][kHeadersList].contains("content-type")) { this[kHeaders].append("content-type", contentType); } } const inputOrInitBody = initBody ?? inputBody; if (inputOrInitBody != null && inputOrInitBody.source == null) { if (initBody != null && init2.duplex == null) { throw new TypeError("RequestInit: duplex option is required when sending a body."); } if (request4.mode !== "same-origin" && request4.mode !== "cors") { throw new TypeError( 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' ); } request4.useCORSPreflightFlag = true; } let finalBody = inputOrInitBody; if (initBody == null && inputBody != null) { if (util5.isDisturbed(inputBody.stream) || inputBody.stream.locked) { throw new TypeError( "Cannot construct a Request with a Request object that has already been used." ); } if (!TransformStream3) { TransformStream3 = require("stream/web").TransformStream; } const identityTransform = new TransformStream3(); inputBody.stream.pipeThrough(identityTransform); finalBody = { source: inputBody.source, length: inputBody.length, stream: identityTransform.readable }; } this[kState].body = finalBody; } // Returns request’s HTTP method, which is "GET" by default. get method() { webidl.brandCheck(this, Request4); return this[kState].method; } // Returns the URL of request as a string. get url() { webidl.brandCheck(this, Request4); return URLSerializer(this[kState].url); } // Returns a Headers object consisting of the headers associated with request. // Note that headers added in the network layer by the user agent will not // be accounted for in this object, e.g., the "Host" header. get headers() { webidl.brandCheck(this, Request4); return this[kHeaders]; } // Returns the kind of resource requested by request, e.g., "document" // or "script". get destination() { webidl.brandCheck(this, Request4); return this[kState].destination; } // Returns the referrer of request. Its value can be a same-origin URL if // explicitly set in init, the empty string to indicate no referrer, and // "about:client" when defaulting to the global’s default. This is used // during fetching to determine the value of the `Referer` header of the // request being made. get referrer() { webidl.brandCheck(this, Request4); if (this[kState].referrer === "no-referrer") { return ""; } if (this[kState].referrer === "client") { return "about:client"; } return this[kState].referrer.toString(); } // Returns the referrer policy associated with request. // This is used during fetching to compute the value of the request’s // referrer. get referrerPolicy() { webidl.brandCheck(this, Request4); return this[kState].referrerPolicy; } // Returns the mode associated with request, which is a string indicating // whether the request will use CORS, or will be restricted to same-origin // URLs. get mode() { webidl.brandCheck(this, Request4); return this[kState].mode; } // Returns the credentials mode associated with request, // which is a string indicating whether credentials will be sent with the // request always, never, or only when sent to a same-origin URL. get credentials() { return this[kState].credentials; } // Returns the cache mode associated with request, // which is a string indicating how the request will // interact with the browser’s cache when fetching. get cache() { webidl.brandCheck(this, Request4); return this[kState].cache; } // Returns the redirect mode associated with request, // which is a string indicating how redirects for the // request will be handled during fetching. A request // will follow redirects by default. get redirect() { webidl.brandCheck(this, Request4); return this[kState].redirect; } // Returns request’s subresource integrity metadata, which is a // cryptographic hash of the resource being fetched. Its value // consists of multiple hashes separated by whitespace. [SRI] get integrity() { webidl.brandCheck(this, Request4); return this[kState].integrity; } // Returns a boolean indicating whether or not request can outlive the // global in which it was created. get keepalive() { webidl.brandCheck(this, Request4); return this[kState].keepalive; } // Returns a boolean indicating whether or not request is for a reload // navigation. get isReloadNavigation() { webidl.brandCheck(this, Request4); return this[kState].reloadNavigation; } // Returns a boolean indicating whether or not request is for a history // navigation (a.k.a. back-foward navigation). get isHistoryNavigation() { webidl.brandCheck(this, Request4); return this[kState].historyNavigation; } // Returns the signal associated with request, which is an AbortSignal // object indicating whether or not request has been aborted, and its // abort event handler. get signal() { webidl.brandCheck(this, Request4); return this[kSignal]; } get body() { webidl.brandCheck(this, Request4); return this[kState].body ? this[kState].body.stream : null; } get bodyUsed() { webidl.brandCheck(this, Request4); return !!this[kState].body && util5.isDisturbed(this[kState].body.stream); } get duplex() { webidl.brandCheck(this, Request4); return "half"; } // Returns a clone of request. clone() { webidl.brandCheck(this, Request4); if (this.bodyUsed || this.body?.locked) { throw new TypeError("unusable"); } const clonedRequest = cloneRequest(this[kState]); const clonedRequestObject = new Request4(kConstruct); clonedRequestObject[kState] = clonedRequest; clonedRequestObject[kRealm] = this[kRealm]; clonedRequestObject[kHeaders] = new Headers6(kConstruct); clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList; clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]; clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]; const ac2 = new AbortController(); if (this.signal.aborted) { ac2.abort(this.signal.reason); } else { util5.addAbortListener( this.signal, () => { ac2.abort(this.signal.reason); } ); } clonedRequestObject[kSignal] = ac2.signal; return clonedRequestObject; } }; __name(Request4, "Request"); mixinBody(Request4); function makeRequest(init2) { const request4 = { method: "GET", localURLsOnly: false, unsafeRequest: false, body: null, client: null, reservedClient: null, replacesClientId: "", window: "client", keepalive: false, serviceWorkers: "all", initiator: "", destination: "", priority: null, origin: "client", policyContainer: "client", referrer: "client", referrerPolicy: "", mode: "no-cors", useCORSPreflightFlag: false, credentials: "same-origin", useCredentials: false, cache: "default", redirect: "follow", integrity: "", cryptoGraphicsNonceMetadata: "", parserMetadata: "", reloadNavigation: false, historyNavigation: false, userActivation: false, taintedOrigin: false, redirectCount: 0, responseTainting: "basic", preventNoCacheCacheControlHeaderModification: false, done: false, timingAllowFailed: false, ...init2, headersList: init2.headersList ? new HeadersList(init2.headersList) : new HeadersList() }; request4.url = request4.urlList[0]; return request4; } __name(makeRequest, "makeRequest"); function cloneRequest(request4) { const newRequest = makeRequest({ ...request4, body: null }); if (request4.body != null) { newRequest.body = cloneBody(request4.body); } return newRequest; } __name(cloneRequest, "cloneRequest"); Object.defineProperties(Request4.prototype, { method: kEnumerableProperty, url: kEnumerableProperty, headers: kEnumerableProperty, redirect: kEnumerableProperty, clone: kEnumerableProperty, signal: kEnumerableProperty, duplex: kEnumerableProperty, destination: kEnumerableProperty, body: kEnumerableProperty, bodyUsed: kEnumerableProperty, isHistoryNavigation: kEnumerableProperty, isReloadNavigation: kEnumerableProperty, keepalive: kEnumerableProperty, integrity: kEnumerableProperty, cache: kEnumerableProperty, credentials: kEnumerableProperty, attribute: kEnumerableProperty, referrerPolicy: kEnumerableProperty, referrer: kEnumerableProperty, mode: kEnumerableProperty, [Symbol.toStringTag]: { value: "Request", configurable: true } }); webidl.converters.Request = webidl.interfaceConverter( Request4 ); webidl.converters.RequestInfo = function(V3) { if (typeof V3 === "string") { return webidl.converters.USVString(V3); } if (V3 instanceof Request4) { return webidl.converters.Request(V3); } return webidl.converters.USVString(V3); }; webidl.converters.AbortSignal = webidl.interfaceConverter( AbortSignal ); webidl.converters.RequestInit = webidl.dictionaryConverter([ { key: "method", converter: webidl.converters.ByteString }, { key: "headers", converter: webidl.converters.HeadersInit }, { key: "body", converter: webidl.nullableConverter( webidl.converters.BodyInit ) }, { key: "referrer", converter: webidl.converters.USVString }, { key: "referrerPolicy", converter: webidl.converters.DOMString, // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy allowedValues: referrerPolicy }, { key: "mode", converter: webidl.converters.DOMString, // https://fetch.spec.whatwg.org/#concept-request-mode allowedValues: requestMode }, { key: "credentials", converter: webidl.converters.DOMString, // https://fetch.spec.whatwg.org/#requestcredentials allowedValues: requestCredentials }, { key: "cache", converter: webidl.converters.DOMString, // https://fetch.spec.whatwg.org/#requestcache allowedValues: requestCache }, { key: "redirect", converter: webidl.converters.DOMString, // https://fetch.spec.whatwg.org/#requestredirect allowedValues: requestRedirect }, { key: "integrity", converter: webidl.converters.DOMString }, { key: "keepalive", converter: webidl.converters.boolean }, { key: "signal", converter: webidl.nullableConverter( (signal) => webidl.converters.AbortSignal( signal, { strict: false } ) ) }, { key: "window", converter: webidl.converters.any }, { key: "duplex", converter: webidl.converters.DOMString, allowedValues: requestDuplex } ]); module3.exports = { Request: Request4, makeRequest }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/index.js var require_fetch = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fetch/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { Response: Response13, makeNetworkError, makeAppropriateNetworkError, filterResponse, makeResponse } = require_response(); var { Headers: Headers6 } = require_headers(); var { Request: Request4, makeRequest } = require_request2(); var zlib = require("zlib"); var { bytesMatch, makePolicyContainer, clonePolicyContainer, requestBadPort, TAOCheck, appendRequestOriginHeader, responseLocationURL, requestCurrentURL, setRequestReferrerPolicyOnRedirect, tryUpgradeRequestToAPotentiallyTrustworthyURL, createOpaqueTimingInfo, appendFetchMetadata, corsCheck, crossOriginResourcePolicyCheck, determineRequestsReferrer, coarsenedSharedCurrentTime, createDeferredPromise, isBlobLike, sameOrigin, isCancelled, isAborted: isAborted2, isErrorLike, fullyReadBody, readableStreamClose, isomorphicEncode, urlIsLocal, urlIsHttpHttpsScheme, urlHasHttpsScheme } = require_util2(); var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); var assert38 = require("assert"); var { safelyExtractBody } = require_body(); var { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet, DOMException: DOMException2 } = require_constants2(); var { kHeadersList } = require_symbols(); var EE = require("events"); var { Readable: Readable8, pipeline } = require("stream"); var { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = require_util(); var { dataURLProcessor, serializeAMimeType } = require_dataURL(); var { TransformStream: TransformStream3 } = require("stream/web"); var { getGlobalDispatcher: getGlobalDispatcher2 } = require_global2(); var { webidl } = require_webidl(); var { STATUS_CODES } = require("http"); var GET_OR_HEAD = ["GET", "HEAD"]; var resolveObjectURL; var ReadableStream3 = globalThis.ReadableStream; var Fetch = class extends EE { constructor(dispatcher) { super(); this.dispatcher = dispatcher; this.connection = null; this.dump = false; this.state = "ongoing"; this.setMaxListeners(21); } terminate(reason) { if (this.state !== "ongoing") { return; } this.state = "terminated"; this.connection?.destroy(reason); this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort abort(error2) { if (this.state !== "ongoing") { return; } this.state = "aborted"; if (!error2) { error2 = new DOMException2("The operation was aborted.", "AbortError"); } this.serializedAbortReason = error2; this.connection?.destroy(error2); this.emit("terminated", error2); } }; __name(Fetch, "Fetch"); function fetch15(input, init2 = {}) { webidl.argumentLengthCheck(arguments, 1, { header: "globalThis.fetch" }); const p6 = createDeferredPromise(); let requestObject; try { requestObject = new Request4(input, init2); } catch (e7) { p6.reject(e7); return p6.promise; } const request4 = requestObject[kState]; if (requestObject.signal.aborted) { abortFetch(p6, request4, null, requestObject.signal.reason); return p6.promise; } const globalObject = request4.client.globalObject; if (globalObject?.constructor?.name === "ServiceWorkerGlobalScope") { request4.serviceWorkers = "none"; } let responseObject = null; const relevantRealm = null; let locallyAborted = false; let controller = null; addAbortListener( requestObject.signal, () => { locallyAborted = true; assert38(controller != null); controller.abort(requestObject.signal.reason); abortFetch(p6, request4, responseObject, requestObject.signal.reason); } ); const handleFetchDone = /* @__PURE__ */ __name((response) => finalizeAndReportTiming(response, "fetch"), "handleFetchDone"); const processResponse = /* @__PURE__ */ __name((response) => { if (locallyAborted) { return Promise.resolve(); } if (response.aborted) { abortFetch(p6, request4, responseObject, controller.serializedAbortReason); return Promise.resolve(); } if (response.type === "error") { p6.reject( Object.assign(new TypeError("fetch failed"), { cause: response.error }) ); return Promise.resolve(); } responseObject = new Response13(); responseObject[kState] = response; responseObject[kRealm] = relevantRealm; responseObject[kHeaders][kHeadersList] = response.headersList; responseObject[kHeaders][kGuard] = "immutable"; responseObject[kHeaders][kRealm] = relevantRealm; p6.resolve(responseObject); }, "processResponse"); controller = fetching({ request: request4, processResponseEndOfBody: handleFetchDone, processResponse, dispatcher: init2.dispatcher ?? getGlobalDispatcher2() // undici }); return p6.promise; } __name(fetch15, "fetch"); function finalizeAndReportTiming(response, initiatorType = "other") { if (response.type === "error" && response.aborted) { return; } if (!response.urlList?.length) { return; } const originalURL = response.urlList[0]; let timingInfo = response.timingInfo; let cacheState = response.cacheState; if (!urlIsHttpHttpsScheme(originalURL)) { return; } if (timingInfo === null) { return; } if (!response.timingAllowPassed) { timingInfo = createOpaqueTimingInfo({ startTime: timingInfo.startTime }); cacheState = ""; } timingInfo.endTime = coarsenedSharedCurrentTime(); response.timingInfo = timingInfo; markResourceTiming( timingInfo, originalURL, initiatorType, globalThis, cacheState ); } __name(finalizeAndReportTiming, "finalizeAndReportTiming"); function markResourceTiming(timingInfo, originalURL, initiatorType, globalThis2, cacheState) { if (nodeMajor > 18 || nodeMajor === 18 && nodeMinor >= 2) { performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } __name(markResourceTiming, "markResourceTiming"); function abortFetch(p6, request4, responseObject, error2) { if (!error2) { error2 = new DOMException2("The operation was aborted.", "AbortError"); } p6.reject(error2); if (request4.body != null && isReadable(request4.body?.stream)) { request4.body.stream.cancel(error2).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } throw err; }); } if (responseObject == null) { return; } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { response.body.stream.cancel(error2).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } throw err; }); } } __name(abortFetch, "abortFetch"); function fetching({ request: request4, processRequestBodyChunkLength, processRequestEndOfBody, processResponse, processResponseEndOfBody, processResponseConsumeBody, useParallelQueue = false, dispatcher // undici }) { let taskDestination = null; let crossOriginIsolatedCapability = false; if (request4.client != null) { taskDestination = request4.client.globalObject; crossOriginIsolatedCapability = request4.client.crossOriginIsolatedCapability; } const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability); const timingInfo = createOpaqueTimingInfo({ startTime: currenTime }); const fetchParams = { controller: new Fetch(dispatcher), request: request4, timingInfo, processRequestBodyChunkLength, processRequestEndOfBody, processResponse, processResponseConsumeBody, processResponseEndOfBody, taskDestination, crossOriginIsolatedCapability }; assert38(!request4.body || request4.body.stream); if (request4.window === "client") { request4.window = request4.client?.globalObject?.constructor?.name === "Window" ? request4.client : "no-window"; } if (request4.origin === "client") { request4.origin = request4.client?.origin; } if (request4.policyContainer === "client") { if (request4.client != null) { request4.policyContainer = clonePolicyContainer( request4.client.policyContainer ); } else { request4.policyContainer = makePolicyContainer(); } } if (!request4.headersList.contains("accept")) { const value = "*/*"; request4.headersList.append("accept", value); } if (!request4.headersList.contains("accept-language")) { request4.headersList.append("accept-language", "*"); } if (request4.priority === null) { } if (subresourceSet.has(request4.destination)) { } mainFetch(fetchParams).catch((err) => { fetchParams.controller.terminate(err); }); return fetchParams.controller; } __name(fetching, "fetching"); async function mainFetch(fetchParams, recursive = false) { const request4 = fetchParams.request; let response = null; if (request4.localURLsOnly && !urlIsLocal(requestCurrentURL(request4))) { response = makeNetworkError("local URLs only"); } tryUpgradeRequestToAPotentiallyTrustworthyURL(request4); if (requestBadPort(request4) === "blocked") { response = makeNetworkError("bad port"); } if (request4.referrerPolicy === "") { request4.referrerPolicy = request4.policyContainer.referrerPolicy; } if (request4.referrer !== "no-referrer") { request4.referrer = determineRequestsReferrer(request4); } if (response === null) { response = await (async () => { const currentURL = requestCurrentURL(request4); if ( // - request’s current URL’s origin is same origin with request’s origin, // and request’s response tainting is "basic" sameOrigin(currentURL, request4.url) && request4.responseTainting === "basic" || // request’s current URL’s scheme is "data" currentURL.protocol === "data:" || // - request’s mode is "navigate" or "websocket" (request4.mode === "navigate" || request4.mode === "websocket") ) { request4.responseTainting = "basic"; return await schemeFetch(fetchParams); } if (request4.mode === "same-origin") { return makeNetworkError('request mode cannot be "same-origin"'); } if (request4.mode === "no-cors") { if (request4.redirect !== "follow") { return makeNetworkError( 'redirect mode cannot be "follow" for "no-cors" request' ); } request4.responseTainting = "opaque"; return await schemeFetch(fetchParams); } if (!urlIsHttpHttpsScheme(requestCurrentURL(request4))) { return makeNetworkError("URL scheme must be a HTTP(S) scheme"); } request4.responseTainting = "cors"; return await httpFetch(fetchParams); })(); } if (recursive) { return response; } if (response.status !== 0 && !response.internalResponse) { if (request4.responseTainting === "cors") { } if (request4.responseTainting === "basic") { response = filterResponse(response, "basic"); } else if (request4.responseTainting === "cors") { response = filterResponse(response, "cors"); } else if (request4.responseTainting === "opaque") { response = filterResponse(response, "opaque"); } else { assert38(false); } } let internalResponse = response.status === 0 ? response : response.internalResponse; if (internalResponse.urlList.length === 0) { internalResponse.urlList.push(...request4.urlList); } if (!request4.timingAllowFailed) { response.timingAllowPassed = true; } if (response.type === "opaque" && internalResponse.status === 206 && internalResponse.rangeRequested && !request4.headers.contains("range")) { response = internalResponse = makeNetworkError(); } if (response.status !== 0 && (request4.method === "HEAD" || request4.method === "CONNECT" || nullBodyStatus.includes(internalResponse.status))) { internalResponse.body = null; fetchParams.controller.dump = true; } if (request4.integrity) { const processBodyError = /* @__PURE__ */ __name((reason) => fetchFinale(fetchParams, makeNetworkError(reason)), "processBodyError"); if (request4.responseTainting === "opaque" || response.body == null) { processBodyError(response.error); return; } const processBody = /* @__PURE__ */ __name((bytes) => { if (!bytesMatch(bytes, request4.integrity)) { processBodyError("integrity mismatch"); return; } response.body = safelyExtractBody(bytes)[0]; fetchFinale(fetchParams, response); }, "processBody"); await fullyReadBody(response.body, processBody, processBodyError); } else { fetchFinale(fetchParams, response); } } __name(mainFetch, "mainFetch"); function schemeFetch(fetchParams) { if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { return Promise.resolve(makeAppropriateNetworkError(fetchParams)); } const { request: request4 } = fetchParams; const { protocol: scheme } = requestCurrentURL(request4); switch (scheme) { case "about:": { return Promise.resolve(makeNetworkError("about scheme is not supported")); } case "blob:": { if (!resolveObjectURL) { resolveObjectURL = require("buffer").resolveObjectURL; } const blobURLEntry = requestCurrentURL(request4); if (blobURLEntry.search.length !== 0) { return Promise.resolve(makeNetworkError("NetworkError when attempting to fetch resource.")); } const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString()); if (request4.method !== "GET" || !isBlobLike(blobURLEntryObject)) { return Promise.resolve(makeNetworkError("invalid method")); } const bodyWithType = safelyExtractBody(blobURLEntryObject); const body = bodyWithType[0]; const length = isomorphicEncode(`${body.length}`); const type = bodyWithType[1] ?? ""; const response = makeResponse({ statusText: "OK", headersList: [ ["content-length", { name: "Content-Length", value: length }], ["content-type", { name: "Content-Type", value: type }] ] }); response.body = body; return Promise.resolve(response); } case "data:": { const currentURL = requestCurrentURL(request4); const dataURLStruct = dataURLProcessor(currentURL); if (dataURLStruct === "failure") { return Promise.resolve(makeNetworkError("failed to fetch the data URL")); } const mimeType = serializeAMimeType(dataURLStruct.mimeType); return Promise.resolve(makeResponse({ statusText: "OK", headersList: [ ["content-type", { name: "Content-Type", value: mimeType }] ], body: safelyExtractBody(dataURLStruct.body)[0] })); } case "file:": { return Promise.resolve(makeNetworkError("not implemented... yet...")); } case "http:": case "https:": { return httpFetch(fetchParams).catch((err) => makeNetworkError(err)); } default: { return Promise.resolve(makeNetworkError("unknown scheme")); } } } __name(schemeFetch, "schemeFetch"); function finalizeResponse(fetchParams, response) { fetchParams.request.done = true; if (fetchParams.processResponseDone != null) { queueMicrotask(() => fetchParams.processResponseDone(response)); } } __name(finalizeResponse, "finalizeResponse"); function fetchFinale(fetchParams, response) { if (response.type === "error") { response.urlList = [fetchParams.request.urlList[0]]; response.timingInfo = createOpaqueTimingInfo({ startTime: fetchParams.timingInfo.startTime }); } const processResponseEndOfBody = /* @__PURE__ */ __name(() => { fetchParams.request.done = true; if (fetchParams.processResponseEndOfBody != null) { queueMicrotask(() => fetchParams.processResponseEndOfBody(response)); } }, "processResponseEndOfBody"); if (fetchParams.processResponse != null) { queueMicrotask(() => fetchParams.processResponse(response)); } if (response.body == null) { processResponseEndOfBody(); } else { const identityTransformAlgorithm = /* @__PURE__ */ __name((chunk, controller) => { controller.enqueue(chunk); }, "identityTransformAlgorithm"); const transformStream = new TransformStream3({ start() { }, transform: identityTransformAlgorithm, flush: processResponseEndOfBody }, { size() { return 1; } }, { size() { return 1; } }); response.body = { stream: response.body.stream.pipeThrough(transformStream) }; } if (fetchParams.processResponseConsumeBody != null) { const processBody = /* @__PURE__ */ __name((nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes), "processBody"); const processBodyError = /* @__PURE__ */ __name((failure) => fetchParams.processResponseConsumeBody(response, failure), "processBodyError"); if (response.body == null) { queueMicrotask(() => processBody(null)); } else { return fullyReadBody(response.body, processBody, processBodyError); } return Promise.resolve(); } } __name(fetchFinale, "fetchFinale"); async function httpFetch(fetchParams) { const request4 = fetchParams.request; let response = null; let actualResponse = null; const timingInfo = fetchParams.timingInfo; if (request4.serviceWorkers === "all") { } if (response === null) { if (request4.redirect === "follow") { request4.serviceWorkers = "none"; } actualResponse = response = await httpNetworkOrCacheFetch(fetchParams); if (request4.responseTainting === "cors" && corsCheck(request4, response) === "failure") { return makeNetworkError("cors failure"); } if (TAOCheck(request4, response) === "failure") { request4.timingAllowFailed = true; } } if ((request4.responseTainting === "opaque" || response.type === "opaque") && crossOriginResourcePolicyCheck( request4.origin, request4.client, request4.destination, actualResponse ) === "blocked") { return makeNetworkError("blocked"); } if (redirectStatusSet.has(actualResponse.status)) { if (request4.redirect !== "manual") { fetchParams.controller.connection.destroy(); } if (request4.redirect === "error") { response = makeNetworkError("unexpected redirect"); } else if (request4.redirect === "manual") { response = actualResponse; } else if (request4.redirect === "follow") { response = await httpRedirectFetch(fetchParams, response); } else { assert38(false); } } response.timingInfo = timingInfo; return response; } __name(httpFetch, "httpFetch"); function httpRedirectFetch(fetchParams, response) { const request4 = fetchParams.request; const actualResponse = response.internalResponse ? response.internalResponse : response; let locationURL; try { locationURL = responseLocationURL( actualResponse, requestCurrentURL(request4).hash ); if (locationURL == null) { return response; } } catch (err) { return Promise.resolve(makeNetworkError(err)); } if (!urlIsHttpHttpsScheme(locationURL)) { return Promise.resolve(makeNetworkError("URL scheme must be a HTTP(S) scheme")); } if (request4.redirectCount === 20) { return Promise.resolve(makeNetworkError("redirect count exceeded")); } request4.redirectCount += 1; if (request4.mode === "cors" && (locationURL.username || locationURL.password) && !sameOrigin(request4, locationURL)) { return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"')); } if (request4.responseTainting === "cors" && (locationURL.username || locationURL.password)) { return Promise.resolve(makeNetworkError( 'URL cannot contain credentials for request mode "cors"' )); } if (actualResponse.status !== 303 && request4.body != null && request4.body.source == null) { return Promise.resolve(makeNetworkError()); } if ([301, 302].includes(actualResponse.status) && request4.method === "POST" || actualResponse.status === 303 && !GET_OR_HEAD.includes(request4.method)) { request4.method = "GET"; request4.body = null; for (const headerName of requestBodyHeader) { request4.headersList.delete(headerName); } } if (!sameOrigin(requestCurrentURL(request4), locationURL)) { request4.headersList.delete("authorization"); request4.headersList.delete("proxy-authorization", true); request4.headersList.delete("cookie"); request4.headersList.delete("host"); } if (request4.body != null) { assert38(request4.body.source != null); request4.body = safelyExtractBody(request4.body.source)[0]; } const timingInfo = fetchParams.timingInfo; timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); if (timingInfo.redirectStartTime === 0) { timingInfo.redirectStartTime = timingInfo.startTime; } request4.urlList.push(locationURL); setRequestReferrerPolicyOnRedirect(request4, actualResponse); return mainFetch(fetchParams, true); } __name(httpRedirectFetch, "httpRedirectFetch"); async function httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false) { const request4 = fetchParams.request; let httpFetchParams = null; let httpRequest2 = null; let response = null; const httpCache = null; const revalidatingFlag = false; if (request4.window === "no-window" && request4.redirect === "error") { httpFetchParams = fetchParams; httpRequest2 = request4; } else { httpRequest2 = makeRequest(request4); httpFetchParams = { ...fetchParams }; httpFetchParams.request = httpRequest2; } const includeCredentials = request4.credentials === "include" || request4.credentials === "same-origin" && request4.responseTainting === "basic"; const contentLength = httpRequest2.body ? httpRequest2.body.length : null; let contentLengthHeaderValue = null; if (httpRequest2.body == null && ["POST", "PUT"].includes(httpRequest2.method)) { contentLengthHeaderValue = "0"; } if (contentLength != null) { contentLengthHeaderValue = isomorphicEncode(`${contentLength}`); } if (contentLengthHeaderValue != null) { httpRequest2.headersList.append("content-length", contentLengthHeaderValue); } if (contentLength != null && httpRequest2.keepalive) { } if (httpRequest2.referrer instanceof URL) { httpRequest2.headersList.append("referer", isomorphicEncode(httpRequest2.referrer.href)); } appendRequestOriginHeader(httpRequest2); appendFetchMetadata(httpRequest2); if (!httpRequest2.headersList.contains("user-agent")) { httpRequest2.headersList.append("user-agent", typeof esbuildDetection === "undefined" ? "undici" : "node"); } if (httpRequest2.cache === "default" && (httpRequest2.headersList.contains("if-modified-since") || httpRequest2.headersList.contains("if-none-match") || httpRequest2.headersList.contains("if-unmodified-since") || httpRequest2.headersList.contains("if-match") || httpRequest2.headersList.contains("if-range"))) { httpRequest2.cache = "no-store"; } if (httpRequest2.cache === "no-cache" && !httpRequest2.preventNoCacheCacheControlHeaderModification && !httpRequest2.headersList.contains("cache-control")) { httpRequest2.headersList.append("cache-control", "max-age=0"); } if (httpRequest2.cache === "no-store" || httpRequest2.cache === "reload") { if (!httpRequest2.headersList.contains("pragma")) { httpRequest2.headersList.append("pragma", "no-cache"); } if (!httpRequest2.headersList.contains("cache-control")) { httpRequest2.headersList.append("cache-control", "no-cache"); } } if (httpRequest2.headersList.contains("range")) { httpRequest2.headersList.append("accept-encoding", "identity"); } if (!httpRequest2.headersList.contains("accept-encoding")) { if (urlHasHttpsScheme(requestCurrentURL(httpRequest2))) { httpRequest2.headersList.append("accept-encoding", "br, gzip, deflate"); } else { httpRequest2.headersList.append("accept-encoding", "gzip, deflate"); } } httpRequest2.headersList.delete("host"); if (includeCredentials) { } if (httpCache == null) { httpRequest2.cache = "no-store"; } if (httpRequest2.mode !== "no-store" && httpRequest2.mode !== "reload") { } if (response == null) { if (httpRequest2.mode === "only-if-cached") { return makeNetworkError("only if cached"); } const forwardResponse = await httpNetworkFetch( httpFetchParams, includeCredentials, isNewConnectionFetch ); if (!safeMethodsSet.has(httpRequest2.method) && forwardResponse.status >= 200 && forwardResponse.status <= 399) { } if (revalidatingFlag && forwardResponse.status === 304) { } if (response == null) { response = forwardResponse; } } response.urlList = [...httpRequest2.urlList]; if (httpRequest2.headersList.contains("range")) { response.rangeRequested = true; } response.requestIncludesCredentials = includeCredentials; if (response.status === 407) { if (request4.window === "no-window") { return makeNetworkError(); } if (isCancelled(fetchParams)) { return makeAppropriateNetworkError(fetchParams); } return makeNetworkError("proxy authentication required"); } if ( // response’s status is 421 response.status === 421 && // isNewConnectionFetch is false !isNewConnectionFetch && // request’s body is null, or request’s body is non-null and request’s body’s source is non-null (request4.body == null || request4.body.source != null) ) { if (isCancelled(fetchParams)) { return makeAppropriateNetworkError(fetchParams); } fetchParams.controller.connection.destroy(); response = await httpNetworkOrCacheFetch( fetchParams, isAuthenticationFetch, true ); } if (isAuthenticationFetch) { } return response; } __name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch"); async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) { assert38(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); fetchParams.controller.connection = { abort: null, destroyed: false, destroy(err) { if (!this.destroyed) { this.destroyed = true; this.abort?.(err ?? new DOMException2("The operation was aborted.", "AbortError")); } } }; const request4 = fetchParams.request; let response = null; const timingInfo = fetchParams.timingInfo; const httpCache = null; if (httpCache == null) { request4.cache = "no-store"; } const newConnection = forceNewConnection ? "yes" : "no"; if (request4.mode === "websocket") { } else { } let requestBody = null; if (request4.body == null && fetchParams.processRequestEndOfBody) { queueMicrotask(() => fetchParams.processRequestEndOfBody()); } else if (request4.body != null) { const processBodyChunk = /* @__PURE__ */ __name(async function* (bytes) { if (isCancelled(fetchParams)) { return; } yield bytes; fetchParams.processRequestBodyChunkLength?.(bytes.byteLength); }, "processBodyChunk"); const processEndOfBody = /* @__PURE__ */ __name(() => { if (isCancelled(fetchParams)) { return; } if (fetchParams.processRequestEndOfBody) { fetchParams.processRequestEndOfBody(); } }, "processEndOfBody"); const processBodyError = /* @__PURE__ */ __name((e7) => { if (isCancelled(fetchParams)) { return; } if (e7.name === "AbortError") { fetchParams.controller.abort(); } else { fetchParams.controller.terminate(e7); } }, "processBodyError"); requestBody = async function* () { try { for await (const bytes of request4.body.stream) { yield* processBodyChunk(bytes); } processEndOfBody(); } catch (err) { processBodyError(err); } }(); } try { const { body, status: status2, statusText, headersList, socket } = await dispatch({ body: requestBody }); if (socket) { response = makeResponse({ status: status2, statusText, headersList, socket }); } else { const iterator = body[Symbol.asyncIterator](); fetchParams.controller.next = () => iterator.next(); response = makeResponse({ status: status2, statusText, headersList }); } } catch (err) { if (err.name === "AbortError") { fetchParams.controller.connection.destroy(); return makeAppropriateNetworkError(fetchParams, err); } return makeNetworkError(err); } const pullAlgorithm = /* @__PURE__ */ __name(() => { fetchParams.controller.resume(); }, "pullAlgorithm"); const cancelAlgorithm = /* @__PURE__ */ __name((reason) => { fetchParams.controller.abort(reason); }, "cancelAlgorithm"); if (!ReadableStream3) { ReadableStream3 = require("stream/web").ReadableStream; } const stream2 = new ReadableStream3( { async start(controller) { fetchParams.controller.controller = controller; }, async pull(controller) { await pullAlgorithm(controller); }, async cancel(reason) { await cancelAlgorithm(reason); } }, { highWaterMark: 0, size() { return 1; } } ); response.body = { stream: stream2 }; fetchParams.controller.on("terminated", onAborted); fetchParams.controller.resume = async () => { while (true) { let bytes; let isFailure; try { const { done, value } = await fetchParams.controller.next(); if (isAborted2(fetchParams)) { break; } bytes = done ? void 0 : value; } catch (err) { if (fetchParams.controller.ended && !timingInfo.encodedBodySize) { bytes = void 0; } else { bytes = err; isFailure = true; } } if (bytes === void 0) { readableStreamClose(fetchParams.controller.controller); finalizeResponse(fetchParams, response); return; } timingInfo.decodedBodySize += bytes?.byteLength ?? 0; if (isFailure) { fetchParams.controller.terminate(bytes); return; } fetchParams.controller.controller.enqueue(new Uint8Array(bytes)); if (isErrored(stream2)) { fetchParams.controller.terminate(); return; } if (!fetchParams.controller.controller.desiredSize) { return; } } }; function onAborted(reason) { if (isAborted2(fetchParams)) { response.aborted = true; if (isReadable(stream2)) { fetchParams.controller.controller.error( fetchParams.controller.serializedAbortReason ); } } else { if (isReadable(stream2)) { fetchParams.controller.controller.error(new TypeError("terminated", { cause: isErrorLike(reason) ? reason : void 0 })); } } fetchParams.controller.connection.destroy(); } __name(onAborted, "onAborted"); return response; async function dispatch({ body }) { const url4 = requestCurrentURL(request4); const agent = fetchParams.controller.dispatcher; return new Promise((resolve25, reject) => agent.dispatch( { path: url4.pathname + url4.search, origin: url4.origin, method: request4.method, body: fetchParams.controller.dispatcher.isMockActive ? request4.body && (request4.body.source || request4.body.stream) : body, headers: request4.headersList.entries, maxRedirections: 0, upgrade: request4.mode === "websocket" ? "websocket" : void 0 }, { body: null, abort: null, onConnect(abort) { const { connection } = fetchParams.controller; if (connection.destroyed) { abort(new DOMException2("The operation was aborted.", "AbortError")); } else { fetchParams.controller.on("terminated", abort); this.abort = connection.abort = abort; } }, onHeaders(status2, headersList, resume, statusText) { if (status2 < 200) { return; } let codings = []; let location = ""; const headers = new Headers6(); if (Array.isArray(headersList)) { for (let n6 = 0; n6 < headersList.length; n6 += 2) { const key = headersList[n6 + 0].toString("latin1"); const val2 = headersList[n6 + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { codings = val2.toLowerCase().split(",").map((x6) => x6.trim()); } else if (key.toLowerCase() === "location") { location = val2; } headers[kHeadersList].append(key, val2); } } else { const keys = Object.keys(headersList); for (const key of keys) { const val2 = headersList[key]; if (key.toLowerCase() === "content-encoding") { codings = val2.toLowerCase().split(",").map((x6) => x6.trim()).reverse(); } else if (key.toLowerCase() === "location") { location = val2; } headers[kHeadersList].append(key, val2); } } this.body = new Readable8({ read: resume }); const decoders = []; const willFollow = request4.redirect === "follow" && location && redirectStatusSet.has(status2); if (request4.method !== "HEAD" && request4.method !== "CONNECT" && !nullBodyStatus.includes(status2) && !willFollow) { for (const coding of codings) { if (coding === "x-gzip" || coding === "gzip") { decoders.push(zlib.createGunzip({ // Be less strict when decoding compressed responses, since sometimes // servers send slightly invalid responses that are still accepted // by common browsers. // Always using Z_SYNC_FLUSH is what cURL does. flush: zlib.constants.Z_SYNC_FLUSH, finishFlush: zlib.constants.Z_SYNC_FLUSH })); } else if (coding === "deflate") { decoders.push(zlib.createInflate()); } else if (coding === "br") { decoders.push(zlib.createBrotliDecompress()); } else { decoders.length = 0; break; } } } resolve25({ status: status2, statusText, headersList: headers[kHeadersList], body: decoders.length ? pipeline(this.body, ...decoders, () => { }) : this.body.on("error", () => { }) }); return true; }, onData(chunk) { if (fetchParams.controller.dump) { return; } const bytes = chunk; timingInfo.encodedBodySize += bytes.byteLength; return this.body.push(bytes); }, onComplete() { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } fetchParams.controller.ended = true; this.body.push(null); }, onError(error2) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } this.body?.destroy(error2); fetchParams.controller.terminate(error2); reject(error2); }, onUpgrade(status2, headersList, socket) { if (status2 !== 101) { return; } const headers = new Headers6(); for (let n6 = 0; n6 < headersList.length; n6 += 2) { const key = headersList[n6 + 0].toString("latin1"); const val2 = headersList[n6 + 1].toString("latin1"); headers[kHeadersList].append(key, val2); } resolve25({ status: status2, statusText: STATUS_CODES[status2], headersList: headers[kHeadersList], socket }); return true; } } )); } __name(dispatch, "dispatch"); } __name(httpNetworkFetch, "httpNetworkFetch"); module3.exports = { fetch: fetch15, Fetch, fetching, finalizeAndReportTiming }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fileapi/symbols.js var require_symbols3 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fileapi/symbols.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = { kState: Symbol("FileReader state"), kResult: Symbol("FileReader result"), kError: Symbol("FileReader error"), kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), kEvents: Symbol("FileReader events"), kAborted: Symbol("FileReader aborted") }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fileapi/progressevent.js var require_progressevent = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fileapi/progressevent.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { webidl } = require_webidl(); var kState = Symbol("ProgressEvent state"); var ProgressEvent = class extends Event { constructor(type, eventInitDict = {}) { type = webidl.converters.DOMString(type); eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {}); super(type, eventInitDict); this[kState] = { lengthComputable: eventInitDict.lengthComputable, loaded: eventInitDict.loaded, total: eventInitDict.total }; } get lengthComputable() { webidl.brandCheck(this, ProgressEvent); return this[kState].lengthComputable; } get loaded() { webidl.brandCheck(this, ProgressEvent); return this[kState].loaded; } get total() { webidl.brandCheck(this, ProgressEvent); return this[kState].total; } }; __name(ProgressEvent, "ProgressEvent"); webidl.converters.ProgressEventInit = webidl.dictionaryConverter([ { key: "lengthComputable", converter: webidl.converters.boolean, defaultValue: false }, { key: "loaded", converter: webidl.converters["unsigned long long"], defaultValue: 0 }, { key: "total", converter: webidl.converters["unsigned long long"], defaultValue: 0 }, { key: "bubbles", converter: webidl.converters.boolean, defaultValue: false }, { key: "cancelable", converter: webidl.converters.boolean, defaultValue: false }, { key: "composed", converter: webidl.converters.boolean, defaultValue: false } ]); module3.exports = { ProgressEvent }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fileapi/encoding.js var require_encoding = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fileapi/encoding.js"(exports2, module3) { "use strict"; init_import_meta_url(); function getEncoding(label) { if (!label) { return "failure"; } switch (label.trim().toLowerCase()) { case "unicode-1-1-utf-8": case "unicode11utf8": case "unicode20utf8": case "utf-8": case "utf8": case "x-unicode20utf8": return "UTF-8"; case "866": case "cp866": case "csibm866": case "ibm866": return "IBM866"; case "csisolatin2": case "iso-8859-2": case "iso-ir-101": case "iso8859-2": case "iso88592": case "iso_8859-2": case "iso_8859-2:1987": case "l2": case "latin2": return "ISO-8859-2"; case "csisolatin3": case "iso-8859-3": case "iso-ir-109": case "iso8859-3": case "iso88593": case "iso_8859-3": case "iso_8859-3:1988": case "l3": case "latin3": return "ISO-8859-3"; case "csisolatin4": case "iso-8859-4": case "iso-ir-110": case "iso8859-4": case "iso88594": case "iso_8859-4": case "iso_8859-4:1988": case "l4": case "latin4": return "ISO-8859-4"; case "csisolatincyrillic": case "cyrillic": case "iso-8859-5": case "iso-ir-144": case "iso8859-5": case "iso88595": case "iso_8859-5": case "iso_8859-5:1988": return "ISO-8859-5"; case "arabic": case "asmo-708": case "csiso88596e": case "csiso88596i": case "csisolatinarabic": case "ecma-114": case "iso-8859-6": case "iso-8859-6-e": case "iso-8859-6-i": case "iso-ir-127": case "iso8859-6": case "iso88596": case "iso_8859-6": case "iso_8859-6:1987": return "ISO-8859-6"; case "csisolatingreek": case "ecma-118": case "elot_928": case "greek": case "greek8": case "iso-8859-7": case "iso-ir-126": case "iso8859-7": case "iso88597": case "iso_8859-7": case "iso_8859-7:1987": case "sun_eu_greek": return "ISO-8859-7"; case "csiso88598e": case "csisolatinhebrew": case "hebrew": case "iso-8859-8": case "iso-8859-8-e": case "iso-ir-138": case "iso8859-8": case "iso88598": case "iso_8859-8": case "iso_8859-8:1988": case "visual": return "ISO-8859-8"; case "csiso88598i": case "iso-8859-8-i": case "logical": return "ISO-8859-8-I"; case "csisolatin6": case "iso-8859-10": case "iso-ir-157": case "iso8859-10": case "iso885910": case "l6": case "latin6": return "ISO-8859-10"; case "iso-8859-13": case "iso8859-13": case "iso885913": return "ISO-8859-13"; case "iso-8859-14": case "iso8859-14": case "iso885914": return "ISO-8859-14"; case "csisolatin9": case "iso-8859-15": case "iso8859-15": case "iso885915": case "iso_8859-15": case "l9": return "ISO-8859-15"; case "iso-8859-16": return "ISO-8859-16"; case "cskoi8r": case "koi": case "koi8": case "koi8-r": case "koi8_r": return "KOI8-R"; case "koi8-ru": case "koi8-u": return "KOI8-U"; case "csmacintosh": case "mac": case "macintosh": case "x-mac-roman": return "macintosh"; case "iso-8859-11": case "iso8859-11": case "iso885911": case "tis-620": case "windows-874": return "windows-874"; case "cp1250": case "windows-1250": case "x-cp1250": return "windows-1250"; case "cp1251": case "windows-1251": case "x-cp1251": return "windows-1251"; case "ansi_x3.4-1968": case "ascii": case "cp1252": case "cp819": case "csisolatin1": case "ibm819": case "iso-8859-1": case "iso-ir-100": case "iso8859-1": case "iso88591": case "iso_8859-1": case "iso_8859-1:1987": case "l1": case "latin1": case "us-ascii": case "windows-1252": case "x-cp1252": return "windows-1252"; case "cp1253": case "windows-1253": case "x-cp1253": return "windows-1253"; case "cp1254": case "csisolatin5": case "iso-8859-9": case "iso-ir-148": case "iso8859-9": case "iso88599": case "iso_8859-9": case "iso_8859-9:1989": case "l5": case "latin5": case "windows-1254": case "x-cp1254": return "windows-1254"; case "cp1255": case "windows-1255": case "x-cp1255": return "windows-1255"; case "cp1256": case "windows-1256": case "x-cp1256": return "windows-1256"; case "cp1257": case "windows-1257": case "x-cp1257": return "windows-1257"; case "cp1258": case "windows-1258": case "x-cp1258": return "windows-1258"; case "x-mac-cyrillic": case "x-mac-ukrainian": return "x-mac-cyrillic"; case "chinese": case "csgb2312": case "csiso58gb231280": case "gb2312": case "gb_2312": case "gb_2312-80": case "gbk": case "iso-ir-58": case "x-gbk": return "GBK"; case "gb18030": return "gb18030"; case "big5": case "big5-hkscs": case "cn-big5": case "csbig5": case "x-x-big5": return "Big5"; case "cseucpkdfmtjapanese": case "euc-jp": case "x-euc-jp": return "EUC-JP"; case "csiso2022jp": case "iso-2022-jp": return "ISO-2022-JP"; case "csshiftjis": case "ms932": case "ms_kanji": case "shift-jis": case "shift_jis": case "sjis": case "windows-31j": case "x-sjis": return "Shift_JIS"; case "cseuckr": case "csksc56011987": case "euc-kr": case "iso-ir-149": case "korean": case "ks_c_5601-1987": case "ks_c_5601-1989": case "ksc5601": case "ksc_5601": case "windows-949": return "EUC-KR"; case "csiso2022kr": case "hz-gb-2312": case "iso-2022-cn": case "iso-2022-cn-ext": case "iso-2022-kr": case "replacement": return "replacement"; case "unicodefffe": case "utf-16be": return "UTF-16BE"; case "csunicode": case "iso-10646-ucs-2": case "ucs-2": case "unicode": case "unicodefeff": case "utf-16": case "utf-16le": return "UTF-16LE"; case "x-user-defined": return "x-user-defined"; default: return "failure"; } } __name(getEncoding, "getEncoding"); module3.exports = { getEncoding }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fileapi/util.js var require_util4 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fileapi/util.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { kState, kError, kResult, kAborted, kLastProgressEventFired } = require_symbols3(); var { ProgressEvent } = require_progressevent(); var { getEncoding } = require_encoding(); var { DOMException: DOMException2 } = require_constants2(); var { serializeAMimeType, parseMIMEType } = require_dataURL(); var { types } = require("util"); var { StringDecoder: StringDecoder2 } = require("string_decoder"); var { btoa: btoa2 } = require("buffer"); var staticPropertyDescriptors = { enumerable: true, writable: false, configurable: false }; function readOperation(fr2, blob, type, encodingName) { if (fr2[kState] === "loading") { throw new DOMException2("Invalid state", "InvalidStateError"); } fr2[kState] = "loading"; fr2[kResult] = null; fr2[kError] = null; const stream2 = blob.stream(); const reader = stream2.getReader(); const bytes = []; let chunkPromise = reader.read(); let isFirstChunk = true; (async () => { while (!fr2[kAborted]) { try { const { done, value } = await chunkPromise; if (isFirstChunk && !fr2[kAborted]) { queueMicrotask(() => { fireAProgressEvent("loadstart", fr2); }); } isFirstChunk = false; if (!done && types.isUint8Array(value)) { bytes.push(value); if ((fr2[kLastProgressEventFired] === void 0 || Date.now() - fr2[kLastProgressEventFired] >= 50) && !fr2[kAborted]) { fr2[kLastProgressEventFired] = Date.now(); queueMicrotask(() => { fireAProgressEvent("progress", fr2); }); } chunkPromise = reader.read(); } else if (done) { queueMicrotask(() => { fr2[kState] = "done"; try { const result = packageData(bytes, type, blob.type, encodingName); if (fr2[kAborted]) { return; } fr2[kResult] = result; fireAProgressEvent("load", fr2); } catch (error2) { fr2[kError] = error2; fireAProgressEvent("error", fr2); } if (fr2[kState] !== "loading") { fireAProgressEvent("loadend", fr2); } }); break; } } catch (error2) { if (fr2[kAborted]) { return; } queueMicrotask(() => { fr2[kState] = "done"; fr2[kError] = error2; fireAProgressEvent("error", fr2); if (fr2[kState] !== "loading") { fireAProgressEvent("loadend", fr2); } }); break; } } })(); } __name(readOperation, "readOperation"); function fireAProgressEvent(e7, reader) { const event = new ProgressEvent(e7, { bubbles: false, cancelable: false }); reader.dispatchEvent(event); } __name(fireAProgressEvent, "fireAProgressEvent"); function packageData(bytes, type, mimeType, encodingName) { switch (type) { case "DataURL": { let dataURL = "data:"; const parsed = parseMIMEType(mimeType || "application/octet-stream"); if (parsed !== "failure") { dataURL += serializeAMimeType(parsed); } dataURL += ";base64,"; const decoder = new StringDecoder2("latin1"); for (const chunk of bytes) { dataURL += btoa2(decoder.write(chunk)); } dataURL += btoa2(decoder.end()); return dataURL; } case "Text": { let encoding = "failure"; if (encodingName) { encoding = getEncoding(encodingName); } if (encoding === "failure" && mimeType) { const type2 = parseMIMEType(mimeType); if (type2 !== "failure") { encoding = getEncoding(type2.parameters.get("charset")); } } if (encoding === "failure") { encoding = "UTF-8"; } return decode(bytes, encoding); } case "ArrayBuffer": { const sequence = combineByteSequences(bytes); return sequence.buffer; } case "BinaryString": { let binaryString = ""; const decoder = new StringDecoder2("latin1"); for (const chunk of bytes) { binaryString += decoder.write(chunk); } binaryString += decoder.end(); return binaryString; } } } __name(packageData, "packageData"); function decode(ioQueue, encoding) { const bytes = combineByteSequences(ioQueue); const BOMEncoding = BOMSniffing(bytes); let slice = 0; if (BOMEncoding !== null) { encoding = BOMEncoding; slice = BOMEncoding === "UTF-8" ? 3 : 2; } const sliced = bytes.slice(slice); return new TextDecoder(encoding).decode(sliced); } __name(decode, "decode"); function BOMSniffing(ioQueue) { const [a5, b6, c6] = ioQueue; if (a5 === 239 && b6 === 187 && c6 === 191) { return "UTF-8"; } else if (a5 === 254 && b6 === 255) { return "UTF-16BE"; } else if (a5 === 255 && b6 === 254) { return "UTF-16LE"; } return null; } __name(BOMSniffing, "BOMSniffing"); function combineByteSequences(sequences) { const size = sequences.reduce((a5, b6) => { return a5 + b6.byteLength; }, 0); let offset = 0; return sequences.reduce((a5, b6) => { a5.set(b6, offset); offset += b6.byteLength; return a5; }, new Uint8Array(size)); } __name(combineByteSequences, "combineByteSequences"); module3.exports = { staticPropertyDescriptors, readOperation, fireAProgressEvent }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fileapi/filereader.js var require_filereader = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/fileapi/filereader.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { staticPropertyDescriptors, readOperation, fireAProgressEvent } = require_util4(); var { kState, kError, kResult, kEvents, kAborted } = require_symbols3(); var { webidl } = require_webidl(); var { kEnumerableProperty } = require_util(); var FileReader2 = class extends EventTarget { constructor() { super(); this[kState] = "empty"; this[kResult] = null; this[kError] = null; this[kEvents] = { loadend: null, error: null, abort: null, load: null, progress: null, loadstart: null }; } /** * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer * @param {import('buffer').Blob} blob */ readAsArrayBuffer(blob) { webidl.brandCheck(this, FileReader2); webidl.argumentLengthCheck(arguments, 1, { header: "FileReader.readAsArrayBuffer" }); blob = webidl.converters.Blob(blob, { strict: false }); readOperation(this, blob, "ArrayBuffer"); } /** * @see https://w3c.github.io/FileAPI/#readAsBinaryString * @param {import('buffer').Blob} blob */ readAsBinaryString(blob) { webidl.brandCheck(this, FileReader2); webidl.argumentLengthCheck(arguments, 1, { header: "FileReader.readAsBinaryString" }); blob = webidl.converters.Blob(blob, { strict: false }); readOperation(this, blob, "BinaryString"); } /** * @see https://w3c.github.io/FileAPI/#readAsDataText * @param {import('buffer').Blob} blob * @param {string?} encoding */ readAsText(blob, encoding = void 0) { webidl.brandCheck(this, FileReader2); webidl.argumentLengthCheck(arguments, 1, { header: "FileReader.readAsText" }); blob = webidl.converters.Blob(blob, { strict: false }); if (encoding !== void 0) { encoding = webidl.converters.DOMString(encoding); } readOperation(this, blob, "Text", encoding); } /** * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL * @param {import('buffer').Blob} blob */ readAsDataURL(blob) { webidl.brandCheck(this, FileReader2); webidl.argumentLengthCheck(arguments, 1, { header: "FileReader.readAsDataURL" }); blob = webidl.converters.Blob(blob, { strict: false }); readOperation(this, blob, "DataURL"); } /** * @see https://w3c.github.io/FileAPI/#dfn-abort */ abort() { if (this[kState] === "empty" || this[kState] === "done") { this[kResult] = null; return; } if (this[kState] === "loading") { this[kState] = "done"; this[kResult] = null; } this[kAborted] = true; fireAProgressEvent("abort", this); if (this[kState] !== "loading") { fireAProgressEvent("loadend", this); } } /** * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate */ get readyState() { webidl.brandCheck(this, FileReader2); switch (this[kState]) { case "empty": return this.EMPTY; case "loading": return this.LOADING; case "done": return this.DONE; } } /** * @see https://w3c.github.io/FileAPI/#dom-filereader-result */ get result() { webidl.brandCheck(this, FileReader2); return this[kResult]; } /** * @see https://w3c.github.io/FileAPI/#dom-filereader-error */ get error() { webidl.brandCheck(this, FileReader2); return this[kError]; } get onloadend() { webidl.brandCheck(this, FileReader2); return this[kEvents].loadend; } set onloadend(fn2) { webidl.brandCheck(this, FileReader2); if (this[kEvents].loadend) { this.removeEventListener("loadend", this[kEvents].loadend); } if (typeof fn2 === "function") { this[kEvents].loadend = fn2; this.addEventListener("loadend", fn2); } else { this[kEvents].loadend = null; } } get onerror() { webidl.brandCheck(this, FileReader2); return this[kEvents].error; } set onerror(fn2) { webidl.brandCheck(this, FileReader2); if (this[kEvents].error) { this.removeEventListener("error", this[kEvents].error); } if (typeof fn2 === "function") { this[kEvents].error = fn2; this.addEventListener("error", fn2); } else { this[kEvents].error = null; } } get onloadstart() { webidl.brandCheck(this, FileReader2); return this[kEvents].loadstart; } set onloadstart(fn2) { webidl.brandCheck(this, FileReader2); if (this[kEvents].loadstart) { this.removeEventListener("loadstart", this[kEvents].loadstart); } if (typeof fn2 === "function") { this[kEvents].loadstart = fn2; this.addEventListener("loadstart", fn2); } else { this[kEvents].loadstart = null; } } get onprogress() { webidl.brandCheck(this, FileReader2); return this[kEvents].progress; } set onprogress(fn2) { webidl.brandCheck(this, FileReader2); if (this[kEvents].progress) { this.removeEventListener("progress", this[kEvents].progress); } if (typeof fn2 === "function") { this[kEvents].progress = fn2; this.addEventListener("progress", fn2); } else { this[kEvents].progress = null; } } get onload() { webidl.brandCheck(this, FileReader2); return this[kEvents].load; } set onload(fn2) { webidl.brandCheck(this, FileReader2); if (this[kEvents].load) { this.removeEventListener("load", this[kEvents].load); } if (typeof fn2 === "function") { this[kEvents].load = fn2; this.addEventListener("load", fn2); } else { this[kEvents].load = null; } } get onabort() { webidl.brandCheck(this, FileReader2); return this[kEvents].abort; } set onabort(fn2) { webidl.brandCheck(this, FileReader2); if (this[kEvents].abort) { this.removeEventListener("abort", this[kEvents].abort); } if (typeof fn2 === "function") { this[kEvents].abort = fn2; this.addEventListener("abort", fn2); } else { this[kEvents].abort = null; } } }; __name(FileReader2, "FileReader"); FileReader2.EMPTY = FileReader2.prototype.EMPTY = 0; FileReader2.LOADING = FileReader2.prototype.LOADING = 1; FileReader2.DONE = FileReader2.prototype.DONE = 2; Object.defineProperties(FileReader2.prototype, { EMPTY: staticPropertyDescriptors, LOADING: staticPropertyDescriptors, DONE: staticPropertyDescriptors, readAsArrayBuffer: kEnumerableProperty, readAsBinaryString: kEnumerableProperty, readAsText: kEnumerableProperty, readAsDataURL: kEnumerableProperty, abort: kEnumerableProperty, readyState: kEnumerableProperty, result: kEnumerableProperty, error: kEnumerableProperty, onloadstart: kEnumerableProperty, onprogress: kEnumerableProperty, onload: kEnumerableProperty, onabort: kEnumerableProperty, onerror: kEnumerableProperty, onloadend: kEnumerableProperty, [Symbol.toStringTag]: { value: "FileReader", writable: false, enumerable: false, configurable: true } }); Object.defineProperties(FileReader2, { EMPTY: staticPropertyDescriptors, LOADING: staticPropertyDescriptors, DONE: staticPropertyDescriptors }); module3.exports = { FileReader: FileReader2 }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cache/symbols.js var require_symbols4 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cache/symbols.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = { kConstruct: require_symbols().kConstruct }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cache/util.js var require_util5 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cache/util.js"(exports2, module3) { "use strict"; init_import_meta_url(); var assert38 = require("assert"); var { URLSerializer } = require_dataURL(); var { isValidHeaderName } = require_util2(); function urlEquals(A3, B3, excludeFragment = false) { const serializedA = URLSerializer(A3, excludeFragment); const serializedB = URLSerializer(B3, excludeFragment); return serializedA === serializedB; } __name(urlEquals, "urlEquals"); function fieldValues(header) { assert38(header !== null); const values = []; for (let value of header.split(",")) { value = value.trim(); if (!value.length) { continue; } else if (!isValidHeaderName(value)) { continue; } values.push(value); } return values; } __name(fieldValues, "fieldValues"); module3.exports = { urlEquals, fieldValues }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cache/cache.js var require_cache = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cache/cache.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { kConstruct } = require_symbols4(); var { urlEquals, fieldValues: getFieldValues } = require_util5(); var { kEnumerableProperty, isDisturbed } = require_util(); var { kHeadersList } = require_symbols(); var { webidl } = require_webidl(); var { Response: Response13, cloneResponse } = require_response(); var { Request: Request4 } = require_request2(); var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); var { fetching } = require_fetch(); var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util2(); var assert38 = require("assert"); var { getGlobalDispatcher: getGlobalDispatcher2 } = require_global2(); var Cache3 = class { /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list * @type {requestResponseList} */ #relevantRequestResponseList; constructor() { if (arguments[0] !== kConstruct) { webidl.illegalConstructor(); } this.#relevantRequestResponseList = arguments[1]; } async match(request4, options32 = {}) { webidl.brandCheck(this, Cache3); webidl.argumentLengthCheck(arguments, 1, { header: "Cache.match" }); request4 = webidl.converters.RequestInfo(request4); options32 = webidl.converters.CacheQueryOptions(options32); const p6 = await this.matchAll(request4, options32); if (p6.length === 0) { return; } return p6[0]; } async matchAll(request4 = void 0, options32 = {}) { webidl.brandCheck(this, Cache3); if (request4 !== void 0) request4 = webidl.converters.RequestInfo(request4); options32 = webidl.converters.CacheQueryOptions(options32); let r7 = null; if (request4 !== void 0) { if (request4 instanceof Request4) { r7 = request4[kState]; if (r7.method !== "GET" && !options32.ignoreMethod) { return []; } } else if (typeof request4 === "string") { r7 = new Request4(request4)[kState]; } } const responses = []; if (request4 === void 0) { for (const requestResponse of this.#relevantRequestResponseList) { responses.push(requestResponse[1]); } } else { const requestResponses = this.#queryCache(r7, options32); for (const requestResponse of requestResponses) { responses.push(requestResponse[1]); } } const responseList = []; for (const response of responses) { const responseObject = new Response13(response.body?.source ?? null); const body = responseObject[kState].body; responseObject[kState] = response; responseObject[kState].body = body; responseObject[kHeaders][kHeadersList] = response.headersList; responseObject[kHeaders][kGuard] = "immutable"; responseList.push(responseObject); } return Object.freeze(responseList); } async add(request4) { webidl.brandCheck(this, Cache3); webidl.argumentLengthCheck(arguments, 1, { header: "Cache.add" }); request4 = webidl.converters.RequestInfo(request4); const requests = [request4]; const responseArrayPromise = this.addAll(requests); return await responseArrayPromise; } async addAll(requests) { webidl.brandCheck(this, Cache3); webidl.argumentLengthCheck(arguments, 1, { header: "Cache.addAll" }); requests = webidl.converters["sequence"](requests); const responsePromises = []; const requestList = []; for (const request4 of requests) { if (typeof request4 === "string") { continue; } const r7 = request4[kState]; if (!urlIsHttpHttpsScheme(r7.url) || r7.method !== "GET") { throw webidl.errors.exception({ header: "Cache.addAll", message: "Expected http/s scheme when method is not GET." }); } } const fetchControllers = []; for (const request4 of requests) { const r7 = new Request4(request4)[kState]; if (!urlIsHttpHttpsScheme(r7.url)) { throw webidl.errors.exception({ header: "Cache.addAll", message: "Expected http/s scheme." }); } r7.initiator = "fetch"; r7.destination = "subresource"; requestList.push(r7); const responsePromise = createDeferredPromise(); fetchControllers.push(fetching({ request: r7, dispatcher: getGlobalDispatcher2(), processResponse(response) { if (response.type === "error" || response.status === 206 || response.status < 200 || response.status > 299) { responsePromise.reject(webidl.errors.exception({ header: "Cache.addAll", message: "Received an invalid status code or the request failed." })); } else if (response.headersList.contains("vary")) { const fieldValues = getFieldValues(response.headersList.get("vary")); for (const fieldValue of fieldValues) { if (fieldValue === "*") { responsePromise.reject(webidl.errors.exception({ header: "Cache.addAll", message: "invalid vary field value" })); for (const controller of fetchControllers) { controller.abort(); } return; } } } }, processResponseEndOfBody(response) { if (response.aborted) { responsePromise.reject(new DOMException("aborted", "AbortError")); return; } responsePromise.resolve(response); } })); responsePromises.push(responsePromise.promise); } const p6 = Promise.all(responsePromises); const responses = await p6; const operations = []; let index = 0; for (const response of responses) { const operation = { type: "put", // 7.3.2 request: requestList[index], // 7.3.3 response // 7.3.4 }; operations.push(operation); index++; } const cacheJobPromise = createDeferredPromise(); let errorData = null; try { this.#batchCacheOperations(operations); } catch (e7) { errorData = e7; } queueMicrotask(() => { if (errorData === null) { cacheJobPromise.resolve(void 0); } else { cacheJobPromise.reject(errorData); } }); return cacheJobPromise.promise; } async put(request4, response) { webidl.brandCheck(this, Cache3); webidl.argumentLengthCheck(arguments, 2, { header: "Cache.put" }); request4 = webidl.converters.RequestInfo(request4); response = webidl.converters.Response(response); let innerRequest = null; if (request4 instanceof Request4) { innerRequest = request4[kState]; } else { innerRequest = new Request4(request4)[kState]; } if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== "GET") { throw webidl.errors.exception({ header: "Cache.put", message: "Expected an http/s scheme when method is not GET" }); } const innerResponse = response[kState]; if (innerResponse.status === 206) { throw webidl.errors.exception({ header: "Cache.put", message: "Got 206 status" }); } if (innerResponse.headersList.contains("vary")) { const fieldValues = getFieldValues(innerResponse.headersList.get("vary")); for (const fieldValue of fieldValues) { if (fieldValue === "*") { throw webidl.errors.exception({ header: "Cache.put", message: "Got * vary field value" }); } } } if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { throw webidl.errors.exception({ header: "Cache.put", message: "Response body is locked or disturbed" }); } const clonedResponse = cloneResponse(innerResponse); const bodyReadPromise = createDeferredPromise(); if (innerResponse.body != null) { const stream2 = innerResponse.body.stream; const reader = stream2.getReader(); readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject); } else { bodyReadPromise.resolve(void 0); } const operations = []; const operation = { type: "put", // 14. request: innerRequest, // 15. response: clonedResponse // 16. }; operations.push(operation); const bytes = await bodyReadPromise.promise; if (clonedResponse.body != null) { clonedResponse.body.source = bytes; } const cacheJobPromise = createDeferredPromise(); let errorData = null; try { this.#batchCacheOperations(operations); } catch (e7) { errorData = e7; } queueMicrotask(() => { if (errorData === null) { cacheJobPromise.resolve(); } else { cacheJobPromise.reject(errorData); } }); return cacheJobPromise.promise; } async delete(request4, options32 = {}) { webidl.brandCheck(this, Cache3); webidl.argumentLengthCheck(arguments, 1, { header: "Cache.delete" }); request4 = webidl.converters.RequestInfo(request4); options32 = webidl.converters.CacheQueryOptions(options32); let r7 = null; if (request4 instanceof Request4) { r7 = request4[kState]; if (r7.method !== "GET" && !options32.ignoreMethod) { return false; } } else { assert38(typeof request4 === "string"); r7 = new Request4(request4)[kState]; } const operations = []; const operation = { type: "delete", request: r7, options: options32 }; operations.push(operation); const cacheJobPromise = createDeferredPromise(); let errorData = null; let requestResponses; try { requestResponses = this.#batchCacheOperations(operations); } catch (e7) { errorData = e7; } queueMicrotask(() => { if (errorData === null) { cacheJobPromise.resolve(!!requestResponses?.length); } else { cacheJobPromise.reject(errorData); } }); return cacheJobPromise.promise; } /** * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys * @param {any} request * @param {import('../../types/cache').CacheQueryOptions} options * @returns {readonly Request[]} */ async keys(request4 = void 0, options32 = {}) { webidl.brandCheck(this, Cache3); if (request4 !== void 0) request4 = webidl.converters.RequestInfo(request4); options32 = webidl.converters.CacheQueryOptions(options32); let r7 = null; if (request4 !== void 0) { if (request4 instanceof Request4) { r7 = request4[kState]; if (r7.method !== "GET" && !options32.ignoreMethod) { return []; } } else if (typeof request4 === "string") { r7 = new Request4(request4)[kState]; } } const promise = createDeferredPromise(); const requests = []; if (request4 === void 0) { for (const requestResponse of this.#relevantRequestResponseList) { requests.push(requestResponse[0]); } } else { const requestResponses = this.#queryCache(r7, options32); for (const requestResponse of requestResponses) { requests.push(requestResponse[0]); } } queueMicrotask(() => { const requestList = []; for (const request5 of requests) { const requestObject = new Request4("https://a"); requestObject[kState] = request5; requestObject[kHeaders][kHeadersList] = request5.headersList; requestObject[kHeaders][kGuard] = "immutable"; requestObject[kRealm] = request5.client; requestList.push(requestObject); } promise.resolve(Object.freeze(requestList)); }); return promise.promise; } /** * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm * @param {CacheBatchOperation[]} operations * @returns {requestResponseList} */ #batchCacheOperations(operations) { const cache6 = this.#relevantRequestResponseList; const backupCache = [...cache6]; const addedItems = []; const resultList = []; try { for (const operation of operations) { if (operation.type !== "delete" && operation.type !== "put") { throw webidl.errors.exception({ header: "Cache.#batchCacheOperations", message: 'operation type does not match "delete" or "put"' }); } if (operation.type === "delete" && operation.response != null) { throw webidl.errors.exception({ header: "Cache.#batchCacheOperations", message: "delete operation should not have an associated response" }); } if (this.#queryCache(operation.request, operation.options, addedItems).length) { throw new DOMException("???", "InvalidStateError"); } let requestResponses; if (operation.type === "delete") { requestResponses = this.#queryCache(operation.request, operation.options); if (requestResponses.length === 0) { return []; } for (const requestResponse of requestResponses) { const idx = cache6.indexOf(requestResponse); assert38(idx !== -1); cache6.splice(idx, 1); } } else if (operation.type === "put") { if (operation.response == null) { throw webidl.errors.exception({ header: "Cache.#batchCacheOperations", message: "put operation should have an associated response" }); } const r7 = operation.request; if (!urlIsHttpHttpsScheme(r7.url)) { throw webidl.errors.exception({ header: "Cache.#batchCacheOperations", message: "expected http or https scheme" }); } if (r7.method !== "GET") { throw webidl.errors.exception({ header: "Cache.#batchCacheOperations", message: "not get method" }); } if (operation.options != null) { throw webidl.errors.exception({ header: "Cache.#batchCacheOperations", message: "options must not be defined" }); } requestResponses = this.#queryCache(operation.request); for (const requestResponse of requestResponses) { const idx = cache6.indexOf(requestResponse); assert38(idx !== -1); cache6.splice(idx, 1); } cache6.push([operation.request, operation.response]); addedItems.push([operation.request, operation.response]); } resultList.push([operation.request, operation.response]); } return resultList; } catch (e7) { this.#relevantRequestResponseList.length = 0; this.#relevantRequestResponseList = backupCache; throw e7; } } /** * @see https://w3c.github.io/ServiceWorker/#query-cache * @param {any} requestQuery * @param {import('../../types/cache').CacheQueryOptions} options * @param {requestResponseList} targetStorage * @returns {requestResponseList} */ #queryCache(requestQuery, options32, targetStorage) { const resultList = []; const storage = targetStorage ?? this.#relevantRequestResponseList; for (const requestResponse of storage) { const [cachedRequest, cachedResponse] = requestResponse; if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options32)) { resultList.push(requestResponse); } } return resultList; } /** * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm * @param {any} requestQuery * @param {any} request * @param {any | null} response * @param {import('../../types/cache').CacheQueryOptions | undefined} options * @returns {boolean} */ #requestMatchesCachedItem(requestQuery, request4, response = null, options32) { const queryURL = new URL(requestQuery.url); const cachedURL = new URL(request4.url); if (options32?.ignoreSearch) { cachedURL.search = ""; queryURL.search = ""; } if (!urlEquals(queryURL, cachedURL, true)) { return false; } if (response == null || options32?.ignoreVary || !response.headersList.contains("vary")) { return true; } const fieldValues = getFieldValues(response.headersList.get("vary")); for (const fieldValue of fieldValues) { if (fieldValue === "*") { return false; } const requestValue = request4.headersList.get(fieldValue); const queryValue = requestQuery.headersList.get(fieldValue); if (requestValue !== queryValue) { return false; } } return true; } }; __name(Cache3, "Cache"); Object.defineProperties(Cache3.prototype, { [Symbol.toStringTag]: { value: "Cache", configurable: true }, match: kEnumerableProperty, matchAll: kEnumerableProperty, add: kEnumerableProperty, addAll: kEnumerableProperty, put: kEnumerableProperty, delete: kEnumerableProperty, keys: kEnumerableProperty }); var cacheQueryOptionConverters = [ { key: "ignoreSearch", converter: webidl.converters.boolean, defaultValue: false }, { key: "ignoreMethod", converter: webidl.converters.boolean, defaultValue: false }, { key: "ignoreVary", converter: webidl.converters.boolean, defaultValue: false } ]; webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters); webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([ ...cacheQueryOptionConverters, { key: "cacheName", converter: webidl.converters.DOMString } ]); webidl.converters.Response = webidl.interfaceConverter(Response13); webidl.converters["sequence"] = webidl.sequenceConverter( webidl.converters.RequestInfo ); module3.exports = { Cache: Cache3 }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cache/cachestorage.js var require_cachestorage = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cache/cachestorage.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { kConstruct } = require_symbols4(); var { Cache: Cache3 } = require_cache(); var { webidl } = require_webidl(); var { kEnumerableProperty } = require_util(); var CacheStorage2 = class { /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map * @type {Map} */ async has(cacheName) { webidl.brandCheck(this, CacheStorage2); webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.has" }); cacheName = webidl.converters.DOMString(cacheName); return this.#caches.has(cacheName); } /** * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open * @param {string} cacheName * @returns {Promise} */ async open(cacheName) { webidl.brandCheck(this, CacheStorage2); webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.open" }); cacheName = webidl.converters.DOMString(cacheName); if (this.#caches.has(cacheName)) { const cache7 = this.#caches.get(cacheName); return new Cache3(kConstruct, cache7); } const cache6 = []; this.#caches.set(cacheName, cache6); return new Cache3(kConstruct, cache6); } /** * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete * @param {string} cacheName * @returns {Promise} */ async delete(cacheName) { webidl.brandCheck(this, CacheStorage2); webidl.argumentLengthCheck(arguments, 1, { header: "CacheStorage.delete" }); cacheName = webidl.converters.DOMString(cacheName); return this.#caches.delete(cacheName); } /** * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys * @returns {string[]} */ async keys() { webidl.brandCheck(this, CacheStorage2); const keys = this.#caches.keys(); return [...keys]; } }; __name(CacheStorage2, "CacheStorage"); Object.defineProperties(CacheStorage2.prototype, { [Symbol.toStringTag]: { value: "CacheStorage", configurable: true }, match: kEnumerableProperty, has: kEnumerableProperty, open: kEnumerableProperty, delete: kEnumerableProperty, keys: kEnumerableProperty }); module3.exports = { CacheStorage: CacheStorage2 }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cookies/constants.js var require_constants4 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cookies/constants.js"(exports2, module3) { "use strict"; init_import_meta_url(); var maxAttributeValueSize = 1024; var maxNameValuePairSize = 4096; module3.exports = { maxAttributeValueSize, maxNameValuePairSize }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cookies/util.js var require_util6 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cookies/util.js"(exports2, module3) { "use strict"; init_import_meta_url(); var assert38 = require("assert"); var { kHeadersList } = require_symbols(); function isCTLExcludingHtab(value) { if (value.length === 0) { return false; } for (const char of value) { const code = char.charCodeAt(0); if (code >= 0 || code <= 8 || (code >= 10 || code <= 31) || code === 127) { return false; } } } __name(isCTLExcludingHtab, "isCTLExcludingHtab"); function validateCookieName(name2) { for (const char of name2) { const code = char.charCodeAt(0); if (code <= 32 || code > 127 || char === "(" || char === ")" || char === ">" || char === "<" || char === "@" || char === "," || char === ";" || char === ":" || char === "\\" || char === '"' || char === "/" || char === "[" || char === "]" || char === "?" || char === "=" || char === "{" || char === "}") { throw new Error("Invalid cookie name"); } } } __name(validateCookieName, "validateCookieName"); function validateCookieValue(value) { for (const char of value) { const code = char.charCodeAt(0); if (code < 33 || // exclude CTLs (0-31) code === 34 || code === 44 || code === 59 || code === 92 || code > 126) { throw new Error("Invalid header value"); } } } __name(validateCookieValue, "validateCookieValue"); function validateCookiePath(path72) { for (const char of path72) { const code = char.charCodeAt(0); if (code < 33 || char === ";") { throw new Error("Invalid cookie path"); } } } __name(validateCookiePath, "validateCookiePath"); function validateCookieDomain(domain3) { if (domain3.startsWith("-") || domain3.endsWith(".") || domain3.endsWith("-")) { throw new Error("Invalid cookie domain"); } } __name(validateCookieDomain, "validateCookieDomain"); function toIMFDate(date) { if (typeof date === "number") { date = new Date(date); } const days = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]; const months = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; const dayName = days[date.getUTCDay()]; const day2 = date.getUTCDate().toString().padStart(2, "0"); const month2 = months[date.getUTCMonth()]; const year2 = date.getUTCFullYear(); const hour2 = date.getUTCHours().toString().padStart(2, "0"); const minute2 = date.getUTCMinutes().toString().padStart(2, "0"); const second = date.getUTCSeconds().toString().padStart(2, "0"); return `${dayName}, ${day2} ${month2} ${year2} ${hour2}:${minute2}:${second} GMT`; } __name(toIMFDate, "toIMFDate"); function validateCookieMaxAge(maxAge) { if (maxAge < 0) { throw new Error("Invalid cookie max-age"); } } __name(validateCookieMaxAge, "validateCookieMaxAge"); function stringify(cookie) { if (cookie.name.length === 0) { return null; } validateCookieName(cookie.name); validateCookieValue(cookie.value); const out = [`${cookie.name}=${cookie.value}`]; if (cookie.name.startsWith("__Secure-")) { cookie.secure = true; } if (cookie.name.startsWith("__Host-")) { cookie.secure = true; cookie.domain = null; cookie.path = "/"; } if (cookie.secure) { out.push("Secure"); } if (cookie.httpOnly) { out.push("HttpOnly"); } if (typeof cookie.maxAge === "number") { validateCookieMaxAge(cookie.maxAge); out.push(`Max-Age=${cookie.maxAge}`); } if (cookie.domain) { validateCookieDomain(cookie.domain); out.push(`Domain=${cookie.domain}`); } if (cookie.path) { validateCookiePath(cookie.path); out.push(`Path=${cookie.path}`); } if (cookie.expires && cookie.expires.toString() !== "Invalid Date") { out.push(`Expires=${toIMFDate(cookie.expires)}`); } if (cookie.sameSite) { out.push(`SameSite=${cookie.sameSite}`); } for (const part of cookie.unparsed) { if (!part.includes("=")) { throw new Error("Invalid unparsed"); } const [key, ...value] = part.split("="); out.push(`${key.trim()}=${value.join("=")}`); } return out.join("; "); } __name(stringify, "stringify"); var kHeadersListNode; function getHeadersList(headers) { if (headers[kHeadersList]) { return headers[kHeadersList]; } if (!kHeadersListNode) { kHeadersListNode = Object.getOwnPropertySymbols(headers).find( (symbol) => symbol.description === "headers list" ); assert38(kHeadersListNode, "Headers cannot be parsed"); } const headersList = headers[kHeadersListNode]; assert38(headersList); return headersList; } __name(getHeadersList, "getHeadersList"); module3.exports = { isCTLExcludingHtab, stringify, getHeadersList }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cookies/parse.js var require_parse = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cookies/parse.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4(); var { isCTLExcludingHtab } = require_util6(); var { collectASequenceOfCodePointsFast } = require_dataURL(); var assert38 = require("assert"); function parseSetCookie(header) { if (isCTLExcludingHtab(header)) { return null; } let nameValuePair = ""; let unparsedAttributes = ""; let name2 = ""; let value = ""; if (header.includes(";")) { const position = { position: 0 }; nameValuePair = collectASequenceOfCodePointsFast(";", header, position); unparsedAttributes = header.slice(position.position); } else { nameValuePair = header; } if (!nameValuePair.includes("=")) { value = nameValuePair; } else { const position = { position: 0 }; name2 = collectASequenceOfCodePointsFast( "=", nameValuePair, position ); value = nameValuePair.slice(position.position + 1); } name2 = name2.trim(); value = value.trim(); if (name2.length + value.length > maxNameValuePairSize) { return null; } return { name: name2, value, ...parseUnparsedAttributes(unparsedAttributes) }; } __name(parseSetCookie, "parseSetCookie"); function parseUnparsedAttributes(unparsedAttributes, cookieAttributeList = {}) { if (unparsedAttributes.length === 0) { return cookieAttributeList; } assert38(unparsedAttributes[0] === ";"); unparsedAttributes = unparsedAttributes.slice(1); let cookieAv = ""; if (unparsedAttributes.includes(";")) { cookieAv = collectASequenceOfCodePointsFast( ";", unparsedAttributes, { position: 0 } ); unparsedAttributes = unparsedAttributes.slice(cookieAv.length); } else { cookieAv = unparsedAttributes; unparsedAttributes = ""; } let attributeName = ""; let attributeValue = ""; if (cookieAv.includes("=")) { const position = { position: 0 }; attributeName = collectASequenceOfCodePointsFast( "=", cookieAv, position ); attributeValue = cookieAv.slice(position.position + 1); } else { attributeName = cookieAv; } attributeName = attributeName.trim(); attributeValue = attributeValue.trim(); if (attributeValue.length > maxAttributeValueSize) { return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); } const attributeNameLowercase = attributeName.toLowerCase(); if (attributeNameLowercase === "expires") { const expiryTime = new Date(attributeValue); cookieAttributeList.expires = expiryTime; } else if (attributeNameLowercase === "max-age") { const charCode = attributeValue.charCodeAt(0); if ((charCode < 48 || charCode > 57) && attributeValue[0] !== "-") { return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); } if (!/^\d+$/.test(attributeValue)) { return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); } const deltaSeconds = Number(attributeValue); cookieAttributeList.maxAge = deltaSeconds; } else if (attributeNameLowercase === "domain") { let cookieDomain = attributeValue; if (cookieDomain[0] === ".") { cookieDomain = cookieDomain.slice(1); } cookieDomain = cookieDomain.toLowerCase(); cookieAttributeList.domain = cookieDomain; } else if (attributeNameLowercase === "path") { let cookiePath = ""; if (attributeValue.length === 0 || attributeValue[0] !== "/") { cookiePath = "/"; } else { cookiePath = attributeValue; } cookieAttributeList.path = cookiePath; } else if (attributeNameLowercase === "secure") { cookieAttributeList.secure = true; } else if (attributeNameLowercase === "httponly") { cookieAttributeList.httpOnly = true; } else if (attributeNameLowercase === "samesite") { let enforcement = "Default"; const attributeValueLowercase = attributeValue.toLowerCase(); if (attributeValueLowercase.includes("none")) { enforcement = "None"; } if (attributeValueLowercase.includes("strict")) { enforcement = "Strict"; } if (attributeValueLowercase.includes("lax")) { enforcement = "Lax"; } cookieAttributeList.sameSite = enforcement; } else { cookieAttributeList.unparsed ??= []; cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`); } return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList); } __name(parseUnparsedAttributes, "parseUnparsedAttributes"); module3.exports = { parseSetCookie, parseUnparsedAttributes }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cookies/index.js var require_cookies = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/cookies/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { parseSetCookie } = require_parse(); var { stringify, getHeadersList } = require_util6(); var { webidl } = require_webidl(); var { Headers: Headers6 } = require_headers(); function getCookies(headers) { webidl.argumentLengthCheck(arguments, 1, { header: "getCookies" }); webidl.brandCheck(headers, Headers6, { strict: false }); const cookie = headers.get("cookie"); const out = {}; if (!cookie) { return out; } for (const piece of cookie.split(";")) { const [name2, ...value] = piece.split("="); out[name2.trim()] = value.join("="); } return out; } __name(getCookies, "getCookies"); function deleteCookie(headers, name2, attributes) { webidl.argumentLengthCheck(arguments, 2, { header: "deleteCookie" }); webidl.brandCheck(headers, Headers6, { strict: false }); name2 = webidl.converters.DOMString(name2); attributes = webidl.converters.DeleteCookieAttributes(attributes); setCookie(headers, { name: name2, value: "", expires: /* @__PURE__ */ new Date(0), ...attributes }); } __name(deleteCookie, "deleteCookie"); function getSetCookies(headers) { webidl.argumentLengthCheck(arguments, 1, { header: "getSetCookies" }); webidl.brandCheck(headers, Headers6, { strict: false }); const cookies = getHeadersList(headers).cookies; if (!cookies) { return []; } return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair)); } __name(getSetCookies, "getSetCookies"); function setCookie(headers, cookie) { webidl.argumentLengthCheck(arguments, 2, { header: "setCookie" }); webidl.brandCheck(headers, Headers6, { strict: false }); cookie = webidl.converters.Cookie(cookie); const str = stringify(cookie); if (str) { headers.append("Set-Cookie", stringify(cookie)); } } __name(setCookie, "setCookie"); webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ { converter: webidl.nullableConverter(webidl.converters.DOMString), key: "path", defaultValue: null }, { converter: webidl.nullableConverter(webidl.converters.DOMString), key: "domain", defaultValue: null } ]); webidl.converters.Cookie = webidl.dictionaryConverter([ { converter: webidl.converters.DOMString, key: "name" }, { converter: webidl.converters.DOMString, key: "value" }, { converter: webidl.nullableConverter((value) => { if (typeof value === "number") { return webidl.converters["unsigned long long"](value); } return new Date(value); }), key: "expires", defaultValue: null }, { converter: webidl.nullableConverter(webidl.converters["long long"]), key: "maxAge", defaultValue: null }, { converter: webidl.nullableConverter(webidl.converters.DOMString), key: "domain", defaultValue: null }, { converter: webidl.nullableConverter(webidl.converters.DOMString), key: "path", defaultValue: null }, { converter: webidl.nullableConverter(webidl.converters.boolean), key: "secure", defaultValue: null }, { converter: webidl.nullableConverter(webidl.converters.boolean), key: "httpOnly", defaultValue: null }, { converter: webidl.converters.USVString, key: "sameSite", allowedValues: ["Strict", "Lax", "None"] }, { converter: webidl.sequenceConverter(webidl.converters.DOMString), key: "unparsed", defaultValue: [] } ]); module3.exports = { getCookies, deleteCookie, getSetCookies, setCookie }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/constants.js var require_constants5 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/constants.js"(exports2, module3) { "use strict"; init_import_meta_url(); var uid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; var staticPropertyDescriptors = { enumerable: true, writable: false, configurable: false }; var states = { CONNECTING: 0, OPEN: 1, CLOSING: 2, CLOSED: 3 }; var opcodes = { CONTINUATION: 0, TEXT: 1, BINARY: 2, CLOSE: 8, PING: 9, PONG: 10 }; var maxUnsigned16Bit = 2 ** 16 - 1; var parserStates = { INFO: 0, PAYLOADLENGTH_16: 2, PAYLOADLENGTH_64: 3, READ_DATA: 4 }; var emptyBuffer = Buffer.allocUnsafe(0); module3.exports = { uid, staticPropertyDescriptors, states, opcodes, maxUnsigned16Bit, parserStates, emptyBuffer }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/symbols.js var require_symbols5 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/symbols.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = { kWebSocketURL: Symbol("url"), kReadyState: Symbol("ready state"), kController: Symbol("controller"), kResponse: Symbol("response"), kBinaryType: Symbol("binary type"), kSentClose: Symbol("sent close"), kReceivedClose: Symbol("received close"), kByteParser: Symbol("byte parser") }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/events.js var require_events = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/events.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { webidl } = require_webidl(); var { kEnumerableProperty } = require_util(); var { MessagePort } = require("worker_threads"); var MessageEvent = class extends Event { #eventInit; constructor(type, eventInitDict = {}) { webidl.argumentLengthCheck(arguments, 1, { header: "MessageEvent constructor" }); type = webidl.converters.DOMString(type); eventInitDict = webidl.converters.MessageEventInit(eventInitDict); super(type, eventInitDict); this.#eventInit = eventInitDict; } get data() { webidl.brandCheck(this, MessageEvent); return this.#eventInit.data; } get origin() { webidl.brandCheck(this, MessageEvent); return this.#eventInit.origin; } get lastEventId() { webidl.brandCheck(this, MessageEvent); return this.#eventInit.lastEventId; } get source() { webidl.brandCheck(this, MessageEvent); return this.#eventInit.source; } get ports() { webidl.brandCheck(this, MessageEvent); if (!Object.isFrozen(this.#eventInit.ports)) { Object.freeze(this.#eventInit.ports); } return this.#eventInit.ports; } initMessageEvent(type, bubbles = false, cancelable = false, data = null, origin = "", lastEventId2 = "", source = null, ports = []) { webidl.brandCheck(this, MessageEvent); webidl.argumentLengthCheck(arguments, 1, { header: "MessageEvent.initMessageEvent" }); return new MessageEvent(type, { bubbles, cancelable, data, origin, lastEventId: lastEventId2, source, ports }); } }; __name(MessageEvent, "MessageEvent"); var CloseEvent = class extends Event { #eventInit; constructor(type, eventInitDict = {}) { webidl.argumentLengthCheck(arguments, 1, { header: "CloseEvent constructor" }); type = webidl.converters.DOMString(type); eventInitDict = webidl.converters.CloseEventInit(eventInitDict); super(type, eventInitDict); this.#eventInit = eventInitDict; } get wasClean() { webidl.brandCheck(this, CloseEvent); return this.#eventInit.wasClean; } get code() { webidl.brandCheck(this, CloseEvent); return this.#eventInit.code; } get reason() { webidl.brandCheck(this, CloseEvent); return this.#eventInit.reason; } }; __name(CloseEvent, "CloseEvent"); var ErrorEvent = class extends Event { #eventInit; constructor(type, eventInitDict) { webidl.argumentLengthCheck(arguments, 1, { header: "ErrorEvent constructor" }); super(type, eventInitDict); type = webidl.converters.DOMString(type); eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {}); this.#eventInit = eventInitDict; } get message() { webidl.brandCheck(this, ErrorEvent); return this.#eventInit.message; } get filename() { webidl.brandCheck(this, ErrorEvent); return this.#eventInit.filename; } get lineno() { webidl.brandCheck(this, ErrorEvent); return this.#eventInit.lineno; } get colno() { webidl.brandCheck(this, ErrorEvent); return this.#eventInit.colno; } get error() { webidl.brandCheck(this, ErrorEvent); return this.#eventInit.error; } }; __name(ErrorEvent, "ErrorEvent"); Object.defineProperties(MessageEvent.prototype, { [Symbol.toStringTag]: { value: "MessageEvent", configurable: true }, data: kEnumerableProperty, origin: kEnumerableProperty, lastEventId: kEnumerableProperty, source: kEnumerableProperty, ports: kEnumerableProperty, initMessageEvent: kEnumerableProperty }); Object.defineProperties(CloseEvent.prototype, { [Symbol.toStringTag]: { value: "CloseEvent", configurable: true }, reason: kEnumerableProperty, code: kEnumerableProperty, wasClean: kEnumerableProperty }); Object.defineProperties(ErrorEvent.prototype, { [Symbol.toStringTag]: { value: "ErrorEvent", configurable: true }, message: kEnumerableProperty, filename: kEnumerableProperty, lineno: kEnumerableProperty, colno: kEnumerableProperty, error: kEnumerableProperty }); webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort); webidl.converters["sequence"] = webidl.sequenceConverter( webidl.converters.MessagePort ); var eventInit = [ { key: "bubbles", converter: webidl.converters.boolean, defaultValue: false }, { key: "cancelable", converter: webidl.converters.boolean, defaultValue: false }, { key: "composed", converter: webidl.converters.boolean, defaultValue: false } ]; webidl.converters.MessageEventInit = webidl.dictionaryConverter([ ...eventInit, { key: "data", converter: webidl.converters.any, defaultValue: null }, { key: "origin", converter: webidl.converters.USVString, defaultValue: "" }, { key: "lastEventId", converter: webidl.converters.DOMString, defaultValue: "" }, { key: "source", // Node doesn't implement WindowProxy or ServiceWorker, so the only // valid value for source is a MessagePort. converter: webidl.nullableConverter(webidl.converters.MessagePort), defaultValue: null }, { key: "ports", converter: webidl.converters["sequence"], get defaultValue() { return []; } } ]); webidl.converters.CloseEventInit = webidl.dictionaryConverter([ ...eventInit, { key: "wasClean", converter: webidl.converters.boolean, defaultValue: false }, { key: "code", converter: webidl.converters["unsigned short"], defaultValue: 0 }, { key: "reason", converter: webidl.converters.USVString, defaultValue: "" } ]); webidl.converters.ErrorEventInit = webidl.dictionaryConverter([ ...eventInit, { key: "message", converter: webidl.converters.DOMString, defaultValue: "" }, { key: "filename", converter: webidl.converters.USVString, defaultValue: "" }, { key: "lineno", converter: webidl.converters["unsigned long"], defaultValue: 0 }, { key: "colno", converter: webidl.converters["unsigned long"], defaultValue: 0 }, { key: "error", converter: webidl.converters.any } ]); module3.exports = { MessageEvent, CloseEvent, ErrorEvent }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/util.js var require_util7 = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/util.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require_symbols5(); var { states, opcodes } = require_constants5(); var { MessageEvent, ErrorEvent } = require_events(); function isEstablished(ws) { return ws[kReadyState] === states.OPEN; } __name(isEstablished, "isEstablished"); function isClosing(ws) { return ws[kReadyState] === states.CLOSING; } __name(isClosing, "isClosing"); function isClosed(ws) { return ws[kReadyState] === states.CLOSED; } __name(isClosed, "isClosed"); function fireEvent(e7, target, eventConstructor = Event, eventInitDict) { const event = new eventConstructor(e7, eventInitDict); target.dispatchEvent(event); } __name(fireEvent, "fireEvent"); function websocketMessageReceived(ws, type, data) { if (ws[kReadyState] !== states.OPEN) { return; } let dataForEvent; if (type === opcodes.TEXT) { try { dataForEvent = new TextDecoder("utf-8", { fatal: true }).decode(data); } catch { failWebsocketConnection(ws, "Received invalid UTF-8 in text frame."); return; } } else if (type === opcodes.BINARY) { if (ws[kBinaryType] === "blob") { dataForEvent = new Blob([data]); } else { dataForEvent = new Uint8Array(data).buffer; } } fireEvent("message", ws, MessageEvent, { origin: ws[kWebSocketURL].origin, data: dataForEvent }); } __name(websocketMessageReceived, "websocketMessageReceived"); function isValidSubprotocol(protocol) { if (protocol.length === 0) { return false; } for (const char of protocol) { const code = char.charCodeAt(0); if (code < 33 || code > 126 || char === "(" || char === ")" || char === "<" || char === ">" || char === "@" || char === "," || char === ";" || char === ":" || char === "\\" || char === '"' || char === "/" || char === "[" || char === "]" || char === "?" || char === "=" || char === "{" || char === "}" || code === 32 || // SP code === 9) { return false; } } return true; } __name(isValidSubprotocol, "isValidSubprotocol"); function isValidStatusCode(code) { if (code >= 1e3 && code < 1015) { return code !== 1004 && // reserved code !== 1005 && // "MUST NOT be set as a status code" code !== 1006; } return code >= 3e3 && code <= 4999; } __name(isValidStatusCode, "isValidStatusCode"); function failWebsocketConnection(ws, reason) { const { [kController]: controller, [kResponse]: response } = ws; controller.abort(); if (response?.socket && !response.socket.destroyed) { response.socket.destroy(); } if (reason) { fireEvent("error", ws, ErrorEvent, { error: new Error(reason) }); } } __name(failWebsocketConnection, "failWebsocketConnection"); module3.exports = { isEstablished, isClosing, isClosed, fireEvent, isValidSubprotocol, isValidStatusCode, failWebsocketConnection, websocketMessageReceived }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/connection.js var require_connection = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/connection.js"(exports2, module3) { "use strict"; init_import_meta_url(); var diagnosticsChannel = require("diagnostics_channel"); var { uid, states } = require_constants5(); var { kReadyState, kSentClose, kByteParser, kReceivedClose } = require_symbols5(); var { fireEvent, failWebsocketConnection } = require_util7(); var { CloseEvent } = require_events(); var { makeRequest } = require_request2(); var { fetching } = require_fetch(); var { Headers: Headers6 } = require_headers(); var { getGlobalDispatcher: getGlobalDispatcher2 } = require_global2(); var { kHeadersList } = require_symbols(); var channels = {}; channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); var crypto8; try { crypto8 = require("crypto"); } catch { } function establishWebSocketConnection(url4, protocols, ws, onEstablish, options32) { const requestURL = url4; requestURL.protocol = url4.protocol === "ws:" ? "http:" : "https:"; const request4 = makeRequest({ urlList: [requestURL], serviceWorkers: "none", referrer: "no-referrer", mode: "websocket", credentials: "include", cache: "no-store", redirect: "error" }); if (options32.headers) { const headersList = new Headers6(options32.headers)[kHeadersList]; request4.headersList = headersList; } const keyValue = crypto8.randomBytes(16).toString("base64"); request4.headersList.append("sec-websocket-key", keyValue); request4.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { request4.headersList.append("sec-websocket-protocol", protocol); } const permessageDeflate = ""; const controller = fetching({ request: request4, useParallelQueue: true, dispatcher: options32.dispatcher ?? getGlobalDispatcher2(), processResponse(response) { if (response.type === "error" || response.status !== 101) { failWebsocketConnection(ws, "Received network error or non-101 status code."); return; } if (protocols.length !== 0 && !response.headersList.get("Sec-WebSocket-Protocol")) { failWebsocketConnection(ws, "Server did not respond with sent protocols."); return; } if (response.headersList.get("Upgrade")?.toLowerCase() !== "websocket") { failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".'); return; } if (response.headersList.get("Connection")?.toLowerCase() !== "upgrade") { failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".'); return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); const digest = crypto8.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; } const secExtension = response.headersList.get("Sec-WebSocket-Extensions"); if (secExtension !== null && secExtension !== permessageDeflate) { failWebsocketConnection(ws, "Received different permessage-deflate than the one set."); return; } const secProtocol = response.headersList.get("Sec-WebSocket-Protocol"); if (secProtocol !== null && secProtocol !== request4.headersList.get("Sec-WebSocket-Protocol")) { failWebsocketConnection(ws, "Protocol was not set in the opening handshake."); return; } response.socket.on("data", onSocketData); response.socket.on("close", onSocketClose); response.socket.on("error", onSocketError); if (channels.open.hasSubscribers) { channels.open.publish({ address: response.socket.address(), protocol: secProtocol, extensions: secExtension }); } onEstablish(response); } }); return controller; } __name(establishWebSocketConnection, "establishWebSocketConnection"); function onSocketData(chunk) { if (!this.ws[kByteParser].write(chunk)) { this.pause(); } } __name(onSocketData, "onSocketData"); function onSocketClose() { const { ws } = this; const wasClean = ws[kSentClose] && ws[kReceivedClose]; let code = 1005; let reason = ""; const result = ws[kByteParser].closingInfo; if (result) { code = result.code ?? 1005; reason = result.reason; } else if (!ws[kSentClose]) { code = 1006; } ws[kReadyState] = states.CLOSED; fireEvent("close", ws, CloseEvent, { wasClean, code, reason }); if (channels.close.hasSubscribers) { channels.close.publish({ websocket: ws, code, reason }); } } __name(onSocketClose, "onSocketClose"); function onSocketError(error2) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { channels.socketError.publish(error2); } this.destroy(); } __name(onSocketError, "onSocketError"); module3.exports = { establishWebSocketConnection }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/frame.js var require_frame = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/frame.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { maxUnsigned16Bit } = require_constants5(); var crypto8; try { crypto8 = require("crypto"); } catch { } var WebsocketFrameSend = class { /** * @param {Buffer|undefined} data */ constructor(data) { this.frameData = data; this.maskKey = crypto8.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; let payloadLength = bodyLength; let offset = 6; if (bodyLength > maxUnsigned16Bit) { offset += 8; payloadLength = 127; } else if (bodyLength > 125) { offset += 2; payloadLength = 126; } const buffer = Buffer.allocUnsafe(bodyLength + offset); buffer[0] = buffer[1] = 0; buffer[0] |= 128; buffer[0] = (buffer[0] & 240) + opcode; buffer[offset - 4] = this.maskKey[0]; buffer[offset - 3] = this.maskKey[1]; buffer[offset - 2] = this.maskKey[2]; buffer[offset - 1] = this.maskKey[3]; buffer[1] = payloadLength; if (payloadLength === 126) { buffer.writeUInt16BE(bodyLength, 2); } else if (payloadLength === 127) { buffer[2] = buffer[3] = 0; buffer.writeUIntBE(bodyLength, 4, 6); } buffer[1] |= 128; for (let i5 = 0; i5 < bodyLength; i5++) { buffer[offset + i5] = this.frameData[i5] ^ this.maskKey[i5 % 4]; } return buffer; } }; __name(WebsocketFrameSend, "WebsocketFrameSend"); module3.exports = { WebsocketFrameSend }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/receiver.js var require_receiver = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/receiver.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { Writable: Writable5 } = require("stream"); var diagnosticsChannel = require("diagnostics_channel"); var { parserStates, opcodes, states, emptyBuffer } = require_constants5(); var { kReadyState, kSentClose, kResponse, kReceivedClose } = require_symbols5(); var { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = require_util7(); var { WebsocketFrameSend } = require_frame(); var channels = {}; channels.ping = diagnosticsChannel.channel("undici:websocket:ping"); channels.pong = diagnosticsChannel.channel("undici:websocket:pong"); var ByteParser = class extends Writable5 { #buffers = []; #byteOffset = 0; #state = parserStates.INFO; #info = {}; #fragments = []; constructor(ws) { super(); this.ws = ws; } /** * @param {Buffer} chunk * @param {() => void} callback */ _write(chunk, _4, callback) { this.#buffers.push(chunk); this.#byteOffset += chunk.length; this.run(callback); } /** * Runs whenever a new chunk is received. * Callback is called whenever there are no more chunks buffering, * or not enough bytes are buffered to parse. */ run(callback) { while (true) { if (this.#state === parserStates.INFO) { if (this.#byteOffset < 2) { return callback(); } const buffer = this.consume(2); this.#info.fin = (buffer[0] & 128) !== 0; this.#info.opcode = buffer[0] & 15; this.#info.originalOpcode ??= this.#info.opcode; this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION; if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) { failWebsocketConnection(this.ws, "Invalid frame type was fragmented."); return; } const payloadLength = buffer[1] & 127; if (payloadLength <= 125) { this.#info.payloadLength = payloadLength; this.#state = parserStates.READ_DATA; } else if (payloadLength === 126) { this.#state = parserStates.PAYLOADLENGTH_16; } else if (payloadLength === 127) { this.#state = parserStates.PAYLOADLENGTH_64; } if (this.#info.fragmented && payloadLength > 125) { failWebsocketConnection(this.ws, "Fragmented frame exceeded 125 bytes."); return; } else if ((this.#info.opcode === opcodes.PING || this.#info.opcode === opcodes.PONG || this.#info.opcode === opcodes.CLOSE) && payloadLength > 125) { failWebsocketConnection(this.ws, "Payload length for control frame exceeded 125 bytes."); return; } else if (this.#info.opcode === opcodes.CLOSE) { if (payloadLength === 1) { failWebsocketConnection(this.ws, "Received close frame with a 1-byte body."); return; } const body = this.consume(payloadLength); this.#info.closeInfo = this.parseCloseBody(false, body); if (!this.ws[kSentClose]) { const body2 = Buffer.allocUnsafe(2); body2.writeUInt16BE(this.#info.closeInfo.code, 0); const closeFrame = new WebsocketFrameSend(body2); this.ws[kResponse].socket.write( closeFrame.createFrame(opcodes.CLOSE), (err) => { if (!err) { this.ws[kSentClose] = true; } } ); } this.ws[kReadyState] = states.CLOSING; this.ws[kReceivedClose] = true; this.end(); return; } else if (this.#info.opcode === opcodes.PING) { const body = this.consume(payloadLength); if (!this.ws[kReceivedClose]) { const frame = new WebsocketFrameSend(body); this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG)); if (channels.ping.hasSubscribers) { channels.ping.publish({ payload: body }); } } this.#state = parserStates.INFO; if (this.#byteOffset > 0) { continue; } else { callback(); return; } } else if (this.#info.opcode === opcodes.PONG) { const body = this.consume(payloadLength); if (channels.pong.hasSubscribers) { channels.pong.publish({ payload: body }); } if (this.#byteOffset > 0) { continue; } else { callback(); return; } } } else if (this.#state === parserStates.PAYLOADLENGTH_16) { if (this.#byteOffset < 2) { return callback(); } const buffer = this.consume(2); this.#info.payloadLength = buffer.readUInt16BE(0); this.#state = parserStates.READ_DATA; } else if (this.#state === parserStates.PAYLOADLENGTH_64) { if (this.#byteOffset < 8) { return callback(); } const buffer = this.consume(8); const upper = buffer.readUInt32BE(0); if (upper > 2 ** 31 - 1) { failWebsocketConnection(this.ws, "Received payload length > 2^31 bytes."); return; } const lower = buffer.readUInt32BE(4); this.#info.payloadLength = (upper << 8) + lower; this.#state = parserStates.READ_DATA; } else if (this.#state === parserStates.READ_DATA) { if (this.#byteOffset < this.#info.payloadLength) { return callback(); } else if (this.#byteOffset >= this.#info.payloadLength) { const body = this.consume(this.#info.payloadLength); this.#fragments.push(body); if (!this.#info.fragmented || this.#info.fin && this.#info.opcode === opcodes.CONTINUATION) { const fullMessage = Buffer.concat(this.#fragments); websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage); this.#info = {}; this.#fragments.length = 0; } this.#state = parserStates.INFO; } } if (this.#byteOffset > 0) { continue; } else { callback(); break; } } } /** * Take n bytes from the buffered Buffers * @param {number} n * @returns {Buffer|null} */ consume(n6) { if (n6 > this.#byteOffset) { return null; } else if (n6 === 0) { return emptyBuffer; } if (this.#buffers[0].length === n6) { this.#byteOffset -= this.#buffers[0].length; return this.#buffers.shift(); } const buffer = Buffer.allocUnsafe(n6); let offset = 0; while (offset !== n6) { const next = this.#buffers[0]; const { length } = next; if (length + offset === n6) { buffer.set(this.#buffers.shift(), offset); break; } else if (length + offset > n6) { buffer.set(next.subarray(0, n6 - offset), offset); this.#buffers[0] = next.subarray(n6 - offset); break; } else { buffer.set(this.#buffers.shift(), offset); offset += next.length; } } this.#byteOffset -= n6; return buffer; } parseCloseBody(onlyCode, data) { let code; if (data.length >= 2) { code = data.readUInt16BE(0); } if (onlyCode) { if (!isValidStatusCode(code)) { return null; } return { code }; } let reason = data.subarray(2); if (reason[0] === 239 && reason[1] === 187 && reason[2] === 191) { reason = reason.subarray(3); } if (code !== void 0 && !isValidStatusCode(code)) { return null; } try { reason = new TextDecoder("utf-8", { fatal: true }).decode(reason); } catch { return null; } return { code, reason }; } get closingInfo() { return this.#info.closeInfo; } }; __name(ByteParser, "ByteParser"); module3.exports = { ByteParser }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/websocket.js var require_websocket = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/websocket/websocket.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { webidl } = require_webidl(); var { DOMException: DOMException2 } = require_constants2(); var { URLSerializer } = require_dataURL(); var { getGlobalOrigin } = require_global(); var { staticPropertyDescriptors, states, opcodes, emptyBuffer } = require_constants5(); var { kWebSocketURL, kReadyState, kController, kBinaryType, kResponse, kSentClose, kByteParser } = require_symbols5(); var { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = require_util7(); var { establishWebSocketConnection } = require_connection(); var { WebsocketFrameSend } = require_frame(); var { ByteParser } = require_receiver(); var { kEnumerableProperty, isBlobLike } = require_util(); var { getGlobalDispatcher: getGlobalDispatcher2 } = require_global2(); var { types } = require("util"); var experimentalWarned = false; var WebSocket2 = class extends EventTarget { #events = { open: null, error: null, close: null, message: null }; #bufferedAmount = 0; #protocol = ""; #extensions = ""; /** * @param {string} url * @param {string|string[]} protocols */ constructor(url4, protocols = []) { super(); webidl.argumentLengthCheck(arguments, 1, { header: "WebSocket constructor" }); if (!experimentalWarned) { experimentalWarned = true; process.emitWarning("WebSockets are experimental, expect them to change at any time.", { code: "UNDICI-WS" }); } const options32 = webidl.converters["DOMString or sequence or WebSocketInit"](protocols); url4 = webidl.converters.USVString(url4); protocols = options32.protocols; const baseURL = getGlobalOrigin(); let urlRecord; try { urlRecord = new URL(url4, baseURL); } catch (e7) { throw new DOMException2(e7, "SyntaxError"); } if (urlRecord.protocol === "http:") { urlRecord.protocol = "ws:"; } else if (urlRecord.protocol === "https:") { urlRecord.protocol = "wss:"; } if (urlRecord.protocol !== "ws:" && urlRecord.protocol !== "wss:") { throw new DOMException2( `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, "SyntaxError" ); } if (urlRecord.hash || urlRecord.href.endsWith("#")) { throw new DOMException2("Got fragment", "SyntaxError"); } if (typeof protocols === "string") { protocols = [protocols]; } if (protocols.length !== new Set(protocols.map((p6) => p6.toLowerCase())).size) { throw new DOMException2("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); } if (protocols.length > 0 && !protocols.every((p6) => isValidSubprotocol(p6))) { throw new DOMException2("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); } this[kWebSocketURL] = new URL(urlRecord.href); this[kController] = establishWebSocketConnection( urlRecord, protocols, this, (response) => this.#onConnectionEstablished(response), options32 ); this[kReadyState] = WebSocket2.CONNECTING; this[kBinaryType] = "blob"; } /** * @see https://websockets.spec.whatwg.org/#dom-websocket-close * @param {number|undefined} code * @param {string|undefined} reason */ close(code = void 0, reason = void 0) { webidl.brandCheck(this, WebSocket2); if (code !== void 0) { code = webidl.converters["unsigned short"](code, { clamp: true }); } if (reason !== void 0) { reason = webidl.converters.USVString(reason); } if (code !== void 0) { if (code !== 1e3 && (code < 3e3 || code > 4999)) { throw new DOMException2("invalid code", "InvalidAccessError"); } } let reasonByteLength = 0; if (reason !== void 0) { reasonByteLength = Buffer.byteLength(reason); if (reasonByteLength > 123) { throw new DOMException2( `Reason must be less than 123 bytes; received ${reasonByteLength}`, "SyntaxError" ); } } if (this[kReadyState] === WebSocket2.CLOSING || this[kReadyState] === WebSocket2.CLOSED) { } else if (!isEstablished(this)) { failWebsocketConnection(this, "Connection was closed before it was established."); this[kReadyState] = WebSocket2.CLOSING; } else if (!isClosing(this)) { const frame = new WebsocketFrameSend(); if (code !== void 0 && reason === void 0) { frame.frameData = Buffer.allocUnsafe(2); frame.frameData.writeUInt16BE(code, 0); } else if (code !== void 0 && reason !== void 0) { frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength); frame.frameData.writeUInt16BE(code, 0); frame.frameData.write(reason, 2, "utf-8"); } else { frame.frameData = emptyBuffer; } const socket = this[kResponse].socket; socket.write(frame.createFrame(opcodes.CLOSE), (err) => { if (!err) { this[kSentClose] = true; } }); this[kReadyState] = states.CLOSING; } else { this[kReadyState] = WebSocket2.CLOSING; } } /** * @see https://websockets.spec.whatwg.org/#dom-websocket-send * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data */ send(data) { webidl.brandCheck(this, WebSocket2); webidl.argumentLengthCheck(arguments, 1, { header: "WebSocket.send" }); data = webidl.converters.WebSocketSendData(data); if (this[kReadyState] === WebSocket2.CONNECTING) { throw new DOMException2("Sent before connected.", "InvalidStateError"); } if (!isEstablished(this) || isClosing(this)) { return; } const socket = this[kResponse].socket; if (typeof data === "string") { const value = Buffer.from(data); const frame = new WebsocketFrameSend(value); const buffer = frame.createFrame(opcodes.TEXT); this.#bufferedAmount += value.byteLength; socket.write(buffer, () => { this.#bufferedAmount -= value.byteLength; }); } else if (types.isArrayBuffer(data)) { const value = Buffer.from(data); const frame = new WebsocketFrameSend(value); const buffer = frame.createFrame(opcodes.BINARY); this.#bufferedAmount += value.byteLength; socket.write(buffer, () => { this.#bufferedAmount -= value.byteLength; }); } else if (ArrayBuffer.isView(data)) { const ab2 = Buffer.from(data, data.byteOffset, data.byteLength); const frame = new WebsocketFrameSend(ab2); const buffer = frame.createFrame(opcodes.BINARY); this.#bufferedAmount += ab2.byteLength; socket.write(buffer, () => { this.#bufferedAmount -= ab2.byteLength; }); } else if (isBlobLike(data)) { const frame = new WebsocketFrameSend(); data.arrayBuffer().then((ab2) => { const value = Buffer.from(ab2); frame.frameData = value; const buffer = frame.createFrame(opcodes.BINARY); this.#bufferedAmount += value.byteLength; socket.write(buffer, () => { this.#bufferedAmount -= value.byteLength; }); }); } } get readyState() { webidl.brandCheck(this, WebSocket2); return this[kReadyState]; } get bufferedAmount() { webidl.brandCheck(this, WebSocket2); return this.#bufferedAmount; } get url() { webidl.brandCheck(this, WebSocket2); return URLSerializer(this[kWebSocketURL]); } get extensions() { webidl.brandCheck(this, WebSocket2); return this.#extensions; } get protocol() { webidl.brandCheck(this, WebSocket2); return this.#protocol; } get onopen() { webidl.brandCheck(this, WebSocket2); return this.#events.open; } set onopen(fn2) { webidl.brandCheck(this, WebSocket2); if (this.#events.open) { this.removeEventListener("open", this.#events.open); } if (typeof fn2 === "function") { this.#events.open = fn2; this.addEventListener("open", fn2); } else { this.#events.open = null; } } get onerror() { webidl.brandCheck(this, WebSocket2); return this.#events.error; } set onerror(fn2) { webidl.brandCheck(this, WebSocket2); if (this.#events.error) { this.removeEventListener("error", this.#events.error); } if (typeof fn2 === "function") { this.#events.error = fn2; this.addEventListener("error", fn2); } else { this.#events.error = null; } } get onclose() { webidl.brandCheck(this, WebSocket2); return this.#events.close; } set onclose(fn2) { webidl.brandCheck(this, WebSocket2); if (this.#events.close) { this.removeEventListener("close", this.#events.close); } if (typeof fn2 === "function") { this.#events.close = fn2; this.addEventListener("close", fn2); } else { this.#events.close = null; } } get onmessage() { webidl.brandCheck(this, WebSocket2); return this.#events.message; } set onmessage(fn2) { webidl.brandCheck(this, WebSocket2); if (this.#events.message) { this.removeEventListener("message", this.#events.message); } if (typeof fn2 === "function") { this.#events.message = fn2; this.addEventListener("message", fn2); } else { this.#events.message = null; } } get binaryType() { webidl.brandCheck(this, WebSocket2); return this[kBinaryType]; } set binaryType(type) { webidl.brandCheck(this, WebSocket2); if (type !== "blob" && type !== "arraybuffer") { this[kBinaryType] = "blob"; } else { this[kBinaryType] = type; } } /** * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol */ #onConnectionEstablished(response) { this[kResponse] = response; const parser2 = new ByteParser(this); parser2.on("drain", /* @__PURE__ */ __name(function onParserDrain() { this.ws[kResponse].socket.resume(); }, "onParserDrain")); response.socket.ws = this; this[kByteParser] = parser2; this[kReadyState] = states.OPEN; const extensions = response.headersList.get("sec-websocket-extensions"); if (extensions !== null) { this.#extensions = extensions; } const protocol = response.headersList.get("sec-websocket-protocol"); if (protocol !== null) { this.#protocol = protocol; } fireEvent("open", this); } }; __name(WebSocket2, "WebSocket"); WebSocket2.CONNECTING = WebSocket2.prototype.CONNECTING = states.CONNECTING; WebSocket2.OPEN = WebSocket2.prototype.OPEN = states.OPEN; WebSocket2.CLOSING = WebSocket2.prototype.CLOSING = states.CLOSING; WebSocket2.CLOSED = WebSocket2.prototype.CLOSED = states.CLOSED; Object.defineProperties(WebSocket2.prototype, { CONNECTING: staticPropertyDescriptors, OPEN: staticPropertyDescriptors, CLOSING: staticPropertyDescriptors, CLOSED: staticPropertyDescriptors, url: kEnumerableProperty, readyState: kEnumerableProperty, bufferedAmount: kEnumerableProperty, onopen: kEnumerableProperty, onerror: kEnumerableProperty, onclose: kEnumerableProperty, close: kEnumerableProperty, onmessage: kEnumerableProperty, binaryType: kEnumerableProperty, send: kEnumerableProperty, extensions: kEnumerableProperty, protocol: kEnumerableProperty, [Symbol.toStringTag]: { value: "WebSocket", writable: false, enumerable: false, configurable: true } }); Object.defineProperties(WebSocket2, { CONNECTING: staticPropertyDescriptors, OPEN: staticPropertyDescriptors, CLOSING: staticPropertyDescriptors, CLOSED: staticPropertyDescriptors }); webidl.converters["sequence"] = webidl.sequenceConverter( webidl.converters.DOMString ); webidl.converters["DOMString or sequence"] = function(V3) { if (webidl.util.Type(V3) === "Object" && Symbol.iterator in V3) { return webidl.converters["sequence"](V3); } return webidl.converters.DOMString(V3); }; webidl.converters.WebSocketInit = webidl.dictionaryConverter([ { key: "protocols", converter: webidl.converters["DOMString or sequence"], get defaultValue() { return []; } }, { key: "dispatcher", converter: (V3) => V3, get defaultValue() { return getGlobalDispatcher2(); } }, { key: "headers", converter: webidl.nullableConverter(webidl.converters.HeadersInit) } ]); webidl.converters["DOMString or sequence or WebSocketInit"] = function(V3) { if (webidl.util.Type(V3) === "Object" && !(Symbol.iterator in V3)) { return webidl.converters.WebSocketInit(V3); } return { protocols: webidl.converters["DOMString or sequence"](V3) }; }; webidl.converters.WebSocketSendData = function(V3) { if (webidl.util.Type(V3) === "Object") { if (isBlobLike(V3)) { return webidl.converters.Blob(V3, { strict: false }); } if (ArrayBuffer.isView(V3) || types.isAnyArrayBuffer(V3)) { return webidl.converters.BufferSource(V3); } } return webidl.converters.USVString(V3); }; module3.exports = { WebSocket: WebSocket2 }; } }); // ../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/index.js var require_undici = __commonJS({ "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var Client2 = require_client(); var Dispatcher2 = require_dispatcher(); var errors = require_errors(); var Pool = require_pool(); var BalancedPool = require_balanced_pool(); var Agent = require_agent(); var util5 = require_util(); var { InvalidArgumentError } = errors; var api = require_api(); var buildConnector = require_connect(); var MockClient = require_mock_client(); var MockAgent = require_mock_agent(); var MockPool = require_mock_pool(); var mockErrors = require_mock_errors(); var ProxyAgent2 = require_proxy_agent(); var RetryHandler = require_RetryHandler(); var { getGlobalDispatcher: getGlobalDispatcher2, setGlobalDispatcher: setGlobalDispatcher2 } = require_global2(); var DecoratorHandler = require_DecoratorHandler(); var RedirectHandler = require_RedirectHandler(); var createRedirectInterceptor = require_redirectInterceptor(); var hasCrypto; try { require("crypto"); hasCrypto = true; } catch { hasCrypto = false; } Object.assign(Dispatcher2.prototype, api); module3.exports.Dispatcher = Dispatcher2; module3.exports.Client = Client2; module3.exports.Pool = Pool; module3.exports.BalancedPool = BalancedPool; module3.exports.Agent = Agent; module3.exports.ProxyAgent = ProxyAgent2; module3.exports.RetryHandler = RetryHandler; module3.exports.DecoratorHandler = DecoratorHandler; module3.exports.RedirectHandler = RedirectHandler; module3.exports.createRedirectInterceptor = createRedirectInterceptor; module3.exports.buildConnector = buildConnector; module3.exports.errors = errors; function makeDispatcher(fn2) { return (url4, opts, handler31) => { if (typeof opts === "function") { handler31 = opts; opts = null; } if (!url4 || typeof url4 !== "string" && typeof url4 !== "object" && !(url4 instanceof URL)) { throw new InvalidArgumentError("invalid url"); } if (opts != null && typeof opts !== "object") { throw new InvalidArgumentError("invalid opts"); } if (opts && opts.path != null) { if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } let path72 = opts.path; if (!opts.path.startsWith("/")) { path72 = `/${path72}`; } url4 = new URL(util5.parseOrigin(url4).origin + path72); } else { if (!opts) { opts = typeof url4 === "object" ? url4 : {}; } url4 = util5.parseURL(url4); } const { agent, dispatcher = getGlobalDispatcher2() } = opts; if (agent) { throw new InvalidArgumentError("unsupported opts.agent. Did you mean opts.client?"); } return fn2.call(dispatcher, { ...opts, origin: url4.origin, path: url4.search ? `${url4.pathname}${url4.search}` : url4.pathname, method: opts.method || (opts.body ? "PUT" : "GET") }, handler31); }; } __name(makeDispatcher, "makeDispatcher"); module3.exports.setGlobalDispatcher = setGlobalDispatcher2; module3.exports.getGlobalDispatcher = getGlobalDispatcher2; if (util5.nodeMajor > 16 || util5.nodeMajor === 16 && util5.nodeMinor >= 8) { let fetchImpl = null; module3.exports.fetch = /* @__PURE__ */ __name(async function fetch15(resource) { if (!fetchImpl) { fetchImpl = require_fetch().fetch; } try { return await fetchImpl(...arguments); } catch (err) { if (typeof err === "object") { Error.captureStackTrace(err, this); } throw err; } }, "fetch"); module3.exports.Headers = require_headers().Headers; module3.exports.Response = require_response().Response; module3.exports.Request = require_request2().Request; module3.exports.FormData = require_formdata().FormData; module3.exports.File = require_file().File; module3.exports.FileReader = require_filereader().FileReader; const { setGlobalOrigin, getGlobalOrigin } = require_global(); module3.exports.setGlobalOrigin = setGlobalOrigin; module3.exports.getGlobalOrigin = getGlobalOrigin; const { CacheStorage: CacheStorage2 } = require_cachestorage(); const { kConstruct } = require_symbols4(); module3.exports.caches = new CacheStorage2(kConstruct); } if (util5.nodeMajor >= 16) { const { deleteCookie, getCookies, getSetCookies, setCookie } = require_cookies(); module3.exports.deleteCookie = deleteCookie; module3.exports.getCookies = getCookies; module3.exports.getSetCookies = getSetCookies; module3.exports.setCookie = setCookie; const { parseMIMEType, serializeAMimeType } = require_dataURL(); module3.exports.parseMIMEType = parseMIMEType; module3.exports.serializeAMimeType = serializeAMimeType; } if (util5.nodeMajor >= 18 && hasCrypto) { const { WebSocket: WebSocket2 } = require_websocket(); module3.exports.WebSocket = WebSocket2; } module3.exports.request = makeDispatcher(api.request); module3.exports.stream = makeDispatcher(api.stream); module3.exports.pipeline = makeDispatcher(api.pipeline); module3.exports.connect = makeDispatcher(api.connect); module3.exports.upgrade = makeDispatcher(api.upgrade); module3.exports.MockClient = MockClient; module3.exports.MockPool = MockPool; module3.exports.MockAgent = MockAgent; module3.exports.mockErrors = mockErrors; } }); // ../../node_modules/.pnpm/@webcontainer+env@1.1.0/node_modules/@webcontainer/env/dist/index.js var require_dist = __commonJS({ "../../node_modules/.pnpm/@webcontainer+env@1.1.0/node_modules/@webcontainer/env/dist/index.js"(exports2, module3) { init_import_meta_url(); var c6 = Object.defineProperty; var g6 = Object.getOwnPropertyDescriptor; var y4 = Object.getOwnPropertyNames; var d6 = Object.prototype.hasOwnProperty; var a5 = /* @__PURE__ */ __name((e7, t7) => c6(e7, "name", { value: t7, configurable: true }), "a"); var b6 = /* @__PURE__ */ __name((e7, t7) => { for (var o5 in t7) c6(e7, o5, { get: t7[o5], enumerable: true }); }, "b"); var P3 = /* @__PURE__ */ __name((e7, t7, o5, u5) => { if (t7 && typeof t7 == "object" || typeof t7 == "function") for (let s5 of y4(t7)) !d6.call(e7, s5) && s5 !== o5 && c6(e7, s5, { get: () => t7[s5], enumerable: !(u5 = g6(t7, s5)) || u5.enumerable }); return e7; }, "P"); var U3 = /* @__PURE__ */ __name((e7) => P3(c6({}, "__esModule", { value: true }), e7), "U"); var x6 = {}; b6(x6, { HostURL: () => n6, isWebContainer: () => h6 }); module3.exports = U3(x6); var r7; try { r7 = require("@blitz/internal/env"); } catch (e7) { } function h6() { return r7 != null && process.versions.webcontainer != null; } __name(h6, "h"); a5(h6, "isWebContainer"); function p6(e7) { let t7 = r7 == null ? void 0 : r7.createServiceHostname(e7); if (!t7) throw new Error("Failed to construct service hostname"); return t7; } __name(p6, "p"); a5(p6, "_createServiceHostname"); function f5(e7) { return r7 == null ? void 0 : r7.isServiceUrl(e7); } __name(f5, "f"); a5(f5, "_isServiceUrl"); function l6(e7) { return r7 == null ? void 0 : r7.isLocalhost(e7); } __name(l6, "l"); a5(l6, "_isLocalhost"); var n6 = /* @__PURE__ */ __name(class { constructor(t7) { this._url = t7; if (this._port = this._url.port, h6() && l6(this._url.hostname)) { let o5 = p6(this._port); this._url.host = o5, this._port === this._url.port && (this._url.port = ""); } } static parse(t7) { return t7 = typeof t7 == "string" ? new URL(t7) : t7, new n6(t7); } get port() { return h6() ? this._port : this._url.port; } get hash() { return this._url.hash; } get host() { return this._url.host; } get hostname() { return this._url.hostname; } get href() { return this._url.href; } get origin() { return this._url.origin; } get username() { return this._url.username; } get password() { return this._url.password; } get pathname() { return this._url.pathname; } get protocol() { return this._url.protocol; } get search() { return this._url.search; } get searchParams() { return this._url.searchParams; } update(t7) { var u5; let o5 = h6(); for (let s5 in t7) { let i5 = (u5 = t7[s5]) != null ? u5 : ""; if (o5) switch (s5) { case "port": { if (this._port = i5, (l6(this._url.hostname) || f5(this._url.hostname)) && (this._url.host = p6(i5), this._port !== this._url.port)) continue; break; } case "host": { let [m6, _4 = this._port] = i5.split(":"); this._port = _4, l6(m6) && (i5 = p6(_4)); break; } case "hostname": { if (l6(i5)) { if (/\/|:/.test(i5)) continue; i5 = p6(this._port); } else this._url.port = this._port; break; } case "href": { this._url = n6.parse(i5); continue; } } this._url[s5] = i5; } return this; } toString() { return this._url.toString(); } toJSON() { return this._url.toJSON(); } }, "n"); a5(n6, "HostURL"); } }); // ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/lib/XDGAppPaths.js var require_XDGAppPaths = __commonJS({ "../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/lib/XDGAppPaths.js"(exports2) { "use strict"; init_import_meta_url(); exports2.__esModule = true; exports2.Adapt = void 0; function isBoolean3(t7) { return typeOf(t7) === "boolean"; } __name(isBoolean3, "isBoolean"); function isObject2(t7) { return typeOf(t7) === "object"; } __name(isObject2, "isObject"); function isString4(t7) { return typeOf(t7) === "string"; } __name(isString4, "isString"); function typeOf(t7) { return typeof t7; } __name(typeOf, "typeOf"); function Adapt(adapter_) { var meta = adapter_.meta, path72 = adapter_.path, xdg = adapter_.xdg; var XDGAppPaths_ = function() { function XDGAppPaths_2(options_) { if (options_ === void 0) { options_ = {}; } var _a3, _b2, _c2; function XDGAppPaths(options33) { if (options33 === void 0) { options33 = {}; } return new XDGAppPaths_2(options33); } __name(XDGAppPaths, "XDGAppPaths"); var options32 = isObject2(options_) ? options_ : { name: options_ }; var suffix = (_a3 = options32.suffix) !== null && _a3 !== void 0 ? _a3 : ""; var isolated_ = (_b2 = options32.isolated) !== null && _b2 !== void 0 ? _b2 : true; var namePriorityList = [ options32.name, meta.pkgMainFilename(), meta.mainFilename() ]; var nameFallback = "$eval"; var name2 = path72.parse(((_c2 = namePriorityList.find(function(e7) { return isString4(e7); })) !== null && _c2 !== void 0 ? _c2 : nameFallback) + suffix).name; XDGAppPaths.$name = /* @__PURE__ */ __name(function $name() { return name2; }, "$name"); XDGAppPaths.$isolated = /* @__PURE__ */ __name(function $isolated() { return isolated_; }, "$isolated"); function isIsolated(dirOptions) { var _a4; dirOptions = dirOptions !== null && dirOptions !== void 0 ? dirOptions : { isolated: isolated_ }; var isolated = isBoolean3(dirOptions) ? dirOptions : (_a4 = dirOptions.isolated) !== null && _a4 !== void 0 ? _a4 : isolated_; return isolated; } __name(isIsolated, "isIsolated"); function finalPathSegment(dirOptions) { return isIsolated(dirOptions) ? name2 : ""; } __name(finalPathSegment, "finalPathSegment"); XDGAppPaths.cache = /* @__PURE__ */ __name(function cache6(dirOptions) { return path72.join(xdg.cache(), finalPathSegment(dirOptions)); }, "cache"); XDGAppPaths.config = /* @__PURE__ */ __name(function config(dirOptions) { return path72.join(xdg.config(), finalPathSegment(dirOptions)); }, "config"); XDGAppPaths.data = /* @__PURE__ */ __name(function data(dirOptions) { return path72.join(xdg.data(), finalPathSegment(dirOptions)); }, "data"); XDGAppPaths.runtime = /* @__PURE__ */ __name(function runtime(dirOptions) { return xdg.runtime() ? path72.join(xdg.runtime(), finalPathSegment(dirOptions)) : void 0; }, "runtime"); XDGAppPaths.state = /* @__PURE__ */ __name(function state2(dirOptions) { return path72.join(xdg.state(), finalPathSegment(dirOptions)); }, "state"); XDGAppPaths.configDirs = /* @__PURE__ */ __name(function configDirs(dirOptions) { return xdg.configDirs().map(function(s5) { return path72.join(s5, finalPathSegment(dirOptions)); }); }, "configDirs"); XDGAppPaths.dataDirs = /* @__PURE__ */ __name(function dataDirs(dirOptions) { return xdg.dataDirs().map(function(s5) { return path72.join(s5, finalPathSegment(dirOptions)); }); }, "dataDirs"); return XDGAppPaths; } __name(XDGAppPaths_2, "XDGAppPaths_"); return XDGAppPaths_2; }(); return { XDGAppPaths: new XDGAppPaths_() }; } __name(Adapt, "Adapt"); exports2.Adapt = Adapt; } }); // ../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/lib/XDG.js var require_XDG = __commonJS({ "../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/lib/XDG.js"(exports2) { "use strict"; init_import_meta_url(); var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) { for (var i5 = 0, il = from.length, j6 = to.length; i5 < il; i5++, j6++) to[j6] = from[i5]; return to; }; exports2.__esModule = true; exports2.Adapt = void 0; function Adapt(adapter_) { var env6 = adapter_.env, osPaths = adapter_.osPaths, path72 = adapter_.path; var isMacOS = /^darwin$/i.test(adapter_.process.platform); var isWinOS = /^win/i.test(adapter_.process.platform); function baseDir() { return osPaths.home() || osPaths.temp(); } __name(baseDir, "baseDir"); function valOrPath(val2, pathSegments) { return val2 || path72.join.apply(path72, pathSegments); } __name(valOrPath, "valOrPath"); var linux = /* @__PURE__ */ __name(function() { var cache6 = /* @__PURE__ */ __name(function() { return valOrPath(env6.get("XDG_CACHE_HOME"), [baseDir(), ".cache"]); }, "cache"); var config = /* @__PURE__ */ __name(function() { return valOrPath(env6.get("XDG_CONFIG_HOME"), [baseDir(), ".config"]); }, "config"); var data = /* @__PURE__ */ __name(function() { return valOrPath(env6.get("XDG_DATA_HOME"), [baseDir(), ".local", "share"]); }, "data"); var runtime = /* @__PURE__ */ __name(function() { return env6.get("XDG_RUNTIME_DIR") || void 0; }, "runtime"); var state2 = /* @__PURE__ */ __name(function() { return valOrPath(env6.get("XDG_STATE_HOME"), [baseDir(), ".local", "state"]); }, "state"); return { cache: cache6, config, data, runtime, state: state2 }; }, "linux"); var macos = /* @__PURE__ */ __name(function() { var cache6 = /* @__PURE__ */ __name(function() { return valOrPath(env6.get("XDG_CACHE_HOME"), [baseDir(), "Library", "Caches"]); }, "cache"); var config = /* @__PURE__ */ __name(function() { return valOrPath(env6.get("XDG_CONFIG_HOME"), [baseDir(), "Library", "Preferences"]); }, "config"); var data = /* @__PURE__ */ __name(function() { return valOrPath(env6.get("XDG_DATA_HOME"), [baseDir(), "Library", "Application Support"]); }, "data"); var runtime = /* @__PURE__ */ __name(function() { return env6.get("XDG_RUNTIME_DIR") || void 0; }, "runtime"); var state2 = /* @__PURE__ */ __name(function() { return valOrPath(env6.get("XDG_STATE_HOME"), [baseDir(), "Library", "State"]); }, "state"); return { cache: cache6, config, data, runtime, state: state2 }; }, "macos"); var windows = /* @__PURE__ */ __name(function() { function appData() { return valOrPath(env6.get("APPDATA"), [baseDir(), "AppData", "Roaming"]); } __name(appData, "appData"); function localAppData() { return valOrPath(env6.get("LOCALAPPDATA"), [baseDir(), "AppData", "Local"]); } __name(localAppData, "localAppData"); var cache6 = /* @__PURE__ */ __name(function() { return valOrPath(env6.get("XDG_CACHE_HOME"), [localAppData(), "xdg.cache"]); }, "cache"); var config = /* @__PURE__ */ __name(function() { return valOrPath(env6.get("XDG_CONFIG_HOME"), [appData(), "xdg.config"]); }, "config"); var data = /* @__PURE__ */ __name(function() { return valOrPath(env6.get("XDG_DATA_HOME"), [appData(), "xdg.data"]); }, "data"); var runtime = /* @__PURE__ */ __name(function() { return env6.get("XDG_RUNTIME_DIR") || void 0; }, "runtime"); var state2 = /* @__PURE__ */ __name(function() { return valOrPath(env6.get("XDG_STATE_HOME"), [localAppData(), "xdg.state"]); }, "state"); return { cache: cache6, config, data, runtime, state: state2 }; }, "windows"); var XDG_ = function() { function XDG_2() { function XDG() { return new XDG_2(); } __name(XDG, "XDG"); var extension = isMacOS ? macos() : isWinOS ? windows() : linux(); XDG.cache = extension.cache; XDG.config = extension.config; XDG.data = extension.data; XDG.runtime = extension.runtime; XDG.state = extension.state; XDG.configDirs = /* @__PURE__ */ __name(function configDirs() { var pathList = env6.get("XDG_CONFIG_DIRS"); return __spreadArray([extension.config()], pathList ? pathList.split(path72.delimiter) : []); }, "configDirs"); XDG.dataDirs = /* @__PURE__ */ __name(function dataDirs() { var pathList = env6.get("XDG_DATA_DIRS"); return __spreadArray([extension.data()], pathList ? pathList.split(path72.delimiter) : []); }, "dataDirs"); return XDG; } __name(XDG_2, "XDG_"); return XDG_2; }(); return { XDG: new XDG_() }; } __name(Adapt, "Adapt"); exports2.Adapt = Adapt; } }); // ../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/lib/OSPaths.js var require_OSPaths = __commonJS({ "../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/lib/OSPaths.js"(exports2) { "use strict"; init_import_meta_url(); var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) { for (var i5 = 0, il = from.length, j6 = to.length; i5 < il; i5++, j6++) to[j6] = from[i5]; return to; }; exports2.__esModule = true; exports2.Adapt = void 0; function isEmpty(s5) { return !s5; } __name(isEmpty, "isEmpty"); function Adapt(adapter_) { var env6 = adapter_.env, os13 = adapter_.os, path72 = adapter_.path; var isWinOS = /^win/i.test(adapter_.process.platform); function normalizePath2(path_) { return path_ ? adapter_.path.normalize(adapter_.path.join(path_, ".")) : void 0; } __name(normalizePath2, "normalizePath"); function home() { var posix2 = /* @__PURE__ */ __name(function() { return normalizePath2((typeof os13.homedir === "function" ? os13.homedir() : void 0) || env6.get("HOME")); }, "posix"); var windows = /* @__PURE__ */ __name(function() { var priorityList = [ typeof os13.homedir === "function" ? os13.homedir() : void 0, env6.get("USERPROFILE"), env6.get("HOME"), env6.get("HOMEDRIVE") || env6.get("HOMEPATH") ? path72.join(env6.get("HOMEDRIVE") || "", env6.get("HOMEPATH") || "") : void 0 ]; return normalizePath2(priorityList.find(function(v7) { return !isEmpty(v7); })); }, "windows"); return isWinOS ? windows() : posix2(); } __name(home, "home"); function temp() { function joinPathToBase(base, segments) { return base ? path72.join.apply(path72, __spreadArray([base], segments)) : void 0; } __name(joinPathToBase, "joinPathToBase"); function posix2() { var fallback = "/tmp"; var priorityList = [ typeof os13.tmpdir === "function" ? os13.tmpdir() : void 0, env6.get("TMPDIR"), env6.get("TEMP"), env6.get("TMP") ]; return normalizePath2(priorityList.find(function(v7) { return !isEmpty(v7); })) || fallback; } __name(posix2, "posix"); function windows() { var fallback = "C:\\Temp"; var priorityListLazy = [ typeof os13.tmpdir === "function" ? os13.tmpdir : function() { return void 0; }, function() { return env6.get("TEMP"); }, function() { return env6.get("TMP"); }, function() { return joinPathToBase(env6.get("LOCALAPPDATA"), ["Temp"]); }, function() { return joinPathToBase(home(), ["AppData", "Local", "Temp"]); }, function() { return joinPathToBase(env6.get("ALLUSERSPROFILE"), ["Temp"]); }, function() { return joinPathToBase(env6.get("SystemRoot"), ["Temp"]); }, function() { return joinPathToBase(env6.get("windir"), ["Temp"]); }, function() { return joinPathToBase(env6.get("SystemDrive"), ["\\", "Temp"]); } ]; var v7 = priorityListLazy.find(function(v8) { return v8 && !isEmpty(v8()); }); return v7 && normalizePath2(v7()) || fallback; } __name(windows, "windows"); return isWinOS ? windows() : posix2(); } __name(temp, "temp"); var OSPaths_ = function() { function OSPaths_2() { function OSPaths() { return new OSPaths_2(); } __name(OSPaths, "OSPaths"); OSPaths.home = home; OSPaths.temp = temp; return OSPaths; } __name(OSPaths_2, "OSPaths_"); return OSPaths_2; }(); return { OSPaths: new OSPaths_() }; } __name(Adapt, "Adapt"); exports2.Adapt = Adapt; } }); // ../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/platform-adapters/node.js var require_node = __commonJS({ "../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/platform-adapters/node.js"(exports2) { "use strict"; init_import_meta_url(); var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o5, m6, k6, k22) { if (k22 === void 0) k22 = k6; Object.defineProperty(o5, k22, { enumerable: true, get: function() { return m6[k6]; } }); } : function(o5, m6, k6, k22) { if (k22 === void 0) k22 = k6; o5[k22] = m6[k6]; }); var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o5, v7) { Object.defineProperty(o5, "default", { enumerable: true, value: v7 }); } : function(o5, v7) { o5["default"] = v7; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k6 in mod) if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod, k6)) __createBinding(result, mod, k6); } __setModuleDefault(result, mod); return result; }; exports2.__esModule = true; exports2.adapter = void 0; var os13 = __importStar(require("os")); var path72 = __importStar(require("path")); exports2.adapter = { atImportPermissions: { env: true }, env: { get: function(s5) { return process.env[s5]; } }, os: os13, path: path72, process }; } }); // ../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/mod.cjs.js var require_mod_cjs = __commonJS({ "../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/mod.cjs.js"(exports2, module3) { "use strict"; init_import_meta_url(); var OSPaths_js_1 = require_OSPaths(); var node_js_1 = require_node(); module3.exports = OSPaths_js_1.Adapt(node_js_1.adapter).OSPaths; } }); // ../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/platform-adapters/node.js var require_node2 = __commonJS({ "../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/platform-adapters/node.js"(exports2) { "use strict"; init_import_meta_url(); var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o5, m6, k6, k22) { if (k22 === void 0) k22 = k6; Object.defineProperty(o5, k22, { enumerable: true, get: function() { return m6[k6]; } }); } : function(o5, m6, k6, k22) { if (k22 === void 0) k22 = k6; o5[k22] = m6[k6]; }); var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o5, v7) { Object.defineProperty(o5, "default", { enumerable: true, value: v7 }); } : function(o5, v7) { o5["default"] = v7; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k6 in mod) if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod, k6)) __createBinding(result, mod, k6); } __setModuleDefault(result, mod); return result; }; var __importDefault = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; exports2.__esModule = true; exports2.adapter = void 0; var path72 = __importStar(require("path")); var os_paths_1 = __importDefault(require_mod_cjs()); exports2.adapter = { atImportPermissions: { env: true }, env: { get: function(s5) { return process.env[s5]; } }, osPaths: os_paths_1["default"], path: path72, process }; } }); // ../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/mod.cjs.js var require_mod_cjs2 = __commonJS({ "../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/mod.cjs.js"(exports2, module3) { "use strict"; init_import_meta_url(); var XDG_js_1 = require_XDG(); var node_js_1 = require_node2(); module3.exports = XDG_js_1.Adapt(node_js_1.adapter).XDG; } }); // ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/platform-adapters/node.js var require_node3 = __commonJS({ "../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/platform-adapters/node.js"(exports2) { "use strict"; init_import_meta_url(); var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o5, m6, k6, k22) { if (k22 === void 0) k22 = k6; Object.defineProperty(o5, k22, { enumerable: true, get: function() { return m6[k6]; } }); } : function(o5, m6, k6, k22) { if (k22 === void 0) k22 = k6; o5[k22] = m6[k6]; }); var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o5, v7) { Object.defineProperty(o5, "default", { enumerable: true, value: v7 }); } : function(o5, v7) { o5["default"] = v7; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k6 in mod) if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod, k6)) __createBinding(result, mod, k6); } __setModuleDefault(result, mod); return result; }; var __importDefault = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; exports2.__esModule = true; exports2.adapter = void 0; var path72 = __importStar(require("path")); var xdg_portable_1 = __importDefault(require_mod_cjs2()); exports2.adapter = { atImportPermissions: { env: true, read: true }, meta: { mainFilename: function() { var requireMain = typeof require !== "undefined" && require !== null && require.main ? require.main : { filename: void 0 }; var requireMainFilename = requireMain.filename; var filename = (requireMainFilename !== process.execArgv[0] ? requireMainFilename : void 0) || (typeof process._eval === "undefined" ? process.argv[1] : void 0); return filename; }, pkgMainFilename: function() { return process.pkg ? process.execPath : void 0; } }, path: path72, process, xdg: xdg_portable_1["default"] }; } }); // ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/mod.cjs.js var require_mod_cjs3 = __commonJS({ "../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/mod.cjs.js"(exports2, module3) { "use strict"; init_import_meta_url(); var XDGAppPaths_js_1 = require_XDGAppPaths(); var node_js_1 = require_node3(); module3.exports = XDGAppPaths_js_1.Adapt(node_js_1.adapter).XDGAppPaths; } }); // ../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/debug.js var require_debug = __commonJS({ "../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/debug.js"(exports2, module3) { init_import_meta_url(); var messages = []; var level = 0; var debug = /* @__PURE__ */ __name((msg, min) => { if (level >= min) { messages.push(msg); } }, "debug"); debug.WARN = 1; debug.INFO = 2; debug.DEBUG = 3; debug.reset = () => { messages = []; }; debug.setDebugLevel = (v7) => { level = v7; }; debug.warn = (msg) => debug(msg, debug.WARN); debug.info = (msg) => debug(msg, debug.INFO); debug.debug = (msg) => debug(msg, debug.DEBUG); debug.debugMessages = () => messages; module3.exports = debug; } }); // ../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js var require_ansi_regex = __commonJS({ "../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = ({ onlyFirst = false } = {}) => { const pattern = [ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))" ].join("|"); return new RegExp(pattern, onlyFirst ? void 0 : "g"); }; } }); // ../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js var require_strip_ansi = __commonJS({ "../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var ansiRegex2 = require_ansi_regex(); module3.exports = (string) => typeof string === "string" ? string.replace(ansiRegex2(), "") : string; } }); // ../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js var require_is_fullwidth_code_point = __commonJS({ "../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var isFullwidthCodePoint2 = /* @__PURE__ */ __name((codePoint) => { if (Number.isNaN(codePoint)) { return false; } if (codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET // CJK Radicals Supplement .. Enclosed CJK Letters and Months 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A 12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals 19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A 43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables 44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs 63744 <= codePoint && codePoint <= 64255 || // Vertical Forms 65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants 65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement 110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement 127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane 131072 <= codePoint && codePoint <= 262141)) { return true; } return false; }, "isFullwidthCodePoint"); module3.exports = isFullwidthCodePoint2; module3.exports.default = isFullwidthCodePoint2; } }); // ../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js var require_emoji_regex = __commonJS({ "../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = function() { return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; }; } }); // ../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js var require_string_width = __commonJS({ "../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var stripAnsi4 = require_strip_ansi(); var isFullwidthCodePoint2 = require_is_fullwidth_code_point(); var emojiRegex3 = require_emoji_regex(); var stringWidth2 = /* @__PURE__ */ __name((string) => { if (typeof string !== "string" || string.length === 0) { return 0; } string = stripAnsi4(string); if (string.length === 0) { return 0; } string = string.replace(emojiRegex3(), " "); let width = 0; for (let i5 = 0; i5 < string.length; i5++) { const code = string.codePointAt(i5); if (code <= 31 || code >= 127 && code <= 159) { continue; } if (code >= 768 && code <= 879) { continue; } if (code > 65535) { i5++; } width += isFullwidthCodePoint2(code) ? 2 : 1; } return width; }, "stringWidth"); module3.exports = stringWidth2; module3.exports.default = stringWidth2; } }); // ../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/utils.js var require_utils2 = __commonJS({ "../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/utils.js"(exports2, module3) { init_import_meta_url(); var stringWidth2 = require_string_width(); function codeRegex(capture) { return capture ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g; } __name(codeRegex, "codeRegex"); function strlen(str) { let code = codeRegex(); let stripped = ("" + str).replace(code, ""); let split = stripped.split("\n"); return split.reduce(function(memo, s5) { return stringWidth2(s5) > memo ? stringWidth2(s5) : memo; }, 0); } __name(strlen, "strlen"); function repeat2(str, times) { return Array(times + 1).join(str); } __name(repeat2, "repeat"); function pad2(str, len, pad3, dir) { let length = strlen(str); if (len + 1 >= length) { let padlen = len - length; switch (dir) { case "right": { str = repeat2(pad3, padlen) + str; break; } case "center": { let right2 = Math.ceil(padlen / 2); let left2 = padlen - right2; str = repeat2(pad3, left2) + str + repeat2(pad3, right2); break; } default: { str = str + repeat2(pad3, padlen); break; } } } return str; } __name(pad2, "pad"); var codeCache = {}; function addToCodeCache(name2, on, off) { on = "\x1B[" + on + "m"; off = "\x1B[" + off + "m"; codeCache[on] = { set: name2, to: true }; codeCache[off] = { set: name2, to: false }; codeCache[name2] = { on, off }; } __name(addToCodeCache, "addToCodeCache"); addToCodeCache("bold", 1, 22); addToCodeCache("italics", 3, 23); addToCodeCache("underline", 4, 24); addToCodeCache("inverse", 7, 27); addToCodeCache("strikethrough", 9, 29); function updateState(state2, controlChars) { let controlCode = controlChars[1] ? parseInt(controlChars[1].split(";")[0]) : 0; if (controlCode >= 30 && controlCode <= 39 || controlCode >= 90 && controlCode <= 97) { state2.lastForegroundAdded = controlChars[0]; return; } if (controlCode >= 40 && controlCode <= 49 || controlCode >= 100 && controlCode <= 107) { state2.lastBackgroundAdded = controlChars[0]; return; } if (controlCode === 0) { for (let i5 in state2) { if (Object.prototype.hasOwnProperty.call(state2, i5)) { delete state2[i5]; } } return; } let info = codeCache[controlChars[0]]; if (info) { state2[info.set] = info.to; } } __name(updateState, "updateState"); function readState(line) { let code = codeRegex(true); let controlChars = code.exec(line); let state2 = {}; while (controlChars !== null) { updateState(state2, controlChars); controlChars = code.exec(line); } return state2; } __name(readState, "readState"); function unwindState(state2, ret) { let lastBackgroundAdded = state2.lastBackgroundAdded; let lastForegroundAdded = state2.lastForegroundAdded; delete state2.lastBackgroundAdded; delete state2.lastForegroundAdded; Object.keys(state2).forEach(function(key) { if (state2[key]) { ret += codeCache[key].off; } }); if (lastBackgroundAdded && lastBackgroundAdded != "\x1B[49m") { ret += "\x1B[49m"; } if (lastForegroundAdded && lastForegroundAdded != "\x1B[39m") { ret += "\x1B[39m"; } return ret; } __name(unwindState, "unwindState"); function rewindState(state2, ret) { let lastBackgroundAdded = state2.lastBackgroundAdded; let lastForegroundAdded = state2.lastForegroundAdded; delete state2.lastBackgroundAdded; delete state2.lastForegroundAdded; Object.keys(state2).forEach(function(key) { if (state2[key]) { ret = codeCache[key].on + ret; } }); if (lastBackgroundAdded && lastBackgroundAdded != "\x1B[49m") { ret = lastBackgroundAdded + ret; } if (lastForegroundAdded && lastForegroundAdded != "\x1B[39m") { ret = lastForegroundAdded + ret; } return ret; } __name(rewindState, "rewindState"); function truncateWidth(str, desiredLength) { if (str.length === strlen(str)) { return str.substr(0, desiredLength); } while (strlen(str) > desiredLength) { str = str.slice(0, -1); } return str; } __name(truncateWidth, "truncateWidth"); function truncateWidthWithAnsi(str, desiredLength) { let code = codeRegex(true); let split = str.split(codeRegex()); let splitIndex = 0; let retLen = 0; let ret = ""; let myArray; let state2 = {}; while (retLen < desiredLength) { myArray = code.exec(str); let toAdd = split[splitIndex]; splitIndex++; if (retLen + strlen(toAdd) > desiredLength) { toAdd = truncateWidth(toAdd, desiredLength - retLen); } ret += toAdd; retLen += strlen(toAdd); if (retLen < desiredLength) { if (!myArray) { break; } ret += myArray[0]; updateState(state2, myArray); } } return unwindState(state2, ret); } __name(truncateWidthWithAnsi, "truncateWidthWithAnsi"); function truncate4(str, desiredLength, truncateChar) { truncateChar = truncateChar || "\u2026"; let lengthOfStr = strlen(str); if (lengthOfStr <= desiredLength) { return str; } desiredLength -= strlen(truncateChar); let ret = truncateWidthWithAnsi(str, desiredLength); return ret + truncateChar; } __name(truncate4, "truncate"); function defaultOptions3() { return { chars: { top: "\u2500", "top-mid": "\u252C", "top-left": "\u250C", "top-right": "\u2510", bottom: "\u2500", "bottom-mid": "\u2534", "bottom-left": "\u2514", "bottom-right": "\u2518", left: "\u2502", "left-mid": "\u251C", mid: "\u2500", "mid-mid": "\u253C", right: "\u2502", "right-mid": "\u2524", middle: "\u2502" }, truncate: "\u2026", colWidths: [], rowHeights: [], colAligns: [], rowAligns: [], style: { "padding-left": 1, "padding-right": 1, head: ["red"], border: ["grey"], compact: false }, head: [] }; } __name(defaultOptions3, "defaultOptions"); function mergeOptions(options32, defaults) { options32 = options32 || {}; defaults = defaults || defaultOptions3(); let ret = Object.assign({}, defaults, options32); ret.chars = Object.assign({}, defaults.chars, options32.chars); ret.style = Object.assign({}, defaults.style, options32.style); return ret; } __name(mergeOptions, "mergeOptions"); function wordWrap(maxLength, input) { let lines = []; let split = input.split(/(\s+)/g); let line = []; let lineLength = 0; let whitespace; for (let i5 = 0; i5 < split.length; i5 += 2) { let word = split[i5]; let newLength = lineLength + strlen(word); if (lineLength > 0 && whitespace) { newLength += whitespace.length; } if (newLength > maxLength) { if (lineLength !== 0) { lines.push(line.join("")); } line = [word]; lineLength = strlen(word); } else { line.push(whitespace || "", word); lineLength = newLength; } whitespace = split[i5 + 1]; } if (lineLength) { lines.push(line.join("")); } return lines; } __name(wordWrap, "wordWrap"); function textWrap(maxLength, input) { let lines = []; let line = ""; function pushLine(str, ws) { if (line.length && ws) line += ws; line += str; while (line.length > maxLength) { lines.push(line.slice(0, maxLength)); line = line.slice(maxLength); } } __name(pushLine, "pushLine"); let split = input.split(/(\s+)/g); for (let i5 = 0; i5 < split.length; i5 += 2) { pushLine(split[i5], i5 && split[i5 - 1]); } if (line.length) lines.push(line); return lines; } __name(textWrap, "textWrap"); function multiLineWordWrap(maxLength, input, wrapOnWordBoundary = true) { let output = []; input = input.split("\n"); const handler31 = wrapOnWordBoundary ? wordWrap : textWrap; for (let i5 = 0; i5 < input.length; i5++) { output.push.apply(output, handler31(maxLength, input[i5])); } return output; } __name(multiLineWordWrap, "multiLineWordWrap"); function colorizeLines(input) { let state2 = {}; let output = []; for (let i5 = 0; i5 < input.length; i5++) { let line = rewindState(state2, input[i5]); state2 = readState(line); let temp = Object.assign({}, state2); output.push(unwindState(temp, line)); } return output; } __name(colorizeLines, "colorizeLines"); function hyperlink(url4, text) { const OSC2 = "\x1B]"; const BEL2 = "\x07"; const SEP2 = ";"; return [OSC2, "8", SEP2, SEP2, url4 || text, BEL2, text, OSC2, "8", SEP2, SEP2, BEL2].join(""); } __name(hyperlink, "hyperlink"); module3.exports = { strlen, repeat: repeat2, pad: pad2, truncate: truncate4, mergeOptions, wordWrap: multiLineWordWrap, colorizeLines, hyperlink }; } }); // ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/styles.js var require_styles = __commonJS({ "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/styles.js"(exports2, module3) { init_import_meta_url(); var styles4 = {}; module3["exports"] = styles4; var codes = { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29], black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], gray: [90, 39], grey: [90, 39], brightRed: [91, 39], brightGreen: [92, 39], brightYellow: [93, 39], brightBlue: [94, 39], brightMagenta: [95, 39], brightCyan: [96, 39], brightWhite: [97, 39], bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgGray: [100, 49], bgGrey: [100, 49], bgBrightRed: [101, 49], bgBrightGreen: [102, 49], bgBrightYellow: [103, 49], bgBrightBlue: [104, 49], bgBrightMagenta: [105, 49], bgBrightCyan: [106, 49], bgBrightWhite: [107, 49], // legacy styles for colors pre v1.0.0 blackBG: [40, 49], redBG: [41, 49], greenBG: [42, 49], yellowBG: [43, 49], blueBG: [44, 49], magentaBG: [45, 49], cyanBG: [46, 49], whiteBG: [47, 49] }; Object.keys(codes).forEach(function(key) { var val2 = codes[key]; var style = styles4[key] = []; style.open = "\x1B[" + val2[0] + "m"; style.close = "\x1B[" + val2[1] + "m"; }); } }); // ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/has-flag.js var require_has_flag = __commonJS({ "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/has-flag.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = function(flag, argv) { argv = argv || process.argv; var terminatorPos = argv.indexOf("--"); var prefix = /^-{1,2}/.test(flag) ? "" : "--"; var pos = argv.indexOf(prefix + flag); return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); }; } }); // ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/supports-colors.js var require_supports_colors = __commonJS({ "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module3) { "use strict"; init_import_meta_url(); var os13 = require("os"); var hasFlag3 = require_has_flag(); var env6 = process.env; var forceColor = void 0; if (hasFlag3("no-color") || hasFlag3("no-colors") || hasFlag3("color=false")) { forceColor = false; } else if (hasFlag3("color") || hasFlag3("colors") || hasFlag3("color=true") || hasFlag3("color=always")) { forceColor = true; } if ("FORCE_COLOR" in env6) { forceColor = env6.FORCE_COLOR.length === 0 || parseInt(env6.FORCE_COLOR, 10) !== 0; } function translateLevel3(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; } __name(translateLevel3, "translateLevel"); function supportsColor3(stream2) { if (forceColor === false) { return 0; } if (hasFlag3("color=16m") || hasFlag3("color=full") || hasFlag3("color=truecolor")) { return 3; } if (hasFlag3("color=256")) { return 2; } if (stream2 && !stream2.isTTY && forceColor !== true) { return 0; } var min = forceColor ? 1 : 0; if (process.platform === "win32") { var osRelease = os13.release().split("."); if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } if ("CI" in env6) { if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(sign) { return sign in env6; }) || env6.CI_NAME === "codeship") { return 1; } return min; } if ("TEAMCITY_VERSION" in env6) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env6.TEAMCITY_VERSION) ? 1 : 0; } if ("TERM_PROGRAM" in env6) { var version4 = parseInt((env6.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env6.TERM_PROGRAM) { case "iTerm.app": return version4 >= 3 ? 3 : 2; case "Hyper": return 3; case "Apple_Terminal": return 2; } } if (/-256(color)?$/i.test(env6.TERM)) { return 2; } if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env6.TERM)) { return 1; } if ("COLORTERM" in env6) { return 1; } if (env6.TERM === "dumb") { return min; } return min; } __name(supportsColor3, "supportsColor"); function getSupportLevel(stream2) { var level = supportsColor3(stream2); return translateLevel3(level); } __name(getSupportLevel, "getSupportLevel"); module3.exports = { supportsColor: getSupportLevel, stdout: getSupportLevel(process.stdout), stderr: getSupportLevel(process.stderr) }; } }); // ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/custom/trap.js var require_trap = __commonJS({ "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/custom/trap.js"(exports2, module3) { init_import_meta_url(); module3["exports"] = /* @__PURE__ */ __name(function runTheTrap(text, options32) { var result = ""; text = text || "Run the trap, drop the bass"; text = text.split(""); var trap = { a: ["@", "\u0104", "\u023A", "\u0245", "\u0394", "\u039B", "\u0414"], b: ["\xDF", "\u0181", "\u0243", "\u026E", "\u03B2", "\u0E3F"], c: ["\xA9", "\u023B", "\u03FE"], d: ["\xD0", "\u018A", "\u0500", "\u0501", "\u0502", "\u0503"], e: [ "\xCB", "\u0115", "\u018E", "\u0258", "\u03A3", "\u03BE", "\u04BC", "\u0A6C" ], f: ["\u04FA"], g: ["\u0262"], h: ["\u0126", "\u0195", "\u04A2", "\u04BA", "\u04C7", "\u050A"], i: ["\u0F0F"], j: ["\u0134"], k: ["\u0138", "\u04A0", "\u04C3", "\u051E"], l: ["\u0139"], m: ["\u028D", "\u04CD", "\u04CE", "\u0520", "\u0521", "\u0D69"], n: ["\xD1", "\u014B", "\u019D", "\u0376", "\u03A0", "\u048A"], o: [ "\xD8", "\xF5", "\xF8", "\u01FE", "\u0298", "\u047A", "\u05DD", "\u06DD", "\u0E4F" ], p: ["\u01F7", "\u048E"], q: ["\u09CD"], r: ["\xAE", "\u01A6", "\u0210", "\u024C", "\u0280", "\u042F"], s: ["\xA7", "\u03DE", "\u03DF", "\u03E8"], t: ["\u0141", "\u0166", "\u0373"], u: ["\u01B1", "\u054D"], v: ["\u05D8"], w: ["\u0428", "\u0460", "\u047C", "\u0D70"], x: ["\u04B2", "\u04FE", "\u04FC", "\u04FD"], y: ["\xA5", "\u04B0", "\u04CB"], z: ["\u01B5", "\u0240"] }; text.forEach(function(c6) { c6 = c6.toLowerCase(); var chars = trap[c6] || [" "]; var rand = Math.floor(Math.random() * chars.length); if (typeof trap[c6] !== "undefined") { result += trap[c6][rand]; } else { result += c6; } }); return result; }, "runTheTrap"); } }); // ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/custom/zalgo.js var require_zalgo = __commonJS({ "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/custom/zalgo.js"(exports2, module3) { init_import_meta_url(); module3["exports"] = /* @__PURE__ */ __name(function zalgo(text, options32) { text = text || " he is here "; var soul = { "up": [ "\u030D", "\u030E", "\u0304", "\u0305", "\u033F", "\u0311", "\u0306", "\u0310", "\u0352", "\u0357", "\u0351", "\u0307", "\u0308", "\u030A", "\u0342", "\u0313", "\u0308", "\u034A", "\u034B", "\u034C", "\u0303", "\u0302", "\u030C", "\u0350", "\u0300", "\u0301", "\u030B", "\u030F", "\u0312", "\u0313", "\u0314", "\u033D", "\u0309", "\u0363", "\u0364", "\u0365", "\u0366", "\u0367", "\u0368", "\u0369", "\u036A", "\u036B", "\u036C", "\u036D", "\u036E", "\u036F", "\u033E", "\u035B", "\u0346", "\u031A" ], "down": [ "\u0316", "\u0317", "\u0318", "\u0319", "\u031C", "\u031D", "\u031E", "\u031F", "\u0320", "\u0324", "\u0325", "\u0326", "\u0329", "\u032A", "\u032B", "\u032C", "\u032D", "\u032E", "\u032F", "\u0330", "\u0331", "\u0332", "\u0333", "\u0339", "\u033A", "\u033B", "\u033C", "\u0345", "\u0347", "\u0348", "\u0349", "\u034D", "\u034E", "\u0353", "\u0354", "\u0355", "\u0356", "\u0359", "\u035A", "\u0323" ], "mid": [ "\u0315", "\u031B", "\u0300", "\u0301", "\u0358", "\u0321", "\u0322", "\u0327", "\u0328", "\u0334", "\u0335", "\u0336", "\u035C", "\u035D", "\u035E", "\u035F", "\u0360", "\u0362", "\u0338", "\u0337", "\u0361", " \u0489" ] }; var all2 = [].concat(soul.up, soul.down, soul.mid); function randomNumber(range) { var r7 = Math.floor(Math.random() * range); return r7; } __name(randomNumber, "randomNumber"); function isChar(character) { var bool = false; all2.filter(function(i5) { bool = i5 === character; }); return bool; } __name(isChar, "isChar"); function heComes(text2, options33) { var result = ""; var counts; var l6; options33 = options33 || {}; options33["up"] = typeof options33["up"] !== "undefined" ? options33["up"] : true; options33["mid"] = typeof options33["mid"] !== "undefined" ? options33["mid"] : true; options33["down"] = typeof options33["down"] !== "undefined" ? options33["down"] : true; options33["size"] = typeof options33["size"] !== "undefined" ? options33["size"] : "maxi"; text2 = text2.split(""); for (l6 in text2) { if (isChar(l6)) { continue; } result = result + text2[l6]; counts = { "up": 0, "down": 0, "mid": 0 }; switch (options33.size) { case "mini": counts.up = randomNumber(8); counts.mid = randomNumber(2); counts.down = randomNumber(8); break; case "maxi": counts.up = randomNumber(16) + 3; counts.mid = randomNumber(4) + 1; counts.down = randomNumber(64) + 3; break; default: counts.up = randomNumber(8) + 1; counts.mid = randomNumber(6) / 2; counts.down = randomNumber(8) + 1; break; } var arr = ["up", "mid", "down"]; for (var d6 in arr) { var index = arr[d6]; for (var i5 = 0; i5 <= counts[index]; i5++) { if (options33[index]) { result = result + soul[index][randomNumber(soul[index].length)]; } } } } return result; } __name(heComes, "heComes"); return heComes(text, options32); }, "zalgo"); } }); // ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/america.js var require_america = __commonJS({ "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/america.js"(exports2, module3) { init_import_meta_url(); module3["exports"] = function(colors) { return function(letter, i5, exploded) { if (letter === " ") return letter; switch (i5 % 3) { case 0: return colors.red(letter); case 1: return colors.white(letter); case 2: return colors.blue(letter); } }; }; } }); // ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/zebra.js var require_zebra = __commonJS({ "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/zebra.js"(exports2, module3) { init_import_meta_url(); module3["exports"] = function(colors) { return function(letter, i5, exploded) { return i5 % 2 === 0 ? letter : colors.inverse(letter); }; }; } }); // ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/rainbow.js var require_rainbow = __commonJS({ "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/rainbow.js"(exports2, module3) { init_import_meta_url(); module3["exports"] = function(colors) { var rainbowColors = ["red", "yellow", "green", "blue", "magenta"]; return function(letter, i5, exploded) { if (letter === " ") { return letter; } else { return colors[rainbowColors[i5++ % rainbowColors.length]](letter); } }; }; } }); // ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/random.js var require_random = __commonJS({ "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/maps/random.js"(exports2, module3) { init_import_meta_url(); module3["exports"] = function(colors) { var available = [ "underline", "inverse", "grey", "yellow", "red", "green", "blue", "white", "cyan", "magenta", "brightYellow", "brightRed", "brightGreen", "brightBlue", "brightWhite", "brightCyan", "brightMagenta" ]; return function(letter, i5, exploded) { return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 2))]](letter); }; }; } }); // ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/colors.js var require_colors = __commonJS({ "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/colors.js"(exports2, module3) { init_import_meta_url(); var colors = {}; module3["exports"] = colors; colors.themes = {}; var util5 = require("util"); var ansiStyles3 = colors.styles = require_styles(); var defineProps = Object.defineProperties; var newLineRegex = new RegExp(/[\r\n]+/g); colors.supportsColor = require_supports_colors().supportsColor; if (typeof colors.enabled === "undefined") { colors.enabled = colors.supportsColor() !== false; } colors.enable = function() { colors.enabled = true; }; colors.disable = function() { colors.enabled = false; }; colors.stripColors = colors.strip = function(str) { return ("" + str).replace(/\x1B\[\d+m/g, ""); }; var stylize = colors.stylize = /* @__PURE__ */ __name(function stylize2(str, style) { if (!colors.enabled) { return str + ""; } var styleMap = ansiStyles3[style]; if (!styleMap && style in colors) { return colors[style](str); } return styleMap.open + str + styleMap.close; }, "stylize"); var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; var escapeStringRegexp = /* @__PURE__ */ __name(function(str) { if (typeof str !== "string") { throw new TypeError("Expected a string"); } return str.replace(matchOperatorsRe, "\\$&"); }, "escapeStringRegexp"); function build5(_styles) { var builder = /* @__PURE__ */ __name(function builder2() { return applyStyle2.apply(builder2, arguments); }, "builder"); builder._styles = _styles; builder.__proto__ = proto2; return builder; } __name(build5, "build"); var styles4 = function() { var ret = {}; ansiStyles3.grey = ansiStyles3.gray; Object.keys(ansiStyles3).forEach(function(key) { ansiStyles3[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles3[key].close), "g"); ret[key] = { get: function() { return build5(this._styles.concat(key)); } }; }); return ret; }(); var proto2 = defineProps(/* @__PURE__ */ __name(function colors2() { }, "colors"), styles4); function applyStyle2() { var args = Array.prototype.slice.call(arguments); var str = args.map(function(arg) { if (arg != null && arg.constructor === String) { return arg; } else { return util5.inspect(arg); } }).join(" "); if (!colors.enabled || !str) { return str; } var newLinesPresent = str.indexOf("\n") != -1; var nestedStyles = this._styles; var i5 = nestedStyles.length; while (i5--) { var code = ansiStyles3[nestedStyles[i5]]; str = code.open + str.replace(code.closeRe, code.open) + code.close; if (newLinesPresent) { str = str.replace(newLineRegex, function(match2) { return code.close + match2 + code.open; }); } } return str; } __name(applyStyle2, "applyStyle"); colors.setTheme = function(theme) { if (typeof theme === "string") { console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));"); return; } for (var style in theme) { (function(style2) { colors[style2] = function(str) { if (typeof theme[style2] === "object") { var out = str; for (var i5 in theme[style2]) { out = colors[theme[style2][i5]](out); } return out; } return colors[theme[style2]](str); }; })(style); } }; function init2() { var ret = {}; Object.keys(styles4).forEach(function(name2) { ret[name2] = { get: function() { return build5([name2]); } }; }); return ret; } __name(init2, "init"); var sequencer = /* @__PURE__ */ __name(function sequencer2(map3, str) { var exploded = str.split(""); exploded = exploded.map(map3); return exploded.join(""); }, "sequencer"); colors.trap = require_trap(); colors.zalgo = require_zalgo(); colors.maps = {}; colors.maps.america = require_america()(colors); colors.maps.zebra = require_zebra()(colors); colors.maps.rainbow = require_rainbow()(colors); colors.maps.random = require_random()(colors); for (map2 in colors.maps) { (function(map3) { colors[map3] = function(str) { return sequencer(colors.maps[map3], str); }; })(map2); } var map2; defineProps(colors, init2()); } }); // ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/safe.js var require_safe = __commonJS({ "../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/safe.js"(exports2, module3) { init_import_meta_url(); var colors = require_colors(); module3["exports"] = colors; } }); // ../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/cell.js var require_cell = __commonJS({ "../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/cell.js"(exports2, module3) { init_import_meta_url(); var { info, debug } = require_debug(); var utils = require_utils2(); var Cell = class { /** * A representation of a cell within the table. * Implementations must have `init` and `draw` methods, * as well as `colSpan`, `rowSpan`, `desiredHeight` and `desiredWidth` properties. * @param options * @constructor */ constructor(options32) { this.setOptions(options32); this.x = null; this.y = null; } setOptions(options32) { if (["boolean", "number", "string"].indexOf(typeof options32) !== -1) { options32 = { content: "" + options32 }; } options32 = options32 || {}; this.options = options32; let content = options32.content; if (["boolean", "number", "string"].indexOf(typeof content) !== -1) { this.content = String(content); } else if (!content) { this.content = this.options.href || ""; } else { throw new Error("Content needs to be a primitive, got: " + typeof content); } this.colSpan = options32.colSpan || 1; this.rowSpan = options32.rowSpan || 1; if (this.options.href) { Object.defineProperty(this, "href", { get() { return this.options.href; } }); } } mergeTableOptions(tableOptions, cells) { this.cells = cells; let optionsChars = this.options.chars || {}; let tableChars = tableOptions.chars; let chars = this.chars = {}; CHAR_NAMES.forEach(function(name2) { setOption(optionsChars, tableChars, name2, chars); }); this.truncate = this.options.truncate || tableOptions.truncate; let style = this.options.style = this.options.style || {}; let tableStyle = tableOptions.style; setOption(style, tableStyle, "padding-left", this); setOption(style, tableStyle, "padding-right", this); this.head = style.head || tableStyle.head; this.border = style.border || tableStyle.border; this.fixedWidth = tableOptions.colWidths[this.x]; this.lines = this.computeLines(tableOptions); this.desiredWidth = utils.strlen(this.content) + this.paddingLeft + this.paddingRight; this.desiredHeight = this.lines.length; } computeLines(tableOptions) { const tableWordWrap = tableOptions.wordWrap || tableOptions.textWrap; const { wordWrap = tableWordWrap } = this.options; if (this.fixedWidth && wordWrap) { this.fixedWidth -= this.paddingLeft + this.paddingRight; if (this.colSpan) { let i5 = 1; while (i5 < this.colSpan) { this.fixedWidth += tableOptions.colWidths[this.x + i5]; i5++; } } const { wrapOnWordBoundary: tableWrapOnWordBoundary = true } = tableOptions; const { wrapOnWordBoundary = tableWrapOnWordBoundary } = this.options; return this.wrapLines(utils.wordWrap(this.fixedWidth, this.content, wrapOnWordBoundary)); } return this.wrapLines(this.content.split("\n")); } wrapLines(computedLines) { const lines = utils.colorizeLines(computedLines); if (this.href) { return lines.map((line) => utils.hyperlink(this.href, line)); } return lines; } /** * Initializes the Cells data structure. * * @param tableOptions - A fully populated set of tableOptions. * In addition to the standard default values, tableOptions must have fully populated the * `colWidths` and `rowWidths` arrays. Those arrays must have lengths equal to the number * of columns or rows (respectively) in this table, and each array item must be a Number. * */ init(tableOptions) { let x6 = this.x; let y4 = this.y; this.widths = tableOptions.colWidths.slice(x6, x6 + this.colSpan); this.heights = tableOptions.rowHeights.slice(y4, y4 + this.rowSpan); this.width = this.widths.reduce(sumPlusOne, -1); this.height = this.heights.reduce(sumPlusOne, -1); this.hAlign = this.options.hAlign || tableOptions.colAligns[x6]; this.vAlign = this.options.vAlign || tableOptions.rowAligns[y4]; this.drawRight = x6 + this.colSpan == tableOptions.colWidths.length; } /** * Draws the given line of the cell. * This default implementation defers to methods `drawTop`, `drawBottom`, `drawLine` and `drawEmpty`. * @param lineNum - can be `top`, `bottom` or a numerical line number. * @param spanningCell - will be a number if being called from a RowSpanCell, and will represent how * many rows below it's being called from. Otherwise it's undefined. * @returns {String} The representation of this line. */ draw(lineNum, spanningCell) { if (lineNum == "top") return this.drawTop(this.drawRight); if (lineNum == "bottom") return this.drawBottom(this.drawRight); let content = utils.truncate(this.content, 10, this.truncate); if (!lineNum) { info(`${this.y}-${this.x}: ${this.rowSpan - lineNum}x${this.colSpan} Cell ${content}`); } else { } let padLen = Math.max(this.height - this.lines.length, 0); let padTop; switch (this.vAlign) { case "center": padTop = Math.ceil(padLen / 2); break; case "bottom": padTop = padLen; break; default: padTop = 0; } if (lineNum < padTop || lineNum >= padTop + this.lines.length) { return this.drawEmpty(this.drawRight, spanningCell); } let forceTruncation = this.lines.length > this.height && lineNum + 1 >= this.height; return this.drawLine(lineNum - padTop, this.drawRight, forceTruncation, spanningCell); } /** * Renders the top line of the cell. * @param drawRight - true if this method should render the right edge of the cell. * @returns {String} */ drawTop(drawRight) { let content = []; if (this.cells) { this.widths.forEach(function(width, index) { content.push(this._topLeftChar(index)); content.push(utils.repeat(this.chars[this.y == 0 ? "top" : "mid"], width)); }, this); } else { content.push(this._topLeftChar(0)); content.push(utils.repeat(this.chars[this.y == 0 ? "top" : "mid"], this.width)); } if (drawRight) { content.push(this.chars[this.y == 0 ? "topRight" : "rightMid"]); } return this.wrapWithStyleColors("border", content.join("")); } _topLeftChar(offset) { let x6 = this.x + offset; let leftChar; if (this.y == 0) { leftChar = x6 == 0 ? "topLeft" : offset == 0 ? "topMid" : "top"; } else { if (x6 == 0) { leftChar = "leftMid"; } else { leftChar = offset == 0 ? "midMid" : "bottomMid"; if (this.cells) { let spanAbove = this.cells[this.y - 1][x6] instanceof Cell.ColSpanCell; if (spanAbove) { leftChar = offset == 0 ? "topMid" : "mid"; } if (offset == 0) { let i5 = 1; while (this.cells[this.y][x6 - i5] instanceof Cell.ColSpanCell) { i5++; } if (this.cells[this.y][x6 - i5] instanceof Cell.RowSpanCell) { leftChar = "leftMid"; } } } } } return this.chars[leftChar]; } wrapWithStyleColors(styleProperty, content) { if (this[styleProperty] && this[styleProperty].length) { try { let colors = require_safe(); for (let i5 = this[styleProperty].length - 1; i5 >= 0; i5--) { colors = colors[this[styleProperty][i5]]; } return colors(content); } catch (e7) { return content; } } else { return content; } } /** * Renders a line of text. * @param lineNum - Which line of text to render. This is not necessarily the line within the cell. * There may be top-padding above the first line of text. * @param drawRight - true if this method should render the right edge of the cell. * @param forceTruncationSymbol - `true` if the rendered text should end with the truncation symbol even * if the text fits. This is used when the cell is vertically truncated. If `false` the text should * only include the truncation symbol if the text will not fit horizontally within the cell width. * @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined. * @returns {String} */ drawLine(lineNum, drawRight, forceTruncationSymbol, spanningCell) { let left2 = this.chars[this.x == 0 ? "left" : "middle"]; if (this.x && spanningCell && this.cells) { let cellLeft = this.cells[this.y + spanningCell][this.x - 1]; while (cellLeft instanceof ColSpanCell) { cellLeft = this.cells[cellLeft.y][cellLeft.x - 1]; } if (!(cellLeft instanceof RowSpanCell)) { left2 = this.chars["rightMid"]; } } let leftPadding = utils.repeat(" ", this.paddingLeft); let right2 = drawRight ? this.chars["right"] : ""; let rightPadding = utils.repeat(" ", this.paddingRight); let line = this.lines[lineNum]; let len = this.width - (this.paddingLeft + this.paddingRight); if (forceTruncationSymbol) line += this.truncate || "\u2026"; let content = utils.truncate(line, len, this.truncate); content = utils.pad(content, len, " ", this.hAlign); content = leftPadding + content + rightPadding; return this.stylizeLine(left2, content, right2); } stylizeLine(left2, content, right2) { left2 = this.wrapWithStyleColors("border", left2); right2 = this.wrapWithStyleColors("border", right2); if (this.y === 0) { content = this.wrapWithStyleColors("head", content); } return left2 + content + right2; } /** * Renders the bottom line of the cell. * @param drawRight - true if this method should render the right edge of the cell. * @returns {String} */ drawBottom(drawRight) { let left2 = this.chars[this.x == 0 ? "bottomLeft" : "bottomMid"]; let content = utils.repeat(this.chars.bottom, this.width); let right2 = drawRight ? this.chars["bottomRight"] : ""; return this.wrapWithStyleColors("border", left2 + content + right2); } /** * Renders a blank line of text within the cell. Used for top and/or bottom padding. * @param drawRight - true if this method should render the right edge of the cell. * @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined. * @returns {String} */ drawEmpty(drawRight, spanningCell) { let left2 = this.chars[this.x == 0 ? "left" : "middle"]; if (this.x && spanningCell && this.cells) { let cellLeft = this.cells[this.y + spanningCell][this.x - 1]; while (cellLeft instanceof ColSpanCell) { cellLeft = this.cells[cellLeft.y][cellLeft.x - 1]; } if (!(cellLeft instanceof RowSpanCell)) { left2 = this.chars["rightMid"]; } } let right2 = drawRight ? this.chars["right"] : ""; let content = utils.repeat(" ", this.width); return this.stylizeLine(left2, content, right2); } }; __name(Cell, "Cell"); var ColSpanCell = class { /** * A Cell that doesn't do anything. It just draws empty lines. * Used as a placeholder in column spanning. * @constructor */ constructor() { } draw(lineNum) { if (typeof lineNum === "number") { debug(`${this.y}-${this.x}: 1x1 ColSpanCell`); } return ""; } init() { } mergeTableOptions() { } }; __name(ColSpanCell, "ColSpanCell"); var RowSpanCell = class { /** * A placeholder Cell for a Cell that spans multiple rows. * It delegates rendering to the original cell, but adds the appropriate offset. * @param originalCell * @constructor */ constructor(originalCell) { this.originalCell = originalCell; } init(tableOptions) { let y4 = this.y; let originalY = this.originalCell.y; this.cellOffset = y4 - originalY; this.offset = findDimension(tableOptions.rowHeights, originalY, this.cellOffset); } draw(lineNum) { if (lineNum == "top") { return this.originalCell.draw(this.offset, this.cellOffset); } if (lineNum == "bottom") { return this.originalCell.draw("bottom"); } debug(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`); return this.originalCell.draw(this.offset + 1 + lineNum); } mergeTableOptions() { } }; __name(RowSpanCell, "RowSpanCell"); function firstDefined(...args) { return args.filter((v7) => v7 !== void 0 && v7 !== null).shift(); } __name(firstDefined, "firstDefined"); function setOption(objA, objB, nameB, targetObj) { let nameA = nameB.split("-"); if (nameA.length > 1) { nameA[1] = nameA[1].charAt(0).toUpperCase() + nameA[1].substr(1); nameA = nameA.join(""); targetObj[nameA] = firstDefined(objA[nameA], objA[nameB], objB[nameA], objB[nameB]); } else { targetObj[nameB] = firstDefined(objA[nameB], objB[nameB]); } } __name(setOption, "setOption"); function findDimension(dimensionTable, startingIndex, span) { let ret = dimensionTable[startingIndex]; for (let i5 = 1; i5 < span; i5++) { ret += 1 + dimensionTable[startingIndex + i5]; } return ret; } __name(findDimension, "findDimension"); function sumPlusOne(a5, b6) { return a5 + b6 + 1; } __name(sumPlusOne, "sumPlusOne"); var CHAR_NAMES = [ "top", "top-mid", "top-left", "top-right", "bottom", "bottom-mid", "bottom-left", "bottom-right", "left", "left-mid", "mid", "mid-mid", "right", "right-mid", "middle" ]; module3.exports = Cell; module3.exports.ColSpanCell = ColSpanCell; module3.exports.RowSpanCell = RowSpanCell; } }); // ../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/layout-manager.js var require_layout_manager = __commonJS({ "../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/layout-manager.js"(exports2, module3) { init_import_meta_url(); var { warn: warn2, debug } = require_debug(); var Cell = require_cell(); var { ColSpanCell, RowSpanCell } = Cell; (function() { function next(alloc, col) { if (alloc[col] > 0) { return next(alloc, col + 1); } return col; } __name(next, "next"); function layoutTable(table) { let alloc = {}; table.forEach(function(row, rowIndex) { let col = 0; row.forEach(function(cell) { cell.y = rowIndex; cell.x = rowIndex ? next(alloc, col) : col; const rowSpan = cell.rowSpan || 1; const colSpan = cell.colSpan || 1; if (rowSpan > 1) { for (let cs3 = 0; cs3 < colSpan; cs3++) { alloc[cell.x + cs3] = rowSpan; } } col = cell.x + colSpan; }); Object.keys(alloc).forEach((idx) => { alloc[idx]--; if (alloc[idx] < 1) delete alloc[idx]; }); }); } __name(layoutTable, "layoutTable"); function maxWidth(table) { let mw = 0; table.forEach(function(row) { row.forEach(function(cell) { mw = Math.max(mw, cell.x + (cell.colSpan || 1)); }); }); return mw; } __name(maxWidth, "maxWidth"); function maxHeight(table) { return table.length; } __name(maxHeight, "maxHeight"); function cellsConflict(cell1, cell2) { let yMin1 = cell1.y; let yMax1 = cell1.y - 1 + (cell1.rowSpan || 1); let yMin2 = cell2.y; let yMax2 = cell2.y - 1 + (cell2.rowSpan || 1); let yConflict = !(yMin1 > yMax2 || yMin2 > yMax1); let xMin1 = cell1.x; let xMax1 = cell1.x - 1 + (cell1.colSpan || 1); let xMin2 = cell2.x; let xMax2 = cell2.x - 1 + (cell2.colSpan || 1); let xConflict = !(xMin1 > xMax2 || xMin2 > xMax1); return yConflict && xConflict; } __name(cellsConflict, "cellsConflict"); function conflictExists(rows, x6, y4) { let i_max = Math.min(rows.length - 1, y4); let cell = { x: x6, y: y4 }; for (let i5 = 0; i5 <= i_max; i5++) { let row = rows[i5]; for (let j6 = 0; j6 < row.length; j6++) { if (cellsConflict(cell, row[j6])) { return true; } } } return false; } __name(conflictExists, "conflictExists"); function allBlank(rows, y4, xMin, xMax) { for (let x6 = xMin; x6 < xMax; x6++) { if (conflictExists(rows, x6, y4)) { return false; } } return true; } __name(allBlank, "allBlank"); function addRowSpanCells(table) { table.forEach(function(row, rowIndex) { row.forEach(function(cell) { for (let i5 = 1; i5 < cell.rowSpan; i5++) { let rowSpanCell = new RowSpanCell(cell); rowSpanCell.x = cell.x; rowSpanCell.y = cell.y + i5; rowSpanCell.colSpan = cell.colSpan; insertCell(rowSpanCell, table[rowIndex + i5]); } }); }); } __name(addRowSpanCells, "addRowSpanCells"); function addColSpanCells(cellRows) { for (let rowIndex = cellRows.length - 1; rowIndex >= 0; rowIndex--) { let cellColumns = cellRows[rowIndex]; for (let columnIndex = 0; columnIndex < cellColumns.length; columnIndex++) { let cell = cellColumns[columnIndex]; for (let k6 = 1; k6 < cell.colSpan; k6++) { let colSpanCell = new ColSpanCell(); colSpanCell.x = cell.x + k6; colSpanCell.y = cell.y; cellColumns.splice(columnIndex + 1, 0, colSpanCell); } } } } __name(addColSpanCells, "addColSpanCells"); function insertCell(cell, row) { let x6 = 0; while (x6 < row.length && row[x6].x < cell.x) { x6++; } row.splice(x6, 0, cell); } __name(insertCell, "insertCell"); function fillInTable(table) { let h_max = maxHeight(table); let w_max = maxWidth(table); debug(`Max rows: ${h_max}; Max cols: ${w_max}`); for (let y4 = 0; y4 < h_max; y4++) { for (let x6 = 0; x6 < w_max; x6++) { if (!conflictExists(table, x6, y4)) { let opts = { x: x6, y: y4, colSpan: 1, rowSpan: 1 }; x6++; while (x6 < w_max && !conflictExists(table, x6, y4)) { opts.colSpan++; x6++; } let y22 = y4 + 1; while (y22 < h_max && allBlank(table, y22, opts.x, opts.x + opts.colSpan)) { opts.rowSpan++; y22++; } let cell = new Cell(opts); cell.x = opts.x; cell.y = opts.y; warn2(`Missing cell at ${cell.y}-${cell.x}.`); insertCell(cell, table[y4]); } } } } __name(fillInTable, "fillInTable"); function generateCells(rows) { return rows.map(function(row) { if (!Array.isArray(row)) { let key = Object.keys(row)[0]; row = row[key]; if (Array.isArray(row)) { row = row.slice(); row.unshift(key); } else { row = [key, row]; } } return row.map(function(cell) { return new Cell(cell); }); }); } __name(generateCells, "generateCells"); function makeTableLayout(rows) { let cellRows = generateCells(rows); layoutTable(cellRows); fillInTable(cellRows); addRowSpanCells(cellRows); addColSpanCells(cellRows); return cellRows; } __name(makeTableLayout, "makeTableLayout"); module3.exports = { makeTableLayout, layoutTable, addRowSpanCells, maxWidth, fillInTable, computeWidths: makeComputeWidths("colSpan", "desiredWidth", "x", 1), computeHeights: makeComputeWidths("rowSpan", "desiredHeight", "y", 1) }; })(); function makeComputeWidths(colSpan, desiredWidth, x6, forcedMin) { return function(vals, table) { let result = []; let spanners = []; let auto = {}; table.forEach(function(row) { row.forEach(function(cell) { if ((cell[colSpan] || 1) > 1) { spanners.push(cell); } else { result[cell[x6]] = Math.max(result[cell[x6]] || 0, cell[desiredWidth] || 0, forcedMin); } }); }); vals.forEach(function(val2, index) { if (typeof val2 === "number") { result[index] = val2; } }); for (let k6 = spanners.length - 1; k6 >= 0; k6--) { let cell = spanners[k6]; let span = cell[colSpan]; let col = cell[x6]; let existingWidth = result[col]; let editableCols = typeof vals[col] === "number" ? 0 : 1; if (typeof existingWidth === "number") { for (let i5 = 1; i5 < span; i5++) { existingWidth += 1 + result[col + i5]; if (typeof vals[col + i5] !== "number") { editableCols++; } } } else { existingWidth = desiredWidth === "desiredWidth" ? cell.desiredWidth - 1 : 1; if (!auto[col] || auto[col] < existingWidth) { auto[col] = existingWidth; } } if (cell[desiredWidth] > existingWidth) { let i5 = 0; while (editableCols > 0 && cell[desiredWidth] > existingWidth) { if (typeof vals[col + i5] !== "number") { let dif = Math.round((cell[desiredWidth] - existingWidth) / editableCols); existingWidth += dif; result[col + i5] += dif; editableCols--; } i5++; } } } Object.assign(vals, result, auto); for (let j6 = 0; j6 < vals.length; j6++) { vals[j6] = Math.max(forcedMin, vals[j6] || 0); } }; } __name(makeComputeWidths, "makeComputeWidths"); } }); // ../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/table.js var require_table = __commonJS({ "../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/table.js"(exports2, module3) { init_import_meta_url(); var debug = require_debug(); var utils = require_utils2(); var tableLayout = require_layout_manager(); var Table2 = class extends Array { constructor(opts) { super(); const options32 = utils.mergeOptions(opts); Object.defineProperty(this, "options", { value: options32, enumerable: options32.debug }); if (options32.debug) { switch (typeof options32.debug) { case "boolean": debug.setDebugLevel(debug.WARN); break; case "number": debug.setDebugLevel(options32.debug); break; case "string": debug.setDebugLevel(parseInt(options32.debug, 10)); break; default: debug.setDebugLevel(debug.WARN); debug.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof options32.debug}`); } Object.defineProperty(this, "messages", { get() { return debug.debugMessages(); } }); } } toString() { let array = this; let headersPresent = this.options.head && this.options.head.length; if (headersPresent) { array = [this.options.head]; if (this.length) { array.push.apply(array, this); } } else { this.options.style.head = []; } let cells = tableLayout.makeTableLayout(array); cells.forEach(function(row) { row.forEach(function(cell) { cell.mergeTableOptions(this.options, cells); }, this); }, this); tableLayout.computeWidths(this.options.colWidths, cells); tableLayout.computeHeights(this.options.rowHeights, cells); cells.forEach(function(row) { row.forEach(function(cell) { cell.init(this.options); }, this); }, this); let result = []; for (let rowIndex = 0; rowIndex < cells.length; rowIndex++) { let row = cells[rowIndex]; let heightOfRow = this.options.rowHeights[rowIndex]; if (rowIndex === 0 || !this.options.style.compact || rowIndex == 1 && headersPresent) { doDraw(row, "top", result); } for (let lineNum = 0; lineNum < heightOfRow; lineNum++) { doDraw(row, lineNum, result); } if (rowIndex + 1 == cells.length) { doDraw(row, "bottom", result); } } return result.join("\n"); } get width() { let str = this.toString().split("\n"); return str[0].length; } }; __name(Table2, "Table"); Table2.reset = () => debug.reset(); function doDraw(row, lineNum, result) { let line = []; row.forEach(function(cell) { line.push(cell.draw(lineNum)); }); let str = line.join(""); if (str.length) result.push(str); } __name(doDraw, "doDraw"); module3.exports = Table2; } }); // ../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/index.js var require_cli_table3 = __commonJS({ "../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/index.js"(exports2, module3) { init_import_meta_url(); module3.exports = require_table(); } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/parser.js var require_parser = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/parser.js"(exports2, module3) { "use strict"; init_import_meta_url(); var ParserEND = 1114112; var ParserError = class extends Error { /* istanbul ignore next */ constructor(msg, filename, linenumber) { super("[ParserError] " + msg, filename, linenumber); this.name = "ParserError"; this.code = "ParserError"; if (Error.captureStackTrace) Error.captureStackTrace(this, ParserError); } }; __name(ParserError, "ParserError"); var State = class { constructor(parser2) { this.parser = parser2; this.buf = ""; this.returned = null; this.result = null; this.resultTable = null; this.resultArr = null; } }; __name(State, "State"); var Parser2 = class { constructor() { this.pos = 0; this.col = 0; this.line = 0; this.obj = {}; this.ctx = this.obj; this.stack = []; this._buf = ""; this.char = null; this.ii = 0; this.state = new State(this.parseStart); } parse(str) { if (str.length === 0 || str.length == null) return; this._buf = String(str); this.ii = -1; this.char = -1; let getNext; while (getNext === false || this.nextChar()) { getNext = this.runOne(); } this._buf = null; } nextChar() { if (this.char === 10) { ++this.line; this.col = -1; } ++this.ii; this.char = this._buf.codePointAt(this.ii); ++this.pos; ++this.col; return this.haveBuffer(); } haveBuffer() { return this.ii < this._buf.length; } runOne() { return this.state.parser.call(this, this.state.returned); } finish() { this.char = ParserEND; let last; do { last = this.state.parser; this.runOne(); } while (this.state.parser !== last); this.ctx = null; this.state = null; this._buf = null; return this.obj; } next(fn2) { if (typeof fn2 !== "function") throw new ParserError("Tried to set state to non-existent state: " + JSON.stringify(fn2)); this.state.parser = fn2; } goto(fn2) { this.next(fn2); return this.runOne(); } call(fn2, returnWith) { if (returnWith) this.next(returnWith); this.stack.push(this.state); this.state = new State(fn2); } callNow(fn2, returnWith) { this.call(fn2, returnWith); return this.runOne(); } return(value) { if (this.stack.length === 0) throw this.error(new ParserError("Stack underflow")); if (value === void 0) value = this.state.buf; this.state = this.stack.pop(); this.state.returned = value; } returnNow(value) { this.return(value); return this.runOne(); } consume() { if (this.char === ParserEND) throw this.error(new ParserError("Unexpected end-of-buffer")); this.state.buf += this._buf[this.ii]; } error(err) { err.line = this.line; err.col = this.col; err.pos = this.pos; return err; } /* istanbul ignore next */ parseStart() { throw new ParserError("Must declare a parseStart method"); } }; __name(Parser2, "Parser"); Parser2.END = ParserEND; Parser2.Error = ParserError; module3.exports = Parser2; } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime.js var require_create_datetime = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = (value) => { const date = new Date(value); if (isNaN(date)) { throw new TypeError("Invalid Datetime"); } else { return date; } }; } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/format-num.js var require_format_num = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/format-num.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = (d6, num) => { num = String(num); while (num.length < d6) num = "0" + num; return num; }; } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime-float.js var require_create_datetime_float = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime-float.js"(exports2, module3) { "use strict"; init_import_meta_url(); var f5 = require_format_num(); var FloatingDateTime = class extends Date { constructor(value) { super(value + "Z"); this.isFloating = true; } toISOString() { const date = `${this.getUTCFullYear()}-${f5(2, this.getUTCMonth() + 1)}-${f5(2, this.getUTCDate())}`; const time = `${f5(2, this.getUTCHours())}:${f5(2, this.getUTCMinutes())}:${f5(2, this.getUTCSeconds())}.${f5(3, this.getUTCMilliseconds())}`; return `${date}T${time}`; } }; __name(FloatingDateTime, "FloatingDateTime"); module3.exports = (value) => { const date = new FloatingDateTime(value); if (isNaN(date)) { throw new TypeError("Invalid Datetime"); } else { return date; } }; } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-date.js var require_create_date = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-date.js"(exports2, module3) { "use strict"; init_import_meta_url(); var f5 = require_format_num(); var DateTime = global.Date; var Date2 = class extends DateTime { constructor(value) { super(value); this.isDate = true; } toISOString() { return `${this.getUTCFullYear()}-${f5(2, this.getUTCMonth() + 1)}-${f5(2, this.getUTCDate())}`; } }; __name(Date2, "Date"); module3.exports = (value) => { const date = new Date2(value); if (isNaN(date)) { throw new TypeError("Invalid Datetime"); } else { return date; } }; } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-time.js var require_create_time = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-time.js"(exports2, module3) { "use strict"; init_import_meta_url(); var f5 = require_format_num(); var Time = class extends Date { constructor(value) { super(`0000-01-01T${value}Z`); this.isTime = true; } toISOString() { return `${f5(2, this.getUTCHours())}:${f5(2, this.getUTCMinutes())}:${f5(2, this.getUTCSeconds())}.${f5(3, this.getUTCMilliseconds())}`; } }; __name(Time, "Time"); module3.exports = (value) => { const date = new Time(value); if (isNaN(date)) { throw new TypeError("Invalid Datetime"); } else { return date; } }; } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/toml-parser.js var require_toml_parser = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/toml-parser.js"(exports, module) { "use strict"; init_import_meta_url(); module.exports = makeParserClass(require_parser()); module.exports.makeParserClass = makeParserClass; var TomlError = class extends Error { constructor(msg) { super(msg); this.name = "TomlError"; if (Error.captureStackTrace) Error.captureStackTrace(this, TomlError); this.fromTOML = true; this.wrapped = null; } }; __name(TomlError, "TomlError"); TomlError.wrap = (err) => { const terr = new TomlError(err.message); terr.code = err.code; terr.wrapped = err; return terr; }; module.exports.TomlError = TomlError; var createDateTime = require_create_datetime(); var createDateTimeFloat = require_create_datetime_float(); var createDate = require_create_date(); var createTime = require_create_time(); var CTRL_I = 9; var CTRL_J = 10; var CTRL_M = 13; var CTRL_CHAR_BOUNDARY = 31; var CHAR_SP = 32; var CHAR_QUOT = 34; var CHAR_NUM = 35; var CHAR_APOS = 39; var CHAR_PLUS = 43; var CHAR_COMMA = 44; var CHAR_HYPHEN = 45; var CHAR_PERIOD = 46; var CHAR_0 = 48; var CHAR_1 = 49; var CHAR_7 = 55; var CHAR_9 = 57; var CHAR_COLON = 58; var CHAR_EQUALS = 61; var CHAR_A = 65; var CHAR_E = 69; var CHAR_F = 70; var CHAR_T = 84; var CHAR_U = 85; var CHAR_Z = 90; var CHAR_LOWBAR = 95; var CHAR_a = 97; var CHAR_b = 98; var CHAR_e = 101; var CHAR_f = 102; var CHAR_i = 105; var CHAR_l = 108; var CHAR_n = 110; var CHAR_o = 111; var CHAR_r = 114; var CHAR_s = 115; var CHAR_t = 116; var CHAR_u = 117; var CHAR_x = 120; var CHAR_z = 122; var CHAR_LCUB = 123; var CHAR_RCUB = 125; var CHAR_LSQB = 91; var CHAR_BSOL = 92; var CHAR_RSQB = 93; var CHAR_DEL = 127; var SURROGATE_FIRST = 55296; var SURROGATE_LAST = 57343; var escapes = { [CHAR_b]: "\b", [CHAR_t]: " ", [CHAR_n]: "\n", [CHAR_f]: "\f", [CHAR_r]: "\r", [CHAR_QUOT]: '"', [CHAR_BSOL]: "\\" }; function isDigit(cp3) { return cp3 >= CHAR_0 && cp3 <= CHAR_9; } __name(isDigit, "isDigit"); function isHexit(cp3) { return cp3 >= CHAR_A && cp3 <= CHAR_F || cp3 >= CHAR_a && cp3 <= CHAR_f || cp3 >= CHAR_0 && cp3 <= CHAR_9; } __name(isHexit, "isHexit"); function isBit(cp3) { return cp3 === CHAR_1 || cp3 === CHAR_0; } __name(isBit, "isBit"); function isOctit(cp3) { return cp3 >= CHAR_0 && cp3 <= CHAR_7; } __name(isOctit, "isOctit"); function isAlphaNumQuoteHyphen(cp3) { return cp3 >= CHAR_A && cp3 <= CHAR_Z || cp3 >= CHAR_a && cp3 <= CHAR_z || cp3 >= CHAR_0 && cp3 <= CHAR_9 || cp3 === CHAR_APOS || cp3 === CHAR_QUOT || cp3 === CHAR_LOWBAR || cp3 === CHAR_HYPHEN; } __name(isAlphaNumQuoteHyphen, "isAlphaNumQuoteHyphen"); function isAlphaNumHyphen(cp3) { return cp3 >= CHAR_A && cp3 <= CHAR_Z || cp3 >= CHAR_a && cp3 <= CHAR_z || cp3 >= CHAR_0 && cp3 <= CHAR_9 || cp3 === CHAR_LOWBAR || cp3 === CHAR_HYPHEN; } __name(isAlphaNumHyphen, "isAlphaNumHyphen"); var _type = Symbol("type"); var _declared = Symbol("declared"); var hasOwnProperty = Object.prototype.hasOwnProperty; var defineProperty = Object.defineProperty; var descriptor = { configurable: true, enumerable: true, writable: true, value: void 0 }; function hasKey(obj, key) { if (hasOwnProperty.call(obj, key)) return true; if (key === "__proto__") defineProperty(obj, "__proto__", descriptor); return false; } __name(hasKey, "hasKey"); var INLINE_TABLE = Symbol("inline-table"); function InlineTable() { return Object.defineProperties({}, { [_type]: { value: INLINE_TABLE } }); } __name(InlineTable, "InlineTable"); function isInlineTable(obj) { if (obj === null || typeof obj !== "object") return false; return obj[_type] === INLINE_TABLE; } __name(isInlineTable, "isInlineTable"); var TABLE = Symbol("table"); function Table() { return Object.defineProperties({}, { [_type]: { value: TABLE }, [_declared]: { value: false, writable: true } }); } __name(Table, "Table"); function isTable(obj) { if (obj === null || typeof obj !== "object") return false; return obj[_type] === TABLE; } __name(isTable, "isTable"); var _contentType = Symbol("content-type"); var INLINE_LIST = Symbol("inline-list"); function InlineList(type) { return Object.defineProperties([], { [_type]: { value: INLINE_LIST }, [_contentType]: { value: type } }); } __name(InlineList, "InlineList"); function isInlineList(obj) { if (obj === null || typeof obj !== "object") return false; return obj[_type] === INLINE_LIST; } __name(isInlineList, "isInlineList"); var LIST = Symbol("list"); function List() { return Object.defineProperties([], { [_type]: { value: LIST } }); } __name(List, "List"); function isList(obj) { if (obj === null || typeof obj !== "object") return false; return obj[_type] === LIST; } __name(isList, "isList"); var _custom; try { const utilInspect = eval("require('util').inspect"); _custom = utilInspect.custom; } catch (_4) { } var _inspect = _custom || "inspect"; var BoxedBigInt = class { constructor(value) { try { this.value = global.BigInt.asIntN(64, value); } catch (_4) { this.value = null; } Object.defineProperty(this, _type, { value: INTEGER }); } isNaN() { return this.value === null; } /* istanbul ignore next */ toString() { return String(this.value); } /* istanbul ignore next */ [_inspect]() { return `[BigInt: ${this.toString()}]}`; } valueOf() { return this.value; } }; __name(BoxedBigInt, "BoxedBigInt"); var INTEGER = Symbol("integer"); function Integer(value) { let num = Number(value); if (Object.is(num, -0)) num = 0; if (global.BigInt && !Number.isSafeInteger(num)) { return new BoxedBigInt(value); } else { return Object.defineProperties(new Number(num), { isNaN: { value: function() { return isNaN(this); } }, [_type]: { value: INTEGER }, [_inspect]: { value: () => `[Integer: ${value}]` } }); } } __name(Integer, "Integer"); function isInteger(obj) { if (obj === null || typeof obj !== "object") return false; return obj[_type] === INTEGER; } __name(isInteger, "isInteger"); var FLOAT = Symbol("float"); function Float(value) { return Object.defineProperties(new Number(value), { [_type]: { value: FLOAT }, [_inspect]: { value: () => `[Float: ${value}]` } }); } __name(Float, "Float"); function isFloat(obj) { if (obj === null || typeof obj !== "object") return false; return obj[_type] === FLOAT; } __name(isFloat, "isFloat"); function tomlType(value) { const type = typeof value; if (type === "object") { if (value === null) return "null"; if (value instanceof Date) return "datetime"; if (_type in value) { switch (value[_type]) { case INLINE_TABLE: return "inline-table"; case INLINE_LIST: return "inline-list"; case TABLE: return "table"; case LIST: return "list"; case FLOAT: return "float"; case INTEGER: return "integer"; } } } return type; } __name(tomlType, "tomlType"); function makeParserClass(Parser2) { class TOMLParser extends Parser2 { constructor() { super(); this.ctx = this.obj = Table(); } /* MATCH HELPER */ atEndOfWord() { return this.char === CHAR_NUM || this.char === CTRL_I || this.char === CHAR_SP || this.atEndOfLine(); } atEndOfLine() { return this.char === Parser2.END || this.char === CTRL_J || this.char === CTRL_M; } parseStart() { if (this.char === Parser2.END) { return null; } else if (this.char === CHAR_LSQB) { return this.call(this.parseTableOrList); } else if (this.char === CHAR_NUM) { return this.call(this.parseComment); } else if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) { return null; } else if (isAlphaNumQuoteHyphen(this.char)) { return this.callNow(this.parseAssignStatement); } else { throw this.error(new TomlError(`Unknown character "${this.char}"`)); } } // HELPER, this strips any whitespace and comments to the end of the line // then RETURNS. Last state in a production. parseWhitespaceToEOL() { if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) { return null; } else if (this.char === CHAR_NUM) { return this.goto(this.parseComment); } else if (this.char === Parser2.END || this.char === CTRL_J) { return this.return(); } else { throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line")); } } /* ASSIGNMENT: key = value */ parseAssignStatement() { return this.callNow(this.parseAssign, this.recordAssignStatement); } recordAssignStatement(kv) { let target = this.ctx; let finalKey = kv.key.pop(); for (let kw of kv.key) { if (hasKey(target, kw) && !isTable(target[kw])) { throw this.error(new TomlError("Can't redefine existing key")); } target = target[kw] = target[kw] || Table(); } if (hasKey(target, finalKey)) { throw this.error(new TomlError("Can't redefine existing key")); } target[_declared] = true; if (isInteger(kv.value) || isFloat(kv.value)) { target[finalKey] = kv.value.valueOf(); } else { target[finalKey] = kv.value; } return this.goto(this.parseWhitespaceToEOL); } /* ASSSIGNMENT expression, key = value possibly inside an inline table */ parseAssign() { return this.callNow(this.parseKeyword, this.recordAssignKeyword); } recordAssignKeyword(key) { if (this.state.resultTable) { this.state.resultTable.push(key); } else { this.state.resultTable = [key]; } return this.goto(this.parseAssignKeywordPreDot); } parseAssignKeywordPreDot() { if (this.char === CHAR_PERIOD) { return this.next(this.parseAssignKeywordPostDot); } else if (this.char !== CHAR_SP && this.char !== CTRL_I) { return this.goto(this.parseAssignEqual); } } parseAssignKeywordPostDot() { if (this.char !== CHAR_SP && this.char !== CTRL_I) { return this.callNow(this.parseKeyword, this.recordAssignKeyword); } } parseAssignEqual() { if (this.char === CHAR_EQUALS) { return this.next(this.parseAssignPreValue); } else { throw this.error(new TomlError('Invalid character, expected "="')); } } parseAssignPreValue() { if (this.char === CHAR_SP || this.char === CTRL_I) { return null; } else { return this.callNow(this.parseValue, this.recordAssignValue); } } recordAssignValue(value) { return this.returnNow({ key: this.state.resultTable, value }); } /* COMMENTS: #...eol */ parseComment() { do { if (this.char === Parser2.END || this.char === CTRL_J) { return this.return(); } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) { throw this.errorControlCharIn("comments"); } } while (this.nextChar()); } /* TABLES AND LISTS, [foo] and [[foo]] */ parseTableOrList() { if (this.char === CHAR_LSQB) { this.next(this.parseList); } else { return this.goto(this.parseTable); } } /* TABLE [foo.bar.baz] */ parseTable() { this.ctx = this.obj; return this.goto(this.parseTableNext); } parseTableNext() { if (this.char === CHAR_SP || this.char === CTRL_I) { return null; } else { return this.callNow(this.parseKeyword, this.parseTableMore); } } parseTableMore(keyword) { if (this.char === CHAR_SP || this.char === CTRL_I) { return null; } else if (this.char === CHAR_RSQB) { if (hasKey(this.ctx, keyword) && (!isTable(this.ctx[keyword]) || this.ctx[keyword][_declared])) { throw this.error(new TomlError("Can't redefine existing key")); } else { this.ctx = this.ctx[keyword] = this.ctx[keyword] || Table(); this.ctx[_declared] = true; } return this.next(this.parseWhitespaceToEOL); } else if (this.char === CHAR_PERIOD) { if (!hasKey(this.ctx, keyword)) { this.ctx = this.ctx[keyword] = Table(); } else if (isTable(this.ctx[keyword])) { this.ctx = this.ctx[keyword]; } else if (isList(this.ctx[keyword])) { this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1]; } else { throw this.error(new TomlError("Can't redefine existing key")); } return this.next(this.parseTableNext); } else { throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]")); } } /* LIST [[a.b.c]] */ parseList() { this.ctx = this.obj; return this.goto(this.parseListNext); } parseListNext() { if (this.char === CHAR_SP || this.char === CTRL_I) { return null; } else { return this.callNow(this.parseKeyword, this.parseListMore); } } parseListMore(keyword) { if (this.char === CHAR_SP || this.char === CTRL_I) { return null; } else if (this.char === CHAR_RSQB) { if (!hasKey(this.ctx, keyword)) { this.ctx[keyword] = List(); } if (isInlineList(this.ctx[keyword])) { throw this.error(new TomlError("Can't extend an inline array")); } else if (isList(this.ctx[keyword])) { const next = Table(); this.ctx[keyword].push(next); this.ctx = next; } else { throw this.error(new TomlError("Can't redefine an existing key")); } return this.next(this.parseListEnd); } else if (this.char === CHAR_PERIOD) { if (!hasKey(this.ctx, keyword)) { this.ctx = this.ctx[keyword] = Table(); } else if (isInlineList(this.ctx[keyword])) { throw this.error(new TomlError("Can't extend an inline array")); } else if (isInlineTable(this.ctx[keyword])) { throw this.error(new TomlError("Can't extend an inline table")); } else if (isList(this.ctx[keyword])) { this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1]; } else if (isTable(this.ctx[keyword])) { this.ctx = this.ctx[keyword]; } else { throw this.error(new TomlError("Can't redefine an existing key")); } return this.next(this.parseListNext); } else { throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]")); } } parseListEnd(keyword) { if (this.char === CHAR_RSQB) { return this.next(this.parseWhitespaceToEOL); } else { throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]")); } } /* VALUE string, number, boolean, inline list, inline object */ parseValue() { if (this.char === Parser2.END) { throw this.error(new TomlError("Key without value")); } else if (this.char === CHAR_QUOT) { return this.next(this.parseDoubleString); } if (this.char === CHAR_APOS) { return this.next(this.parseSingleString); } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) { return this.goto(this.parseNumberSign); } else if (this.char === CHAR_i) { return this.next(this.parseInf); } else if (this.char === CHAR_n) { return this.next(this.parseNan); } else if (isDigit(this.char)) { return this.goto(this.parseNumberOrDateTime); } else if (this.char === CHAR_t || this.char === CHAR_f) { return this.goto(this.parseBoolean); } else if (this.char === CHAR_LSQB) { return this.call(this.parseInlineList, this.recordValue); } else if (this.char === CHAR_LCUB) { return this.call(this.parseInlineTable, this.recordValue); } else { throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table")); } } recordValue(value) { return this.returnNow(value); } parseInf() { if (this.char === CHAR_n) { return this.next(this.parseInf2); } else { throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"')); } } parseInf2() { if (this.char === CHAR_f) { if (this.state.buf === "-") { return this.return(-Infinity); } else { return this.return(Infinity); } } else { throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"')); } } parseNan() { if (this.char === CHAR_a) { return this.next(this.parseNan2); } else { throw this.error(new TomlError('Unexpected character, expected "nan"')); } } parseNan2() { if (this.char === CHAR_n) { return this.return(NaN); } else { throw this.error(new TomlError('Unexpected character, expected "nan"')); } } /* KEYS, barewords or basic, literal, or dotted */ parseKeyword() { if (this.char === CHAR_QUOT) { return this.next(this.parseBasicString); } else if (this.char === CHAR_APOS) { return this.next(this.parseLiteralString); } else { return this.goto(this.parseBareKey); } } /* KEYS: barewords */ parseBareKey() { do { if (this.char === Parser2.END) { throw this.error(new TomlError("Key ended without value")); } else if (isAlphaNumHyphen(this.char)) { this.consume(); } else if (this.state.buf.length === 0) { throw this.error(new TomlError("Empty bare keys are not allowed")); } else { return this.returnNow(); } } while (this.nextChar()); } /* STRINGS, single quoted (literal) */ parseSingleString() { if (this.char === CHAR_APOS) { return this.next(this.parseLiteralMultiStringMaybe); } else { return this.goto(this.parseLiteralString); } } parseLiteralString() { do { if (this.char === CHAR_APOS) { return this.return(); } else if (this.atEndOfLine()) { throw this.error(new TomlError("Unterminated string")); } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) { throw this.errorControlCharIn("strings"); } else { this.consume(); } } while (this.nextChar()); } parseLiteralMultiStringMaybe() { if (this.char === CHAR_APOS) { return this.next(this.parseLiteralMultiString); } else { return this.returnNow(); } } parseLiteralMultiString() { if (this.char === CTRL_M) { return null; } else if (this.char === CTRL_J) { return this.next(this.parseLiteralMultiStringContent); } else { return this.goto(this.parseLiteralMultiStringContent); } } parseLiteralMultiStringContent() { do { if (this.char === CHAR_APOS) { return this.next(this.parseLiteralMultiEnd); } else if (this.char === Parser2.END) { throw this.error(new TomlError("Unterminated multi-line string")); } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M) { throw this.errorControlCharIn("strings"); } else { this.consume(); } } while (this.nextChar()); } parseLiteralMultiEnd() { if (this.char === CHAR_APOS) { return this.next(this.parseLiteralMultiEnd2); } else { this.state.buf += "'"; return this.goto(this.parseLiteralMultiStringContent); } } parseLiteralMultiEnd2() { if (this.char === CHAR_APOS) { return this.next(this.parseLiteralMultiEnd3); } else { this.state.buf += "''"; return this.goto(this.parseLiteralMultiStringContent); } } parseLiteralMultiEnd3() { if (this.char === CHAR_APOS) { this.state.buf += "'"; return this.next(this.parseLiteralMultiEnd4); } else { return this.returnNow(); } } parseLiteralMultiEnd4() { if (this.char === CHAR_APOS) { this.state.buf += "'"; return this.return(); } else { return this.returnNow(); } } /* STRINGS double quoted */ parseDoubleString() { if (this.char === CHAR_QUOT) { return this.next(this.parseMultiStringMaybe); } else { return this.goto(this.parseBasicString); } } parseBasicString() { do { if (this.char === CHAR_BSOL) { return this.call(this.parseEscape, this.recordEscapeReplacement); } else if (this.char === CHAR_QUOT) { return this.return(); } else if (this.atEndOfLine()) { throw this.error(new TomlError("Unterminated string")); } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) { throw this.errorControlCharIn("strings"); } else { this.consume(); } } while (this.nextChar()); } recordEscapeReplacement(replacement) { this.state.buf += replacement; return this.goto(this.parseBasicString); } parseMultiStringMaybe() { if (this.char === CHAR_QUOT) { return this.next(this.parseMultiString); } else { return this.returnNow(); } } parseMultiString() { if (this.char === CTRL_M) { return null; } else if (this.char === CTRL_J) { return this.next(this.parseMultiStringContent); } else { return this.goto(this.parseMultiStringContent); } } parseMultiStringContent() { do { if (this.char === CHAR_BSOL) { return this.call(this.parseMultiEscape, this.recordMultiEscapeReplacement); } else if (this.char === CHAR_QUOT) { return this.next(this.parseMultiEnd); } else if (this.char === Parser2.END) { throw this.error(new TomlError("Unterminated multi-line string")); } else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M) { throw this.errorControlCharIn("strings"); } else { this.consume(); } } while (this.nextChar()); } errorControlCharIn(type) { let displayCode = "\\u00"; if (this.char < 16) { displayCode += "0"; } displayCode += this.char.toString(16); return this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in ${type}, use ${displayCode} instead`)); } recordMultiEscapeReplacement(replacement) { this.state.buf += replacement; return this.goto(this.parseMultiStringContent); } parseMultiEnd() { if (this.char === CHAR_QUOT) { return this.next(this.parseMultiEnd2); } else { this.state.buf += '"'; return this.goto(this.parseMultiStringContent); } } parseMultiEnd2() { if (this.char === CHAR_QUOT) { return this.next(this.parseMultiEnd3); } else { this.state.buf += '""'; return this.goto(this.parseMultiStringContent); } } parseMultiEnd3() { if (this.char === CHAR_QUOT) { this.state.buf += '"'; return this.next(this.parseMultiEnd4); } else { return this.returnNow(); } } parseMultiEnd4() { if (this.char === CHAR_QUOT) { this.state.buf += '"'; return this.return(); } else { return this.returnNow(); } } parseMultiEscape() { if (this.char === CTRL_M || this.char === CTRL_J) { return this.next(this.parseMultiTrim); } else if (this.char === CHAR_SP || this.char === CTRL_I) { return this.next(this.parsePreMultiTrim); } else { return this.goto(this.parseEscape); } } parsePreMultiTrim() { if (this.char === CHAR_SP || this.char === CTRL_I) { return null; } else if (this.char === CTRL_M || this.char === CTRL_J) { return this.next(this.parseMultiTrim); } else { throw this.error(new TomlError("Can't escape whitespace")); } } parseMultiTrim() { if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) { return null; } else { return this.returnNow(); } } parseEscape() { if (this.char in escapes) { return this.return(escapes[this.char]); } else if (this.char === CHAR_u) { return this.call(this.parseSmallUnicode, this.parseUnicodeReturn); } else if (this.char === CHAR_U) { return this.call(this.parseLargeUnicode, this.parseUnicodeReturn); } else { throw this.error(new TomlError("Unknown escape character: " + this.char)); } } parseUnicodeReturn(char) { try { const codePoint = parseInt(char, 16); if (codePoint >= SURROGATE_FIRST && codePoint <= SURROGATE_LAST) { throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved")); } return this.returnNow(String.fromCodePoint(codePoint)); } catch (err) { throw this.error(TomlError.wrap(err)); } } parseSmallUnicode() { if (!isHexit(this.char)) { throw this.error(new TomlError("Invalid character in unicode sequence, expected hex")); } else { this.consume(); if (this.state.buf.length >= 4) return this.return(); } } parseLargeUnicode() { if (!isHexit(this.char)) { throw this.error(new TomlError("Invalid character in unicode sequence, expected hex")); } else { this.consume(); if (this.state.buf.length >= 8) return this.return(); } } /* NUMBERS */ parseNumberSign() { this.consume(); return this.next(this.parseMaybeSignedInfOrNan); } parseMaybeSignedInfOrNan() { if (this.char === CHAR_i) { return this.next(this.parseInf); } else if (this.char === CHAR_n) { return this.next(this.parseNan); } else { return this.callNow(this.parseNoUnder, this.parseNumberIntegerStart); } } parseNumberIntegerStart() { if (this.char === CHAR_0) { this.consume(); return this.next(this.parseNumberIntegerExponentOrDecimal); } else { return this.goto(this.parseNumberInteger); } } parseNumberIntegerExponentOrDecimal() { if (this.char === CHAR_PERIOD) { this.consume(); return this.call(this.parseNoUnder, this.parseNumberFloat); } else if (this.char === CHAR_E || this.char === CHAR_e) { this.consume(); return this.next(this.parseNumberExponentSign); } else { return this.returnNow(Integer(this.state.buf)); } } parseNumberInteger() { if (isDigit(this.char)) { this.consume(); } else if (this.char === CHAR_LOWBAR) { return this.call(this.parseNoUnder); } else if (this.char === CHAR_E || this.char === CHAR_e) { this.consume(); return this.next(this.parseNumberExponentSign); } else if (this.char === CHAR_PERIOD) { this.consume(); return this.call(this.parseNoUnder, this.parseNumberFloat); } else { const result = Integer(this.state.buf); if (result.isNaN()) { throw this.error(new TomlError("Invalid number")); } else { return this.returnNow(result); } } } parseNoUnder() { if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD || this.char === CHAR_E || this.char === CHAR_e) { throw this.error(new TomlError("Unexpected character, expected digit")); } else if (this.atEndOfWord()) { throw this.error(new TomlError("Incomplete number")); } return this.returnNow(); } parseNoUnderHexOctBinLiteral() { if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD) { throw this.error(new TomlError("Unexpected character, expected digit")); } else if (this.atEndOfWord()) { throw this.error(new TomlError("Incomplete number")); } return this.returnNow(); } parseNumberFloat() { if (this.char === CHAR_LOWBAR) { return this.call(this.parseNoUnder, this.parseNumberFloat); } else if (isDigit(this.char)) { this.consume(); } else if (this.char === CHAR_E || this.char === CHAR_e) { this.consume(); return this.next(this.parseNumberExponentSign); } else { return this.returnNow(Float(this.state.buf)); } } parseNumberExponentSign() { if (isDigit(this.char)) { return this.goto(this.parseNumberExponent); } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) { this.consume(); this.call(this.parseNoUnder, this.parseNumberExponent); } else { throw this.error(new TomlError("Unexpected character, expected -, + or digit")); } } parseNumberExponent() { if (isDigit(this.char)) { this.consume(); } else if (this.char === CHAR_LOWBAR) { return this.call(this.parseNoUnder); } else { return this.returnNow(Float(this.state.buf)); } } /* NUMBERS or DATETIMES */ parseNumberOrDateTime() { if (this.char === CHAR_0) { this.consume(); return this.next(this.parseNumberBaseOrDateTime); } else { return this.goto(this.parseNumberOrDateTimeOnly); } } parseNumberOrDateTimeOnly() { if (this.char === CHAR_LOWBAR) { return this.call(this.parseNoUnder, this.parseNumberInteger); } else if (isDigit(this.char)) { this.consume(); if (this.state.buf.length > 4) this.next(this.parseNumberInteger); } else if (this.char === CHAR_E || this.char === CHAR_e) { this.consume(); return this.next(this.parseNumberExponentSign); } else if (this.char === CHAR_PERIOD) { this.consume(); return this.call(this.parseNoUnder, this.parseNumberFloat); } else if (this.char === CHAR_HYPHEN) { return this.goto(this.parseDateTime); } else if (this.char === CHAR_COLON) { return this.goto(this.parseOnlyTimeHour); } else { return this.returnNow(Integer(this.state.buf)); } } parseDateTimeOnly() { if (this.state.buf.length < 4) { if (isDigit(this.char)) { return this.consume(); } else if (this.char === CHAR_COLON) { return this.goto(this.parseOnlyTimeHour); } else { throw this.error(new TomlError("Expected digit while parsing year part of a date")); } } else { if (this.char === CHAR_HYPHEN) { return this.goto(this.parseDateTime); } else { throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date")); } } } parseNumberBaseOrDateTime() { if (this.char === CHAR_b) { this.consume(); return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerBin); } else if (this.char === CHAR_o) { this.consume(); return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerOct); } else if (this.char === CHAR_x) { this.consume(); return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerHex); } else if (this.char === CHAR_PERIOD) { return this.goto(this.parseNumberInteger); } else if (isDigit(this.char)) { return this.goto(this.parseDateTimeOnly); } else { return this.returnNow(Integer(this.state.buf)); } } parseIntegerHex() { if (isHexit(this.char)) { this.consume(); } else if (this.char === CHAR_LOWBAR) { return this.call(this.parseNoUnderHexOctBinLiteral); } else { const result = Integer(this.state.buf); if (result.isNaN()) { throw this.error(new TomlError("Invalid number")); } else { return this.returnNow(result); } } } parseIntegerOct() { if (isOctit(this.char)) { this.consume(); } else if (this.char === CHAR_LOWBAR) { return this.call(this.parseNoUnderHexOctBinLiteral); } else { const result = Integer(this.state.buf); if (result.isNaN()) { throw this.error(new TomlError("Invalid number")); } else { return this.returnNow(result); } } } parseIntegerBin() { if (isBit(this.char)) { this.consume(); } else if (this.char === CHAR_LOWBAR) { return this.call(this.parseNoUnderHexOctBinLiteral); } else { const result = Integer(this.state.buf); if (result.isNaN()) { throw this.error(new TomlError("Invalid number")); } else { return this.returnNow(result); } } } /* DATETIME */ parseDateTime() { if (this.state.buf.length < 4) { throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters")); } this.state.result = this.state.buf; this.state.buf = ""; return this.next(this.parseDateMonth); } parseDateMonth() { if (this.char === CHAR_HYPHEN) { if (this.state.buf.length < 2) { throw this.error(new TomlError("Months less than 10 must be zero padded to two characters")); } this.state.result += "-" + this.state.buf; this.state.buf = ""; return this.next(this.parseDateDay); } else if (isDigit(this.char)) { this.consume(); } else { throw this.error(new TomlError("Incomplete datetime")); } } parseDateDay() { if (this.char === CHAR_T || this.char === CHAR_SP) { if (this.state.buf.length < 2) { throw this.error(new TomlError("Days less than 10 must be zero padded to two characters")); } this.state.result += "-" + this.state.buf; this.state.buf = ""; return this.next(this.parseStartTimeHour); } else if (this.atEndOfWord()) { return this.returnNow(createDate(this.state.result + "-" + this.state.buf)); } else if (isDigit(this.char)) { this.consume(); } else { throw this.error(new TomlError("Incomplete datetime")); } } parseStartTimeHour() { if (this.atEndOfWord()) { return this.returnNow(createDate(this.state.result)); } else { return this.goto(this.parseTimeHour); } } parseTimeHour() { if (this.char === CHAR_COLON) { if (this.state.buf.length < 2) { throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters")); } this.state.result += "T" + this.state.buf; this.state.buf = ""; return this.next(this.parseTimeMin); } else if (isDigit(this.char)) { this.consume(); } else { throw this.error(new TomlError("Incomplete datetime")); } } parseTimeMin() { if (this.state.buf.length < 2 && isDigit(this.char)) { this.consume(); } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) { this.state.result += ":" + this.state.buf; this.state.buf = ""; return this.next(this.parseTimeSec); } else { throw this.error(new TomlError("Incomplete datetime")); } } parseTimeSec() { if (isDigit(this.char)) { this.consume(); if (this.state.buf.length === 2) { this.state.result += ":" + this.state.buf; this.state.buf = ""; return this.next(this.parseTimeZoneOrFraction); } } else { throw this.error(new TomlError("Incomplete datetime")); } } parseOnlyTimeHour() { if (this.char === CHAR_COLON) { if (this.state.buf.length < 2) { throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters")); } this.state.result = this.state.buf; this.state.buf = ""; return this.next(this.parseOnlyTimeMin); } else { throw this.error(new TomlError("Incomplete time")); } } parseOnlyTimeMin() { if (this.state.buf.length < 2 && isDigit(this.char)) { this.consume(); } else if (this.state.buf.length === 2 && this.char === CHAR_COLON) { this.state.result += ":" + this.state.buf; this.state.buf = ""; return this.next(this.parseOnlyTimeSec); } else { throw this.error(new TomlError("Incomplete time")); } } parseOnlyTimeSec() { if (isDigit(this.char)) { this.consume(); if (this.state.buf.length === 2) { return this.next(this.parseOnlyTimeFractionMaybe); } } else { throw this.error(new TomlError("Incomplete time")); } } parseOnlyTimeFractionMaybe() { this.state.result += ":" + this.state.buf; if (this.char === CHAR_PERIOD) { this.state.buf = ""; this.next(this.parseOnlyTimeFraction); } else { return this.return(createTime(this.state.result)); } } parseOnlyTimeFraction() { if (isDigit(this.char)) { this.consume(); } else if (this.atEndOfWord()) { if (this.state.buf.length === 0) throw this.error(new TomlError("Expected digit in milliseconds")); return this.returnNow(createTime(this.state.result + "." + this.state.buf)); } else { throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z")); } } parseTimeZoneOrFraction() { if (this.char === CHAR_PERIOD) { this.consume(); this.next(this.parseDateTimeFraction); } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) { this.consume(); this.next(this.parseTimeZoneHour); } else if (this.char === CHAR_Z) { this.consume(); return this.return(createDateTime(this.state.result + this.state.buf)); } else if (this.atEndOfWord()) { return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf)); } else { throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z")); } } parseDateTimeFraction() { if (isDigit(this.char)) { this.consume(); } else if (this.state.buf.length === 1) { throw this.error(new TomlError("Expected digit in milliseconds")); } else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) { this.consume(); this.next(this.parseTimeZoneHour); } else if (this.char === CHAR_Z) { this.consume(); return this.return(createDateTime(this.state.result + this.state.buf)); } else if (this.atEndOfWord()) { return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf)); } else { throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z")); } } parseTimeZoneHour() { if (isDigit(this.char)) { this.consume(); if (/\d\d$/.test(this.state.buf)) return this.next(this.parseTimeZoneSep); } else { throw this.error(new TomlError("Unexpected character in datetime, expected digit")); } } parseTimeZoneSep() { if (this.char === CHAR_COLON) { this.consume(); this.next(this.parseTimeZoneMin); } else { throw this.error(new TomlError("Unexpected character in datetime, expected colon")); } } parseTimeZoneMin() { if (isDigit(this.char)) { this.consume(); if (/\d\d$/.test(this.state.buf)) return this.return(createDateTime(this.state.result + this.state.buf)); } else { throw this.error(new TomlError("Unexpected character in datetime, expected digit")); } } /* BOOLEAN */ parseBoolean() { if (this.char === CHAR_t) { this.consume(); return this.next(this.parseTrue_r); } else if (this.char === CHAR_f) { this.consume(); return this.next(this.parseFalse_a); } } parseTrue_r() { if (this.char === CHAR_r) { this.consume(); return this.next(this.parseTrue_u); } else { throw this.error(new TomlError("Invalid boolean, expected true or false")); } } parseTrue_u() { if (this.char === CHAR_u) { this.consume(); return this.next(this.parseTrue_e); } else { throw this.error(new TomlError("Invalid boolean, expected true or false")); } } parseTrue_e() { if (this.char === CHAR_e) { return this.return(true); } else { throw this.error(new TomlError("Invalid boolean, expected true or false")); } } parseFalse_a() { if (this.char === CHAR_a) { this.consume(); return this.next(this.parseFalse_l); } else { throw this.error(new TomlError("Invalid boolean, expected true or false")); } } parseFalse_l() { if (this.char === CHAR_l) { this.consume(); return this.next(this.parseFalse_s); } else { throw this.error(new TomlError("Invalid boolean, expected true or false")); } } parseFalse_s() { if (this.char === CHAR_s) { this.consume(); return this.next(this.parseFalse_e); } else { throw this.error(new TomlError("Invalid boolean, expected true or false")); } } parseFalse_e() { if (this.char === CHAR_e) { return this.return(false); } else { throw this.error(new TomlError("Invalid boolean, expected true or false")); } } /* INLINE LISTS */ parseInlineList() { if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) { return null; } else if (this.char === Parser2.END) { throw this.error(new TomlError("Unterminated inline array")); } else if (this.char === CHAR_NUM) { return this.call(this.parseComment); } else if (this.char === CHAR_RSQB) { return this.return(this.state.resultArr || InlineList()); } else { return this.callNow(this.parseValue, this.recordInlineListValue); } } recordInlineListValue(value) { if (!this.state.resultArr) { this.state.resultArr = InlineList(tomlType(value)); } if (isFloat(value) || isInteger(value)) { this.state.resultArr.push(value.valueOf()); } else { this.state.resultArr.push(value); } return this.goto(this.parseInlineListNext); } parseInlineListNext() { if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) { return null; } else if (this.char === CHAR_NUM) { return this.call(this.parseComment); } else if (this.char === CHAR_COMMA) { return this.next(this.parseInlineList); } else if (this.char === CHAR_RSQB) { return this.goto(this.parseInlineList); } else { throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])")); } } /* INLINE TABLE */ parseInlineTable() { if (this.char === CHAR_SP || this.char === CTRL_I) { return null; } else if (this.char === Parser2.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) { throw this.error(new TomlError("Unterminated inline array")); } else if (this.char === CHAR_RCUB) { return this.return(this.state.resultTable || InlineTable()); } else { if (!this.state.resultTable) this.state.resultTable = InlineTable(); return this.callNow(this.parseAssign, this.recordInlineTableValue); } } recordInlineTableValue(kv) { let target = this.state.resultTable; let finalKey = kv.key.pop(); for (let kw of kv.key) { if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) { throw this.error(new TomlError("Can't redefine existing key")); } target = target[kw] = target[kw] || Table(); } if (hasKey(target, finalKey)) { throw this.error(new TomlError("Can't redefine existing key")); } if (isInteger(kv.value) || isFloat(kv.value)) { target[finalKey] = kv.value.valueOf(); } else { target[finalKey] = kv.value; } return this.goto(this.parseInlineTableNext); } parseInlineTableNext() { if (this.char === CHAR_SP || this.char === CTRL_I) { return null; } else if (this.char === Parser2.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) { throw this.error(new TomlError("Unterminated inline array")); } else if (this.char === CHAR_COMMA) { return this.next(this.parseInlineTablePostComma); } else if (this.char === CHAR_RCUB) { return this.goto(this.parseInlineTable); } else { throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])")); } } parseInlineTablePostComma() { if (this.char === CHAR_SP || this.char === CTRL_I) { return null; } else if (this.char === Parser2.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) { throw this.error(new TomlError("Unterminated inline array")); } else if (this.char === CHAR_COMMA) { throw this.error(new TomlError("Empty elements in inline tables are not permitted")); } else if (this.char === CHAR_RCUB) { throw this.error(new TomlError("Trailing commas in inline tables are not permitted")); } else { return this.goto(this.parseInlineTable); } } } __name(TOMLParser, "TOMLParser"); return TOMLParser; } __name(makeParserClass, "makeParserClass"); } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-pretty-error.js var require_parse_pretty_error = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-pretty-error.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = prettyError; function prettyError(err, buf) { if (err.pos == null || err.line == null) return err; let msg = err.message; msg += ` at row ${err.line + 1}, col ${err.col + 1}, pos ${err.pos}: `; if (buf && buf.split) { const lines = buf.split(/\n/); const lineNumWidth = String(Math.min(lines.length, err.line + 3)).length; let linePadding = " "; while (linePadding.length < lineNumWidth) linePadding += " "; for (let ii = Math.max(0, err.line - 1); ii < Math.min(lines.length, err.line + 2); ++ii) { let lineNum = String(ii + 1); if (lineNum.length < lineNumWidth) lineNum = " " + lineNum; if (err.line === ii) { msg += lineNum + "> " + lines[ii] + "\n"; msg += linePadding + " "; for (let hh = 0; hh < err.col; ++hh) { msg += " "; } msg += "^\n"; } else { msg += lineNum + ": " + lines[ii] + "\n"; } } } err.message = msg + "\n"; return err; } __name(prettyError, "prettyError"); } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-string.js var require_parse_string = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-string.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = parseString; var TOMLParser = require_toml_parser(); var prettyError = require_parse_pretty_error(); function parseString(str) { if (global.Buffer && global.Buffer.isBuffer(str)) { str = str.toString("utf8"); } const parser2 = new TOMLParser(); try { parser2.parse(str); return parser2.finish(); } catch (err) { throw prettyError(err, str); } } __name(parseString, "parseString"); } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-async.js var require_parse_async = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-async.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = parseAsync; var TOMLParser = require_toml_parser(); var prettyError = require_parse_pretty_error(); function parseAsync(str, opts) { if (!opts) opts = {}; const index = 0; const blocksize = opts.blocksize || 40960; const parser2 = new TOMLParser(); return new Promise((resolve25, reject) => { setImmediate(parseAsyncNext, index, blocksize, resolve25, reject); }); function parseAsyncNext(index2, blocksize2, resolve25, reject) { if (index2 >= str.length) { try { return resolve25(parser2.finish()); } catch (err) { return reject(prettyError(err, str)); } } try { parser2.parse(str.slice(index2, index2 + blocksize2)); setImmediate(parseAsyncNext, index2 + blocksize2, blocksize2, resolve25, reject); } catch (err) { reject(prettyError(err, str)); } } __name(parseAsyncNext, "parseAsyncNext"); } __name(parseAsync, "parseAsync"); } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-stream.js var require_parse_stream = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-stream.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = parseStream; var stream2 = require("stream"); var TOMLParser = require_toml_parser(); function parseStream(stm) { if (stm) { return parseReadable(stm); } else { return parseTransform2(stm); } } __name(parseStream, "parseStream"); function parseReadable(stm) { const parser2 = new TOMLParser(); stm.setEncoding("utf8"); return new Promise((resolve25, reject) => { let readable; let ended = false; let errored = false; function finish() { ended = true; if (readable) return; try { resolve25(parser2.finish()); } catch (err) { reject(err); } } __name(finish, "finish"); function error2(err) { errored = true; reject(err); } __name(error2, "error"); stm.once("end", finish); stm.once("error", error2); readNext(); function readNext() { readable = true; let data; while ((data = stm.read()) !== null) { try { parser2.parse(data); } catch (err) { return error2(err); } } readable = false; if (ended) return finish(); if (errored) return; stm.once("readable", readNext); } __name(readNext, "readNext"); }); } __name(parseReadable, "parseReadable"); function parseTransform2() { const parser2 = new TOMLParser(); return new stream2.Transform({ objectMode: true, transform(chunk, encoding, cb2) { try { parser2.parse(chunk.toString(encoding)); } catch (err) { this.emit("error", err); } cb2(); }, flush(cb2) { try { this.push(parser2.finish()); } catch (err) { this.emit("error", err); } cb2(); } }); } __name(parseTransform2, "parseTransform"); } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse.js var require_parse2 = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = require_parse_string(); module3.exports.async = require_parse_async(); module3.exports.stream = require_parse_stream(); module3.exports.prettyError = require_parse_pretty_error(); } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/stringify.js var require_stringify = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/stringify.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = stringify; module3.exports.value = stringifyInline; function stringify(obj) { if (obj === null) throw typeError("null"); if (obj === void 0) throw typeError("undefined"); if (typeof obj !== "object") throw typeError(typeof obj); if (typeof obj.toJSON === "function") obj = obj.toJSON(); if (obj == null) return null; const type = tomlType2(obj); if (type !== "table") throw typeError(type); return stringifyObject("", "", obj); } __name(stringify, "stringify"); function typeError(type) { return new Error("Can only stringify objects, not " + type); } __name(typeError, "typeError"); function getInlineKeys(obj) { return Object.keys(obj).filter((key) => isInline(obj[key])); } __name(getInlineKeys, "getInlineKeys"); function getComplexKeys(obj) { return Object.keys(obj).filter((key) => !isInline(obj[key])); } __name(getComplexKeys, "getComplexKeys"); function toJSON(obj) { let nobj = Array.isArray(obj) ? [] : Object.prototype.hasOwnProperty.call(obj, "__proto__") ? { ["__proto__"]: void 0 } : {}; for (let prop of Object.keys(obj)) { if (obj[prop] && typeof obj[prop].toJSON === "function" && !("toISOString" in obj[prop])) { nobj[prop] = obj[prop].toJSON(); } else { nobj[prop] = obj[prop]; } } return nobj; } __name(toJSON, "toJSON"); function stringifyObject(prefix, indent, obj) { obj = toJSON(obj); let inlineKeys; let complexKeys; inlineKeys = getInlineKeys(obj); complexKeys = getComplexKeys(obj); const result = []; const inlineIndent = indent || ""; inlineKeys.forEach((key) => { var type = tomlType2(obj[key]); if (type !== "undefined" && type !== "null") { result.push(inlineIndent + stringifyKey(key) + " = " + stringifyAnyInline(obj[key], true)); } }); if (result.length > 0) result.push(""); const complexIndent = prefix && inlineKeys.length > 0 ? indent + " " : ""; complexKeys.forEach((key) => { result.push(stringifyComplex(prefix, complexIndent, key, obj[key])); }); return result.join("\n"); } __name(stringifyObject, "stringifyObject"); function isInline(value) { switch (tomlType2(value)) { case "undefined": case "null": case "integer": case "nan": case "float": case "boolean": case "string": case "datetime": return true; case "array": return value.length === 0 || tomlType2(value[0]) !== "table"; case "table": return Object.keys(value).length === 0; default: return false; } } __name(isInline, "isInline"); function tomlType2(value) { if (value === void 0) { return "undefined"; } else if (value === null) { return "null"; } else if (typeof value === "bigint" || Number.isInteger(value) && !Object.is(value, -0)) { return "integer"; } else if (typeof value === "number") { return "float"; } else if (typeof value === "boolean") { return "boolean"; } else if (typeof value === "string") { return "string"; } else if ("toISOString" in value) { return isNaN(value) ? "undefined" : "datetime"; } else if (Array.isArray(value)) { return "array"; } else { return "table"; } } __name(tomlType2, "tomlType"); function stringifyKey(key) { const keyStr = String(key); if (/^[-A-Za-z0-9_]+$/.test(keyStr)) { return keyStr; } else { return stringifyBasicString(keyStr); } } __name(stringifyKey, "stringifyKey"); function stringifyBasicString(str) { return '"' + escapeString(str).replace(/"/g, '\\"') + '"'; } __name(stringifyBasicString, "stringifyBasicString"); function stringifyLiteralString(str) { return "'" + str + "'"; } __name(stringifyLiteralString, "stringifyLiteralString"); function numpad(num, str) { while (str.length < num) str = "0" + str; return str; } __name(numpad, "numpad"); function escapeString(str) { return str.replace(/\\/g, "\\\\").replace(/[\b]/g, "\\b").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\f/g, "\\f").replace(/\r/g, "\\r").replace(/([\u0000-\u001f\u007f])/, (c6) => "\\u" + numpad(4, c6.codePointAt(0).toString(16))); } __name(escapeString, "escapeString"); function stringifyMultilineString(str) { let escaped = str.split(/\n/).map((str2) => { return escapeString(str2).replace(/"(?="")/g, '\\"'); }).join("\n"); if (escaped.slice(-1) === '"') escaped += "\\\n"; return '"""\n' + escaped + '"""'; } __name(stringifyMultilineString, "stringifyMultilineString"); function stringifyAnyInline(value, multilineOk) { let type = tomlType2(value); if (type === "string") { if (multilineOk && /\n/.test(value)) { type = "string-multiline"; } else if (!/[\b\t\n\f\r']/.test(value) && /"/.test(value)) { type = "string-literal"; } } return stringifyInline(value, type); } __name(stringifyAnyInline, "stringifyAnyInline"); function stringifyInline(value, type) { if (!type) type = tomlType2(value); switch (type) { case "string-multiline": return stringifyMultilineString(value); case "string": return stringifyBasicString(value); case "string-literal": return stringifyLiteralString(value); case "integer": return stringifyInteger(value); case "float": return stringifyFloat(value); case "boolean": return stringifyBoolean(value); case "datetime": return stringifyDatetime(value); case "array": return stringifyInlineArray(value.filter((_4) => tomlType2(_4) !== "null" && tomlType2(_4) !== "undefined" && tomlType2(_4) !== "nan")); case "table": return stringifyInlineTable(value); default: throw typeError(type); } } __name(stringifyInline, "stringifyInline"); function stringifyInteger(value) { return String(value).replace(/\B(?=(\d{3})+(?!\d))/g, "_"); } __name(stringifyInteger, "stringifyInteger"); function stringifyFloat(value) { if (value === Infinity) { return "inf"; } else if (value === -Infinity) { return "-inf"; } else if (Object.is(value, NaN)) { return "nan"; } else if (Object.is(value, -0)) { return "-0.0"; } const [int, dec] = String(value).split("."); return stringifyInteger(int) + "." + dec; } __name(stringifyFloat, "stringifyFloat"); function stringifyBoolean(value) { return String(value); } __name(stringifyBoolean, "stringifyBoolean"); function stringifyDatetime(value) { return value.toISOString(); } __name(stringifyDatetime, "stringifyDatetime"); function stringifyInlineArray(values) { values = toJSON(values); let result = "["; const stringified = values.map((_4) => stringifyInline(_4)); if (stringified.join(", ").length > 60 || /\n/.test(stringified)) { result += "\n " + stringified.join(",\n ") + "\n"; } else { result += " " + stringified.join(", ") + (stringified.length > 0 ? " " : ""); } return result + "]"; } __name(stringifyInlineArray, "stringifyInlineArray"); function stringifyInlineTable(value) { value = toJSON(value); const result = []; Object.keys(value).forEach((key) => { result.push(stringifyKey(key) + " = " + stringifyAnyInline(value[key], false)); }); return "{ " + result.join(", ") + (result.length > 0 ? " " : "") + "}"; } __name(stringifyInlineTable, "stringifyInlineTable"); function stringifyComplex(prefix, indent, key, value) { const valueType = tomlType2(value); if (valueType === "array") { return stringifyArrayOfTables(prefix, indent, key, value); } else if (valueType === "table") { return stringifyComplexTable(prefix, indent, key, value); } else { throw typeError(valueType); } } __name(stringifyComplex, "stringifyComplex"); function stringifyArrayOfTables(prefix, indent, key, values) { values = toJSON(values); const firstValueType = tomlType2(values[0]); if (firstValueType !== "table") throw typeError(firstValueType); const fullKey = prefix + stringifyKey(key); let result = ""; values.forEach((table) => { if (result.length > 0) result += "\n"; result += indent + "[[" + fullKey + "]]\n"; result += stringifyObject(fullKey + ".", indent, table); }); return result; } __name(stringifyArrayOfTables, "stringifyArrayOfTables"); function stringifyComplexTable(prefix, indent, key, value) { const fullKey = prefix + stringifyKey(key); let result = ""; if (getInlineKeys(value).length > 0) { result += indent + "[" + fullKey + "]\n"; } return result + stringifyObject(fullKey + ".", indent, value); } __name(stringifyComplexTable, "stringifyComplexTable"); } }); // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/toml.js var require_toml = __commonJS({ "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/toml.js"(exports2) { "use strict"; init_import_meta_url(); exports2.parse = require_parse2(); exports2.stringify = require_stringify(); } }); // ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js var require_signals = __commonJS({ "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports2, module3) { init_import_meta_url(); module3.exports = [ "SIGABRT", "SIGALRM", "SIGHUP", "SIGINT", "SIGTERM" ]; if (process.platform !== "win32") { module3.exports.push( "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT" // should detect profiler and enable/disable accordingly. // see #21 // 'SIGPROF' ); } if (process.platform === "linux") { module3.exports.push( "SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT", "SIGUNUSED" ); } } }); // ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js var require_signal_exit = __commonJS({ "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports2, module3) { init_import_meta_url(); var process11 = global.process; var processOk = /* @__PURE__ */ __name(function(process12) { return process12 && typeof process12 === "object" && typeof process12.removeListener === "function" && typeof process12.emit === "function" && typeof process12.reallyExit === "function" && typeof process12.listeners === "function" && typeof process12.kill === "function" && typeof process12.pid === "number" && typeof process12.on === "function"; }, "processOk"); if (!processOk(process11)) { module3.exports = function() { return function() { }; }; } else { assert38 = require("assert"); signals = require_signals(); isWin = /^win/i.test(process11.platform); EE = require("events"); if (typeof EE !== "function") { EE = EE.EventEmitter; } if (process11.__signal_exit_emitter__) { emitter = process11.__signal_exit_emitter__; } else { emitter = process11.__signal_exit_emitter__ = new EE(); emitter.count = 0; emitter.emitted = {}; } if (!emitter.infinite) { emitter.setMaxListeners(Infinity); emitter.infinite = true; } module3.exports = function(cb2, opts) { if (!processOk(global.process)) { return function() { }; } assert38.equal(typeof cb2, "function", "a callback must be provided for exit handler"); if (loaded === false) { load(); } var ev = "exit"; if (opts && opts.alwaysLast) { ev = "afterexit"; } var remove = /* @__PURE__ */ __name(function() { emitter.removeListener(ev, cb2); if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) { unload(); } }, "remove"); emitter.on(ev, cb2); return remove; }; unload = /* @__PURE__ */ __name(function unload2() { if (!loaded || !processOk(global.process)) { return; } loaded = false; signals.forEach(function(sig) { try { process11.removeListener(sig, sigListeners[sig]); } catch (er) { } }); process11.emit = originalProcessEmit; process11.reallyExit = originalProcessReallyExit; emitter.count -= 1; }, "unload"); module3.exports.unload = unload; emit = /* @__PURE__ */ __name(function emit2(event, code, signal) { if (emitter.emitted[event]) { return; } emitter.emitted[event] = true; emitter.emit(event, code, signal); }, "emit"); sigListeners = {}; signals.forEach(function(sig) { sigListeners[sig] = /* @__PURE__ */ __name(function listener() { if (!processOk(global.process)) { return; } var listeners = process11.listeners(sig); if (listeners.length === emitter.count) { unload(); emit("exit", null, sig); emit("afterexit", null, sig); if (isWin && sig === "SIGHUP") { sig = "SIGINT"; } process11.kill(process11.pid, sig); } }, "listener"); }); module3.exports.signals = function() { return signals; }; loaded = false; load = /* @__PURE__ */ __name(function load2() { if (loaded || !processOk(global.process)) { return; } loaded = true; emitter.count += 1; signals = signals.filter(function(sig) { try { process11.on(sig, sigListeners[sig]); return true; } catch (er) { return false; } }); process11.emit = processEmit; process11.reallyExit = processReallyExit; }, "load"); module3.exports.load = load; originalProcessReallyExit = process11.reallyExit; processReallyExit = /* @__PURE__ */ __name(function processReallyExit2(code) { if (!processOk(global.process)) { return; } process11.exitCode = code || /* istanbul ignore next */ 0; emit("exit", process11.exitCode, null); emit("afterexit", process11.exitCode, null); originalProcessReallyExit.call(process11, process11.exitCode); }, "processReallyExit"); originalProcessEmit = process11.emit; processEmit = /* @__PURE__ */ __name(function processEmit2(ev, arg) { if (ev === "exit" && processOk(global.process)) { if (arg !== void 0) { process11.exitCode = arg; } var ret = originalProcessEmit.apply(this, arguments); emit("exit", process11.exitCode, null); emit("afterexit", process11.exitCode, null); return ret; } else { return originalProcessEmit.apply(this, arguments); } }, "processEmit"); } var assert38; var signals; var isWin; var EE; var emitter; var unload; var emit; var sigListeners; var loaded; var load; var originalProcessReallyExit; var processReallyExit; var originalProcessEmit; var processEmit; } }); // ../../node_modules/.pnpm/ignore@5.3.1/node_modules/ignore/index.js var require_ignore = __commonJS({ "../../node_modules/.pnpm/ignore@5.3.1/node_modules/ignore/index.js"(exports2, module3) { init_import_meta_url(); function makeArray(subject) { return Array.isArray(subject) ? subject : [subject]; } __name(makeArray, "makeArray"); var EMPTY = ""; var SPACE2 = " "; var ESCAPE = "\\"; var REGEX_TEST_BLANK_LINE = /^\s+$/; var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; var REGEX_SPLITALL_CRLF = /\r?\n/g; var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/; var SLASH2 = "/"; var TMP_KEY_IGNORE = "node-ignore"; if (typeof Symbol !== "undefined") { TMP_KEY_IGNORE = Symbol.for("node-ignore"); } var KEY_IGNORE = TMP_KEY_IGNORE; var define = /* @__PURE__ */ __name((object, key, value) => Object.defineProperty(object, key, { value }), "define"); var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; var RETURN_FALSE = /* @__PURE__ */ __name(() => false, "RETURN_FALSE"); var sanitizeRange = /* @__PURE__ */ __name((range) => range.replace( REGEX_REGEXP_RANGE, (match2, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match2 : EMPTY ), "sanitizeRange"); var cleanRangeBackSlash = /* @__PURE__ */ __name((slashes) => { const { length } = slashes; return slashes.slice(0, length - length % 2); }, "cleanRangeBackSlash"); var REPLACERS = [ [ // remove BOM // TODO: // Other similar zero-width characters? /^\uFEFF/, () => EMPTY ], // > Trailing spaces are ignored unless they are quoted with backslash ("\") [ // (a\ ) -> (a ) // (a ) -> (a) // (a \ ) -> (a ) /\\?\s+$/, (match2) => match2.indexOf("\\") === 0 ? SPACE2 : EMPTY ], // replace (\ ) with ' ' [ /\\\s/g, () => SPACE2 ], // Escape metacharacters // which is written down by users but means special for regular expressions. // > There are 12 characters with special meanings: // > - the backslash \, // > - the caret ^, // > - the dollar sign $, // > - the period or dot ., // > - the vertical bar or pipe symbol |, // > - the question mark ?, // > - the asterisk or star *, // > - the plus sign +, // > - the opening parenthesis (, // > - the closing parenthesis ), // > - and the opening square bracket [, // > - the opening curly brace {, // > These special characters are often called "metacharacters". [ /[\\$.|*+(){^]/g, (match2) => `\\${match2}` ], [ // > a question mark (?) matches a single character /(?!\\)\?/g, () => "[^/]" ], // leading slash [ // > A leading slash matches the beginning of the pathname. // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". // A leading slash matches the beginning of the pathname /^\//, () => "^" ], // replace special metacharacter slash after the leading slash [ /\//g, () => "\\/" ], [ // > A leading "**" followed by a slash means match in all directories. // > For example, "**/foo" matches file or directory "foo" anywhere, // > the same as pattern "foo". // > "**/foo/bar" matches file or directory "bar" anywhere that is directly // > under directory "foo". // Notice that the '*'s have been replaced as '\\*' /^\^*\\\*\\\*\\\//, // '**/foo' <-> 'foo' () => "^(?:.*\\/)?" ], // starting [ // there will be no leading '/' // (which has been replaced by section "leading slash") // If starts with '**', adding a '^' to the regular expression also works /^(?=[^^])/, /* @__PURE__ */ __name(function startingReplacer() { return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^"; }, "startingReplacer") ], // two globstars [ // Use lookahead assertions so that we could match more than one `'/**'` /\\\/\\\*\\\*(?=\\\/|$)/g, // Zero, one or several directories // should not use '*', or it will be replaced by the next replacer // Check if it is not the last `'/**'` (_4, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+" ], // normal intermediate wildcards [ // Never replace escaped '*' // ignore rule '\*' will match the path '*' // 'abc.*/' -> go // 'abc.*' -> skip this rule, // coz trailing single wildcard will be handed by [trailing wildcard] /(^|[^\\]+)(\\\*)+(?=.+)/g, // '*.js' matches '.js' // '*.js' doesn't match 'abc' (_4, p1, p22) => { const unescaped = p22.replace(/\\\*/g, "[^\\/]*"); return p1 + unescaped; } ], [ // unescape, revert step 3 except for back slash // For example, if a user escape a '\\*', // after step 3, the result will be '\\\\\\*' /\\\\\\(?=[$.|*+(){^])/g, () => ESCAPE ], [ // '\\\\' -> '\\' /\\\\/g, () => ESCAPE ], [ // > The range notation, e.g. [a-zA-Z], // > can be used to match one of the characters in a range. // `\` is escaped by step 3 /(\\)?\[([^\]/]*?)(\\*)($|\])/g, (match2, leadEscape, range, endEscape, close2) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close2}` : close2 === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]" ], // ending [ // 'js' will not match 'js.' // 'ab' will not match 'abc' /(?:[^*])$/, // WTF! // https://git-scm.com/docs/gitignore // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) // which re-fixes #24, #38 // > If there is a separator at the end of the pattern then the pattern // > will only match directories, otherwise the pattern can match both // > files and directories. // 'js*' will not match 'a.js' // 'js/' will not match 'a.js' // 'js' will match 'a.js' and 'a.js/' (match2) => /\/$/.test(match2) ? `${match2}$` : `${match2}(?=$|\\/$)` ], // trailing wildcard [ /(\^|\\\/)?\\\*$/, (_4, p1) => { const prefix = p1 ? `${p1}[^/]+` : "[^/]*"; return `${prefix}(?=$|\\/$)`; } ] ]; var regexCache = /* @__PURE__ */ Object.create(null); var makeRegex = /* @__PURE__ */ __name((pattern, ignoreCase) => { let source = regexCache[pattern]; if (!source) { source = REPLACERS.reduce( (prev, current) => prev.replace(current[0], current[1].bind(pattern)), pattern ); regexCache[pattern] = source; } return ignoreCase ? new RegExp(source, "i") : new RegExp(source); }, "makeRegex"); var isString4 = /* @__PURE__ */ __name((subject) => typeof subject === "string", "isString"); var checkPattern = /* @__PURE__ */ __name((pattern) => pattern && isString4(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0, "checkPattern"); var splitPattern = /* @__PURE__ */ __name((pattern) => pattern.split(REGEX_SPLITALL_CRLF), "splitPattern"); var IgnoreRule = class { constructor(origin, pattern, negative, regex2) { this.origin = origin; this.pattern = pattern; this.negative = negative; this.regex = regex2; } }; __name(IgnoreRule, "IgnoreRule"); var createRule = /* @__PURE__ */ __name((pattern, ignoreCase) => { const origin = pattern; let negative = false; if (pattern.indexOf("!") === 0) { negative = true; pattern = pattern.substr(1); } pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#"); const regex2 = makeRegex(pattern, ignoreCase); return new IgnoreRule( origin, pattern, negative, regex2 ); }, "createRule"); var throwError = /* @__PURE__ */ __name((message, Ctor) => { throw new Ctor(message); }, "throwError"); var checkPath = /* @__PURE__ */ __name((path72, originalPath, doThrow) => { if (!isString4(path72)) { return doThrow( `path must be a string, but got \`${originalPath}\``, TypeError ); } if (!path72) { return doThrow(`path must not be empty`, TypeError); } if (checkPath.isNotRelative(path72)) { const r7 = "`path.relative()`d"; return doThrow( `path should be a ${r7} string, but got "${originalPath}"`, RangeError ); } return true; }, "checkPath"); var isNotRelative = /* @__PURE__ */ __name((path72) => REGEX_TEST_INVALID_PATH.test(path72), "isNotRelative"); checkPath.isNotRelative = isNotRelative; checkPath.convert = (p6) => p6; var Ignore = class { constructor({ ignorecase = true, ignoreCase = ignorecase, allowRelativePaths = false } = {}) { define(this, KEY_IGNORE, true); this._rules = []; this._ignoreCase = ignoreCase; this._allowRelativePaths = allowRelativePaths; this._initCache(); } _initCache() { this._ignoreCache = /* @__PURE__ */ Object.create(null); this._testCache = /* @__PURE__ */ Object.create(null); } _addPattern(pattern) { if (pattern && pattern[KEY_IGNORE]) { this._rules = this._rules.concat(pattern._rules); this._added = true; return; } if (checkPattern(pattern)) { const rule = createRule(pattern, this._ignoreCase); this._added = true; this._rules.push(rule); } } // @param {Array | string | Ignore} pattern add(pattern) { this._added = false; makeArray( isString4(pattern) ? splitPattern(pattern) : pattern ).forEach(this._addPattern, this); if (this._added) { this._initCache(); } return this; } // legacy addPattern(pattern) { return this.add(pattern); } // | ignored : unignored // negative | 0:0 | 0:1 | 1:0 | 1:1 // -------- | ------- | ------- | ------- | -------- // 0 | TEST | TEST | SKIP | X // 1 | TESTIF | SKIP | TEST | X // - SKIP: always skip // - TEST: always test // - TESTIF: only test if checkUnignored // - X: that never happen // @param {boolean} whether should check if the path is unignored, // setting `checkUnignored` to `false` could reduce additional // path matching. // @returns {TestResult} true if a file is ignored _testOne(path72, checkUnignored) { let ignored = false; let unignored = false; this._rules.forEach((rule) => { const { negative } = rule; if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { return; } const matched = rule.regex.test(path72); if (matched) { ignored = !negative; unignored = negative; } }); return { ignored, unignored }; } // @returns {TestResult} _test(originalPath, cache6, checkUnignored, slices) { const path72 = originalPath && checkPath.convert(originalPath); checkPath( path72, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError ); return this._t(path72, cache6, checkUnignored, slices); } _t(path72, cache6, checkUnignored, slices) { if (path72 in cache6) { return cache6[path72]; } if (!slices) { slices = path72.split(SLASH2); } slices.pop(); if (!slices.length) { return cache6[path72] = this._testOne(path72, checkUnignored); } const parent = this._t( slices.join(SLASH2) + SLASH2, cache6, checkUnignored, slices ); return cache6[path72] = parent.ignored ? parent : this._testOne(path72, checkUnignored); } ignores(path72) { return this._test(path72, this._ignoreCache, false).ignored; } createFilter() { return (path72) => !this.ignores(path72); } filter(paths) { return makeArray(paths).filter(this.createFilter()); } // @returns {TestResult} test(path72) { return this._test(path72, this._testCache, true); } }; __name(Ignore, "Ignore"); var factory = /* @__PURE__ */ __name((options32) => new Ignore(options32), "factory"); var isPathValid = /* @__PURE__ */ __name((path72) => checkPath(path72 && checkPath.convert(path72), path72, RETURN_FALSE), "isPathValid"); factory.isPathValid = isPathValid; factory.default = factory; module3.exports = factory; if ( // Detect `process` so that it can run in browsers. typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32") ) { const makePosix = /* @__PURE__ */ __name((str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/"), "makePosix"); checkPath.convert = makePosix; const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; checkPath.isNotRelative = (path72) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path72) || isNotRelative(path72); } } }); // ../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/Mime.js var require_Mime = __commonJS({ "../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/Mime.js"(exports2, module3) { "use strict"; init_import_meta_url(); function Mime() { this._types = /* @__PURE__ */ Object.create(null); this._extensions = /* @__PURE__ */ Object.create(null); for (let i5 = 0; i5 < arguments.length; i5++) { this.define(arguments[i5]); } this.define = this.define.bind(this); this.getType = this.getType.bind(this); this.getExtension = this.getExtension.bind(this); } __name(Mime, "Mime"); Mime.prototype.define = function(typeMap, force) { for (let type in typeMap) { let extensions = typeMap[type].map(function(t7) { return t7.toLowerCase(); }); type = type.toLowerCase(); for (let i5 = 0; i5 < extensions.length; i5++) { const ext = extensions[i5]; if (ext[0] === "*") { continue; } if (!force && ext in this._types) { throw new Error( 'Attempt to change mapping for "' + ext + '" extension from "' + this._types[ext] + '" to "' + type + '". Pass `force=true` to allow this, otherwise remove "' + ext + '" from the list of extensions for "' + type + '".' ); } this._types[ext] = type; } if (force || !this._extensions[type]) { const ext = extensions[0]; this._extensions[type] = ext[0] !== "*" ? ext : ext.substr(1); } } }; Mime.prototype.getType = function(path72) { path72 = String(path72); let last = path72.replace(/^.*[/\\]/, "").toLowerCase(); let ext = last.replace(/^.*\./, "").toLowerCase(); let hasPath = last.length < path72.length; let hasDot = ext.length < last.length - 1; return (hasDot || !hasPath) && this._types[ext] || null; }; Mime.prototype.getExtension = function(type) { type = /^\s*([^;\s]*)/.test(type) && RegExp.$1; return type && this._extensions[type.toLowerCase()] || null; }; module3.exports = Mime; } }); // ../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/types/standard.js var require_standard = __commonJS({ "../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/types/standard.js"(exports2, module3) { init_import_meta_url(); module3.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["es", "ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avif": ["avif"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] }; } }); // ../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/types/other.js var require_other = __commonJS({ "../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/types/other.js"(exports2, module3) { init_import_meta_url(); module3.exports = { "application/prs.cww": ["cww"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.sap.vds": ["vds"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] }; } }); // ../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/index.js var require_mime = __commonJS({ "../../node_modules/.pnpm/mime@3.0.0/node_modules/mime/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var Mime = require_Mime(); module3.exports = new Mime(require_standard(), require_other()); } }); // ../../node_modules/.pnpm/dotenv@16.3.1/node_modules/dotenv/package.json var require_package = __commonJS({ "../../node_modules/.pnpm/dotenv@16.3.1/node_modules/dotenv/package.json"(exports2, module3) { module3.exports = { name: "dotenv", version: "16.3.1", description: "Loads environment variables from .env file", main: "lib/main.js", types: "lib/main.d.ts", exports: { ".": { types: "./lib/main.d.ts", require: "./lib/main.js", default: "./lib/main.js" }, "./config": "./config.js", "./config.js": "./config.js", "./lib/env-options": "./lib/env-options.js", "./lib/env-options.js": "./lib/env-options.js", "./lib/cli-options": "./lib/cli-options.js", "./lib/cli-options.js": "./lib/cli-options.js", "./package.json": "./package.json" }, scripts: { "dts-check": "tsc --project tests/types/tsconfig.json", lint: "standard", "lint-readme": "standard-markdown", pretest: "npm run lint && npm run dts-check", test: "tap tests/*.js --100 -Rspec", prerelease: "npm test", release: "standard-version" }, repository: { type: "git", url: "git://github.com/motdotla/dotenv.git" }, funding: "https://github.com/motdotla/dotenv?sponsor=1", keywords: [ "dotenv", "env", ".env", "environment", "variables", "config", "settings" ], readmeFilename: "README.md", license: "BSD-2-Clause", devDependencies: { "@definitelytyped/dtslint": "^0.0.133", "@types/node": "^18.11.3", decache: "^4.6.1", sinon: "^14.0.1", standard: "^17.0.0", "standard-markdown": "^7.1.0", "standard-version": "^9.5.0", tap: "^16.3.0", tar: "^6.1.11", typescript: "^4.8.4" }, engines: { node: ">=12" }, browser: { fs: false } }; } }); // ../../node_modules/.pnpm/dotenv@16.3.1/node_modules/dotenv/lib/main.js var require_main2 = __commonJS({ "../../node_modules/.pnpm/dotenv@16.3.1/node_modules/dotenv/lib/main.js"(exports2, module3) { init_import_meta_url(); var fs27 = require("fs"); var path72 = require("path"); var os13 = require("os"); var crypto8 = require("crypto"); var packageJson = require_package(); var version4 = packageJson.version; var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg; function parse7(src) { const obj = {}; let lines = src.toString(); lines = lines.replace(/\r\n?/mg, "\n"); let match2; while ((match2 = LINE.exec(lines)) != null) { const key = match2[1]; let value = match2[2] || ""; value = value.trim(); const maybeQuote = value[0]; value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"); if (maybeQuote === '"') { value = value.replace(/\\n/g, "\n"); value = value.replace(/\\r/g, "\r"); } obj[key] = value; } return obj; } __name(parse7, "parse"); function _parseVault(options32) { const vaultPath = _vaultPath(options32); const result = DotenvModule.configDotenv({ path: vaultPath }); if (!result.parsed) { throw new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`); } const keys = _dotenvKey(options32).split(","); const length = keys.length; let decrypted; for (let i5 = 0; i5 < length; i5++) { try { const key = keys[i5].trim(); const attrs = _instructions(result, key); decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key); break; } catch (error2) { if (i5 + 1 >= length) { throw error2; } } } return DotenvModule.parse(decrypted); } __name(_parseVault, "_parseVault"); function _log(message) { console.log(`[dotenv@${version4}][INFO] ${message}`); } __name(_log, "_log"); function _warn(message) { console.log(`[dotenv@${version4}][WARN] ${message}`); } __name(_warn, "_warn"); function _debug(message) { console.log(`[dotenv@${version4}][DEBUG] ${message}`); } __name(_debug, "_debug"); function _dotenvKey(options32) { if (options32 && options32.DOTENV_KEY && options32.DOTENV_KEY.length > 0) { return options32.DOTENV_KEY; } if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) { return process.env.DOTENV_KEY; } return ""; } __name(_dotenvKey, "_dotenvKey"); function _instructions(result, dotenvKey) { let uri; try { uri = new URL(dotenvKey); } catch (error2) { if (error2.code === "ERR_INVALID_URL") { throw new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development"); } throw error2; } const key = uri.password; if (!key) { throw new Error("INVALID_DOTENV_KEY: Missing key part"); } const environment = uri.searchParams.get("environment"); if (!environment) { throw new Error("INVALID_DOTENV_KEY: Missing environment part"); } const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`; const ciphertext = result.parsed[environmentKey]; if (!ciphertext) { throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`); } return { ciphertext, key }; } __name(_instructions, "_instructions"); function _vaultPath(options32) { let dotenvPath = path72.resolve(process.cwd(), ".env"); if (options32 && options32.path && options32.path.length > 0) { dotenvPath = options32.path; } return dotenvPath.endsWith(".vault") ? dotenvPath : `${dotenvPath}.vault`; } __name(_vaultPath, "_vaultPath"); function _resolveHome(envPath) { return envPath[0] === "~" ? path72.join(os13.homedir(), envPath.slice(1)) : envPath; } __name(_resolveHome, "_resolveHome"); function _configVault(options32) { _log("Loading env from encrypted .env.vault"); const parsed = DotenvModule._parseVault(options32); let processEnv = process.env; if (options32 && options32.processEnv != null) { processEnv = options32.processEnv; } DotenvModule.populate(processEnv, parsed, options32); return { parsed }; } __name(_configVault, "_configVault"); function configDotenv(options32) { let dotenvPath = path72.resolve(process.cwd(), ".env"); let encoding = "utf8"; const debug = Boolean(options32 && options32.debug); if (options32) { if (options32.path != null) { dotenvPath = _resolveHome(options32.path); } if (options32.encoding != null) { encoding = options32.encoding; } } try { const parsed = DotenvModule.parse(fs27.readFileSync(dotenvPath, { encoding })); let processEnv = process.env; if (options32 && options32.processEnv != null) { processEnv = options32.processEnv; } DotenvModule.populate(processEnv, parsed, options32); return { parsed }; } catch (e7) { if (debug) { _debug(`Failed to load ${dotenvPath} ${e7.message}`); } return { error: e7 }; } } __name(configDotenv, "configDotenv"); function config(options32) { const vaultPath = _vaultPath(options32); if (_dotenvKey(options32).length === 0) { return DotenvModule.configDotenv(options32); } if (!fs27.existsSync(vaultPath)) { _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`); return DotenvModule.configDotenv(options32); } return DotenvModule._configVault(options32); } __name(config, "config"); function decrypt(encrypted, keyStr) { const key = Buffer.from(keyStr.slice(-64), "hex"); let ciphertext = Buffer.from(encrypted, "base64"); const nonce = ciphertext.slice(0, 12); const authTag = ciphertext.slice(-16); ciphertext = ciphertext.slice(12, -16); try { const aesgcm = crypto8.createDecipheriv("aes-256-gcm", key, nonce); aesgcm.setAuthTag(authTag); return `${aesgcm.update(ciphertext)}${aesgcm.final()}`; } catch (error2) { const isRange = error2 instanceof RangeError; const invalidKeyLength = error2.message === "Invalid key length"; const decryptionFailed = error2.message === "Unsupported state or unable to authenticate data"; if (isRange || invalidKeyLength) { const msg = "INVALID_DOTENV_KEY: It must be 64 characters long (or more)"; throw new Error(msg); } else if (decryptionFailed) { const msg = "DECRYPTION_FAILED: Please check your DOTENV_KEY"; throw new Error(msg); } else { console.error("Error: ", error2.code); console.error("Error: ", error2.message); throw error2; } } } __name(decrypt, "decrypt"); function populate(processEnv, parsed, options32 = {}) { const debug = Boolean(options32 && options32.debug); const override = Boolean(options32 && options32.override); if (typeof parsed !== "object") { throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate"); } for (const key of Object.keys(parsed)) { if (Object.prototype.hasOwnProperty.call(processEnv, key)) { if (override === true) { processEnv[key] = parsed[key]; } if (debug) { if (override === true) { _debug(`"${key}" is already defined and WAS overwritten`); } else { _debug(`"${key}" is already defined and was NOT overwritten`); } } } else { processEnv[key] = parsed[key]; } } } __name(populate, "populate"); var DotenvModule = { configDotenv, _configVault, _parseVault, config, decrypt, parse: parse7, populate }; module3.exports.configDotenv = DotenvModule.configDotenv; module3.exports._configVault = DotenvModule._configVault; module3.exports._parseVault = DotenvModule._parseVault; module3.exports.config = DotenvModule.config; module3.exports.decrypt = DotenvModule.decrypt; module3.exports.parse = DotenvModule.parse; module3.exports.populate = DotenvModule.populate; module3.exports = DotenvModule; } }); // ../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js var require_src = __commonJS({ "../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var ESC2 = "\x1B"; var CSI = `${ESC2}[`; var beep = "\x07"; var cursor = { to(x6, y4) { if (!y4) return `${CSI}${x6 + 1}G`; return `${CSI}${y4 + 1};${x6 + 1}H`; }, move(x6, y4) { let ret = ""; if (x6 < 0) ret += `${CSI}${-x6}D`; else if (x6 > 0) ret += `${CSI}${x6}C`; if (y4 < 0) ret += `${CSI}${-y4}A`; else if (y4 > 0) ret += `${CSI}${y4}B`; return ret; }, up: (count = 1) => `${CSI}${count}A`, down: (count = 1) => `${CSI}${count}B`, forward: (count = 1) => `${CSI}${count}C`, backward: (count = 1) => `${CSI}${count}D`, nextLine: (count = 1) => `${CSI}E`.repeat(count), prevLine: (count = 1) => `${CSI}F`.repeat(count), left: `${CSI}G`, hide: `${CSI}?25l`, show: `${CSI}?25h`, save: `${ESC2}7`, restore: `${ESC2}8` }; var scroll = { up: (count = 1) => `${CSI}S`.repeat(count), down: (count = 1) => `${CSI}T`.repeat(count) }; var erase = { screen: `${CSI}2J`, up: (count = 1) => `${CSI}1J`.repeat(count), down: (count = 1) => `${CSI}J`.repeat(count), line: `${CSI}2K`, lineEnd: `${CSI}K`, lineStart: `${CSI}1K`, lines(count) { let clear = ""; for (let i5 = 0; i5 < count; i5++) clear += this.line + (i5 < count - 1 ? cursor.up() : ""); if (count) clear += cursor.left; return clear; } }; module3.exports = { cursor, scroll, erase, beep }; } }); // ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js var require_picocolors = __commonJS({ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports2, module3) { init_import_meta_url(); var p6 = process || {}; var argv = p6.argv || []; var env6 = p6.env || {}; var isColorSupported = !(!!env6.NO_COLOR || argv.includes("--no-color")) && (!!env6.FORCE_COLOR || argv.includes("--color") || p6.platform === "win32" || (p6.stdout || {}).isTTY && env6.TERM !== "dumb" || !!env6.CI); var formatter = /* @__PURE__ */ __name((open4, close2, replace = open4) => (input) => { let string = "" + input, index = string.indexOf(close2, open4.length); return ~index ? open4 + replaceClose(string, close2, replace, index) + close2 : open4 + string + close2; }, "formatter"); var replaceClose = /* @__PURE__ */ __name((string, close2, replace, index) => { let result = "", cursor = 0; do { result += string.substring(cursor, index) + replace; cursor = index + close2.length; index = string.indexOf(close2, cursor); } while (~index); return result + string.substring(cursor); }, "replaceClose"); var createColors = /* @__PURE__ */ __name((enabled = isColorSupported) => { let f5 = enabled ? formatter : () => String; return { isColorSupported: enabled, reset: f5("\x1B[0m", "\x1B[0m"), bold: f5("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"), dim: f5("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"), italic: f5("\x1B[3m", "\x1B[23m"), underline: f5("\x1B[4m", "\x1B[24m"), inverse: f5("\x1B[7m", "\x1B[27m"), hidden: f5("\x1B[8m", "\x1B[28m"), strikethrough: f5("\x1B[9m", "\x1B[29m"), black: f5("\x1B[30m", "\x1B[39m"), red: f5("\x1B[31m", "\x1B[39m"), green: f5("\x1B[32m", "\x1B[39m"), yellow: f5("\x1B[33m", "\x1B[39m"), blue: f5("\x1B[34m", "\x1B[39m"), magenta: f5("\x1B[35m", "\x1B[39m"), cyan: f5("\x1B[36m", "\x1B[39m"), white: f5("\x1B[37m", "\x1B[39m"), gray: f5("\x1B[90m", "\x1B[39m"), bgBlack: f5("\x1B[40m", "\x1B[49m"), bgRed: f5("\x1B[41m", "\x1B[49m"), bgGreen: f5("\x1B[42m", "\x1B[49m"), bgYellow: f5("\x1B[43m", "\x1B[49m"), bgBlue: f5("\x1B[44m", "\x1B[49m"), bgMagenta: f5("\x1B[45m", "\x1B[49m"), bgCyan: f5("\x1B[46m", "\x1B[49m"), bgWhite: f5("\x1B[47m", "\x1B[49m"), blackBright: f5("\x1B[90m", "\x1B[39m"), redBright: f5("\x1B[91m", "\x1B[39m"), greenBright: f5("\x1B[92m", "\x1B[39m"), yellowBright: f5("\x1B[93m", "\x1B[39m"), blueBright: f5("\x1B[94m", "\x1B[39m"), magentaBright: f5("\x1B[95m", "\x1B[39m"), cyanBright: f5("\x1B[96m", "\x1B[39m"), whiteBright: f5("\x1B[97m", "\x1B[39m"), bgBlackBright: f5("\x1B[100m", "\x1B[49m"), bgRedBright: f5("\x1B[101m", "\x1B[49m"), bgGreenBright: f5("\x1B[102m", "\x1B[49m"), bgYellowBright: f5("\x1B[103m", "\x1B[49m"), bgBlueBright: f5("\x1B[104m", "\x1B[49m"), bgMagentaBright: f5("\x1B[105m", "\x1B[49m"), bgCyanBright: f5("\x1B[106m", "\x1B[49m"), bgWhiteBright: f5("\x1B[107m", "\x1B[49m") }; }, "createColors"); module3.exports = createColors(); module3.exports.createColors = createColors; } }); // ../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js var require_mimic_fn = __commonJS({ "../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var mimicFn = /* @__PURE__ */ __name((to, from) => { for (const prop of Reflect.ownKeys(from)) { Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); } return to; }, "mimicFn"); module3.exports = mimicFn; module3.exports.default = mimicFn; } }); // ../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js var require_onetime = __commonJS({ "../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var mimicFn = require_mimic_fn(); var calledFunctions2 = /* @__PURE__ */ new WeakMap(); var onetime3 = /* @__PURE__ */ __name((function_, options32 = {}) => { if (typeof function_ !== "function") { throw new TypeError("Expected a function"); } let returnValue; let callCount = 0; const functionName = function_.displayName || function_.name || ""; const onetime4 = /* @__PURE__ */ __name(function(...arguments_) { calledFunctions2.set(onetime4, ++callCount); if (callCount === 1) { returnValue = function_.apply(this, arguments_); function_ = null; } else if (options32.throw === true) { throw new Error(`Function \`${functionName}\` can only be called once`); } return returnValue; }, "onetime"); mimicFn(onetime4, function_); calledFunctions2.set(onetime4, callCount); return onetime4; }, "onetime"); module3.exports = onetime3; module3.exports.default = onetime3; module3.exports.callCount = (function_) => { if (!calledFunctions2.has(function_)) { throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`); } return calledFunctions2.get(function_); }; } }); // ../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js var require_eastasianwidth = __commonJS({ "../../node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js"(exports2, module3) { init_import_meta_url(); var eaw = {}; if ("undefined" == typeof module3) { window.eastasianwidth = eaw; } else { module3.exports = eaw; } eaw.eastAsianWidth = function(character) { var x6 = character.charCodeAt(0); var y4 = character.length == 2 ? character.charCodeAt(1) : 0; var codePoint = x6; if (55296 <= x6 && x6 <= 56319 && (56320 <= y4 && y4 <= 57343)) { x6 &= 1023; y4 &= 1023; codePoint = x6 << 10 | y4; codePoint += 65536; } if (12288 == codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) { return "F"; } if (8361 == codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) { return "H"; } if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) { return "W"; } if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 == codePoint || 175 == codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) { return "Na"; } if (161 == codePoint || 164 == codePoint || 167 <= codePoint && codePoint <= 168 || 170 == codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 == codePoint || 208 == codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 == codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 == codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 == codePoint || 254 == codePoint || 257 == codePoint || 273 == codePoint || 275 == codePoint || 283 == codePoint || 294 <= codePoint && codePoint <= 295 || 299 == codePoint || 305 <= codePoint && codePoint <= 307 || 312 == codePoint || 319 <= codePoint && codePoint <= 322 || 324 == codePoint || 328 <= codePoint && codePoint <= 331 || 333 == codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 == codePoint || 462 == codePoint || 464 == codePoint || 466 == codePoint || 468 == codePoint || 470 == codePoint || 472 == codePoint || 474 == codePoint || 476 == codePoint || 593 == codePoint || 609 == codePoint || 708 == codePoint || 711 == codePoint || 713 <= codePoint && codePoint <= 715 || 717 == codePoint || 720 == codePoint || 728 <= codePoint && codePoint <= 731 || 733 == codePoint || 735 == codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 == codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 == codePoint || 8208 == codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 == codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 == codePoint || 8251 == codePoint || 8254 == codePoint || 8308 == codePoint || 8319 == codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 == codePoint || 8451 == codePoint || 8453 == codePoint || 8457 == codePoint || 8467 == codePoint || 8470 == codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 == codePoint || 8491 == codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 == codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 == codePoint || 8660 == codePoint || 8679 == codePoint || 8704 == codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 == codePoint || 8719 == codePoint || 8721 == codePoint || 8725 == codePoint || 8730 == codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 == codePoint || 8741 == codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 == codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 == codePoint || 8780 == codePoint || 8786 == codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 == codePoint || 8857 == codePoint || 8869 == codePoint || 8895 == codePoint || 8978 == codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 == codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 == codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 == codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 == codePoint || 9758 == codePoint || 9792 == codePoint || 9794 == codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 == codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 == codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 == codePoint || 10071 == codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 == codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109) { return "A"; } return "N"; }; eaw.characterLength = function(character) { var code = this.eastAsianWidth(character); if (code == "F" || code == "W" || code == "A") { return 2; } else { return 1; } }; function stringToArray(string) { return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || []; } __name(stringToArray, "stringToArray"); eaw.length = function(string) { var characters = stringToArray(string); var len = 0; for (var i5 = 0; i5 < characters.length; i5++) { len = len + this.characterLength(characters[i5]); } return len; }; eaw.slice = function(text, start, end) { textLen = eaw.length(text); start = start ? start : 0; end = end ? end : 1; if (start < 0) { start = textLen + start; } if (end < 0) { end = textLen + end; } var result = ""; var eawLen = 0; var chars = stringToArray(text); for (var i5 = 0; i5 < chars.length; i5++) { var char = chars[i5]; var charLen = eaw.length(char); if (eawLen >= start - (charLen == 2 ? 1 : 0)) { if (eawLen + charLen <= end) { result += char; } else { break; } } eawLen += charLen; } return result; }; } }); // ../../node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js var require_emoji_regex2 = __commonJS({ "../../node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = function() { return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; }; } }); // ../../node_modules/.pnpm/ci-info@3.9.0/node_modules/ci-info/vendors.json var require_vendors = __commonJS({ "../../node_modules/.pnpm/ci-info@3.9.0/node_modules/ci-info/vendors.json"(exports2, module3) { module3.exports = [ { name: "Appcircle", constant: "APPCIRCLE", env: "AC_APPCIRCLE" }, { name: "AppVeyor", constant: "APPVEYOR", env: "APPVEYOR", pr: "APPVEYOR_PULL_REQUEST_NUMBER" }, { name: "AWS CodeBuild", constant: "CODEBUILD", env: "CODEBUILD_BUILD_ARN" }, { name: "Azure Pipelines", constant: "AZURE_PIPELINES", env: "TF_BUILD", pr: { BUILD_REASON: "PullRequest" } }, { name: "Bamboo", constant: "BAMBOO", env: "bamboo_planKey" }, { name: "Bitbucket Pipelines", constant: "BITBUCKET", env: "BITBUCKET_COMMIT", pr: "BITBUCKET_PR_ID" }, { name: "Bitrise", constant: "BITRISE", env: "BITRISE_IO", pr: "BITRISE_PULL_REQUEST" }, { name: "Buddy", constant: "BUDDY", env: "BUDDY_WORKSPACE_ID", pr: "BUDDY_EXECUTION_PULL_REQUEST_ID" }, { name: "Buildkite", constant: "BUILDKITE", env: "BUILDKITE", pr: { env: "BUILDKITE_PULL_REQUEST", ne: "false" } }, { name: "CircleCI", constant: "CIRCLE", env: "CIRCLECI", pr: "CIRCLE_PULL_REQUEST" }, { name: "Cirrus CI", constant: "CIRRUS", env: "CIRRUS_CI", pr: "CIRRUS_PR" }, { name: "Codefresh", constant: "CODEFRESH", env: "CF_BUILD_ID", pr: { any: [ "CF_PULL_REQUEST_NUMBER", "CF_PULL_REQUEST_ID" ] } }, { name: "Codemagic", constant: "CODEMAGIC", env: "CM_BUILD_ID", pr: "CM_PULL_REQUEST" }, { name: "Codeship", constant: "CODESHIP", env: { CI_NAME: "codeship" } }, { name: "Drone", constant: "DRONE", env: "DRONE", pr: { DRONE_BUILD_EVENT: "pull_request" } }, { name: "dsari", constant: "DSARI", env: "DSARI" }, { name: "Expo Application Services", constant: "EAS", env: "EAS_BUILD" }, { name: "Gerrit", constant: "GERRIT", env: "GERRIT_PROJECT" }, { name: "GitHub Actions", constant: "GITHUB_ACTIONS", env: "GITHUB_ACTIONS", pr: { GITHUB_EVENT_NAME: "pull_request" } }, { name: "GitLab CI", constant: "GITLAB", env: "GITLAB_CI", pr: "CI_MERGE_REQUEST_ID" }, { name: "GoCD", constant: "GOCD", env: "GO_PIPELINE_LABEL" }, { name: "Google Cloud Build", constant: "GOOGLE_CLOUD_BUILD", env: "BUILDER_OUTPUT" }, { name: "Harness CI", constant: "HARNESS", env: "HARNESS_BUILD_ID" }, { name: "Heroku", constant: "HEROKU", env: { env: "NODE", includes: "/app/.heroku/node/bin/node" } }, { name: "Hudson", constant: "HUDSON", env: "HUDSON_URL" }, { name: "Jenkins", constant: "JENKINS", env: [ "JENKINS_URL", "BUILD_ID" ], pr: { any: [ "ghprbPullId", "CHANGE_ID" ] } }, { name: "LayerCI", constant: "LAYERCI", env: "LAYERCI", pr: "LAYERCI_PULL_REQUEST" }, { name: "Magnum CI", constant: "MAGNUM", env: "MAGNUM" }, { name: "Netlify CI", constant: "NETLIFY", env: "NETLIFY", pr: { env: "PULL_REQUEST", ne: "false" } }, { name: "Nevercode", constant: "NEVERCODE", env: "NEVERCODE", pr: { env: "NEVERCODE_PULL_REQUEST", ne: "false" } }, { name: "ReleaseHub", constant: "RELEASEHUB", env: "RELEASE_BUILD_ID" }, { name: "Render", constant: "RENDER", env: "RENDER", pr: { IS_PULL_REQUEST: "true" } }, { name: "Sail CI", constant: "SAIL", env: "SAILCI", pr: "SAIL_PULL_REQUEST_NUMBER" }, { name: "Screwdriver", constant: "SCREWDRIVER", env: "SCREWDRIVER", pr: { env: "SD_PULL_REQUEST", ne: "false" } }, { name: "Semaphore", constant: "SEMAPHORE", env: "SEMAPHORE", pr: "PULL_REQUEST_NUMBER" }, { name: "Shippable", constant: "SHIPPABLE", env: "SHIPPABLE", pr: { IS_PULL_REQUEST: "true" } }, { name: "Solano CI", constant: "SOLANO", env: "TDDIUM", pr: "TDDIUM_PR_ID" }, { name: "Sourcehut", constant: "SOURCEHUT", env: { CI_NAME: "sourcehut" } }, { name: "Strider CD", constant: "STRIDER", env: "STRIDER" }, { name: "TaskCluster", constant: "TASKCLUSTER", env: [ "TASK_ID", "RUN_ID" ] }, { name: "TeamCity", constant: "TEAMCITY", env: "TEAMCITY_VERSION" }, { name: "Travis CI", constant: "TRAVIS", env: "TRAVIS", pr: { env: "TRAVIS_PULL_REQUEST", ne: "false" } }, { name: "Vercel", constant: "VERCEL", env: { any: [ "NOW_BUILDER", "VERCEL" ] }, pr: "VERCEL_GIT_PULL_REQUEST_ID" }, { name: "Visual Studio App Center", constant: "APPCENTER", env: "APPCENTER_BUILD_ID" }, { name: "Woodpecker", constant: "WOODPECKER", env: { CI: "woodpecker" }, pr: { CI_BUILD_EVENT: "pull_request" } }, { name: "Xcode Cloud", constant: "XCODE_CLOUD", env: "CI_XCODE_PROJECT", pr: "CI_PULL_REQUEST_NUMBER" }, { name: "Xcode Server", constant: "XCODE_SERVER", env: "XCS" } ]; } }); // ../../node_modules/.pnpm/ci-info@3.9.0/node_modules/ci-info/index.js var require_ci_info = __commonJS({ "../../node_modules/.pnpm/ci-info@3.9.0/node_modules/ci-info/index.js"(exports2) { "use strict"; init_import_meta_url(); var vendors = require_vendors(); var env6 = process.env; Object.defineProperty(exports2, "_vendors", { value: vendors.map(function(v7) { return v7.constant; }) }); exports2.name = null; exports2.isPR = null; vendors.forEach(function(vendor) { const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env]; const isCI2 = envs.every(function(obj) { return checkEnv(obj); }); exports2[vendor.constant] = isCI2; if (!isCI2) { return; } exports2.name = vendor.name; switch (typeof vendor.pr) { case "string": exports2.isPR = !!env6[vendor.pr]; break; case "object": if ("env" in vendor.pr) { exports2.isPR = vendor.pr.env in env6 && env6[vendor.pr.env] !== vendor.pr.ne; } else if ("any" in vendor.pr) { exports2.isPR = vendor.pr.any.some(function(key) { return !!env6[key]; }); } else { exports2.isPR = checkEnv(vendor.pr); } break; default: exports2.isPR = null; } }); exports2.isCI = !!(env6.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false' (env6.BUILD_ID || // Jenkins, Cloudbees env6.BUILD_NUMBER || // Jenkins, TeamCity env6.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari env6.CI_APP_ID || // Appflow env6.CI_BUILD_ID || // Appflow env6.CI_BUILD_NUMBER || // Appflow env6.CI_NAME || // Codeship and others env6.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI env6.RUN_ID || // TaskCluster, dsari exports2.name || false)); function checkEnv(obj) { if (typeof obj === "string") return !!env6[obj]; if ("env" in obj) { return env6[obj.env] && env6[obj.env].includes(obj.includes); } if ("any" in obj) { return obj.any.some(function(k6) { return !!env6[k6]; }); } return Object.keys(obj).every(function(k6) { return env6[k6] === obj[k6]; }); } __name(checkEnv, "checkEnv"); } }); // ../../node_modules/.pnpm/is-ci@3.0.1/node_modules/is-ci/index.js var require_is_ci = __commonJS({ "../../node_modules/.pnpm/is-ci@3.0.1/node_modules/is-ci/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = require_ci_info().isCI; } }); // ../../node_modules/.pnpm/kleur@3.0.3/node_modules/kleur/index.js var require_kleur = __commonJS({ "../../node_modules/.pnpm/kleur@3.0.3/node_modules/kleur/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = process.env; var $3 = { enabled: !NODE_DISABLE_COLORS && TERM !== "dumb" && FORCE_COLOR !== "0", // modifiers reset: init2(0, 0), bold: init2(1, 22), dim: init2(2, 22), italic: init2(3, 23), underline: init2(4, 24), inverse: init2(7, 27), hidden: init2(8, 28), strikethrough: init2(9, 29), // colors black: init2(30, 39), red: init2(31, 39), green: init2(32, 39), yellow: init2(33, 39), blue: init2(34, 39), magenta: init2(35, 39), cyan: init2(36, 39), white: init2(37, 39), gray: init2(90, 39), grey: init2(90, 39), // background colors bgBlack: init2(40, 49), bgRed: init2(41, 49), bgGreen: init2(42, 49), bgYellow: init2(43, 49), bgBlue: init2(44, 49), bgMagenta: init2(45, 49), bgCyan: init2(46, 49), bgWhite: init2(47, 49) }; function run2(arr, str) { let i5 = 0, tmp, beg = "", end = ""; for (; i5 < arr.length; i5++) { tmp = arr[i5]; beg += tmp.open; end += tmp.close; if (str.includes(tmp.close)) { str = str.replace(tmp.rgx, tmp.close + tmp.open); } } return beg + str + end; } __name(run2, "run"); function chain2(has, keys) { let ctx = { has, keys }; ctx.reset = $3.reset.bind(ctx); ctx.bold = $3.bold.bind(ctx); ctx.dim = $3.dim.bind(ctx); ctx.italic = $3.italic.bind(ctx); ctx.underline = $3.underline.bind(ctx); ctx.inverse = $3.inverse.bind(ctx); ctx.hidden = $3.hidden.bind(ctx); ctx.strikethrough = $3.strikethrough.bind(ctx); ctx.black = $3.black.bind(ctx); ctx.red = $3.red.bind(ctx); ctx.green = $3.green.bind(ctx); ctx.yellow = $3.yellow.bind(ctx); ctx.blue = $3.blue.bind(ctx); ctx.magenta = $3.magenta.bind(ctx); ctx.cyan = $3.cyan.bind(ctx); ctx.white = $3.white.bind(ctx); ctx.gray = $3.gray.bind(ctx); ctx.grey = $3.grey.bind(ctx); ctx.bgBlack = $3.bgBlack.bind(ctx); ctx.bgRed = $3.bgRed.bind(ctx); ctx.bgGreen = $3.bgGreen.bind(ctx); ctx.bgYellow = $3.bgYellow.bind(ctx); ctx.bgBlue = $3.bgBlue.bind(ctx); ctx.bgMagenta = $3.bgMagenta.bind(ctx); ctx.bgCyan = $3.bgCyan.bind(ctx); ctx.bgWhite = $3.bgWhite.bind(ctx); return ctx; } __name(chain2, "chain"); function init2(open4, close2) { let blk = { open: `\x1B[${open4}m`, close: `\x1B[${close2}m`, rgx: new RegExp(`\\x1b\\[${close2}m`, "g") }; return function(txt) { if (this !== void 0 && this.has !== void 0) { this.has.includes(open4) || (this.has.push(open4), this.keys.push(blk)); return txt === void 0 ? this : $3.enabled ? run2(this.keys, txt + "") : txt + ""; } return txt === void 0 ? chain2([open4], [blk]) : $3.enabled ? run2([blk], txt + "") : txt + ""; }; } __name(init2, "init"); module3.exports = $3; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.js var require_action = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = (key, isSelect) => { if (key.meta && key.name !== "escape") return; if (key.ctrl) { if (key.name === "a") return "first"; if (key.name === "c") return "abort"; if (key.name === "d") return "abort"; if (key.name === "e") return "last"; if (key.name === "g") return "reset"; } if (isSelect) { if (key.name === "j") return "down"; if (key.name === "k") return "up"; } if (key.name === "return") return "submit"; if (key.name === "enter") return "submit"; if (key.name === "backspace") return "delete"; if (key.name === "delete") return "deleteForward"; if (key.name === "abort") return "abort"; if (key.name === "escape") return "exit"; if (key.name === "tab") return "next"; if (key.name === "pagedown") return "nextPage"; if (key.name === "pageup") return "prevPage"; if (key.name === "home") return "home"; if (key.name === "end") return "end"; if (key.name === "up") return "up"; if (key.name === "down") return "down"; if (key.name === "right") return "right"; if (key.name === "left") return "left"; return false; }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.js var require_strip = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = (str) => { const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"); const RGX = new RegExp(pattern, "g"); return typeof str === "string" ? str.replace(RGX, "") : str; }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.js var require_clear = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.js"(exports2, module3) { "use strict"; init_import_meta_url(); function _createForOfIteratorHelper(o5, allowArrayLike) { var it2 = typeof Symbol !== "undefined" && o5[Symbol.iterator] || o5["@@iterator"]; if (!it2) { if (Array.isArray(o5) || (it2 = _unsupportedIterableToArray4(o5)) || allowArrayLike && o5 && typeof o5.length === "number") { if (it2) o5 = it2; var i5 = 0; var F3 = /* @__PURE__ */ __name(function F4() { }, "F"); return { s: F3, n: /* @__PURE__ */ __name(function n6() { if (i5 >= o5.length) return { done: true }; return { done: false, value: o5[i5++] }; }, "n"), e: /* @__PURE__ */ __name(function e7(_e) { throw _e; }, "e"), f: F3 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: /* @__PURE__ */ __name(function s5() { it2 = it2.call(o5); }, "s"), n: /* @__PURE__ */ __name(function n6() { var step = it2.next(); normalCompletion = step.done; return step; }, "n"), e: /* @__PURE__ */ __name(function e7(_e2) { didErr = true; err = _e2; }, "e"), f: /* @__PURE__ */ __name(function f5() { try { if (!normalCompletion && it2.return != null) it2.return(); } finally { if (didErr) throw err; } }, "f") }; } __name(_createForOfIteratorHelper, "_createForOfIteratorHelper"); function _unsupportedIterableToArray4(o5, minLen) { if (!o5) return; if (typeof o5 === "string") return _arrayLikeToArray4(o5, minLen); var n6 = Object.prototype.toString.call(o5).slice(8, -1); if (n6 === "Object" && o5.constructor) n6 = o5.constructor.name; if (n6 === "Map" || n6 === "Set") return Array.from(o5); if (n6 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n6)) return _arrayLikeToArray4(o5, minLen); } __name(_unsupportedIterableToArray4, "_unsupportedIterableToArray"); function _arrayLikeToArray4(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i5 = 0, arr2 = new Array(len); i5 < len; i5++) arr2[i5] = arr[i5]; return arr2; } __name(_arrayLikeToArray4, "_arrayLikeToArray"); var strip = require_strip(); var _require = require_src(); var erase = _require.erase; var cursor = _require.cursor; var width = /* @__PURE__ */ __name((str) => [...strip(str)].length, "width"); module3.exports = function(prompt2, perLine) { if (!perLine) return erase.line + cursor.to(0); let rows = 0; const lines = prompt2.split(/\r?\n/); var _iterator = _createForOfIteratorHelper(lines), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done; ) { let line = _step.value; rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine); } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } return erase.lines(rows); }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.js var require_figures = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.js"(exports2, module3) { "use strict"; init_import_meta_url(); var main2 = { arrowUp: "\u2191", arrowDown: "\u2193", arrowLeft: "\u2190", arrowRight: "\u2192", radioOn: "\u25C9", radioOff: "\u25EF", tick: "\u2714", cross: "\u2716", ellipsis: "\u2026", pointerSmall: "\u203A", line: "\u2500", pointer: "\u276F" }; var win = { arrowUp: main2.arrowUp, arrowDown: main2.arrowDown, arrowLeft: main2.arrowLeft, arrowRight: main2.arrowRight, radioOn: "(*)", radioOff: "( )", tick: "\u221A", cross: "\xD7", ellipsis: "...", pointerSmall: "\xBB", line: "\u2500", pointer: ">" }; var figures = process.platform === "win32" ? win : main2; module3.exports = figures; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.js var require_style = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.js"(exports2, module3) { "use strict"; init_import_meta_url(); var c6 = require_kleur(); var figures = require_figures(); var styles4 = Object.freeze({ password: { scale: 1, render: (input) => "*".repeat(input.length) }, emoji: { scale: 2, render: (input) => "\u{1F603}".repeat(input.length) }, invisible: { scale: 0, render: (input) => "" }, default: { scale: 1, render: (input) => `${input}` } }); var render2 = /* @__PURE__ */ __name((type) => styles4[type] || styles4.default, "render"); var symbols = Object.freeze({ aborted: c6.red(figures.cross), done: c6.green(figures.tick), exited: c6.yellow(figures.cross), default: c6.cyan("?") }); var symbol = /* @__PURE__ */ __name((done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default, "symbol"); var delimiter = /* @__PURE__ */ __name((completing) => c6.gray(completing ? figures.ellipsis : figures.pointerSmall), "delimiter"); var item = /* @__PURE__ */ __name((expandable, expanded) => c6.gray(expandable ? expanded ? figures.pointerSmall : "+" : figures.line), "item"); module3.exports = { styles: styles4, render: render2, symbols, symbol, delimiter, item }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.js var require_lines = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.js"(exports2, module3) { "use strict"; init_import_meta_url(); var strip = require_strip(); module3.exports = function(msg, perLine) { let lines = String(strip(msg) || "").split(/\r?\n/); if (!perLine) return lines.length; return lines.map((l6) => Math.ceil(l6.length / perLine)).reduce((a5, b6) => a5 + b6); }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.js var require_wrap = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = (msg, opts = {}) => { const tab = Number.isSafeInteger(parseInt(opts.margin)) ? new Array(parseInt(opts.margin)).fill(" ").join("") : opts.margin || ""; const width = opts.width; return (msg || "").split(/\r?\n/g).map((line) => line.split(/\s+/g).reduce((arr, w6) => { if (w6.length + tab.length >= width || arr[arr.length - 1].length + w6.length + 1 < width) arr[arr.length - 1] += ` ${w6}`; else arr.push(`${tab}${w6}`); return arr; }, [tab]).join("\n")).join("\n"); }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.js var require_entriesToDisplay = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = (cursor, total, maxVisible) => { maxVisible = maxVisible || total; let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2)); if (startIndex < 0) startIndex = 0; let endIndex = Math.min(startIndex + maxVisible, total); return { startIndex, endIndex }; }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.js var require_util8 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = { action: require_action(), clear: require_clear(), style: require_style(), strip: require_strip(), figures: require_figures(), lines: require_lines(), wrap: require_wrap(), entriesToDisplay: require_entriesToDisplay() }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.js var require_prompt = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.js"(exports2, module3) { "use strict"; init_import_meta_url(); var readline4 = require("readline"); var _require = require_util8(); var action = _require.action; var EventEmitter5 = require("events"); var _require2 = require_src(); var beep = _require2.beep; var cursor = _require2.cursor; var color = require_kleur(); var Prompt = class extends EventEmitter5 { constructor(opts = {}) { super(); this.firstRender = true; this.in = opts.stdin || process.stdin; this.out = opts.stdout || process.stdout; this.onRender = (opts.onRender || (() => void 0)).bind(this); const rl = readline4.createInterface({ input: this.in, escapeCodeTimeout: 50 }); readline4.emitKeypressEvents(this.in, rl); if (this.in.isTTY) this.in.setRawMode(true); const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1; const keypress = /* @__PURE__ */ __name((str, key) => { let a5 = action(key, isSelect); if (a5 === false) { this._ && this._(str, key); } else if (typeof this[a5] === "function") { this[a5](key); } else { this.bell(); } }, "keypress"); this.close = () => { this.out.write(cursor.show); this.in.removeListener("keypress", keypress); if (this.in.isTTY) this.in.setRawMode(false); rl.close(); this.emit(this.aborted ? "abort" : this.exited ? "exit" : "submit", this.value); this.closed = true; }; this.in.on("keypress", keypress); } fire() { this.emit("state", { value: this.value, aborted: !!this.aborted, exited: !!this.exited }); } bell() { this.out.write(beep); } render() { this.onRender(color); if (this.firstRender) this.firstRender = false; } }; __name(Prompt, "Prompt"); module3.exports = Prompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js var require_text = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js"(exports2, module3) { "use strict"; init_import_meta_url(); function asyncGeneratorStep(gen, resolve25, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error2) { reject(error2); return; } if (info.done) { resolve25(value); } else { Promise.resolve(value).then(_next, _throw); } } __name(asyncGeneratorStep, "asyncGeneratorStep"); function _asyncToGenerator(fn2) { return function() { var self2 = this, args = arguments; return new Promise(function(resolve25, reject) { var gen = fn2.apply(self2, args); function _next(value) { asyncGeneratorStep(gen, resolve25, reject, _next, _throw, "next", value); } __name(_next, "_next"); function _throw(err) { asyncGeneratorStep(gen, resolve25, reject, _next, _throw, "throw", err); } __name(_throw, "_throw"); _next(void 0); }); }; } __name(_asyncToGenerator, "_asyncToGenerator"); var color = require_kleur(); var Prompt = require_prompt(); var _require = require_src(); var erase = _require.erase; var cursor = _require.cursor; var _require2 = require_util8(); var style = _require2.style; var clear = _require2.clear; var lines = _require2.lines; var figures = _require2.figures; var TextPrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.transform = style.render(opts.style); this.scale = this.transform.scale; this.msg = opts.message; this.initial = opts.initial || ``; this.validator = opts.validate || (() => true); this.value = ``; this.errorMsg = opts.error || `Please Enter A Valid Value`; this.cursor = Number(!!this.initial); this.cursorOffset = 0; this.clear = clear(``, this.out.columns); this.render(); } set value(v7) { if (!v7 && this.initial) { this.placeholder = true; this.rendered = color.gray(this.transform.render(this.initial)); } else { this.placeholder = false; this.rendered = this.transform.render(v7); } this._value = v7; this.fire(); } get value() { return this._value; } reset() { this.value = ``; this.cursor = Number(!!this.initial); this.cursorOffset = 0; this.fire(); this.render(); } exit() { this.abort(); } abort() { this.value = this.value || this.initial; this.done = this.aborted = true; this.error = false; this.red = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } validate() { var _this = this; return _asyncToGenerator(function* () { let valid = yield _this.validator(_this.value); if (typeof valid === `string`) { _this.errorMsg = valid; valid = false; } _this.error = !valid; })(); } submit() { var _this2 = this; return _asyncToGenerator(function* () { _this2.value = _this2.value || _this2.initial; _this2.cursorOffset = 0; _this2.cursor = _this2.rendered.length; yield _this2.validate(); if (_this2.error) { _this2.red = true; _this2.fire(); _this2.render(); return; } _this2.done = true; _this2.aborted = false; _this2.fire(); _this2.render(); _this2.out.write("\n"); _this2.close(); })(); } next() { if (!this.placeholder) return this.bell(); this.value = this.initial; this.cursor = this.rendered.length; this.fire(); this.render(); } moveCursor(n6) { if (this.placeholder) return; this.cursor = this.cursor + n6; this.cursorOffset += n6; } _(c6, key) { let s1 = this.value.slice(0, this.cursor); let s22 = this.value.slice(this.cursor); this.value = `${s1}${c6}${s22}`; this.red = false; this.cursor = this.placeholder ? 0 : s1.length + 1; this.render(); } delete() { if (this.isCursorAtStart()) return this.bell(); let s1 = this.value.slice(0, this.cursor - 1); let s22 = this.value.slice(this.cursor); this.value = `${s1}${s22}`; this.red = false; if (this.isCursorAtStart()) { this.cursorOffset = 0; } else { this.cursorOffset++; this.moveCursor(-1); } this.render(); } deleteForward() { if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell(); let s1 = this.value.slice(0, this.cursor); let s22 = this.value.slice(this.cursor + 1); this.value = `${s1}${s22}`; this.red = false; if (this.isCursorAtEnd()) { this.cursorOffset = 0; } else { this.cursorOffset++; } this.render(); } first() { this.cursor = 0; this.render(); } last() { this.cursor = this.value.length; this.render(); } left() { if (this.cursor <= 0 || this.placeholder) return this.bell(); this.moveCursor(-1); this.render(); } right() { if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell(); this.moveCursor(1); this.render(); } isCursorAtStart() { return this.cursor === 0 || this.placeholder && this.cursor === 1; } isCursorAtEnd() { return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1; } render() { if (this.closed) return; if (!this.firstRender) { if (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns)); this.out.write(clear(this.outputText, this.out.columns)); } super.render(); this.outputError = ""; this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.red ? color.red(this.rendered) : this.rendered].join(` `); if (this.error) { this.outputError += this.errorMsg.split(` `).reduce((a5, l6, i5) => a5 + ` ${i5 ? " " : figures.pointerSmall} ${color.red().italic(l6)}`, ``); } this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0)); } }; __name(TextPrompt, "TextPrompt"); module3.exports = TextPrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.js var require_select = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.js"(exports2, module3) { "use strict"; init_import_meta_url(); var color = require_kleur(); var Prompt = require_prompt(); var _require = require_util8(); var style = _require.style; var clear = _require.clear; var figures = _require.figures; var wrap4 = _require.wrap; var entriesToDisplay = _require.entriesToDisplay; var _require2 = require_src(); var cursor = _require2.cursor; var SelectPrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.msg = opts.message; this.hint = opts.hint || "- Use arrow-keys. Return to submit."; this.warn = opts.warn || "- This option is disabled"; this.cursor = opts.initial || 0; this.choices = opts.choices.map((ch2, idx) => { if (typeof ch2 === "string") ch2 = { title: ch2, value: idx }; return { title: ch2 && (ch2.title || ch2.value || ch2), value: ch2 && (ch2.value === void 0 ? idx : ch2.value), description: ch2 && ch2.description, selected: ch2 && ch2.selected, disabled: ch2 && ch2.disabled }; }); this.optionsPerPage = opts.optionsPerPage || 10; this.value = (this.choices[this.cursor] || {}).value; this.clear = clear("", this.out.columns); this.render(); } moveCursor(n6) { this.cursor = n6; this.value = this.choices[n6].value; this.fire(); } reset() { this.moveCursor(0); this.fire(); this.render(); } exit() { this.abort(); } abort() { this.done = this.aborted = true; this.fire(); this.render(); this.out.write("\n"); this.close(); } submit() { if (!this.selection.disabled) { this.done = true; this.aborted = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } else this.bell(); } first() { this.moveCursor(0); this.render(); } last() { this.moveCursor(this.choices.length - 1); this.render(); } up() { if (this.cursor === 0) { this.moveCursor(this.choices.length - 1); } else { this.moveCursor(this.cursor - 1); } this.render(); } down() { if (this.cursor === this.choices.length - 1) { this.moveCursor(0); } else { this.moveCursor(this.cursor + 1); } this.render(); } next() { this.moveCursor((this.cursor + 1) % this.choices.length); this.render(); } _(c6, key) { if (c6 === " ") return this.submit(); } get selection() { return this.choices[this.cursor]; } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); else this.out.write(clear(this.outputText, this.out.columns)); super.render(); let _entriesToDisplay = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex; this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.done ? this.selection.title : this.selection.disabled ? color.yellow(this.warn) : color.gray(this.hint)].join(" "); if (!this.done) { this.outputText += "\n"; for (let i5 = startIndex; i5 < endIndex; i5++) { let title, prefix, desc = "", v7 = this.choices[i5]; if (i5 === startIndex && startIndex > 0) { prefix = figures.arrowUp; } else if (i5 === endIndex - 1 && endIndex < this.choices.length) { prefix = figures.arrowDown; } else { prefix = " "; } if (v7.disabled) { title = this.cursor === i5 ? color.gray().underline(v7.title) : color.strikethrough().gray(v7.title); prefix = (this.cursor === i5 ? color.bold().gray(figures.pointer) + " " : " ") + prefix; } else { title = this.cursor === i5 ? color.cyan().underline(v7.title) : v7.title; prefix = (this.cursor === i5 ? color.cyan(figures.pointer) + " " : " ") + prefix; if (v7.description && this.cursor === i5) { desc = ` - ${v7.description}`; if (prefix.length + title.length + desc.length >= this.out.columns || v7.description.split(/\r?\n/).length > 1) { desc = "\n" + wrap4(v7.description, { margin: 3, width: this.out.columns }); } } } this.outputText += `${prefix} ${title}${color.gray(desc)} `; } } this.out.write(this.outputText); } }; __name(SelectPrompt, "SelectPrompt"); module3.exports = SelectPrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.js var require_toggle = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.js"(exports2, module3) { "use strict"; init_import_meta_url(); var color = require_kleur(); var Prompt = require_prompt(); var _require = require_util8(); var style = _require.style; var clear = _require.clear; var _require2 = require_src(); var cursor = _require2.cursor; var erase = _require2.erase; var TogglePrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.msg = opts.message; this.value = !!opts.initial; this.active = opts.active || "on"; this.inactive = opts.inactive || "off"; this.initialValue = this.value; this.render(); } reset() { this.value = this.initialValue; this.fire(); this.render(); } exit() { this.abort(); } abort() { this.done = this.aborted = true; this.fire(); this.render(); this.out.write("\n"); this.close(); } submit() { this.done = true; this.aborted = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } deactivate() { if (this.value === false) return this.bell(); this.value = false; this.render(); } activate() { if (this.value === true) return this.bell(); this.value = true; this.render(); } delete() { this.deactivate(); } left() { this.deactivate(); } right() { this.activate(); } down() { this.deactivate(); } up() { this.activate(); } next() { this.value = !this.value; this.fire(); this.render(); } _(c6, key) { if (c6 === " ") { this.value = !this.value; } else if (c6 === "1") { this.value = true; } else if (c6 === "0") { this.value = false; } else return this.bell(); this.render(); } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); else this.out.write(clear(this.outputText, this.out.columns)); super.render(); this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.value ? this.inactive : color.cyan().underline(this.inactive), color.gray("/"), this.value ? color.cyan().underline(this.active) : this.active].join(" "); this.out.write(erase.line + cursor.to(0) + this.outputText); } }; __name(TogglePrompt, "TogglePrompt"); module3.exports = TogglePrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.js var require_datepart = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = class { constructor({ token, date, parts, locales }) { this.token = token; this.date = date || /* @__PURE__ */ new Date(); this.parts = parts || [this]; this.locales = locales || {}; } up() { } down() { } next() { const currentIdx = this.parts.indexOf(this); return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart); } setTo(val2) { } prev() { let parts = [].concat(this.parts).reverse(); const currentIdx = parts.indexOf(this); return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart); } toString() { return String(this.date); } }; __name(DatePart, "DatePart"); module3.exports = DatePart; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.js var require_meridiem = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart(); var Meridiem = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setHours((this.date.getHours() + 12) % 24); } down() { this.up(); } toString() { let meridiem = this.date.getHours() > 12 ? "pm" : "am"; return /\A/.test(this.token) ? meridiem.toUpperCase() : meridiem; } }; __name(Meridiem, "Meridiem"); module3.exports = Meridiem; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.js var require_day = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart(); var pos = /* @__PURE__ */ __name((n6) => { n6 = n6 % 10; return n6 === 1 ? "st" : n6 === 2 ? "nd" : n6 === 3 ? "rd" : "th"; }, "pos"); var Day = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setDate(this.date.getDate() + 1); } down() { this.date.setDate(this.date.getDate() - 1); } setTo(val2) { this.date.setDate(parseInt(val2.substr(-2))); } toString() { let date = this.date.getDate(); let day2 = this.date.getDay(); return this.token === "DD" ? String(date).padStart(2, "0") : this.token === "Do" ? date + pos(date) : this.token === "d" ? day2 + 1 : this.token === "ddd" ? this.locales.weekdaysShort[day2] : this.token === "dddd" ? this.locales.weekdays[day2] : date; } }; __name(Day, "Day"); module3.exports = Day; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.js var require_hours = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart(); var Hours = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setHours(this.date.getHours() + 1); } down() { this.date.setHours(this.date.getHours() - 1); } setTo(val2) { this.date.setHours(parseInt(val2.substr(-2))); } toString() { let hours = this.date.getHours(); if (/h/.test(this.token)) hours = hours % 12 || 12; return this.token.length > 1 ? String(hours).padStart(2, "0") : hours; } }; __name(Hours, "Hours"); module3.exports = Hours; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.js var require_milliseconds = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart(); var Milliseconds = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setMilliseconds(this.date.getMilliseconds() + 1); } down() { this.date.setMilliseconds(this.date.getMilliseconds() - 1); } setTo(val2) { this.date.setMilliseconds(parseInt(val2.substr(-this.token.length))); } toString() { return String(this.date.getMilliseconds()).padStart(4, "0").substr(0, this.token.length); } }; __name(Milliseconds, "Milliseconds"); module3.exports = Milliseconds; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.js var require_minutes = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart(); var Minutes = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setMinutes(this.date.getMinutes() + 1); } down() { this.date.setMinutes(this.date.getMinutes() - 1); } setTo(val2) { this.date.setMinutes(parseInt(val2.substr(-2))); } toString() { let m6 = this.date.getMinutes(); return this.token.length > 1 ? String(m6).padStart(2, "0") : m6; } }; __name(Minutes, "Minutes"); module3.exports = Minutes; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.js var require_month = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart(); var Month = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setMonth(this.date.getMonth() + 1); } down() { this.date.setMonth(this.date.getMonth() - 1); } setTo(val2) { val2 = parseInt(val2.substr(-2)) - 1; this.date.setMonth(val2 < 0 ? 0 : val2); } toString() { let month2 = this.date.getMonth(); let tl = this.token.length; return tl === 2 ? String(month2 + 1).padStart(2, "0") : tl === 3 ? this.locales.monthsShort[month2] : tl === 4 ? this.locales.months[month2] : String(month2 + 1); } }; __name(Month, "Month"); module3.exports = Month; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.js var require_seconds = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart(); var Seconds = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setSeconds(this.date.getSeconds() + 1); } down() { this.date.setSeconds(this.date.getSeconds() - 1); } setTo(val2) { this.date.setSeconds(parseInt(val2.substr(-2))); } toString() { let s5 = this.date.getSeconds(); return this.token.length > 1 ? String(s5).padStart(2, "0") : s5; } }; __name(Seconds, "Seconds"); module3.exports = Seconds; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.js var require_year = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart(); var Year = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setFullYear(this.date.getFullYear() + 1); } down() { this.date.setFullYear(this.date.getFullYear() - 1); } setTo(val2) { this.date.setFullYear(val2.substr(-4)); } toString() { let year2 = String(this.date.getFullYear()).padStart(4, "0"); return this.token.length === 2 ? year2.substr(-2) : year2; } }; __name(Year, "Year"); module3.exports = Year; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.js var require_dateparts = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = { DatePart: require_datepart(), Meridiem: require_meridiem(), Day: require_day(), Hours: require_hours(), Milliseconds: require_milliseconds(), Minutes: require_minutes(), Month: require_month(), Seconds: require_seconds(), Year: require_year() }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js var require_date = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js"(exports2, module3) { "use strict"; init_import_meta_url(); function asyncGeneratorStep(gen, resolve25, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error2) { reject(error2); return; } if (info.done) { resolve25(value); } else { Promise.resolve(value).then(_next, _throw); } } __name(asyncGeneratorStep, "asyncGeneratorStep"); function _asyncToGenerator(fn2) { return function() { var self2 = this, args = arguments; return new Promise(function(resolve25, reject) { var gen = fn2.apply(self2, args); function _next(value) { asyncGeneratorStep(gen, resolve25, reject, _next, _throw, "next", value); } __name(_next, "_next"); function _throw(err) { asyncGeneratorStep(gen, resolve25, reject, _next, _throw, "throw", err); } __name(_throw, "_throw"); _next(void 0); }); }; } __name(_asyncToGenerator, "_asyncToGenerator"); var color = require_kleur(); var Prompt = require_prompt(); var _require = require_util8(); var style = _require.style; var clear = _require.clear; var figures = _require.figures; var _require2 = require_src(); var erase = _require2.erase; var cursor = _require2.cursor; var _require3 = require_dateparts(); var DatePart = _require3.DatePart; var Meridiem = _require3.Meridiem; var Day = _require3.Day; var Hours = _require3.Hours; var Milliseconds = _require3.Milliseconds; var Minutes = _require3.Minutes; var Month = _require3.Month; var Seconds = _require3.Seconds; var Year = _require3.Year; var regex2 = /\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g; var regexGroups = { 1: ({ token }) => token.replace(/\\(.)/g, "$1"), 2: (opts) => new Day(opts), // Day // TODO 3: (opts) => new Month(opts), // Month 4: (opts) => new Year(opts), // Year 5: (opts) => new Meridiem(opts), // AM/PM // TODO (special) 6: (opts) => new Hours(opts), // Hours 7: (opts) => new Minutes(opts), // Minutes 8: (opts) => new Seconds(opts), // Seconds 9: (opts) => new Milliseconds(opts) // Fractional seconds }; var dfltLocales = { months: "January,February,March,April,May,June,July,August,September,October,November,December".split(","), monthsShort: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","), weekdays: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","), weekdaysShort: "Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",") }; var DatePrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.msg = opts.message; this.cursor = 0; this.typed = ""; this.locales = Object.assign(dfltLocales, opts.locales); this._date = opts.initial || /* @__PURE__ */ new Date(); this.errorMsg = opts.error || "Please Enter A Valid Value"; this.validator = opts.validate || (() => true); this.mask = opts.mask || "YYYY-MM-DD HH:mm:ss"; this.clear = clear("", this.out.columns); this.render(); } get value() { return this.date; } get date() { return this._date; } set date(date) { if (date) this._date.setTime(date.getTime()); } set mask(mask) { let result; this.parts = []; while (result = regex2.exec(mask)) { let match2 = result.shift(); let idx = result.findIndex((gr) => gr != null); this.parts.push(idx in regexGroups ? regexGroups[idx]({ token: result[idx] || match2, date: this.date, parts: this.parts, locales: this.locales }) : result[idx] || match2); } let parts = this.parts.reduce((arr, i5) => { if (typeof i5 === "string" && typeof arr[arr.length - 1] === "string") arr[arr.length - 1] += i5; else arr.push(i5); return arr; }, []); this.parts.splice(0); this.parts.push(...parts); this.reset(); } moveCursor(n6) { this.typed = ""; this.cursor = n6; this.fire(); } reset() { this.moveCursor(this.parts.findIndex((p6) => p6 instanceof DatePart)); this.fire(); this.render(); } exit() { this.abort(); } abort() { this.done = this.aborted = true; this.error = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } validate() { var _this = this; return _asyncToGenerator(function* () { let valid = yield _this.validator(_this.value); if (typeof valid === "string") { _this.errorMsg = valid; valid = false; } _this.error = !valid; })(); } submit() { var _this2 = this; return _asyncToGenerator(function* () { yield _this2.validate(); if (_this2.error) { _this2.color = "red"; _this2.fire(); _this2.render(); return; } _this2.done = true; _this2.aborted = false; _this2.fire(); _this2.render(); _this2.out.write("\n"); _this2.close(); })(); } up() { this.typed = ""; this.parts[this.cursor].up(); this.render(); } down() { this.typed = ""; this.parts[this.cursor].down(); this.render(); } left() { let prev = this.parts[this.cursor].prev(); if (prev == null) return this.bell(); this.moveCursor(this.parts.indexOf(prev)); this.render(); } right() { let next = this.parts[this.cursor].next(); if (next == null) return this.bell(); this.moveCursor(this.parts.indexOf(next)); this.render(); } next() { let next = this.parts[this.cursor].next(); this.moveCursor(next ? this.parts.indexOf(next) : this.parts.findIndex((part) => part instanceof DatePart)); this.render(); } _(c6) { if (/\d/.test(c6)) { this.typed += c6; this.parts[this.cursor].setTo(this.typed); this.render(); } } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); else this.out.write(clear(this.outputText, this.out.columns)); super.render(); this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.parts.reduce((arr, p6, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p6.toString()) : p6), []).join("")].join(" "); if (this.error) { this.outputText += this.errorMsg.split("\n").reduce((a5, l6, i5) => a5 + ` ${i5 ? ` ` : figures.pointerSmall} ${color.red().italic(l6)}`, ``); } this.out.write(erase.line + cursor.to(0) + this.outputText); } }; __name(DatePrompt, "DatePrompt"); module3.exports = DatePrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js var require_number = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js"(exports2, module3) { "use strict"; init_import_meta_url(); function asyncGeneratorStep(gen, resolve25, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error2) { reject(error2); return; } if (info.done) { resolve25(value); } else { Promise.resolve(value).then(_next, _throw); } } __name(asyncGeneratorStep, "asyncGeneratorStep"); function _asyncToGenerator(fn2) { return function() { var self2 = this, args = arguments; return new Promise(function(resolve25, reject) { var gen = fn2.apply(self2, args); function _next(value) { asyncGeneratorStep(gen, resolve25, reject, _next, _throw, "next", value); } __name(_next, "_next"); function _throw(err) { asyncGeneratorStep(gen, resolve25, reject, _next, _throw, "throw", err); } __name(_throw, "_throw"); _next(void 0); }); }; } __name(_asyncToGenerator, "_asyncToGenerator"); var color = require_kleur(); var Prompt = require_prompt(); var _require = require_src(); var cursor = _require.cursor; var erase = _require.erase; var _require2 = require_util8(); var style = _require2.style; var figures = _require2.figures; var clear = _require2.clear; var lines = _require2.lines; var isNumber2 = /[0-9]/; var isDef = /* @__PURE__ */ __name((any) => any !== void 0, "isDef"); var round = /* @__PURE__ */ __name((number, precision) => { let factor = Math.pow(10, precision); return Math.round(number * factor) / factor; }, "round"); var NumberPrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.transform = style.render(opts.style); this.msg = opts.message; this.initial = isDef(opts.initial) ? opts.initial : ""; this.float = !!opts.float; this.round = opts.round || 2; this.inc = opts.increment || 1; this.min = isDef(opts.min) ? opts.min : -Infinity; this.max = isDef(opts.max) ? opts.max : Infinity; this.errorMsg = opts.error || `Please Enter A Valid Value`; this.validator = opts.validate || (() => true); this.color = `cyan`; this.value = ``; this.typed = ``; this.lastHit = 0; this.render(); } set value(v7) { if (!v7 && v7 !== 0) { this.placeholder = true; this.rendered = color.gray(this.transform.render(`${this.initial}`)); this._value = ``; } else { this.placeholder = false; this.rendered = this.transform.render(`${round(v7, this.round)}`); this._value = round(v7, this.round); } this.fire(); } get value() { return this._value; } parse(x6) { return this.float ? parseFloat(x6) : parseInt(x6); } valid(c6) { return c6 === `-` || c6 === `.` && this.float || isNumber2.test(c6); } reset() { this.typed = ``; this.value = ``; this.fire(); this.render(); } exit() { this.abort(); } abort() { let x6 = this.value; this.value = x6 !== `` ? x6 : this.initial; this.done = this.aborted = true; this.error = false; this.fire(); this.render(); this.out.write(` `); this.close(); } validate() { var _this = this; return _asyncToGenerator(function* () { let valid = yield _this.validator(_this.value); if (typeof valid === `string`) { _this.errorMsg = valid; valid = false; } _this.error = !valid; })(); } submit() { var _this2 = this; return _asyncToGenerator(function* () { yield _this2.validate(); if (_this2.error) { _this2.color = `red`; _this2.fire(); _this2.render(); return; } let x6 = _this2.value; _this2.value = x6 !== `` ? x6 : _this2.initial; _this2.done = true; _this2.aborted = false; _this2.error = false; _this2.fire(); _this2.render(); _this2.out.write(` `); _this2.close(); })(); } up() { this.typed = ``; if (this.value === "") { this.value = this.min - this.inc; } if (this.value >= this.max) return this.bell(); this.value += this.inc; this.color = `cyan`; this.fire(); this.render(); } down() { this.typed = ``; if (this.value === "") { this.value = this.min + this.inc; } if (this.value <= this.min) return this.bell(); this.value -= this.inc; this.color = `cyan`; this.fire(); this.render(); } delete() { let val2 = this.value.toString(); if (val2.length === 0) return this.bell(); this.value = this.parse(val2 = val2.slice(0, -1)) || ``; if (this.value !== "" && this.value < this.min) { this.value = this.min; } this.color = `cyan`; this.fire(); this.render(); } next() { this.value = this.initial; this.fire(); this.render(); } _(c6, key) { if (!this.valid(c6)) return this.bell(); const now = Date.now(); if (now - this.lastHit > 1e3) this.typed = ``; this.typed += c6; this.lastHit = now; this.color = `cyan`; if (c6 === `.`) return this.fire(); this.value = Math.min(this.parse(this.typed), this.max); if (this.value > this.max) this.value = this.max; if (this.value < this.min) this.value = this.min; this.fire(); this.render(); } render() { if (this.closed) return; if (!this.firstRender) { if (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns)); this.out.write(clear(this.outputText, this.out.columns)); } super.render(); this.outputError = ""; this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), !this.done || !this.done && !this.placeholder ? color[this.color]().underline(this.rendered) : this.rendered].join(` `); if (this.error) { this.outputError += this.errorMsg.split(` `).reduce((a5, l6, i5) => a5 + ` ${i5 ? ` ` : figures.pointerSmall} ${color.red().italic(l6)}`, ``); } this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore); } }; __name(NumberPrompt, "NumberPrompt"); module3.exports = NumberPrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.js var require_multiselect = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.js"(exports2, module3) { "use strict"; init_import_meta_url(); var color = require_kleur(); var _require = require_src(); var cursor = _require.cursor; var Prompt = require_prompt(); var _require2 = require_util8(); var clear = _require2.clear; var figures = _require2.figures; var style = _require2.style; var wrap4 = _require2.wrap; var entriesToDisplay = _require2.entriesToDisplay; var MultiselectPrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.msg = opts.message; this.cursor = opts.cursor || 0; this.scrollIndex = opts.cursor || 0; this.hint = opts.hint || ""; this.warn = opts.warn || "- This option is disabled -"; this.minSelected = opts.min; this.showMinError = false; this.maxChoices = opts.max; this.instructions = opts.instructions; this.optionsPerPage = opts.optionsPerPage || 10; this.value = opts.choices.map((ch2, idx) => { if (typeof ch2 === "string") ch2 = { title: ch2, value: idx }; return { title: ch2 && (ch2.title || ch2.value || ch2), description: ch2 && ch2.description, value: ch2 && (ch2.value === void 0 ? idx : ch2.value), selected: ch2 && ch2.selected, disabled: ch2 && ch2.disabled }; }); this.clear = clear("", this.out.columns); if (!opts.overrideRender) { this.render(); } } reset() { this.value.map((v7) => !v7.selected); this.cursor = 0; this.fire(); this.render(); } selected() { return this.value.filter((v7) => v7.selected); } exit() { this.abort(); } abort() { this.done = this.aborted = true; this.fire(); this.render(); this.out.write("\n"); this.close(); } submit() { const selected = this.value.filter((e7) => e7.selected); if (this.minSelected && selected.length < this.minSelected) { this.showMinError = true; this.render(); } else { this.done = true; this.aborted = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } } first() { this.cursor = 0; this.render(); } last() { this.cursor = this.value.length - 1; this.render(); } next() { this.cursor = (this.cursor + 1) % this.value.length; this.render(); } up() { if (this.cursor === 0) { this.cursor = this.value.length - 1; } else { this.cursor--; } this.render(); } down() { if (this.cursor === this.value.length - 1) { this.cursor = 0; } else { this.cursor++; } this.render(); } left() { this.value[this.cursor].selected = false; this.render(); } right() { if (this.value.filter((e7) => e7.selected).length >= this.maxChoices) return this.bell(); this.value[this.cursor].selected = true; this.render(); } handleSpaceToggle() { const v7 = this.value[this.cursor]; if (v7.selected) { v7.selected = false; this.render(); } else if (v7.disabled || this.value.filter((e7) => e7.selected).length >= this.maxChoices) { return this.bell(); } else { v7.selected = true; this.render(); } } toggleAll() { if (this.maxChoices !== void 0 || this.value[this.cursor].disabled) { return this.bell(); } const newSelected = !this.value[this.cursor].selected; this.value.filter((v7) => !v7.disabled).forEach((v7) => v7.selected = newSelected); this.render(); } _(c6, key) { if (c6 === " ") { this.handleSpaceToggle(); } else if (c6 === "a") { this.toggleAll(); } else { return this.bell(); } } renderInstructions() { if (this.instructions === void 0 || this.instructions) { if (typeof this.instructions === "string") { return this.instructions; } return ` Instructions: ${figures.arrowUp}/${figures.arrowDown}: Highlight option ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection ` + (this.maxChoices === void 0 ? ` a: Toggle all ` : "") + ` enter/return: Complete answer`; } return ""; } renderOption(cursor2, v7, i5, arrowIndicator) { const prefix = (v7.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + arrowIndicator + " "; let title, desc; if (v7.disabled) { title = cursor2 === i5 ? color.gray().underline(v7.title) : color.strikethrough().gray(v7.title); } else { title = cursor2 === i5 ? color.cyan().underline(v7.title) : v7.title; if (cursor2 === i5 && v7.description) { desc = ` - ${v7.description}`; if (prefix.length + title.length + desc.length >= this.out.columns || v7.description.split(/\r?\n/).length > 1) { desc = "\n" + wrap4(v7.description, { margin: prefix.length, width: this.out.columns }); } } } return prefix + title + color.gray(desc || ""); } // shared with autocompleteMultiselect paginateOptions(options32) { if (options32.length === 0) { return color.red("No matches for this query."); } let _entriesToDisplay = entriesToDisplay(this.cursor, options32.length, this.optionsPerPage), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex; let prefix, styledOptions = []; for (let i5 = startIndex; i5 < endIndex; i5++) { if (i5 === startIndex && startIndex > 0) { prefix = figures.arrowUp; } else if (i5 === endIndex - 1 && endIndex < options32.length) { prefix = figures.arrowDown; } else { prefix = " "; } styledOptions.push(this.renderOption(this.cursor, options32[i5], i5, prefix)); } return "\n" + styledOptions.join("\n"); } // shared with autocomleteMultiselect renderOptions(options32) { if (!this.done) { return this.paginateOptions(options32); } return ""; } renderDoneOrInstructions() { if (this.done) { return this.value.filter((e7) => e7.selected).map((v7) => v7.title).join(", "); } const output = [color.gray(this.hint), this.renderInstructions()]; if (this.value[this.cursor].disabled) { output.push(color.yellow(this.warn)); } return output.join(" "); } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); super.render(); let prompt2 = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" "); if (this.showMinError) { prompt2 += color.red(`You must select a minimum of ${this.minSelected} choices.`); this.showMinError = false; } prompt2 += this.renderOptions(this.value); this.out.write(this.clear + prompt2); this.clear = clear(prompt2, this.out.columns); } }; __name(MultiselectPrompt, "MultiselectPrompt"); module3.exports = MultiselectPrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js var require_autocomplete = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js"(exports2, module3) { "use strict"; init_import_meta_url(); function asyncGeneratorStep(gen, resolve25, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error2) { reject(error2); return; } if (info.done) { resolve25(value); } else { Promise.resolve(value).then(_next, _throw); } } __name(asyncGeneratorStep, "asyncGeneratorStep"); function _asyncToGenerator(fn2) { return function() { var self2 = this, args = arguments; return new Promise(function(resolve25, reject) { var gen = fn2.apply(self2, args); function _next(value) { asyncGeneratorStep(gen, resolve25, reject, _next, _throw, "next", value); } __name(_next, "_next"); function _throw(err) { asyncGeneratorStep(gen, resolve25, reject, _next, _throw, "throw", err); } __name(_throw, "_throw"); _next(void 0); }); }; } __name(_asyncToGenerator, "_asyncToGenerator"); var color = require_kleur(); var Prompt = require_prompt(); var _require = require_src(); var erase = _require.erase; var cursor = _require.cursor; var _require2 = require_util8(); var style = _require2.style; var clear = _require2.clear; var figures = _require2.figures; var wrap4 = _require2.wrap; var entriesToDisplay = _require2.entriesToDisplay; var getVal = /* @__PURE__ */ __name((arr, i5) => arr[i5] && (arr[i5].value || arr[i5].title || arr[i5]), "getVal"); var getTitle = /* @__PURE__ */ __name((arr, i5) => arr[i5] && (arr[i5].title || arr[i5].value || arr[i5]), "getTitle"); var getIndex2 = /* @__PURE__ */ __name((arr, valOrTitle) => { const index = arr.findIndex((el) => el.value === valOrTitle || el.title === valOrTitle); return index > -1 ? index : void 0; }, "getIndex"); var AutocompletePrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.msg = opts.message; this.suggest = opts.suggest; this.choices = opts.choices; this.initial = typeof opts.initial === "number" ? opts.initial : getIndex2(opts.choices, opts.initial); this.select = this.initial || opts.cursor || 0; this.i18n = { noMatches: opts.noMatches || "no matches found" }; this.fallback = opts.fallback || this.initial; this.clearFirst = opts.clearFirst || false; this.suggestions = []; this.input = ""; this.limit = opts.limit || 10; this.cursor = 0; this.transform = style.render(opts.style); this.scale = this.transform.scale; this.render = this.render.bind(this); this.complete = this.complete.bind(this); this.clear = clear("", this.out.columns); this.complete(this.render); this.render(); } set fallback(fb) { this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb; } get fallback() { let choice; if (typeof this._fb === "number") choice = this.choices[this._fb]; else if (typeof this._fb === "string") choice = { title: this._fb }; return choice || this._fb || { title: this.i18n.noMatches }; } moveSelect(i5) { this.select = i5; if (this.suggestions.length > 0) this.value = getVal(this.suggestions, i5); else this.value = this.fallback.value; this.fire(); } complete(cb2) { var _this = this; return _asyncToGenerator(function* () { const p6 = _this.completing = _this.suggest(_this.input, _this.choices); const suggestions = yield p6; if (_this.completing !== p6) return; _this.suggestions = suggestions.map((s5, i5, arr) => ({ title: getTitle(arr, i5), value: getVal(arr, i5), description: s5.description })); _this.completing = false; const l6 = Math.max(suggestions.length - 1, 0); _this.moveSelect(Math.min(l6, _this.select)); cb2 && cb2(); })(); } reset() { this.input = ""; this.complete(() => { this.moveSelect(this.initial !== void 0 ? this.initial : 0); this.render(); }); this.render(); } exit() { if (this.clearFirst && this.input.length > 0) { this.reset(); } else { this.done = this.exited = true; this.aborted = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } } abort() { this.done = this.aborted = true; this.exited = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } submit() { this.done = true; this.aborted = this.exited = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } _(c6, key) { let s1 = this.input.slice(0, this.cursor); let s22 = this.input.slice(this.cursor); this.input = `${s1}${c6}${s22}`; this.cursor = s1.length + 1; this.complete(this.render); this.render(); } delete() { if (this.cursor === 0) return this.bell(); let s1 = this.input.slice(0, this.cursor - 1); let s22 = this.input.slice(this.cursor); this.input = `${s1}${s22}`; this.complete(this.render); this.cursor = this.cursor - 1; this.render(); } deleteForward() { if (this.cursor * this.scale >= this.rendered.length) return this.bell(); let s1 = this.input.slice(0, this.cursor); let s22 = this.input.slice(this.cursor + 1); this.input = `${s1}${s22}`; this.complete(this.render); this.render(); } first() { this.moveSelect(0); this.render(); } last() { this.moveSelect(this.suggestions.length - 1); this.render(); } up() { if (this.select === 0) { this.moveSelect(this.suggestions.length - 1); } else { this.moveSelect(this.select - 1); } this.render(); } down() { if (this.select === this.suggestions.length - 1) { this.moveSelect(0); } else { this.moveSelect(this.select + 1); } this.render(); } next() { if (this.select === this.suggestions.length - 1) { this.moveSelect(0); } else this.moveSelect(this.select + 1); this.render(); } nextPage() { this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1)); this.render(); } prevPage() { this.moveSelect(Math.max(this.select - this.limit, 0)); this.render(); } left() { if (this.cursor <= 0) return this.bell(); this.cursor = this.cursor - 1; this.render(); } right() { if (this.cursor * this.scale >= this.rendered.length) return this.bell(); this.cursor = this.cursor + 1; this.render(); } renderOption(v7, hovered, isStart, isEnd) { let desc; let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : " "; let title = hovered ? color.cyan().underline(v7.title) : v7.title; prefix = (hovered ? color.cyan(figures.pointer) + " " : " ") + prefix; if (v7.description) { desc = ` - ${v7.description}`; if (prefix.length + title.length + desc.length >= this.out.columns || v7.description.split(/\r?\n/).length > 1) { desc = "\n" + wrap4(v7.description, { margin: 3, width: this.out.columns }); } } return prefix + " " + title + color.gray(desc || ""); } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); else this.out.write(clear(this.outputText, this.out.columns)); super.render(); let _entriesToDisplay = entriesToDisplay(this.select, this.choices.length, this.limit), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex; this.outputText = [style.symbol(this.done, this.aborted, this.exited), color.bold(this.msg), style.delimiter(this.completing), this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)].join(" "); if (!this.done) { const suggestions = this.suggestions.slice(startIndex, endIndex).map((item, i5) => this.renderOption(item, this.select === i5 + startIndex, i5 === 0 && startIndex > 0, i5 + startIndex === endIndex - 1 && endIndex < this.choices.length)).join("\n"); this.outputText += ` ` + (suggestions || color.gray(this.fallback.title)); } this.out.write(erase.line + cursor.to(0) + this.outputText); } }; __name(AutocompletePrompt, "AutocompletePrompt"); module3.exports = AutocompletePrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.js var require_autocompleteMultiselect = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.js"(exports2, module3) { "use strict"; init_import_meta_url(); var color = require_kleur(); var _require = require_src(); var cursor = _require.cursor; var MultiselectPrompt = require_multiselect(); var _require2 = require_util8(); var clear = _require2.clear; var style = _require2.style; var figures = _require2.figures; var AutocompleteMultiselectPrompt = class extends MultiselectPrompt { constructor(opts = {}) { opts.overrideRender = true; super(opts); this.inputValue = ""; this.clear = clear("", this.out.columns); this.filteredOptions = this.value; this.render(); } last() { this.cursor = this.filteredOptions.length - 1; this.render(); } next() { this.cursor = (this.cursor + 1) % this.filteredOptions.length; this.render(); } up() { if (this.cursor === 0) { this.cursor = this.filteredOptions.length - 1; } else { this.cursor--; } this.render(); } down() { if (this.cursor === this.filteredOptions.length - 1) { this.cursor = 0; } else { this.cursor++; } this.render(); } left() { this.filteredOptions[this.cursor].selected = false; this.render(); } right() { if (this.value.filter((e7) => e7.selected).length >= this.maxChoices) return this.bell(); this.filteredOptions[this.cursor].selected = true; this.render(); } delete() { if (this.inputValue.length) { this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1); this.updateFilteredOptions(); } } updateFilteredOptions() { const currentHighlight = this.filteredOptions[this.cursor]; this.filteredOptions = this.value.filter((v7) => { if (this.inputValue) { if (typeof v7.title === "string") { if (v7.title.toLowerCase().includes(this.inputValue.toLowerCase())) { return true; } } if (typeof v7.value === "string") { if (v7.value.toLowerCase().includes(this.inputValue.toLowerCase())) { return true; } } return false; } return true; }); const newHighlightIndex = this.filteredOptions.findIndex((v7) => v7 === currentHighlight); this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex; this.render(); } handleSpaceToggle() { const v7 = this.filteredOptions[this.cursor]; if (v7.selected) { v7.selected = false; this.render(); } else if (v7.disabled || this.value.filter((e7) => e7.selected).length >= this.maxChoices) { return this.bell(); } else { v7.selected = true; this.render(); } } handleInputChange(c6) { this.inputValue = this.inputValue + c6; this.updateFilteredOptions(); } _(c6, key) { if (c6 === " ") { this.handleSpaceToggle(); } else { this.handleInputChange(c6); } } renderInstructions() { if (this.instructions === void 0 || this.instructions) { if (typeof this.instructions === "string") { return this.instructions; } return ` Instructions: ${figures.arrowUp}/${figures.arrowDown}: Highlight option ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection [a,b,c]/delete: Filter choices enter/return: Complete answer `; } return ""; } renderCurrentInput() { return ` Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter something to filter")} `; } renderOption(cursor2, v7, i5) { let title; if (v7.disabled) title = cursor2 === i5 ? color.gray().underline(v7.title) : color.strikethrough().gray(v7.title); else title = cursor2 === i5 ? color.cyan().underline(v7.title) : v7.title; return (v7.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + title; } renderDoneOrInstructions() { if (this.done) { return this.value.filter((e7) => e7.selected).map((v7) => v7.title).join(", "); } const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()]; if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) { output.push(color.yellow(this.warn)); } return output.join(" "); } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); super.render(); let prompt2 = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" "); if (this.showMinError) { prompt2 += color.red(`You must select a minimum of ${this.minSelected} choices.`); this.showMinError = false; } prompt2 += this.renderOptions(this.filteredOptions); this.out.write(this.clear + prompt2); this.clear = clear(prompt2, this.out.columns); } }; __name(AutocompleteMultiselectPrompt, "AutocompleteMultiselectPrompt"); module3.exports = AutocompleteMultiselectPrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.js var require_confirm = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.js"(exports2, module3) { "use strict"; init_import_meta_url(); var color = require_kleur(); var Prompt = require_prompt(); var _require = require_util8(); var style = _require.style; var clear = _require.clear; var _require2 = require_src(); var erase = _require2.erase; var cursor = _require2.cursor; var ConfirmPrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.msg = opts.message; this.value = opts.initial; this.initialValue = !!opts.initial; this.yesMsg = opts.yes || "yes"; this.yesOption = opts.yesOption || "(Y/n)"; this.noMsg = opts.no || "no"; this.noOption = opts.noOption || "(y/N)"; this.render(); } reset() { this.value = this.initialValue; this.fire(); this.render(); } exit() { this.abort(); } abort() { this.done = this.aborted = true; this.fire(); this.render(); this.out.write("\n"); this.close(); } submit() { this.value = this.value || false; this.done = true; this.aborted = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } _(c6, key) { if (c6.toLowerCase() === "y") { this.value = true; return this.submit(); } if (c6.toLowerCase() === "n") { this.value = false; return this.submit(); } return this.bell(); } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); else this.out.write(clear(this.outputText, this.out.columns)); super.render(); this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.done ? this.value ? this.yesMsg : this.noMsg : color.gray(this.initialValue ? this.yesOption : this.noOption)].join(" "); this.out.write(erase.line + cursor.to(0) + this.outputText); } }; __name(ConfirmPrompt, "ConfirmPrompt"); module3.exports = ConfirmPrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.js var require_elements = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = { TextPrompt: require_text(), SelectPrompt: require_select(), TogglePrompt: require_toggle(), DatePrompt: require_date(), NumberPrompt: require_number(), MultiselectPrompt: require_multiselect(), AutocompletePrompt: require_autocomplete(), AutocompleteMultiselectPrompt: require_autocompleteMultiselect(), ConfirmPrompt: require_confirm() }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.js var require_prompts = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.js"(exports2) { "use strict"; init_import_meta_url(); var $3 = exports2; var el = require_elements(); var noop = /* @__PURE__ */ __name((v7) => v7, "noop"); function toPrompt(type, args, opts = {}) { return new Promise((res, rej) => { const p6 = new el[type](args); const onAbort = opts.onAbort || noop; const onSubmit = opts.onSubmit || noop; const onExit6 = opts.onExit || noop; p6.on("state", args.onState || noop); p6.on("submit", (x6) => res(onSubmit(x6))); p6.on("exit", (x6) => res(onExit6(x6))); p6.on("abort", (x6) => rej(onAbort(x6))); }); } __name(toPrompt, "toPrompt"); $3.text = (args) => toPrompt("TextPrompt", args); $3.password = (args) => { args.style = "password"; return $3.text(args); }; $3.invisible = (args) => { args.style = "invisible"; return $3.text(args); }; $3.number = (args) => toPrompt("NumberPrompt", args); $3.date = (args) => toPrompt("DatePrompt", args); $3.confirm = (args) => toPrompt("ConfirmPrompt", args); $3.list = (args) => { const sep5 = args.separator || ","; return toPrompt("TextPrompt", args, { onSubmit: (str) => str.split(sep5).map((s5) => s5.trim()) }); }; $3.toggle = (args) => toPrompt("TogglePrompt", args); $3.select = (args) => toPrompt("SelectPrompt", args); $3.multiselect = (args) => { args.choices = [].concat(args.choices || []); const toSelected = /* @__PURE__ */ __name((items) => items.filter((item) => item.selected).map((item) => item.value), "toSelected"); return toPrompt("MultiselectPrompt", args, { onAbort: toSelected, onSubmit: toSelected }); }; $3.autocompleteMultiselect = (args) => { args.choices = [].concat(args.choices || []); const toSelected = /* @__PURE__ */ __name((items) => items.filter((item) => item.selected).map((item) => item.value), "toSelected"); return toPrompt("AutocompleteMultiselectPrompt", args, { onAbort: toSelected, onSubmit: toSelected }); }; var byTitle = /* @__PURE__ */ __name((input, choices) => Promise.resolve(choices.filter((item) => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase())), "byTitle"); $3.autocomplete = (args) => { args.suggest = args.suggest || byTitle; args.choices = [].concat(args.choices || []); return toPrompt("AutocompletePrompt", args); }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.js var require_dist2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); function ownKeys11(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function(sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } __name(ownKeys11, "ownKeys"); function _objectSpread11(target) { for (var i5 = 1; i5 < arguments.length; i5++) { var source = arguments[i5] != null ? arguments[i5] : {}; if (i5 % 2) { ownKeys11(Object(source), true).forEach(function(key) { _defineProperty11(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys11(Object(source)).forEach(function(key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } __name(_objectSpread11, "_objectSpread"); function _defineProperty11(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } __name(_defineProperty11, "_defineProperty"); function _createForOfIteratorHelper(o5, allowArrayLike) { var it2 = typeof Symbol !== "undefined" && o5[Symbol.iterator] || o5["@@iterator"]; if (!it2) { if (Array.isArray(o5) || (it2 = _unsupportedIterableToArray4(o5)) || allowArrayLike && o5 && typeof o5.length === "number") { if (it2) o5 = it2; var i5 = 0; var F3 = /* @__PURE__ */ __name(function F4() { }, "F"); return { s: F3, n: /* @__PURE__ */ __name(function n6() { if (i5 >= o5.length) return { done: true }; return { done: false, value: o5[i5++] }; }, "n"), e: /* @__PURE__ */ __name(function e7(_e) { throw _e; }, "e"), f: F3 }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: /* @__PURE__ */ __name(function s5() { it2 = it2.call(o5); }, "s"), n: /* @__PURE__ */ __name(function n6() { var step = it2.next(); normalCompletion = step.done; return step; }, "n"), e: /* @__PURE__ */ __name(function e7(_e2) { didErr = true; err = _e2; }, "e"), f: /* @__PURE__ */ __name(function f5() { try { if (!normalCompletion && it2.return != null) it2.return(); } finally { if (didErr) throw err; } }, "f") }; } __name(_createForOfIteratorHelper, "_createForOfIteratorHelper"); function _unsupportedIterableToArray4(o5, minLen) { if (!o5) return; if (typeof o5 === "string") return _arrayLikeToArray4(o5, minLen); var n6 = Object.prototype.toString.call(o5).slice(8, -1); if (n6 === "Object" && o5.constructor) n6 = o5.constructor.name; if (n6 === "Map" || n6 === "Set") return Array.from(o5); if (n6 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n6)) return _arrayLikeToArray4(o5, minLen); } __name(_unsupportedIterableToArray4, "_unsupportedIterableToArray"); function _arrayLikeToArray4(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i5 = 0, arr2 = new Array(len); i5 < len; i5++) arr2[i5] = arr[i5]; return arr2; } __name(_arrayLikeToArray4, "_arrayLikeToArray"); function asyncGeneratorStep(gen, resolve25, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error2) { reject(error2); return; } if (info.done) { resolve25(value); } else { Promise.resolve(value).then(_next, _throw); } } __name(asyncGeneratorStep, "asyncGeneratorStep"); function _asyncToGenerator(fn2) { return function() { var self2 = this, args = arguments; return new Promise(function(resolve25, reject) { var gen = fn2.apply(self2, args); function _next(value) { asyncGeneratorStep(gen, resolve25, reject, _next, _throw, "next", value); } __name(_next, "_next"); function _throw(err) { asyncGeneratorStep(gen, resolve25, reject, _next, _throw, "throw", err); } __name(_throw, "_throw"); _next(void 0); }); }; } __name(_asyncToGenerator, "_asyncToGenerator"); var prompts2 = require_prompts(); var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"]; var noop = /* @__PURE__ */ __name(() => { }, "noop"); function prompt2() { return _prompt.apply(this, arguments); } __name(prompt2, "prompt"); function _prompt() { _prompt = _asyncToGenerator(function* (questions = [], { onSubmit = noop, onCancel = noop } = {}) { const answers = {}; const override2 = prompt2._override || {}; questions = [].concat(questions); let answer, question, quit, name2, type, lastPrompt; const getFormattedAnswer = /* @__PURE__ */ function() { var _ref = _asyncToGenerator(function* (question2, answer2, skipValidation = false) { if (!skipValidation && question2.validate && question2.validate(answer2) !== true) { return; } return question2.format ? yield question2.format(answer2, answers) : answer2; }); return /* @__PURE__ */ __name(function getFormattedAnswer2(_x, _x2) { return _ref.apply(this, arguments); }, "getFormattedAnswer"); }(); var _iterator = _createForOfIteratorHelper(questions), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done; ) { question = _step.value; var _question = question; name2 = _question.name; type = _question.type; if (typeof type === "function") { type = yield type(answer, _objectSpread11({}, answers), question); question["type"] = type; } if (!type) continue; for (let key in question) { if (passOn.includes(key)) continue; let value = question[key]; question[key] = typeof value === "function" ? yield value(answer, _objectSpread11({}, answers), lastPrompt) : value; } lastPrompt = question; if (typeof question.message !== "string") { throw new Error("prompt message is required"); } var _question2 = question; name2 = _question2.name; type = _question2.type; if (prompts2[type] === void 0) { throw new Error(`prompt type (${type}) is not defined`); } if (override2[question.name] !== void 0) { answer = yield getFormattedAnswer(question, override2[question.name]); if (answer !== void 0) { answers[name2] = answer; continue; } } try { answer = prompt2._injected ? getInjectedAnswer(prompt2._injected, question.initial) : yield prompts2[type](question); answers[name2] = answer = yield getFormattedAnswer(question, answer, true); quit = yield onSubmit(question, answer, answers); } catch (err) { quit = !(yield onCancel(question, answers)); } if (quit) return answers; } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } return answers; }); return _prompt.apply(this, arguments); } __name(_prompt, "_prompt"); function getInjectedAnswer(injected, deafultValue) { const answer = injected.shift(); if (answer instanceof Error) { throw answer; } return answer === void 0 ? deafultValue : answer; } __name(getInjectedAnswer, "getInjectedAnswer"); function inject(answers) { prompt2._injected = (prompt2._injected || []).concat(answers); } __name(inject, "inject"); function override(answers) { prompt2._override = Object.assign({}, answers); } __name(override, "override"); module3.exports = Object.assign(prompt2, { prompt: prompt2, prompts: prompts2, inject, override }); } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.js var require_action2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = (key, isSelect) => { if (key.meta && key.name !== "escape") return; if (key.ctrl) { if (key.name === "a") return "first"; if (key.name === "c") return "abort"; if (key.name === "d") return "abort"; if (key.name === "e") return "last"; if (key.name === "g") return "reset"; } if (isSelect) { if (key.name === "j") return "down"; if (key.name === "k") return "up"; } if (key.name === "return") return "submit"; if (key.name === "enter") return "submit"; if (key.name === "backspace") return "delete"; if (key.name === "delete") return "deleteForward"; if (key.name === "abort") return "abort"; if (key.name === "escape") return "exit"; if (key.name === "tab") return "next"; if (key.name === "pagedown") return "nextPage"; if (key.name === "pageup") return "prevPage"; if (key.name === "home") return "home"; if (key.name === "end") return "end"; if (key.name === "up") return "up"; if (key.name === "down") return "down"; if (key.name === "right") return "right"; if (key.name === "left") return "left"; return false; }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.js var require_strip2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = (str) => { const pattern = [ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))" ].join("|"); const RGX = new RegExp(pattern, "g"); return typeof str === "string" ? str.replace(RGX, "") : str; }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.js var require_clear2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.js"(exports2, module3) { "use strict"; init_import_meta_url(); var strip = require_strip2(); var { erase, cursor } = require_src(); var width = /* @__PURE__ */ __name((str) => [...strip(str)].length, "width"); module3.exports = function(prompt2, perLine) { if (!perLine) return erase.line + cursor.to(0); let rows = 0; const lines = prompt2.split(/\r?\n/); for (let line of lines) { rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine); } return erase.lines(rows); }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.js var require_figures2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.js"(exports2, module3) { "use strict"; init_import_meta_url(); var main2 = { arrowUp: "\u2191", arrowDown: "\u2193", arrowLeft: "\u2190", arrowRight: "\u2192", radioOn: "\u25C9", radioOff: "\u25EF", tick: "\u2714", cross: "\u2716", ellipsis: "\u2026", pointerSmall: "\u203A", line: "\u2500", pointer: "\u276F" }; var win = { arrowUp: main2.arrowUp, arrowDown: main2.arrowDown, arrowLeft: main2.arrowLeft, arrowRight: main2.arrowRight, radioOn: "(*)", radioOff: "( )", tick: "\u221A", cross: "\xD7", ellipsis: "...", pointerSmall: "\xBB", line: "\u2500", pointer: ">" }; var figures = process.platform === "win32" ? win : main2; module3.exports = figures; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.js var require_style2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.js"(exports2, module3) { "use strict"; init_import_meta_url(); var c6 = require_kleur(); var figures = require_figures2(); var styles4 = Object.freeze({ password: { scale: 1, render: (input) => "*".repeat(input.length) }, emoji: { scale: 2, render: (input) => "\u{1F603}".repeat(input.length) }, invisible: { scale: 0, render: (input) => "" }, default: { scale: 1, render: (input) => `${input}` } }); var render2 = /* @__PURE__ */ __name((type) => styles4[type] || styles4.default, "render"); var symbols = Object.freeze({ aborted: c6.red(figures.cross), done: c6.green(figures.tick), exited: c6.yellow(figures.cross), default: c6.cyan("?") }); var symbol = /* @__PURE__ */ __name((done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default, "symbol"); var delimiter = /* @__PURE__ */ __name((completing) => c6.gray(completing ? figures.ellipsis : figures.pointerSmall), "delimiter"); var item = /* @__PURE__ */ __name((expandable, expanded) => c6.gray(expandable ? expanded ? figures.pointerSmall : "+" : figures.line), "item"); module3.exports = { styles: styles4, render: render2, symbols, symbol, delimiter, item }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.js var require_lines2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.js"(exports2, module3) { "use strict"; init_import_meta_url(); var strip = require_strip2(); module3.exports = function(msg, perLine) { let lines = String(strip(msg) || "").split(/\r?\n/); if (!perLine) return lines.length; return lines.map((l6) => Math.ceil(l6.length / perLine)).reduce((a5, b6) => a5 + b6); }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.js var require_wrap2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = (msg, opts = {}) => { const tab = Number.isSafeInteger(parseInt(opts.margin)) ? new Array(parseInt(opts.margin)).fill(" ").join("") : opts.margin || ""; const width = opts.width; return (msg || "").split(/\r?\n/g).map((line) => line.split(/\s+/g).reduce((arr, w6) => { if (w6.length + tab.length >= width || arr[arr.length - 1].length + w6.length + 1 < width) arr[arr.length - 1] += ` ${w6}`; else arr.push(`${tab}${w6}`); return arr; }, [tab]).join("\n")).join("\n"); }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.js var require_entriesToDisplay2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = (cursor, total, maxVisible) => { maxVisible = maxVisible || total; let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2)); if (startIndex < 0) startIndex = 0; let endIndex = Math.min(startIndex + maxVisible, total); return { startIndex, endIndex }; }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.js var require_util9 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = { action: require_action2(), clear: require_clear2(), style: require_style2(), strip: require_strip2(), figures: require_figures2(), lines: require_lines2(), wrap: require_wrap2(), entriesToDisplay: require_entriesToDisplay2() }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.js var require_prompt2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.js"(exports2, module3) { "use strict"; init_import_meta_url(); var readline4 = require("readline"); var { action } = require_util9(); var EventEmitter5 = require("events"); var { beep, cursor } = require_src(); var color = require_kleur(); var Prompt = class extends EventEmitter5 { constructor(opts = {}) { super(); this.firstRender = true; this.in = opts.stdin || process.stdin; this.out = opts.stdout || process.stdout; this.onRender = (opts.onRender || (() => void 0)).bind(this); const rl = readline4.createInterface({ input: this.in, escapeCodeTimeout: 50 }); readline4.emitKeypressEvents(this.in, rl); if (this.in.isTTY) this.in.setRawMode(true); const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1; const keypress = /* @__PURE__ */ __name((str, key) => { let a5 = action(key, isSelect); if (a5 === false) { this._ && this._(str, key); } else if (typeof this[a5] === "function") { this[a5](key); } else { this.bell(); } }, "keypress"); this.close = () => { this.out.write(cursor.show); this.in.removeListener("keypress", keypress); if (this.in.isTTY) this.in.setRawMode(false); rl.close(); this.emit(this.aborted ? "abort" : this.exited ? "exit" : "submit", this.value); this.closed = true; }; this.in.on("keypress", keypress); } fire() { this.emit("state", { value: this.value, aborted: !!this.aborted, exited: !!this.exited }); } bell() { this.out.write(beep); } render() { this.onRender(color); if (this.firstRender) this.firstRender = false; } }; __name(Prompt, "Prompt"); module3.exports = Prompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js var require_text2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js"(exports2, module3) { init_import_meta_url(); var color = require_kleur(); var Prompt = require_prompt2(); var { erase, cursor } = require_src(); var { style, clear, lines, figures } = require_util9(); var TextPrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.transform = style.render(opts.style); this.scale = this.transform.scale; this.msg = opts.message; this.initial = opts.initial || ``; this.validator = opts.validate || (() => true); this.value = ``; this.errorMsg = opts.error || `Please Enter A Valid Value`; this.cursor = Number(!!this.initial); this.cursorOffset = 0; this.clear = clear(``, this.out.columns); this.render(); } set value(v7) { if (!v7 && this.initial) { this.placeholder = true; this.rendered = color.gray(this.transform.render(this.initial)); } else { this.placeholder = false; this.rendered = this.transform.render(v7); } this._value = v7; this.fire(); } get value() { return this._value; } reset() { this.value = ``; this.cursor = Number(!!this.initial); this.cursorOffset = 0; this.fire(); this.render(); } exit() { this.abort(); } abort() { this.value = this.value || this.initial; this.done = this.aborted = true; this.error = false; this.red = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } async validate() { let valid = await this.validator(this.value); if (typeof valid === `string`) { this.errorMsg = valid; valid = false; } this.error = !valid; } async submit() { this.value = this.value || this.initial; this.cursorOffset = 0; this.cursor = this.rendered.length; await this.validate(); if (this.error) { this.red = true; this.fire(); this.render(); return; } this.done = true; this.aborted = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } next() { if (!this.placeholder) return this.bell(); this.value = this.initial; this.cursor = this.rendered.length; this.fire(); this.render(); } moveCursor(n6) { if (this.placeholder) return; this.cursor = this.cursor + n6; this.cursorOffset += n6; } _(c6, key) { let s1 = this.value.slice(0, this.cursor); let s22 = this.value.slice(this.cursor); this.value = `${s1}${c6}${s22}`; this.red = false; this.cursor = this.placeholder ? 0 : s1.length + 1; this.render(); } delete() { if (this.isCursorAtStart()) return this.bell(); let s1 = this.value.slice(0, this.cursor - 1); let s22 = this.value.slice(this.cursor); this.value = `${s1}${s22}`; this.red = false; if (this.isCursorAtStart()) { this.cursorOffset = 0; } else { this.cursorOffset++; this.moveCursor(-1); } this.render(); } deleteForward() { if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell(); let s1 = this.value.slice(0, this.cursor); let s22 = this.value.slice(this.cursor + 1); this.value = `${s1}${s22}`; this.red = false; if (this.isCursorAtEnd()) { this.cursorOffset = 0; } else { this.cursorOffset++; } this.render(); } first() { this.cursor = 0; this.render(); } last() { this.cursor = this.value.length; this.render(); } left() { if (this.cursor <= 0 || this.placeholder) return this.bell(); this.moveCursor(-1); this.render(); } right() { if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell(); this.moveCursor(1); this.render(); } isCursorAtStart() { return this.cursor === 0 || this.placeholder && this.cursor === 1; } isCursorAtEnd() { return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1; } render() { if (this.closed) return; if (!this.firstRender) { if (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns)); this.out.write(clear(this.outputText, this.out.columns)); } super.render(); this.outputError = ""; this.outputText = [ style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.red ? color.red(this.rendered) : this.rendered ].join(` `); if (this.error) { this.outputError += this.errorMsg.split(` `).reduce((a5, l6, i5) => a5 + ` ${i5 ? " " : figures.pointerSmall} ${color.red().italic(l6)}`, ``); } this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0)); } }; __name(TextPrompt, "TextPrompt"); module3.exports = TextPrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.js var require_select2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.js"(exports2, module3) { "use strict"; init_import_meta_url(); var color = require_kleur(); var Prompt = require_prompt2(); var { style, clear, figures, wrap: wrap4, entriesToDisplay } = require_util9(); var { cursor } = require_src(); var SelectPrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.msg = opts.message; this.hint = opts.hint || "- Use arrow-keys. Return to submit."; this.warn = opts.warn || "- This option is disabled"; this.cursor = opts.initial || 0; this.choices = opts.choices.map((ch2, idx) => { if (typeof ch2 === "string") ch2 = { title: ch2, value: idx }; return { title: ch2 && (ch2.title || ch2.value || ch2), value: ch2 && (ch2.value === void 0 ? idx : ch2.value), description: ch2 && ch2.description, selected: ch2 && ch2.selected, disabled: ch2 && ch2.disabled }; }); this.optionsPerPage = opts.optionsPerPage || 10; this.value = (this.choices[this.cursor] || {}).value; this.clear = clear("", this.out.columns); this.render(); } moveCursor(n6) { this.cursor = n6; this.value = this.choices[n6].value; this.fire(); } reset() { this.moveCursor(0); this.fire(); this.render(); } exit() { this.abort(); } abort() { this.done = this.aborted = true; this.fire(); this.render(); this.out.write("\n"); this.close(); } submit() { if (!this.selection.disabled) { this.done = true; this.aborted = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } else this.bell(); } first() { this.moveCursor(0); this.render(); } last() { this.moveCursor(this.choices.length - 1); this.render(); } up() { if (this.cursor === 0) { this.moveCursor(this.choices.length - 1); } else { this.moveCursor(this.cursor - 1); } this.render(); } down() { if (this.cursor === this.choices.length - 1) { this.moveCursor(0); } else { this.moveCursor(this.cursor + 1); } this.render(); } next() { this.moveCursor((this.cursor + 1) % this.choices.length); this.render(); } _(c6, key) { if (c6 === " ") return this.submit(); } get selection() { return this.choices[this.cursor]; } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); else this.out.write(clear(this.outputText, this.out.columns)); super.render(); let { startIndex, endIndex } = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage); this.outputText = [ style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.done ? this.selection.title : this.selection.disabled ? color.yellow(this.warn) : color.gray(this.hint) ].join(" "); if (!this.done) { this.outputText += "\n"; for (let i5 = startIndex; i5 < endIndex; i5++) { let title, prefix, desc = "", v7 = this.choices[i5]; if (i5 === startIndex && startIndex > 0) { prefix = figures.arrowUp; } else if (i5 === endIndex - 1 && endIndex < this.choices.length) { prefix = figures.arrowDown; } else { prefix = " "; } if (v7.disabled) { title = this.cursor === i5 ? color.gray().underline(v7.title) : color.strikethrough().gray(v7.title); prefix = (this.cursor === i5 ? color.bold().gray(figures.pointer) + " " : " ") + prefix; } else { title = this.cursor === i5 ? color.cyan().underline(v7.title) : v7.title; prefix = (this.cursor === i5 ? color.cyan(figures.pointer) + " " : " ") + prefix; if (v7.description && this.cursor === i5) { desc = ` - ${v7.description}`; if (prefix.length + title.length + desc.length >= this.out.columns || v7.description.split(/\r?\n/).length > 1) { desc = "\n" + wrap4(v7.description, { margin: 3, width: this.out.columns }); } } } this.outputText += `${prefix} ${title}${color.gray(desc)} `; } } this.out.write(this.outputText); } }; __name(SelectPrompt, "SelectPrompt"); module3.exports = SelectPrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js var require_toggle2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js"(exports2, module3) { init_import_meta_url(); var color = require_kleur(); var Prompt = require_prompt2(); var { style, clear } = require_util9(); var { cursor, erase } = require_src(); var TogglePrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.msg = opts.message; this.value = !!opts.initial; this.active = opts.active || "on"; this.inactive = opts.inactive || "off"; this.initialValue = this.value; this.render(); } reset() { this.value = this.initialValue; this.fire(); this.render(); } exit() { this.abort(); } abort() { this.done = this.aborted = true; this.fire(); this.render(); this.out.write("\n"); this.close(); } submit() { this.done = true; this.aborted = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } deactivate() { if (this.value === false) return this.bell(); this.value = false; this.render(); } activate() { if (this.value === true) return this.bell(); this.value = true; this.render(); } delete() { this.deactivate(); } left() { this.deactivate(); } right() { this.activate(); } down() { this.deactivate(); } up() { this.activate(); } next() { this.value = !this.value; this.fire(); this.render(); } _(c6, key) { if (c6 === " ") { this.value = !this.value; } else if (c6 === "1") { this.value = true; } else if (c6 === "0") { this.value = false; } else return this.bell(); this.render(); } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); else this.out.write(clear(this.outputText, this.out.columns)); super.render(); this.outputText = [ style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.value ? this.inactive : color.cyan().underline(this.inactive), color.gray("/"), this.value ? color.cyan().underline(this.active) : this.active ].join(" "); this.out.write(erase.line + cursor.to(0) + this.outputText); } }; __name(TogglePrompt, "TogglePrompt"); module3.exports = TogglePrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.js var require_datepart2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = class { constructor({ token, date, parts, locales }) { this.token = token; this.date = date || /* @__PURE__ */ new Date(); this.parts = parts || [this]; this.locales = locales || {}; } up() { } down() { } next() { const currentIdx = this.parts.indexOf(this); return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart); } setTo(val2) { } prev() { let parts = [].concat(this.parts).reverse(); const currentIdx = parts.indexOf(this); return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart); } toString() { return String(this.date); } }; __name(DatePart, "DatePart"); module3.exports = DatePart; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.js var require_meridiem2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart2(); var Meridiem = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setHours((this.date.getHours() + 12) % 24); } down() { this.up(); } toString() { let meridiem = this.date.getHours() > 12 ? "pm" : "am"; return /\A/.test(this.token) ? meridiem.toUpperCase() : meridiem; } }; __name(Meridiem, "Meridiem"); module3.exports = Meridiem; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.js var require_day2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart2(); var pos = /* @__PURE__ */ __name((n6) => { n6 = n6 % 10; return n6 === 1 ? "st" : n6 === 2 ? "nd" : n6 === 3 ? "rd" : "th"; }, "pos"); var Day = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setDate(this.date.getDate() + 1); } down() { this.date.setDate(this.date.getDate() - 1); } setTo(val2) { this.date.setDate(parseInt(val2.substr(-2))); } toString() { let date = this.date.getDate(); let day2 = this.date.getDay(); return this.token === "DD" ? String(date).padStart(2, "0") : this.token === "Do" ? date + pos(date) : this.token === "d" ? day2 + 1 : this.token === "ddd" ? this.locales.weekdaysShort[day2] : this.token === "dddd" ? this.locales.weekdays[day2] : date; } }; __name(Day, "Day"); module3.exports = Day; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.js var require_hours2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart2(); var Hours = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setHours(this.date.getHours() + 1); } down() { this.date.setHours(this.date.getHours() - 1); } setTo(val2) { this.date.setHours(parseInt(val2.substr(-2))); } toString() { let hours = this.date.getHours(); if (/h/.test(this.token)) hours = hours % 12 || 12; return this.token.length > 1 ? String(hours).padStart(2, "0") : hours; } }; __name(Hours, "Hours"); module3.exports = Hours; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.js var require_milliseconds2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart2(); var Milliseconds = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setMilliseconds(this.date.getMilliseconds() + 1); } down() { this.date.setMilliseconds(this.date.getMilliseconds() - 1); } setTo(val2) { this.date.setMilliseconds(parseInt(val2.substr(-this.token.length))); } toString() { return String(this.date.getMilliseconds()).padStart(4, "0").substr(0, this.token.length); } }; __name(Milliseconds, "Milliseconds"); module3.exports = Milliseconds; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.js var require_minutes2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart2(); var Minutes = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setMinutes(this.date.getMinutes() + 1); } down() { this.date.setMinutes(this.date.getMinutes() - 1); } setTo(val2) { this.date.setMinutes(parseInt(val2.substr(-2))); } toString() { let m6 = this.date.getMinutes(); return this.token.length > 1 ? String(m6).padStart(2, "0") : m6; } }; __name(Minutes, "Minutes"); module3.exports = Minutes; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.js var require_month2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart2(); var Month = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setMonth(this.date.getMonth() + 1); } down() { this.date.setMonth(this.date.getMonth() - 1); } setTo(val2) { val2 = parseInt(val2.substr(-2)) - 1; this.date.setMonth(val2 < 0 ? 0 : val2); } toString() { let month2 = this.date.getMonth(); let tl = this.token.length; return tl === 2 ? String(month2 + 1).padStart(2, "0") : tl === 3 ? this.locales.monthsShort[month2] : tl === 4 ? this.locales.months[month2] : String(month2 + 1); } }; __name(Month, "Month"); module3.exports = Month; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.js var require_seconds2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart2(); var Seconds = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setSeconds(this.date.getSeconds() + 1); } down() { this.date.setSeconds(this.date.getSeconds() - 1); } setTo(val2) { this.date.setSeconds(parseInt(val2.substr(-2))); } toString() { let s5 = this.date.getSeconds(); return this.token.length > 1 ? String(s5).padStart(2, "0") : s5; } }; __name(Seconds, "Seconds"); module3.exports = Seconds; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.js var require_year2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.js"(exports2, module3) { "use strict"; init_import_meta_url(); var DatePart = require_datepart2(); var Year = class extends DatePart { constructor(opts = {}) { super(opts); } up() { this.date.setFullYear(this.date.getFullYear() + 1); } down() { this.date.setFullYear(this.date.getFullYear() - 1); } setTo(val2) { this.date.setFullYear(val2.substr(-4)); } toString() { let year2 = String(this.date.getFullYear()).padStart(4, "0"); return this.token.length === 2 ? year2.substr(-2) : year2; } }; __name(Year, "Year"); module3.exports = Year; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.js var require_dateparts2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = { DatePart: require_datepart2(), Meridiem: require_meridiem2(), Day: require_day2(), Hours: require_hours2(), Milliseconds: require_milliseconds2(), Minutes: require_minutes2(), Month: require_month2(), Seconds: require_seconds2(), Year: require_year2() }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.js var require_date2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.js"(exports2, module3) { "use strict"; init_import_meta_url(); var color = require_kleur(); var Prompt = require_prompt2(); var { style, clear, figures } = require_util9(); var { erase, cursor } = require_src(); var { DatePart, Meridiem, Day, Hours, Milliseconds, Minutes, Month, Seconds, Year } = require_dateparts2(); var regex2 = /\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g; var regexGroups = { 1: ({ token }) => token.replace(/\\(.)/g, "$1"), 2: (opts) => new Day(opts), // Day // TODO 3: (opts) => new Month(opts), // Month 4: (opts) => new Year(opts), // Year 5: (opts) => new Meridiem(opts), // AM/PM // TODO (special) 6: (opts) => new Hours(opts), // Hours 7: (opts) => new Minutes(opts), // Minutes 8: (opts) => new Seconds(opts), // Seconds 9: (opts) => new Milliseconds(opts) // Fractional seconds }; var dfltLocales = { months: "January,February,March,April,May,June,July,August,September,October,November,December".split(","), monthsShort: "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","), weekdays: "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","), weekdaysShort: "Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",") }; var DatePrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.msg = opts.message; this.cursor = 0; this.typed = ""; this.locales = Object.assign(dfltLocales, opts.locales); this._date = opts.initial || /* @__PURE__ */ new Date(); this.errorMsg = opts.error || "Please Enter A Valid Value"; this.validator = opts.validate || (() => true); this.mask = opts.mask || "YYYY-MM-DD HH:mm:ss"; this.clear = clear("", this.out.columns); this.render(); } get value() { return this.date; } get date() { return this._date; } set date(date) { if (date) this._date.setTime(date.getTime()); } set mask(mask) { let result; this.parts = []; while (result = regex2.exec(mask)) { let match2 = result.shift(); let idx = result.findIndex((gr) => gr != null); this.parts.push(idx in regexGroups ? regexGroups[idx]({ token: result[idx] || match2, date: this.date, parts: this.parts, locales: this.locales }) : result[idx] || match2); } let parts = this.parts.reduce((arr, i5) => { if (typeof i5 === "string" && typeof arr[arr.length - 1] === "string") arr[arr.length - 1] += i5; else arr.push(i5); return arr; }, []); this.parts.splice(0); this.parts.push(...parts); this.reset(); } moveCursor(n6) { this.typed = ""; this.cursor = n6; this.fire(); } reset() { this.moveCursor(this.parts.findIndex((p6) => p6 instanceof DatePart)); this.fire(); this.render(); } exit() { this.abort(); } abort() { this.done = this.aborted = true; this.error = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } async validate() { let valid = await this.validator(this.value); if (typeof valid === "string") { this.errorMsg = valid; valid = false; } this.error = !valid; } async submit() { await this.validate(); if (this.error) { this.color = "red"; this.fire(); this.render(); return; } this.done = true; this.aborted = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } up() { this.typed = ""; this.parts[this.cursor].up(); this.render(); } down() { this.typed = ""; this.parts[this.cursor].down(); this.render(); } left() { let prev = this.parts[this.cursor].prev(); if (prev == null) return this.bell(); this.moveCursor(this.parts.indexOf(prev)); this.render(); } right() { let next = this.parts[this.cursor].next(); if (next == null) return this.bell(); this.moveCursor(this.parts.indexOf(next)); this.render(); } next() { let next = this.parts[this.cursor].next(); this.moveCursor(next ? this.parts.indexOf(next) : this.parts.findIndex((part) => part instanceof DatePart)); this.render(); } _(c6) { if (/\d/.test(c6)) { this.typed += c6; this.parts[this.cursor].setTo(this.typed); this.render(); } } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); else this.out.write(clear(this.outputText, this.out.columns)); super.render(); this.outputText = [ style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.parts.reduce((arr, p6, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p6.toString()) : p6), []).join("") ].join(" "); if (this.error) { this.outputText += this.errorMsg.split("\n").reduce( (a5, l6, i5) => a5 + ` ${i5 ? ` ` : figures.pointerSmall} ${color.red().italic(l6)}`, `` ); } this.out.write(erase.line + cursor.to(0) + this.outputText); } }; __name(DatePrompt, "DatePrompt"); module3.exports = DatePrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js var require_number2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js"(exports2, module3) { init_import_meta_url(); var color = require_kleur(); var Prompt = require_prompt2(); var { cursor, erase } = require_src(); var { style, figures, clear, lines } = require_util9(); var isNumber2 = /[0-9]/; var isDef = /* @__PURE__ */ __name((any) => any !== void 0, "isDef"); var round = /* @__PURE__ */ __name((number, precision) => { let factor = Math.pow(10, precision); return Math.round(number * factor) / factor; }, "round"); var NumberPrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.transform = style.render(opts.style); this.msg = opts.message; this.initial = isDef(opts.initial) ? opts.initial : ""; this.float = !!opts.float; this.round = opts.round || 2; this.inc = opts.increment || 1; this.min = isDef(opts.min) ? opts.min : -Infinity; this.max = isDef(opts.max) ? opts.max : Infinity; this.errorMsg = opts.error || `Please Enter A Valid Value`; this.validator = opts.validate || (() => true); this.color = `cyan`; this.value = ``; this.typed = ``; this.lastHit = 0; this.render(); } set value(v7) { if (!v7 && v7 !== 0) { this.placeholder = true; this.rendered = color.gray(this.transform.render(`${this.initial}`)); this._value = ``; } else { this.placeholder = false; this.rendered = this.transform.render(`${round(v7, this.round)}`); this._value = round(v7, this.round); } this.fire(); } get value() { return this._value; } parse(x6) { return this.float ? parseFloat(x6) : parseInt(x6); } valid(c6) { return c6 === `-` || c6 === `.` && this.float || isNumber2.test(c6); } reset() { this.typed = ``; this.value = ``; this.fire(); this.render(); } exit() { this.abort(); } abort() { let x6 = this.value; this.value = x6 !== `` ? x6 : this.initial; this.done = this.aborted = true; this.error = false; this.fire(); this.render(); this.out.write(` `); this.close(); } async validate() { let valid = await this.validator(this.value); if (typeof valid === `string`) { this.errorMsg = valid; valid = false; } this.error = !valid; } async submit() { await this.validate(); if (this.error) { this.color = `red`; this.fire(); this.render(); return; } let x6 = this.value; this.value = x6 !== `` ? x6 : this.initial; this.done = true; this.aborted = false; this.error = false; this.fire(); this.render(); this.out.write(` `); this.close(); } up() { this.typed = ``; if (this.value === "") { this.value = this.min - this.inc; } if (this.value >= this.max) return this.bell(); this.value += this.inc; this.color = `cyan`; this.fire(); this.render(); } down() { this.typed = ``; if (this.value === "") { this.value = this.min + this.inc; } if (this.value <= this.min) return this.bell(); this.value -= this.inc; this.color = `cyan`; this.fire(); this.render(); } delete() { let val2 = this.value.toString(); if (val2.length === 0) return this.bell(); this.value = this.parse(val2 = val2.slice(0, -1)) || ``; if (this.value !== "" && this.value < this.min) { this.value = this.min; } this.color = `cyan`; this.fire(); this.render(); } next() { this.value = this.initial; this.fire(); this.render(); } _(c6, key) { if (!this.valid(c6)) return this.bell(); const now = Date.now(); if (now - this.lastHit > 1e3) this.typed = ``; this.typed += c6; this.lastHit = now; this.color = `cyan`; if (c6 === `.`) return this.fire(); this.value = Math.min(this.parse(this.typed), this.max); if (this.value > this.max) this.value = this.max; if (this.value < this.min) this.value = this.min; this.fire(); this.render(); } render() { if (this.closed) return; if (!this.firstRender) { if (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns)); this.out.write(clear(this.outputText, this.out.columns)); } super.render(); this.outputError = ""; this.outputText = [ style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), !this.done || !this.done && !this.placeholder ? color[this.color]().underline(this.rendered) : this.rendered ].join(` `); if (this.error) { this.outputError += this.errorMsg.split(` `).reduce((a5, l6, i5) => a5 + ` ${i5 ? ` ` : figures.pointerSmall} ${color.red().italic(l6)}`, ``); } this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore); } }; __name(NumberPrompt, "NumberPrompt"); module3.exports = NumberPrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.js var require_multiselect2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.js"(exports2, module3) { "use strict"; init_import_meta_url(); var color = require_kleur(); var { cursor } = require_src(); var Prompt = require_prompt2(); var { clear, figures, style, wrap: wrap4, entriesToDisplay } = require_util9(); var MultiselectPrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.msg = opts.message; this.cursor = opts.cursor || 0; this.scrollIndex = opts.cursor || 0; this.hint = opts.hint || ""; this.warn = opts.warn || "- This option is disabled -"; this.minSelected = opts.min; this.showMinError = false; this.maxChoices = opts.max; this.instructions = opts.instructions; this.optionsPerPage = opts.optionsPerPage || 10; this.value = opts.choices.map((ch2, idx) => { if (typeof ch2 === "string") ch2 = { title: ch2, value: idx }; return { title: ch2 && (ch2.title || ch2.value || ch2), description: ch2 && ch2.description, value: ch2 && (ch2.value === void 0 ? idx : ch2.value), selected: ch2 && ch2.selected, disabled: ch2 && ch2.disabled }; }); this.clear = clear("", this.out.columns); if (!opts.overrideRender) { this.render(); } } reset() { this.value.map((v7) => !v7.selected); this.cursor = 0; this.fire(); this.render(); } selected() { return this.value.filter((v7) => v7.selected); } exit() { this.abort(); } abort() { this.done = this.aborted = true; this.fire(); this.render(); this.out.write("\n"); this.close(); } submit() { const selected = this.value.filter((e7) => e7.selected); if (this.minSelected && selected.length < this.minSelected) { this.showMinError = true; this.render(); } else { this.done = true; this.aborted = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } } first() { this.cursor = 0; this.render(); } last() { this.cursor = this.value.length - 1; this.render(); } next() { this.cursor = (this.cursor + 1) % this.value.length; this.render(); } up() { if (this.cursor === 0) { this.cursor = this.value.length - 1; } else { this.cursor--; } this.render(); } down() { if (this.cursor === this.value.length - 1) { this.cursor = 0; } else { this.cursor++; } this.render(); } left() { this.value[this.cursor].selected = false; this.render(); } right() { if (this.value.filter((e7) => e7.selected).length >= this.maxChoices) return this.bell(); this.value[this.cursor].selected = true; this.render(); } handleSpaceToggle() { const v7 = this.value[this.cursor]; if (v7.selected) { v7.selected = false; this.render(); } else if (v7.disabled || this.value.filter((e7) => e7.selected).length >= this.maxChoices) { return this.bell(); } else { v7.selected = true; this.render(); } } toggleAll() { if (this.maxChoices !== void 0 || this.value[this.cursor].disabled) { return this.bell(); } const newSelected = !this.value[this.cursor].selected; this.value.filter((v7) => !v7.disabled).forEach((v7) => v7.selected = newSelected); this.render(); } _(c6, key) { if (c6 === " ") { this.handleSpaceToggle(); } else if (c6 === "a") { this.toggleAll(); } else { return this.bell(); } } renderInstructions() { if (this.instructions === void 0 || this.instructions) { if (typeof this.instructions === "string") { return this.instructions; } return ` Instructions: ${figures.arrowUp}/${figures.arrowDown}: Highlight option ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection ` + (this.maxChoices === void 0 ? ` a: Toggle all ` : "") + ` enter/return: Complete answer`; } return ""; } renderOption(cursor2, v7, i5, arrowIndicator) { const prefix = (v7.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + arrowIndicator + " "; let title, desc; if (v7.disabled) { title = cursor2 === i5 ? color.gray().underline(v7.title) : color.strikethrough().gray(v7.title); } else { title = cursor2 === i5 ? color.cyan().underline(v7.title) : v7.title; if (cursor2 === i5 && v7.description) { desc = ` - ${v7.description}`; if (prefix.length + title.length + desc.length >= this.out.columns || v7.description.split(/\r?\n/).length > 1) { desc = "\n" + wrap4(v7.description, { margin: prefix.length, width: this.out.columns }); } } } return prefix + title + color.gray(desc || ""); } // shared with autocompleteMultiselect paginateOptions(options32) { if (options32.length === 0) { return color.red("No matches for this query."); } let { startIndex, endIndex } = entriesToDisplay(this.cursor, options32.length, this.optionsPerPage); let prefix, styledOptions = []; for (let i5 = startIndex; i5 < endIndex; i5++) { if (i5 === startIndex && startIndex > 0) { prefix = figures.arrowUp; } else if (i5 === endIndex - 1 && endIndex < options32.length) { prefix = figures.arrowDown; } else { prefix = " "; } styledOptions.push(this.renderOption(this.cursor, options32[i5], i5, prefix)); } return "\n" + styledOptions.join("\n"); } // shared with autocomleteMultiselect renderOptions(options32) { if (!this.done) { return this.paginateOptions(options32); } return ""; } renderDoneOrInstructions() { if (this.done) { return this.value.filter((e7) => e7.selected).map((v7) => v7.title).join(", "); } const output = [color.gray(this.hint), this.renderInstructions()]; if (this.value[this.cursor].disabled) { output.push(color.yellow(this.warn)); } return output.join(" "); } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); super.render(); let prompt2 = [ style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions() ].join(" "); if (this.showMinError) { prompt2 += color.red(`You must select a minimum of ${this.minSelected} choices.`); this.showMinError = false; } prompt2 += this.renderOptions(this.value); this.out.write(this.clear + prompt2); this.clear = clear(prompt2, this.out.columns); } }; __name(MultiselectPrompt, "MultiselectPrompt"); module3.exports = MultiselectPrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.js var require_autocomplete2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.js"(exports2, module3) { "use strict"; init_import_meta_url(); var color = require_kleur(); var Prompt = require_prompt2(); var { erase, cursor } = require_src(); var { style, clear, figures, wrap: wrap4, entriesToDisplay } = require_util9(); var getVal = /* @__PURE__ */ __name((arr, i5) => arr[i5] && (arr[i5].value || arr[i5].title || arr[i5]), "getVal"); var getTitle = /* @__PURE__ */ __name((arr, i5) => arr[i5] && (arr[i5].title || arr[i5].value || arr[i5]), "getTitle"); var getIndex2 = /* @__PURE__ */ __name((arr, valOrTitle) => { const index = arr.findIndex((el) => el.value === valOrTitle || el.title === valOrTitle); return index > -1 ? index : void 0; }, "getIndex"); var AutocompletePrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.msg = opts.message; this.suggest = opts.suggest; this.choices = opts.choices; this.initial = typeof opts.initial === "number" ? opts.initial : getIndex2(opts.choices, opts.initial); this.select = this.initial || opts.cursor || 0; this.i18n = { noMatches: opts.noMatches || "no matches found" }; this.fallback = opts.fallback || this.initial; this.clearFirst = opts.clearFirst || false; this.suggestions = []; this.input = ""; this.limit = opts.limit || 10; this.cursor = 0; this.transform = style.render(opts.style); this.scale = this.transform.scale; this.render = this.render.bind(this); this.complete = this.complete.bind(this); this.clear = clear("", this.out.columns); this.complete(this.render); this.render(); } set fallback(fb) { this._fb = Number.isSafeInteger(parseInt(fb)) ? parseInt(fb) : fb; } get fallback() { let choice; if (typeof this._fb === "number") choice = this.choices[this._fb]; else if (typeof this._fb === "string") choice = { title: this._fb }; return choice || this._fb || { title: this.i18n.noMatches }; } moveSelect(i5) { this.select = i5; if (this.suggestions.length > 0) this.value = getVal(this.suggestions, i5); else this.value = this.fallback.value; this.fire(); } async complete(cb2) { const p6 = this.completing = this.suggest(this.input, this.choices); const suggestions = await p6; if (this.completing !== p6) return; this.suggestions = suggestions.map((s5, i5, arr) => ({ title: getTitle(arr, i5), value: getVal(arr, i5), description: s5.description })); this.completing = false; const l6 = Math.max(suggestions.length - 1, 0); this.moveSelect(Math.min(l6, this.select)); cb2 && cb2(); } reset() { this.input = ""; this.complete(() => { this.moveSelect(this.initial !== void 0 ? this.initial : 0); this.render(); }); this.render(); } exit() { if (this.clearFirst && this.input.length > 0) { this.reset(); } else { this.done = this.exited = true; this.aborted = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } } abort() { this.done = this.aborted = true; this.exited = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } submit() { this.done = true; this.aborted = this.exited = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } _(c6, key) { let s1 = this.input.slice(0, this.cursor); let s22 = this.input.slice(this.cursor); this.input = `${s1}${c6}${s22}`; this.cursor = s1.length + 1; this.complete(this.render); this.render(); } delete() { if (this.cursor === 0) return this.bell(); let s1 = this.input.slice(0, this.cursor - 1); let s22 = this.input.slice(this.cursor); this.input = `${s1}${s22}`; this.complete(this.render); this.cursor = this.cursor - 1; this.render(); } deleteForward() { if (this.cursor * this.scale >= this.rendered.length) return this.bell(); let s1 = this.input.slice(0, this.cursor); let s22 = this.input.slice(this.cursor + 1); this.input = `${s1}${s22}`; this.complete(this.render); this.render(); } first() { this.moveSelect(0); this.render(); } last() { this.moveSelect(this.suggestions.length - 1); this.render(); } up() { if (this.select === 0) { this.moveSelect(this.suggestions.length - 1); } else { this.moveSelect(this.select - 1); } this.render(); } down() { if (this.select === this.suggestions.length - 1) { this.moveSelect(0); } else { this.moveSelect(this.select + 1); } this.render(); } next() { if (this.select === this.suggestions.length - 1) { this.moveSelect(0); } else this.moveSelect(this.select + 1); this.render(); } nextPage() { this.moveSelect(Math.min(this.select + this.limit, this.suggestions.length - 1)); this.render(); } prevPage() { this.moveSelect(Math.max(this.select - this.limit, 0)); this.render(); } left() { if (this.cursor <= 0) return this.bell(); this.cursor = this.cursor - 1; this.render(); } right() { if (this.cursor * this.scale >= this.rendered.length) return this.bell(); this.cursor = this.cursor + 1; this.render(); } renderOption(v7, hovered, isStart, isEnd) { let desc; let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : " "; let title = hovered ? color.cyan().underline(v7.title) : v7.title; prefix = (hovered ? color.cyan(figures.pointer) + " " : " ") + prefix; if (v7.description) { desc = ` - ${v7.description}`; if (prefix.length + title.length + desc.length >= this.out.columns || v7.description.split(/\r?\n/).length > 1) { desc = "\n" + wrap4(v7.description, { margin: 3, width: this.out.columns }); } } return prefix + " " + title + color.gray(desc || ""); } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); else this.out.write(clear(this.outputText, this.out.columns)); super.render(); let { startIndex, endIndex } = entriesToDisplay(this.select, this.choices.length, this.limit); this.outputText = [ style.symbol(this.done, this.aborted, this.exited), color.bold(this.msg), style.delimiter(this.completing), this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input) ].join(" "); if (!this.done) { const suggestions = this.suggestions.slice(startIndex, endIndex).map((item, i5) => this.renderOption( item, this.select === i5 + startIndex, i5 === 0 && startIndex > 0, i5 + startIndex === endIndex - 1 && endIndex < this.choices.length )).join("\n"); this.outputText += ` ` + (suggestions || color.gray(this.fallback.title)); } this.out.write(erase.line + cursor.to(0) + this.outputText); } }; __name(AutocompletePrompt, "AutocompletePrompt"); module3.exports = AutocompletePrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.js var require_autocompleteMultiselect2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.js"(exports2, module3) { "use strict"; init_import_meta_url(); var color = require_kleur(); var { cursor } = require_src(); var MultiselectPrompt = require_multiselect2(); var { clear, style, figures } = require_util9(); var AutocompleteMultiselectPrompt = class extends MultiselectPrompt { constructor(opts = {}) { opts.overrideRender = true; super(opts); this.inputValue = ""; this.clear = clear("", this.out.columns); this.filteredOptions = this.value; this.render(); } last() { this.cursor = this.filteredOptions.length - 1; this.render(); } next() { this.cursor = (this.cursor + 1) % this.filteredOptions.length; this.render(); } up() { if (this.cursor === 0) { this.cursor = this.filteredOptions.length - 1; } else { this.cursor--; } this.render(); } down() { if (this.cursor === this.filteredOptions.length - 1) { this.cursor = 0; } else { this.cursor++; } this.render(); } left() { this.filteredOptions[this.cursor].selected = false; this.render(); } right() { if (this.value.filter((e7) => e7.selected).length >= this.maxChoices) return this.bell(); this.filteredOptions[this.cursor].selected = true; this.render(); } delete() { if (this.inputValue.length) { this.inputValue = this.inputValue.substr(0, this.inputValue.length - 1); this.updateFilteredOptions(); } } updateFilteredOptions() { const currentHighlight = this.filteredOptions[this.cursor]; this.filteredOptions = this.value.filter((v7) => { if (this.inputValue) { if (typeof v7.title === "string") { if (v7.title.toLowerCase().includes(this.inputValue.toLowerCase())) { return true; } } if (typeof v7.value === "string") { if (v7.value.toLowerCase().includes(this.inputValue.toLowerCase())) { return true; } } return false; } return true; }); const newHighlightIndex = this.filteredOptions.findIndex((v7) => v7 === currentHighlight); this.cursor = newHighlightIndex < 0 ? 0 : newHighlightIndex; this.render(); } handleSpaceToggle() { const v7 = this.filteredOptions[this.cursor]; if (v7.selected) { v7.selected = false; this.render(); } else if (v7.disabled || this.value.filter((e7) => e7.selected).length >= this.maxChoices) { return this.bell(); } else { v7.selected = true; this.render(); } } handleInputChange(c6) { this.inputValue = this.inputValue + c6; this.updateFilteredOptions(); } _(c6, key) { if (c6 === " ") { this.handleSpaceToggle(); } else { this.handleInputChange(c6); } } renderInstructions() { if (this.instructions === void 0 || this.instructions) { if (typeof this.instructions === "string") { return this.instructions; } return ` Instructions: ${figures.arrowUp}/${figures.arrowDown}: Highlight option ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection [a,b,c]/delete: Filter choices enter/return: Complete answer `; } return ""; } renderCurrentInput() { return ` Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter something to filter")} `; } renderOption(cursor2, v7, i5) { let title; if (v7.disabled) title = cursor2 === i5 ? color.gray().underline(v7.title) : color.strikethrough().gray(v7.title); else title = cursor2 === i5 ? color.cyan().underline(v7.title) : v7.title; return (v7.selected ? color.green(figures.radioOn) : figures.radioOff) + " " + title; } renderDoneOrInstructions() { if (this.done) { return this.value.filter((e7) => e7.selected).map((v7) => v7.title).join(", "); } const output = [color.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()]; if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) { output.push(color.yellow(this.warn)); } return output.join(" "); } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); super.render(); let prompt2 = [ style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions() ].join(" "); if (this.showMinError) { prompt2 += color.red(`You must select a minimum of ${this.minSelected} choices.`); this.showMinError = false; } prompt2 += this.renderOptions(this.filteredOptions); this.out.write(this.clear + prompt2); this.clear = clear(prompt2, this.out.columns); } }; __name(AutocompleteMultiselectPrompt, "AutocompleteMultiselectPrompt"); module3.exports = AutocompleteMultiselectPrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js var require_confirm2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js"(exports2, module3) { init_import_meta_url(); var color = require_kleur(); var Prompt = require_prompt2(); var { style, clear } = require_util9(); var { erase, cursor } = require_src(); var ConfirmPrompt = class extends Prompt { constructor(opts = {}) { super(opts); this.msg = opts.message; this.value = opts.initial; this.initialValue = !!opts.initial; this.yesMsg = opts.yes || "yes"; this.yesOption = opts.yesOption || "(Y/n)"; this.noMsg = opts.no || "no"; this.noOption = opts.noOption || "(y/N)"; this.render(); } reset() { this.value = this.initialValue; this.fire(); this.render(); } exit() { this.abort(); } abort() { this.done = this.aborted = true; this.fire(); this.render(); this.out.write("\n"); this.close(); } submit() { this.value = this.value || false; this.done = true; this.aborted = false; this.fire(); this.render(); this.out.write("\n"); this.close(); } _(c6, key) { if (c6.toLowerCase() === "y") { this.value = true; return this.submit(); } if (c6.toLowerCase() === "n") { this.value = false; return this.submit(); } return this.bell(); } render() { if (this.closed) return; if (this.firstRender) this.out.write(cursor.hide); else this.out.write(clear(this.outputText, this.out.columns)); super.render(); this.outputText = [ style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.done ? this.value ? this.yesMsg : this.noMsg : color.gray(this.initialValue ? this.yesOption : this.noOption) ].join(" "); this.out.write(erase.line + cursor.to(0) + this.outputText); } }; __name(ConfirmPrompt, "ConfirmPrompt"); module3.exports = ConfirmPrompt; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.js var require_elements2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = { TextPrompt: require_text2(), SelectPrompt: require_select2(), TogglePrompt: require_toggle2(), DatePrompt: require_date2(), NumberPrompt: require_number2(), MultiselectPrompt: require_multiselect2(), AutocompletePrompt: require_autocomplete2(), AutocompleteMultiselectPrompt: require_autocompleteMultiselect2(), ConfirmPrompt: require_confirm2() }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.js var require_prompts2 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.js"(exports2) { "use strict"; init_import_meta_url(); var $3 = exports2; var el = require_elements2(); var noop = /* @__PURE__ */ __name((v7) => v7, "noop"); function toPrompt(type, args, opts = {}) { return new Promise((res, rej) => { const p6 = new el[type](args); const onAbort = opts.onAbort || noop; const onSubmit = opts.onSubmit || noop; const onExit6 = opts.onExit || noop; p6.on("state", args.onState || noop); p6.on("submit", (x6) => res(onSubmit(x6))); p6.on("exit", (x6) => res(onExit6(x6))); p6.on("abort", (x6) => rej(onAbort(x6))); }); } __name(toPrompt, "toPrompt"); $3.text = (args) => toPrompt("TextPrompt", args); $3.password = (args) => { args.style = "password"; return $3.text(args); }; $3.invisible = (args) => { args.style = "invisible"; return $3.text(args); }; $3.number = (args) => toPrompt("NumberPrompt", args); $3.date = (args) => toPrompt("DatePrompt", args); $3.confirm = (args) => toPrompt("ConfirmPrompt", args); $3.list = (args) => { const sep5 = args.separator || ","; return toPrompt("TextPrompt", args, { onSubmit: (str) => str.split(sep5).map((s5) => s5.trim()) }); }; $3.toggle = (args) => toPrompt("TogglePrompt", args); $3.select = (args) => toPrompt("SelectPrompt", args); $3.multiselect = (args) => { args.choices = [].concat(args.choices || []); const toSelected = /* @__PURE__ */ __name((items) => items.filter((item) => item.selected).map((item) => item.value), "toSelected"); return toPrompt("MultiselectPrompt", args, { onAbort: toSelected, onSubmit: toSelected }); }; $3.autocompleteMultiselect = (args) => { args.choices = [].concat(args.choices || []); const toSelected = /* @__PURE__ */ __name((items) => items.filter((item) => item.selected).map((item) => item.value), "toSelected"); return toPrompt("AutocompleteMultiselectPrompt", args, { onAbort: toSelected, onSubmit: toSelected }); }; var byTitle = /* @__PURE__ */ __name((input, choices) => Promise.resolve( choices.filter((item) => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase()) ), "byTitle"); $3.autocomplete = (args) => { args.suggest = args.suggest || byTitle; args.choices = [].concat(args.choices || []); return toPrompt("AutocompletePrompt", args); }; } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/index.js var require_lib = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var prompts2 = require_prompts2(); var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"]; var noop = /* @__PURE__ */ __name(() => { }, "noop"); async function prompt2(questions = [], { onSubmit = noop, onCancel = noop } = {}) { const answers = {}; const override2 = prompt2._override || {}; questions = [].concat(questions); let answer, question, quit, name2, type, lastPrompt; const getFormattedAnswer = /* @__PURE__ */ __name(async (question2, answer2, skipValidation = false) => { if (!skipValidation && question2.validate && question2.validate(answer2) !== true) { return; } return question2.format ? await question2.format(answer2, answers) : answer2; }, "getFormattedAnswer"); for (question of questions) { ({ name: name2, type } = question); if (typeof type === "function") { type = await type(answer, { ...answers }, question); question["type"] = type; } if (!type) continue; for (let key in question) { if (passOn.includes(key)) continue; let value = question[key]; question[key] = typeof value === "function" ? await value(answer, { ...answers }, lastPrompt) : value; } lastPrompt = question; if (typeof question.message !== "string") { throw new Error("prompt message is required"); } ({ name: name2, type } = question); if (prompts2[type] === void 0) { throw new Error(`prompt type (${type}) is not defined`); } if (override2[question.name] !== void 0) { answer = await getFormattedAnswer(question, override2[question.name]); if (answer !== void 0) { answers[name2] = answer; continue; } } try { answer = prompt2._injected ? getInjectedAnswer(prompt2._injected, question.initial) : await prompts2[type](question); answers[name2] = answer = await getFormattedAnswer(question, answer, true); quit = await onSubmit(question, answer, answers); } catch (err) { quit = !await onCancel(question, answers); } if (quit) return answers; } return answers; } __name(prompt2, "prompt"); function getInjectedAnswer(injected, deafultValue) { const answer = injected.shift(); if (answer instanceof Error) { throw answer; } return answer === void 0 ? deafultValue : answer; } __name(getInjectedAnswer, "getInjectedAnswer"); function inject(answers) { prompt2._injected = (prompt2._injected || []).concat(answers); } __name(inject, "inject"); function override(answers) { prompt2._override = Object.assign({}, answers); } __name(override, "override"); module3.exports = Object.assign(prompt2, { prompt: prompt2, prompts: prompts2, inject, override }); } }); // ../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.js var require_prompts3 = __commonJS({ "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.js"(exports2, module3) { init_import_meta_url(); function isNodeLT(tar) { tar = (Array.isArray(tar) ? tar : tar.split(".")).map(Number); let i5 = 0, src = process.versions.node.split(".").map(Number); for (; i5 < tar.length; i5++) { if (src[i5] > tar[i5]) return false; if (tar[i5] > src[i5]) return true; } return false; } __name(isNodeLT, "isNodeLT"); module3.exports = isNodeLT("8.6.0") ? require_dist2() : require_lib(); } }); // ../../node_modules/.pnpm/is-docker@2.2.1/node_modules/is-docker/index.js var require_is_docker = __commonJS({ "../../node_modules/.pnpm/is-docker@2.2.1/node_modules/is-docker/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var fs27 = require("fs"); var isDocker; function hasDockerEnv() { try { fs27.statSync("/.dockerenv"); return true; } catch (_4) { return false; } } __name(hasDockerEnv, "hasDockerEnv"); function hasDockerCGroup() { try { return fs27.readFileSync("/proc/self/cgroup", "utf8").includes("docker"); } catch (_4) { return false; } } __name(hasDockerCGroup, "hasDockerCGroup"); module3.exports = () => { if (isDocker === void 0) { isDocker = hasDockerEnv() || hasDockerCGroup(); } return isDocker; }; } }); // ../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js var require_is_wsl = __commonJS({ "../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var os13 = require("os"); var fs27 = require("fs"); var isDocker = require_is_docker(); var isWsl = /* @__PURE__ */ __name(() => { if (process.platform !== "linux") { return false; } if (os13.release().toLowerCase().includes("microsoft")) { if (isDocker()) { return false; } return true; } try { return fs27.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isDocker() : false; } catch (_4) { return false; } }, "isWsl"); if (process.env.__IS_WSL_TEST__) { module3.exports = isWsl; } else { module3.exports = isWsl(); } } }); // ../../node_modules/.pnpm/define-lazy-prop@2.0.0/node_modules/define-lazy-prop/index.js var require_define_lazy_prop = __commonJS({ "../../node_modules/.pnpm/define-lazy-prop@2.0.0/node_modules/define-lazy-prop/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = (object, propertyName, fn2) => { const define = /* @__PURE__ */ __name((value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true }), "define"); Object.defineProperty(object, propertyName, { configurable: true, enumerable: true, get() { const result = fn2(); define(result); return result; }, set(value) { define(value); } }); return object; }; } }); // ../../node_modules/.pnpm/open@8.4.0/node_modules/open/index.js var require_open = __commonJS({ "../../node_modules/.pnpm/open@8.4.0/node_modules/open/index.js"(exports2, module3) { init_import_meta_url(); var path72 = require("path"); var childProcess2 = require("child_process"); var { promises: fs27, constants: fsConstants } = require("fs"); var isWsl = require_is_wsl(); var isDocker = require_is_docker(); var defineLazyProperty = require_define_lazy_prop(); var localXdgOpenPath = path72.join(__dirname, "xdg-open"); var { platform: platform3, arch: arch2 } = process; var getWslDrivesMountPoint = (() => { const defaultMountPoint = "/mnt/"; let mountPoint; return async function() { if (mountPoint) { return mountPoint; } const configFilePath = "/etc/wsl.conf"; let isConfigFileExists = false; try { await fs27.access(configFilePath, fsConstants.F_OK); isConfigFileExists = true; } catch { } if (!isConfigFileExists) { return defaultMountPoint; } const configContent = await fs27.readFile(configFilePath, { encoding: "utf8" }); const configMountPoint = /(?.*)/g.exec(configContent); if (!configMountPoint) { return defaultMountPoint; } mountPoint = configMountPoint.groups.mountPoint.trim(); mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`; return mountPoint; }; })(); var pTryEach = /* @__PURE__ */ __name(async (array, mapper) => { let latestError; for (const item of array) { try { return await mapper(item); } catch (error2) { latestError = error2; } } throw latestError; }, "pTryEach"); var baseOpen = /* @__PURE__ */ __name(async (options32) => { options32 = { wait: false, background: false, newInstance: false, allowNonzeroExitCode: false, ...options32 }; if (Array.isArray(options32.app)) { return pTryEach(options32.app, (singleApp) => baseOpen({ ...options32, app: singleApp })); } let { name: app, arguments: appArguments = [] } = options32.app || {}; appArguments = [...appArguments]; if (Array.isArray(app)) { return pTryEach(app, (appName) => baseOpen({ ...options32, app: { name: appName, arguments: appArguments } })); } let command2; const cliArguments = []; const childProcessOptions = {}; if (platform3 === "darwin") { command2 = "open"; if (options32.wait) { cliArguments.push("--wait-apps"); } if (options32.background) { cliArguments.push("--background"); } if (options32.newInstance) { cliArguments.push("--new"); } if (app) { cliArguments.push("-a", app); } } else if (platform3 === "win32" || isWsl && !isDocker()) { const mountPoint = await getWslDrivesMountPoint(); command2 = isWsl ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`; cliArguments.push( "-NoProfile", "-NonInteractive", "\u2013ExecutionPolicy", "Bypass", "-EncodedCommand" ); if (!isWsl) { childProcessOptions.windowsVerbatimArguments = true; } const encodedArguments = ["Start"]; if (options32.wait) { encodedArguments.push("-Wait"); } if (app) { encodedArguments.push(`"\`"${app}\`""`, "-ArgumentList"); if (options32.target) { appArguments.unshift(options32.target); } } else if (options32.target) { encodedArguments.push(`"${options32.target}"`); } if (appArguments.length > 0) { appArguments = appArguments.map((arg) => `"\`"${arg}\`""`); encodedArguments.push(appArguments.join(",")); } options32.target = Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64"); } else { if (app) { command2 = app; } else { const isBundled = !__dirname || __dirname === "/"; let exeLocalXdgOpen = false; try { await fs27.access(localXdgOpenPath, fsConstants.X_OK); exeLocalXdgOpen = true; } catch { } const useSystemXdgOpen = process.versions.electron || platform3 === "android" || isBundled || !exeLocalXdgOpen; command2 = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath; } if (appArguments.length > 0) { cliArguments.push(...appArguments); } if (!options32.wait) { childProcessOptions.stdio = "ignore"; childProcessOptions.detached = true; } } if (options32.target) { cliArguments.push(options32.target); } if (platform3 === "darwin" && appArguments.length > 0) { cliArguments.push("--args", ...appArguments); } const subprocess = childProcess2.spawn(command2, cliArguments, childProcessOptions); if (options32.wait) { return new Promise((resolve25, reject) => { subprocess.once("error", reject); subprocess.once("close", (exitCode) => { if (options32.allowNonzeroExitCode && exitCode > 0) { reject(new Error(`Exited with code ${exitCode}`)); return; } resolve25(subprocess); }); }); } subprocess.unref(); return subprocess; }, "baseOpen"); var open4 = /* @__PURE__ */ __name((target, options32) => { if (typeof target !== "string") { throw new TypeError("Expected a `target`"); } return baseOpen({ ...options32, target }); }, "open"); var openApp = /* @__PURE__ */ __name((name2, options32) => { if (typeof name2 !== "string") { throw new TypeError("Expected a `name`"); } const { arguments: appArguments = [] } = options32 || {}; if (appArguments !== void 0 && appArguments !== null && !Array.isArray(appArguments)) { throw new TypeError("Expected `appArguments` as Array type"); } return baseOpen({ ...options32, app: { name: name2, arguments: appArguments } }); }, "openApp"); function detectArchBinary(binary) { if (typeof binary === "string" || Array.isArray(binary)) { return binary; } const { [arch2]: archBinary } = binary; if (!archBinary) { throw new Error(`${arch2} is not supported`); } return archBinary; } __name(detectArchBinary, "detectArchBinary"); function detectPlatformBinary({ [platform3]: platformBinary }, { wsl }) { if (wsl && isWsl) { return detectArchBinary(wsl); } if (!platformBinary) { throw new Error(`${platform3} is not supported`); } return detectArchBinary(platformBinary); } __name(detectPlatformBinary, "detectPlatformBinary"); var apps = {}; defineLazyProperty(apps, "chrome", () => detectPlatformBinary({ darwin: "google chrome", win32: "chrome", linux: ["google-chrome", "google-chrome-stable", "chromium"] }, { wsl: { ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe", x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"] } })); defineLazyProperty(apps, "firefox", () => detectPlatformBinary({ darwin: "firefox", win32: "C:\\Program Files\\Mozilla Firefox\\firefox.exe", linux: "firefox" }, { wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe" })); defineLazyProperty(apps, "edge", () => detectPlatformBinary({ darwin: "microsoft edge", win32: "msedge", linux: ["microsoft-edge", "microsoft-edge-dev"] }, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" })); open4.apps = apps; open4.openApp = openApp; module3.exports = open4; } }); // ../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js var require_glob_to_regexp = __commonJS({ "../../node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js"(exports2, module3) { init_import_meta_url(); module3.exports = function(glob, opts) { if (typeof glob !== "string") { throw new TypeError("Expected a string"); } var str = String(glob); var reStr = ""; var extended = opts ? !!opts.extended : false; var globstar = opts ? !!opts.globstar : false; var inGroup = false; var flags2 = opts && typeof opts.flags === "string" ? opts.flags : ""; var c6; for (var i5 = 0, len = str.length; i5 < len; i5++) { c6 = str[i5]; switch (c6) { case "/": case "$": case "^": case "+": case ".": case "(": case ")": case "=": case "!": case "|": reStr += "\\" + c6; break; case "?": if (extended) { reStr += "."; break; } case "[": case "]": if (extended) { reStr += c6; break; } case "{": if (extended) { inGroup = true; reStr += "("; break; } case "}": if (extended) { inGroup = false; reStr += ")"; break; } case ",": if (inGroup) { reStr += "|"; break; } reStr += "\\" + c6; break; case "*": var prevChar = str[i5 - 1]; var starCount = 1; while (str[i5 + 1] === "*") { starCount++; i5++; } var nextChar = str[i5 + 1]; if (!globstar) { reStr += ".*"; } else { var isGlobstar = starCount > 1 && (prevChar === "/" || prevChar === void 0) && (nextChar === "/" || nextChar === void 0); if (isGlobstar) { reStr += "((?:[^/]*(?:/|$))*)"; i5++; } else { reStr += "([^/]*)"; } } break; default: reStr += c6; } } if (!flags2 || !~flags2.indexOf("g")) { reStr = "^" + reStr + "$"; } return new RegExp(reStr, flags2); }; } }); // ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/homedir.js var require_homedir = __commonJS({ "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/homedir.js"(exports2, module3) { "use strict"; init_import_meta_url(); var os13 = require("os"); module3.exports = os13.homedir || /* @__PURE__ */ __name(function homedir3() { var home = process.env.HOME; var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME; if (process.platform === "win32") { return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null; } if (process.platform === "darwin") { return home || (user ? "/Users/" + user : null); } if (process.platform === "linux") { return home || (process.getuid() === 0 ? "/root" : user ? "/home/" + user : null); } return home || null; }, "homedir"); } }); // ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/caller.js var require_caller = __commonJS({ "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/caller.js"(exports2, module3) { init_import_meta_url(); module3.exports = function() { var origPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = function(_4, stack2) { return stack2; }; var stack = new Error().stack; Error.prepareStackTrace = origPrepareStackTrace; return stack[2].getFileName(); }; } }); // ../../node_modules/.pnpm/path-parse@1.0.7/node_modules/path-parse/index.js var require_path_parse = __commonJS({ "../../node_modules/.pnpm/path-parse@1.0.7/node_modules/path-parse/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var isWindows4 = process.platform === "win32"; var splitWindowsRe = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/; var win32 = {}; function win32SplitPath(filename) { return splitWindowsRe.exec(filename).slice(1); } __name(win32SplitPath, "win32SplitPath"); win32.parse = function(pathString) { if (typeof pathString !== "string") { throw new TypeError( "Parameter 'pathString' must be a string, not " + typeof pathString ); } var allParts = win32SplitPath(pathString); if (!allParts || allParts.length !== 5) { throw new TypeError("Invalid path '" + pathString + "'"); } return { root: allParts[1], dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1), base: allParts[2], ext: allParts[4], name: allParts[3] }; }; var splitPathRe = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/; var posix2 = {}; function posixSplitPath(filename) { return splitPathRe.exec(filename).slice(1); } __name(posixSplitPath, "posixSplitPath"); posix2.parse = function(pathString) { if (typeof pathString !== "string") { throw new TypeError( "Parameter 'pathString' must be a string, not " + typeof pathString ); } var allParts = posixSplitPath(pathString); if (!allParts || allParts.length !== 5) { throw new TypeError("Invalid path '" + pathString + "'"); } return { root: allParts[1], dir: allParts[0].slice(0, -1), base: allParts[2], ext: allParts[4], name: allParts[3] }; }; if (isWindows4) module3.exports = win32.parse; else module3.exports = posix2.parse; module3.exports.posix = posix2.parse; module3.exports.win32 = win32.parse; } }); // ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/node-modules-paths.js var require_node_modules_paths = __commonJS({ "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/node-modules-paths.js"(exports2, module3) { init_import_meta_url(); var path72 = require("path"); var parse7 = path72.parse || require_path_parse(); var getNodeModulesDirs = /* @__PURE__ */ __name(function getNodeModulesDirs2(absoluteStart, modules) { var prefix = "/"; if (/^([A-Za-z]:)/.test(absoluteStart)) { prefix = ""; } else if (/^\\\\/.test(absoluteStart)) { prefix = "\\\\"; } var paths = [absoluteStart]; var parsed = parse7(absoluteStart); while (parsed.dir !== paths[paths.length - 1]) { paths.push(parsed.dir); parsed = parse7(parsed.dir); } return paths.reduce(function(dirs, aPath) { return dirs.concat(modules.map(function(moduleDir) { return path72.resolve(prefix, aPath, moduleDir); })); }, []); }, "getNodeModulesDirs"); module3.exports = /* @__PURE__ */ __name(function nodeModulesPaths(start, opts, request4) { var modules = opts && opts.moduleDirectory ? [].concat(opts.moduleDirectory) : ["node_modules"]; if (opts && typeof opts.paths === "function") { return opts.paths( request4, start, function() { return getNodeModulesDirs(start, modules); }, opts ); } var dirs = getNodeModulesDirs(start, modules); return opts && opts.paths ? dirs.concat(opts.paths) : dirs; }, "nodeModulesPaths"); } }); // ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/normalize-options.js var require_normalize_options = __commonJS({ "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/normalize-options.js"(exports2, module3) { init_import_meta_url(); module3.exports = function(x6, opts) { return opts || {}; }; } }); // ../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js var require_implementation = __commonJS({ "../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(exports2, module3) { "use strict"; init_import_meta_url(); var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; var toStr = Object.prototype.toString; var max = Math.max; var funcType = "[object Function]"; var concatty = /* @__PURE__ */ __name(function concatty2(a5, b6) { var arr = []; for (var i5 = 0; i5 < a5.length; i5 += 1) { arr[i5] = a5[i5]; } for (var j6 = 0; j6 < b6.length; j6 += 1) { arr[j6 + a5.length] = b6[j6]; } return arr; }, "concatty"); var slicy = /* @__PURE__ */ __name(function slicy2(arrLike, offset) { var arr = []; for (var i5 = offset || 0, j6 = 0; i5 < arrLike.length; i5 += 1, j6 += 1) { arr[j6] = arrLike[i5]; } return arr; }, "slicy"); var joiny = /* @__PURE__ */ __name(function(arr, joiner) { var str = ""; for (var i5 = 0; i5 < arr.length; i5 += 1) { str += arr[i5]; if (i5 + 1 < arr.length) { str += joiner; } } return str; }, "joiny"); module3.exports = /* @__PURE__ */ __name(function bind(that) { var target = this; if (typeof target !== "function" || toStr.apply(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } var args = slicy(arguments, 1); var bound; var binder = /* @__PURE__ */ __name(function() { if (this instanceof bound) { var result = target.apply( this, concatty(args, arguments) ); if (Object(result) === result) { return result; } return this; } return target.apply( that, concatty(args, arguments) ); }, "binder"); var boundLength = max(0, target.length - args.length); var boundArgs = []; for (var i5 = 0; i5 < boundLength; i5++) { boundArgs[i5] = "$" + i5; } bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); if (target.prototype) { var Empty = /* @__PURE__ */ __name(function Empty2() { }, "Empty"); Empty.prototype = target.prototype; bound.prototype = new Empty(); Empty.prototype = null; } return bound; }, "bind"); } }); // ../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js var require_function_bind = __commonJS({ "../../node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var implementation = require_implementation(); module3.exports = Function.prototype.bind || implementation; } }); // ../../node_modules/.pnpm/has@1.0.3/node_modules/has/src/index.js var require_src2 = __commonJS({ "../../node_modules/.pnpm/has@1.0.3/node_modules/has/src/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var bind = require_function_bind(); module3.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); } }); // ../../node_modules/.pnpm/is-core-module@2.13.0/node_modules/is-core-module/core.json var require_core = __commonJS({ "../../node_modules/.pnpm/is-core-module@2.13.0/node_modules/is-core-module/core.json"(exports2, module3) { module3.exports = { assert: true, "node:assert": [">= 14.18 && < 15", ">= 16"], "assert/strict": ">= 15", "node:assert/strict": ">= 16", async_hooks: ">= 8", "node:async_hooks": [">= 14.18 && < 15", ">= 16"], buffer_ieee754: ">= 0.5 && < 0.9.7", buffer: true, "node:buffer": [">= 14.18 && < 15", ">= 16"], child_process: true, "node:child_process": [">= 14.18 && < 15", ">= 16"], cluster: ">= 0.5", "node:cluster": [">= 14.18 && < 15", ">= 16"], console: true, "node:console": [">= 14.18 && < 15", ">= 16"], constants: true, "node:constants": [">= 14.18 && < 15", ">= 16"], crypto: true, "node:crypto": [">= 14.18 && < 15", ">= 16"], _debug_agent: ">= 1 && < 8", _debugger: "< 8", dgram: true, "node:dgram": [">= 14.18 && < 15", ">= 16"], diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"], "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"], dns: true, "node:dns": [">= 14.18 && < 15", ">= 16"], "dns/promises": ">= 15", "node:dns/promises": ">= 16", domain: ">= 0.7.12", "node:domain": [">= 14.18 && < 15", ">= 16"], events: true, "node:events": [">= 14.18 && < 15", ">= 16"], freelist: "< 6", fs: true, "node:fs": [">= 14.18 && < 15", ">= 16"], "fs/promises": [">= 10 && < 10.1", ">= 14"], "node:fs/promises": [">= 14.18 && < 15", ">= 16"], _http_agent: ">= 0.11.1", "node:_http_agent": [">= 14.18 && < 15", ">= 16"], _http_client: ">= 0.11.1", "node:_http_client": [">= 14.18 && < 15", ">= 16"], _http_common: ">= 0.11.1", "node:_http_common": [">= 14.18 && < 15", ">= 16"], _http_incoming: ">= 0.11.1", "node:_http_incoming": [">= 14.18 && < 15", ">= 16"], _http_outgoing: ">= 0.11.1", "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"], _http_server: ">= 0.11.1", "node:_http_server": [">= 14.18 && < 15", ">= 16"], http: true, "node:http": [">= 14.18 && < 15", ">= 16"], http2: ">= 8.8", "node:http2": [">= 14.18 && < 15", ">= 16"], https: true, "node:https": [">= 14.18 && < 15", ">= 16"], inspector: ">= 8", "node:inspector": [">= 14.18 && < 15", ">= 16"], "inspector/promises": [">= 19"], "node:inspector/promises": [">= 19"], _linklist: "< 8", module: true, "node:module": [">= 14.18 && < 15", ">= 16"], net: true, "node:net": [">= 14.18 && < 15", ">= 16"], "node-inspect/lib/_inspect": ">= 7.6 && < 12", "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12", "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12", os: true, "node:os": [">= 14.18 && < 15", ">= 16"], path: true, "node:path": [">= 14.18 && < 15", ">= 16"], "path/posix": ">= 15.3", "node:path/posix": ">= 16", "path/win32": ">= 15.3", "node:path/win32": ">= 16", perf_hooks: ">= 8.5", "node:perf_hooks": [">= 14.18 && < 15", ">= 16"], process: ">= 1", "node:process": [">= 14.18 && < 15", ">= 16"], punycode: ">= 0.5", "node:punycode": [">= 14.18 && < 15", ">= 16"], querystring: true, "node:querystring": [">= 14.18 && < 15", ">= 16"], readline: true, "node:readline": [">= 14.18 && < 15", ">= 16"], "readline/promises": ">= 17", "node:readline/promises": ">= 17", repl: true, "node:repl": [">= 14.18 && < 15", ">= 16"], smalloc: ">= 0.11.5 && < 3", _stream_duplex: ">= 0.9.4", "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"], _stream_transform: ">= 0.9.4", "node:_stream_transform": [">= 14.18 && < 15", ">= 16"], _stream_wrap: ">= 1.4.1", "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"], _stream_passthrough: ">= 0.9.4", "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"], _stream_readable: ">= 0.9.4", "node:_stream_readable": [">= 14.18 && < 15", ">= 16"], _stream_writable: ">= 0.9.4", "node:_stream_writable": [">= 14.18 && < 15", ">= 16"], stream: true, "node:stream": [">= 14.18 && < 15", ">= 16"], "stream/consumers": ">= 16.7", "node:stream/consumers": ">= 16.7", "stream/promises": ">= 15", "node:stream/promises": ">= 16", "stream/web": ">= 16.5", "node:stream/web": ">= 16.5", string_decoder: true, "node:string_decoder": [">= 14.18 && < 15", ">= 16"], sys: [">= 0.4 && < 0.7", ">= 0.8"], "node:sys": [">= 14.18 && < 15", ">= 16"], "test/reporters": ">= 19.9 && < 20.2", "node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"], "node:test": [">= 16.17 && < 17", ">= 18"], timers: true, "node:timers": [">= 14.18 && < 15", ">= 16"], "timers/promises": ">= 15", "node:timers/promises": ">= 16", _tls_common: ">= 0.11.13", "node:_tls_common": [">= 14.18 && < 15", ">= 16"], _tls_legacy: ">= 0.11.3 && < 10", _tls_wrap: ">= 0.11.3", "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"], tls: true, "node:tls": [">= 14.18 && < 15", ">= 16"], trace_events: ">= 10", "node:trace_events": [">= 14.18 && < 15", ">= 16"], tty: true, "node:tty": [">= 14.18 && < 15", ">= 16"], url: true, "node:url": [">= 14.18 && < 15", ">= 16"], util: true, "node:util": [">= 14.18 && < 15", ">= 16"], "util/types": ">= 15.3", "node:util/types": ">= 16", "v8/tools/arguments": ">= 10 && < 12", "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"], "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"], "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"], "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"], "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"], "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"], v8: ">= 1", "node:v8": [">= 14.18 && < 15", ">= 16"], vm: true, "node:vm": [">= 14.18 && < 15", ">= 16"], wasi: [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"], "node:wasi": [">= 18.17 && < 19", ">= 20"], worker_threads: ">= 11.7", "node:worker_threads": [">= 14.18 && < 15", ">= 16"], zlib: ">= 0.5", "node:zlib": [">= 14.18 && < 15", ">= 16"] }; } }); // ../../node_modules/.pnpm/is-core-module@2.13.0/node_modules/is-core-module/index.js var require_is_core_module = __commonJS({ "../../node_modules/.pnpm/is-core-module@2.13.0/node_modules/is-core-module/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var has = require_src2(); function specifierIncluded(current, specifier) { var nodeParts = current.split("."); var parts = specifier.split(" "); var op = parts.length > 1 ? parts[0] : "="; var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split("."); for (var i5 = 0; i5 < 3; ++i5) { var cur = parseInt(nodeParts[i5] || 0, 10); var ver = parseInt(versionParts[i5] || 0, 10); if (cur === ver) { continue; } if (op === "<") { return cur < ver; } if (op === ">=") { return cur >= ver; } return false; } return op === ">="; } __name(specifierIncluded, "specifierIncluded"); function matchesRange(current, range) { var specifiers = range.split(/ ?&& ?/); if (specifiers.length === 0) { return false; } for (var i5 = 0; i5 < specifiers.length; ++i5) { if (!specifierIncluded(current, specifiers[i5])) { return false; } } return true; } __name(matchesRange, "matchesRange"); function versionIncluded(nodeVersion2, specifierValue) { if (typeof specifierValue === "boolean") { return specifierValue; } var current = typeof nodeVersion2 === "undefined" ? process.versions && process.versions.node : nodeVersion2; if (typeof current !== "string") { throw new TypeError(typeof nodeVersion2 === "undefined" ? "Unable to determine current node version" : "If provided, a valid node version is required"); } if (specifierValue && typeof specifierValue === "object") { for (var i5 = 0; i5 < specifierValue.length; ++i5) { if (matchesRange(current, specifierValue[i5])) { return true; } } return false; } return matchesRange(current, specifierValue); } __name(versionIncluded, "versionIncluded"); var data = require_core(); module3.exports = /* @__PURE__ */ __name(function isCore(x6, nodeVersion2) { return has(data, x6) && versionIncluded(nodeVersion2, data[x6]); }, "isCore"); } }); // ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/async.js var require_async = __commonJS({ "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/async.js"(exports2, module3) { init_import_meta_url(); var fs27 = require("fs"); var getHomedir = require_homedir(); var path72 = require("path"); var caller = require_caller(); var nodeModulesPaths = require_node_modules_paths(); var normalizeOptions = require_normalize_options(); var isCore = require_is_core_module(); var realpathFS = process.platform !== "win32" && fs27.realpath && typeof fs27.realpath.native === "function" ? fs27.realpath.native : fs27.realpath; var homedir3 = getHomedir(); var defaultPaths = /* @__PURE__ */ __name(function() { return [ path72.join(homedir3, ".node_modules"), path72.join(homedir3, ".node_libraries") ]; }, "defaultPaths"); var defaultIsFile = /* @__PURE__ */ __name(function isFile(file, cb2) { fs27.stat(file, function(err, stat9) { if (!err) { return cb2(null, stat9.isFile() || stat9.isFIFO()); } if (err.code === "ENOENT" || err.code === "ENOTDIR") return cb2(null, false); return cb2(err); }); }, "isFile"); var defaultIsDir = /* @__PURE__ */ __name(function isDirectory2(dir, cb2) { fs27.stat(dir, function(err, stat9) { if (!err) { return cb2(null, stat9.isDirectory()); } if (err.code === "ENOENT" || err.code === "ENOTDIR") return cb2(null, false); return cb2(err); }); }, "isDirectory"); var defaultRealpath = /* @__PURE__ */ __name(function realpath2(x6, cb2) { realpathFS(x6, function(realpathErr, realPath) { if (realpathErr && realpathErr.code !== "ENOENT") cb2(realpathErr); else cb2(null, realpathErr ? x6 : realPath); }); }, "realpath"); var maybeRealpath = /* @__PURE__ */ __name(function maybeRealpath2(realpath2, x6, opts, cb2) { if (opts && opts.preserveSymlinks === false) { realpath2(x6, cb2); } else { cb2(null, x6); } }, "maybeRealpath"); var defaultReadPackage = /* @__PURE__ */ __name(function defaultReadPackage2(readFile17, pkgfile, cb2) { readFile17(pkgfile, function(readFileErr, body) { if (readFileErr) cb2(readFileErr); else { try { var pkg = JSON.parse(body); cb2(null, pkg); } catch (jsonErr) { cb2(null); } } }); }, "defaultReadPackage"); var getPackageCandidates = /* @__PURE__ */ __name(function getPackageCandidates2(x6, start, opts) { var dirs = nodeModulesPaths(start, opts, x6); for (var i5 = 0; i5 < dirs.length; i5++) { dirs[i5] = path72.join(dirs[i5], x6); } return dirs; }, "getPackageCandidates"); module3.exports = /* @__PURE__ */ __name(function resolve25(x6, options32, callback) { var cb2 = callback; var opts = options32; if (typeof options32 === "function") { cb2 = opts; opts = {}; } if (typeof x6 !== "string") { var err = new TypeError("Path must be a string."); return process.nextTick(function() { cb2(err); }); } opts = normalizeOptions(x6, opts); var isFile = opts.isFile || defaultIsFile; var isDirectory2 = opts.isDirectory || defaultIsDir; var readFile17 = opts.readFile || fs27.readFile; var realpath2 = opts.realpath || defaultRealpath; var readPackage = opts.readPackage || defaultReadPackage; if (opts.readFile && opts.readPackage) { var conflictErr = new TypeError("`readFile` and `readPackage` are mutually exclusive."); return process.nextTick(function() { cb2(conflictErr); }); } var packageIterator = opts.packageIterator; var extensions = opts.extensions || [".js"]; var includeCoreModules = opts.includeCoreModules !== false; var basedir = opts.basedir || path72.dirname(caller()); var parent = opts.filename || basedir; opts.paths = opts.paths || defaultPaths(); var absoluteStart = path72.resolve(basedir); maybeRealpath( realpath2, absoluteStart, opts, function(err2, realStart) { if (err2) cb2(err2); else init2(realStart); } ); var res; function init2(basedir2) { if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x6)) { res = path72.resolve(basedir2, x6); if (x6 === "." || x6 === ".." || x6.slice(-1) === "/") res += "/"; if (/\/$/.test(x6) && res === basedir2) { loadAsDirectory(res, opts.package, onfile); } else loadAsFile(res, opts.package, onfile); } else if (includeCoreModules && isCore(x6)) { return cb2(null, x6); } else loadNodeModules(x6, basedir2, function(err2, n6, pkg) { if (err2) cb2(err2); else if (n6) { return maybeRealpath(realpath2, n6, opts, function(err3, realN) { if (err3) { cb2(err3); } else { cb2(null, realN, pkg); } }); } else { var moduleError = new Error("Cannot find module '" + x6 + "' from '" + parent + "'"); moduleError.code = "MODULE_NOT_FOUND"; cb2(moduleError); } }); } __name(init2, "init"); function onfile(err2, m6, pkg) { if (err2) cb2(err2); else if (m6) cb2(null, m6, pkg); else loadAsDirectory(res, function(err3, d6, pkg2) { if (err3) cb2(err3); else if (d6) { maybeRealpath(realpath2, d6, opts, function(err4, realD) { if (err4) { cb2(err4); } else { cb2(null, realD, pkg2); } }); } else { var moduleError = new Error("Cannot find module '" + x6 + "' from '" + parent + "'"); moduleError.code = "MODULE_NOT_FOUND"; cb2(moduleError); } }); } __name(onfile, "onfile"); function loadAsFile(x7, thePackage, callback2) { var loadAsFilePackage = thePackage; var cb3 = callback2; if (typeof loadAsFilePackage === "function") { cb3 = loadAsFilePackage; loadAsFilePackage = void 0; } var exts = [""].concat(extensions); load(exts, x7, loadAsFilePackage); function load(exts2, x8, loadPackage) { if (exts2.length === 0) return cb3(null, void 0, loadPackage); var file = x8 + exts2[0]; var pkg = loadPackage; if (pkg) onpkg(null, pkg); else loadpkg(path72.dirname(file), onpkg); function onpkg(err2, pkg_, dir) { pkg = pkg_; if (err2) return cb3(err2); if (dir && pkg && opts.pathFilter) { var rfile = path72.relative(dir, file); var rel = rfile.slice(0, rfile.length - exts2[0].length); var r7 = opts.pathFilter(pkg, x8, rel); if (r7) return load( [""].concat(extensions.slice()), path72.resolve(dir, r7), pkg ); } isFile(file, onex); } __name(onpkg, "onpkg"); function onex(err2, ex) { if (err2) return cb3(err2); if (ex) return cb3(null, file, pkg); load(exts2.slice(1), x8, pkg); } __name(onex, "onex"); } __name(load, "load"); } __name(loadAsFile, "loadAsFile"); function loadpkg(dir, cb3) { if (dir === "" || dir === "/") return cb3(null); if (process.platform === "win32" && /^\w:[/\\]*$/.test(dir)) { return cb3(null); } if (/[/\\]node_modules[/\\]*$/.test(dir)) return cb3(null); maybeRealpath(realpath2, dir, opts, function(unwrapErr, pkgdir) { if (unwrapErr) return loadpkg(path72.dirname(dir), cb3); var pkgfile = path72.join(pkgdir, "package.json"); isFile(pkgfile, function(err2, ex) { if (!ex) return loadpkg(path72.dirname(dir), cb3); readPackage(readFile17, pkgfile, function(err3, pkgParam) { if (err3) cb3(err3); var pkg = pkgParam; if (pkg && opts.packageFilter) { pkg = opts.packageFilter(pkg, pkgfile); } cb3(null, pkg, dir); }); }); }); } __name(loadpkg, "loadpkg"); function loadAsDirectory(x7, loadAsDirectoryPackage, callback2) { var cb3 = callback2; var fpkg = loadAsDirectoryPackage; if (typeof fpkg === "function") { cb3 = fpkg; fpkg = opts.package; } maybeRealpath(realpath2, x7, opts, function(unwrapErr, pkgdir) { if (unwrapErr) return cb3(unwrapErr); var pkgfile = path72.join(pkgdir, "package.json"); isFile(pkgfile, function(err2, ex) { if (err2) return cb3(err2); if (!ex) return loadAsFile(path72.join(x7, "index"), fpkg, cb3); readPackage(readFile17, pkgfile, function(err3, pkgParam) { if (err3) return cb3(err3); var pkg = pkgParam; if (pkg && opts.packageFilter) { pkg = opts.packageFilter(pkg, pkgfile); } if (pkg && pkg.main) { if (typeof pkg.main !== "string") { var mainError = new TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string"); mainError.code = "INVALID_PACKAGE_MAIN"; return cb3(mainError); } if (pkg.main === "." || pkg.main === "./") { pkg.main = "index"; } loadAsFile(path72.resolve(x7, pkg.main), pkg, function(err4, m6, pkg2) { if (err4) return cb3(err4); if (m6) return cb3(null, m6, pkg2); if (!pkg2) return loadAsFile(path72.join(x7, "index"), pkg2, cb3); var dir = path72.resolve(x7, pkg2.main); loadAsDirectory(dir, pkg2, function(err5, n6, pkg3) { if (err5) return cb3(err5); if (n6) return cb3(null, n6, pkg3); loadAsFile(path72.join(x7, "index"), pkg3, cb3); }); }); return; } loadAsFile(path72.join(x7, "/index"), pkg, cb3); }); }); }); } __name(loadAsDirectory, "loadAsDirectory"); function processDirs(cb3, dirs) { if (dirs.length === 0) return cb3(null, void 0); var dir = dirs[0]; isDirectory2(path72.dirname(dir), isdir); function isdir(err2, isdir2) { if (err2) return cb3(err2); if (!isdir2) return processDirs(cb3, dirs.slice(1)); loadAsFile(dir, opts.package, onfile2); } __name(isdir, "isdir"); function onfile2(err2, m6, pkg) { if (err2) return cb3(err2); if (m6) return cb3(null, m6, pkg); loadAsDirectory(dir, opts.package, ondir); } __name(onfile2, "onfile"); function ondir(err2, n6, pkg) { if (err2) return cb3(err2); if (n6) return cb3(null, n6, pkg); processDirs(cb3, dirs.slice(1)); } __name(ondir, "ondir"); } __name(processDirs, "processDirs"); function loadNodeModules(x7, start, cb3) { var thunk = /* @__PURE__ */ __name(function() { return getPackageCandidates(x7, start, opts); }, "thunk"); processDirs( cb3, packageIterator ? packageIterator(x7, start, thunk, opts) : thunk() ); } __name(loadNodeModules, "loadNodeModules"); }, "resolve"); } }); // ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/core.json var require_core2 = __commonJS({ "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/core.json"(exports2, module3) { module3.exports = { assert: true, "node:assert": [">= 14.18 && < 15", ">= 16"], "assert/strict": ">= 15", "node:assert/strict": ">= 16", async_hooks: ">= 8", "node:async_hooks": [">= 14.18 && < 15", ">= 16"], buffer_ieee754: ">= 0.5 && < 0.9.7", buffer: true, "node:buffer": [">= 14.18 && < 15", ">= 16"], child_process: true, "node:child_process": [">= 14.18 && < 15", ">= 16"], cluster: ">= 0.5", "node:cluster": [">= 14.18 && < 15", ">= 16"], console: true, "node:console": [">= 14.18 && < 15", ">= 16"], constants: true, "node:constants": [">= 14.18 && < 15", ">= 16"], crypto: true, "node:crypto": [">= 14.18 && < 15", ">= 16"], _debug_agent: ">= 1 && < 8", _debugger: "< 8", dgram: true, "node:dgram": [">= 14.18 && < 15", ">= 16"], diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"], "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"], dns: true, "node:dns": [">= 14.18 && < 15", ">= 16"], "dns/promises": ">= 15", "node:dns/promises": ">= 16", domain: ">= 0.7.12", "node:domain": [">= 14.18 && < 15", ">= 16"], events: true, "node:events": [">= 14.18 && < 15", ">= 16"], freelist: "< 6", fs: true, "node:fs": [">= 14.18 && < 15", ">= 16"], "fs/promises": [">= 10 && < 10.1", ">= 14"], "node:fs/promises": [">= 14.18 && < 15", ">= 16"], _http_agent: ">= 0.11.1", "node:_http_agent": [">= 14.18 && < 15", ">= 16"], _http_client: ">= 0.11.1", "node:_http_client": [">= 14.18 && < 15", ">= 16"], _http_common: ">= 0.11.1", "node:_http_common": [">= 14.18 && < 15", ">= 16"], _http_incoming: ">= 0.11.1", "node:_http_incoming": [">= 14.18 && < 15", ">= 16"], _http_outgoing: ">= 0.11.1", "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"], _http_server: ">= 0.11.1", "node:_http_server": [">= 14.18 && < 15", ">= 16"], http: true, "node:http": [">= 14.18 && < 15", ">= 16"], http2: ">= 8.8", "node:http2": [">= 14.18 && < 15", ">= 16"], https: true, "node:https": [">= 14.18 && < 15", ">= 16"], inspector: ">= 8", "node:inspector": [">= 14.18 && < 15", ">= 16"], "inspector/promises": [">= 19"], "node:inspector/promises": [">= 19"], _linklist: "< 8", module: true, "node:module": [">= 14.18 && < 15", ">= 16"], net: true, "node:net": [">= 14.18 && < 15", ">= 16"], "node-inspect/lib/_inspect": ">= 7.6 && < 12", "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12", "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12", os: true, "node:os": [">= 14.18 && < 15", ">= 16"], path: true, "node:path": [">= 14.18 && < 15", ">= 16"], "path/posix": ">= 15.3", "node:path/posix": ">= 16", "path/win32": ">= 15.3", "node:path/win32": ">= 16", perf_hooks: ">= 8.5", "node:perf_hooks": [">= 14.18 && < 15", ">= 16"], process: ">= 1", "node:process": [">= 14.18 && < 15", ">= 16"], punycode: ">= 0.5", "node:punycode": [">= 14.18 && < 15", ">= 16"], querystring: true, "node:querystring": [">= 14.18 && < 15", ">= 16"], readline: true, "node:readline": [">= 14.18 && < 15", ">= 16"], "readline/promises": ">= 17", "node:readline/promises": ">= 17", repl: true, "node:repl": [">= 14.18 && < 15", ">= 16"], smalloc: ">= 0.11.5 && < 3", _stream_duplex: ">= 0.9.4", "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"], _stream_transform: ">= 0.9.4", "node:_stream_transform": [">= 14.18 && < 15", ">= 16"], _stream_wrap: ">= 1.4.1", "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"], _stream_passthrough: ">= 0.9.4", "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"], _stream_readable: ">= 0.9.4", "node:_stream_readable": [">= 14.18 && < 15", ">= 16"], _stream_writable: ">= 0.9.4", "node:_stream_writable": [">= 14.18 && < 15", ">= 16"], stream: true, "node:stream": [">= 14.18 && < 15", ">= 16"], "stream/consumers": ">= 16.7", "node:stream/consumers": ">= 16.7", "stream/promises": ">= 15", "node:stream/promises": ">= 16", "stream/web": ">= 16.5", "node:stream/web": ">= 16.5", string_decoder: true, "node:string_decoder": [">= 14.18 && < 15", ">= 16"], sys: [">= 0.4 && < 0.7", ">= 0.8"], "node:sys": [">= 14.18 && < 15", ">= 16"], "test/reporters": ">= 19.9 && < 20.2", "node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"], "node:test": [">= 16.17 && < 17", ">= 18"], timers: true, "node:timers": [">= 14.18 && < 15", ">= 16"], "timers/promises": ">= 15", "node:timers/promises": ">= 16", _tls_common: ">= 0.11.13", "node:_tls_common": [">= 14.18 && < 15", ">= 16"], _tls_legacy: ">= 0.11.3 && < 10", _tls_wrap: ">= 0.11.3", "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"], tls: true, "node:tls": [">= 14.18 && < 15", ">= 16"], trace_events: ">= 10", "node:trace_events": [">= 14.18 && < 15", ">= 16"], tty: true, "node:tty": [">= 14.18 && < 15", ">= 16"], url: true, "node:url": [">= 14.18 && < 15", ">= 16"], util: true, "node:util": [">= 14.18 && < 15", ">= 16"], "util/types": ">= 15.3", "node:util/types": ">= 16", "v8/tools/arguments": ">= 10 && < 12", "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"], "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"], "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"], "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"], "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"], "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"], v8: ">= 1", "node:v8": [">= 14.18 && < 15", ">= 16"], vm: true, "node:vm": [">= 14.18 && < 15", ">= 16"], wasi: [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"], "node:wasi": [">= 18.17 && < 19", ">= 20"], worker_threads: ">= 11.7", "node:worker_threads": [">= 14.18 && < 15", ">= 16"], zlib: ">= 0.5", "node:zlib": [">= 14.18 && < 15", ">= 16"] }; } }); // ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/core.js var require_core3 = __commonJS({ "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/core.js"(exports2, module3) { "use strict"; init_import_meta_url(); var isCoreModule = require_is_core_module(); var data = require_core2(); var core = {}; for (mod in data) { if (Object.prototype.hasOwnProperty.call(data, mod)) { core[mod] = isCoreModule(mod); } } var mod; module3.exports = core; } }); // ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/is-core.js var require_is_core = __commonJS({ "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/is-core.js"(exports2, module3) { init_import_meta_url(); var isCoreModule = require_is_core_module(); module3.exports = /* @__PURE__ */ __name(function isCore(x6) { return isCoreModule(x6); }, "isCore"); } }); // ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/sync.js var require_sync = __commonJS({ "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/sync.js"(exports2, module3) { init_import_meta_url(); var isCore = require_is_core_module(); var fs27 = require("fs"); var path72 = require("path"); var getHomedir = require_homedir(); var caller = require_caller(); var nodeModulesPaths = require_node_modules_paths(); var normalizeOptions = require_normalize_options(); var realpathFS = process.platform !== "win32" && fs27.realpathSync && typeof fs27.realpathSync.native === "function" ? fs27.realpathSync.native : fs27.realpathSync; var homedir3 = getHomedir(); var defaultPaths = /* @__PURE__ */ __name(function() { return [ path72.join(homedir3, ".node_modules"), path72.join(homedir3, ".node_libraries") ]; }, "defaultPaths"); var defaultIsFile = /* @__PURE__ */ __name(function isFile(file) { try { var stat9 = fs27.statSync(file, { throwIfNoEntry: false }); } catch (e7) { if (e7 && (e7.code === "ENOENT" || e7.code === "ENOTDIR")) return false; throw e7; } return !!stat9 && (stat9.isFile() || stat9.isFIFO()); }, "isFile"); var defaultIsDir = /* @__PURE__ */ __name(function isDirectory2(dir) { try { var stat9 = fs27.statSync(dir, { throwIfNoEntry: false }); } catch (e7) { if (e7 && (e7.code === "ENOENT" || e7.code === "ENOTDIR")) return false; throw e7; } return !!stat9 && stat9.isDirectory(); }, "isDirectory"); var defaultRealpathSync = /* @__PURE__ */ __name(function realpathSync4(x6) { try { return realpathFS(x6); } catch (realpathErr) { if (realpathErr.code !== "ENOENT") { throw realpathErr; } } return x6; }, "realpathSync"); var maybeRealpathSync = /* @__PURE__ */ __name(function maybeRealpathSync2(realpathSync4, x6, opts) { if (opts && opts.preserveSymlinks === false) { return realpathSync4(x6); } return x6; }, "maybeRealpathSync"); var defaultReadPackageSync = /* @__PURE__ */ __name(function defaultReadPackageSync2(readFileSync28, pkgfile) { var body = readFileSync28(pkgfile); try { var pkg = JSON.parse(body); return pkg; } catch (jsonErr) { } }, "defaultReadPackageSync"); var getPackageCandidates = /* @__PURE__ */ __name(function getPackageCandidates2(x6, start, opts) { var dirs = nodeModulesPaths(start, opts, x6); for (var i5 = 0; i5 < dirs.length; i5++) { dirs[i5] = path72.join(dirs[i5], x6); } return dirs; }, "getPackageCandidates"); module3.exports = /* @__PURE__ */ __name(function resolveSync2(x6, options32) { if (typeof x6 !== "string") { throw new TypeError("Path must be a string."); } var opts = normalizeOptions(x6, options32); var isFile = opts.isFile || defaultIsFile; var readFileSync28 = opts.readFileSync || fs27.readFileSync; var isDirectory2 = opts.isDirectory || defaultIsDir; var realpathSync4 = opts.realpathSync || defaultRealpathSync; var readPackageSync = opts.readPackageSync || defaultReadPackageSync; if (opts.readFileSync && opts.readPackageSync) { throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive."); } var packageIterator = opts.packageIterator; var extensions = opts.extensions || [".js"]; var includeCoreModules = opts.includeCoreModules !== false; var basedir = opts.basedir || path72.dirname(caller()); var parent = opts.filename || basedir; opts.paths = opts.paths || defaultPaths(); var absoluteStart = maybeRealpathSync(realpathSync4, path72.resolve(basedir), opts); if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x6)) { var res = path72.resolve(absoluteStart, x6); if (x6 === "." || x6 === ".." || x6.slice(-1) === "/") res += "/"; var m6 = loadAsFileSync(res) || loadAsDirectorySync(res); if (m6) return maybeRealpathSync(realpathSync4, m6, opts); } else if (includeCoreModules && isCore(x6)) { return x6; } else { var n6 = loadNodeModulesSync(x6, absoluteStart); if (n6) return maybeRealpathSync(realpathSync4, n6, opts); } var err = new Error("Cannot find module '" + x6 + "' from '" + parent + "'"); err.code = "MODULE_NOT_FOUND"; throw err; function loadAsFileSync(x7) { var pkg = loadpkg(path72.dirname(x7)); if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) { var rfile = path72.relative(pkg.dir, x7); var r7 = opts.pathFilter(pkg.pkg, x7, rfile); if (r7) { x7 = path72.resolve(pkg.dir, r7); } } if (isFile(x7)) { return x7; } for (var i5 = 0; i5 < extensions.length; i5++) { var file = x7 + extensions[i5]; if (isFile(file)) { return file; } } } __name(loadAsFileSync, "loadAsFileSync"); function loadpkg(dir) { if (dir === "" || dir === "/") return; if (process.platform === "win32" && /^\w:[/\\]*$/.test(dir)) { return; } if (/[/\\]node_modules[/\\]*$/.test(dir)) return; var pkgfile = path72.join(maybeRealpathSync(realpathSync4, dir, opts), "package.json"); if (!isFile(pkgfile)) { return loadpkg(path72.dirname(dir)); } var pkg = readPackageSync(readFileSync28, pkgfile); if (pkg && opts.packageFilter) { pkg = opts.packageFilter( pkg, /*pkgfile,*/ dir ); } return { pkg, dir }; } __name(loadpkg, "loadpkg"); function loadAsDirectorySync(x7) { var pkgfile = path72.join(maybeRealpathSync(realpathSync4, x7, opts), "/package.json"); if (isFile(pkgfile)) { try { var pkg = readPackageSync(readFileSync28, pkgfile); } catch (e7) { } if (pkg && opts.packageFilter) { pkg = opts.packageFilter( pkg, /*pkgfile,*/ x7 ); } if (pkg && pkg.main) { if (typeof pkg.main !== "string") { var mainError = new TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string"); mainError.code = "INVALID_PACKAGE_MAIN"; throw mainError; } if (pkg.main === "." || pkg.main === "./") { pkg.main = "index"; } try { var m7 = loadAsFileSync(path72.resolve(x7, pkg.main)); if (m7) return m7; var n7 = loadAsDirectorySync(path72.resolve(x7, pkg.main)); if (n7) return n7; } catch (e7) { } } } return loadAsFileSync(path72.join(x7, "/index")); } __name(loadAsDirectorySync, "loadAsDirectorySync"); function loadNodeModulesSync(x7, start) { var thunk = /* @__PURE__ */ __name(function() { return getPackageCandidates(x7, start, opts); }, "thunk"); var dirs = packageIterator ? packageIterator(x7, start, thunk, opts) : thunk(); for (var i5 = 0; i5 < dirs.length; i5++) { var dir = dirs[i5]; if (isDirectory2(path72.dirname(dir))) { var m7 = loadAsFileSync(dir); if (m7) return m7; var n7 = loadAsDirectorySync(dir); if (n7) return n7; } } } __name(loadNodeModulesSync, "loadNodeModulesSync"); }, "resolveSync"); } }); // ../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/index.js var require_resolve = __commonJS({ "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/index.js"(exports2, module3) { init_import_meta_url(); var async = require_async(); async.core = require_core3(); async.isCore = require_is_core(); async.sync = require_sync(); module3.exports = async; } }); // ../../node_modules/.pnpm/ini@1.3.8/node_modules/ini/ini.js var require_ini = __commonJS({ "../../node_modules/.pnpm/ini@1.3.8/node_modules/ini/ini.js"(exports2) { init_import_meta_url(); exports2.parse = exports2.decode = decode; exports2.stringify = exports2.encode = encode; exports2.safe = safe; exports2.unsafe = unsafe; var eol = typeof process !== "undefined" && process.platform === "win32" ? "\r\n" : "\n"; function encode(obj, opt) { var children = []; var out = ""; if (typeof opt === "string") { opt = { section: opt, whitespace: false }; } else { opt = opt || {}; opt.whitespace = opt.whitespace === true; } var separator = opt.whitespace ? " = " : "="; Object.keys(obj).forEach(function(k6, _4, __) { var val2 = obj[k6]; if (val2 && Array.isArray(val2)) { val2.forEach(function(item) { out += safe(k6 + "[]") + separator + safe(item) + "\n"; }); } else if (val2 && typeof val2 === "object") children.push(k6); else out += safe(k6) + separator + safe(val2) + eol; }); if (opt.section && out.length) out = "[" + safe(opt.section) + "]" + eol + out; children.forEach(function(k6, _4, __) { var nk = dotSplit(k6).join("\\."); var section = (opt.section ? opt.section + "." : "") + nk; var child = encode(obj[k6], { section, whitespace: opt.whitespace }); if (out.length && child.length) out += eol; out += child; }); return out; } __name(encode, "encode"); function dotSplit(str) { return str.replace(/\1/g, "LITERAL\\1LITERAL").replace(/\\\./g, "").split(/\./).map(function(part) { return part.replace(/\1/g, "\\.").replace(/\2LITERAL\\1LITERAL\2/g, ""); }); } __name(dotSplit, "dotSplit"); function decode(str) { var out = {}; var p6 = out; var section = null; var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i; var lines = str.split(/[\r\n]+/g); lines.forEach(function(line, _4, __) { if (!line || line.match(/^\s*[;#]/)) return; var match2 = line.match(re); if (!match2) return; if (match2[1] !== void 0) { section = unsafe(match2[1]); if (section === "__proto__") { p6 = {}; return; } p6 = out[section] = out[section] || {}; return; } var key = unsafe(match2[2]); if (key === "__proto__") return; var value = match2[3] ? unsafe(match2[4]) : true; switch (value) { case "true": case "false": case "null": value = JSON.parse(value); } if (key.length > 2 && key.slice(-2) === "[]") { key = key.substring(0, key.length - 2); if (key === "__proto__") return; if (!p6[key]) p6[key] = []; else if (!Array.isArray(p6[key])) p6[key] = [p6[key]]; } if (Array.isArray(p6[key])) p6[key].push(value); else p6[key] = value; }); Object.keys(out).filter(function(k6, _4, __) { if (!out[k6] || typeof out[k6] !== "object" || Array.isArray(out[k6])) return false; var parts = dotSplit(k6); var p7 = out; var l6 = parts.pop(); var nl = l6.replace(/\\\./g, "."); parts.forEach(function(part, _5, __2) { if (part === "__proto__") return; if (!p7[part] || typeof p7[part] !== "object") p7[part] = {}; p7 = p7[part]; }); if (p7 === out && nl === l6) return false; p7[nl] = out[k6]; return true; }).forEach(function(del, _4, __) { delete out[del]; }); return out; } __name(decode, "decode"); function isQuoted(val2) { return val2.charAt(0) === '"' && val2.slice(-1) === '"' || val2.charAt(0) === "'" && val2.slice(-1) === "'"; } __name(isQuoted, "isQuoted"); function safe(val2) { return typeof val2 !== "string" || val2.match(/[=\r\n]/) || val2.match(/^\[/) || val2.length > 1 && isQuoted(val2) || val2 !== val2.trim() ? JSON.stringify(val2) : val2.replace(/;/g, "\\;").replace(/#/g, "\\#"); } __name(safe, "safe"); function unsafe(val2, doUnesc) { val2 = (val2 || "").trim(); if (isQuoted(val2)) { if (val2.charAt(0) === "'") val2 = val2.substr(1, val2.length - 2); try { val2 = JSON.parse(val2); } catch (_4) { } } else { var esc = false; var unesc = ""; for (var i5 = 0, l6 = val2.length; i5 < l6; i5++) { var c6 = val2.charAt(i5); if (esc) { if ("\\;#".indexOf(c6) !== -1) unesc += c6; else unesc += "\\" + c6; esc = false; } else if (";#".indexOf(c6) !== -1) break; else if (c6 === "\\") esc = true; else unesc += c6; } if (esc) unesc += "\\"; return unesc.trim(); } return val2; } __name(unsafe, "unsafe"); } }); // ../../node_modules/.pnpm/strip-json-comments@2.0.1/node_modules/strip-json-comments/index.js var require_strip_json_comments = __commonJS({ "../../node_modules/.pnpm/strip-json-comments@2.0.1/node_modules/strip-json-comments/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var singleComment = 1; var multiComment = 2; function stripWithoutWhitespace() { return ""; } __name(stripWithoutWhitespace, "stripWithoutWhitespace"); function stripWithWhitespace(str, start, end) { return str.slice(start, end).replace(/\S/g, " "); } __name(stripWithWhitespace, "stripWithWhitespace"); module3.exports = function(str, opts) { opts = opts || {}; var currentChar; var nextChar; var insideString = false; var insideComment = false; var offset = 0; var ret = ""; var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; for (var i5 = 0; i5 < str.length; i5++) { currentChar = str[i5]; nextChar = str[i5 + 1]; if (!insideComment && currentChar === '"') { var escaped = str[i5 - 1] === "\\" && str[i5 - 2] !== "\\"; if (!escaped) { insideString = !insideString; } } if (insideString) { continue; } if (!insideComment && currentChar + nextChar === "//") { ret += str.slice(offset, i5); offset = i5; insideComment = singleComment; i5++; } else if (insideComment === singleComment && currentChar + nextChar === "\r\n") { i5++; insideComment = false; ret += strip(str, offset, i5); offset = i5; continue; } else if (insideComment === singleComment && currentChar === "\n") { insideComment = false; ret += strip(str, offset, i5); offset = i5; } else if (!insideComment && currentChar + nextChar === "/*") { ret += str.slice(offset, i5); offset = i5; insideComment = multiComment; i5++; continue; } else if (insideComment === multiComment && currentChar + nextChar === "*/") { i5++; insideComment = false; ret += strip(str, offset, i5 + 1); offset = i5 + 1; continue; } } return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset)); }; } }); // ../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js var require_utils3 = __commonJS({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(exports2) { "use strict"; init_import_meta_url(); var fs27 = require("fs"); var ini = require_ini(); var path72 = require("path"); var stripJsonComments = require_strip_json_comments(); var parse7 = exports2.parse = function(content) { if (/^\s*{/.test(content)) return JSON.parse(stripJsonComments(content)); return ini.parse(content); }; var file = exports2.file = function() { var args = [].slice.call(arguments).filter(function(arg) { return arg != null; }); for (var i5 in args) if ("string" !== typeof args[i5]) return; var file2 = path72.join.apply(null, args); var content; try { return fs27.readFileSync(file2, "utf-8"); } catch (err) { return; } }; var json = exports2.json = function() { var content = file.apply(null, arguments); return content ? parse7(content) : null; }; var env6 = exports2.env = function(prefix, env7) { env7 = env7 || process.env; var obj = {}; var l6 = prefix.length; for (var k6 in env7) { if (k6.toLowerCase().indexOf(prefix.toLowerCase()) === 0) { var keypath = k6.substring(l6).split("__"); var _emptyStringIndex; while ((_emptyStringIndex = keypath.indexOf("")) > -1) { keypath.splice(_emptyStringIndex, 1); } var cursor = obj; keypath.forEach(/* @__PURE__ */ __name(function _buildSubObj(_subkey, i5) { if (!_subkey || typeof cursor !== "object") return; if (i5 === keypath.length - 1) cursor[_subkey] = env7[k6]; if (cursor[_subkey] === void 0) cursor[_subkey] = {}; cursor = cursor[_subkey]; }, "_buildSubObj")); } } return obj; }; var find = exports2.find = function() { var rel = path72.join.apply(null, [].slice.call(arguments)); function find2(start, rel2) { var file2 = path72.join(start, rel2); try { fs27.statSync(file2); return file2; } catch (err) { if (path72.dirname(start) !== start) return find2(path72.dirname(start), rel2); } } __name(find2, "find"); return find2(process.cwd(), rel); }; } }); // ../../node_modules/.pnpm/deep-extend@0.6.0/node_modules/deep-extend/lib/deep-extend.js var require_deep_extend = __commonJS({ "../../node_modules/.pnpm/deep-extend@0.6.0/node_modules/deep-extend/lib/deep-extend.js"(exports2, module3) { "use strict"; init_import_meta_url(); function isSpecificValue(val2) { return val2 instanceof Buffer || val2 instanceof Date || val2 instanceof RegExp ? true : false; } __name(isSpecificValue, "isSpecificValue"); function cloneSpecificValue(val2) { if (val2 instanceof Buffer) { var x6 = Buffer.alloc ? Buffer.alloc(val2.length) : new Buffer(val2.length); val2.copy(x6); return x6; } else if (val2 instanceof Date) { return new Date(val2.getTime()); } else if (val2 instanceof RegExp) { return new RegExp(val2); } else { throw new Error("Unexpected situation"); } } __name(cloneSpecificValue, "cloneSpecificValue"); function deepCloneArray(arr) { var clone = []; arr.forEach(function(item, index) { if (typeof item === "object" && item !== null) { if (Array.isArray(item)) { clone[index] = deepCloneArray(item); } else if (isSpecificValue(item)) { clone[index] = cloneSpecificValue(item); } else { clone[index] = deepExtend({}, item); } } else { clone[index] = item; } }); return clone; } __name(deepCloneArray, "deepCloneArray"); function safeGetProperty(object, property) { return property === "__proto__" ? void 0 : object[property]; } __name(safeGetProperty, "safeGetProperty"); var deepExtend = module3.exports = function() { if (arguments.length < 1 || typeof arguments[0] !== "object") { return false; } if (arguments.length < 2) { return arguments[0]; } var target = arguments[0]; var args = Array.prototype.slice.call(arguments, 1); var val2, src, clone; args.forEach(function(obj) { if (typeof obj !== "object" || obj === null || Array.isArray(obj)) { return; } Object.keys(obj).forEach(function(key) { src = safeGetProperty(target, key); val2 = safeGetProperty(obj, key); if (val2 === target) { return; } else if (typeof val2 !== "object" || val2 === null) { target[key] = val2; return; } else if (Array.isArray(val2)) { target[key] = deepCloneArray(val2); return; } else if (isSpecificValue(val2)) { target[key] = cloneSpecificValue(val2); return; } else if (typeof src !== "object" || src === null || Array.isArray(src)) { target[key] = deepExtend({}, val2); return; } else { target[key] = deepExtend(src, val2); return; } }); }); return target; }; } }); // ../../node_modules/.pnpm/minimist@1.2.6/node_modules/minimist/index.js var require_minimist = __commonJS({ "../../node_modules/.pnpm/minimist@1.2.6/node_modules/minimist/index.js"(exports2, module3) { init_import_meta_url(); module3.exports = function(args, opts) { if (!opts) opts = {}; var flags2 = { bools: {}, strings: {}, unknownFn: null }; if (typeof opts["unknown"] === "function") { flags2.unknownFn = opts["unknown"]; } if (typeof opts["boolean"] === "boolean" && opts["boolean"]) { flags2.allBools = true; } else { [].concat(opts["boolean"]).filter(Boolean).forEach(function(key2) { flags2.bools[key2] = true; }); } var aliases2 = {}; Object.keys(opts.alias || {}).forEach(function(key2) { aliases2[key2] = [].concat(opts.alias[key2]); aliases2[key2].forEach(function(x6) { aliases2[x6] = [key2].concat(aliases2[key2].filter(function(y4) { return x6 !== y4; })); }); }); [].concat(opts.string).filter(Boolean).forEach(function(key2) { flags2.strings[key2] = true; if (aliases2[key2]) { flags2.strings[aliases2[key2]] = true; } }); var defaults = opts["default"] || {}; var argv = { _: [] }; Object.keys(flags2.bools).forEach(function(key2) { setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]); }); var notFlags = []; if (args.indexOf("--") !== -1) { notFlags = args.slice(args.indexOf("--") + 1); args = args.slice(0, args.indexOf("--")); } function argDefined(key2, arg2) { return flags2.allBools && /^--[^=]+$/.test(arg2) || flags2.strings[key2] || flags2.bools[key2] || aliases2[key2]; } __name(argDefined, "argDefined"); function setArg(key2, val2, arg2) { if (arg2 && flags2.unknownFn && !argDefined(key2, arg2)) { if (flags2.unknownFn(arg2) === false) return; } var value2 = !flags2.strings[key2] && isNumber2(val2) ? Number(val2) : val2; setKey(argv, key2.split("."), value2); (aliases2[key2] || []).forEach(function(x6) { setKey(argv, x6.split("."), value2); }); } __name(setArg, "setArg"); function setKey(obj, keys, value2) { var o5 = obj; for (var i6 = 0; i6 < keys.length - 1; i6++) { var key2 = keys[i6]; if (isConstructorOrProto(o5, key2)) return; if (o5[key2] === void 0) o5[key2] = {}; if (o5[key2] === Object.prototype || o5[key2] === Number.prototype || o5[key2] === String.prototype) o5[key2] = {}; if (o5[key2] === Array.prototype) o5[key2] = []; o5 = o5[key2]; } var key2 = keys[keys.length - 1]; if (isConstructorOrProto(o5, key2)) return; if (o5 === Object.prototype || o5 === Number.prototype || o5 === String.prototype) o5 = {}; if (o5 === Array.prototype) o5 = []; if (o5[key2] === void 0 || flags2.bools[key2] || typeof o5[key2] === "boolean") { o5[key2] = value2; } else if (Array.isArray(o5[key2])) { o5[key2].push(value2); } else { o5[key2] = [o5[key2], value2]; } } __name(setKey, "setKey"); function aliasIsBoolean(key2) { return aliases2[key2].some(function(x6) { return flags2.bools[x6]; }); } __name(aliasIsBoolean, "aliasIsBoolean"); for (var i5 = 0; i5 < args.length; i5++) { var arg = args[i5]; if (/^--.+=/.test(arg)) { var m6 = arg.match(/^--([^=]+)=([\s\S]*)$/); var key = m6[1]; var value = m6[2]; if (flags2.bools[key]) { value = value !== "false"; } setArg(key, value, arg); } else if (/^--no-.+/.test(arg)) { var key = arg.match(/^--no-(.+)/)[1]; setArg(key, false, arg); } else if (/^--.+/.test(arg)) { var key = arg.match(/^--(.+)/)[1]; var next = args[i5 + 1]; if (next !== void 0 && !/^-/.test(next) && !flags2.bools[key] && !flags2.allBools && (aliases2[key] ? !aliasIsBoolean(key) : true)) { setArg(key, next, arg); i5++; } else if (/^(true|false)$/.test(next)) { setArg(key, next === "true", arg); i5++; } else { setArg(key, flags2.strings[key] ? "" : true, arg); } } else if (/^-[^-]+/.test(arg)) { var letters = arg.slice(1, -1).split(""); var broken = false; for (var j6 = 0; j6 < letters.length; j6++) { var next = arg.slice(j6 + 2); if (next === "-") { setArg(letters[j6], next, arg); continue; } if (/[A-Za-z]/.test(letters[j6]) && /=/.test(next)) { setArg(letters[j6], next.split("=")[1], arg); broken = true; break; } if (/[A-Za-z]/.test(letters[j6]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { setArg(letters[j6], next, arg); broken = true; break; } if (letters[j6 + 1] && letters[j6 + 1].match(/\W/)) { setArg(letters[j6], arg.slice(j6 + 2), arg); broken = true; break; } else { setArg(letters[j6], flags2.strings[letters[j6]] ? "" : true, arg); } } var key = arg.slice(-1)[0]; if (!broken && key !== "-") { if (args[i5 + 1] && !/^(-|--)[^-]/.test(args[i5 + 1]) && !flags2.bools[key] && (aliases2[key] ? !aliasIsBoolean(key) : true)) { setArg(key, args[i5 + 1], arg); i5++; } else if (args[i5 + 1] && /^(true|false)$/.test(args[i5 + 1])) { setArg(key, args[i5 + 1] === "true", arg); i5++; } else { setArg(key, flags2.strings[key] ? "" : true, arg); } } } else { if (!flags2.unknownFn || flags2.unknownFn(arg) !== false) { argv._.push( flags2.strings["_"] || !isNumber2(arg) ? arg : Number(arg) ); } if (opts.stopEarly) { argv._.push.apply(argv._, args.slice(i5 + 1)); break; } } } Object.keys(defaults).forEach(function(key2) { if (!hasKey2(argv, key2.split("."))) { setKey(argv, key2.split("."), defaults[key2]); (aliases2[key2] || []).forEach(function(x6) { setKey(argv, x6.split("."), defaults[key2]); }); } }); if (opts["--"]) { argv["--"] = new Array(); notFlags.forEach(function(key2) { argv["--"].push(key2); }); } else { notFlags.forEach(function(key2) { argv._.push(key2); }); } return argv; }; function hasKey2(obj, keys) { var o5 = obj; keys.slice(0, -1).forEach(function(key2) { o5 = o5[key2] || {}; }); var key = keys[keys.length - 1]; return key in o5; } __name(hasKey2, "hasKey"); function isNumber2(x6) { if (typeof x6 === "number") return true; if (/^0x[0-9a-f]+$/i.test(x6)) return true; return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x6); } __name(isNumber2, "isNumber"); function isConstructorOrProto(obj, key) { return key === "constructor" && typeof obj[key] === "function" || key === "__proto__"; } __name(isConstructorOrProto, "isConstructorOrProto"); } }); // ../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/index.js var require_rc = __commonJS({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/index.js"(exports2, module3) { init_import_meta_url(); var cc2 = require_utils3(); var join23 = require("path").join; var deepExtend = require_deep_extend(); var etc = "/etc"; var win = process.platform === "win32"; var home = win ? process.env.USERPROFILE : process.env.HOME; module3.exports = function(name2, defaults, argv, parse7) { if ("string" !== typeof name2) throw new Error("rc(name): name *must* be string"); if (!argv) argv = require_minimist()(process.argv.slice(2)); defaults = ("string" === typeof defaults ? cc2.json(defaults) : defaults) || {}; parse7 = parse7 || cc2.parse; var env6 = cc2.env(name2 + "_"); var configs = [defaults]; var configFiles = []; function addConfigFile(file) { if (configFiles.indexOf(file) >= 0) return; var fileConfig = cc2.file(file); if (fileConfig) { configs.push(parse7(fileConfig)); configFiles.push(file); } } __name(addConfigFile, "addConfigFile"); if (!win) [ join23(etc, name2, "config"), join23(etc, name2 + "rc") ].forEach(addConfigFile); if (home) [ join23(home, ".config", name2, "config"), join23(home, ".config", name2), join23(home, "." + name2, "config"), join23(home, "." + name2 + "rc") ].forEach(addConfigFile); addConfigFile(cc2.find("." + name2 + "rc")); if (env6.config) addConfigFile(env6.config); if (argv.config) addConfigFile(argv.config); return deepExtend.apply(null, configs.concat([ env6, argv, configFiles.length ? { configs: configFiles, config: configFiles[configFiles.length - 1] } : void 0 ])); }; } }); // ../../node_modules/.pnpm/registry-url@3.1.0/node_modules/registry-url/index.js var require_registry_url = __commonJS({ "../../node_modules/.pnpm/registry-url@3.1.0/node_modules/registry-url/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = function(scope) { var rc = require_rc()("npm", { registry: "https://registry.npmjs.org/" }); var url4 = rc[scope + ":registry"] || rc.registry; return url4.slice(-1) === "/" ? url4 : url4 + "/"; }; } }); // ../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js var require_safe_buffer = __commonJS({ "../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports2, module3) { init_import_meta_url(); var buffer = require("buffer"); var Buffer7 = buffer.Buffer; function copyProps(src, dst) { for (var key in src) { dst[key] = src[key]; } } __name(copyProps, "copyProps"); if (Buffer7.from && Buffer7.alloc && Buffer7.allocUnsafe && Buffer7.allocUnsafeSlow) { module3.exports = buffer; } else { copyProps(buffer, exports2); exports2.Buffer = SafeBuffer; } function SafeBuffer(arg, encodingOrOffset, length) { return Buffer7(arg, encodingOrOffset, length); } __name(SafeBuffer, "SafeBuffer"); SafeBuffer.prototype = Object.create(Buffer7.prototype); copyProps(Buffer7, SafeBuffer); SafeBuffer.from = function(arg, encodingOrOffset, length) { if (typeof arg === "number") { throw new TypeError("Argument must not be a number"); } return Buffer7(arg, encodingOrOffset, length); }; SafeBuffer.alloc = function(size, fill2, encoding) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } var buf = Buffer7(size); if (fill2 !== void 0) { if (typeof encoding === "string") { buf.fill(fill2, encoding); } else { buf.fill(fill2); } } else { buf.fill(0); } return buf; }; SafeBuffer.allocUnsafe = function(size) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } return Buffer7(size); }; SafeBuffer.allocUnsafeSlow = function(size) { if (typeof size !== "number") { throw new TypeError("Argument must be a number"); } return buffer.SlowBuffer(size); }; } }); // ../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/base64.js var require_base64 = __commonJS({ "../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/base64.js"(exports2, module3) { init_import_meta_url(); var safeBuffer = require_safe_buffer().Buffer; function decodeBase64(base642) { return safeBuffer.from(base642, "base64").toString("utf8"); } __name(decodeBase64, "decodeBase64"); function encodeBase64(string) { return safeBuffer.from(string, "utf8").toString("base64"); } __name(encodeBase64, "encodeBase64"); module3.exports = { decodeBase64, encodeBase64 }; } }); // ../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/index.js var require_registry_auth_token = __commonJS({ "../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/index.js"(exports2, module3) { init_import_meta_url(); var url4 = require("url"); var base642 = require_base64(); var decodeBase64 = base642.decodeBase64; var encodeBase64 = base642.encodeBase64; var tokenKey = ":_authToken"; var userKey = ":username"; var passwordKey = ":_password"; module3.exports = function() { var checkUrl2; var options32; if (arguments.length >= 2) { checkUrl2 = arguments[0]; options32 = arguments[1]; } else if (typeof arguments[0] === "string") { checkUrl2 = arguments[0]; } else { options32 = arguments[0]; } options32 = options32 || {}; options32.npmrc = options32.npmrc || require_rc()("npm", { registry: "https://registry.npmjs.org/" }); checkUrl2 = checkUrl2 || options32.npmrc.registry; return getRegistryAuthInfo(checkUrl2, options32) || getLegacyAuthInfo(options32.npmrc); }; function getRegistryAuthInfo(checkUrl2, options32) { var parsed = url4.parse(checkUrl2, false, true); var pathname; while (pathname !== "/" && parsed.pathname !== pathname) { pathname = parsed.pathname || "/"; var regUrl = "//" + parsed.host + pathname.replace(/\/$/, ""); var authInfo = getAuthInfoForUrl(regUrl, options32.npmrc); if (authInfo) { return authInfo; } if (!options32.recursive) { return /\/$/.test(checkUrl2) ? void 0 : getRegistryAuthInfo(url4.resolve(checkUrl2, "."), options32); } parsed.pathname = url4.resolve(normalizePath2(pathname), "..") || "/"; } return void 0; } __name(getRegistryAuthInfo, "getRegistryAuthInfo"); function getLegacyAuthInfo(npmrc) { if (npmrc._auth) { return { token: npmrc._auth, type: "Basic" }; } return void 0; } __name(getLegacyAuthInfo, "getLegacyAuthInfo"); function normalizePath2(path72) { return path72[path72.length - 1] === "/" ? path72 : path72 + "/"; } __name(normalizePath2, "normalizePath"); function getAuthInfoForUrl(regUrl, npmrc) { var bearerAuth = getBearerToken(npmrc[regUrl + tokenKey] || npmrc[regUrl + "/" + tokenKey]); if (bearerAuth) { return bearerAuth; } var username = npmrc[regUrl + userKey] || npmrc[regUrl + "/" + userKey]; var password = npmrc[regUrl + passwordKey] || npmrc[regUrl + "/" + passwordKey]; var basicAuth = getTokenForUsernameAndPassword(username, password); if (basicAuth) { return basicAuth; } return void 0; } __name(getAuthInfoForUrl, "getAuthInfoForUrl"); function getBearerToken(tok) { if (!tok) { return void 0; } var token = tok.replace(/^\$\{?([^}]*)\}?$/, function(fullMatch, envVar) { return process.env[envVar]; }); return { token, type: "Bearer" }; } __name(getBearerToken, "getBearerToken"); function getTokenForUsernameAndPassword(username, password) { if (!username || !password) { return void 0; } var pass2 = decodeBase64(password.replace(/^\$\{?([^}]*)\}?$/, function(fullMatch, envVar) { return process.env[envVar]; })); var token = encodeBase64(username + ":" + pass2); return { token, type: "Basic", password: pass2, username }; } __name(getTokenForUsernameAndPassword, "getTokenForUsernameAndPassword"); } }); // ../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js var require_update_check = __commonJS({ "../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js"(exports2, module3) { init_import_meta_url(); var { URL: URL7 } = require("url"); var { join: join23 } = require("path"); var fs27 = require("fs"); var { promisify: promisify3 } = require("util"); var { tmpdir } = require("os"); var registryUrl = require_registry_url(); var writeFile12 = promisify3(fs27.writeFile); var mkdir7 = promisify3(fs27.mkdir); var readFile17 = promisify3(fs27.readFile); var compareVersions = /* @__PURE__ */ __name((a5, b6) => a5.localeCompare(b6, "en-US", { numeric: true }), "compareVersions"); var encode = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/^%40/, "@"), "encode"); var getFile = /* @__PURE__ */ __name(async (details, distTag) => { const rootDir = tmpdir(); const subDir = join23(rootDir, "update-check"); if (!fs27.existsSync(subDir)) { await mkdir7(subDir); } let name2 = `${details.name}-${distTag}.json`; if (details.scope) { name2 = `${details.scope}-${name2}`; } return join23(subDir, name2); }, "getFile"); var evaluateCache = /* @__PURE__ */ __name(async (file, time, interval) => { if (fs27.existsSync(file)) { const content = await readFile17(file, "utf8"); const { lastUpdate, latest } = JSON.parse(content); const nextCheck = lastUpdate + interval; if (nextCheck > time) { return { shouldCheck: false, latest }; } } return { shouldCheck: true, latest: null }; }, "evaluateCache"); var updateCache = /* @__PURE__ */ __name(async (file, latest, lastUpdate) => { const content = JSON.stringify({ latest, lastUpdate }); await writeFile12(file, content, "utf8"); }, "updateCache"); var loadPackage = /* @__PURE__ */ __name((url4, authInfo) => new Promise((resolve25, reject) => { const options32 = { host: url4.hostname, path: url4.pathname, port: url4.port, headers: { accept: "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*" }, timeout: 2e3 }; if (authInfo) { options32.headers.authorization = `${authInfo.type} ${authInfo.token}`; } const { get: get2 } = url4.protocol === "https:" ? require("https") : require("http"); get2(options32, (response) => { const { statusCode } = response; if (statusCode !== 200) { const error2 = new Error(`Request failed with code ${statusCode}`); error2.code = statusCode; reject(error2); response.resume(); return; } let rawData = ""; response.setEncoding("utf8"); response.on("data", (chunk) => { rawData += chunk; }); response.on("end", () => { try { const parsedData = JSON.parse(rawData); resolve25(parsedData); } catch (e7) { reject(e7); } }); }).on("error", reject).on("timeout", reject); }), "loadPackage"); var getMostRecent = /* @__PURE__ */ __name(async ({ full, scope }, distTag) => { const regURL = registryUrl(scope); const url4 = new URL7(full, regURL); let spec = null; try { spec = await loadPackage(url4); } catch (err) { if (err.code && String(err.code).startsWith(4)) { const registryAuthToken = require_registry_auth_token(); const authInfo = registryAuthToken(regURL, { recursive: true }); spec = await loadPackage(url4, authInfo); } else { throw err; } } const version4 = spec["dist-tags"][distTag]; if (!version4) { throw new Error(`Distribution tag ${distTag} is not available`); } return version4; }, "getMostRecent"); var defaultConfig = { interval: 36e5, distTag: "latest" }; var getDetails = /* @__PURE__ */ __name((name2) => { const spec = { full: encode(name2) }; if (name2.includes("/")) { const parts = name2.split("/"); spec.scope = parts[0]; spec.name = parts[1]; } else { spec.scope = null; spec.name = name2; } return spec; }, "getDetails"); module3.exports = async (pkg, config) => { if (typeof pkg !== "object") { throw new Error("The first parameter should be your package.json file content"); } const details = getDetails(pkg.name); const time = Date.now(); const { distTag, interval } = Object.assign({}, defaultConfig, config); const file = await getFile(details, distTag); let latest = null; let shouldCheck = true; ({ shouldCheck, latest } = await evaluateCache(file, time, interval)); if (shouldCheck) { latest = await getMostRecent(details, distTag); await updateCache(file, latest, time); } const comparision = compareVersions(pkg.version, latest); if (comparision === -1) { return { latest, fromCache: !shouldCheck }; } return null; }; } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/stream.js var require_stream = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/stream.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { Duplex } = require("stream"); function emitClose(stream2) { stream2.emit("close"); } __name(emitClose, "emitClose"); function duplexOnEnd() { if (!this.destroyed && this._writableState.finished) { this.destroy(); } } __name(duplexOnEnd, "duplexOnEnd"); function duplexOnError(err) { this.removeListener("error", duplexOnError); this.destroy(); if (this.listenerCount("error") === 0) { this.emit("error", err); } } __name(duplexOnError, "duplexOnError"); function createWebSocketStream2(ws, options32) { let terminateOnDestroy = true; const duplex = new Duplex({ ...options32, autoDestroy: false, emitClose: false, objectMode: false, writableObjectMode: false }); ws.on("message", /* @__PURE__ */ __name(function message(msg, isBinary) { const data = !isBinary && duplex._readableState.objectMode ? msg.toString() : msg; if (!duplex.push(data)) ws.pause(); }, "message")); ws.once("error", /* @__PURE__ */ __name(function error2(err) { if (duplex.destroyed) return; terminateOnDestroy = false; duplex.destroy(err); }, "error")); ws.once("close", /* @__PURE__ */ __name(function close2() { if (duplex.destroyed) return; duplex.push(null); }, "close")); duplex._destroy = function(err, callback) { if (ws.readyState === ws.CLOSED) { callback(err); process.nextTick(emitClose, duplex); return; } let called = false; ws.once("error", /* @__PURE__ */ __name(function error2(err2) { called = true; callback(err2); }, "error")); ws.once("close", /* @__PURE__ */ __name(function close2() { if (!called) callback(err); process.nextTick(emitClose, duplex); }, "close")); if (terminateOnDestroy) ws.terminate(); }; duplex._final = function(callback) { if (ws.readyState === ws.CONNECTING) { ws.once("open", /* @__PURE__ */ __name(function open4() { duplex._final(callback); }, "open")); return; } if (ws._socket === null) return; if (ws._socket._writableState.finished) { callback(); if (duplex._readableState.endEmitted) duplex.destroy(); } else { ws._socket.once("finish", /* @__PURE__ */ __name(function finish() { callback(); }, "finish")); ws.close(); } }; duplex._read = function() { if (ws.isPaused) ws.resume(); }; duplex._write = function(chunk, encoding, callback) { if (ws.readyState === ws.CONNECTING) { ws.once("open", /* @__PURE__ */ __name(function open4() { duplex._write(chunk, encoding, callback); }, "open")); return; } ws.send(chunk, callback); }; duplex.on("end", duplexOnEnd); duplex.on("error", duplexOnError); return duplex; } __name(createWebSocketStream2, "createWebSocketStream"); module3.exports = createWebSocketStream2; } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/constants.js var require_constants6 = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/constants.js"(exports2, module3) { "use strict"; init_import_meta_url(); var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"]; var hasBlob = typeof Blob !== "undefined"; if (hasBlob) BINARY_TYPES.push("blob"); module3.exports = { BINARY_TYPES, EMPTY_BUFFER: Buffer.alloc(0), GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11", hasBlob, kForOnEventAttribute: Symbol("kIsForOnEventAttribute"), kListener: Symbol("kListener"), kStatusCode: Symbol("status-code"), kWebSocket: Symbol("websocket"), NOOP: () => { } }; } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/buffer-util.js var require_buffer_util = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/buffer-util.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { EMPTY_BUFFER } = require_constants6(); var FastBuffer = Buffer[Symbol.species]; function concat(list, totalLength) { if (list.length === 0) return EMPTY_BUFFER; if (list.length === 1) return list[0]; const target = Buffer.allocUnsafe(totalLength); let offset = 0; for (let i5 = 0; i5 < list.length; i5++) { const buf = list[i5]; target.set(buf, offset); offset += buf.length; } if (offset < totalLength) { return new FastBuffer(target.buffer, target.byteOffset, offset); } return target; } __name(concat, "concat"); function _mask(source, mask, output, offset, length) { for (let i5 = 0; i5 < length; i5++) { output[offset + i5] = source[i5] ^ mask[i5 & 3]; } } __name(_mask, "_mask"); function _unmask(buffer, mask) { for (let i5 = 0; i5 < buffer.length; i5++) { buffer[i5] ^= mask[i5 & 3]; } } __name(_unmask, "_unmask"); function toArrayBuffer(buf) { if (buf.length === buf.buffer.byteLength) { return buf.buffer; } return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length); } __name(toArrayBuffer, "toArrayBuffer"); function toBuffer(data) { toBuffer.readOnly = true; if (Buffer.isBuffer(data)) return data; let buf; if (data instanceof ArrayBuffer) { buf = new FastBuffer(data); } else if (ArrayBuffer.isView(data)) { buf = new FastBuffer(data.buffer, data.byteOffset, data.byteLength); } else { buf = Buffer.from(data); toBuffer.readOnly = false; } return buf; } __name(toBuffer, "toBuffer"); module3.exports = { concat, mask: _mask, toArrayBuffer, toBuffer, unmask: _unmask }; if (!process.env.WS_NO_BUFFER_UTIL) { try { const bufferUtil = require("bufferutil"); module3.exports.mask = function(source, mask, output, offset, length) { if (length < 48) _mask(source, mask, output, offset, length); else bufferUtil.mask(source, mask, output, offset, length); }; module3.exports.unmask = function(buffer, mask) { if (buffer.length < 32) _unmask(buffer, mask); else bufferUtil.unmask(buffer, mask); }; } catch (e7) { } } } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/limiter.js var require_limiter = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/limiter.js"(exports2, module3) { "use strict"; init_import_meta_url(); var kDone = Symbol("kDone"); var kRun = Symbol("kRun"); var Limiter = class { /** * Creates a new `Limiter`. * * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed * to run concurrently */ constructor(concurrency) { this[kDone] = () => { this.pending--; this[kRun](); }; this.concurrency = concurrency || Infinity; this.jobs = []; this.pending = 0; } /** * Adds a job to the queue. * * @param {Function} job The job to run * @public */ add(job) { this.jobs.push(job); this[kRun](); } /** * Removes a job from the queue and runs it if possible. * * @private */ [kRun]() { if (this.pending === this.concurrency) return; if (this.jobs.length) { const job = this.jobs.shift(); this.pending++; job(this[kDone]); } } }; __name(Limiter, "Limiter"); module3.exports = Limiter; } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/permessage-deflate.js var require_permessage_deflate = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/permessage-deflate.js"(exports2, module3) { "use strict"; init_import_meta_url(); var zlib = require("zlib"); var bufferUtil = require_buffer_util(); var Limiter = require_limiter(); var { kStatusCode } = require_constants6(); var FastBuffer = Buffer[Symbol.species]; var TRAILER = Buffer.from([0, 0, 255, 255]); var kPerMessageDeflate = Symbol("permessage-deflate"); var kTotalLength = Symbol("total-length"); var kCallback = Symbol("callback"); var kBuffers = Symbol("buffers"); var kError = Symbol("error"); var zlibLimiter; var PerMessageDeflate = class { /** * Creates a PerMessageDeflate instance. * * @param {Object} [options] Configuration options * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support * for, or request, a custom client window size * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/ * acknowledge disabling of client context takeover * @param {Number} [options.concurrencyLimit=10] The number of concurrent * calls to zlib * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the * use of a custom server window size * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept * disabling of server context takeover * @param {Number} [options.threshold=1024] Size (in bytes) below which * messages should not be compressed if context takeover is disabled * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on * deflate * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on * inflate * @param {Boolean} [isServer=false] Create the instance in either server or * client mode * @param {Number} [maxPayload=0] The maximum allowed message length */ constructor(options32, isServer, maxPayload) { this._maxPayload = maxPayload | 0; this._options = options32 || {}; this._threshold = this._options.threshold !== void 0 ? this._options.threshold : 1024; this._isServer = !!isServer; this._deflate = null; this._inflate = null; this.params = null; if (!zlibLimiter) { const concurrency = this._options.concurrencyLimit !== void 0 ? this._options.concurrencyLimit : 10; zlibLimiter = new Limiter(concurrency); } } /** * @type {String} */ static get extensionName() { return "permessage-deflate"; } /** * Create an extension negotiation offer. * * @return {Object} Extension parameters * @public */ offer() { const params = {}; if (this._options.serverNoContextTakeover) { params.server_no_context_takeover = true; } if (this._options.clientNoContextTakeover) { params.client_no_context_takeover = true; } if (this._options.serverMaxWindowBits) { params.server_max_window_bits = this._options.serverMaxWindowBits; } if (this._options.clientMaxWindowBits) { params.client_max_window_bits = this._options.clientMaxWindowBits; } else if (this._options.clientMaxWindowBits == null) { params.client_max_window_bits = true; } return params; } /** * Accept an extension negotiation offer/response. * * @param {Array} configurations The extension negotiation offers/reponse * @return {Object} Accepted configuration * @public */ accept(configurations) { configurations = this.normalizeParams(configurations); this.params = this._isServer ? this.acceptAsServer(configurations) : this.acceptAsClient(configurations); return this.params; } /** * Releases all resources used by the extension. * * @public */ cleanup() { if (this._inflate) { this._inflate.close(); this._inflate = null; } if (this._deflate) { const callback = this._deflate[kCallback]; this._deflate.close(); this._deflate = null; if (callback) { callback( new Error( "The deflate stream was closed while data was being processed" ) ); } } } /** * Accept an extension negotiation offer. * * @param {Array} offers The extension negotiation offers * @return {Object} Accepted configuration * @private */ acceptAsServer(offers) { const opts = this._options; const accepted = offers.find((params) => { if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" && !params.client_max_window_bits) { return false; } return true; }); if (!accepted) { throw new Error("None of the extension offers can be accepted"); } if (opts.serverNoContextTakeover) { accepted.server_no_context_takeover = true; } if (opts.clientNoContextTakeover) { accepted.client_no_context_takeover = true; } if (typeof opts.serverMaxWindowBits === "number") { accepted.server_max_window_bits = opts.serverMaxWindowBits; } if (typeof opts.clientMaxWindowBits === "number") { accepted.client_max_window_bits = opts.clientMaxWindowBits; } else if (accepted.client_max_window_bits === true || opts.clientMaxWindowBits === false) { delete accepted.client_max_window_bits; } return accepted; } /** * Accept the extension negotiation response. * * @param {Array} response The extension negotiation response * @return {Object} Accepted configuration * @private */ acceptAsClient(response) { const params = response[0]; if (this._options.clientNoContextTakeover === false && params.client_no_context_takeover) { throw new Error('Unexpected parameter "client_no_context_takeover"'); } if (!params.client_max_window_bits) { if (typeof this._options.clientMaxWindowBits === "number") { params.client_max_window_bits = this._options.clientMaxWindowBits; } } else if (this._options.clientMaxWindowBits === false || typeof this._options.clientMaxWindowBits === "number" && params.client_max_window_bits > this._options.clientMaxWindowBits) { throw new Error( 'Unexpected or invalid parameter "client_max_window_bits"' ); } return params; } /** * Normalize parameters. * * @param {Array} configurations The extension negotiation offers/reponse * @return {Array} The offers/response with normalized parameters * @private */ normalizeParams(configurations) { configurations.forEach((params) => { Object.keys(params).forEach((key) => { let value = params[key]; if (value.length > 1) { throw new Error(`Parameter "${key}" must have only a single value`); } value = value[0]; if (key === "client_max_window_bits") { if (value !== true) { const num = +value; if (!Number.isInteger(num) || num < 8 || num > 15) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } value = num; } else if (!this._isServer) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } } else if (key === "server_max_window_bits") { const num = +value; if (!Number.isInteger(num) || num < 8 || num > 15) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } value = num; } else if (key === "client_no_context_takeover" || key === "server_no_context_takeover") { if (value !== true) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } } else { throw new Error(`Unknown parameter "${key}"`); } params[key] = value; }); }); return configurations; } /** * Decompress data. Concurrency limited. * * @param {Buffer} data Compressed data * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @public */ decompress(data, fin, callback) { zlibLimiter.add((done) => { this._decompress(data, fin, (err, result) => { done(); callback(err, result); }); }); } /** * Compress data. Concurrency limited. * * @param {(Buffer|String)} data Data to compress * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @public */ compress(data, fin, callback) { zlibLimiter.add((done) => { this._compress(data, fin, (err, result) => { done(); callback(err, result); }); }); } /** * Decompress data. * * @param {Buffer} data Compressed data * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @private */ _decompress(data, fin, callback) { const endpoint = this._isServer ? "client" : "server"; if (!this._inflate) { const key = `${endpoint}_max_window_bits`; const windowBits = typeof this.params[key] !== "number" ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key]; this._inflate = zlib.createInflateRaw({ ...this._options.zlibInflateOptions, windowBits }); this._inflate[kPerMessageDeflate] = this; this._inflate[kTotalLength] = 0; this._inflate[kBuffers] = []; this._inflate.on("error", inflateOnError); this._inflate.on("data", inflateOnData); } this._inflate[kCallback] = callback; this._inflate.write(data); if (fin) this._inflate.write(TRAILER); this._inflate.flush(() => { const err = this._inflate[kError]; if (err) { this._inflate.close(); this._inflate = null; callback(err); return; } const data2 = bufferUtil.concat( this._inflate[kBuffers], this._inflate[kTotalLength] ); if (this._inflate._readableState.endEmitted) { this._inflate.close(); this._inflate = null; } else { this._inflate[kTotalLength] = 0; this._inflate[kBuffers] = []; if (fin && this.params[`${endpoint}_no_context_takeover`]) { this._inflate.reset(); } } callback(null, data2); }); } /** * Compress data. * * @param {(Buffer|String)} data Data to compress * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @private */ _compress(data, fin, callback) { const endpoint = this._isServer ? "server" : "client"; if (!this._deflate) { const key = `${endpoint}_max_window_bits`; const windowBits = typeof this.params[key] !== "number" ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key]; this._deflate = zlib.createDeflateRaw({ ...this._options.zlibDeflateOptions, windowBits }); this._deflate[kTotalLength] = 0; this._deflate[kBuffers] = []; this._deflate.on("data", deflateOnData); } this._deflate[kCallback] = callback; this._deflate.write(data); this._deflate.flush(zlib.Z_SYNC_FLUSH, () => { if (!this._deflate) { return; } let data2 = bufferUtil.concat( this._deflate[kBuffers], this._deflate[kTotalLength] ); if (fin) { data2 = new FastBuffer(data2.buffer, data2.byteOffset, data2.length - 4); } this._deflate[kCallback] = null; this._deflate[kTotalLength] = 0; this._deflate[kBuffers] = []; if (fin && this.params[`${endpoint}_no_context_takeover`]) { this._deflate.reset(); } callback(null, data2); }); } }; __name(PerMessageDeflate, "PerMessageDeflate"); module3.exports = PerMessageDeflate; function deflateOnData(chunk) { this[kBuffers].push(chunk); this[kTotalLength] += chunk.length; } __name(deflateOnData, "deflateOnData"); function inflateOnData(chunk) { this[kTotalLength] += chunk.length; if (this[kPerMessageDeflate]._maxPayload < 1 || this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload) { this[kBuffers].push(chunk); return; } this[kError] = new RangeError("Max payload size exceeded"); this[kError].code = "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"; this[kError][kStatusCode] = 1009; this.removeListener("data", inflateOnData); this.reset(); } __name(inflateOnData, "inflateOnData"); function inflateOnError(err) { this[kPerMessageDeflate]._inflate = null; err[kStatusCode] = 1007; this[kCallback](err); } __name(inflateOnError, "inflateOnError"); } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/validation.js var require_validation = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/validation.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { isUtf8 } = require("buffer"); var { hasBlob } = require_constants6(); var tokenChars = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127 ]; function isValidStatusCode(code) { return code >= 1e3 && code <= 1014 && code !== 1004 && code !== 1005 && code !== 1006 || code >= 3e3 && code <= 4999; } __name(isValidStatusCode, "isValidStatusCode"); function _isValidUTF8(buf) { const len = buf.length; let i5 = 0; while (i5 < len) { if ((buf[i5] & 128) === 0) { i5++; } else if ((buf[i5] & 224) === 192) { if (i5 + 1 === len || (buf[i5 + 1] & 192) !== 128 || (buf[i5] & 254) === 192) { return false; } i5 += 2; } else if ((buf[i5] & 240) === 224) { if (i5 + 2 >= len || (buf[i5 + 1] & 192) !== 128 || (buf[i5 + 2] & 192) !== 128 || buf[i5] === 224 && (buf[i5 + 1] & 224) === 128 || // Overlong buf[i5] === 237 && (buf[i5 + 1] & 224) === 160) { return false; } i5 += 3; } else if ((buf[i5] & 248) === 240) { if (i5 + 3 >= len || (buf[i5 + 1] & 192) !== 128 || (buf[i5 + 2] & 192) !== 128 || (buf[i5 + 3] & 192) !== 128 || buf[i5] === 240 && (buf[i5 + 1] & 240) === 128 || // Overlong buf[i5] === 244 && buf[i5 + 1] > 143 || buf[i5] > 244) { return false; } i5 += 4; } else { return false; } } return true; } __name(_isValidUTF8, "_isValidUTF8"); function isBlob3(value) { return hasBlob && typeof value === "object" && typeof value.arrayBuffer === "function" && typeof value.type === "string" && typeof value.stream === "function" && (value[Symbol.toStringTag] === "Blob" || value[Symbol.toStringTag] === "File"); } __name(isBlob3, "isBlob"); module3.exports = { isBlob: isBlob3, isValidStatusCode, isValidUTF8: _isValidUTF8, tokenChars }; if (isUtf8) { module3.exports.isValidUTF8 = function(buf) { return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf); }; } else if (!process.env.WS_NO_UTF_8_VALIDATE) { try { const isValidUTF8 = require("utf-8-validate"); module3.exports.isValidUTF8 = function(buf) { return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf); }; } catch (e7) { } } } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/receiver.js var require_receiver2 = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/receiver.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { Writable: Writable5 } = require("stream"); var PerMessageDeflate = require_permessage_deflate(); var { BINARY_TYPES, EMPTY_BUFFER, kStatusCode, kWebSocket } = require_constants6(); var { concat, toArrayBuffer, unmask } = require_buffer_util(); var { isValidStatusCode, isValidUTF8 } = require_validation(); var FastBuffer = Buffer[Symbol.species]; var GET_INFO = 0; var GET_PAYLOAD_LENGTH_16 = 1; var GET_PAYLOAD_LENGTH_64 = 2; var GET_MASK = 3; var GET_DATA = 4; var INFLATING = 5; var DEFER_EVENT = 6; var Receiver2 = class extends Writable5 { /** * Creates a Receiver instance. * * @param {Object} [options] Options object * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted * multiple times in the same tick * @param {String} [options.binaryType=nodebuffer] The type for binary data * @param {Object} [options.extensions] An object containing the negotiated * extensions * @param {Boolean} [options.isServer=false] Specifies whether to operate in * client or server mode * @param {Number} [options.maxPayload=0] The maximum allowed message length * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or * not to skip UTF-8 validation for text and close messages */ constructor(options32 = {}) { super(); this._allowSynchronousEvents = options32.allowSynchronousEvents !== void 0 ? options32.allowSynchronousEvents : true; this._binaryType = options32.binaryType || BINARY_TYPES[0]; this._extensions = options32.extensions || {}; this._isServer = !!options32.isServer; this._maxPayload = options32.maxPayload | 0; this._skipUTF8Validation = !!options32.skipUTF8Validation; this[kWebSocket] = void 0; this._bufferedBytes = 0; this._buffers = []; this._compressed = false; this._payloadLength = 0; this._mask = void 0; this._fragmented = 0; this._masked = false; this._fin = false; this._opcode = 0; this._totalPayloadLength = 0; this._messageLength = 0; this._fragments = []; this._errored = false; this._loop = false; this._state = GET_INFO; } /** * Implements `Writable.prototype._write()`. * * @param {Buffer} chunk The chunk of data to write * @param {String} encoding The character encoding of `chunk` * @param {Function} cb Callback * @private */ _write(chunk, encoding, cb2) { if (this._opcode === 8 && this._state == GET_INFO) return cb2(); this._bufferedBytes += chunk.length; this._buffers.push(chunk); this.startLoop(cb2); } /** * Consumes `n` bytes from the buffered data. * * @param {Number} n The number of bytes to consume * @return {Buffer} The consumed bytes * @private */ consume(n6) { this._bufferedBytes -= n6; if (n6 === this._buffers[0].length) return this._buffers.shift(); if (n6 < this._buffers[0].length) { const buf = this._buffers[0]; this._buffers[0] = new FastBuffer( buf.buffer, buf.byteOffset + n6, buf.length - n6 ); return new FastBuffer(buf.buffer, buf.byteOffset, n6); } const dst = Buffer.allocUnsafe(n6); do { const buf = this._buffers[0]; const offset = dst.length - n6; if (n6 >= buf.length) { dst.set(this._buffers.shift(), offset); } else { dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n6), offset); this._buffers[0] = new FastBuffer( buf.buffer, buf.byteOffset + n6, buf.length - n6 ); } n6 -= buf.length; } while (n6 > 0); return dst; } /** * Starts the parsing loop. * * @param {Function} cb Callback * @private */ startLoop(cb2) { this._loop = true; do { switch (this._state) { case GET_INFO: this.getInfo(cb2); break; case GET_PAYLOAD_LENGTH_16: this.getPayloadLength16(cb2); break; case GET_PAYLOAD_LENGTH_64: this.getPayloadLength64(cb2); break; case GET_MASK: this.getMask(); break; case GET_DATA: this.getData(cb2); break; case INFLATING: case DEFER_EVENT: this._loop = false; return; } } while (this._loop); if (!this._errored) cb2(); } /** * Reads the first two bytes of a frame. * * @param {Function} cb Callback * @private */ getInfo(cb2) { if (this._bufferedBytes < 2) { this._loop = false; return; } const buf = this.consume(2); if ((buf[0] & 48) !== 0) { const error2 = this.createError( RangeError, "RSV2 and RSV3 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_2_3" ); cb2(error2); return; } const compressed = (buf[0] & 64) === 64; if (compressed && !this._extensions[PerMessageDeflate.extensionName]) { const error2 = this.createError( RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1" ); cb2(error2); return; } this._fin = (buf[0] & 128) === 128; this._opcode = buf[0] & 15; this._payloadLength = buf[1] & 127; if (this._opcode === 0) { if (compressed) { const error2 = this.createError( RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1" ); cb2(error2); return; } if (!this._fragmented) { const error2 = this.createError( RangeError, "invalid opcode 0", true, 1002, "WS_ERR_INVALID_OPCODE" ); cb2(error2); return; } this._opcode = this._fragmented; } else if (this._opcode === 1 || this._opcode === 2) { if (this._fragmented) { const error2 = this.createError( RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE" ); cb2(error2); return; } this._compressed = compressed; } else if (this._opcode > 7 && this._opcode < 11) { if (!this._fin) { const error2 = this.createError( RangeError, "FIN must be set", true, 1002, "WS_ERR_EXPECTED_FIN" ); cb2(error2); return; } if (compressed) { const error2 = this.createError( RangeError, "RSV1 must be clear", true, 1002, "WS_ERR_UNEXPECTED_RSV_1" ); cb2(error2); return; } if (this._payloadLength > 125 || this._opcode === 8 && this._payloadLength === 1) { const error2 = this.createError( RangeError, `invalid payload length ${this._payloadLength}`, true, 1002, "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH" ); cb2(error2); return; } } else { const error2 = this.createError( RangeError, `invalid opcode ${this._opcode}`, true, 1002, "WS_ERR_INVALID_OPCODE" ); cb2(error2); return; } if (!this._fin && !this._fragmented) this._fragmented = this._opcode; this._masked = (buf[1] & 128) === 128; if (this._isServer) { if (!this._masked) { const error2 = this.createError( RangeError, "MASK must be set", true, 1002, "WS_ERR_EXPECTED_MASK" ); cb2(error2); return; } } else if (this._masked) { const error2 = this.createError( RangeError, "MASK must be clear", true, 1002, "WS_ERR_UNEXPECTED_MASK" ); cb2(error2); return; } if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16; else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64; else this.haveLength(cb2); } /** * Gets extended payload length (7+16). * * @param {Function} cb Callback * @private */ getPayloadLength16(cb2) { if (this._bufferedBytes < 2) { this._loop = false; return; } this._payloadLength = this.consume(2).readUInt16BE(0); this.haveLength(cb2); } /** * Gets extended payload length (7+64). * * @param {Function} cb Callback * @private */ getPayloadLength64(cb2) { if (this._bufferedBytes < 8) { this._loop = false; return; } const buf = this.consume(8); const num = buf.readUInt32BE(0); if (num > Math.pow(2, 53 - 32) - 1) { const error2 = this.createError( RangeError, "Unsupported WebSocket frame: payload length > 2^53 - 1", false, 1009, "WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH" ); cb2(error2); return; } this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4); this.haveLength(cb2); } /** * Payload length has been read. * * @param {Function} cb Callback * @private */ haveLength(cb2) { if (this._payloadLength && this._opcode < 8) { this._totalPayloadLength += this._payloadLength; if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) { const error2 = this.createError( RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH" ); cb2(error2); return; } } if (this._masked) this._state = GET_MASK; else this._state = GET_DATA; } /** * Reads mask bytes. * * @private */ getMask() { if (this._bufferedBytes < 4) { this._loop = false; return; } this._mask = this.consume(4); this._state = GET_DATA; } /** * Reads data bytes. * * @param {Function} cb Callback * @private */ getData(cb2) { let data = EMPTY_BUFFER; if (this._payloadLength) { if (this._bufferedBytes < this._payloadLength) { this._loop = false; return; } data = this.consume(this._payloadLength); if (this._masked && (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0) { unmask(data, this._mask); } } if (this._opcode > 7) { this.controlMessage(data, cb2); return; } if (this._compressed) { this._state = INFLATING; this.decompress(data, cb2); return; } if (data.length) { this._messageLength = this._totalPayloadLength; this._fragments.push(data); } this.dataMessage(cb2); } /** * Decompresses data. * * @param {Buffer} data Compressed data * @param {Function} cb Callback * @private */ decompress(data, cb2) { const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; perMessageDeflate.decompress(data, this._fin, (err, buf) => { if (err) return cb2(err); if (buf.length) { this._messageLength += buf.length; if (this._messageLength > this._maxPayload && this._maxPayload > 0) { const error2 = this.createError( RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH" ); cb2(error2); return; } this._fragments.push(buf); } this.dataMessage(cb2); if (this._state === GET_INFO) this.startLoop(cb2); }); } /** * Handles a data message. * * @param {Function} cb Callback * @private */ dataMessage(cb2) { if (!this._fin) { this._state = GET_INFO; return; } const messageLength = this._messageLength; const fragments = this._fragments; this._totalPayloadLength = 0; this._messageLength = 0; this._fragmented = 0; this._fragments = []; if (this._opcode === 2) { let data; if (this._binaryType === "nodebuffer") { data = concat(fragments, messageLength); } else if (this._binaryType === "arraybuffer") { data = toArrayBuffer(concat(fragments, messageLength)); } else if (this._binaryType === "blob") { data = new Blob(fragments); } else { data = fragments; } if (this._allowSynchronousEvents) { this.emit("message", data, true); this._state = GET_INFO; } else { this._state = DEFER_EVENT; setImmediate(() => { this.emit("message", data, true); this._state = GET_INFO; this.startLoop(cb2); }); } } else { const buf = concat(fragments, messageLength); if (!this._skipUTF8Validation && !isValidUTF8(buf)) { const error2 = this.createError( Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8" ); cb2(error2); return; } if (this._state === INFLATING || this._allowSynchronousEvents) { this.emit("message", buf, false); this._state = GET_INFO; } else { this._state = DEFER_EVENT; setImmediate(() => { this.emit("message", buf, false); this._state = GET_INFO; this.startLoop(cb2); }); } } } /** * Handles a control message. * * @param {Buffer} data Data to handle * @return {(Error|RangeError|undefined)} A possible error * @private */ controlMessage(data, cb2) { if (this._opcode === 8) { if (data.length === 0) { this._loop = false; this.emit("conclude", 1005, EMPTY_BUFFER); this.end(); } else { const code = data.readUInt16BE(0); if (!isValidStatusCode(code)) { const error2 = this.createError( RangeError, `invalid status code ${code}`, true, 1002, "WS_ERR_INVALID_CLOSE_CODE" ); cb2(error2); return; } const buf = new FastBuffer( data.buffer, data.byteOffset + 2, data.length - 2 ); if (!this._skipUTF8Validation && !isValidUTF8(buf)) { const error2 = this.createError( Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8" ); cb2(error2); return; } this._loop = false; this.emit("conclude", code, buf); this.end(); } this._state = GET_INFO; return; } if (this._allowSynchronousEvents) { this.emit(this._opcode === 9 ? "ping" : "pong", data); this._state = GET_INFO; } else { this._state = DEFER_EVENT; setImmediate(() => { this.emit(this._opcode === 9 ? "ping" : "pong", data); this._state = GET_INFO; this.startLoop(cb2); }); } } /** * Builds an error object. * * @param {function(new:Error|RangeError)} ErrorCtor The error constructor * @param {String} message The error message * @param {Boolean} prefix Specifies whether or not to add a default prefix to * `message` * @param {Number} statusCode The status code * @param {String} errorCode The exposed error code * @return {(Error|RangeError)} The error * @private */ createError(ErrorCtor, message, prefix, statusCode, errorCode) { this._loop = false; this._errored = true; const err = new ErrorCtor( prefix ? `Invalid WebSocket frame: ${message}` : message ); Error.captureStackTrace(err, this.createError); err.code = errorCode; err[kStatusCode] = statusCode; return err; } }; __name(Receiver2, "Receiver"); module3.exports = Receiver2; } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/sender.js var require_sender = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/sender.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { Duplex } = require("stream"); var { randomFillSync } = require("crypto"); var PerMessageDeflate = require_permessage_deflate(); var { EMPTY_BUFFER, kWebSocket, NOOP } = require_constants6(); var { isBlob: isBlob3, isValidStatusCode } = require_validation(); var { mask: applyMask, toBuffer } = require_buffer_util(); var kByteLength = Symbol("kByteLength"); var maskBuffer = Buffer.alloc(4); var RANDOM_POOL_SIZE = 8 * 1024; var randomPool; var randomPoolPointer = RANDOM_POOL_SIZE; var DEFAULT = 0; var DEFLATING = 1; var GET_BLOB_DATA = 2; var Sender2 = class { /** * Creates a Sender instance. * * @param {Duplex} socket The connection socket * @param {Object} [extensions] An object containing the negotiated extensions * @param {Function} [generateMask] The function used to generate the masking * key */ constructor(socket, extensions, generateMask) { this._extensions = extensions || {}; if (generateMask) { this._generateMask = generateMask; this._maskBuffer = Buffer.alloc(4); } this._socket = socket; this._firstFragment = true; this._compress = false; this._bufferedBytes = 0; this._queue = []; this._state = DEFAULT; this.onerror = NOOP; this[kWebSocket] = void 0; } /** * Frames a piece of data according to the HyBi WebSocket protocol. * * @param {(Buffer|String)} data The data to frame * @param {Object} options Options object * @param {Boolean} [options.fin=false] Specifies whether or not to set the * FIN bit * @param {Function} [options.generateMask] The function used to generate the * masking key * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Buffer} [options.maskBuffer] The buffer used to store the masking * key * @param {Number} options.opcode The opcode * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be * modified * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the * RSV1 bit * @return {(Buffer|String)[]} The framed data * @public */ static frame(data, options32) { let mask; let merge = false; let offset = 2; let skipMasking = false; if (options32.mask) { mask = options32.maskBuffer || maskBuffer; if (options32.generateMask) { options32.generateMask(mask); } else { if (randomPoolPointer === RANDOM_POOL_SIZE) { if (randomPool === void 0) { randomPool = Buffer.alloc(RANDOM_POOL_SIZE); } randomFillSync(randomPool, 0, RANDOM_POOL_SIZE); randomPoolPointer = 0; } mask[0] = randomPool[randomPoolPointer++]; mask[1] = randomPool[randomPoolPointer++]; mask[2] = randomPool[randomPoolPointer++]; mask[3] = randomPool[randomPoolPointer++]; } skipMasking = (mask[0] | mask[1] | mask[2] | mask[3]) === 0; offset = 6; } let dataLength; if (typeof data === "string") { if ((!options32.mask || skipMasking) && options32[kByteLength] !== void 0) { dataLength = options32[kByteLength]; } else { data = Buffer.from(data); dataLength = data.length; } } else { dataLength = data.length; merge = options32.mask && options32.readOnly && !skipMasking; } let payloadLength = dataLength; if (dataLength >= 65536) { offset += 8; payloadLength = 127; } else if (dataLength > 125) { offset += 2; payloadLength = 126; } const target = Buffer.allocUnsafe(merge ? dataLength + offset : offset); target[0] = options32.fin ? options32.opcode | 128 : options32.opcode; if (options32.rsv1) target[0] |= 64; target[1] = payloadLength; if (payloadLength === 126) { target.writeUInt16BE(dataLength, 2); } else if (payloadLength === 127) { target[2] = target[3] = 0; target.writeUIntBE(dataLength, 4, 6); } if (!options32.mask) return [target, data]; target[1] |= 128; target[offset - 4] = mask[0]; target[offset - 3] = mask[1]; target[offset - 2] = mask[2]; target[offset - 1] = mask[3]; if (skipMasking) return [target, data]; if (merge) { applyMask(data, mask, target, offset, dataLength); return [target]; } applyMask(data, mask, data, 0, dataLength); return [target, data]; } /** * Sends a close message to the other peer. * * @param {Number} [code] The status code component of the body * @param {(String|Buffer)} [data] The message component of the body * @param {Boolean} [mask=false] Specifies whether or not to mask the message * @param {Function} [cb] Callback * @public */ close(code, data, mask, cb2) { let buf; if (code === void 0) { buf = EMPTY_BUFFER; } else if (typeof code !== "number" || !isValidStatusCode(code)) { throw new TypeError("First argument must be a valid error code number"); } else if (data === void 0 || !data.length) { buf = Buffer.allocUnsafe(2); buf.writeUInt16BE(code, 0); } else { const length = Buffer.byteLength(data); if (length > 123) { throw new RangeError("The message must not be greater than 123 bytes"); } buf = Buffer.allocUnsafe(2 + length); buf.writeUInt16BE(code, 0); if (typeof data === "string") { buf.write(data, 2); } else { buf.set(data, 2); } } const options32 = { [kByteLength]: buf.length, fin: true, generateMask: this._generateMask, mask, maskBuffer: this._maskBuffer, opcode: 8, readOnly: false, rsv1: false }; if (this._state !== DEFAULT) { this.enqueue([this.dispatch, buf, false, options32, cb2]); } else { this.sendFrame(Sender2.frame(buf, options32), cb2); } } /** * Sends a ping message to the other peer. * * @param {*} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Function} [cb] Callback * @public */ ping(data, mask, cb2) { let byteLength; let readOnly; if (typeof data === "string") { byteLength = Buffer.byteLength(data); readOnly = false; } else if (isBlob3(data)) { byteLength = data.size; readOnly = false; } else { data = toBuffer(data); byteLength = data.length; readOnly = toBuffer.readOnly; } if (byteLength > 125) { throw new RangeError("The data size must not be greater than 125 bytes"); } const options32 = { [kByteLength]: byteLength, fin: true, generateMask: this._generateMask, mask, maskBuffer: this._maskBuffer, opcode: 9, readOnly, rsv1: false }; if (isBlob3(data)) { if (this._state !== DEFAULT) { this.enqueue([this.getBlobData, data, false, options32, cb2]); } else { this.getBlobData(data, false, options32, cb2); } } else if (this._state !== DEFAULT) { this.enqueue([this.dispatch, data, false, options32, cb2]); } else { this.sendFrame(Sender2.frame(data, options32), cb2); } } /** * Sends a pong message to the other peer. * * @param {*} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Function} [cb] Callback * @public */ pong(data, mask, cb2) { let byteLength; let readOnly; if (typeof data === "string") { byteLength = Buffer.byteLength(data); readOnly = false; } else if (isBlob3(data)) { byteLength = data.size; readOnly = false; } else { data = toBuffer(data); byteLength = data.length; readOnly = toBuffer.readOnly; } if (byteLength > 125) { throw new RangeError("The data size must not be greater than 125 bytes"); } const options32 = { [kByteLength]: byteLength, fin: true, generateMask: this._generateMask, mask, maskBuffer: this._maskBuffer, opcode: 10, readOnly, rsv1: false }; if (isBlob3(data)) { if (this._state !== DEFAULT) { this.enqueue([this.getBlobData, data, false, options32, cb2]); } else { this.getBlobData(data, false, options32, cb2); } } else if (this._state !== DEFAULT) { this.enqueue([this.dispatch, data, false, options32, cb2]); } else { this.sendFrame(Sender2.frame(data, options32), cb2); } } /** * Sends a data message to the other peer. * * @param {*} data The message to send * @param {Object} options Options object * @param {Boolean} [options.binary=false] Specifies whether `data` is binary * or text * @param {Boolean} [options.compress=false] Specifies whether or not to * compress `data` * @param {Boolean} [options.fin=false] Specifies whether the fragment is the * last one * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Function} [cb] Callback * @public */ send(data, options32, cb2) { const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; let opcode = options32.binary ? 2 : 1; let rsv1 = options32.compress; let byteLength; let readOnly; if (typeof data === "string") { byteLength = Buffer.byteLength(data); readOnly = false; } else if (isBlob3(data)) { byteLength = data.size; readOnly = false; } else { data = toBuffer(data); byteLength = data.length; readOnly = toBuffer.readOnly; } if (this._firstFragment) { this._firstFragment = false; if (rsv1 && perMessageDeflate && perMessageDeflate.params[perMessageDeflate._isServer ? "server_no_context_takeover" : "client_no_context_takeover"]) { rsv1 = byteLength >= perMessageDeflate._threshold; } this._compress = rsv1; } else { rsv1 = false; opcode = 0; } if (options32.fin) this._firstFragment = true; const opts = { [kByteLength]: byteLength, fin: options32.fin, generateMask: this._generateMask, mask: options32.mask, maskBuffer: this._maskBuffer, opcode, readOnly, rsv1 }; if (isBlob3(data)) { if (this._state !== DEFAULT) { this.enqueue([this.getBlobData, data, this._compress, opts, cb2]); } else { this.getBlobData(data, this._compress, opts, cb2); } } else if (this._state !== DEFAULT) { this.enqueue([this.dispatch, data, this._compress, opts, cb2]); } else { this.dispatch(data, this._compress, opts, cb2); } } /** * Gets the contents of a blob as binary data. * * @param {Blob} blob The blob * @param {Boolean} [compress=false] Specifies whether or not to compress * the data * @param {Object} options Options object * @param {Boolean} [options.fin=false] Specifies whether or not to set the * FIN bit * @param {Function} [options.generateMask] The function used to generate the * masking key * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Buffer} [options.maskBuffer] The buffer used to store the masking * key * @param {Number} options.opcode The opcode * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be * modified * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the * RSV1 bit * @param {Function} [cb] Callback * @private */ getBlobData(blob, compress, options32, cb2) { this._bufferedBytes += options32[kByteLength]; this._state = GET_BLOB_DATA; blob.arrayBuffer().then((arrayBuffer2) => { if (this._socket.destroyed) { const err = new Error( "The socket was closed while the blob was being read" ); process.nextTick(callCallbacks, this, err, cb2); return; } this._bufferedBytes -= options32[kByteLength]; const data = toBuffer(arrayBuffer2); if (!compress) { this._state = DEFAULT; this.sendFrame(Sender2.frame(data, options32), cb2); this.dequeue(); } else { this.dispatch(data, compress, options32, cb2); } }).catch((err) => { process.nextTick(onError, this, err, cb2); }); } /** * Dispatches a message. * * @param {(Buffer|String)} data The message to send * @param {Boolean} [compress=false] Specifies whether or not to compress * `data` * @param {Object} options Options object * @param {Boolean} [options.fin=false] Specifies whether or not to set the * FIN bit * @param {Function} [options.generateMask] The function used to generate the * masking key * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Buffer} [options.maskBuffer] The buffer used to store the masking * key * @param {Number} options.opcode The opcode * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be * modified * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the * RSV1 bit * @param {Function} [cb] Callback * @private */ dispatch(data, compress, options32, cb2) { if (!compress) { this.sendFrame(Sender2.frame(data, options32), cb2); return; } const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; this._bufferedBytes += options32[kByteLength]; this._state = DEFLATING; perMessageDeflate.compress(data, options32.fin, (_4, buf) => { if (this._socket.destroyed) { const err = new Error( "The socket was closed while data was being compressed" ); callCallbacks(this, err, cb2); return; } this._bufferedBytes -= options32[kByteLength]; this._state = DEFAULT; options32.readOnly = false; this.sendFrame(Sender2.frame(buf, options32), cb2); this.dequeue(); }); } /** * Executes queued send operations. * * @private */ dequeue() { while (this._state === DEFAULT && this._queue.length) { const params = this._queue.shift(); this._bufferedBytes -= params[3][kByteLength]; Reflect.apply(params[0], this, params.slice(1)); } } /** * Enqueues a send operation. * * @param {Array} params Send operation parameters. * @private */ enqueue(params) { this._bufferedBytes += params[3][kByteLength]; this._queue.push(params); } /** * Sends a frame. * * @param {Buffer[]} list The frame to send * @param {Function} [cb] Callback * @private */ sendFrame(list, cb2) { if (list.length === 2) { this._socket.cork(); this._socket.write(list[0]); this._socket.write(list[1], cb2); this._socket.uncork(); } else { this._socket.write(list[0], cb2); } } }; __name(Sender2, "Sender"); module3.exports = Sender2; function callCallbacks(sender, err, cb2) { if (typeof cb2 === "function") cb2(err); for (let i5 = 0; i5 < sender._queue.length; i5++) { const params = sender._queue[i5]; const callback = params[params.length - 1]; if (typeof callback === "function") callback(err); } } __name(callCallbacks, "callCallbacks"); function onError(sender, err, cb2) { callCallbacks(sender, err, cb2); sender.onerror(err); } __name(onError, "onError"); } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/event-target.js var require_event_target = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/event-target.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { kForOnEventAttribute, kListener } = require_constants6(); var kCode = Symbol("kCode"); var kData = Symbol("kData"); var kError = Symbol("kError"); var kMessage = Symbol("kMessage"); var kReason = Symbol("kReason"); var kTarget = Symbol("kTarget"); var kType = Symbol("kType"); var kWasClean = Symbol("kWasClean"); var Event2 = class { /** * Create a new `Event`. * * @param {String} type The name of the event * @throws {TypeError} If the `type` argument is not specified */ constructor(type) { this[kTarget] = null; this[kType] = type; } /** * @type {*} */ get target() { return this[kTarget]; } /** * @type {String} */ get type() { return this[kType]; } }; __name(Event2, "Event"); Object.defineProperty(Event2.prototype, "target", { enumerable: true }); Object.defineProperty(Event2.prototype, "type", { enumerable: true }); var CloseEvent = class extends Event2 { /** * Create a new `CloseEvent`. * * @param {String} type The name of the event * @param {Object} [options] A dictionary object that allows for setting * attributes via object members of the same name * @param {Number} [options.code=0] The status code explaining why the * connection was closed * @param {String} [options.reason=''] A human-readable string explaining why * the connection was closed * @param {Boolean} [options.wasClean=false] Indicates whether or not the * connection was cleanly closed */ constructor(type, options32 = {}) { super(type); this[kCode] = options32.code === void 0 ? 0 : options32.code; this[kReason] = options32.reason === void 0 ? "" : options32.reason; this[kWasClean] = options32.wasClean === void 0 ? false : options32.wasClean; } /** * @type {Number} */ get code() { return this[kCode]; } /** * @type {String} */ get reason() { return this[kReason]; } /** * @type {Boolean} */ get wasClean() { return this[kWasClean]; } }; __name(CloseEvent, "CloseEvent"); Object.defineProperty(CloseEvent.prototype, "code", { enumerable: true }); Object.defineProperty(CloseEvent.prototype, "reason", { enumerable: true }); Object.defineProperty(CloseEvent.prototype, "wasClean", { enumerable: true }); var ErrorEvent = class extends Event2 { /** * Create a new `ErrorEvent`. * * @param {String} type The name of the event * @param {Object} [options] A dictionary object that allows for setting * attributes via object members of the same name * @param {*} [options.error=null] The error that generated this event * @param {String} [options.message=''] The error message */ constructor(type, options32 = {}) { super(type); this[kError] = options32.error === void 0 ? null : options32.error; this[kMessage] = options32.message === void 0 ? "" : options32.message; } /** * @type {*} */ get error() { return this[kError]; } /** * @type {String} */ get message() { return this[kMessage]; } }; __name(ErrorEvent, "ErrorEvent"); Object.defineProperty(ErrorEvent.prototype, "error", { enumerable: true }); Object.defineProperty(ErrorEvent.prototype, "message", { enumerable: true }); var MessageEvent = class extends Event2 { /** * Create a new `MessageEvent`. * * @param {String} type The name of the event * @param {Object} [options] A dictionary object that allows for setting * attributes via object members of the same name * @param {*} [options.data=null] The message content */ constructor(type, options32 = {}) { super(type); this[kData] = options32.data === void 0 ? null : options32.data; } /** * @type {*} */ get data() { return this[kData]; } }; __name(MessageEvent, "MessageEvent"); Object.defineProperty(MessageEvent.prototype, "data", { enumerable: true }); var EventTarget2 = { /** * Register an event listener. * * @param {String} type A string representing the event type to listen for * @param {(Function|Object)} handler The listener to add * @param {Object} [options] An options object specifies characteristics about * the event listener * @param {Boolean} [options.once=false] A `Boolean` indicating that the * listener should be invoked at most once after being added. If `true`, * the listener would be automatically removed when invoked. * @public */ addEventListener(type, handler31, options32 = {}) { for (const listener of this.listeners(type)) { if (!options32[kForOnEventAttribute] && listener[kListener] === handler31 && !listener[kForOnEventAttribute]) { return; } } let wrapper; if (type === "message") { wrapper = /* @__PURE__ */ __name(function onMessage(data, isBinary) { const event = new MessageEvent("message", { data: isBinary ? data : data.toString() }); event[kTarget] = this; callListener(handler31, this, event); }, "onMessage"); } else if (type === "close") { wrapper = /* @__PURE__ */ __name(function onClose(code, message) { const event = new CloseEvent("close", { code, reason: message.toString(), wasClean: this._closeFrameReceived && this._closeFrameSent }); event[kTarget] = this; callListener(handler31, this, event); }, "onClose"); } else if (type === "error") { wrapper = /* @__PURE__ */ __name(function onError(error2) { const event = new ErrorEvent("error", { error: error2, message: error2.message }); event[kTarget] = this; callListener(handler31, this, event); }, "onError"); } else if (type === "open") { wrapper = /* @__PURE__ */ __name(function onOpen() { const event = new Event2("open"); event[kTarget] = this; callListener(handler31, this, event); }, "onOpen"); } else { return; } wrapper[kForOnEventAttribute] = !!options32[kForOnEventAttribute]; wrapper[kListener] = handler31; if (options32.once) { this.once(type, wrapper); } else { this.on(type, wrapper); } }, /** * Remove an event listener. * * @param {String} type A string representing the event type to remove * @param {(Function|Object)} handler The listener to remove * @public */ removeEventListener(type, handler31) { for (const listener of this.listeners(type)) { if (listener[kListener] === handler31 && !listener[kForOnEventAttribute]) { this.removeListener(type, listener); break; } } } }; module3.exports = { CloseEvent, ErrorEvent, Event: Event2, EventTarget: EventTarget2, MessageEvent }; function callListener(listener, thisArg, event) { if (typeof listener === "object" && listener.handleEvent) { listener.handleEvent.call(listener, event); } else { listener.call(thisArg, event); } } __name(callListener, "callListener"); } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/extension.js var require_extension = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/extension.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { tokenChars } = require_validation(); function push2(dest, name2, elem) { if (dest[name2] === void 0) dest[name2] = [elem]; else dest[name2].push(elem); } __name(push2, "push"); function parse7(header) { const offers = /* @__PURE__ */ Object.create(null); let params = /* @__PURE__ */ Object.create(null); let mustUnescape = false; let isEscaping = false; let inQuotes = false; let extensionName; let paramName; let start = -1; let code = -1; let end = -1; let i5 = 0; for (; i5 < header.length; i5++) { code = header.charCodeAt(i5); if (extensionName === void 0) { if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i5; } else if (i5 !== 0 && (code === 32 || code === 9)) { if (end === -1 && start !== -1) end = i5; } else if (code === 59 || code === 44) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i5}`); } if (end === -1) end = i5; const name2 = header.slice(start, end); if (code === 44) { push2(offers, name2, params); params = /* @__PURE__ */ Object.create(null); } else { extensionName = name2; } start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i5}`); } } else if (paramName === void 0) { if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i5; } else if (code === 32 || code === 9) { if (end === -1 && start !== -1) end = i5; } else if (code === 59 || code === 44) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i5}`); } if (end === -1) end = i5; push2(params, header.slice(start, end), true); if (code === 44) { push2(offers, extensionName, params); params = /* @__PURE__ */ Object.create(null); extensionName = void 0; } start = end = -1; } else if (code === 61 && start !== -1 && end === -1) { paramName = header.slice(start, i5); start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i5}`); } } else { if (isEscaping) { if (tokenChars[code] !== 1) { throw new SyntaxError(`Unexpected character at index ${i5}`); } if (start === -1) start = i5; else if (!mustUnescape) mustUnescape = true; isEscaping = false; } else if (inQuotes) { if (tokenChars[code] === 1) { if (start === -1) start = i5; } else if (code === 34 && start !== -1) { inQuotes = false; end = i5; } else if (code === 92) { isEscaping = true; } else { throw new SyntaxError(`Unexpected character at index ${i5}`); } } else if (code === 34 && header.charCodeAt(i5 - 1) === 61) { inQuotes = true; } else if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i5; } else if (start !== -1 && (code === 32 || code === 9)) { if (end === -1) end = i5; } else if (code === 59 || code === 44) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i5}`); } if (end === -1) end = i5; let value = header.slice(start, end); if (mustUnescape) { value = value.replace(/\\/g, ""); mustUnescape = false; } push2(params, paramName, value); if (code === 44) { push2(offers, extensionName, params); params = /* @__PURE__ */ Object.create(null); extensionName = void 0; } paramName = void 0; start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i5}`); } } } if (start === -1 || inQuotes || code === 32 || code === 9) { throw new SyntaxError("Unexpected end of input"); } if (end === -1) end = i5; const token = header.slice(start, end); if (extensionName === void 0) { push2(offers, token, params); } else { if (paramName === void 0) { push2(params, token, true); } else if (mustUnescape) { push2(params, paramName, token.replace(/\\/g, "")); } else { push2(params, paramName, token); } push2(offers, extensionName, params); } return offers; } __name(parse7, "parse"); function format11(extensions) { return Object.keys(extensions).map((extension) => { let configurations = extensions[extension]; if (!Array.isArray(configurations)) configurations = [configurations]; return configurations.map((params) => { return [extension].concat( Object.keys(params).map((k6) => { let values = params[k6]; if (!Array.isArray(values)) values = [values]; return values.map((v7) => v7 === true ? k6 : `${k6}=${v7}`).join("; "); }) ).join("; "); }).join(", "); }).join(", "); } __name(format11, "format"); module3.exports = { format: format11, parse: parse7 }; } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/websocket.js var require_websocket2 = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/websocket.js"(exports2, module3) { "use strict"; init_import_meta_url(); var EventEmitter5 = require("events"); var https2 = require("https"); var http5 = require("http"); var net2 = require("net"); var tls = require("tls"); var { randomBytes: randomBytes2, createHash: createHash5 } = require("crypto"); var { Duplex, Readable: Readable8 } = require("stream"); var { URL: URL7 } = require("url"); var PerMessageDeflate = require_permessage_deflate(); var Receiver2 = require_receiver2(); var Sender2 = require_sender(); var { isBlob: isBlob3 } = require_validation(); var { BINARY_TYPES, EMPTY_BUFFER, GUID, kForOnEventAttribute, kListener, kStatusCode, kWebSocket, NOOP } = require_constants6(); var { EventTarget: { addEventListener, removeEventListener } } = require_event_target(); var { format: format11, parse: parse7 } = require_extension(); var { toBuffer } = require_buffer_util(); var closeTimeout = 30 * 1e3; var kAborted = Symbol("kAborted"); var protocolVersions = [8, 13]; var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"]; var subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/; var WebSocket2 = class extends EventEmitter5 { /** * Create a new `WebSocket`. * * @param {(String|URL)} address The URL to which to connect * @param {(String|String[])} [protocols] The subprotocols * @param {Object} [options] Connection options */ constructor(address, protocols, options32) { super(); this._binaryType = BINARY_TYPES[0]; this._closeCode = 1006; this._closeFrameReceived = false; this._closeFrameSent = false; this._closeMessage = EMPTY_BUFFER; this._closeTimer = null; this._errorEmitted = false; this._extensions = {}; this._paused = false; this._protocol = ""; this._readyState = WebSocket2.CONNECTING; this._receiver = null; this._sender = null; this._socket = null; if (address !== null) { this._bufferedAmount = 0; this._isServer = false; this._redirects = 0; if (protocols === void 0) { protocols = []; } else if (!Array.isArray(protocols)) { if (typeof protocols === "object" && protocols !== null) { options32 = protocols; protocols = []; } else { protocols = [protocols]; } } initAsClient(this, address, protocols, options32); } else { this._autoPong = options32.autoPong; this._isServer = true; } } /** * For historical reasons, the custom "nodebuffer" type is used by the default * instead of "blob". * * @type {String} */ get binaryType() { return this._binaryType; } set binaryType(type) { if (!BINARY_TYPES.includes(type)) return; this._binaryType = type; if (this._receiver) this._receiver._binaryType = type; } /** * @type {Number} */ get bufferedAmount() { if (!this._socket) return this._bufferedAmount; return this._socket._writableState.length + this._sender._bufferedBytes; } /** * @type {String} */ get extensions() { return Object.keys(this._extensions).join(); } /** * @type {Boolean} */ get isPaused() { return this._paused; } /** * @type {Function} */ /* istanbul ignore next */ get onclose() { return null; } /** * @type {Function} */ /* istanbul ignore next */ get onerror() { return null; } /** * @type {Function} */ /* istanbul ignore next */ get onopen() { return null; } /** * @type {Function} */ /* istanbul ignore next */ get onmessage() { return null; } /** * @type {String} */ get protocol() { return this._protocol; } /** * @type {Number} */ get readyState() { return this._readyState; } /** * @type {String} */ get url() { return this._url; } /** * Set up the socket and the internal resources. * * @param {Duplex} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Object} options Options object * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted * multiple times in the same tick * @param {Function} [options.generateMask] The function used to generate the * masking key * @param {Number} [options.maxPayload=0] The maximum allowed message size * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or * not to skip UTF-8 validation for text and close messages * @private */ setSocket(socket, head, options32) { const receiver = new Receiver2({ allowSynchronousEvents: options32.allowSynchronousEvents, binaryType: this.binaryType, extensions: this._extensions, isServer: this._isServer, maxPayload: options32.maxPayload, skipUTF8Validation: options32.skipUTF8Validation }); const sender = new Sender2(socket, this._extensions, options32.generateMask); this._receiver = receiver; this._sender = sender; this._socket = socket; receiver[kWebSocket] = this; sender[kWebSocket] = this; socket[kWebSocket] = this; receiver.on("conclude", receiverOnConclude); receiver.on("drain", receiverOnDrain); receiver.on("error", receiverOnError); receiver.on("message", receiverOnMessage); receiver.on("ping", receiverOnPing); receiver.on("pong", receiverOnPong); sender.onerror = senderOnError; if (socket.setTimeout) socket.setTimeout(0); if (socket.setNoDelay) socket.setNoDelay(); if (head.length > 0) socket.unshift(head); socket.on("close", socketOnClose); socket.on("data", socketOnData); socket.on("end", socketOnEnd); socket.on("error", socketOnError); this._readyState = WebSocket2.OPEN; this.emit("open"); } /** * Emit the `'close'` event. * * @private */ emitClose() { if (!this._socket) { this._readyState = WebSocket2.CLOSED; this.emit("close", this._closeCode, this._closeMessage); return; } if (this._extensions[PerMessageDeflate.extensionName]) { this._extensions[PerMessageDeflate.extensionName].cleanup(); } this._receiver.removeAllListeners(); this._readyState = WebSocket2.CLOSED; this.emit("close", this._closeCode, this._closeMessage); } /** * Start a closing handshake. * * +----------+ +-----------+ +----------+ * - - -|ws.close()|-->|close frame|-->|ws.close()|- - - * | +----------+ +-----------+ +----------+ | * +----------+ +-----------+ | * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING * +----------+ +-----------+ | * | | | +---+ | * +------------------------+-->|fin| - - - - * | +---+ | +---+ * - - - - -|fin|<---------------------+ * +---+ * * @param {Number} [code] Status code explaining why the connection is closing * @param {(String|Buffer)} [data] The reason why the connection is * closing * @public */ close(code, data) { if (this.readyState === WebSocket2.CLOSED) return; if (this.readyState === WebSocket2.CONNECTING) { const msg = "WebSocket was closed before the connection was established"; abortHandshake(this, this._req, msg); return; } if (this.readyState === WebSocket2.CLOSING) { if (this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted)) { this._socket.end(); } return; } this._readyState = WebSocket2.CLOSING; this._sender.close(code, data, !this._isServer, (err) => { if (err) return; this._closeFrameSent = true; if (this._closeFrameReceived || this._receiver._writableState.errorEmitted) { this._socket.end(); } }); setCloseTimer(this); } /** * Pause the socket. * * @public */ pause() { if (this.readyState === WebSocket2.CONNECTING || this.readyState === WebSocket2.CLOSED) { return; } this._paused = true; this._socket.pause(); } /** * Send a ping. * * @param {*} [data] The data to send * @param {Boolean} [mask] Indicates whether or not to mask `data` * @param {Function} [cb] Callback which is executed when the ping is sent * @public */ ping(data, mask, cb2) { if (this.readyState === WebSocket2.CONNECTING) { throw new Error("WebSocket is not open: readyState 0 (CONNECTING)"); } if (typeof data === "function") { cb2 = data; data = mask = void 0; } else if (typeof mask === "function") { cb2 = mask; mask = void 0; } if (typeof data === "number") data = data.toString(); if (this.readyState !== WebSocket2.OPEN) { sendAfterClose(this, data, cb2); return; } if (mask === void 0) mask = !this._isServer; this._sender.ping(data || EMPTY_BUFFER, mask, cb2); } /** * Send a pong. * * @param {*} [data] The data to send * @param {Boolean} [mask] Indicates whether or not to mask `data` * @param {Function} [cb] Callback which is executed when the pong is sent * @public */ pong(data, mask, cb2) { if (this.readyState === WebSocket2.CONNECTING) { throw new Error("WebSocket is not open: readyState 0 (CONNECTING)"); } if (typeof data === "function") { cb2 = data; data = mask = void 0; } else if (typeof mask === "function") { cb2 = mask; mask = void 0; } if (typeof data === "number") data = data.toString(); if (this.readyState !== WebSocket2.OPEN) { sendAfterClose(this, data, cb2); return; } if (mask === void 0) mask = !this._isServer; this._sender.pong(data || EMPTY_BUFFER, mask, cb2); } /** * Resume the socket. * * @public */ resume() { if (this.readyState === WebSocket2.CONNECTING || this.readyState === WebSocket2.CLOSED) { return; } this._paused = false; if (!this._receiver._writableState.needDrain) this._socket.resume(); } /** * Send a data message. * * @param {*} data The message to send * @param {Object} [options] Options object * @param {Boolean} [options.binary] Specifies whether `data` is binary or * text * @param {Boolean} [options.compress] Specifies whether or not to compress * `data` * @param {Boolean} [options.fin=true] Specifies whether the fragment is the * last one * @param {Boolean} [options.mask] Specifies whether or not to mask `data` * @param {Function} [cb] Callback which is executed when data is written out * @public */ send(data, options32, cb2) { if (this.readyState === WebSocket2.CONNECTING) { throw new Error("WebSocket is not open: readyState 0 (CONNECTING)"); } if (typeof options32 === "function") { cb2 = options32; options32 = {}; } if (typeof data === "number") data = data.toString(); if (this.readyState !== WebSocket2.OPEN) { sendAfterClose(this, data, cb2); return; } const opts = { binary: typeof data !== "string", mask: !this._isServer, compress: true, fin: true, ...options32 }; if (!this._extensions[PerMessageDeflate.extensionName]) { opts.compress = false; } this._sender.send(data || EMPTY_BUFFER, opts, cb2); } /** * Forcibly close the connection. * * @public */ terminate() { if (this.readyState === WebSocket2.CLOSED) return; if (this.readyState === WebSocket2.CONNECTING) { const msg = "WebSocket was closed before the connection was established"; abortHandshake(this, this._req, msg); return; } if (this._socket) { this._readyState = WebSocket2.CLOSING; this._socket.destroy(); } } }; __name(WebSocket2, "WebSocket"); Object.defineProperty(WebSocket2, "CONNECTING", { enumerable: true, value: readyStates.indexOf("CONNECTING") }); Object.defineProperty(WebSocket2.prototype, "CONNECTING", { enumerable: true, value: readyStates.indexOf("CONNECTING") }); Object.defineProperty(WebSocket2, "OPEN", { enumerable: true, value: readyStates.indexOf("OPEN") }); Object.defineProperty(WebSocket2.prototype, "OPEN", { enumerable: true, value: readyStates.indexOf("OPEN") }); Object.defineProperty(WebSocket2, "CLOSING", { enumerable: true, value: readyStates.indexOf("CLOSING") }); Object.defineProperty(WebSocket2.prototype, "CLOSING", { enumerable: true, value: readyStates.indexOf("CLOSING") }); Object.defineProperty(WebSocket2, "CLOSED", { enumerable: true, value: readyStates.indexOf("CLOSED") }); Object.defineProperty(WebSocket2.prototype, "CLOSED", { enumerable: true, value: readyStates.indexOf("CLOSED") }); [ "binaryType", "bufferedAmount", "extensions", "isPaused", "protocol", "readyState", "url" ].forEach((property) => { Object.defineProperty(WebSocket2.prototype, property, { enumerable: true }); }); ["open", "error", "close", "message"].forEach((method) => { Object.defineProperty(WebSocket2.prototype, `on${method}`, { enumerable: true, get() { for (const listener of this.listeners(method)) { if (listener[kForOnEventAttribute]) return listener[kListener]; } return null; }, set(handler31) { for (const listener of this.listeners(method)) { if (listener[kForOnEventAttribute]) { this.removeListener(method, listener); break; } } if (typeof handler31 !== "function") return; this.addEventListener(method, handler31, { [kForOnEventAttribute]: true }); } }); }); WebSocket2.prototype.addEventListener = addEventListener; WebSocket2.prototype.removeEventListener = removeEventListener; module3.exports = WebSocket2; function initAsClient(websocket, address, protocols, options32) { const opts = { allowSynchronousEvents: true, autoPong: true, protocolVersion: protocolVersions[1], maxPayload: 100 * 1024 * 1024, skipUTF8Validation: false, perMessageDeflate: true, followRedirects: false, maxRedirects: 10, ...options32, socketPath: void 0, hostname: void 0, protocol: void 0, timeout: void 0, method: "GET", host: void 0, path: void 0, port: void 0 }; websocket._autoPong = opts.autoPong; if (!protocolVersions.includes(opts.protocolVersion)) { throw new RangeError( `Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})` ); } let parsedUrl; if (address instanceof URL7) { parsedUrl = address; } else { try { parsedUrl = new URL7(address); } catch (e7) { throw new SyntaxError(`Invalid URL: ${address}`); } } if (parsedUrl.protocol === "http:") { parsedUrl.protocol = "ws:"; } else if (parsedUrl.protocol === "https:") { parsedUrl.protocol = "wss:"; } websocket._url = parsedUrl.href; const isSecure = parsedUrl.protocol === "wss:"; const isIpcUrl = parsedUrl.protocol === "ws+unix:"; let invalidUrlMessage; if (parsedUrl.protocol !== "ws:" && !isSecure && !isIpcUrl) { invalidUrlMessage = `The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`; } else if (isIpcUrl && !parsedUrl.pathname) { invalidUrlMessage = "The URL's pathname is empty"; } else if (parsedUrl.hash) { invalidUrlMessage = "The URL contains a fragment identifier"; } if (invalidUrlMessage) { const err = new SyntaxError(invalidUrlMessage); if (websocket._redirects === 0) { throw err; } else { emitErrorAndClose(websocket, err); return; } } const defaultPort = isSecure ? 443 : 80; const key = randomBytes2(16).toString("base64"); const request4 = isSecure ? https2.request : http5.request; const protocolSet = /* @__PURE__ */ new Set(); let perMessageDeflate; opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect); opts.defaultPort = opts.defaultPort || defaultPort; opts.port = parsedUrl.port || defaultPort; opts.host = parsedUrl.hostname.startsWith("[") ? parsedUrl.hostname.slice(1, -1) : parsedUrl.hostname; opts.headers = { ...opts.headers, "Sec-WebSocket-Version": opts.protocolVersion, "Sec-WebSocket-Key": key, Connection: "Upgrade", Upgrade: "websocket" }; opts.path = parsedUrl.pathname + parsedUrl.search; opts.timeout = opts.handshakeTimeout; if (opts.perMessageDeflate) { perMessageDeflate = new PerMessageDeflate( opts.perMessageDeflate !== true ? opts.perMessageDeflate : {}, false, opts.maxPayload ); opts.headers["Sec-WebSocket-Extensions"] = format11({ [PerMessageDeflate.extensionName]: perMessageDeflate.offer() }); } if (protocols.length) { for (const protocol of protocols) { if (typeof protocol !== "string" || !subprotocolRegex.test(protocol) || protocolSet.has(protocol)) { throw new SyntaxError( "An invalid or duplicated subprotocol was specified" ); } protocolSet.add(protocol); } opts.headers["Sec-WebSocket-Protocol"] = protocols.join(","); } if (opts.origin) { if (opts.protocolVersion < 13) { opts.headers["Sec-WebSocket-Origin"] = opts.origin; } else { opts.headers.Origin = opts.origin; } } if (parsedUrl.username || parsedUrl.password) { opts.auth = `${parsedUrl.username}:${parsedUrl.password}`; } if (isIpcUrl) { const parts = opts.path.split(":"); opts.socketPath = parts[0]; opts.path = parts[1]; } let req; if (opts.followRedirects) { if (websocket._redirects === 0) { websocket._originalIpc = isIpcUrl; websocket._originalSecure = isSecure; websocket._originalHostOrSocketPath = isIpcUrl ? opts.socketPath : parsedUrl.host; const headers = options32 && options32.headers; options32 = { ...options32, headers: {} }; if (headers) { for (const [key2, value] of Object.entries(headers)) { options32.headers[key2.toLowerCase()] = value; } } } else if (websocket.listenerCount("redirect") === 0) { const isSameHost = isIpcUrl ? websocket._originalIpc ? opts.socketPath === websocket._originalHostOrSocketPath : false : websocket._originalIpc ? false : parsedUrl.host === websocket._originalHostOrSocketPath; if (!isSameHost || websocket._originalSecure && !isSecure) { delete opts.headers.authorization; delete opts.headers.cookie; if (!isSameHost) delete opts.headers.host; opts.auth = void 0; } } if (opts.auth && !options32.headers.authorization) { options32.headers.authorization = "Basic " + Buffer.from(opts.auth).toString("base64"); } req = websocket._req = request4(opts); if (websocket._redirects) { websocket.emit("redirect", websocket.url, req); } } else { req = websocket._req = request4(opts); } if (opts.timeout) { req.on("timeout", () => { abortHandshake(websocket, req, "Opening handshake has timed out"); }); } req.on("error", (err) => { if (req === null || req[kAborted]) return; req = websocket._req = null; emitErrorAndClose(websocket, err); }); req.on("response", (res) => { const location = res.headers.location; const statusCode = res.statusCode; if (location && opts.followRedirects && statusCode >= 300 && statusCode < 400) { if (++websocket._redirects > opts.maxRedirects) { abortHandshake(websocket, req, "Maximum redirects exceeded"); return; } req.abort(); let addr; try { addr = new URL7(location, address); } catch (e7) { const err = new SyntaxError(`Invalid URL: ${location}`); emitErrorAndClose(websocket, err); return; } initAsClient(websocket, addr, protocols, options32); } else if (!websocket.emit("unexpected-response", req, res)) { abortHandshake( websocket, req, `Unexpected server response: ${res.statusCode}` ); } }); req.on("upgrade", (res, socket, head) => { websocket.emit("upgrade", res); if (websocket.readyState !== WebSocket2.CONNECTING) return; req = websocket._req = null; const upgrade = res.headers.upgrade; if (upgrade === void 0 || upgrade.toLowerCase() !== "websocket") { abortHandshake(websocket, socket, "Invalid Upgrade header"); return; } const digest = createHash5("sha1").update(key + GUID).digest("base64"); if (res.headers["sec-websocket-accept"] !== digest) { abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header"); return; } const serverProt = res.headers["sec-websocket-protocol"]; let protError; if (serverProt !== void 0) { if (!protocolSet.size) { protError = "Server sent a subprotocol but none was requested"; } else if (!protocolSet.has(serverProt)) { protError = "Server sent an invalid subprotocol"; } } else if (protocolSet.size) { protError = "Server sent no subprotocol"; } if (protError) { abortHandshake(websocket, socket, protError); return; } if (serverProt) websocket._protocol = serverProt; const secWebSocketExtensions = res.headers["sec-websocket-extensions"]; if (secWebSocketExtensions !== void 0) { if (!perMessageDeflate) { const message = "Server sent a Sec-WebSocket-Extensions header but no extension was requested"; abortHandshake(websocket, socket, message); return; } let extensions; try { extensions = parse7(secWebSocketExtensions); } catch (err) { const message = "Invalid Sec-WebSocket-Extensions header"; abortHandshake(websocket, socket, message); return; } const extensionNames = Object.keys(extensions); if (extensionNames.length !== 1 || extensionNames[0] !== PerMessageDeflate.extensionName) { const message = "Server indicated an extension that was not requested"; abortHandshake(websocket, socket, message); return; } try { perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]); } catch (err) { const message = "Invalid Sec-WebSocket-Extensions header"; abortHandshake(websocket, socket, message); return; } websocket._extensions[PerMessageDeflate.extensionName] = perMessageDeflate; } websocket.setSocket(socket, head, { allowSynchronousEvents: opts.allowSynchronousEvents, generateMask: opts.generateMask, maxPayload: opts.maxPayload, skipUTF8Validation: opts.skipUTF8Validation }); }); if (opts.finishRequest) { opts.finishRequest(req, websocket); } else { req.end(); } } __name(initAsClient, "initAsClient"); function emitErrorAndClose(websocket, err) { websocket._readyState = WebSocket2.CLOSING; websocket._errorEmitted = true; websocket.emit("error", err); websocket.emitClose(); } __name(emitErrorAndClose, "emitErrorAndClose"); function netConnect(options32) { options32.path = options32.socketPath; return net2.connect(options32); } __name(netConnect, "netConnect"); function tlsConnect(options32) { options32.path = void 0; if (!options32.servername && options32.servername !== "") { options32.servername = net2.isIP(options32.host) ? "" : options32.host; } return tls.connect(options32); } __name(tlsConnect, "tlsConnect"); function abortHandshake(websocket, stream2, message) { websocket._readyState = WebSocket2.CLOSING; const err = new Error(message); Error.captureStackTrace(err, abortHandshake); if (stream2.setHeader) { stream2[kAborted] = true; stream2.abort(); if (stream2.socket && !stream2.socket.destroyed) { stream2.socket.destroy(); } process.nextTick(emitErrorAndClose, websocket, err); } else { stream2.destroy(err); stream2.once("error", websocket.emit.bind(websocket, "error")); stream2.once("close", websocket.emitClose.bind(websocket)); } } __name(abortHandshake, "abortHandshake"); function sendAfterClose(websocket, data, cb2) { if (data) { const length = isBlob3(data) ? data.size : toBuffer(data).length; if (websocket._socket) websocket._sender._bufferedBytes += length; else websocket._bufferedAmount += length; } if (cb2) { const err = new Error( `WebSocket is not open: readyState ${websocket.readyState} (${readyStates[websocket.readyState]})` ); process.nextTick(cb2, err); } } __name(sendAfterClose, "sendAfterClose"); function receiverOnConclude(code, reason) { const websocket = this[kWebSocket]; websocket._closeFrameReceived = true; websocket._closeMessage = reason; websocket._closeCode = code; if (websocket._socket[kWebSocket] === void 0) return; websocket._socket.removeListener("data", socketOnData); process.nextTick(resume, websocket._socket); if (code === 1005) websocket.close(); else websocket.close(code, reason); } __name(receiverOnConclude, "receiverOnConclude"); function receiverOnDrain() { const websocket = this[kWebSocket]; if (!websocket.isPaused) websocket._socket.resume(); } __name(receiverOnDrain, "receiverOnDrain"); function receiverOnError(err) { const websocket = this[kWebSocket]; if (websocket._socket[kWebSocket] !== void 0) { websocket._socket.removeListener("data", socketOnData); process.nextTick(resume, websocket._socket); websocket.close(err[kStatusCode]); } if (!websocket._errorEmitted) { websocket._errorEmitted = true; websocket.emit("error", err); } } __name(receiverOnError, "receiverOnError"); function receiverOnFinish() { this[kWebSocket].emitClose(); } __name(receiverOnFinish, "receiverOnFinish"); function receiverOnMessage(data, isBinary) { this[kWebSocket].emit("message", data, isBinary); } __name(receiverOnMessage, "receiverOnMessage"); function receiverOnPing(data) { const websocket = this[kWebSocket]; if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP); websocket.emit("ping", data); } __name(receiverOnPing, "receiverOnPing"); function receiverOnPong(data) { this[kWebSocket].emit("pong", data); } __name(receiverOnPong, "receiverOnPong"); function resume(stream2) { stream2.resume(); } __name(resume, "resume"); function senderOnError(err) { const websocket = this[kWebSocket]; if (websocket.readyState === WebSocket2.CLOSED) return; if (websocket.readyState === WebSocket2.OPEN) { websocket._readyState = WebSocket2.CLOSING; setCloseTimer(websocket); } this._socket.end(); if (!websocket._errorEmitted) { websocket._errorEmitted = true; websocket.emit("error", err); } } __name(senderOnError, "senderOnError"); function setCloseTimer(websocket) { websocket._closeTimer = setTimeout( websocket._socket.destroy.bind(websocket._socket), closeTimeout ); } __name(setCloseTimer, "setCloseTimer"); function socketOnClose() { const websocket = this[kWebSocket]; this.removeListener("close", socketOnClose); this.removeListener("data", socketOnData); this.removeListener("end", socketOnEnd); websocket._readyState = WebSocket2.CLOSING; let chunk; if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && (chunk = websocket._socket.read()) !== null) { websocket._receiver.write(chunk); } websocket._receiver.end(); this[kWebSocket] = void 0; clearTimeout(websocket._closeTimer); if (websocket._receiver._writableState.finished || websocket._receiver._writableState.errorEmitted) { websocket.emitClose(); } else { websocket._receiver.on("error", receiverOnFinish); websocket._receiver.on("finish", receiverOnFinish); } } __name(socketOnClose, "socketOnClose"); function socketOnData(chunk) { if (!this[kWebSocket]._receiver.write(chunk)) { this.pause(); } } __name(socketOnData, "socketOnData"); function socketOnEnd() { const websocket = this[kWebSocket]; websocket._readyState = WebSocket2.CLOSING; websocket._receiver.end(); this.end(); } __name(socketOnEnd, "socketOnEnd"); function socketOnError() { const websocket = this[kWebSocket]; this.removeListener("error", socketOnError); this.on("error", NOOP); if (websocket) { websocket._readyState = WebSocket2.CLOSING; this.destroy(); } } __name(socketOnError, "socketOnError"); } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/subprotocol.js var require_subprotocol = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/subprotocol.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { tokenChars } = require_validation(); function parse7(header) { const protocols = /* @__PURE__ */ new Set(); let start = -1; let end = -1; let i5 = 0; for (i5; i5 < header.length; i5++) { const code = header.charCodeAt(i5); if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i5; } else if (i5 !== 0 && (code === 32 || code === 9)) { if (end === -1 && start !== -1) end = i5; } else if (code === 44) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i5}`); } if (end === -1) end = i5; const protocol2 = header.slice(start, end); if (protocols.has(protocol2)) { throw new SyntaxError(`The "${protocol2}" subprotocol is duplicated`); } protocols.add(protocol2); start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i5}`); } } if (start === -1 || end !== -1) { throw new SyntaxError("Unexpected end of input"); } const protocol = header.slice(start, i5); if (protocols.has(protocol)) { throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`); } protocols.add(protocol); return protocols; } __name(parse7, "parse"); module3.exports = { parse: parse7 }; } }); // ../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/websocket-server.js var require_websocket_server = __commonJS({ "../../node_modules/.pnpm/ws@8.18.0/node_modules/ws/lib/websocket-server.js"(exports2, module3) { "use strict"; init_import_meta_url(); var EventEmitter5 = require("events"); var http5 = require("http"); var { Duplex } = require("stream"); var { createHash: createHash5 } = require("crypto"); var extension = require_extension(); var PerMessageDeflate = require_permessage_deflate(); var subprotocol = require_subprotocol(); var WebSocket2 = require_websocket2(); var { GUID, kWebSocket } = require_constants6(); var keyRegex = /^[+/0-9A-Za-z]{22}==$/; var RUNNING = 0; var CLOSING = 1; var CLOSED = 2; var WebSocketServer2 = class extends EventEmitter5 { /** * Create a `WebSocketServer` instance. * * @param {Object} options Configuration options * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted * multiple times in the same tick * @param {Boolean} [options.autoPong=true] Specifies whether or not to * automatically send a pong in response to a ping * @param {Number} [options.backlog=511] The maximum length of the queue of * pending connections * @param {Boolean} [options.clientTracking=true] Specifies whether or not to * track clients * @param {Function} [options.handleProtocols] A hook to handle protocols * @param {String} [options.host] The hostname where to bind the server * @param {Number} [options.maxPayload=104857600] The maximum allowed message * size * @param {Boolean} [options.noServer=false] Enable no server mode * @param {String} [options.path] Accept only connections matching this path * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable * permessage-deflate * @param {Number} [options.port] The port where to bind the server * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S * server to use * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or * not to skip UTF-8 validation for text and close messages * @param {Function} [options.verifyClient] A hook to reject connections * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket` * class to use. It must be the `WebSocket` class or class that extends it * @param {Function} [callback] A listener for the `listening` event */ constructor(options32, callback) { super(); options32 = { allowSynchronousEvents: true, autoPong: true, maxPayload: 100 * 1024 * 1024, skipUTF8Validation: false, perMessageDeflate: false, handleProtocols: null, clientTracking: true, verifyClient: null, noServer: false, backlog: null, // use default (511 as implemented in net.js) server: null, host: null, path: null, port: null, WebSocket: WebSocket2, ...options32 }; if (options32.port == null && !options32.server && !options32.noServer || options32.port != null && (options32.server || options32.noServer) || options32.server && options32.noServer) { throw new TypeError( 'One and only one of the "port", "server", or "noServer" options must be specified' ); } if (options32.port != null) { this._server = http5.createServer((req, res) => { const body = http5.STATUS_CODES[426]; res.writeHead(426, { "Content-Length": body.length, "Content-Type": "text/plain" }); res.end(body); }); this._server.listen( options32.port, options32.host, options32.backlog, callback ); } else if (options32.server) { this._server = options32.server; } if (this._server) { const emitConnection = this.emit.bind(this, "connection"); this._removeListeners = addListeners(this._server, { listening: this.emit.bind(this, "listening"), error: this.emit.bind(this, "error"), upgrade: (req, socket, head) => { this.handleUpgrade(req, socket, head, emitConnection); } }); } if (options32.perMessageDeflate === true) options32.perMessageDeflate = {}; if (options32.clientTracking) { this.clients = /* @__PURE__ */ new Set(); this._shouldEmitClose = false; } this.options = options32; this._state = RUNNING; } /** * Returns the bound address, the address family name, and port of the server * as reported by the operating system if listening on an IP socket. * If the server is listening on a pipe or UNIX domain socket, the name is * returned as a string. * * @return {(Object|String|null)} The address of the server * @public */ address() { if (this.options.noServer) { throw new Error('The server is operating in "noServer" mode'); } if (!this._server) return null; return this._server.address(); } /** * Stop the server from accepting new connections and emit the `'close'` event * when all existing connections are closed. * * @param {Function} [cb] A one-time listener for the `'close'` event * @public */ close(cb2) { if (this._state === CLOSED) { if (cb2) { this.once("close", () => { cb2(new Error("The server is not running")); }); } process.nextTick(emitClose, this); return; } if (cb2) this.once("close", cb2); if (this._state === CLOSING) return; this._state = CLOSING; if (this.options.noServer || this.options.server) { if (this._server) { this._removeListeners(); this._removeListeners = this._server = null; } if (this.clients) { if (!this.clients.size) { process.nextTick(emitClose, this); } else { this._shouldEmitClose = true; } } else { process.nextTick(emitClose, this); } } else { const server = this._server; this._removeListeners(); this._removeListeners = this._server = null; server.close(() => { emitClose(this); }); } } /** * See if a given request should be handled by this server instance. * * @param {http.IncomingMessage} req Request object to inspect * @return {Boolean} `true` if the request is valid, else `false` * @public */ shouldHandle(req) { if (this.options.path) { const index = req.url.indexOf("?"); const pathname = index !== -1 ? req.url.slice(0, index) : req.url; if (pathname !== this.options.path) return false; } return true; } /** * Handle a HTTP Upgrade request. * * @param {http.IncomingMessage} req The request object * @param {Duplex} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Function} cb Callback * @public */ handleUpgrade(req, socket, head, cb2) { socket.on("error", socketOnError); const key = req.headers["sec-websocket-key"]; const upgrade = req.headers.upgrade; const version4 = +req.headers["sec-websocket-version"]; if (req.method !== "GET") { const message = "Invalid HTTP method"; abortHandshakeOrEmitwsClientError(this, req, socket, 405, message); return; } if (upgrade === void 0 || upgrade.toLowerCase() !== "websocket") { const message = "Invalid Upgrade header"; abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); return; } if (key === void 0 || !keyRegex.test(key)) { const message = "Missing or invalid Sec-WebSocket-Key header"; abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); return; } if (version4 !== 8 && version4 !== 13) { const message = "Missing or invalid Sec-WebSocket-Version header"; abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); return; } if (!this.shouldHandle(req)) { abortHandshake(socket, 400); return; } const secWebSocketProtocol = req.headers["sec-websocket-protocol"]; let protocols = /* @__PURE__ */ new Set(); if (secWebSocketProtocol !== void 0) { try { protocols = subprotocol.parse(secWebSocketProtocol); } catch (err) { const message = "Invalid Sec-WebSocket-Protocol header"; abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); return; } } const secWebSocketExtensions = req.headers["sec-websocket-extensions"]; const extensions = {}; if (this.options.perMessageDeflate && secWebSocketExtensions !== void 0) { const perMessageDeflate = new PerMessageDeflate( this.options.perMessageDeflate, true, this.options.maxPayload ); try { const offers = extension.parse(secWebSocketExtensions); if (offers[PerMessageDeflate.extensionName]) { perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]); extensions[PerMessageDeflate.extensionName] = perMessageDeflate; } } catch (err) { const message = "Invalid or unacceptable Sec-WebSocket-Extensions header"; abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); return; } } if (this.options.verifyClient) { const info = { origin: req.headers[`${version4 === 8 ? "sec-websocket-origin" : "origin"}`], secure: !!(req.socket.authorized || req.socket.encrypted), req }; if (this.options.verifyClient.length === 2) { this.options.verifyClient(info, (verified, code, message, headers) => { if (!verified) { return abortHandshake(socket, code || 401, message, headers); } this.completeUpgrade( extensions, key, protocols, req, socket, head, cb2 ); }); return; } if (!this.options.verifyClient(info)) return abortHandshake(socket, 401); } this.completeUpgrade(extensions, key, protocols, req, socket, head, cb2); } /** * Upgrade the connection to WebSocket. * * @param {Object} extensions The accepted extensions * @param {String} key The value of the `Sec-WebSocket-Key` header * @param {Set} protocols The subprotocols * @param {http.IncomingMessage} req The request object * @param {Duplex} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Function} cb Callback * @throws {Error} If called more than once with the same socket * @private */ completeUpgrade(extensions, key, protocols, req, socket, head, cb2) { if (!socket.readable || !socket.writable) return socket.destroy(); if (socket[kWebSocket]) { throw new Error( "server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration" ); } if (this._state > RUNNING) return abortHandshake(socket, 503); const digest = createHash5("sha1").update(key + GUID).digest("base64"); const headers = [ "HTTP/1.1 101 Switching Protocols", "Upgrade: websocket", "Connection: Upgrade", `Sec-WebSocket-Accept: ${digest}` ]; const ws = new this.options.WebSocket(null, void 0, this.options); if (protocols.size) { const protocol = this.options.handleProtocols ? this.options.handleProtocols(protocols, req) : protocols.values().next().value; if (protocol) { headers.push(`Sec-WebSocket-Protocol: ${protocol}`); ws._protocol = protocol; } } if (extensions[PerMessageDeflate.extensionName]) { const params = extensions[PerMessageDeflate.extensionName].params; const value = extension.format({ [PerMessageDeflate.extensionName]: [params] }); headers.push(`Sec-WebSocket-Extensions: ${value}`); ws._extensions = extensions; } this.emit("headers", headers, req); socket.write(headers.concat("\r\n").join("\r\n")); socket.removeListener("error", socketOnError); ws.setSocket(socket, head, { allowSynchronousEvents: this.options.allowSynchronousEvents, maxPayload: this.options.maxPayload, skipUTF8Validation: this.options.skipUTF8Validation }); if (this.clients) { this.clients.add(ws); ws.on("close", () => { this.clients.delete(ws); if (this._shouldEmitClose && !this.clients.size) { process.nextTick(emitClose, this); } }); } cb2(ws, req); } }; __name(WebSocketServer2, "WebSocketServer"); module3.exports = WebSocketServer2; function addListeners(server, map2) { for (const event of Object.keys(map2)) server.on(event, map2[event]); return /* @__PURE__ */ __name(function removeListeners() { for (const event of Object.keys(map2)) { server.removeListener(event, map2[event]); } }, "removeListeners"); } __name(addListeners, "addListeners"); function emitClose(server) { server._state = CLOSED; server.emit("close"); } __name(emitClose, "emitClose"); function socketOnError() { this.destroy(); } __name(socketOnError, "socketOnError"); function abortHandshake(socket, code, message, headers) { message = message || http5.STATUS_CODES[code]; headers = { Connection: "close", "Content-Type": "text/html", "Content-Length": Buffer.byteLength(message), ...headers }; socket.once("finish", socket.destroy); socket.end( `HTTP/1.1 ${code} ${http5.STATUS_CODES[code]}\r ` + Object.keys(headers).map((h6) => `${h6}: ${headers[h6]}`).join("\r\n") + "\r\n\r\n" + message ); } __name(abortHandshake, "abortHandshake"); function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) { if (server.listenerCount("wsClientError")) { const err = new Error(message); Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError); server.emit("wsClientError", err, socket, req); } else { abortHandshake(socket, code, message); } } __name(abortHandshakeOrEmitwsClientError, "abortHandshakeOrEmitwsClientError"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/forge.js var require_forge = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/forge.js"(exports2, module3) { init_import_meta_url(); module3.exports = { // default options options: { usePureJavaScript: false } }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/baseN.js var require_baseN = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/baseN.js"(exports2, module3) { init_import_meta_url(); var api = {}; module3.exports = api; var _reverseAlphabets = {}; api.encode = function(input, alphabet, maxline) { if (typeof alphabet !== "string") { throw new TypeError('"alphabet" must be a string.'); } if (maxline !== void 0 && typeof maxline !== "number") { throw new TypeError('"maxline" must be a number.'); } var output = ""; if (!(input instanceof Uint8Array)) { output = _encodeWithByteBuffer(input, alphabet); } else { var i5 = 0; var base = alphabet.length; var first = alphabet.charAt(0); var digits = [0]; for (i5 = 0; i5 < input.length; ++i5) { for (var j6 = 0, carry = input[i5]; j6 < digits.length; ++j6) { carry += digits[j6] << 8; digits[j6] = carry % base; carry = carry / base | 0; } while (carry > 0) { digits.push(carry % base); carry = carry / base | 0; } } for (i5 = 0; input[i5] === 0 && i5 < input.length - 1; ++i5) { output += first; } for (i5 = digits.length - 1; i5 >= 0; --i5) { output += alphabet[digits[i5]]; } } if (maxline) { var regex2 = new RegExp(".{1," + maxline + "}", "g"); output = output.match(regex2).join("\r\n"); } return output; }; api.decode = function(input, alphabet) { if (typeof input !== "string") { throw new TypeError('"input" must be a string.'); } if (typeof alphabet !== "string") { throw new TypeError('"alphabet" must be a string.'); } var table = _reverseAlphabets[alphabet]; if (!table) { table = _reverseAlphabets[alphabet] = []; for (var i5 = 0; i5 < alphabet.length; ++i5) { table[alphabet.charCodeAt(i5)] = i5; } } input = input.replace(/\s/g, ""); var base = alphabet.length; var first = alphabet.charAt(0); var bytes = [0]; for (var i5 = 0; i5 < input.length; i5++) { var value = table[input.charCodeAt(i5)]; if (value === void 0) { return; } for (var j6 = 0, carry = value; j6 < bytes.length; ++j6) { carry += bytes[j6] * base; bytes[j6] = carry & 255; carry >>= 8; } while (carry > 0) { bytes.push(carry & 255); carry >>= 8; } } for (var k6 = 0; input[k6] === first && k6 < input.length - 1; ++k6) { bytes.push(0); } if (typeof Buffer !== "undefined") { return Buffer.from(bytes.reverse()); } return new Uint8Array(bytes.reverse()); }; function _encodeWithByteBuffer(input, alphabet) { var i5 = 0; var base = alphabet.length; var first = alphabet.charAt(0); var digits = [0]; for (i5 = 0; i5 < input.length(); ++i5) { for (var j6 = 0, carry = input.at(i5); j6 < digits.length; ++j6) { carry += digits[j6] << 8; digits[j6] = carry % base; carry = carry / base | 0; } while (carry > 0) { digits.push(carry % base); carry = carry / base | 0; } } var output = ""; for (i5 = 0; input.at(i5) === 0 && i5 < input.length() - 1; ++i5) { output += first; } for (i5 = digits.length - 1; i5 >= 0; --i5) { output += alphabet[digits[i5]]; } return output; } __name(_encodeWithByteBuffer, "_encodeWithByteBuffer"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/util.js var require_util10 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/util.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); var baseN = require_baseN(); var util5 = module3.exports = forge.util = forge.util || {}; (function() { if (typeof process !== "undefined" && process.nextTick && !process.browser) { util5.nextTick = process.nextTick; if (typeof setImmediate === "function") { util5.setImmediate = setImmediate; } else { util5.setImmediate = util5.nextTick; } return; } if (typeof setImmediate === "function") { util5.setImmediate = function() { return setImmediate.apply(void 0, arguments); }; util5.nextTick = function(callback) { return setImmediate(callback); }; return; } util5.setImmediate = function(callback) { setTimeout(callback, 0); }; if (typeof window !== "undefined" && typeof window.postMessage === "function") { let handler32 = function(event) { if (event.source === window && event.data === msg) { event.stopPropagation(); var copy = callbacks.slice(); callbacks.length = 0; copy.forEach(function(callback) { callback(); }); } }; var handler31 = handler32; __name(handler32, "handler"); var msg = "forge.setImmediate"; var callbacks = []; util5.setImmediate = function(callback) { callbacks.push(callback); if (callbacks.length === 1) { window.postMessage(msg, "*"); } }; window.addEventListener("message", handler32, true); } if (typeof MutationObserver !== "undefined") { var now = Date.now(); var attr = true; var div = document.createElement("div"); var callbacks = []; new MutationObserver(function() { var copy = callbacks.slice(); callbacks.length = 0; copy.forEach(function(callback) { callback(); }); }).observe(div, { attributes: true }); var oldSetImmediate = util5.setImmediate; util5.setImmediate = function(callback) { if (Date.now() - now > 15) { now = Date.now(); oldSetImmediate(callback); } else { callbacks.push(callback); if (callbacks.length === 1) { div.setAttribute("a", attr = !attr); } } }; } util5.nextTick = util5.setImmediate; })(); util5.isNodejs = typeof process !== "undefined" && process.versions && process.versions.node; util5.globalScope = function() { if (util5.isNodejs) { return global; } return typeof self === "undefined" ? window : self; }(); util5.isArray = Array.isArray || function(x6) { return Object.prototype.toString.call(x6) === "[object Array]"; }; util5.isArrayBuffer = function(x6) { return typeof ArrayBuffer !== "undefined" && x6 instanceof ArrayBuffer; }; util5.isArrayBufferView = function(x6) { return x6 && util5.isArrayBuffer(x6.buffer) && x6.byteLength !== void 0; }; function _checkBitsParam(n6) { if (!(n6 === 8 || n6 === 16 || n6 === 24 || n6 === 32)) { throw new Error("Only 8, 16, 24, or 32 bits supported: " + n6); } } __name(_checkBitsParam, "_checkBitsParam"); util5.ByteBuffer = ByteStringBuffer; function ByteStringBuffer(b6) { this.data = ""; this.read = 0; if (typeof b6 === "string") { this.data = b6; } else if (util5.isArrayBuffer(b6) || util5.isArrayBufferView(b6)) { if (typeof Buffer !== "undefined" && b6 instanceof Buffer) { this.data = b6.toString("binary"); } else { var arr = new Uint8Array(b6); try { this.data = String.fromCharCode.apply(null, arr); } catch (e7) { for (var i5 = 0; i5 < arr.length; ++i5) { this.putByte(arr[i5]); } } } } else if (b6 instanceof ByteStringBuffer || typeof b6 === "object" && typeof b6.data === "string" && typeof b6.read === "number") { this.data = b6.data; this.read = b6.read; } this._constructedStringLength = 0; } __name(ByteStringBuffer, "ByteStringBuffer"); util5.ByteStringBuffer = ByteStringBuffer; var _MAX_CONSTRUCTED_STRING_LENGTH = 4096; util5.ByteStringBuffer.prototype._optimizeConstructedString = function(x6) { this._constructedStringLength += x6; if (this._constructedStringLength > _MAX_CONSTRUCTED_STRING_LENGTH) { this.data.substr(0, 1); this._constructedStringLength = 0; } }; util5.ByteStringBuffer.prototype.length = function() { return this.data.length - this.read; }; util5.ByteStringBuffer.prototype.isEmpty = function() { return this.length() <= 0; }; util5.ByteStringBuffer.prototype.putByte = function(b6) { return this.putBytes(String.fromCharCode(b6)); }; util5.ByteStringBuffer.prototype.fillWithByte = function(b6, n6) { b6 = String.fromCharCode(b6); var d6 = this.data; while (n6 > 0) { if (n6 & 1) { d6 += b6; } n6 >>>= 1; if (n6 > 0) { b6 += b6; } } this.data = d6; this._optimizeConstructedString(n6); return this; }; util5.ByteStringBuffer.prototype.putBytes = function(bytes) { this.data += bytes; this._optimizeConstructedString(bytes.length); return this; }; util5.ByteStringBuffer.prototype.putString = function(str) { return this.putBytes(util5.encodeUtf8(str)); }; util5.ByteStringBuffer.prototype.putInt16 = function(i5) { return this.putBytes( String.fromCharCode(i5 >> 8 & 255) + String.fromCharCode(i5 & 255) ); }; util5.ByteStringBuffer.prototype.putInt24 = function(i5) { return this.putBytes( String.fromCharCode(i5 >> 16 & 255) + String.fromCharCode(i5 >> 8 & 255) + String.fromCharCode(i5 & 255) ); }; util5.ByteStringBuffer.prototype.putInt32 = function(i5) { return this.putBytes( String.fromCharCode(i5 >> 24 & 255) + String.fromCharCode(i5 >> 16 & 255) + String.fromCharCode(i5 >> 8 & 255) + String.fromCharCode(i5 & 255) ); }; util5.ByteStringBuffer.prototype.putInt16Le = function(i5) { return this.putBytes( String.fromCharCode(i5 & 255) + String.fromCharCode(i5 >> 8 & 255) ); }; util5.ByteStringBuffer.prototype.putInt24Le = function(i5) { return this.putBytes( String.fromCharCode(i5 & 255) + String.fromCharCode(i5 >> 8 & 255) + String.fromCharCode(i5 >> 16 & 255) ); }; util5.ByteStringBuffer.prototype.putInt32Le = function(i5) { return this.putBytes( String.fromCharCode(i5 & 255) + String.fromCharCode(i5 >> 8 & 255) + String.fromCharCode(i5 >> 16 & 255) + String.fromCharCode(i5 >> 24 & 255) ); }; util5.ByteStringBuffer.prototype.putInt = function(i5, n6) { _checkBitsParam(n6); var bytes = ""; do { n6 -= 8; bytes += String.fromCharCode(i5 >> n6 & 255); } while (n6 > 0); return this.putBytes(bytes); }; util5.ByteStringBuffer.prototype.putSignedInt = function(i5, n6) { if (i5 < 0) { i5 += 2 << n6 - 1; } return this.putInt(i5, n6); }; util5.ByteStringBuffer.prototype.putBuffer = function(buffer) { return this.putBytes(buffer.getBytes()); }; util5.ByteStringBuffer.prototype.getByte = function() { return this.data.charCodeAt(this.read++); }; util5.ByteStringBuffer.prototype.getInt16 = function() { var rval = this.data.charCodeAt(this.read) << 8 ^ this.data.charCodeAt(this.read + 1); this.read += 2; return rval; }; util5.ByteStringBuffer.prototype.getInt24 = function() { var rval = this.data.charCodeAt(this.read) << 16 ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2); this.read += 3; return rval; }; util5.ByteStringBuffer.prototype.getInt32 = function() { var rval = this.data.charCodeAt(this.read) << 24 ^ this.data.charCodeAt(this.read + 1) << 16 ^ this.data.charCodeAt(this.read + 2) << 8 ^ this.data.charCodeAt(this.read + 3); this.read += 4; return rval; }; util5.ByteStringBuffer.prototype.getInt16Le = function() { var rval = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8; this.read += 2; return rval; }; util5.ByteStringBuffer.prototype.getInt24Le = function() { var rval = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2) << 16; this.read += 3; return rval; }; util5.ByteStringBuffer.prototype.getInt32Le = function() { var rval = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2) << 16 ^ this.data.charCodeAt(this.read + 3) << 24; this.read += 4; return rval; }; util5.ByteStringBuffer.prototype.getInt = function(n6) { _checkBitsParam(n6); var rval = 0; do { rval = (rval << 8) + this.data.charCodeAt(this.read++); n6 -= 8; } while (n6 > 0); return rval; }; util5.ByteStringBuffer.prototype.getSignedInt = function(n6) { var x6 = this.getInt(n6); var max = 2 << n6 - 2; if (x6 >= max) { x6 -= max << 1; } return x6; }; util5.ByteStringBuffer.prototype.getBytes = function(count) { var rval; if (count) { count = Math.min(this.length(), count); rval = this.data.slice(this.read, this.read + count); this.read += count; } else if (count === 0) { rval = ""; } else { rval = this.read === 0 ? this.data : this.data.slice(this.read); this.clear(); } return rval; }; util5.ByteStringBuffer.prototype.bytes = function(count) { return typeof count === "undefined" ? this.data.slice(this.read) : this.data.slice(this.read, this.read + count); }; util5.ByteStringBuffer.prototype.at = function(i5) { return this.data.charCodeAt(this.read + i5); }; util5.ByteStringBuffer.prototype.setAt = function(i5, b6) { this.data = this.data.substr(0, this.read + i5) + String.fromCharCode(b6) + this.data.substr(this.read + i5 + 1); return this; }; util5.ByteStringBuffer.prototype.last = function() { return this.data.charCodeAt(this.data.length - 1); }; util5.ByteStringBuffer.prototype.copy = function() { var c6 = util5.createBuffer(this.data); c6.read = this.read; return c6; }; util5.ByteStringBuffer.prototype.compact = function() { if (this.read > 0) { this.data = this.data.slice(this.read); this.read = 0; } return this; }; util5.ByteStringBuffer.prototype.clear = function() { this.data = ""; this.read = 0; return this; }; util5.ByteStringBuffer.prototype.truncate = function(count) { var len = Math.max(0, this.length() - count); this.data = this.data.substr(this.read, len); this.read = 0; return this; }; util5.ByteStringBuffer.prototype.toHex = function() { var rval = ""; for (var i5 = this.read; i5 < this.data.length; ++i5) { var b6 = this.data.charCodeAt(i5); if (b6 < 16) { rval += "0"; } rval += b6.toString(16); } return rval; }; util5.ByteStringBuffer.prototype.toString = function() { return util5.decodeUtf8(this.bytes()); }; function DataBuffer(b6, options32) { options32 = options32 || {}; this.read = options32.readOffset || 0; this.growSize = options32.growSize || 1024; var isArrayBuffer3 = util5.isArrayBuffer(b6); var isArrayBufferView = util5.isArrayBufferView(b6); if (isArrayBuffer3 || isArrayBufferView) { if (isArrayBuffer3) { this.data = new DataView(b6); } else { this.data = new DataView(b6.buffer, b6.byteOffset, b6.byteLength); } this.write = "writeOffset" in options32 ? options32.writeOffset : this.data.byteLength; return; } this.data = new DataView(new ArrayBuffer(0)); this.write = 0; if (b6 !== null && b6 !== void 0) { this.putBytes(b6); } if ("writeOffset" in options32) { this.write = options32.writeOffset; } } __name(DataBuffer, "DataBuffer"); util5.DataBuffer = DataBuffer; util5.DataBuffer.prototype.length = function() { return this.write - this.read; }; util5.DataBuffer.prototype.isEmpty = function() { return this.length() <= 0; }; util5.DataBuffer.prototype.accommodate = function(amount, growSize) { if (this.length() >= amount) { return this; } growSize = Math.max(growSize || this.growSize, amount); var src = new Uint8Array( this.data.buffer, this.data.byteOffset, this.data.byteLength ); var dst = new Uint8Array(this.length() + growSize); dst.set(src); this.data = new DataView(dst.buffer); return this; }; util5.DataBuffer.prototype.putByte = function(b6) { this.accommodate(1); this.data.setUint8(this.write++, b6); return this; }; util5.DataBuffer.prototype.fillWithByte = function(b6, n6) { this.accommodate(n6); for (var i5 = 0; i5 < n6; ++i5) { this.data.setUint8(b6); } return this; }; util5.DataBuffer.prototype.putBytes = function(bytes, encoding) { if (util5.isArrayBufferView(bytes)) { var src = new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength); var len = src.byteLength - src.byteOffset; this.accommodate(len); var dst = new Uint8Array(this.data.buffer, this.write); dst.set(src); this.write += len; return this; } if (util5.isArrayBuffer(bytes)) { var src = new Uint8Array(bytes); this.accommodate(src.byteLength); var dst = new Uint8Array(this.data.buffer); dst.set(src, this.write); this.write += src.byteLength; return this; } if (bytes instanceof util5.DataBuffer || typeof bytes === "object" && typeof bytes.read === "number" && typeof bytes.write === "number" && util5.isArrayBufferView(bytes.data)) { var src = new Uint8Array(bytes.data.byteLength, bytes.read, bytes.length()); this.accommodate(src.byteLength); var dst = new Uint8Array(bytes.data.byteLength, this.write); dst.set(src); this.write += src.byteLength; return this; } if (bytes instanceof util5.ByteStringBuffer) { bytes = bytes.data; encoding = "binary"; } encoding = encoding || "binary"; if (typeof bytes === "string") { var view; if (encoding === "hex") { this.accommodate(Math.ceil(bytes.length / 2)); view = new Uint8Array(this.data.buffer, this.write); this.write += util5.binary.hex.decode(bytes, view, this.write); return this; } if (encoding === "base64") { this.accommodate(Math.ceil(bytes.length / 4) * 3); view = new Uint8Array(this.data.buffer, this.write); this.write += util5.binary.base64.decode(bytes, view, this.write); return this; } if (encoding === "utf8") { bytes = util5.encodeUtf8(bytes); encoding = "binary"; } if (encoding === "binary" || encoding === "raw") { this.accommodate(bytes.length); view = new Uint8Array(this.data.buffer, this.write); this.write += util5.binary.raw.decode(view); return this; } if (encoding === "utf16") { this.accommodate(bytes.length * 2); view = new Uint16Array(this.data.buffer, this.write); this.write += util5.text.utf16.encode(view); return this; } throw new Error("Invalid encoding: " + encoding); } throw Error("Invalid parameter: " + bytes); }; util5.DataBuffer.prototype.putBuffer = function(buffer) { this.putBytes(buffer); buffer.clear(); return this; }; util5.DataBuffer.prototype.putString = function(str) { return this.putBytes(str, "utf16"); }; util5.DataBuffer.prototype.putInt16 = function(i5) { this.accommodate(2); this.data.setInt16(this.write, i5); this.write += 2; return this; }; util5.DataBuffer.prototype.putInt24 = function(i5) { this.accommodate(3); this.data.setInt16(this.write, i5 >> 8 & 65535); this.data.setInt8(this.write, i5 >> 16 & 255); this.write += 3; return this; }; util5.DataBuffer.prototype.putInt32 = function(i5) { this.accommodate(4); this.data.setInt32(this.write, i5); this.write += 4; return this; }; util5.DataBuffer.prototype.putInt16Le = function(i5) { this.accommodate(2); this.data.setInt16(this.write, i5, true); this.write += 2; return this; }; util5.DataBuffer.prototype.putInt24Le = function(i5) { this.accommodate(3); this.data.setInt8(this.write, i5 >> 16 & 255); this.data.setInt16(this.write, i5 >> 8 & 65535, true); this.write += 3; return this; }; util5.DataBuffer.prototype.putInt32Le = function(i5) { this.accommodate(4); this.data.setInt32(this.write, i5, true); this.write += 4; return this; }; util5.DataBuffer.prototype.putInt = function(i5, n6) { _checkBitsParam(n6); this.accommodate(n6 / 8); do { n6 -= 8; this.data.setInt8(this.write++, i5 >> n6 & 255); } while (n6 > 0); return this; }; util5.DataBuffer.prototype.putSignedInt = function(i5, n6) { _checkBitsParam(n6); this.accommodate(n6 / 8); if (i5 < 0) { i5 += 2 << n6 - 1; } return this.putInt(i5, n6); }; util5.DataBuffer.prototype.getByte = function() { return this.data.getInt8(this.read++); }; util5.DataBuffer.prototype.getInt16 = function() { var rval = this.data.getInt16(this.read); this.read += 2; return rval; }; util5.DataBuffer.prototype.getInt24 = function() { var rval = this.data.getInt16(this.read) << 8 ^ this.data.getInt8(this.read + 2); this.read += 3; return rval; }; util5.DataBuffer.prototype.getInt32 = function() { var rval = this.data.getInt32(this.read); this.read += 4; return rval; }; util5.DataBuffer.prototype.getInt16Le = function() { var rval = this.data.getInt16(this.read, true); this.read += 2; return rval; }; util5.DataBuffer.prototype.getInt24Le = function() { var rval = this.data.getInt8(this.read) ^ this.data.getInt16(this.read + 1, true) << 8; this.read += 3; return rval; }; util5.DataBuffer.prototype.getInt32Le = function() { var rval = this.data.getInt32(this.read, true); this.read += 4; return rval; }; util5.DataBuffer.prototype.getInt = function(n6) { _checkBitsParam(n6); var rval = 0; do { rval = (rval << 8) + this.data.getInt8(this.read++); n6 -= 8; } while (n6 > 0); return rval; }; util5.DataBuffer.prototype.getSignedInt = function(n6) { var x6 = this.getInt(n6); var max = 2 << n6 - 2; if (x6 >= max) { x6 -= max << 1; } return x6; }; util5.DataBuffer.prototype.getBytes = function(count) { var rval; if (count) { count = Math.min(this.length(), count); rval = this.data.slice(this.read, this.read + count); this.read += count; } else if (count === 0) { rval = ""; } else { rval = this.read === 0 ? this.data : this.data.slice(this.read); this.clear(); } return rval; }; util5.DataBuffer.prototype.bytes = function(count) { return typeof count === "undefined" ? this.data.slice(this.read) : this.data.slice(this.read, this.read + count); }; util5.DataBuffer.prototype.at = function(i5) { return this.data.getUint8(this.read + i5); }; util5.DataBuffer.prototype.setAt = function(i5, b6) { this.data.setUint8(i5, b6); return this; }; util5.DataBuffer.prototype.last = function() { return this.data.getUint8(this.write - 1); }; util5.DataBuffer.prototype.copy = function() { return new util5.DataBuffer(this); }; util5.DataBuffer.prototype.compact = function() { if (this.read > 0) { var src = new Uint8Array(this.data.buffer, this.read); var dst = new Uint8Array(src.byteLength); dst.set(src); this.data = new DataView(dst); this.write -= this.read; this.read = 0; } return this; }; util5.DataBuffer.prototype.clear = function() { this.data = new DataView(new ArrayBuffer(0)); this.read = this.write = 0; return this; }; util5.DataBuffer.prototype.truncate = function(count) { this.write = Math.max(0, this.length() - count); this.read = Math.min(this.read, this.write); return this; }; util5.DataBuffer.prototype.toHex = function() { var rval = ""; for (var i5 = this.read; i5 < this.data.byteLength; ++i5) { var b6 = this.data.getUint8(i5); if (b6 < 16) { rval += "0"; } rval += b6.toString(16); } return rval; }; util5.DataBuffer.prototype.toString = function(encoding) { var view = new Uint8Array(this.data, this.read, this.length()); encoding = encoding || "utf8"; if (encoding === "binary" || encoding === "raw") { return util5.binary.raw.encode(view); } if (encoding === "hex") { return util5.binary.hex.encode(view); } if (encoding === "base64") { return util5.binary.base64.encode(view); } if (encoding === "utf8") { return util5.text.utf8.decode(view); } if (encoding === "utf16") { return util5.text.utf16.decode(view); } throw new Error("Invalid encoding: " + encoding); }; util5.createBuffer = function(input, encoding) { encoding = encoding || "raw"; if (input !== void 0 && encoding === "utf8") { input = util5.encodeUtf8(input); } return new util5.ByteBuffer(input); }; util5.fillString = function(c6, n6) { var s5 = ""; while (n6 > 0) { if (n6 & 1) { s5 += c6; } n6 >>>= 1; if (n6 > 0) { c6 += c6; } } return s5; }; util5.xorBytes = function(s1, s22, n6) { var s32 = ""; var b6 = ""; var t7 = ""; var i5 = 0; var c6 = 0; for (; n6 > 0; --n6, ++i5) { b6 = s1.charCodeAt(i5) ^ s22.charCodeAt(i5); if (c6 >= 10) { s32 += t7; t7 = ""; c6 = 0; } t7 += String.fromCharCode(b6); ++c6; } s32 += t7; return s32; }; util5.hexToBytes = function(hex) { var rval = ""; var i5 = 0; if (hex.length & true) { i5 = 1; rval += String.fromCharCode(parseInt(hex[0], 16)); } for (; i5 < hex.length; i5 += 2) { rval += String.fromCharCode(parseInt(hex.substr(i5, 2), 16)); } return rval; }; util5.bytesToHex = function(bytes) { return util5.createBuffer(bytes).toHex(); }; util5.int32ToBytes = function(i5) { return String.fromCharCode(i5 >> 24 & 255) + String.fromCharCode(i5 >> 16 & 255) + String.fromCharCode(i5 >> 8 & 255) + String.fromCharCode(i5 & 255); }; var _base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var _base64Idx = [ /*43 -43 = 0*/ /*'+', 1, 2, 3,'/' */ 62, -1, -1, -1, 63, /*'0','1','2','3','4','5','6','7','8','9' */ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, /*15, 16, 17,'=', 19, 20, 21 */ -1, -1, -1, 64, -1, -1, -1, /*65 - 43 = 22*/ /*'A','B','C','D','E','F','G','H','I','J','K','L','M', */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, /*'N','O','P','Q','R','S','T','U','V','W','X','Y','Z' */ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, /*91 - 43 = 48 */ /*48, 49, 50, 51, 52, 53 */ -1, -1, -1, -1, -1, -1, /*97 - 43 = 54*/ /*'a','b','c','d','e','f','g','h','i','j','k','l','m' */ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, /*'n','o','p','q','r','s','t','u','v','w','x','y','z' */ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 ]; var _base58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; util5.encode64 = function(input, maxline) { var line = ""; var output = ""; var chr1, chr2, chr3; var i5 = 0; while (i5 < input.length) { chr1 = input.charCodeAt(i5++); chr2 = input.charCodeAt(i5++); chr3 = input.charCodeAt(i5++); line += _base64.charAt(chr1 >> 2); line += _base64.charAt((chr1 & 3) << 4 | chr2 >> 4); if (isNaN(chr2)) { line += "=="; } else { line += _base64.charAt((chr2 & 15) << 2 | chr3 >> 6); line += isNaN(chr3) ? "=" : _base64.charAt(chr3 & 63); } if (maxline && line.length > maxline) { output += line.substr(0, maxline) + "\r\n"; line = line.substr(maxline); } } output += line; return output; }; util5.decode64 = function(input) { input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); var output = ""; var enc1, enc2, enc3, enc4; var i5 = 0; while (i5 < input.length) { enc1 = _base64Idx[input.charCodeAt(i5++) - 43]; enc2 = _base64Idx[input.charCodeAt(i5++) - 43]; enc3 = _base64Idx[input.charCodeAt(i5++) - 43]; enc4 = _base64Idx[input.charCodeAt(i5++) - 43]; output += String.fromCharCode(enc1 << 2 | enc2 >> 4); if (enc3 !== 64) { output += String.fromCharCode((enc2 & 15) << 4 | enc3 >> 2); if (enc4 !== 64) { output += String.fromCharCode((enc3 & 3) << 6 | enc4); } } } return output; }; util5.encodeUtf8 = function(str) { return unescape(encodeURIComponent(str)); }; util5.decodeUtf8 = function(str) { return decodeURIComponent(escape(str)); }; util5.binary = { raw: {}, hex: {}, base64: {}, base58: {}, baseN: { encode: baseN.encode, decode: baseN.decode } }; util5.binary.raw.encode = function(bytes) { return String.fromCharCode.apply(null, bytes); }; util5.binary.raw.decode = function(str, output, offset) { var out = output; if (!out) { out = new Uint8Array(str.length); } offset = offset || 0; var j6 = offset; for (var i5 = 0; i5 < str.length; ++i5) { out[j6++] = str.charCodeAt(i5); } return output ? j6 - offset : out; }; util5.binary.hex.encode = util5.bytesToHex; util5.binary.hex.decode = function(hex, output, offset) { var out = output; if (!out) { out = new Uint8Array(Math.ceil(hex.length / 2)); } offset = offset || 0; var i5 = 0, j6 = offset; if (hex.length & 1) { i5 = 1; out[j6++] = parseInt(hex[0], 16); } for (; i5 < hex.length; i5 += 2) { out[j6++] = parseInt(hex.substr(i5, 2), 16); } return output ? j6 - offset : out; }; util5.binary.base64.encode = function(input, maxline) { var line = ""; var output = ""; var chr1, chr2, chr3; var i5 = 0; while (i5 < input.byteLength) { chr1 = input[i5++]; chr2 = input[i5++]; chr3 = input[i5++]; line += _base64.charAt(chr1 >> 2); line += _base64.charAt((chr1 & 3) << 4 | chr2 >> 4); if (isNaN(chr2)) { line += "=="; } else { line += _base64.charAt((chr2 & 15) << 2 | chr3 >> 6); line += isNaN(chr3) ? "=" : _base64.charAt(chr3 & 63); } if (maxline && line.length > maxline) { output += line.substr(0, maxline) + "\r\n"; line = line.substr(maxline); } } output += line; return output; }; util5.binary.base64.decode = function(input, output, offset) { var out = output; if (!out) { out = new Uint8Array(Math.ceil(input.length / 4) * 3); } input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); offset = offset || 0; var enc1, enc2, enc3, enc4; var i5 = 0, j6 = offset; while (i5 < input.length) { enc1 = _base64Idx[input.charCodeAt(i5++) - 43]; enc2 = _base64Idx[input.charCodeAt(i5++) - 43]; enc3 = _base64Idx[input.charCodeAt(i5++) - 43]; enc4 = _base64Idx[input.charCodeAt(i5++) - 43]; out[j6++] = enc1 << 2 | enc2 >> 4; if (enc3 !== 64) { out[j6++] = (enc2 & 15) << 4 | enc3 >> 2; if (enc4 !== 64) { out[j6++] = (enc3 & 3) << 6 | enc4; } } } return output ? j6 - offset : out.subarray(0, j6); }; util5.binary.base58.encode = function(input, maxline) { return util5.binary.baseN.encode(input, _base58, maxline); }; util5.binary.base58.decode = function(input, maxline) { return util5.binary.baseN.decode(input, _base58, maxline); }; util5.text = { utf8: {}, utf16: {} }; util5.text.utf8.encode = function(str, output, offset) { str = util5.encodeUtf8(str); var out = output; if (!out) { out = new Uint8Array(str.length); } offset = offset || 0; var j6 = offset; for (var i5 = 0; i5 < str.length; ++i5) { out[j6++] = str.charCodeAt(i5); } return output ? j6 - offset : out; }; util5.text.utf8.decode = function(bytes) { return util5.decodeUtf8(String.fromCharCode.apply(null, bytes)); }; util5.text.utf16.encode = function(str, output, offset) { var out = output; if (!out) { out = new Uint8Array(str.length * 2); } var view = new Uint16Array(out.buffer); offset = offset || 0; var j6 = offset; var k6 = offset; for (var i5 = 0; i5 < str.length; ++i5) { view[k6++] = str.charCodeAt(i5); j6 += 2; } return output ? j6 - offset : out; }; util5.text.utf16.decode = function(bytes) { return String.fromCharCode.apply(null, new Uint16Array(bytes.buffer)); }; util5.deflate = function(api, bytes, raw) { bytes = util5.decode64(api.deflate(util5.encode64(bytes)).rval); if (raw) { var start = 2; var flg = bytes.charCodeAt(1); if (flg & 32) { start = 6; } bytes = bytes.substring(start, bytes.length - 4); } return bytes; }; util5.inflate = function(api, bytes, raw) { var rval = api.inflate(util5.encode64(bytes)).rval; return rval === null ? null : util5.decode64(rval); }; var _setStorageObject = /* @__PURE__ */ __name(function(api, id, obj) { if (!api) { throw new Error("WebStorage not available."); } var rval; if (obj === null) { rval = api.removeItem(id); } else { obj = util5.encode64(JSON.stringify(obj)); rval = api.setItem(id, obj); } if (typeof rval !== "undefined" && rval.rval !== true) { var error2 = new Error(rval.error.message); error2.id = rval.error.id; error2.name = rval.error.name; throw error2; } }, "_setStorageObject"); var _getStorageObject = /* @__PURE__ */ __name(function(api, id) { if (!api) { throw new Error("WebStorage not available."); } var rval = api.getItem(id); if (api.init) { if (rval.rval === null) { if (rval.error) { var error2 = new Error(rval.error.message); error2.id = rval.error.id; error2.name = rval.error.name; throw error2; } rval = null; } else { rval = rval.rval; } } if (rval !== null) { rval = JSON.parse(util5.decode64(rval)); } return rval; }, "_getStorageObject"); var _setItem = /* @__PURE__ */ __name(function(api, id, key, data) { var obj = _getStorageObject(api, id); if (obj === null) { obj = {}; } obj[key] = data; _setStorageObject(api, id, obj); }, "_setItem"); var _getItem = /* @__PURE__ */ __name(function(api, id, key) { var rval = _getStorageObject(api, id); if (rval !== null) { rval = key in rval ? rval[key] : null; } return rval; }, "_getItem"); var _removeItem = /* @__PURE__ */ __name(function(api, id, key) { var obj = _getStorageObject(api, id); if (obj !== null && key in obj) { delete obj[key]; var empty2 = true; for (var prop in obj) { empty2 = false; break; } if (empty2) { obj = null; } _setStorageObject(api, id, obj); } }, "_removeItem"); var _clearItems = /* @__PURE__ */ __name(function(api, id) { _setStorageObject(api, id, null); }, "_clearItems"); var _callStorageFunction = /* @__PURE__ */ __name(function(func, args, location) { var rval = null; if (typeof location === "undefined") { location = ["web", "flash"]; } var type; var done = false; var exception = null; for (var idx in location) { type = location[idx]; try { if (type === "flash" || type === "both") { if (args[0] === null) { throw new Error("Flash local storage not available."); } rval = func.apply(this, args); done = type === "flash"; } if (type === "web" || type === "both") { args[0] = localStorage; rval = func.apply(this, args); done = true; } } catch (ex) { exception = ex; } if (done) { break; } } if (!done) { throw exception; } return rval; }, "_callStorageFunction"); util5.setItem = function(api, id, key, data, location) { _callStorageFunction(_setItem, arguments, location); }; util5.getItem = function(api, id, key, location) { return _callStorageFunction(_getItem, arguments, location); }; util5.removeItem = function(api, id, key, location) { _callStorageFunction(_removeItem, arguments, location); }; util5.clearItems = function(api, id, location) { _callStorageFunction(_clearItems, arguments, location); }; util5.isEmpty = function(obj) { for (var prop in obj) { if (obj.hasOwnProperty(prop)) { return false; } } return true; }; util5.format = function(format11) { var re = /%./g; var match2; var part; var argi = 0; var parts = []; var last = 0; while (match2 = re.exec(format11)) { part = format11.substring(last, re.lastIndex - 2); if (part.length > 0) { parts.push(part); } last = re.lastIndex; var code = match2[0][1]; switch (code) { case "s": case "o": if (argi < arguments.length) { parts.push(arguments[argi++ + 1]); } else { parts.push(""); } break; case "%": parts.push("%"); break; default: parts.push("<%" + code + "?>"); } } parts.push(format11.substring(last)); return parts.join(""); }; util5.formatNumber = function(number, decimals, dec_point, thousands_sep) { var n6 = number, c6 = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals; var d6 = dec_point === void 0 ? "," : dec_point; var t7 = thousands_sep === void 0 ? "." : thousands_sep, s5 = n6 < 0 ? "-" : ""; var i5 = parseInt(n6 = Math.abs(+n6 || 0).toFixed(c6), 10) + ""; var j6 = i5.length > 3 ? i5.length % 3 : 0; return s5 + (j6 ? i5.substr(0, j6) + t7 : "") + i5.substr(j6).replace(/(\d{3})(?=\d)/g, "$1" + t7) + (c6 ? d6 + Math.abs(n6 - i5).toFixed(c6).slice(2) : ""); }; util5.formatSize = function(size) { if (size >= 1073741824) { size = util5.formatNumber(size / 1073741824, 2, ".", "") + " GiB"; } else if (size >= 1048576) { size = util5.formatNumber(size / 1048576, 2, ".", "") + " MiB"; } else if (size >= 1024) { size = util5.formatNumber(size / 1024, 0) + " KiB"; } else { size = util5.formatNumber(size, 0) + " bytes"; } return size; }; util5.bytesFromIP = function(ip) { if (ip.indexOf(".") !== -1) { return util5.bytesFromIPv4(ip); } if (ip.indexOf(":") !== -1) { return util5.bytesFromIPv6(ip); } return null; }; util5.bytesFromIPv4 = function(ip) { ip = ip.split("."); if (ip.length !== 4) { return null; } var b6 = util5.createBuffer(); for (var i5 = 0; i5 < ip.length; ++i5) { var num = parseInt(ip[i5], 10); if (isNaN(num)) { return null; } b6.putByte(num); } return b6.getBytes(); }; util5.bytesFromIPv6 = function(ip) { var blanks = 0; ip = ip.split(":").filter(function(e7) { if (e7.length === 0) ++blanks; return true; }); var zeros = (8 - ip.length + blanks) * 2; var b6 = util5.createBuffer(); for (var i5 = 0; i5 < 8; ++i5) { if (!ip[i5] || ip[i5].length === 0) { b6.fillWithByte(0, zeros); zeros = 0; continue; } var bytes = util5.hexToBytes(ip[i5]); if (bytes.length < 2) { b6.putByte(0); } b6.putBytes(bytes); } return b6.getBytes(); }; util5.bytesToIP = function(bytes) { if (bytes.length === 4) { return util5.bytesToIPv4(bytes); } if (bytes.length === 16) { return util5.bytesToIPv6(bytes); } return null; }; util5.bytesToIPv4 = function(bytes) { if (bytes.length !== 4) { return null; } var ip = []; for (var i5 = 0; i5 < bytes.length; ++i5) { ip.push(bytes.charCodeAt(i5)); } return ip.join("."); }; util5.bytesToIPv6 = function(bytes) { if (bytes.length !== 16) { return null; } var ip = []; var zeroGroups = []; var zeroMaxGroup = 0; for (var i5 = 0; i5 < bytes.length; i5 += 2) { var hex = util5.bytesToHex(bytes[i5] + bytes[i5 + 1]); while (hex[0] === "0" && hex !== "0") { hex = hex.substr(1); } if (hex === "0") { var last = zeroGroups[zeroGroups.length - 1]; var idx = ip.length; if (!last || idx !== last.end + 1) { zeroGroups.push({ start: idx, end: idx }); } else { last.end = idx; if (last.end - last.start > zeroGroups[zeroMaxGroup].end - zeroGroups[zeroMaxGroup].start) { zeroMaxGroup = zeroGroups.length - 1; } } } ip.push(hex); } if (zeroGroups.length > 0) { var group = zeroGroups[zeroMaxGroup]; if (group.end - group.start > 0) { ip.splice(group.start, group.end - group.start + 1, ""); if (group.start === 0) { ip.unshift(""); } if (group.end === 7) { ip.push(""); } } } return ip.join(":"); }; util5.estimateCores = function(options32, callback) { if (typeof options32 === "function") { callback = options32; options32 = {}; } options32 = options32 || {}; if ("cores" in util5 && !options32.update) { return callback(null, util5.cores); } if (typeof navigator !== "undefined" && "hardwareConcurrency" in navigator && navigator.hardwareConcurrency > 0) { util5.cores = navigator.hardwareConcurrency; return callback(null, util5.cores); } if (typeof Worker === "undefined") { util5.cores = 1; return callback(null, util5.cores); } if (typeof Blob === "undefined") { util5.cores = 2; return callback(null, util5.cores); } var blobUrl = URL.createObjectURL(new Blob([ "(", function() { self.addEventListener("message", function(e7) { var st = Date.now(); var et = st + 4; while (Date.now() < et) ; self.postMessage({ st, et }); }); }.toString(), ")()" ], { type: "application/javascript" })); sample([], 5, 16); function sample(max, samples, numWorkers) { if (samples === 0) { var avg = Math.floor(max.reduce(function(avg2, x6) { return avg2 + x6; }, 0) / max.length); util5.cores = Math.max(1, avg); URL.revokeObjectURL(blobUrl); return callback(null, util5.cores); } map2(numWorkers, function(err, results) { max.push(reduce(numWorkers, results)); sample(max, samples - 1, numWorkers); }); } __name(sample, "sample"); function map2(numWorkers, callback2) { var workers = []; var results = []; for (var i5 = 0; i5 < numWorkers; ++i5) { var worker = new Worker(blobUrl); worker.addEventListener("message", function(e7) { results.push(e7.data); if (results.length === numWorkers) { for (var i6 = 0; i6 < numWorkers; ++i6) { workers[i6].terminate(); } callback2(null, results); } }); workers.push(worker); } for (var i5 = 0; i5 < numWorkers; ++i5) { workers[i5].postMessage(i5); } } __name(map2, "map"); function reduce(numWorkers, results) { var overlaps = []; for (var n6 = 0; n6 < numWorkers; ++n6) { var r1 = results[n6]; var overlap = overlaps[n6] = []; for (var i5 = 0; i5 < numWorkers; ++i5) { if (n6 === i5) { continue; } var r22 = results[i5]; if (r1.st > r22.st && r1.st < r22.et || r22.st > r1.st && r22.st < r1.et) { overlap.push(i5); } } } return overlaps.reduce(function(max, overlap2) { return Math.max(max, overlap2.length); }, 0); } __name(reduce, "reduce"); }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/cipher.js var require_cipher = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/cipher.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_util10(); module3.exports = forge.cipher = forge.cipher || {}; forge.cipher.algorithms = forge.cipher.algorithms || {}; forge.cipher.createCipher = function(algorithm, key) { var api = algorithm; if (typeof api === "string") { api = forge.cipher.getAlgorithm(api); if (api) { api = api(); } } if (!api) { throw new Error("Unsupported algorithm: " + algorithm); } return new forge.cipher.BlockCipher({ algorithm: api, key, decrypt: false }); }; forge.cipher.createDecipher = function(algorithm, key) { var api = algorithm; if (typeof api === "string") { api = forge.cipher.getAlgorithm(api); if (api) { api = api(); } } if (!api) { throw new Error("Unsupported algorithm: " + algorithm); } return new forge.cipher.BlockCipher({ algorithm: api, key, decrypt: true }); }; forge.cipher.registerAlgorithm = function(name2, algorithm) { name2 = name2.toUpperCase(); forge.cipher.algorithms[name2] = algorithm; }; forge.cipher.getAlgorithm = function(name2) { name2 = name2.toUpperCase(); if (name2 in forge.cipher.algorithms) { return forge.cipher.algorithms[name2]; } return null; }; var BlockCipher = forge.cipher.BlockCipher = function(options32) { this.algorithm = options32.algorithm; this.mode = this.algorithm.mode; this.blockSize = this.mode.blockSize; this._finish = false; this._input = null; this.output = null; this._op = options32.decrypt ? this.mode.decrypt : this.mode.encrypt; this._decrypt = options32.decrypt; this.algorithm.initialize(options32); }; BlockCipher.prototype.start = function(options32) { options32 = options32 || {}; var opts = {}; for (var key in options32) { opts[key] = options32[key]; } opts.decrypt = this._decrypt; this._finish = false; this._input = forge.util.createBuffer(); this.output = options32.output || forge.util.createBuffer(); this.mode.start(opts); }; BlockCipher.prototype.update = function(input) { if (input) { this._input.putBuffer(input); } while (!this._op.call(this.mode, this._input, this.output, this._finish) && !this._finish) { } this._input.compact(); }; BlockCipher.prototype.finish = function(pad2) { if (pad2 && (this.mode.name === "ECB" || this.mode.name === "CBC")) { this.mode.pad = function(input) { return pad2(this.blockSize, input, false); }; this.mode.unpad = function(output) { return pad2(this.blockSize, output, true); }; } var options32 = {}; options32.decrypt = this._decrypt; options32.overflow = this._input.length() % this.blockSize; if (!this._decrypt && this.mode.pad) { if (!this.mode.pad(this._input, options32)) { return false; } } this._finish = true; this.update(); if (this._decrypt && this.mode.unpad) { if (!this.mode.unpad(this.output, options32)) { return false; } } if (this.mode.afterFinish) { if (!this.mode.afterFinish(this.output, options32)) { return false; } } return true; }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/cipherModes.js var require_cipherModes = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/cipherModes.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_util10(); forge.cipher = forge.cipher || {}; var modes = module3.exports = forge.cipher.modes = forge.cipher.modes || {}; modes.ecb = function(options32) { options32 = options32 || {}; this.name = "ECB"; this.cipher = options32.cipher; this.blockSize = options32.blockSize || 16; this._ints = this.blockSize / 4; this._inBlock = new Array(this._ints); this._outBlock = new Array(this._ints); }; modes.ecb.prototype.start = function(options32) { }; modes.ecb.prototype.encrypt = function(input, output, finish) { if (input.length() < this.blockSize && !(finish && input.length() > 0)) { return true; } for (var i5 = 0; i5 < this._ints; ++i5) { this._inBlock[i5] = input.getInt32(); } this.cipher.encrypt(this._inBlock, this._outBlock); for (var i5 = 0; i5 < this._ints; ++i5) { output.putInt32(this._outBlock[i5]); } }; modes.ecb.prototype.decrypt = function(input, output, finish) { if (input.length() < this.blockSize && !(finish && input.length() > 0)) { return true; } for (var i5 = 0; i5 < this._ints; ++i5) { this._inBlock[i5] = input.getInt32(); } this.cipher.decrypt(this._inBlock, this._outBlock); for (var i5 = 0; i5 < this._ints; ++i5) { output.putInt32(this._outBlock[i5]); } }; modes.ecb.prototype.pad = function(input, options32) { var padding = input.length() === this.blockSize ? this.blockSize : this.blockSize - input.length(); input.fillWithByte(padding, padding); return true; }; modes.ecb.prototype.unpad = function(output, options32) { if (options32.overflow > 0) { return false; } var len = output.length(); var count = output.at(len - 1); if (count > this.blockSize << 2) { return false; } output.truncate(count); return true; }; modes.cbc = function(options32) { options32 = options32 || {}; this.name = "CBC"; this.cipher = options32.cipher; this.blockSize = options32.blockSize || 16; this._ints = this.blockSize / 4; this._inBlock = new Array(this._ints); this._outBlock = new Array(this._ints); }; modes.cbc.prototype.start = function(options32) { if (options32.iv === null) { if (!this._prev) { throw new Error("Invalid IV parameter."); } this._iv = this._prev.slice(0); } else if (!("iv" in options32)) { throw new Error("Invalid IV parameter."); } else { this._iv = transformIV(options32.iv, this.blockSize); this._prev = this._iv.slice(0); } }; modes.cbc.prototype.encrypt = function(input, output, finish) { if (input.length() < this.blockSize && !(finish && input.length() > 0)) { return true; } for (var i5 = 0; i5 < this._ints; ++i5) { this._inBlock[i5] = this._prev[i5] ^ input.getInt32(); } this.cipher.encrypt(this._inBlock, this._outBlock); for (var i5 = 0; i5 < this._ints; ++i5) { output.putInt32(this._outBlock[i5]); } this._prev = this._outBlock; }; modes.cbc.prototype.decrypt = function(input, output, finish) { if (input.length() < this.blockSize && !(finish && input.length() > 0)) { return true; } for (var i5 = 0; i5 < this._ints; ++i5) { this._inBlock[i5] = input.getInt32(); } this.cipher.decrypt(this._inBlock, this._outBlock); for (var i5 = 0; i5 < this._ints; ++i5) { output.putInt32(this._prev[i5] ^ this._outBlock[i5]); } this._prev = this._inBlock.slice(0); }; modes.cbc.prototype.pad = function(input, options32) { var padding = input.length() === this.blockSize ? this.blockSize : this.blockSize - input.length(); input.fillWithByte(padding, padding); return true; }; modes.cbc.prototype.unpad = function(output, options32) { if (options32.overflow > 0) { return false; } var len = output.length(); var count = output.at(len - 1); if (count > this.blockSize << 2) { return false; } output.truncate(count); return true; }; modes.cfb = function(options32) { options32 = options32 || {}; this.name = "CFB"; this.cipher = options32.cipher; this.blockSize = options32.blockSize || 16; this._ints = this.blockSize / 4; this._inBlock = null; this._outBlock = new Array(this._ints); this._partialBlock = new Array(this._ints); this._partialOutput = forge.util.createBuffer(); this._partialBytes = 0; }; modes.cfb.prototype.start = function(options32) { if (!("iv" in options32)) { throw new Error("Invalid IV parameter."); } this._iv = transformIV(options32.iv, this.blockSize); this._inBlock = this._iv.slice(0); this._partialBytes = 0; }; modes.cfb.prototype.encrypt = function(input, output, finish) { var inputLength = input.length(); if (inputLength === 0) { return true; } this.cipher.encrypt(this._inBlock, this._outBlock); if (this._partialBytes === 0 && inputLength >= this.blockSize) { for (var i5 = 0; i5 < this._ints; ++i5) { this._inBlock[i5] = input.getInt32() ^ this._outBlock[i5]; output.putInt32(this._inBlock[i5]); } return; } var partialBytes = (this.blockSize - inputLength) % this.blockSize; if (partialBytes > 0) { partialBytes = this.blockSize - partialBytes; } this._partialOutput.clear(); for (var i5 = 0; i5 < this._ints; ++i5) { this._partialBlock[i5] = input.getInt32() ^ this._outBlock[i5]; this._partialOutput.putInt32(this._partialBlock[i5]); } if (partialBytes > 0) { input.read -= this.blockSize; } else { for (var i5 = 0; i5 < this._ints; ++i5) { this._inBlock[i5] = this._partialBlock[i5]; } } if (this._partialBytes > 0) { this._partialOutput.getBytes(this._partialBytes); } if (partialBytes > 0 && !finish) { output.putBytes(this._partialOutput.getBytes( partialBytes - this._partialBytes )); this._partialBytes = partialBytes; return true; } output.putBytes(this._partialOutput.getBytes( inputLength - this._partialBytes )); this._partialBytes = 0; }; modes.cfb.prototype.decrypt = function(input, output, finish) { var inputLength = input.length(); if (inputLength === 0) { return true; } this.cipher.encrypt(this._inBlock, this._outBlock); if (this._partialBytes === 0 && inputLength >= this.blockSize) { for (var i5 = 0; i5 < this._ints; ++i5) { this._inBlock[i5] = input.getInt32(); output.putInt32(this._inBlock[i5] ^ this._outBlock[i5]); } return; } var partialBytes = (this.blockSize - inputLength) % this.blockSize; if (partialBytes > 0) { partialBytes = this.blockSize - partialBytes; } this._partialOutput.clear(); for (var i5 = 0; i5 < this._ints; ++i5) { this._partialBlock[i5] = input.getInt32(); this._partialOutput.putInt32(this._partialBlock[i5] ^ this._outBlock[i5]); } if (partialBytes > 0) { input.read -= this.blockSize; } else { for (var i5 = 0; i5 < this._ints; ++i5) { this._inBlock[i5] = this._partialBlock[i5]; } } if (this._partialBytes > 0) { this._partialOutput.getBytes(this._partialBytes); } if (partialBytes > 0 && !finish) { output.putBytes(this._partialOutput.getBytes( partialBytes - this._partialBytes )); this._partialBytes = partialBytes; return true; } output.putBytes(this._partialOutput.getBytes( inputLength - this._partialBytes )); this._partialBytes = 0; }; modes.ofb = function(options32) { options32 = options32 || {}; this.name = "OFB"; this.cipher = options32.cipher; this.blockSize = options32.blockSize || 16; this._ints = this.blockSize / 4; this._inBlock = null; this._outBlock = new Array(this._ints); this._partialOutput = forge.util.createBuffer(); this._partialBytes = 0; }; modes.ofb.prototype.start = function(options32) { if (!("iv" in options32)) { throw new Error("Invalid IV parameter."); } this._iv = transformIV(options32.iv, this.blockSize); this._inBlock = this._iv.slice(0); this._partialBytes = 0; }; modes.ofb.prototype.encrypt = function(input, output, finish) { var inputLength = input.length(); if (input.length() === 0) { return true; } this.cipher.encrypt(this._inBlock, this._outBlock); if (this._partialBytes === 0 && inputLength >= this.blockSize) { for (var i5 = 0; i5 < this._ints; ++i5) { output.putInt32(input.getInt32() ^ this._outBlock[i5]); this._inBlock[i5] = this._outBlock[i5]; } return; } var partialBytes = (this.blockSize - inputLength) % this.blockSize; if (partialBytes > 0) { partialBytes = this.blockSize - partialBytes; } this._partialOutput.clear(); for (var i5 = 0; i5 < this._ints; ++i5) { this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i5]); } if (partialBytes > 0) { input.read -= this.blockSize; } else { for (var i5 = 0; i5 < this._ints; ++i5) { this._inBlock[i5] = this._outBlock[i5]; } } if (this._partialBytes > 0) { this._partialOutput.getBytes(this._partialBytes); } if (partialBytes > 0 && !finish) { output.putBytes(this._partialOutput.getBytes( partialBytes - this._partialBytes )); this._partialBytes = partialBytes; return true; } output.putBytes(this._partialOutput.getBytes( inputLength - this._partialBytes )); this._partialBytes = 0; }; modes.ofb.prototype.decrypt = modes.ofb.prototype.encrypt; modes.ctr = function(options32) { options32 = options32 || {}; this.name = "CTR"; this.cipher = options32.cipher; this.blockSize = options32.blockSize || 16; this._ints = this.blockSize / 4; this._inBlock = null; this._outBlock = new Array(this._ints); this._partialOutput = forge.util.createBuffer(); this._partialBytes = 0; }; modes.ctr.prototype.start = function(options32) { if (!("iv" in options32)) { throw new Error("Invalid IV parameter."); } this._iv = transformIV(options32.iv, this.blockSize); this._inBlock = this._iv.slice(0); this._partialBytes = 0; }; modes.ctr.prototype.encrypt = function(input, output, finish) { var inputLength = input.length(); if (inputLength === 0) { return true; } this.cipher.encrypt(this._inBlock, this._outBlock); if (this._partialBytes === 0 && inputLength >= this.blockSize) { for (var i5 = 0; i5 < this._ints; ++i5) { output.putInt32(input.getInt32() ^ this._outBlock[i5]); } } else { var partialBytes = (this.blockSize - inputLength) % this.blockSize; if (partialBytes > 0) { partialBytes = this.blockSize - partialBytes; } this._partialOutput.clear(); for (var i5 = 0; i5 < this._ints; ++i5) { this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i5]); } if (partialBytes > 0) { input.read -= this.blockSize; } if (this._partialBytes > 0) { this._partialOutput.getBytes(this._partialBytes); } if (partialBytes > 0 && !finish) { output.putBytes(this._partialOutput.getBytes( partialBytes - this._partialBytes )); this._partialBytes = partialBytes; return true; } output.putBytes(this._partialOutput.getBytes( inputLength - this._partialBytes )); this._partialBytes = 0; } inc32(this._inBlock); }; modes.ctr.prototype.decrypt = modes.ctr.prototype.encrypt; modes.gcm = function(options32) { options32 = options32 || {}; this.name = "GCM"; this.cipher = options32.cipher; this.blockSize = options32.blockSize || 16; this._ints = this.blockSize / 4; this._inBlock = new Array(this._ints); this._outBlock = new Array(this._ints); this._partialOutput = forge.util.createBuffer(); this._partialBytes = 0; this._R = 3774873600; }; modes.gcm.prototype.start = function(options32) { if (!("iv" in options32)) { throw new Error("Invalid IV parameter."); } var iv = forge.util.createBuffer(options32.iv); this._cipherLength = 0; var additionalData; if ("additionalData" in options32) { additionalData = forge.util.createBuffer(options32.additionalData); } else { additionalData = forge.util.createBuffer(); } if ("tagLength" in options32) { this._tagLength = options32.tagLength; } else { this._tagLength = 128; } this._tag = null; if (options32.decrypt) { this._tag = forge.util.createBuffer(options32.tag).getBytes(); if (this._tag.length !== this._tagLength / 8) { throw new Error("Authentication tag does not match tag length."); } } this._hashBlock = new Array(this._ints); this.tag = null; this._hashSubkey = new Array(this._ints); this.cipher.encrypt([0, 0, 0, 0], this._hashSubkey); this.componentBits = 4; this._m = this.generateHashTable(this._hashSubkey, this.componentBits); var ivLength = iv.length(); if (ivLength === 12) { this._j0 = [iv.getInt32(), iv.getInt32(), iv.getInt32(), 1]; } else { this._j0 = [0, 0, 0, 0]; while (iv.length() > 0) { this._j0 = this.ghash( this._hashSubkey, this._j0, [iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()] ); } this._j0 = this.ghash( this._hashSubkey, this._j0, [0, 0].concat(from64To32(ivLength * 8)) ); } this._inBlock = this._j0.slice(0); inc32(this._inBlock); this._partialBytes = 0; additionalData = forge.util.createBuffer(additionalData); this._aDataLength = from64To32(additionalData.length() * 8); var overflow = additionalData.length() % this.blockSize; if (overflow) { additionalData.fillWithByte(0, this.blockSize - overflow); } this._s = [0, 0, 0, 0]; while (additionalData.length() > 0) { this._s = this.ghash(this._hashSubkey, this._s, [ additionalData.getInt32(), additionalData.getInt32(), additionalData.getInt32(), additionalData.getInt32() ]); } }; modes.gcm.prototype.encrypt = function(input, output, finish) { var inputLength = input.length(); if (inputLength === 0) { return true; } this.cipher.encrypt(this._inBlock, this._outBlock); if (this._partialBytes === 0 && inputLength >= this.blockSize) { for (var i5 = 0; i5 < this._ints; ++i5) { output.putInt32(this._outBlock[i5] ^= input.getInt32()); } this._cipherLength += this.blockSize; } else { var partialBytes = (this.blockSize - inputLength) % this.blockSize; if (partialBytes > 0) { partialBytes = this.blockSize - partialBytes; } this._partialOutput.clear(); for (var i5 = 0; i5 < this._ints; ++i5) { this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i5]); } if (partialBytes <= 0 || finish) { if (finish) { var overflow = inputLength % this.blockSize; this._cipherLength += overflow; this._partialOutput.truncate(this.blockSize - overflow); } else { this._cipherLength += this.blockSize; } for (var i5 = 0; i5 < this._ints; ++i5) { this._outBlock[i5] = this._partialOutput.getInt32(); } this._partialOutput.read -= this.blockSize; } if (this._partialBytes > 0) { this._partialOutput.getBytes(this._partialBytes); } if (partialBytes > 0 && !finish) { input.read -= this.blockSize; output.putBytes(this._partialOutput.getBytes( partialBytes - this._partialBytes )); this._partialBytes = partialBytes; return true; } output.putBytes(this._partialOutput.getBytes( inputLength - this._partialBytes )); this._partialBytes = 0; } this._s = this.ghash(this._hashSubkey, this._s, this._outBlock); inc32(this._inBlock); }; modes.gcm.prototype.decrypt = function(input, output, finish) { var inputLength = input.length(); if (inputLength < this.blockSize && !(finish && inputLength > 0)) { return true; } this.cipher.encrypt(this._inBlock, this._outBlock); inc32(this._inBlock); this._hashBlock[0] = input.getInt32(); this._hashBlock[1] = input.getInt32(); this._hashBlock[2] = input.getInt32(); this._hashBlock[3] = input.getInt32(); this._s = this.ghash(this._hashSubkey, this._s, this._hashBlock); for (var i5 = 0; i5 < this._ints; ++i5) { output.putInt32(this._outBlock[i5] ^ this._hashBlock[i5]); } if (inputLength < this.blockSize) { this._cipherLength += inputLength % this.blockSize; } else { this._cipherLength += this.blockSize; } }; modes.gcm.prototype.afterFinish = function(output, options32) { var rval = true; if (options32.decrypt && options32.overflow) { output.truncate(this.blockSize - options32.overflow); } this.tag = forge.util.createBuffer(); var lengths = this._aDataLength.concat(from64To32(this._cipherLength * 8)); this._s = this.ghash(this._hashSubkey, this._s, lengths); var tag = []; this.cipher.encrypt(this._j0, tag); for (var i5 = 0; i5 < this._ints; ++i5) { this.tag.putInt32(this._s[i5] ^ tag[i5]); } this.tag.truncate(this.tag.length() % (this._tagLength / 8)); if (options32.decrypt && this.tag.bytes() !== this._tag) { rval = false; } return rval; }; modes.gcm.prototype.multiply = function(x6, y4) { var z_i = [0, 0, 0, 0]; var v_i = y4.slice(0); for (var i5 = 0; i5 < 128; ++i5) { var x_i = x6[i5 / 32 | 0] & 1 << 31 - i5 % 32; if (x_i) { z_i[0] ^= v_i[0]; z_i[1] ^= v_i[1]; z_i[2] ^= v_i[2]; z_i[3] ^= v_i[3]; } this.pow(v_i, v_i); } return z_i; }; modes.gcm.prototype.pow = function(x6, out) { var lsb = x6[3] & 1; for (var i5 = 3; i5 > 0; --i5) { out[i5] = x6[i5] >>> 1 | (x6[i5 - 1] & 1) << 31; } out[0] = x6[0] >>> 1; if (lsb) { out[0] ^= this._R; } }; modes.gcm.prototype.tableMultiply = function(x6) { var z5 = [0, 0, 0, 0]; for (var i5 = 0; i5 < 32; ++i5) { var idx = i5 / 8 | 0; var x_i = x6[idx] >>> (7 - i5 % 8) * 4 & 15; var ah2 = this._m[i5][x_i]; z5[0] ^= ah2[0]; z5[1] ^= ah2[1]; z5[2] ^= ah2[2]; z5[3] ^= ah2[3]; } return z5; }; modes.gcm.prototype.ghash = function(h6, y4, x6) { y4[0] ^= x6[0]; y4[1] ^= x6[1]; y4[2] ^= x6[2]; y4[3] ^= x6[3]; return this.tableMultiply(y4); }; modes.gcm.prototype.generateHashTable = function(h6, bits) { var multiplier = 8 / bits; var perInt = 4 * multiplier; var size = 16 * multiplier; var m6 = new Array(size); for (var i5 = 0; i5 < size; ++i5) { var tmp = [0, 0, 0, 0]; var idx = i5 / perInt | 0; var shft = (perInt - 1 - i5 % perInt) * bits; tmp[idx] = 1 << bits - 1 << shft; m6[i5] = this.generateSubHashTable(this.multiply(tmp, h6), bits); } return m6; }; modes.gcm.prototype.generateSubHashTable = function(mid, bits) { var size = 1 << bits; var half = size >>> 1; var m6 = new Array(size); m6[half] = mid.slice(0); var i5 = half >>> 1; while (i5 > 0) { this.pow(m6[2 * i5], m6[i5] = []); i5 >>= 1; } i5 = 2; while (i5 < half) { for (var j6 = 1; j6 < i5; ++j6) { var m_i = m6[i5]; var m_j = m6[j6]; m6[i5 + j6] = [ m_i[0] ^ m_j[0], m_i[1] ^ m_j[1], m_i[2] ^ m_j[2], m_i[3] ^ m_j[3] ]; } i5 *= 2; } m6[0] = [0, 0, 0, 0]; for (i5 = half + 1; i5 < size; ++i5) { var c6 = m6[i5 ^ half]; m6[i5] = [mid[0] ^ c6[0], mid[1] ^ c6[1], mid[2] ^ c6[2], mid[3] ^ c6[3]]; } return m6; }; function transformIV(iv, blockSize) { if (typeof iv === "string") { iv = forge.util.createBuffer(iv); } if (forge.util.isArray(iv) && iv.length > 4) { var tmp = iv; iv = forge.util.createBuffer(); for (var i5 = 0; i5 < tmp.length; ++i5) { iv.putByte(tmp[i5]); } } if (iv.length() < blockSize) { throw new Error( "Invalid IV length; got " + iv.length() + " bytes and expected " + blockSize + " bytes." ); } if (!forge.util.isArray(iv)) { var ints = []; var blocks = blockSize / 4; for (var i5 = 0; i5 < blocks; ++i5) { ints.push(iv.getInt32()); } iv = ints; } return iv; } __name(transformIV, "transformIV"); function inc32(block) { block[block.length - 1] = block[block.length - 1] + 1 & 4294967295; } __name(inc32, "inc32"); function from64To32(num) { return [num / 4294967296 | 0, num & 4294967295]; } __name(from64To32, "from64To32"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/aes.js var require_aes = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/aes.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_cipher(); require_cipherModes(); require_util10(); module3.exports = forge.aes = forge.aes || {}; forge.aes.startEncrypting = function(key, iv, output, mode) { var cipher = _createCipher({ key, output, decrypt: false, mode }); cipher.start(iv); return cipher; }; forge.aes.createEncryptionCipher = function(key, mode) { return _createCipher({ key, output: null, decrypt: false, mode }); }; forge.aes.startDecrypting = function(key, iv, output, mode) { var cipher = _createCipher({ key, output, decrypt: true, mode }); cipher.start(iv); return cipher; }; forge.aes.createDecryptionCipher = function(key, mode) { return _createCipher({ key, output: null, decrypt: true, mode }); }; forge.aes.Algorithm = function(name2, mode) { if (!init2) { initialize(); } var self2 = this; self2.name = name2; self2.mode = new mode({ blockSize: 16, cipher: { encrypt: function(inBlock, outBlock) { return _updateBlock(self2._w, inBlock, outBlock, false); }, decrypt: function(inBlock, outBlock) { return _updateBlock(self2._w, inBlock, outBlock, true); } } }); self2._init = false; }; forge.aes.Algorithm.prototype.initialize = function(options32) { if (this._init) { return; } var key = options32.key; var tmp; if (typeof key === "string" && (key.length === 16 || key.length === 24 || key.length === 32)) { key = forge.util.createBuffer(key); } else if (forge.util.isArray(key) && (key.length === 16 || key.length === 24 || key.length === 32)) { tmp = key; key = forge.util.createBuffer(); for (var i5 = 0; i5 < tmp.length; ++i5) { key.putByte(tmp[i5]); } } if (!forge.util.isArray(key)) { tmp = key; key = []; var len = tmp.length(); if (len === 16 || len === 24 || len === 32) { len = len >>> 2; for (var i5 = 0; i5 < len; ++i5) { key.push(tmp.getInt32()); } } } if (!forge.util.isArray(key) || !(key.length === 4 || key.length === 6 || key.length === 8)) { throw new Error("Invalid key parameter."); } var mode = this.mode.name; var encryptOp = ["CFB", "OFB", "CTR", "GCM"].indexOf(mode) !== -1; this._w = _expandKey(key, options32.decrypt && !encryptOp); this._init = true; }; forge.aes._expandKey = function(key, decrypt) { if (!init2) { initialize(); } return _expandKey(key, decrypt); }; forge.aes._updateBlock = _updateBlock; registerAlgorithm("AES-ECB", forge.cipher.modes.ecb); registerAlgorithm("AES-CBC", forge.cipher.modes.cbc); registerAlgorithm("AES-CFB", forge.cipher.modes.cfb); registerAlgorithm("AES-OFB", forge.cipher.modes.ofb); registerAlgorithm("AES-CTR", forge.cipher.modes.ctr); registerAlgorithm("AES-GCM", forge.cipher.modes.gcm); function registerAlgorithm(name2, mode) { var factory = /* @__PURE__ */ __name(function() { return new forge.aes.Algorithm(name2, mode); }, "factory"); forge.cipher.registerAlgorithm(name2, factory); } __name(registerAlgorithm, "registerAlgorithm"); var init2 = false; var Nb = 4; var sbox; var isbox; var rcon; var mix; var imix; function initialize() { init2 = true; rcon = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54]; var xtime = new Array(256); for (var i5 = 0; i5 < 128; ++i5) { xtime[i5] = i5 << 1; xtime[i5 + 128] = i5 + 128 << 1 ^ 283; } sbox = new Array(256); isbox = new Array(256); mix = new Array(4); imix = new Array(4); for (var i5 = 0; i5 < 4; ++i5) { mix[i5] = new Array(256); imix[i5] = new Array(256); } var e7 = 0, ei = 0, e22, e42, e8, sx, sx2, me, ime; for (var i5 = 0; i5 < 256; ++i5) { sx = ei ^ ei << 1 ^ ei << 2 ^ ei << 3 ^ ei << 4; sx = sx >> 8 ^ sx & 255 ^ 99; sbox[e7] = sx; isbox[sx] = e7; sx2 = xtime[sx]; e22 = xtime[e7]; e42 = xtime[e22]; e8 = xtime[e42]; me = sx2 << 24 ^ // 2 sx << 16 ^ // 1 sx << 8 ^ // 1 (sx ^ sx2); ime = (e22 ^ e42 ^ e8) << 24 ^ // E (14) (e7 ^ e8) << 16 ^ // 9 (e7 ^ e42 ^ e8) << 8 ^ // D (13) (e7 ^ e22 ^ e8); for (var n6 = 0; n6 < 4; ++n6) { mix[n6][e7] = me; imix[n6][sx] = ime; me = me << 24 | me >>> 8; ime = ime << 24 | ime >>> 8; } if (e7 === 0) { e7 = ei = 1; } else { e7 = e22 ^ xtime[xtime[xtime[e22 ^ e8]]]; ei ^= xtime[xtime[ei]]; } } } __name(initialize, "initialize"); function _expandKey(key, decrypt) { var w6 = key.slice(0); var temp, iNk = 1; var Nk = w6.length; var Nr1 = Nk + 6 + 1; var end = Nb * Nr1; for (var i5 = Nk; i5 < end; ++i5) { temp = w6[i5 - 1]; if (i5 % Nk === 0) { temp = sbox[temp >>> 16 & 255] << 24 ^ sbox[temp >>> 8 & 255] << 16 ^ sbox[temp & 255] << 8 ^ sbox[temp >>> 24] ^ rcon[iNk] << 24; iNk++; } else if (Nk > 6 && i5 % Nk === 4) { temp = sbox[temp >>> 24] << 24 ^ sbox[temp >>> 16 & 255] << 16 ^ sbox[temp >>> 8 & 255] << 8 ^ sbox[temp & 255]; } w6[i5] = w6[i5 - Nk] ^ temp; } if (decrypt) { var tmp; var m0 = imix[0]; var m1 = imix[1]; var m22 = imix[2]; var m32 = imix[3]; var wnew = w6.slice(0); end = w6.length; for (var i5 = 0, wi = end - Nb; i5 < end; i5 += Nb, wi -= Nb) { if (i5 === 0 || i5 === end - Nb) { wnew[i5] = w6[wi]; wnew[i5 + 1] = w6[wi + 3]; wnew[i5 + 2] = w6[wi + 2]; wnew[i5 + 3] = w6[wi + 1]; } else { for (var n6 = 0; n6 < Nb; ++n6) { tmp = w6[wi + n6]; wnew[i5 + (3 & -n6)] = m0[sbox[tmp >>> 24]] ^ m1[sbox[tmp >>> 16 & 255]] ^ m22[sbox[tmp >>> 8 & 255]] ^ m32[sbox[tmp & 255]]; } } } w6 = wnew; } return w6; } __name(_expandKey, "_expandKey"); function _updateBlock(w6, input, output, decrypt) { var Nr = w6.length / 4 - 1; var m0, m1, m22, m32, sub; if (decrypt) { m0 = imix[0]; m1 = imix[1]; m22 = imix[2]; m32 = imix[3]; sub = isbox; } else { m0 = mix[0]; m1 = mix[1]; m22 = mix[2]; m32 = mix[3]; sub = sbox; } var a5, b6, c6, d6, a22, b22, c22; a5 = input[0] ^ w6[0]; b6 = input[decrypt ? 3 : 1] ^ w6[1]; c6 = input[2] ^ w6[2]; d6 = input[decrypt ? 1 : 3] ^ w6[3]; var i5 = 3; for (var round = 1; round < Nr; ++round) { a22 = m0[a5 >>> 24] ^ m1[b6 >>> 16 & 255] ^ m22[c6 >>> 8 & 255] ^ m32[d6 & 255] ^ w6[++i5]; b22 = m0[b6 >>> 24] ^ m1[c6 >>> 16 & 255] ^ m22[d6 >>> 8 & 255] ^ m32[a5 & 255] ^ w6[++i5]; c22 = m0[c6 >>> 24] ^ m1[d6 >>> 16 & 255] ^ m22[a5 >>> 8 & 255] ^ m32[b6 & 255] ^ w6[++i5]; d6 = m0[d6 >>> 24] ^ m1[a5 >>> 16 & 255] ^ m22[b6 >>> 8 & 255] ^ m32[c6 & 255] ^ w6[++i5]; a5 = a22; b6 = b22; c6 = c22; } output[0] = sub[a5 >>> 24] << 24 ^ sub[b6 >>> 16 & 255] << 16 ^ sub[c6 >>> 8 & 255] << 8 ^ sub[d6 & 255] ^ w6[++i5]; output[decrypt ? 3 : 1] = sub[b6 >>> 24] << 24 ^ sub[c6 >>> 16 & 255] << 16 ^ sub[d6 >>> 8 & 255] << 8 ^ sub[a5 & 255] ^ w6[++i5]; output[2] = sub[c6 >>> 24] << 24 ^ sub[d6 >>> 16 & 255] << 16 ^ sub[a5 >>> 8 & 255] << 8 ^ sub[b6 & 255] ^ w6[++i5]; output[decrypt ? 1 : 3] = sub[d6 >>> 24] << 24 ^ sub[a5 >>> 16 & 255] << 16 ^ sub[b6 >>> 8 & 255] << 8 ^ sub[c6 & 255] ^ w6[++i5]; } __name(_updateBlock, "_updateBlock"); function _createCipher(options32) { options32 = options32 || {}; var mode = (options32.mode || "CBC").toUpperCase(); var algorithm = "AES-" + mode; var cipher; if (options32.decrypt) { cipher = forge.cipher.createDecipher(algorithm, options32.key); } else { cipher = forge.cipher.createCipher(algorithm, options32.key); } var start = cipher.start; cipher.start = function(iv, options33) { var output = null; if (options33 instanceof forge.util.ByteBuffer) { output = options33; options33 = {}; } options33 = options33 || {}; options33.output = output; options33.iv = iv; start.call(cipher, options33); }; return cipher; } __name(_createCipher, "_createCipher"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/oids.js var require_oids = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/oids.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); forge.pki = forge.pki || {}; var oids = module3.exports = forge.pki.oids = forge.oids = forge.oids || {}; function _IN(id, name2) { oids[id] = name2; oids[name2] = id; } __name(_IN, "_IN"); function _I_(id, name2) { oids[id] = name2; } __name(_I_, "_I_"); _IN("1.2.840.113549.1.1.1", "rsaEncryption"); _IN("1.2.840.113549.1.1.4", "md5WithRSAEncryption"); _IN("1.2.840.113549.1.1.5", "sha1WithRSAEncryption"); _IN("1.2.840.113549.1.1.7", "RSAES-OAEP"); _IN("1.2.840.113549.1.1.8", "mgf1"); _IN("1.2.840.113549.1.1.9", "pSpecified"); _IN("1.2.840.113549.1.1.10", "RSASSA-PSS"); _IN("1.2.840.113549.1.1.11", "sha256WithRSAEncryption"); _IN("1.2.840.113549.1.1.12", "sha384WithRSAEncryption"); _IN("1.2.840.113549.1.1.13", "sha512WithRSAEncryption"); _IN("1.3.101.112", "EdDSA25519"); _IN("1.2.840.10040.4.3", "dsa-with-sha1"); _IN("1.3.14.3.2.7", "desCBC"); _IN("1.3.14.3.2.26", "sha1"); _IN("1.3.14.3.2.29", "sha1WithRSASignature"); _IN("2.16.840.1.101.3.4.2.1", "sha256"); _IN("2.16.840.1.101.3.4.2.2", "sha384"); _IN("2.16.840.1.101.3.4.2.3", "sha512"); _IN("2.16.840.1.101.3.4.2.4", "sha224"); _IN("2.16.840.1.101.3.4.2.5", "sha512-224"); _IN("2.16.840.1.101.3.4.2.6", "sha512-256"); _IN("1.2.840.113549.2.2", "md2"); _IN("1.2.840.113549.2.5", "md5"); _IN("1.2.840.113549.1.7.1", "data"); _IN("1.2.840.113549.1.7.2", "signedData"); _IN("1.2.840.113549.1.7.3", "envelopedData"); _IN("1.2.840.113549.1.7.4", "signedAndEnvelopedData"); _IN("1.2.840.113549.1.7.5", "digestedData"); _IN("1.2.840.113549.1.7.6", "encryptedData"); _IN("1.2.840.113549.1.9.1", "emailAddress"); _IN("1.2.840.113549.1.9.2", "unstructuredName"); _IN("1.2.840.113549.1.9.3", "contentType"); _IN("1.2.840.113549.1.9.4", "messageDigest"); _IN("1.2.840.113549.1.9.5", "signingTime"); _IN("1.2.840.113549.1.9.6", "counterSignature"); _IN("1.2.840.113549.1.9.7", "challengePassword"); _IN("1.2.840.113549.1.9.8", "unstructuredAddress"); _IN("1.2.840.113549.1.9.14", "extensionRequest"); _IN("1.2.840.113549.1.9.20", "friendlyName"); _IN("1.2.840.113549.1.9.21", "localKeyId"); _IN("1.2.840.113549.1.9.22.1", "x509Certificate"); _IN("1.2.840.113549.1.12.10.1.1", "keyBag"); _IN("1.2.840.113549.1.12.10.1.2", "pkcs8ShroudedKeyBag"); _IN("1.2.840.113549.1.12.10.1.3", "certBag"); _IN("1.2.840.113549.1.12.10.1.4", "crlBag"); _IN("1.2.840.113549.1.12.10.1.5", "secretBag"); _IN("1.2.840.113549.1.12.10.1.6", "safeContentsBag"); _IN("1.2.840.113549.1.5.13", "pkcs5PBES2"); _IN("1.2.840.113549.1.5.12", "pkcs5PBKDF2"); _IN("1.2.840.113549.1.12.1.1", "pbeWithSHAAnd128BitRC4"); _IN("1.2.840.113549.1.12.1.2", "pbeWithSHAAnd40BitRC4"); _IN("1.2.840.113549.1.12.1.3", "pbeWithSHAAnd3-KeyTripleDES-CBC"); _IN("1.2.840.113549.1.12.1.4", "pbeWithSHAAnd2-KeyTripleDES-CBC"); _IN("1.2.840.113549.1.12.1.5", "pbeWithSHAAnd128BitRC2-CBC"); _IN("1.2.840.113549.1.12.1.6", "pbewithSHAAnd40BitRC2-CBC"); _IN("1.2.840.113549.2.7", "hmacWithSHA1"); _IN("1.2.840.113549.2.8", "hmacWithSHA224"); _IN("1.2.840.113549.2.9", "hmacWithSHA256"); _IN("1.2.840.113549.2.10", "hmacWithSHA384"); _IN("1.2.840.113549.2.11", "hmacWithSHA512"); _IN("1.2.840.113549.3.7", "des-EDE3-CBC"); _IN("2.16.840.1.101.3.4.1.2", "aes128-CBC"); _IN("2.16.840.1.101.3.4.1.22", "aes192-CBC"); _IN("2.16.840.1.101.3.4.1.42", "aes256-CBC"); _IN("2.5.4.3", "commonName"); _IN("2.5.4.4", "surname"); _IN("2.5.4.5", "serialNumber"); _IN("2.5.4.6", "countryName"); _IN("2.5.4.7", "localityName"); _IN("2.5.4.8", "stateOrProvinceName"); _IN("2.5.4.9", "streetAddress"); _IN("2.5.4.10", "organizationName"); _IN("2.5.4.11", "organizationalUnitName"); _IN("2.5.4.12", "title"); _IN("2.5.4.13", "description"); _IN("2.5.4.15", "businessCategory"); _IN("2.5.4.17", "postalCode"); _IN("2.5.4.42", "givenName"); _IN("1.3.6.1.4.1.311.60.2.1.2", "jurisdictionOfIncorporationStateOrProvinceName"); _IN("1.3.6.1.4.1.311.60.2.1.3", "jurisdictionOfIncorporationCountryName"); _IN("2.16.840.1.113730.1.1", "nsCertType"); _IN("2.16.840.1.113730.1.13", "nsComment"); _I_("2.5.29.1", "authorityKeyIdentifier"); _I_("2.5.29.2", "keyAttributes"); _I_("2.5.29.3", "certificatePolicies"); _I_("2.5.29.4", "keyUsageRestriction"); _I_("2.5.29.5", "policyMapping"); _I_("2.5.29.6", "subtreesConstraint"); _I_("2.5.29.7", "subjectAltName"); _I_("2.5.29.8", "issuerAltName"); _I_("2.5.29.9", "subjectDirectoryAttributes"); _I_("2.5.29.10", "basicConstraints"); _I_("2.5.29.11", "nameConstraints"); _I_("2.5.29.12", "policyConstraints"); _I_("2.5.29.13", "basicConstraints"); _IN("2.5.29.14", "subjectKeyIdentifier"); _IN("2.5.29.15", "keyUsage"); _I_("2.5.29.16", "privateKeyUsagePeriod"); _IN("2.5.29.17", "subjectAltName"); _IN("2.5.29.18", "issuerAltName"); _IN("2.5.29.19", "basicConstraints"); _I_("2.5.29.20", "cRLNumber"); _I_("2.5.29.21", "cRLReason"); _I_("2.5.29.22", "expirationDate"); _I_("2.5.29.23", "instructionCode"); _I_("2.5.29.24", "invalidityDate"); _I_("2.5.29.25", "cRLDistributionPoints"); _I_("2.5.29.26", "issuingDistributionPoint"); _I_("2.5.29.27", "deltaCRLIndicator"); _I_("2.5.29.28", "issuingDistributionPoint"); _I_("2.5.29.29", "certificateIssuer"); _I_("2.5.29.30", "nameConstraints"); _IN("2.5.29.31", "cRLDistributionPoints"); _IN("2.5.29.32", "certificatePolicies"); _I_("2.5.29.33", "policyMappings"); _I_("2.5.29.34", "policyConstraints"); _IN("2.5.29.35", "authorityKeyIdentifier"); _I_("2.5.29.36", "policyConstraints"); _IN("2.5.29.37", "extKeyUsage"); _I_("2.5.29.46", "freshestCRL"); _I_("2.5.29.54", "inhibitAnyPolicy"); _IN("1.3.6.1.4.1.11129.2.4.2", "timestampList"); _IN("1.3.6.1.5.5.7.1.1", "authorityInfoAccess"); _IN("1.3.6.1.5.5.7.3.1", "serverAuth"); _IN("1.3.6.1.5.5.7.3.2", "clientAuth"); _IN("1.3.6.1.5.5.7.3.3", "codeSigning"); _IN("1.3.6.1.5.5.7.3.4", "emailProtection"); _IN("1.3.6.1.5.5.7.3.8", "timeStamping"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/asn1.js var require_asn1 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/asn1.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_util10(); require_oids(); var asn1 = module3.exports = forge.asn1 = forge.asn1 || {}; asn1.Class = { UNIVERSAL: 0, APPLICATION: 64, CONTEXT_SPECIFIC: 128, PRIVATE: 192 }; asn1.Type = { NONE: 0, BOOLEAN: 1, INTEGER: 2, BITSTRING: 3, OCTETSTRING: 4, NULL: 5, OID: 6, ODESC: 7, EXTERNAL: 8, REAL: 9, ENUMERATED: 10, EMBEDDED: 11, UTF8: 12, ROID: 13, SEQUENCE: 16, SET: 17, PRINTABLESTRING: 19, IA5STRING: 22, UTCTIME: 23, GENERALIZEDTIME: 24, BMPSTRING: 30 }; asn1.create = function(tagClass, type, constructed, value, options32) { if (forge.util.isArray(value)) { var tmp = []; for (var i5 = 0; i5 < value.length; ++i5) { if (value[i5] !== void 0) { tmp.push(value[i5]); } } value = tmp; } var obj = { tagClass, type, constructed, composed: constructed || forge.util.isArray(value), value }; if (options32 && "bitStringContents" in options32) { obj.bitStringContents = options32.bitStringContents; obj.original = asn1.copy(obj); } return obj; }; asn1.copy = function(obj, options32) { var copy; if (forge.util.isArray(obj)) { copy = []; for (var i5 = 0; i5 < obj.length; ++i5) { copy.push(asn1.copy(obj[i5], options32)); } return copy; } if (typeof obj === "string") { return obj; } copy = { tagClass: obj.tagClass, type: obj.type, constructed: obj.constructed, composed: obj.composed, value: asn1.copy(obj.value, options32) }; if (options32 && !options32.excludeBitStringContents) { copy.bitStringContents = obj.bitStringContents; } return copy; }; asn1.equals = function(obj1, obj2, options32) { if (forge.util.isArray(obj1)) { if (!forge.util.isArray(obj2)) { return false; } if (obj1.length !== obj2.length) { return false; } for (var i5 = 0; i5 < obj1.length; ++i5) { if (!asn1.equals(obj1[i5], obj2[i5])) { return false; } } return true; } if (typeof obj1 !== typeof obj2) { return false; } if (typeof obj1 === "string") { return obj1 === obj2; } var equal = obj1.tagClass === obj2.tagClass && obj1.type === obj2.type && obj1.constructed === obj2.constructed && obj1.composed === obj2.composed && asn1.equals(obj1.value, obj2.value); if (options32 && options32.includeBitStringContents) { equal = equal && obj1.bitStringContents === obj2.bitStringContents; } return equal; }; asn1.getBerValueLength = function(b6) { var b22 = b6.getByte(); if (b22 === 128) { return void 0; } var length; var longForm = b22 & 128; if (!longForm) { length = b22; } else { length = b6.getInt((b22 & 127) << 3); } return length; }; function _checkBufferLength(bytes, remaining, n6) { if (n6 > remaining) { var error2 = new Error("Too few bytes to parse DER."); error2.available = bytes.length(); error2.remaining = remaining; error2.requested = n6; throw error2; } } __name(_checkBufferLength, "_checkBufferLength"); var _getValueLength = /* @__PURE__ */ __name(function(bytes, remaining) { var b22 = bytes.getByte(); remaining--; if (b22 === 128) { return void 0; } var length; var longForm = b22 & 128; if (!longForm) { length = b22; } else { var longFormBytes = b22 & 127; _checkBufferLength(bytes, remaining, longFormBytes); length = bytes.getInt(longFormBytes << 3); } if (length < 0) { throw new Error("Negative length: " + length); } return length; }, "_getValueLength"); asn1.fromDer = function(bytes, options32) { if (options32 === void 0) { options32 = { strict: true, parseAllBytes: true, decodeBitStrings: true }; } if (typeof options32 === "boolean") { options32 = { strict: options32, parseAllBytes: true, decodeBitStrings: true }; } if (!("strict" in options32)) { options32.strict = true; } if (!("parseAllBytes" in options32)) { options32.parseAllBytes = true; } if (!("decodeBitStrings" in options32)) { options32.decodeBitStrings = true; } if (typeof bytes === "string") { bytes = forge.util.createBuffer(bytes); } var byteCount = bytes.length(); var value = _fromDer(bytes, bytes.length(), 0, options32); if (options32.parseAllBytes && bytes.length() !== 0) { var error2 = new Error("Unparsed DER bytes remain after ASN.1 parsing."); error2.byteCount = byteCount; error2.remaining = bytes.length(); throw error2; } return value; }; function _fromDer(bytes, remaining, depth, options32) { var start; _checkBufferLength(bytes, remaining, 2); var b1 = bytes.getByte(); remaining--; var tagClass = b1 & 192; var type = b1 & 31; start = bytes.length(); var length = _getValueLength(bytes, remaining); remaining -= start - bytes.length(); if (length !== void 0 && length > remaining) { if (options32.strict) { var error2 = new Error("Too few bytes to read ASN.1 value."); error2.available = bytes.length(); error2.remaining = remaining; error2.requested = length; throw error2; } length = remaining; } var value; var bitStringContents; var constructed = (b1 & 32) === 32; if (constructed) { value = []; if (length === void 0) { for (; ; ) { _checkBufferLength(bytes, remaining, 2); if (bytes.bytes(2) === String.fromCharCode(0, 0)) { bytes.getBytes(2); remaining -= 2; break; } start = bytes.length(); value.push(_fromDer(bytes, remaining, depth + 1, options32)); remaining -= start - bytes.length(); } } else { while (length > 0) { start = bytes.length(); value.push(_fromDer(bytes, length, depth + 1, options32)); remaining -= start - bytes.length(); length -= start - bytes.length(); } } } if (value === void 0 && tagClass === asn1.Class.UNIVERSAL && type === asn1.Type.BITSTRING) { bitStringContents = bytes.bytes(length); } if (value === void 0 && options32.decodeBitStrings && tagClass === asn1.Class.UNIVERSAL && // FIXME: OCTET STRINGs not yet supported here // .. other parts of forge expect to decode OCTET STRINGs manually type === asn1.Type.BITSTRING && length > 1) { var savedRead = bytes.read; var savedRemaining = remaining; var unused = 0; if (type === asn1.Type.BITSTRING) { _checkBufferLength(bytes, remaining, 1); unused = bytes.getByte(); remaining--; } if (unused === 0) { try { start = bytes.length(); var subOptions = { // enforce strict mode to avoid parsing ASN.1 from plain data strict: true, decodeBitStrings: true }; var composed = _fromDer(bytes, remaining, depth + 1, subOptions); var used = start - bytes.length(); remaining -= used; if (type == asn1.Type.BITSTRING) { used++; } var tc = composed.tagClass; if (used === length && (tc === asn1.Class.UNIVERSAL || tc === asn1.Class.CONTEXT_SPECIFIC)) { value = [composed]; } } catch (ex) { } } if (value === void 0) { bytes.read = savedRead; remaining = savedRemaining; } } if (value === void 0) { if (length === void 0) { if (options32.strict) { throw new Error("Non-constructed ASN.1 object of indefinite length."); } length = remaining; } if (type === asn1.Type.BMPSTRING) { value = ""; for (; length > 0; length -= 2) { _checkBufferLength(bytes, remaining, 2); value += String.fromCharCode(bytes.getInt16()); remaining -= 2; } } else { value = bytes.getBytes(length); remaining -= length; } } var asn1Options = bitStringContents === void 0 ? null : { bitStringContents }; return asn1.create(tagClass, type, constructed, value, asn1Options); } __name(_fromDer, "_fromDer"); asn1.toDer = function(obj) { var bytes = forge.util.createBuffer(); var b1 = obj.tagClass | obj.type; var value = forge.util.createBuffer(); var useBitStringContents = false; if ("bitStringContents" in obj) { useBitStringContents = true; if (obj.original) { useBitStringContents = asn1.equals(obj, obj.original); } } if (useBitStringContents) { value.putBytes(obj.bitStringContents); } else if (obj.composed) { if (obj.constructed) { b1 |= 32; } else { value.putByte(0); } for (var i5 = 0; i5 < obj.value.length; ++i5) { if (obj.value[i5] !== void 0) { value.putBuffer(asn1.toDer(obj.value[i5])); } } } else { if (obj.type === asn1.Type.BMPSTRING) { for (var i5 = 0; i5 < obj.value.length; ++i5) { value.putInt16(obj.value.charCodeAt(i5)); } } else { if (obj.type === asn1.Type.INTEGER && obj.value.length > 1 && // leading 0x00 for positive integer (obj.value.charCodeAt(0) === 0 && (obj.value.charCodeAt(1) & 128) === 0 || // leading 0xFF for negative integer obj.value.charCodeAt(0) === 255 && (obj.value.charCodeAt(1) & 128) === 128)) { value.putBytes(obj.value.substr(1)); } else { value.putBytes(obj.value); } } } bytes.putByte(b1); if (value.length() <= 127) { bytes.putByte(value.length() & 127); } else { var len = value.length(); var lenBytes = ""; do { lenBytes += String.fromCharCode(len & 255); len = len >>> 8; } while (len > 0); bytes.putByte(lenBytes.length | 128); for (var i5 = lenBytes.length - 1; i5 >= 0; --i5) { bytes.putByte(lenBytes.charCodeAt(i5)); } } bytes.putBuffer(value); return bytes; }; asn1.oidToDer = function(oid) { var values = oid.split("."); var bytes = forge.util.createBuffer(); bytes.putByte(40 * parseInt(values[0], 10) + parseInt(values[1], 10)); var last, valueBytes, value, b6; for (var i5 = 2; i5 < values.length; ++i5) { last = true; valueBytes = []; value = parseInt(values[i5], 10); do { b6 = value & 127; value = value >>> 7; if (!last) { b6 |= 128; } valueBytes.push(b6); last = false; } while (value > 0); for (var n6 = valueBytes.length - 1; n6 >= 0; --n6) { bytes.putByte(valueBytes[n6]); } } return bytes; }; asn1.derToOid = function(bytes) { var oid; if (typeof bytes === "string") { bytes = forge.util.createBuffer(bytes); } var b6 = bytes.getByte(); oid = Math.floor(b6 / 40) + "." + b6 % 40; var value = 0; while (bytes.length() > 0) { b6 = bytes.getByte(); value = value << 7; if (b6 & 128) { value += b6 & 127; } else { oid += "." + (value + b6); value = 0; } } return oid; }; asn1.utcTimeToDate = function(utc) { var date = /* @__PURE__ */ new Date(); var year2 = parseInt(utc.substr(0, 2), 10); year2 = year2 >= 50 ? 1900 + year2 : 2e3 + year2; var MM = parseInt(utc.substr(2, 2), 10) - 1; var DD2 = parseInt(utc.substr(4, 2), 10); var hh = parseInt(utc.substr(6, 2), 10); var mm = parseInt(utc.substr(8, 2), 10); var ss = 0; if (utc.length > 11) { var c6 = utc.charAt(10); var end = 10; if (c6 !== "+" && c6 !== "-") { ss = parseInt(utc.substr(10, 2), 10); end += 2; } } date.setUTCFullYear(year2, MM, DD2); date.setUTCHours(hh, mm, ss, 0); if (end) { c6 = utc.charAt(end); if (c6 === "+" || c6 === "-") { var hhoffset = parseInt(utc.substr(end + 1, 2), 10); var mmoffset = parseInt(utc.substr(end + 4, 2), 10); var offset = hhoffset * 60 + mmoffset; offset *= 6e4; if (c6 === "+") { date.setTime(+date - offset); } else { date.setTime(+date + offset); } } } return date; }; asn1.generalizedTimeToDate = function(gentime) { var date = /* @__PURE__ */ new Date(); var YYYY = parseInt(gentime.substr(0, 4), 10); var MM = parseInt(gentime.substr(4, 2), 10) - 1; var DD2 = parseInt(gentime.substr(6, 2), 10); var hh = parseInt(gentime.substr(8, 2), 10); var mm = parseInt(gentime.substr(10, 2), 10); var ss = parseInt(gentime.substr(12, 2), 10); var fff = 0; var offset = 0; var isUTC = false; if (gentime.charAt(gentime.length - 1) === "Z") { isUTC = true; } var end = gentime.length - 5, c6 = gentime.charAt(end); if (c6 === "+" || c6 === "-") { var hhoffset = parseInt(gentime.substr(end + 1, 2), 10); var mmoffset = parseInt(gentime.substr(end + 4, 2), 10); offset = hhoffset * 60 + mmoffset; offset *= 6e4; if (c6 === "+") { offset *= -1; } isUTC = true; } if (gentime.charAt(14) === ".") { fff = parseFloat(gentime.substr(14), 10) * 1e3; } if (isUTC) { date.setUTCFullYear(YYYY, MM, DD2); date.setUTCHours(hh, mm, ss, fff); date.setTime(+date + offset); } else { date.setFullYear(YYYY, MM, DD2); date.setHours(hh, mm, ss, fff); } return date; }; asn1.dateToUtcTime = function(date) { if (typeof date === "string") { return date; } var rval = ""; var format11 = []; format11.push(("" + date.getUTCFullYear()).substr(2)); format11.push("" + (date.getUTCMonth() + 1)); format11.push("" + date.getUTCDate()); format11.push("" + date.getUTCHours()); format11.push("" + date.getUTCMinutes()); format11.push("" + date.getUTCSeconds()); for (var i5 = 0; i5 < format11.length; ++i5) { if (format11[i5].length < 2) { rval += "0"; } rval += format11[i5]; } rval += "Z"; return rval; }; asn1.dateToGeneralizedTime = function(date) { if (typeof date === "string") { return date; } var rval = ""; var format11 = []; format11.push("" + date.getUTCFullYear()); format11.push("" + (date.getUTCMonth() + 1)); format11.push("" + date.getUTCDate()); format11.push("" + date.getUTCHours()); format11.push("" + date.getUTCMinutes()); format11.push("" + date.getUTCSeconds()); for (var i5 = 0; i5 < format11.length; ++i5) { if (format11[i5].length < 2) { rval += "0"; } rval += format11[i5]; } rval += "Z"; return rval; }; asn1.integerToDer = function(x6) { var rval = forge.util.createBuffer(); if (x6 >= -128 && x6 < 128) { return rval.putSignedInt(x6, 8); } if (x6 >= -32768 && x6 < 32768) { return rval.putSignedInt(x6, 16); } if (x6 >= -8388608 && x6 < 8388608) { return rval.putSignedInt(x6, 24); } if (x6 >= -2147483648 && x6 < 2147483648) { return rval.putSignedInt(x6, 32); } var error2 = new Error("Integer too large; max is 32-bits."); error2.integer = x6; throw error2; }; asn1.derToInteger = function(bytes) { if (typeof bytes === "string") { bytes = forge.util.createBuffer(bytes); } var n6 = bytes.length() * 8; if (n6 > 32) { throw new Error("Integer too large; max is 32-bits."); } return bytes.getSignedInt(n6); }; asn1.validate = function(obj, v7, capture, errors) { var rval = false; if ((obj.tagClass === v7.tagClass || typeof v7.tagClass === "undefined") && (obj.type === v7.type || typeof v7.type === "undefined")) { if (obj.constructed === v7.constructed || typeof v7.constructed === "undefined") { rval = true; if (v7.value && forge.util.isArray(v7.value)) { var j6 = 0; for (var i5 = 0; rval && i5 < v7.value.length; ++i5) { rval = v7.value[i5].optional || false; if (obj.value[j6]) { rval = asn1.validate(obj.value[j6], v7.value[i5], capture, errors); if (rval) { ++j6; } else if (v7.value[i5].optional) { rval = true; } } if (!rval && errors) { errors.push( "[" + v7.name + '] Tag class "' + v7.tagClass + '", type "' + v7.type + '" expected value length "' + v7.value.length + '", got "' + obj.value.length + '"' ); } } } if (rval && capture) { if (v7.capture) { capture[v7.capture] = obj.value; } if (v7.captureAsn1) { capture[v7.captureAsn1] = obj; } if (v7.captureBitStringContents && "bitStringContents" in obj) { capture[v7.captureBitStringContents] = obj.bitStringContents; } if (v7.captureBitStringValue && "bitStringContents" in obj) { var value; if (obj.bitStringContents.length < 2) { capture[v7.captureBitStringValue] = ""; } else { var unused = obj.bitStringContents.charCodeAt(0); if (unused !== 0) { throw new Error( "captureBitStringValue only supported for zero unused bits" ); } capture[v7.captureBitStringValue] = obj.bitStringContents.slice(1); } } } } else if (errors) { errors.push( "[" + v7.name + '] Expected constructed "' + v7.constructed + '", got "' + obj.constructed + '"' ); } } else if (errors) { if (obj.tagClass !== v7.tagClass) { errors.push( "[" + v7.name + '] Expected tag class "' + v7.tagClass + '", got "' + obj.tagClass + '"' ); } if (obj.type !== v7.type) { errors.push( "[" + v7.name + '] Expected type "' + v7.type + '", got "' + obj.type + '"' ); } } return rval; }; var _nonLatinRegex = /[^\\u0000-\\u00ff]/; asn1.prettyPrint = function(obj, level, indentation) { var rval = ""; level = level || 0; indentation = indentation || 2; if (level > 0) { rval += "\n"; } var indent = ""; for (var i5 = 0; i5 < level * indentation; ++i5) { indent += " "; } rval += indent + "Tag: "; switch (obj.tagClass) { case asn1.Class.UNIVERSAL: rval += "Universal:"; break; case asn1.Class.APPLICATION: rval += "Application:"; break; case asn1.Class.CONTEXT_SPECIFIC: rval += "Context-Specific:"; break; case asn1.Class.PRIVATE: rval += "Private:"; break; } if (obj.tagClass === asn1.Class.UNIVERSAL) { rval += obj.type; switch (obj.type) { case asn1.Type.NONE: rval += " (None)"; break; case asn1.Type.BOOLEAN: rval += " (Boolean)"; break; case asn1.Type.INTEGER: rval += " (Integer)"; break; case asn1.Type.BITSTRING: rval += " (Bit string)"; break; case asn1.Type.OCTETSTRING: rval += " (Octet string)"; break; case asn1.Type.NULL: rval += " (Null)"; break; case asn1.Type.OID: rval += " (Object Identifier)"; break; case asn1.Type.ODESC: rval += " (Object Descriptor)"; break; case asn1.Type.EXTERNAL: rval += " (External or Instance of)"; break; case asn1.Type.REAL: rval += " (Real)"; break; case asn1.Type.ENUMERATED: rval += " (Enumerated)"; break; case asn1.Type.EMBEDDED: rval += " (Embedded PDV)"; break; case asn1.Type.UTF8: rval += " (UTF8)"; break; case asn1.Type.ROID: rval += " (Relative Object Identifier)"; break; case asn1.Type.SEQUENCE: rval += " (Sequence)"; break; case asn1.Type.SET: rval += " (Set)"; break; case asn1.Type.PRINTABLESTRING: rval += " (Printable String)"; break; case asn1.Type.IA5String: rval += " (IA5String (ASCII))"; break; case asn1.Type.UTCTIME: rval += " (UTC time)"; break; case asn1.Type.GENERALIZEDTIME: rval += " (Generalized time)"; break; case asn1.Type.BMPSTRING: rval += " (BMP String)"; break; } } else { rval += obj.type; } rval += "\n"; rval += indent + "Constructed: " + obj.constructed + "\n"; if (obj.composed) { var subvalues = 0; var sub = ""; for (var i5 = 0; i5 < obj.value.length; ++i5) { if (obj.value[i5] !== void 0) { subvalues += 1; sub += asn1.prettyPrint(obj.value[i5], level + 1, indentation); if (i5 + 1 < obj.value.length) { sub += ","; } } } rval += indent + "Sub values: " + subvalues + sub; } else { rval += indent + "Value: "; if (obj.type === asn1.Type.OID) { var oid = asn1.derToOid(obj.value); rval += oid; if (forge.pki && forge.pki.oids) { if (oid in forge.pki.oids) { rval += " (" + forge.pki.oids[oid] + ") "; } } } if (obj.type === asn1.Type.INTEGER) { try { rval += asn1.derToInteger(obj.value); } catch (ex) { rval += "0x" + forge.util.bytesToHex(obj.value); } } else if (obj.type === asn1.Type.BITSTRING) { if (obj.value.length > 1) { rval += "0x" + forge.util.bytesToHex(obj.value.slice(1)); } else { rval += "(none)"; } if (obj.value.length > 0) { var unused = obj.value.charCodeAt(0); if (unused == 1) { rval += " (1 unused bit shown)"; } else if (unused > 1) { rval += " (" + unused + " unused bits shown)"; } } } else if (obj.type === asn1.Type.OCTETSTRING) { if (!_nonLatinRegex.test(obj.value)) { rval += "(" + obj.value + ") "; } rval += "0x" + forge.util.bytesToHex(obj.value); } else if (obj.type === asn1.Type.UTF8) { try { rval += forge.util.decodeUtf8(obj.value); } catch (e7) { if (e7.message === "URI malformed") { rval += "0x" + forge.util.bytesToHex(obj.value) + " (malformed UTF8)"; } else { throw e7; } } } else if (obj.type === asn1.Type.PRINTABLESTRING || obj.type === asn1.Type.IA5String) { rval += obj.value; } else if (_nonLatinRegex.test(obj.value)) { rval += "0x" + forge.util.bytesToHex(obj.value); } else if (obj.value.length === 0) { rval += "[null]"; } else { rval += obj.value; } } return rval; }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/md.js var require_md = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/md.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); module3.exports = forge.md = forge.md || {}; forge.md.algorithms = forge.md.algorithms || {}; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/hmac.js var require_hmac = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/hmac.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_md(); require_util10(); var hmac2 = module3.exports = forge.hmac = forge.hmac || {}; hmac2.create = function() { var _key = null; var _md = null; var _ipadding = null; var _opadding = null; var ctx = {}; ctx.start = function(md, key) { if (md !== null) { if (typeof md === "string") { md = md.toLowerCase(); if (md in forge.md.algorithms) { _md = forge.md.algorithms[md].create(); } else { throw new Error('Unknown hash algorithm "' + md + '"'); } } else { _md = md; } } if (key === null) { key = _key; } else { if (typeof key === "string") { key = forge.util.createBuffer(key); } else if (forge.util.isArray(key)) { var tmp = key; key = forge.util.createBuffer(); for (var i5 = 0; i5 < tmp.length; ++i5) { key.putByte(tmp[i5]); } } var keylen = key.length(); if (keylen > _md.blockLength) { _md.start(); _md.update(key.bytes()); key = _md.digest(); } _ipadding = forge.util.createBuffer(); _opadding = forge.util.createBuffer(); keylen = key.length(); for (var i5 = 0; i5 < keylen; ++i5) { var tmp = key.at(i5); _ipadding.putByte(54 ^ tmp); _opadding.putByte(92 ^ tmp); } if (keylen < _md.blockLength) { var tmp = _md.blockLength - keylen; for (var i5 = 0; i5 < tmp; ++i5) { _ipadding.putByte(54); _opadding.putByte(92); } } _key = key; _ipadding = _ipadding.bytes(); _opadding = _opadding.bytes(); } _md.start(); _md.update(_ipadding); }; ctx.update = function(bytes) { _md.update(bytes); }; ctx.getMac = function() { var inner = _md.digest().bytes(); _md.start(); _md.update(_opadding); _md.update(inner); return _md.digest(); }; ctx.digest = ctx.getMac; return ctx; }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/md5.js var require_md5 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/md5.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_md(); require_util10(); var md5 = module3.exports = forge.md5 = forge.md5 || {}; forge.md.md5 = forge.md.algorithms.md5 = md5; md5.create = function() { if (!_initialized) { _init(); } var _state = null; var _input = forge.util.createBuffer(); var _w = new Array(16); var md = { algorithm: "md5", blockLength: 64, digestLength: 16, // 56-bit length of message so far (does not including padding) messageLength: 0, // true message length fullMessageLength: null, // size of message length in bytes messageLengthSize: 8 }; md.start = function() { md.messageLength = 0; md.fullMessageLength = md.messageLength64 = []; var int32s = md.messageLengthSize / 4; for (var i5 = 0; i5 < int32s; ++i5) { md.fullMessageLength.push(0); } _input = forge.util.createBuffer(); _state = { h0: 1732584193, h1: 4023233417, h2: 2562383102, h3: 271733878 }; return md; }; md.start(); md.update = function(msg, encoding) { if (encoding === "utf8") { msg = forge.util.encodeUtf8(msg); } var len = msg.length; md.messageLength += len; len = [len / 4294967296 >>> 0, len >>> 0]; for (var i5 = md.fullMessageLength.length - 1; i5 >= 0; --i5) { md.fullMessageLength[i5] += len[1]; len[1] = len[0] + (md.fullMessageLength[i5] / 4294967296 >>> 0); md.fullMessageLength[i5] = md.fullMessageLength[i5] >>> 0; len[0] = len[1] / 4294967296 >>> 0; } _input.putBytes(msg); _update(_state, _w, _input); if (_input.read > 2048 || _input.length() === 0) { _input.compact(); } return md; }; md.digest = function() { var finalBlock = forge.util.createBuffer(); finalBlock.putBytes(_input.bytes()); var remaining = md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize; var overflow = remaining & md.blockLength - 1; finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); var bits, carry = 0; for (var i5 = md.fullMessageLength.length - 1; i5 >= 0; --i5) { bits = md.fullMessageLength[i5] * 8 + carry; carry = bits / 4294967296 >>> 0; finalBlock.putInt32Le(bits >>> 0); } var s22 = { h0: _state.h0, h1: _state.h1, h2: _state.h2, h3: _state.h3 }; _update(s22, _w, finalBlock); var rval = forge.util.createBuffer(); rval.putInt32Le(s22.h0); rval.putInt32Le(s22.h1); rval.putInt32Le(s22.h2); rval.putInt32Le(s22.h3); return rval; }; return md; }; var _padding = null; var _g = null; var _r = null; var _k = null; var _initialized = false; function _init() { _padding = String.fromCharCode(128); _padding += forge.util.fillString(String.fromCharCode(0), 64); _g = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9 ]; _r = [ 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21 ]; _k = new Array(64); for (var i5 = 0; i5 < 64; ++i5) { _k[i5] = Math.floor(Math.abs(Math.sin(i5 + 1)) * 4294967296); } _initialized = true; } __name(_init, "_init"); function _update(s5, w6, bytes) { var t7, a5, b6, c6, d6, f5, r7, i5; var len = bytes.length(); while (len >= 64) { a5 = s5.h0; b6 = s5.h1; c6 = s5.h2; d6 = s5.h3; for (i5 = 0; i5 < 16; ++i5) { w6[i5] = bytes.getInt32Le(); f5 = d6 ^ b6 & (c6 ^ d6); t7 = a5 + f5 + _k[i5] + w6[i5]; r7 = _r[i5]; a5 = d6; d6 = c6; c6 = b6; b6 += t7 << r7 | t7 >>> 32 - r7; } for (; i5 < 32; ++i5) { f5 = c6 ^ d6 & (b6 ^ c6); t7 = a5 + f5 + _k[i5] + w6[_g[i5]]; r7 = _r[i5]; a5 = d6; d6 = c6; c6 = b6; b6 += t7 << r7 | t7 >>> 32 - r7; } for (; i5 < 48; ++i5) { f5 = b6 ^ c6 ^ d6; t7 = a5 + f5 + _k[i5] + w6[_g[i5]]; r7 = _r[i5]; a5 = d6; d6 = c6; c6 = b6; b6 += t7 << r7 | t7 >>> 32 - r7; } for (; i5 < 64; ++i5) { f5 = c6 ^ (b6 | ~d6); t7 = a5 + f5 + _k[i5] + w6[_g[i5]]; r7 = _r[i5]; a5 = d6; d6 = c6; c6 = b6; b6 += t7 << r7 | t7 >>> 32 - r7; } s5.h0 = s5.h0 + a5 | 0; s5.h1 = s5.h1 + b6 | 0; s5.h2 = s5.h2 + c6 | 0; s5.h3 = s5.h3 + d6 | 0; len -= 64; } } __name(_update, "_update"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pem.js var require_pem = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pem.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_util10(); var pem = module3.exports = forge.pem = forge.pem || {}; pem.encode = function(msg, options32) { options32 = options32 || {}; var rval = "-----BEGIN " + msg.type + "-----\r\n"; var header; if (msg.procType) { header = { name: "Proc-Type", values: [String(msg.procType.version), msg.procType.type] }; rval += foldHeader(header); } if (msg.contentDomain) { header = { name: "Content-Domain", values: [msg.contentDomain] }; rval += foldHeader(header); } if (msg.dekInfo) { header = { name: "DEK-Info", values: [msg.dekInfo.algorithm] }; if (msg.dekInfo.parameters) { header.values.push(msg.dekInfo.parameters); } rval += foldHeader(header); } if (msg.headers) { for (var i5 = 0; i5 < msg.headers.length; ++i5) { rval += foldHeader(msg.headers[i5]); } } if (msg.procType) { rval += "\r\n"; } rval += forge.util.encode64(msg.body, options32.maxline || 64) + "\r\n"; rval += "-----END " + msg.type + "-----\r\n"; return rval; }; pem.decode = function(str) { var rval = []; var rMessage = /\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g; var rHeader = /([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/; var rCRLF = /\r?\n/; var match2; while (true) { match2 = rMessage.exec(str); if (!match2) { break; } var type = match2[1]; if (type === "NEW CERTIFICATE REQUEST") { type = "CERTIFICATE REQUEST"; } var msg = { type, procType: null, contentDomain: null, dekInfo: null, headers: [], body: forge.util.decode64(match2[3]) }; rval.push(msg); if (!match2[2]) { continue; } var lines = match2[2].split(rCRLF); var li = 0; while (match2 && li < lines.length) { var line = lines[li].replace(/\s+$/, ""); for (var nl = li + 1; nl < lines.length; ++nl) { var next = lines[nl]; if (!/\s/.test(next[0])) { break; } line += next; li = nl; } match2 = line.match(rHeader); if (match2) { var header = { name: match2[1], values: [] }; var values = match2[2].split(","); for (var vi = 0; vi < values.length; ++vi) { header.values.push(ltrim(values[vi])); } if (!msg.procType) { if (header.name !== "Proc-Type") { throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".'); } else if (header.values.length !== 2) { throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.'); } msg.procType = { version: values[0], type: values[1] }; } else if (!msg.contentDomain && header.name === "Content-Domain") { msg.contentDomain = values[0] || ""; } else if (!msg.dekInfo && header.name === "DEK-Info") { if (header.values.length === 0) { throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.'); } msg.dekInfo = { algorithm: values[0], parameters: values[1] || null }; } else { msg.headers.push(header); } } ++li; } if (msg.procType === "ENCRYPTED" && !msg.dekInfo) { throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".'); } } if (rval.length === 0) { throw new Error("Invalid PEM formatted message."); } return rval; }; function foldHeader(header) { var rval = header.name + ": "; var values = []; var insertSpace = /* @__PURE__ */ __name(function(match2, $1) { return " " + $1; }, "insertSpace"); for (var i5 = 0; i5 < header.values.length; ++i5) { values.push(header.values[i5].replace(/^(\S+\r\n)/, insertSpace)); } rval += values.join(",") + "\r\n"; var length = 0; var candidate = -1; for (var i5 = 0; i5 < rval.length; ++i5, ++length) { if (length > 65 && candidate !== -1) { var insert = rval[candidate]; if (insert === ",") { ++candidate; rval = rval.substr(0, candidate) + "\r\n " + rval.substr(candidate); } else { rval = rval.substr(0, candidate) + "\r\n" + insert + rval.substr(candidate + 1); } length = i5 - candidate - 1; candidate = -1; ++i5; } else if (rval[i5] === " " || rval[i5] === " " || rval[i5] === ",") { candidate = i5; } } return rval; } __name(foldHeader, "foldHeader"); function ltrim(str) { return str.replace(/^\s+/, ""); } __name(ltrim, "ltrim"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/des.js var require_des = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/des.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_cipher(); require_cipherModes(); require_util10(); module3.exports = forge.des = forge.des || {}; forge.des.startEncrypting = function(key, iv, output, mode) { var cipher = _createCipher({ key, output, decrypt: false, mode: mode || (iv === null ? "ECB" : "CBC") }); cipher.start(iv); return cipher; }; forge.des.createEncryptionCipher = function(key, mode) { return _createCipher({ key, output: null, decrypt: false, mode }); }; forge.des.startDecrypting = function(key, iv, output, mode) { var cipher = _createCipher({ key, output, decrypt: true, mode: mode || (iv === null ? "ECB" : "CBC") }); cipher.start(iv); return cipher; }; forge.des.createDecryptionCipher = function(key, mode) { return _createCipher({ key, output: null, decrypt: true, mode }); }; forge.des.Algorithm = function(name2, mode) { var self2 = this; self2.name = name2; self2.mode = new mode({ blockSize: 8, cipher: { encrypt: function(inBlock, outBlock) { return _updateBlock(self2._keys, inBlock, outBlock, false); }, decrypt: function(inBlock, outBlock) { return _updateBlock(self2._keys, inBlock, outBlock, true); } } }); self2._init = false; }; forge.des.Algorithm.prototype.initialize = function(options32) { if (this._init) { return; } var key = forge.util.createBuffer(options32.key); if (this.name.indexOf("3DES") === 0) { if (key.length() !== 24) { throw new Error("Invalid Triple-DES key size: " + key.length() * 8); } } this._keys = _createKeys(key); this._init = true; }; registerAlgorithm("DES-ECB", forge.cipher.modes.ecb); registerAlgorithm("DES-CBC", forge.cipher.modes.cbc); registerAlgorithm("DES-CFB", forge.cipher.modes.cfb); registerAlgorithm("DES-OFB", forge.cipher.modes.ofb); registerAlgorithm("DES-CTR", forge.cipher.modes.ctr); registerAlgorithm("3DES-ECB", forge.cipher.modes.ecb); registerAlgorithm("3DES-CBC", forge.cipher.modes.cbc); registerAlgorithm("3DES-CFB", forge.cipher.modes.cfb); registerAlgorithm("3DES-OFB", forge.cipher.modes.ofb); registerAlgorithm("3DES-CTR", forge.cipher.modes.ctr); function registerAlgorithm(name2, mode) { var factory = /* @__PURE__ */ __name(function() { return new forge.des.Algorithm(name2, mode); }, "factory"); forge.cipher.registerAlgorithm(name2, factory); } __name(registerAlgorithm, "registerAlgorithm"); var spfunction1 = [16843776, 0, 65536, 16843780, 16842756, 66564, 4, 65536, 1024, 16843776, 16843780, 1024, 16778244, 16842756, 16777216, 4, 1028, 16778240, 16778240, 66560, 66560, 16842752, 16842752, 16778244, 65540, 16777220, 16777220, 65540, 0, 1028, 66564, 16777216, 65536, 16843780, 4, 16842752, 16843776, 16777216, 16777216, 1024, 16842756, 65536, 66560, 16777220, 1024, 4, 16778244, 66564, 16843780, 65540, 16842752, 16778244, 16777220, 1028, 66564, 16843776, 1028, 16778240, 16778240, 0, 65540, 66560, 0, 16842756]; var spfunction2 = [-2146402272, -2147450880, 32768, 1081376, 1048576, 32, -2146435040, -2147450848, -2147483616, -2146402272, -2146402304, -2147483648, -2147450880, 1048576, 32, -2146435040, 1081344, 1048608, -2147450848, 0, -2147483648, 32768, 1081376, -2146435072, 1048608, -2147483616, 0, 1081344, 32800, -2146402304, -2146435072, 32800, 0, 1081376, -2146435040, 1048576, -2147450848, -2146435072, -2146402304, 32768, -2146435072, -2147450880, 32, -2146402272, 1081376, 32, 32768, -2147483648, 32800, -2146402304, 1048576, -2147483616, 1048608, -2147450848, -2147483616, 1048608, 1081344, 0, -2147450880, 32800, -2147483648, -2146435040, -2146402272, 1081344]; var spfunction3 = [520, 134349312, 0, 134348808, 134218240, 0, 131592, 134218240, 131080, 134217736, 134217736, 131072, 134349320, 131080, 134348800, 520, 134217728, 8, 134349312, 512, 131584, 134348800, 134348808, 131592, 134218248, 131584, 131072, 134218248, 8, 134349320, 512, 134217728, 134349312, 134217728, 131080, 520, 131072, 134349312, 134218240, 0, 512, 131080, 134349320, 134218240, 134217736, 512, 0, 134348808, 134218248, 131072, 134217728, 134349320, 8, 131592, 131584, 134217736, 134348800, 134218248, 520, 134348800, 131592, 8, 134348808, 131584]; var spfunction4 = [8396801, 8321, 8321, 128, 8396928, 8388737, 8388609, 8193, 0, 8396800, 8396800, 8396929, 129, 0, 8388736, 8388609, 1, 8192, 8388608, 8396801, 128, 8388608, 8193, 8320, 8388737, 1, 8320, 8388736, 8192, 8396928, 8396929, 129, 8388736, 8388609, 8396800, 8396929, 129, 0, 0, 8396800, 8320, 8388736, 8388737, 1, 8396801, 8321, 8321, 128, 8396929, 129, 1, 8192, 8388609, 8193, 8396928, 8388737, 8193, 8320, 8388608, 8396801, 128, 8388608, 8192, 8396928]; var spfunction5 = [256, 34078976, 34078720, 1107296512, 524288, 256, 1073741824, 34078720, 1074266368, 524288, 33554688, 1074266368, 1107296512, 1107820544, 524544, 1073741824, 33554432, 1074266112, 1074266112, 0, 1073742080, 1107820800, 1107820800, 33554688, 1107820544, 1073742080, 0, 1107296256, 34078976, 33554432, 1107296256, 524544, 524288, 1107296512, 256, 33554432, 1073741824, 34078720, 1107296512, 1074266368, 33554688, 1073741824, 1107820544, 34078976, 1074266368, 256, 33554432, 1107820544, 1107820800, 524544, 1107296256, 1107820800, 34078720, 0, 1074266112, 1107296256, 524544, 33554688, 1073742080, 524288, 0, 1074266112, 34078976, 1073742080]; var spfunction6 = [536870928, 541065216, 16384, 541081616, 541065216, 16, 541081616, 4194304, 536887296, 4210704, 4194304, 536870928, 4194320, 536887296, 536870912, 16400, 0, 4194320, 536887312, 16384, 4210688, 536887312, 16, 541065232, 541065232, 0, 4210704, 541081600, 16400, 4210688, 541081600, 536870912, 536887296, 16, 541065232, 4210688, 541081616, 4194304, 16400, 536870928, 4194304, 536887296, 536870912, 16400, 536870928, 541081616, 4210688, 541065216, 4210704, 541081600, 0, 541065232, 16, 16384, 541065216, 4210704, 16384, 4194320, 536887312, 0, 541081600, 536870912, 4194320, 536887312]; var spfunction7 = [2097152, 69206018, 67110914, 0, 2048, 67110914, 2099202, 69208064, 69208066, 2097152, 0, 67108866, 2, 67108864, 69206018, 2050, 67110912, 2099202, 2097154, 67110912, 67108866, 69206016, 69208064, 2097154, 69206016, 2048, 2050, 69208066, 2099200, 2, 67108864, 2099200, 67108864, 2099200, 2097152, 67110914, 67110914, 69206018, 69206018, 2, 2097154, 67108864, 67110912, 2097152, 69208064, 2050, 2099202, 69208064, 2050, 67108866, 69208066, 69206016, 2099200, 0, 2, 69208066, 0, 2099202, 69206016, 2048, 67108866, 67110912, 2048, 2097154]; var spfunction8 = [268439616, 4096, 262144, 268701760, 268435456, 268439616, 64, 268435456, 262208, 268697600, 268701760, 266240, 268701696, 266304, 4096, 64, 268697600, 268435520, 268439552, 4160, 266240, 262208, 268697664, 268701696, 4160, 0, 0, 268697664, 268435520, 268439552, 266304, 262144, 266304, 262144, 268701696, 4096, 64, 268697664, 4096, 266304, 268439552, 64, 268435520, 268697600, 268697664, 268435456, 262144, 268439616, 0, 268701760, 262208, 268435520, 268697600, 268439552, 268439616, 0, 268701760, 266240, 266240, 4160, 4160, 262208, 268435456, 268701696]; function _createKeys(key) { var pc2bytes0 = [0, 4, 536870912, 536870916, 65536, 65540, 536936448, 536936452, 512, 516, 536871424, 536871428, 66048, 66052, 536936960, 536936964], pc2bytes1 = [0, 1, 1048576, 1048577, 67108864, 67108865, 68157440, 68157441, 256, 257, 1048832, 1048833, 67109120, 67109121, 68157696, 68157697], pc2bytes2 = [0, 8, 2048, 2056, 16777216, 16777224, 16779264, 16779272, 0, 8, 2048, 2056, 16777216, 16777224, 16779264, 16779272], pc2bytes3 = [0, 2097152, 134217728, 136314880, 8192, 2105344, 134225920, 136323072, 131072, 2228224, 134348800, 136445952, 139264, 2236416, 134356992, 136454144], pc2bytes4 = [0, 262144, 16, 262160, 0, 262144, 16, 262160, 4096, 266240, 4112, 266256, 4096, 266240, 4112, 266256], pc2bytes5 = [0, 1024, 32, 1056, 0, 1024, 32, 1056, 33554432, 33555456, 33554464, 33555488, 33554432, 33555456, 33554464, 33555488], pc2bytes6 = [0, 268435456, 524288, 268959744, 2, 268435458, 524290, 268959746, 0, 268435456, 524288, 268959744, 2, 268435458, 524290, 268959746], pc2bytes7 = [0, 65536, 2048, 67584, 536870912, 536936448, 536872960, 536938496, 131072, 196608, 133120, 198656, 537001984, 537067520, 537004032, 537069568], pc2bytes8 = [0, 262144, 0, 262144, 2, 262146, 2, 262146, 33554432, 33816576, 33554432, 33816576, 33554434, 33816578, 33554434, 33816578], pc2bytes9 = [0, 268435456, 8, 268435464, 0, 268435456, 8, 268435464, 1024, 268436480, 1032, 268436488, 1024, 268436480, 1032, 268436488], pc2bytes10 = [0, 32, 0, 32, 1048576, 1048608, 1048576, 1048608, 8192, 8224, 8192, 8224, 1056768, 1056800, 1056768, 1056800], pc2bytes11 = [0, 16777216, 512, 16777728, 2097152, 18874368, 2097664, 18874880, 67108864, 83886080, 67109376, 83886592, 69206016, 85983232, 69206528, 85983744], pc2bytes12 = [0, 4096, 134217728, 134221824, 524288, 528384, 134742016, 134746112, 16, 4112, 134217744, 134221840, 524304, 528400, 134742032, 134746128], pc2bytes13 = [0, 4, 256, 260, 0, 4, 256, 260, 1, 5, 257, 261, 1, 5, 257, 261]; var iterations = key.length() > 8 ? 3 : 1; var keys = []; var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0]; var n6 = 0, tmp; for (var j6 = 0; j6 < iterations; j6++) { var left2 = key.getInt32(); var right2 = key.getInt32(); tmp = (left2 >>> 4 ^ right2) & 252645135; right2 ^= tmp; left2 ^= tmp << 4; tmp = (right2 >>> -16 ^ left2) & 65535; left2 ^= tmp; right2 ^= tmp << -16; tmp = (left2 >>> 2 ^ right2) & 858993459; right2 ^= tmp; left2 ^= tmp << 2; tmp = (right2 >>> -16 ^ left2) & 65535; left2 ^= tmp; right2 ^= tmp << -16; tmp = (left2 >>> 1 ^ right2) & 1431655765; right2 ^= tmp; left2 ^= tmp << 1; tmp = (right2 >>> 8 ^ left2) & 16711935; left2 ^= tmp; right2 ^= tmp << 8; tmp = (left2 >>> 1 ^ right2) & 1431655765; right2 ^= tmp; left2 ^= tmp << 1; tmp = left2 << 8 | right2 >>> 20 & 240; left2 = right2 << 24 | right2 << 8 & 16711680 | right2 >>> 8 & 65280 | right2 >>> 24 & 240; right2 = tmp; for (var i5 = 0; i5 < shifts.length; ++i5) { if (shifts[i5]) { left2 = left2 << 2 | left2 >>> 26; right2 = right2 << 2 | right2 >>> 26; } else { left2 = left2 << 1 | left2 >>> 27; right2 = right2 << 1 | right2 >>> 27; } left2 &= -15; right2 &= -15; var lefttmp = pc2bytes0[left2 >>> 28] | pc2bytes1[left2 >>> 24 & 15] | pc2bytes2[left2 >>> 20 & 15] | pc2bytes3[left2 >>> 16 & 15] | pc2bytes4[left2 >>> 12 & 15] | pc2bytes5[left2 >>> 8 & 15] | pc2bytes6[left2 >>> 4 & 15]; var righttmp = pc2bytes7[right2 >>> 28] | pc2bytes8[right2 >>> 24 & 15] | pc2bytes9[right2 >>> 20 & 15] | pc2bytes10[right2 >>> 16 & 15] | pc2bytes11[right2 >>> 12 & 15] | pc2bytes12[right2 >>> 8 & 15] | pc2bytes13[right2 >>> 4 & 15]; tmp = (righttmp >>> 16 ^ lefttmp) & 65535; keys[n6++] = lefttmp ^ tmp; keys[n6++] = righttmp ^ tmp << 16; } } return keys; } __name(_createKeys, "_createKeys"); function _updateBlock(keys, input, output, decrypt) { var iterations = keys.length === 32 ? 3 : 9; var looping; if (iterations === 3) { looping = decrypt ? [30, -2, -2] : [0, 32, 2]; } else { looping = decrypt ? [94, 62, -2, 32, 64, 2, 30, -2, -2] : [0, 32, 2, 62, 30, -2, 64, 96, 2]; } var tmp; var left2 = input[0]; var right2 = input[1]; tmp = (left2 >>> 4 ^ right2) & 252645135; right2 ^= tmp; left2 ^= tmp << 4; tmp = (left2 >>> 16 ^ right2) & 65535; right2 ^= tmp; left2 ^= tmp << 16; tmp = (right2 >>> 2 ^ left2) & 858993459; left2 ^= tmp; right2 ^= tmp << 2; tmp = (right2 >>> 8 ^ left2) & 16711935; left2 ^= tmp; right2 ^= tmp << 8; tmp = (left2 >>> 1 ^ right2) & 1431655765; right2 ^= tmp; left2 ^= tmp << 1; left2 = left2 << 1 | left2 >>> 31; right2 = right2 << 1 | right2 >>> 31; for (var j6 = 0; j6 < iterations; j6 += 3) { var endloop = looping[j6 + 1]; var loopinc = looping[j6 + 2]; for (var i5 = looping[j6]; i5 != endloop; i5 += loopinc) { var right1 = right2 ^ keys[i5]; var right22 = (right2 >>> 4 | right2 << 28) ^ keys[i5 + 1]; tmp = left2; left2 = right2; right2 = tmp ^ (spfunction2[right1 >>> 24 & 63] | spfunction4[right1 >>> 16 & 63] | spfunction6[right1 >>> 8 & 63] | spfunction8[right1 & 63] | spfunction1[right22 >>> 24 & 63] | spfunction3[right22 >>> 16 & 63] | spfunction5[right22 >>> 8 & 63] | spfunction7[right22 & 63]); } tmp = left2; left2 = right2; right2 = tmp; } left2 = left2 >>> 1 | left2 << 31; right2 = right2 >>> 1 | right2 << 31; tmp = (left2 >>> 1 ^ right2) & 1431655765; right2 ^= tmp; left2 ^= tmp << 1; tmp = (right2 >>> 8 ^ left2) & 16711935; left2 ^= tmp; right2 ^= tmp << 8; tmp = (right2 >>> 2 ^ left2) & 858993459; left2 ^= tmp; right2 ^= tmp << 2; tmp = (left2 >>> 16 ^ right2) & 65535; right2 ^= tmp; left2 ^= tmp << 16; tmp = (left2 >>> 4 ^ right2) & 252645135; right2 ^= tmp; left2 ^= tmp << 4; output[0] = left2; output[1] = right2; } __name(_updateBlock, "_updateBlock"); function _createCipher(options32) { options32 = options32 || {}; var mode = (options32.mode || "CBC").toUpperCase(); var algorithm = "DES-" + mode; var cipher; if (options32.decrypt) { cipher = forge.cipher.createDecipher(algorithm, options32.key); } else { cipher = forge.cipher.createCipher(algorithm, options32.key); } var start = cipher.start; cipher.start = function(iv, options33) { var output = null; if (options33 instanceof forge.util.ByteBuffer) { output = options33; options33 = {}; } options33 = options33 || {}; options33.output = output; options33.iv = iv; start.call(cipher, options33); }; return cipher; } __name(_createCipher, "_createCipher"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pbkdf2.js var require_pbkdf2 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pbkdf2.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_hmac(); require_md(); require_util10(); var pkcs5 = forge.pkcs5 = forge.pkcs5 || {}; var crypto8; if (forge.util.isNodejs && !forge.options.usePureJavaScript) { crypto8 = require("crypto"); } module3.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function(p6, s5, c6, dkLen, md, callback) { if (typeof md === "function") { callback = md; md = null; } if (forge.util.isNodejs && !forge.options.usePureJavaScript && crypto8.pbkdf2 && (md === null || typeof md !== "object") && (crypto8.pbkdf2Sync.length > 4 || (!md || md === "sha1"))) { if (typeof md !== "string") { md = "sha1"; } p6 = Buffer.from(p6, "binary"); s5 = Buffer.from(s5, "binary"); if (!callback) { if (crypto8.pbkdf2Sync.length === 4) { return crypto8.pbkdf2Sync(p6, s5, c6, dkLen).toString("binary"); } return crypto8.pbkdf2Sync(p6, s5, c6, dkLen, md).toString("binary"); } if (crypto8.pbkdf2Sync.length === 4) { return crypto8.pbkdf2(p6, s5, c6, dkLen, function(err2, key) { if (err2) { return callback(err2); } callback(null, key.toString("binary")); }); } return crypto8.pbkdf2(p6, s5, c6, dkLen, md, function(err2, key) { if (err2) { return callback(err2); } callback(null, key.toString("binary")); }); } if (typeof md === "undefined" || md === null) { md = "sha1"; } if (typeof md === "string") { if (!(md in forge.md.algorithms)) { throw new Error("Unknown hash algorithm: " + md); } md = forge.md[md].create(); } var hLen = md.digestLength; if (dkLen > 4294967295 * hLen) { var err = new Error("Derived key is too long."); if (callback) { return callback(err); } throw err; } var len = Math.ceil(dkLen / hLen); var r7 = dkLen - (len - 1) * hLen; var prf = forge.hmac.create(); prf.start(md, p6); var dk = ""; var xor, u_c, u_c1; if (!callback) { for (var i5 = 1; i5 <= len; ++i5) { prf.start(null, null); prf.update(s5); prf.update(forge.util.int32ToBytes(i5)); xor = u_c1 = prf.digest().getBytes(); for (var j6 = 2; j6 <= c6; ++j6) { prf.start(null, null); prf.update(u_c1); u_c = prf.digest().getBytes(); xor = forge.util.xorBytes(xor, u_c, hLen); u_c1 = u_c; } dk += i5 < len ? xor : xor.substr(0, r7); } return dk; } var i5 = 1, j6; function outer() { if (i5 > len) { return callback(null, dk); } prf.start(null, null); prf.update(s5); prf.update(forge.util.int32ToBytes(i5)); xor = u_c1 = prf.digest().getBytes(); j6 = 2; inner(); } __name(outer, "outer"); function inner() { if (j6 <= c6) { prf.start(null, null); prf.update(u_c1); u_c = prf.digest().getBytes(); xor = forge.util.xorBytes(xor, u_c, hLen); u_c1 = u_c; ++j6; return forge.util.setImmediate(inner); } dk += i5 < len ? xor : xor.substr(0, r7); ++i5; outer(); } __name(inner, "inner"); outer(); }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/sha256.js var require_sha256 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/sha256.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_md(); require_util10(); var sha256 = module3.exports = forge.sha256 = forge.sha256 || {}; forge.md.sha256 = forge.md.algorithms.sha256 = sha256; sha256.create = function() { if (!_initialized) { _init(); } var _state = null; var _input = forge.util.createBuffer(); var _w = new Array(64); var md = { algorithm: "sha256", blockLength: 64, digestLength: 32, // 56-bit length of message so far (does not including padding) messageLength: 0, // true message length fullMessageLength: null, // size of message length in bytes messageLengthSize: 8 }; md.start = function() { md.messageLength = 0; md.fullMessageLength = md.messageLength64 = []; var int32s = md.messageLengthSize / 4; for (var i5 = 0; i5 < int32s; ++i5) { md.fullMessageLength.push(0); } _input = forge.util.createBuffer(); _state = { h0: 1779033703, h1: 3144134277, h2: 1013904242, h3: 2773480762, h4: 1359893119, h5: 2600822924, h6: 528734635, h7: 1541459225 }; return md; }; md.start(); md.update = function(msg, encoding) { if (encoding === "utf8") { msg = forge.util.encodeUtf8(msg); } var len = msg.length; md.messageLength += len; len = [len / 4294967296 >>> 0, len >>> 0]; for (var i5 = md.fullMessageLength.length - 1; i5 >= 0; --i5) { md.fullMessageLength[i5] += len[1]; len[1] = len[0] + (md.fullMessageLength[i5] / 4294967296 >>> 0); md.fullMessageLength[i5] = md.fullMessageLength[i5] >>> 0; len[0] = len[1] / 4294967296 >>> 0; } _input.putBytes(msg); _update(_state, _w, _input); if (_input.read > 2048 || _input.length() === 0) { _input.compact(); } return md; }; md.digest = function() { var finalBlock = forge.util.createBuffer(); finalBlock.putBytes(_input.bytes()); var remaining = md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize; var overflow = remaining & md.blockLength - 1; finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); var next, carry; var bits = md.fullMessageLength[0] * 8; for (var i5 = 0; i5 < md.fullMessageLength.length - 1; ++i5) { next = md.fullMessageLength[i5 + 1] * 8; carry = next / 4294967296 >>> 0; bits += carry; finalBlock.putInt32(bits >>> 0); bits = next >>> 0; } finalBlock.putInt32(bits); var s22 = { h0: _state.h0, h1: _state.h1, h2: _state.h2, h3: _state.h3, h4: _state.h4, h5: _state.h5, h6: _state.h6, h7: _state.h7 }; _update(s22, _w, finalBlock); var rval = forge.util.createBuffer(); rval.putInt32(s22.h0); rval.putInt32(s22.h1); rval.putInt32(s22.h2); rval.putInt32(s22.h3); rval.putInt32(s22.h4); rval.putInt32(s22.h5); rval.putInt32(s22.h6); rval.putInt32(s22.h7); return rval; }; return md; }; var _padding = null; var _initialized = false; var _k = null; function _init() { _padding = String.fromCharCode(128); _padding += forge.util.fillString(String.fromCharCode(0), 64); _k = [ 1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298 ]; _initialized = true; } __name(_init, "_init"); function _update(s5, w6, bytes) { var t1, t22, s0, s1, ch2, maj, i5, a5, b6, c6, d6, e7, f5, g6, h6; var len = bytes.length(); while (len >= 64) { for (i5 = 0; i5 < 16; ++i5) { w6[i5] = bytes.getInt32(); } for (; i5 < 64; ++i5) { t1 = w6[i5 - 2]; t1 = (t1 >>> 17 | t1 << 15) ^ (t1 >>> 19 | t1 << 13) ^ t1 >>> 10; t22 = w6[i5 - 15]; t22 = (t22 >>> 7 | t22 << 25) ^ (t22 >>> 18 | t22 << 14) ^ t22 >>> 3; w6[i5] = t1 + w6[i5 - 7] + t22 + w6[i5 - 16] | 0; } a5 = s5.h0; b6 = s5.h1; c6 = s5.h2; d6 = s5.h3; e7 = s5.h4; f5 = s5.h5; g6 = s5.h6; h6 = s5.h7; for (i5 = 0; i5 < 64; ++i5) { s1 = (e7 >>> 6 | e7 << 26) ^ (e7 >>> 11 | e7 << 21) ^ (e7 >>> 25 | e7 << 7); ch2 = g6 ^ e7 & (f5 ^ g6); s0 = (a5 >>> 2 | a5 << 30) ^ (a5 >>> 13 | a5 << 19) ^ (a5 >>> 22 | a5 << 10); maj = a5 & b6 | c6 & (a5 ^ b6); t1 = h6 + s1 + ch2 + _k[i5] + w6[i5]; t22 = s0 + maj; h6 = g6; g6 = f5; f5 = e7; e7 = d6 + t1 >>> 0; d6 = c6; c6 = b6; b6 = a5; a5 = t1 + t22 >>> 0; } s5.h0 = s5.h0 + a5 | 0; s5.h1 = s5.h1 + b6 | 0; s5.h2 = s5.h2 + c6 | 0; s5.h3 = s5.h3 + d6 | 0; s5.h4 = s5.h4 + e7 | 0; s5.h5 = s5.h5 + f5 | 0; s5.h6 = s5.h6 + g6 | 0; s5.h7 = s5.h7 + h6 | 0; len -= 64; } } __name(_update, "_update"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/prng.js var require_prng = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/prng.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_util10(); var _crypto = null; if (forge.util.isNodejs && !forge.options.usePureJavaScript && !process.versions["node-webkit"]) { _crypto = require("crypto"); } var prng = module3.exports = forge.prng = forge.prng || {}; prng.create = function(plugin) { var ctx = { plugin, key: null, seed: null, time: null, // number of reseeds so far reseeds: 0, // amount of data generated so far generated: 0, // no initial key bytes keyBytes: "" }; var md = plugin.md; var pools = new Array(32); for (var i5 = 0; i5 < 32; ++i5) { pools[i5] = md.create(); } ctx.pools = pools; ctx.pool = 0; ctx.generate = function(count, callback) { if (!callback) { return ctx.generateSync(count); } var cipher = ctx.plugin.cipher; var increment2 = ctx.plugin.increment; var formatKey = ctx.plugin.formatKey; var formatSeed = ctx.plugin.formatSeed; var b6 = forge.util.createBuffer(); ctx.key = null; generate2(); function generate2(err) { if (err) { return callback(err); } if (b6.length() >= count) { return callback(null, b6.getBytes(count)); } if (ctx.generated > 1048575) { ctx.key = null; } if (ctx.key === null) { return forge.util.nextTick(function() { _reseed(generate2); }); } var bytes = cipher(ctx.key, ctx.seed); ctx.generated += bytes.length; b6.putBytes(bytes); ctx.key = formatKey(cipher(ctx.key, increment2(ctx.seed))); ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); forge.util.setImmediate(generate2); } __name(generate2, "generate"); }; ctx.generateSync = function(count) { var cipher = ctx.plugin.cipher; var increment2 = ctx.plugin.increment; var formatKey = ctx.plugin.formatKey; var formatSeed = ctx.plugin.formatSeed; ctx.key = null; var b6 = forge.util.createBuffer(); while (b6.length() < count) { if (ctx.generated > 1048575) { ctx.key = null; } if (ctx.key === null) { _reseedSync(); } var bytes = cipher(ctx.key, ctx.seed); ctx.generated += bytes.length; b6.putBytes(bytes); ctx.key = formatKey(cipher(ctx.key, increment2(ctx.seed))); ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); } return b6.getBytes(count); }; function _reseed(callback) { if (ctx.pools[0].messageLength >= 32) { _seed(); return callback(); } var needed = 32 - ctx.pools[0].messageLength << 5; ctx.seedFile(needed, function(err, bytes) { if (err) { return callback(err); } ctx.collect(bytes); _seed(); callback(); }); } __name(_reseed, "_reseed"); function _reseedSync() { if (ctx.pools[0].messageLength >= 32) { return _seed(); } var needed = 32 - ctx.pools[0].messageLength << 5; ctx.collect(ctx.seedFileSync(needed)); _seed(); } __name(_reseedSync, "_reseedSync"); function _seed() { ctx.reseeds = ctx.reseeds === 4294967295 ? 0 : ctx.reseeds + 1; var md2 = ctx.plugin.md.create(); md2.update(ctx.keyBytes); var _2powK = 1; for (var k6 = 0; k6 < 32; ++k6) { if (ctx.reseeds % _2powK === 0) { md2.update(ctx.pools[k6].digest().getBytes()); ctx.pools[k6].start(); } _2powK = _2powK << 1; } ctx.keyBytes = md2.digest().getBytes(); md2.start(); md2.update(ctx.keyBytes); var seedBytes = md2.digest().getBytes(); ctx.key = ctx.plugin.formatKey(ctx.keyBytes); ctx.seed = ctx.plugin.formatSeed(seedBytes); ctx.generated = 0; } __name(_seed, "_seed"); function defaultSeedFile(needed) { var getRandomValues = null; var globalScope = forge.util.globalScope; var _crypto2 = globalScope.crypto || globalScope.msCrypto; if (_crypto2 && _crypto2.getRandomValues) { getRandomValues = /* @__PURE__ */ __name(function(arr) { return _crypto2.getRandomValues(arr); }, "getRandomValues"); } var b6 = forge.util.createBuffer(); if (getRandomValues) { while (b6.length() < needed) { var count = Math.max(1, Math.min(needed - b6.length(), 65536) / 4); var entropy = new Uint32Array(Math.floor(count)); try { getRandomValues(entropy); for (var i6 = 0; i6 < entropy.length; ++i6) { b6.putInt32(entropy[i6]); } } catch (e7) { if (!(typeof QuotaExceededError !== "undefined" && e7 instanceof QuotaExceededError)) { throw e7; } } } } if (b6.length() < needed) { var hi, lo, next; var seed = Math.floor(Math.random() * 65536); while (b6.length() < needed) { lo = 16807 * (seed & 65535); hi = 16807 * (seed >> 16); lo += (hi & 32767) << 16; lo += hi >> 15; lo = (lo & 2147483647) + (lo >> 31); seed = lo & 4294967295; for (var i6 = 0; i6 < 3; ++i6) { next = seed >>> (i6 << 3); next ^= Math.floor(Math.random() * 256); b6.putByte(next & 255); } } } return b6.getBytes(needed); } __name(defaultSeedFile, "defaultSeedFile"); if (_crypto) { ctx.seedFile = function(needed, callback) { _crypto.randomBytes(needed, function(err, bytes) { if (err) { return callback(err); } callback(null, bytes.toString()); }); }; ctx.seedFileSync = function(needed) { return _crypto.randomBytes(needed).toString(); }; } else { ctx.seedFile = function(needed, callback) { try { callback(null, defaultSeedFile(needed)); } catch (e7) { callback(e7); } }; ctx.seedFileSync = defaultSeedFile; } ctx.collect = function(bytes) { var count = bytes.length; for (var i6 = 0; i6 < count; ++i6) { ctx.pools[ctx.pool].update(bytes.substr(i6, 1)); ctx.pool = ctx.pool === 31 ? 0 : ctx.pool + 1; } }; ctx.collectInt = function(i6, n6) { var bytes = ""; for (var x6 = 0; x6 < n6; x6 += 8) { bytes += String.fromCharCode(i6 >> x6 & 255); } ctx.collect(bytes); }; ctx.registerWorker = function(worker) { if (worker === self) { ctx.seedFile = function(needed, callback) { function listener2(e7) { var data = e7.data; if (data.forge && data.forge.prng) { self.removeEventListener("message", listener2); callback(data.forge.prng.err, data.forge.prng.bytes); } } __name(listener2, "listener"); self.addEventListener("message", listener2); self.postMessage({ forge: { prng: { needed } } }); }; } else { var listener = /* @__PURE__ */ __name(function(e7) { var data = e7.data; if (data.forge && data.forge.prng) { ctx.seedFile(data.forge.prng.needed, function(err, bytes) { worker.postMessage({ forge: { prng: { err, bytes } } }); }); } }, "listener"); worker.addEventListener("message", listener); } }; return ctx; }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/random.js var require_random2 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/random.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_aes(); require_sha256(); require_prng(); require_util10(); (function() { if (forge.random && forge.random.getBytes) { module3.exports = forge.random; return; } (function(jQuery2) { var prng_aes = {}; var _prng_aes_output = new Array(4); var _prng_aes_buffer = forge.util.createBuffer(); prng_aes.formatKey = function(key2) { var tmp = forge.util.createBuffer(key2); key2 = new Array(4); key2[0] = tmp.getInt32(); key2[1] = tmp.getInt32(); key2[2] = tmp.getInt32(); key2[3] = tmp.getInt32(); return forge.aes._expandKey(key2, false); }; prng_aes.formatSeed = function(seed) { var tmp = forge.util.createBuffer(seed); seed = new Array(4); seed[0] = tmp.getInt32(); seed[1] = tmp.getInt32(); seed[2] = tmp.getInt32(); seed[3] = tmp.getInt32(); return seed; }; prng_aes.cipher = function(key2, seed) { forge.aes._updateBlock(key2, seed, _prng_aes_output, false); _prng_aes_buffer.putInt32(_prng_aes_output[0]); _prng_aes_buffer.putInt32(_prng_aes_output[1]); _prng_aes_buffer.putInt32(_prng_aes_output[2]); _prng_aes_buffer.putInt32(_prng_aes_output[3]); return _prng_aes_buffer.getBytes(); }; prng_aes.increment = function(seed) { ++seed[3]; return seed; }; prng_aes.md = forge.md.sha256; function spawnPrng() { var ctx = forge.prng.create(prng_aes); ctx.getBytes = function(count, callback) { return ctx.generate(count, callback); }; ctx.getBytesSync = function(count) { return ctx.generate(count); }; return ctx; } __name(spawnPrng, "spawnPrng"); var _ctx = spawnPrng(); var getRandomValues = null; var globalScope = forge.util.globalScope; var _crypto = globalScope.crypto || globalScope.msCrypto; if (_crypto && _crypto.getRandomValues) { getRandomValues = /* @__PURE__ */ __name(function(arr) { return _crypto.getRandomValues(arr); }, "getRandomValues"); } if (forge.options.usePureJavaScript || !forge.util.isNodejs && !getRandomValues) { if (typeof window === "undefined" || window.document === void 0) { } _ctx.collectInt(+/* @__PURE__ */ new Date(), 32); if (typeof navigator !== "undefined") { var _navBytes = ""; for (var key in navigator) { try { if (typeof navigator[key] == "string") { _navBytes += navigator[key]; } } catch (e7) { } } _ctx.collect(_navBytes); _navBytes = null; } if (jQuery2) { jQuery2().mousemove(function(e7) { _ctx.collectInt(e7.clientX, 16); _ctx.collectInt(e7.clientY, 16); }); jQuery2().keypress(function(e7) { _ctx.collectInt(e7.charCode, 8); }); } } if (!forge.random) { forge.random = _ctx; } else { for (var key in _ctx) { forge.random[key] = _ctx[key]; } } forge.random.createInstance = spawnPrng; module3.exports = forge.random; })(typeof jQuery !== "undefined" ? jQuery : null); })(); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/rc2.js var require_rc2 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/rc2.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_util10(); var piTable = [ 217, 120, 249, 196, 25, 221, 181, 237, 40, 233, 253, 121, 74, 160, 216, 157, 198, 126, 55, 131, 43, 118, 83, 142, 98, 76, 100, 136, 68, 139, 251, 162, 23, 154, 89, 245, 135, 179, 79, 19, 97, 69, 109, 141, 9, 129, 125, 50, 189, 143, 64, 235, 134, 183, 123, 11, 240, 149, 33, 34, 92, 107, 78, 130, 84, 214, 101, 147, 206, 96, 178, 28, 115, 86, 192, 20, 167, 140, 241, 220, 18, 117, 202, 31, 59, 190, 228, 209, 66, 61, 212, 48, 163, 60, 182, 38, 111, 191, 14, 218, 70, 105, 7, 87, 39, 242, 29, 155, 188, 148, 67, 3, 248, 17, 199, 246, 144, 239, 62, 231, 6, 195, 213, 47, 200, 102, 30, 215, 8, 232, 234, 222, 128, 82, 238, 247, 132, 170, 114, 172, 53, 77, 106, 42, 150, 26, 210, 113, 90, 21, 73, 116, 75, 159, 208, 94, 4, 24, 164, 236, 194, 224, 65, 110, 15, 81, 203, 204, 36, 145, 175, 80, 161, 244, 112, 57, 153, 124, 58, 133, 35, 184, 180, 122, 252, 2, 54, 91, 37, 85, 151, 49, 45, 93, 250, 152, 227, 138, 146, 174, 5, 223, 41, 16, 103, 108, 186, 201, 211, 0, 230, 207, 225, 158, 168, 44, 99, 22, 1, 63, 88, 226, 137, 169, 13, 56, 52, 27, 171, 51, 255, 176, 187, 72, 12, 95, 185, 177, 205, 46, 197, 243, 219, 71, 229, 165, 156, 119, 10, 166, 32, 104, 254, 127, 193, 173 ]; var s5 = [1, 2, 3, 5]; var rol = /* @__PURE__ */ __name(function(word, bits) { return word << bits & 65535 | (word & 65535) >> 16 - bits; }, "rol"); var ror = /* @__PURE__ */ __name(function(word, bits) { return (word & 65535) >> bits | word << 16 - bits & 65535; }, "ror"); module3.exports = forge.rc2 = forge.rc2 || {}; forge.rc2.expandKey = function(key, effKeyBits) { if (typeof key === "string") { key = forge.util.createBuffer(key); } effKeyBits = effKeyBits || 128; var L3 = key; var T3 = key.length(); var T1 = effKeyBits; var T8 = Math.ceil(T1 / 8); var TM = 255 >> (T1 & 7); var i5; for (i5 = T3; i5 < 128; i5++) { L3.putByte(piTable[L3.at(i5 - 1) + L3.at(i5 - T3) & 255]); } L3.setAt(128 - T8, piTable[L3.at(128 - T8) & TM]); for (i5 = 127 - T8; i5 >= 0; i5--) { L3.setAt(i5, piTable[L3.at(i5 + 1) ^ L3.at(i5 + T8)]); } return L3; }; var createCipher = /* @__PURE__ */ __name(function(key, bits, encrypt) { var _finish = false, _input = null, _output = null, _iv = null; var mixRound, mashRound; var i5, j6, K3 = []; key = forge.rc2.expandKey(key, bits); for (i5 = 0; i5 < 64; i5++) { K3.push(key.getInt16Le()); } if (encrypt) { mixRound = /* @__PURE__ */ __name(function(R3) { for (i5 = 0; i5 < 4; i5++) { R3[i5] += K3[j6] + (R3[(i5 + 3) % 4] & R3[(i5 + 2) % 4]) + (~R3[(i5 + 3) % 4] & R3[(i5 + 1) % 4]); R3[i5] = rol(R3[i5], s5[i5]); j6++; } }, "mixRound"); mashRound = /* @__PURE__ */ __name(function(R3) { for (i5 = 0; i5 < 4; i5++) { R3[i5] += K3[R3[(i5 + 3) % 4] & 63]; } }, "mashRound"); } else { mixRound = /* @__PURE__ */ __name(function(R3) { for (i5 = 3; i5 >= 0; i5--) { R3[i5] = ror(R3[i5], s5[i5]); R3[i5] -= K3[j6] + (R3[(i5 + 3) % 4] & R3[(i5 + 2) % 4]) + (~R3[(i5 + 3) % 4] & R3[(i5 + 1) % 4]); j6--; } }, "mixRound"); mashRound = /* @__PURE__ */ __name(function(R3) { for (i5 = 3; i5 >= 0; i5--) { R3[i5] -= K3[R3[(i5 + 3) % 4] & 63]; } }, "mashRound"); } var runPlan = /* @__PURE__ */ __name(function(plan) { var R3 = []; for (i5 = 0; i5 < 4; i5++) { var val2 = _input.getInt16Le(); if (_iv !== null) { if (encrypt) { val2 ^= _iv.getInt16Le(); } else { _iv.putInt16Le(val2); } } R3.push(val2 & 65535); } j6 = encrypt ? 0 : 63; for (var ptr = 0; ptr < plan.length; ptr++) { for (var ctr = 0; ctr < plan[ptr][0]; ctr++) { plan[ptr][1](R3); } } for (i5 = 0; i5 < 4; i5++) { if (_iv !== null) { if (encrypt) { _iv.putInt16Le(R3[i5]); } else { R3[i5] ^= _iv.getInt16Le(); } } _output.putInt16Le(R3[i5]); } }, "runPlan"); var cipher = null; cipher = { /** * Starts or restarts the encryption or decryption process, whichever * was previously configured. * * To use the cipher in CBC mode, iv may be given either as a string * of bytes, or as a byte buffer. For ECB mode, give null as iv. * * @param iv the initialization vector to use, null for ECB mode. * @param output the output the buffer to write to, null to create one. */ start: function(iv, output) { if (iv) { if (typeof iv === "string") { iv = forge.util.createBuffer(iv); } } _finish = false; _input = forge.util.createBuffer(); _output = output || new forge.util.createBuffer(); _iv = iv; cipher.output = _output; }, /** * Updates the next block. * * @param input the buffer to read from. */ update: function(input) { if (!_finish) { _input.putBuffer(input); } while (_input.length() >= 8) { runPlan([ [5, mixRound], [1, mashRound], [6, mixRound], [1, mashRound], [5, mixRound] ]); } }, /** * Finishes encrypting or decrypting. * * @param pad a padding function to use, null for PKCS#7 padding, * signature(blockSize, buffer, decrypt). * * @return true if successful, false on error. */ finish: function(pad2) { var rval = true; if (encrypt) { if (pad2) { rval = pad2(8, _input, !encrypt); } else { var padding = _input.length() === 8 ? 8 : 8 - _input.length(); _input.fillWithByte(padding, padding); } } if (rval) { _finish = true; cipher.update(); } if (!encrypt) { rval = _input.length() === 0; if (rval) { if (pad2) { rval = pad2(8, _output, !encrypt); } else { var len = _output.length(); var count = _output.at(len - 1); if (count > len) { rval = false; } else { _output.truncate(count); } } } } return rval; } }; return cipher; }, "createCipher"); forge.rc2.startEncrypting = function(key, iv, output) { var cipher = forge.rc2.createEncryptionCipher(key, 128); cipher.start(iv, output); return cipher; }; forge.rc2.createEncryptionCipher = function(key, bits) { return createCipher(key, bits, true); }; forge.rc2.startDecrypting = function(key, iv, output) { var cipher = forge.rc2.createDecryptionCipher(key, 128); cipher.start(iv, output); return cipher; }; forge.rc2.createDecryptionCipher = function(key, bits) { return createCipher(key, bits, false); }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/jsbn.js var require_jsbn = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/jsbn.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); module3.exports = forge.jsbn = forge.jsbn || {}; var dbits; var canary = 244837814094590; var j_lm = (canary & 16777215) == 15715070; function BigInteger(a5, b6, c6) { this.data = []; if (a5 != null) if ("number" == typeof a5) this.fromNumber(a5, b6, c6); else if (b6 == null && "string" != typeof a5) this.fromString(a5, 256); else this.fromString(a5, b6); } __name(BigInteger, "BigInteger"); forge.jsbn.BigInteger = BigInteger; function nbi() { return new BigInteger(null); } __name(nbi, "nbi"); function am1(i5, x6, w6, j6, c6, n6) { while (--n6 >= 0) { var v7 = x6 * this.data[i5++] + w6.data[j6] + c6; c6 = Math.floor(v7 / 67108864); w6.data[j6++] = v7 & 67108863; } return c6; } __name(am1, "am1"); function am22(i5, x6, w6, j6, c6, n6) { var xl = x6 & 32767, xh = x6 >> 15; while (--n6 >= 0) { var l6 = this.data[i5] & 32767; var h6 = this.data[i5++] >> 15; var m6 = xh * l6 + h6 * xl; l6 = xl * l6 + ((m6 & 32767) << 15) + w6.data[j6] + (c6 & 1073741823); c6 = (l6 >>> 30) + (m6 >>> 15) + xh * h6 + (c6 >>> 30); w6.data[j6++] = l6 & 1073741823; } return c6; } __name(am22, "am2"); function am3(i5, x6, w6, j6, c6, n6) { var xl = x6 & 16383, xh = x6 >> 14; while (--n6 >= 0) { var l6 = this.data[i5] & 16383; var h6 = this.data[i5++] >> 14; var m6 = xh * l6 + h6 * xl; l6 = xl * l6 + ((m6 & 16383) << 14) + w6.data[j6] + c6; c6 = (l6 >> 28) + (m6 >> 14) + xh * h6; w6.data[j6++] = l6 & 268435455; } return c6; } __name(am3, "am3"); if (typeof navigator === "undefined") { BigInteger.prototype.am = am3; dbits = 28; } else if (j_lm && navigator.appName == "Microsoft Internet Explorer") { BigInteger.prototype.am = am22; dbits = 30; } else if (j_lm && navigator.appName != "Netscape") { BigInteger.prototype.am = am1; dbits = 26; } else { BigInteger.prototype.am = am3; dbits = 28; } BigInteger.prototype.DB = dbits; BigInteger.prototype.DM = (1 << dbits) - 1; BigInteger.prototype.DV = 1 << dbits; var BI_FP = 52; BigInteger.prototype.FV = Math.pow(2, BI_FP); BigInteger.prototype.F1 = BI_FP - dbits; BigInteger.prototype.F2 = 2 * dbits - BI_FP; var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"; var BI_RC = new Array(); var rr; var vv; rr = "0".charCodeAt(0); for (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv; rr = "a".charCodeAt(0); for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; rr = "A".charCodeAt(0); for (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; function int2char(n6) { return BI_RM.charAt(n6); } __name(int2char, "int2char"); function intAt(s5, i5) { var c6 = BI_RC[s5.charCodeAt(i5)]; return c6 == null ? -1 : c6; } __name(intAt, "intAt"); function bnpCopyTo(r7) { for (var i5 = this.t - 1; i5 >= 0; --i5) r7.data[i5] = this.data[i5]; r7.t = this.t; r7.s = this.s; } __name(bnpCopyTo, "bnpCopyTo"); function bnpFromInt(x6) { this.t = 1; this.s = x6 < 0 ? -1 : 0; if (x6 > 0) this.data[0] = x6; else if (x6 < -1) this.data[0] = x6 + this.DV; else this.t = 0; } __name(bnpFromInt, "bnpFromInt"); function nbv(i5) { var r7 = nbi(); r7.fromInt(i5); return r7; } __name(nbv, "nbv"); function bnpFromString(s5, b6) { var k6; if (b6 == 16) k6 = 4; else if (b6 == 8) k6 = 3; else if (b6 == 256) k6 = 8; else if (b6 == 2) k6 = 1; else if (b6 == 32) k6 = 5; else if (b6 == 4) k6 = 2; else { this.fromRadix(s5, b6); return; } this.t = 0; this.s = 0; var i5 = s5.length, mi = false, sh = 0; while (--i5 >= 0) { var x6 = k6 == 8 ? s5[i5] & 255 : intAt(s5, i5); if (x6 < 0) { if (s5.charAt(i5) == "-") mi = true; continue; } mi = false; if (sh == 0) this.data[this.t++] = x6; else if (sh + k6 > this.DB) { this.data[this.t - 1] |= (x6 & (1 << this.DB - sh) - 1) << sh; this.data[this.t++] = x6 >> this.DB - sh; } else this.data[this.t - 1] |= x6 << sh; sh += k6; if (sh >= this.DB) sh -= this.DB; } if (k6 == 8 && (s5[0] & 128) != 0) { this.s = -1; if (sh > 0) this.data[this.t - 1] |= (1 << this.DB - sh) - 1 << sh; } this.clamp(); if (mi) BigInteger.ZERO.subTo(this, this); } __name(bnpFromString, "bnpFromString"); function bnpClamp() { var c6 = this.s & this.DM; while (this.t > 0 && this.data[this.t - 1] == c6) --this.t; } __name(bnpClamp, "bnpClamp"); function bnToString(b6) { if (this.s < 0) return "-" + this.negate().toString(b6); var k6; if (b6 == 16) k6 = 4; else if (b6 == 8) k6 = 3; else if (b6 == 2) k6 = 1; else if (b6 == 32) k6 = 5; else if (b6 == 4) k6 = 2; else return this.toRadix(b6); var km = (1 << k6) - 1, d6, m6 = false, r7 = "", i5 = this.t; var p6 = this.DB - i5 * this.DB % k6; if (i5-- > 0) { if (p6 < this.DB && (d6 = this.data[i5] >> p6) > 0) { m6 = true; r7 = int2char(d6); } while (i5 >= 0) { if (p6 < k6) { d6 = (this.data[i5] & (1 << p6) - 1) << k6 - p6; d6 |= this.data[--i5] >> (p6 += this.DB - k6); } else { d6 = this.data[i5] >> (p6 -= k6) & km; if (p6 <= 0) { p6 += this.DB; --i5; } } if (d6 > 0) m6 = true; if (m6) r7 += int2char(d6); } } return m6 ? r7 : "0"; } __name(bnToString, "bnToString"); function bnNegate() { var r7 = nbi(); BigInteger.ZERO.subTo(this, r7); return r7; } __name(bnNegate, "bnNegate"); function bnAbs() { return this.s < 0 ? this.negate() : this; } __name(bnAbs, "bnAbs"); function bnCompareTo(a5) { var r7 = this.s - a5.s; if (r7 != 0) return r7; var i5 = this.t; r7 = i5 - a5.t; if (r7 != 0) return this.s < 0 ? -r7 : r7; while (--i5 >= 0) if ((r7 = this.data[i5] - a5.data[i5]) != 0) return r7; return 0; } __name(bnCompareTo, "bnCompareTo"); function nbits(x6) { var r7 = 1, t7; if ((t7 = x6 >>> 16) != 0) { x6 = t7; r7 += 16; } if ((t7 = x6 >> 8) != 0) { x6 = t7; r7 += 8; } if ((t7 = x6 >> 4) != 0) { x6 = t7; r7 += 4; } if ((t7 = x6 >> 2) != 0) { x6 = t7; r7 += 2; } if ((t7 = x6 >> 1) != 0) { x6 = t7; r7 += 1; } return r7; } __name(nbits, "nbits"); function bnBitLength() { if (this.t <= 0) return 0; return this.DB * (this.t - 1) + nbits(this.data[this.t - 1] ^ this.s & this.DM); } __name(bnBitLength, "bnBitLength"); function bnpDLShiftTo(n6, r7) { var i5; for (i5 = this.t - 1; i5 >= 0; --i5) r7.data[i5 + n6] = this.data[i5]; for (i5 = n6 - 1; i5 >= 0; --i5) r7.data[i5] = 0; r7.t = this.t + n6; r7.s = this.s; } __name(bnpDLShiftTo, "bnpDLShiftTo"); function bnpDRShiftTo(n6, r7) { for (var i5 = n6; i5 < this.t; ++i5) r7.data[i5 - n6] = this.data[i5]; r7.t = Math.max(this.t - n6, 0); r7.s = this.s; } __name(bnpDRShiftTo, "bnpDRShiftTo"); function bnpLShiftTo(n6, r7) { var bs3 = n6 % this.DB; var cbs = this.DB - bs3; var bm2 = (1 << cbs) - 1; var ds = Math.floor(n6 / this.DB), c6 = this.s << bs3 & this.DM, i5; for (i5 = this.t - 1; i5 >= 0; --i5) { r7.data[i5 + ds + 1] = this.data[i5] >> cbs | c6; c6 = (this.data[i5] & bm2) << bs3; } for (i5 = ds - 1; i5 >= 0; --i5) r7.data[i5] = 0; r7.data[ds] = c6; r7.t = this.t + ds + 1; r7.s = this.s; r7.clamp(); } __name(bnpLShiftTo, "bnpLShiftTo"); function bnpRShiftTo(n6, r7) { r7.s = this.s; var ds = Math.floor(n6 / this.DB); if (ds >= this.t) { r7.t = 0; return; } var bs3 = n6 % this.DB; var cbs = this.DB - bs3; var bm2 = (1 << bs3) - 1; r7.data[0] = this.data[ds] >> bs3; for (var i5 = ds + 1; i5 < this.t; ++i5) { r7.data[i5 - ds - 1] |= (this.data[i5] & bm2) << cbs; r7.data[i5 - ds] = this.data[i5] >> bs3; } if (bs3 > 0) r7.data[this.t - ds - 1] |= (this.s & bm2) << cbs; r7.t = this.t - ds; r7.clamp(); } __name(bnpRShiftTo, "bnpRShiftTo"); function bnpSubTo(a5, r7) { var i5 = 0, c6 = 0, m6 = Math.min(a5.t, this.t); while (i5 < m6) { c6 += this.data[i5] - a5.data[i5]; r7.data[i5++] = c6 & this.DM; c6 >>= this.DB; } if (a5.t < this.t) { c6 -= a5.s; while (i5 < this.t) { c6 += this.data[i5]; r7.data[i5++] = c6 & this.DM; c6 >>= this.DB; } c6 += this.s; } else { c6 += this.s; while (i5 < a5.t) { c6 -= a5.data[i5]; r7.data[i5++] = c6 & this.DM; c6 >>= this.DB; } c6 -= a5.s; } r7.s = c6 < 0 ? -1 : 0; if (c6 < -1) r7.data[i5++] = this.DV + c6; else if (c6 > 0) r7.data[i5++] = c6; r7.t = i5; r7.clamp(); } __name(bnpSubTo, "bnpSubTo"); function bnpMultiplyTo(a5, r7) { var x6 = this.abs(), y4 = a5.abs(); var i5 = x6.t; r7.t = i5 + y4.t; while (--i5 >= 0) r7.data[i5] = 0; for (i5 = 0; i5 < y4.t; ++i5) r7.data[i5 + x6.t] = x6.am(0, y4.data[i5], r7, i5, 0, x6.t); r7.s = 0; r7.clamp(); if (this.s != a5.s) BigInteger.ZERO.subTo(r7, r7); } __name(bnpMultiplyTo, "bnpMultiplyTo"); function bnpSquareTo(r7) { var x6 = this.abs(); var i5 = r7.t = 2 * x6.t; while (--i5 >= 0) r7.data[i5] = 0; for (i5 = 0; i5 < x6.t - 1; ++i5) { var c6 = x6.am(i5, x6.data[i5], r7, 2 * i5, 0, 1); if ((r7.data[i5 + x6.t] += x6.am(i5 + 1, 2 * x6.data[i5], r7, 2 * i5 + 1, c6, x6.t - i5 - 1)) >= x6.DV) { r7.data[i5 + x6.t] -= x6.DV; r7.data[i5 + x6.t + 1] = 1; } } if (r7.t > 0) r7.data[r7.t - 1] += x6.am(i5, x6.data[i5], r7, 2 * i5, 0, 1); r7.s = 0; r7.clamp(); } __name(bnpSquareTo, "bnpSquareTo"); function bnpDivRemTo(m6, q6, r7) { var pm = m6.abs(); if (pm.t <= 0) return; var pt2 = this.abs(); if (pt2.t < pm.t) { if (q6 != null) q6.fromInt(0); if (r7 != null) this.copyTo(r7); return; } if (r7 == null) r7 = nbi(); var y4 = nbi(), ts = this.s, ms = m6.s; var nsh = this.DB - nbits(pm.data[pm.t - 1]); if (nsh > 0) { pm.lShiftTo(nsh, y4); pt2.lShiftTo(nsh, r7); } else { pm.copyTo(y4); pt2.copyTo(r7); } var ys = y4.t; var y0 = y4.data[ys - 1]; if (y0 == 0) return; var yt = y0 * (1 << this.F1) + (ys > 1 ? y4.data[ys - 2] >> this.F2 : 0); var d12 = this.FV / yt, d22 = (1 << this.F1) / yt, e7 = 1 << this.F2; var i5 = r7.t, j6 = i5 - ys, t7 = q6 == null ? nbi() : q6; y4.dlShiftTo(j6, t7); if (r7.compareTo(t7) >= 0) { r7.data[r7.t++] = 1; r7.subTo(t7, r7); } BigInteger.ONE.dlShiftTo(ys, t7); t7.subTo(y4, y4); while (y4.t < ys) y4.data[y4.t++] = 0; while (--j6 >= 0) { var qd = r7.data[--i5] == y0 ? this.DM : Math.floor(r7.data[i5] * d12 + (r7.data[i5 - 1] + e7) * d22); if ((r7.data[i5] += y4.am(0, qd, r7, j6, 0, ys)) < qd) { y4.dlShiftTo(j6, t7); r7.subTo(t7, r7); while (r7.data[i5] < --qd) r7.subTo(t7, r7); } } if (q6 != null) { r7.drShiftTo(ys, q6); if (ts != ms) BigInteger.ZERO.subTo(q6, q6); } r7.t = ys; r7.clamp(); if (nsh > 0) r7.rShiftTo(nsh, r7); if (ts < 0) BigInteger.ZERO.subTo(r7, r7); } __name(bnpDivRemTo, "bnpDivRemTo"); function bnMod(a5) { var r7 = nbi(); this.abs().divRemTo(a5, null, r7); if (this.s < 0 && r7.compareTo(BigInteger.ZERO) > 0) a5.subTo(r7, r7); return r7; } __name(bnMod, "bnMod"); function Classic(m6) { this.m = m6; } __name(Classic, "Classic"); function cConvert(x6) { if (x6.s < 0 || x6.compareTo(this.m) >= 0) return x6.mod(this.m); else return x6; } __name(cConvert, "cConvert"); function cRevert(x6) { return x6; } __name(cRevert, "cRevert"); function cReduce(x6) { x6.divRemTo(this.m, null, x6); } __name(cReduce, "cReduce"); function cMulTo(x6, y4, r7) { x6.multiplyTo(y4, r7); this.reduce(r7); } __name(cMulTo, "cMulTo"); function cSqrTo(x6, r7) { x6.squareTo(r7); this.reduce(r7); } __name(cSqrTo, "cSqrTo"); Classic.prototype.convert = cConvert; Classic.prototype.revert = cRevert; Classic.prototype.reduce = cReduce; Classic.prototype.mulTo = cMulTo; Classic.prototype.sqrTo = cSqrTo; function bnpInvDigit() { if (this.t < 1) return 0; var x6 = this.data[0]; if ((x6 & 1) == 0) return 0; var y4 = x6 & 3; y4 = y4 * (2 - (x6 & 15) * y4) & 15; y4 = y4 * (2 - (x6 & 255) * y4) & 255; y4 = y4 * (2 - ((x6 & 65535) * y4 & 65535)) & 65535; y4 = y4 * (2 - x6 * y4 % this.DV) % this.DV; return y4 > 0 ? this.DV - y4 : -y4; } __name(bnpInvDigit, "bnpInvDigit"); function Montgomery(m6) { this.m = m6; this.mp = m6.invDigit(); this.mpl = this.mp & 32767; this.mph = this.mp >> 15; this.um = (1 << m6.DB - 15) - 1; this.mt2 = 2 * m6.t; } __name(Montgomery, "Montgomery"); function montConvert(x6) { var r7 = nbi(); x6.abs().dlShiftTo(this.m.t, r7); r7.divRemTo(this.m, null, r7); if (x6.s < 0 && r7.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r7, r7); return r7; } __name(montConvert, "montConvert"); function montRevert(x6) { var r7 = nbi(); x6.copyTo(r7); this.reduce(r7); return r7; } __name(montRevert, "montRevert"); function montReduce(x6) { while (x6.t <= this.mt2) x6.data[x6.t++] = 0; for (var i5 = 0; i5 < this.m.t; ++i5) { var j6 = x6.data[i5] & 32767; var u0 = j6 * this.mpl + ((j6 * this.mph + (x6.data[i5] >> 15) * this.mpl & this.um) << 15) & x6.DM; j6 = i5 + this.m.t; x6.data[j6] += this.m.am(0, u0, x6, i5, 0, this.m.t); while (x6.data[j6] >= x6.DV) { x6.data[j6] -= x6.DV; x6.data[++j6]++; } } x6.clamp(); x6.drShiftTo(this.m.t, x6); if (x6.compareTo(this.m) >= 0) x6.subTo(this.m, x6); } __name(montReduce, "montReduce"); function montSqrTo(x6, r7) { x6.squareTo(r7); this.reduce(r7); } __name(montSqrTo, "montSqrTo"); function montMulTo(x6, y4, r7) { x6.multiplyTo(y4, r7); this.reduce(r7); } __name(montMulTo, "montMulTo"); Montgomery.prototype.convert = montConvert; Montgomery.prototype.revert = montRevert; Montgomery.prototype.reduce = montReduce; Montgomery.prototype.mulTo = montMulTo; Montgomery.prototype.sqrTo = montSqrTo; function bnpIsEven() { return (this.t > 0 ? this.data[0] & 1 : this.s) == 0; } __name(bnpIsEven, "bnpIsEven"); function bnpExp(e7, z5) { if (e7 > 4294967295 || e7 < 1) return BigInteger.ONE; var r7 = nbi(), r22 = nbi(), g6 = z5.convert(this), i5 = nbits(e7) - 1; g6.copyTo(r7); while (--i5 >= 0) { z5.sqrTo(r7, r22); if ((e7 & 1 << i5) > 0) z5.mulTo(r22, g6, r7); else { var t7 = r7; r7 = r22; r22 = t7; } } return z5.revert(r7); } __name(bnpExp, "bnpExp"); function bnModPowInt(e7, m6) { var z5; if (e7 < 256 || m6.isEven()) z5 = new Classic(m6); else z5 = new Montgomery(m6); return this.exp(e7, z5); } __name(bnModPowInt, "bnModPowInt"); BigInteger.prototype.copyTo = bnpCopyTo; BigInteger.prototype.fromInt = bnpFromInt; BigInteger.prototype.fromString = bnpFromString; BigInteger.prototype.clamp = bnpClamp; BigInteger.prototype.dlShiftTo = bnpDLShiftTo; BigInteger.prototype.drShiftTo = bnpDRShiftTo; BigInteger.prototype.lShiftTo = bnpLShiftTo; BigInteger.prototype.rShiftTo = bnpRShiftTo; BigInteger.prototype.subTo = bnpSubTo; BigInteger.prototype.multiplyTo = bnpMultiplyTo; BigInteger.prototype.squareTo = bnpSquareTo; BigInteger.prototype.divRemTo = bnpDivRemTo; BigInteger.prototype.invDigit = bnpInvDigit; BigInteger.prototype.isEven = bnpIsEven; BigInteger.prototype.exp = bnpExp; BigInteger.prototype.toString = bnToString; BigInteger.prototype.negate = bnNegate; BigInteger.prototype.abs = bnAbs; BigInteger.prototype.compareTo = bnCompareTo; BigInteger.prototype.bitLength = bnBitLength; BigInteger.prototype.mod = bnMod; BigInteger.prototype.modPowInt = bnModPowInt; BigInteger.ZERO = nbv(0); BigInteger.ONE = nbv(1); function bnClone() { var r7 = nbi(); this.copyTo(r7); return r7; } __name(bnClone, "bnClone"); function bnIntValue() { if (this.s < 0) { if (this.t == 1) return this.data[0] - this.DV; else if (this.t == 0) return -1; } else if (this.t == 1) return this.data[0]; else if (this.t == 0) return 0; return (this.data[1] & (1 << 32 - this.DB) - 1) << this.DB | this.data[0]; } __name(bnIntValue, "bnIntValue"); function bnByteValue() { return this.t == 0 ? this.s : this.data[0] << 24 >> 24; } __name(bnByteValue, "bnByteValue"); function bnShortValue() { return this.t == 0 ? this.s : this.data[0] << 16 >> 16; } __name(bnShortValue, "bnShortValue"); function bnpChunkSize(r7) { return Math.floor(Math.LN2 * this.DB / Math.log(r7)); } __name(bnpChunkSize, "bnpChunkSize"); function bnSigNum() { if (this.s < 0) return -1; else if (this.t <= 0 || this.t == 1 && this.data[0] <= 0) return 0; else return 1; } __name(bnSigNum, "bnSigNum"); function bnpToRadix(b6) { if (b6 == null) b6 = 10; if (this.signum() == 0 || b6 < 2 || b6 > 36) return "0"; var cs3 = this.chunkSize(b6); var a5 = Math.pow(b6, cs3); var d6 = nbv(a5), y4 = nbi(), z5 = nbi(), r7 = ""; this.divRemTo(d6, y4, z5); while (y4.signum() > 0) { r7 = (a5 + z5.intValue()).toString(b6).substr(1) + r7; y4.divRemTo(d6, y4, z5); } return z5.intValue().toString(b6) + r7; } __name(bnpToRadix, "bnpToRadix"); function bnpFromRadix(s5, b6) { this.fromInt(0); if (b6 == null) b6 = 10; var cs3 = this.chunkSize(b6); var d6 = Math.pow(b6, cs3), mi = false, j6 = 0, w6 = 0; for (var i5 = 0; i5 < s5.length; ++i5) { var x6 = intAt(s5, i5); if (x6 < 0) { if (s5.charAt(i5) == "-" && this.signum() == 0) mi = true; continue; } w6 = b6 * w6 + x6; if (++j6 >= cs3) { this.dMultiply(d6); this.dAddOffset(w6, 0); j6 = 0; w6 = 0; } } if (j6 > 0) { this.dMultiply(Math.pow(b6, j6)); this.dAddOffset(w6, 0); } if (mi) BigInteger.ZERO.subTo(this, this); } __name(bnpFromRadix, "bnpFromRadix"); function bnpFromNumber(a5, b6, c6) { if ("number" == typeof b6) { if (a5 < 2) this.fromInt(1); else { this.fromNumber(a5, c6); if (!this.testBit(a5 - 1)) this.bitwiseTo(BigInteger.ONE.shiftLeft(a5 - 1), op_or, this); if (this.isEven()) this.dAddOffset(1, 0); while (!this.isProbablePrime(b6)) { this.dAddOffset(2, 0); if (this.bitLength() > a5) this.subTo(BigInteger.ONE.shiftLeft(a5 - 1), this); } } } else { var x6 = new Array(), t7 = a5 & 7; x6.length = (a5 >> 3) + 1; b6.nextBytes(x6); if (t7 > 0) x6[0] &= (1 << t7) - 1; else x6[0] = 0; this.fromString(x6, 256); } } __name(bnpFromNumber, "bnpFromNumber"); function bnToByteArray() { var i5 = this.t, r7 = new Array(); r7[0] = this.s; var p6 = this.DB - i5 * this.DB % 8, d6, k6 = 0; if (i5-- > 0) { if (p6 < this.DB && (d6 = this.data[i5] >> p6) != (this.s & this.DM) >> p6) r7[k6++] = d6 | this.s << this.DB - p6; while (i5 >= 0) { if (p6 < 8) { d6 = (this.data[i5] & (1 << p6) - 1) << 8 - p6; d6 |= this.data[--i5] >> (p6 += this.DB - 8); } else { d6 = this.data[i5] >> (p6 -= 8) & 255; if (p6 <= 0) { p6 += this.DB; --i5; } } if ((d6 & 128) != 0) d6 |= -256; if (k6 == 0 && (this.s & 128) != (d6 & 128)) ++k6; if (k6 > 0 || d6 != this.s) r7[k6++] = d6; } } return r7; } __name(bnToByteArray, "bnToByteArray"); function bnEquals(a5) { return this.compareTo(a5) == 0; } __name(bnEquals, "bnEquals"); function bnMin(a5) { return this.compareTo(a5) < 0 ? this : a5; } __name(bnMin, "bnMin"); function bnMax(a5) { return this.compareTo(a5) > 0 ? this : a5; } __name(bnMax, "bnMax"); function bnpBitwiseTo(a5, op, r7) { var i5, f5, m6 = Math.min(a5.t, this.t); for (i5 = 0; i5 < m6; ++i5) r7.data[i5] = op(this.data[i5], a5.data[i5]); if (a5.t < this.t) { f5 = a5.s & this.DM; for (i5 = m6; i5 < this.t; ++i5) r7.data[i5] = op(this.data[i5], f5); r7.t = this.t; } else { f5 = this.s & this.DM; for (i5 = m6; i5 < a5.t; ++i5) r7.data[i5] = op(f5, a5.data[i5]); r7.t = a5.t; } r7.s = op(this.s, a5.s); r7.clamp(); } __name(bnpBitwiseTo, "bnpBitwiseTo"); function op_and(x6, y4) { return x6 & y4; } __name(op_and, "op_and"); function bnAnd(a5) { var r7 = nbi(); this.bitwiseTo(a5, op_and, r7); return r7; } __name(bnAnd, "bnAnd"); function op_or(x6, y4) { return x6 | y4; } __name(op_or, "op_or"); function bnOr(a5) { var r7 = nbi(); this.bitwiseTo(a5, op_or, r7); return r7; } __name(bnOr, "bnOr"); function op_xor(x6, y4) { return x6 ^ y4; } __name(op_xor, "op_xor"); function bnXor(a5) { var r7 = nbi(); this.bitwiseTo(a5, op_xor, r7); return r7; } __name(bnXor, "bnXor"); function op_andnot(x6, y4) { return x6 & ~y4; } __name(op_andnot, "op_andnot"); function bnAndNot(a5) { var r7 = nbi(); this.bitwiseTo(a5, op_andnot, r7); return r7; } __name(bnAndNot, "bnAndNot"); function bnNot() { var r7 = nbi(); for (var i5 = 0; i5 < this.t; ++i5) r7.data[i5] = this.DM & ~this.data[i5]; r7.t = this.t; r7.s = ~this.s; return r7; } __name(bnNot, "bnNot"); function bnShiftLeft(n6) { var r7 = nbi(); if (n6 < 0) this.rShiftTo(-n6, r7); else this.lShiftTo(n6, r7); return r7; } __name(bnShiftLeft, "bnShiftLeft"); function bnShiftRight(n6) { var r7 = nbi(); if (n6 < 0) this.lShiftTo(-n6, r7); else this.rShiftTo(n6, r7); return r7; } __name(bnShiftRight, "bnShiftRight"); function lbit(x6) { if (x6 == 0) return -1; var r7 = 0; if ((x6 & 65535) == 0) { x6 >>= 16; r7 += 16; } if ((x6 & 255) == 0) { x6 >>= 8; r7 += 8; } if ((x6 & 15) == 0) { x6 >>= 4; r7 += 4; } if ((x6 & 3) == 0) { x6 >>= 2; r7 += 2; } if ((x6 & 1) == 0) ++r7; return r7; } __name(lbit, "lbit"); function bnGetLowestSetBit() { for (var i5 = 0; i5 < this.t; ++i5) if (this.data[i5] != 0) return i5 * this.DB + lbit(this.data[i5]); if (this.s < 0) return this.t * this.DB; return -1; } __name(bnGetLowestSetBit, "bnGetLowestSetBit"); function cbit(x6) { var r7 = 0; while (x6 != 0) { x6 &= x6 - 1; ++r7; } return r7; } __name(cbit, "cbit"); function bnBitCount() { var r7 = 0, x6 = this.s & this.DM; for (var i5 = 0; i5 < this.t; ++i5) r7 += cbit(this.data[i5] ^ x6); return r7; } __name(bnBitCount, "bnBitCount"); function bnTestBit(n6) { var j6 = Math.floor(n6 / this.DB); if (j6 >= this.t) return this.s != 0; return (this.data[j6] & 1 << n6 % this.DB) != 0; } __name(bnTestBit, "bnTestBit"); function bnpChangeBit(n6, op) { var r7 = BigInteger.ONE.shiftLeft(n6); this.bitwiseTo(r7, op, r7); return r7; } __name(bnpChangeBit, "bnpChangeBit"); function bnSetBit(n6) { return this.changeBit(n6, op_or); } __name(bnSetBit, "bnSetBit"); function bnClearBit(n6) { return this.changeBit(n6, op_andnot); } __name(bnClearBit, "bnClearBit"); function bnFlipBit(n6) { return this.changeBit(n6, op_xor); } __name(bnFlipBit, "bnFlipBit"); function bnpAddTo(a5, r7) { var i5 = 0, c6 = 0, m6 = Math.min(a5.t, this.t); while (i5 < m6) { c6 += this.data[i5] + a5.data[i5]; r7.data[i5++] = c6 & this.DM; c6 >>= this.DB; } if (a5.t < this.t) { c6 += a5.s; while (i5 < this.t) { c6 += this.data[i5]; r7.data[i5++] = c6 & this.DM; c6 >>= this.DB; } c6 += this.s; } else { c6 += this.s; while (i5 < a5.t) { c6 += a5.data[i5]; r7.data[i5++] = c6 & this.DM; c6 >>= this.DB; } c6 += a5.s; } r7.s = c6 < 0 ? -1 : 0; if (c6 > 0) r7.data[i5++] = c6; else if (c6 < -1) r7.data[i5++] = this.DV + c6; r7.t = i5; r7.clamp(); } __name(bnpAddTo, "bnpAddTo"); function bnAdd(a5) { var r7 = nbi(); this.addTo(a5, r7); return r7; } __name(bnAdd, "bnAdd"); function bnSubtract(a5) { var r7 = nbi(); this.subTo(a5, r7); return r7; } __name(bnSubtract, "bnSubtract"); function bnMultiply(a5) { var r7 = nbi(); this.multiplyTo(a5, r7); return r7; } __name(bnMultiply, "bnMultiply"); function bnDivide(a5) { var r7 = nbi(); this.divRemTo(a5, r7, null); return r7; } __name(bnDivide, "bnDivide"); function bnRemainder(a5) { var r7 = nbi(); this.divRemTo(a5, null, r7); return r7; } __name(bnRemainder, "bnRemainder"); function bnDivideAndRemainder(a5) { var q6 = nbi(), r7 = nbi(); this.divRemTo(a5, q6, r7); return new Array(q6, r7); } __name(bnDivideAndRemainder, "bnDivideAndRemainder"); function bnpDMultiply(n6) { this.data[this.t] = this.am(0, n6 - 1, this, 0, 0, this.t); ++this.t; this.clamp(); } __name(bnpDMultiply, "bnpDMultiply"); function bnpDAddOffset(n6, w6) { if (n6 == 0) return; while (this.t <= w6) this.data[this.t++] = 0; this.data[w6] += n6; while (this.data[w6] >= this.DV) { this.data[w6] -= this.DV; if (++w6 >= this.t) this.data[this.t++] = 0; ++this.data[w6]; } } __name(bnpDAddOffset, "bnpDAddOffset"); function NullExp() { } __name(NullExp, "NullExp"); function nNop(x6) { return x6; } __name(nNop, "nNop"); function nMulTo(x6, y4, r7) { x6.multiplyTo(y4, r7); } __name(nMulTo, "nMulTo"); function nSqrTo(x6, r7) { x6.squareTo(r7); } __name(nSqrTo, "nSqrTo"); NullExp.prototype.convert = nNop; NullExp.prototype.revert = nNop; NullExp.prototype.mulTo = nMulTo; NullExp.prototype.sqrTo = nSqrTo; function bnPow(e7) { return this.exp(e7, new NullExp()); } __name(bnPow, "bnPow"); function bnpMultiplyLowerTo(a5, n6, r7) { var i5 = Math.min(this.t + a5.t, n6); r7.s = 0; r7.t = i5; while (i5 > 0) r7.data[--i5] = 0; var j6; for (j6 = r7.t - this.t; i5 < j6; ++i5) r7.data[i5 + this.t] = this.am(0, a5.data[i5], r7, i5, 0, this.t); for (j6 = Math.min(a5.t, n6); i5 < j6; ++i5) this.am(0, a5.data[i5], r7, i5, 0, n6 - i5); r7.clamp(); } __name(bnpMultiplyLowerTo, "bnpMultiplyLowerTo"); function bnpMultiplyUpperTo(a5, n6, r7) { --n6; var i5 = r7.t = this.t + a5.t - n6; r7.s = 0; while (--i5 >= 0) r7.data[i5] = 0; for (i5 = Math.max(n6 - this.t, 0); i5 < a5.t; ++i5) r7.data[this.t + i5 - n6] = this.am(n6 - i5, a5.data[i5], r7, 0, 0, this.t + i5 - n6); r7.clamp(); r7.drShiftTo(1, r7); } __name(bnpMultiplyUpperTo, "bnpMultiplyUpperTo"); function Barrett(m6) { this.r2 = nbi(); this.q3 = nbi(); BigInteger.ONE.dlShiftTo(2 * m6.t, this.r2); this.mu = this.r2.divide(m6); this.m = m6; } __name(Barrett, "Barrett"); function barrettConvert(x6) { if (x6.s < 0 || x6.t > 2 * this.m.t) return x6.mod(this.m); else if (x6.compareTo(this.m) < 0) return x6; else { var r7 = nbi(); x6.copyTo(r7); this.reduce(r7); return r7; } } __name(barrettConvert, "barrettConvert"); function barrettRevert(x6) { return x6; } __name(barrettRevert, "barrettRevert"); function barrettReduce(x6) { x6.drShiftTo(this.m.t - 1, this.r2); if (x6.t > this.m.t + 1) { x6.t = this.m.t + 1; x6.clamp(); } this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3); this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); while (x6.compareTo(this.r2) < 0) x6.dAddOffset(1, this.m.t + 1); x6.subTo(this.r2, x6); while (x6.compareTo(this.m) >= 0) x6.subTo(this.m, x6); } __name(barrettReduce, "barrettReduce"); function barrettSqrTo(x6, r7) { x6.squareTo(r7); this.reduce(r7); } __name(barrettSqrTo, "barrettSqrTo"); function barrettMulTo(x6, y4, r7) { x6.multiplyTo(y4, r7); this.reduce(r7); } __name(barrettMulTo, "barrettMulTo"); Barrett.prototype.convert = barrettConvert; Barrett.prototype.revert = barrettRevert; Barrett.prototype.reduce = barrettReduce; Barrett.prototype.mulTo = barrettMulTo; Barrett.prototype.sqrTo = barrettSqrTo; function bnModPow(e7, m6) { var i5 = e7.bitLength(), k6, r7 = nbv(1), z5; if (i5 <= 0) return r7; else if (i5 < 18) k6 = 1; else if (i5 < 48) k6 = 3; else if (i5 < 144) k6 = 4; else if (i5 < 768) k6 = 5; else k6 = 6; if (i5 < 8) z5 = new Classic(m6); else if (m6.isEven()) z5 = new Barrett(m6); else z5 = new Montgomery(m6); var g6 = new Array(), n6 = 3, k1 = k6 - 1, km = (1 << k6) - 1; g6[1] = z5.convert(this); if (k6 > 1) { var g22 = nbi(); z5.sqrTo(g6[1], g22); while (n6 <= km) { g6[n6] = nbi(); z5.mulTo(g22, g6[n6 - 2], g6[n6]); n6 += 2; } } var j6 = e7.t - 1, w6, is1 = true, r22 = nbi(), t7; i5 = nbits(e7.data[j6]) - 1; while (j6 >= 0) { if (i5 >= k1) w6 = e7.data[j6] >> i5 - k1 & km; else { w6 = (e7.data[j6] & (1 << i5 + 1) - 1) << k1 - i5; if (j6 > 0) w6 |= e7.data[j6 - 1] >> this.DB + i5 - k1; } n6 = k6; while ((w6 & 1) == 0) { w6 >>= 1; --n6; } if ((i5 -= n6) < 0) { i5 += this.DB; --j6; } if (is1) { g6[w6].copyTo(r7); is1 = false; } else { while (n6 > 1) { z5.sqrTo(r7, r22); z5.sqrTo(r22, r7); n6 -= 2; } if (n6 > 0) z5.sqrTo(r7, r22); else { t7 = r7; r7 = r22; r22 = t7; } z5.mulTo(r22, g6[w6], r7); } while (j6 >= 0 && (e7.data[j6] & 1 << i5) == 0) { z5.sqrTo(r7, r22); t7 = r7; r7 = r22; r22 = t7; if (--i5 < 0) { i5 = this.DB - 1; --j6; } } } return z5.revert(r7); } __name(bnModPow, "bnModPow"); function bnGCD(a5) { var x6 = this.s < 0 ? this.negate() : this.clone(); var y4 = a5.s < 0 ? a5.negate() : a5.clone(); if (x6.compareTo(y4) < 0) { var t7 = x6; x6 = y4; y4 = t7; } var i5 = x6.getLowestSetBit(), g6 = y4.getLowestSetBit(); if (g6 < 0) return x6; if (i5 < g6) g6 = i5; if (g6 > 0) { x6.rShiftTo(g6, x6); y4.rShiftTo(g6, y4); } while (x6.signum() > 0) { if ((i5 = x6.getLowestSetBit()) > 0) x6.rShiftTo(i5, x6); if ((i5 = y4.getLowestSetBit()) > 0) y4.rShiftTo(i5, y4); if (x6.compareTo(y4) >= 0) { x6.subTo(y4, x6); x6.rShiftTo(1, x6); } else { y4.subTo(x6, y4); y4.rShiftTo(1, y4); } } if (g6 > 0) y4.lShiftTo(g6, y4); return y4; } __name(bnGCD, "bnGCD"); function bnpModInt(n6) { if (n6 <= 0) return 0; var d6 = this.DV % n6, r7 = this.s < 0 ? n6 - 1 : 0; if (this.t > 0) if (d6 == 0) r7 = this.data[0] % n6; else for (var i5 = this.t - 1; i5 >= 0; --i5) r7 = (d6 * r7 + this.data[i5]) % n6; return r7; } __name(bnpModInt, "bnpModInt"); function bnModInverse(m6) { var ac2 = m6.isEven(); if (this.isEven() && ac2 || m6.signum() == 0) return BigInteger.ZERO; var u5 = m6.clone(), v7 = this.clone(); var a5 = nbv(1), b6 = nbv(0), c6 = nbv(0), d6 = nbv(1); while (u5.signum() != 0) { while (u5.isEven()) { u5.rShiftTo(1, u5); if (ac2) { if (!a5.isEven() || !b6.isEven()) { a5.addTo(this, a5); b6.subTo(m6, b6); } a5.rShiftTo(1, a5); } else if (!b6.isEven()) b6.subTo(m6, b6); b6.rShiftTo(1, b6); } while (v7.isEven()) { v7.rShiftTo(1, v7); if (ac2) { if (!c6.isEven() || !d6.isEven()) { c6.addTo(this, c6); d6.subTo(m6, d6); } c6.rShiftTo(1, c6); } else if (!d6.isEven()) d6.subTo(m6, d6); d6.rShiftTo(1, d6); } if (u5.compareTo(v7) >= 0) { u5.subTo(v7, u5); if (ac2) a5.subTo(c6, a5); b6.subTo(d6, b6); } else { v7.subTo(u5, v7); if (ac2) c6.subTo(a5, c6); d6.subTo(b6, d6); } } if (v7.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; if (d6.compareTo(m6) >= 0) return d6.subtract(m6); if (d6.signum() < 0) d6.addTo(m6, d6); else return d6; if (d6.signum() < 0) return d6.add(m6); else return d6; } __name(bnModInverse, "bnModInverse"); var lowprimes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509]; var lplim = (1 << 26) / lowprimes[lowprimes.length - 1]; function bnIsProbablePrime(t7) { var i5, x6 = this.abs(); if (x6.t == 1 && x6.data[0] <= lowprimes[lowprimes.length - 1]) { for (i5 = 0; i5 < lowprimes.length; ++i5) if (x6.data[0] == lowprimes[i5]) return true; return false; } if (x6.isEven()) return false; i5 = 1; while (i5 < lowprimes.length) { var m6 = lowprimes[i5], j6 = i5 + 1; while (j6 < lowprimes.length && m6 < lplim) m6 *= lowprimes[j6++]; m6 = x6.modInt(m6); while (i5 < j6) if (m6 % lowprimes[i5++] == 0) return false; } return x6.millerRabin(t7); } __name(bnIsProbablePrime, "bnIsProbablePrime"); function bnpMillerRabin(t7) { var n1 = this.subtract(BigInteger.ONE); var k6 = n1.getLowestSetBit(); if (k6 <= 0) return false; var r7 = n1.shiftRight(k6); var prng = bnGetPrng(); var a5; for (var i5 = 0; i5 < t7; ++i5) { do { a5 = new BigInteger(this.bitLength(), prng); } while (a5.compareTo(BigInteger.ONE) <= 0 || a5.compareTo(n1) >= 0); var y4 = a5.modPow(r7, this); if (y4.compareTo(BigInteger.ONE) != 0 && y4.compareTo(n1) != 0) { var j6 = 1; while (j6++ < k6 && y4.compareTo(n1) != 0) { y4 = y4.modPowInt(2, this); if (y4.compareTo(BigInteger.ONE) == 0) return false; } if (y4.compareTo(n1) != 0) return false; } } return true; } __name(bnpMillerRabin, "bnpMillerRabin"); function bnGetPrng() { return { // x is an array to fill with bytes nextBytes: function(x6) { for (var i5 = 0; i5 < x6.length; ++i5) { x6[i5] = Math.floor(Math.random() * 256); } } }; } __name(bnGetPrng, "bnGetPrng"); BigInteger.prototype.chunkSize = bnpChunkSize; BigInteger.prototype.toRadix = bnpToRadix; BigInteger.prototype.fromRadix = bnpFromRadix; BigInteger.prototype.fromNumber = bnpFromNumber; BigInteger.prototype.bitwiseTo = bnpBitwiseTo; BigInteger.prototype.changeBit = bnpChangeBit; BigInteger.prototype.addTo = bnpAddTo; BigInteger.prototype.dMultiply = bnpDMultiply; BigInteger.prototype.dAddOffset = bnpDAddOffset; BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; BigInteger.prototype.modInt = bnpModInt; BigInteger.prototype.millerRabin = bnpMillerRabin; BigInteger.prototype.clone = bnClone; BigInteger.prototype.intValue = bnIntValue; BigInteger.prototype.byteValue = bnByteValue; BigInteger.prototype.shortValue = bnShortValue; BigInteger.prototype.signum = bnSigNum; BigInteger.prototype.toByteArray = bnToByteArray; BigInteger.prototype.equals = bnEquals; BigInteger.prototype.min = bnMin; BigInteger.prototype.max = bnMax; BigInteger.prototype.and = bnAnd; BigInteger.prototype.or = bnOr; BigInteger.prototype.xor = bnXor; BigInteger.prototype.andNot = bnAndNot; BigInteger.prototype.not = bnNot; BigInteger.prototype.shiftLeft = bnShiftLeft; BigInteger.prototype.shiftRight = bnShiftRight; BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; BigInteger.prototype.bitCount = bnBitCount; BigInteger.prototype.testBit = bnTestBit; BigInteger.prototype.setBit = bnSetBit; BigInteger.prototype.clearBit = bnClearBit; BigInteger.prototype.flipBit = bnFlipBit; BigInteger.prototype.add = bnAdd; BigInteger.prototype.subtract = bnSubtract; BigInteger.prototype.multiply = bnMultiply; BigInteger.prototype.divide = bnDivide; BigInteger.prototype.remainder = bnRemainder; BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; BigInteger.prototype.modPow = bnModPow; BigInteger.prototype.modInverse = bnModInverse; BigInteger.prototype.pow = bnPow; BigInteger.prototype.gcd = bnGCD; BigInteger.prototype.isProbablePrime = bnIsProbablePrime; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/sha1.js var require_sha1 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/sha1.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_md(); require_util10(); var sha1 = module3.exports = forge.sha1 = forge.sha1 || {}; forge.md.sha1 = forge.md.algorithms.sha1 = sha1; sha1.create = function() { if (!_initialized) { _init(); } var _state = null; var _input = forge.util.createBuffer(); var _w = new Array(80); var md = { algorithm: "sha1", blockLength: 64, digestLength: 20, // 56-bit length of message so far (does not including padding) messageLength: 0, // true message length fullMessageLength: null, // size of message length in bytes messageLengthSize: 8 }; md.start = function() { md.messageLength = 0; md.fullMessageLength = md.messageLength64 = []; var int32s = md.messageLengthSize / 4; for (var i5 = 0; i5 < int32s; ++i5) { md.fullMessageLength.push(0); } _input = forge.util.createBuffer(); _state = { h0: 1732584193, h1: 4023233417, h2: 2562383102, h3: 271733878, h4: 3285377520 }; return md; }; md.start(); md.update = function(msg, encoding) { if (encoding === "utf8") { msg = forge.util.encodeUtf8(msg); } var len = msg.length; md.messageLength += len; len = [len / 4294967296 >>> 0, len >>> 0]; for (var i5 = md.fullMessageLength.length - 1; i5 >= 0; --i5) { md.fullMessageLength[i5] += len[1]; len[1] = len[0] + (md.fullMessageLength[i5] / 4294967296 >>> 0); md.fullMessageLength[i5] = md.fullMessageLength[i5] >>> 0; len[0] = len[1] / 4294967296 >>> 0; } _input.putBytes(msg); _update(_state, _w, _input); if (_input.read > 2048 || _input.length() === 0) { _input.compact(); } return md; }; md.digest = function() { var finalBlock = forge.util.createBuffer(); finalBlock.putBytes(_input.bytes()); var remaining = md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize; var overflow = remaining & md.blockLength - 1; finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); var next, carry; var bits = md.fullMessageLength[0] * 8; for (var i5 = 0; i5 < md.fullMessageLength.length - 1; ++i5) { next = md.fullMessageLength[i5 + 1] * 8; carry = next / 4294967296 >>> 0; bits += carry; finalBlock.putInt32(bits >>> 0); bits = next >>> 0; } finalBlock.putInt32(bits); var s22 = { h0: _state.h0, h1: _state.h1, h2: _state.h2, h3: _state.h3, h4: _state.h4 }; _update(s22, _w, finalBlock); var rval = forge.util.createBuffer(); rval.putInt32(s22.h0); rval.putInt32(s22.h1); rval.putInt32(s22.h2); rval.putInt32(s22.h3); rval.putInt32(s22.h4); return rval; }; return md; }; var _padding = null; var _initialized = false; function _init() { _padding = String.fromCharCode(128); _padding += forge.util.fillString(String.fromCharCode(0), 64); _initialized = true; } __name(_init, "_init"); function _update(s5, w6, bytes) { var t7, a5, b6, c6, d6, e7, f5, i5; var len = bytes.length(); while (len >= 64) { a5 = s5.h0; b6 = s5.h1; c6 = s5.h2; d6 = s5.h3; e7 = s5.h4; for (i5 = 0; i5 < 16; ++i5) { t7 = bytes.getInt32(); w6[i5] = t7; f5 = d6 ^ b6 & (c6 ^ d6); t7 = (a5 << 5 | a5 >>> 27) + f5 + e7 + 1518500249 + t7; e7 = d6; d6 = c6; c6 = (b6 << 30 | b6 >>> 2) >>> 0; b6 = a5; a5 = t7; } for (; i5 < 20; ++i5) { t7 = w6[i5 - 3] ^ w6[i5 - 8] ^ w6[i5 - 14] ^ w6[i5 - 16]; t7 = t7 << 1 | t7 >>> 31; w6[i5] = t7; f5 = d6 ^ b6 & (c6 ^ d6); t7 = (a5 << 5 | a5 >>> 27) + f5 + e7 + 1518500249 + t7; e7 = d6; d6 = c6; c6 = (b6 << 30 | b6 >>> 2) >>> 0; b6 = a5; a5 = t7; } for (; i5 < 32; ++i5) { t7 = w6[i5 - 3] ^ w6[i5 - 8] ^ w6[i5 - 14] ^ w6[i5 - 16]; t7 = t7 << 1 | t7 >>> 31; w6[i5] = t7; f5 = b6 ^ c6 ^ d6; t7 = (a5 << 5 | a5 >>> 27) + f5 + e7 + 1859775393 + t7; e7 = d6; d6 = c6; c6 = (b6 << 30 | b6 >>> 2) >>> 0; b6 = a5; a5 = t7; } for (; i5 < 40; ++i5) { t7 = w6[i5 - 6] ^ w6[i5 - 16] ^ w6[i5 - 28] ^ w6[i5 - 32]; t7 = t7 << 2 | t7 >>> 30; w6[i5] = t7; f5 = b6 ^ c6 ^ d6; t7 = (a5 << 5 | a5 >>> 27) + f5 + e7 + 1859775393 + t7; e7 = d6; d6 = c6; c6 = (b6 << 30 | b6 >>> 2) >>> 0; b6 = a5; a5 = t7; } for (; i5 < 60; ++i5) { t7 = w6[i5 - 6] ^ w6[i5 - 16] ^ w6[i5 - 28] ^ w6[i5 - 32]; t7 = t7 << 2 | t7 >>> 30; w6[i5] = t7; f5 = b6 & c6 | d6 & (b6 ^ c6); t7 = (a5 << 5 | a5 >>> 27) + f5 + e7 + 2400959708 + t7; e7 = d6; d6 = c6; c6 = (b6 << 30 | b6 >>> 2) >>> 0; b6 = a5; a5 = t7; } for (; i5 < 80; ++i5) { t7 = w6[i5 - 6] ^ w6[i5 - 16] ^ w6[i5 - 28] ^ w6[i5 - 32]; t7 = t7 << 2 | t7 >>> 30; w6[i5] = t7; f5 = b6 ^ c6 ^ d6; t7 = (a5 << 5 | a5 >>> 27) + f5 + e7 + 3395469782 + t7; e7 = d6; d6 = c6; c6 = (b6 << 30 | b6 >>> 2) >>> 0; b6 = a5; a5 = t7; } s5.h0 = s5.h0 + a5 | 0; s5.h1 = s5.h1 + b6 | 0; s5.h2 = s5.h2 + c6 | 0; s5.h3 = s5.h3 + d6 | 0; s5.h4 = s5.h4 + e7 | 0; len -= 64; } } __name(_update, "_update"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pkcs1.js var require_pkcs1 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pkcs1.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_util10(); require_random2(); require_sha1(); var pkcs1 = module3.exports = forge.pkcs1 = forge.pkcs1 || {}; pkcs1.encode_rsa_oaep = function(key, message, options32) { var label; var seed; var md; var mgf1Md; if (typeof options32 === "string") { label = options32; seed = arguments[3] || void 0; md = arguments[4] || void 0; } else if (options32) { label = options32.label || void 0; seed = options32.seed || void 0; md = options32.md || void 0; if (options32.mgf1 && options32.mgf1.md) { mgf1Md = options32.mgf1.md; } } if (!md) { md = forge.md.sha1.create(); } else { md.start(); } if (!mgf1Md) { mgf1Md = md; } var keyLength = Math.ceil(key.n.bitLength() / 8); var maxLength = keyLength - 2 * md.digestLength - 2; if (message.length > maxLength) { var error2 = new Error("RSAES-OAEP input message length is too long."); error2.length = message.length; error2.maxLength = maxLength; throw error2; } if (!label) { label = ""; } md.update(label, "raw"); var lHash = md.digest(); var PS = ""; var PS_length = maxLength - message.length; for (var i5 = 0; i5 < PS_length; i5++) { PS += "\0"; } var DB = lHash.getBytes() + PS + "" + message; if (!seed) { seed = forge.random.getBytes(md.digestLength); } else if (seed.length !== md.digestLength) { var error2 = new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length."); error2.seedLength = seed.length; error2.digestLength = md.digestLength; throw error2; } var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); var maskedDB = forge.util.xorBytes(DB, dbMask, DB.length); var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); var maskedSeed = forge.util.xorBytes(seed, seedMask, seed.length); return "\0" + maskedSeed + maskedDB; }; pkcs1.decode_rsa_oaep = function(key, em, options32) { var label; var md; var mgf1Md; if (typeof options32 === "string") { label = options32; md = arguments[3] || void 0; } else if (options32) { label = options32.label || void 0; md = options32.md || void 0; if (options32.mgf1 && options32.mgf1.md) { mgf1Md = options32.mgf1.md; } } var keyLength = Math.ceil(key.n.bitLength() / 8); if (em.length !== keyLength) { var error2 = new Error("RSAES-OAEP encoded message length is invalid."); error2.length = em.length; error2.expectedLength = keyLength; throw error2; } if (md === void 0) { md = forge.md.sha1.create(); } else { md.start(); } if (!mgf1Md) { mgf1Md = md; } if (keyLength < 2 * md.digestLength + 2) { throw new Error("RSAES-OAEP key is too short for the hash function."); } if (!label) { label = ""; } md.update(label, "raw"); var lHash = md.digest().getBytes(); var y4 = em.charAt(0); var maskedSeed = em.substring(1, md.digestLength + 1); var maskedDB = em.substring(1 + md.digestLength); var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); var seed = forge.util.xorBytes(maskedSeed, seedMask, maskedSeed.length); var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); var db = forge.util.xorBytes(maskedDB, dbMask, maskedDB.length); var lHashPrime = db.substring(0, md.digestLength); var error2 = y4 !== "\0"; for (var i5 = 0; i5 < md.digestLength; ++i5) { error2 |= lHash.charAt(i5) !== lHashPrime.charAt(i5); } var in_ps = 1; var index = md.digestLength; for (var j6 = md.digestLength; j6 < db.length; j6++) { var code = db.charCodeAt(j6); var is_0 = code & 1 ^ 1; var error_mask = in_ps ? 65534 : 0; error2 |= code & error_mask; in_ps = in_ps & is_0; index += in_ps; } if (error2 || db.charCodeAt(index) !== 1) { throw new Error("Invalid RSAES-OAEP padding."); } return db.substring(index + 1); }; function rsa_mgf1(seed, maskLength, hash) { if (!hash) { hash = forge.md.sha1.create(); } var t7 = ""; var count = Math.ceil(maskLength / hash.digestLength); for (var i5 = 0; i5 < count; ++i5) { var c6 = String.fromCharCode( i5 >> 24 & 255, i5 >> 16 & 255, i5 >> 8 & 255, i5 & 255 ); hash.start(); hash.update(seed + c6); t7 += hash.digest().getBytes(); } return t7.substring(0, maskLength); } __name(rsa_mgf1, "rsa_mgf1"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/prime.js var require_prime = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/prime.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_util10(); require_jsbn(); require_random2(); (function() { if (forge.prime) { module3.exports = forge.prime; return; } var prime = module3.exports = forge.prime = forge.prime || {}; var BigInteger = forge.jsbn.BigInteger; var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; var THIRTY = new BigInteger(null); THIRTY.fromInt(30); var op_or = /* @__PURE__ */ __name(function(x6, y4) { return x6 | y4; }, "op_or"); prime.generateProbablePrime = function(bits, options32, callback) { if (typeof options32 === "function") { callback = options32; options32 = {}; } options32 = options32 || {}; var algorithm = options32.algorithm || "PRIMEINC"; if (typeof algorithm === "string") { algorithm = { name: algorithm }; } algorithm.options = algorithm.options || {}; var prng = options32.prng || forge.random; var rng2 = { // x is an array to fill with bytes nextBytes: function(x6) { var b6 = prng.getBytesSync(x6.length); for (var i5 = 0; i5 < x6.length; ++i5) { x6[i5] = b6.charCodeAt(i5); } } }; if (algorithm.name === "PRIMEINC") { return primeincFindPrime(bits, rng2, algorithm.options, callback); } throw new Error("Invalid prime generation algorithm: " + algorithm.name); }; function primeincFindPrime(bits, rng2, options32, callback) { if ("workers" in options32) { return primeincFindPrimeWithWorkers(bits, rng2, options32, callback); } return primeincFindPrimeWithoutWorkers(bits, rng2, options32, callback); } __name(primeincFindPrime, "primeincFindPrime"); function primeincFindPrimeWithoutWorkers(bits, rng2, options32, callback) { var num = generateRandom(bits, rng2); var deltaIdx = 0; var mrTests = getMillerRabinTests(num.bitLength()); if ("millerRabinTests" in options32) { mrTests = options32.millerRabinTests; } var maxBlockTime = 10; if ("maxBlockTime" in options32) { maxBlockTime = options32.maxBlockTime; } _primeinc(num, bits, rng2, deltaIdx, mrTests, maxBlockTime, callback); } __name(primeincFindPrimeWithoutWorkers, "primeincFindPrimeWithoutWorkers"); function _primeinc(num, bits, rng2, deltaIdx, mrTests, maxBlockTime, callback) { var start = +/* @__PURE__ */ new Date(); do { if (num.bitLength() > bits) { num = generateRandom(bits, rng2); } if (num.isProbablePrime(mrTests)) { return callback(null, num); } num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); } while (maxBlockTime < 0 || +/* @__PURE__ */ new Date() - start < maxBlockTime); forge.util.setImmediate(function() { _primeinc(num, bits, rng2, deltaIdx, mrTests, maxBlockTime, callback); }); } __name(_primeinc, "_primeinc"); function primeincFindPrimeWithWorkers(bits, rng2, options32, callback) { if (typeof Worker === "undefined") { return primeincFindPrimeWithoutWorkers(bits, rng2, options32, callback); } var num = generateRandom(bits, rng2); var numWorkers = options32.workers; var workLoad = options32.workLoad || 100; var range = workLoad * 30 / 8; var workerScript = options32.workerScript || "forge/prime.worker.js"; if (numWorkers === -1) { return forge.util.estimateCores(function(err, cores) { if (err) { cores = 2; } numWorkers = cores - 1; generate2(); }); } generate2(); function generate2() { numWorkers = Math.max(1, numWorkers); var workers = []; for (var i5 = 0; i5 < numWorkers; ++i5) { workers[i5] = new Worker(workerScript); } var running = numWorkers; for (var i5 = 0; i5 < numWorkers; ++i5) { workers[i5].addEventListener("message", workerMessage); } var found = false; function workerMessage(e7) { if (found) { return; } --running; var data = e7.data; if (data.found) { for (var i6 = 0; i6 < workers.length; ++i6) { workers[i6].terminate(); } found = true; return callback(null, new BigInteger(data.prime, 16)); } if (num.bitLength() > bits) { num = generateRandom(bits, rng2); } var hex = num.toString(16); e7.target.postMessage({ hex, workLoad }); num.dAddOffset(range, 0); } __name(workerMessage, "workerMessage"); } __name(generate2, "generate"); } __name(primeincFindPrimeWithWorkers, "primeincFindPrimeWithWorkers"); function generateRandom(bits, rng2) { var num = new BigInteger(bits, rng2); var bits1 = bits - 1; if (!num.testBit(bits1)) { num.bitwiseTo(BigInteger.ONE.shiftLeft(bits1), op_or, num); } num.dAddOffset(31 - num.mod(THIRTY).byteValue(), 0); return num; } __name(generateRandom, "generateRandom"); function getMillerRabinTests(bits) { if (bits <= 100) return 27; if (bits <= 150) return 18; if (bits <= 200) return 15; if (bits <= 250) return 12; if (bits <= 300) return 9; if (bits <= 350) return 8; if (bits <= 400) return 7; if (bits <= 500) return 6; if (bits <= 600) return 5; if (bits <= 800) return 4; if (bits <= 1250) return 3; return 2; } __name(getMillerRabinTests, "getMillerRabinTests"); })(); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/rsa.js var require_rsa = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/rsa.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_asn1(); require_jsbn(); require_oids(); require_pkcs1(); require_prime(); require_random2(); require_util10(); if (typeof BigInteger === "undefined") { BigInteger = forge.jsbn.BigInteger; } var BigInteger; var _crypto = forge.util.isNodejs ? require("crypto") : null; var asn1 = forge.asn1; var util5 = forge.util; forge.pki = forge.pki || {}; module3.exports = forge.pki.rsa = forge.rsa = forge.rsa || {}; var pki = forge.pki; var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; var privateKeyValidator = { // PrivateKeyInfo name: "PrivateKeyInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ // Version (INTEGER) name: "PrivateKeyInfo.version", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "privateKeyVersion" }, { // privateKeyAlgorithm name: "PrivateKeyInfo.privateKeyAlgorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "AlgorithmIdentifier.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "privateKeyOid" }] }, { // PrivateKey name: "PrivateKeyInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: "privateKey" }] }; var rsaPrivateKeyValidator = { // RSAPrivateKey name: "RSAPrivateKey", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ // Version (INTEGER) name: "RSAPrivateKey.version", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "privateKeyVersion" }, { // modulus (n) name: "RSAPrivateKey.modulus", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "privateKeyModulus" }, { // publicExponent (e) name: "RSAPrivateKey.publicExponent", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "privateKeyPublicExponent" }, { // privateExponent (d) name: "RSAPrivateKey.privateExponent", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "privateKeyPrivateExponent" }, { // prime1 (p) name: "RSAPrivateKey.prime1", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "privateKeyPrime1" }, { // prime2 (q) name: "RSAPrivateKey.prime2", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "privateKeyPrime2" }, { // exponent1 (d mod (p-1)) name: "RSAPrivateKey.exponent1", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "privateKeyExponent1" }, { // exponent2 (d mod (q-1)) name: "RSAPrivateKey.exponent2", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "privateKeyExponent2" }, { // coefficient ((inverse of q) mod p) name: "RSAPrivateKey.coefficient", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "privateKeyCoefficient" }] }; var rsaPublicKeyValidator = { // RSAPublicKey name: "RSAPublicKey", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ // modulus (n) name: "RSAPublicKey.modulus", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "publicKeyModulus" }, { // publicExponent (e) name: "RSAPublicKey.exponent", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "publicKeyExponent" }] }; var publicKeyValidator = forge.pki.rsa.publicKeyValidator = { name: "SubjectPublicKeyInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: "subjectPublicKeyInfo", value: [{ name: "SubjectPublicKeyInfo.AlgorithmIdentifier", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "AlgorithmIdentifier.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "publicKeyOid" }] }, { // subjectPublicKey name: "SubjectPublicKeyInfo.subjectPublicKey", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, value: [{ // RSAPublicKey name: "SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, optional: true, captureAsn1: "rsaPublicKey" }] }] }; var digestInfoValidator = { name: "DigestInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "DigestInfo.DigestAlgorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "DigestInfo.DigestAlgorithm.algorithmIdentifier", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "algorithmIdentifier" }, { // NULL paramters name: "DigestInfo.DigestAlgorithm.parameters", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.NULL, // captured only to check existence for md2 and md5 capture: "parameters", optional: true, constructed: false }] }, { // digest name: "DigestInfo.digest", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: "digest" }] }; var emsaPkcs1v15encode = /* @__PURE__ */ __name(function(md) { var oid; if (md.algorithm in pki.oids) { oid = pki.oids[md.algorithm]; } else { var error2 = new Error("Unknown message digest algorithm."); error2.algorithm = md.algorithm; throw error2; } var oidBytes = asn1.oidToDer(oid).getBytes(); var digestInfo = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [] ); var digestAlgorithm = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [] ); digestAlgorithm.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, oidBytes )); digestAlgorithm.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "" )); var digest = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, md.digest().getBytes() ); digestInfo.value.push(digestAlgorithm); digestInfo.value.push(digest); return asn1.toDer(digestInfo).getBytes(); }, "emsaPkcs1v15encode"); var _modPow = /* @__PURE__ */ __name(function(x6, key, pub) { if (pub) { return x6.modPow(key.e, key.n); } if (!key.p || !key.q) { return x6.modPow(key.d, key.n); } if (!key.dP) { key.dP = key.d.mod(key.p.subtract(BigInteger.ONE)); } if (!key.dQ) { key.dQ = key.d.mod(key.q.subtract(BigInteger.ONE)); } if (!key.qInv) { key.qInv = key.q.modInverse(key.p); } var r7; do { r7 = new BigInteger( forge.util.bytesToHex(forge.random.getBytes(key.n.bitLength() / 8)), 16 ); } while (r7.compareTo(key.n) >= 0 || !r7.gcd(key.n).equals(BigInteger.ONE)); x6 = x6.multiply(r7.modPow(key.e, key.n)).mod(key.n); var xp = x6.mod(key.p).modPow(key.dP, key.p); var xq = x6.mod(key.q).modPow(key.dQ, key.q); while (xp.compareTo(xq) < 0) { xp = xp.add(key.p); } var y4 = xp.subtract(xq).multiply(key.qInv).mod(key.p).multiply(key.q).add(xq); y4 = y4.multiply(r7.modInverse(key.n)).mod(key.n); return y4; }, "_modPow"); pki.rsa.encrypt = function(m6, key, bt2) { var pub = bt2; var eb; var k6 = Math.ceil(key.n.bitLength() / 8); if (bt2 !== false && bt2 !== true) { pub = bt2 === 2; eb = _encodePkcs1_v1_5(m6, key, bt2); } else { eb = forge.util.createBuffer(); eb.putBytes(m6); } var x6 = new BigInteger(eb.toHex(), 16); var y4 = _modPow(x6, key, pub); var yhex = y4.toString(16); var ed = forge.util.createBuffer(); var zeros = k6 - Math.ceil(yhex.length / 2); while (zeros > 0) { ed.putByte(0); --zeros; } ed.putBytes(forge.util.hexToBytes(yhex)); return ed.getBytes(); }; pki.rsa.decrypt = function(ed, key, pub, ml) { var k6 = Math.ceil(key.n.bitLength() / 8); if (ed.length !== k6) { var error2 = new Error("Encrypted message length is invalid."); error2.length = ed.length; error2.expected = k6; throw error2; } var y4 = new BigInteger(forge.util.createBuffer(ed).toHex(), 16); if (y4.compareTo(key.n) >= 0) { throw new Error("Encrypted message is invalid."); } var x6 = _modPow(y4, key, pub); var xhex = x6.toString(16); var eb = forge.util.createBuffer(); var zeros = k6 - Math.ceil(xhex.length / 2); while (zeros > 0) { eb.putByte(0); --zeros; } eb.putBytes(forge.util.hexToBytes(xhex)); if (ml !== false) { return _decodePkcs1_v1_5(eb.getBytes(), key, pub); } return eb.getBytes(); }; pki.rsa.createKeyPairGenerationState = function(bits, e7, options32) { if (typeof bits === "string") { bits = parseInt(bits, 10); } bits = bits || 2048; options32 = options32 || {}; var prng = options32.prng || forge.random; var rng2 = { // x is an array to fill with bytes nextBytes: function(x6) { var b6 = prng.getBytesSync(x6.length); for (var i5 = 0; i5 < x6.length; ++i5) { x6[i5] = b6.charCodeAt(i5); } } }; var algorithm = options32.algorithm || "PRIMEINC"; var rval; if (algorithm === "PRIMEINC") { rval = { algorithm, state: 0, bits, rng: rng2, eInt: e7 || 65537, e: new BigInteger(null), p: null, q: null, qBits: bits >> 1, pBits: bits - (bits >> 1), pqState: 0, num: null, keys: null }; rval.e.fromInt(rval.eInt); } else { throw new Error("Invalid key generation algorithm: " + algorithm); } return rval; }; pki.rsa.stepKeyPairGenerationState = function(state2, n6) { if (!("algorithm" in state2)) { state2.algorithm = "PRIMEINC"; } var THIRTY = new BigInteger(null); THIRTY.fromInt(30); var deltaIdx = 0; var op_or = /* @__PURE__ */ __name(function(x6, y4) { return x6 | y4; }, "op_or"); var t1 = +/* @__PURE__ */ new Date(); var t22; var total = 0; while (state2.keys === null && (n6 <= 0 || total < n6)) { if (state2.state === 0) { var bits = state2.p === null ? state2.pBits : state2.qBits; var bits1 = bits - 1; if (state2.pqState === 0) { state2.num = new BigInteger(bits, state2.rng); if (!state2.num.testBit(bits1)) { state2.num.bitwiseTo( BigInteger.ONE.shiftLeft(bits1), op_or, state2.num ); } state2.num.dAddOffset(31 - state2.num.mod(THIRTY).byteValue(), 0); deltaIdx = 0; ++state2.pqState; } else if (state2.pqState === 1) { if (state2.num.bitLength() > bits) { state2.pqState = 0; } else if (state2.num.isProbablePrime( _getMillerRabinTests(state2.num.bitLength()) )) { ++state2.pqState; } else { state2.num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); } } else if (state2.pqState === 2) { state2.pqState = state2.num.subtract(BigInteger.ONE).gcd(state2.e).compareTo(BigInteger.ONE) === 0 ? 3 : 0; } else if (state2.pqState === 3) { state2.pqState = 0; if (state2.p === null) { state2.p = state2.num; } else { state2.q = state2.num; } if (state2.p !== null && state2.q !== null) { ++state2.state; } state2.num = null; } } else if (state2.state === 1) { if (state2.p.compareTo(state2.q) < 0) { state2.num = state2.p; state2.p = state2.q; state2.q = state2.num; } ++state2.state; } else if (state2.state === 2) { state2.p1 = state2.p.subtract(BigInteger.ONE); state2.q1 = state2.q.subtract(BigInteger.ONE); state2.phi = state2.p1.multiply(state2.q1); ++state2.state; } else if (state2.state === 3) { if (state2.phi.gcd(state2.e).compareTo(BigInteger.ONE) === 0) { ++state2.state; } else { state2.p = null; state2.q = null; state2.state = 0; } } else if (state2.state === 4) { state2.n = state2.p.multiply(state2.q); if (state2.n.bitLength() === state2.bits) { ++state2.state; } else { state2.q = null; state2.state = 0; } } else if (state2.state === 5) { var d6 = state2.e.modInverse(state2.phi); state2.keys = { privateKey: pki.rsa.setPrivateKey( state2.n, state2.e, d6, state2.p, state2.q, d6.mod(state2.p1), d6.mod(state2.q1), state2.q.modInverse(state2.p) ), publicKey: pki.rsa.setPublicKey(state2.n, state2.e) }; } t22 = +/* @__PURE__ */ new Date(); total += t22 - t1; t1 = t22; } return state2.keys !== null; }; pki.rsa.generateKeyPair = function(bits, e7, options32, callback) { if (arguments.length === 1) { if (typeof bits === "object") { options32 = bits; bits = void 0; } else if (typeof bits === "function") { callback = bits; bits = void 0; } } else if (arguments.length === 2) { if (typeof bits === "number") { if (typeof e7 === "function") { callback = e7; e7 = void 0; } else if (typeof e7 !== "number") { options32 = e7; e7 = void 0; } } else { options32 = bits; callback = e7; bits = void 0; e7 = void 0; } } else if (arguments.length === 3) { if (typeof e7 === "number") { if (typeof options32 === "function") { callback = options32; options32 = void 0; } } else { callback = options32; options32 = e7; e7 = void 0; } } options32 = options32 || {}; if (bits === void 0) { bits = options32.bits || 2048; } if (e7 === void 0) { e7 = options32.e || 65537; } if (!forge.options.usePureJavaScript && !options32.prng && bits >= 256 && bits <= 16384 && (e7 === 65537 || e7 === 3)) { if (callback) { if (_detectNodeCrypto("generateKeyPair")) { return _crypto.generateKeyPair("rsa", { modulusLength: bits, publicExponent: e7, publicKeyEncoding: { type: "spki", format: "pem" }, privateKeyEncoding: { type: "pkcs8", format: "pem" } }, function(err, pub, priv) { if (err) { return callback(err); } callback(null, { privateKey: pki.privateKeyFromPem(priv), publicKey: pki.publicKeyFromPem(pub) }); }); } if (_detectSubtleCrypto("generateKey") && _detectSubtleCrypto("exportKey")) { return util5.globalScope.crypto.subtle.generateKey({ name: "RSASSA-PKCS1-v1_5", modulusLength: bits, publicExponent: _intToUint8Array(e7), hash: { name: "SHA-256" } }, true, ["sign", "verify"]).then(function(pair) { return util5.globalScope.crypto.subtle.exportKey( "pkcs8", pair.privateKey ); }).then(void 0, function(err) { callback(err); }).then(function(pkcs8) { if (pkcs8) { var privateKey = pki.privateKeyFromAsn1( asn1.fromDer(forge.util.createBuffer(pkcs8)) ); callback(null, { privateKey, publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e) }); } }); } if (_detectSubtleMsCrypto("generateKey") && _detectSubtleMsCrypto("exportKey")) { var genOp = util5.globalScope.msCrypto.subtle.generateKey({ name: "RSASSA-PKCS1-v1_5", modulusLength: bits, publicExponent: _intToUint8Array(e7), hash: { name: "SHA-256" } }, true, ["sign", "verify"]); genOp.oncomplete = function(e8) { var pair = e8.target.result; var exportOp = util5.globalScope.msCrypto.subtle.exportKey( "pkcs8", pair.privateKey ); exportOp.oncomplete = function(e9) { var pkcs8 = e9.target.result; var privateKey = pki.privateKeyFromAsn1( asn1.fromDer(forge.util.createBuffer(pkcs8)) ); callback(null, { privateKey, publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e) }); }; exportOp.onerror = function(err) { callback(err); }; }; genOp.onerror = function(err) { callback(err); }; return; } } else { if (_detectNodeCrypto("generateKeyPairSync")) { var keypair = _crypto.generateKeyPairSync("rsa", { modulusLength: bits, publicExponent: e7, publicKeyEncoding: { type: "spki", format: "pem" }, privateKeyEncoding: { type: "pkcs8", format: "pem" } }); return { privateKey: pki.privateKeyFromPem(keypair.privateKey), publicKey: pki.publicKeyFromPem(keypair.publicKey) }; } } } var state2 = pki.rsa.createKeyPairGenerationState(bits, e7, options32); if (!callback) { pki.rsa.stepKeyPairGenerationState(state2, 0); return state2.keys; } _generateKeyPair(state2, options32, callback); }; pki.setRsaPublicKey = pki.rsa.setPublicKey = function(n6, e7) { var key = { n: n6, e: e7 }; key.encrypt = function(data, scheme, schemeOptions) { if (typeof scheme === "string") { scheme = scheme.toUpperCase(); } else if (scheme === void 0) { scheme = "RSAES-PKCS1-V1_5"; } if (scheme === "RSAES-PKCS1-V1_5") { scheme = { encode: function(m6, key2, pub) { return _encodePkcs1_v1_5(m6, key2, 2).getBytes(); } }; } else if (scheme === "RSA-OAEP" || scheme === "RSAES-OAEP") { scheme = { encode: function(m6, key2) { return forge.pkcs1.encode_rsa_oaep(key2, m6, schemeOptions); } }; } else if (["RAW", "NONE", "NULL", null].indexOf(scheme) !== -1) { scheme = { encode: function(e9) { return e9; } }; } else if (typeof scheme === "string") { throw new Error('Unsupported encryption scheme: "' + scheme + '".'); } var e8 = scheme.encode(data, key, true); return pki.rsa.encrypt(e8, key, true); }; key.verify = function(digest, signature, scheme, options32) { if (typeof scheme === "string") { scheme = scheme.toUpperCase(); } else if (scheme === void 0) { scheme = "RSASSA-PKCS1-V1_5"; } if (options32 === void 0) { options32 = { _parseAllDigestBytes: true }; } if (!("_parseAllDigestBytes" in options32)) { options32._parseAllDigestBytes = true; } if (scheme === "RSASSA-PKCS1-V1_5") { scheme = { verify: function(digest2, d7) { d7 = _decodePkcs1_v1_5(d7, key, true); var obj = asn1.fromDer(d7, { parseAllBytes: options32._parseAllDigestBytes }); var capture = {}; var errors = []; if (!asn1.validate(obj, digestInfoValidator, capture, errors)) { var error2 = new Error( "ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value." ); error2.errors = errors; throw error2; } var oid = asn1.derToOid(capture.algorithmIdentifier); if (!(oid === forge.oids.md2 || oid === forge.oids.md5 || oid === forge.oids.sha1 || oid === forge.oids.sha224 || oid === forge.oids.sha256 || oid === forge.oids.sha384 || oid === forge.oids.sha512 || oid === forge.oids["sha512-224"] || oid === forge.oids["sha512-256"])) { var error2 = new Error( "Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier." ); error2.oid = oid; throw error2; } if (oid === forge.oids.md2 || oid === forge.oids.md5) { if (!("parameters" in capture)) { throw new Error( "ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters." ); } } return digest2 === capture.digest; } }; } else if (scheme === "NONE" || scheme === "NULL" || scheme === null) { scheme = { verify: function(digest2, d7) { d7 = _decodePkcs1_v1_5(d7, key, true); return digest2 === d7; } }; } var d6 = pki.rsa.decrypt(signature, key, true, false); return scheme.verify(digest, d6, key.n.bitLength()); }; return key; }; pki.setRsaPrivateKey = pki.rsa.setPrivateKey = function(n6, e7, d6, p6, q6, dP, dQ, qInv) { var key = { n: n6, e: e7, d: d6, p: p6, q: q6, dP, dQ, qInv }; key.decrypt = function(data, scheme, schemeOptions) { if (typeof scheme === "string") { scheme = scheme.toUpperCase(); } else if (scheme === void 0) { scheme = "RSAES-PKCS1-V1_5"; } var d7 = pki.rsa.decrypt(data, key, false, false); if (scheme === "RSAES-PKCS1-V1_5") { scheme = { decode: _decodePkcs1_v1_5 }; } else if (scheme === "RSA-OAEP" || scheme === "RSAES-OAEP") { scheme = { decode: function(d8, key2) { return forge.pkcs1.decode_rsa_oaep(key2, d8, schemeOptions); } }; } else if (["RAW", "NONE", "NULL", null].indexOf(scheme) !== -1) { scheme = { decode: function(d8) { return d8; } }; } else { throw new Error('Unsupported encryption scheme: "' + scheme + '".'); } return scheme.decode(d7, key, false); }; key.sign = function(md, scheme) { var bt2 = false; if (typeof scheme === "string") { scheme = scheme.toUpperCase(); } if (scheme === void 0 || scheme === "RSASSA-PKCS1-V1_5") { scheme = { encode: emsaPkcs1v15encode }; bt2 = 1; } else if (scheme === "NONE" || scheme === "NULL" || scheme === null) { scheme = { encode: function() { return md; } }; bt2 = 1; } var d7 = scheme.encode(md, key.n.bitLength()); return pki.rsa.encrypt(d7, key, bt2); }; return key; }; pki.wrapRsaPrivateKey = function(rsaKey) { return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // version (0) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(0).getBytes() ), // privateKeyAlgorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.rsaEncryption).getBytes() ), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") ]), // PrivateKey asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, asn1.toDer(rsaKey).getBytes() ) ]); }; pki.privateKeyFromAsn1 = function(obj) { var capture = {}; var errors = []; if (asn1.validate(obj, privateKeyValidator, capture, errors)) { obj = asn1.fromDer(forge.util.createBuffer(capture.privateKey)); } capture = {}; errors = []; if (!asn1.validate(obj, rsaPrivateKeyValidator, capture, errors)) { var error2 = new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey."); error2.errors = errors; throw error2; } var n6, e7, d6, p6, q6, dP, dQ, qInv; n6 = forge.util.createBuffer(capture.privateKeyModulus).toHex(); e7 = forge.util.createBuffer(capture.privateKeyPublicExponent).toHex(); d6 = forge.util.createBuffer(capture.privateKeyPrivateExponent).toHex(); p6 = forge.util.createBuffer(capture.privateKeyPrime1).toHex(); q6 = forge.util.createBuffer(capture.privateKeyPrime2).toHex(); dP = forge.util.createBuffer(capture.privateKeyExponent1).toHex(); dQ = forge.util.createBuffer(capture.privateKeyExponent2).toHex(); qInv = forge.util.createBuffer(capture.privateKeyCoefficient).toHex(); return pki.setRsaPrivateKey( new BigInteger(n6, 16), new BigInteger(e7, 16), new BigInteger(d6, 16), new BigInteger(p6, 16), new BigInteger(q6, 16), new BigInteger(dP, 16), new BigInteger(dQ, 16), new BigInteger(qInv, 16) ); }; pki.privateKeyToAsn1 = pki.privateKeyToRSAPrivateKey = function(key) { return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // version (0 = only 2 primes, 1 multiple primes) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(0).getBytes() ), // modulus (n) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.n) ), // publicExponent (e) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.e) ), // privateExponent (d) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.d) ), // privateKeyPrime1 (p) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.p) ), // privateKeyPrime2 (q) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.q) ), // privateKeyExponent1 (dP) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.dP) ), // privateKeyExponent2 (dQ) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.dQ) ), // coefficient (qInv) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.qInv) ) ]); }; pki.publicKeyFromAsn1 = function(obj) { var capture = {}; var errors = []; if (asn1.validate(obj, publicKeyValidator, capture, errors)) { var oid = asn1.derToOid(capture.publicKeyOid); if (oid !== pki.oids.rsaEncryption) { var error2 = new Error("Cannot read public key. Unknown OID."); error2.oid = oid; throw error2; } obj = capture.rsaPublicKey; } errors = []; if (!asn1.validate(obj, rsaPublicKeyValidator, capture, errors)) { var error2 = new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey."); error2.errors = errors; throw error2; } var n6 = forge.util.createBuffer(capture.publicKeyModulus).toHex(); var e7 = forge.util.createBuffer(capture.publicKeyExponent).toHex(); return pki.setRsaPublicKey( new BigInteger(n6, 16), new BigInteger(e7, 16) ); }; pki.publicKeyToAsn1 = pki.publicKeyToSubjectPublicKeyInfo = function(key) { return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // AlgorithmIdentifier asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.rsaEncryption).getBytes() ), // parameters (null) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") ]), // subjectPublicKey asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, [ pki.publicKeyToRSAPublicKey(key) ]) ]); }; pki.publicKeyToRSAPublicKey = function(key) { return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // modulus (n) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.n) ), // publicExponent (e) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, _bnToBytes(key.e) ) ]); }; function _encodePkcs1_v1_5(m6, key, bt2) { var eb = forge.util.createBuffer(); var k6 = Math.ceil(key.n.bitLength() / 8); if (m6.length > k6 - 11) { var error2 = new Error("Message is too long for PKCS#1 v1.5 padding."); error2.length = m6.length; error2.max = k6 - 11; throw error2; } eb.putByte(0); eb.putByte(bt2); var padNum = k6 - 3 - m6.length; var padByte; if (bt2 === 0 || bt2 === 1) { padByte = bt2 === 0 ? 0 : 255; for (var i5 = 0; i5 < padNum; ++i5) { eb.putByte(padByte); } } else { while (padNum > 0) { var numZeros = 0; var padBytes = forge.random.getBytes(padNum); for (var i5 = 0; i5 < padNum; ++i5) { padByte = padBytes.charCodeAt(i5); if (padByte === 0) { ++numZeros; } else { eb.putByte(padByte); } } padNum = numZeros; } } eb.putByte(0); eb.putBytes(m6); return eb; } __name(_encodePkcs1_v1_5, "_encodePkcs1_v1_5"); function _decodePkcs1_v1_5(em, key, pub, ml) { var k6 = Math.ceil(key.n.bitLength() / 8); var eb = forge.util.createBuffer(em); var first = eb.getByte(); var bt2 = eb.getByte(); if (first !== 0 || pub && bt2 !== 0 && bt2 !== 1 || !pub && bt2 != 2 || pub && bt2 === 0 && typeof ml === "undefined") { throw new Error("Encryption block is invalid."); } var padNum = 0; if (bt2 === 0) { padNum = k6 - 3 - ml; for (var i5 = 0; i5 < padNum; ++i5) { if (eb.getByte() !== 0) { throw new Error("Encryption block is invalid."); } } } else if (bt2 === 1) { padNum = 0; while (eb.length() > 1) { if (eb.getByte() !== 255) { --eb.read; break; } ++padNum; } } else if (bt2 === 2) { padNum = 0; while (eb.length() > 1) { if (eb.getByte() === 0) { --eb.read; break; } ++padNum; } } var zero = eb.getByte(); if (zero !== 0 || padNum !== k6 - 3 - eb.length()) { throw new Error("Encryption block is invalid."); } return eb.getBytes(); } __name(_decodePkcs1_v1_5, "_decodePkcs1_v1_5"); function _generateKeyPair(state2, options32, callback) { if (typeof options32 === "function") { callback = options32; options32 = {}; } options32 = options32 || {}; var opts = { algorithm: { name: options32.algorithm || "PRIMEINC", options: { workers: options32.workers || 2, workLoad: options32.workLoad || 100, workerScript: options32.workerScript } } }; if ("prng" in options32) { opts.prng = options32.prng; } generate2(); function generate2() { getPrime(state2.pBits, function(err, num) { if (err) { return callback(err); } state2.p = num; if (state2.q !== null) { return finish(err, state2.q); } getPrime(state2.qBits, finish); }); } __name(generate2, "generate"); function getPrime(bits, callback2) { forge.prime.generateProbablePrime(bits, opts, callback2); } __name(getPrime, "getPrime"); function finish(err, num) { if (err) { return callback(err); } state2.q = num; if (state2.p.compareTo(state2.q) < 0) { var tmp = state2.p; state2.p = state2.q; state2.q = tmp; } if (state2.p.subtract(BigInteger.ONE).gcd(state2.e).compareTo(BigInteger.ONE) !== 0) { state2.p = null; generate2(); return; } if (state2.q.subtract(BigInteger.ONE).gcd(state2.e).compareTo(BigInteger.ONE) !== 0) { state2.q = null; getPrime(state2.qBits, finish); return; } state2.p1 = state2.p.subtract(BigInteger.ONE); state2.q1 = state2.q.subtract(BigInteger.ONE); state2.phi = state2.p1.multiply(state2.q1); if (state2.phi.gcd(state2.e).compareTo(BigInteger.ONE) !== 0) { state2.p = state2.q = null; generate2(); return; } state2.n = state2.p.multiply(state2.q); if (state2.n.bitLength() !== state2.bits) { state2.q = null; getPrime(state2.qBits, finish); return; } var d6 = state2.e.modInverse(state2.phi); state2.keys = { privateKey: pki.rsa.setPrivateKey( state2.n, state2.e, d6, state2.p, state2.q, d6.mod(state2.p1), d6.mod(state2.q1), state2.q.modInverse(state2.p) ), publicKey: pki.rsa.setPublicKey(state2.n, state2.e) }; callback(null, state2.keys); } __name(finish, "finish"); } __name(_generateKeyPair, "_generateKeyPair"); function _bnToBytes(b6) { var hex = b6.toString(16); if (hex[0] >= "8") { hex = "00" + hex; } var bytes = forge.util.hexToBytes(hex); if (bytes.length > 1 && // leading 0x00 for positive integer (bytes.charCodeAt(0) === 0 && (bytes.charCodeAt(1) & 128) === 0 || // leading 0xFF for negative integer bytes.charCodeAt(0) === 255 && (bytes.charCodeAt(1) & 128) === 128)) { return bytes.substr(1); } return bytes; } __name(_bnToBytes, "_bnToBytes"); function _getMillerRabinTests(bits) { if (bits <= 100) return 27; if (bits <= 150) return 18; if (bits <= 200) return 15; if (bits <= 250) return 12; if (bits <= 300) return 9; if (bits <= 350) return 8; if (bits <= 400) return 7; if (bits <= 500) return 6; if (bits <= 600) return 5; if (bits <= 800) return 4; if (bits <= 1250) return 3; return 2; } __name(_getMillerRabinTests, "_getMillerRabinTests"); function _detectNodeCrypto(fn2) { return forge.util.isNodejs && typeof _crypto[fn2] === "function"; } __name(_detectNodeCrypto, "_detectNodeCrypto"); function _detectSubtleCrypto(fn2) { return typeof util5.globalScope !== "undefined" && typeof util5.globalScope.crypto === "object" && typeof util5.globalScope.crypto.subtle === "object" && typeof util5.globalScope.crypto.subtle[fn2] === "function"; } __name(_detectSubtleCrypto, "_detectSubtleCrypto"); function _detectSubtleMsCrypto(fn2) { return typeof util5.globalScope !== "undefined" && typeof util5.globalScope.msCrypto === "object" && typeof util5.globalScope.msCrypto.subtle === "object" && typeof util5.globalScope.msCrypto.subtle[fn2] === "function"; } __name(_detectSubtleMsCrypto, "_detectSubtleMsCrypto"); function _intToUint8Array(x6) { var bytes = forge.util.hexToBytes(x6.toString(16)); var buffer = new Uint8Array(bytes.length); for (var i5 = 0; i5 < bytes.length; ++i5) { buffer[i5] = bytes.charCodeAt(i5); } return buffer; } __name(_intToUint8Array, "_intToUint8Array"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pbe.js var require_pbe = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pbe.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_aes(); require_asn1(); require_des(); require_md(); require_oids(); require_pbkdf2(); require_pem(); require_random2(); require_rc2(); require_rsa(); require_util10(); if (typeof BigInteger === "undefined") { BigInteger = forge.jsbn.BigInteger; } var BigInteger; var asn1 = forge.asn1; var pki = forge.pki = forge.pki || {}; module3.exports = pki.pbe = forge.pbe = forge.pbe || {}; var oids = pki.oids; var encryptedPrivateKeyValidator = { name: "EncryptedPrivateKeyInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "EncryptedPrivateKeyInfo.encryptionAlgorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "AlgorithmIdentifier.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "encryptionOid" }, { name: "AlgorithmIdentifier.parameters", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: "encryptionParams" }] }, { // encryptedData name: "EncryptedPrivateKeyInfo.encryptedData", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: "encryptedData" }] }; var PBES2AlgorithmsValidator = { name: "PBES2Algorithms", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "PBES2Algorithms.keyDerivationFunc", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "PBES2Algorithms.keyDerivationFunc.oid", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "kdfOid" }, { name: "PBES2Algorithms.params", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "PBES2Algorithms.params.salt", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: "kdfSalt" }, { name: "PBES2Algorithms.params.iterationCount", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "kdfIterationCount" }, { name: "PBES2Algorithms.params.keyLength", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, optional: true, capture: "keyLength" }, { // prf name: "PBES2Algorithms.params.prf", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, optional: true, value: [{ name: "PBES2Algorithms.params.prf.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "prfOid" }] }] }] }, { name: "PBES2Algorithms.encryptionScheme", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "PBES2Algorithms.encryptionScheme.oid", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "encOid" }, { name: "PBES2Algorithms.encryptionScheme.iv", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: "encIv" }] }] }; var pkcs12PbeParamsValidator = { name: "pkcs-12PbeParams", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "pkcs-12PbeParams.salt", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: "salt" }, { name: "pkcs-12PbeParams.iterations", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "iterations" }] }; pki.encryptPrivateKeyInfo = function(obj, password, options32) { options32 = options32 || {}; options32.saltSize = options32.saltSize || 8; options32.count = options32.count || 2048; options32.algorithm = options32.algorithm || "aes128"; options32.prfAlgorithm = options32.prfAlgorithm || "sha1"; var salt = forge.random.getBytesSync(options32.saltSize); var count = options32.count; var countBytes = asn1.integerToDer(count); var dkLen; var encryptionAlgorithm; var encryptedData; if (options32.algorithm.indexOf("aes") === 0 || options32.algorithm === "des") { var ivLen, encOid, cipherFn; switch (options32.algorithm) { case "aes128": dkLen = 16; ivLen = 16; encOid = oids["aes128-CBC"]; cipherFn = forge.aes.createEncryptionCipher; break; case "aes192": dkLen = 24; ivLen = 16; encOid = oids["aes192-CBC"]; cipherFn = forge.aes.createEncryptionCipher; break; case "aes256": dkLen = 32; ivLen = 16; encOid = oids["aes256-CBC"]; cipherFn = forge.aes.createEncryptionCipher; break; case "des": dkLen = 8; ivLen = 8; encOid = oids["desCBC"]; cipherFn = forge.des.createEncryptionCipher; break; default: var error2 = new Error("Cannot encrypt private key. Unknown encryption algorithm."); error2.algorithm = options32.algorithm; throw error2; } var prfAlgorithm = "hmacWith" + options32.prfAlgorithm.toUpperCase(); var md = prfAlgorithmToMessageDigest(prfAlgorithm); var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); var iv = forge.random.getBytesSync(ivLen); var cipher = cipherFn(dk); cipher.start(iv); cipher.update(asn1.toDer(obj)); cipher.finish(); encryptedData = cipher.output.getBytes(); var params = createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm); encryptionAlgorithm = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(oids["pkcs5PBES2"]).getBytes() ), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // keyDerivationFunc asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(oids["pkcs5PBKDF2"]).getBytes() ), // PBKDF2-params params ]), // encryptionScheme asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(encOid).getBytes() ), // iv asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, iv ) ]) ]) ] ); } else if (options32.algorithm === "3des") { dkLen = 24; var saltBytes = new forge.util.ByteBuffer(salt); var dk = pki.pbe.generatePkcs12Key(password, saltBytes, 1, count, dkLen); var iv = pki.pbe.generatePkcs12Key(password, saltBytes, 2, count, dkLen); var cipher = forge.des.createEncryptionCipher(dk); cipher.start(iv); cipher.update(asn1.toDer(obj)); cipher.finish(); encryptedData = cipher.output.getBytes(); encryptionAlgorithm = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes() ), // pkcs-12PbeParams asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // salt asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt), // iteration count asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, countBytes.getBytes() ) ]) ] ); } else { var error2 = new Error("Cannot encrypt private key. Unknown encryption algorithm."); error2.algorithm = options32.algorithm; throw error2; } var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // encryptionAlgorithm encryptionAlgorithm, // encryptedData asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, encryptedData ) ]); return rval; }; pki.decryptPrivateKeyInfo = function(obj, password) { var rval = null; var capture = {}; var errors = []; if (!asn1.validate(obj, encryptedPrivateKeyValidator, capture, errors)) { var error2 = new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo."); error2.errors = errors; throw error2; } var oid = asn1.derToOid(capture.encryptionOid); var cipher = pki.pbe.getCipher(oid, capture.encryptionParams, password); var encrypted = forge.util.createBuffer(capture.encryptedData); cipher.update(encrypted); if (cipher.finish()) { rval = asn1.fromDer(cipher.output); } return rval; }; pki.encryptedPrivateKeyToPem = function(epki, maxline) { var msg = { type: "ENCRYPTED PRIVATE KEY", body: asn1.toDer(epki).getBytes() }; return forge.pem.encode(msg, { maxline }); }; pki.encryptedPrivateKeyFromPem = function(pem) { var msg = forge.pem.decode(pem)[0]; if (msg.type !== "ENCRYPTED PRIVATE KEY") { var error2 = new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".'); error2.headerType = msg.type; throw error2; } if (msg.procType && msg.procType.type === "ENCRYPTED") { throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted."); } return asn1.fromDer(msg.body); }; pki.encryptRsaPrivateKey = function(rsaKey, password, options32) { options32 = options32 || {}; if (!options32.legacy) { var rval = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(rsaKey)); rval = pki.encryptPrivateKeyInfo(rval, password, options32); return pki.encryptedPrivateKeyToPem(rval); } var algorithm; var iv; var dkLen; var cipherFn; switch (options32.algorithm) { case "aes128": algorithm = "AES-128-CBC"; dkLen = 16; iv = forge.random.getBytesSync(16); cipherFn = forge.aes.createEncryptionCipher; break; case "aes192": algorithm = "AES-192-CBC"; dkLen = 24; iv = forge.random.getBytesSync(16); cipherFn = forge.aes.createEncryptionCipher; break; case "aes256": algorithm = "AES-256-CBC"; dkLen = 32; iv = forge.random.getBytesSync(16); cipherFn = forge.aes.createEncryptionCipher; break; case "3des": algorithm = "DES-EDE3-CBC"; dkLen = 24; iv = forge.random.getBytesSync(8); cipherFn = forge.des.createEncryptionCipher; break; case "des": algorithm = "DES-CBC"; dkLen = 8; iv = forge.random.getBytesSync(8); cipherFn = forge.des.createEncryptionCipher; break; default: var error2 = new Error('Could not encrypt RSA private key; unsupported encryption algorithm "' + options32.algorithm + '".'); error2.algorithm = options32.algorithm; throw error2; } var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); var cipher = cipherFn(dk); cipher.start(iv); cipher.update(asn1.toDer(pki.privateKeyToAsn1(rsaKey))); cipher.finish(); var msg = { type: "RSA PRIVATE KEY", procType: { version: "4", type: "ENCRYPTED" }, dekInfo: { algorithm, parameters: forge.util.bytesToHex(iv).toUpperCase() }, body: cipher.output.getBytes() }; return forge.pem.encode(msg); }; pki.decryptRsaPrivateKey = function(pem, password) { var rval = null; var msg = forge.pem.decode(pem)[0]; if (msg.type !== "ENCRYPTED PRIVATE KEY" && msg.type !== "PRIVATE KEY" && msg.type !== "RSA PRIVATE KEY") { var error2 = new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".'); error2.headerType = error2; throw error2; } if (msg.procType && msg.procType.type === "ENCRYPTED") { var dkLen; var cipherFn; switch (msg.dekInfo.algorithm) { case "DES-CBC": dkLen = 8; cipherFn = forge.des.createDecryptionCipher; break; case "DES-EDE3-CBC": dkLen = 24; cipherFn = forge.des.createDecryptionCipher; break; case "AES-128-CBC": dkLen = 16; cipherFn = forge.aes.createDecryptionCipher; break; case "AES-192-CBC": dkLen = 24; cipherFn = forge.aes.createDecryptionCipher; break; case "AES-256-CBC": dkLen = 32; cipherFn = forge.aes.createDecryptionCipher; break; case "RC2-40-CBC": dkLen = 5; cipherFn = /* @__PURE__ */ __name(function(key) { return forge.rc2.createDecryptionCipher(key, 40); }, "cipherFn"); break; case "RC2-64-CBC": dkLen = 8; cipherFn = /* @__PURE__ */ __name(function(key) { return forge.rc2.createDecryptionCipher(key, 64); }, "cipherFn"); break; case "RC2-128-CBC": dkLen = 16; cipherFn = /* @__PURE__ */ __name(function(key) { return forge.rc2.createDecryptionCipher(key, 128); }, "cipherFn"); break; default: var error2 = new Error('Could not decrypt private key; unsupported encryption algorithm "' + msg.dekInfo.algorithm + '".'); error2.algorithm = msg.dekInfo.algorithm; throw error2; } var iv = forge.util.hexToBytes(msg.dekInfo.parameters); var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); var cipher = cipherFn(dk); cipher.start(iv); cipher.update(forge.util.createBuffer(msg.body)); if (cipher.finish()) { rval = cipher.output.getBytes(); } else { return rval; } } else { rval = msg.body; } if (msg.type === "ENCRYPTED PRIVATE KEY") { rval = pki.decryptPrivateKeyInfo(asn1.fromDer(rval), password); } else { rval = asn1.fromDer(rval); } if (rval !== null) { rval = pki.privateKeyFromAsn1(rval); } return rval; }; pki.pbe.generatePkcs12Key = function(password, salt, id, iter, n6, md) { var j6, l6; if (typeof md === "undefined" || md === null) { if (!("sha1" in forge.md)) { throw new Error('"sha1" hash algorithm unavailable.'); } md = forge.md.sha1.create(); } var u5 = md.digestLength; var v7 = md.blockLength; var result = new forge.util.ByteBuffer(); var passBuf = new forge.util.ByteBuffer(); if (password !== null && password !== void 0) { for (l6 = 0; l6 < password.length; l6++) { passBuf.putInt16(password.charCodeAt(l6)); } passBuf.putInt16(0); } var p6 = passBuf.length(); var s5 = salt.length(); var D3 = new forge.util.ByteBuffer(); D3.fillWithByte(id, v7); var Slen = v7 * Math.ceil(s5 / v7); var S3 = new forge.util.ByteBuffer(); for (l6 = 0; l6 < Slen; l6++) { S3.putByte(salt.at(l6 % s5)); } var Plen = v7 * Math.ceil(p6 / v7); var P3 = new forge.util.ByteBuffer(); for (l6 = 0; l6 < Plen; l6++) { P3.putByte(passBuf.at(l6 % p6)); } var I4 = S3; I4.putBuffer(P3); var c6 = Math.ceil(n6 / u5); for (var i5 = 1; i5 <= c6; i5++) { var buf = new forge.util.ByteBuffer(); buf.putBytes(D3.bytes()); buf.putBytes(I4.bytes()); for (var round = 0; round < iter; round++) { md.start(); md.update(buf.getBytes()); buf = md.digest(); } var B3 = new forge.util.ByteBuffer(); for (l6 = 0; l6 < v7; l6++) { B3.putByte(buf.at(l6 % u5)); } var k6 = Math.ceil(s5 / v7) + Math.ceil(p6 / v7); var Inew = new forge.util.ByteBuffer(); for (j6 = 0; j6 < k6; j6++) { var chunk = new forge.util.ByteBuffer(I4.getBytes(v7)); var x6 = 511; for (l6 = B3.length() - 1; l6 >= 0; l6--) { x6 = x6 >> 8; x6 += B3.at(l6) + chunk.at(l6); chunk.setAt(l6, x6 & 255); } Inew.putBuffer(chunk); } I4 = Inew; result.putBuffer(buf); } result.truncate(result.length() - n6); return result; }; pki.pbe.getCipher = function(oid, params, password) { switch (oid) { case pki.oids["pkcs5PBES2"]: return pki.pbe.getCipherForPBES2(oid, params, password); case pki.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]: case pki.oids["pbewithSHAAnd40BitRC2-CBC"]: return pki.pbe.getCipherForPKCS12PBE(oid, params, password); default: var error2 = new Error("Cannot read encrypted PBE data block. Unsupported OID."); error2.oid = oid; error2.supportedOids = [ "pkcs5PBES2", "pbeWithSHAAnd3-KeyTripleDES-CBC", "pbewithSHAAnd40BitRC2-CBC" ]; throw error2; } }; pki.pbe.getCipherForPBES2 = function(oid, params, password) { var capture = {}; var errors = []; if (!asn1.validate(params, PBES2AlgorithmsValidator, capture, errors)) { var error2 = new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo."); error2.errors = errors; throw error2; } oid = asn1.derToOid(capture.kdfOid); if (oid !== pki.oids["pkcs5PBKDF2"]) { var error2 = new Error("Cannot read encrypted private key. Unsupported key derivation function OID."); error2.oid = oid; error2.supportedOids = ["pkcs5PBKDF2"]; throw error2; } oid = asn1.derToOid(capture.encOid); if (oid !== pki.oids["aes128-CBC"] && oid !== pki.oids["aes192-CBC"] && oid !== pki.oids["aes256-CBC"] && oid !== pki.oids["des-EDE3-CBC"] && oid !== pki.oids["desCBC"]) { var error2 = new Error("Cannot read encrypted private key. Unsupported encryption scheme OID."); error2.oid = oid; error2.supportedOids = [ "aes128-CBC", "aes192-CBC", "aes256-CBC", "des-EDE3-CBC", "desCBC" ]; throw error2; } var salt = capture.kdfSalt; var count = forge.util.createBuffer(capture.kdfIterationCount); count = count.getInt(count.length() << 3); var dkLen; var cipherFn; switch (pki.oids[oid]) { case "aes128-CBC": dkLen = 16; cipherFn = forge.aes.createDecryptionCipher; break; case "aes192-CBC": dkLen = 24; cipherFn = forge.aes.createDecryptionCipher; break; case "aes256-CBC": dkLen = 32; cipherFn = forge.aes.createDecryptionCipher; break; case "des-EDE3-CBC": dkLen = 24; cipherFn = forge.des.createDecryptionCipher; break; case "desCBC": dkLen = 8; cipherFn = forge.des.createDecryptionCipher; break; } var md = prfOidToMessageDigest(capture.prfOid); var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); var iv = capture.encIv; var cipher = cipherFn(dk); cipher.start(iv); return cipher; }; pki.pbe.getCipherForPKCS12PBE = function(oid, params, password) { var capture = {}; var errors = []; if (!asn1.validate(params, pkcs12PbeParamsValidator, capture, errors)) { var error2 = new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo."); error2.errors = errors; throw error2; } var salt = forge.util.createBuffer(capture.salt); var count = forge.util.createBuffer(capture.iterations); count = count.getInt(count.length() << 3); var dkLen, dIvLen, cipherFn; switch (oid) { case pki.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]: dkLen = 24; dIvLen = 8; cipherFn = forge.des.startDecrypting; break; case pki.oids["pbewithSHAAnd40BitRC2-CBC"]: dkLen = 5; dIvLen = 8; cipherFn = /* @__PURE__ */ __name(function(key2, iv2) { var cipher = forge.rc2.createDecryptionCipher(key2, 40); cipher.start(iv2, null); return cipher; }, "cipherFn"); break; default: var error2 = new Error("Cannot read PKCS #12 PBE data block. Unsupported OID."); error2.oid = oid; throw error2; } var md = prfOidToMessageDigest(capture.prfOid); var key = pki.pbe.generatePkcs12Key(password, salt, 1, count, dkLen, md); md.start(); var iv = pki.pbe.generatePkcs12Key(password, salt, 2, count, dIvLen, md); return cipherFn(key, iv); }; pki.pbe.opensslDeriveBytes = function(password, salt, dkLen, md) { if (typeof md === "undefined" || md === null) { if (!("md5" in forge.md)) { throw new Error('"md5" hash algorithm unavailable.'); } md = forge.md.md5.create(); } if (salt === null) { salt = ""; } var digests = [hash(md, password + salt)]; for (var length = 16, i5 = 1; length < dkLen; ++i5, length += 16) { digests.push(hash(md, digests[i5 - 1] + password + salt)); } return digests.join("").substr(0, dkLen); }; function hash(md, bytes) { return md.start().update(bytes).digest().getBytes(); } __name(hash, "hash"); function prfOidToMessageDigest(prfOid) { var prfAlgorithm; if (!prfOid) { prfAlgorithm = "hmacWithSHA1"; } else { prfAlgorithm = pki.oids[asn1.derToOid(prfOid)]; if (!prfAlgorithm) { var error2 = new Error("Unsupported PRF OID."); error2.oid = prfOid; error2.supported = [ "hmacWithSHA1", "hmacWithSHA224", "hmacWithSHA256", "hmacWithSHA384", "hmacWithSHA512" ]; throw error2; } } return prfAlgorithmToMessageDigest(prfAlgorithm); } __name(prfOidToMessageDigest, "prfOidToMessageDigest"); function prfAlgorithmToMessageDigest(prfAlgorithm) { var factory = forge.md; switch (prfAlgorithm) { case "hmacWithSHA224": factory = forge.md.sha512; case "hmacWithSHA1": case "hmacWithSHA256": case "hmacWithSHA384": case "hmacWithSHA512": prfAlgorithm = prfAlgorithm.substr(8).toLowerCase(); break; default: var error2 = new Error("Unsupported PRF algorithm."); error2.algorithm = prfAlgorithm; error2.supported = [ "hmacWithSHA1", "hmacWithSHA224", "hmacWithSHA256", "hmacWithSHA384", "hmacWithSHA512" ]; throw error2; } if (!factory || !(prfAlgorithm in factory)) { throw new Error("Unknown hash algorithm: " + prfAlgorithm); } return factory[prfAlgorithm].create(); } __name(prfAlgorithmToMessageDigest, "prfAlgorithmToMessageDigest"); function createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm) { var params = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // salt asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt ), // iteration count asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, countBytes.getBytes() ) ]); if (prfAlgorithm !== "hmacWithSHA1") { params.value.push( // key length asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, forge.util.hexToBytes(dkLen.toString(16)) ), // AlgorithmIdentifier asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids[prfAlgorithm]).getBytes() ), // parameters (null) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") ]) ); } return params; } __name(createPbkdf2Params, "createPbkdf2Params"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pkcs7asn1.js var require_pkcs7asn1 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pkcs7asn1.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_asn1(); require_util10(); var asn1 = forge.asn1; var p7v = module3.exports = forge.pkcs7asn1 = forge.pkcs7asn1 || {}; forge.pkcs7 = forge.pkcs7 || {}; forge.pkcs7.asn1 = p7v; var contentInfoValidator = { name: "ContentInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "ContentInfo.ContentType", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "contentType" }, { name: "ContentInfo.content", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, constructed: true, optional: true, captureAsn1: "content" }] }; p7v.contentInfoValidator = contentInfoValidator; var encryptedContentInfoValidator = { name: "EncryptedContentInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "EncryptedContentInfo.contentType", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "contentType" }, { name: "EncryptedContentInfo.contentEncryptionAlgorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "EncryptedContentInfo.contentEncryptionAlgorithm.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "encAlgorithm" }, { name: "EncryptedContentInfo.contentEncryptionAlgorithm.parameter", tagClass: asn1.Class.UNIVERSAL, captureAsn1: "encParameter" }] }, { name: "EncryptedContentInfo.encryptedContent", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, /* The PKCS#7 structure output by OpenSSL somewhat differs from what * other implementations do generate. * * OpenSSL generates a structure like this: * SEQUENCE { * ... * [0] * 26 DA 67 D2 17 9C 45 3C B1 2A A8 59 2F 29 33 38 * C3 C3 DF 86 71 74 7A 19 9F 40 D0 29 BE 85 90 45 * ... * } * * Whereas other implementations (and this PKCS#7 module) generate: * SEQUENCE { * ... * [0] { * OCTET STRING * 26 DA 67 D2 17 9C 45 3C B1 2A A8 59 2F 29 33 38 * C3 C3 DF 86 71 74 7A 19 9F 40 D0 29 BE 85 90 45 * ... * } * } * * In order to support both, we just capture the context specific * field here. The OCTET STRING bit is removed below. */ capture: "encryptedContent", captureAsn1: "encryptedContentAsn1" }] }; p7v.envelopedDataValidator = { name: "EnvelopedData", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "EnvelopedData.Version", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "version" }, { name: "EnvelopedData.RecipientInfos", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SET, constructed: true, captureAsn1: "recipientInfos" }].concat(encryptedContentInfoValidator) }; p7v.encryptedDataValidator = { name: "EncryptedData", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "EncryptedData.Version", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "version" }].concat(encryptedContentInfoValidator) }; var signerValidator = { name: "SignerInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "SignerInfo.version", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false }, { name: "SignerInfo.issuerAndSerialNumber", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "SignerInfo.issuerAndSerialNumber.issuer", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: "issuer" }, { name: "SignerInfo.issuerAndSerialNumber.serialNumber", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "serial" }] }, { name: "SignerInfo.digestAlgorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "SignerInfo.digestAlgorithm.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "digestAlgorithm" }, { name: "SignerInfo.digestAlgorithm.parameter", tagClass: asn1.Class.UNIVERSAL, constructed: false, captureAsn1: "digestParameter", optional: true }] }, { name: "SignerInfo.authenticatedAttributes", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, constructed: true, optional: true, capture: "authenticatedAttributes" }, { name: "SignerInfo.digestEncryptionAlgorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, capture: "signatureAlgorithm" }, { name: "SignerInfo.encryptedDigest", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: "signature" }, { name: "SignerInfo.unauthenticatedAttributes", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 1, constructed: true, optional: true, capture: "unauthenticatedAttributes" }] }; p7v.signedDataValidator = { name: "SignedData", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [ { name: "SignedData.Version", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "version" }, { name: "SignedData.DigestAlgorithms", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SET, constructed: true, captureAsn1: "digestAlgorithms" }, contentInfoValidator, { name: "SignedData.Certificates", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, optional: true, captureAsn1: "certificates" }, { name: "SignedData.CertificateRevocationLists", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 1, optional: true, captureAsn1: "crls" }, { name: "SignedData.SignerInfos", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SET, capture: "signerInfos", optional: true, value: [signerValidator] } ] }; p7v.recipientInfoValidator = { name: "RecipientInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "RecipientInfo.version", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "version" }, { name: "RecipientInfo.issuerAndSerial", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "RecipientInfo.issuerAndSerial.issuer", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: "issuer" }, { name: "RecipientInfo.issuerAndSerial.serialNumber", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "serial" }] }, { name: "RecipientInfo.keyEncryptionAlgorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "RecipientInfo.keyEncryptionAlgorithm.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "encAlgorithm" }, { name: "RecipientInfo.keyEncryptionAlgorithm.parameter", tagClass: asn1.Class.UNIVERSAL, constructed: false, captureAsn1: "encParameter", optional: true }] }, { name: "RecipientInfo.encryptedKey", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: "encKey" }] }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/mgf1.js var require_mgf1 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/mgf1.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_util10(); forge.mgf = forge.mgf || {}; var mgf1 = module3.exports = forge.mgf.mgf1 = forge.mgf1 = forge.mgf1 || {}; mgf1.create = function(md) { var mgf = { /** * Generate mask of specified length. * * @param {String} seed The seed for mask generation. * @param maskLen Number of bytes to generate. * @return {String} The generated mask. */ generate: function(seed, maskLen) { var t7 = new forge.util.ByteBuffer(); var len = Math.ceil(maskLen / md.digestLength); for (var i5 = 0; i5 < len; i5++) { var c6 = new forge.util.ByteBuffer(); c6.putInt32(i5); md.start(); md.update(seed + c6.getBytes()); t7.putBuffer(md.digest()); } t7.truncate(t7.length() - maskLen); return t7.getBytes(); } }; return mgf; }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/mgf.js var require_mgf = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/mgf.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_mgf1(); module3.exports = forge.mgf = forge.mgf || {}; forge.mgf.mgf1 = forge.mgf1; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pss.js var require_pss = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pss.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_random2(); require_util10(); var pss = module3.exports = forge.pss = forge.pss || {}; pss.create = function(options32) { if (arguments.length === 3) { options32 = { md: arguments[0], mgf: arguments[1], saltLength: arguments[2] }; } var hash = options32.md; var mgf = options32.mgf; var hLen = hash.digestLength; var salt_ = options32.salt || null; if (typeof salt_ === "string") { salt_ = forge.util.createBuffer(salt_); } var sLen; if ("saltLength" in options32) { sLen = options32.saltLength; } else if (salt_ !== null) { sLen = salt_.length(); } else { throw new Error("Salt length not specified or specific salt not given."); } if (salt_ !== null && salt_.length() !== sLen) { throw new Error("Given salt length does not match length of given salt."); } var prng = options32.prng || forge.random; var pssobj = {}; pssobj.encode = function(md, modBits) { var i5; var emBits = modBits - 1; var emLen = Math.ceil(emBits / 8); var mHash = md.digest().getBytes(); if (emLen < hLen + sLen + 2) { throw new Error("Message is too long to encrypt."); } var salt; if (salt_ === null) { salt = prng.getBytesSync(sLen); } else { salt = salt_.bytes(); } var m_ = new forge.util.ByteBuffer(); m_.fillWithByte(0, 8); m_.putBytes(mHash); m_.putBytes(salt); hash.start(); hash.update(m_.getBytes()); var h6 = hash.digest().getBytes(); var ps = new forge.util.ByteBuffer(); ps.fillWithByte(0, emLen - sLen - hLen - 2); ps.putByte(1); ps.putBytes(salt); var db = ps.getBytes(); var maskLen = emLen - hLen - 1; var dbMask = mgf.generate(h6, maskLen); var maskedDB = ""; for (i5 = 0; i5 < maskLen; i5++) { maskedDB += String.fromCharCode(db.charCodeAt(i5) ^ dbMask.charCodeAt(i5)); } var mask = 65280 >> 8 * emLen - emBits & 255; maskedDB = String.fromCharCode(maskedDB.charCodeAt(0) & ~mask) + maskedDB.substr(1); return maskedDB + h6 + String.fromCharCode(188); }; pssobj.verify = function(mHash, em, modBits) { var i5; var emBits = modBits - 1; var emLen = Math.ceil(emBits / 8); em = em.substr(-emLen); if (emLen < hLen + sLen + 2) { throw new Error("Inconsistent parameters to PSS signature verification."); } if (em.charCodeAt(emLen - 1) !== 188) { throw new Error("Encoded message does not end in 0xBC."); } var maskLen = emLen - hLen - 1; var maskedDB = em.substr(0, maskLen); var h6 = em.substr(maskLen, hLen); var mask = 65280 >> 8 * emLen - emBits & 255; if ((maskedDB.charCodeAt(0) & mask) !== 0) { throw new Error("Bits beyond keysize not zero as expected."); } var dbMask = mgf.generate(h6, maskLen); var db = ""; for (i5 = 0; i5 < maskLen; i5++) { db += String.fromCharCode(maskedDB.charCodeAt(i5) ^ dbMask.charCodeAt(i5)); } db = String.fromCharCode(db.charCodeAt(0) & ~mask) + db.substr(1); var checkLen = emLen - hLen - sLen - 2; for (i5 = 0; i5 < checkLen; i5++) { if (db.charCodeAt(i5) !== 0) { throw new Error("Leftmost octets not zero as expected"); } } if (db.charCodeAt(checkLen) !== 1) { throw new Error("Inconsistent PSS signature, 0x01 marker not found"); } var salt = db.substr(-sLen); var m_ = new forge.util.ByteBuffer(); m_.fillWithByte(0, 8); m_.putBytes(mHash); m_.putBytes(salt); hash.start(); hash.update(m_.getBytes()); var h_ = hash.digest().getBytes(); return h6 === h_; }; return pssobj; }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/x509.js var require_x509 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/x509.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_aes(); require_asn1(); require_des(); require_md(); require_mgf(); require_oids(); require_pem(); require_pss(); require_rsa(); require_util10(); var asn1 = forge.asn1; var pki = module3.exports = forge.pki = forge.pki || {}; var oids = pki.oids; var _shortNames = {}; _shortNames["CN"] = oids["commonName"]; _shortNames["commonName"] = "CN"; _shortNames["C"] = oids["countryName"]; _shortNames["countryName"] = "C"; _shortNames["L"] = oids["localityName"]; _shortNames["localityName"] = "L"; _shortNames["ST"] = oids["stateOrProvinceName"]; _shortNames["stateOrProvinceName"] = "ST"; _shortNames["O"] = oids["organizationName"]; _shortNames["organizationName"] = "O"; _shortNames["OU"] = oids["organizationalUnitName"]; _shortNames["organizationalUnitName"] = "OU"; _shortNames["E"] = oids["emailAddress"]; _shortNames["emailAddress"] = "E"; var publicKeyValidator = forge.pki.rsa.publicKeyValidator; var x509CertificateValidator = { name: "Certificate", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "Certificate.TBSCertificate", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: "tbsCertificate", value: [ { name: "Certificate.TBSCertificate.version", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, constructed: true, optional: true, value: [{ name: "Certificate.TBSCertificate.version.integer", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "certVersion" }] }, { name: "Certificate.TBSCertificate.serialNumber", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "certSerialNumber" }, { name: "Certificate.TBSCertificate.signature", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "Certificate.TBSCertificate.signature.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "certinfoSignatureOid" }, { name: "Certificate.TBSCertificate.signature.parameters", tagClass: asn1.Class.UNIVERSAL, optional: true, captureAsn1: "certinfoSignatureParams" }] }, { name: "Certificate.TBSCertificate.issuer", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: "certIssuer" }, { name: "Certificate.TBSCertificate.validity", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, // Note: UTC and generalized times may both appear so the capture // names are based on their detected order, the names used below // are only for the common case, which validity time really means // "notBefore" and which means "notAfter" will be determined by order value: [{ // notBefore (Time) (UTC time case) name: "Certificate.TBSCertificate.validity.notBefore (utc)", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.UTCTIME, constructed: false, optional: true, capture: "certValidity1UTCTime" }, { // notBefore (Time) (generalized time case) name: "Certificate.TBSCertificate.validity.notBefore (generalized)", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.GENERALIZEDTIME, constructed: false, optional: true, capture: "certValidity2GeneralizedTime" }, { // notAfter (Time) (only UTC time is supported) name: "Certificate.TBSCertificate.validity.notAfter (utc)", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.UTCTIME, constructed: false, optional: true, capture: "certValidity3UTCTime" }, { // notAfter (Time) (only UTC time is supported) name: "Certificate.TBSCertificate.validity.notAfter (generalized)", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.GENERALIZEDTIME, constructed: false, optional: true, capture: "certValidity4GeneralizedTime" }] }, { // Name (subject) (RDNSequence) name: "Certificate.TBSCertificate.subject", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: "certSubject" }, // SubjectPublicKeyInfo publicKeyValidator, { // issuerUniqueID (optional) name: "Certificate.TBSCertificate.issuerUniqueID", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 1, constructed: true, optional: true, value: [{ name: "Certificate.TBSCertificate.issuerUniqueID.id", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, // TODO: support arbitrary bit length ids captureBitStringValue: "certIssuerUniqueId" }] }, { // subjectUniqueID (optional) name: "Certificate.TBSCertificate.subjectUniqueID", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 2, constructed: true, optional: true, value: [{ name: "Certificate.TBSCertificate.subjectUniqueID.id", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, // TODO: support arbitrary bit length ids captureBitStringValue: "certSubjectUniqueId" }] }, { // Extensions (optional) name: "Certificate.TBSCertificate.extensions", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 3, constructed: true, captureAsn1: "certExtensions", optional: true } ] }, { // AlgorithmIdentifier (signature algorithm) name: "Certificate.signatureAlgorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ // algorithm name: "Certificate.signatureAlgorithm.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "certSignatureOid" }, { name: "Certificate.TBSCertificate.signature.parameters", tagClass: asn1.Class.UNIVERSAL, optional: true, captureAsn1: "certSignatureParams" }] }, { // SignatureValue name: "Certificate.signatureValue", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, captureBitStringValue: "certSignature" }] }; var rsassaPssParameterValidator = { name: "rsapss", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "rsapss.hashAlgorithm", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, constructed: true, value: [{ name: "rsapss.hashAlgorithm.AlgorithmIdentifier", tagClass: asn1.Class.UNIVERSAL, type: asn1.Class.SEQUENCE, constructed: true, optional: true, value: [{ name: "rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "hashOid" /* parameter block omitted, for SHA1 NULL anyhow. */ }] }] }, { name: "rsapss.maskGenAlgorithm", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 1, constructed: true, value: [{ name: "rsapss.maskGenAlgorithm.AlgorithmIdentifier", tagClass: asn1.Class.UNIVERSAL, type: asn1.Class.SEQUENCE, constructed: true, optional: true, value: [{ name: "rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "maskGenOid" }, { name: "rsapss.maskGenAlgorithm.AlgorithmIdentifier.params", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "maskGenHashOid" /* parameter block omitted, for SHA1 NULL anyhow. */ }] }] }] }, { name: "rsapss.saltLength", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 2, optional: true, value: [{ name: "rsapss.saltLength.saltLength", tagClass: asn1.Class.UNIVERSAL, type: asn1.Class.INTEGER, constructed: false, capture: "saltLength" }] }, { name: "rsapss.trailerField", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 3, optional: true, value: [{ name: "rsapss.trailer.trailer", tagClass: asn1.Class.UNIVERSAL, type: asn1.Class.INTEGER, constructed: false, capture: "trailer" }] }] }; var certificationRequestInfoValidator = { name: "CertificationRequestInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: "certificationRequestInfo", value: [ { name: "CertificationRequestInfo.integer", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "certificationRequestInfoVersion" }, { // Name (subject) (RDNSequence) name: "CertificationRequestInfo.subject", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: "certificationRequestInfoSubject" }, // SubjectPublicKeyInfo publicKeyValidator, { name: "CertificationRequestInfo.attributes", tagClass: asn1.Class.CONTEXT_SPECIFIC, type: 0, constructed: true, optional: true, capture: "certificationRequestInfoAttributes", value: [{ name: "CertificationRequestInfo.attributes", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "CertificationRequestInfo.attributes.type", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false }, { name: "CertificationRequestInfo.attributes.value", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SET, constructed: true }] }] } ] }; var certificationRequestValidator = { name: "CertificationRequest", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: "csr", value: [ certificationRequestInfoValidator, { // AlgorithmIdentifier (signature algorithm) name: "CertificationRequest.signatureAlgorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ // algorithm name: "CertificationRequest.signatureAlgorithm.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "csrSignatureOid" }, { name: "CertificationRequest.signatureAlgorithm.parameters", tagClass: asn1.Class.UNIVERSAL, optional: true, captureAsn1: "csrSignatureParams" }] }, { // signature name: "CertificationRequest.signature", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, captureBitStringValue: "csrSignature" } ] }; pki.RDNAttributesAsArray = function(rdn, md) { var rval = []; var set, attr, obj; for (var si2 = 0; si2 < rdn.value.length; ++si2) { set = rdn.value[si2]; for (var i5 = 0; i5 < set.value.length; ++i5) { obj = {}; attr = set.value[i5]; obj.type = asn1.derToOid(attr.value[0].value); obj.value = attr.value[1].value; obj.valueTagClass = attr.value[1].type; if (obj.type in oids) { obj.name = oids[obj.type]; if (obj.name in _shortNames) { obj.shortName = _shortNames[obj.name]; } } if (md) { md.update(obj.type); md.update(obj.value); } rval.push(obj); } } return rval; }; pki.CRIAttributesAsArray = function(attributes) { var rval = []; for (var si2 = 0; si2 < attributes.length; ++si2) { var seq = attributes[si2]; var type = asn1.derToOid(seq.value[0].value); var values = seq.value[1].value; for (var vi = 0; vi < values.length; ++vi) { var obj = {}; obj.type = type; obj.value = values[vi].value; obj.valueTagClass = values[vi].type; if (obj.type in oids) { obj.name = oids[obj.type]; if (obj.name in _shortNames) { obj.shortName = _shortNames[obj.name]; } } if (obj.type === oids.extensionRequest) { obj.extensions = []; for (var ei = 0; ei < obj.value.length; ++ei) { obj.extensions.push(pki.certificateExtensionFromAsn1(obj.value[ei])); } } rval.push(obj); } } return rval; }; function _getAttribute(obj, options32) { if (typeof options32 === "string") { options32 = { shortName: options32 }; } var rval = null; var attr; for (var i5 = 0; rval === null && i5 < obj.attributes.length; ++i5) { attr = obj.attributes[i5]; if (options32.type && options32.type === attr.type) { rval = attr; } else if (options32.name && options32.name === attr.name) { rval = attr; } else if (options32.shortName && options32.shortName === attr.shortName) { rval = attr; } } return rval; } __name(_getAttribute, "_getAttribute"); var _readSignatureParameters = /* @__PURE__ */ __name(function(oid, obj, fillDefaults) { var params = {}; if (oid !== oids["RSASSA-PSS"]) { return params; } if (fillDefaults) { params = { hash: { algorithmOid: oids["sha1"] }, mgf: { algorithmOid: oids["mgf1"], hash: { algorithmOid: oids["sha1"] } }, saltLength: 20 }; } var capture = {}; var errors = []; if (!asn1.validate(obj, rsassaPssParameterValidator, capture, errors)) { var error2 = new Error("Cannot read RSASSA-PSS parameter block."); error2.errors = errors; throw error2; } if (capture.hashOid !== void 0) { params.hash = params.hash || {}; params.hash.algorithmOid = asn1.derToOid(capture.hashOid); } if (capture.maskGenOid !== void 0) { params.mgf = params.mgf || {}; params.mgf.algorithmOid = asn1.derToOid(capture.maskGenOid); params.mgf.hash = params.mgf.hash || {}; params.mgf.hash.algorithmOid = asn1.derToOid(capture.maskGenHashOid); } if (capture.saltLength !== void 0) { params.saltLength = capture.saltLength.charCodeAt(0); } return params; }, "_readSignatureParameters"); var _createSignatureDigest = /* @__PURE__ */ __name(function(options32) { switch (oids[options32.signatureOid]) { case "sha1WithRSAEncryption": case "sha1WithRSASignature": return forge.md.sha1.create(); case "md5WithRSAEncryption": return forge.md.md5.create(); case "sha256WithRSAEncryption": return forge.md.sha256.create(); case "sha384WithRSAEncryption": return forge.md.sha384.create(); case "sha512WithRSAEncryption": return forge.md.sha512.create(); case "RSASSA-PSS": return forge.md.sha256.create(); default: var error2 = new Error( "Could not compute " + options32.type + " digest. Unknown signature OID." ); error2.signatureOid = options32.signatureOid; throw error2; } }, "_createSignatureDigest"); var _verifySignature = /* @__PURE__ */ __name(function(options32) { var cert = options32.certificate; var scheme; switch (cert.signatureOid) { case oids.sha1WithRSAEncryption: case oids.sha1WithRSASignature: break; case oids["RSASSA-PSS"]: var hash, mgf; hash = oids[cert.signatureParameters.mgf.hash.algorithmOid]; if (hash === void 0 || forge.md[hash] === void 0) { var error2 = new Error("Unsupported MGF hash function."); error2.oid = cert.signatureParameters.mgf.hash.algorithmOid; error2.name = hash; throw error2; } mgf = oids[cert.signatureParameters.mgf.algorithmOid]; if (mgf === void 0 || forge.mgf[mgf] === void 0) { var error2 = new Error("Unsupported MGF function."); error2.oid = cert.signatureParameters.mgf.algorithmOid; error2.name = mgf; throw error2; } mgf = forge.mgf[mgf].create(forge.md[hash].create()); hash = oids[cert.signatureParameters.hash.algorithmOid]; if (hash === void 0 || forge.md[hash] === void 0) { var error2 = new Error("Unsupported RSASSA-PSS hash function."); error2.oid = cert.signatureParameters.hash.algorithmOid; error2.name = hash; throw error2; } scheme = forge.pss.create( forge.md[hash].create(), mgf, cert.signatureParameters.saltLength ); break; } return cert.publicKey.verify( options32.md.digest().getBytes(), options32.signature, scheme ); }, "_verifySignature"); pki.certificateFromPem = function(pem, computeHash, strict) { var msg = forge.pem.decode(pem)[0]; if (msg.type !== "CERTIFICATE" && msg.type !== "X509 CERTIFICATE" && msg.type !== "TRUSTED CERTIFICATE") { var error2 = new Error( 'Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".' ); error2.headerType = msg.type; throw error2; } if (msg.procType && msg.procType.type === "ENCRYPTED") { throw new Error( "Could not convert certificate from PEM; PEM is encrypted." ); } var obj = asn1.fromDer(msg.body, strict); return pki.certificateFromAsn1(obj, computeHash); }; pki.certificateToPem = function(cert, maxline) { var msg = { type: "CERTIFICATE", body: asn1.toDer(pki.certificateToAsn1(cert)).getBytes() }; return forge.pem.encode(msg, { maxline }); }; pki.publicKeyFromPem = function(pem) { var msg = forge.pem.decode(pem)[0]; if (msg.type !== "PUBLIC KEY" && msg.type !== "RSA PUBLIC KEY") { var error2 = new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".'); error2.headerType = msg.type; throw error2; } if (msg.procType && msg.procType.type === "ENCRYPTED") { throw new Error("Could not convert public key from PEM; PEM is encrypted."); } var obj = asn1.fromDer(msg.body); return pki.publicKeyFromAsn1(obj); }; pki.publicKeyToPem = function(key, maxline) { var msg = { type: "PUBLIC KEY", body: asn1.toDer(pki.publicKeyToAsn1(key)).getBytes() }; return forge.pem.encode(msg, { maxline }); }; pki.publicKeyToRSAPublicKeyPem = function(key, maxline) { var msg = { type: "RSA PUBLIC KEY", body: asn1.toDer(pki.publicKeyToRSAPublicKey(key)).getBytes() }; return forge.pem.encode(msg, { maxline }); }; pki.getPublicKeyFingerprint = function(key, options32) { options32 = options32 || {}; var md = options32.md || forge.md.sha1.create(); var type = options32.type || "RSAPublicKey"; var bytes; switch (type) { case "RSAPublicKey": bytes = asn1.toDer(pki.publicKeyToRSAPublicKey(key)).getBytes(); break; case "SubjectPublicKeyInfo": bytes = asn1.toDer(pki.publicKeyToAsn1(key)).getBytes(); break; default: throw new Error('Unknown fingerprint type "' + options32.type + '".'); } md.start(); md.update(bytes); var digest = md.digest(); if (options32.encoding === "hex") { var hex = digest.toHex(); if (options32.delimiter) { return hex.match(/.{2}/g).join(options32.delimiter); } return hex; } else if (options32.encoding === "binary") { return digest.getBytes(); } else if (options32.encoding) { throw new Error('Unknown encoding "' + options32.encoding + '".'); } return digest; }; pki.certificationRequestFromPem = function(pem, computeHash, strict) { var msg = forge.pem.decode(pem)[0]; if (msg.type !== "CERTIFICATE REQUEST") { var error2 = new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".'); error2.headerType = msg.type; throw error2; } if (msg.procType && msg.procType.type === "ENCRYPTED") { throw new Error("Could not convert certification request from PEM; PEM is encrypted."); } var obj = asn1.fromDer(msg.body, strict); return pki.certificationRequestFromAsn1(obj, computeHash); }; pki.certificationRequestToPem = function(csr, maxline) { var msg = { type: "CERTIFICATE REQUEST", body: asn1.toDer(pki.certificationRequestToAsn1(csr)).getBytes() }; return forge.pem.encode(msg, { maxline }); }; pki.createCertificate = function() { var cert = {}; cert.version = 2; cert.serialNumber = "00"; cert.signatureOid = null; cert.signature = null; cert.siginfo = {}; cert.siginfo.algorithmOid = null; cert.validity = {}; cert.validity.notBefore = /* @__PURE__ */ new Date(); cert.validity.notAfter = /* @__PURE__ */ new Date(); cert.issuer = {}; cert.issuer.getField = function(sn) { return _getAttribute(cert.issuer, sn); }; cert.issuer.addField = function(attr) { _fillMissingFields([attr]); cert.issuer.attributes.push(attr); }; cert.issuer.attributes = []; cert.issuer.hash = null; cert.subject = {}; cert.subject.getField = function(sn) { return _getAttribute(cert.subject, sn); }; cert.subject.addField = function(attr) { _fillMissingFields([attr]); cert.subject.attributes.push(attr); }; cert.subject.attributes = []; cert.subject.hash = null; cert.extensions = []; cert.publicKey = null; cert.md = null; cert.setSubject = function(attrs, uniqueId) { _fillMissingFields(attrs); cert.subject.attributes = attrs; delete cert.subject.uniqueId; if (uniqueId) { cert.subject.uniqueId = uniqueId; } cert.subject.hash = null; }; cert.setIssuer = function(attrs, uniqueId) { _fillMissingFields(attrs); cert.issuer.attributes = attrs; delete cert.issuer.uniqueId; if (uniqueId) { cert.issuer.uniqueId = uniqueId; } cert.issuer.hash = null; }; cert.setExtensions = function(exts) { for (var i5 = 0; i5 < exts.length; ++i5) { _fillMissingExtensionFields(exts[i5], { cert }); } cert.extensions = exts; }; cert.getExtension = function(options32) { if (typeof options32 === "string") { options32 = { name: options32 }; } var rval = null; var ext; for (var i5 = 0; rval === null && i5 < cert.extensions.length; ++i5) { ext = cert.extensions[i5]; if (options32.id && ext.id === options32.id) { rval = ext; } else if (options32.name && ext.name === options32.name) { rval = ext; } } return rval; }; cert.sign = function(key, md) { cert.md = md || forge.md.sha1.create(); var algorithmOid = oids[cert.md.algorithm + "WithRSAEncryption"]; if (!algorithmOid) { var error2 = new Error("Could not compute certificate digest. Unknown message digest algorithm OID."); error2.algorithm = cert.md.algorithm; throw error2; } cert.signatureOid = cert.siginfo.algorithmOid = algorithmOid; cert.tbsCertificate = pki.getTBSCertificate(cert); var bytes = asn1.toDer(cert.tbsCertificate); cert.md.update(bytes.getBytes()); cert.signature = key.sign(cert.md); }; cert.verify = function(child) { var rval = false; if (!cert.issued(child)) { var issuer = child.issuer; var subject = cert.subject; var error2 = new Error( "The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject." ); error2.expectedIssuer = subject.attributes; error2.actualIssuer = issuer.attributes; throw error2; } var md = child.md; if (md === null) { md = _createSignatureDigest({ signatureOid: child.signatureOid, type: "certificate" }); var tbsCertificate = child.tbsCertificate || pki.getTBSCertificate(child); var bytes = asn1.toDer(tbsCertificate); md.update(bytes.getBytes()); } if (md !== null) { rval = _verifySignature({ certificate: cert, md, signature: child.signature }); } return rval; }; cert.isIssuer = function(parent) { var rval = false; var i5 = cert.issuer; var s5 = parent.subject; if (i5.hash && s5.hash) { rval = i5.hash === s5.hash; } else if (i5.attributes.length === s5.attributes.length) { rval = true; var iattr, sattr; for (var n6 = 0; rval && n6 < i5.attributes.length; ++n6) { iattr = i5.attributes[n6]; sattr = s5.attributes[n6]; if (iattr.type !== sattr.type || iattr.value !== sattr.value) { rval = false; } } } return rval; }; cert.issued = function(child) { return child.isIssuer(cert); }; cert.generateSubjectKeyIdentifier = function() { return pki.getPublicKeyFingerprint(cert.publicKey, { type: "RSAPublicKey" }); }; cert.verifySubjectKeyIdentifier = function() { var oid = oids["subjectKeyIdentifier"]; for (var i5 = 0; i5 < cert.extensions.length; ++i5) { var ext = cert.extensions[i5]; if (ext.id === oid) { var ski = cert.generateSubjectKeyIdentifier().getBytes(); return forge.util.hexToBytes(ext.subjectKeyIdentifier) === ski; } } return false; }; return cert; }; pki.certificateFromAsn1 = function(obj, computeHash) { var capture = {}; var errors = []; if (!asn1.validate(obj, x509CertificateValidator, capture, errors)) { var error2 = new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate."); error2.errors = errors; throw error2; } var oid = asn1.derToOid(capture.publicKeyOid); if (oid !== pki.oids.rsaEncryption) { throw new Error("Cannot read public key. OID is not RSA."); } var cert = pki.createCertificate(); cert.version = capture.certVersion ? capture.certVersion.charCodeAt(0) : 0; var serial = forge.util.createBuffer(capture.certSerialNumber); cert.serialNumber = serial.toHex(); cert.signatureOid = forge.asn1.derToOid(capture.certSignatureOid); cert.signatureParameters = _readSignatureParameters( cert.signatureOid, capture.certSignatureParams, true ); cert.siginfo.algorithmOid = forge.asn1.derToOid(capture.certinfoSignatureOid); cert.siginfo.parameters = _readSignatureParameters( cert.siginfo.algorithmOid, capture.certinfoSignatureParams, false ); cert.signature = capture.certSignature; var validity = []; if (capture.certValidity1UTCTime !== void 0) { validity.push(asn1.utcTimeToDate(capture.certValidity1UTCTime)); } if (capture.certValidity2GeneralizedTime !== void 0) { validity.push(asn1.generalizedTimeToDate( capture.certValidity2GeneralizedTime )); } if (capture.certValidity3UTCTime !== void 0) { validity.push(asn1.utcTimeToDate(capture.certValidity3UTCTime)); } if (capture.certValidity4GeneralizedTime !== void 0) { validity.push(asn1.generalizedTimeToDate( capture.certValidity4GeneralizedTime )); } if (validity.length > 2) { throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate."); } if (validity.length < 2) { throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime."); } cert.validity.notBefore = validity[0]; cert.validity.notAfter = validity[1]; cert.tbsCertificate = capture.tbsCertificate; if (computeHash) { cert.md = _createSignatureDigest({ signatureOid: cert.signatureOid, type: "certificate" }); var bytes = asn1.toDer(cert.tbsCertificate); cert.md.update(bytes.getBytes()); } var imd = forge.md.sha1.create(); var ibytes = asn1.toDer(capture.certIssuer); imd.update(ibytes.getBytes()); cert.issuer.getField = function(sn) { return _getAttribute(cert.issuer, sn); }; cert.issuer.addField = function(attr) { _fillMissingFields([attr]); cert.issuer.attributes.push(attr); }; cert.issuer.attributes = pki.RDNAttributesAsArray(capture.certIssuer); if (capture.certIssuerUniqueId) { cert.issuer.uniqueId = capture.certIssuerUniqueId; } cert.issuer.hash = imd.digest().toHex(); var smd = forge.md.sha1.create(); var sbytes = asn1.toDer(capture.certSubject); smd.update(sbytes.getBytes()); cert.subject.getField = function(sn) { return _getAttribute(cert.subject, sn); }; cert.subject.addField = function(attr) { _fillMissingFields([attr]); cert.subject.attributes.push(attr); }; cert.subject.attributes = pki.RDNAttributesAsArray(capture.certSubject); if (capture.certSubjectUniqueId) { cert.subject.uniqueId = capture.certSubjectUniqueId; } cert.subject.hash = smd.digest().toHex(); if (capture.certExtensions) { cert.extensions = pki.certificateExtensionsFromAsn1(capture.certExtensions); } else { cert.extensions = []; } cert.publicKey = pki.publicKeyFromAsn1(capture.subjectPublicKeyInfo); return cert; }; pki.certificateExtensionsFromAsn1 = function(exts) { var rval = []; for (var i5 = 0; i5 < exts.value.length; ++i5) { var extseq = exts.value[i5]; for (var ei = 0; ei < extseq.value.length; ++ei) { rval.push(pki.certificateExtensionFromAsn1(extseq.value[ei])); } } return rval; }; pki.certificateExtensionFromAsn1 = function(ext) { var e7 = {}; e7.id = asn1.derToOid(ext.value[0].value); e7.critical = false; if (ext.value[1].type === asn1.Type.BOOLEAN) { e7.critical = ext.value[1].value.charCodeAt(0) !== 0; e7.value = ext.value[2].value; } else { e7.value = ext.value[1].value; } if (e7.id in oids) { e7.name = oids[e7.id]; if (e7.name === "keyUsage") { var ev = asn1.fromDer(e7.value); var b22 = 0; var b32 = 0; if (ev.value.length > 1) { b22 = ev.value.charCodeAt(1); b32 = ev.value.length > 2 ? ev.value.charCodeAt(2) : 0; } e7.digitalSignature = (b22 & 128) === 128; e7.nonRepudiation = (b22 & 64) === 64; e7.keyEncipherment = (b22 & 32) === 32; e7.dataEncipherment = (b22 & 16) === 16; e7.keyAgreement = (b22 & 8) === 8; e7.keyCertSign = (b22 & 4) === 4; e7.cRLSign = (b22 & 2) === 2; e7.encipherOnly = (b22 & 1) === 1; e7.decipherOnly = (b32 & 128) === 128; } else if (e7.name === "basicConstraints") { var ev = asn1.fromDer(e7.value); if (ev.value.length > 0 && ev.value[0].type === asn1.Type.BOOLEAN) { e7.cA = ev.value[0].value.charCodeAt(0) !== 0; } else { e7.cA = false; } var value = null; if (ev.value.length > 0 && ev.value[0].type === asn1.Type.INTEGER) { value = ev.value[0].value; } else if (ev.value.length > 1) { value = ev.value[1].value; } if (value !== null) { e7.pathLenConstraint = asn1.derToInteger(value); } } else if (e7.name === "extKeyUsage") { var ev = asn1.fromDer(e7.value); for (var vi = 0; vi < ev.value.length; ++vi) { var oid = asn1.derToOid(ev.value[vi].value); if (oid in oids) { e7[oids[oid]] = true; } else { e7[oid] = true; } } } else if (e7.name === "nsCertType") { var ev = asn1.fromDer(e7.value); var b22 = 0; if (ev.value.length > 1) { b22 = ev.value.charCodeAt(1); } e7.client = (b22 & 128) === 128; e7.server = (b22 & 64) === 64; e7.email = (b22 & 32) === 32; e7.objsign = (b22 & 16) === 16; e7.reserved = (b22 & 8) === 8; e7.sslCA = (b22 & 4) === 4; e7.emailCA = (b22 & 2) === 2; e7.objCA = (b22 & 1) === 1; } else if (e7.name === "subjectAltName" || e7.name === "issuerAltName") { e7.altNames = []; var gn; var ev = asn1.fromDer(e7.value); for (var n6 = 0; n6 < ev.value.length; ++n6) { gn = ev.value[n6]; var altName = { type: gn.type, value: gn.value }; e7.altNames.push(altName); switch (gn.type) { case 1: case 2: case 6: break; case 7: altName.ip = forge.util.bytesToIP(gn.value); break; case 8: altName.oid = asn1.derToOid(gn.value); break; default: } } } else if (e7.name === "subjectKeyIdentifier") { var ev = asn1.fromDer(e7.value); e7.subjectKeyIdentifier = forge.util.bytesToHex(ev.value); } } return e7; }; pki.certificationRequestFromAsn1 = function(obj, computeHash) { var capture = {}; var errors = []; if (!asn1.validate(obj, certificationRequestValidator, capture, errors)) { var error2 = new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest."); error2.errors = errors; throw error2; } var oid = asn1.derToOid(capture.publicKeyOid); if (oid !== pki.oids.rsaEncryption) { throw new Error("Cannot read public key. OID is not RSA."); } var csr = pki.createCertificationRequest(); csr.version = capture.csrVersion ? capture.csrVersion.charCodeAt(0) : 0; csr.signatureOid = forge.asn1.derToOid(capture.csrSignatureOid); csr.signatureParameters = _readSignatureParameters( csr.signatureOid, capture.csrSignatureParams, true ); csr.siginfo.algorithmOid = forge.asn1.derToOid(capture.csrSignatureOid); csr.siginfo.parameters = _readSignatureParameters( csr.siginfo.algorithmOid, capture.csrSignatureParams, false ); csr.signature = capture.csrSignature; csr.certificationRequestInfo = capture.certificationRequestInfo; if (computeHash) { csr.md = _createSignatureDigest({ signatureOid: csr.signatureOid, type: "certification request" }); var bytes = asn1.toDer(csr.certificationRequestInfo); csr.md.update(bytes.getBytes()); } var smd = forge.md.sha1.create(); csr.subject.getField = function(sn) { return _getAttribute(csr.subject, sn); }; csr.subject.addField = function(attr) { _fillMissingFields([attr]); csr.subject.attributes.push(attr); }; csr.subject.attributes = pki.RDNAttributesAsArray( capture.certificationRequestInfoSubject, smd ); csr.subject.hash = smd.digest().toHex(); csr.publicKey = pki.publicKeyFromAsn1(capture.subjectPublicKeyInfo); csr.getAttribute = function(sn) { return _getAttribute(csr, sn); }; csr.addAttribute = function(attr) { _fillMissingFields([attr]); csr.attributes.push(attr); }; csr.attributes = pki.CRIAttributesAsArray( capture.certificationRequestInfoAttributes || [] ); return csr; }; pki.createCertificationRequest = function() { var csr = {}; csr.version = 0; csr.signatureOid = null; csr.signature = null; csr.siginfo = {}; csr.siginfo.algorithmOid = null; csr.subject = {}; csr.subject.getField = function(sn) { return _getAttribute(csr.subject, sn); }; csr.subject.addField = function(attr) { _fillMissingFields([attr]); csr.subject.attributes.push(attr); }; csr.subject.attributes = []; csr.subject.hash = null; csr.publicKey = null; csr.attributes = []; csr.getAttribute = function(sn) { return _getAttribute(csr, sn); }; csr.addAttribute = function(attr) { _fillMissingFields([attr]); csr.attributes.push(attr); }; csr.md = null; csr.setSubject = function(attrs) { _fillMissingFields(attrs); csr.subject.attributes = attrs; csr.subject.hash = null; }; csr.setAttributes = function(attrs) { _fillMissingFields(attrs); csr.attributes = attrs; }; csr.sign = function(key, md) { csr.md = md || forge.md.sha1.create(); var algorithmOid = oids[csr.md.algorithm + "WithRSAEncryption"]; if (!algorithmOid) { var error2 = new Error("Could not compute certification request digest. Unknown message digest algorithm OID."); error2.algorithm = csr.md.algorithm; throw error2; } csr.signatureOid = csr.siginfo.algorithmOid = algorithmOid; csr.certificationRequestInfo = pki.getCertificationRequestInfo(csr); var bytes = asn1.toDer(csr.certificationRequestInfo); csr.md.update(bytes.getBytes()); csr.signature = key.sign(csr.md); }; csr.verify = function() { var rval = false; var md = csr.md; if (md === null) { md = _createSignatureDigest({ signatureOid: csr.signatureOid, type: "certification request" }); var cri = csr.certificationRequestInfo || pki.getCertificationRequestInfo(csr); var bytes = asn1.toDer(cri); md.update(bytes.getBytes()); } if (md !== null) { rval = _verifySignature({ certificate: csr, md, signature: csr.signature }); } return rval; }; return csr; }; function _dnToAsn1(obj) { var rval = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [] ); var attr, set; var attrs = obj.attributes; for (var i5 = 0; i5 < attrs.length; ++i5) { attr = attrs[i5]; var value = attr.value; var valueTagClass = asn1.Type.PRINTABLESTRING; if ("valueTagClass" in attr) { valueTagClass = attr.valueTagClass; if (valueTagClass === asn1.Type.UTF8) { value = forge.util.encodeUtf8(value); } } set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // AttributeType asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(attr.type).getBytes() ), // AttributeValue asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value) ]) ]); rval.value.push(set); } return rval; } __name(_dnToAsn1, "_dnToAsn1"); function _fillMissingFields(attrs) { var attr; for (var i5 = 0; i5 < attrs.length; ++i5) { attr = attrs[i5]; if (typeof attr.name === "undefined") { if (attr.type && attr.type in pki.oids) { attr.name = pki.oids[attr.type]; } else if (attr.shortName && attr.shortName in _shortNames) { attr.name = pki.oids[_shortNames[attr.shortName]]; } } if (typeof attr.type === "undefined") { if (attr.name && attr.name in pki.oids) { attr.type = pki.oids[attr.name]; } else { var error2 = new Error("Attribute type not specified."); error2.attribute = attr; throw error2; } } if (typeof attr.shortName === "undefined") { if (attr.name && attr.name in _shortNames) { attr.shortName = _shortNames[attr.name]; } } if (attr.type === oids.extensionRequest) { attr.valueConstructed = true; attr.valueTagClass = asn1.Type.SEQUENCE; if (!attr.value && attr.extensions) { attr.value = []; for (var ei = 0; ei < attr.extensions.length; ++ei) { attr.value.push(pki.certificateExtensionToAsn1( _fillMissingExtensionFields(attr.extensions[ei]) )); } } } if (typeof attr.value === "undefined") { var error2 = new Error("Attribute value not specified."); error2.attribute = attr; throw error2; } } } __name(_fillMissingFields, "_fillMissingFields"); function _fillMissingExtensionFields(e7, options32) { options32 = options32 || {}; if (typeof e7.name === "undefined") { if (e7.id && e7.id in pki.oids) { e7.name = pki.oids[e7.id]; } } if (typeof e7.id === "undefined") { if (e7.name && e7.name in pki.oids) { e7.id = pki.oids[e7.name]; } else { var error2 = new Error("Extension ID not specified."); error2.extension = e7; throw error2; } } if (typeof e7.value !== "undefined") { return e7; } if (e7.name === "keyUsage") { var unused = 0; var b22 = 0; var b32 = 0; if (e7.digitalSignature) { b22 |= 128; unused = 7; } if (e7.nonRepudiation) { b22 |= 64; unused = 6; } if (e7.keyEncipherment) { b22 |= 32; unused = 5; } if (e7.dataEncipherment) { b22 |= 16; unused = 4; } if (e7.keyAgreement) { b22 |= 8; unused = 3; } if (e7.keyCertSign) { b22 |= 4; unused = 2; } if (e7.cRLSign) { b22 |= 2; unused = 1; } if (e7.encipherOnly) { b22 |= 1; unused = 0; } if (e7.decipherOnly) { b32 |= 128; unused = 7; } var value = String.fromCharCode(unused); if (b32 !== 0) { value += String.fromCharCode(b22) + String.fromCharCode(b32); } else if (b22 !== 0) { value += String.fromCharCode(b22); } e7.value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, value ); } else if (e7.name === "basicConstraints") { e7.value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [] ); if (e7.cA) { e7.value.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BOOLEAN, false, String.fromCharCode(255) )); } if ("pathLenConstraint" in e7) { e7.value.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(e7.pathLenConstraint).getBytes() )); } } else if (e7.name === "extKeyUsage") { e7.value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [] ); var seq = e7.value.value; for (var key in e7) { if (e7[key] !== true) { continue; } if (key in oids) { seq.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(oids[key]).getBytes() )); } else if (key.indexOf(".") !== -1) { seq.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(key).getBytes() )); } } } else if (e7.name === "nsCertType") { var unused = 0; var b22 = 0; if (e7.client) { b22 |= 128; unused = 7; } if (e7.server) { b22 |= 64; unused = 6; } if (e7.email) { b22 |= 32; unused = 5; } if (e7.objsign) { b22 |= 16; unused = 4; } if (e7.reserved) { b22 |= 8; unused = 3; } if (e7.sslCA) { b22 |= 4; unused = 2; } if (e7.emailCA) { b22 |= 2; unused = 1; } if (e7.objCA) { b22 |= 1; unused = 0; } var value = String.fromCharCode(unused); if (b22 !== 0) { value += String.fromCharCode(b22); } e7.value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, value ); } else if (e7.name === "subjectAltName" || e7.name === "issuerAltName") { e7.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); var altName; for (var n6 = 0; n6 < e7.altNames.length; ++n6) { altName = e7.altNames[n6]; var value = altName.value; if (altName.type === 7 && altName.ip) { value = forge.util.bytesFromIP(altName.ip); if (value === null) { var error2 = new Error( 'Extension "ip" value is not a valid IPv4 or IPv6 address.' ); error2.extension = e7; throw error2; } } else if (altName.type === 8) { if (altName.oid) { value = asn1.oidToDer(asn1.oidToDer(altName.oid)); } else { value = asn1.oidToDer(value); } } e7.value.value.push(asn1.create( asn1.Class.CONTEXT_SPECIFIC, altName.type, false, value )); } } else if (e7.name === "nsComment" && options32.cert) { if (!/^[\x00-\x7F]*$/.test(e7.comment) || e7.comment.length < 1 || e7.comment.length > 128) { throw new Error('Invalid "nsComment" content.'); } e7.value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.IA5STRING, false, e7.comment ); } else if (e7.name === "subjectKeyIdentifier" && options32.cert) { var ski = options32.cert.generateSubjectKeyIdentifier(); e7.subjectKeyIdentifier = ski.toHex(); e7.value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, ski.getBytes() ); } else if (e7.name === "authorityKeyIdentifier" && options32.cert) { e7.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); var seq = e7.value.value; if (e7.keyIdentifier) { var keyIdentifier = e7.keyIdentifier === true ? options32.cert.generateSubjectKeyIdentifier().getBytes() : e7.keyIdentifier; seq.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, false, keyIdentifier) ); } if (e7.authorityCertIssuer) { var authorityCertIssuer = [ asn1.create(asn1.Class.CONTEXT_SPECIFIC, 4, true, [ _dnToAsn1(e7.authorityCertIssuer === true ? options32.cert.issuer : e7.authorityCertIssuer) ]) ]; seq.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, authorityCertIssuer) ); } if (e7.serialNumber) { var serialNumber = forge.util.hexToBytes(e7.serialNumber === true ? options32.cert.serialNumber : e7.serialNumber); seq.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, false, serialNumber) ); } } else if (e7.name === "cRLDistributionPoints") { e7.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); var seq = e7.value.value; var subSeq = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [] ); var fullNameGeneralNames = asn1.create( asn1.Class.CONTEXT_SPECIFIC, 0, true, [] ); var altName; for (var n6 = 0; n6 < e7.altNames.length; ++n6) { altName = e7.altNames[n6]; var value = altName.value; if (altName.type === 7 && altName.ip) { value = forge.util.bytesFromIP(altName.ip); if (value === null) { var error2 = new Error( 'Extension "ip" value is not a valid IPv4 or IPv6 address.' ); error2.extension = e7; throw error2; } } else if (altName.type === 8) { if (altName.oid) { value = asn1.oidToDer(asn1.oidToDer(altName.oid)); } else { value = asn1.oidToDer(value); } } fullNameGeneralNames.value.push(asn1.create( asn1.Class.CONTEXT_SPECIFIC, altName.type, false, value )); } subSeq.value.push(asn1.create( asn1.Class.CONTEXT_SPECIFIC, 0, true, [fullNameGeneralNames] )); seq.push(subSeq); } if (typeof e7.value === "undefined") { var error2 = new Error("Extension value not specified."); error2.extension = e7; throw error2; } return e7; } __name(_fillMissingExtensionFields, "_fillMissingExtensionFields"); function _signatureParametersToAsn1(oid, params) { switch (oid) { case oids["RSASSA-PSS"]: var parts = []; if (params.hash.algorithmOid !== void 0) { parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(params.hash.algorithmOid).getBytes() ), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") ]) ])); } if (params.mgf.algorithmOid !== void 0) { parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(params.mgf.algorithmOid).getBytes() ), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(params.mgf.hash.algorithmOid).getBytes() ), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") ]) ]) ])); } if (params.saltLength !== void 0) { parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(params.saltLength).getBytes() ) ])); } return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, parts); default: return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, ""); } } __name(_signatureParametersToAsn1, "_signatureParametersToAsn1"); function _CRIAttributesToAsn1(csr) { var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, []); if (csr.attributes.length === 0) { return rval; } var attrs = csr.attributes; for (var i5 = 0; i5 < attrs.length; ++i5) { var attr = attrs[i5]; var value = attr.value; var valueTagClass = asn1.Type.UTF8; if ("valueTagClass" in attr) { valueTagClass = attr.valueTagClass; } if (valueTagClass === asn1.Type.UTF8) { value = forge.util.encodeUtf8(value); } var valueConstructed = false; if ("valueConstructed" in attr) { valueConstructed = attr.valueConstructed; } var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // AttributeType asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(attr.type).getBytes() ), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ // AttributeValue asn1.create( asn1.Class.UNIVERSAL, valueTagClass, valueConstructed, value ) ]) ]); rval.value.push(seq); } return rval; } __name(_CRIAttributesToAsn1, "_CRIAttributesToAsn1"); var jan_1_1950 = /* @__PURE__ */ new Date("1950-01-01T00:00:00Z"); var jan_1_2050 = /* @__PURE__ */ new Date("2050-01-01T00:00:00Z"); function _dateToAsn1(date) { if (date >= jan_1_1950 && date < jan_1_2050) { return asn1.create( asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false, asn1.dateToUtcTime(date) ); } else { return asn1.create( asn1.Class.UNIVERSAL, asn1.Type.GENERALIZEDTIME, false, asn1.dateToGeneralizedTime(date) ); } } __name(_dateToAsn1, "_dateToAsn1"); pki.getTBSCertificate = function(cert) { var notBefore = _dateToAsn1(cert.validity.notBefore); var notAfter = _dateToAsn1(cert.validity.notAfter); var tbs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // version asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ // integer asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(cert.version).getBytes() ) ]), // serialNumber asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, forge.util.hexToBytes(cert.serialNumber) ), // signature asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(cert.siginfo.algorithmOid).getBytes() ), // parameters _signatureParametersToAsn1( cert.siginfo.algorithmOid, cert.siginfo.parameters ) ]), // issuer _dnToAsn1(cert.issuer), // validity asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ notBefore, notAfter ]), // subject _dnToAsn1(cert.subject), // SubjectPublicKeyInfo pki.publicKeyToAsn1(cert.publicKey) ]); if (cert.issuer.uniqueId) { tbs.value.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, // TODO: support arbitrary bit length ids String.fromCharCode(0) + cert.issuer.uniqueId ) ]) ); } if (cert.subject.uniqueId) { tbs.value.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, // TODO: support arbitrary bit length ids String.fromCharCode(0) + cert.subject.uniqueId ) ]) ); } if (cert.extensions.length > 0) { tbs.value.push(pki.certificateExtensionsToAsn1(cert.extensions)); } return tbs; }; pki.getCertificationRequestInfo = function(csr) { var cri = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // version asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(csr.version).getBytes() ), // subject _dnToAsn1(csr.subject), // SubjectPublicKeyInfo pki.publicKeyToAsn1(csr.publicKey), // attributes _CRIAttributesToAsn1(csr) ]); return cri; }; pki.distinguishedNameToAsn1 = function(dn) { return _dnToAsn1(dn); }; pki.certificateToAsn1 = function(cert) { var tbsCertificate = cert.tbsCertificate || pki.getTBSCertificate(cert); return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // TBSCertificate tbsCertificate, // AlgorithmIdentifier (signature algorithm) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(cert.signatureOid).getBytes() ), // parameters _signatureParametersToAsn1(cert.signatureOid, cert.signatureParameters) ]), // SignatureValue asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, String.fromCharCode(0) + cert.signature ) ]); }; pki.certificateExtensionsToAsn1 = function(exts) { var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 3, true, []); var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); rval.value.push(seq); for (var i5 = 0; i5 < exts.length; ++i5) { seq.value.push(pki.certificateExtensionToAsn1(exts[i5])); } return rval; }; pki.certificateExtensionToAsn1 = function(ext) { var extseq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); extseq.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(ext.id).getBytes() )); if (ext.critical) { extseq.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BOOLEAN, false, String.fromCharCode(255) )); } var value = ext.value; if (typeof ext.value !== "string") { value = asn1.toDer(value).getBytes(); } extseq.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, value )); return extseq; }; pki.certificationRequestToAsn1 = function(csr) { var cri = csr.certificationRequestInfo || pki.getCertificationRequestInfo(csr); return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // CertificationRequestInfo cri, // AlgorithmIdentifier (signature algorithm) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(csr.signatureOid).getBytes() ), // parameters _signatureParametersToAsn1(csr.signatureOid, csr.signatureParameters) ]), // signature asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, String.fromCharCode(0) + csr.signature ) ]); }; pki.createCaStore = function(certs) { var caStore = { // stored certificates certs: {} }; caStore.getIssuer = function(cert2) { var rval = getBySubject(cert2.issuer); return rval; }; caStore.addCertificate = function(cert2) { if (typeof cert2 === "string") { cert2 = forge.pki.certificateFromPem(cert2); } ensureSubjectHasHash(cert2.subject); if (!caStore.hasCertificate(cert2)) { if (cert2.subject.hash in caStore.certs) { var tmp = caStore.certs[cert2.subject.hash]; if (!forge.util.isArray(tmp)) { tmp = [tmp]; } tmp.push(cert2); caStore.certs[cert2.subject.hash] = tmp; } else { caStore.certs[cert2.subject.hash] = cert2; } } }; caStore.hasCertificate = function(cert2) { if (typeof cert2 === "string") { cert2 = forge.pki.certificateFromPem(cert2); } var match2 = getBySubject(cert2.subject); if (!match2) { return false; } if (!forge.util.isArray(match2)) { match2 = [match2]; } var der1 = asn1.toDer(pki.certificateToAsn1(cert2)).getBytes(); for (var i6 = 0; i6 < match2.length; ++i6) { var der2 = asn1.toDer(pki.certificateToAsn1(match2[i6])).getBytes(); if (der1 === der2) { return true; } } return false; }; caStore.listAllCertificates = function() { var certList = []; for (var hash in caStore.certs) { if (caStore.certs.hasOwnProperty(hash)) { var value = caStore.certs[hash]; if (!forge.util.isArray(value)) { certList.push(value); } else { for (var i6 = 0; i6 < value.length; ++i6) { certList.push(value[i6]); } } } } return certList; }; caStore.removeCertificate = function(cert2) { var result; if (typeof cert2 === "string") { cert2 = forge.pki.certificateFromPem(cert2); } ensureSubjectHasHash(cert2.subject); if (!caStore.hasCertificate(cert2)) { return null; } var match2 = getBySubject(cert2.subject); if (!forge.util.isArray(match2)) { result = caStore.certs[cert2.subject.hash]; delete caStore.certs[cert2.subject.hash]; return result; } var der1 = asn1.toDer(pki.certificateToAsn1(cert2)).getBytes(); for (var i6 = 0; i6 < match2.length; ++i6) { var der2 = asn1.toDer(pki.certificateToAsn1(match2[i6])).getBytes(); if (der1 === der2) { result = match2[i6]; match2.splice(i6, 1); } } if (match2.length === 0) { delete caStore.certs[cert2.subject.hash]; } return result; }; function getBySubject(subject) { ensureSubjectHasHash(subject); return caStore.certs[subject.hash] || null; } __name(getBySubject, "getBySubject"); function ensureSubjectHasHash(subject) { if (!subject.hash) { var md = forge.md.sha1.create(); subject.attributes = pki.RDNAttributesAsArray(_dnToAsn1(subject), md); subject.hash = md.digest().toHex(); } } __name(ensureSubjectHasHash, "ensureSubjectHasHash"); if (certs) { for (var i5 = 0; i5 < certs.length; ++i5) { var cert = certs[i5]; caStore.addCertificate(cert); } } return caStore; }; pki.certificateError = { bad_certificate: "forge.pki.BadCertificate", unsupported_certificate: "forge.pki.UnsupportedCertificate", certificate_revoked: "forge.pki.CertificateRevoked", certificate_expired: "forge.pki.CertificateExpired", certificate_unknown: "forge.pki.CertificateUnknown", unknown_ca: "forge.pki.UnknownCertificateAuthority" }; pki.verifyCertificateChain = function(caStore, chain2, options32) { if (typeof options32 === "function") { options32 = { verify: options32 }; } options32 = options32 || {}; chain2 = chain2.slice(0); var certs = chain2.slice(0); var validityCheckDate = options32.validityCheckDate; if (typeof validityCheckDate === "undefined") { validityCheckDate = /* @__PURE__ */ new Date(); } var first = true; var error2 = null; var depth = 0; do { var cert = chain2.shift(); var parent = null; var selfSigned = false; if (validityCheckDate) { if (validityCheckDate < cert.validity.notBefore || validityCheckDate > cert.validity.notAfter) { error2 = { message: "Certificate is not valid yet or has expired.", error: pki.certificateError.certificate_expired, notBefore: cert.validity.notBefore, notAfter: cert.validity.notAfter, // TODO: we might want to reconsider renaming 'now' to // 'validityCheckDate' should this API be changed in the future. now: validityCheckDate }; } } if (error2 === null) { parent = chain2[0] || caStore.getIssuer(cert); if (parent === null) { if (cert.isIssuer(cert)) { selfSigned = true; parent = cert; } } if (parent) { var parents = parent; if (!forge.util.isArray(parents)) { parents = [parents]; } var verified = false; while (!verified && parents.length > 0) { parent = parents.shift(); try { verified = parent.verify(cert); } catch (ex) { } } if (!verified) { error2 = { message: "Certificate signature is invalid.", error: pki.certificateError.bad_certificate }; } } if (error2 === null && (!parent || selfSigned) && !caStore.hasCertificate(cert)) { error2 = { message: "Certificate is not trusted.", error: pki.certificateError.unknown_ca }; } } if (error2 === null && parent && !cert.isIssuer(parent)) { error2 = { message: "Certificate issuer is invalid.", error: pki.certificateError.bad_certificate }; } if (error2 === null) { var se2 = { keyUsage: true, basicConstraints: true }; for (var i5 = 0; error2 === null && i5 < cert.extensions.length; ++i5) { var ext = cert.extensions[i5]; if (ext.critical && !(ext.name in se2)) { error2 = { message: "Certificate has an unsupported critical extension.", error: pki.certificateError.unsupported_certificate }; } } } if (error2 === null && (!first || chain2.length === 0 && (!parent || selfSigned))) { var bcExt = cert.getExtension("basicConstraints"); var keyUsageExt = cert.getExtension("keyUsage"); if (keyUsageExt !== null) { if (!keyUsageExt.keyCertSign || bcExt === null) { error2 = { message: "Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.", error: pki.certificateError.bad_certificate }; } } if (error2 === null && bcExt !== null && !bcExt.cA) { error2 = { message: "Certificate basicConstraints indicates the certificate is not a CA.", error: pki.certificateError.bad_certificate }; } if (error2 === null && keyUsageExt !== null && "pathLenConstraint" in bcExt) { var pathLen = depth - 1; if (pathLen > bcExt.pathLenConstraint) { error2 = { message: "Certificate basicConstraints pathLenConstraint violated.", error: pki.certificateError.bad_certificate }; } } } var vfd = error2 === null ? true : error2.error; var ret = options32.verify ? options32.verify(vfd, depth, certs) : vfd; if (ret === true) { error2 = null; } else { if (vfd === true) { error2 = { message: "The application rejected the certificate.", error: pki.certificateError.bad_certificate }; } if (ret || ret === 0) { if (typeof ret === "object" && !forge.util.isArray(ret)) { if (ret.message) { error2.message = ret.message; } if (ret.error) { error2.error = ret.error; } } else if (typeof ret === "string") { error2.error = ret; } } throw error2; } first = false; ++depth; } while (chain2.length > 0); return true; }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pkcs12.js var require_pkcs12 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pkcs12.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_asn1(); require_hmac(); require_oids(); require_pkcs7asn1(); require_pbe(); require_random2(); require_rsa(); require_sha1(); require_util10(); require_x509(); var asn1 = forge.asn1; var pki = forge.pki; var p12 = module3.exports = forge.pkcs12 = forge.pkcs12 || {}; var contentInfoValidator = { name: "ContentInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, // a ContentInfo constructed: true, value: [{ name: "ContentInfo.contentType", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "contentType" }, { name: "ContentInfo.content", tagClass: asn1.Class.CONTEXT_SPECIFIC, constructed: true, captureAsn1: "content" }] }; var pfxValidator = { name: "PFX", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [ { name: "PFX.version", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "version" }, contentInfoValidator, { name: "PFX.macData", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, optional: true, captureAsn1: "mac", value: [{ name: "PFX.macData.mac", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, // DigestInfo constructed: true, value: [{ name: "PFX.macData.mac.digestAlgorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, // DigestAlgorithmIdentifier constructed: true, value: [{ name: "PFX.macData.mac.digestAlgorithm.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "macAlgorithm" }, { name: "PFX.macData.mac.digestAlgorithm.parameters", tagClass: asn1.Class.UNIVERSAL, captureAsn1: "macAlgorithmParameters" }] }, { name: "PFX.macData.mac.digest", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: "macDigest" }] }, { name: "PFX.macData.macSalt", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: "macSalt" }, { name: "PFX.macData.iterations", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, optional: true, capture: "macIterations" }] } ] }; var safeBagValidator = { name: "SafeBag", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "SafeBag.bagId", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "bagId" }, { name: "SafeBag.bagValue", tagClass: asn1.Class.CONTEXT_SPECIFIC, constructed: true, captureAsn1: "bagValue" }, { name: "SafeBag.bagAttributes", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SET, constructed: true, optional: true, capture: "bagAttributes" }] }; var attributeValidator = { name: "Attribute", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "Attribute.attrId", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "oid" }, { name: "Attribute.attrValues", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SET, constructed: true, capture: "values" }] }; var certBagValidator = { name: "CertBag", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "CertBag.certId", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "certId" }, { name: "CertBag.certValue", tagClass: asn1.Class.CONTEXT_SPECIFIC, constructed: true, /* So far we only support X.509 certificates (which are wrapped in an OCTET STRING, hence hard code that here). */ value: [{ name: "CertBag.certValue[0]", tagClass: asn1.Class.UNIVERSAL, type: asn1.Class.OCTETSTRING, constructed: false, capture: "cert" }] }] }; function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) { var result = []; for (var i5 = 0; i5 < safeContents.length; i5++) { for (var j6 = 0; j6 < safeContents[i5].safeBags.length; j6++) { var bag = safeContents[i5].safeBags[j6]; if (bagType !== void 0 && bag.type !== bagType) { continue; } if (attrName === null) { result.push(bag); continue; } if (bag.attributes[attrName] !== void 0 && bag.attributes[attrName].indexOf(attrValue) >= 0) { result.push(bag); } } } return result; } __name(_getBagsByAttribute, "_getBagsByAttribute"); p12.pkcs12FromAsn1 = function(obj, strict, password) { if (typeof strict === "string") { password = strict; strict = true; } else if (strict === void 0) { strict = true; } var capture = {}; var errors = []; if (!asn1.validate(obj, pfxValidator, capture, errors)) { var error2 = new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX."); error2.errors = error2; throw error2; } var pfx = { version: capture.version.charCodeAt(0), safeContents: [], /** * Gets bags with matching attributes. * * @param filter the attributes to filter by: * [localKeyId] the localKeyId to search for. * [localKeyIdHex] the localKeyId in hex to search for. * [friendlyName] the friendly name to search for. * [bagType] bag type to narrow each attribute search by. * * @return a map of attribute type to an array of matching bags or, if no * attribute was given but a bag type, the map key will be the * bag type. */ getBags: function(filter) { var rval = {}; var localKeyId; if ("localKeyId" in filter) { localKeyId = filter.localKeyId; } else if ("localKeyIdHex" in filter) { localKeyId = forge.util.hexToBytes(filter.localKeyIdHex); } if (localKeyId === void 0 && !("friendlyName" in filter) && "bagType" in filter) { rval[filter.bagType] = _getBagsByAttribute( pfx.safeContents, null, null, filter.bagType ); } if (localKeyId !== void 0) { rval.localKeyId = _getBagsByAttribute( pfx.safeContents, "localKeyId", localKeyId, filter.bagType ); } if ("friendlyName" in filter) { rval.friendlyName = _getBagsByAttribute( pfx.safeContents, "friendlyName", filter.friendlyName, filter.bagType ); } return rval; }, /** * DEPRECATED: use getBags() instead. * * Get bags with matching friendlyName attribute. * * @param friendlyName the friendly name to search for. * @param [bagType] bag type to narrow search by. * * @return an array of bags with matching friendlyName attribute. */ getBagsByFriendlyName: function(friendlyName, bagType) { return _getBagsByAttribute( pfx.safeContents, "friendlyName", friendlyName, bagType ); }, /** * DEPRECATED: use getBags() instead. * * Get bags with matching localKeyId attribute. * * @param localKeyId the localKeyId to search for. * @param [bagType] bag type to narrow search by. * * @return an array of bags with matching localKeyId attribute. */ getBagsByLocalKeyId: function(localKeyId, bagType) { return _getBagsByAttribute( pfx.safeContents, "localKeyId", localKeyId, bagType ); } }; if (capture.version.charCodeAt(0) !== 3) { var error2 = new Error("PKCS#12 PFX of version other than 3 not supported."); error2.version = capture.version.charCodeAt(0); throw error2; } if (asn1.derToOid(capture.contentType) !== pki.oids.data) { var error2 = new Error("Only PKCS#12 PFX in password integrity mode supported."); error2.oid = asn1.derToOid(capture.contentType); throw error2; } var data = capture.content.value[0]; if (data.tagClass !== asn1.Class.UNIVERSAL || data.type !== asn1.Type.OCTETSTRING) { throw new Error("PKCS#12 authSafe content data is not an OCTET STRING."); } data = _decodePkcs7Data(data); if (capture.mac) { var md = null; var macKeyBytes = 0; var macAlgorithm = asn1.derToOid(capture.macAlgorithm); switch (macAlgorithm) { case pki.oids.sha1: md = forge.md.sha1.create(); macKeyBytes = 20; break; case pki.oids.sha256: md = forge.md.sha256.create(); macKeyBytes = 32; break; case pki.oids.sha384: md = forge.md.sha384.create(); macKeyBytes = 48; break; case pki.oids.sha512: md = forge.md.sha512.create(); macKeyBytes = 64; break; case pki.oids.md5: md = forge.md.md5.create(); macKeyBytes = 16; break; } if (md === null) { throw new Error("PKCS#12 uses unsupported MAC algorithm: " + macAlgorithm); } var macSalt = new forge.util.ByteBuffer(capture.macSalt); var macIterations = "macIterations" in capture ? parseInt(forge.util.bytesToHex(capture.macIterations), 16) : 1; var macKey = p12.generateKey( password, macSalt, 3, macIterations, macKeyBytes, md ); var mac = forge.hmac.create(); mac.start(md, macKey); mac.update(data.value); var macValue = mac.getMac(); if (macValue.getBytes() !== capture.macDigest) { throw new Error("PKCS#12 MAC could not be verified. Invalid password?"); } } _decodeAuthenticatedSafe(pfx, data.value, strict, password); return pfx; }; function _decodePkcs7Data(data) { if (data.composed || data.constructed) { var value = forge.util.createBuffer(); for (var i5 = 0; i5 < data.value.length; ++i5) { value.putBytes(data.value[i5].value); } data.composed = data.constructed = false; data.value = value.getBytes(); } return data; } __name(_decodePkcs7Data, "_decodePkcs7Data"); function _decodeAuthenticatedSafe(pfx, authSafe, strict, password) { authSafe = asn1.fromDer(authSafe, strict); if (authSafe.tagClass !== asn1.Class.UNIVERSAL || authSafe.type !== asn1.Type.SEQUENCE || authSafe.constructed !== true) { throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo"); } for (var i5 = 0; i5 < authSafe.value.length; i5++) { var contentInfo = authSafe.value[i5]; var capture = {}; var errors = []; if (!asn1.validate(contentInfo, contentInfoValidator, capture, errors)) { var error2 = new Error("Cannot read ContentInfo."); error2.errors = errors; throw error2; } var obj = { encrypted: false }; var safeContents = null; var data = capture.content.value[0]; switch (asn1.derToOid(capture.contentType)) { case pki.oids.data: if (data.tagClass !== asn1.Class.UNIVERSAL || data.type !== asn1.Type.OCTETSTRING) { throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING."); } safeContents = _decodePkcs7Data(data).value; break; case pki.oids.encryptedData: safeContents = _decryptSafeContents(data, password); obj.encrypted = true; break; default: var error2 = new Error("Unsupported PKCS#12 contentType."); error2.contentType = asn1.derToOid(capture.contentType); throw error2; } obj.safeBags = _decodeSafeContents(safeContents, strict, password); pfx.safeContents.push(obj); } } __name(_decodeAuthenticatedSafe, "_decodeAuthenticatedSafe"); function _decryptSafeContents(data, password) { var capture = {}; var errors = []; if (!asn1.validate( data, forge.pkcs7.asn1.encryptedDataValidator, capture, errors )) { var error2 = new Error("Cannot read EncryptedContentInfo."); error2.errors = errors; throw error2; } var oid = asn1.derToOid(capture.contentType); if (oid !== pki.oids.data) { var error2 = new Error( "PKCS#12 EncryptedContentInfo ContentType is not Data." ); error2.oid = oid; throw error2; } oid = asn1.derToOid(capture.encAlgorithm); var cipher = pki.pbe.getCipher(oid, capture.encParameter, password); var encryptedContentAsn1 = _decodePkcs7Data(capture.encryptedContentAsn1); var encrypted = forge.util.createBuffer(encryptedContentAsn1.value); cipher.update(encrypted); if (!cipher.finish()) { throw new Error("Failed to decrypt PKCS#12 SafeContents."); } return cipher.output.getBytes(); } __name(_decryptSafeContents, "_decryptSafeContents"); function _decodeSafeContents(safeContents, strict, password) { if (!strict && safeContents.length === 0) { return []; } safeContents = asn1.fromDer(safeContents, strict); if (safeContents.tagClass !== asn1.Class.UNIVERSAL || safeContents.type !== asn1.Type.SEQUENCE || safeContents.constructed !== true) { throw new Error( "PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag." ); } var res = []; for (var i5 = 0; i5 < safeContents.value.length; i5++) { var safeBag = safeContents.value[i5]; var capture = {}; var errors = []; if (!asn1.validate(safeBag, safeBagValidator, capture, errors)) { var error2 = new Error("Cannot read SafeBag."); error2.errors = errors; throw error2; } var bag = { type: asn1.derToOid(capture.bagId), attributes: _decodeBagAttributes(capture.bagAttributes) }; res.push(bag); var validator, decoder; var bagAsn1 = capture.bagValue.value[0]; switch (bag.type) { case pki.oids.pkcs8ShroudedKeyBag: bagAsn1 = pki.decryptPrivateKeyInfo(bagAsn1, password); if (bagAsn1 === null) { throw new Error( "Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?" ); } case pki.oids.keyBag: try { bag.key = pki.privateKeyFromAsn1(bagAsn1); } catch (e7) { bag.key = null; bag.asn1 = bagAsn1; } continue; case pki.oids.certBag: validator = certBagValidator; decoder = /* @__PURE__ */ __name(function() { if (asn1.derToOid(capture.certId) !== pki.oids.x509Certificate) { var error3 = new Error( "Unsupported certificate type, only X.509 supported." ); error3.oid = asn1.derToOid(capture.certId); throw error3; } var certAsn1 = asn1.fromDer(capture.cert, strict); try { bag.cert = pki.certificateFromAsn1(certAsn1, true); } catch (e7) { bag.cert = null; bag.asn1 = certAsn1; } }, "decoder"); break; default: var error2 = new Error("Unsupported PKCS#12 SafeBag type."); error2.oid = bag.type; throw error2; } if (validator !== void 0 && !asn1.validate(bagAsn1, validator, capture, errors)) { var error2 = new Error("Cannot read PKCS#12 " + validator.name); error2.errors = errors; throw error2; } decoder(); } return res; } __name(_decodeSafeContents, "_decodeSafeContents"); function _decodeBagAttributes(attributes) { var decodedAttrs = {}; if (attributes !== void 0) { for (var i5 = 0; i5 < attributes.length; ++i5) { var capture = {}; var errors = []; if (!asn1.validate(attributes[i5], attributeValidator, capture, errors)) { var error2 = new Error("Cannot read PKCS#12 BagAttribute."); error2.errors = errors; throw error2; } var oid = asn1.derToOid(capture.oid); if (pki.oids[oid] === void 0) { continue; } decodedAttrs[pki.oids[oid]] = []; for (var j6 = 0; j6 < capture.values.length; ++j6) { decodedAttrs[pki.oids[oid]].push(capture.values[j6].value); } } } return decodedAttrs; } __name(_decodeBagAttributes, "_decodeBagAttributes"); p12.toPkcs12Asn1 = function(key, cert, password, options32) { options32 = options32 || {}; options32.saltSize = options32.saltSize || 8; options32.count = options32.count || 2048; options32.algorithm = options32.algorithm || options32.encAlgorithm || "aes128"; if (!("useMac" in options32)) { options32.useMac = true; } if (!("localKeyId" in options32)) { options32.localKeyId = null; } if (!("generateLocalKeyId" in options32)) { options32.generateLocalKeyId = true; } var localKeyId = options32.localKeyId; var bagAttrs; if (localKeyId !== null) { localKeyId = forge.util.hexToBytes(localKeyId); } else if (options32.generateLocalKeyId) { if (cert) { var pairedCert = forge.util.isArray(cert) ? cert[0] : cert; if (typeof pairedCert === "string") { pairedCert = pki.certificateFromPem(pairedCert); } var sha1 = forge.md.sha1.create(); sha1.update(asn1.toDer(pki.certificateToAsn1(pairedCert)).getBytes()); localKeyId = sha1.digest().getBytes(); } else { localKeyId = forge.random.getBytes(20); } } var attrs = []; if (localKeyId !== null) { attrs.push( // localKeyID asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // attrId asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.localKeyId).getBytes() ), // attrValues asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, localKeyId ) ]) ]) ); } if ("friendlyName" in options32) { attrs.push( // friendlyName asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // attrId asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.friendlyName).getBytes() ), // attrValues asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.BMPSTRING, false, options32.friendlyName ) ]) ]) ); } if (attrs.length > 0) { bagAttrs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, attrs); } var contents = []; var chain2 = []; if (cert !== null) { if (forge.util.isArray(cert)) { chain2 = cert; } else { chain2 = [cert]; } } var certSafeBags = []; for (var i5 = 0; i5 < chain2.length; ++i5) { cert = chain2[i5]; if (typeof cert === "string") { cert = pki.certificateFromPem(cert); } var certBagAttrs = i5 === 0 ? bagAttrs : void 0; var certAsn1 = pki.certificateToAsn1(cert); var certSafeBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // bagId asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.certBag).getBytes() ), // bagValue asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ // CertBag asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // certId asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.x509Certificate).getBytes() ), // certValue (x509Certificate) asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, asn1.toDer(certAsn1).getBytes() ) ]) ]) ]), // bagAttributes (OPTIONAL) certBagAttrs ]); certSafeBags.push(certSafeBag); } if (certSafeBags.length > 0) { var certSafeContents = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, certSafeBags ); var certCI = ( // PKCS#7 ContentInfo asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // contentType asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, // OID for the content type is 'data' asn1.oidToDer(pki.oids.data).getBytes() ), // content asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, asn1.toDer(certSafeContents).getBytes() ) ]) ]) ); contents.push(certCI); } var keyBag = null; if (key !== null) { var pkAsn1 = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(key)); if (password === null) { keyBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // bagId asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.keyBag).getBytes() ), // bagValue asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ // PrivateKeyInfo pkAsn1 ]), // bagAttributes (OPTIONAL) bagAttrs ]); } else { keyBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // bagId asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.pkcs8ShroudedKeyBag).getBytes() ), // bagValue asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ // EncryptedPrivateKeyInfo pki.encryptPrivateKeyInfo(pkAsn1, password, options32) ]), // bagAttributes (OPTIONAL) bagAttrs ]); } var keySafeContents = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [keyBag]); var keyCI = ( // PKCS#7 ContentInfo asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // contentType asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, // OID for the content type is 'data' asn1.oidToDer(pki.oids.data).getBytes() ), // content asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, asn1.toDer(keySafeContents).getBytes() ) ]) ]) ); contents.push(keyCI); } var safe = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, contents ); var macData; if (options32.useMac) { var sha1 = forge.md.sha1.create(); var macSalt = new forge.util.ByteBuffer( forge.random.getBytes(options32.saltSize) ); var count = options32.count; var key = p12.generateKey(password, macSalt, 3, count, 20); var mac = forge.hmac.create(); mac.start(sha1, key); mac.update(asn1.toDer(safe).getBytes()); var macValue = mac.getMac(); macData = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // mac DigestInfo asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // digestAlgorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm = SHA-1 asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(pki.oids.sha1).getBytes() ), // parameters = Null asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") ]), // digest asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, macValue.getBytes() ) ]), // macSalt OCTET STRING asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, macSalt.getBytes() ), // iterations INTEGER (XXX: Only support count < 65536) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(count).getBytes() ) ]); } return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // version (3) asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(3).getBytes() ), // PKCS#7 ContentInfo asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // contentType asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, // OID for the content type is 'data' asn1.oidToDer(pki.oids.data).getBytes() ), // content asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, asn1.toDer(safe).getBytes() ) ]) ]), macData ]); }; p12.generateKey = forge.pbe.generatePkcs12Key; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pki.js var require_pki = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pki.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_asn1(); require_oids(); require_pbe(); require_pem(); require_pbkdf2(); require_pkcs12(); require_pss(); require_rsa(); require_util10(); require_x509(); var asn1 = forge.asn1; var pki = module3.exports = forge.pki = forge.pki || {}; pki.pemToDer = function(pem) { var msg = forge.pem.decode(pem)[0]; if (msg.procType && msg.procType.type === "ENCRYPTED") { throw new Error("Could not convert PEM to DER; PEM is encrypted."); } return forge.util.createBuffer(msg.body); }; pki.privateKeyFromPem = function(pem) { var msg = forge.pem.decode(pem)[0]; if (msg.type !== "PRIVATE KEY" && msg.type !== "RSA PRIVATE KEY") { var error2 = new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".'); error2.headerType = msg.type; throw error2; } if (msg.procType && msg.procType.type === "ENCRYPTED") { throw new Error("Could not convert private key from PEM; PEM is encrypted."); } var obj = asn1.fromDer(msg.body); return pki.privateKeyFromAsn1(obj); }; pki.privateKeyToPem = function(key, maxline) { var msg = { type: "RSA PRIVATE KEY", body: asn1.toDer(pki.privateKeyToAsn1(key)).getBytes() }; return forge.pem.encode(msg, { maxline }); }; pki.privateKeyInfoToPem = function(pki2, maxline) { var msg = { type: "PRIVATE KEY", body: asn1.toDer(pki2).getBytes() }; return forge.pem.encode(msg, { maxline }); }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/tls.js var require_tls = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/tls.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_asn1(); require_hmac(); require_md5(); require_pem(); require_pki(); require_random2(); require_sha1(); require_util10(); var prf_TLS1 = /* @__PURE__ */ __name(function(secret2, label, seed, length) { var rval = forge.util.createBuffer(); var idx = secret2.length >> 1; var slen = idx + (secret2.length & 1); var s1 = secret2.substr(0, slen); var s22 = secret2.substr(idx, slen); var ai3 = forge.util.createBuffer(); var hmac2 = forge.hmac.create(); seed = label + seed; var md5itr = Math.ceil(length / 16); var sha1itr = Math.ceil(length / 20); hmac2.start("MD5", s1); var md5bytes = forge.util.createBuffer(); ai3.putBytes(seed); for (var i5 = 0; i5 < md5itr; ++i5) { hmac2.start(null, null); hmac2.update(ai3.getBytes()); ai3.putBuffer(hmac2.digest()); hmac2.start(null, null); hmac2.update(ai3.bytes() + seed); md5bytes.putBuffer(hmac2.digest()); } hmac2.start("SHA1", s22); var sha1bytes = forge.util.createBuffer(); ai3.clear(); ai3.putBytes(seed); for (var i5 = 0; i5 < sha1itr; ++i5) { hmac2.start(null, null); hmac2.update(ai3.getBytes()); ai3.putBuffer(hmac2.digest()); hmac2.start(null, null); hmac2.update(ai3.bytes() + seed); sha1bytes.putBuffer(hmac2.digest()); } rval.putBytes(forge.util.xorBytes( md5bytes.getBytes(), sha1bytes.getBytes(), length )); return rval; }, "prf_TLS1"); var hmac_sha1 = /* @__PURE__ */ __name(function(key2, seqNum, record) { var hmac2 = forge.hmac.create(); hmac2.start("SHA1", key2); var b6 = forge.util.createBuffer(); b6.putInt32(seqNum[0]); b6.putInt32(seqNum[1]); b6.putByte(record.type); b6.putByte(record.version.major); b6.putByte(record.version.minor); b6.putInt16(record.length); b6.putBytes(record.fragment.bytes()); hmac2.update(b6.getBytes()); return hmac2.digest().getBytes(); }, "hmac_sha1"); var deflate = /* @__PURE__ */ __name(function(c6, record, s5) { var rval = false; try { var bytes = c6.deflate(record.fragment.getBytes()); record.fragment = forge.util.createBuffer(bytes); record.length = bytes.length; rval = true; } catch (ex) { } return rval; }, "deflate"); var inflate = /* @__PURE__ */ __name(function(c6, record, s5) { var rval = false; try { var bytes = c6.inflate(record.fragment.getBytes()); record.fragment = forge.util.createBuffer(bytes); record.length = bytes.length; rval = true; } catch (ex) { } return rval; }, "inflate"); var readVector = /* @__PURE__ */ __name(function(b6, lenBytes) { var len = 0; switch (lenBytes) { case 1: len = b6.getByte(); break; case 2: len = b6.getInt16(); break; case 3: len = b6.getInt24(); break; case 4: len = b6.getInt32(); break; } return forge.util.createBuffer(b6.getBytes(len)); }, "readVector"); var writeVector = /* @__PURE__ */ __name(function(b6, lenBytes, v7) { b6.putInt(v7.length(), lenBytes << 3); b6.putBuffer(v7); }, "writeVector"); var tls = {}; tls.Versions = { TLS_1_0: { major: 3, minor: 1 }, TLS_1_1: { major: 3, minor: 2 }, TLS_1_2: { major: 3, minor: 3 } }; tls.SupportedVersions = [ tls.Versions.TLS_1_1, tls.Versions.TLS_1_0 ]; tls.Version = tls.SupportedVersions[0]; tls.MaxFragment = 16384 - 1024; tls.ConnectionEnd = { server: 0, client: 1 }; tls.PRFAlgorithm = { tls_prf_sha256: 0 }; tls.BulkCipherAlgorithm = { none: null, rc4: 0, des3: 1, aes: 2 }; tls.CipherType = { stream: 0, block: 1, aead: 2 }; tls.MACAlgorithm = { none: null, hmac_md5: 0, hmac_sha1: 1, hmac_sha256: 2, hmac_sha384: 3, hmac_sha512: 4 }; tls.CompressionMethod = { none: 0, deflate: 1 }; tls.ContentType = { change_cipher_spec: 20, alert: 21, handshake: 22, application_data: 23, heartbeat: 24 }; tls.HandshakeType = { hello_request: 0, client_hello: 1, server_hello: 2, certificate: 11, server_key_exchange: 12, certificate_request: 13, server_hello_done: 14, certificate_verify: 15, client_key_exchange: 16, finished: 20 }; tls.Alert = {}; tls.Alert.Level = { warning: 1, fatal: 2 }; tls.Alert.Description = { close_notify: 0, unexpected_message: 10, bad_record_mac: 20, decryption_failed: 21, record_overflow: 22, decompression_failure: 30, handshake_failure: 40, bad_certificate: 42, unsupported_certificate: 43, certificate_revoked: 44, certificate_expired: 45, certificate_unknown: 46, illegal_parameter: 47, unknown_ca: 48, access_denied: 49, decode_error: 50, decrypt_error: 51, export_restriction: 60, protocol_version: 70, insufficient_security: 71, internal_error: 80, user_canceled: 90, no_renegotiation: 100 }; tls.HeartbeatMessageType = { heartbeat_request: 1, heartbeat_response: 2 }; tls.CipherSuites = {}; tls.getCipherSuite = function(twoBytes) { var rval = null; for (var key2 in tls.CipherSuites) { var cs3 = tls.CipherSuites[key2]; if (cs3.id[0] === twoBytes.charCodeAt(0) && cs3.id[1] === twoBytes.charCodeAt(1)) { rval = cs3; break; } } return rval; }; tls.handleUnexpected = function(c6, record) { var ignore2 = !c6.open && c6.entity === tls.ConnectionEnd.client; if (!ignore2) { c6.error(c6, { message: "Unexpected message. Received TLS record out of order.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.unexpected_message } }); } }; tls.handleHelloRequest = function(c6, record, length) { if (!c6.handshaking && c6.handshakes > 0) { tls.queue(c6, tls.createAlert(c6, { level: tls.Alert.Level.warning, description: tls.Alert.Description.no_renegotiation })); tls.flush(c6); } c6.process(); }; tls.parseHelloMessage = function(c6, record, length) { var msg = null; var client = c6.entity === tls.ConnectionEnd.client; if (length < 38) { c6.error(c6, { message: client ? "Invalid ServerHello message. Message too short." : "Invalid ClientHello message. Message too short.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.illegal_parameter } }); } else { var b6 = record.fragment; var remaining = b6.length(); msg = { version: { major: b6.getByte(), minor: b6.getByte() }, random: forge.util.createBuffer(b6.getBytes(32)), session_id: readVector(b6, 1), extensions: [] }; if (client) { msg.cipher_suite = b6.getBytes(2); msg.compression_method = b6.getByte(); } else { msg.cipher_suites = readVector(b6, 2); msg.compression_methods = readVector(b6, 1); } remaining = length - (remaining - b6.length()); if (remaining > 0) { var exts = readVector(b6, 2); while (exts.length() > 0) { msg.extensions.push({ type: [exts.getByte(), exts.getByte()], data: readVector(exts, 2) }); } if (!client) { for (var i5 = 0; i5 < msg.extensions.length; ++i5) { var ext = msg.extensions[i5]; if (ext.type[0] === 0 && ext.type[1] === 0) { var snl = readVector(ext.data, 2); while (snl.length() > 0) { var snType = snl.getByte(); if (snType !== 0) { break; } c6.session.extensions.server_name.serverNameList.push( readVector(snl, 2).getBytes() ); } } } } } if (c6.session.version) { if (msg.version.major !== c6.session.version.major || msg.version.minor !== c6.session.version.minor) { return c6.error(c6, { message: "TLS version change is disallowed during renegotiation.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.protocol_version } }); } } if (client) { c6.session.cipherSuite = tls.getCipherSuite(msg.cipher_suite); } else { var tmp = forge.util.createBuffer(msg.cipher_suites.bytes()); while (tmp.length() > 0) { c6.session.cipherSuite = tls.getCipherSuite(tmp.getBytes(2)); if (c6.session.cipherSuite !== null) { break; } } } if (c6.session.cipherSuite === null) { return c6.error(c6, { message: "No cipher suites in common.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.handshake_failure }, cipherSuite: forge.util.bytesToHex(msg.cipher_suite) }); } if (client) { c6.session.compressionMethod = msg.compression_method; } else { c6.session.compressionMethod = tls.CompressionMethod.none; } } return msg; }; tls.createSecurityParameters = function(c6, msg) { var client = c6.entity === tls.ConnectionEnd.client; var msgRandom = msg.random.bytes(); var cRandom = client ? c6.session.sp.client_random : msgRandom; var sRandom = client ? msgRandom : tls.createRandom().getBytes(); c6.session.sp = { entity: c6.entity, prf_algorithm: tls.PRFAlgorithm.tls_prf_sha256, bulk_cipher_algorithm: null, cipher_type: null, enc_key_length: null, block_length: null, fixed_iv_length: null, record_iv_length: null, mac_algorithm: null, mac_length: null, mac_key_length: null, compression_algorithm: c6.session.compressionMethod, pre_master_secret: null, master_secret: null, client_random: cRandom, server_random: sRandom }; }; tls.handleServerHello = function(c6, record, length) { var msg = tls.parseHelloMessage(c6, record, length); if (c6.fail) { return; } if (msg.version.minor <= c6.version.minor) { c6.version.minor = msg.version.minor; } else { return c6.error(c6, { message: "Incompatible TLS version.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.protocol_version } }); } c6.session.version = c6.version; var sessionId = msg.session_id.bytes(); if (sessionId.length > 0 && sessionId === c6.session.id) { c6.expect = SCC; c6.session.resuming = true; c6.session.sp.server_random = msg.random.bytes(); } else { c6.expect = SCE; c6.session.resuming = false; tls.createSecurityParameters(c6, msg); } c6.session.id = sessionId; c6.process(); }; tls.handleClientHello = function(c6, record, length) { var msg = tls.parseHelloMessage(c6, record, length); if (c6.fail) { return; } var sessionId = msg.session_id.bytes(); var session = null; if (c6.sessionCache) { session = c6.sessionCache.getSession(sessionId); if (session === null) { sessionId = ""; } else if (session.version.major !== msg.version.major || session.version.minor > msg.version.minor) { session = null; sessionId = ""; } } if (sessionId.length === 0) { sessionId = forge.random.getBytes(32); } c6.session.id = sessionId; c6.session.clientHelloVersion = msg.version; c6.session.sp = {}; if (session) { c6.version = c6.session.version = session.version; c6.session.sp = session.sp; } else { var version4; for (var i5 = 1; i5 < tls.SupportedVersions.length; ++i5) { version4 = tls.SupportedVersions[i5]; if (version4.minor <= msg.version.minor) { break; } } c6.version = { major: version4.major, minor: version4.minor }; c6.session.version = c6.version; } if (session !== null) { c6.expect = CCC; c6.session.resuming = true; c6.session.sp.client_random = msg.random.bytes(); } else { c6.expect = c6.verifyClient !== false ? CCE : CKE; c6.session.resuming = false; tls.createSecurityParameters(c6, msg); } c6.open = true; tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.handshake, data: tls.createServerHello(c6) })); if (c6.session.resuming) { tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.change_cipher_spec, data: tls.createChangeCipherSpec() })); c6.state.pending = tls.createConnectionState(c6); c6.state.current.write = c6.state.pending.write; tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.handshake, data: tls.createFinished(c6) })); } else { tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.handshake, data: tls.createCertificate(c6) })); if (!c6.fail) { tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.handshake, data: tls.createServerKeyExchange(c6) })); if (c6.verifyClient !== false) { tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.handshake, data: tls.createCertificateRequest(c6) })); } tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.handshake, data: tls.createServerHelloDone(c6) })); } } tls.flush(c6); c6.process(); }; tls.handleCertificate = function(c6, record, length) { if (length < 3) { return c6.error(c6, { message: "Invalid Certificate message. Message too short.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.illegal_parameter } }); } var b6 = record.fragment; var msg = { certificate_list: readVector(b6, 3) }; var cert, asn1; var certs = []; try { while (msg.certificate_list.length() > 0) { cert = readVector(msg.certificate_list, 3); asn1 = forge.asn1.fromDer(cert); cert = forge.pki.certificateFromAsn1(asn1, true); certs.push(cert); } } catch (ex) { return c6.error(c6, { message: "Could not parse certificate list.", cause: ex, send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.bad_certificate } }); } var client = c6.entity === tls.ConnectionEnd.client; if ((client || c6.verifyClient === true) && certs.length === 0) { c6.error(c6, { message: client ? "No server certificate provided." : "No client certificate provided.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.illegal_parameter } }); } else if (certs.length === 0) { c6.expect = client ? SKE : CKE; } else { if (client) { c6.session.serverCertificate = certs[0]; } else { c6.session.clientCertificate = certs[0]; } if (tls.verifyCertificateChain(c6, certs)) { c6.expect = client ? SKE : CKE; } } c6.process(); }; tls.handleServerKeyExchange = function(c6, record, length) { if (length > 0) { return c6.error(c6, { message: "Invalid key parameters. Only RSA is supported.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.unsupported_certificate } }); } c6.expect = SCR; c6.process(); }; tls.handleClientKeyExchange = function(c6, record, length) { if (length < 48) { return c6.error(c6, { message: "Invalid key parameters. Only RSA is supported.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.unsupported_certificate } }); } var b6 = record.fragment; var msg = { enc_pre_master_secret: readVector(b6, 2).getBytes() }; var privateKey = null; if (c6.getPrivateKey) { try { privateKey = c6.getPrivateKey(c6, c6.session.serverCertificate); privateKey = forge.pki.privateKeyFromPem(privateKey); } catch (ex) { c6.error(c6, { message: "Could not get private key.", cause: ex, send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.internal_error } }); } } if (privateKey === null) { return c6.error(c6, { message: "No private key set.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.internal_error } }); } try { var sp = c6.session.sp; sp.pre_master_secret = privateKey.decrypt(msg.enc_pre_master_secret); var version4 = c6.session.clientHelloVersion; if (version4.major !== sp.pre_master_secret.charCodeAt(0) || version4.minor !== sp.pre_master_secret.charCodeAt(1)) { throw new Error("TLS version rollback attack detected."); } } catch (ex) { sp.pre_master_secret = forge.random.getBytes(48); } c6.expect = CCC; if (c6.session.clientCertificate !== null) { c6.expect = CCV; } c6.process(); }; tls.handleCertificateRequest = function(c6, record, length) { if (length < 3) { return c6.error(c6, { message: "Invalid CertificateRequest. Message too short.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.illegal_parameter } }); } var b6 = record.fragment; var msg = { certificate_types: readVector(b6, 1), certificate_authorities: readVector(b6, 2) }; c6.session.certificateRequest = msg; c6.expect = SHD; c6.process(); }; tls.handleCertificateVerify = function(c6, record, length) { if (length < 2) { return c6.error(c6, { message: "Invalid CertificateVerify. Message too short.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.illegal_parameter } }); } var b6 = record.fragment; b6.read -= 4; var msgBytes = b6.bytes(); b6.read += 4; var msg = { signature: readVector(b6, 2).getBytes() }; var verify = forge.util.createBuffer(); verify.putBuffer(c6.session.md5.digest()); verify.putBuffer(c6.session.sha1.digest()); verify = verify.getBytes(); try { var cert = c6.session.clientCertificate; if (!cert.publicKey.verify(verify, msg.signature, "NONE")) { throw new Error("CertificateVerify signature does not match."); } c6.session.md5.update(msgBytes); c6.session.sha1.update(msgBytes); } catch (ex) { return c6.error(c6, { message: "Bad signature in CertificateVerify.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.handshake_failure } }); } c6.expect = CCC; c6.process(); }; tls.handleServerHelloDone = function(c6, record, length) { if (length > 0) { return c6.error(c6, { message: "Invalid ServerHelloDone message. Invalid length.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.record_overflow } }); } if (c6.serverCertificate === null) { var error2 = { message: "No server certificate provided. Not enough security.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.insufficient_security } }; var depth = 0; var ret = c6.verify(c6, error2.alert.description, depth, []); if (ret !== true) { if (ret || ret === 0) { if (typeof ret === "object" && !forge.util.isArray(ret)) { if (ret.message) { error2.message = ret.message; } if (ret.alert) { error2.alert.description = ret.alert; } } else if (typeof ret === "number") { error2.alert.description = ret; } } return c6.error(c6, error2); } } if (c6.session.certificateRequest !== null) { record = tls.createRecord(c6, { type: tls.ContentType.handshake, data: tls.createCertificate(c6) }); tls.queue(c6, record); } record = tls.createRecord(c6, { type: tls.ContentType.handshake, data: tls.createClientKeyExchange(c6) }); tls.queue(c6, record); c6.expect = SER; var callback = /* @__PURE__ */ __name(function(c7, signature) { if (c7.session.certificateRequest !== null && c7.session.clientCertificate !== null) { tls.queue(c7, tls.createRecord(c7, { type: tls.ContentType.handshake, data: tls.createCertificateVerify(c7, signature) })); } tls.queue(c7, tls.createRecord(c7, { type: tls.ContentType.change_cipher_spec, data: tls.createChangeCipherSpec() })); c7.state.pending = tls.createConnectionState(c7); c7.state.current.write = c7.state.pending.write; tls.queue(c7, tls.createRecord(c7, { type: tls.ContentType.handshake, data: tls.createFinished(c7) })); c7.expect = SCC; tls.flush(c7); c7.process(); }, "callback"); if (c6.session.certificateRequest === null || c6.session.clientCertificate === null) { return callback(c6, null); } tls.getClientSignature(c6, callback); }; tls.handleChangeCipherSpec = function(c6, record) { if (record.fragment.getByte() !== 1) { return c6.error(c6, { message: "Invalid ChangeCipherSpec message received.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.illegal_parameter } }); } var client = c6.entity === tls.ConnectionEnd.client; if (c6.session.resuming && client || !c6.session.resuming && !client) { c6.state.pending = tls.createConnectionState(c6); } c6.state.current.read = c6.state.pending.read; if (!c6.session.resuming && client || c6.session.resuming && !client) { c6.state.pending = null; } c6.expect = client ? SFI : CFI; c6.process(); }; tls.handleFinished = function(c6, record, length) { var b6 = record.fragment; b6.read -= 4; var msgBytes = b6.bytes(); b6.read += 4; var vd = record.fragment.getBytes(); b6 = forge.util.createBuffer(); b6.putBuffer(c6.session.md5.digest()); b6.putBuffer(c6.session.sha1.digest()); var client = c6.entity === tls.ConnectionEnd.client; var label = client ? "server finished" : "client finished"; var sp = c6.session.sp; var vdl = 12; var prf = prf_TLS1; b6 = prf(sp.master_secret, label, b6.getBytes(), vdl); if (b6.getBytes() !== vd) { return c6.error(c6, { message: "Invalid verify_data in Finished message.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.decrypt_error } }); } c6.session.md5.update(msgBytes); c6.session.sha1.update(msgBytes); if (c6.session.resuming && client || !c6.session.resuming && !client) { tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.change_cipher_spec, data: tls.createChangeCipherSpec() })); c6.state.current.write = c6.state.pending.write; c6.state.pending = null; tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.handshake, data: tls.createFinished(c6) })); } c6.expect = client ? SAD : CAD; c6.handshaking = false; ++c6.handshakes; c6.peerCertificate = client ? c6.session.serverCertificate : c6.session.clientCertificate; tls.flush(c6); c6.isConnected = true; c6.connected(c6); c6.process(); }; tls.handleAlert = function(c6, record) { var b6 = record.fragment; var alert = { level: b6.getByte(), description: b6.getByte() }; var msg; switch (alert.description) { case tls.Alert.Description.close_notify: msg = "Connection closed."; break; case tls.Alert.Description.unexpected_message: msg = "Unexpected message."; break; case tls.Alert.Description.bad_record_mac: msg = "Bad record MAC."; break; case tls.Alert.Description.decryption_failed: msg = "Decryption failed."; break; case tls.Alert.Description.record_overflow: msg = "Record overflow."; break; case tls.Alert.Description.decompression_failure: msg = "Decompression failed."; break; case tls.Alert.Description.handshake_failure: msg = "Handshake failure."; break; case tls.Alert.Description.bad_certificate: msg = "Bad certificate."; break; case tls.Alert.Description.unsupported_certificate: msg = "Unsupported certificate."; break; case tls.Alert.Description.certificate_revoked: msg = "Certificate revoked."; break; case tls.Alert.Description.certificate_expired: msg = "Certificate expired."; break; case tls.Alert.Description.certificate_unknown: msg = "Certificate unknown."; break; case tls.Alert.Description.illegal_parameter: msg = "Illegal parameter."; break; case tls.Alert.Description.unknown_ca: msg = "Unknown certificate authority."; break; case tls.Alert.Description.access_denied: msg = "Access denied."; break; case tls.Alert.Description.decode_error: msg = "Decode error."; break; case tls.Alert.Description.decrypt_error: msg = "Decrypt error."; break; case tls.Alert.Description.export_restriction: msg = "Export restriction."; break; case tls.Alert.Description.protocol_version: msg = "Unsupported protocol version."; break; case tls.Alert.Description.insufficient_security: msg = "Insufficient security."; break; case tls.Alert.Description.internal_error: msg = "Internal error."; break; case tls.Alert.Description.user_canceled: msg = "User canceled."; break; case tls.Alert.Description.no_renegotiation: msg = "Renegotiation not supported."; break; default: msg = "Unknown error."; break; } if (alert.description === tls.Alert.Description.close_notify) { return c6.close(); } c6.error(c6, { message: msg, send: false, // origin is the opposite end origin: c6.entity === tls.ConnectionEnd.client ? "server" : "client", alert }); c6.process(); }; tls.handleHandshake = function(c6, record) { var b6 = record.fragment; var type = b6.getByte(); var length = b6.getInt24(); if (length > b6.length()) { c6.fragmented = record; record.fragment = forge.util.createBuffer(); b6.read -= 4; return c6.process(); } c6.fragmented = null; b6.read -= 4; var bytes = b6.bytes(length + 4); b6.read += 4; if (type in hsTable[c6.entity][c6.expect]) { if (c6.entity === tls.ConnectionEnd.server && !c6.open && !c6.fail) { c6.handshaking = true; c6.session = { version: null, extensions: { server_name: { serverNameList: [] } }, cipherSuite: null, compressionMethod: null, serverCertificate: null, clientCertificate: null, md5: forge.md.md5.create(), sha1: forge.md.sha1.create() }; } if (type !== tls.HandshakeType.hello_request && type !== tls.HandshakeType.certificate_verify && type !== tls.HandshakeType.finished) { c6.session.md5.update(bytes); c6.session.sha1.update(bytes); } hsTable[c6.entity][c6.expect][type](c6, record, length); } else { tls.handleUnexpected(c6, record); } }; tls.handleApplicationData = function(c6, record) { c6.data.putBuffer(record.fragment); c6.dataReady(c6); c6.process(); }; tls.handleHeartbeat = function(c6, record) { var b6 = record.fragment; var type = b6.getByte(); var length = b6.getInt16(); var payload = b6.getBytes(length); if (type === tls.HeartbeatMessageType.heartbeat_request) { if (c6.handshaking || length > payload.length) { return c6.process(); } tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.heartbeat, data: tls.createHeartbeat( tls.HeartbeatMessageType.heartbeat_response, payload ) })); tls.flush(c6); } else if (type === tls.HeartbeatMessageType.heartbeat_response) { if (payload !== c6.expectedHeartbeatPayload) { return c6.process(); } if (c6.heartbeatReceived) { c6.heartbeatReceived(c6, forge.util.createBuffer(payload)); } } c6.process(); }; var SHE = 0; var SCE = 1; var SKE = 2; var SCR = 3; var SHD = 4; var SCC = 5; var SFI = 6; var SAD = 7; var SER = 8; var CHE = 0; var CCE = 1; var CKE = 2; var CCV = 3; var CCC = 4; var CFI = 5; var CAD = 6; var __ = tls.handleUnexpected; var R0 = tls.handleChangeCipherSpec; var R1 = tls.handleAlert; var R22 = tls.handleHandshake; var R3 = tls.handleApplicationData; var R4 = tls.handleHeartbeat; var ctTable = []; ctTable[tls.ConnectionEnd.client] = [ // CC,AL,HS,AD,HB /*SHE*/ [__, R1, R22, __, R4], /*SCE*/ [__, R1, R22, __, R4], /*SKE*/ [__, R1, R22, __, R4], /*SCR*/ [__, R1, R22, __, R4], /*SHD*/ [__, R1, R22, __, R4], /*SCC*/ [R0, R1, __, __, R4], /*SFI*/ [__, R1, R22, __, R4], /*SAD*/ [__, R1, R22, R3, R4], /*SER*/ [__, R1, R22, __, R4] ]; ctTable[tls.ConnectionEnd.server] = [ // CC,AL,HS,AD /*CHE*/ [__, R1, R22, __, R4], /*CCE*/ [__, R1, R22, __, R4], /*CKE*/ [__, R1, R22, __, R4], /*CCV*/ [__, R1, R22, __, R4], /*CCC*/ [R0, R1, __, __, R4], /*CFI*/ [__, R1, R22, __, R4], /*CAD*/ [__, R1, R22, R3, R4], /*CER*/ [__, R1, R22, __, R4] ]; var H0 = tls.handleHelloRequest; var H1 = tls.handleServerHello; var H22 = tls.handleCertificate; var H32 = tls.handleServerKeyExchange; var H4 = tls.handleCertificateRequest; var H5 = tls.handleServerHelloDone; var H6 = tls.handleFinished; var hsTable = []; hsTable[tls.ConnectionEnd.client] = [ // HR,01,SH,03,04,05,06,07,08,09,10,SC,SK,CR,HD,15,CK,17,18,19,FI /*SHE*/ [__, __, H1, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __], /*SCE*/ [H0, __, __, __, __, __, __, __, __, __, __, H22, H32, H4, H5, __, __, __, __, __, __], /*SKE*/ [H0, __, __, __, __, __, __, __, __, __, __, __, H32, H4, H5, __, __, __, __, __, __], /*SCR*/ [H0, __, __, __, __, __, __, __, __, __, __, __, __, H4, H5, __, __, __, __, __, __], /*SHD*/ [H0, __, __, __, __, __, __, __, __, __, __, __, __, __, H5, __, __, __, __, __, __], /*SCC*/ [H0, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __], /*SFI*/ [H0, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, H6], /*SAD*/ [H0, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __], /*SER*/ [H0, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __] ]; var H7 = tls.handleClientHello; var H8 = tls.handleClientKeyExchange; var H9 = tls.handleCertificateVerify; hsTable[tls.ConnectionEnd.server] = [ // 01,CH,02,03,04,05,06,07,08,09,10,CC,12,13,14,CV,CK,17,18,19,FI /*CHE*/ [__, H7, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __], /*CCE*/ [__, __, __, __, __, __, __, __, __, __, __, H22, __, __, __, __, __, __, __, __, __], /*CKE*/ [__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, H8, __, __, __, __], /*CCV*/ [__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, H9, __, __, __, __, __], /*CCC*/ [__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __], /*CFI*/ [__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, H6], /*CAD*/ [__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __], /*CER*/ [__, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __] ]; tls.generateKeys = function(c6, sp) { var prf = prf_TLS1; var random = sp.client_random + sp.server_random; if (!c6.session.resuming) { sp.master_secret = prf( sp.pre_master_secret, "master secret", random, 48 ).bytes(); sp.pre_master_secret = null; } random = sp.server_random + sp.client_random; var length = 2 * sp.mac_key_length + 2 * sp.enc_key_length; var tls10 = c6.version.major === tls.Versions.TLS_1_0.major && c6.version.minor === tls.Versions.TLS_1_0.minor; if (tls10) { length += 2 * sp.fixed_iv_length; } var km = prf(sp.master_secret, "key expansion", random, length); var rval = { client_write_MAC_key: km.getBytes(sp.mac_key_length), server_write_MAC_key: km.getBytes(sp.mac_key_length), client_write_key: km.getBytes(sp.enc_key_length), server_write_key: km.getBytes(sp.enc_key_length) }; if (tls10) { rval.client_write_IV = km.getBytes(sp.fixed_iv_length); rval.server_write_IV = km.getBytes(sp.fixed_iv_length); } return rval; }; tls.createConnectionState = function(c6) { var client = c6.entity === tls.ConnectionEnd.client; var createMode = /* @__PURE__ */ __name(function() { var mode = { // two 32-bit numbers, first is most significant sequenceNumber: [0, 0], macKey: null, macLength: 0, macFunction: null, cipherState: null, cipherFunction: function(record) { return true; }, compressionState: null, compressFunction: function(record) { return true; }, updateSequenceNumber: function() { if (mode.sequenceNumber[1] === 4294967295) { mode.sequenceNumber[1] = 0; ++mode.sequenceNumber[0]; } else { ++mode.sequenceNumber[1]; } } }; return mode; }, "createMode"); var state2 = { read: createMode(), write: createMode() }; state2.read.update = function(c7, record) { if (!state2.read.cipherFunction(record, state2.read)) { c7.error(c7, { message: "Could not decrypt record or bad MAC.", send: true, alert: { level: tls.Alert.Level.fatal, // doesn't matter if decryption failed or MAC was // invalid, return the same error so as not to reveal // which one occurred description: tls.Alert.Description.bad_record_mac } }); } else if (!state2.read.compressFunction(c7, record, state2.read)) { c7.error(c7, { message: "Could not decompress record.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.decompression_failure } }); } return !c7.fail; }; state2.write.update = function(c7, record) { if (!state2.write.compressFunction(c7, record, state2.write)) { c7.error(c7, { message: "Could not compress record.", send: false, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.internal_error } }); } else if (!state2.write.cipherFunction(record, state2.write)) { c7.error(c7, { message: "Could not encrypt record.", send: false, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.internal_error } }); } return !c7.fail; }; if (c6.session) { var sp = c6.session.sp; c6.session.cipherSuite.initSecurityParameters(sp); sp.keys = tls.generateKeys(c6, sp); state2.read.macKey = client ? sp.keys.server_write_MAC_key : sp.keys.client_write_MAC_key; state2.write.macKey = client ? sp.keys.client_write_MAC_key : sp.keys.server_write_MAC_key; c6.session.cipherSuite.initConnectionState(state2, c6, sp); switch (sp.compression_algorithm) { case tls.CompressionMethod.none: break; case tls.CompressionMethod.deflate: state2.read.compressFunction = inflate; state2.write.compressFunction = deflate; break; default: throw new Error("Unsupported compression algorithm."); } } return state2; }; tls.createRandom = function() { var d6 = /* @__PURE__ */ new Date(); var utc = +d6 + d6.getTimezoneOffset() * 6e4; var rval = forge.util.createBuffer(); rval.putInt32(utc); rval.putBytes(forge.random.getBytes(28)); return rval; }; tls.createRecord = function(c6, options32) { if (!options32.data) { return null; } var record = { type: options32.type, version: { major: c6.version.major, minor: c6.version.minor }, length: options32.data.length(), fragment: options32.data }; return record; }; tls.createAlert = function(c6, alert) { var b6 = forge.util.createBuffer(); b6.putByte(alert.level); b6.putByte(alert.description); return tls.createRecord(c6, { type: tls.ContentType.alert, data: b6 }); }; tls.createClientHello = function(c6) { c6.session.clientHelloVersion = { major: c6.version.major, minor: c6.version.minor }; var cipherSuites = forge.util.createBuffer(); for (var i5 = 0; i5 < c6.cipherSuites.length; ++i5) { var cs3 = c6.cipherSuites[i5]; cipherSuites.putByte(cs3.id[0]); cipherSuites.putByte(cs3.id[1]); } var cSuites = cipherSuites.length(); var compressionMethods = forge.util.createBuffer(); compressionMethods.putByte(tls.CompressionMethod.none); var cMethods = compressionMethods.length(); var extensions = forge.util.createBuffer(); if (c6.virtualHost) { var ext = forge.util.createBuffer(); ext.putByte(0); ext.putByte(0); var serverName = forge.util.createBuffer(); serverName.putByte(0); writeVector(serverName, 2, forge.util.createBuffer(c6.virtualHost)); var snList = forge.util.createBuffer(); writeVector(snList, 2, serverName); writeVector(ext, 2, snList); extensions.putBuffer(ext); } var extLength = extensions.length(); if (extLength > 0) { extLength += 2; } var sessionId = c6.session.id; var length = sessionId.length + 1 + // session ID vector 2 + // version (major + minor) 4 + 28 + // random time and random bytes 2 + cSuites + // cipher suites vector 1 + cMethods + // compression methods vector extLength; var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.client_hello); rval.putInt24(length); rval.putByte(c6.version.major); rval.putByte(c6.version.minor); rval.putBytes(c6.session.sp.client_random); writeVector(rval, 1, forge.util.createBuffer(sessionId)); writeVector(rval, 2, cipherSuites); writeVector(rval, 1, compressionMethods); if (extLength > 0) { writeVector(rval, 2, extensions); } return rval; }; tls.createServerHello = function(c6) { var sessionId = c6.session.id; var length = sessionId.length + 1 + // session ID vector 2 + // version (major + minor) 4 + 28 + // random time and random bytes 2 + // chosen cipher suite 1; var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.server_hello); rval.putInt24(length); rval.putByte(c6.version.major); rval.putByte(c6.version.minor); rval.putBytes(c6.session.sp.server_random); writeVector(rval, 1, forge.util.createBuffer(sessionId)); rval.putByte(c6.session.cipherSuite.id[0]); rval.putByte(c6.session.cipherSuite.id[1]); rval.putByte(c6.session.compressionMethod); return rval; }; tls.createCertificate = function(c6) { var client = c6.entity === tls.ConnectionEnd.client; var cert = null; if (c6.getCertificate) { var hint; if (client) { hint = c6.session.certificateRequest; } else { hint = c6.session.extensions.server_name.serverNameList; } cert = c6.getCertificate(c6, hint); } var certList = forge.util.createBuffer(); if (cert !== null) { try { if (!forge.util.isArray(cert)) { cert = [cert]; } var asn1 = null; for (var i5 = 0; i5 < cert.length; ++i5) { var msg = forge.pem.decode(cert[i5])[0]; if (msg.type !== "CERTIFICATE" && msg.type !== "X509 CERTIFICATE" && msg.type !== "TRUSTED CERTIFICATE") { var error2 = new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".'); error2.headerType = msg.type; throw error2; } if (msg.procType && msg.procType.type === "ENCRYPTED") { throw new Error("Could not convert certificate from PEM; PEM is encrypted."); } var der = forge.util.createBuffer(msg.body); if (asn1 === null) { asn1 = forge.asn1.fromDer(der.bytes(), false); } var certBuffer = forge.util.createBuffer(); writeVector(certBuffer, 3, der); certList.putBuffer(certBuffer); } cert = forge.pki.certificateFromAsn1(asn1); if (client) { c6.session.clientCertificate = cert; } else { c6.session.serverCertificate = cert; } } catch (ex) { return c6.error(c6, { message: "Could not send certificate list.", cause: ex, send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.bad_certificate } }); } } var length = 3 + certList.length(); var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.certificate); rval.putInt24(length); writeVector(rval, 3, certList); return rval; }; tls.createClientKeyExchange = function(c6) { var b6 = forge.util.createBuffer(); b6.putByte(c6.session.clientHelloVersion.major); b6.putByte(c6.session.clientHelloVersion.minor); b6.putBytes(forge.random.getBytes(46)); var sp = c6.session.sp; sp.pre_master_secret = b6.getBytes(); var key2 = c6.session.serverCertificate.publicKey; b6 = key2.encrypt(sp.pre_master_secret); var length = b6.length + 2; var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.client_key_exchange); rval.putInt24(length); rval.putInt16(b6.length); rval.putBytes(b6); return rval; }; tls.createServerKeyExchange = function(c6) { var length = 0; var rval = forge.util.createBuffer(); if (length > 0) { rval.putByte(tls.HandshakeType.server_key_exchange); rval.putInt24(length); } return rval; }; tls.getClientSignature = function(c6, callback) { var b6 = forge.util.createBuffer(); b6.putBuffer(c6.session.md5.digest()); b6.putBuffer(c6.session.sha1.digest()); b6 = b6.getBytes(); c6.getSignature = c6.getSignature || function(c7, b7, callback2) { var privateKey = null; if (c7.getPrivateKey) { try { privateKey = c7.getPrivateKey(c7, c7.session.clientCertificate); privateKey = forge.pki.privateKeyFromPem(privateKey); } catch (ex) { c7.error(c7, { message: "Could not get private key.", cause: ex, send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.internal_error } }); } } if (privateKey === null) { c7.error(c7, { message: "No private key set.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.internal_error } }); } else { b7 = privateKey.sign(b7, null); } callback2(c7, b7); }; c6.getSignature(c6, b6, callback); }; tls.createCertificateVerify = function(c6, signature) { var length = signature.length + 2; var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.certificate_verify); rval.putInt24(length); rval.putInt16(signature.length); rval.putBytes(signature); return rval; }; tls.createCertificateRequest = function(c6) { var certTypes = forge.util.createBuffer(); certTypes.putByte(1); var cAs = forge.util.createBuffer(); for (var key2 in c6.caStore.certs) { var cert = c6.caStore.certs[key2]; var dn = forge.pki.distinguishedNameToAsn1(cert.subject); var byteBuffer = forge.asn1.toDer(dn); cAs.putInt16(byteBuffer.length()); cAs.putBuffer(byteBuffer); } var length = 1 + certTypes.length() + 2 + cAs.length(); var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.certificate_request); rval.putInt24(length); writeVector(rval, 1, certTypes); writeVector(rval, 2, cAs); return rval; }; tls.createServerHelloDone = function(c6) { var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.server_hello_done); rval.putInt24(0); return rval; }; tls.createChangeCipherSpec = function() { var rval = forge.util.createBuffer(); rval.putByte(1); return rval; }; tls.createFinished = function(c6) { var b6 = forge.util.createBuffer(); b6.putBuffer(c6.session.md5.digest()); b6.putBuffer(c6.session.sha1.digest()); var client = c6.entity === tls.ConnectionEnd.client; var sp = c6.session.sp; var vdl = 12; var prf = prf_TLS1; var label = client ? "client finished" : "server finished"; b6 = prf(sp.master_secret, label, b6.getBytes(), vdl); var rval = forge.util.createBuffer(); rval.putByte(tls.HandshakeType.finished); rval.putInt24(b6.length()); rval.putBuffer(b6); return rval; }; tls.createHeartbeat = function(type, payload, payloadLength) { if (typeof payloadLength === "undefined") { payloadLength = payload.length; } var rval = forge.util.createBuffer(); rval.putByte(type); rval.putInt16(payloadLength); rval.putBytes(payload); var plaintextLength = rval.length(); var paddingLength = Math.max(16, plaintextLength - payloadLength - 3); rval.putBytes(forge.random.getBytes(paddingLength)); return rval; }; tls.queue = function(c6, record) { if (!record) { return; } if (record.fragment.length() === 0) { if (record.type === tls.ContentType.handshake || record.type === tls.ContentType.alert || record.type === tls.ContentType.change_cipher_spec) { return; } } if (record.type === tls.ContentType.handshake) { var bytes = record.fragment.bytes(); c6.session.md5.update(bytes); c6.session.sha1.update(bytes); bytes = null; } var records; if (record.fragment.length() <= tls.MaxFragment) { records = [record]; } else { records = []; var data = record.fragment.bytes(); while (data.length > tls.MaxFragment) { records.push(tls.createRecord(c6, { type: record.type, data: forge.util.createBuffer(data.slice(0, tls.MaxFragment)) })); data = data.slice(tls.MaxFragment); } if (data.length > 0) { records.push(tls.createRecord(c6, { type: record.type, data: forge.util.createBuffer(data) })); } } for (var i5 = 0; i5 < records.length && !c6.fail; ++i5) { var rec = records[i5]; var s5 = c6.state.current.write; if (s5.update(c6, rec)) { c6.records.push(rec); } } }; tls.flush = function(c6) { for (var i5 = 0; i5 < c6.records.length; ++i5) { var record = c6.records[i5]; c6.tlsData.putByte(record.type); c6.tlsData.putByte(record.version.major); c6.tlsData.putByte(record.version.minor); c6.tlsData.putInt16(record.fragment.length()); c6.tlsData.putBuffer(c6.records[i5].fragment); } c6.records = []; return c6.tlsDataReady(c6); }; var _certErrorToAlertDesc = /* @__PURE__ */ __name(function(error2) { switch (error2) { case true: return true; case forge.pki.certificateError.bad_certificate: return tls.Alert.Description.bad_certificate; case forge.pki.certificateError.unsupported_certificate: return tls.Alert.Description.unsupported_certificate; case forge.pki.certificateError.certificate_revoked: return tls.Alert.Description.certificate_revoked; case forge.pki.certificateError.certificate_expired: return tls.Alert.Description.certificate_expired; case forge.pki.certificateError.certificate_unknown: return tls.Alert.Description.certificate_unknown; case forge.pki.certificateError.unknown_ca: return tls.Alert.Description.unknown_ca; default: return tls.Alert.Description.bad_certificate; } }, "_certErrorToAlertDesc"); var _alertDescToCertError = /* @__PURE__ */ __name(function(desc) { switch (desc) { case true: return true; case tls.Alert.Description.bad_certificate: return forge.pki.certificateError.bad_certificate; case tls.Alert.Description.unsupported_certificate: return forge.pki.certificateError.unsupported_certificate; case tls.Alert.Description.certificate_revoked: return forge.pki.certificateError.certificate_revoked; case tls.Alert.Description.certificate_expired: return forge.pki.certificateError.certificate_expired; case tls.Alert.Description.certificate_unknown: return forge.pki.certificateError.certificate_unknown; case tls.Alert.Description.unknown_ca: return forge.pki.certificateError.unknown_ca; default: return forge.pki.certificateError.bad_certificate; } }, "_alertDescToCertError"); tls.verifyCertificateChain = function(c6, chain2) { try { var options32 = {}; for (var key2 in c6.verifyOptions) { options32[key2] = c6.verifyOptions[key2]; } options32.verify = function(vfd, depth, chain3) { var desc = _certErrorToAlertDesc(vfd); var ret = c6.verify(c6, vfd, depth, chain3); if (ret !== true) { if (typeof ret === "object" && !forge.util.isArray(ret)) { var error2 = new Error("The application rejected the certificate."); error2.send = true; error2.alert = { level: tls.Alert.Level.fatal, description: tls.Alert.Description.bad_certificate }; if (ret.message) { error2.message = ret.message; } if (ret.alert) { error2.alert.description = ret.alert; } throw error2; } if (ret !== vfd) { ret = _alertDescToCertError(ret); } } return ret; }; forge.pki.verifyCertificateChain(c6.caStore, chain2, options32); } catch (ex) { var err = ex; if (typeof err !== "object" || forge.util.isArray(err)) { err = { send: true, alert: { level: tls.Alert.Level.fatal, description: _certErrorToAlertDesc(ex) } }; } if (!("send" in err)) { err.send = true; } if (!("alert" in err)) { err.alert = { level: tls.Alert.Level.fatal, description: _certErrorToAlertDesc(err.error) }; } c6.error(c6, err); } return !c6.fail; }; tls.createSessionCache = function(cache6, capacity) { var rval = null; if (cache6 && cache6.getSession && cache6.setSession && cache6.order) { rval = cache6; } else { rval = {}; rval.cache = cache6 || {}; rval.capacity = Math.max(capacity || 100, 1); rval.order = []; for (var key2 in cache6) { if (rval.order.length <= capacity) { rval.order.push(key2); } else { delete cache6[key2]; } } rval.getSession = function(sessionId) { var session = null; var key3 = null; if (sessionId) { key3 = forge.util.bytesToHex(sessionId); } else if (rval.order.length > 0) { key3 = rval.order[0]; } if (key3 !== null && key3 in rval.cache) { session = rval.cache[key3]; delete rval.cache[key3]; for (var i5 in rval.order) { if (rval.order[i5] === key3) { rval.order.splice(i5, 1); break; } } } return session; }; rval.setSession = function(sessionId, session) { if (rval.order.length === rval.capacity) { var key3 = rval.order.shift(); delete rval.cache[key3]; } var key3 = forge.util.bytesToHex(sessionId); rval.order.push(key3); rval.cache[key3] = session; }; } return rval; }; tls.createConnection = function(options32) { var caStore = null; if (options32.caStore) { if (forge.util.isArray(options32.caStore)) { caStore = forge.pki.createCaStore(options32.caStore); } else { caStore = options32.caStore; } } else { caStore = forge.pki.createCaStore(); } var cipherSuites = options32.cipherSuites || null; if (cipherSuites === null) { cipherSuites = []; for (var key2 in tls.CipherSuites) { cipherSuites.push(tls.CipherSuites[key2]); } } var entity = options32.server || false ? tls.ConnectionEnd.server : tls.ConnectionEnd.client; var sessionCache = options32.sessionCache ? tls.createSessionCache(options32.sessionCache) : null; var c6 = { version: { major: tls.Version.major, minor: tls.Version.minor }, entity, sessionId: options32.sessionId, caStore, sessionCache, cipherSuites, connected: options32.connected, virtualHost: options32.virtualHost || null, verifyClient: options32.verifyClient || false, verify: options32.verify || function(cn2, vfd, dpth, cts) { return vfd; }, verifyOptions: options32.verifyOptions || {}, getCertificate: options32.getCertificate || null, getPrivateKey: options32.getPrivateKey || null, getSignature: options32.getSignature || null, input: forge.util.createBuffer(), tlsData: forge.util.createBuffer(), data: forge.util.createBuffer(), tlsDataReady: options32.tlsDataReady, dataReady: options32.dataReady, heartbeatReceived: options32.heartbeatReceived, closed: options32.closed, error: function(c7, ex) { ex.origin = ex.origin || (c7.entity === tls.ConnectionEnd.client ? "client" : "server"); if (ex.send) { tls.queue(c7, tls.createAlert(c7, ex.alert)); tls.flush(c7); } var fatal = ex.fatal !== false; if (fatal) { c7.fail = true; } options32.error(c7, ex); if (fatal) { c7.close(false); } }, deflate: options32.deflate || null, inflate: options32.inflate || null }; c6.reset = function(clearFail) { c6.version = { major: tls.Version.major, minor: tls.Version.minor }; c6.record = null; c6.session = null; c6.peerCertificate = null; c6.state = { pending: null, current: null }; c6.expect = c6.entity === tls.ConnectionEnd.client ? SHE : CHE; c6.fragmented = null; c6.records = []; c6.open = false; c6.handshakes = 0; c6.handshaking = false; c6.isConnected = false; c6.fail = !(clearFail || typeof clearFail === "undefined"); c6.input.clear(); c6.tlsData.clear(); c6.data.clear(); c6.state.current = tls.createConnectionState(c6); }; c6.reset(); var _update = /* @__PURE__ */ __name(function(c7, record) { var aligned = record.type - tls.ContentType.change_cipher_spec; var handlers2 = ctTable[c7.entity][c7.expect]; if (aligned in handlers2) { handlers2[aligned](c7, record); } else { tls.handleUnexpected(c7, record); } }, "_update"); var _readRecordHeader = /* @__PURE__ */ __name(function(c7) { var rval = 0; var b6 = c7.input; var len = b6.length(); if (len < 5) { rval = 5 - len; } else { c7.record = { type: b6.getByte(), version: { major: b6.getByte(), minor: b6.getByte() }, length: b6.getInt16(), fragment: forge.util.createBuffer(), ready: false }; var compatibleVersion = c7.record.version.major === c7.version.major; if (compatibleVersion && c7.session && c7.session.version) { compatibleVersion = c7.record.version.minor === c7.version.minor; } if (!compatibleVersion) { c7.error(c7, { message: "Incompatible TLS version.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.protocol_version } }); } } return rval; }, "_readRecordHeader"); var _readRecord = /* @__PURE__ */ __name(function(c7) { var rval = 0; var b6 = c7.input; var len = b6.length(); if (len < c7.record.length) { rval = c7.record.length - len; } else { c7.record.fragment.putBytes(b6.getBytes(c7.record.length)); b6.compact(); var s5 = c7.state.current.read; if (s5.update(c7, c7.record)) { if (c7.fragmented !== null) { if (c7.fragmented.type === c7.record.type) { c7.fragmented.fragment.putBuffer(c7.record.fragment); c7.record = c7.fragmented; } else { c7.error(c7, { message: "Invalid fragmented record.", send: true, alert: { level: tls.Alert.Level.fatal, description: tls.Alert.Description.unexpected_message } }); } } c7.record.ready = true; } } return rval; }, "_readRecord"); c6.handshake = function(sessionId) { if (c6.entity !== tls.ConnectionEnd.client) { c6.error(c6, { message: "Cannot initiate handshake as a server.", fatal: false }); } else if (c6.handshaking) { c6.error(c6, { message: "Handshake already in progress.", fatal: false }); } else { if (c6.fail && !c6.open && c6.handshakes === 0) { c6.fail = false; } c6.handshaking = true; sessionId = sessionId || ""; var session = null; if (sessionId.length > 0) { if (c6.sessionCache) { session = c6.sessionCache.getSession(sessionId); } if (session === null) { sessionId = ""; } } if (sessionId.length === 0 && c6.sessionCache) { session = c6.sessionCache.getSession(); if (session !== null) { sessionId = session.id; } } c6.session = { id: sessionId, version: null, cipherSuite: null, compressionMethod: null, serverCertificate: null, certificateRequest: null, clientCertificate: null, sp: {}, md5: forge.md.md5.create(), sha1: forge.md.sha1.create() }; if (session) { c6.version = session.version; c6.session.sp = session.sp; } c6.session.sp.client_random = tls.createRandom().getBytes(); c6.open = true; tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.handshake, data: tls.createClientHello(c6) })); tls.flush(c6); } }; c6.process = function(data) { var rval = 0; if (data) { c6.input.putBytes(data); } if (!c6.fail) { if (c6.record !== null && c6.record.ready && c6.record.fragment.isEmpty()) { c6.record = null; } if (c6.record === null) { rval = _readRecordHeader(c6); } if (!c6.fail && c6.record !== null && !c6.record.ready) { rval = _readRecord(c6); } if (!c6.fail && c6.record !== null && c6.record.ready) { _update(c6, c6.record); } } return rval; }; c6.prepare = function(data) { tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.application_data, data: forge.util.createBuffer(data) })); return tls.flush(c6); }; c6.prepareHeartbeatRequest = function(payload, payloadLength) { if (payload instanceof forge.util.ByteBuffer) { payload = payload.bytes(); } if (typeof payloadLength === "undefined") { payloadLength = payload.length; } c6.expectedHeartbeatPayload = payload; tls.queue(c6, tls.createRecord(c6, { type: tls.ContentType.heartbeat, data: tls.createHeartbeat( tls.HeartbeatMessageType.heartbeat_request, payload, payloadLength ) })); return tls.flush(c6); }; c6.close = function(clearFail) { if (!c6.fail && c6.sessionCache && c6.session) { var session = { id: c6.session.id, version: c6.session.version, sp: c6.session.sp }; session.sp.keys = null; c6.sessionCache.setSession(session.id, session); } if (c6.open) { c6.open = false; c6.input.clear(); if (c6.isConnected || c6.handshaking) { c6.isConnected = c6.handshaking = false; tls.queue(c6, tls.createAlert(c6, { level: tls.Alert.Level.warning, description: tls.Alert.Description.close_notify })); tls.flush(c6); } c6.closed(c6); } c6.reset(clearFail); }; return c6; }; module3.exports = forge.tls = forge.tls || {}; for (key in tls) { if (typeof tls[key] !== "function") { forge.tls[key] = tls[key]; } } var key; forge.tls.prf_tls1 = prf_TLS1; forge.tls.hmac_sha1 = hmac_sha1; forge.tls.createSessionCache = tls.createSessionCache; forge.tls.createConnection = tls.createConnection; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/aesCipherSuites.js var require_aesCipherSuites = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/aesCipherSuites.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_aes(); require_tls(); var tls = module3.exports = forge.tls; tls.CipherSuites["TLS_RSA_WITH_AES_128_CBC_SHA"] = { id: [0, 47], name: "TLS_RSA_WITH_AES_128_CBC_SHA", initSecurityParameters: function(sp) { sp.bulk_cipher_algorithm = tls.BulkCipherAlgorithm.aes; sp.cipher_type = tls.CipherType.block; sp.enc_key_length = 16; sp.block_length = 16; sp.fixed_iv_length = 16; sp.record_iv_length = 16; sp.mac_algorithm = tls.MACAlgorithm.hmac_sha1; sp.mac_length = 20; sp.mac_key_length = 20; }, initConnectionState }; tls.CipherSuites["TLS_RSA_WITH_AES_256_CBC_SHA"] = { id: [0, 53], name: "TLS_RSA_WITH_AES_256_CBC_SHA", initSecurityParameters: function(sp) { sp.bulk_cipher_algorithm = tls.BulkCipherAlgorithm.aes; sp.cipher_type = tls.CipherType.block; sp.enc_key_length = 32; sp.block_length = 16; sp.fixed_iv_length = 16; sp.record_iv_length = 16; sp.mac_algorithm = tls.MACAlgorithm.hmac_sha1; sp.mac_length = 20; sp.mac_key_length = 20; }, initConnectionState }; function initConnectionState(state2, c6, sp) { var client = c6.entity === forge.tls.ConnectionEnd.client; state2.read.cipherState = { init: false, cipher: forge.cipher.createDecipher("AES-CBC", client ? sp.keys.server_write_key : sp.keys.client_write_key), iv: client ? sp.keys.server_write_IV : sp.keys.client_write_IV }; state2.write.cipherState = { init: false, cipher: forge.cipher.createCipher("AES-CBC", client ? sp.keys.client_write_key : sp.keys.server_write_key), iv: client ? sp.keys.client_write_IV : sp.keys.server_write_IV }; state2.read.cipherFunction = decrypt_aes_cbc_sha1; state2.write.cipherFunction = encrypt_aes_cbc_sha1; state2.read.macLength = state2.write.macLength = sp.mac_length; state2.read.macFunction = state2.write.macFunction = tls.hmac_sha1; } __name(initConnectionState, "initConnectionState"); function encrypt_aes_cbc_sha1(record, s5) { var rval = false; var mac = s5.macFunction(s5.macKey, s5.sequenceNumber, record); record.fragment.putBytes(mac); s5.updateSequenceNumber(); var iv; if (record.version.minor === tls.Versions.TLS_1_0.minor) { iv = s5.cipherState.init ? null : s5.cipherState.iv; } else { iv = forge.random.getBytesSync(16); } s5.cipherState.init = true; var cipher = s5.cipherState.cipher; cipher.start({ iv }); if (record.version.minor >= tls.Versions.TLS_1_1.minor) { cipher.output.putBytes(iv); } cipher.update(record.fragment); if (cipher.finish(encrypt_aes_cbc_sha1_padding)) { record.fragment = cipher.output; record.length = record.fragment.length(); rval = true; } return rval; } __name(encrypt_aes_cbc_sha1, "encrypt_aes_cbc_sha1"); function encrypt_aes_cbc_sha1_padding(blockSize, input, decrypt) { if (!decrypt) { var padding = blockSize - input.length() % blockSize; input.fillWithByte(padding - 1, padding); } return true; } __name(encrypt_aes_cbc_sha1_padding, "encrypt_aes_cbc_sha1_padding"); function decrypt_aes_cbc_sha1_padding(blockSize, output, decrypt) { var rval = true; if (decrypt) { var len = output.length(); var paddingLength = output.last(); for (var i5 = len - 1 - paddingLength; i5 < len - 1; ++i5) { rval = rval && output.at(i5) == paddingLength; } if (rval) { output.truncate(paddingLength + 1); } } return rval; } __name(decrypt_aes_cbc_sha1_padding, "decrypt_aes_cbc_sha1_padding"); function decrypt_aes_cbc_sha1(record, s5) { var rval = false; var iv; if (record.version.minor === tls.Versions.TLS_1_0.minor) { iv = s5.cipherState.init ? null : s5.cipherState.iv; } else { iv = record.fragment.getBytes(16); } s5.cipherState.init = true; var cipher = s5.cipherState.cipher; cipher.start({ iv }); cipher.update(record.fragment); rval = cipher.finish(decrypt_aes_cbc_sha1_padding); var macLen = s5.macLength; var mac = forge.random.getBytesSync(macLen); var len = cipher.output.length(); if (len >= macLen) { record.fragment = cipher.output.getBytes(len - macLen); mac = cipher.output.getBytes(macLen); } else { record.fragment = cipher.output.getBytes(); } record.fragment = forge.util.createBuffer(record.fragment); record.length = record.fragment.length(); var mac2 = s5.macFunction(s5.macKey, s5.sequenceNumber, record); s5.updateSequenceNumber(); rval = compareMacs(s5.macKey, mac, mac2) && rval; return rval; } __name(decrypt_aes_cbc_sha1, "decrypt_aes_cbc_sha1"); function compareMacs(key, mac1, mac2) { var hmac2 = forge.hmac.create(); hmac2.start("SHA1", key); hmac2.update(mac1); mac1 = hmac2.digest().getBytes(); hmac2.start(null, null); hmac2.update(mac2); mac2 = hmac2.digest().getBytes(); return mac1 === mac2; } __name(compareMacs, "compareMacs"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/sha512.js var require_sha512 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/sha512.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_md(); require_util10(); var sha512 = module3.exports = forge.sha512 = forge.sha512 || {}; forge.md.sha512 = forge.md.algorithms.sha512 = sha512; var sha384 = forge.sha384 = forge.sha512.sha384 = forge.sha512.sha384 || {}; sha384.create = function() { return sha512.create("SHA-384"); }; forge.md.sha384 = forge.md.algorithms.sha384 = sha384; forge.sha512.sha256 = forge.sha512.sha256 || { create: function() { return sha512.create("SHA-512/256"); } }; forge.md["sha512/256"] = forge.md.algorithms["sha512/256"] = forge.sha512.sha256; forge.sha512.sha224 = forge.sha512.sha224 || { create: function() { return sha512.create("SHA-512/224"); } }; forge.md["sha512/224"] = forge.md.algorithms["sha512/224"] = forge.sha512.sha224; sha512.create = function(algorithm) { if (!_initialized) { _init(); } if (typeof algorithm === "undefined") { algorithm = "SHA-512"; } if (!(algorithm in _states)) { throw new Error("Invalid SHA-512 algorithm: " + algorithm); } var _state = _states[algorithm]; var _h = null; var _input = forge.util.createBuffer(); var _w = new Array(80); for (var wi = 0; wi < 80; ++wi) { _w[wi] = new Array(2); } var digestLength = 64; switch (algorithm) { case "SHA-384": digestLength = 48; break; case "SHA-512/256": digestLength = 32; break; case "SHA-512/224": digestLength = 28; break; } var md = { // SHA-512 => sha512 algorithm: algorithm.replace("-", "").toLowerCase(), blockLength: 128, digestLength, // 56-bit length of message so far (does not including padding) messageLength: 0, // true message length fullMessageLength: null, // size of message length in bytes messageLengthSize: 16 }; md.start = function() { md.messageLength = 0; md.fullMessageLength = md.messageLength128 = []; var int32s = md.messageLengthSize / 4; for (var i5 = 0; i5 < int32s; ++i5) { md.fullMessageLength.push(0); } _input = forge.util.createBuffer(); _h = new Array(_state.length); for (var i5 = 0; i5 < _state.length; ++i5) { _h[i5] = _state[i5].slice(0); } return md; }; md.start(); md.update = function(msg, encoding) { if (encoding === "utf8") { msg = forge.util.encodeUtf8(msg); } var len = msg.length; md.messageLength += len; len = [len / 4294967296 >>> 0, len >>> 0]; for (var i5 = md.fullMessageLength.length - 1; i5 >= 0; --i5) { md.fullMessageLength[i5] += len[1]; len[1] = len[0] + (md.fullMessageLength[i5] / 4294967296 >>> 0); md.fullMessageLength[i5] = md.fullMessageLength[i5] >>> 0; len[0] = len[1] / 4294967296 >>> 0; } _input.putBytes(msg); _update(_h, _w, _input); if (_input.read > 2048 || _input.length() === 0) { _input.compact(); } return md; }; md.digest = function() { var finalBlock = forge.util.createBuffer(); finalBlock.putBytes(_input.bytes()); var remaining = md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize; var overflow = remaining & md.blockLength - 1; finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); var next, carry; var bits = md.fullMessageLength[0] * 8; for (var i5 = 0; i5 < md.fullMessageLength.length - 1; ++i5) { next = md.fullMessageLength[i5 + 1] * 8; carry = next / 4294967296 >>> 0; bits += carry; finalBlock.putInt32(bits >>> 0); bits = next >>> 0; } finalBlock.putInt32(bits); var h6 = new Array(_h.length); for (var i5 = 0; i5 < _h.length; ++i5) { h6[i5] = _h[i5].slice(0); } _update(h6, _w, finalBlock); var rval = forge.util.createBuffer(); var hlen; if (algorithm === "SHA-512") { hlen = h6.length; } else if (algorithm === "SHA-384") { hlen = h6.length - 2; } else { hlen = h6.length - 4; } for (var i5 = 0; i5 < hlen; ++i5) { rval.putInt32(h6[i5][0]); if (i5 !== hlen - 1 || algorithm !== "SHA-512/224") { rval.putInt32(h6[i5][1]); } } return rval; }; return md; }; var _padding = null; var _initialized = false; var _k = null; var _states = null; function _init() { _padding = String.fromCharCode(128); _padding += forge.util.fillString(String.fromCharCode(0), 128); _k = [ [1116352408, 3609767458], [1899447441, 602891725], [3049323471, 3964484399], [3921009573, 2173295548], [961987163, 4081628472], [1508970993, 3053834265], [2453635748, 2937671579], [2870763221, 3664609560], [3624381080, 2734883394], [310598401, 1164996542], [607225278, 1323610764], [1426881987, 3590304994], [1925078388, 4068182383], [2162078206, 991336113], [2614888103, 633803317], [3248222580, 3479774868], [3835390401, 2666613458], [4022224774, 944711139], [264347078, 2341262773], [604807628, 2007800933], [770255983, 1495990901], [1249150122, 1856431235], [1555081692, 3175218132], [1996064986, 2198950837], [2554220882, 3999719339], [2821834349, 766784016], [2952996808, 2566594879], [3210313671, 3203337956], [3336571891, 1034457026], [3584528711, 2466948901], [113926993, 3758326383], [338241895, 168717936], [666307205, 1188179964], [773529912, 1546045734], [1294757372, 1522805485], [1396182291, 2643833823], [1695183700, 2343527390], [1986661051, 1014477480], [2177026350, 1206759142], [2456956037, 344077627], [2730485921, 1290863460], [2820302411, 3158454273], [3259730800, 3505952657], [3345764771, 106217008], [3516065817, 3606008344], [3600352804, 1432725776], [4094571909, 1467031594], [275423344, 851169720], [430227734, 3100823752], [506948616, 1363258195], [659060556, 3750685593], [883997877, 3785050280], [958139571, 3318307427], [1322822218, 3812723403], [1537002063, 2003034995], [1747873779, 3602036899], [1955562222, 1575990012], [2024104815, 1125592928], [2227730452, 2716904306], [2361852424, 442776044], [2428436474, 593698344], [2756734187, 3733110249], [3204031479, 2999351573], [3329325298, 3815920427], [3391569614, 3928383900], [3515267271, 566280711], [3940187606, 3454069534], [4118630271, 4000239992], [116418474, 1914138554], [174292421, 2731055270], [289380356, 3203993006], [460393269, 320620315], [685471733, 587496836], [852142971, 1086792851], [1017036298, 365543100], [1126000580, 2618297676], [1288033470, 3409855158], [1501505948, 4234509866], [1607167915, 987167468], [1816402316, 1246189591] ]; _states = {}; _states["SHA-512"] = [ [1779033703, 4089235720], [3144134277, 2227873595], [1013904242, 4271175723], [2773480762, 1595750129], [1359893119, 2917565137], [2600822924, 725511199], [528734635, 4215389547], [1541459225, 327033209] ]; _states["SHA-384"] = [ [3418070365, 3238371032], [1654270250, 914150663], [2438529370, 812702999], [355462360, 4144912697], [1731405415, 4290775857], [2394180231, 1750603025], [3675008525, 1694076839], [1203062813, 3204075428] ]; _states["SHA-512/256"] = [ [573645204, 4230739756], [2673172387, 3360449730], [596883563, 1867755857], [2520282905, 1497426621], [2519219938, 2827943907], [3193839141, 1401305490], [721525244, 746961066], [246885852, 2177182882] ]; _states["SHA-512/224"] = [ [2352822216, 424955298], [1944164710, 2312950998], [502970286, 855612546], [1738396948, 1479516111], [258812777, 2077511080], [2011393907, 79989058], [1067287976, 1780299464], [286451373, 2446758561] ]; _initialized = true; } __name(_init, "_init"); function _update(s5, w6, bytes) { var t1_hi, t1_lo; var t2_hi, t2_lo; var s0_hi, s0_lo; var s1_hi, s1_lo; var ch_hi, ch_lo; var maj_hi, maj_lo; var a_hi, a_lo; var b_hi, b_lo; var c_hi, c_lo; var d_hi, d_lo; var e_hi, e_lo; var f_hi, f_lo; var g_hi, g_lo; var h_hi, h_lo; var i5, hi, lo, w22, w7, w15, w16; var len = bytes.length(); while (len >= 128) { for (i5 = 0; i5 < 16; ++i5) { w6[i5][0] = bytes.getInt32() >>> 0; w6[i5][1] = bytes.getInt32() >>> 0; } for (; i5 < 80; ++i5) { w22 = w6[i5 - 2]; hi = w22[0]; lo = w22[1]; t1_hi = ((hi >>> 19 | lo << 13) ^ // ROTR 19 (lo >>> 29 | hi << 3) ^ // ROTR 61/(swap + ROTR 29) hi >>> 6) >>> 0; t1_lo = ((hi << 13 | lo >>> 19) ^ // ROTR 19 (lo << 3 | hi >>> 29) ^ // ROTR 61/(swap + ROTR 29) (hi << 26 | lo >>> 6)) >>> 0; w15 = w6[i5 - 15]; hi = w15[0]; lo = w15[1]; t2_hi = ((hi >>> 1 | lo << 31) ^ // ROTR 1 (hi >>> 8 | lo << 24) ^ // ROTR 8 hi >>> 7) >>> 0; t2_lo = ((hi << 31 | lo >>> 1) ^ // ROTR 1 (hi << 24 | lo >>> 8) ^ // ROTR 8 (hi << 25 | lo >>> 7)) >>> 0; w7 = w6[i5 - 7]; w16 = w6[i5 - 16]; lo = t1_lo + w7[1] + t2_lo + w16[1]; w6[i5][0] = t1_hi + w7[0] + t2_hi + w16[0] + (lo / 4294967296 >>> 0) >>> 0; w6[i5][1] = lo >>> 0; } a_hi = s5[0][0]; a_lo = s5[0][1]; b_hi = s5[1][0]; b_lo = s5[1][1]; c_hi = s5[2][0]; c_lo = s5[2][1]; d_hi = s5[3][0]; d_lo = s5[3][1]; e_hi = s5[4][0]; e_lo = s5[4][1]; f_hi = s5[5][0]; f_lo = s5[5][1]; g_hi = s5[6][0]; g_lo = s5[6][1]; h_hi = s5[7][0]; h_lo = s5[7][1]; for (i5 = 0; i5 < 80; ++i5) { s1_hi = ((e_hi >>> 14 | e_lo << 18) ^ // ROTR 14 (e_hi >>> 18 | e_lo << 14) ^ // ROTR 18 (e_lo >>> 9 | e_hi << 23)) >>> 0; s1_lo = ((e_hi << 18 | e_lo >>> 14) ^ // ROTR 14 (e_hi << 14 | e_lo >>> 18) ^ // ROTR 18 (e_lo << 23 | e_hi >>> 9)) >>> 0; ch_hi = (g_hi ^ e_hi & (f_hi ^ g_hi)) >>> 0; ch_lo = (g_lo ^ e_lo & (f_lo ^ g_lo)) >>> 0; s0_hi = ((a_hi >>> 28 | a_lo << 4) ^ // ROTR 28 (a_lo >>> 2 | a_hi << 30) ^ // ROTR 34/(swap + ROTR 2) (a_lo >>> 7 | a_hi << 25)) >>> 0; s0_lo = ((a_hi << 4 | a_lo >>> 28) ^ // ROTR 28 (a_lo << 30 | a_hi >>> 2) ^ // ROTR 34/(swap + ROTR 2) (a_lo << 25 | a_hi >>> 7)) >>> 0; maj_hi = (a_hi & b_hi | c_hi & (a_hi ^ b_hi)) >>> 0; maj_lo = (a_lo & b_lo | c_lo & (a_lo ^ b_lo)) >>> 0; lo = h_lo + s1_lo + ch_lo + _k[i5][1] + w6[i5][1]; t1_hi = h_hi + s1_hi + ch_hi + _k[i5][0] + w6[i5][0] + (lo / 4294967296 >>> 0) >>> 0; t1_lo = lo >>> 0; lo = s0_lo + maj_lo; t2_hi = s0_hi + maj_hi + (lo / 4294967296 >>> 0) >>> 0; t2_lo = lo >>> 0; h_hi = g_hi; h_lo = g_lo; g_hi = f_hi; g_lo = f_lo; f_hi = e_hi; f_lo = e_lo; lo = d_lo + t1_lo; e_hi = d_hi + t1_hi + (lo / 4294967296 >>> 0) >>> 0; e_lo = lo >>> 0; d_hi = c_hi; d_lo = c_lo; c_hi = b_hi; c_lo = b_lo; b_hi = a_hi; b_lo = a_lo; lo = t1_lo + t2_lo; a_hi = t1_hi + t2_hi + (lo / 4294967296 >>> 0) >>> 0; a_lo = lo >>> 0; } lo = s5[0][1] + a_lo; s5[0][0] = s5[0][0] + a_hi + (lo / 4294967296 >>> 0) >>> 0; s5[0][1] = lo >>> 0; lo = s5[1][1] + b_lo; s5[1][0] = s5[1][0] + b_hi + (lo / 4294967296 >>> 0) >>> 0; s5[1][1] = lo >>> 0; lo = s5[2][1] + c_lo; s5[2][0] = s5[2][0] + c_hi + (lo / 4294967296 >>> 0) >>> 0; s5[2][1] = lo >>> 0; lo = s5[3][1] + d_lo; s5[3][0] = s5[3][0] + d_hi + (lo / 4294967296 >>> 0) >>> 0; s5[3][1] = lo >>> 0; lo = s5[4][1] + e_lo; s5[4][0] = s5[4][0] + e_hi + (lo / 4294967296 >>> 0) >>> 0; s5[4][1] = lo >>> 0; lo = s5[5][1] + f_lo; s5[5][0] = s5[5][0] + f_hi + (lo / 4294967296 >>> 0) >>> 0; s5[5][1] = lo >>> 0; lo = s5[6][1] + g_lo; s5[6][0] = s5[6][0] + g_hi + (lo / 4294967296 >>> 0) >>> 0; s5[6][1] = lo >>> 0; lo = s5[7][1] + h_lo; s5[7][0] = s5[7][0] + h_hi + (lo / 4294967296 >>> 0) >>> 0; s5[7][1] = lo >>> 0; len -= 128; } } __name(_update, "_update"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/asn1-validator.js var require_asn1_validator = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/asn1-validator.js"(exports2) { init_import_meta_url(); var forge = require_forge(); require_asn1(); var asn1 = forge.asn1; exports2.privateKeyValidator = { // PrivateKeyInfo name: "PrivateKeyInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ // Version (INTEGER) name: "PrivateKeyInfo.version", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.INTEGER, constructed: false, capture: "privateKeyVersion" }, { // privateKeyAlgorithm name: "PrivateKeyInfo.privateKeyAlgorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "AlgorithmIdentifier.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "privateKeyOid" }] }, { // PrivateKey name: "PrivateKeyInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OCTETSTRING, constructed: false, capture: "privateKey" }] }; exports2.publicKeyValidator = { name: "SubjectPublicKeyInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, captureAsn1: "subjectPublicKeyInfo", value: [ { name: "SubjectPublicKeyInfo.AlgorithmIdentifier", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ name: "AlgorithmIdentifier.algorithm", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, capture: "publicKeyOid" }] }, // capture group for ed25519PublicKey { tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, composed: true, captureBitStringValue: "ed25519PublicKey" } // FIXME: this is capture group for rsaPublicKey, use it in this API or // discard? /* { // subjectPublicKey name: 'SubjectPublicKeyInfo.subjectPublicKey', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.BITSTRING, constructed: false, value: [{ // RSAPublicKey name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, optional: true, captureAsn1: 'rsaPublicKey' }] } */ ] }; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/ed25519.js var require_ed25519 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/ed25519.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_jsbn(); require_random2(); require_sha512(); require_util10(); var asn1Validator = require_asn1_validator(); var publicKeyValidator = asn1Validator.publicKeyValidator; var privateKeyValidator = asn1Validator.privateKeyValidator; if (typeof BigInteger === "undefined") { BigInteger = forge.jsbn.BigInteger; } var BigInteger; var ByteBuffer = forge.util.ByteBuffer; var NativeBuffer = typeof Buffer === "undefined" ? Uint8Array : Buffer; forge.pki = forge.pki || {}; module3.exports = forge.pki.ed25519 = forge.ed25519 = forge.ed25519 || {}; var ed25519 = forge.ed25519; ed25519.constants = {}; ed25519.constants.PUBLIC_KEY_BYTE_LENGTH = 32; ed25519.constants.PRIVATE_KEY_BYTE_LENGTH = 64; ed25519.constants.SEED_BYTE_LENGTH = 32; ed25519.constants.SIGN_BYTE_LENGTH = 64; ed25519.constants.HASH_BYTE_LENGTH = 64; ed25519.generateKeyPair = function(options32) { options32 = options32 || {}; var seed = options32.seed; if (seed === void 0) { seed = forge.random.getBytesSync(ed25519.constants.SEED_BYTE_LENGTH); } else if (typeof seed === "string") { if (seed.length !== ed25519.constants.SEED_BYTE_LENGTH) { throw new TypeError( '"seed" must be ' + ed25519.constants.SEED_BYTE_LENGTH + " bytes in length." ); } } else if (!(seed instanceof Uint8Array)) { throw new TypeError( '"seed" must be a node.js Buffer, Uint8Array, or a binary string.' ); } seed = messageToNativeBuffer({ message: seed, encoding: "binary" }); var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); var sk = new NativeBuffer(ed25519.constants.PRIVATE_KEY_BYTE_LENGTH); for (var i5 = 0; i5 < 32; ++i5) { sk[i5] = seed[i5]; } crypto_sign_keypair(pk, sk); return { publicKey: pk, privateKey: sk }; }; ed25519.privateKeyFromAsn1 = function(obj) { var capture = {}; var errors = []; var valid = forge.asn1.validate(obj, privateKeyValidator, capture, errors); if (!valid) { var error2 = new Error("Invalid Key."); error2.errors = errors; throw error2; } var oid = forge.asn1.derToOid(capture.privateKeyOid); var ed25519Oid = forge.oids.EdDSA25519; if (oid !== ed25519Oid) { throw new Error('Invalid OID "' + oid + '"; OID must be "' + ed25519Oid + '".'); } var privateKey = capture.privateKey; var privateKeyBytes = messageToNativeBuffer({ message: forge.asn1.fromDer(privateKey).value, encoding: "binary" }); return { privateKeyBytes }; }; ed25519.publicKeyFromAsn1 = function(obj) { var capture = {}; var errors = []; var valid = forge.asn1.validate(obj, publicKeyValidator, capture, errors); if (!valid) { var error2 = new Error("Invalid Key."); error2.errors = errors; throw error2; } var oid = forge.asn1.derToOid(capture.publicKeyOid); var ed25519Oid = forge.oids.EdDSA25519; if (oid !== ed25519Oid) { throw new Error('Invalid OID "' + oid + '"; OID must be "' + ed25519Oid + '".'); } var publicKeyBytes = capture.ed25519PublicKey; if (publicKeyBytes.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) { throw new Error("Key length is invalid."); } return messageToNativeBuffer({ message: publicKeyBytes, encoding: "binary" }); }; ed25519.publicKeyFromPrivateKey = function(options32) { options32 = options32 || {}; var privateKey = messageToNativeBuffer({ message: options32.privateKey, encoding: "binary" }); if (privateKey.length !== ed25519.constants.PRIVATE_KEY_BYTE_LENGTH) { throw new TypeError( '"options.privateKey" must have a byte length of ' + ed25519.constants.PRIVATE_KEY_BYTE_LENGTH ); } var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); for (var i5 = 0; i5 < pk.length; ++i5) { pk[i5] = privateKey[32 + i5]; } return pk; }; ed25519.sign = function(options32) { options32 = options32 || {}; var msg = messageToNativeBuffer(options32); var privateKey = messageToNativeBuffer({ message: options32.privateKey, encoding: "binary" }); if (privateKey.length === ed25519.constants.SEED_BYTE_LENGTH) { var keyPair = ed25519.generateKeyPair({ seed: privateKey }); privateKey = keyPair.privateKey; } else if (privateKey.length !== ed25519.constants.PRIVATE_KEY_BYTE_LENGTH) { throw new TypeError( '"options.privateKey" must have a byte length of ' + ed25519.constants.SEED_BYTE_LENGTH + " or " + ed25519.constants.PRIVATE_KEY_BYTE_LENGTH ); } var signedMsg = new NativeBuffer( ed25519.constants.SIGN_BYTE_LENGTH + msg.length ); crypto_sign(signedMsg, msg, msg.length, privateKey); var sig = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH); for (var i5 = 0; i5 < sig.length; ++i5) { sig[i5] = signedMsg[i5]; } return sig; }; ed25519.verify = function(options32) { options32 = options32 || {}; var msg = messageToNativeBuffer(options32); if (options32.signature === void 0) { throw new TypeError( '"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.' ); } var sig = messageToNativeBuffer({ message: options32.signature, encoding: "binary" }); if (sig.length !== ed25519.constants.SIGN_BYTE_LENGTH) { throw new TypeError( '"options.signature" must have a byte length of ' + ed25519.constants.SIGN_BYTE_LENGTH ); } var publicKey = messageToNativeBuffer({ message: options32.publicKey, encoding: "binary" }); if (publicKey.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) { throw new TypeError( '"options.publicKey" must have a byte length of ' + ed25519.constants.PUBLIC_KEY_BYTE_LENGTH ); } var sm = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH + msg.length); var m6 = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH + msg.length); var i5; for (i5 = 0; i5 < ed25519.constants.SIGN_BYTE_LENGTH; ++i5) { sm[i5] = sig[i5]; } for (i5 = 0; i5 < msg.length; ++i5) { sm[i5 + ed25519.constants.SIGN_BYTE_LENGTH] = msg[i5]; } return crypto_sign_open(m6, sm, sm.length, publicKey) >= 0; }; function messageToNativeBuffer(options32) { var message = options32.message; if (message instanceof Uint8Array || message instanceof NativeBuffer) { return message; } var encoding = options32.encoding; if (message === void 0) { if (options32.md) { message = options32.md.digest().getBytes(); encoding = "binary"; } else { throw new TypeError('"options.message" or "options.md" not specified.'); } } if (typeof message === "string" && !encoding) { throw new TypeError('"options.encoding" must be "binary" or "utf8".'); } if (typeof message === "string") { if (typeof Buffer !== "undefined") { return Buffer.from(message, encoding); } message = new ByteBuffer(message, encoding); } else if (!(message instanceof ByteBuffer)) { throw new TypeError( '"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.' ); } var buffer = new NativeBuffer(message.length()); for (var i5 = 0; i5 < buffer.length; ++i5) { buffer[i5] = message.at(i5); } return buffer; } __name(messageToNativeBuffer, "messageToNativeBuffer"); var gf0 = gf(); var gf1 = gf([1]); var D3 = gf([ 30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995 ]); var D22 = gf([ 61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222 ]); var X3 = gf([ 54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553 ]); var Y3 = gf([ 26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214 ]); var L3 = new Float64Array([ 237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 ]); var I4 = gf([ 41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139 ]); function sha512(msg, msgLen) { var md = forge.md.sha512.create(); var buffer = new ByteBuffer(msg); md.update(buffer.getBytes(msgLen), "binary"); var hash = md.digest().getBytes(); if (typeof Buffer !== "undefined") { return Buffer.from(hash, "binary"); } var out = new NativeBuffer(ed25519.constants.HASH_BYTE_LENGTH); for (var i5 = 0; i5 < 64; ++i5) { out[i5] = hash.charCodeAt(i5); } return out; } __name(sha512, "sha512"); function crypto_sign_keypair(pk, sk) { var p6 = [gf(), gf(), gf(), gf()]; var i5; var d6 = sha512(sk, 32); d6[0] &= 248; d6[31] &= 127; d6[31] |= 64; scalarbase(p6, d6); pack(pk, p6); for (i5 = 0; i5 < 32; ++i5) { sk[i5 + 32] = pk[i5]; } return 0; } __name(crypto_sign_keypair, "crypto_sign_keypair"); function crypto_sign(sm, m6, n6, sk) { var i5, j6, x6 = new Float64Array(64); var p6 = [gf(), gf(), gf(), gf()]; var d6 = sha512(sk, 32); d6[0] &= 248; d6[31] &= 127; d6[31] |= 64; var smlen = n6 + 64; for (i5 = 0; i5 < n6; ++i5) { sm[64 + i5] = m6[i5]; } for (i5 = 0; i5 < 32; ++i5) { sm[32 + i5] = d6[32 + i5]; } var r7 = sha512(sm.subarray(32), n6 + 32); reduce(r7); scalarbase(p6, r7); pack(sm, p6); for (i5 = 32; i5 < 64; ++i5) { sm[i5] = sk[i5]; } var h6 = sha512(sm, n6 + 64); reduce(h6); for (i5 = 32; i5 < 64; ++i5) { x6[i5] = 0; } for (i5 = 0; i5 < 32; ++i5) { x6[i5] = r7[i5]; } for (i5 = 0; i5 < 32; ++i5) { for (j6 = 0; j6 < 32; j6++) { x6[i5 + j6] += h6[i5] * d6[j6]; } } modL(sm.subarray(32), x6); return smlen; } __name(crypto_sign, "crypto_sign"); function crypto_sign_open(m6, sm, n6, pk) { var i5, mlen; var t7 = new NativeBuffer(32); var p6 = [gf(), gf(), gf(), gf()], q6 = [gf(), gf(), gf(), gf()]; mlen = -1; if (n6 < 64) { return -1; } if (unpackneg(q6, pk)) { return -1; } for (i5 = 0; i5 < n6; ++i5) { m6[i5] = sm[i5]; } for (i5 = 0; i5 < 32; ++i5) { m6[i5 + 32] = pk[i5]; } var h6 = sha512(m6, n6); reduce(h6); scalarmult(p6, q6, h6); scalarbase(q6, sm.subarray(32)); add(p6, q6); pack(t7, p6); n6 -= 64; if (crypto_verify_32(sm, 0, t7, 0)) { for (i5 = 0; i5 < n6; ++i5) { m6[i5] = 0; } return -1; } for (i5 = 0; i5 < n6; ++i5) { m6[i5] = sm[i5 + 64]; } mlen = n6; return mlen; } __name(crypto_sign_open, "crypto_sign_open"); function modL(r7, x6) { var carry, i5, j6, k6; for (i5 = 63; i5 >= 32; --i5) { carry = 0; for (j6 = i5 - 32, k6 = i5 - 12; j6 < k6; ++j6) { x6[j6] += carry - 16 * x6[i5] * L3[j6 - (i5 - 32)]; carry = x6[j6] + 128 >> 8; x6[j6] -= carry * 256; } x6[j6] += carry; x6[i5] = 0; } carry = 0; for (j6 = 0; j6 < 32; ++j6) { x6[j6] += carry - (x6[31] >> 4) * L3[j6]; carry = x6[j6] >> 8; x6[j6] &= 255; } for (j6 = 0; j6 < 32; ++j6) { x6[j6] -= carry * L3[j6]; } for (i5 = 0; i5 < 32; ++i5) { x6[i5 + 1] += x6[i5] >> 8; r7[i5] = x6[i5] & 255; } } __name(modL, "modL"); function reduce(r7) { var x6 = new Float64Array(64); for (var i5 = 0; i5 < 64; ++i5) { x6[i5] = r7[i5]; r7[i5] = 0; } modL(r7, x6); } __name(reduce, "reduce"); function add(p6, q6) { var a5 = gf(), b6 = gf(), c6 = gf(), d6 = gf(), e7 = gf(), f5 = gf(), g6 = gf(), h6 = gf(), t7 = gf(); Z3(a5, p6[1], p6[0]); Z3(t7, q6[1], q6[0]); M3(a5, a5, t7); A3(b6, p6[0], p6[1]); A3(t7, q6[0], q6[1]); M3(b6, b6, t7); M3(c6, p6[3], q6[3]); M3(c6, c6, D22); M3(d6, p6[2], q6[2]); A3(d6, d6, d6); Z3(e7, b6, a5); Z3(f5, d6, c6); A3(g6, d6, c6); A3(h6, b6, a5); M3(p6[0], e7, f5); M3(p6[1], h6, g6); M3(p6[2], g6, f5); M3(p6[3], e7, h6); } __name(add, "add"); function cswap(p6, q6, b6) { for (var i5 = 0; i5 < 4; ++i5) { sel25519(p6[i5], q6[i5], b6); } } __name(cswap, "cswap"); function pack(r7, p6) { var tx = gf(), ty = gf(), zi = gf(); inv25519(zi, p6[2]); M3(tx, p6[0], zi); M3(ty, p6[1], zi); pack25519(r7, ty); r7[31] ^= par25519(tx) << 7; } __name(pack, "pack"); function pack25519(o5, n6) { var i5, j6, b6; var m6 = gf(), t7 = gf(); for (i5 = 0; i5 < 16; ++i5) { t7[i5] = n6[i5]; } car25519(t7); car25519(t7); car25519(t7); for (j6 = 0; j6 < 2; ++j6) { m6[0] = t7[0] - 65517; for (i5 = 1; i5 < 15; ++i5) { m6[i5] = t7[i5] - 65535 - (m6[i5 - 1] >> 16 & 1); m6[i5 - 1] &= 65535; } m6[15] = t7[15] - 32767 - (m6[14] >> 16 & 1); b6 = m6[15] >> 16 & 1; m6[14] &= 65535; sel25519(t7, m6, 1 - b6); } for (i5 = 0; i5 < 16; i5++) { o5[2 * i5] = t7[i5] & 255; o5[2 * i5 + 1] = t7[i5] >> 8; } } __name(pack25519, "pack25519"); function unpackneg(r7, p6) { var t7 = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); set25519(r7[2], gf1); unpack25519(r7[1], p6); S3(num, r7[1]); M3(den, num, D3); Z3(num, num, r7[2]); A3(den, r7[2], den); S3(den2, den); S3(den4, den2); M3(den6, den4, den2); M3(t7, den6, num); M3(t7, t7, den); pow2523(t7, t7); M3(t7, t7, num); M3(t7, t7, den); M3(t7, t7, den); M3(r7[0], t7, den); S3(chk, r7[0]); M3(chk, chk, den); if (neq25519(chk, num)) { M3(r7[0], r7[0], I4); } S3(chk, r7[0]); M3(chk, chk, den); if (neq25519(chk, num)) { return -1; } if (par25519(r7[0]) === p6[31] >> 7) { Z3(r7[0], gf0, r7[0]); } M3(r7[3], r7[0], r7[1]); return 0; } __name(unpackneg, "unpackneg"); function unpack25519(o5, n6) { var i5; for (i5 = 0; i5 < 16; ++i5) { o5[i5] = n6[2 * i5] + (n6[2 * i5 + 1] << 8); } o5[15] &= 32767; } __name(unpack25519, "unpack25519"); function pow2523(o5, i5) { var c6 = gf(); var a5; for (a5 = 0; a5 < 16; ++a5) { c6[a5] = i5[a5]; } for (a5 = 250; a5 >= 0; --a5) { S3(c6, c6); if (a5 !== 1) { M3(c6, c6, i5); } } for (a5 = 0; a5 < 16; ++a5) { o5[a5] = c6[a5]; } } __name(pow2523, "pow2523"); function neq25519(a5, b6) { var c6 = new NativeBuffer(32); var d6 = new NativeBuffer(32); pack25519(c6, a5); pack25519(d6, b6); return crypto_verify_32(c6, 0, d6, 0); } __name(neq25519, "neq25519"); function crypto_verify_32(x6, xi, y4, yi) { return vn(x6, xi, y4, yi, 32); } __name(crypto_verify_32, "crypto_verify_32"); function vn(x6, xi, y4, yi, n6) { var i5, d6 = 0; for (i5 = 0; i5 < n6; ++i5) { d6 |= x6[xi + i5] ^ y4[yi + i5]; } return (1 & d6 - 1 >>> 8) - 1; } __name(vn, "vn"); function par25519(a5) { var d6 = new NativeBuffer(32); pack25519(d6, a5); return d6[0] & 1; } __name(par25519, "par25519"); function scalarmult(p6, q6, s5) { var b6, i5; set25519(p6[0], gf0); set25519(p6[1], gf1); set25519(p6[2], gf1); set25519(p6[3], gf0); for (i5 = 255; i5 >= 0; --i5) { b6 = s5[i5 / 8 | 0] >> (i5 & 7) & 1; cswap(p6, q6, b6); add(q6, p6); add(p6, p6); cswap(p6, q6, b6); } } __name(scalarmult, "scalarmult"); function scalarbase(p6, s5) { var q6 = [gf(), gf(), gf(), gf()]; set25519(q6[0], X3); set25519(q6[1], Y3); set25519(q6[2], gf1); M3(q6[3], X3, Y3); scalarmult(p6, q6, s5); } __name(scalarbase, "scalarbase"); function set25519(r7, a5) { var i5; for (i5 = 0; i5 < 16; i5++) { r7[i5] = a5[i5] | 0; } } __name(set25519, "set25519"); function inv25519(o5, i5) { var c6 = gf(); var a5; for (a5 = 0; a5 < 16; ++a5) { c6[a5] = i5[a5]; } for (a5 = 253; a5 >= 0; --a5) { S3(c6, c6); if (a5 !== 2 && a5 !== 4) { M3(c6, c6, i5); } } for (a5 = 0; a5 < 16; ++a5) { o5[a5] = c6[a5]; } } __name(inv25519, "inv25519"); function car25519(o5) { var i5, v7, c6 = 1; for (i5 = 0; i5 < 16; ++i5) { v7 = o5[i5] + c6 + 65535; c6 = Math.floor(v7 / 65536); o5[i5] = v7 - c6 * 65536; } o5[0] += c6 - 1 + 37 * (c6 - 1); } __name(car25519, "car25519"); function sel25519(p6, q6, b6) { var t7, c6 = ~(b6 - 1); for (var i5 = 0; i5 < 16; ++i5) { t7 = c6 & (p6[i5] ^ q6[i5]); p6[i5] ^= t7; q6[i5] ^= t7; } } __name(sel25519, "sel25519"); function gf(init2) { var i5, r7 = new Float64Array(16); if (init2) { for (i5 = 0; i5 < init2.length; ++i5) { r7[i5] = init2[i5]; } } return r7; } __name(gf, "gf"); function A3(o5, a5, b6) { for (var i5 = 0; i5 < 16; ++i5) { o5[i5] = a5[i5] + b6[i5]; } } __name(A3, "A"); function Z3(o5, a5, b6) { for (var i5 = 0; i5 < 16; ++i5) { o5[i5] = a5[i5] - b6[i5]; } } __name(Z3, "Z"); function S3(o5, a5) { M3(o5, a5, a5); } __name(S3, "S"); function M3(o5, a5, b6) { var v7, c6, t0 = 0, t1 = 0, t22 = 0, t32 = 0, t42 = 0, t52 = 0, t62 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t222 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b6[0], b1 = b6[1], b22 = b6[2], b32 = b6[3], b42 = b6[4], b52 = b6[5], b62 = b6[6], b7 = b6[7], b8 = b6[8], b9 = b6[9], b10 = b6[10], b11 = b6[11], b12 = b6[12], b13 = b6[13], b14 = b6[14], b15 = b6[15]; v7 = a5[0]; t0 += v7 * b0; t1 += v7 * b1; t22 += v7 * b22; t32 += v7 * b32; t42 += v7 * b42; t52 += v7 * b52; t62 += v7 * b62; t7 += v7 * b7; t8 += v7 * b8; t9 += v7 * b9; t10 += v7 * b10; t11 += v7 * b11; t12 += v7 * b12; t13 += v7 * b13; t14 += v7 * b14; t15 += v7 * b15; v7 = a5[1]; t1 += v7 * b0; t22 += v7 * b1; t32 += v7 * b22; t42 += v7 * b32; t52 += v7 * b42; t62 += v7 * b52; t7 += v7 * b62; t8 += v7 * b7; t9 += v7 * b8; t10 += v7 * b9; t11 += v7 * b10; t12 += v7 * b11; t13 += v7 * b12; t14 += v7 * b13; t15 += v7 * b14; t16 += v7 * b15; v7 = a5[2]; t22 += v7 * b0; t32 += v7 * b1; t42 += v7 * b22; t52 += v7 * b32; t62 += v7 * b42; t7 += v7 * b52; t8 += v7 * b62; t9 += v7 * b7; t10 += v7 * b8; t11 += v7 * b9; t12 += v7 * b10; t13 += v7 * b11; t14 += v7 * b12; t15 += v7 * b13; t16 += v7 * b14; t17 += v7 * b15; v7 = a5[3]; t32 += v7 * b0; t42 += v7 * b1; t52 += v7 * b22; t62 += v7 * b32; t7 += v7 * b42; t8 += v7 * b52; t9 += v7 * b62; t10 += v7 * b7; t11 += v7 * b8; t12 += v7 * b9; t13 += v7 * b10; t14 += v7 * b11; t15 += v7 * b12; t16 += v7 * b13; t17 += v7 * b14; t18 += v7 * b15; v7 = a5[4]; t42 += v7 * b0; t52 += v7 * b1; t62 += v7 * b22; t7 += v7 * b32; t8 += v7 * b42; t9 += v7 * b52; t10 += v7 * b62; t11 += v7 * b7; t12 += v7 * b8; t13 += v7 * b9; t14 += v7 * b10; t15 += v7 * b11; t16 += v7 * b12; t17 += v7 * b13; t18 += v7 * b14; t19 += v7 * b15; v7 = a5[5]; t52 += v7 * b0; t62 += v7 * b1; t7 += v7 * b22; t8 += v7 * b32; t9 += v7 * b42; t10 += v7 * b52; t11 += v7 * b62; t12 += v7 * b7; t13 += v7 * b8; t14 += v7 * b9; t15 += v7 * b10; t16 += v7 * b11; t17 += v7 * b12; t18 += v7 * b13; t19 += v7 * b14; t20 += v7 * b15; v7 = a5[6]; t62 += v7 * b0; t7 += v7 * b1; t8 += v7 * b22; t9 += v7 * b32; t10 += v7 * b42; t11 += v7 * b52; t12 += v7 * b62; t13 += v7 * b7; t14 += v7 * b8; t15 += v7 * b9; t16 += v7 * b10; t17 += v7 * b11; t18 += v7 * b12; t19 += v7 * b13; t20 += v7 * b14; t21 += v7 * b15; v7 = a5[7]; t7 += v7 * b0; t8 += v7 * b1; t9 += v7 * b22; t10 += v7 * b32; t11 += v7 * b42; t12 += v7 * b52; t13 += v7 * b62; t14 += v7 * b7; t15 += v7 * b8; t16 += v7 * b9; t17 += v7 * b10; t18 += v7 * b11; t19 += v7 * b12; t20 += v7 * b13; t21 += v7 * b14; t222 += v7 * b15; v7 = a5[8]; t8 += v7 * b0; t9 += v7 * b1; t10 += v7 * b22; t11 += v7 * b32; t12 += v7 * b42; t13 += v7 * b52; t14 += v7 * b62; t15 += v7 * b7; t16 += v7 * b8; t17 += v7 * b9; t18 += v7 * b10; t19 += v7 * b11; t20 += v7 * b12; t21 += v7 * b13; t222 += v7 * b14; t23 += v7 * b15; v7 = a5[9]; t9 += v7 * b0; t10 += v7 * b1; t11 += v7 * b22; t12 += v7 * b32; t13 += v7 * b42; t14 += v7 * b52; t15 += v7 * b62; t16 += v7 * b7; t17 += v7 * b8; t18 += v7 * b9; t19 += v7 * b10; t20 += v7 * b11; t21 += v7 * b12; t222 += v7 * b13; t23 += v7 * b14; t24 += v7 * b15; v7 = a5[10]; t10 += v7 * b0; t11 += v7 * b1; t12 += v7 * b22; t13 += v7 * b32; t14 += v7 * b42; t15 += v7 * b52; t16 += v7 * b62; t17 += v7 * b7; t18 += v7 * b8; t19 += v7 * b9; t20 += v7 * b10; t21 += v7 * b11; t222 += v7 * b12; t23 += v7 * b13; t24 += v7 * b14; t25 += v7 * b15; v7 = a5[11]; t11 += v7 * b0; t12 += v7 * b1; t13 += v7 * b22; t14 += v7 * b32; t15 += v7 * b42; t16 += v7 * b52; t17 += v7 * b62; t18 += v7 * b7; t19 += v7 * b8; t20 += v7 * b9; t21 += v7 * b10; t222 += v7 * b11; t23 += v7 * b12; t24 += v7 * b13; t25 += v7 * b14; t26 += v7 * b15; v7 = a5[12]; t12 += v7 * b0; t13 += v7 * b1; t14 += v7 * b22; t15 += v7 * b32; t16 += v7 * b42; t17 += v7 * b52; t18 += v7 * b62; t19 += v7 * b7; t20 += v7 * b8; t21 += v7 * b9; t222 += v7 * b10; t23 += v7 * b11; t24 += v7 * b12; t25 += v7 * b13; t26 += v7 * b14; t27 += v7 * b15; v7 = a5[13]; t13 += v7 * b0; t14 += v7 * b1; t15 += v7 * b22; t16 += v7 * b32; t17 += v7 * b42; t18 += v7 * b52; t19 += v7 * b62; t20 += v7 * b7; t21 += v7 * b8; t222 += v7 * b9; t23 += v7 * b10; t24 += v7 * b11; t25 += v7 * b12; t26 += v7 * b13; t27 += v7 * b14; t28 += v7 * b15; v7 = a5[14]; t14 += v7 * b0; t15 += v7 * b1; t16 += v7 * b22; t17 += v7 * b32; t18 += v7 * b42; t19 += v7 * b52; t20 += v7 * b62; t21 += v7 * b7; t222 += v7 * b8; t23 += v7 * b9; t24 += v7 * b10; t25 += v7 * b11; t26 += v7 * b12; t27 += v7 * b13; t28 += v7 * b14; t29 += v7 * b15; v7 = a5[15]; t15 += v7 * b0; t16 += v7 * b1; t17 += v7 * b22; t18 += v7 * b32; t19 += v7 * b42; t20 += v7 * b52; t21 += v7 * b62; t222 += v7 * b7; t23 += v7 * b8; t24 += v7 * b9; t25 += v7 * b10; t26 += v7 * b11; t27 += v7 * b12; t28 += v7 * b13; t29 += v7 * b14; t30 += v7 * b15; t0 += 38 * t16; t1 += 38 * t17; t22 += 38 * t18; t32 += 38 * t19; t42 += 38 * t20; t52 += 38 * t21; t62 += 38 * t222; t7 += 38 * t23; t8 += 38 * t24; t9 += 38 * t25; t10 += 38 * t26; t11 += 38 * t27; t12 += 38 * t28; t13 += 38 * t29; t14 += 38 * t30; c6 = 1; v7 = t0 + c6 + 65535; c6 = Math.floor(v7 / 65536); t0 = v7 - c6 * 65536; v7 = t1 + c6 + 65535; c6 = Math.floor(v7 / 65536); t1 = v7 - c6 * 65536; v7 = t22 + c6 + 65535; c6 = Math.floor(v7 / 65536); t22 = v7 - c6 * 65536; v7 = t32 + c6 + 65535; c6 = Math.floor(v7 / 65536); t32 = v7 - c6 * 65536; v7 = t42 + c6 + 65535; c6 = Math.floor(v7 / 65536); t42 = v7 - c6 * 65536; v7 = t52 + c6 + 65535; c6 = Math.floor(v7 / 65536); t52 = v7 - c6 * 65536; v7 = t62 + c6 + 65535; c6 = Math.floor(v7 / 65536); t62 = v7 - c6 * 65536; v7 = t7 + c6 + 65535; c6 = Math.floor(v7 / 65536); t7 = v7 - c6 * 65536; v7 = t8 + c6 + 65535; c6 = Math.floor(v7 / 65536); t8 = v7 - c6 * 65536; v7 = t9 + c6 + 65535; c6 = Math.floor(v7 / 65536); t9 = v7 - c6 * 65536; v7 = t10 + c6 + 65535; c6 = Math.floor(v7 / 65536); t10 = v7 - c6 * 65536; v7 = t11 + c6 + 65535; c6 = Math.floor(v7 / 65536); t11 = v7 - c6 * 65536; v7 = t12 + c6 + 65535; c6 = Math.floor(v7 / 65536); t12 = v7 - c6 * 65536; v7 = t13 + c6 + 65535; c6 = Math.floor(v7 / 65536); t13 = v7 - c6 * 65536; v7 = t14 + c6 + 65535; c6 = Math.floor(v7 / 65536); t14 = v7 - c6 * 65536; v7 = t15 + c6 + 65535; c6 = Math.floor(v7 / 65536); t15 = v7 - c6 * 65536; t0 += c6 - 1 + 37 * (c6 - 1); c6 = 1; v7 = t0 + c6 + 65535; c6 = Math.floor(v7 / 65536); t0 = v7 - c6 * 65536; v7 = t1 + c6 + 65535; c6 = Math.floor(v7 / 65536); t1 = v7 - c6 * 65536; v7 = t22 + c6 + 65535; c6 = Math.floor(v7 / 65536); t22 = v7 - c6 * 65536; v7 = t32 + c6 + 65535; c6 = Math.floor(v7 / 65536); t32 = v7 - c6 * 65536; v7 = t42 + c6 + 65535; c6 = Math.floor(v7 / 65536); t42 = v7 - c6 * 65536; v7 = t52 + c6 + 65535; c6 = Math.floor(v7 / 65536); t52 = v7 - c6 * 65536; v7 = t62 + c6 + 65535; c6 = Math.floor(v7 / 65536); t62 = v7 - c6 * 65536; v7 = t7 + c6 + 65535; c6 = Math.floor(v7 / 65536); t7 = v7 - c6 * 65536; v7 = t8 + c6 + 65535; c6 = Math.floor(v7 / 65536); t8 = v7 - c6 * 65536; v7 = t9 + c6 + 65535; c6 = Math.floor(v7 / 65536); t9 = v7 - c6 * 65536; v7 = t10 + c6 + 65535; c6 = Math.floor(v7 / 65536); t10 = v7 - c6 * 65536; v7 = t11 + c6 + 65535; c6 = Math.floor(v7 / 65536); t11 = v7 - c6 * 65536; v7 = t12 + c6 + 65535; c6 = Math.floor(v7 / 65536); t12 = v7 - c6 * 65536; v7 = t13 + c6 + 65535; c6 = Math.floor(v7 / 65536); t13 = v7 - c6 * 65536; v7 = t14 + c6 + 65535; c6 = Math.floor(v7 / 65536); t14 = v7 - c6 * 65536; v7 = t15 + c6 + 65535; c6 = Math.floor(v7 / 65536); t15 = v7 - c6 * 65536; t0 += c6 - 1 + 37 * (c6 - 1); o5[0] = t0; o5[1] = t1; o5[2] = t22; o5[3] = t32; o5[4] = t42; o5[5] = t52; o5[6] = t62; o5[7] = t7; o5[8] = t8; o5[9] = t9; o5[10] = t10; o5[11] = t11; o5[12] = t12; o5[13] = t13; o5[14] = t14; o5[15] = t15; } __name(M3, "M"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/kem.js var require_kem = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/kem.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_util10(); require_random2(); require_jsbn(); module3.exports = forge.kem = forge.kem || {}; var BigInteger = forge.jsbn.BigInteger; forge.kem.rsa = {}; forge.kem.rsa.create = function(kdf, options32) { options32 = options32 || {}; var prng = options32.prng || forge.random; var kem = {}; kem.encrypt = function(publicKey, keyLength) { var byteLength = Math.ceil(publicKey.n.bitLength() / 8); var r7; do { r7 = new BigInteger( forge.util.bytesToHex(prng.getBytesSync(byteLength)), 16 ).mod(publicKey.n); } while (r7.compareTo(BigInteger.ONE) <= 0); r7 = forge.util.hexToBytes(r7.toString(16)); var zeros = byteLength - r7.length; if (zeros > 0) { r7 = forge.util.fillString(String.fromCharCode(0), zeros) + r7; } var encapsulation = publicKey.encrypt(r7, "NONE"); var key = kdf.generate(r7, keyLength); return { encapsulation, key }; }; kem.decrypt = function(privateKey, encapsulation, keyLength) { var r7 = privateKey.decrypt(encapsulation, "NONE"); return kdf.generate(r7, keyLength); }; return kem; }; forge.kem.kdf1 = function(md, digestLength) { _createKDF(this, md, 0, digestLength || md.digestLength); }; forge.kem.kdf2 = function(md, digestLength) { _createKDF(this, md, 1, digestLength || md.digestLength); }; function _createKDF(kdf, md, counterStart, digestLength) { kdf.generate = function(x6, length) { var key = new forge.util.ByteBuffer(); var k6 = Math.ceil(length / digestLength) + counterStart; var c6 = new forge.util.ByteBuffer(); for (var i5 = counterStart; i5 < k6; ++i5) { c6.putInt32(i5); md.start(); md.update(x6 + c6.getBytes()); var hash = md.digest(); key.putBytes(hash.getBytes(digestLength)); } key.truncate(key.length() - length); return key.getBytes(); }; } __name(_createKDF, "_createKDF"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/log.js var require_log = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/log.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_util10(); module3.exports = forge.log = forge.log || {}; forge.log.levels = [ "none", "error", "warning", "info", "debug", "verbose", "max" ]; var sLevelInfo = {}; var sLoggers = []; var sConsoleLogger = null; forge.log.LEVEL_LOCKED = 1 << 1; forge.log.NO_LEVEL_CHECK = 1 << 2; forge.log.INTERPOLATE = 1 << 3; for (i5 = 0; i5 < forge.log.levels.length; ++i5) { level = forge.log.levels[i5]; sLevelInfo[level] = { index: i5, name: level.toUpperCase() }; } var level; var i5; forge.log.logMessage = function(message) { var messageLevelIndex = sLevelInfo[message.level].index; for (var i6 = 0; i6 < sLoggers.length; ++i6) { var logger5 = sLoggers[i6]; if (logger5.flags & forge.log.NO_LEVEL_CHECK) { logger5.f(message); } else { var loggerLevelIndex = sLevelInfo[logger5.level].index; if (messageLevelIndex <= loggerLevelIndex) { logger5.f(logger5, message); } } } }; forge.log.prepareStandard = function(message) { if (!("standard" in message)) { message.standard = sLevelInfo[message.level].name + //' ' + +message.timestamp + " [" + message.category + "] " + message.message; } }; forge.log.prepareFull = function(message) { if (!("full" in message)) { var args = [message.message]; args = args.concat([]); message.full = forge.util.format.apply(this, args); } }; forge.log.prepareStandardFull = function(message) { if (!("standardFull" in message)) { forge.log.prepareStandard(message); message.standardFull = message.standard; } }; if (true) { levels = ["error", "warning", "info", "debug", "verbose"]; for (i5 = 0; i5 < levels.length; ++i5) { (function(level2) { forge.log[level2] = function(category, message) { var args = Array.prototype.slice.call(arguments).slice(2); var msg = { timestamp: /* @__PURE__ */ new Date(), level: level2, category, message, "arguments": args /*standard*/ /*full*/ /*fullMessage*/ }; forge.log.logMessage(msg); }; })(levels[i5]); } } var levels; var i5; forge.log.makeLogger = function(logFunction) { var logger5 = { flags: 0, f: logFunction }; forge.log.setLevel(logger5, "none"); return logger5; }; forge.log.setLevel = function(logger5, level2) { var rval = false; if (logger5 && !(logger5.flags & forge.log.LEVEL_LOCKED)) { for (var i6 = 0; i6 < forge.log.levels.length; ++i6) { var aValidLevel = forge.log.levels[i6]; if (level2 == aValidLevel) { logger5.level = level2; rval = true; break; } } } return rval; }; forge.log.lock = function(logger5, lock2) { if (typeof lock2 === "undefined" || lock2) { logger5.flags |= forge.log.LEVEL_LOCKED; } else { logger5.flags &= ~forge.log.LEVEL_LOCKED; } }; forge.log.addLogger = function(logger5) { sLoggers.push(logger5); }; if (typeof console !== "undefined" && "log" in console) { if (console.error && console.warn && console.info && console.debug) { levelHandlers = { error: console.error, warning: console.warn, info: console.info, debug: console.debug, verbose: console.debug }; f5 = /* @__PURE__ */ __name(function(logger5, message) { forge.log.prepareStandard(message); var handler31 = levelHandlers[message.level]; var args = [message.standard]; args = args.concat(message["arguments"].slice()); handler31.apply(console, args); }, "f"); logger4 = forge.log.makeLogger(f5); } else { f5 = /* @__PURE__ */ __name(function(logger5, message) { forge.log.prepareStandardFull(message); console.log(message.standardFull); }, "f"); logger4 = forge.log.makeLogger(f5); } forge.log.setLevel(logger4, "debug"); forge.log.addLogger(logger4); sConsoleLogger = logger4; } else { console = { log: function() { } }; } var logger4; var levelHandlers; var f5; if (sConsoleLogger !== null && typeof window !== "undefined" && window.location) { query = new URL(window.location.href).searchParams; if (query.has("console.level")) { forge.log.setLevel( sConsoleLogger, query.get("console.level").slice(-1)[0] ); } if (query.has("console.lock")) { lock = query.get("console.lock").slice(-1)[0]; if (lock == "true") { forge.log.lock(sConsoleLogger); } } } var query; var lock; forge.log.consoleLogger = sConsoleLogger; } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/md.all.js var require_md_all = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/md.all.js"(exports2, module3) { init_import_meta_url(); module3.exports = require_md(); require_md5(); require_sha1(); require_sha256(); require_sha512(); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pkcs7.js var require_pkcs7 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/pkcs7.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_aes(); require_asn1(); require_des(); require_oids(); require_pem(); require_pkcs7asn1(); require_random2(); require_util10(); require_x509(); var asn1 = forge.asn1; var p7 = module3.exports = forge.pkcs7 = forge.pkcs7 || {}; p7.messageFromPem = function(pem) { var msg = forge.pem.decode(pem)[0]; if (msg.type !== "PKCS7") { var error2 = new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".'); error2.headerType = msg.type; throw error2; } if (msg.procType && msg.procType.type === "ENCRYPTED") { throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted."); } var obj = asn1.fromDer(msg.body); return p7.messageFromAsn1(obj); }; p7.messageToPem = function(msg, maxline) { var pemObj = { type: "PKCS7", body: asn1.toDer(msg.toAsn1()).getBytes() }; return forge.pem.encode(pemObj, { maxline }); }; p7.messageFromAsn1 = function(obj) { var capture = {}; var errors = []; if (!asn1.validate(obj, p7.asn1.contentInfoValidator, capture, errors)) { var error2 = new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo."); error2.errors = errors; throw error2; } var contentType = asn1.derToOid(capture.contentType); var msg; switch (contentType) { case forge.pki.oids.envelopedData: msg = p7.createEnvelopedData(); break; case forge.pki.oids.encryptedData: msg = p7.createEncryptedData(); break; case forge.pki.oids.signedData: msg = p7.createSignedData(); break; default: throw new Error("Cannot read PKCS#7 message. ContentType with OID " + contentType + " is not (yet) supported."); } msg.fromAsn1(capture.content.value[0]); return msg; }; p7.createSignedData = function() { var msg = null; msg = { type: forge.pki.oids.signedData, version: 1, certificates: [], crls: [], // TODO: add json-formatted signer stuff here? signers: [], // populated during sign() digestAlgorithmIdentifiers: [], contentInfo: null, signerInfos: [], fromAsn1: function(obj) { _fromAsn1(msg, obj, p7.asn1.signedDataValidator); msg.certificates = []; msg.crls = []; msg.digestAlgorithmIdentifiers = []; msg.contentInfo = null; msg.signerInfos = []; if (msg.rawCapture.certificates) { var certs = msg.rawCapture.certificates.value; for (var i5 = 0; i5 < certs.length; ++i5) { msg.certificates.push(forge.pki.certificateFromAsn1(certs[i5])); } } }, toAsn1: function() { if (!msg.contentInfo) { msg.sign(); } var certs = []; for (var i5 = 0; i5 < msg.certificates.length; ++i5) { certs.push(forge.pki.certificateToAsn1(msg.certificates[i5])); } var crls = []; var signedData = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // Version asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(msg.version).getBytes() ), // DigestAlgorithmIdentifiers asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SET, true, msg.digestAlgorithmIdentifiers ), // ContentInfo msg.contentInfo ]) ]); if (certs.length > 0) { signedData.value[0].value.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, certs) ); } if (crls.length > 0) { signedData.value[0].value.push( asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, crls) ); } signedData.value[0].value.push( asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SET, true, msg.signerInfos ) ); return asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // ContentType asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(msg.type).getBytes() ), // [0] SignedData signedData ] ); }, /** * Add (another) entity to list of signers. * * Note: If authenticatedAttributes are provided, then, per RFC 2315, * they must include at least two attributes: content type and * message digest. The message digest attribute value will be * auto-calculated during signing and will be ignored if provided. * * Here's an example of providing these two attributes: * * forge.pkcs7.createSignedData(); * p7.addSigner({ * issuer: cert.issuer.attributes, * serialNumber: cert.serialNumber, * key: privateKey, * digestAlgorithm: forge.pki.oids.sha1, * authenticatedAttributes: [{ * type: forge.pki.oids.contentType, * value: forge.pki.oids.data * }, { * type: forge.pki.oids.messageDigest * }] * }); * * TODO: Support [subjectKeyIdentifier] as signer's ID. * * @param signer the signer information: * key the signer's private key. * [certificate] a certificate containing the public key * associated with the signer's private key; use this option as * an alternative to specifying signer.issuer and * signer.serialNumber. * [issuer] the issuer attributes (eg: cert.issuer.attributes). * [serialNumber] the signer's certificate's serial number in * hexadecimal (eg: cert.serialNumber). * [digestAlgorithm] the message digest OID, as a string, to use * (eg: forge.pki.oids.sha1). * [authenticatedAttributes] an optional array of attributes * to also sign along with the content. */ addSigner: function(signer) { var issuer = signer.issuer; var serialNumber = signer.serialNumber; if (signer.certificate) { var cert = signer.certificate; if (typeof cert === "string") { cert = forge.pki.certificateFromPem(cert); } issuer = cert.issuer.attributes; serialNumber = cert.serialNumber; } var key = signer.key; if (!key) { throw new Error( "Could not add PKCS#7 signer; no private key specified." ); } if (typeof key === "string") { key = forge.pki.privateKeyFromPem(key); } var digestAlgorithm = signer.digestAlgorithm || forge.pki.oids.sha1; switch (digestAlgorithm) { case forge.pki.oids.sha1: case forge.pki.oids.sha256: case forge.pki.oids.sha384: case forge.pki.oids.sha512: case forge.pki.oids.md5: break; default: throw new Error( "Could not add PKCS#7 signer; unknown message digest algorithm: " + digestAlgorithm ); } var authenticatedAttributes = signer.authenticatedAttributes || []; if (authenticatedAttributes.length > 0) { var contentType = false; var messageDigest = false; for (var i5 = 0; i5 < authenticatedAttributes.length; ++i5) { var attr = authenticatedAttributes[i5]; if (!contentType && attr.type === forge.pki.oids.contentType) { contentType = true; if (messageDigest) { break; } continue; } if (!messageDigest && attr.type === forge.pki.oids.messageDigest) { messageDigest = true; if (contentType) { break; } continue; } } if (!contentType || !messageDigest) { throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest."); } } msg.signers.push({ key, version: 1, issuer, serialNumber, digestAlgorithm, signatureAlgorithm: forge.pki.oids.rsaEncryption, signature: null, authenticatedAttributes, unauthenticatedAttributes: [] }); }, /** * Signs the content. * @param options Options to apply when signing: * [detached] boolean. If signing should be done in detached mode. Defaults to false. */ sign: function(options32) { options32 = options32 || {}; if (typeof msg.content !== "object" || msg.contentInfo === null) { msg.contentInfo = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // ContentType asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(forge.pki.oids.data).getBytes() ) ] ); if ("content" in msg) { var content; if (msg.content instanceof forge.util.ByteBuffer) { content = msg.content.bytes(); } else if (typeof msg.content === "string") { content = forge.util.encodeUtf8(msg.content); } if (options32.detached) { msg.detachedContent = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, content); } else { msg.contentInfo.value.push( // [0] EXPLICIT content asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, content ) ]) ); } } } if (msg.signers.length === 0) { return; } var mds = addDigestAlgorithmIds(); addSignerInfos(mds); }, verify: function() { throw new Error("PKCS#7 signature verification not yet implemented."); }, /** * Add a certificate. * * @param cert the certificate to add. */ addCertificate: function(cert) { if (typeof cert === "string") { cert = forge.pki.certificateFromPem(cert); } msg.certificates.push(cert); }, /** * Add a certificate revokation list. * * @param crl the certificate revokation list to add. */ addCertificateRevokationList: function(crl) { throw new Error("PKCS#7 CRL support not yet implemented."); } }; return msg; function addDigestAlgorithmIds() { var mds = {}; for (var i5 = 0; i5 < msg.signers.length; ++i5) { var signer = msg.signers[i5]; var oid = signer.digestAlgorithm; if (!(oid in mds)) { mds[oid] = forge.md[forge.pki.oids[oid]].create(); } if (signer.authenticatedAttributes.length === 0) { signer.md = mds[oid]; } else { signer.md = forge.md[forge.pki.oids[oid]].create(); } } msg.digestAlgorithmIdentifiers = []; for (var oid in mds) { msg.digestAlgorithmIdentifiers.push( // AlgorithmIdentifier asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(oid).getBytes() ), // parameters (null) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") ]) ); } return mds; } __name(addDigestAlgorithmIds, "addDigestAlgorithmIds"); function addSignerInfos(mds) { var content; if (msg.detachedContent) { content = msg.detachedContent; } else { content = msg.contentInfo.value[1]; content = content.value[0]; } if (!content) { throw new Error( "Could not sign PKCS#7 message; there is no content to sign." ); } var contentType = asn1.derToOid(msg.contentInfo.value[0].value); var bytes = asn1.toDer(content); bytes.getByte(); asn1.getBerValueLength(bytes); bytes = bytes.getBytes(); for (var oid in mds) { mds[oid].start().update(bytes); } var signingTime = /* @__PURE__ */ new Date(); for (var i5 = 0; i5 < msg.signers.length; ++i5) { var signer = msg.signers[i5]; if (signer.authenticatedAttributes.length === 0) { if (contentType !== forge.pki.oids.data) { throw new Error( "Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data." ); } } else { signer.authenticatedAttributesAsn1 = asn1.create( asn1.Class.CONTEXT_SPECIFIC, 0, true, [] ); var attrsAsn1 = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SET, true, [] ); for (var ai3 = 0; ai3 < signer.authenticatedAttributes.length; ++ai3) { var attr = signer.authenticatedAttributes[ai3]; if (attr.type === forge.pki.oids.messageDigest) { attr.value = mds[signer.digestAlgorithm].digest(); } else if (attr.type === forge.pki.oids.signingTime) { if (!attr.value) { attr.value = signingTime; } } attrsAsn1.value.push(_attributeToAsn1(attr)); signer.authenticatedAttributesAsn1.value.push(_attributeToAsn1(attr)); } bytes = asn1.toDer(attrsAsn1).getBytes(); signer.md.start().update(bytes); } signer.signature = signer.key.sign(signer.md, "RSASSA-PKCS1-V1_5"); } msg.signerInfos = _signersToAsn1(msg.signers); } __name(addSignerInfos, "addSignerInfos"); }; p7.createEncryptedData = function() { var msg = null; msg = { type: forge.pki.oids.encryptedData, version: 0, encryptedContent: { algorithm: forge.pki.oids["aes256-CBC"] }, /** * Reads an EncryptedData content block (in ASN.1 format) * * @param obj The ASN.1 representation of the EncryptedData content block */ fromAsn1: function(obj) { _fromAsn1(msg, obj, p7.asn1.encryptedDataValidator); }, /** * Decrypt encrypted content * * @param key The (symmetric) key as a byte buffer */ decrypt: function(key) { if (key !== void 0) { msg.encryptedContent.key = key; } _decryptContent(msg); } }; return msg; }; p7.createEnvelopedData = function() { var msg = null; msg = { type: forge.pki.oids.envelopedData, version: 0, recipients: [], encryptedContent: { algorithm: forge.pki.oids["aes256-CBC"] }, /** * Reads an EnvelopedData content block (in ASN.1 format) * * @param obj the ASN.1 representation of the EnvelopedData content block. */ fromAsn1: function(obj) { var capture = _fromAsn1(msg, obj, p7.asn1.envelopedDataValidator); msg.recipients = _recipientsFromAsn1(capture.recipientInfos.value); }, toAsn1: function() { return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // ContentType asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(msg.type).getBytes() ), // [0] EnvelopedData asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // Version asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(msg.version).getBytes() ), // RecipientInfos asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SET, true, _recipientsToAsn1(msg.recipients) ), // EncryptedContentInfo asn1.create( asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, _encryptedContentToAsn1(msg.encryptedContent) ) ]) ]) ]); }, /** * Find recipient by X.509 certificate's issuer. * * @param cert the certificate with the issuer to look for. * * @return the recipient object. */ findRecipient: function(cert) { var sAttr = cert.issuer.attributes; for (var i5 = 0; i5 < msg.recipients.length; ++i5) { var r7 = msg.recipients[i5]; var rAttr = r7.issuer; if (r7.serialNumber !== cert.serialNumber) { continue; } if (rAttr.length !== sAttr.length) { continue; } var match2 = true; for (var j6 = 0; j6 < sAttr.length; ++j6) { if (rAttr[j6].type !== sAttr[j6].type || rAttr[j6].value !== sAttr[j6].value) { match2 = false; break; } } if (match2) { return r7; } } return null; }, /** * Decrypt enveloped content * * @param recipient The recipient object related to the private key * @param privKey The (RSA) private key object */ decrypt: function(recipient, privKey) { if (msg.encryptedContent.key === void 0 && recipient !== void 0 && privKey !== void 0) { switch (recipient.encryptedContent.algorithm) { case forge.pki.oids.rsaEncryption: case forge.pki.oids.desCBC: var key = privKey.decrypt(recipient.encryptedContent.content); msg.encryptedContent.key = forge.util.createBuffer(key); break; default: throw new Error("Unsupported asymmetric cipher, OID " + recipient.encryptedContent.algorithm); } } _decryptContent(msg); }, /** * Add (another) entity to list of recipients. * * @param cert The certificate of the entity to add. */ addRecipient: function(cert) { msg.recipients.push({ version: 0, issuer: cert.issuer.attributes, serialNumber: cert.serialNumber, encryptedContent: { // We simply assume rsaEncryption here, since forge.pki only // supports RSA so far. If the PKI module supports other // ciphers one day, we need to modify this one as well. algorithm: forge.pki.oids.rsaEncryption, key: cert.publicKey } }); }, /** * Encrypt enveloped content. * * This function supports two optional arguments, cipher and key, which * can be used to influence symmetric encryption. Unless cipher is * provided, the cipher specified in encryptedContent.algorithm is used * (defaults to AES-256-CBC). If no key is provided, encryptedContent.key * is (re-)used. If that one's not set, a random key will be generated * automatically. * * @param [key] The key to be used for symmetric encryption. * @param [cipher] The OID of the symmetric cipher to use. */ encrypt: function(key, cipher) { if (msg.encryptedContent.content === void 0) { cipher = cipher || msg.encryptedContent.algorithm; key = key || msg.encryptedContent.key; var keyLen, ivLen, ciphFn; switch (cipher) { case forge.pki.oids["aes128-CBC"]: keyLen = 16; ivLen = 16; ciphFn = forge.aes.createEncryptionCipher; break; case forge.pki.oids["aes192-CBC"]: keyLen = 24; ivLen = 16; ciphFn = forge.aes.createEncryptionCipher; break; case forge.pki.oids["aes256-CBC"]: keyLen = 32; ivLen = 16; ciphFn = forge.aes.createEncryptionCipher; break; case forge.pki.oids["des-EDE3-CBC"]: keyLen = 24; ivLen = 8; ciphFn = forge.des.createEncryptionCipher; break; default: throw new Error("Unsupported symmetric cipher, OID " + cipher); } if (key === void 0) { key = forge.util.createBuffer(forge.random.getBytes(keyLen)); } else if (key.length() != keyLen) { throw new Error("Symmetric key has wrong length; got " + key.length() + " bytes, expected " + keyLen + "."); } msg.encryptedContent.algorithm = cipher; msg.encryptedContent.key = key; msg.encryptedContent.parameter = forge.util.createBuffer( forge.random.getBytes(ivLen) ); var ciph = ciphFn(key); ciph.start(msg.encryptedContent.parameter.copy()); ciph.update(msg.content); if (!ciph.finish()) { throw new Error("Symmetric encryption failed."); } msg.encryptedContent.content = ciph.output; } for (var i5 = 0; i5 < msg.recipients.length; ++i5) { var recipient = msg.recipients[i5]; if (recipient.encryptedContent.content !== void 0) { continue; } switch (recipient.encryptedContent.algorithm) { case forge.pki.oids.rsaEncryption: recipient.encryptedContent.content = recipient.encryptedContent.key.encrypt( msg.encryptedContent.key.data ); break; default: throw new Error("Unsupported asymmetric cipher, OID " + recipient.encryptedContent.algorithm); } } } }; return msg; }; function _recipientFromAsn1(obj) { var capture = {}; var errors = []; if (!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) { var error2 = new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo."); error2.errors = errors; throw error2; } return { version: capture.version.charCodeAt(0), issuer: forge.pki.RDNAttributesAsArray(capture.issuer), serialNumber: forge.util.createBuffer(capture.serial).toHex(), encryptedContent: { algorithm: asn1.derToOid(capture.encAlgorithm), parameter: capture.encParameter ? capture.encParameter.value : void 0, content: capture.encKey } }; } __name(_recipientFromAsn1, "_recipientFromAsn1"); function _recipientToAsn1(obj) { return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // Version asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(obj.version).getBytes() ), // IssuerAndSerialNumber asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // Name forge.pki.distinguishedNameToAsn1({ attributes: obj.issuer }), // Serial asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, forge.util.hexToBytes(obj.serialNumber) ) ]), // KeyEncryptionAlgorithmIdentifier asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // Algorithm asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(obj.encryptedContent.algorithm).getBytes() ), // Parameter, force NULL, only RSA supported for now. asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") ]), // EncryptedKey asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.encryptedContent.content ) ]); } __name(_recipientToAsn1, "_recipientToAsn1"); function _recipientsFromAsn1(infos) { var ret = []; for (var i5 = 0; i5 < infos.length; ++i5) { ret.push(_recipientFromAsn1(infos[i5])); } return ret; } __name(_recipientsFromAsn1, "_recipientsFromAsn1"); function _recipientsToAsn1(recipients) { var ret = []; for (var i5 = 0; i5 < recipients.length; ++i5) { ret.push(_recipientToAsn1(recipients[i5])); } return ret; } __name(_recipientsToAsn1, "_recipientsToAsn1"); function _signerToAsn1(obj) { var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // version asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, asn1.integerToDer(obj.version).getBytes() ), // issuerAndSerialNumber asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // name forge.pki.distinguishedNameToAsn1({ attributes: obj.issuer }), // serial asn1.create( asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, forge.util.hexToBytes(obj.serialNumber) ) ]), // digestAlgorithm asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(obj.digestAlgorithm).getBytes() ), // parameters (null) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") ]) ]); if (obj.authenticatedAttributesAsn1) { rval.value.push(obj.authenticatedAttributesAsn1); } rval.value.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // algorithm asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(obj.signatureAlgorithm).getBytes() ), // parameters (null) asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, "") ])); rval.value.push(asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.signature )); if (obj.unauthenticatedAttributes.length > 0) { var attrsAsn1 = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, []); for (var i5 = 0; i5 < obj.unauthenticatedAttributes.length; ++i5) { var attr = obj.unauthenticatedAttributes[i5]; attrsAsn1.values.push(_attributeToAsn1(attr)); } rval.value.push(attrsAsn1); } return rval; } __name(_signerToAsn1, "_signerToAsn1"); function _signersToAsn1(signers) { var ret = []; for (var i5 = 0; i5 < signers.length; ++i5) { ret.push(_signerToAsn1(signers[i5])); } return ret; } __name(_signersToAsn1, "_signersToAsn1"); function _attributeToAsn1(attr) { var value; if (attr.type === forge.pki.oids.contentType) { value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(attr.value).getBytes() ); } else if (attr.type === forge.pki.oids.messageDigest) { value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, attr.value.bytes() ); } else if (attr.type === forge.pki.oids.signingTime) { var jan_1_1950 = /* @__PURE__ */ new Date("1950-01-01T00:00:00Z"); var jan_1_2050 = /* @__PURE__ */ new Date("2050-01-01T00:00:00Z"); var date = attr.value; if (typeof date === "string") { var timestamp = Date.parse(date); if (!isNaN(timestamp)) { date = new Date(timestamp); } else if (date.length === 13) { date = asn1.utcTimeToDate(date); } else { date = asn1.generalizedTimeToDate(date); } } if (date >= jan_1_1950 && date < jan_1_2050) { value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false, asn1.dateToUtcTime(date) ); } else { value = asn1.create( asn1.Class.UNIVERSAL, asn1.Type.GENERALIZEDTIME, false, asn1.dateToGeneralizedTime(date) ); } } return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // AttributeType asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(attr.type).getBytes() ), asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ // AttributeValue value ]) ]); } __name(_attributeToAsn1, "_attributeToAsn1"); function _encryptedContentToAsn1(ec) { return [ // ContentType, always Data for the moment asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(forge.pki.oids.data).getBytes() ), // ContentEncryptionAlgorithmIdentifier asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ // Algorithm asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OID, false, asn1.oidToDer(ec.algorithm).getBytes() ), // Parameters (IV) !ec.parameter ? void 0 : asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, ec.parameter.getBytes() ) ]), // [0] EncryptedContent asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ asn1.create( asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, ec.content.getBytes() ) ]) ]; } __name(_encryptedContentToAsn1, "_encryptedContentToAsn1"); function _fromAsn1(msg, obj, validator) { var capture = {}; var errors = []; if (!asn1.validate(obj, validator, capture, errors)) { var error2 = new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message."); error2.errors = error2; throw error2; } var contentType = asn1.derToOid(capture.contentType); if (contentType !== forge.pki.oids.data) { throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported."); } if (capture.encryptedContent) { var content = ""; if (forge.util.isArray(capture.encryptedContent)) { for (var i5 = 0; i5 < capture.encryptedContent.length; ++i5) { if (capture.encryptedContent[i5].type !== asn1.Type.OCTETSTRING) { throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects."); } content += capture.encryptedContent[i5].value; } } else { content = capture.encryptedContent; } msg.encryptedContent = { algorithm: asn1.derToOid(capture.encAlgorithm), parameter: forge.util.createBuffer(capture.encParameter.value), content: forge.util.createBuffer(content) }; } if (capture.content) { var content = ""; if (forge.util.isArray(capture.content)) { for (var i5 = 0; i5 < capture.content.length; ++i5) { if (capture.content[i5].type !== asn1.Type.OCTETSTRING) { throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects."); } content += capture.content[i5].value; } } else { content = capture.content; } msg.content = forge.util.createBuffer(content); } msg.version = capture.version.charCodeAt(0); msg.rawCapture = capture; return capture; } __name(_fromAsn1, "_fromAsn1"); function _decryptContent(msg) { if (msg.encryptedContent.key === void 0) { throw new Error("Symmetric key not available."); } if (msg.content === void 0) { var ciph; switch (msg.encryptedContent.algorithm) { case forge.pki.oids["aes128-CBC"]: case forge.pki.oids["aes192-CBC"]: case forge.pki.oids["aes256-CBC"]: ciph = forge.aes.createDecryptionCipher(msg.encryptedContent.key); break; case forge.pki.oids["desCBC"]: case forge.pki.oids["des-EDE3-CBC"]: ciph = forge.des.createDecryptionCipher(msg.encryptedContent.key); break; default: throw new Error("Unsupported symmetric cipher, OID " + msg.encryptedContent.algorithm); } ciph.start(msg.encryptedContent.parameter); ciph.update(msg.encryptedContent.content); if (!ciph.finish()) { throw new Error("Symmetric decryption failed."); } msg.content = ciph.output; } } __name(_decryptContent, "_decryptContent"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/ssh.js var require_ssh = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/ssh.js"(exports2, module3) { init_import_meta_url(); var forge = require_forge(); require_aes(); require_hmac(); require_md5(); require_sha1(); require_util10(); var ssh = module3.exports = forge.ssh = forge.ssh || {}; ssh.privateKeyToPutty = function(privateKey, passphrase, comment) { comment = comment || ""; passphrase = passphrase || ""; var algorithm = "ssh-rsa"; var encryptionAlgorithm = passphrase === "" ? "none" : "aes256-cbc"; var ppk = "PuTTY-User-Key-File-2: " + algorithm + "\r\n"; ppk += "Encryption: " + encryptionAlgorithm + "\r\n"; ppk += "Comment: " + comment + "\r\n"; var pubbuffer = forge.util.createBuffer(); _addStringToBuffer(pubbuffer, algorithm); _addBigIntegerToBuffer(pubbuffer, privateKey.e); _addBigIntegerToBuffer(pubbuffer, privateKey.n); var pub = forge.util.encode64(pubbuffer.bytes(), 64); var length = Math.floor(pub.length / 66) + 1; ppk += "Public-Lines: " + length + "\r\n"; ppk += pub; var privbuffer = forge.util.createBuffer(); _addBigIntegerToBuffer(privbuffer, privateKey.d); _addBigIntegerToBuffer(privbuffer, privateKey.p); _addBigIntegerToBuffer(privbuffer, privateKey.q); _addBigIntegerToBuffer(privbuffer, privateKey.qInv); var priv; if (!passphrase) { priv = forge.util.encode64(privbuffer.bytes(), 64); } else { var encLen = privbuffer.length() + 16 - 1; encLen -= encLen % 16; var padding = _sha1(privbuffer.bytes()); padding.truncate(padding.length() - encLen + privbuffer.length()); privbuffer.putBuffer(padding); var aeskey = forge.util.createBuffer(); aeskey.putBuffer(_sha1("\0\0\0\0", passphrase)); aeskey.putBuffer(_sha1("\0\0\0", passphrase)); var cipher = forge.aes.createEncryptionCipher(aeskey.truncate(8), "CBC"); cipher.start(forge.util.createBuffer().fillWithByte(0, 16)); cipher.update(privbuffer.copy()); cipher.finish(); var encrypted = cipher.output; encrypted.truncate(16); priv = forge.util.encode64(encrypted.bytes(), 64); } length = Math.floor(priv.length / 66) + 1; ppk += "\r\nPrivate-Lines: " + length + "\r\n"; ppk += priv; var mackey = _sha1("putty-private-key-file-mac-key", passphrase); var macbuffer = forge.util.createBuffer(); _addStringToBuffer(macbuffer, algorithm); _addStringToBuffer(macbuffer, encryptionAlgorithm); _addStringToBuffer(macbuffer, comment); macbuffer.putInt32(pubbuffer.length()); macbuffer.putBuffer(pubbuffer); macbuffer.putInt32(privbuffer.length()); macbuffer.putBuffer(privbuffer); var hmac2 = forge.hmac.create(); hmac2.start("sha1", mackey); hmac2.update(macbuffer.bytes()); ppk += "\r\nPrivate-MAC: " + hmac2.digest().toHex() + "\r\n"; return ppk; }; ssh.publicKeyToOpenSSH = function(key, comment) { var type = "ssh-rsa"; comment = comment || ""; var buffer = forge.util.createBuffer(); _addStringToBuffer(buffer, type); _addBigIntegerToBuffer(buffer, key.e); _addBigIntegerToBuffer(buffer, key.n); return type + " " + forge.util.encode64(buffer.bytes()) + " " + comment; }; ssh.privateKeyToOpenSSH = function(privateKey, passphrase) { if (!passphrase) { return forge.pki.privateKeyToPem(privateKey); } return forge.pki.encryptRsaPrivateKey( privateKey, passphrase, { legacy: true, algorithm: "aes128" } ); }; ssh.getPublicKeyFingerprint = function(key, options32) { options32 = options32 || {}; var md = options32.md || forge.md.md5.create(); var type = "ssh-rsa"; var buffer = forge.util.createBuffer(); _addStringToBuffer(buffer, type); _addBigIntegerToBuffer(buffer, key.e); _addBigIntegerToBuffer(buffer, key.n); md.start(); md.update(buffer.getBytes()); var digest = md.digest(); if (options32.encoding === "hex") { var hex = digest.toHex(); if (options32.delimiter) { return hex.match(/.{2}/g).join(options32.delimiter); } return hex; } else if (options32.encoding === "binary") { return digest.getBytes(); } else if (options32.encoding) { throw new Error('Unknown encoding "' + options32.encoding + '".'); } return digest; }; function _addBigIntegerToBuffer(buffer, val2) { var hexVal = val2.toString(16); if (hexVal[0] >= "8") { hexVal = "00" + hexVal; } var bytes = forge.util.hexToBytes(hexVal); buffer.putInt32(bytes.length); buffer.putBytes(bytes); } __name(_addBigIntegerToBuffer, "_addBigIntegerToBuffer"); function _addStringToBuffer(buffer, val2) { buffer.putInt32(val2.length); buffer.putString(val2); } __name(_addStringToBuffer, "_addStringToBuffer"); function _sha1() { var sha = forge.md.sha1.create(); var num = arguments.length; for (var i5 = 0; i5 < num; ++i5) { sha.update(arguments[i5]); } return sha.digest(); } __name(_sha1, "_sha1"); } }); // ../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/index.js var require_lib2 = __commonJS({ "../../node_modules/.pnpm/node-forge@1.3.1/node_modules/node-forge/lib/index.js"(exports2, module3) { init_import_meta_url(); module3.exports = require_forge(); require_aes(); require_aesCipherSuites(); require_asn1(); require_cipher(); require_des(); require_ed25519(); require_hmac(); require_kem(); require_log(); require_md_all(); require_mgf1(); require_pbkdf2(); require_pem(); require_pkcs1(); require_pkcs12(); require_pkcs7(); require_pki(); require_prime(); require_prng(); require_pss(); require_random2(); require_rc2(); require_ssh(); require_tls(); require_util10(); } }); // ../../node_modules/.pnpm/selfsigned@2.1.1/node_modules/selfsigned/index.js var require_selfsigned = __commonJS({ "../../node_modules/.pnpm/selfsigned@2.1.1/node_modules/selfsigned/index.js"(exports2) { init_import_meta_url(); var forge = require_lib2(); function toPositiveHex(hexString) { var mostSiginficativeHexAsInt = parseInt(hexString[0], 16); if (mostSiginficativeHexAsInt < 8) { return hexString; } mostSiginficativeHexAsInt -= 8; return mostSiginficativeHexAsInt.toString() + hexString.substring(1); } __name(toPositiveHex, "toPositiveHex"); function getAlgorithm(key) { switch (key) { case "sha256": return forge.md.sha256.create(); default: return forge.md.sha1.create(); } } __name(getAlgorithm, "getAlgorithm"); exports2.generate = /* @__PURE__ */ __name(function generate2(attrs, options32, done) { if (typeof attrs === "function") { done = attrs; attrs = void 0; } else if (typeof options32 === "function") { done = options32; options32 = {}; } options32 = options32 || {}; var generatePem = /* @__PURE__ */ __name(function(keyPair2) { var cert = forge.pki.createCertificate(); cert.serialNumber = toPositiveHex(forge.util.bytesToHex(forge.random.getBytesSync(9))); cert.validity.notBefore = /* @__PURE__ */ new Date(); cert.validity.notAfter = /* @__PURE__ */ new Date(); cert.validity.notAfter.setDate(cert.validity.notBefore.getDate() + (options32.days || 365)); attrs = attrs || [{ name: "commonName", value: "example.org" }, { name: "countryName", value: "US" }, { shortName: "ST", value: "Virginia" }, { name: "localityName", value: "Blacksburg" }, { name: "organizationName", value: "Test" }, { shortName: "OU", value: "Test" }]; cert.setSubject(attrs); cert.setIssuer(attrs); cert.publicKey = keyPair2.publicKey; cert.setExtensions(options32.extensions || [{ name: "basicConstraints", cA: true }, { name: "keyUsage", keyCertSign: true, digitalSignature: true, nonRepudiation: true, keyEncipherment: true, dataEncipherment: true }, { name: "subjectAltName", altNames: [{ type: 6, // URI value: "http://example.org/webid#me" }] }]); cert.sign(keyPair2.privateKey, getAlgorithm(options32 && options32.algorithm)); const fingerprint = forge.md.sha1.create().update(forge.asn1.toDer(forge.pki.certificateToAsn1(cert)).getBytes()).digest().toHex().match(/.{2}/g).join(":"); var pem = { private: forge.pki.privateKeyToPem(keyPair2.privateKey), public: forge.pki.publicKeyToPem(keyPair2.publicKey), cert: forge.pki.certificateToPem(cert), fingerprint }; if (options32 && options32.pkcs7) { var p7 = forge.pkcs7.createSignedData(); p7.addCertificate(cert); pem.pkcs7 = forge.pkcs7.messageToPem(p7); } if (options32 && options32.clientCertificate) { var clientkeys = forge.pki.rsa.generateKeyPair(1024); var clientcert = forge.pki.createCertificate(); clientcert.serialNumber = toPositiveHex(forge.util.bytesToHex(forge.random.getBytesSync(9))); clientcert.validity.notBefore = /* @__PURE__ */ new Date(); clientcert.validity.notAfter = /* @__PURE__ */ new Date(); clientcert.validity.notAfter.setFullYear(clientcert.validity.notBefore.getFullYear() + 1); var clientAttrs = JSON.parse(JSON.stringify(attrs)); for (var i5 = 0; i5 < clientAttrs.length; i5++) { if (clientAttrs[i5].name === "commonName") { if (options32.clientCertificateCN) clientAttrs[i5] = { name: "commonName", value: options32.clientCertificateCN }; else clientAttrs[i5] = { name: "commonName", value: "John Doe jdoe123" }; } } clientcert.setSubject(clientAttrs); clientcert.setIssuer(attrs); clientcert.publicKey = clientkeys.publicKey; clientcert.sign(keyPair2.privateKey); pem.clientprivate = forge.pki.privateKeyToPem(clientkeys.privateKey); pem.clientpublic = forge.pki.publicKeyToPem(clientkeys.publicKey); pem.clientcert = forge.pki.certificateToPem(clientcert); if (options32.pkcs7) { var clientp7 = forge.pkcs7.createSignedData(); clientp7.addCertificate(clientcert); pem.clientpkcs7 = forge.pkcs7.messageToPem(clientp7); } } var caStore = forge.pki.createCaStore(); caStore.addCertificate(cert); try { forge.pki.verifyCertificateChain( caStore, [cert], function(vfd, depth, chain2) { if (vfd !== true) { throw new Error("Certificate could not be verified."); } return true; } ); } catch (ex) { throw new Error(ex); } return pem; }, "generatePem"); var keySize = options32.keySize || 1024; if (done) { return forge.pki.rsa.generateKeyPair({ bits: keySize }, function(err, keyPair2) { if (err) { return done(err); } try { return done(null, generatePem(keyPair2)); } catch (ex) { return done(ex); } }); } var keyPair = options32.keyPair ? { privateKey: forge.pki.privateKeyFromPem(options32.keyPair.privateKey), publicKey: forge.pki.publicKeyFromPem(options32.keyPair.publicKey) } : forge.pki.rsa.generateKeyPair(keySize); return generatePem(keyPair); }, "generate"); } }); // ../../node_modules/.pnpm/eventemitter3@4.0.7/node_modules/eventemitter3/index.js var require_eventemitter3 = __commonJS({ "../../node_modules/.pnpm/eventemitter3@4.0.7/node_modules/eventemitter3/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var has = Object.prototype.hasOwnProperty; var prefix = "~"; function Events() { } __name(Events, "Events"); if (Object.create) { Events.prototype = /* @__PURE__ */ Object.create(null); if (!new Events().__proto__) prefix = false; } function EE(fn2, context2, once) { this.fn = fn2; this.context = context2; this.once = once || false; } __name(EE, "EE"); function addListener(emitter, event, fn2, context2, once) { if (typeof fn2 !== "function") { throw new TypeError("The listener must be a function"); } var listener = new EE(fn2, context2 || emitter, once), evt = prefix ? prefix + event : event; if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); else emitter._events[evt] = [emitter._events[evt], listener]; return emitter; } __name(addListener, "addListener"); function clearEvent(emitter, evt) { if (--emitter._eventsCount === 0) emitter._events = new Events(); else delete emitter._events[evt]; } __name(clearEvent, "clearEvent"); function EventEmitter5() { this._events = new Events(); this._eventsCount = 0; } __name(EventEmitter5, "EventEmitter"); EventEmitter5.prototype.eventNames = /* @__PURE__ */ __name(function eventNames() { var names = [], events6, name2; if (this._eventsCount === 0) return names; for (name2 in events6 = this._events) { if (has.call(events6, name2)) names.push(prefix ? name2.slice(1) : name2); } if (Object.getOwnPropertySymbols) { return names.concat(Object.getOwnPropertySymbols(events6)); } return names; }, "eventNames"); EventEmitter5.prototype.listeners = /* @__PURE__ */ __name(function listeners(event) { var evt = prefix ? prefix + event : event, handlers2 = this._events[evt]; if (!handlers2) return []; if (handlers2.fn) return [handlers2.fn]; for (var i5 = 0, l6 = handlers2.length, ee = new Array(l6); i5 < l6; i5++) { ee[i5] = handlers2[i5].fn; } return ee; }, "listeners"); EventEmitter5.prototype.listenerCount = /* @__PURE__ */ __name(function listenerCount(event) { var evt = prefix ? prefix + event : event, listeners = this._events[evt]; if (!listeners) return 0; if (listeners.fn) return 1; return listeners.length; }, "listenerCount"); EventEmitter5.prototype.emit = /* @__PURE__ */ __name(function emit(event, a1, a22, a32, a42, a5) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return false; var listeners = this._events[evt], len = arguments.length, args, i5; if (listeners.fn) { if (listeners.once) this.removeListener(event, listeners.fn, void 0, true); switch (len) { case 1: return listeners.fn.call(listeners.context), true; case 2: return listeners.fn.call(listeners.context, a1), true; case 3: return listeners.fn.call(listeners.context, a1, a22), true; case 4: return listeners.fn.call(listeners.context, a1, a22, a32), true; case 5: return listeners.fn.call(listeners.context, a1, a22, a32, a42), true; case 6: return listeners.fn.call(listeners.context, a1, a22, a32, a42, a5), true; } for (i5 = 1, args = new Array(len - 1); i5 < len; i5++) { args[i5 - 1] = arguments[i5]; } listeners.fn.apply(listeners.context, args); } else { var length = listeners.length, j6; for (i5 = 0; i5 < length; i5++) { if (listeners[i5].once) this.removeListener(event, listeners[i5].fn, void 0, true); switch (len) { case 1: listeners[i5].fn.call(listeners[i5].context); break; case 2: listeners[i5].fn.call(listeners[i5].context, a1); break; case 3: listeners[i5].fn.call(listeners[i5].context, a1, a22); break; case 4: listeners[i5].fn.call(listeners[i5].context, a1, a22, a32); break; default: if (!args) for (j6 = 1, args = new Array(len - 1); j6 < len; j6++) { args[j6 - 1] = arguments[j6]; } listeners[i5].fn.apply(listeners[i5].context, args); } } } return true; }, "emit"); EventEmitter5.prototype.on = /* @__PURE__ */ __name(function on(event, fn2, context2) { return addListener(this, event, fn2, context2, false); }, "on"); EventEmitter5.prototype.once = /* @__PURE__ */ __name(function once(event, fn2, context2) { return addListener(this, event, fn2, context2, true); }, "once"); EventEmitter5.prototype.removeListener = /* @__PURE__ */ __name(function removeListener(event, fn2, context2, once) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return this; if (!fn2) { clearEvent(this, evt); return this; } var listeners = this._events[evt]; if (listeners.fn) { if (listeners.fn === fn2 && (!once || listeners.once) && (!context2 || listeners.context === context2)) { clearEvent(this, evt); } } else { for (var i5 = 0, events6 = [], length = listeners.length; i5 < length; i5++) { if (listeners[i5].fn !== fn2 || once && !listeners[i5].once || context2 && listeners[i5].context !== context2) { events6.push(listeners[i5]); } } if (events6.length) this._events[evt] = events6.length === 1 ? events6[0] : events6; else clearEvent(this, evt); } return this; }, "removeListener"); EventEmitter5.prototype.removeAllListeners = /* @__PURE__ */ __name(function removeAllListeners(event) { var evt; if (event) { evt = prefix ? prefix + event : event; if (this._events[evt]) clearEvent(this, evt); } else { this._events = new Events(); this._eventsCount = 0; } return this; }, "removeAllListeners"); EventEmitter5.prototype.off = EventEmitter5.prototype.removeListener; EventEmitter5.prototype.addListener = EventEmitter5.prototype.on; EventEmitter5.prefixed = prefix; EventEmitter5.EventEmitter = EventEmitter5; if ("undefined" !== typeof module3) { module3.exports = EventEmitter5; } } }); // ../../node_modules/.pnpm/supports-color@9.2.2/node_modules/supports-color/index.js var supports_color_exports = {}; __export(supports_color_exports, { createSupportsColor: () => createSupportsColor2, default: () => supports_color_default2 }); function hasFlag2(flag, argv = import_node_process7.default.argv) { const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; const position = argv.indexOf(prefix + flag); const terminatorPosition = argv.indexOf("--"); return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); } function envForceColor2() { if ("FORCE_COLOR" in env3) { if (env3.FORCE_COLOR === "true") { return 1; } if (env3.FORCE_COLOR === "false") { return 0; } return env3.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env3.FORCE_COLOR, 10), 3); } } function translateLevel2(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; } function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) { const noFlagForceColor = envForceColor2(); if (noFlagForceColor !== void 0) { flagForceColor2 = noFlagForceColor; } const forceColor = sniffFlags ? flagForceColor2 : noFlagForceColor; if (forceColor === 0) { return 0; } if (sniffFlags) { if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) { return 3; } if (hasFlag2("color=256")) { return 2; } } if (haveStream && !streamIsTTY && forceColor === void 0) { return 0; } const min = forceColor || 0; if (env3.TERM === "dumb") { return min; } if (import_node_process7.default.platform === "win32") { const osRelease = import_node_os5.default.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } if ("CI" in env3) { if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env3) || env3.CI_NAME === "codeship") { return 1; } return min; } if ("TEAMCITY_VERSION" in env3) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env3.TEAMCITY_VERSION) ? 1 : 0; } if ("TF_BUILD" in env3 && "AGENT_NAME" in env3) { return 1; } if (env3.COLORTERM === "truecolor") { return 3; } if ("TERM_PROGRAM" in env3) { const version4 = Number.parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env3.TERM_PROGRAM) { case "iTerm.app": return version4 >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } } if (/-256(color)?$/i.test(env3.TERM)) { return 2; } if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env3.TERM)) { return 1; } if ("COLORTERM" in env3) { return 1; } return min; } function createSupportsColor2(stream2, options32 = {}) { const level = _supportsColor2(stream2, { streamIsTTY: stream2 && stream2.isTTY, ...options32 }); return translateLevel2(level); } var import_node_process7, import_node_os5, import_node_tty3, env3, flagForceColor2, supportsColor2, supports_color_default2; var init_supports_color = __esm({ "../../node_modules/.pnpm/supports-color@9.2.2/node_modules/supports-color/index.js"() { init_import_meta_url(); import_node_process7 = __toESM(require("node:process"), 1); import_node_os5 = __toESM(require("node:os"), 1); import_node_tty3 = __toESM(require("node:tty"), 1); __name(hasFlag2, "hasFlag"); ({ env: env3 } = import_node_process7.default); if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) { flagForceColor2 = 0; } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) { flagForceColor2 = 1; } __name(envForceColor2, "envForceColor"); __name(translateLevel2, "translateLevel"); __name(_supportsColor2, "_supportsColor"); __name(createSupportsColor2, "createSupportsColor"); supportsColor2 = { stdout: createSupportsColor2({ isTTY: import_node_tty3.default.isatty(1) }), stderr: createSupportsColor2({ isTTY: import_node_tty3.default.isatty(2) }) }; supports_color_default2 = supportsColor2; } }); // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js var require_windows = __commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports2, module3) { init_import_meta_url(); module3.exports = isexe; isexe.sync = sync; var fs27 = require("fs"); function checkPathExt(path72, options32) { var pathext = options32.pathExt !== void 0 ? options32.pathExt : process.env.PATHEXT; if (!pathext) { return true; } pathext = pathext.split(";"); if (pathext.indexOf("") !== -1) { return true; } for (var i5 = 0; i5 < pathext.length; i5++) { var p6 = pathext[i5].toLowerCase(); if (p6 && path72.substr(-p6.length).toLowerCase() === p6) { return true; } } return false; } __name(checkPathExt, "checkPathExt"); function checkStat(stat9, path72, options32) { if (!stat9.isSymbolicLink() && !stat9.isFile()) { return false; } return checkPathExt(path72, options32); } __name(checkStat, "checkStat"); function isexe(path72, options32, cb2) { fs27.stat(path72, function(er, stat9) { cb2(er, er ? false : checkStat(stat9, path72, options32)); }); } __name(isexe, "isexe"); function sync(path72, options32) { return checkStat(fs27.statSync(path72), path72, options32); } __name(sync, "sync"); } }); // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js var require_mode = __commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports2, module3) { init_import_meta_url(); module3.exports = isexe; isexe.sync = sync; var fs27 = require("fs"); function isexe(path72, options32, cb2) { fs27.stat(path72, function(er, stat9) { cb2(er, er ? false : checkStat(stat9, options32)); }); } __name(isexe, "isexe"); function sync(path72, options32) { return checkStat(fs27.statSync(path72), options32); } __name(sync, "sync"); function checkStat(stat9, options32) { return stat9.isFile() && checkMode(stat9, options32); } __name(checkStat, "checkStat"); function checkMode(stat9, options32) { var mod = stat9.mode; var uid = stat9.uid; var gid = stat9.gid; var myUid = options32.uid !== void 0 ? options32.uid : process.getuid && process.getuid(); var myGid = options32.gid !== void 0 ? options32.gid : process.getgid && process.getgid(); var u5 = parseInt("100", 8); var g6 = parseInt("010", 8); var o5 = parseInt("001", 8); var ug = u5 | g6; var ret = mod & o5 || mod & g6 && gid === myGid || mod & u5 && uid === myUid || mod & ug && myUid === 0; return ret; } __name(checkMode, "checkMode"); } }); // ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js var require_isexe = __commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports2, module3) { init_import_meta_url(); var fs27 = require("fs"); var core; if (process.platform === "win32" || global.TESTING_WINDOWS) { core = require_windows(); } else { core = require_mode(); } module3.exports = isexe; isexe.sync = sync; function isexe(path72, options32, cb2) { if (typeof options32 === "function") { cb2 = options32; options32 = {}; } if (!cb2) { if (typeof Promise !== "function") { throw new TypeError("callback not provided"); } return new Promise(function(resolve25, reject) { isexe(path72, options32 || {}, function(er, is2) { if (er) { reject(er); } else { resolve25(is2); } }); }); } core(path72, options32 || {}, function(er, is2) { if (er) { if (er.code === "EACCES" || options32 && options32.ignoreErrors) { er = null; is2 = false; } } cb2(er, is2); }); } __name(isexe, "isexe"); function sync(path72, options32) { try { return core.sync(path72, options32 || {}); } catch (er) { if (options32 && options32.ignoreErrors || er.code === "EACCES") { return false; } else { throw er; } } } __name(sync, "sync"); } }); // ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js var require_which = __commonJS({ "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports2, module3) { init_import_meta_url(); var isWindows4 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys"; var path72 = require("path"); var COLON = isWindows4 ? ";" : ":"; var isexe = require_isexe(); var getNotFoundError = /* @__PURE__ */ __name((cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }), "getNotFoundError"); var getPathInfo = /* @__PURE__ */ __name((cmd, opt) => { const colon = opt.colon || COLON; const pathEnv = cmd.match(/\//) || isWindows4 && cmd.match(/\\/) ? [""] : [ // windows always checks the cwd first ...isWindows4 ? [process.cwd()] : [], ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */ "").split(colon) ]; const pathExtExe = isWindows4 ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : ""; const pathExt = isWindows4 ? pathExtExe.split(colon) : [""]; if (isWindows4) { if (cmd.indexOf(".") !== -1 && pathExt[0] !== "") pathExt.unshift(""); } return { pathEnv, pathExt, pathExtExe }; }, "getPathInfo"); var which = /* @__PURE__ */ __name((cmd, opt, cb2) => { if (typeof opt === "function") { cb2 = opt; opt = {}; } if (!opt) opt = {}; const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); const found = []; const step = /* @__PURE__ */ __name((i5) => new Promise((resolve25, reject) => { if (i5 === pathEnv.length) return opt.all && found.length ? resolve25(found) : reject(getNotFoundError(cmd)); const ppRaw = pathEnv[i5]; const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; const pCmd = path72.join(pathPart, cmd); const p6 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; resolve25(subStep(p6, i5, 0)); }), "step"); const subStep = /* @__PURE__ */ __name((p6, i5, ii) => new Promise((resolve25, reject) => { if (ii === pathExt.length) return resolve25(step(i5 + 1)); const ext = pathExt[ii]; isexe(p6 + ext, { pathExt: pathExtExe }, (er, is2) => { if (!er && is2) { if (opt.all) found.push(p6 + ext); else return resolve25(p6 + ext); } return resolve25(subStep(p6, i5, ii + 1)); }); }), "subStep"); return cb2 ? step(0).then((res) => cb2(null, res), cb2) : step(0); }, "which"); var whichSync = /* @__PURE__ */ __name((cmd, opt) => { opt = opt || {}; const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); const found = []; for (let i5 = 0; i5 < pathEnv.length; i5++) { const ppRaw = pathEnv[i5]; const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; const pCmd = path72.join(pathPart, cmd); const p6 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; for (let j6 = 0; j6 < pathExt.length; j6++) { const cur = p6 + pathExt[j6]; try { const is2 = isexe.sync(cur, { pathExt: pathExtExe }); if (is2) { if (opt.all) found.push(cur); else return cur; } } catch (ex) { } } } if (opt.all && found.length) return found; if (opt.nothrow) return null; throw getNotFoundError(cmd); }, "whichSync"); module3.exports = which; which.sync = whichSync; } }); // ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js var require_path_key = __commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var pathKey2 = /* @__PURE__ */ __name((options32 = {}) => { const environment = options32.env || process.env; const platform3 = options32.platform || process.platform; if (platform3 !== "win32") { return "PATH"; } return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path"; }, "pathKey"); module3.exports = pathKey2; module3.exports.default = pathKey2; } }); // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js var require_resolveCommand = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module3) { "use strict"; init_import_meta_url(); var path72 = require("path"); var which = require_which(); var getPathKey = require_path_key(); function resolveCommandAttempt(parsed, withoutPathExt) { const env6 = parsed.options.env || process.env; const cwd2 = process.cwd(); const hasCustomCwd = parsed.options.cwd != null; const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled; if (shouldSwitchCwd) { try { process.chdir(parsed.options.cwd); } catch (err) { } } let resolved; try { resolved = which.sync(parsed.command, { path: env6[getPathKey({ env: env6 })], pathExt: withoutPathExt ? path72.delimiter : void 0 }); } catch (e7) { } finally { if (shouldSwitchCwd) { process.chdir(cwd2); } } if (resolved) { resolved = path72.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved); } return resolved; } __name(resolveCommandAttempt, "resolveCommandAttempt"); function resolveCommand(parsed) { return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); } __name(resolveCommand, "resolveCommand"); module3.exports = resolveCommand; } }); // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js var require_escape = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports2, module3) { "use strict"; init_import_meta_url(); var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; function escapeCommand(arg) { arg = arg.replace(metaCharsRegExp, "^$1"); return arg; } __name(escapeCommand, "escapeCommand"); function escapeArgument(arg, doubleEscapeMetaChars) { arg = `${arg}`; arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"'); arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1"); arg = `"${arg}"`; arg = arg.replace(metaCharsRegExp, "^$1"); if (doubleEscapeMetaChars) { arg = arg.replace(metaCharsRegExp, "^$1"); } return arg; } __name(escapeArgument, "escapeArgument"); module3.exports.command = escapeCommand; module3.exports.argument = escapeArgument; } }); // ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js var require_shebang_regex = __commonJS({ "../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = /^#!(.*)/; } }); // ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js var require_shebang_command = __commonJS({ "../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var shebangRegex = require_shebang_regex(); module3.exports = (string = "") => { const match2 = string.match(shebangRegex); if (!match2) { return null; } const [path72, argument] = match2[0].replace(/#! ?/, "").split(" "); const binary = path72.split("/").pop(); if (binary === "env") { return argument; } return argument ? `${binary} ${argument}` : binary; }; } }); // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js var require_readShebang = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module3) { "use strict"; init_import_meta_url(); var fs27 = require("fs"); var shebangCommand = require_shebang_command(); function readShebang(command2) { const size = 150; const buffer = Buffer.alloc(size); let fd; try { fd = fs27.openSync(command2, "r"); fs27.readSync(fd, buffer, 0, size, 0); fs27.closeSync(fd); } catch (e7) { } return shebangCommand(buffer.toString()); } __name(readShebang, "readShebang"); module3.exports = readShebang; } }); // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js var require_parse3 = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports2, module3) { "use strict"; init_import_meta_url(); var path72 = require("path"); var resolveCommand = require_resolveCommand(); var escape2 = require_escape(); var readShebang = require_readShebang(); var isWin = process.platform === "win32"; var isExecutableRegExp = /\.(?:com|exe)$/i; var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; function detectShebang(parsed) { parsed.file = resolveCommand(parsed); const shebang = parsed.file && readShebang(parsed.file); if (shebang) { parsed.args.unshift(parsed.file); parsed.command = shebang; return resolveCommand(parsed); } return parsed.file; } __name(detectShebang, "detectShebang"); function parseNonShell(parsed) { if (!isWin) { return parsed; } const commandFile = detectShebang(parsed); const needsShell = !isExecutableRegExp.test(commandFile); if (parsed.options.forceShell || needsShell) { const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); parsed.command = path72.normalize(parsed.command); parsed.command = escape2.command(parsed.command); parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars)); const shellCommand = [parsed.command].concat(parsed.args).join(" "); parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`]; parsed.command = process.env.comspec || "cmd.exe"; parsed.options.windowsVerbatimArguments = true; } return parsed; } __name(parseNonShell, "parseNonShell"); function parse7(command2, args, options32) { if (args && !Array.isArray(args)) { options32 = args; args = null; } args = args ? args.slice(0) : []; options32 = Object.assign({}, options32); const parsed = { command: command2, args, options: options32, file: void 0, original: { command: command2, args } }; return options32.shell ? parsed : parseNonShell(parsed); } __name(parse7, "parse"); module3.exports = parse7; } }); // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js var require_enoent = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports2, module3) { "use strict"; init_import_meta_url(); var isWin = process.platform === "win32"; function notFoundError(original, syscall) { return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { code: "ENOENT", errno: "ENOENT", syscall: `${syscall} ${original.command}`, path: original.command, spawnargs: original.args }); } __name(notFoundError, "notFoundError"); function hookChildProcess(cp3, parsed) { if (!isWin) { return; } const originalEmit = cp3.emit; cp3.emit = function(name2, arg1) { if (name2 === "exit") { const err = verifyENOENT(arg1, parsed); if (err) { return originalEmit.call(cp3, "error", err); } } return originalEmit.apply(cp3, arguments); }; } __name(hookChildProcess, "hookChildProcess"); function verifyENOENT(status2, parsed) { if (isWin && status2 === 1 && !parsed.file) { return notFoundError(parsed.original, "spawn"); } return null; } __name(verifyENOENT, "verifyENOENT"); function verifyENOENTSync(status2, parsed) { if (isWin && status2 === 1 && !parsed.file) { return notFoundError(parsed.original, "spawnSync"); } return null; } __name(verifyENOENTSync, "verifyENOENTSync"); module3.exports = { hookChildProcess, verifyENOENT, verifyENOENTSync, notFoundError }; } }); // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js var require_cross_spawn = __commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var cp3 = require("child_process"); var parse7 = require_parse3(); var enoent = require_enoent(); function spawn3(command2, args, options32) { const parsed = parse7(command2, args, options32); const spawned = cp3.spawn(parsed.command, parsed.args, parsed.options); enoent.hookChildProcess(spawned, parsed); return spawned; } __name(spawn3, "spawn"); function spawnSync3(command2, args, options32) { const parsed = parse7(command2, args, options32); const result = cp3.spawnSync(parsed.command, parsed.args, parsed.options); result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); return result; } __name(spawnSync3, "spawnSync"); module3.exports = spawn3; module3.exports.spawn = spawn3; module3.exports.sync = spawnSync3; module3.exports._parse = parse7; module3.exports._enoent = enoent; } }); // ../../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"(exports2, module3) { "use strict"; init_import_meta_url(); var { PassThrough: PassThroughStream } = require("stream"); module3.exports = (options32) => { options32 = { ...options32 }; const { array } = options32; let { encoding } = options32; const isBuffer = encoding === "buffer"; let objectMode = false; if (array) { objectMode = !(encoding || isBuffer); } else { encoding = encoding || "utf8"; } if (isBuffer) { encoding = null; } const stream2 = new PassThroughStream({ 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"(exports2, module3) { "use strict"; init_import_meta_url(); var { constants: BufferConstants } = require("buffer"); var stream2 = require("stream"); var { promisify: promisify3 } = require("util"); var bufferStream = require_buffer_stream(); var streamPipelinePromisified = promisify3(stream2.pipeline); var MaxBufferError = class extends Error { constructor() { super("maxBuffer exceeded"); this.name = "MaxBufferError"; } }; __name(MaxBufferError, "MaxBufferError"); async function getStream2(inputStream, options32) { if (!inputStream) { throw new Error("Expected a stream"); } options32 = { maxBuffer: Infinity, ...options32 }; const { maxBuffer } = options32; const stream3 = bufferStream(options32); await new Promise((resolve25, reject) => { const rejectPromise = /* @__PURE__ */ __name((error2) => { if (error2 && stream3.getBufferedLength() <= BufferConstants.MAX_LENGTH) { error2.bufferedData = stream3.getBufferedValue(); } reject(error2); }, "rejectPromise"); (async () => { try { await streamPipelinePromisified(inputStream, stream3); resolve25(); } catch (error2) { rejectPromise(error2); } })(); stream3.on("data", () => { if (stream3.getBufferedLength() > maxBuffer) { rejectPromise(new MaxBufferError()); } }); }); return stream3.getBufferedValue(); } __name(getStream2, "getStream"); module3.exports = getStream2; module3.exports.buffer = (stream3, options32) => getStream2(stream3, { ...options32, encoding: "buffer" }); module3.exports.array = (stream3, options32) => getStream2(stream3, { ...options32, array: true }); module3.exports.MaxBufferError = MaxBufferError; } }); // ../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js var require_merge_stream = __commonJS({ "../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var { PassThrough: PassThrough3 } = require("stream"); module3.exports = function() { var sources = []; var output = new PassThrough3({ objectMode: true }); output.setMaxListeners(0); output.add = add; output.isEmpty = isEmpty; output.on("unpipe", remove); Array.prototype.slice.call(arguments).forEach(add); return output; function add(source) { if (Array.isArray(source)) { source.forEach(add); return this; } sources.push(source); source.once("end", remove.bind(null, source)); source.once("error", output.emit.bind(output, "error")); source.pipe(output, { end: false }); return this; } __name(add, "add"); function isEmpty() { return sources.length == 0; } __name(isEmpty, "isEmpty"); function remove(source) { sources = sources.filter(function(it2) { return it2 !== source; }); if (!sources.length && output.readable) { output.end(); } } __name(remove, "remove"); }; } }); // ../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js var require_command_exists = __commonJS({ "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js"(exports2, module3) { "use strict"; init_import_meta_url(); var exec3 = require("child_process").exec; var execSync4 = require("child_process").execSync; var fs27 = require("fs"); var path72 = require("path"); var access4 = fs27.access; var accessSync = fs27.accessSync; var constants4 = fs27.constants || fs27; var isUsingWindows = process.platform == "win32"; var fileNotExists = /* @__PURE__ */ __name(function(commandName, callback) { access4( commandName, constants4.F_OK, function(err) { callback(!err); } ); }, "fileNotExists"); var fileNotExistsSync = /* @__PURE__ */ __name(function(commandName) { try { accessSync(commandName, constants4.F_OK); return false; } catch (e7) { return true; } }, "fileNotExistsSync"); var localExecutable = /* @__PURE__ */ __name(function(commandName, callback) { access4( commandName, constants4.F_OK | constants4.X_OK, function(err) { callback(null, !err); } ); }, "localExecutable"); var localExecutableSync = /* @__PURE__ */ __name(function(commandName) { try { accessSync(commandName, constants4.F_OK | constants4.X_OK); return true; } catch (e7) { return false; } }, "localExecutableSync"); var commandExistsUnix = /* @__PURE__ */ __name(function(commandName, cleanedCommandName, callback) { fileNotExists(commandName, function(isFile) { if (!isFile) { var child = exec3( "command -v " + cleanedCommandName + " 2>/dev/null && { echo >&1 " + cleanedCommandName + "; exit 0; }", function(error2, stdout2, stderr2) { callback(null, !!stdout2); } ); return; } localExecutable(commandName, callback); }); }, "commandExistsUnix"); var commandExistsWindows = /* @__PURE__ */ __name(function(commandName, cleanedCommandName, callback) { if (!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(commandName)) { callback(null, false); return; } var child = exec3( "where " + cleanedCommandName, function(error2) { if (error2 !== null) { callback(null, false); } else { callback(null, true); } } ); }, "commandExistsWindows"); var commandExistsUnixSync = /* @__PURE__ */ __name(function(commandName, cleanedCommandName) { if (fileNotExistsSync(commandName)) { try { var stdout2 = execSync4( "command -v " + cleanedCommandName + " 2>/dev/null && { echo >&1 " + cleanedCommandName + "; exit 0; }" ); return !!stdout2; } catch (error2) { return false; } } return localExecutableSync(commandName); }, "commandExistsUnixSync"); var commandExistsWindowsSync = /* @__PURE__ */ __name(function(commandName, cleanedCommandName, callback) { if (!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(commandName)) { return false; } try { var stdout2 = execSync4("where " + cleanedCommandName, { stdio: [] }); return !!stdout2; } catch (error2) { return false; } }, "commandExistsWindowsSync"); var cleanInput = /* @__PURE__ */ __name(function(s5) { if (/[^A-Za-z0-9_\/:=-]/.test(s5)) { s5 = "'" + s5.replace(/'/g, "'\\''") + "'"; s5 = s5.replace(/^(?:'')+/g, "").replace(/\\'''/g, "\\'"); } return s5; }, "cleanInput"); if (isUsingWindows) { cleanInput = /* @__PURE__ */ __name(function(s5) { var isPathName = /[\\]/.test(s5); if (isPathName) { var dirname17 = '"' + path72.dirname(s5) + '"'; var basename7 = '"' + path72.basename(s5) + '"'; return dirname17 + ":" + basename7; } return '"' + s5 + '"'; }, "cleanInput"); } module3.exports = /* @__PURE__ */ __name(function commandExists(commandName, callback) { var cleanedCommandName = cleanInput(commandName); if (!callback && typeof Promise !== "undefined") { return new Promise(function(resolve25, reject) { commandExists(commandName, function(error2, output) { if (output) { resolve25(commandName); } else { reject(error2); } }); }); } if (isUsingWindows) { commandExistsWindows(commandName, cleanedCommandName, callback); } else { commandExistsUnix(commandName, cleanedCommandName, callback); } }, "commandExists"); module3.exports.sync = function(commandName) { var cleanedCommandName = cleanInput(commandName); if (isUsingWindows) { return commandExistsWindowsSync(commandName, cleanedCommandName); } else { return commandExistsUnixSync(commandName, cleanedCommandName); } }; } }); // ../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/index.js var require_command_exists2 = __commonJS({ "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/index.js"(exports2, module3) { init_import_meta_url(); module3.exports = require_command_exists(); } }); // ../../node_modules/.pnpm/md5-file@5.0.0/node_modules/md5-file/index.js var require_md5_file = __commonJS({ "../../node_modules/.pnpm/md5-file@5.0.0/node_modules/md5-file/index.js"(exports2, module3) { init_import_meta_url(); var crypto8 = require("crypto"); var fs27 = require("fs"); var BUFFER_SIZE = 8192; function md5FileSync(path72) { const fd = fs27.openSync(path72, "r"); const hash = crypto8.createHash("md5"); const buffer = Buffer.alloc(BUFFER_SIZE); try { let bytesRead; do { bytesRead = fs27.readSync(fd, buffer, 0, BUFFER_SIZE); hash.update(buffer.slice(0, bytesRead)); } while (bytesRead === BUFFER_SIZE); } finally { fs27.closeSync(fd); } return hash.digest("hex"); } __name(md5FileSync, "md5FileSync"); function md5File2(path72) { return new Promise((resolve25, reject) => { const output = crypto8.createHash("md5"); const input = fs27.createReadStream(path72); input.on("error", (err) => { reject(err); }); output.once("readable", () => { resolve25(output.read().toString("hex")); }); input.pipe(output); }); } __name(md5File2, "md5File"); module3.exports = md5File2; module3.exports.sync = md5FileSync; } }); // ../../node_modules/.pnpm/shell-quote@1.8.1/node_modules/shell-quote/quote.js var require_quote = __commonJS({ "../../node_modules/.pnpm/shell-quote@1.8.1/node_modules/shell-quote/quote.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = /* @__PURE__ */ __name(function quote2(xs) { return xs.map(function(s5) { if (s5 && typeof s5 === "object") { return s5.op.replace(/(.)/g, "\\$1"); } if (/["\s]/.test(s5) && !/'/.test(s5)) { return "'" + s5.replace(/(['\\])/g, "\\$1") + "'"; } if (/["'\s]/.test(s5)) { return '"' + s5.replace(/(["\\$`!])/g, "\\$1") + '"'; } return String(s5).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, "$1\\$2"); }).join(" "); }, "quote"); } }); // ../../node_modules/.pnpm/shell-quote@1.8.1/node_modules/shell-quote/parse.js var require_parse4 = __commonJS({ "../../node_modules/.pnpm/shell-quote@1.8.1/node_modules/shell-quote/parse.js"(exports2, module3) { "use strict"; init_import_meta_url(); var CONTROL = "(?:" + [ "\\|\\|", "\\&\\&", ";;", "\\|\\&", "\\<\\(", "\\<\\<\\<", ">>", ">\\&", "<\\&", "[&;()|<>]" ].join("|") + ")"; var controlRE = new RegExp("^" + CONTROL + "$"); var META = "|&;()<> \\t"; var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"'; var DOUBLE_QUOTE = "'((\\\\'|[^'])*?)'"; var hash = /^#$/; var SQ = "'"; var DQ = '"'; var DS = "$"; var TOKEN = ""; var mult = 4294967296; for (i5 = 0; i5 < 4; i5++) { TOKEN += (mult * Math.random()).toString(16); } var i5; var startsWithToken = new RegExp("^" + TOKEN); function matchAll(s5, r7) { var origIndex = r7.lastIndex; var matches = []; var matchObj; while (matchObj = r7.exec(s5)) { matches.push(matchObj); if (r7.lastIndex === matchObj.index) { r7.lastIndex += 1; } } r7.lastIndex = origIndex; return matches; } __name(matchAll, "matchAll"); function getVar(env6, pre, key) { var r7 = typeof env6 === "function" ? env6(key) : env6[key]; if (typeof r7 === "undefined" && key != "") { r7 = ""; } else if (typeof r7 === "undefined") { r7 = "$"; } if (typeof r7 === "object") { return pre + TOKEN + JSON.stringify(r7) + TOKEN; } return pre + r7; } __name(getVar, "getVar"); function parseInternal(string, env6, opts) { if (!opts) { opts = {}; } var BS = opts.escape || "\\"; var BAREWORD = "(\\" + BS + `['"` + META + `]|[^\\s'"` + META + "])+"; var chunker = new RegExp([ "(" + CONTROL + ")", // control chars "(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+" ].join("|"), "g"); var matches = matchAll(string, chunker); if (matches.length === 0) { return []; } if (!env6) { env6 = {}; } var commented = false; return matches.map(function(match2) { var s5 = match2[0]; if (!s5 || commented) { return void 0; } if (controlRE.test(s5)) { return { op: s5 }; } var quote2 = false; var esc = false; var out = ""; var isGlob = false; var i6; function parseEnvVar() { i6 += 1; var varend; var varname; var char = s5.charAt(i6); if (char === "{") { i6 += 1; if (s5.charAt(i6) === "}") { throw new Error("Bad substitution: " + s5.slice(i6 - 2, i6 + 1)); } varend = s5.indexOf("}", i6); if (varend < 0) { throw new Error("Bad substitution: " + s5.slice(i6)); } varname = s5.slice(i6, varend); i6 = varend; } else if (/[*@#?$!_-]/.test(char)) { varname = char; i6 += 1; } else { var slicedFromI = s5.slice(i6); varend = slicedFromI.match(/[^\w\d_]/); if (!varend) { varname = slicedFromI; i6 = s5.length; } else { varname = slicedFromI.slice(0, varend.index); i6 += varend.index - 1; } } return getVar(env6, "", varname); } __name(parseEnvVar, "parseEnvVar"); for (i6 = 0; i6 < s5.length; i6++) { var c6 = s5.charAt(i6); isGlob = isGlob || !quote2 && (c6 === "*" || c6 === "?"); if (esc) { out += c6; esc = false; } else if (quote2) { if (c6 === quote2) { quote2 = false; } else if (quote2 == SQ) { out += c6; } else { if (c6 === BS) { i6 += 1; c6 = s5.charAt(i6); if (c6 === DQ || c6 === BS || c6 === DS) { out += c6; } else { out += BS + c6; } } else if (c6 === DS) { out += parseEnvVar(); } else { out += c6; } } } else if (c6 === DQ || c6 === SQ) { quote2 = c6; } else if (controlRE.test(c6)) { return { op: s5 }; } else if (hash.test(c6)) { commented = true; var commentObj = { comment: string.slice(match2.index + i6 + 1) }; if (out.length) { return [out, commentObj]; } return [commentObj]; } else if (c6 === BS) { esc = true; } else if (c6 === DS) { out += parseEnvVar(); } else { out += c6; } } if (isGlob) { return { op: "glob", pattern: out }; } return out; }).reduce(function(prev, arg) { return typeof arg === "undefined" ? prev : prev.concat(arg); }, []); } __name(parseInternal, "parseInternal"); module3.exports = /* @__PURE__ */ __name(function parse7(s5, env6, opts) { var mapped = parseInternal(s5, env6, opts); if (typeof env6 !== "function") { return mapped; } return mapped.reduce(function(acc, s6) { if (typeof s6 === "object") { return acc.concat(s6); } var xs = s6.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g")); if (xs.length === 1) { return acc.concat(xs[0]); } return acc.concat(xs.filter(Boolean).map(function(x6) { if (startsWithToken.test(x6)) { return JSON.parse(x6.split(TOKEN)[1]); } return x6; })); }, []); }, "parse"); } }); // ../../node_modules/.pnpm/shell-quote@1.8.1/node_modules/shell-quote/index.js var require_shell_quote = __commonJS({ "../../node_modules/.pnpm/shell-quote@1.8.1/node_modules/shell-quote/index.js"(exports2) { "use strict"; init_import_meta_url(); exports2.quote = require_quote(); exports2.parse = require_parse4(); } }); // ../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js var require_path = __commonJS({ "../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js"(exports2, module3) { init_import_meta_url(); var isWindows4 = typeof process === "object" && process && process.platform === "win32"; module3.exports = isWindows4 ? { sep: "\\" } : { sep: "/" }; } }); // ../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js var require_balanced_match = __commonJS({ "../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); module3.exports = balanced; function balanced(a5, b6, str) { if (a5 instanceof RegExp) a5 = maybeMatch(a5, str); if (b6 instanceof RegExp) b6 = maybeMatch(b6, str); var r7 = range(a5, b6, str); return r7 && { start: r7[0], end: r7[1], pre: str.slice(0, r7[0]), body: str.slice(r7[0] + a5.length, r7[1]), post: str.slice(r7[1] + b6.length) }; } __name(balanced, "balanced"); function maybeMatch(reg, str) { var m6 = str.match(reg); return m6 ? m6[0] : null; } __name(maybeMatch, "maybeMatch"); balanced.range = range; function range(a5, b6, str) { var begs, beg, left2, right2, result; var ai3 = str.indexOf(a5); var bi2 = str.indexOf(b6, ai3 + 1); var i5 = ai3; if (ai3 >= 0 && bi2 > 0) { if (a5 === b6) { return [ai3, bi2]; } begs = []; left2 = str.length; while (i5 >= 0 && !result) { if (i5 == ai3) { begs.push(i5); ai3 = str.indexOf(a5, i5 + 1); } else if (begs.length == 1) { result = [begs.pop(), bi2]; } else { beg = begs.pop(); if (beg < left2) { left2 = beg; right2 = bi2; } bi2 = str.indexOf(b6, i5 + 1); } i5 = ai3 < bi2 && ai3 >= 0 ? ai3 : bi2; } if (begs.length) { result = [left2, right2]; } } return result; } __name(range, "range"); } }); // ../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js var require_brace_expansion = __commonJS({ "../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(exports2, module3) { init_import_meta_url(); var balanced = require_balanced_match(); module3.exports = expandTop; var escSlash = "\0SLASH" + Math.random() + "\0"; var escOpen = "\0OPEN" + Math.random() + "\0"; var escClose = "\0CLOSE" + Math.random() + "\0"; var escComma = "\0COMMA" + Math.random() + "\0"; var escPeriod = "\0PERIOD" + Math.random() + "\0"; function numeric(str) { return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } __name(numeric, "numeric"); function escapeBraces(str) { return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } __name(escapeBraces, "escapeBraces"); function unescapeBraces(str) { return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } __name(unescapeBraces, "unescapeBraces"); function parseCommaParts(str) { if (!str) return [""]; var parts = []; var m6 = balanced("{", "}", str); if (!m6) return str.split(","); var pre = m6.pre; var body = m6.body; var post = m6.post; var p6 = pre.split(","); p6[p6.length - 1] += "{" + body + "}"; var postParts = parseCommaParts(post); if (post.length) { p6[p6.length - 1] += postParts.shift(); p6.push.apply(p6, postParts); } parts.push.apply(parts, p6); return parts; } __name(parseCommaParts, "parseCommaParts"); function expandTop(str) { if (!str) return []; if (str.substr(0, 2) === "{}") { str = "\\{\\}" + str.substr(2); } return expand(escapeBraces(str), true).map(unescapeBraces); } __name(expandTop, "expandTop"); function embrace(str) { return "{" + str + "}"; } __name(embrace, "embrace"); function isPadded(el) { return /^-?0\d/.test(el); } __name(isPadded, "isPadded"); function lte(i5, y4) { return i5 <= y4; } __name(lte, "lte"); function gte(i5, y4) { return i5 >= y4; } __name(gte, "gte"); function expand(str, isTop) { var expansions = []; var m6 = balanced("{", "}", str); if (!m6) return [str]; var pre = m6.pre; var post = m6.post.length ? expand(m6.post, false) : [""]; if (/\$$/.test(m6.pre)) { for (var k6 = 0; k6 < post.length; k6++) { var expansion = pre + "{" + m6.body + "}" + post[k6]; expansions.push(expansion); } } else { var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m6.body); var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m6.body); var isSequence = isNumericSequence || isAlphaSequence; var isOptions = m6.body.indexOf(",") >= 0; if (!isSequence && !isOptions) { if (m6.post.match(/,.*\}/)) { str = m6.pre + "{" + m6.body + escClose + m6.post; return expand(str); } return [str]; } var n6; if (isSequence) { n6 = m6.body.split(/\.\./); } else { n6 = parseCommaParts(m6.body); if (n6.length === 1) { n6 = expand(n6[0], false).map(embrace); if (n6.length === 1) { return post.map(function(p6) { return m6.pre + n6[0] + p6; }); } } } var N3; if (isSequence) { var x6 = numeric(n6[0]); var y4 = numeric(n6[1]); var width = Math.max(n6[0].length, n6[1].length); var incr = n6.length == 3 ? Math.abs(numeric(n6[2])) : 1; var test = lte; var reverse = y4 < x6; if (reverse) { incr *= -1; test = gte; } var pad2 = n6.some(isPadded); N3 = []; for (var i5 = x6; test(i5, y4); i5 += incr) { var c6; if (isAlphaSequence) { c6 = String.fromCharCode(i5); if (c6 === "\\") c6 = ""; } else { c6 = String(i5); if (pad2) { var need = width - c6.length; if (need > 0) { var z5 = new Array(need + 1).join("0"); if (i5 < 0) c6 = "-" + z5 + c6.slice(1); else c6 = z5 + c6; } } } N3.push(c6); } } else { N3 = []; for (var j6 = 0; j6 < n6.length; j6++) { N3.push.apply(N3, expand(n6[j6], false)); } } for (var j6 = 0; j6 < N3.length; j6++) { for (var k6 = 0; k6 < post.length; k6++) { var expansion = pre + N3[j6] + post[k6]; if (!isTop || isSequence || expansion) expansions.push(expansion); } } } return expansions; } __name(expand, "expand"); } }); // ../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js var require_minimatch = __commonJS({ "../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js"(exports2, module3) { init_import_meta_url(); var minimatch = module3.exports = (p6, pattern, options32 = {}) => { assertValidPattern(pattern); if (!options32.nocomment && pattern.charAt(0) === "#") { return false; } return new Minimatch2(pattern, options32).match(p6); }; module3.exports = minimatch; var path72 = require_path(); minimatch.sep = path72.sep; var GLOBSTAR = Symbol("globstar **"); minimatch.GLOBSTAR = GLOBSTAR; var expand = require_brace_expansion(); var plTypes = { "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, "?": { open: "(?:", close: ")?" }, "+": { open: "(?:", close: ")+" }, "*": { open: "(?:", close: ")*" }, "@": { open: "(?:", close: ")" } }; var qmark = "[^/]"; var star = qmark + "*?"; var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; var charSet = /* @__PURE__ */ __name((s5) => s5.split("").reduce((set, c6) => { set[c6] = true; return set; }, {}), "charSet"); var reSpecials = charSet("().*{}+?[]^$\\!"); var addPatternStartSet = charSet("[.("); var slashSplit = /\/+/; minimatch.filter = (pattern, options32 = {}) => (p6, i5, list) => minimatch(p6, pattern, options32); var ext = /* @__PURE__ */ __name((a5, b6 = {}) => { const t7 = {}; Object.keys(a5).forEach((k6) => t7[k6] = a5[k6]); Object.keys(b6).forEach((k6) => t7[k6] = b6[k6]); return t7; }, "ext"); minimatch.defaults = (def) => { if (!def || typeof def !== "object" || !Object.keys(def).length) { return minimatch; } const orig = minimatch; const m6 = /* @__PURE__ */ __name((p6, pattern, options32) => orig(p6, pattern, ext(def, options32)), "m"); m6.Minimatch = /* @__PURE__ */ __name(class Minimatch extends orig.Minimatch { constructor(pattern, options32) { super(pattern, ext(def, options32)); } }, "Minimatch"); m6.Minimatch.defaults = (options32) => orig.defaults(ext(def, options32)).Minimatch; m6.filter = (pattern, options32) => orig.filter(pattern, ext(def, options32)); m6.defaults = (options32) => orig.defaults(ext(def, options32)); m6.makeRe = (pattern, options32) => orig.makeRe(pattern, ext(def, options32)); m6.braceExpand = (pattern, options32) => orig.braceExpand(pattern, ext(def, options32)); m6.match = (list, pattern, options32) => orig.match(list, pattern, ext(def, options32)); return m6; }; minimatch.braceExpand = (pattern, options32) => braceExpand(pattern, options32); var braceExpand = /* @__PURE__ */ __name((pattern, options32 = {}) => { assertValidPattern(pattern); if (options32.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { return [pattern]; } return expand(pattern); }, "braceExpand"); var MAX_PATTERN_LENGTH = 1024 * 64; var assertValidPattern = /* @__PURE__ */ __name((pattern) => { if (typeof pattern !== "string") { throw new TypeError("invalid pattern"); } if (pattern.length > MAX_PATTERN_LENGTH) { throw new TypeError("pattern is too long"); } }, "assertValidPattern"); var SUBPARSE = Symbol("subparse"); minimatch.makeRe = (pattern, options32) => new Minimatch2(pattern, options32 || {}).makeRe(); minimatch.match = (list, pattern, options32 = {}) => { const mm = new Minimatch2(pattern, options32); list = list.filter((f5) => mm.match(f5)); if (mm.options.nonull && !list.length) { list.push(pattern); } return list; }; var globUnescape = /* @__PURE__ */ __name((s5) => s5.replace(/\\(.)/g, "$1"), "globUnescape"); var charUnescape = /* @__PURE__ */ __name((s5) => s5.replace(/\\([^-\]])/g, "$1"), "charUnescape"); var regExpEscape = /* @__PURE__ */ __name((s5) => s5.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), "regExpEscape"); var braExpEscape = /* @__PURE__ */ __name((s5) => s5.replace(/[[\]\\]/g, "\\$&"), "braExpEscape"); var Minimatch2 = class { constructor(pattern, options32) { assertValidPattern(pattern); if (!options32) options32 = {}; this.options = options32; this.set = []; this.pattern = pattern; this.windowsPathsNoEscape = !!options32.windowsPathsNoEscape || options32.allowWindowsEscape === false; if (this.windowsPathsNoEscape) { this.pattern = this.pattern.replace(/\\/g, "/"); } this.regexp = null; this.negate = false; this.comment = false; this.empty = false; this.partial = !!options32.partial; this.make(); } debug() { } make() { const pattern = this.pattern; const options32 = this.options; if (!options32.nocomment && pattern.charAt(0) === "#") { this.comment = true; return; } if (!pattern) { this.empty = true; return; } this.parseNegate(); let set = this.globSet = this.braceExpand(); if (options32.debug) this.debug = (...args) => console.error(...args); this.debug(this.pattern, set); set = this.globParts = set.map((s5) => s5.split(slashSplit)); this.debug(this.pattern, set); set = set.map((s5, si2, set2) => s5.map(this.parse, this)); this.debug(this.pattern, set); set = set.filter((s5) => s5.indexOf(false) === -1); this.debug(this.pattern, set); this.set = set; } parseNegate() { if (this.options.nonegate) return; const pattern = this.pattern; let negate3 = false; let negateOffset = 0; for (let i5 = 0; i5 < pattern.length && pattern.charAt(i5) === "!"; i5++) { negate3 = !negate3; negateOffset++; } if (negateOffset) this.pattern = pattern.slice(negateOffset); this.negate = negate3; } // set partial to true to test if, for example, // "/a/b" matches the start of "/*/b/*/d" // Partial means, if you run out of file before you run // out of pattern, then that's fine, as long as all // the parts match. matchOne(file, pattern, partial) { var options32 = this.options; this.debug( "matchOne", { "this": this, file, pattern } ); this.debug("matchOne", file.length, pattern.length); for (var fi = 0, pi = 0, fl = file.length, pl3 = pattern.length; fi < fl && pi < pl3; fi++, pi++) { this.debug("matchOne loop"); var p6 = pattern[pi]; var f5 = file[fi]; this.debug(pattern, p6, f5); if (p6 === false) return false; if (p6 === GLOBSTAR) { this.debug("GLOBSTAR", [pattern, p6, f5]); var fr2 = fi; var pr = pi + 1; if (pr === pl3) { this.debug("** at the end"); for (; fi < fl; fi++) { if (file[fi] === "." || file[fi] === ".." || !options32.dot && file[fi].charAt(0) === ".") return false; } return true; } while (fr2 < fl) { var swallowee = file[fr2]; this.debug("\nglobstar while", file, fr2, pattern, pr, swallowee); if (this.matchOne(file.slice(fr2), pattern.slice(pr), partial)) { this.debug("globstar found match!", fr2, fl, swallowee); return true; } else { if (swallowee === "." || swallowee === ".." || !options32.dot && swallowee.charAt(0) === ".") { this.debug("dot detected!", file, fr2, pattern, pr); break; } this.debug("globstar swallow a segment, and continue"); fr2++; } } if (partial) { this.debug("\n>>> no match, partial?", file, fr2, pattern, pr); if (fr2 === fl) return true; } return false; } var hit; if (typeof p6 === "string") { hit = f5 === p6; this.debug("string match", p6, f5, hit); } else { hit = f5.match(p6); this.debug("pattern match", p6, f5, hit); } if (!hit) return false; } if (fi === fl && pi === pl3) { return true; } else if (fi === fl) { return partial; } else if (pi === pl3) { return fi === fl - 1 && file[fi] === ""; } throw new Error("wtf?"); } braceExpand() { return braceExpand(this.pattern, this.options); } parse(pattern, isSub) { assertValidPattern(pattern); const options32 = this.options; if (pattern === "**") { if (!options32.noglobstar) return GLOBSTAR; else pattern = "*"; } if (pattern === "") return ""; let re = ""; let hasMagic = false; let escaping = false; const patternListStack = []; const negativeLists = []; let stateChar; let inClass = false; let reClassStart = -1; let classStart = -1; let cs3; let pl3; let sp; let dotTravAllowed = pattern.charAt(0) === "."; let dotFileAllowed = options32.dot || dotTravAllowed; const patternStart = /* @__PURE__ */ __name(() => dotTravAllowed ? "" : dotFileAllowed ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)", "patternStart"); const subPatternStart = /* @__PURE__ */ __name((p6) => p6.charAt(0) === "." ? "" : options32.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)", "subPatternStart"); const clearStateChar = /* @__PURE__ */ __name(() => { if (stateChar) { switch (stateChar) { case "*": re += star; hasMagic = true; break; case "?": re += qmark; hasMagic = true; break; default: re += "\\" + stateChar; break; } this.debug("clearStateChar %j %j", stateChar, re); stateChar = false; } }, "clearStateChar"); for (let i5 = 0, c6; i5 < pattern.length && (c6 = pattern.charAt(i5)); i5++) { this.debug("%s %s %s %j", pattern, i5, re, c6); if (escaping) { if (c6 === "/") { return false; } if (reSpecials[c6]) { re += "\\"; } re += c6; escaping = false; continue; } switch (c6) { case "/": { return false; } case "\\": if (inClass && pattern.charAt(i5 + 1) === "-") { re += c6; continue; } clearStateChar(); escaping = true; continue; case "?": case "*": case "+": case "@": case "!": this.debug("%s %s %s %j <-- stateChar", pattern, i5, re, c6); if (inClass) { this.debug(" in class"); if (c6 === "!" && i5 === classStart + 1) c6 = "^"; re += c6; continue; } this.debug("call clearStateChar %j", stateChar); clearStateChar(); stateChar = c6; if (options32.noext) clearStateChar(); continue; case "(": { if (inClass) { re += "("; continue; } if (!stateChar) { re += "\\("; continue; } const plEntry = { type: stateChar, start: i5 - 1, reStart: re.length, open: plTypes[stateChar].open, close: plTypes[stateChar].close }; this.debug(this.pattern, " ", plEntry); patternListStack.push(plEntry); re += plEntry.open; if (plEntry.start === 0 && plEntry.type !== "!") { dotTravAllowed = true; re += subPatternStart(pattern.slice(i5 + 1)); } this.debug("plType %j %j", stateChar, re); stateChar = false; continue; } case ")": { const plEntry = patternListStack[patternListStack.length - 1]; if (inClass || !plEntry) { re += "\\)"; continue; } patternListStack.pop(); clearStateChar(); hasMagic = true; pl3 = plEntry; re += pl3.close; if (pl3.type === "!") { negativeLists.push(Object.assign(pl3, { reEnd: re.length })); } continue; } case "|": { const plEntry = patternListStack[patternListStack.length - 1]; if (inClass || !plEntry) { re += "\\|"; continue; } clearStateChar(); re += "|"; if (plEntry.start === 0 && plEntry.type !== "!") { dotTravAllowed = true; re += subPatternStart(pattern.slice(i5 + 1)); } continue; } case "[": clearStateChar(); if (inClass) { re += "\\" + c6; continue; } inClass = true; classStart = i5; reClassStart = re.length; re += c6; continue; case "]": if (i5 === classStart + 1 || !inClass) { re += "\\" + c6; continue; } cs3 = pattern.substring(classStart + 1, i5); try { RegExp("[" + braExpEscape(charUnescape(cs3)) + "]"); re += c6; } catch (er) { re = re.substring(0, reClassStart) + "(?:$.)"; } hasMagic = true; inClass = false; continue; default: clearStateChar(); if (reSpecials[c6] && !(c6 === "^" && inClass)) { re += "\\"; } re += c6; break; } } if (inClass) { cs3 = pattern.slice(classStart + 1); sp = this.parse(cs3, SUBPARSE); re = re.substring(0, reClassStart) + "\\[" + sp[0]; hasMagic = hasMagic || sp[1]; } for (pl3 = patternListStack.pop(); pl3; pl3 = patternListStack.pop()) { let tail; tail = re.slice(pl3.reStart + pl3.open.length); this.debug("setting tail", re, pl3); tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_4, $1, $22) => { if (!$22) { $22 = "\\"; } return $1 + $1 + $22 + "|"; }); this.debug("tail=%j\n %s", tail, tail, pl3, re); const t7 = pl3.type === "*" ? star : pl3.type === "?" ? qmark : "\\" + pl3.type; hasMagic = true; re = re.slice(0, pl3.reStart) + t7 + "\\(" + tail; } clearStateChar(); if (escaping) { re += "\\\\"; } const addPatternStart = addPatternStartSet[re.charAt(0)]; for (let n6 = negativeLists.length - 1; n6 > -1; n6--) { const nl = negativeLists[n6]; const nlBefore = re.slice(0, nl.reStart); const nlFirst = re.slice(nl.reStart, nl.reEnd - 8); let nlAfter = re.slice(nl.reEnd); const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter; const closeParensBefore = nlBefore.split(")").length; const openParensBefore = nlBefore.split("(").length - closeParensBefore; let cleanAfter = nlAfter; for (let i5 = 0; i5 < openParensBefore; i5++) { cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); } nlAfter = cleanAfter; const dollar = nlAfter === "" && isSub !== SUBPARSE ? "(?:$|\\/)" : ""; re = nlBefore + nlFirst + nlAfter + dollar + nlLast; } if (re !== "" && hasMagic) { re = "(?=.)" + re; } if (addPatternStart) { re = patternStart() + re; } if (isSub === SUBPARSE) { return [re, hasMagic]; } if (options32.nocase && !hasMagic) { hasMagic = pattern.toUpperCase() !== pattern.toLowerCase(); } if (!hasMagic) { return globUnescape(pattern); } const flags2 = options32.nocase ? "i" : ""; try { return Object.assign(new RegExp("^" + re + "$", flags2), { _glob: pattern, _src: re }); } catch (er) { return new RegExp("$."); } } makeRe() { if (this.regexp || this.regexp === false) return this.regexp; const set = this.set; if (!set.length) { this.regexp = false; return this.regexp; } const options32 = this.options; const twoStar = options32.noglobstar ? star : options32.dot ? twoStarDot : twoStarNoDot; const flags2 = options32.nocase ? "i" : ""; let re = set.map((pattern) => { pattern = pattern.map( (p6) => typeof p6 === "string" ? regExpEscape(p6) : p6 === GLOBSTAR ? GLOBSTAR : p6._src ).reduce((set2, p6) => { if (!(set2[set2.length - 1] === GLOBSTAR && p6 === GLOBSTAR)) { set2.push(p6); } return set2; }, []); pattern.forEach((p6, i5) => { if (p6 !== GLOBSTAR || pattern[i5 - 1] === GLOBSTAR) { return; } if (i5 === 0) { if (pattern.length > 1) { pattern[i5 + 1] = "(?:\\/|" + twoStar + "\\/)?" + pattern[i5 + 1]; } else { pattern[i5] = twoStar; } } else if (i5 === pattern.length - 1) { pattern[i5 - 1] += "(?:\\/|" + twoStar + ")?"; } else { pattern[i5 - 1] += "(?:\\/|\\/" + twoStar + "\\/)" + pattern[i5 + 1]; pattern[i5 + 1] = GLOBSTAR; } }); return pattern.filter((p6) => p6 !== GLOBSTAR).join("/"); }).join("|"); re = "^(?:" + re + ")$"; if (this.negate) re = "^(?!" + re + ").*$"; try { this.regexp = new RegExp(re, flags2); } catch (ex) { this.regexp = false; } return this.regexp; } match(f5, partial = this.partial) { this.debug("match", f5, this.pattern); if (this.comment) return false; if (this.empty) return f5 === ""; if (f5 === "/" && partial) return true; const options32 = this.options; if (path72.sep !== "/") { f5 = f5.split(path72.sep).join("/"); } f5 = f5.split(slashSplit); this.debug(this.pattern, "split", f5); const set = this.set; this.debug(this.pattern, "set", set); let filename; for (let i5 = f5.length - 1; i5 >= 0; i5--) { filename = f5[i5]; if (filename) break; } for (let i5 = 0; i5 < set.length; i5++) { const pattern = set[i5]; let file = f5; if (options32.matchBase && pattern.length === 1) { file = [filename]; } const hit = this.matchOne(file, pattern, partial); if (hit) { if (options32.flipNegate) return true; return !this.negate; } } if (options32.flipNegate) return false; return this.negate; } static defaults(def) { return minimatch.defaults(def).Minimatch; } }; __name(Minimatch2, "Minimatch"); minimatch.Minimatch = Minimatch2; } }); // src/pages/hash.ts var import_node_fs25, import_node_path49, import_blake3_wasm, hashFile; var init_hash = __esm({ "src/pages/hash.ts"() { init_import_meta_url(); import_node_fs25 = require("node:fs"); import_node_path49 = require("node:path"); import_blake3_wasm = require("blake3-wasm"); hashFile = /* @__PURE__ */ __name((filepath) => { const contents = (0, import_node_fs25.readFileSync)(filepath); const base64Contents = contents.toString("base64"); const extension = (0, import_node_path49.extname)(filepath).substring(1); return (0, import_blake3_wasm.hash)(base64Contents + extension).toString("hex").slice(0, 32); }, "hashFile"); } }); // ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js var require_ms = __commonJS({ "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module3) { init_import_meta_url(); var s5 = 1e3; var m6 = s5 * 60; var h6 = m6 * 60; var d6 = h6 * 24; var w6 = d6 * 7; var y4 = d6 * 365.25; module3.exports = function(val2, options32) { options32 = options32 || {}; var type = typeof val2; if (type === "string" && val2.length > 0) { return parse7(val2); } else if (type === "number" && isFinite(val2)) { return options32.long ? fmtLong(val2) : fmtShort(val2); } throw new Error( "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) ); }; function parse7(str) { str = String(str); if (str.length > 100) { return; } var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match2) { return; } var n6 = parseFloat(match2[1]); var type = (match2[2] || "ms").toLowerCase(); switch (type) { case "years": case "year": case "yrs": case "yr": case "y": return n6 * y4; case "weeks": case "week": case "w": return n6 * w6; case "days": case "day": case "d": return n6 * d6; case "hours": case "hour": case "hrs": case "hr": case "h": return n6 * h6; case "minutes": case "minute": case "mins": case "min": case "m": return n6 * m6; case "seconds": case "second": case "secs": case "sec": case "s": return n6 * s5; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": return n6; default: return void 0; } } __name(parse7, "parse"); function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d6) { return Math.round(ms / d6) + "d"; } if (msAbs >= h6) { return Math.round(ms / h6) + "h"; } if (msAbs >= m6) { return Math.round(ms / m6) + "m"; } if (msAbs >= s5) { return Math.round(ms / s5) + "s"; } return ms + "ms"; } __name(fmtShort, "fmtShort"); function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d6) { return plural2(ms, msAbs, d6, "day"); } if (msAbs >= h6) { return plural2(ms, msAbs, h6, "hour"); } if (msAbs >= m6) { return plural2(ms, msAbs, m6, "minute"); } if (msAbs >= s5) { return plural2(ms, msAbs, s5, "second"); } return ms + " ms"; } __name(fmtLong, "fmtLong"); function plural2(ms, msAbs, n6, name2) { var isPlural = msAbs >= n6 * 1.5; return Math.round(ms / n6) + " " + name2 + (isPlural ? "s" : ""); } __name(plural2, "plural"); } }); // ../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/common.js var require_common = __commonJS({ "../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/common.js"(exports2, module3) { init_import_meta_url(); function setup(env6) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce2; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require_ms(); createDebug.destroy = destroy; Object.keys(env6).forEach((key) => { createDebug[key] = env6[key]; }); createDebug.names = []; createDebug.skips = []; createDebug.formatters = {}; function selectColor(namespace) { let hash = 0; for (let i5 = 0; i5 < namespace.length; i5++) { hash = (hash << 5) - hash + namespace.charCodeAt(i5); hash |= 0; } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } __name(selectColor, "selectColor"); createDebug.selectColor = selectColor; function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug(...args) { if (!debug.enabled) { return; } const self2 = debug; const curr = Number(/* @__PURE__ */ new Date()); const ms = curr - (prevTime || curr); self2.diff = ms; self2.prev = prevTime; self2.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== "string") { args.unshift("%O"); } let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format11) => { if (match2 === "%%") { return "%"; } index++; const formatter = createDebug.formatters[format11]; if (typeof formatter === "function") { const val2 = args[index]; match2 = formatter.call(self2, val2); args.splice(index, 1); index--; } return match2; }); createDebug.formatArgs.call(self2, args); const logFn = self2.log || createDebug.log; logFn.apply(self2, args); } __name(debug, "debug"); debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; Object.defineProperty(debug, "enabled", { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug.namespaces) { namespacesCache = createDebug.namespaces; enabledCache = createDebug.enabled(namespace); } return enabledCache; }, set: (v7) => { enableOverride = v7; } }); if (typeof createDebug.init === "function") { createDebug.init(debug); } return debug; } __name(createDebug, "createDebug"); function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); newDebug.log = this.log; return newDebug; } __name(extend, "extend"); function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; let i5; const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); const len = split.length; for (i5 = 0; i5 < len; i5++) { if (!split[i5]) { continue; } namespaces = split[i5].replace(/\*/g, ".*?"); if (namespaces[0] === "-") { createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")); } else { createDebug.names.push(new RegExp("^" + namespaces + "$")); } } } __name(enable, "enable"); function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace) ].join(","); createDebug.enable(""); return namespaces; } __name(disable, "disable"); function enabled(name2) { if (name2[name2.length - 1] === "*") { return true; } let i5; let len; for (i5 = 0, len = createDebug.skips.length; i5 < len; i5++) { if (createDebug.skips[i5].test(name2)) { return false; } } for (i5 = 0, len = createDebug.names.length; i5 < len; i5++) { if (createDebug.names[i5].test(name2)) { return true; } } return false; } __name(enabled, "enabled"); function toNamespace(regexp) { return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*"); } __name(toNamespace, "toNamespace"); function coerce2(val2) { if (val2 instanceof Error) { return val2.stack || val2.message; } return val2; } __name(coerce2, "coerce"); function destroy() { console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } __name(destroy, "destroy"); createDebug.enable(createDebug.load()); return createDebug; } __name(setup, "setup"); module3.exports = setup; } }); // ../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/browser.js var require_browser = __commonJS({ "../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/browser.js"(exports2, module3) { init_import_meta_url(); exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; exports2.storage = localstorage(); exports2.destroy = (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } }; })(); exports2.colors = [ "#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33" ]; function useColors() { if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { return true; } if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } let m6; return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== "undefined" && navigator.userAgent && (m6 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m6[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } __name(useColors, "useColors"); function formatArgs(args) { args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module3.exports.humanize(this.diff); if (!this.useColors) { return; } const c6 = "color: " + this.color; args.splice(1, 0, c6, "color: inherit"); let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, (match2) => { if (match2 === "%%") { return; } index++; if (match2 === "%c") { lastC = index; } }); args.splice(lastC, 0, c6); } __name(formatArgs, "formatArgs"); exports2.log = console.debug || console.log || (() => { }); function save(namespaces) { try { if (namespaces) { exports2.storage.setItem("debug", namespaces); } else { exports2.storage.removeItem("debug"); } } catch (error2) { } } __name(save, "save"); function load() { let r7; try { r7 = exports2.storage.getItem("debug"); } catch (error2) { } if (!r7 && typeof process !== "undefined" && "env" in process) { r7 = process.env.DEBUG; } return r7; } __name(load, "load"); function localstorage() { try { return localStorage; } catch (error2) { } } __name(localstorage, "localstorage"); module3.exports = require_common()(exports2); var { formatters: formatters2 } = module3.exports; formatters2.j = function(v7) { try { return JSON.stringify(v7); } catch (error2) { return "[UnexpectedJSONParseError]: " + error2.message; } }; } }); // ../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/node.js var require_node4 = __commonJS({ "../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/node.js"(exports2, module3) { init_import_meta_url(); var tty3 = require("tty"); var util5 = require("util"); exports2.init = init2; exports2.log = log2; exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; exports2.destroy = util5.deprecate( () => { }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." ); exports2.colors = [6, 2, 3, 4, 5, 1]; try { const supportsColor3 = (init_supports_color(), __toCommonJS(supports_color_exports)); if (supportsColor3 && (supportsColor3.stderr || supportsColor3).level >= 2) { exports2.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error2) { } exports2.inspectOpts = Object.keys(process.env).filter((key) => { return /^debug_/i.test(key); }).reduce((obj, key) => { const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_4, k6) => { return k6.toUpperCase(); }); let val2 = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val2)) { val2 = true; } else if (/^(no|off|false|disabled)$/i.test(val2)) { val2 = false; } else if (val2 === "null") { val2 = null; } else { val2 = Number(val2); } obj[prop] = val2; return obj; }, {}); function useColors() { return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty3.isatty(process.stderr.fd); } __name(useColors, "useColors"); function formatArgs(args) { const { namespace: name2, useColors: useColors2 } = this; if (useColors2) { const c6 = this.color; const colorCode = "\x1B[3" + (c6 < 8 ? c6 : "8;5;" + c6); const prefix = ` ${colorCode};1m${name2} \x1B[0m`; args[0] = prefix + args[0].split("\n").join("\n" + prefix); args.push(colorCode + "m+" + module3.exports.humanize(this.diff) + "\x1B[0m"); } else { args[0] = getDate2() + name2 + " " + args[0]; } } __name(formatArgs, "formatArgs"); function getDate2() { if (exports2.inspectOpts.hideDate) { return ""; } return (/* @__PURE__ */ new Date()).toISOString() + " "; } __name(getDate2, "getDate"); function log2(...args) { return process.stderr.write(util5.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); } __name(log2, "log"); function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { delete process.env.DEBUG; } } __name(save, "save"); function load() { return process.env.DEBUG; } __name(load, "load"); function init2(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports2.inspectOpts); for (let i5 = 0; i5 < keys.length; i5++) { debug.inspectOpts[keys[i5]] = exports2.inspectOpts[keys[i5]]; } } __name(init2, "init"); module3.exports = require_common()(exports2); var { formatters: formatters2 } = module3.exports; formatters2.o = function(v7) { this.inspectOpts.colors = this.useColors; return util5.inspect(v7, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); }; formatters2.O = function(v7) { this.inspectOpts.colors = this.useColors; return util5.inspect(v7, this.inspectOpts); }; } }); // ../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/index.js var require_src3 = __commonJS({ "../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/index.js"(exports2, module3) { init_import_meta_url(); if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { module3.exports = require_browser(); } else { module3.exports = require_node4(); } } }); // ../../node_modules/.pnpm/agent-base@7.1.3/node_modules/agent-base/dist/helpers.js var require_helpers = __commonJS({ "../../node_modules/.pnpm/agent-base@7.1.3/node_modules/agent-base/dist/helpers.js"(exports2) { "use strict"; init_import_meta_url(); var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o5, m6, k6, k22) { if (k22 === void 0) k22 = k6; var desc = Object.getOwnPropertyDescriptor(m6, k6); if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m6[k6]; } }; } Object.defineProperty(o5, k22, desc); } : function(o5, m6, k6, k22) { if (k22 === void 0) k22 = k6; o5[k22] = m6[k6]; }); var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o5, v7) { Object.defineProperty(o5, "default", { enumerable: true, value: v7 }); } : function(o5, v7) { o5["default"] = v7; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k6 in mod) if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod, k6)) __createBinding(result, mod, k6); } __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.req = exports2.json = exports2.toBuffer = void 0; var http5 = __importStar(require("http")); var https2 = __importStar(require("https")); async function toBuffer(stream2) { let length = 0; const chunks = []; for await (const chunk of stream2) { length += chunk.length; chunks.push(chunk); } return Buffer.concat(chunks, length); } __name(toBuffer, "toBuffer"); exports2.toBuffer = toBuffer; async function json(stream2) { const buf = await toBuffer(stream2); const str = buf.toString("utf8"); try { return JSON.parse(str); } catch (_err) { const err = _err; err.message += ` (input: ${str})`; throw err; } } __name(json, "json"); exports2.json = json; function req(url4, opts = {}) { const href = typeof url4 === "string" ? url4 : url4.href; const req2 = (href.startsWith("https:") ? https2 : http5).request(url4, opts); const promise = new Promise((resolve25, reject) => { req2.once("response", resolve25).once("error", reject).end(); }); req2.then = promise.then.bind(promise); return req2; } __name(req, "req"); exports2.req = req; } }); // ../../node_modules/.pnpm/agent-base@7.1.3/node_modules/agent-base/dist/index.js var require_dist3 = __commonJS({ "../../node_modules/.pnpm/agent-base@7.1.3/node_modules/agent-base/dist/index.js"(exports2) { "use strict"; init_import_meta_url(); var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o5, m6, k6, k22) { if (k22 === void 0) k22 = k6; var desc = Object.getOwnPropertyDescriptor(m6, k6); if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m6[k6]; } }; } Object.defineProperty(o5, k22, desc); } : function(o5, m6, k6, k22) { if (k22 === void 0) k22 = k6; o5[k22] = m6[k6]; }); var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o5, v7) { Object.defineProperty(o5, "default", { enumerable: true, value: v7 }); } : function(o5, v7) { o5["default"] = v7; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k6 in mod) if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod, k6)) __createBinding(result, mod, k6); } __setModuleDefault(result, mod); return result; }; var __exportStar = exports2 && exports2.__exportStar || function(m6, exports3) { for (var p6 in m6) if (p6 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p6)) __createBinding(exports3, m6, p6); }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Agent = void 0; var net2 = __importStar(require("net")); var http5 = __importStar(require("http")); var https_1 = require("https"); __exportStar(require_helpers(), exports2); var INTERNAL = Symbol("AgentBaseInternalState"); var Agent = class extends http5.Agent { constructor(opts) { super(opts); this[INTERNAL] = {}; } /** * Determine whether this is an `http` or `https` request. */ isSecureEndpoint(options32) { if (options32) { if (typeof options32.secureEndpoint === "boolean") { return options32.secureEndpoint; } if (typeof options32.protocol === "string") { return options32.protocol === "https:"; } } const { stack } = new Error(); if (typeof stack !== "string") return false; return stack.split("\n").some((l6) => l6.indexOf("(https.js:") !== -1 || l6.indexOf("node:https:") !== -1); } // In order to support async signatures in `connect()` and Node's native // connection pooling in `http.Agent`, the array of sockets for each origin // has to be updated synchronously. This is so the length of the array is // accurate when `addRequest()` is next called. We achieve this by creating a // fake socket and adding it to `sockets[origin]` and incrementing // `totalSocketCount`. incrementSockets(name2) { if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) { return null; } if (!this.sockets[name2]) { this.sockets[name2] = []; } const fakeSocket = new net2.Socket({ writable: false }); this.sockets[name2].push(fakeSocket); this.totalSocketCount++; return fakeSocket; } decrementSockets(name2, socket) { if (!this.sockets[name2] || socket === null) { return; } const sockets = this.sockets[name2]; const index = sockets.indexOf(socket); if (index !== -1) { sockets.splice(index, 1); this.totalSocketCount--; if (sockets.length === 0) { delete this.sockets[name2]; } } } // In order to properly update the socket pool, we need to call `getName()` on // the core `https.Agent` if it is a secureEndpoint. getName(options32) { const secureEndpoint = typeof options32.secureEndpoint === "boolean" ? options32.secureEndpoint : this.isSecureEndpoint(options32); if (secureEndpoint) { return https_1.Agent.prototype.getName.call(this, options32); } return super.getName(options32); } createSocket(req, options32, cb2) { const connectOpts = { ...options32, secureEndpoint: this.isSecureEndpoint(options32) }; const name2 = this.getName(connectOpts); const fakeSocket = this.incrementSockets(name2); Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => { this.decrementSockets(name2, fakeSocket); if (socket instanceof http5.Agent) { try { return socket.addRequest(req, connectOpts); } catch (err) { return cb2(err); } } this[INTERNAL].currentSocket = socket; super.createSocket(req, options32, cb2); }, (err) => { this.decrementSockets(name2, fakeSocket); cb2(err); }); } createConnection() { const socket = this[INTERNAL].currentSocket; this[INTERNAL].currentSocket = void 0; if (!socket) { throw new Error("No socket was returned in the `connect()` function"); } return socket; } get defaultPort() { return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); } set defaultPort(v7) { if (this[INTERNAL]) { this[INTERNAL].defaultPort = v7; } } get protocol() { return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); } set protocol(v7) { if (this[INTERNAL]) { this[INTERNAL].protocol = v7; } } }; __name(Agent, "Agent"); exports2.Agent = Agent; } }); // ../../node_modules/.pnpm/https-proxy-agent@7.0.2_supports-color@9.2.2/node_modules/https-proxy-agent/dist/parse-proxy-response.js var require_parse_proxy_response = __commonJS({ "../../node_modules/.pnpm/https-proxy-agent@7.0.2_supports-color@9.2.2/node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports2) { "use strict"; init_import_meta_url(); var __importDefault = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.parseProxyResponse = void 0; var debug_1 = __importDefault(require_src3()); var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); function parseProxyResponse(socket) { return new Promise((resolve25, reject) => { let buffersLength = 0; const buffers = []; function read2() { const b6 = socket.read(); if (b6) ondata(b6); else socket.once("readable", read2); } __name(read2, "read"); function cleanup() { socket.removeListener("end", onend); socket.removeListener("error", onerror); socket.removeListener("readable", read2); } __name(cleanup, "cleanup"); function onend() { cleanup(); debug("onend"); reject(new Error("Proxy connection ended before receiving CONNECT response")); } __name(onend, "onend"); function onerror(err) { cleanup(); debug("onerror %o", err); reject(err); } __name(onerror, "onerror"); function ondata(b6) { buffers.push(b6); buffersLength += b6.length; const buffered = Buffer.concat(buffers, buffersLength); const endOfHeaders = buffered.indexOf("\r\n\r\n"); if (endOfHeaders === -1) { debug("have not received end of HTTP headers yet..."); read2(); return; } const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n"); const firstLine = headerParts.shift(); if (!firstLine) { socket.destroy(); return reject(new Error("No header received from proxy CONNECT response")); } const firstLineParts = firstLine.split(" "); const statusCode = +firstLineParts[1]; const statusText = firstLineParts.slice(2).join(" "); const headers = {}; for (const header of headerParts) { if (!header) continue; const firstColon = header.indexOf(":"); if (firstColon === -1) { socket.destroy(); return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`)); } const key = header.slice(0, firstColon).toLowerCase(); const value = header.slice(firstColon + 1).trimStart(); const current = headers[key]; if (typeof current === "string") { headers[key] = [current, value]; } else if (Array.isArray(current)) { current.push(value); } else { headers[key] = value; } } debug("got proxy server response: %o %o", firstLine, headers); cleanup(); resolve25({ connect: { statusCode, statusText, headers }, buffered }); } __name(ondata, "ondata"); socket.on("error", onerror); socket.on("end", onend); read2(); }); } __name(parseProxyResponse, "parseProxyResponse"); exports2.parseProxyResponse = parseProxyResponse; } }); // ../../node_modules/.pnpm/https-proxy-agent@7.0.2_supports-color@9.2.2/node_modules/https-proxy-agent/dist/index.js var require_dist4 = __commonJS({ "../../node_modules/.pnpm/https-proxy-agent@7.0.2_supports-color@9.2.2/node_modules/https-proxy-agent/dist/index.js"(exports2) { "use strict"; init_import_meta_url(); var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o5, m6, k6, k22) { if (k22 === void 0) k22 = k6; var desc = Object.getOwnPropertyDescriptor(m6, k6); if (!desc || ("get" in desc ? !m6.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m6[k6]; } }; } Object.defineProperty(o5, k22, desc); } : function(o5, m6, k6, k22) { if (k22 === void 0) k22 = k6; o5[k22] = m6[k6]; }); var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o5, v7) { Object.defineProperty(o5, "default", { enumerable: true, value: v7 }); } : function(o5, v7) { o5["default"] = v7; }); var __importStar = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k6 in mod) if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod, k6)) __createBinding(result, mod, k6); } __setModuleDefault(result, mod); return result; }; var __importDefault = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.HttpsProxyAgent = void 0; var net2 = __importStar(require("net")); var tls = __importStar(require("tls")); var assert_1 = __importDefault(require("assert")); var debug_1 = __importDefault(require_src3()); var agent_base_1 = require_dist3(); var parse_proxy_response_1 = require_parse_proxy_response(); var debug = (0, debug_1.default)("https-proxy-agent"); var HttpsProxyAgent3 = class extends agent_base_1.Agent { constructor(proxy2, opts) { super(opts); this.options = { path: void 0 }; this.proxy = typeof proxy2 === "string" ? new URL(proxy2) : proxy2; this.proxyHeaders = opts?.headers ?? {}; debug("Creating new HttpsProxyAgent instance: %o", this.proxy.href); const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ""); const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80; this.connectOpts = { // Attempt to negotiate http/1.1 for proxy servers that support http/2 ALPNProtocols: ["http/1.1"], ...opts ? omit(opts, "headers") : null, host, port }; } /** * Called when the node-core HTTP client library is creating a * new HTTP request. */ async connect(req, opts) { const { proxy: proxy2 } = this; if (!opts.host) { throw new TypeError('No "host" provided'); } let socket; if (proxy2.protocol === "https:") { debug("Creating `tls.Socket`: %o", this.connectOpts); const servername = this.connectOpts.servername || this.connectOpts.host; socket = tls.connect({ ...this.connectOpts, servername: servername && net2.isIP(servername) ? void 0 : servername }); } else { debug("Creating `net.Socket`: %o", this.connectOpts); socket = net2.connect(this.connectOpts); } const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; const host = net2.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r `; if (proxy2.username || proxy2.password) { const auth = `${decodeURIComponent(proxy2.username)}:${decodeURIComponent(proxy2.password)}`; headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } headers.Host = `${host}:${opts.port}`; if (!headers["Proxy-Connection"]) { headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } for (const name2 of Object.keys(headers)) { payload += `${name2}: ${headers[name2]}\r `; } const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket); socket.write(`${payload}\r `); const { connect, buffered } = await proxyResponsePromise; req.emit("proxyConnect", connect); this.emit("proxyConnect", connect, req); if (connect.statusCode === 200) { req.once("socket", resume); if (opts.secureEndpoint) { debug("Upgrading socket connection to TLS"); const servername = opts.servername || opts.host; return tls.connect({ ...omit(opts, "host", "path", "port"), socket, servername: net2.isIP(servername) ? void 0 : servername }); } return socket; } socket.destroy(); const fakeSocket = new net2.Socket({ writable: false }); fakeSocket.readable = true; req.once("socket", (s5) => { debug("Replaying proxy buffer for failed request"); (0, assert_1.default)(s5.listenerCount("data") > 0); s5.push(buffered); s5.push(null); }); return fakeSocket; } }; __name(HttpsProxyAgent3, "HttpsProxyAgent"); HttpsProxyAgent3.protocols = ["http", "https"]; exports2.HttpsProxyAgent = HttpsProxyAgent3; function resume(socket) { socket.resume(); } __name(resume, "resume"); function omit(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; } __name(omit, "omit"); } }); // ../../node_modules/.pnpm/readdirp@4.0.1/node_modules/readdirp/esm/index.js function defaultOptions() { return { root: ".", fileFilter: (_path) => true, directoryFilter: (_path) => true, type: FILE_TYPE, lstat: false, depth: 2147483648, alwaysStat: false, highWaterMark: 4096 }; } var import_fs10, import_promises24, import_stream3, import_path14, RECURSIVE_ERROR_CODE, NORMAL_FLOW_ERRORS, FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE, ALL_TYPES, DIR_TYPES, FILE_TYPES, isNormalFlowError, wantBigintFsStats, emptyFn, normalizeFilter, ReaddirpStream, readdirp; var init_esm = __esm({ "../../node_modules/.pnpm/readdirp@4.0.1/node_modules/readdirp/esm/index.js"() { init_import_meta_url(); import_fs10 = require("fs"); import_promises24 = require("fs/promises"); import_stream3 = require("stream"); import_path14 = require("path"); __name(defaultOptions, "defaultOptions"); RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR"; NORMAL_FLOW_ERRORS = /* @__PURE__ */ new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]); FILE_TYPE = "files"; DIR_TYPE = "directories"; FILE_DIR_TYPE = "files_directories"; EVERYTHING_TYPE = "all"; ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; DIR_TYPES = /* @__PURE__ */ new Set([DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]); FILE_TYPES = /* @__PURE__ */ new Set([FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]); isNormalFlowError = /* @__PURE__ */ __name((error2) => NORMAL_FLOW_ERRORS.has(error2.code), "isNormalFlowError"); wantBigintFsStats = process.platform === "win32"; emptyFn = /* @__PURE__ */ __name((_path) => true, "emptyFn"); normalizeFilter = /* @__PURE__ */ __name((filter) => { if (filter === void 0) return emptyFn; if (typeof filter === "function") return filter; if (typeof filter === "string") { const fl = filter.trim(); return (entry) => entry.basename === fl; } if (Array.isArray(filter)) { const trItems = filter.map((item) => item.trim()); return (entry) => trItems.some((f5) => entry.basename === f5); } return emptyFn; }, "normalizeFilter"); ReaddirpStream = class extends import_stream3.Readable { constructor(options32 = {}) { super({ objectMode: true, autoDestroy: true, highWaterMark: options32.highWaterMark }); const opts = { ...defaultOptions(), ...options32 }; const { root, type } = opts; this._fileFilter = normalizeFilter(opts.fileFilter); this._directoryFilter = normalizeFilter(opts.directoryFilter); const statMethod = opts.lstat ? import_fs10.lstatSync : import_fs10.statSync; if (wantBigintFsStats) { this._stat = (path72) => statMethod(path72, { bigint: true }); } else { this._stat = statMethod; } this._maxDepth = opts.depth; this._wantsDir = DIR_TYPES.has(type); this._wantsFile = FILE_TYPES.has(type); this._wantsEverything = type === EVERYTHING_TYPE; this._root = (0, import_path14.resolve)(root); this._isDirent = !opts.alwaysStat; this._statsProp = this._isDirent ? "dirent" : "stats"; this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent }; this.parents = [this._exploreDir(root, 1)]; this.reading = false; this.parent = void 0; } async _read(batch) { if (this.reading) return; this.reading = true; try { while (!this.destroyed && batch > 0) { const par = this.parent; const fil = par && par.files; if (fil && fil.length > 0) { const { path: path72, depth } = par; const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path72)); for (const entry of slice) { if (!entry) { batch--; return; } if (this.destroyed) return; const entryType = await this._getEntryType(entry); if (entryType === "directory" && this._directoryFilter(entry)) { if (depth <= this._maxDepth) { this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); } if (this._wantsDir) { this.push(entry); batch--; } } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) { if (this._wantsFile) { this.push(entry); batch--; } } } } else { const parent = this.parents.pop(); if (!parent) { this.push(null); break; } this.parent = await parent; if (this.destroyed) return; } } } catch (error2) { this.destroy(error2); } finally { this.reading = false; } } async _exploreDir(path72, depth) { let files; try { files = await (0, import_promises24.readdir)(path72, this._rdOptions); } catch (error2) { this._onError(error2); } return { files, depth, path: path72 }; } _formatEntry(dirent, path72) { let entry; const basename7 = this._isDirent ? dirent.name : dirent; try { const fullPath = (0, import_path14.resolve)((0, import_path14.join)(path72, basename7)); entry = { path: (0, import_path14.relative)(this._root, fullPath), fullPath, basename: basename7 }; entry[this._statsProp] = this._isDirent ? dirent : this._stat(fullPath); } catch (err) { this._onError(err); return; } return entry; } _onError(err) { if (isNormalFlowError(err) && !this.destroyed) { this.emit("warn", err); } else { this.destroy(err); } } async _getEntryType(entry) { if (!entry && this._statsProp in entry) { return ""; } const stats = entry[this._statsProp]; if (stats.isFile()) return "file"; if (stats.isDirectory()) return "directory"; if (stats && stats.isSymbolicLink()) { const full = entry.fullPath; try { const entryRealPath = await (0, import_promises24.realpath)(full); const entryRealPathStats = (0, import_fs10.lstatSync)(entryRealPath); if (entryRealPathStats.isFile()) { return "file"; } if (entryRealPathStats.isDirectory()) { const len = entryRealPath.length; if (full.startsWith(entryRealPath) && full.substr(len, 1) === import_path14.sep) { const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`); recursiveError.code = RECURSIVE_ERROR_CODE; return this._onError(recursiveError); } return "directory"; } } catch (error2) { this._onError(error2); return ""; } } } _includeAsFile(entry) { const stats = entry && entry[this._statsProp]; return stats && this._wantsEverything && !stats.isDirectory(); } }; __name(ReaddirpStream, "ReaddirpStream"); readdirp = /* @__PURE__ */ __name((root, options32 = {}) => { let type = options32.entryType || options32.type; if (type === "both") type = FILE_DIR_TYPE; if (type) options32.type = type; if (!root) { throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)"); } else if (typeof root !== "string") { throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)"); } else if (type && !ALL_TYPES.includes(type)) { throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`); } options32.root = root; return new ReaddirpStream(options32); }, "readdirp"); } }); // ../../node_modules/.pnpm/chokidar@4.0.1/node_modules/chokidar/esm/handler.js function createFsWatchInstance(path72, options32, listener, errHandler, emitRaw) { const handleEvent = /* @__PURE__ */ __name((rawEvent, evPath) => { listener(path72); emitRaw(rawEvent, evPath, { watchedPath: path72 }); if (evPath && path72 !== evPath) { fsWatchBroadcast(sysPath.resolve(path72, evPath), KEY_LISTENERS, sysPath.join(path72, evPath)); } }, "handleEvent"); try { return (0, import_fs11.watch)(path72, { persistent: options32.persistent }, handleEvent); } catch (error2) { errHandler(error2); return void 0; } } var import_fs11, import_promises25, sysPath, import_os4, STR_DATA, STR_END, STR_CLOSE, EMPTY_FN, pl2, isWindows2, isMacos, isLinux, isIBMi, EVENTS, EV, THROTTLE_MODE_WATCH, statMethods, KEY_LISTENERS, KEY_ERR, KEY_RAW, HANDLER_KEYS, binaryExtensions, isBinaryPath, foreach, addAndConvert, clearItem, delFromSet, isEmptySet, FsWatchInstances, fsWatchBroadcast, setFsWatchListener, FsWatchFileInstances, setFsWatchFileListener, NodeFsHandler; var init_handler = __esm({ "../../node_modules/.pnpm/chokidar@4.0.1/node_modules/chokidar/esm/handler.js"() { init_import_meta_url(); import_fs11 = require("fs"); import_promises25 = require("fs/promises"); sysPath = __toESM(require("path"), 1); import_os4 = require("os"); STR_DATA = "data"; STR_END = "end"; STR_CLOSE = "close"; EMPTY_FN = /* @__PURE__ */ __name(() => { }, "EMPTY_FN"); pl2 = process.platform; isWindows2 = pl2 === "win32"; isMacos = pl2 === "darwin"; isLinux = pl2 === "linux"; isIBMi = (0, import_os4.type)() === "OS400"; EVENTS = { ALL: "all", READY: "ready", ADD: "add", CHANGE: "change", ADD_DIR: "addDir", UNLINK: "unlink", UNLINK_DIR: "unlinkDir", RAW: "raw", ERROR: "error" }; EV = EVENTS; THROTTLE_MODE_WATCH = "watch"; statMethods = { lstat: import_promises25.lstat, stat: import_promises25.stat }; KEY_LISTENERS = "listeners"; KEY_ERR = "errHandlers"; KEY_RAW = "rawEmitters"; HANDLER_KEYS = [KEY_LISTENERS, KEY_ERR, KEY_RAW]; binaryExtensions = /* @__PURE__ */ new Set([ "3dm", "3ds", "3g2", "3gp", "7z", "a", "aac", "adp", "afdesign", "afphoto", "afpub", "ai", "aif", "aiff", "alz", "ape", "apk", "appimage", "ar", "arj", "asf", "au", "avi", "bak", "baml", "bh", "bin", "bk", "bmp", "btif", "bz2", "bzip2", "cab", "caf", "cgm", "class", "cmx", "cpio", "cr2", "cur", "dat", "dcm", "deb", "dex", "djvu", "dll", "dmg", "dng", "doc", "docm", "docx", "dot", "dotm", "dra", "DS_Store", "dsk", "dts", "dtshd", "dvb", "dwg", "dxf", "ecelp4800", "ecelp7470", "ecelp9600", "egg", "eol", "eot", "epub", "exe", "f4v", "fbs", "fh", "fla", "flac", "flatpak", "fli", "flv", "fpx", "fst", "fvt", "g3", "gh", "gif", "graffle", "gz", "gzip", "h261", "h263", "h264", "icns", "ico", "ief", "img", "ipa", "iso", "jar", "jpeg", "jpg", "jpgv", "jpm", "jxr", "key", "ktx", "lha", "lib", "lvp", "lz", "lzh", "lzma", "lzo", "m3u", "m4a", "m4v", "mar", "mdi", "mht", "mid", "midi", "mj2", "mka", "mkv", "mmr", "mng", "mobi", "mov", "movie", "mp3", "mp4", "mp4a", "mpeg", "mpg", "mpga", "mxu", "nef", "npx", "numbers", "nupkg", "o", "odp", "ods", "odt", "oga", "ogg", "ogv", "otf", "ott", "pages", "pbm", "pcx", "pdb", "pdf", "pea", "pgm", "pic", "png", "pnm", "pot", "potm", "potx", "ppa", "ppam", "ppm", "pps", "ppsm", "ppsx", "ppt", "pptm", "pptx", "psd", "pya", "pyc", "pyo", "pyv", "qt", "rar", "ras", "raw", "resources", "rgb", "rip", "rlc", "rmf", "rmvb", "rpm", "rtf", "rz", "s3m", "s7z", "scpt", "sgi", "shar", "snap", "sil", "sketch", "slk", "smv", "snk", "so", "stl", "suo", "sub", "swf", "tar", "tbz", "tbz2", "tga", "tgz", "thmx", "tif", "tiff", "tlz", "ttc", "ttf", "txz", "udf", "uvh", "uvi", "uvm", "uvp", "uvs", "uvu", "viv", "vob", "war", "wav", "wax", "wbmp", "wdp", "weba", "webm", "webp", "whl", "wim", "wm", "wma", "wmv", "wmx", "woff", "woff2", "wrm", "wvx", "xbm", "xif", "xla", "xlam", "xls", "xlsb", "xlsm", "xlsx", "xlt", "xltm", "xltx", "xm", "xmind", "xpi", "xpm", "xwd", "xz", "z", "zip", "zipx" ]); isBinaryPath = /* @__PURE__ */ __name((filePath) => binaryExtensions.has(sysPath.extname(filePath).slice(1).toLowerCase()), "isBinaryPath"); foreach = /* @__PURE__ */ __name((val2, fn2) => { if (val2 instanceof Set) { val2.forEach(fn2); } else { fn2(val2); } }, "foreach"); addAndConvert = /* @__PURE__ */ __name((main2, prop, item) => { let container = main2[prop]; if (!(container instanceof Set)) { main2[prop] = container = /* @__PURE__ */ new Set([container]); } container.add(item); }, "addAndConvert"); clearItem = /* @__PURE__ */ __name((cont) => (key) => { const set = cont[key]; if (set instanceof Set) { set.clear(); } else { delete cont[key]; } }, "clearItem"); delFromSet = /* @__PURE__ */ __name((main2, prop, item) => { const container = main2[prop]; if (container instanceof Set) { container.delete(item); } else if (container === item) { delete main2[prop]; } }, "delFromSet"); isEmptySet = /* @__PURE__ */ __name((val2) => val2 instanceof Set ? val2.size === 0 : !val2, "isEmptySet"); FsWatchInstances = /* @__PURE__ */ new Map(); __name(createFsWatchInstance, "createFsWatchInstance"); fsWatchBroadcast = /* @__PURE__ */ __name((fullPath, listenerType, val1, val2, val3) => { const cont = FsWatchInstances.get(fullPath); if (!cont) return; foreach(cont[listenerType], (listener) => { listener(val1, val2, val3); }); }, "fsWatchBroadcast"); setFsWatchListener = /* @__PURE__ */ __name((path72, fullPath, options32, handlers2) => { const { listener, errHandler, rawEmitter } = handlers2; let cont = FsWatchInstances.get(fullPath); let watcher; if (!options32.persistent) { watcher = createFsWatchInstance(path72, options32, listener, errHandler, rawEmitter); if (!watcher) return; return watcher.close.bind(watcher); } if (cont) { addAndConvert(cont, KEY_LISTENERS, listener); addAndConvert(cont, KEY_ERR, errHandler); addAndConvert(cont, KEY_RAW, rawEmitter); } else { watcher = createFsWatchInstance( path72, options32, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, // no need to use broadcast here fsWatchBroadcast.bind(null, fullPath, KEY_RAW) ); if (!watcher) return; watcher.on(EV.ERROR, async (error2) => { const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR); if (cont) cont.watcherUnusable = true; if (isWindows2 && error2.code === "EPERM") { try { const fd = await (0, import_promises25.open)(path72, "r"); await fd.close(); broadcastErr(error2); } catch (err) { } } else { broadcastErr(error2); } }); cont = { listeners: listener, errHandlers: errHandler, rawEmitters: rawEmitter, watcher }; FsWatchInstances.set(fullPath, cont); } return () => { delFromSet(cont, KEY_LISTENERS, listener); delFromSet(cont, KEY_ERR, errHandler); delFromSet(cont, KEY_RAW, rawEmitter); if (isEmptySet(cont.listeners)) { cont.watcher.close(); FsWatchInstances.delete(fullPath); HANDLER_KEYS.forEach(clearItem(cont)); cont.watcher = void 0; Object.freeze(cont); } }; }, "setFsWatchListener"); FsWatchFileInstances = /* @__PURE__ */ new Map(); setFsWatchFileListener = /* @__PURE__ */ __name((path72, fullPath, options32, handlers2) => { const { listener, rawEmitter } = handlers2; let cont = FsWatchFileInstances.get(fullPath); const copts = cont && cont.options; if (copts && (copts.persistent < options32.persistent || copts.interval > options32.interval)) { (0, import_fs11.unwatchFile)(fullPath); cont = void 0; } if (cont) { addAndConvert(cont, KEY_LISTENERS, listener); addAndConvert(cont, KEY_RAW, rawEmitter); } else { cont = { listeners: listener, rawEmitters: rawEmitter, options: options32, watcher: (0, import_fs11.watchFile)(fullPath, options32, (curr, prev) => { foreach(cont.rawEmitters, (rawEmitter2) => { rawEmitter2(EV.CHANGE, fullPath, { curr, prev }); }); const currmtime = curr.mtimeMs; if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) { foreach(cont.listeners, (listener2) => listener2(path72, curr)); } }) }; FsWatchFileInstances.set(fullPath, cont); } return () => { delFromSet(cont, KEY_LISTENERS, listener); delFromSet(cont, KEY_RAW, rawEmitter); if (isEmptySet(cont.listeners)) { FsWatchFileInstances.delete(fullPath); (0, import_fs11.unwatchFile)(fullPath); cont.options = cont.watcher = void 0; Object.freeze(cont); } }; }, "setFsWatchFileListener"); NodeFsHandler = class { constructor(fsW) { this.fsw = fsW; this._boundHandleError = (error2) => fsW._handleError(error2); } /** * Watch file for changes with fs_watchFile or fs_watch. * @param path to file or dir * @param listener on fs change * @returns closer for the watcher instance */ _watchWithNodeFs(path72, listener) { const opts = this.fsw.options; const directory = sysPath.dirname(path72); const basename7 = sysPath.basename(path72); const parent = this.fsw._getWatchedDir(directory); parent.add(basename7); const absolutePath = sysPath.resolve(path72); const options32 = { persistent: opts.persistent }; if (!listener) listener = EMPTY_FN; let closer; if (opts.usePolling) { const enableBin = opts.interval !== opts.binaryInterval; options32.interval = enableBin && isBinaryPath(basename7) ? opts.binaryInterval : opts.interval; closer = setFsWatchFileListener(path72, absolutePath, options32, { listener, rawEmitter: this.fsw._emitRaw }); } else { closer = setFsWatchListener(path72, absolutePath, options32, { listener, errHandler: this._boundHandleError, rawEmitter: this.fsw._emitRaw }); } return closer; } /** * Watch a file and emit add event if warranted. * @returns closer for the watcher instance */ _handleFile(file, stats, initialAdd) { if (this.fsw.closed) { return; } const dirname17 = sysPath.dirname(file); const basename7 = sysPath.basename(file); const parent = this.fsw._getWatchedDir(dirname17); let prevStats = stats; if (parent.has(basename7)) return; const listener = /* @__PURE__ */ __name(async (path72, newStats) => { if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return; if (!newStats || newStats.mtimeMs === 0) { try { const newStats2 = await (0, import_promises25.stat)(file); if (this.fsw.closed) return; const at2 = newStats2.atimeMs; const mt2 = newStats2.mtimeMs; if (!at2 || at2 <= mt2 || mt2 !== prevStats.mtimeMs) { this.fsw._emit(EV.CHANGE, file, newStats2); } if ((isMacos || isLinux) && prevStats.ino !== newStats2.ino) { this.fsw._closeFile(path72); prevStats = newStats2; const closer2 = this._watchWithNodeFs(file, listener); if (closer2) this.fsw._addPathCloser(path72, closer2); } else { prevStats = newStats2; } } catch (error2) { this.fsw._remove(dirname17, basename7); } } else if (parent.has(basename7)) { const at2 = newStats.atimeMs; const mt2 = newStats.mtimeMs; if (!at2 || at2 <= mt2 || mt2 !== prevStats.mtimeMs) { this.fsw._emit(EV.CHANGE, file, newStats); } prevStats = newStats; } }, "listener"); const closer = this._watchWithNodeFs(file, listener); if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) { if (!this.fsw._throttle(EV.ADD, file, 0)) return; this.fsw._emit(EV.ADD, file, stats); } return closer; } /** * Handle symlinks encountered while reading a dir. * @param entry returned by readdirp * @param directory path of dir being read * @param path of this item * @param item basename of this item * @returns true if no more processing is needed for this entry. */ async _handleSymlink(entry, directory, path72, item) { if (this.fsw.closed) { return; } const full = entry.fullPath; const dir = this.fsw._getWatchedDir(directory); if (!this.fsw.options.followSymlinks) { this.fsw._incrReadyCount(); let linkPath; try { linkPath = await (0, import_promises25.realpath)(path72); } catch (e7) { this.fsw._emitReady(); return true; } if (this.fsw.closed) return; if (dir.has(item)) { if (this.fsw._symlinkPaths.get(full) !== linkPath) { this.fsw._symlinkPaths.set(full, linkPath); this.fsw._emit(EV.CHANGE, path72, entry.stats); } } else { dir.add(item); this.fsw._symlinkPaths.set(full, linkPath); this.fsw._emit(EV.ADD, path72, entry.stats); } this.fsw._emitReady(); return true; } if (this.fsw._symlinkPaths.has(full)) { return true; } this.fsw._symlinkPaths.set(full, true); } _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { directory = sysPath.join(directory, ""); throttler = this.fsw._throttle("readdir", directory, 1e3); if (!throttler) return; const previous = this.fsw._getWatchedDir(wh.path); const current = /* @__PURE__ */ new Set(); let stream2 = this.fsw._readdirp(directory, { fileFilter: (entry) => wh.filterPath(entry), directoryFilter: (entry) => wh.filterDir(entry) }); if (!stream2) return; stream2.on(STR_DATA, async (entry) => { if (this.fsw.closed) { stream2 = void 0; return; } const item = entry.path; let path72 = sysPath.join(directory, item); current.add(item); if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path72, item)) { return; } if (this.fsw.closed) { stream2 = void 0; return; } if (item === target || !target && !previous.has(item)) { this.fsw._incrReadyCount(); path72 = sysPath.join(dir, sysPath.relative(dir, path72)); this._addToNodeFs(path72, initialAdd, wh, depth + 1); } }).on(EV.ERROR, this._boundHandleError); return new Promise((resolve25, reject) => { if (!stream2) return reject(); stream2.once(STR_END, () => { if (this.fsw.closed) { stream2 = void 0; return; } const wasThrottled = throttler ? throttler.clear() : false; resolve25(void 0); previous.getChildren().filter((item) => { return item !== directory && !current.has(item); }).forEach((item) => { this.fsw._remove(directory, item); }); stream2 = void 0; if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler); }); }); } /** * Read directory to add / remove files from `@watched` list and re-read it on change. * @param dir fs path * @param stats * @param initialAdd * @param depth relative to user-supplied path * @param target child path targeted for watch * @param wh Common watch helpers for this path * @param realpath * @returns closer for the watcher instance. */ async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath2) { const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir)); const tracked = parentDir.has(sysPath.basename(dir)); if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) { this.fsw._emit(EV.ADD_DIR, dir, stats); } parentDir.add(sysPath.basename(dir)); this.fsw._getWatchedDir(dir); let throttler; let closer; const oDepth = this.fsw.options.depth; if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath2)) { if (!target) { await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler); if (this.fsw.closed) return; } closer = this._watchWithNodeFs(dir, (dirPath, stats2) => { if (stats2 && stats2.mtimeMs === 0) return; this._handleRead(dirPath, false, wh, target, dir, depth, throttler); }); } return closer; } /** * Handle added file, directory, or glob pattern. * Delegates call to _handleFile / _handleDir after checks. * @param path to file or ir * @param initialAdd was the file added at watch instantiation? * @param priorWh depth relative to user-supplied path * @param depth Child path actually targeted for watch * @param target Child path actually targeted for watch */ async _addToNodeFs(path72, initialAdd, priorWh, depth, target) { const ready = this.fsw._emitReady; if (this.fsw._isIgnored(path72) || this.fsw.closed) { ready(); return false; } const wh = this.fsw._getWatchHelpers(path72); if (priorWh) { wh.filterPath = (entry) => priorWh.filterPath(entry); wh.filterDir = (entry) => priorWh.filterDir(entry); } try { const stats = await statMethods[wh.statMethod](wh.watchPath); if (this.fsw.closed) return; if (this.fsw._isIgnored(wh.watchPath, stats)) { ready(); return false; } const follow = this.fsw.options.followSymlinks; let closer; if (stats.isDirectory()) { const absPath = sysPath.resolve(path72); const targetPath = follow ? await (0, import_promises25.realpath)(path72) : path72; if (this.fsw.closed) return; closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath); if (this.fsw.closed) return; if (absPath !== targetPath && targetPath !== void 0) { this.fsw._symlinkPaths.set(absPath, targetPath); } } else if (stats.isSymbolicLink()) { const targetPath = follow ? await (0, import_promises25.realpath)(path72) : path72; if (this.fsw.closed) return; const parent = sysPath.dirname(wh.watchPath); this.fsw._getWatchedDir(parent).add(wh.watchPath); this.fsw._emit(EV.ADD, wh.watchPath, stats); closer = await this._handleDir(parent, stats, initialAdd, depth, path72, wh, targetPath); if (this.fsw.closed) return; if (targetPath !== void 0) { this.fsw._symlinkPaths.set(sysPath.resolve(path72), targetPath); } } else { closer = this._handleFile(wh.watchPath, stats, initialAdd); } ready(); if (closer) this.fsw._addPathCloser(path72, closer); return false; } catch (error2) { if (this.fsw._handleError(error2)) { ready(); return path72; } } } }; __name(NodeFsHandler, "NodeFsHandler"); } }); // ../../node_modules/.pnpm/chokidar@4.0.1/node_modules/chokidar/esm/index.js function arrify(item) { return Array.isArray(item) ? item : [item]; } function createPattern(matcher) { if (typeof matcher === "function") return matcher; if (typeof matcher === "string") return (string) => matcher === string; if (matcher instanceof RegExp) return (string) => matcher.test(string); if (typeof matcher === "object" && matcher !== null) { return (string) => { if (matcher.path === string) return true; if (matcher.recursive) { const relative15 = sysPath2.relative(matcher.path, string); if (!relative15) { return false; } return !relative15.startsWith("..") && !sysPath2.isAbsolute(relative15); } return false; }; } return () => false; } function normalizePath(path72) { if (typeof path72 !== "string") throw new Error("string expected"); path72 = sysPath2.normalize(path72); path72 = path72.replace(/\\/g, "/"); let prepend = false; if (path72.startsWith("//")) prepend = true; const DOUBLE_SLASH_RE2 = /\/\//; while (path72.match(DOUBLE_SLASH_RE2)) path72 = path72.replace(DOUBLE_SLASH_RE2, "/"); if (prepend) path72 = "/" + path72; return path72; } function matchPatterns(patterns, testString, stats) { const path72 = normalizePath(testString); for (let index = 0; index < patterns.length; index++) { const pattern = patterns[index]; if (pattern(path72, stats)) { return true; } } return false; } function anymatch(matchers, testString) { if (matchers == null) { throw new TypeError("anymatch: specify first argument"); } const matchersArray = arrify(matchers); const patterns = matchersArray.map((matcher) => createPattern(matcher)); if (testString == null) { return (testString2, stats) => { return matchPatterns(patterns, testString2, stats); }; } return matchPatterns(patterns, testString); } function watch(paths, options32 = {}) { const watcher = new FSWatcher(options32); watcher.add(paths); return watcher; } var import_fs12, import_promises26, import_events4, sysPath2, SLASH, SLASH_SLASH, ONE_DOT, TWO_DOTS, STRING_TYPE, BACK_SLASH_RE, DOUBLE_SLASH_RE, DOT_RE, REPLACER_RE, isMatcherObject, unifyPaths, toUnix, normalizePathToUnix, normalizeIgnored, getAbsolutePath, EMPTY_SET, DirEntry, STAT_METHOD_F, STAT_METHOD_L, WatchHelper, FSWatcher; var init_esm2 = __esm({ "../../node_modules/.pnpm/chokidar@4.0.1/node_modules/chokidar/esm/index.js"() { init_import_meta_url(); import_fs12 = require("fs"); import_promises26 = require("fs/promises"); import_events4 = require("events"); sysPath2 = __toESM(require("path"), 1); init_esm(); init_handler(); SLASH = "/"; SLASH_SLASH = "//"; ONE_DOT = "."; TWO_DOTS = ".."; STRING_TYPE = "string"; BACK_SLASH_RE = /\\/g; DOUBLE_SLASH_RE = /\/\//; DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/; REPLACER_RE = /^\.[/\\]/; __name(arrify, "arrify"); isMatcherObject = /* @__PURE__ */ __name((matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp), "isMatcherObject"); __name(createPattern, "createPattern"); __name(normalizePath, "normalizePath"); __name(matchPatterns, "matchPatterns"); __name(anymatch, "anymatch"); unifyPaths = /* @__PURE__ */ __name((paths_) => { const paths = arrify(paths_).flat(); if (!paths.every((p6) => typeof p6 === STRING_TYPE)) { throw new TypeError(`Non-string provided as watch path: ${paths}`); } return paths.map(normalizePathToUnix); }, "unifyPaths"); toUnix = /* @__PURE__ */ __name((string) => { let str = string.replace(BACK_SLASH_RE, SLASH); let prepend = false; if (str.startsWith(SLASH_SLASH)) { prepend = true; } while (str.match(DOUBLE_SLASH_RE)) { str = str.replace(DOUBLE_SLASH_RE, SLASH); } if (prepend) { str = SLASH + str; } return str; }, "toUnix"); normalizePathToUnix = /* @__PURE__ */ __name((path72) => toUnix(sysPath2.normalize(toUnix(path72))), "normalizePathToUnix"); normalizeIgnored = /* @__PURE__ */ __name((cwd2 = "") => (path72) => { if (typeof path72 === "string") { return normalizePathToUnix(sysPath2.isAbsolute(path72) ? path72 : sysPath2.join(cwd2, path72)); } else { return path72; } }, "normalizeIgnored"); getAbsolutePath = /* @__PURE__ */ __name((path72, cwd2) => { if (sysPath2.isAbsolute(path72)) { return path72; } return sysPath2.join(cwd2, path72); }, "getAbsolutePath"); EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set()); DirEntry = class { constructor(dir, removeWatcher) { this.path = dir; this._removeWatcher = removeWatcher; this.items = /* @__PURE__ */ new Set(); } add(item) { const { items } = this; if (!items) return; if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item); } async remove(item) { const { items } = this; if (!items) return; items.delete(item); if (items.size > 0) return; const dir = this.path; try { await (0, import_promises26.readdir)(dir); } catch (err) { if (this._removeWatcher) { this._removeWatcher(sysPath2.dirname(dir), sysPath2.basename(dir)); } } } has(item) { const { items } = this; if (!items) return; return items.has(item); } getChildren() { const { items } = this; if (!items) return []; return [...items.values()]; } dispose() { this.items.clear(); this.path = ""; this._removeWatcher = EMPTY_FN; this.items = EMPTY_SET; Object.freeze(this); } }; __name(DirEntry, "DirEntry"); STAT_METHOD_F = "stat"; STAT_METHOD_L = "lstat"; WatchHelper = class { constructor(path72, follow, fsw) { this.fsw = fsw; const watchPath = path72; this.path = path72 = path72.replace(REPLACER_RE, ""); this.watchPath = watchPath; this.fullWatchPath = sysPath2.resolve(watchPath); this.dirParts = []; this.dirParts.forEach((parts) => { if (parts.length > 1) parts.pop(); }); this.followSymlinks = follow; this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L; } entryPath(entry) { return sysPath2.join(this.watchPath, sysPath2.relative(this.watchPath, entry.fullPath)); } filterPath(entry) { const { stats } = entry; if (stats && stats.isSymbolicLink()) return this.filterDir(entry); const resolvedPath2 = this.entryPath(entry); return this.fsw._isntIgnored(resolvedPath2, stats) && this.fsw._hasReadPermissions(stats); } filterDir(entry) { return this.fsw._isntIgnored(this.entryPath(entry), entry.stats); } }; __name(WatchHelper, "WatchHelper"); FSWatcher = class extends import_events4.EventEmitter { // Not indenting methods for history sake; for now. constructor(_opts = {}) { super(); this.closed = false; this._closers = /* @__PURE__ */ new Map(); this._ignoredPaths = /* @__PURE__ */ new Set(); this._throttled = /* @__PURE__ */ new Map(); this._streams = /* @__PURE__ */ new Set(); this._symlinkPaths = /* @__PURE__ */ new Map(); this._watched = /* @__PURE__ */ new Map(); this._pendingWrites = /* @__PURE__ */ new Map(); this._pendingUnlinks = /* @__PURE__ */ new Map(); this._readyCount = 0; this._readyEmitted = false; const awf = _opts.awaitWriteFinish; const DEF_AWF = { stabilityThreshold: 2e3, pollInterval: 100 }; const opts = { // Defaults persistent: true, ignoreInitial: false, ignorePermissionErrors: false, interval: 100, binaryInterval: 300, followSymlinks: true, usePolling: false, // useAsync: false, atomic: true, // NOTE: overwritten later (depends on usePolling) ..._opts, // Change format ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]), awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? { ...DEF_AWF, ...awf } : false }; if (isIBMi) opts.usePolling = true; if (opts.atomic === void 0) opts.atomic = !opts.usePolling; const envPoll = process.env.CHOKIDAR_USEPOLLING; if (envPoll !== void 0) { const envLower = envPoll.toLowerCase(); if (envLower === "false" || envLower === "0") opts.usePolling = false; else if (envLower === "true" || envLower === "1") opts.usePolling = true; else opts.usePolling = !!envLower; } const envInterval = process.env.CHOKIDAR_INTERVAL; if (envInterval) opts.interval = Number.parseInt(envInterval, 10); let readyCalls = 0; this._emitReady = () => { readyCalls++; if (readyCalls >= this._readyCount) { this._emitReady = EMPTY_FN; this._readyEmitted = true; process.nextTick(() => this.emit(EVENTS.READY)); } }; this._emitRaw = (...args) => this.emit(EVENTS.RAW, ...args); this._boundRemove = this._remove.bind(this); this.options = opts; this._nodeFsHandler = new NodeFsHandler(this); Object.freeze(opts); } _addIgnoredPath(matcher) { if (isMatcherObject(matcher)) { for (const ignored of this._ignoredPaths) { if (isMatcherObject(ignored) && ignored.path === matcher.path && ignored.recursive === matcher.recursive) { return; } } } this._ignoredPaths.add(matcher); } _removeIgnoredPath(matcher) { this._ignoredPaths.delete(matcher); if (typeof matcher === "string") { for (const ignored of this._ignoredPaths) { if (isMatcherObject(ignored) && ignored.path === matcher) { this._ignoredPaths.delete(ignored); } } } } // Public methods /** * Adds paths to be watched on an existing FSWatcher instance. * @param paths_ file or file list. Other arguments are unused */ add(paths_, _origAdd, _internal) { const { cwd: cwd2 } = this.options; this.closed = false; this._closePromise = void 0; let paths = unifyPaths(paths_); if (cwd2) { paths = paths.map((path72) => { const absPath = getAbsolutePath(path72, cwd2); return absPath; }); } paths.forEach((path72) => { this._removeIgnoredPath(path72); }); this._userIgnored = void 0; if (!this._readyCount) this._readyCount = 0; this._readyCount += paths.length; Promise.all(paths.map(async (path72) => { const res = await this._nodeFsHandler._addToNodeFs(path72, !_internal, void 0, 0, _origAdd); if (res) this._emitReady(); return res; })).then((results) => { if (this.closed) return; results.forEach((item) => { if (item) this.add(sysPath2.dirname(item), sysPath2.basename(_origAdd || item)); }); }); return this; } /** * Close watchers or start ignoring events from specified paths. */ unwatch(paths_) { if (this.closed) return this; const paths = unifyPaths(paths_); const { cwd: cwd2 } = this.options; paths.forEach((path72) => { if (!sysPath2.isAbsolute(path72) && !this._closers.has(path72)) { if (cwd2) path72 = sysPath2.join(cwd2, path72); path72 = sysPath2.resolve(path72); } this._closePath(path72); this._addIgnoredPath(path72); if (this._watched.has(path72)) { this._addIgnoredPath({ path: path72, recursive: true }); } this._userIgnored = void 0; }); return this; } /** * Close watchers and remove all listeners from watched paths. */ close() { if (this._closePromise) { return this._closePromise; } this.closed = true; this.removeAllListeners(); const closers = []; this._closers.forEach((closerList) => closerList.forEach((closer) => { const promise = closer(); if (promise instanceof Promise) closers.push(promise); })); this._streams.forEach((stream2) => stream2.destroy()); this._userIgnored = void 0; this._readyCount = 0; this._readyEmitted = false; this._watched.forEach((dirent) => dirent.dispose()); this._closers.clear(); this._watched.clear(); this._streams.clear(); this._symlinkPaths.clear(); this._throttled.clear(); this._closePromise = closers.length ? Promise.all(closers).then(() => void 0) : Promise.resolve(); return this._closePromise; } /** * Expose list of watched paths * @returns for chaining */ getWatched() { const watchList = {}; this._watched.forEach((entry, dir) => { const key = this.options.cwd ? sysPath2.relative(this.options.cwd, dir) : dir; const index = key || ONE_DOT; watchList[index] = entry.getChildren().sort(); }); return watchList; } emitWithAll(event, args) { this.emit(...args); if (event !== EVENTS.ERROR) this.emit(EVENTS.ALL, ...args); } // Common helpers // -------------- /** * Normalize and emit events. * Calling _emit DOES NOT MEAN emit() would be called! * @param event Type of event * @param path File or directory path * @param stats arguments to be passed with event * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag */ async _emit(event, path72, stats) { if (this.closed) return; const opts = this.options; if (isWindows2) path72 = sysPath2.normalize(path72); if (opts.cwd) path72 = sysPath2.relative(opts.cwd, path72); const args = [event, path72]; if (stats != null) args.push(stats); const awf = opts.awaitWriteFinish; let pw; if (awf && (pw = this._pendingWrites.get(path72))) { pw.lastChange = /* @__PURE__ */ new Date(); return this; } if (opts.atomic) { if (event === EVENTS.UNLINK) { this._pendingUnlinks.set(path72, args); setTimeout(() => { this._pendingUnlinks.forEach((entry, path73) => { this.emit(...entry); this.emit(EVENTS.ALL, ...entry); this._pendingUnlinks.delete(path73); }); }, typeof opts.atomic === "number" ? opts.atomic : 100); return this; } if (event === EVENTS.ADD && this._pendingUnlinks.has(path72)) { event = args[0] = EVENTS.CHANGE; this._pendingUnlinks.delete(path72); } } if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) { const awfEmit = /* @__PURE__ */ __name((err, stats2) => { if (err) { event = args[0] = EVENTS.ERROR; args[1] = err; this.emitWithAll(event, args); } else if (stats2) { if (args.length > 2) { args[2] = stats2; } else { args.push(stats2); } this.emitWithAll(event, args); } }, "awfEmit"); this._awaitWriteFinish(path72, awf.stabilityThreshold, event, awfEmit); return this; } if (event === EVENTS.CHANGE) { const isThrottled = !this._throttle(EVENTS.CHANGE, path72, 50); if (isThrottled) return this; } if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) { const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path72) : path72; let stats2; try { stats2 = await (0, import_promises26.stat)(fullPath); } catch (err) { } if (!stats2 || this.closed) return; args.push(stats2); } this.emitWithAll(event, args); return this; } /** * Common handler for errors * @returns The error if defined, otherwise the value of the FSWatcher instance's `closed` flag */ _handleError(error2) { const code = error2 && error2.code; if (error2 && code !== "ENOENT" && code !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code !== "EPERM" && code !== "EACCES")) { this.emit(EVENTS.ERROR, error2); } return error2 || this.closed; } /** * Helper utility for throttling * @param actionType type being throttled * @param path being acted upon * @param timeout duration of time to suppress duplicate actions * @returns tracking object or false if action should be suppressed */ _throttle(actionType, path72, timeout2) { if (!this._throttled.has(actionType)) { this._throttled.set(actionType, /* @__PURE__ */ new Map()); } const action = this._throttled.get(actionType); if (!action) throw new Error("invalid throttle"); const actionPath = action.get(path72); if (actionPath) { actionPath.count++; return false; } let timeoutObject; const clear = /* @__PURE__ */ __name(() => { const item = action.get(path72); const count = item ? item.count : 0; action.delete(path72); clearTimeout(timeoutObject); if (item) clearTimeout(item.timeoutObject); return count; }, "clear"); timeoutObject = setTimeout(clear, timeout2); const thr = { timeoutObject, clear, count: 0 }; action.set(path72, thr); return thr; } _incrReadyCount() { return this._readyCount++; } /** * Awaits write operation to finish. * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback. * @param path being acted upon * @param threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished * @param event * @param awfEmit Callback to be called when ready for event to be emitted. */ _awaitWriteFinish(path72, threshold, event, awfEmit) { const awf = this.options.awaitWriteFinish; if (typeof awf !== "object") return; const pollInterval = awf.pollInterval; let timeoutHandler; let fullPath = path72; if (this.options.cwd && !sysPath2.isAbsolute(path72)) { fullPath = sysPath2.join(this.options.cwd, path72); } const now = /* @__PURE__ */ new Date(); const writes = this._pendingWrites; function awaitWriteFinishFn(prevStat) { (0, import_fs12.stat)(fullPath, (err, curStat) => { if (err || !writes.has(path72)) { if (err && err.code !== "ENOENT") awfEmit(err); return; } const now2 = Number(/* @__PURE__ */ new Date()); if (prevStat && curStat.size !== prevStat.size) { writes.get(path72).lastChange = now2; } const pw = writes.get(path72); const df = now2 - pw.lastChange; if (df >= threshold) { writes.delete(path72); awfEmit(void 0, curStat); } else { timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat); } }); } __name(awaitWriteFinishFn, "awaitWriteFinishFn"); if (!writes.has(path72)) { writes.set(path72, { lastChange: now, cancelWait: () => { writes.delete(path72); clearTimeout(timeoutHandler); return event; } }); timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval); } } /** * Determines whether user has asked to ignore this path. */ _isIgnored(path72, stats) { if (this.options.atomic && DOT_RE.test(path72)) return true; if (!this._userIgnored) { const { cwd: cwd2 } = this.options; const ign = this.options.ignored; const ignored = (ign || []).map(normalizeIgnored(cwd2)); const ignoredPaths = [...this._ignoredPaths]; const list = [...ignoredPaths.map(normalizeIgnored(cwd2)), ...ignored]; this._userIgnored = anymatch(list, void 0); } return this._userIgnored(path72, stats); } _isntIgnored(path72, stat9) { return !this._isIgnored(path72, stat9); } /** * Provides a set of common helpers and properties relating to symlink handling. * @param path file or directory pattern being watched */ _getWatchHelpers(path72) { return new WatchHelper(path72, this.options.followSymlinks, this); } // Directory helpers // ----------------- /** * Provides directory tracking objects * @param directory path of the directory */ _getWatchedDir(directory) { const dir = sysPath2.resolve(directory); if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove)); return this._watched.get(dir); } // File helpers // ------------ /** * Check for read permissions: https://stackoverflow.com/a/11781404/1358405 */ _hasReadPermissions(stats) { if (this.options.ignorePermissionErrors) return true; return Boolean(Number(stats.mode) & 256); } /** * Handles emitting unlink events for * files and directories, and via recursion, for * files and directories within directories that are unlinked * @param directory within which the following item is located * @param item base path of item/directory */ _remove(directory, item, isDirectory2) { const path72 = sysPath2.join(directory, item); const fullPath = sysPath2.resolve(path72); isDirectory2 = isDirectory2 != null ? isDirectory2 : this._watched.has(path72) || this._watched.has(fullPath); if (!this._throttle("remove", path72, 100)) return; if (!isDirectory2 && this._watched.size === 1) { this.add(directory, item, true); } const wp = this._getWatchedDir(path72); const nestedDirectoryChildren = wp.getChildren(); nestedDirectoryChildren.forEach((nested) => this._remove(path72, nested)); const parent = this._getWatchedDir(directory); const wasTracked = parent.has(item); parent.remove(item); if (this._symlinkPaths.has(fullPath)) { this._symlinkPaths.delete(fullPath); } let relPath = path72; if (this.options.cwd) relPath = sysPath2.relative(this.options.cwd, path72); if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) { const event = this._pendingWrites.get(relPath).cancelWait(); if (event === EVENTS.ADD) return; } this._watched.delete(path72); this._watched.delete(fullPath); const eventName = isDirectory2 ? EVENTS.UNLINK_DIR : EVENTS.UNLINK; if (wasTracked && !this._isIgnored(path72)) this._emit(eventName, path72); this._closePath(path72); } /** * Closes all watchers for a path */ _closePath(path72) { this._closeFile(path72); const dir = sysPath2.dirname(path72); this._getWatchedDir(dir).remove(sysPath2.basename(path72)); } /** * Closes only file-specific watchers */ _closeFile(path72) { const closers = this._closers.get(path72); if (!closers) return; closers.forEach((closer) => closer()); this._closers.delete(path72); } _addPathCloser(path72, closer) { if (!closer) return; let list = this._closers.get(path72); if (!list) { list = []; this._closers.set(path72, list); } list.push(closer); } _readdirp(root, opts) { if (this.closed) return; const options32 = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 }; let stream2 = readdirp(root, options32); this._streams.add(stream2); stream2.once(STR_CLOSE, () => { stream2 = void 0; }); stream2.once(STR_END, () => { if (stream2) { this._streams.delete(stream2); stream2 = void 0; } }); return stream2; } }; __name(FSWatcher, "FSWatcher"); __name(watch, "watch"); } }); // ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js var getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig; var init_httpExtensionConfiguration = __esm({ "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js"() { init_import_meta_url(); getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { let httpHandler = runtimeConfig.httpHandler; return { setHttpHandler(handler31) { httpHandler = handler31; }, httpHandler() { return httpHandler; }, updateHttpClientConfig(key, value) { httpHandler.updateHttpClientConfig(key, value); }, httpHandlerConfigs() { return httpHandler.httpHandlerConfigs(); } }; }, "getHttpHandlerExtensionConfiguration"); resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => { return { httpHandler: httpHandlerExtensionConfiguration.httpHandler() }; }, "resolveHttpHandlerRuntimeConfig"); } }); // ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/extensions/index.js var init_extensions = __esm({ "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/extensions/index.js"() { init_import_meta_url(); init_httpExtensionConfiguration(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/abort.js var init_abort = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/abort.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/auth.js var HttpAuthLocation; var init_auth = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/auth.js"() { init_import_meta_url(); (function(HttpAuthLocation2) { HttpAuthLocation2["HEADER"] = "header"; HttpAuthLocation2["QUERY"] = "query"; })(HttpAuthLocation || (HttpAuthLocation = {})); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js var HttpApiKeyAuthLocation; var init_HttpApiKeyAuth = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js"() { init_import_meta_url(); (function(HttpApiKeyAuthLocation2) { HttpApiKeyAuthLocation2["HEADER"] = "header"; HttpApiKeyAuthLocation2["QUERY"] = "query"; })(HttpApiKeyAuthLocation || (HttpApiKeyAuthLocation = {})); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js var init_HttpAuthScheme = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js var init_HttpAuthSchemeProvider = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpSigner.js var init_HttpSigner = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/HttpSigner.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js var init_IdentityProviderConfig = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/index.js var init_auth2 = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/auth/index.js"() { init_import_meta_url(); init_auth(); init_HttpApiKeyAuth(); init_HttpAuthScheme(); init_HttpAuthSchemeProvider(); init_HttpSigner(); init_IdentityProviderConfig(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js var init_blob_payload_input_types = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/checksum.js var init_checksum = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/checksum.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/client.js var init_client = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/client.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/command.js var init_command = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/command.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/config.js var init_config = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/config.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/manager.js var init_manager = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/manager.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/pool.js var init_pool = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/pool.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/index.js var init_connection = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/connection/index.js"() { init_import_meta_url(); init_config(); init_manager(); init_pool(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/crypto.js var init_crypto = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/crypto.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/encode.js var init_encode = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/encode.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoint.js var EndpointURLScheme; var init_endpoint = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoint.js"() { init_import_meta_url(); (function(EndpointURLScheme2) { EndpointURLScheme2["HTTP"] = "http"; EndpointURLScheme2["HTTPS"] = "https"; })(EndpointURLScheme || (EndpointURLScheme = {})); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js var init_EndpointRuleObject = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js var init_ErrorRuleObject = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js var init_RuleSetObject = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/shared.js var init_shared = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/shared.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js var init_TreeRuleObject = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/index.js var init_endpoints = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/endpoints/index.js"() { init_import_meta_url(); init_EndpointRuleObject(); init_ErrorRuleObject(); init_RuleSetObject(); init_shared(); init_TreeRuleObject(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/eventStream.js var init_eventStream = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/eventStream.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/checksum.js var AlgorithmId; var init_checksum2 = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/checksum.js"() { init_import_meta_url(); (function(AlgorithmId2) { AlgorithmId2["MD5"] = "md5"; AlgorithmId2["CRC32"] = "crc32"; AlgorithmId2["CRC32C"] = "crc32c"; AlgorithmId2["SHA1"] = "sha1"; AlgorithmId2["SHA256"] = "sha256"; })(AlgorithmId || (AlgorithmId = {})); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js var init_defaultClientConfiguration = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js"() { init_import_meta_url(); init_checksum2(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js var init_defaultExtensionConfiguration = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/index.js var init_extensions2 = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/extensions/index.js"() { init_import_meta_url(); init_defaultClientConfiguration(); init_defaultExtensionConfiguration(); init_checksum2(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/feature-ids.js var init_feature_ids = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/feature-ids.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/http.js var FieldPosition; var init_http = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/http.js"() { init_import_meta_url(); (function(FieldPosition2) { FieldPosition2[FieldPosition2["HEADER"] = 0] = "HEADER"; FieldPosition2[FieldPosition2["TRAILER"] = 1] = "TRAILER"; })(FieldPosition || (FieldPosition = {})); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js var init_httpHandlerInitialization = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js var init_apiKeyIdentity = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js var init_awsCredentialIdentity = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/identity.js var init_identity = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/identity.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/tokenIdentity.js var init_tokenIdentity = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/tokenIdentity.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/index.js var init_identity2 = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/identity/index.js"() { init_import_meta_url(); init_apiKeyIdentity(); init_awsCredentialIdentity(); init_identity(); init_tokenIdentity(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/logger.js var init_logger = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/logger.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/middleware.js var SMITHY_CONTEXT_KEY; var init_middleware = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/middleware.js"() { init_import_meta_url(); SMITHY_CONTEXT_KEY = "__smithy_context"; } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/pagination.js var init_pagination = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/pagination.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/profile.js var IniSectionType; var init_profile = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/profile.js"() { init_import_meta_url(); (function(IniSectionType2) { IniSectionType2["PROFILE"] = "profile"; IniSectionType2["SSO_SESSION"] = "sso-session"; IniSectionType2["SERVICES"] = "services"; })(IniSectionType || (IniSectionType = {})); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/response.js var init_response = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/response.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/retry.js var init_retry = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/retry.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/serde.js var init_serde = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/serde.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/shapes.js var init_shapes = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/shapes.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/signature.js var init_signature = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/signature.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/stream.js var init_stream = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/stream.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js var init_streaming_blob_common_types = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js var init_streaming_blob_payload_input_types = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js var init_streaming_blob_payload_output_types = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transfer.js var RequestHandlerProtocol; var init_transfer = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transfer.js"() { init_import_meta_url(); (function(RequestHandlerProtocol2) { RequestHandlerProtocol2["HTTP_0_9"] = "http/0.9"; RequestHandlerProtocol2["HTTP_1_0"] = "http/1.0"; RequestHandlerProtocol2["TDS_8_0"] = "tds/8.0"; })(RequestHandlerProtocol || (RequestHandlerProtocol = {})); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js var init_client_payload_blob_type_narrow = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transform/no-undefined.js var init_no_undefined = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transform/no-undefined.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transform/type-transform.js var init_type_transform = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/transform/type-transform.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/uri.js var init_uri = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/uri.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/util.js var init_util = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/util.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/waiter.js var init_waiter = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/waiter.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/index.js var init_dist_es = __esm({ "../../node_modules/.pnpm/@smithy+types@3.7.2/node_modules/@smithy/types/dist-es/index.js"() { init_import_meta_url(); init_abort(); init_auth2(); init_blob_payload_input_types(); init_checksum(); init_client(); init_command(); init_connection(); init_crypto(); init_encode(); init_endpoint(); init_endpoints(); init_eventStream(); init_extensions2(); init_feature_ids(); init_http(); init_httpHandlerInitialization(); init_identity2(); init_logger(); init_middleware(); init_pagination(); init_profile(); init_response(); init_retry(); init_serde(); init_shapes(); init_signature(); init_stream(); init_streaming_blob_common_types(); init_streaming_blob_payload_input_types(); init_streaming_blob_payload_output_types(); init_transfer(); init_client_payload_blob_type_narrow(); init_no_undefined(); init_type_transform(); init_uri(); init_util(); init_waiter(); } }); // ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/Field.js var init_Field = __esm({ "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/Field.js"() { init_import_meta_url(); init_dist_es(); } }); // ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/Fields.js var init_Fields = __esm({ "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/Fields.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/httpHandler.js var init_httpHandler = __esm({ "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/httpHandler.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/httpRequest.js function cloneQuery(query) { return Object.keys(query).reduce((carry, paramName) => { const param = query[paramName]; return { ...carry, [paramName]: Array.isArray(param) ? [...param] : param }; }, {}); } var HttpRequest; var init_httpRequest = __esm({ "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/httpRequest.js"() { init_import_meta_url(); HttpRequest = class { constructor(options32) { this.method = options32.method || "GET"; this.hostname = options32.hostname || "localhost"; this.port = options32.port; this.query = options32.query || {}; this.headers = options32.headers || {}; this.body = options32.body; this.protocol = options32.protocol ? options32.protocol.slice(-1) !== ":" ? `${options32.protocol}:` : options32.protocol : "https:"; this.path = options32.path ? options32.path.charAt(0) !== "/" ? `/${options32.path}` : options32.path : "/"; this.username = options32.username; this.password = options32.password; this.fragment = options32.fragment; } static clone(request4) { const cloned = new HttpRequest({ ...request4, headers: { ...request4.headers } }); if (cloned.query) { cloned.query = cloneQuery(cloned.query); } return cloned; } static isInstance(request4) { if (!request4) { return false; } const req = request4; return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object"; } clone() { return HttpRequest.clone(this); } }; __name(HttpRequest, "HttpRequest"); __name(cloneQuery, "cloneQuery"); } }); // ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/httpResponse.js var HttpResponse; var init_httpResponse = __esm({ "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/httpResponse.js"() { init_import_meta_url(); HttpResponse = class { constructor(options32) { this.statusCode = options32.statusCode; this.reason = options32.reason; this.headers = options32.headers || {}; this.body = options32.body; } static isInstance(response) { if (!response) return false; const resp = response; return typeof resp.statusCode === "number" && typeof resp.headers === "object"; } }; __name(HttpResponse, "HttpResponse"); } }); // ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/isValidHostname.js var init_isValidHostname = __esm({ "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/isValidHostname.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/types.js var init_types = __esm({ "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/types.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/index.js var init_dist_es2 = __esm({ "../../node_modules/.pnpm/@smithy+protocol-http@4.1.8/node_modules/@smithy/protocol-http/dist-es/index.js"() { init_import_meta_url(); init_extensions(); init_Field(); init_Fields(); init_httpHandler(); init_httpRequest(); init_httpResponse(); init_isValidHostname(); init_types(); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js var state, emitWarningIfUnsupportedVersion; var init_emitWarningIfUnsupportedVersion = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js"() { init_import_meta_url(); state = { warningEmitted: false }; emitWarningIfUnsupportedVersion = /* @__PURE__ */ __name((version4) => { if (version4 && !state.warningEmitted && parseInt(version4.substring(1, version4.indexOf("."))) < 18) { state.warningEmitted = true; process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will no longer support Node.js 16.x on January 6, 2025. To continue receiving updates to AWS services, bug fixes, and security updates please upgrade to a supported Node.js LTS version. More information can be found at: https://a.co/74kJMmI`); } }, "emitWarningIfUnsupportedVersion"); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js function setCredentialFeature(credentials, feature, value) { if (!credentials.$source) { credentials.$source = {}; } credentials.$source[feature] = value; return credentials; } var init_setCredentialFeature = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js"() { init_import_meta_url(); __name(setCredentialFeature, "setCredentialFeature"); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js function setFeature(context2, feature, value) { if (!context2.__aws_sdk_context) { context2.__aws_sdk_context = { features: {} }; } else if (!context2.__aws_sdk_context.features) { context2.__aws_sdk_context.features = {}; } context2.__aws_sdk_context.features[feature] = value; } var init_setFeature = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js"() { init_import_meta_url(); __name(setFeature, "setFeature"); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js var init_client2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js"() { init_import_meta_url(); init_emitWarningIfUnsupportedVersion(); init_setCredentialFeature(); init_setFeature(); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js var getDateHeader; var init_getDateHeader = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js"() { init_import_meta_url(); init_dist_es2(); getDateHeader = /* @__PURE__ */ __name((response) => HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0, "getDateHeader"); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js var getSkewCorrectedDate; var init_getSkewCorrectedDate = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js"() { init_import_meta_url(); getSkewCorrectedDate = /* @__PURE__ */ __name((systemClockOffset) => new Date(Date.now() + systemClockOffset), "getSkewCorrectedDate"); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js var isClockSkewed; var init_isClockSkewed = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js"() { init_import_meta_url(); init_getSkewCorrectedDate(); isClockSkewed = /* @__PURE__ */ __name((clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5, "isClockSkewed"); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js var getUpdatedSystemClockOffset; var init_getUpdatedSystemClockOffset = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js"() { init_import_meta_url(); init_isClockSkewed(); getUpdatedSystemClockOffset = /* @__PURE__ */ __name((clockTime, currentSystemClockOffset) => { const clockTimeInMs = Date.parse(clockTime); if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { return clockTimeInMs - Date.now(); } return currentSystemClockOffset; }, "getUpdatedSystemClockOffset"); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js var init_utils = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js"() { init_import_meta_url(); init_getDateHeader(); init_getSkewCorrectedDate(); init_getUpdatedSystemClockOffset(); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js var throwSigningPropertyError, validateSigningProperties, AwsSdkSigV4Signer; var init_AwsSdkSigV4Signer = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js"() { init_import_meta_url(); init_dist_es2(); init_utils(); throwSigningPropertyError = /* @__PURE__ */ __name((name2, property) => { if (!property) { throw new Error(`Property \`${name2}\` is not resolved for AWS SDK SigV4Auth`); } return property; }, "throwSigningPropertyError"); validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties) => { const context2 = throwSigningPropertyError("context", signingProperties.context); const config = throwSigningPropertyError("config", signingProperties.config); const authScheme = context2.endpointV2?.properties?.authSchemes?.[0]; const signerFunction = throwSigningPropertyError("signer", config.signer); const signer = await signerFunction(authScheme); const signingRegion = signingProperties?.signingRegion; const signingRegionSet = signingProperties?.signingRegionSet; const signingName = signingProperties?.signingName; return { config, signer, signingRegion, signingRegionSet, signingName }; }, "validateSigningProperties"); AwsSdkSigV4Signer = class { async sign(httpRequest2, identity, signingProperties) { if (!HttpRequest.isInstance(httpRequest2)) { throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); } const validatedProps = await validateSigningProperties(signingProperties); const { config, signer } = validatedProps; let { signingRegion, signingName } = validatedProps; const handlerExecutionContext = signingProperties.context; if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) { const [first, second] = handlerExecutionContext.authSchemes; if (first?.name === "sigv4a" && second?.name === "sigv4") { signingRegion = second?.signingRegion ?? signingRegion; signingName = second?.signingName ?? signingName; } } const signedRequest = await signer.sign(httpRequest2, { signingDate: getSkewCorrectedDate(config.systemClockOffset), signingRegion, signingService: signingName }); return signedRequest; } errorHandler(signingProperties) { return (error2) => { const serverTime = error2.ServerTime ?? getDateHeader(error2.$response); if (serverTime) { const config = throwSigningPropertyError("config", signingProperties.config); const initialSystemClockOffset = config.systemClockOffset; config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset); const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset; if (clockSkewCorrected && error2.$metadata) { error2.$metadata.clockSkewCorrected = true; } } throw error2; }; } successHandler(httpResponse, signingProperties) { const dateHeader = getDateHeader(httpResponse); if (dateHeader) { const config = throwSigningPropertyError("config", signingProperties.config); config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset); } } }; __name(AwsSdkSigV4Signer, "AwsSdkSigV4Signer"); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js var AwsSdkSigV4ASigner; var init_AwsSdkSigV4ASigner = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js"() { init_import_meta_url(); init_dist_es2(); init_utils(); init_AwsSdkSigV4Signer(); AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer { async sign(httpRequest2, identity, signingProperties) { if (!HttpRequest.isInstance(httpRequest2)) { throw new Error("The request is not an instance of `HttpRequest` and cannot be signed"); } const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties); const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.(); const multiRegionOverride = (configResolvedSigningRegionSet ?? signingRegionSet ?? [signingRegion]).join(","); const signedRequest = await signer.sign(httpRequest2, { signingDate: getSkewCorrectedDate(config.systemClockOffset), signingRegion: multiRegionOverride, signingService: signingName }); return signedRequest; } }; __name(AwsSdkSigV4ASigner, "AwsSdkSigV4ASigner"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/getSmithyContext.js var init_getSmithyContext = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/getSmithyContext.js"() { init_import_meta_url(); init_dist_es(); } }); // ../../node_modules/.pnpm/@smithy+util-middleware@3.0.11/node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js var getSmithyContext; var init_getSmithyContext2 = __esm({ "../../node_modules/.pnpm/@smithy+util-middleware@3.0.11/node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js"() { init_import_meta_url(); init_dist_es(); getSmithyContext = /* @__PURE__ */ __name((context2) => context2[SMITHY_CONTEXT_KEY] || (context2[SMITHY_CONTEXT_KEY] = {}), "getSmithyContext"); } }); // ../../node_modules/.pnpm/@smithy+util-middleware@3.0.11/node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js var normalizeProvider; var init_normalizeProvider = __esm({ "../../node_modules/.pnpm/@smithy+util-middleware@3.0.11/node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js"() { init_import_meta_url(); normalizeProvider = /* @__PURE__ */ __name((input) => { if (typeof input === "function") return input; const promisified = Promise.resolve(input); return () => promisified; }, "normalizeProvider"); } }); // ../../node_modules/.pnpm/@smithy+util-middleware@3.0.11/node_modules/@smithy/util-middleware/dist-es/index.js var init_dist_es3 = __esm({ "../../node_modules/.pnpm/@smithy+util-middleware@3.0.11/node_modules/@smithy/util-middleware/dist-es/index.js"() { init_import_meta_url(); init_getSmithyContext2(); init_normalizeProvider(); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js function convertHttpAuthSchemesToMap(httpAuthSchemes) { const map2 = /* @__PURE__ */ new Map(); for (const scheme of httpAuthSchemes) { map2.set(scheme.schemeId, scheme); } return map2; } var httpAuthSchemeMiddleware; var init_httpAuthSchemeMiddleware = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js"() { init_import_meta_url(); init_dist_es(); init_dist_es3(); __name(convertHttpAuthSchemesToMap, "convertHttpAuthSchemesToMap"); httpAuthSchemeMiddleware = /* @__PURE__ */ __name((config, mwOptions) => (next, context2) => async (args) => { const options32 = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context2, args.input)); const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes); const smithyContext = getSmithyContext(context2); const failureReasons = []; for (const option of options32) { const scheme = authSchemes.get(option.schemeId); if (!scheme) { failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`); continue; } const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config)); if (!identityProvider) { failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`); continue; } const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context2) || {}; option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties); option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties); smithyContext.selectedHttpAuthScheme = { httpAuthOption: option, identity: await identityProvider(option.identityProperties), signer: scheme.signer }; break; } if (!smithyContext.selectedHttpAuthScheme) { throw new Error(failureReasons.join("\n")); } return next(args); }, "httpAuthSchemeMiddleware"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js var httpAuthSchemeEndpointRuleSetMiddlewareOptions, getHttpAuthSchemeEndpointRuleSetPlugin; var init_getHttpAuthSchemeEndpointRuleSetPlugin = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js"() { init_import_meta_url(); init_httpAuthSchemeMiddleware(); httpAuthSchemeEndpointRuleSetMiddlewareOptions = { step: "serialize", tags: ["HTTP_AUTH_SCHEME"], name: "httpAuthSchemeMiddleware", override: true, relation: "before", toMiddleware: "endpointV2Middleware" }; getHttpAuthSchemeEndpointRuleSetPlugin = /* @__PURE__ */ __name((config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }), httpAuthSchemeEndpointRuleSetMiddlewareOptions); } }), "getHttpAuthSchemeEndpointRuleSetPlugin"); } }); // ../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js var deserializerMiddleware; var init_deserializerMiddleware = __esm({ "../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js"() { init_import_meta_url(); deserializerMiddleware = /* @__PURE__ */ __name((options32, deserializer) => (next) => async (args) => { const { response } = await next(args); try { const parsed = await deserializer(response, options32); return { response, output: parsed }; } catch (error2) { Object.defineProperty(error2, "$response", { value: response }); if (!("$metadata" in error2)) { const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; error2.message += "\n " + hint; if (typeof error2.$responseBodyText !== "undefined") { if (error2.$response) { error2.$response.body = error2.$responseBodyText; } } } throw error2; } }, "deserializerMiddleware"); } }); // ../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js var serializerMiddleware; var init_serializerMiddleware = __esm({ "../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js"() { init_import_meta_url(); serializerMiddleware = /* @__PURE__ */ __name((options32, serializer) => (next, context2) => async (args) => { const endpoint = context2.endpointV2?.url && options32.urlParser ? async () => options32.urlParser(context2.endpointV2.url) : options32.endpoint; if (!endpoint) { throw new Error("No valid endpoint provider available."); } const request4 = await serializer(args.input, { ...options32, endpoint }); return next({ ...args, request: request4 }); }, "serializerMiddleware"); } }); // ../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js function getSerdePlugin(config, serializer, deserializer) { return { applyToStack: (commandStack) => { commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption); commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption); } }; } var deserializerMiddlewareOption, serializerMiddlewareOption; var init_serdePlugin = __esm({ "../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js"() { init_import_meta_url(); init_deserializerMiddleware(); init_serializerMiddleware(); deserializerMiddlewareOption = { name: "deserializerMiddleware", step: "deserialize", tags: ["DESERIALIZER"], override: true }; serializerMiddlewareOption = { name: "serializerMiddleware", step: "serialize", tags: ["SERIALIZER"], override: true }; __name(getSerdePlugin, "getSerdePlugin"); } }); // ../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/index.js var init_dist_es4 = __esm({ "../../node_modules/.pnpm/@smithy+middleware-serde@3.0.11/node_modules/@smithy/middleware-serde/dist-es/index.js"() { init_import_meta_url(); init_deserializerMiddleware(); init_serdePlugin(); init_serializerMiddleware(); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js var httpAuthSchemeMiddlewareOptions; var init_getHttpAuthSchemePlugin = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js"() { init_import_meta_url(); init_dist_es4(); init_httpAuthSchemeMiddleware(); httpAuthSchemeMiddlewareOptions = { step: "serialize", tags: ["HTTP_AUTH_SCHEME"], name: "httpAuthSchemeMiddleware", override: true, relation: "before", toMiddleware: serializerMiddlewareOption.name }; } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js var init_middleware_http_auth_scheme = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js"() { init_import_meta_url(); init_httpAuthSchemeMiddleware(); init_getHttpAuthSchemeEndpointRuleSetPlugin(); init_getHttpAuthSchemePlugin(); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js var defaultErrorHandler, defaultSuccessHandler, httpSigningMiddleware; var init_httpSigningMiddleware = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js"() { init_import_meta_url(); init_dist_es2(); init_dist_es(); init_dist_es3(); defaultErrorHandler = /* @__PURE__ */ __name((signingProperties) => (error2) => { throw error2; }, "defaultErrorHandler"); defaultSuccessHandler = /* @__PURE__ */ __name((httpResponse, signingProperties) => { }, "defaultSuccessHandler"); httpSigningMiddleware = /* @__PURE__ */ __name((config) => (next, context2) => async (args) => { if (!HttpRequest.isInstance(args.request)) { return next(args); } const smithyContext = getSmithyContext(context2); const scheme = smithyContext.selectedHttpAuthScheme; if (!scheme) { throw new Error(`No HttpAuthScheme was selected: unable to sign request`); } const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme; const output = await next({ ...args, request: await signer.sign(args.request, identity, signingProperties) }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties)); (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties); return output; }, "httpSigningMiddleware"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js var httpSigningMiddlewareOptions, getHttpSigningPlugin; var init_getHttpSigningMiddleware = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js"() { init_import_meta_url(); init_httpSigningMiddleware(); httpSigningMiddlewareOptions = { step: "finalizeRequest", tags: ["HTTP_SIGNING"], name: "httpSigningMiddleware", aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"], override: true, relation: "after", toMiddleware: "retryMiddleware" }; getHttpSigningPlugin = /* @__PURE__ */ __name((config) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions); } }), "getHttpSigningPlugin"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-signing/index.js var init_middleware_http_signing = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/middleware-http-signing/index.js"() { init_import_meta_url(); init_httpSigningMiddleware(); init_getHttpSigningMiddleware(); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/normalizeProvider.js var normalizeProvider2; var init_normalizeProvider2 = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/normalizeProvider.js"() { init_import_meta_url(); normalizeProvider2 = /* @__PURE__ */ __name((input) => { if (typeof input === "function") return input; const promisified = Promise.resolve(input); return () => promisified; }, "normalizeProvider"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/pagination/createPaginator.js function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) { return /* @__PURE__ */ __name(async function* paginateOperation(config, input, ...additionalArguments) { let token = config.startingToken || void 0; let hasNext = true; let page; while (hasNext) { input[inputTokenName] = token; if (pageSizeTokenName) { input[pageSizeTokenName] = input[pageSizeTokenName] ?? config.pageSize; } if (config.client instanceof ClientCtor) { page = await makePagedClientRequest(CommandCtor, config.client, input, ...additionalArguments); } else { throw new Error(`Invalid client, expected instance of ${ClientCtor.name}`); } yield page; const prevToken = token; token = get(page, outputTokenName); hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); } return void 0; }, "paginateOperation"); } var makePagedClientRequest, get; var init_createPaginator = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/pagination/createPaginator.js"() { init_import_meta_url(); makePagedClientRequest = /* @__PURE__ */ __name(async (CommandCtor, client, input, ...args) => { return await client.send(new CommandCtor(input), ...args); }, "makePagedClientRequest"); __name(createPaginator, "createPaginator"); get = /* @__PURE__ */ __name((fromObject, path72) => { let cursor = fromObject; const pathComponents = path72.split("."); for (const step of pathComponents) { if (!cursor || typeof cursor !== "object") { return void 0; } cursor = cursor[step]; } return cursor; }, "get"); } }); // ../../node_modules/.pnpm/@smithy+is-array-buffer@3.0.0/node_modules/@smithy/is-array-buffer/dist-es/index.js var isArrayBuffer; var init_dist_es5 = __esm({ "../../node_modules/.pnpm/@smithy+is-array-buffer@3.0.0/node_modules/@smithy/is-array-buffer/dist-es/index.js"() { init_import_meta_url(); isArrayBuffer = /* @__PURE__ */ __name((arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]", "isArrayBuffer"); } }); // ../../node_modules/.pnpm/@smithy+util-buffer-from@3.0.0/node_modules/@smithy/util-buffer-from/dist-es/index.js var import_buffer2, fromArrayBuffer, fromString; var init_dist_es6 = __esm({ "../../node_modules/.pnpm/@smithy+util-buffer-from@3.0.0/node_modules/@smithy/util-buffer-from/dist-es/index.js"() { init_import_meta_url(); init_dist_es5(); import_buffer2 = require("buffer"); fromArrayBuffer = /* @__PURE__ */ __name((input, offset = 0, length = input.byteLength - offset) => { if (!isArrayBuffer(input)) { throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); } return import_buffer2.Buffer.from(input, offset, length); }, "fromArrayBuffer"); fromString = /* @__PURE__ */ __name((input, encoding) => { if (typeof input !== "string") { throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); } return encoding ? import_buffer2.Buffer.from(input, encoding) : import_buffer2.Buffer.from(input); }, "fromString"); } }); // ../../node_modules/.pnpm/@smithy+util-base64@3.0.0/node_modules/@smithy/util-base64/dist-es/fromBase64.js var BASE64_REGEX, fromBase64; var init_fromBase64 = __esm({ "../../node_modules/.pnpm/@smithy+util-base64@3.0.0/node_modules/@smithy/util-base64/dist-es/fromBase64.js"() { init_import_meta_url(); init_dist_es6(); BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; fromBase64 = /* @__PURE__ */ __name((input) => { if (input.length * 3 % 4 !== 0) { throw new TypeError(`Incorrect padding on base64 string.`); } if (!BASE64_REGEX.exec(input)) { throw new TypeError(`Invalid base64 string.`); } const buffer = fromString(input, "base64"); return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); }, "fromBase64"); } }); // ../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js var fromUtf8; var init_fromUtf8 = __esm({ "../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js"() { init_import_meta_url(); init_dist_es6(); fromUtf8 = /* @__PURE__ */ __name((input) => { const buf = fromString(input, "utf8"); return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); }, "fromUtf8"); } }); // ../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js var toUint8Array; var init_toUint8Array = __esm({ "../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js"() { init_import_meta_url(); init_fromUtf8(); toUint8Array = /* @__PURE__ */ __name((data) => { if (typeof data === "string") { return fromUtf8(data); } if (ArrayBuffer.isView(data)) { return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT); } return new Uint8Array(data); }, "toUint8Array"); } }); // ../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/toUtf8.js var toUtf8; var init_toUtf8 = __esm({ "../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/toUtf8.js"() { init_import_meta_url(); init_dist_es6(); toUtf8 = /* @__PURE__ */ __name((input) => { if (typeof input === "string") { return input; } if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array."); } return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); }, "toUtf8"); } }); // ../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/index.js var init_dist_es7 = __esm({ "../../node_modules/.pnpm/@smithy+util-utf8@3.0.0/node_modules/@smithy/util-utf8/dist-es/index.js"() { init_import_meta_url(); init_fromUtf8(); init_toUint8Array(); init_toUtf8(); } }); // ../../node_modules/.pnpm/@smithy+util-base64@3.0.0/node_modules/@smithy/util-base64/dist-es/toBase64.js var toBase64; var init_toBase64 = __esm({ "../../node_modules/.pnpm/@smithy+util-base64@3.0.0/node_modules/@smithy/util-base64/dist-es/toBase64.js"() { init_import_meta_url(); init_dist_es6(); init_dist_es7(); toBase64 = /* @__PURE__ */ __name((_input) => { let input; if (typeof _input === "string") { input = fromUtf8(_input); } else { input = _input; } if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") { throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array."); } return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("base64"); }, "toBase64"); } }); // ../../node_modules/.pnpm/@smithy+util-base64@3.0.0/node_modules/@smithy/util-base64/dist-es/index.js var init_dist_es8 = __esm({ "../../node_modules/.pnpm/@smithy+util-base64@3.0.0/node_modules/@smithy/util-base64/dist-es/index.js"() { init_import_meta_url(); init_fromBase64(); init_toBase64(); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/blob/transforms.js function transformToString(payload, encoding = "utf-8") { if (encoding === "base64") { return toBase64(payload); } return toUtf8(payload); } function transformFromString(str, encoding) { if (encoding === "base64") { return Uint8ArrayBlobAdapter.mutate(fromBase64(str)); } return Uint8ArrayBlobAdapter.mutate(fromUtf8(str)); } var init_transforms = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/blob/transforms.js"() { init_import_meta_url(); init_dist_es8(); init_dist_es7(); init_Uint8ArrayBlobAdapter(); __name(transformToString, "transformToString"); __name(transformFromString, "transformFromString"); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js var Uint8ArrayBlobAdapter; var init_Uint8ArrayBlobAdapter = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js"() { init_import_meta_url(); init_transforms(); Uint8ArrayBlobAdapter = class extends Uint8Array { static fromString(source, encoding = "utf-8") { switch (typeof source) { case "string": return transformFromString(source, encoding); default: throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); } } static mutate(source) { Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype); return source; } transformToString(encoding = "utf-8") { return transformToString(this, encoding); } }; __name(Uint8ArrayBlobAdapter, "Uint8ArrayBlobAdapter"); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/getAwsChunkedEncodingStream.js var import_stream4, getAwsChunkedEncodingStream; var init_getAwsChunkedEncodingStream = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/getAwsChunkedEncodingStream.js"() { init_import_meta_url(); import_stream4 = require("stream"); getAwsChunkedEncodingStream = /* @__PURE__ */ __name((readableStream, options32) => { const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options32; const checksumRequired = base64Encoder !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0; const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : void 0; const awsChunkedEncodingStream = new import_stream4.Readable({ read: () => { } }); readableStream.on("data", (data) => { const length = bodyLengthChecker(data) || 0; awsChunkedEncodingStream.push(`${length.toString(16)}\r `); awsChunkedEncodingStream.push(data); awsChunkedEncodingStream.push("\r\n"); }); readableStream.on("end", async () => { awsChunkedEncodingStream.push(`0\r `); if (checksumRequired) { const checksum = base64Encoder(await digest); awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r `); awsChunkedEncodingStream.push(`\r `); } awsChunkedEncodingStream.push(null); }); return awsChunkedEncodingStream; }, "getAwsChunkedEncodingStream"); } }); // ../../node_modules/.pnpm/@smithy+util-uri-escape@3.0.0/node_modules/@smithy/util-uri-escape/dist-es/escape-uri.js var escapeUri, hexEncode; var init_escape_uri = __esm({ "../../node_modules/.pnpm/@smithy+util-uri-escape@3.0.0/node_modules/@smithy/util-uri-escape/dist-es/escape-uri.js"() { init_import_meta_url(); escapeUri = /* @__PURE__ */ __name((uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode), "escapeUri"); hexEncode = /* @__PURE__ */ __name((c6) => `%${c6.charCodeAt(0).toString(16).toUpperCase()}`, "hexEncode"); } }); // ../../node_modules/.pnpm/@smithy+util-uri-escape@3.0.0/node_modules/@smithy/util-uri-escape/dist-es/escape-uri-path.js var init_escape_uri_path = __esm({ "../../node_modules/.pnpm/@smithy+util-uri-escape@3.0.0/node_modules/@smithy/util-uri-escape/dist-es/escape-uri-path.js"() { init_import_meta_url(); init_escape_uri(); } }); // ../../node_modules/.pnpm/@smithy+util-uri-escape@3.0.0/node_modules/@smithy/util-uri-escape/dist-es/index.js var init_dist_es9 = __esm({ "../../node_modules/.pnpm/@smithy+util-uri-escape@3.0.0/node_modules/@smithy/util-uri-escape/dist-es/index.js"() { init_import_meta_url(); init_escape_uri(); init_escape_uri_path(); } }); // ../../node_modules/.pnpm/@smithy+querystring-builder@3.0.11/node_modules/@smithy/querystring-builder/dist-es/index.js function buildQueryString(query) { const parts = []; for (let key of Object.keys(query).sort()) { const value = query[key]; key = escapeUri(key); if (Array.isArray(value)) { for (let i5 = 0, iLen = value.length; i5 < iLen; i5++) { parts.push(`${key}=${escapeUri(value[i5])}`); } } else { let qsEntry = key; if (value || typeof value === "string") { qsEntry += `=${escapeUri(value)}`; } parts.push(qsEntry); } } return parts.join("&"); } var init_dist_es10 = __esm({ "../../node_modules/.pnpm/@smithy+querystring-builder@3.0.11/node_modules/@smithy/querystring-builder/dist-es/index.js"() { init_import_meta_url(); init_dist_es9(); __name(buildQueryString, "buildQueryString"); } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/constants.js var NODEJS_TIMEOUT_ERROR_CODES; var init_constants = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/constants.js"() { init_import_meta_url(); NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js var getTransformedHeaders; var init_get_transformed_headers = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js"() { init_import_meta_url(); getTransformedHeaders = /* @__PURE__ */ __name((headers) => { const transformedHeaders = {}; for (const name2 of Object.keys(headers)) { const headerValues = headers[name2]; transformedHeaders[name2] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; } return transformedHeaders; }, "getTransformedHeaders"); } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/timing.js var timing; var init_timing = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/timing.js"() { init_import_meta_url(); timing = { setTimeout: (cb2, ms) => setTimeout(cb2, ms), clearTimeout: (timeoutId) => clearTimeout(timeoutId) }; } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js var DEFER_EVENT_LISTENER_TIME, setConnectionTimeout; var init_set_connection_timeout = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js"() { init_import_meta_url(); init_timing(); DEFER_EVENT_LISTENER_TIME = 1e3; setConnectionTimeout = /* @__PURE__ */ __name((request4, reject, timeoutInMs = 0) => { if (!timeoutInMs) { return -1; } const registerTimeout = /* @__PURE__ */ __name((offset) => { const timeoutId = timing.setTimeout(() => { request4.destroy(); reject(Object.assign(new Error(`Socket timed out without establishing a connection within ${timeoutInMs} ms`), { name: "TimeoutError" })); }, timeoutInMs - offset); const doWithSocket = /* @__PURE__ */ __name((socket) => { if (socket?.connecting) { socket.on("connect", () => { timing.clearTimeout(timeoutId); }); } else { timing.clearTimeout(timeoutId); } }, "doWithSocket"); if (request4.socket) { doWithSocket(request4.socket); } else { request4.on("socket", doWithSocket); } }, "registerTimeout"); if (timeoutInMs < 2e3) { registerTimeout(0); return 0; } return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); }, "setConnectionTimeout"); } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js var DEFER_EVENT_LISTENER_TIME2, setSocketKeepAlive; var init_set_socket_keep_alive = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js"() { init_import_meta_url(); init_timing(); DEFER_EVENT_LISTENER_TIME2 = 3e3; setSocketKeepAlive = /* @__PURE__ */ __name((request4, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME2) => { if (keepAlive !== true) { return -1; } const registerListener = /* @__PURE__ */ __name(() => { if (request4.socket) { request4.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); } else { request4.on("socket", (socket) => { socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); }); } }, "registerListener"); if (deferTimeMs === 0) { registerListener(); return 0; } return timing.setTimeout(registerListener, deferTimeMs); }, "setSocketKeepAlive"); } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js var DEFER_EVENT_LISTENER_TIME3, setSocketTimeout; var init_set_socket_timeout = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js"() { init_import_meta_url(); init_timing(); DEFER_EVENT_LISTENER_TIME3 = 3e3; setSocketTimeout = /* @__PURE__ */ __name((request4, reject, timeoutInMs = 0) => { const registerTimeout = /* @__PURE__ */ __name((offset) => { const timeout2 = timeoutInMs - offset; const onTimeout = /* @__PURE__ */ __name(() => { request4.destroy(); reject(Object.assign(new Error(`Connection timed out after ${timeoutInMs} ms`), { name: "TimeoutError" })); }, "onTimeout"); if (request4.socket) { request4.socket.setTimeout(timeout2, onTimeout); } else { request4.setTimeout(timeout2, onTimeout); } }, "registerTimeout"); if (0 < timeoutInMs && timeoutInMs < 6e3) { registerTimeout(0); return 0; } return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME3), DEFER_EVENT_LISTENER_TIME3); }, "setSocketTimeout"); } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js async function writeRequestBody(httpRequest2, request4, maxContinueTimeoutMs = MIN_WAIT_TIME) { const headers = request4.headers ?? {}; const expect = headers["Expect"] || headers["expect"]; let timeoutId = -1; let sendBody = true; if (expect === "100-continue") { sendBody = await Promise.race([ new Promise((resolve25) => { timeoutId = Number(timing.setTimeout(resolve25, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); }), new Promise((resolve25) => { httpRequest2.on("continue", () => { timing.clearTimeout(timeoutId); resolve25(true); }); httpRequest2.on("response", () => { timing.clearTimeout(timeoutId); resolve25(false); }); httpRequest2.on("error", () => { timing.clearTimeout(timeoutId); resolve25(false); }); }) ]); } if (sendBody) { writeBody(httpRequest2, request4.body); } } function writeBody(httpRequest2, body) { if (body instanceof import_stream5.Readable) { body.pipe(httpRequest2); return; } if (body) { if (Buffer.isBuffer(body) || typeof body === "string") { httpRequest2.end(body); return; } const uint8 = body; if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") { httpRequest2.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength)); return; } httpRequest2.end(Buffer.from(body)); return; } httpRequest2.end(); } var import_stream5, MIN_WAIT_TIME; var init_write_request_body = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js"() { init_import_meta_url(); import_stream5 = require("stream"); init_timing(); MIN_WAIT_TIME = 1e3; __name(writeRequestBody, "writeRequestBody"); __name(writeBody, "writeBody"); } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js var import_http, import_https, NodeHttpHandler; var init_node_http_handler = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js"() { init_import_meta_url(); init_dist_es2(); init_dist_es10(); import_http = require("http"); import_https = require("https"); init_constants(); init_get_transformed_headers(); init_set_connection_timeout(); init_set_socket_keep_alive(); init_set_socket_timeout(); init_timing(); init_write_request_body(); NodeHttpHandler = class { static create(instanceOrOptions) { if (typeof instanceOrOptions?.handle === "function") { return instanceOrOptions; } return new NodeHttpHandler(instanceOrOptions); } static checkSocketUsage(agent, socketWarningTimestamp, logger4 = console) { const { sockets, requests, maxSockets } = agent; if (typeof maxSockets !== "number" || maxSockets === Infinity) { return socketWarningTimestamp; } const interval = 15e3; if (Date.now() - interval < socketWarningTimestamp) { return socketWarningTimestamp; } if (sockets && requests) { for (const origin in sockets) { const socketsInUse = sockets[origin]?.length ?? 0; const requestsEnqueued = requests[origin]?.length ?? 0; if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) { logger4?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued. See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`); return Date.now(); } } } return socketWarningTimestamp; } constructor(options32) { this.socketWarningTimestamp = 0; this.metadata = { handlerProtocol: "http/1.1" }; this.configProvider = new Promise((resolve25, reject) => { if (typeof options32 === "function") { options32().then((_options) => { resolve25(this.resolveDefaultConfig(_options)); }).catch(reject); } else { resolve25(this.resolveDefaultConfig(options32)); } }); } resolveDefaultConfig(options32) { const { requestTimeout: requestTimeout2, connectionTimeout, socketTimeout, httpAgent, httpsAgent } = options32 || {}; const keepAlive = true; const maxSockets = 50; return { connectionTimeout, requestTimeout: requestTimeout2 ?? socketTimeout, httpAgent: (() => { if (httpAgent instanceof import_http.Agent || typeof httpAgent?.destroy === "function") { return httpAgent; } return new import_http.Agent({ keepAlive, maxSockets, ...httpAgent }); })(), httpsAgent: (() => { if (httpsAgent instanceof import_https.Agent || typeof httpsAgent?.destroy === "function") { return httpsAgent; } return new import_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); })(), logger: console }; } destroy() { this.config?.httpAgent?.destroy(); this.config?.httpsAgent?.destroy(); } async handle(request4, { abortSignal } = {}) { if (!this.config) { this.config = await this.configProvider; } return new Promise((_resolve, _reject) => { let writeRequestBodyPromise = void 0; const timeouts = []; const resolve25 = /* @__PURE__ */ __name(async (arg) => { await writeRequestBodyPromise; timeouts.forEach(timing.clearTimeout); _resolve(arg); }, "resolve"); const reject = /* @__PURE__ */ __name(async (arg) => { await writeRequestBodyPromise; timeouts.forEach(timing.clearTimeout); _reject(arg); }, "reject"); if (!this.config) { throw new Error("Node HTTP request handler config is not resolved"); } if (abortSignal?.aborted) { const abortError = new Error("Request aborted"); abortError.name = "AbortError"; reject(abortError); return; } const isSSL = request4.protocol === "https:"; const agent = isSSL ? this.config.httpsAgent : this.config.httpAgent; timeouts.push(timing.setTimeout(() => { this.socketWarningTimestamp = NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, this.config.logger); }, this.config.socketAcquisitionWarningTimeout ?? (this.config.requestTimeout ?? 2e3) + (this.config.connectionTimeout ?? 1e3))); const queryString = buildQueryString(request4.query || {}); let auth = void 0; if (request4.username != null || request4.password != null) { const username = request4.username ?? ""; const password = request4.password ?? ""; auth = `${username}:${password}`; } let path72 = request4.path; if (queryString) { path72 += `?${queryString}`; } if (request4.fragment) { path72 += `#${request4.fragment}`; } let hostname2 = request4.hostname ?? ""; if (hostname2[0] === "[" && hostname2.endsWith("]")) { hostname2 = request4.hostname.slice(1, -1); } else { hostname2 = request4.hostname; } const nodeHttpsOptions = { headers: request4.headers, host: hostname2, method: request4.method, path: path72, port: request4.port, agent, auth }; const requestFunc = isSSL ? import_https.request : import_http.request; const req = requestFunc(nodeHttpsOptions, (res) => { const httpResponse = new HttpResponse({ statusCode: res.statusCode || -1, reason: res.statusMessage, headers: getTransformedHeaders(res.headers), body: res }); resolve25({ response: httpResponse }); }); req.on("error", (err) => { if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) { reject(Object.assign(err, { name: "TimeoutError" })); } else { reject(err); } }); if (abortSignal) { const onAbort = /* @__PURE__ */ __name(() => { req.destroy(); const abortError = new Error("Request aborted"); abortError.name = "AbortError"; reject(abortError); }, "onAbort"); if (typeof abortSignal.addEventListener === "function") { const signal = abortSignal; signal.addEventListener("abort", onAbort, { once: true }); req.once("close", () => signal.removeEventListener("abort", onAbort)); } else { abortSignal.onabort = onAbort; } } timeouts.push(setConnectionTimeout(req, reject, this.config.connectionTimeout)); timeouts.push(setSocketTimeout(req, reject, this.config.requestTimeout)); const httpAgent = nodeHttpsOptions.agent; if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { timeouts.push(setSocketKeepAlive(req, { keepAlive: httpAgent.keepAlive, keepAliveMsecs: httpAgent.keepAliveMsecs })); } writeRequestBodyPromise = writeRequestBody(req, request4, this.config.requestTimeout).catch((e7) => { timeouts.forEach(timing.clearTimeout); return _reject(e7); }); }); } updateHttpClientConfig(key, value) { this.config = void 0; this.configProvider = this.configProvider.then((config) => { return { ...config, [key]: value }; }); } httpHandlerConfigs() { return this.config ?? {}; } }; __name(NodeHttpHandler, "NodeHttpHandler"); } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js var NodeHttp2ConnectionPool; var init_node_http2_connection_pool = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-pool.js"() { init_import_meta_url(); NodeHttp2ConnectionPool = class { constructor(sessions) { this.sessions = []; this.sessions = sessions ?? []; } poll() { if (this.sessions.length > 0) { return this.sessions.shift(); } } offerLast(session) { this.sessions.push(session); } contains(session) { return this.sessions.includes(session); } remove(session) { this.sessions = this.sessions.filter((s5) => s5 !== session); } [Symbol.iterator]() { return this.sessions[Symbol.iterator](); } destroy(connection) { for (const session of this.sessions) { if (session === connection) { if (!session.destroyed) { session.destroy(); } } } } }; __name(NodeHttp2ConnectionPool, "NodeHttp2ConnectionPool"); } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js var init_node_http2_connection_manager = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js"() { init_import_meta_url(); init_node_http2_connection_pool(); } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js var init_node_http2_handler = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js"() { init_import_meta_url(); init_dist_es2(); init_dist_es10(); init_get_transformed_headers(); init_node_http2_connection_manager(); init_write_request_body(); } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js var import_stream6, Collector; var init_collector = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/stream-collector/collector.js"() { init_import_meta_url(); import_stream6 = require("stream"); Collector = class extends import_stream6.Writable { constructor() { super(...arguments); this.bufferedBytes = []; } _write(chunk, encoding, callback) { this.bufferedBytes.push(chunk); callback(); } }; __name(Collector, "Collector"); } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js async function collectReadableStream(stream2) { const chunks = []; const reader = stream2.getReader(); let isDone = false; let length = 0; while (!isDone) { const { done, value } = await reader.read(); if (value) { chunks.push(value); length += value.length; } isDone = done; } const collected = new Uint8Array(length); let offset = 0; for (const chunk of chunks) { collected.set(chunk, offset); offset += chunk.length; } return collected; } var streamCollector, isReadableStreamInstance; var init_stream_collector = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/stream-collector/index.js"() { init_import_meta_url(); init_collector(); streamCollector = /* @__PURE__ */ __name((stream2) => { if (isReadableStreamInstance(stream2)) { return collectReadableStream(stream2); } return new Promise((resolve25, reject) => { const collector = new Collector(); stream2.pipe(collector); stream2.on("error", (err) => { collector.end(); reject(err); }); collector.on("error", reject); collector.on("finish", function() { const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); resolve25(bytes); }); }); }, "streamCollector"); isReadableStreamInstance = /* @__PURE__ */ __name((stream2) => typeof ReadableStream === "function" && stream2 instanceof ReadableStream, "isReadableStreamInstance"); __name(collectReadableStream, "collectReadableStream"); } }); // ../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/index.js var init_dist_es11 = __esm({ "../../node_modules/.pnpm/@smithy+node-http-handler@3.3.3/node_modules/@smithy/node-http-handler/dist-es/index.js"() { init_import_meta_url(); init_node_http_handler(); init_node_http2_handler(); init_stream_collector(); } }); // ../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/create-request.js var init_create_request = __esm({ "../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/create-request.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/request-timeout.js var init_request_timeout = __esm({ "../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/request-timeout.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js var init_fetch_http_handler = __esm({ "../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js"() { init_import_meta_url(); init_dist_es2(); init_dist_es10(); init_create_request(); init_request_timeout(); } }); // ../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js async function collectBlob(blob) { const base642 = await readToBase64(blob); const arrayBuffer2 = fromBase64(base642); return new Uint8Array(arrayBuffer2); } async function collectStream(stream2) { const chunks = []; const reader = stream2.getReader(); let isDone = false; let length = 0; while (!isDone) { const { done, value } = await reader.read(); if (value) { chunks.push(value); length += value.length; } isDone = done; } const collected = new Uint8Array(length); let offset = 0; for (const chunk of chunks) { collected.set(chunk, offset); offset += chunk.length; } return collected; } function readToBase64(blob) { return new Promise((resolve25, reject) => { const reader = new FileReader(); reader.onloadend = () => { if (reader.readyState !== 2) { return reject(new Error("Reader aborted too early")); } const result = reader.result ?? ""; const commaIndex = result.indexOf(","); const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length; resolve25(result.substring(dataOffset)); }; reader.onabort = () => reject(new Error("Read aborted")); reader.onerror = () => reject(reader.error); reader.readAsDataURL(blob); }); } var streamCollector2; var init_stream_collector2 = __esm({ "../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js"() { init_import_meta_url(); init_dist_es8(); streamCollector2 = /* @__PURE__ */ __name(async (stream2) => { if (typeof Blob === "function" && stream2 instanceof Blob || stream2.constructor?.name === "Blob") { if (Blob.prototype.arrayBuffer !== void 0) { return new Uint8Array(await stream2.arrayBuffer()); } return collectBlob(stream2); } return collectStream(stream2); }, "streamCollector"); __name(collectBlob, "collectBlob"); __name(collectStream, "collectStream"); __name(readToBase64, "readToBase64"); } }); // ../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/index.js var init_dist_es12 = __esm({ "../../node_modules/.pnpm/@smithy+fetch-http-handler@4.1.3/node_modules/@smithy/fetch-http-handler/dist-es/index.js"() { init_import_meta_url(); init_fetch_http_handler(); init_stream_collector2(); } }); // ../../node_modules/.pnpm/@smithy+util-hex-encoding@3.0.0/node_modules/@smithy/util-hex-encoding/dist-es/index.js function fromHex(encoded) { if (encoded.length % 2 !== 0) { throw new Error("Hex encoded strings must have an even number length"); } const out = new Uint8Array(encoded.length / 2); for (let i5 = 0; i5 < encoded.length; i5 += 2) { const encodedByte = encoded.slice(i5, i5 + 2).toLowerCase(); if (encodedByte in HEX_TO_SHORT) { out[i5 / 2] = HEX_TO_SHORT[encodedByte]; } else { throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`); } } return out; } function toHex(bytes) { let out = ""; for (let i5 = 0; i5 < bytes.byteLength; i5++) { out += SHORT_TO_HEX[bytes[i5]]; } return out; } var SHORT_TO_HEX, HEX_TO_SHORT; var init_dist_es13 = __esm({ "../../node_modules/.pnpm/@smithy+util-hex-encoding@3.0.0/node_modules/@smithy/util-hex-encoding/dist-es/index.js"() { init_import_meta_url(); SHORT_TO_HEX = {}; HEX_TO_SHORT = {}; for (let i5 = 0; i5 < 256; i5++) { let encodedByte = i5.toString(16).toLowerCase(); if (encodedByte.length === 1) { encodedByte = `0${encodedByte}`; } SHORT_TO_HEX[i5] = encodedByte; HEX_TO_SHORT[encodedByte] = i5; } __name(fromHex, "fromHex"); __name(toHex, "toHex"); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/stream-type-check.js var isReadableStream, isBlob2; var init_stream_type_check = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/stream-type-check.js"() { init_import_meta_url(); isReadableStream = /* @__PURE__ */ __name((stream2) => typeof ReadableStream === "function" && (stream2?.constructor?.name === ReadableStream.name || stream2 instanceof ReadableStream), "isReadableStream"); isBlob2 = /* @__PURE__ */ __name((blob) => { return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob); }, "isBlob"); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED, sdkStreamMixin, isBlobInstance; var init_sdk_stream_mixin_browser = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js"() { init_import_meta_url(); init_dist_es12(); init_dist_es8(); init_dist_es13(); init_dist_es7(); init_stream_type_check(); ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; sdkStreamMixin = /* @__PURE__ */ __name((stream2) => { if (!isBlobInstance(stream2) && !isReadableStream(stream2)) { const name2 = stream2?.__proto__?.constructor?.name || stream2; throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name2}`); } let transformed = false; const transformToByteArray = /* @__PURE__ */ __name(async () => { if (transformed) { throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); } transformed = true; return await streamCollector2(stream2); }, "transformToByteArray"); const blobToWebStream = /* @__PURE__ */ __name((blob) => { if (typeof blob.stream !== "function") { throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body"); } return blob.stream(); }, "blobToWebStream"); return Object.assign(stream2, { transformToByteArray, transformToString: async (encoding) => { const buf = await transformToByteArray(); if (encoding === "base64") { return toBase64(buf); } else if (encoding === "hex") { return toHex(buf); } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") { return toUtf8(buf); } else if (typeof TextDecoder === "function") { return new TextDecoder(encoding).decode(buf); } else { throw new Error("TextDecoder is not available, please make sure polyfill is provided."); } }, transformToWebStream: () => { if (transformed) { throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); } transformed = true; if (isBlobInstance(stream2)) { return blobToWebStream(stream2); } else if (isReadableStream(stream2)) { return stream2; } else { throw new Error(`Cannot transform payload to web stream, got ${stream2}`); } } }); }, "sdkStreamMixin"); isBlobInstance = /* @__PURE__ */ __name((stream2) => typeof Blob === "function" && stream2 instanceof Blob, "isBlobInstance"); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js var import_stream7, ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2, sdkStreamMixin2; var init_sdk_stream_mixin = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js"() { init_import_meta_url(); init_dist_es11(); init_dist_es6(); import_stream7 = require("stream"); init_sdk_stream_mixin_browser(); ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2 = "The stream has already been transformed."; sdkStreamMixin2 = /* @__PURE__ */ __name((stream2) => { if (!(stream2 instanceof import_stream7.Readable)) { try { return sdkStreamMixin(stream2); } catch (e7) { const name2 = stream2?.__proto__?.constructor?.name || stream2; throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name2}`); } } let transformed = false; const transformToByteArray = /* @__PURE__ */ __name(async () => { if (transformed) { throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2); } transformed = true; return await streamCollector(stream2); }, "transformToByteArray"); return Object.assign(stream2, { transformToByteArray, transformToString: async (encoding) => { const buf = await transformToByteArray(); if (encoding === void 0 || Buffer.isEncoding(encoding)) { return fromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); } else { const decoder = new TextDecoder(encoding); return decoder.decode(buf); } }, transformToWebStream: () => { if (transformed) { throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED2); } if (stream2.readableFlowing !== null) { throw new Error("The stream has been consumed by other callbacks."); } if (typeof import_stream7.Readable.toWeb !== "function") { throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available."); } transformed = true; return import_stream7.Readable.toWeb(stream2); } }); }, "sdkStreamMixin"); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/splitStream.browser.js async function splitStream(stream2) { if (typeof stream2.stream === "function") { stream2 = stream2.stream(); } const readableStream = stream2; return readableStream.tee(); } var init_splitStream_browser = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/splitStream.browser.js"() { init_import_meta_url(); __name(splitStream, "splitStream"); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/splitStream.js async function splitStream2(stream2) { if (isReadableStream(stream2) || isBlob2(stream2)) { return splitStream(stream2); } const stream1 = new import_stream8.PassThrough(); const stream22 = new import_stream8.PassThrough(); stream2.pipe(stream1); stream2.pipe(stream22); return [stream1, stream22]; } var import_stream8; var init_splitStream = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/splitStream.js"() { init_import_meta_url(); import_stream8 = require("stream"); init_splitStream_browser(); init_stream_type_check(); __name(splitStream2, "splitStream"); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/headStream.browser.js async function headStream(stream2, bytes) { let byteLengthCounter = 0; const chunks = []; const reader = stream2.getReader(); let isDone = false; while (!isDone) { const { done, value } = await reader.read(); if (value) { chunks.push(value); byteLengthCounter += value?.byteLength ?? 0; } if (byteLengthCounter >= bytes) { break; } isDone = done; } reader.releaseLock(); const collected = new Uint8Array(Math.min(bytes, byteLengthCounter)); let offset = 0; for (const chunk of chunks) { if (chunk.byteLength > collected.byteLength - offset) { collected.set(chunk.subarray(0, collected.byteLength - offset), offset); break; } else { collected.set(chunk, offset); } offset += chunk.length; } return collected; } var init_headStream_browser = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/headStream.browser.js"() { init_import_meta_url(); __name(headStream, "headStream"); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/headStream.js var import_stream9, headStream2, Collector2; var init_headStream = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/headStream.js"() { init_import_meta_url(); import_stream9 = require("stream"); init_headStream_browser(); init_stream_type_check(); headStream2 = /* @__PURE__ */ __name((stream2, bytes) => { if (isReadableStream(stream2)) { return headStream(stream2, bytes); } return new Promise((resolve25, reject) => { const collector = new Collector2(); collector.limit = bytes; stream2.pipe(collector); stream2.on("error", (err) => { collector.end(); reject(err); }); collector.on("error", reject); collector.on("finish", function() { const bytes2 = new Uint8Array(Buffer.concat(this.buffers)); resolve25(bytes2); }); }); }, "headStream"); Collector2 = class extends import_stream9.Writable { constructor() { super(...arguments); this.buffers = []; this.limit = Infinity; this.bytesBuffered = 0; } _write(chunk, encoding, callback) { this.buffers.push(chunk); this.bytesBuffered += chunk.byteLength ?? 0; if (this.bytesBuffered >= this.limit) { const excess = this.bytesBuffered - this.limit; const tailBuffer = this.buffers[this.buffers.length - 1]; this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess); this.emit("finish"); } callback(); } }; __name(Collector2, "Collector"); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.js var init_ChecksumStream = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.js"() { init_import_meta_url(); init_dist_es8(); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.browser.js var init_ChecksumStream_browser = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.browser.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.browser.js var init_createChecksumStream_browser = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.browser.js"() { init_import_meta_url(); init_dist_es8(); init_stream_type_check(); init_ChecksumStream_browser(); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.js var init_createChecksumStream = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.js"() { init_import_meta_url(); init_stream_type_check(); init_ChecksumStream(); init_createChecksumStream_browser(); } }); // ../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/index.js var init_dist_es14 = __esm({ "../../node_modules/.pnpm/@smithy+util-stream@3.3.4/node_modules/@smithy/util-stream/dist-es/index.js"() { init_import_meta_url(); init_Uint8ArrayBlobAdapter(); init_getAwsChunkedEncodingStream(); init_sdk_stream_mixin(); init_splitStream(); init_headStream(); init_stream_type_check(); init_createChecksumStream(); init_ChecksumStream(); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js var collectBody; var init_collect_stream_body = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js"() { init_import_meta_url(); init_dist_es14(); collectBody = /* @__PURE__ */ __name(async (streamBody = new Uint8Array(), context2) => { if (streamBody instanceof Uint8Array) { return Uint8ArrayBlobAdapter.mutate(streamBody); } if (!streamBody) { return Uint8ArrayBlobAdapter.mutate(new Uint8Array()); } const fromContext = context2.streamCollector(streamBody); return Uint8ArrayBlobAdapter.mutate(await fromContext); }, "collectBody"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js function extendedEncodeURIComponent(str) { return encodeURIComponent(str).replace(/[!'()*]/g, function(c6) { return "%" + c6.charCodeAt(0).toString(16).toUpperCase(); }); } var init_extended_encode_uri_component = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js"() { init_import_meta_url(); __name(extendedEncodeURIComponent, "extendedEncodeURIComponent"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js var resolvedPath; var init_resolve_path = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js"() { init_import_meta_url(); init_extended_encode_uri_component(); resolvedPath = /* @__PURE__ */ __name((resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { if (input != null && input[memberName] !== void 0) { const labelValue = labelValueProvider(); if (labelValue.length <= 0) { throw new Error("Empty value provided for input HTTP label: " + memberName + "."); } resolvedPath2 = resolvedPath2.replace(uriLabel, isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue)); } else { throw new Error("No value provided for input HTTP label: " + memberName + "."); } return resolvedPath2; }, "resolvedPath"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js function requestBuilder(input, context2) { return new RequestBuilder(input, context2); } var RequestBuilder; var init_requestBuilder = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js"() { init_import_meta_url(); init_dist_es2(); init_resolve_path(); __name(requestBuilder, "requestBuilder"); RequestBuilder = class { constructor(input, context2) { this.input = input; this.context = context2; this.query = {}; this.method = ""; this.headers = {}; this.path = ""; this.body = null; this.hostname = ""; this.resolvePathStack = []; } async build() { const { hostname: hostname2, protocol = "https", port, path: basePath } = await this.context.endpoint(); this.path = basePath; for (const resolvePath3 of this.resolvePathStack) { resolvePath3(this.path); } return new HttpRequest({ protocol, hostname: this.hostname || hostname2, port, method: this.method, path: this.path, query: this.query, body: this.body, headers: this.headers }); } hn(hostname2) { this.hostname = hostname2; return this; } bp(uriLabel) { this.resolvePathStack.push((basePath) => { this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel; }); return this; } p(memberName, labelValueProvider, uriLabel, isGreedyLabel) { this.resolvePathStack.push((path72) => { this.path = resolvedPath(path72, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel); }); return this; } h(headers) { this.headers = headers; return this; } q(query) { this.query = query; return this; } b(body) { this.body = body; return this; } m(method) { this.method = method; return this; } }; __name(RequestBuilder, "RequestBuilder"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/index.js var init_protocols = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/submodules/protocols/index.js"() { init_import_meta_url(); init_collect_stream_body(); init_extended_encode_uri_component(); init_requestBuilder(); init_resolve_path(); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/protocols/requestBuilder.js var init_requestBuilder2 = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/protocols/requestBuilder.js"() { init_import_meta_url(); init_protocols(); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/setFeature.js function setFeature2(context2, feature, value) { if (!context2.__smithy_context) { context2.__smithy_context = { features: {} }; } else if (!context2.__smithy_context.features) { context2.__smithy_context.features = {}; } context2.__smithy_context.features[feature] = value; } var init_setFeature2 = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/setFeature.js"() { init_import_meta_url(); __name(setFeature2, "setFeature"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js var DefaultIdentityProviderConfig; var init_DefaultIdentityProviderConfig = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js"() { init_import_meta_url(); DefaultIdentityProviderConfig = class { constructor(config) { this.authSchemes = /* @__PURE__ */ new Map(); for (const [key, value] of Object.entries(config)) { if (value !== void 0) { this.authSchemes.set(key, value); } } } getIdentityProvider(schemeId) { return this.authSchemes.get(schemeId); } }; __name(DefaultIdentityProviderConfig, "DefaultIdentityProviderConfig"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js var init_httpApiKeyAuth = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js"() { init_import_meta_url(); init_dist_es2(); init_dist_es(); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js var init_httpBearerAuth = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js"() { init_import_meta_url(); init_dist_es2(); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js var NoAuthSigner; var init_noAuth = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js"() { init_import_meta_url(); NoAuthSigner = class { async sign(httpRequest2, identity, signingProperties) { return httpRequest2; } }; __name(NoAuthSigner, "NoAuthSigner"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js var init_httpAuthSchemes = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js"() { init_import_meta_url(); init_httpApiKeyAuth(); init_httpBearerAuth(); init_noAuth(); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js var createIsIdentityExpiredFunction, EXPIRATION_MS, isIdentityExpired, doesIdentityRequireRefresh, memoizeIdentityProvider; var init_memoizeIdentityProvider = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js"() { init_import_meta_url(); createIsIdentityExpiredFunction = /* @__PURE__ */ __name((expirationMs) => (identity) => doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs, "createIsIdentityExpiredFunction"); EXPIRATION_MS = 3e5; isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS); doesIdentityRequireRefresh = /* @__PURE__ */ __name((identity) => identity.expiration !== void 0, "doesIdentityRequireRefresh"); memoizeIdentityProvider = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => { if (provider === void 0) { return void 0; } const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider; let resolved; let pending; let hasResult; let isConstant = false; const coalesceProvider = /* @__PURE__ */ __name(async (options32) => { if (!pending) { pending = normalizedProvider(options32); } try { resolved = await pending; hasResult = true; isConstant = false; } finally { pending = void 0; } return resolved; }, "coalesceProvider"); if (isExpired === void 0) { return async (options32) => { if (!hasResult || options32?.forceRefresh) { resolved = await coalesceProvider(options32); } return resolved; }; } return async (options32) => { if (!hasResult || options32?.forceRefresh) { resolved = await coalesceProvider(options32); } if (isConstant) { return resolved; } if (!requiresRefresh(resolved)) { isConstant = true; return resolved; } if (isExpired(resolved)) { await coalesceProvider(options32); return resolved; } return resolved; }; }, "memoizeIdentityProvider"); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js var init_util_identity_and_auth = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js"() { init_import_meta_url(); init_DefaultIdentityProviderConfig(); init_httpAuthSchemes(); init_memoizeIdentityProvider(); } }); // ../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/index.js var init_dist_es15 = __esm({ "../../node_modules/.pnpm/@smithy+core@2.5.7/node_modules/@smithy/core/dist-es/index.js"() { init_import_meta_url(); init_getSmithyContext(); init_middleware_http_auth_scheme(); init_middleware_http_signing(); init_normalizeProvider2(); init_createPaginator(); init_requestBuilder2(); init_setFeature2(); init_util_identity_and_auth(); } }); // ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/ProviderError.js var ProviderError; var init_ProviderError = __esm({ "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/ProviderError.js"() { init_import_meta_url(); ProviderError = class extends Error { constructor(message, options32 = true) { let logger4; let tryNextLink = true; if (typeof options32 === "boolean") { logger4 = void 0; tryNextLink = options32; } else if (options32 != null && typeof options32 === "object") { logger4 = options32.logger; tryNextLink = options32.tryNextLink ?? true; } super(message); this.name = "ProviderError"; this.tryNextLink = tryNextLink; Object.setPrototypeOf(this, ProviderError.prototype); logger4?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); } static from(error2, options32 = true) { return Object.assign(new this(error2.message, options32), error2); } }; __name(ProviderError, "ProviderError"); } }); // ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js var CredentialsProviderError; var init_CredentialsProviderError = __esm({ "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js"() { init_import_meta_url(); init_ProviderError(); CredentialsProviderError = class extends ProviderError { constructor(message, options32 = true) { super(message, options32); this.name = "CredentialsProviderError"; Object.setPrototypeOf(this, CredentialsProviderError.prototype); } }; __name(CredentialsProviderError, "CredentialsProviderError"); } }); // ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/TokenProviderError.js var TokenProviderError; var init_TokenProviderError = __esm({ "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/TokenProviderError.js"() { init_import_meta_url(); init_ProviderError(); TokenProviderError = class extends ProviderError { constructor(message, options32 = true) { super(message, options32); this.name = "TokenProviderError"; Object.setPrototypeOf(this, TokenProviderError.prototype); } }; __name(TokenProviderError, "TokenProviderError"); } }); // ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/chain.js var chain; var init_chain = __esm({ "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/chain.js"() { init_import_meta_url(); init_ProviderError(); chain = /* @__PURE__ */ __name((...providers) => async () => { if (providers.length === 0) { throw new ProviderError("No providers in chain"); } let lastProviderError; for (const provider of providers) { try { const credentials = await provider(); return credentials; } catch (err) { lastProviderError = err; if (err?.tryNextLink) { continue; } throw err; } } throw lastProviderError; }, "chain"); } }); // ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/fromStatic.js var fromStatic; var init_fromStatic = __esm({ "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/fromStatic.js"() { init_import_meta_url(); fromStatic = /* @__PURE__ */ __name((staticValue) => () => Promise.resolve(staticValue), "fromStatic"); } }); // ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/memoize.js var memoize; var init_memoize = __esm({ "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/memoize.js"() { init_import_meta_url(); memoize = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => { let resolved; let pending; let hasResult; let isConstant = false; const coalesceProvider = /* @__PURE__ */ __name(async () => { if (!pending) { pending = provider(); } try { resolved = await pending; hasResult = true; isConstant = false; } finally { pending = void 0; } return resolved; }, "coalesceProvider"); if (isExpired === void 0) { return async (options32) => { if (!hasResult || options32?.forceRefresh) { resolved = await coalesceProvider(); } return resolved; }; } return async (options32) => { if (!hasResult || options32?.forceRefresh) { resolved = await coalesceProvider(); } if (isConstant) { return resolved; } if (requiresRefresh && !requiresRefresh(resolved)) { isConstant = true; return resolved; } if (isExpired(resolved)) { await coalesceProvider(); return resolved; } return resolved; }; }, "memoize"); } }); // ../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/index.js var init_dist_es16 = __esm({ "../../node_modules/.pnpm/@smithy+property-provider@3.1.11/node_modules/@smithy/property-provider/dist-es/index.js"() { init_import_meta_url(); init_CredentialsProviderError(); init_ProviderError(); init_TokenProviderError(); init_chain(); init_fromStatic(); init_memoize(); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js var resolveAwsSdkSigV4AConfig, NODE_SIGV4A_CONFIG_OPTIONS; var init_resolveAwsSdkSigV4AConfig = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js"() { init_import_meta_url(); init_dist_es15(); init_dist_es16(); resolveAwsSdkSigV4AConfig = /* @__PURE__ */ __name((config) => { config.sigv4aSigningRegionSet = normalizeProvider2(config.sigv4aSigningRegionSet); return config; }, "resolveAwsSdkSigV4AConfig"); NODE_SIGV4A_CONFIG_OPTIONS = { environmentVariableSelector(env6) { if (env6.AWS_SIGV4A_SIGNING_REGION_SET) { return env6.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_4) => _4.trim()); } throw new ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", { tryNextLink: true }); }, configFileSelector(profile) { if (profile.sigv4a_signing_region_set) { return (profile.sigv4a_signing_region_set ?? "").split(",").map((_4) => _4.trim()); } throw new ProviderError("sigv4a_signing_region_set not set in profile.", { tryNextLink: true }); }, default: void 0 }; } }); // ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/constants.js var ALGORITHM_QUERY_PARAM, CREDENTIAL_QUERY_PARAM, AMZ_DATE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, EXPIRES_QUERY_PARAM, SIGNATURE_QUERY_PARAM, TOKEN_QUERY_PARAM, AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER, GENERATED_HEADERS, SIGNATURE_HEADER, SHA256_HEADER, TOKEN_HEADER, ALWAYS_UNSIGNABLE_HEADERS, PROXY_HEADER_PATTERN, SEC_HEADER_PATTERN, ALGORITHM_IDENTIFIER, EVENT_ALGORITHM_IDENTIFIER, UNSIGNED_PAYLOAD, MAX_CACHE_SIZE, KEY_TYPE_IDENTIFIER, MAX_PRESIGNED_TTL; var init_constants2 = __esm({ "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/constants.js"() { init_import_meta_url(); ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; EXPIRES_QUERY_PARAM = "X-Amz-Expires"; SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; AUTH_HEADER = "authorization"; AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); DATE_HEADER = "date"; GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); SHA256_HEADER = "x-amz-content-sha256"; TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); ALWAYS_UNSIGNABLE_HEADERS = { authorization: true, "cache-control": true, connection: true, expect: true, from: true, "keep-alive": true, "max-forwards": true, pragma: true, referer: true, te: true, trailer: true, "transfer-encoding": true, upgrade: true, "user-agent": true, "x-amzn-trace-id": true }; PROXY_HEADER_PATTERN = /^proxy-/; SEC_HEADER_PATTERN = /^sec-/; ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; MAX_CACHE_SIZE = 50; KEY_TYPE_IDENTIFIER = "aws4_request"; MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; } }); // ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js var signingKeyCache, cacheQueue, createScope, getSigningKey, hmac; var init_credentialDerivation = __esm({ "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js"() { init_import_meta_url(); init_dist_es13(); init_dist_es7(); init_constants2(); signingKeyCache = {}; cacheQueue = []; createScope = /* @__PURE__ */ __name((shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`, "createScope"); getSigningKey = /* @__PURE__ */ __name(async (sha256Constructor, credentials, shortDate, region, service) => { const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`; if (cacheKey in signingKeyCache) { return signingKeyCache[cacheKey]; } cacheQueue.push(cacheKey); while (cacheQueue.length > MAX_CACHE_SIZE) { delete signingKeyCache[cacheQueue.shift()]; } let key = `AWS4${credentials.secretAccessKey}`; for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) { key = await hmac(sha256Constructor, key, signable); } return signingKeyCache[cacheKey] = key; }, "getSigningKey"); hmac = /* @__PURE__ */ __name((ctor, secret2, data) => { const hash = new ctor(secret2); hash.update(toUint8Array(data)); return hash.digest(); }, "hmac"); } }); // ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js var getCanonicalHeaders; var init_getCanonicalHeaders = __esm({ "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js"() { init_import_meta_url(); init_constants2(); getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders, signableHeaders) => { const canonical = {}; for (const headerName of Object.keys(headers).sort()) { if (headers[headerName] == void 0) { continue; } const canonicalHeaderName = headerName.toLowerCase(); if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || unsignableHeaders?.has(canonicalHeaderName) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) { if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) { continue; } } canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " "); } return canonical; }, "getCanonicalHeaders"); } }); // ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js var getCanonicalQuery; var init_getCanonicalQuery = __esm({ "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js"() { init_import_meta_url(); init_dist_es9(); init_constants2(); getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => { const keys = []; const serialized = {}; for (const key of Object.keys(query)) { if (key.toLowerCase() === SIGNATURE_HEADER) { continue; } const encodedKey = escapeUri(key); keys.push(encodedKey); const value = query[key]; if (typeof value === "string") { serialized[encodedKey] = `${encodedKey}=${escapeUri(value)}`; } else if (Array.isArray(value)) { serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${encodedKey}=${escapeUri(value2)}`]), []).sort().join("&"); } } return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&"); }, "getCanonicalQuery"); } }); // ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js var getPayloadHash; var init_getPayloadHash = __esm({ "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js"() { init_import_meta_url(); init_dist_es5(); init_dist_es13(); init_dist_es7(); init_constants2(); getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstructor) => { for (const headerName of Object.keys(headers)) { if (headerName.toLowerCase() === SHA256_HEADER) { return headers[headerName]; } } if (body == void 0) { return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; } else if (typeof body === "string" || ArrayBuffer.isView(body) || isArrayBuffer(body)) { const hashCtor = new hashConstructor(); hashCtor.update(toUint8Array(body)); return toHex(await hashCtor.digest()); } return UNSIGNED_PAYLOAD; }, "getPayloadHash"); } }); // ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js function negate(bytes) { for (let i5 = 0; i5 < 8; i5++) { bytes[i5] ^= 255; } for (let i5 = 7; i5 > -1; i5--) { bytes[i5]++; if (bytes[i5] !== 0) break; } } var HeaderFormatter, HEADER_VALUE_TYPE, UUID_PATTERN, Int64; var init_HeaderFormatter = __esm({ "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js"() { init_import_meta_url(); init_dist_es13(); init_dist_es7(); HeaderFormatter = class { format(headers) { const chunks = []; for (const headerName of Object.keys(headers)) { const bytes = fromUtf8(headerName); chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName])); } const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0)); let position = 0; for (const chunk of chunks) { out.set(chunk, position); position += chunk.byteLength; } return out; } formatHeaderValue(header) { switch (header.type) { case "boolean": return Uint8Array.from([header.value ? 0 : 1]); case "byte": return Uint8Array.from([2, header.value]); case "short": const shortView = new DataView(new ArrayBuffer(3)); shortView.setUint8(0, 3); shortView.setInt16(1, header.value, false); return new Uint8Array(shortView.buffer); case "integer": const intView = new DataView(new ArrayBuffer(5)); intView.setUint8(0, 4); intView.setInt32(1, header.value, false); return new Uint8Array(intView.buffer); case "long": const longBytes = new Uint8Array(9); longBytes[0] = 5; longBytes.set(header.value.bytes, 1); return longBytes; case "binary": const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength)); binView.setUint8(0, 6); binView.setUint16(1, header.value.byteLength, false); const binBytes = new Uint8Array(binView.buffer); binBytes.set(header.value, 3); return binBytes; case "string": const utf8Bytes = fromUtf8(header.value); const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength)); strView.setUint8(0, 7); strView.setUint16(1, utf8Bytes.byteLength, false); const strBytes = new Uint8Array(strView.buffer); strBytes.set(utf8Bytes, 3); return strBytes; case "timestamp": const tsBytes = new Uint8Array(9); tsBytes[0] = 8; tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1); return tsBytes; case "uuid": if (!UUID_PATTERN.test(header.value)) { throw new Error(`Invalid UUID received: ${header.value}`); } const uuidBytes = new Uint8Array(17); uuidBytes[0] = 9; uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1); return uuidBytes; } } }; __name(HeaderFormatter, "HeaderFormatter"); (function(HEADER_VALUE_TYPE3) { HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolTrue"] = 0] = "boolTrue"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["boolFalse"] = 1] = "boolFalse"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byte"] = 2] = "byte"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["short"] = 3] = "short"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["integer"] = 4] = "integer"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["long"] = 5] = "long"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["byteArray"] = 6] = "byteArray"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["string"] = 7] = "string"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["timestamp"] = 8] = "timestamp"; HEADER_VALUE_TYPE3[HEADER_VALUE_TYPE3["uuid"] = 9] = "uuid"; })(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {})); UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; Int64 = class { constructor(bytes) { this.bytes = bytes; if (bytes.byteLength !== 8) { throw new Error("Int64 buffers must be exactly 8 bytes"); } } static fromNumber(number) { if (number > 9223372036854776e3 || number < -9223372036854776e3) { throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`); } const bytes = new Uint8Array(8); for (let i5 = 7, remaining = Math.abs(Math.round(number)); i5 > -1 && remaining > 0; i5--, remaining /= 256) { bytes[i5] = remaining; } if (number < 0) { negate(bytes); } return new Int64(bytes); } valueOf() { const bytes = this.bytes.slice(0); const negative = bytes[0] & 128; if (negative) { negate(bytes); } return parseInt(toHex(bytes), 16) * (negative ? -1 : 1); } toString() { return String(this.valueOf()); } }; __name(Int64, "Int64"); __name(negate, "negate"); } }); // ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/headerUtil.js var hasHeader; var init_headerUtil = __esm({ "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/headerUtil.js"() { init_import_meta_url(); hasHeader = /* @__PURE__ */ __name((soughtHeader, headers) => { soughtHeader = soughtHeader.toLowerCase(); for (const headerName of Object.keys(headers)) { if (soughtHeader === headerName.toLowerCase()) { return true; } } return false; }, "hasHeader"); } }); // ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js var moveHeadersToQuery; var init_moveHeadersToQuery = __esm({ "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js"() { init_import_meta_url(); init_dist_es2(); moveHeadersToQuery = /* @__PURE__ */ __name((request4, options32 = {}) => { const { headers, query = {} } = HttpRequest.clone(request4); for (const name2 of Object.keys(headers)) { const lname = name2.toLowerCase(); if (lname.slice(0, 6) === "x-amz-" && !options32.unhoistableHeaders?.has(lname) || options32.hoistableHeaders?.has(lname)) { query[name2] = headers[name2]; delete headers[name2]; } } return { ...request4, headers, query }; }, "moveHeadersToQuery"); } }); // ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js var prepareRequest; var init_prepareRequest = __esm({ "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js"() { init_import_meta_url(); init_dist_es2(); init_constants2(); prepareRequest = /* @__PURE__ */ __name((request4) => { request4 = HttpRequest.clone(request4); for (const headerName of Object.keys(request4.headers)) { if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { delete request4.headers[headerName]; } } return request4; }, "prepareRequest"); } }); // ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/utilDate.js var iso8601, toDate2; var init_utilDate = __esm({ "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/utilDate.js"() { init_import_meta_url(); iso8601 = /* @__PURE__ */ __name((time) => toDate2(time).toISOString().replace(/\.\d{3}Z$/, "Z"), "iso8601"); toDate2 = /* @__PURE__ */ __name((time) => { if (typeof time === "number") { return new Date(time * 1e3); } if (typeof time === "string") { if (Number(time)) { return new Date(Number(time) * 1e3); } return new Date(time); } return time; }, "toDate"); } }); // ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js var SignatureV4, formatDate, getCanonicalHeaderList; var init_SignatureV4 = __esm({ "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js"() { init_import_meta_url(); init_dist_es13(); init_dist_es3(); init_dist_es9(); init_dist_es7(); init_constants2(); init_credentialDerivation(); init_getCanonicalHeaders(); init_getCanonicalQuery(); init_getPayloadHash(); init_HeaderFormatter(); init_headerUtil(); init_moveHeadersToQuery(); init_prepareRequest(); init_utilDate(); SignatureV4 = class { constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) { this.headerFormatter = new HeaderFormatter(); this.service = service; this.sha256 = sha256; this.uriEscapePath = uriEscapePath; this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; this.regionProvider = normalizeProvider(region); this.credentialProvider = normalizeProvider(credentials); } async presign(originalRequest, options32 = {}) { const { signingDate = /* @__PURE__ */ new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, hoistableHeaders, signingRegion, signingService } = options32; const credentials = await this.credentialProvider(); this.validateResolvedCredentials(credentials); const region = signingRegion ?? await this.regionProvider(); const { longDate, shortDate } = formatDate(signingDate); if (expiresIn > MAX_PRESIGNED_TTL) { return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future"); } const scope = createScope(shortDate, region, signingService ?? this.service); const request4 = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders }); if (credentials.sessionToken) { request4.query[TOKEN_QUERY_PARAM] = credentials.sessionToken; } request4.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER; request4.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; request4.query[AMZ_DATE_QUERY_PARAM] = longDate; request4.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); const canonicalHeaders = getCanonicalHeaders(request4, unsignableHeaders, signableHeaders); request4.query[SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders); request4.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request4, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))); return request4; } async sign(toSign, options32) { if (typeof toSign === "string") { return this.signString(toSign, options32); } else if (toSign.headers && toSign.payload) { return this.signEvent(toSign, options32); } else if (toSign.message) { return this.signMessage(toSign, options32); } else { return this.signRequest(toSign, options32); } } async signEvent({ headers, payload }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }) { const region = signingRegion ?? await this.regionProvider(); const { shortDate, longDate } = formatDate(signingDate); const scope = createScope(shortDate, region, signingService ?? this.service); const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256); const hash = new this.sha256(); hash.update(headers); const hashedHeaders = toHex(await hash.digest()); const stringToSign = [ EVENT_ALGORITHM_IDENTIFIER, longDate, scope, priorSignature, hashedHeaders, hashedPayload ].join("\n"); return this.signString(stringToSign, { signingDate, signingRegion: region, signingService }); } async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService }) { const promise = this.signEvent({ headers: this.headerFormatter.format(signableMessage.message.headers), payload: signableMessage.message.body }, { signingDate, signingRegion, signingService, priorSignature: signableMessage.priorSignature }); return promise.then((signature) => { return { message: signableMessage.message, signature }; }); } async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService } = {}) { const credentials = await this.credentialProvider(); this.validateResolvedCredentials(credentials); const region = signingRegion ?? await this.regionProvider(); const { shortDate } = formatDate(signingDate); const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); hash.update(toUint8Array(stringToSign)); return toHex(await hash.digest()); } async signRequest(requestToSign, { signingDate = /* @__PURE__ */ new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService } = {}) { const credentials = await this.credentialProvider(); this.validateResolvedCredentials(credentials); const region = signingRegion ?? await this.regionProvider(); const request4 = prepareRequest(requestToSign); const { longDate, shortDate } = formatDate(signingDate); const scope = createScope(shortDate, region, signingService ?? this.service); request4.headers[AMZ_DATE_HEADER] = longDate; if (credentials.sessionToken) { request4.headers[TOKEN_HEADER] = credentials.sessionToken; } const payloadHash = await getPayloadHash(request4, this.sha256); if (!hasHeader(SHA256_HEADER, request4.headers) && this.applyChecksum) { request4.headers[SHA256_HEADER] = payloadHash; } const canonicalHeaders = getCanonicalHeaders(request4, unsignableHeaders, signableHeaders); const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request4, canonicalHeaders, payloadHash)); request4.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`; return request4; } createCanonicalRequest(request4, canonicalHeaders, payloadHash) { const sortedHeaders = Object.keys(canonicalHeaders).sort(); return `${request4.method} ${this.getCanonicalPath(request4)} ${getCanonicalQuery(request4)} ${sortedHeaders.map((name2) => `${name2}:${canonicalHeaders[name2]}`).join("\n")} ${sortedHeaders.join(";")} ${payloadHash}`; } async createStringToSign(longDate, credentialScope, canonicalRequest) { const hash = new this.sha256(); hash.update(toUint8Array(canonicalRequest)); const hashedRequest = await hash.digest(); return `${ALGORITHM_IDENTIFIER} ${longDate} ${credentialScope} ${toHex(hashedRequest)}`; } getCanonicalPath({ path: path72 }) { if (this.uriEscapePath) { const normalizedPathSegments = []; for (const pathSegment of path72.split("/")) { if (pathSegment?.length === 0) continue; if (pathSegment === ".") continue; if (pathSegment === "..") { normalizedPathSegments.pop(); } else { normalizedPathSegments.push(pathSegment); } } const normalizedPath = `${path72?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path72?.endsWith("/") ? "/" : ""}`; const doubleEncoded = escapeUri(normalizedPath); return doubleEncoded.replace(/%2F/g, "/"); } return path72; } async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest); const hash = new this.sha256(await keyPromise); hash.update(toUint8Array(stringToSign)); return toHex(await hash.digest()); } getSigningKey(credentials, region, shortDate, service) { return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); } validateResolvedCredentials(credentials) { if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") { throw new Error("Resolved credential object is not valid"); } } }; __name(SignatureV4, "SignatureV4"); formatDate = /* @__PURE__ */ __name((now) => { const longDate = iso8601(now).replace(/[\-:]/g, ""); return { longDate, shortDate: longDate.slice(0, 8) }; }, "formatDate"); getCanonicalHeaderList = /* @__PURE__ */ __name((headers) => Object.keys(headers).sort().join(";"), "getCanonicalHeaderList"); } }); // ../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/index.js var init_dist_es17 = __esm({ "../../node_modules/.pnpm/@smithy+signature-v4@4.2.4/node_modules/@smithy/signature-v4/dist-es/index.js"() { init_import_meta_url(); init_SignatureV4(); init_getCanonicalHeaders(); init_getCanonicalQuery(); init_getPayloadHash(); init_moveHeadersToQuery(); init_prepareRequest(); init_credentialDerivation(); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js var resolveAwsSdkSigV4Config; var init_resolveAwsSdkSigV4Config = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js"() { init_import_meta_url(); init_client2(); init_dist_es15(); init_dist_es17(); resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => { let isUserSupplied = false; let credentialsProvider; if (config.credentials) { isUserSupplied = true; credentialsProvider = memoizeIdentityProvider(config.credentials, isIdentityExpired, doesIdentityRequireRefresh); } if (!credentialsProvider) { if (config.credentialDefaultProvider) { credentialsProvider = normalizeProvider2(config.credentialDefaultProvider(Object.assign({}, config, { parentClientConfig: config }))); } else { credentialsProvider = /* @__PURE__ */ __name(async () => { throw new Error("`credentials` is missing"); }, "credentialsProvider"); } } const boundCredentialsProvider = /* @__PURE__ */ __name(async () => credentialsProvider({ callerClientConfig: config }), "boundCredentialsProvider"); const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256 } = config; let signer; if (config.signer) { signer = normalizeProvider2(config.signer); } else if (config.regionInfoProvider) { signer = /* @__PURE__ */ __name(() => normalizeProvider2(config.region)().then(async (region) => [ await config.regionInfoProvider(region, { useFipsEndpoint: await config.useFipsEndpoint(), useDualstackEndpoint: await config.useDualstackEndpoint() }) || {}, region ]).then(([regionInfo, region]) => { const { signingRegion, signingService } = regionInfo; config.signingRegion = config.signingRegion || signingRegion || region; config.signingName = config.signingName || signingService || config.serviceId; const params = { ...config, credentials: boundCredentialsProvider, region: config.signingRegion, service: config.signingName, sha256, uriEscapePath: signingEscapePath }; const SignerCtor = config.signerConstructor || SignatureV4; return new SignerCtor(params); }), "signer"); } else { signer = /* @__PURE__ */ __name(async (authScheme) => { authScheme = Object.assign({}, { name: "sigv4", signingName: config.signingName || config.defaultSigningName, signingRegion: await normalizeProvider2(config.region)(), properties: {} }, authScheme); const signingRegion = authScheme.signingRegion; const signingService = authScheme.signingName; config.signingRegion = config.signingRegion || signingRegion; config.signingName = config.signingName || signingService || config.serviceId; const params = { ...config, credentials: boundCredentialsProvider, region: config.signingRegion, service: config.signingName, sha256, uriEscapePath: signingEscapePath }; const SignerCtor = config.signerConstructor || SignatureV4; return new SignerCtor(params); }, "signer"); } return { ...config, systemClockOffset, signingEscapePath, credentials: isUserSupplied ? async () => boundCredentialsProvider().then((creds) => setCredentialFeature(creds, "CREDENTIALS_CODE", "e")) : boundCredentialsProvider, signer }; }, "resolveAwsSdkSigV4Config"); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js var init_aws_sdk = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js"() { init_import_meta_url(); init_AwsSdkSigV4Signer(); init_AwsSdkSigV4ASigner(); init_resolveAwsSdkSigV4AConfig(); init_resolveAwsSdkSigV4Config(); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js var init_httpAuthSchemes2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js"() { init_import_meta_url(); init_aws_sdk(); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js var init_coercing_serializers = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+middleware-stack@3.0.11/node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js var getAllAliases, getMiddlewareNameWithAliases, constructStack, stepWeights, priorityWeights; var init_MiddlewareStack = __esm({ "../../node_modules/.pnpm/@smithy+middleware-stack@3.0.11/node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js"() { init_import_meta_url(); getAllAliases = /* @__PURE__ */ __name((name2, aliases2) => { const _aliases = []; if (name2) { _aliases.push(name2); } if (aliases2) { for (const alias of aliases2) { _aliases.push(alias); } } return _aliases; }, "getAllAliases"); getMiddlewareNameWithAliases = /* @__PURE__ */ __name((name2, aliases2) => { return `${name2 || "anonymous"}${aliases2 && aliases2.length > 0 ? ` (a.k.a. ${aliases2.join(",")})` : ""}`; }, "getMiddlewareNameWithAliases"); constructStack = /* @__PURE__ */ __name(() => { let absoluteEntries = []; let relativeEntries = []; let identifyOnResolve = false; const entriesNameSet = /* @__PURE__ */ new Set(); const sort = /* @__PURE__ */ __name((entries) => entries.sort((a5, b6) => stepWeights[b6.step] - stepWeights[a5.step] || priorityWeights[b6.priority || "normal"] - priorityWeights[a5.priority || "normal"]), "sort"); const removeByName = /* @__PURE__ */ __name((toRemove) => { let isRemoved = false; const filterCb = /* @__PURE__ */ __name((entry) => { const aliases2 = getAllAliases(entry.name, entry.aliases); if (aliases2.includes(toRemove)) { isRemoved = true; for (const alias of aliases2) { entriesNameSet.delete(alias); } return false; } return true; }, "filterCb"); absoluteEntries = absoluteEntries.filter(filterCb); relativeEntries = relativeEntries.filter(filterCb); return isRemoved; }, "removeByName"); const removeByReference = /* @__PURE__ */ __name((toRemove) => { let isRemoved = false; const filterCb = /* @__PURE__ */ __name((entry) => { if (entry.middleware === toRemove) { isRemoved = true; for (const alias of getAllAliases(entry.name, entry.aliases)) { entriesNameSet.delete(alias); } return false; } return true; }, "filterCb"); absoluteEntries = absoluteEntries.filter(filterCb); relativeEntries = relativeEntries.filter(filterCb); return isRemoved; }, "removeByReference"); const cloneTo = /* @__PURE__ */ __name((toStack) => { absoluteEntries.forEach((entry) => { toStack.add(entry.middleware, { ...entry }); }); relativeEntries.forEach((entry) => { toStack.addRelativeTo(entry.middleware, { ...entry }); }); toStack.identifyOnResolve?.(stack.identifyOnResolve()); return toStack; }, "cloneTo"); const expandRelativeMiddlewareList = /* @__PURE__ */ __name((from) => { const expandedMiddlewareList = []; from.before.forEach((entry) => { if (entry.before.length === 0 && entry.after.length === 0) { expandedMiddlewareList.push(entry); } else { expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); } }); expandedMiddlewareList.push(from); from.after.reverse().forEach((entry) => { if (entry.before.length === 0 && entry.after.length === 0) { expandedMiddlewareList.push(entry); } else { expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry)); } }); return expandedMiddlewareList; }, "expandRelativeMiddlewareList"); const getMiddlewareList = /* @__PURE__ */ __name((debug = false) => { const normalizedAbsoluteEntries = []; const normalizedRelativeEntries = []; const normalizedEntriesNameMap = {}; absoluteEntries.forEach((entry) => { const normalizedEntry = { ...entry, before: [], after: [] }; for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { normalizedEntriesNameMap[alias] = normalizedEntry; } normalizedAbsoluteEntries.push(normalizedEntry); }); relativeEntries.forEach((entry) => { const normalizedEntry = { ...entry, before: [], after: [] }; for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) { normalizedEntriesNameMap[alias] = normalizedEntry; } normalizedRelativeEntries.push(normalizedEntry); }); normalizedRelativeEntries.forEach((entry) => { if (entry.toMiddleware) { const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware]; if (toMiddleware === void 0) { if (debug) { return; } throw new Error(`${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`); } if (entry.relation === "after") { toMiddleware.after.push(entry); } if (entry.relation === "before") { toMiddleware.before.push(entry); } } }); const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList, expandedMiddlewareList) => { wholeList.push(...expandedMiddlewareList); return wholeList; }, []); return mainChain; }, "getMiddlewareList"); const stack = { add: (middleware, options32 = {}) => { const { name: name2, override, aliases: _aliases } = options32; const entry = { step: "initialize", priority: "normal", middleware, ...options32 }; const aliases2 = getAllAliases(name2, _aliases); if (aliases2.length > 0) { if (aliases2.some((alias) => entriesNameSet.has(alias))) { if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name2, _aliases)}'`); for (const alias of aliases2) { const toOverrideIndex = absoluteEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a5) => a5 === alias)); if (toOverrideIndex === -1) { continue; } const toOverride = absoluteEntries[toOverrideIndex]; if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) { throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name2, _aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.`); } absoluteEntries.splice(toOverrideIndex, 1); } } for (const alias of aliases2) { entriesNameSet.add(alias); } } absoluteEntries.push(entry); }, addRelativeTo: (middleware, options32) => { const { name: name2, override, aliases: _aliases } = options32; const entry = { middleware, ...options32 }; const aliases2 = getAllAliases(name2, _aliases); if (aliases2.length > 0) { if (aliases2.some((alias) => entriesNameSet.has(alias))) { if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name2, _aliases)}'`); for (const alias of aliases2) { const toOverrideIndex = relativeEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a5) => a5 === alias)); if (toOverrideIndex === -1) { continue; } const toOverride = relativeEntries[toOverrideIndex]; if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) { throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name2, _aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.`); } relativeEntries.splice(toOverrideIndex, 1); } } for (const alias of aliases2) { entriesNameSet.add(alias); } } relativeEntries.push(entry); }, clone: () => cloneTo(constructStack()), use: (plugin) => { plugin.applyToStack(stack); }, remove: (toRemove) => { if (typeof toRemove === "string") return removeByName(toRemove); else return removeByReference(toRemove); }, removeByTag: (toRemove) => { let isRemoved = false; const filterCb = /* @__PURE__ */ __name((entry) => { const { tags, name: name2, aliases: _aliases } = entry; if (tags && tags.includes(toRemove)) { const aliases2 = getAllAliases(name2, _aliases); for (const alias of aliases2) { entriesNameSet.delete(alias); } isRemoved = true; return false; } return true; }, "filterCb"); absoluteEntries = absoluteEntries.filter(filterCb); relativeEntries = relativeEntries.filter(filterCb); return isRemoved; }, concat: (from) => { const cloned = cloneTo(constructStack()); cloned.use(from); cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? false)); return cloned; }, applyToStack: cloneTo, identify: () => { return getMiddlewareList(true).map((mw) => { const step = mw.step ?? mw.relation + " " + mw.toMiddleware; return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step; }); }, identifyOnResolve(toggle) { if (typeof toggle === "boolean") identifyOnResolve = toggle; return identifyOnResolve; }, resolve: (handler31, context2) => { for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) { handler31 = middleware(handler31, context2); } if (identifyOnResolve) { console.log(stack.identify()); } return handler31; } }; return stack; }, "constructStack"); stepWeights = { initialize: 5, serialize: 4, build: 3, finalizeRequest: 2, deserialize: 1 }; priorityWeights = { high: 3, normal: 2, low: 1 }; } }); // ../../node_modules/.pnpm/@smithy+middleware-stack@3.0.11/node_modules/@smithy/middleware-stack/dist-es/index.js var init_dist_es18 = __esm({ "../../node_modules/.pnpm/@smithy+middleware-stack@3.0.11/node_modules/@smithy/middleware-stack/dist-es/index.js"() { init_import_meta_url(); init_MiddlewareStack(); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/client.js var Client; var init_client3 = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/client.js"() { init_import_meta_url(); init_dist_es18(); Client = class { constructor(config) { this.config = config; this.middlewareStack = constructStack(); } send(command2, optionsOrCb, cb2) { const options32 = typeof optionsOrCb !== "function" ? optionsOrCb : void 0; const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb2; const useHandlerCache = options32 === void 0 && this.config.cacheMiddleware === true; let handler31; if (useHandlerCache) { if (!this.handlers) { this.handlers = /* @__PURE__ */ new WeakMap(); } const handlers2 = this.handlers; if (handlers2.has(command2.constructor)) { handler31 = handlers2.get(command2.constructor); } else { handler31 = command2.resolveMiddleware(this.middlewareStack, this.config, options32); handlers2.set(command2.constructor, handler31); } } else { delete this.handlers; handler31 = command2.resolveMiddleware(this.middlewareStack, this.config, options32); } if (callback) { handler31(command2).then((result) => callback(null, result.output), (err) => callback(err)).catch(() => { }); } else { return handler31(command2).then((result) => result.output); } } destroy() { this.config?.requestHandler?.destroy?.(); delete this.handlers; } }; __name(Client, "Client"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/collect-stream-body.js var init_collect_stream_body2 = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/collect-stream-body.js"() { init_import_meta_url(); init_protocols(); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/command.js var Command, ClassBuilder; var init_command2 = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/command.js"() { init_import_meta_url(); init_dist_es18(); init_dist_es(); Command = class { constructor() { this.middlewareStack = constructStack(); } static classBuilder() { return new ClassBuilder(); } resolveMiddlewareWithContext(clientStack, configuration, options32, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor }) { for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options32)) { this.middlewareStack.use(mw); } const stack = clientStack.concat(this.middlewareStack); const { logger: logger4 } = configuration; const handlerExecutionContext = { logger: logger4, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, [SMITHY_CONTEXT_KEY]: { commandInstance: this, ...smithyContext }, ...additionalContext }; const { requestHandler } = configuration; return stack.resolve((request4) => requestHandler.handle(request4.request, options32 || {}), handlerExecutionContext); } }; __name(Command, "Command"); ClassBuilder = class { constructor() { this._init = () => { }; this._ep = {}; this._middlewareFn = () => []; this._commandName = ""; this._clientName = ""; this._additionalContext = {}; this._smithyContext = {}; this._inputFilterSensitiveLog = (_4) => _4; this._outputFilterSensitiveLog = (_4) => _4; this._serializer = null; this._deserializer = null; } init(cb2) { this._init = cb2; } ep(endpointParameterInstructions) { this._ep = endpointParameterInstructions; return this; } m(middlewareSupplier) { this._middlewareFn = middlewareSupplier; return this; } s(service, operation, smithyContext = {}) { this._smithyContext = { service, operation, ...smithyContext }; return this; } c(additionalContext = {}) { this._additionalContext = additionalContext; return this; } n(clientName, commandName) { this._clientName = clientName; this._commandName = commandName; return this; } f(inputFilter = (_4) => _4, outputFilter = (_4) => _4) { this._inputFilterSensitiveLog = inputFilter; this._outputFilterSensitiveLog = outputFilter; return this; } ser(serializer) { this._serializer = serializer; return this; } de(deserializer) { this._deserializer = deserializer; return this; } build() { const closure = this; let CommandRef; return CommandRef = /* @__PURE__ */ __name(class extends Command { static getEndpointParameterInstructions() { return closure._ep; } constructor(...[input]) { super(); this.serialize = closure._serializer; this.deserialize = closure._deserializer; this.input = input ?? {}; closure._init(this); } resolveMiddleware(stack, configuration, options32) { return this.resolveMiddlewareWithContext(stack, configuration, options32, { CommandCtor: CommandRef, middlewareFn: closure._middlewareFn, clientName: closure._clientName, commandName: closure._commandName, inputFilterSensitiveLog: closure._inputFilterSensitiveLog, outputFilterSensitiveLog: closure._outputFilterSensitiveLog, smithyContext: closure._smithyContext, additionalContext: closure._additionalContext }); } }, "CommandRef"); } }; __name(ClassBuilder, "ClassBuilder"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/constants.js var SENSITIVE_STRING; var init_constants3 = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/constants.js"() { init_import_meta_url(); SENSITIVE_STRING = "***SensitiveInformation***"; } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js var createAggregatedClient; var init_create_aggregated_client = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/create-aggregated-client.js"() { init_import_meta_url(); createAggregatedClient = /* @__PURE__ */ __name((commands4, Client2) => { for (const command2 of Object.keys(commands4)) { const CommandCtor = commands4[command2]; const methodImpl = /* @__PURE__ */ __name(async function(args, optionsOrCb, cb2) { const command3 = new CommandCtor(args); if (typeof optionsOrCb === "function") { this.send(command3, optionsOrCb); } else if (typeof cb2 === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expected http options but got ${typeof optionsOrCb}`); this.send(command3, optionsOrCb || {}, cb2); } else { return this.send(command3, optionsOrCb); } }, "methodImpl"); const methodName = (command2[0].toLowerCase() + command2.slice(1)).replace(/Command$/, ""); Client2.prototype[methodName] = methodImpl; } }, "createAggregatedClient"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/parse-utils.js var parseBoolean, expectNumber, MAX_FLOAT, expectFloat32, expectLong, expectInt32, expectShort, expectByte, expectSizedInt, castInt, expectNonNull, expectObject, expectString, strictParseFloat32, NUMBER_REGEX, parseNumber2, strictParseInt32, strictParseShort, strictParseByte, stackTraceWarning, logger2; var init_parse_utils = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/parse-utils.js"() { init_import_meta_url(); parseBoolean = /* @__PURE__ */ __name((value) => { switch (value) { case "true": return true; case "false": return false; default: throw new Error(`Unable to parse boolean value "${value}"`); } }, "parseBoolean"); expectNumber = /* @__PURE__ */ __name((value) => { if (value === null || value === void 0) { return void 0; } if (typeof value === "string") { const parsed = parseFloat(value); if (!Number.isNaN(parsed)) { if (String(parsed) !== String(value)) { logger2.warn(stackTraceWarning(`Expected number but observed string: ${value}`)); } return parsed; } } if (typeof value === "number") { return value; } throw new TypeError(`Expected number, got ${typeof value}: ${value}`); }, "expectNumber"); MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); expectFloat32 = /* @__PURE__ */ __name((value) => { const expected = expectNumber(value); if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) { if (Math.abs(expected) > MAX_FLOAT) { throw new TypeError(`Expected 32-bit float, got ${value}`); } } return expected; }, "expectFloat32"); expectLong = /* @__PURE__ */ __name((value) => { if (value === null || value === void 0) { return void 0; } if (Number.isInteger(value) && !Number.isNaN(value)) { return value; } throw new TypeError(`Expected integer, got ${typeof value}: ${value}`); }, "expectLong"); expectInt32 = /* @__PURE__ */ __name((value) => expectSizedInt(value, 32), "expectInt32"); expectShort = /* @__PURE__ */ __name((value) => expectSizedInt(value, 16), "expectShort"); expectByte = /* @__PURE__ */ __name((value) => expectSizedInt(value, 8), "expectByte"); expectSizedInt = /* @__PURE__ */ __name((value, size) => { const expected = expectLong(value); if (expected !== void 0 && castInt(expected, size) !== expected) { throw new TypeError(`Expected ${size}-bit integer, got ${value}`); } return expected; }, "expectSizedInt"); castInt = /* @__PURE__ */ __name((value, size) => { switch (size) { case 32: return Int32Array.of(value)[0]; case 16: return Int16Array.of(value)[0]; case 8: return Int8Array.of(value)[0]; } }, "castInt"); expectNonNull = /* @__PURE__ */ __name((value, location) => { if (value === null || value === void 0) { if (location) { throw new TypeError(`Expected a non-null value for ${location}`); } throw new TypeError("Expected a non-null value"); } return value; }, "expectNonNull"); expectObject = /* @__PURE__ */ __name((value) => { if (value === null || value === void 0) { return void 0; } if (typeof value === "object" && !Array.isArray(value)) { return value; } const receivedType = Array.isArray(value) ? "array" : typeof value; throw new TypeError(`Expected object, got ${receivedType}: ${value}`); }, "expectObject"); expectString = /* @__PURE__ */ __name((value) => { if (value === null || value === void 0) { return void 0; } if (typeof value === "string") { return value; } if (["boolean", "number", "bigint"].includes(typeof value)) { logger2.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); return String(value); } throw new TypeError(`Expected string, got ${typeof value}: ${value}`); }, "expectString"); strictParseFloat32 = /* @__PURE__ */ __name((value) => { if (typeof value == "string") { return expectFloat32(parseNumber2(value)); } return expectFloat32(value); }, "strictParseFloat32"); NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; parseNumber2 = /* @__PURE__ */ __name((value) => { const matches = value.match(NUMBER_REGEX); if (matches === null || matches[0].length !== value.length) { throw new TypeError(`Expected real number, got implicit NaN`); } return parseFloat(value); }, "parseNumber"); strictParseInt32 = /* @__PURE__ */ __name((value) => { if (typeof value === "string") { return expectInt32(parseNumber2(value)); } return expectInt32(value); }, "strictParseInt32"); strictParseShort = /* @__PURE__ */ __name((value) => { if (typeof value === "string") { return expectShort(parseNumber2(value)); } return expectShort(value); }, "strictParseShort"); strictParseByte = /* @__PURE__ */ __name((value) => { if (typeof value === "string") { return expectByte(parseNumber2(value)); } return expectByte(value); }, "strictParseByte"); stackTraceWarning = /* @__PURE__ */ __name((message) => { return String(new TypeError(message).stack || message).split("\n").slice(0, 5).filter((s5) => !s5.includes("stackTraceWarning")).join("\n"); }, "stackTraceWarning"); logger2 = { warn: console.warn }; } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/date-utils.js var MONTHS, RFC3339, parseRfc3339DateTime, RFC3339_WITH_OFFSET, parseRfc3339DateTimeWithOffset, IMF_FIXDATE, RFC_850_DATE, ASC_TIME, buildDate, FIFTY_YEARS_IN_MILLIS, DAYS_IN_MONTH, validateDayOfMonth, isLeapYear, parseDateValue, parseMilliseconds, parseOffsetToMilliseconds, stripLeadingZeroes; var init_date_utils = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/date-utils.js"() { init_import_meta_url(); init_parse_utils(); MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/); parseRfc3339DateTime = /* @__PURE__ */ __name((value) => { if (value === null || value === void 0) { return void 0; } if (typeof value !== "string") { throw new TypeError("RFC-3339 date-times must be expressed as strings"); } const match2 = RFC3339.exec(value); if (!match2) { throw new TypeError("Invalid RFC-3339 date-time value"); } const [_4, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match2; const year2 = strictParseShort(stripLeadingZeroes(yearStr)); const month2 = parseDateValue(monthStr, "month", 1, 12); const day2 = parseDateValue(dayStr, "day", 1, 31); return buildDate(year2, month2, day2, { hours, minutes, seconds, fractionalMilliseconds }); }, "parseRfc3339DateTime"); RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/); parseRfc3339DateTimeWithOffset = /* @__PURE__ */ __name((value) => { if (value === null || value === void 0) { return void 0; } if (typeof value !== "string") { throw new TypeError("RFC-3339 date-times must be expressed as strings"); } const match2 = RFC3339_WITH_OFFSET.exec(value); if (!match2) { throw new TypeError("Invalid RFC-3339 date-time value"); } const [_4, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match2; const year2 = strictParseShort(stripLeadingZeroes(yearStr)); const month2 = parseDateValue(monthStr, "month", 1, 12); const day2 = parseDateValue(dayStr, "day", 1, 31); const date = buildDate(year2, month2, day2, { hours, minutes, seconds, fractionalMilliseconds }); if (offsetStr.toUpperCase() != "Z") { date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr)); } return date; }, "parseRfc3339DateTimeWithOffset"); IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/); ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/); buildDate = /* @__PURE__ */ __name((year2, month2, day2, time) => { const adjustedMonth = month2 - 1; validateDayOfMonth(year2, adjustedMonth, day2); return new Date(Date.UTC(year2, adjustedMonth, day2, parseDateValue(time.hours, "hour", 0, 23), parseDateValue(time.minutes, "minute", 0, 59), parseDateValue(time.seconds, "seconds", 0, 60), parseMilliseconds(time.fractionalMilliseconds))); }, "buildDate"); FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3; DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; validateDayOfMonth = /* @__PURE__ */ __name((year2, month2, day2) => { let maxDays = DAYS_IN_MONTH[month2]; if (month2 === 1 && isLeapYear(year2)) { maxDays = 29; } if (day2 > maxDays) { throw new TypeError(`Invalid day for ${MONTHS[month2]} in ${year2}: ${day2}`); } }, "validateDayOfMonth"); isLeapYear = /* @__PURE__ */ __name((year2) => { return year2 % 4 === 0 && (year2 % 100 !== 0 || year2 % 400 === 0); }, "isLeapYear"); parseDateValue = /* @__PURE__ */ __name((value, type, lower, upper) => { const dateVal = strictParseByte(stripLeadingZeroes(value)); if (dateVal < lower || dateVal > upper) { throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`); } return dateVal; }, "parseDateValue"); parseMilliseconds = /* @__PURE__ */ __name((value) => { if (value === null || value === void 0) { return 0; } return strictParseFloat32("0." + value) * 1e3; }, "parseMilliseconds"); parseOffsetToMilliseconds = /* @__PURE__ */ __name((value) => { const directionStr = value[0]; let direction = 1; if (directionStr == "+") { direction = 1; } else if (directionStr == "-") { direction = -1; } else { throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`); } const hour2 = Number(value.substring(1, 3)); const minute2 = Number(value.substring(4, 6)); return direction * (hour2 * 60 + minute2) * 60 * 1e3; }, "parseOffsetToMilliseconds"); stripLeadingZeroes = /* @__PURE__ */ __name((value) => { let idx = 0; while (idx < value.length - 1 && value.charAt(idx) === "0") { idx++; } if (idx === 0) { return value; } return value.slice(idx); }, "stripLeadingZeroes"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/exceptions.js var ServiceException, decorateServiceException; var init_exceptions = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/exceptions.js"() { init_import_meta_url(); ServiceException = class extends Error { constructor(options32) { super(options32.message); Object.setPrototypeOf(this, ServiceException.prototype); this.name = options32.name; this.$fault = options32.$fault; this.$metadata = options32.$metadata; } static isInstance(value) { if (!value) return false; const candidate = value; return Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server"); } }; __name(ServiceException, "ServiceException"); decorateServiceException = /* @__PURE__ */ __name((exception, additions = {}) => { Object.entries(additions).filter(([, v7]) => v7 !== void 0).forEach(([k6, v7]) => { if (exception[k6] == void 0 || exception[k6] === "") { exception[k6] = v7; } }); const message = exception.message || exception.Message || "UnknownError"; exception.message = message; delete exception.Message; return exception; }, "decorateServiceException"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/default-error-handler.js var throwDefaultError, withBaseException, deserializeMetadata; var init_default_error_handler = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/default-error-handler.js"() { init_import_meta_url(); init_exceptions(); throwDefaultError = /* @__PURE__ */ __name(({ output, parsedBody, exceptionCtor, errorCode }) => { const $metadata = deserializeMetadata(output); const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : void 0; const response = new exceptionCtor({ name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError", $fault: "client", $metadata }); throw decorateServiceException(response, parsedBody); }, "throwDefaultError"); withBaseException = /* @__PURE__ */ __name((ExceptionCtor) => { return ({ output, parsedBody, errorCode }) => { throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); }; }, "withBaseException"); deserializeMetadata = /* @__PURE__ */ __name((output) => ({ httpStatusCode: output.statusCode, requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], extendedRequestId: output.headers["x-amz-id-2"], cfId: output.headers["x-amz-cf-id"] }), "deserializeMetadata"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/defaults-mode.js var loadConfigsForDefaultMode; var init_defaults_mode = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/defaults-mode.js"() { init_import_meta_url(); loadConfigsForDefaultMode = /* @__PURE__ */ __name((mode) => { switch (mode) { case "standard": return { retryMode: "standard", connectionTimeout: 3100 }; case "in-region": return { retryMode: "standard", connectionTimeout: 1100 }; case "cross-region": return { retryMode: "standard", connectionTimeout: 3100 }; case "mobile": return { retryMode: "standard", connectionTimeout: 3e4 }; default: return {}; } }, "loadConfigsForDefaultMode"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js var warningEmitted, emitWarningIfUnsupportedVersion2; var init_emitWarningIfUnsupportedVersion2 = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js"() { init_import_meta_url(); warningEmitted = false; emitWarningIfUnsupportedVersion2 = /* @__PURE__ */ __name((version4) => { if (version4 && !warningEmitted && parseInt(version4.substring(1, version4.indexOf("."))) < 16) { warningEmitted = true; } }, "emitWarningIfUnsupportedVersion"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extended-encode-uri-component.js var init_extended_encode_uri_component2 = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extended-encode-uri-component.js"() { init_import_meta_url(); init_protocols(); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js var getChecksumConfiguration2, resolveChecksumRuntimeConfig2; var init_checksum3 = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js"() { init_import_meta_url(); init_dist_es(); getChecksumConfiguration2 = /* @__PURE__ */ __name((runtimeConfig) => { const checksumAlgorithms = []; for (const id in AlgorithmId) { const algorithmId = AlgorithmId[id]; if (runtimeConfig[algorithmId] === void 0) { continue; } checksumAlgorithms.push({ algorithmId: () => algorithmId, checksumConstructor: () => runtimeConfig[algorithmId] }); } return { _checksumAlgorithms: checksumAlgorithms, addChecksumAlgorithm(algo) { this._checksumAlgorithms.push(algo); }, checksumAlgorithms() { return this._checksumAlgorithms; } }; }, "getChecksumConfiguration"); resolveChecksumRuntimeConfig2 = /* @__PURE__ */ __name((clientConfig) => { const runtimeConfig = {}; clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); }); return runtimeConfig; }, "resolveChecksumRuntimeConfig"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/retry.js var getRetryConfiguration, resolveRetryRuntimeConfig; var init_retry2 = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/retry.js"() { init_import_meta_url(); getRetryConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { let _retryStrategy = runtimeConfig.retryStrategy; return { setRetryStrategy(retryStrategy) { _retryStrategy = retryStrategy; }, retryStrategy() { return _retryStrategy; } }; }, "getRetryConfiguration"); resolveRetryRuntimeConfig = /* @__PURE__ */ __name((retryStrategyConfiguration) => { const runtimeConfig = {}; runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); return runtimeConfig; }, "resolveRetryRuntimeConfig"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js var getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig; var init_defaultExtensionConfiguration2 = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js"() { init_import_meta_url(); init_checksum3(); init_retry2(); getDefaultExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { return { ...getChecksumConfiguration2(runtimeConfig), ...getRetryConfiguration(runtimeConfig) }; }, "getDefaultExtensionConfiguration"); resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => { return { ...resolveChecksumRuntimeConfig2(config), ...resolveRetryRuntimeConfig(config) }; }, "resolveDefaultRuntimeConfig"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/index.js var init_extensions3 = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/extensions/index.js"() { init_import_meta_url(); init_defaultExtensionConfiguration2(); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/get-array-if-single-item.js var init_get_array_if_single_item = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/get-array-if-single-item.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/get-value-from-text-node.js var getValueFromTextNode; var init_get_value_from_text_node = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/get-value-from-text-node.js"() { init_import_meta_url(); getValueFromTextNode = /* @__PURE__ */ __name((obj) => { const textNodeName = "#text"; for (const key in obj) { if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) { obj[key] = obj[key][textNodeName]; } else if (typeof obj[key] === "object" && obj[key] !== null) { obj[key] = getValueFromTextNode(obj[key]); } } return obj; }, "getValueFromTextNode"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/is-serializable-header-value.js var isSerializableHeaderValue; var init_is_serializable_header_value = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/is-serializable-header-value.js"() { init_import_meta_url(); isSerializableHeaderValue = /* @__PURE__ */ __name((value) => { return value != null; }, "isSerializableHeaderValue"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/lazy-json.js var LazyJsonString; var init_lazy_json = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/lazy-json.js"() { init_import_meta_url(); LazyJsonString = /* @__PURE__ */ __name(function LazyJsonString2(val2) { const str = Object.assign(new String(val2), { deserializeJSON() { return JSON.parse(String(val2)); }, toString() { return String(val2); }, toJSON() { return String(val2); } }); return str; }, "LazyJsonString"); LazyJsonString.from = (object) => { if (object && typeof object === "object" && (object instanceof LazyJsonString || "deserializeJSON" in object)) { return object; } else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) { return LazyJsonString(String(object)); } return LazyJsonString(JSON.stringify(object)); }; LazyJsonString.fromObject = LazyJsonString.from; } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js var NoOpLogger; var init_NoOpLogger = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js"() { init_import_meta_url(); NoOpLogger = class { trace() { } debug() { } info() { } warn() { } error() { } }; __name(NoOpLogger, "NoOpLogger"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/object-mapping.js function map(arg0, arg1, arg2) { let target; let filter; let instructions; if (typeof arg1 === "undefined" && typeof arg2 === "undefined") { target = {}; instructions = arg0; } else { target = arg0; if (typeof arg1 === "function") { filter = arg1; instructions = arg2; return mapWithFilter(target, filter, instructions); } else { instructions = arg1; } } for (const key of Object.keys(instructions)) { if (!Array.isArray(instructions[key])) { target[key] = instructions[key]; continue; } applyInstruction(target, null, instructions, key); } return target; } var take, mapWithFilter, applyInstruction, nonNullish, pass; var init_object_mapping = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/object-mapping.js"() { init_import_meta_url(); __name(map, "map"); take = /* @__PURE__ */ __name((source, instructions) => { const out = {}; for (const key in instructions) { applyInstruction(out, source, instructions, key); } return out; }, "take"); mapWithFilter = /* @__PURE__ */ __name((target, filter, instructions) => { return map(target, Object.entries(instructions).reduce((_instructions, [key, value]) => { if (Array.isArray(value)) { _instructions[key] = value; } else { if (typeof value === "function") { _instructions[key] = [filter, value()]; } else { _instructions[key] = [filter, value]; } } return _instructions; }, {})); }, "mapWithFilter"); applyInstruction = /* @__PURE__ */ __name((target, source, instructions, targetKey) => { if (source !== null) { let instruction = instructions[targetKey]; if (typeof instruction === "function") { instruction = [, instruction]; } const [filter2 = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction; if (typeof filter2 === "function" && filter2(source[sourceKey]) || typeof filter2 !== "function" && !!filter2) { target[targetKey] = valueFn(source[sourceKey]); } return; } let [filter, value] = instructions[targetKey]; if (typeof value === "function") { let _value; const defaultFilterPassed = filter === void 0 && (_value = value()) != null; const customFilterPassed = typeof filter === "function" && !!filter(void 0) || typeof filter !== "function" && !!filter; if (defaultFilterPassed) { target[targetKey] = _value; } else if (customFilterPassed) { target[targetKey] = value(); } } else { const defaultFilterPassed = filter === void 0 && value != null; const customFilterPassed = typeof filter === "function" && !!filter(value) || typeof filter !== "function" && !!filter; if (defaultFilterPassed || customFilterPassed) { target[targetKey] = value; } } }, "applyInstruction"); nonNullish = /* @__PURE__ */ __name((_4) => _4 != null, "nonNullish"); pass = /* @__PURE__ */ __name((_4) => _4, "pass"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/quote-header.js var init_quote_header = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/quote-header.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/resolve-path.js var init_resolve_path2 = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/resolve-path.js"() { init_import_meta_url(); init_protocols(); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/ser-utils.js var init_ser_utils = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/ser-utils.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/serde-json.js var _json; var init_serde_json = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/serde-json.js"() { init_import_meta_url(); _json = /* @__PURE__ */ __name((obj) => { if (obj == null) { return {}; } if (Array.isArray(obj)) { return obj.filter((_4) => _4 != null).map(_json); } if (typeof obj === "object") { const target = {}; for (const key of Object.keys(obj)) { if (obj[key] == null) { continue; } target[key] = _json(obj[key]); } return target; } return obj; }, "_json"); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/split-every.js var init_split_every = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/split-every.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/split-header.js var init_split_header = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/split-header.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/index.js var init_dist_es19 = __esm({ "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/index.js"() { init_import_meta_url(); init_client3(); init_collect_stream_body2(); init_command2(); init_constants3(); init_create_aggregated_client(); init_date_utils(); init_default_error_handler(); init_defaults_mode(); init_emitWarningIfUnsupportedVersion2(); init_exceptions(); init_extended_encode_uri_component2(); init_extensions3(); init_get_array_if_single_item(); init_get_value_from_text_node(); init_is_serializable_header_value(); init_lazy_json(); init_NoOpLogger(); init_object_mapping(); init_parse_utils(); init_quote_header(); init_resolve_path2(); init_ser_utils(); init_serde_json(); init_split_every(); init_split_header(); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js var init_awsExpectUnion = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js"() { init_import_meta_url(); init_dist_es19(); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js var collectBodyString; var init_common = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js"() { init_import_meta_url(); init_dist_es19(); collectBodyString = /* @__PURE__ */ __name((streamBody, context2) => collectBody(streamBody, context2).then((body) => context2.utf8Encoder(body)), "collectBodyString"); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js var parseJsonBody, parseJsonErrorBody, loadRestJsonErrorCode; var init_parseJsonBody = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js"() { init_import_meta_url(); init_common(); parseJsonBody = /* @__PURE__ */ __name((streamBody, context2) => collectBodyString(streamBody, context2).then((encoded) => { if (encoded.length) { try { return JSON.parse(encoded); } catch (e7) { if (e7?.name === "SyntaxError") { Object.defineProperty(e7, "$responseBodyText", { value: encoded }); } throw e7; } } return {}; }), "parseJsonBody"); parseJsonErrorBody = /* @__PURE__ */ __name(async (errorBody, context2) => { const value = await parseJsonBody(errorBody, context2); value.message = value.message ?? value.Message; return value; }, "parseJsonErrorBody"); loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => { const findKey2 = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k6) => k6.toLowerCase() === key.toLowerCase()), "findKey"); const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => { let cleanValue = rawValue; if (typeof cleanValue === "number") { cleanValue = cleanValue.toString(); } if (cleanValue.indexOf(",") >= 0) { cleanValue = cleanValue.split(",")[0]; } if (cleanValue.indexOf(":") >= 0) { cleanValue = cleanValue.split(":")[0]; } if (cleanValue.indexOf("#") >= 0) { cleanValue = cleanValue.split("#")[1]; } return cleanValue; }, "sanitizeErrorCode"); const headerKey = findKey2(output.headers, "x-amzn-errortype"); if (headerKey !== void 0) { return sanitizeErrorCode(output.headers[headerKey]); } if (data.code !== void 0) { return sanitizeErrorCode(data.code); } if (data["__type"] !== void 0) { return sanitizeErrorCode(data["__type"]); } }, "loadRestJsonErrorCode"); } }); // ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/util.js var require_util11 = __commonJS({ "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/util.js"(exports2) { "use strict"; init_import_meta_url(); var nameStartChar = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; var regexName = new RegExp("^" + nameRegexp + "$"); var getAllMatches = /* @__PURE__ */ __name(function(string, regex2) { const matches = []; let match2 = regex2.exec(string); while (match2) { const allmatches = []; allmatches.startIndex = regex2.lastIndex - match2[0].length; const len = match2.length; for (let index = 0; index < len; index++) { allmatches.push(match2[index]); } matches.push(allmatches); match2 = regex2.exec(string); } return matches; }, "getAllMatches"); var isName = /* @__PURE__ */ __name(function(string) { const match2 = regexName.exec(string); return !(match2 === null || typeof match2 === "undefined"); }, "isName"); exports2.isExist = function(v7) { return typeof v7 !== "undefined"; }; exports2.isEmptyObject = function(obj) { return Object.keys(obj).length === 0; }; exports2.merge = function(target, a5, arrayMode) { if (a5) { const keys = Object.keys(a5); const len = keys.length; for (let i5 = 0; i5 < len; i5++) { if (arrayMode === "strict") { target[keys[i5]] = [a5[keys[i5]]]; } else { target[keys[i5]] = a5[keys[i5]]; } } } }; exports2.getValue = function(v7) { if (exports2.isExist(v7)) { return v7; } else { return ""; } }; exports2.isName = isName; exports2.getAllMatches = getAllMatches; exports2.nameRegexp = nameRegexp; } }); // ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/validator.js var require_validator = __commonJS({ "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/validator.js"(exports2) { "use strict"; init_import_meta_url(); var util5 = require_util11(); var defaultOptions3 = { allowBooleanAttributes: false, //A tag can have attributes without any value unpairedTags: [] }; exports2.validate = function(xmlData, options32) { options32 = Object.assign({}, defaultOptions3, options32); const tags = []; let tagFound = false; let reachedRoot = false; if (xmlData[0] === "\uFEFF") { xmlData = xmlData.substr(1); } for (let i5 = 0; i5 < xmlData.length; i5++) { if (xmlData[i5] === "<" && xmlData[i5 + 1] === "?") { i5 += 2; i5 = readPI(xmlData, i5); if (i5.err) return i5; } else if (xmlData[i5] === "<") { let tagStartPos = i5; i5++; if (xmlData[i5] === "!") { i5 = readCommentAndCDATA(xmlData, i5); continue; } else { let closingTag = false; if (xmlData[i5] === "/") { closingTag = true; i5++; } let tagName = ""; for (; i5 < xmlData.length && xmlData[i5] !== ">" && xmlData[i5] !== " " && xmlData[i5] !== " " && xmlData[i5] !== "\n" && xmlData[i5] !== "\r"; i5++) { tagName += xmlData[i5]; } tagName = tagName.trim(); if (tagName[tagName.length - 1] === "/") { tagName = tagName.substring(0, tagName.length - 1); i5--; } if (!validateTagName(tagName)) { let msg; if (tagName.trim().length === 0) { msg = "Invalid space after '<'."; } else { msg = "Tag '" + tagName + "' is an invalid name."; } return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i5)); } const result = readAttributeStr(xmlData, i5); if (result === false) { return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i5)); } let attrStr = result.value; i5 = result.index; if (attrStr[attrStr.length - 1] === "/") { const attrStrStart = i5 - attrStr.length; attrStr = attrStr.substring(0, attrStr.length - 1); const isValid2 = validateAttributeString(attrStr, options32); if (isValid2 === true) { tagFound = true; } else { return getErrorObject(isValid2.err.code, isValid2.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid2.err.line)); } } else if (closingTag) { if (!result.tagClosed) { return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i5)); } else if (attrStr.trim().length > 0) { return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); } else if (tags.length === 0) { return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); } else { const otg = tags.pop(); if (tagName !== otg.tagName) { let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); return getErrorObject( "InvalidTag", "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", getLineNumberForPosition(xmlData, tagStartPos) ); } if (tags.length == 0) { reachedRoot = true; } } } else { const isValid2 = validateAttributeString(attrStr, options32); if (isValid2 !== true) { return getErrorObject(isValid2.err.code, isValid2.err.msg, getLineNumberForPosition(xmlData, i5 - attrStr.length + isValid2.err.line)); } if (reachedRoot === true) { return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i5)); } else if (options32.unpairedTags.indexOf(tagName) !== -1) { } else { tags.push({ tagName, tagStartPos }); } tagFound = true; } for (i5++; i5 < xmlData.length; i5++) { if (xmlData[i5] === "<") { if (xmlData[i5 + 1] === "!") { i5++; i5 = readCommentAndCDATA(xmlData, i5); continue; } else if (xmlData[i5 + 1] === "?") { i5 = readPI(xmlData, ++i5); if (i5.err) return i5; } else { break; } } else if (xmlData[i5] === "&") { const afterAmp = validateAmpersand(xmlData, i5); if (afterAmp == -1) return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i5)); i5 = afterAmp; } else { if (reachedRoot === true && !isWhiteSpace2(xmlData[i5])) { return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i5)); } } } if (xmlData[i5] === "<") { i5--; } } } else { if (isWhiteSpace2(xmlData[i5])) { continue; } return getErrorObject("InvalidChar", "char '" + xmlData[i5] + "' is not expected.", getLineNumberForPosition(xmlData, i5)); } } if (!tagFound) { return getErrorObject("InvalidXml", "Start tag expected.", 1); } else if (tags.length == 1) { return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); } else if (tags.length > 0) { return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t7) => t7.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); } return true; }; function isWhiteSpace2(char) { return char === " " || char === " " || char === "\n" || char === "\r"; } __name(isWhiteSpace2, "isWhiteSpace"); function readPI(xmlData, i5) { const start = i5; for (; i5 < xmlData.length; i5++) { if (xmlData[i5] == "?" || xmlData[i5] == " ") { const tagname = xmlData.substr(start, i5 - start); if (i5 > 5 && tagname === "xml") { return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i5)); } else if (xmlData[i5] == "?" && xmlData[i5 + 1] == ">") { i5++; break; } else { continue; } } } return i5; } __name(readPI, "readPI"); function readCommentAndCDATA(xmlData, i5) { if (xmlData.length > i5 + 5 && xmlData[i5 + 1] === "-" && xmlData[i5 + 2] === "-") { for (i5 += 3; i5 < xmlData.length; i5++) { if (xmlData[i5] === "-" && xmlData[i5 + 1] === "-" && xmlData[i5 + 2] === ">") { i5 += 2; break; } } } else if (xmlData.length > i5 + 8 && xmlData[i5 + 1] === "D" && xmlData[i5 + 2] === "O" && xmlData[i5 + 3] === "C" && xmlData[i5 + 4] === "T" && xmlData[i5 + 5] === "Y" && xmlData[i5 + 6] === "P" && xmlData[i5 + 7] === "E") { let angleBracketsCount = 1; for (i5 += 8; i5 < xmlData.length; i5++) { if (xmlData[i5] === "<") { angleBracketsCount++; } else if (xmlData[i5] === ">") { angleBracketsCount--; if (angleBracketsCount === 0) { break; } } } } else if (xmlData.length > i5 + 9 && xmlData[i5 + 1] === "[" && xmlData[i5 + 2] === "C" && xmlData[i5 + 3] === "D" && xmlData[i5 + 4] === "A" && xmlData[i5 + 5] === "T" && xmlData[i5 + 6] === "A" && xmlData[i5 + 7] === "[") { for (i5 += 8; i5 < xmlData.length; i5++) { if (xmlData[i5] === "]" && xmlData[i5 + 1] === "]" && xmlData[i5 + 2] === ">") { i5 += 2; break; } } } return i5; } __name(readCommentAndCDATA, "readCommentAndCDATA"); var doubleQuote = '"'; var singleQuote = "'"; function readAttributeStr(xmlData, i5) { let attrStr = ""; let startChar = ""; let tagClosed = false; for (; i5 < xmlData.length; i5++) { if (xmlData[i5] === doubleQuote || xmlData[i5] === singleQuote) { if (startChar === "") { startChar = xmlData[i5]; } else if (startChar !== xmlData[i5]) { } else { startChar = ""; } } else if (xmlData[i5] === ">") { if (startChar === "") { tagClosed = true; break; } } attrStr += xmlData[i5]; } if (startChar !== "") { return false; } return { value: attrStr, index: i5, tagClosed }; } __name(readAttributeStr, "readAttributeStr"); var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function validateAttributeString(attrStr, options32) { const matches = util5.getAllMatches(attrStr, validAttrStrRegxp); const attrNames = {}; for (let i5 = 0; i5 < matches.length; i5++) { if (matches[i5][1].length === 0) { return getErrorObject("InvalidAttr", "Attribute '" + matches[i5][2] + "' has no space in starting.", getPositionFromMatch(matches[i5])); } else if (matches[i5][3] !== void 0 && matches[i5][4] === void 0) { return getErrorObject("InvalidAttr", "Attribute '" + matches[i5][2] + "' is without value.", getPositionFromMatch(matches[i5])); } else if (matches[i5][3] === void 0 && !options32.allowBooleanAttributes) { return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i5][2] + "' is not allowed.", getPositionFromMatch(matches[i5])); } const attrName = matches[i5][2]; if (!validateAttrName(attrName)) { return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i5])); } if (!attrNames.hasOwnProperty(attrName)) { attrNames[attrName] = 1; } else { return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i5])); } } return true; } __name(validateAttributeString, "validateAttributeString"); function validateNumberAmpersand(xmlData, i5) { let re = /\d/; if (xmlData[i5] === "x") { i5++; re = /[\da-fA-F]/; } for (; i5 < xmlData.length; i5++) { if (xmlData[i5] === ";") return i5; if (!xmlData[i5].match(re)) break; } return -1; } __name(validateNumberAmpersand, "validateNumberAmpersand"); function validateAmpersand(xmlData, i5) { i5++; if (xmlData[i5] === ";") return -1; if (xmlData[i5] === "#") { i5++; return validateNumberAmpersand(xmlData, i5); } let count = 0; for (; i5 < xmlData.length; i5++, count++) { if (xmlData[i5].match(/\w/) && count < 20) continue; if (xmlData[i5] === ";") break; return -1; } return i5; } __name(validateAmpersand, "validateAmpersand"); function getErrorObject(code, message, lineNumber) { return { err: { code, msg: message, line: lineNumber.line || lineNumber, col: lineNumber.col } }; } __name(getErrorObject, "getErrorObject"); function validateAttrName(attrName) { return util5.isName(attrName); } __name(validateAttrName, "validateAttrName"); function validateTagName(tagname) { return util5.isName(tagname); } __name(validateTagName, "validateTagName"); function getLineNumberForPosition(xmlData, index) { const lines = xmlData.substring(0, index).split(/\r?\n/); return { line: lines.length, // column number is last line's length + 1, because column numbering starts at 1: col: lines[lines.length - 1].length + 1 }; } __name(getLineNumberForPosition, "getLineNumberForPosition"); function getPositionFromMatch(match2) { return match2.startIndex + match2[1].length; } __name(getPositionFromMatch, "getPositionFromMatch"); } }); // ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js var require_OptionsBuilder = __commonJS({ "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { init_import_meta_url(); var defaultOptions3 = { preserveOrder: false, attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, removeNSPrefix: false, // remove NS from tag name or attribute name if true allowBooleanAttributes: false, //a tag can have attributes without any value //ignoreRootElement : false, parseTagValue: true, parseAttributeValue: false, trimValues: true, //Trim string values of tag and attributes cdataPropName: false, numberParseOptions: { hex: true, leadingZeros: true, eNotation: true }, tagValueProcessor: function(tagName, val2) { return val2; }, attributeValueProcessor: function(attrName, val2) { return val2; }, stopNodes: [], //nested tags will not be parsed even for errors alwaysCreateTextNode: false, isArray: () => false, commentPropName: false, unpairedTags: [], processEntities: true, htmlEntities: false, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(tagName, jPath, attrs) { return tagName; } // skipEmptyListItem: false }; var buildOptions2 = /* @__PURE__ */ __name(function(options32) { return Object.assign({}, defaultOptions3, options32); }, "buildOptions"); exports2.buildOptions = buildOptions2; exports2.defaultOptions = defaultOptions3; } }); // ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js var require_xmlNode = __commonJS({ "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module3) { "use strict"; init_import_meta_url(); var XmlNode2 = class { constructor(tagname) { this.tagname = tagname; this.child = []; this[":@"] = {}; } add(key, val2) { if (key === "__proto__") key = "#__proto__"; this.child.push({ [key]: val2 }); } addChild(node2) { if (node2.tagname === "__proto__") node2.tagname = "#__proto__"; if (node2[":@"] && Object.keys(node2[":@"]).length > 0) { this.child.push({ [node2.tagname]: node2.child, [":@"]: node2[":@"] }); } else { this.child.push({ [node2.tagname]: node2.child }); } } }; __name(XmlNode2, "XmlNode"); module3.exports = XmlNode2; } }); // ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js var require_DocTypeReader = __commonJS({ "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module3) { init_import_meta_url(); var util5 = require_util11(); function readDocType(xmlData, i5) { const entities = {}; if (xmlData[i5 + 3] === "O" && xmlData[i5 + 4] === "C" && xmlData[i5 + 5] === "T" && xmlData[i5 + 6] === "Y" && xmlData[i5 + 7] === "P" && xmlData[i5 + 8] === "E") { i5 = i5 + 9; let angleBracketsCount = 1; let hasBody = false, comment = false; let exp = ""; for (; i5 < xmlData.length; i5++) { if (xmlData[i5] === "<" && !comment) { if (hasBody && isEntity(xmlData, i5)) { i5 += 7; [entityName, val, i5] = readEntityExp(xmlData, i5 + 1); if (val.indexOf("&") === -1) entities[validateEntityName(entityName)] = { regx: RegExp(`&${entityName};`, "g"), val }; } else if (hasBody && isElement2(xmlData, i5)) i5 += 8; else if (hasBody && isAttlist(xmlData, i5)) i5 += 8; else if (hasBody && isNotation(xmlData, i5)) i5 += 9; else if (isComment) comment = true; else throw new Error("Invalid DOCTYPE"); angleBracketsCount++; exp = ""; } else if (xmlData[i5] === ">") { if (comment) { if (xmlData[i5 - 1] === "-" && xmlData[i5 - 2] === "-") { comment = false; angleBracketsCount--; } } else { angleBracketsCount--; } if (angleBracketsCount === 0) { break; } } else if (xmlData[i5] === "[") { hasBody = true; } else { exp += xmlData[i5]; } } if (angleBracketsCount !== 0) { throw new Error(`Unclosed DOCTYPE`); } } else { throw new Error(`Invalid Tag instead of DOCTYPE`); } return { entities, i: i5 }; } __name(readDocType, "readDocType"); function readEntityExp(xmlData, i5) { let entityName2 = ""; for (; i5 < xmlData.length && (xmlData[i5] !== "'" && xmlData[i5] !== '"'); i5++) { entityName2 += xmlData[i5]; } entityName2 = entityName2.trim(); if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); const startChar = xmlData[i5++]; let val2 = ""; for (; i5 < xmlData.length && xmlData[i5] !== startChar; i5++) { val2 += xmlData[i5]; } return [entityName2, val2, i5]; } __name(readEntityExp, "readEntityExp"); function isComment(xmlData, i5) { if (xmlData[i5 + 1] === "!" && xmlData[i5 + 2] === "-" && xmlData[i5 + 3] === "-") return true; return false; } __name(isComment, "isComment"); function isEntity(xmlData, i5) { if (xmlData[i5 + 1] === "!" && xmlData[i5 + 2] === "E" && xmlData[i5 + 3] === "N" && xmlData[i5 + 4] === "T" && xmlData[i5 + 5] === "I" && xmlData[i5 + 6] === "T" && xmlData[i5 + 7] === "Y") return true; return false; } __name(isEntity, "isEntity"); function isElement2(xmlData, i5) { if (xmlData[i5 + 1] === "!" && xmlData[i5 + 2] === "E" && xmlData[i5 + 3] === "L" && xmlData[i5 + 4] === "E" && xmlData[i5 + 5] === "M" && xmlData[i5 + 6] === "E" && xmlData[i5 + 7] === "N" && xmlData[i5 + 8] === "T") return true; return false; } __name(isElement2, "isElement"); function isAttlist(xmlData, i5) { if (xmlData[i5 + 1] === "!" && xmlData[i5 + 2] === "A" && xmlData[i5 + 3] === "T" && xmlData[i5 + 4] === "T" && xmlData[i5 + 5] === "L" && xmlData[i5 + 6] === "I" && xmlData[i5 + 7] === "S" && xmlData[i5 + 8] === "T") return true; return false; } __name(isAttlist, "isAttlist"); function isNotation(xmlData, i5) { if (xmlData[i5 + 1] === "!" && xmlData[i5 + 2] === "N" && xmlData[i5 + 3] === "O" && xmlData[i5 + 4] === "T" && xmlData[i5 + 5] === "A" && xmlData[i5 + 6] === "T" && xmlData[i5 + 7] === "I" && xmlData[i5 + 8] === "O" && xmlData[i5 + 9] === "N") return true; return false; } __name(isNotation, "isNotation"); function validateEntityName(name2) { if (util5.isName(name2)) return name2; else throw new Error(`Invalid entity name ${name2}`); } __name(validateEntityName, "validateEntityName"); module3.exports = readDocType; } }); // ../../node_modules/.pnpm/strnum@1.0.5/node_modules/strnum/strnum.js var require_strnum = __commonJS({ "../../node_modules/.pnpm/strnum@1.0.5/node_modules/strnum/strnum.js"(exports2, module3) { init_import_meta_url(); var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; if (!Number.parseInt && window.parseInt) { Number.parseInt = window.parseInt; } if (!Number.parseFloat && window.parseFloat) { Number.parseFloat = window.parseFloat; } var consider = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true //skipLike: /regex/ }; function toNumber(str, options32 = {}) { options32 = Object.assign({}, consider, options32); if (!str || typeof str !== "string") return str; let trimmedStr = str.trim(); if (options32.skipLike !== void 0 && options32.skipLike.test(trimmedStr)) return str; else if (options32.hex && hexRegex.test(trimmedStr)) { return Number.parseInt(trimmedStr, 16); } else { const match2 = numRegex.exec(trimmedStr); if (match2) { const sign = match2[1]; const leadingZeros = match2[2]; let numTrimmedByZeros = trimZeros(match2[3]); const eNotation = match2[4] || match2[6]; if (!options32.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str; else if (!options32.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str; else { const num = Number(trimmedStr); const numStr = "" + num; if (numStr.search(/[eE]/) !== -1) { if (options32.eNotation) return num; else return str; } else if (eNotation) { if (options32.eNotation) return num; else return str; } else if (trimmedStr.indexOf(".") !== -1) { if (numStr === "0" && numTrimmedByZeros === "") return num; else if (numStr === numTrimmedByZeros) return num; else if (sign && numStr === "-" + numTrimmedByZeros) return num; else return str; } if (leadingZeros) { if (numTrimmedByZeros === numStr) return num; else if (sign + numTrimmedByZeros === numStr) return num; else return str; } if (trimmedStr === numStr) return num; else if (trimmedStr === sign + numStr) return num; return str; } } else { return str; } } } __name(toNumber, "toNumber"); function trimZeros(numStr) { if (numStr && numStr.indexOf(".") !== -1) { numStr = numStr.replace(/0+$/, ""); if (numStr === ".") numStr = "0"; else if (numStr[0] === ".") numStr = "0" + numStr; else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); return numStr; } return numStr; } __name(trimZeros, "trimZeros"); module3.exports = toNumber; } }); // ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js var require_OrderedObjParser = __commonJS({ "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module3) { "use strict"; init_import_meta_url(); var util5 = require_util11(); var xmlNode = require_xmlNode(); var readDocType = require_DocTypeReader(); var toNumber = require_strnum(); var OrderedObjParser = class { constructor(options32) { this.options = options32; this.currentNode = null; this.tagsNodeStack = []; this.docTypeEntities = {}; this.lastEntities = { "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } }; this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; this.htmlEntities = { "space": { regex: /&(nbsp|#160);/g, val: " " }, // "lt" : { regex: /&(lt|#60);/g, val: "<" }, // "gt" : { regex: /&(gt|#62);/g, val: ">" }, // "amp" : { regex: /&(amp|#38);/g, val: "&" }, // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, // "apos" : { regex: /&(apos|#39);/g, val: "'" }, "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_4, str) => String.fromCharCode(Number.parseInt(str, 10)) }, "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_4, str) => String.fromCharCode(Number.parseInt(str, 16)) } }; this.addExternalEntities = addExternalEntities; this.parseXml = parseXml; this.parseTextData = parseTextData; this.resolveNameSpace = resolveNameSpace; this.buildAttributesMap = buildAttributesMap; this.isItStopNode = isItStopNode; this.replaceEntitiesValue = replaceEntitiesValue; this.readStopNodeData = readStopNodeData; this.saveTextToParentTag = saveTextToParentTag; this.addChild = addChild; } }; __name(OrderedObjParser, "OrderedObjParser"); function addExternalEntities(externalEntities) { const entKeys = Object.keys(externalEntities); for (let i5 = 0; i5 < entKeys.length; i5++) { const ent = entKeys[i5]; this.lastEntities[ent] = { regex: new RegExp("&" + ent + ";", "g"), val: externalEntities[ent] }; } } __name(addExternalEntities, "addExternalEntities"); function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { if (val2 !== void 0) { if (this.options.trimValues && !dontTrim) { val2 = val2.trim(); } if (val2.length > 0) { if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); if (newval === null || newval === void 0) { return val2; } else if (typeof newval !== typeof val2 || newval !== val2) { return newval; } else if (this.options.trimValues) { return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); } else { const trimmedVal = val2.trim(); if (trimmedVal === val2) { return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); } else { return val2; } } } } } __name(parseTextData, "parseTextData"); function resolveNameSpace(tagname) { if (this.options.removeNSPrefix) { const tags = tagname.split(":"); const prefix = tagname.charAt(0) === "/" ? "/" : ""; if (tags[0] === "xmlns") { return ""; } if (tags.length === 2) { tagname = prefix + tags[1]; } } return tagname; } __name(resolveNameSpace, "resolveNameSpace"); var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function buildAttributesMap(attrStr, jPath, tagName) { if (!this.options.ignoreAttributes && typeof attrStr === "string") { const matches = util5.getAllMatches(attrStr, attrsRegx); const len = matches.length; const attrs = {}; for (let i5 = 0; i5 < len; i5++) { const attrName = this.resolveNameSpace(matches[i5][1]); let oldVal = matches[i5][4]; let aName = this.options.attributeNamePrefix + attrName; if (attrName.length) { if (this.options.transformAttributeName) { aName = this.options.transformAttributeName(aName); } if (aName === "__proto__") aName = "#__proto__"; if (oldVal !== void 0) { if (this.options.trimValues) { oldVal = oldVal.trim(); } oldVal = this.replaceEntitiesValue(oldVal); const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); if (newVal === null || newVal === void 0) { attrs[aName] = oldVal; } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { attrs[aName] = newVal; } else { attrs[aName] = parseValue( oldVal, this.options.parseAttributeValue, this.options.numberParseOptions ); } } else if (this.options.allowBooleanAttributes) { attrs[aName] = true; } } } if (!Object.keys(attrs).length) { return; } if (this.options.attributesGroupName) { const attrCollection = {}; attrCollection[this.options.attributesGroupName] = attrs; return attrCollection; } return attrs; } } __name(buildAttributesMap, "buildAttributesMap"); var parseXml = /* @__PURE__ */ __name(function(xmlData) { xmlData = xmlData.replace(/\r\n?/g, "\n"); const xmlObj = new xmlNode("!xml"); let currentNode = xmlObj; let textData = ""; let jPath = ""; for (let i5 = 0; i5 < xmlData.length; i5++) { const ch2 = xmlData[i5]; if (ch2 === "<") { if (xmlData[i5 + 1] === "/") { const closeIndex = findClosingIndex(xmlData, ">", i5, "Closing Tag is not closed."); let tagName = xmlData.substring(i5 + 2, closeIndex).trim(); if (this.options.removeNSPrefix) { const colonIndex = tagName.indexOf(":"); if (colonIndex !== -1) { tagName = tagName.substr(colonIndex + 1); } } if (this.options.transformTagName) { tagName = this.options.transformTagName(tagName); } if (currentNode) { textData = this.saveTextToParentTag(textData, currentNode, jPath); } const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { throw new Error(`Unpaired tag can not be used as closing tag: `); } let propIndex = 0; if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); this.tagsNodeStack.pop(); } else { propIndex = jPath.lastIndexOf("."); } jPath = jPath.substring(0, propIndex); currentNode = this.tagsNodeStack.pop(); textData = ""; i5 = closeIndex; } else if (xmlData[i5 + 1] === "?") { let tagData = readTagExp(xmlData, i5, false, "?>"); if (!tagData) throw new Error("Pi Tag is not closed."); textData = this.saveTextToParentTag(textData, currentNode, jPath); if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { } else { const childNode = new xmlNode(tagData.tagName); childNode.add(this.options.textNodeName, ""); if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); } this.addChild(currentNode, childNode, jPath); } i5 = tagData.closeIndex + 1; } else if (xmlData.substr(i5 + 1, 3) === "!--") { const endIndex = findClosingIndex(xmlData, "-->", i5 + 4, "Comment is not closed."); if (this.options.commentPropName) { const comment = xmlData.substring(i5 + 4, endIndex - 2); textData = this.saveTextToParentTag(textData, currentNode, jPath); currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); } i5 = endIndex; } else if (xmlData.substr(i5 + 1, 2) === "!D") { const result = readDocType(xmlData, i5); this.docTypeEntities = result.entities; i5 = result.i; } else if (xmlData.substr(i5 + 1, 2) === "![") { const closeIndex = findClosingIndex(xmlData, "]]>", i5, "CDATA is not closed.") - 2; const tagExp = xmlData.substring(i5 + 9, closeIndex); textData = this.saveTextToParentTag(textData, currentNode, jPath); let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); if (val2 == void 0) val2 = ""; if (this.options.cdataPropName) { currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); } else { currentNode.add(this.options.textNodeName, val2); } i5 = closeIndex + 2; } else { let result = readTagExp(xmlData, i5, this.options.removeNSPrefix); let tagName = result.tagName; const rawTagName = result.rawTagName; let tagExp = result.tagExp; let attrExpPresent = result.attrExpPresent; let closeIndex = result.closeIndex; if (this.options.transformTagName) { tagName = this.options.transformTagName(tagName); } if (currentNode && textData) { if (currentNode.tagname !== "!xml") { textData = this.saveTextToParentTag(textData, currentNode, jPath, false); } } const lastTag = currentNode; if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { currentNode = this.tagsNodeStack.pop(); jPath = jPath.substring(0, jPath.lastIndexOf(".")); } if (tagName !== xmlObj.tagname) { jPath += jPath ? "." + tagName : tagName; } if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { let tagContent = ""; if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { if (tagName[tagName.length - 1] === "/") { tagName = tagName.substr(0, tagName.length - 1); jPath = jPath.substr(0, jPath.length - 1); tagExp = tagName; } else { tagExp = tagExp.substr(0, tagExp.length - 1); } i5 = result.closeIndex; } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { i5 = result.closeIndex; } else { const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); i5 = result2.i; tagContent = result2.tagContent; } const childNode = new xmlNode(tagName); if (tagName !== tagExp && attrExpPresent) { childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); } if (tagContent) { tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); } jPath = jPath.substr(0, jPath.lastIndexOf(".")); childNode.add(this.options.textNodeName, tagContent); this.addChild(currentNode, childNode, jPath); } else { if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { if (tagName[tagName.length - 1] === "/") { tagName = tagName.substr(0, tagName.length - 1); jPath = jPath.substr(0, jPath.length - 1); tagExp = tagName; } else { tagExp = tagExp.substr(0, tagExp.length - 1); } if (this.options.transformTagName) { tagName = this.options.transformTagName(tagName); } const childNode = new xmlNode(tagName); if (tagName !== tagExp && attrExpPresent) { childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); } this.addChild(currentNode, childNode, jPath); jPath = jPath.substr(0, jPath.lastIndexOf(".")); } else { const childNode = new xmlNode(tagName); this.tagsNodeStack.push(currentNode); if (tagName !== tagExp && attrExpPresent) { childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); } this.addChild(currentNode, childNode, jPath); currentNode = childNode; } textData = ""; i5 = closeIndex; } } } else { textData += xmlData[i5]; } } return xmlObj.child; }, "parseXml"); function addChild(currentNode, childNode, jPath) { const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); if (result === false) { } else if (typeof result === "string") { childNode.tagname = result; currentNode.addChild(childNode); } else { currentNode.addChild(childNode); } } __name(addChild, "addChild"); var replaceEntitiesValue = /* @__PURE__ */ __name(function(val2) { if (this.options.processEntities) { for (let entityName2 in this.docTypeEntities) { const entity = this.docTypeEntities[entityName2]; val2 = val2.replace(entity.regx, entity.val); } for (let entityName2 in this.lastEntities) { const entity = this.lastEntities[entityName2]; val2 = val2.replace(entity.regex, entity.val); } if (this.options.htmlEntities) { for (let entityName2 in this.htmlEntities) { const entity = this.htmlEntities[entityName2]; val2 = val2.replace(entity.regex, entity.val); } } val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); } return val2; }, "replaceEntitiesValue"); function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { if (textData) { if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; textData = this.parseTextData( textData, currentNode.tagname, jPath, false, currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, isLeafNode ); if (textData !== void 0 && textData !== "") currentNode.add(this.options.textNodeName, textData); textData = ""; } return textData; } __name(saveTextToParentTag, "saveTextToParentTag"); function isItStopNode(stopNodes, jPath, currentTagName) { const allNodesExp = "*." + currentTagName; for (const stopNodePath in stopNodes) { const stopNodeExp = stopNodes[stopNodePath]; if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; } return false; } __name(isItStopNode, "isItStopNode"); function tagExpWithClosingIndex(xmlData, i5, closingChar = ">") { let attrBoundary; let tagExp = ""; for (let index = i5; index < xmlData.length; index++) { let ch2 = xmlData[index]; if (attrBoundary) { if (ch2 === attrBoundary) attrBoundary = ""; } else if (ch2 === '"' || ch2 === "'") { attrBoundary = ch2; } else if (ch2 === closingChar[0]) { if (closingChar[1]) { if (xmlData[index + 1] === closingChar[1]) { return { data: tagExp, index }; } } else { return { data: tagExp, index }; } } else if (ch2 === " ") { ch2 = " "; } tagExp += ch2; } } __name(tagExpWithClosingIndex, "tagExpWithClosingIndex"); function findClosingIndex(xmlData, str, i5, errMsg) { const closingIndex = xmlData.indexOf(str, i5); if (closingIndex === -1) { throw new Error(errMsg); } else { return closingIndex + str.length - 1; } } __name(findClosingIndex, "findClosingIndex"); function readTagExp(xmlData, i5, removeNSPrefix, closingChar = ">") { const result = tagExpWithClosingIndex(xmlData, i5 + 1, closingChar); if (!result) return; let tagExp = result.data; const closeIndex = result.index; const separatorIndex = tagExp.search(/\s/); let tagName = tagExp; let attrExpPresent = true; if (separatorIndex !== -1) { tagName = tagExp.substring(0, separatorIndex); tagExp = tagExp.substring(separatorIndex + 1).trimStart(); } const rawTagName = tagName; if (removeNSPrefix) { const colonIndex = tagName.indexOf(":"); if (colonIndex !== -1) { tagName = tagName.substr(colonIndex + 1); attrExpPresent = tagName !== result.data.substr(colonIndex + 1); } } return { tagName, tagExp, closeIndex, attrExpPresent, rawTagName }; } __name(readTagExp, "readTagExp"); function readStopNodeData(xmlData, tagName, i5) { const startIndex = i5; let openTagCount = 1; for (; i5 < xmlData.length; i5++) { if (xmlData[i5] === "<") { if (xmlData[i5 + 1] === "/") { const closeIndex = findClosingIndex(xmlData, ">", i5, `${tagName} is not closed`); let closeTagName = xmlData.substring(i5 + 2, closeIndex).trim(); if (closeTagName === tagName) { openTagCount--; if (openTagCount === 0) { return { tagContent: xmlData.substring(startIndex, i5), i: closeIndex }; } } i5 = closeIndex; } else if (xmlData[i5 + 1] === "?") { const closeIndex = findClosingIndex(xmlData, "?>", i5 + 1, "StopNode is not closed."); i5 = closeIndex; } else if (xmlData.substr(i5 + 1, 3) === "!--") { const closeIndex = findClosingIndex(xmlData, "-->", i5 + 3, "StopNode is not closed."); i5 = closeIndex; } else if (xmlData.substr(i5 + 1, 2) === "![") { const closeIndex = findClosingIndex(xmlData, "]]>", i5, "StopNode is not closed.") - 2; i5 = closeIndex; } else { const tagData = readTagExp(xmlData, i5, ">"); if (tagData) { const openTagName = tagData && tagData.tagName; if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { openTagCount++; } i5 = tagData.closeIndex; } } } } } __name(readStopNodeData, "readStopNodeData"); function parseValue(val2, shouldParse, options32) { if (shouldParse && typeof val2 === "string") { const newval = val2.trim(); if (newval === "true") return true; else if (newval === "false") return false; else return toNumber(val2, options32); } else { if (util5.isExist(val2)) { return val2; } else { return ""; } } } __name(parseValue, "parseValue"); module3.exports = OrderedObjParser; } }); // ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/node2json.js var require_node2json = __commonJS({ "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { "use strict"; init_import_meta_url(); function prettify(node2, options32) { return compress(node2, options32); } __name(prettify, "prettify"); function compress(arr, options32, jPath) { let text; const compressedObj = {}; for (let i5 = 0; i5 < arr.length; i5++) { const tagObj = arr[i5]; const property = propName(tagObj); let newJpath = ""; if (jPath === void 0) newJpath = property; else newJpath = jPath + "." + property; if (property === options32.textNodeName) { if (text === void 0) text = tagObj[property]; else text += "" + tagObj[property]; } else if (property === void 0) { continue; } else if (tagObj[property]) { let val2 = compress(tagObj[property], options32, newJpath); const isLeaf = isLeafTag(val2, options32); if (tagObj[":@"]) { assignAttributes(val2, tagObj[":@"], newJpath, options32); } else if (Object.keys(val2).length === 1 && val2[options32.textNodeName] !== void 0 && !options32.alwaysCreateTextNode) { val2 = val2[options32.textNodeName]; } else if (Object.keys(val2).length === 0) { if (options32.alwaysCreateTextNode) val2[options32.textNodeName] = ""; else val2 = ""; } if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { if (!Array.isArray(compressedObj[property])) { compressedObj[property] = [compressedObj[property]]; } compressedObj[property].push(val2); } else { if (options32.isArray(property, newJpath, isLeaf)) { compressedObj[property] = [val2]; } else { compressedObj[property] = val2; } } } } if (typeof text === "string") { if (text.length > 0) compressedObj[options32.textNodeName] = text; } else if (text !== void 0) compressedObj[options32.textNodeName] = text; return compressedObj; } __name(compress, "compress"); function propName(obj) { const keys = Object.keys(obj); for (let i5 = 0; i5 < keys.length; i5++) { const key = keys[i5]; if (key !== ":@") return key; } } __name(propName, "propName"); function assignAttributes(obj, attrMap, jpath, options32) { if (attrMap) { const keys = Object.keys(attrMap); const len = keys.length; for (let i5 = 0; i5 < len; i5++) { const atrrName = keys[i5]; if (options32.isArray(atrrName, jpath + "." + atrrName, true, true)) { obj[atrrName] = [attrMap[atrrName]]; } else { obj[atrrName] = attrMap[atrrName]; } } } } __name(assignAttributes, "assignAttributes"); function isLeafTag(obj, options32) { const { textNodeName } = options32; const propCount = Object.keys(obj).length; if (propCount === 0) { return true; } if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { return true; } return false; } __name(isLeafTag, "isLeafTag"); exports2.prettify = prettify; } }); // ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js var require_XMLParser = __commonJS({ "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module3) { init_import_meta_url(); var { buildOptions: buildOptions2 } = require_OptionsBuilder(); var OrderedObjParser = require_OrderedObjParser(); var { prettify } = require_node2json(); var validator = require_validator(); var XMLParser2 = class { constructor(options32) { this.externalEntities = {}; this.options = buildOptions2(options32); } /** * Parse XML dats to JS object * @param {string|Buffer} xmlData * @param {boolean|Object} validationOption */ parse(xmlData, validationOption) { if (typeof xmlData === "string") { } else if (xmlData.toString) { xmlData = xmlData.toString(); } else { throw new Error("XML data is accepted in String or Bytes[] form."); } if (validationOption) { if (validationOption === true) validationOption = {}; const result = validator.validate(xmlData, validationOption); if (result !== true) { throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); } } const orderedObjParser = new OrderedObjParser(this.options); orderedObjParser.addExternalEntities(this.externalEntities); const orderedResult = orderedObjParser.parseXml(xmlData); if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; else return prettify(orderedResult, this.options); } /** * Add Entity which is not by default supported by this library * @param {string} key * @param {string} value */ addEntity(key, value) { if (value.indexOf("&") !== -1) { throw new Error("Entity value can't have '&'"); } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); } else if (value === "&") { throw new Error("An entity with value '&' is not permitted"); } else { this.externalEntities[key] = value; } } }; __name(XMLParser2, "XMLParser"); module3.exports = XMLParser2; } }); // ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js var require_orderedJs2Xml = __commonJS({ "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module3) { init_import_meta_url(); var EOL = "\n"; function toXml(jArray, options32) { let indentation = ""; if (options32.format && options32.indentBy.length > 0) { indentation = EOL; } return arrToStr(jArray, options32, "", indentation); } __name(toXml, "toXml"); function arrToStr(arr, options32, jPath, indentation) { let xmlStr = ""; let isPreviousElementTag = false; for (let i5 = 0; i5 < arr.length; i5++) { const tagObj = arr[i5]; const tagName = propName(tagObj); if (tagName === void 0) continue; let newJPath = ""; if (jPath.length === 0) newJPath = tagName; else newJPath = `${jPath}.${tagName}`; if (tagName === options32.textNodeName) { let tagText = tagObj[tagName]; if (!isStopNode(newJPath, options32)) { tagText = options32.tagValueProcessor(tagName, tagText); tagText = replaceEntitiesValue(tagText, options32); } if (isPreviousElementTag) { xmlStr += indentation; } xmlStr += tagText; isPreviousElementTag = false; continue; } else if (tagName === options32.cdataPropName) { if (isPreviousElementTag) { xmlStr += indentation; } xmlStr += ``; isPreviousElementTag = false; continue; } else if (tagName === options32.commentPropName) { xmlStr += indentation + ``; isPreviousElementTag = true; continue; } else if (tagName[0] === "?") { const attStr2 = attr_to_str(tagObj[":@"], options32); const tempInd = tagName === "?xml" ? "" : indentation; let piTextNodeName = tagObj[tagName][0][options32.textNodeName]; piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; isPreviousElementTag = true; continue; } let newIdentation = indentation; if (newIdentation !== "") { newIdentation += options32.indentBy; } const attStr = attr_to_str(tagObj[":@"], options32); const tagStart = indentation + `<${tagName}${attStr}`; const tagValue = arrToStr(tagObj[tagName], options32, newJPath, newIdentation); if (options32.unpairedTags.indexOf(tagName) !== -1) { if (options32.suppressUnpairedNode) xmlStr += tagStart + ">"; else xmlStr += tagStart + "/>"; } else if ((!tagValue || tagValue.length === 0) && options32.suppressEmptyNode) { xmlStr += tagStart + "/>"; } else if (tagValue && tagValue.endsWith(">")) { xmlStr += tagStart + `>${tagValue}${indentation}`; } else { xmlStr += tagStart + ">"; if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; } isPreviousElementTag = true; } return xmlStr; } __name(arrToStr, "arrToStr"); function propName(obj) { const keys = Object.keys(obj); for (let i5 = 0; i5 < keys.length; i5++) { const key = keys[i5]; if (!obj.hasOwnProperty(key)) continue; if (key !== ":@") return key; } } __name(propName, "propName"); function attr_to_str(attrMap, options32) { let attrStr = ""; if (attrMap && !options32.ignoreAttributes) { for (let attr in attrMap) { if (!attrMap.hasOwnProperty(attr)) continue; let attrVal = options32.attributeValueProcessor(attr, attrMap[attr]); attrVal = replaceEntitiesValue(attrVal, options32); if (attrVal === true && options32.suppressBooleanAttributes) { attrStr += ` ${attr.substr(options32.attributeNamePrefix.length)}`; } else { attrStr += ` ${attr.substr(options32.attributeNamePrefix.length)}="${attrVal}"`; } } } return attrStr; } __name(attr_to_str, "attr_to_str"); function isStopNode(jPath, options32) { jPath = jPath.substr(0, jPath.length - options32.textNodeName.length - 1); let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); for (let index in options32.stopNodes) { if (options32.stopNodes[index] === jPath || options32.stopNodes[index] === "*." + tagName) return true; } return false; } __name(isStopNode, "isStopNode"); function replaceEntitiesValue(textValue, options32) { if (textValue && textValue.length > 0 && options32.processEntities) { for (let i5 = 0; i5 < options32.entities.length; i5++) { const entity = options32.entities[i5]; textValue = textValue.replace(entity.regex, entity.val); } } return textValue; } __name(replaceEntitiesValue, "replaceEntitiesValue"); module3.exports = toXml; } }); // ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js var require_json2xml = __commonJS({ "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module3) { "use strict"; init_import_meta_url(); var buildFromOrderedJs = require_orderedJs2Xml(); var defaultOptions3 = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(key, a5) { return a5; }, attributeValueProcessor: function(attrName, a5) { return a5; }, preserveOrder: false, commentPropName: false, unpairedTags: [], entities: [ { regex: new RegExp("&", "g"), val: "&" }, //it must be on top { regex: new RegExp(">", "g"), val: ">" }, { regex: new RegExp("<", "g"), val: "<" }, { regex: new RegExp("'", "g"), val: "'" }, { regex: new RegExp('"', "g"), val: """ } ], processEntities: true, stopNodes: [], // transformTagName: false, // transformAttributeName: false, oneListGroup: false }; function Builder(options32) { this.options = Object.assign({}, defaultOptions3, options32); if (this.options.ignoreAttributes || this.options.attributesGroupName) { this.isAttribute = function() { return false; }; } else { this.attrPrefixLen = this.options.attributeNamePrefix.length; this.isAttribute = isAttribute; } this.processTextOrObjNode = processTextOrObjNode; if (this.options.format) { this.indentate = indentate; this.tagEndChar = ">\n"; this.newLine = "\n"; } else { this.indentate = function() { return ""; }; this.tagEndChar = ">"; this.newLine = ""; } } __name(Builder, "Builder"); Builder.prototype.build = function(jObj) { if (this.options.preserveOrder) { return buildFromOrderedJs(jObj, this.options); } else { if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { jObj = { [this.options.arrayNodeName]: jObj }; } return this.j2x(jObj, 0).val; } }; Builder.prototype.j2x = function(jObj, level) { let attrStr = ""; let val2 = ""; for (let key in jObj) { if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; if (typeof jObj[key] === "undefined") { if (this.isAttribute(key)) { val2 += ""; } } else if (jObj[key] === null) { if (this.isAttribute(key)) { val2 += ""; } else if (key[0] === "?") { val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; } else { val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; } } else if (jObj[key] instanceof Date) { val2 += this.buildTextValNode(jObj[key], key, "", level); } else if (typeof jObj[key] !== "object") { const attr = this.isAttribute(key); if (attr) { attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); } else { if (key === this.options.textNodeName) { let newval = this.options.tagValueProcessor(key, "" + jObj[key]); val2 += this.replaceEntitiesValue(newval); } else { val2 += this.buildTextValNode(jObj[key], key, "", level); } } } else if (Array.isArray(jObj[key])) { const arrLen = jObj[key].length; let listTagVal = ""; let listTagAttr = ""; for (let j6 = 0; j6 < arrLen; j6++) { const item = jObj[key][j6]; if (typeof item === "undefined") { } else if (item === null) { if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; } else if (typeof item === "object") { if (this.options.oneListGroup) { const result = this.j2x(item, level + 1); listTagVal += result.val; if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { listTagAttr += result.attrStr; } } else { listTagVal += this.processTextOrObjNode(item, key, level); } } else { if (this.options.oneListGroup) { let textValue = this.options.tagValueProcessor(key, item); textValue = this.replaceEntitiesValue(textValue); listTagVal += textValue; } else { listTagVal += this.buildTextValNode(item, key, "", level); } } } if (this.options.oneListGroup) { listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); } val2 += listTagVal; } else { if (this.options.attributesGroupName && key === this.options.attributesGroupName) { const Ks = Object.keys(jObj[key]); const L3 = Ks.length; for (let j6 = 0; j6 < L3; j6++) { attrStr += this.buildAttrPairStr(Ks[j6], "" + jObj[key][Ks[j6]]); } } else { val2 += this.processTextOrObjNode(jObj[key], key, level); } } } return { attrStr, val: val2 }; }; Builder.prototype.buildAttrPairStr = function(attrName, val2) { val2 = this.options.attributeValueProcessor(attrName, "" + val2); val2 = this.replaceEntitiesValue(val2); if (this.options.suppressBooleanAttributes && val2 === "true") { return " " + attrName; } else return " " + attrName + '="' + val2 + '"'; }; function processTextOrObjNode(object, key, level) { const result = this.j2x(object, level + 1); if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); } else { return this.buildObjectNode(result.val, key, result.attrStr, level); } } __name(processTextOrObjNode, "processTextOrObjNode"); Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { if (val2 === "") { if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; else { return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; } } else { let tagEndExp = "" + val2 + tagEndExp; } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { return this.indentate(level) + `` + this.newLine; } else { return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; } } }; Builder.prototype.closeTag = function(key) { let closeTag = ""; if (this.options.unpairedTags.indexOf(key) !== -1) { if (!this.options.suppressUnpairedNode) closeTag = "/"; } else if (this.options.suppressEmptyNode) { closeTag = "/"; } else { closeTag = `>` + this.newLine; } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { return this.indentate(level) + `` + this.newLine; } else if (key[0] === "?") { return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; } else { let textValue = this.options.tagValueProcessor(key, val2); textValue = this.replaceEntitiesValue(textValue); if (textValue === "") { return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; } else { return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { for (let i5 = 0; i5 < this.options.entities.length; i5++) { const entity = this.options.entities[i5]; textValue = textValue.replace(entity.regex, entity.val); } } return textValue; }; function indentate(level) { return this.options.indentBy.repeat(level); } __name(indentate, "indentate"); function isAttribute(name2) { if (name2.startsWith(this.options.attributeNamePrefix) && name2 !== this.options.textNodeName) { return name2.substr(this.attrPrefixLen); } else { return false; } } __name(isAttribute, "isAttribute"); module3.exports = Builder; } }); // ../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/fxp.js var require_fxp = __commonJS({ "../../node_modules/.pnpm/fast-xml-parser@4.4.1/node_modules/fast-xml-parser/src/fxp.js"(exports2, module3) { "use strict"; init_import_meta_url(); var validator = require_validator(); var XMLParser2 = require_XMLParser(); var XMLBuilder = require_json2xml(); module3.exports = { XMLParser: XMLParser2, XMLValidator: validator, XMLBuilder }; } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js var import_fast_xml_parser, parseXmlBody, parseXmlErrorBody, loadRestXmlErrorCode; var init_parseXmlBody = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js"() { init_import_meta_url(); init_dist_es19(); import_fast_xml_parser = __toESM(require_fxp()); init_common(); parseXmlBody = /* @__PURE__ */ __name((streamBody, context2) => collectBodyString(streamBody, context2).then((encoded) => { if (encoded.length) { const parser2 = new import_fast_xml_parser.XMLParser({ attributeNamePrefix: "", htmlEntities: true, ignoreAttributes: false, ignoreDeclaration: true, parseTagValue: false, trimValues: false, tagValueProcessor: (_4, val2) => val2.trim() === "" && val2.includes("\n") ? "" : void 0 }); parser2.addEntity("#xD", "\r"); parser2.addEntity("#10", "\n"); let parsedObj; try { parsedObj = parser2.parse(encoded, true); } catch (e7) { if (e7 && typeof e7 === "object") { Object.defineProperty(e7, "$responseBodyText", { value: encoded }); } throw e7; } const textNodeName = "#text"; const key = Object.keys(parsedObj)[0]; const parsedObjToReturn = parsedObj[key]; if (parsedObjToReturn[textNodeName]) { parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; delete parsedObjToReturn[textNodeName]; } return getValueFromTextNode(parsedObjToReturn); } return {}; }), "parseXmlBody"); parseXmlErrorBody = /* @__PURE__ */ __name(async (errorBody, context2) => { const value = await parseXmlBody(errorBody, context2); if (value.Error) { value.Error.message = value.Error.message ?? value.Error.Message; } return value; }, "parseXmlErrorBody"); loadRestXmlErrorCode = /* @__PURE__ */ __name((output, data) => { if (data?.Error?.Code !== void 0) { return data.Error.Code; } if (data?.Code !== void 0) { return data.Code; } if (output.statusCode == 404) { return "NotFound"; } }, "loadRestXmlErrorCode"); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js var init_protocols2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js"() { init_import_meta_url(); init_coercing_serializers(); init_awsExpectUnion(); init_parseJsonBody(); init_parseXmlBody(); } }); // ../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/index.js var init_dist_es20 = __esm({ "../../node_modules/.pnpm/@aws-sdk+core@3.716.0/node_modules/@aws-sdk/core/dist-es/index.js"() { init_import_meta_url(); init_client2(); init_httpAuthSchemes2(); init_protocols2(); } }); // ../../node_modules/.pnpm/@aws-sdk+middleware-host-header@3.714.0/node_modules/@aws-sdk/middleware-host-header/dist-es/index.js function resolveHostHeaderConfig(input) { return input; } var hostHeaderMiddleware, hostHeaderMiddlewareOptions, getHostHeaderPlugin; var init_dist_es21 = __esm({ "../../node_modules/.pnpm/@aws-sdk+middleware-host-header@3.714.0/node_modules/@aws-sdk/middleware-host-header/dist-es/index.js"() { init_import_meta_url(); init_dist_es2(); __name(resolveHostHeaderConfig, "resolveHostHeaderConfig"); hostHeaderMiddleware = /* @__PURE__ */ __name((options32) => (next) => async (args) => { if (!HttpRequest.isInstance(args.request)) return next(args); const { request: request4 } = args; const { handlerProtocol = "" } = options32.requestHandler.metadata || {}; if (handlerProtocol.indexOf("h2") >= 0 && !request4.headers[":authority"]) { delete request4.headers["host"]; request4.headers[":authority"] = request4.hostname + (request4.port ? ":" + request4.port : ""); } else if (!request4.headers["host"]) { let host = request4.hostname; if (request4.port != null) host += `:${request4.port}`; request4.headers["host"] = host; } return next(args); }, "hostHeaderMiddleware"); hostHeaderMiddlewareOptions = { name: "hostHeaderMiddleware", step: "build", priority: "low", tags: ["HOST"], override: true }; getHostHeaderPlugin = /* @__PURE__ */ __name((options32) => ({ applyToStack: (clientStack) => { clientStack.add(hostHeaderMiddleware(options32), hostHeaderMiddlewareOptions); } }), "getHostHeaderPlugin"); } }); // ../../node_modules/.pnpm/@aws-sdk+middleware-logger@3.714.0/node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js var loggerMiddleware, loggerMiddlewareOptions, getLoggerPlugin; var init_loggerMiddleware = __esm({ "../../node_modules/.pnpm/@aws-sdk+middleware-logger@3.714.0/node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js"() { init_import_meta_url(); loggerMiddleware = /* @__PURE__ */ __name(() => (next, context2) => async (args) => { try { const response = await next(args); const { clientName, commandName, logger: logger4, dynamoDbDocumentClientOptions = {} } = context2; const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context2.inputFilterSensitiveLog; const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context2.outputFilterSensitiveLog; const { $metadata, ...outputWithoutMetadata } = response.output; logger4?.info?.({ clientName, commandName, input: inputFilterSensitiveLog(args.input), output: outputFilterSensitiveLog(outputWithoutMetadata), metadata: $metadata }); return response; } catch (error2) { const { clientName, commandName, logger: logger4, dynamoDbDocumentClientOptions = {} } = context2; const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions; const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context2.inputFilterSensitiveLog; logger4?.error?.({ clientName, commandName, input: inputFilterSensitiveLog(args.input), error: error2, metadata: error2.$metadata }); throw error2; } }, "loggerMiddleware"); loggerMiddlewareOptions = { name: "loggerMiddleware", tags: ["LOGGER"], step: "initialize", override: true }; getLoggerPlugin = /* @__PURE__ */ __name((options32) => ({ applyToStack: (clientStack) => { clientStack.add(loggerMiddleware(), loggerMiddlewareOptions); } }), "getLoggerPlugin"); } }); // ../../node_modules/.pnpm/@aws-sdk+middleware-logger@3.714.0/node_modules/@aws-sdk/middleware-logger/dist-es/index.js var init_dist_es22 = __esm({ "../../node_modules/.pnpm/@aws-sdk+middleware-logger@3.714.0/node_modules/@aws-sdk/middleware-logger/dist-es/index.js"() { init_import_meta_url(); init_loggerMiddleware(); } }); // ../../node_modules/.pnpm/@aws-sdk+middleware-recursion-detection@3.714.0/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js var TRACE_ID_HEADER_NAME, ENV_LAMBDA_FUNCTION_NAME, ENV_TRACE_ID, recursionDetectionMiddleware, addRecursionDetectionMiddlewareOptions, getRecursionDetectionPlugin; var init_dist_es23 = __esm({ "../../node_modules/.pnpm/@aws-sdk+middleware-recursion-detection@3.714.0/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js"() { init_import_meta_url(); init_dist_es2(); TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; recursionDetectionMiddleware = /* @__PURE__ */ __name((options32) => (next) => async (args) => { const { request: request4 } = args; if (!HttpRequest.isInstance(request4) || options32.runtime !== "node" || request4.headers.hasOwnProperty(TRACE_ID_HEADER_NAME)) { return next(args); } const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; const traceId = process.env[ENV_TRACE_ID]; const nonEmptyString = /* @__PURE__ */ __name((str) => typeof str === "string" && str.length > 0, "nonEmptyString"); if (nonEmptyString(functionName) && nonEmptyString(traceId)) { request4.headers[TRACE_ID_HEADER_NAME] = traceId; } return next({ ...args, request: request4 }); }, "recursionDetectionMiddleware"); addRecursionDetectionMiddlewareOptions = { step: "build", tags: ["RECURSION_DETECTION"], name: "recursionDetectionMiddleware", override: true, priority: "low" }; getRecursionDetectionPlugin = /* @__PURE__ */ __name((options32) => ({ applyToStack: (clientStack) => { clientStack.add(recursionDetectionMiddleware(options32), addRecursionDetectionMiddlewareOptions); } }), "getRecursionDetectionPlugin"); } }); // ../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/booleanSelector.js var booleanSelector; var init_booleanSelector = __esm({ "../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/booleanSelector.js"() { init_import_meta_url(); booleanSelector = /* @__PURE__ */ __name((obj, key, type) => { if (!(key in obj)) return void 0; if (obj[key] === "true") return true; if (obj[key] === "false") return false; throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`); }, "booleanSelector"); } }); // ../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/numberSelector.js var init_numberSelector = __esm({ "../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/numberSelector.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/types.js var SelectorType2; var init_types2 = __esm({ "../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/types.js"() { init_import_meta_url(); (function(SelectorType3) { SelectorType3["ENV"] = "env"; SelectorType3["CONFIG"] = "shared config entry"; })(SelectorType2 || (SelectorType2 = {})); } }); // ../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/index.js var init_dist_es24 = __esm({ "../../node_modules/.pnpm/@smithy+util-config-provider@3.0.0/node_modules/@smithy/util-config-provider/dist-es/index.js"() { init_import_meta_url(); init_booleanSelector(); init_numberSelector(); init_types2(); } }); // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js function isValidUserAgentAppId(appId) { if (appId === void 0) { return true; } return typeof appId === "string" && appId.length <= 50; } function resolveUserAgentConfig(input) { const normalizedAppIdProvider = normalizeProvider2(input.userAgentAppId ?? DEFAULT_UA_APP_ID); return { ...input, customUserAgent: typeof input.customUserAgent === "string" ? [[input.customUserAgent]] : input.customUserAgent, userAgentAppId: async () => { const appId = await normalizedAppIdProvider(); if (!isValidUserAgentAppId(appId)) { const logger4 = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger; if (typeof appId !== "string") { logger4?.warn("userAgentAppId must be a string or undefined."); } else if (appId.length > 50) { logger4?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."); } } return appId; } }; } var DEFAULT_UA_APP_ID; var init_configurations = __esm({ "../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js"() { init_import_meta_url(); init_dist_es15(); DEFAULT_UA_APP_ID = void 0; __name(isValidUserAgentAppId, "isValidUserAgentAppId"); __name(resolveUserAgentConfig, "resolveUserAgentConfig"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js var EndpointCache; var init_EndpointCache = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js"() { init_import_meta_url(); EndpointCache = class { constructor({ size, params }) { this.data = /* @__PURE__ */ new Map(); this.parameters = []; this.capacity = size ?? 50; if (params) { this.parameters = params; } } get(endpointParams, resolver) { const key = this.hash(endpointParams); if (key === false) { return resolver(); } if (!this.data.has(key)) { if (this.data.size > this.capacity + 10) { const keys = this.data.keys(); let i5 = 0; while (true) { const { value, done } = keys.next(); this.data.delete(value); if (done || ++i5 > 10) { break; } } } this.data.set(key, resolver()); } return this.data.get(key); } size() { return this.data.size; } hash(endpointParams) { let buffer = ""; const { parameters } = this; if (parameters.length === 0) { return false; } for (const param of parameters) { const val2 = String(endpointParams[param] ?? ""); if (val2.includes("|;")) { return false; } buffer += val2 + "|;"; } return buffer; } }; __name(EndpointCache, "EndpointCache"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js var IP_V4_REGEX, isIpAddress; var init_isIpAddress = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js"() { init_import_meta_url(); IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`); isIpAddress = /* @__PURE__ */ __name((value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"), "isIpAddress"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js var VALID_HOST_LABEL_REGEX, isValidHostLabel; var init_isValidHostLabel = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js"() { init_import_meta_url(); VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); isValidHostLabel = /* @__PURE__ */ __name((value, allowSubDomains = false) => { if (!allowSubDomains) { return VALID_HOST_LABEL_REGEX.test(value); } const labels = value.split("."); for (const label of labels) { if (!isValidHostLabel(label)) { return false; } } return true; }, "isValidHostLabel"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js var customEndpointFunctions; var init_customEndpointFunctions = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js"() { init_import_meta_url(); customEndpointFunctions = {}; } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js var debugId; var init_debugId = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js"() { init_import_meta_url(); debugId = "endpoints"; } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js function toDebugString(input) { if (typeof input !== "object" || input == null) { return input; } if ("ref" in input) { return `$${toDebugString(input.ref)}`; } if ("fn" in input) { return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`; } return JSON.stringify(input, null, 2); } var init_toDebugString = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js"() { init_import_meta_url(); __name(toDebugString, "toDebugString"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/debug/index.js var init_debug = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/debug/index.js"() { init_import_meta_url(); init_debugId(); init_toDebugString(); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js var EndpointError; var init_EndpointError = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js"() { init_import_meta_url(); EndpointError = class extends Error { constructor(message) { super(message); this.name = "EndpointError"; } }; __name(EndpointError, "EndpointError"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/EndpointFunctions.js var init_EndpointFunctions = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/EndpointFunctions.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/EndpointRuleObject.js var init_EndpointRuleObject2 = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/EndpointRuleObject.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/ErrorRuleObject.js var init_ErrorRuleObject2 = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/ErrorRuleObject.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/RuleSetObject.js var init_RuleSetObject2 = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/RuleSetObject.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/TreeRuleObject.js var init_TreeRuleObject2 = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/TreeRuleObject.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/shared.js var init_shared2 = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/shared.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/index.js var init_types3 = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/types/index.js"() { init_import_meta_url(); init_EndpointError(); init_EndpointFunctions(); init_EndpointRuleObject2(); init_ErrorRuleObject2(); init_RuleSetObject2(); init_TreeRuleObject2(); init_shared2(); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js var booleanEquals; var init_booleanEquals = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js"() { init_import_meta_url(); booleanEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "booleanEquals"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js var getAttrPathList; var init_getAttrPathList = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js"() { init_import_meta_url(); init_types3(); getAttrPathList = /* @__PURE__ */ __name((path72) => { const parts = path72.split("."); const pathList = []; for (const part of parts) { const squareBracketIndex = part.indexOf("["); if (squareBracketIndex !== -1) { if (part.indexOf("]") !== part.length - 1) { throw new EndpointError(`Path: '${path72}' does not end with ']'`); } const arrayIndex = part.slice(squareBracketIndex + 1, -1); if (Number.isNaN(parseInt(arrayIndex))) { throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path72}'`); } if (squareBracketIndex !== 0) { pathList.push(part.slice(0, squareBracketIndex)); } pathList.push(arrayIndex); } else { pathList.push(part); } } return pathList; }, "getAttrPathList"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js var getAttr; var init_getAttr = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js"() { init_import_meta_url(); init_types3(); init_getAttrPathList(); getAttr = /* @__PURE__ */ __name((value, path72) => getAttrPathList(path72).reduce((acc, index) => { if (typeof acc !== "object") { throw new EndpointError(`Index '${index}' in '${path72}' not found in '${JSON.stringify(value)}'`); } else if (Array.isArray(acc)) { return acc[parseInt(index)]; } return acc[index]; }, value), "getAttr"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js var isSet; var init_isSet = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js"() { init_import_meta_url(); isSet = /* @__PURE__ */ __name((value) => value != null, "isSet"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/not.js var not; var init_not = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/not.js"() { init_import_meta_url(); not = /* @__PURE__ */ __name((value) => !value, "not"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js var DEFAULT_PORTS, parseURL; var init_parseURL = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js"() { init_import_meta_url(); init_dist_es(); init_isIpAddress(); DEFAULT_PORTS = { [EndpointURLScheme.HTTP]: 80, [EndpointURLScheme.HTTPS]: 443 }; parseURL = /* @__PURE__ */ __name((value) => { const whatwgURL = (() => { try { if (value instanceof URL) { return value; } if (typeof value === "object" && "hostname" in value) { const { hostname: hostname3, port, protocol: protocol2 = "", path: path72 = "", query = {} } = value; const url4 = new URL(`${protocol2}//${hostname3}${port ? `:${port}` : ""}${path72}`); url4.search = Object.entries(query).map(([k6, v7]) => `${k6}=${v7}`).join("&"); return url4; } return new URL(value); } catch (error2) { return null; } })(); if (!whatwgURL) { console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`); return null; } const urlString = whatwgURL.href; const { host, hostname: hostname2, pathname, protocol, search } = whatwgURL; if (search) { return null; } const scheme = protocol.slice(0, -1); if (!Object.values(EndpointURLScheme).includes(scheme)) { return null; } const isIp = isIpAddress(hostname2); const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`); const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`; return { scheme, authority, path: pathname, normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, isIp }; }, "parseURL"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js var stringEquals; var init_stringEquals = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js"() { init_import_meta_url(); stringEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "stringEquals"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/substring.js var substring; var init_substring = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/substring.js"() { init_import_meta_url(); substring = /* @__PURE__ */ __name((input, start, stop, reverse) => { if (start >= stop || input.length < stop) { return null; } if (!reverse) { return input.substring(start, stop); } return input.substring(input.length - stop, input.length - start); }, "substring"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js var uriEncode; var init_uriEncode = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js"() { init_import_meta_url(); uriEncode = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/[!*'()]/g, (c6) => `%${c6.charCodeAt(0).toString(16).toUpperCase()}`), "uriEncode"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/index.js var init_lib = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/lib/index.js"() { init_import_meta_url(); init_booleanEquals(); init_getAttr(); init_isSet(); init_isValidHostLabel(); init_not(); init_parseURL(); init_stringEquals(); init_substring(); init_uriEncode(); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js var endpointFunctions; var init_endpointFunctions = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js"() { init_import_meta_url(); init_lib(); endpointFunctions = { booleanEquals, getAttr, isSet, isValidHostLabel, not, parseURL, stringEquals, substring, uriEncode }; } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js var evaluateTemplate; var init_evaluateTemplate = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js"() { init_import_meta_url(); init_lib(); evaluateTemplate = /* @__PURE__ */ __name((template, options32) => { const evaluatedTemplateArr = []; const templateContext = { ...options32.endpointParams, ...options32.referenceRecord }; let currentIndex = 0; while (currentIndex < template.length) { const openingBraceIndex = template.indexOf("{", currentIndex); if (openingBraceIndex === -1) { evaluatedTemplateArr.push(template.slice(currentIndex)); break; } evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex)); const closingBraceIndex = template.indexOf("}", openingBraceIndex); if (closingBraceIndex === -1) { evaluatedTemplateArr.push(template.slice(openingBraceIndex)); break; } if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") { evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex)); currentIndex = closingBraceIndex + 2; } const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex); if (parameterName.includes("#")) { const [refName, attrName] = parameterName.split("#"); evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName)); } else { evaluatedTemplateArr.push(templateContext[parameterName]); } currentIndex = closingBraceIndex + 1; } return evaluatedTemplateArr.join(""); }, "evaluateTemplate"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js var getReferenceValue; var init_getReferenceValue = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js"() { init_import_meta_url(); getReferenceValue = /* @__PURE__ */ __name(({ ref }, options32) => { const referenceRecord = { ...options32.endpointParams, ...options32.referenceRecord }; return referenceRecord[ref]; }, "getReferenceValue"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js var evaluateExpression; var init_evaluateExpression = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js"() { init_import_meta_url(); init_types3(); init_callFunction(); init_evaluateTemplate(); init_getReferenceValue(); evaluateExpression = /* @__PURE__ */ __name((obj, keyName, options32) => { if (typeof obj === "string") { return evaluateTemplate(obj, options32); } else if (obj["fn"]) { return callFunction(obj, options32); } else if (obj["ref"]) { return getReferenceValue(obj, options32); } throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); }, "evaluateExpression"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/callFunction.js var callFunction; var init_callFunction = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/callFunction.js"() { init_import_meta_url(); init_customEndpointFunctions(); init_endpointFunctions(); init_evaluateExpression(); callFunction = /* @__PURE__ */ __name(({ fn: fn2, argv }, options32) => { const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : evaluateExpression(arg, "arg", options32)); const fnSegments = fn2.split("."); if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) { return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs); } return endpointFunctions[fn2](...evaluatedArgs); }, "callFunction"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js var evaluateCondition; var init_evaluateCondition = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js"() { init_import_meta_url(); init_debug(); init_types3(); init_callFunction(); evaluateCondition = /* @__PURE__ */ __name(({ assign, ...fnArgs }, options32) => { if (assign && assign in options32.referenceRecord) { throw new EndpointError(`'${assign}' is already defined in Reference Record.`); } const value = callFunction(fnArgs, options32); options32.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`); return { result: value === "" ? true : !!value, ...assign != null && { toAssign: { name: assign, value } } }; }, "evaluateCondition"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js var evaluateConditions; var init_evaluateConditions = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js"() { init_import_meta_url(); init_debug(); init_evaluateCondition(); evaluateConditions = /* @__PURE__ */ __name((conditions = [], options32) => { const conditionsReferenceRecord = {}; for (const condition of conditions) { const { result, toAssign } = evaluateCondition(condition, { ...options32, referenceRecord: { ...options32.referenceRecord, ...conditionsReferenceRecord } }); if (!result) { return { result }; } if (toAssign) { conditionsReferenceRecord[toAssign.name] = toAssign.value; options32.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); } } return { result: true, referenceRecord: conditionsReferenceRecord }; }, "evaluateConditions"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js var getEndpointHeaders; var init_getEndpointHeaders = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js"() { init_import_meta_url(); init_types3(); init_evaluateExpression(); getEndpointHeaders = /* @__PURE__ */ __name((headers, options32) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({ ...acc, [headerKey]: headerVal.map((headerValEntry) => { const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options32); if (typeof processedExpr !== "string") { throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`); } return processedExpr; }) }), {}), "getEndpointHeaders"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperty.js var getEndpointProperty; var init_getEndpointProperty = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperty.js"() { init_import_meta_url(); init_types3(); init_evaluateTemplate(); init_getEndpointProperties(); getEndpointProperty = /* @__PURE__ */ __name((property, options32) => { if (Array.isArray(property)) { return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options32)); } switch (typeof property) { case "string": return evaluateTemplate(property, options32); case "object": if (property === null) { throw new EndpointError(`Unexpected endpoint property: ${property}`); } return getEndpointProperties(property, options32); case "boolean": return property; default: throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`); } }, "getEndpointProperty"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js var getEndpointProperties; var init_getEndpointProperties = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js"() { init_import_meta_url(); init_getEndpointProperty(); getEndpointProperties = /* @__PURE__ */ __name((properties, options32) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({ ...acc, [propertyKey]: getEndpointProperty(propertyVal, options32) }), {}), "getEndpointProperties"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js var getEndpointUrl; var init_getEndpointUrl = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js"() { init_import_meta_url(); init_types3(); init_evaluateExpression(); getEndpointUrl = /* @__PURE__ */ __name((endpointUrl, options32) => { const expression = evaluateExpression(endpointUrl, "Endpoint URL", options32); if (typeof expression === "string") { try { return new URL(expression); } catch (error2) { console.error(`Failed to construct URL with ${expression}`, error2); throw error2; } } throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); }, "getEndpointUrl"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js var evaluateEndpointRule; var init_evaluateEndpointRule = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js"() { init_import_meta_url(); init_debug(); init_evaluateConditions(); init_getEndpointHeaders(); init_getEndpointProperties(); init_getEndpointUrl(); evaluateEndpointRule = /* @__PURE__ */ __name((endpointRule, options32) => { const { conditions, endpoint } = endpointRule; const { result, referenceRecord } = evaluateConditions(conditions, options32); if (!result) { return; } const endpointRuleOptions = { ...options32, referenceRecord: { ...options32.referenceRecord, ...referenceRecord } }; const { url: url4, properties, headers } = endpoint; options32.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`); return { ...headers != void 0 && { headers: getEndpointHeaders(headers, endpointRuleOptions) }, ...properties != void 0 && { properties: getEndpointProperties(properties, endpointRuleOptions) }, url: getEndpointUrl(url4, endpointRuleOptions) }; }, "evaluateEndpointRule"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js var evaluateErrorRule; var init_evaluateErrorRule = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js"() { init_import_meta_url(); init_types3(); init_evaluateConditions(); init_evaluateExpression(); evaluateErrorRule = /* @__PURE__ */ __name((errorRule, options32) => { const { conditions, error: error2 } = errorRule; const { result, referenceRecord } = evaluateConditions(conditions, options32); if (!result) { return; } throw new EndpointError(evaluateExpression(error2, "Error", { ...options32, referenceRecord: { ...options32.referenceRecord, ...referenceRecord } })); }, "evaluateErrorRule"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTreeRule.js var evaluateTreeRule; var init_evaluateTreeRule = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTreeRule.js"() { init_import_meta_url(); init_evaluateConditions(); init_evaluateRules(); evaluateTreeRule = /* @__PURE__ */ __name((treeRule, options32) => { const { conditions, rules } = treeRule; const { result, referenceRecord } = evaluateConditions(conditions, options32); if (!result) { return; } return evaluateRules(rules, { ...options32, referenceRecord: { ...options32.referenceRecord, ...referenceRecord } }); }, "evaluateTreeRule"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js var evaluateRules; var init_evaluateRules = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js"() { init_import_meta_url(); init_types3(); init_evaluateEndpointRule(); init_evaluateErrorRule(); init_evaluateTreeRule(); evaluateRules = /* @__PURE__ */ __name((rules, options32) => { for (const rule of rules) { if (rule.type === "endpoint") { const endpointOrUndefined = evaluateEndpointRule(rule, options32); if (endpointOrUndefined) { return endpointOrUndefined; } } else if (rule.type === "error") { evaluateErrorRule(rule, options32); } else if (rule.type === "tree") { const endpointOrUndefined = evaluateTreeRule(rule, options32); if (endpointOrUndefined) { return endpointOrUndefined; } } else { throw new EndpointError(`Unknown endpoint rule: ${rule}`); } } throw new EndpointError(`Rules evaluation failed`); }, "evaluateRules"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/index.js var init_utils2 = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/utils/index.js"() { init_import_meta_url(); init_customEndpointFunctions(); init_evaluateRules(); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js var resolveEndpoint; var init_resolveEndpoint = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js"() { init_import_meta_url(); init_debug(); init_types3(); init_utils2(); resolveEndpoint = /* @__PURE__ */ __name((ruleSetObject, options32) => { const { endpointParams, logger: logger4 } = options32; const { parameters, rules } = ruleSetObject; options32.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`); const paramsWithDefault = Object.entries(parameters).filter(([, v7]) => v7.default != null).map(([k6, v7]) => [k6, v7.default]); if (paramsWithDefault.length > 0) { for (const [paramKey, paramDefaultValue] of paramsWithDefault) { endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue; } } const requiredParams = Object.entries(parameters).filter(([, v7]) => v7.required).map(([k6]) => k6); for (const requiredParam of requiredParams) { if (endpointParams[requiredParam] == null) { throw new EndpointError(`Missing required parameter: '${requiredParam}'`); } } const endpoint = evaluateRules(rules, { endpointParams, logger: logger4, referenceRecord: {} }); options32.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`); return endpoint; }, "resolveEndpoint"); } }); // ../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/index.js var init_dist_es25 = __esm({ "../../node_modules/.pnpm/@smithy+util-endpoints@2.1.7/node_modules/@smithy/util-endpoints/dist-es/index.js"() { init_import_meta_url(); init_EndpointCache(); init_isIpAddress(); init_isValidHostLabel(); init_customEndpointFunctions(); init_resolveEndpoint(); init_types3(); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js var init_isIpAddress2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js"() { init_import_meta_url(); init_dist_es25(); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js var isVirtualHostableS3Bucket; var init_isVirtualHostableS3Bucket = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js"() { init_import_meta_url(); init_dist_es25(); init_isIpAddress2(); isVirtualHostableS3Bucket = /* @__PURE__ */ __name((value, allowSubDomains = false) => { if (allowSubDomains) { for (const label of value.split(".")) { if (!isVirtualHostableS3Bucket(label)) { return false; } } return true; } if (!isValidHostLabel(value)) { return false; } if (value.length < 3 || value.length > 63) { return false; } if (value !== value.toLowerCase()) { return false; } if (isIpAddress(value)) { return false; } return true; }, "isVirtualHostableS3Bucket"); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js var ARN_DELIMITER, RESOURCE_DELIMITER, parseArn; var init_parseArn = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js"() { init_import_meta_url(); ARN_DELIMITER = ":"; RESOURCE_DELIMITER = "/"; parseArn = /* @__PURE__ */ __name((value) => { const segments = value.split(ARN_DELIMITER); if (segments.length < 6) return null; const [arn, partition2, service, region, accountId, ...resourcePath] = segments; if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") return null; const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat(); return { partition: partition2, service, region, accountId, resourceId }; }, "parseArn"); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json var partitions_default; var init_partitions = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json"() { partitions_default = { partitions: [{ id: "aws", outputs: { dnsSuffix: "amazonaws.com", dualStackDnsSuffix: "api.aws", implicitGlobalRegion: "us-east-1", name: "aws", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", regions: { "af-south-1": { description: "Africa (Cape Town)" }, "ap-east-1": { description: "Asia Pacific (Hong Kong)" }, "ap-northeast-1": { description: "Asia Pacific (Tokyo)" }, "ap-northeast-2": { description: "Asia Pacific (Seoul)" }, "ap-northeast-3": { description: "Asia Pacific (Osaka)" }, "ap-south-1": { description: "Asia Pacific (Mumbai)" }, "ap-south-2": { description: "Asia Pacific (Hyderabad)" }, "ap-southeast-1": { description: "Asia Pacific (Singapore)" }, "ap-southeast-2": { description: "Asia Pacific (Sydney)" }, "ap-southeast-3": { description: "Asia Pacific (Jakarta)" }, "ap-southeast-4": { description: "Asia Pacific (Melbourne)" }, "ap-southeast-5": { description: "Asia Pacific (Malaysia)" }, "aws-global": { description: "AWS Standard global region" }, "ca-central-1": { description: "Canada (Central)" }, "ca-west-1": { description: "Canada West (Calgary)" }, "eu-central-1": { description: "Europe (Frankfurt)" }, "eu-central-2": { description: "Europe (Zurich)" }, "eu-north-1": { description: "Europe (Stockholm)" }, "eu-south-1": { description: "Europe (Milan)" }, "eu-south-2": { description: "Europe (Spain)" }, "eu-west-1": { description: "Europe (Ireland)" }, "eu-west-2": { description: "Europe (London)" }, "eu-west-3": { description: "Europe (Paris)" }, "il-central-1": { description: "Israel (Tel Aviv)" }, "me-central-1": { description: "Middle East (UAE)" }, "me-south-1": { description: "Middle East (Bahrain)" }, "sa-east-1": { description: "South America (Sao Paulo)" }, "us-east-1": { description: "US East (N. Virginia)" }, "us-east-2": { description: "US East (Ohio)" }, "us-west-1": { description: "US West (N. California)" }, "us-west-2": { description: "US West (Oregon)" } } }, { id: "aws-cn", outputs: { dnsSuffix: "amazonaws.com.cn", dualStackDnsSuffix: "api.amazonwebservices.com.cn", implicitGlobalRegion: "cn-northwest-1", name: "aws-cn", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^cn\\-\\w+\\-\\d+$", regions: { "aws-cn-global": { description: "AWS China global region" }, "cn-north-1": { description: "China (Beijing)" }, "cn-northwest-1": { description: "China (Ningxia)" } } }, { id: "aws-us-gov", outputs: { dnsSuffix: "amazonaws.com", dualStackDnsSuffix: "api.aws", implicitGlobalRegion: "us-gov-west-1", name: "aws-us-gov", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^us\\-gov\\-\\w+\\-\\d+$", regions: { "aws-us-gov-global": { description: "AWS GovCloud (US) global region" }, "us-gov-east-1": { description: "AWS GovCloud (US-East)" }, "us-gov-west-1": { description: "AWS GovCloud (US-West)" } } }, { id: "aws-iso", outputs: { dnsSuffix: "c2s.ic.gov", dualStackDnsSuffix: "c2s.ic.gov", implicitGlobalRegion: "us-iso-east-1", name: "aws-iso", supportsDualStack: false, supportsFIPS: true }, regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", regions: { "aws-iso-global": { description: "AWS ISO (US) global region" }, "us-iso-east-1": { description: "US ISO East" }, "us-iso-west-1": { description: "US ISO WEST" } } }, { id: "aws-iso-b", outputs: { dnsSuffix: "sc2s.sgov.gov", dualStackDnsSuffix: "sc2s.sgov.gov", implicitGlobalRegion: "us-isob-east-1", name: "aws-iso-b", supportsDualStack: false, supportsFIPS: true }, regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", regions: { "aws-iso-b-global": { description: "AWS ISOB (US) global region" }, "us-isob-east-1": { description: "US ISOB East (Ohio)" } } }, { id: "aws-iso-e", outputs: { dnsSuffix: "cloud.adc-e.uk", dualStackDnsSuffix: "cloud.adc-e.uk", implicitGlobalRegion: "eu-isoe-west-1", name: "aws-iso-e", supportsDualStack: false, supportsFIPS: true }, regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", regions: { "eu-isoe-west-1": { description: "EU ISOE West" } } }, { id: "aws-iso-f", outputs: { dnsSuffix: "csp.hci.ic.gov", dualStackDnsSuffix: "csp.hci.ic.gov", implicitGlobalRegion: "us-isof-south-1", name: "aws-iso-f", supportsDualStack: false, supportsFIPS: true }, regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", regions: {} }], version: "1.1" }; } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js var selectedPartitionsInfo, selectedUserAgentPrefix, partition, getUserAgentPrefix; var init_partition = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js"() { init_import_meta_url(); init_partitions(); selectedPartitionsInfo = partitions_default; selectedUserAgentPrefix = ""; partition = /* @__PURE__ */ __name((value) => { const { partitions } = selectedPartitionsInfo; for (const partition2 of partitions) { const { regions, outputs } = partition2; for (const [region, regionData] of Object.entries(regions)) { if (region === value) { return { ...outputs, ...regionData }; } } } for (const partition2 of partitions) { const { regionRegex, outputs } = partition2; if (new RegExp(regionRegex).test(value)) { return { ...outputs }; } } const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws"); if (!DEFAULT_PARTITION) { throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist."); } return { ...DEFAULT_PARTITION.outputs }; }, "partition"); getUserAgentPrefix = /* @__PURE__ */ __name(() => selectedUserAgentPrefix, "getUserAgentPrefix"); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/aws.js var awsEndpointFunctions; var init_aws = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/aws.js"() { init_import_meta_url(); init_dist_es25(); init_isVirtualHostableS3Bucket(); init_parseArn(); init_partition(); awsEndpointFunctions = { isVirtualHostableS3Bucket, parseArn, partition }; customEndpointFunctions.aws = awsEndpointFunctions; } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js var init_resolveEndpoint2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js"() { init_import_meta_url(); init_dist_es25(); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js var init_EndpointError2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js"() { init_import_meta_url(); init_dist_es25(); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js var init_EndpointRuleObject3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js var init_ErrorRuleObject3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js var init_RuleSetObject3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js var init_TreeRuleObject3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js var init_shared3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js var init_types4 = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js"() { init_import_meta_url(); init_EndpointError2(); init_EndpointRuleObject3(); init_ErrorRuleObject3(); init_RuleSetObject3(); init_TreeRuleObject3(); init_shared3(); } }); // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/index.js var init_dist_es26 = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.714.0/node_modules/@aws-sdk/util-endpoints/dist-es/index.js"() { init_import_meta_url(); init_aws(); init_partition(); init_isIpAddress2(); init_resolveEndpoint2(); init_types4(); } }); // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js async function checkFeatures(context2, config, args) { const request4 = args.request; if (request4?.headers?.["smithy-protocol"] === "rpc-v2-cbor") { setFeature(context2, "PROTOCOL_RPC_V2_CBOR", "M"); } if (typeof config.retryStrategy === "function") { const retryStrategy = await config.retryStrategy(); if (typeof retryStrategy.acquireInitialRetryToken === "function") { if (retryStrategy.constructor?.name?.includes("Adaptive")) { setFeature(context2, "RETRY_MODE_ADAPTIVE", "F"); } else { setFeature(context2, "RETRY_MODE_STANDARD", "E"); } } else { setFeature(context2, "RETRY_MODE_LEGACY", "D"); } } if (typeof config.accountIdEndpointMode === "function") { const endpointV2 = context2.endpointV2; if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) { setFeature(context2, "ACCOUNT_ID_ENDPOINT", "O"); } switch (await config.accountIdEndpointMode?.()) { case "disabled": setFeature(context2, "ACCOUNT_ID_MODE_DISABLED", "Q"); break; case "preferred": setFeature(context2, "ACCOUNT_ID_MODE_PREFERRED", "P"); break; case "required": setFeature(context2, "ACCOUNT_ID_MODE_REQUIRED", "R"); break; } } const identity = context2.__smithy_context?.selectedHttpAuthScheme?.identity; if (identity?.$source) { const credentials = identity; if (credentials.accountId) { setFeature(context2, "RESOLVED_ACCOUNT_ID", "T"); } for (const [key, value] of Object.entries(credentials.$source ?? {})) { setFeature(context2, key, value); } } } var ACCOUNT_ID_ENDPOINT_REGEX; var init_check_features = __esm({ "../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js"() { init_import_meta_url(); init_dist_es20(); ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/; __name(checkFeatures, "checkFeatures"); } }); // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js var USER_AGENT, X_AMZ_USER_AGENT, SPACE, UA_NAME_SEPARATOR, UA_NAME_ESCAPE_REGEX, UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR; var init_constants4 = __esm({ "../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js"() { init_import_meta_url(); USER_AGENT = "user-agent"; X_AMZ_USER_AGENT = "x-amz-user-agent"; SPACE = " "; UA_NAME_SEPARATOR = "/"; UA_NAME_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g; UA_VALUE_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g; UA_ESCAPE_CHAR = "-"; } }); // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js function encodeFeatures(features) { let buffer = ""; for (const key in features) { const val2 = features[key]; if (buffer.length + val2.length + 1 <= BYTE_LIMIT) { if (buffer.length) { buffer += "," + val2; } else { buffer += val2; } continue; } break; } return buffer; } var BYTE_LIMIT; var init_encode_features = __esm({ "../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js"() { init_import_meta_url(); BYTE_LIMIT = 1024; __name(encodeFeatures, "encodeFeatures"); } }); // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js var userAgentMiddleware, escapeUserAgent, getUserAgentMiddlewareOptions, getUserAgentPlugin; var init_user_agent_middleware = __esm({ "../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js"() { init_import_meta_url(); init_dist_es26(); init_dist_es2(); init_check_features(); init_constants4(); init_encode_features(); userAgentMiddleware = /* @__PURE__ */ __name((options32) => (next, context2) => async (args) => { const { request: request4 } = args; if (!HttpRequest.isInstance(request4)) { return next(args); } const { headers } = request4; const userAgent = context2?.userAgent?.map(escapeUserAgent) || []; const defaultUserAgent = (await options32.defaultUserAgentProvider()).map(escapeUserAgent); await checkFeatures(context2, options32, args); const awsContext = context2; defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context2.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`); const customUserAgent = options32?.customUserAgent?.map(escapeUserAgent) || []; const appId = await options32.userAgentAppId(); if (appId) { defaultUserAgent.push(escapeUserAgent([`app/${appId}`])); } const prefix = getUserAgentPrefix(); const sdkUserAgentValue = (prefix ? [prefix] : []).concat([...defaultUserAgent, ...userAgent, ...customUserAgent]).join(SPACE); const normalUAValue = [ ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), ...customUserAgent ].join(SPACE); if (options32.runtime !== "browser") { if (normalUAValue) { headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue; } headers[USER_AGENT] = sdkUserAgentValue; } else { headers[X_AMZ_USER_AGENT] = sdkUserAgentValue; } return next({ ...args, request: request4 }); }, "userAgentMiddleware"); escapeUserAgent = /* @__PURE__ */ __name((userAgentPair) => { const name2 = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR); const version4 = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR); const prefixSeparatorIndex = name2.indexOf(UA_NAME_SEPARATOR); const prefix = name2.substring(0, prefixSeparatorIndex); let uaName = name2.substring(prefixSeparatorIndex + 1); if (prefix === "api") { uaName = uaName.toLowerCase(); } return [prefix, uaName, version4].filter((item) => item && item.length > 0).reduce((acc, item, index) => { switch (index) { case 0: return item; case 1: return `${acc}/${item}`; default: return `${acc}#${item}`; } }, ""); }, "escapeUserAgent"); getUserAgentMiddlewareOptions = { name: "getUserAgentMiddleware", step: "build", priority: "low", tags: ["SET_USER_AGENT", "USER_AGENT"], override: true }; getUserAgentPlugin = /* @__PURE__ */ __name((config) => ({ applyToStack: (clientStack) => { clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions); } }), "getUserAgentPlugin"); } }); // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js var init_dist_es27 = __esm({ "../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.721.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js"() { init_import_meta_url(); init_configurations(); init_user_agent_middleware(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js var ENV_USE_DUALSTACK_ENDPOINT, CONFIG_USE_DUALSTACK_ENDPOINT, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS; var init_NodeUseDualstackEndpointConfigOptions = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js"() { init_import_meta_url(); init_dist_es24(); ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = { environmentVariableSelector: (env6) => booleanSelector(env6, ENV_USE_DUALSTACK_ENDPOINT, SelectorType2.ENV), configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType2.CONFIG), default: false }; } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js var ENV_USE_FIPS_ENDPOINT, CONFIG_USE_FIPS_ENDPOINT, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS; var init_NodeUseFipsEndpointConfigOptions = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js"() { init_import_meta_url(); init_dist_es24(); ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = { environmentVariableSelector: (env6) => booleanSelector(env6, ENV_USE_FIPS_ENDPOINT, SelectorType2.ENV), configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, SelectorType2.CONFIG), default: false }; } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js var init_resolveCustomEndpointsConfig = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js"() { init_import_meta_url(); init_dist_es3(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/utils/getEndpointFromRegion.js var init_getEndpointFromRegion = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/utils/getEndpointFromRegion.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js var init_resolveEndpointsConfig = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js"() { init_import_meta_url(); init_dist_es3(); init_getEndpointFromRegion(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/index.js var init_endpointsConfig = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/index.js"() { init_import_meta_url(); init_NodeUseDualstackEndpointConfigOptions(); init_NodeUseFipsEndpointConfigOptions(); init_resolveCustomEndpointsConfig(); init_resolveEndpointsConfig(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js var REGION_ENV_NAME, REGION_INI_NAME, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS; var init_config2 = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js"() { init_import_meta_url(); REGION_ENV_NAME = "AWS_REGION"; REGION_INI_NAME = "region"; NODE_REGION_CONFIG_OPTIONS = { environmentVariableSelector: (env6) => env6[REGION_ENV_NAME], configFileSelector: (profile) => profile[REGION_INI_NAME], default: () => { throw new Error("Region is missing"); } }; NODE_REGION_CONFIG_FILE_OPTIONS = { preferredFile: "credentials" }; } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js var isFipsRegion; var init_isFipsRegion = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js"() { init_import_meta_url(); isFipsRegion = /* @__PURE__ */ __name((region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")), "isFipsRegion"); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js var getRealRegion; var init_getRealRegion = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js"() { init_import_meta_url(); init_isFipsRegion(); getRealRegion = /* @__PURE__ */ __name((region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region, "getRealRegion"); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js var resolveRegionConfig; var init_resolveRegionConfig = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js"() { init_import_meta_url(); init_getRealRegion(); init_isFipsRegion(); resolveRegionConfig = /* @__PURE__ */ __name((input) => { const { region, useFipsEndpoint } = input; if (!region) { throw new Error("Region is missing"); } return { ...input, region: async () => { if (typeof region === "string") { return getRealRegion(region); } const providedRegion = await region(); return getRealRegion(providedRegion); }, useFipsEndpoint: async () => { const providedRegion = typeof region === "string" ? region : await region(); if (isFipsRegion(providedRegion)) { return true; } return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); } }; }, "resolveRegionConfig"); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/index.js var init_regionConfig = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionConfig/index.js"() { init_import_meta_url(); init_config2(); init_resolveRegionConfig(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/PartitionHash.js var init_PartitionHash = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/PartitionHash.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/RegionHash.js var init_RegionHash = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/RegionHash.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getHostnameFromVariants.js var init_getHostnameFromVariants = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getHostnameFromVariants.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getResolvedHostname.js var init_getResolvedHostname = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getResolvedHostname.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getResolvedPartition.js var init_getResolvedPartition = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getResolvedPartition.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getResolvedSigningRegion.js var init_getResolvedSigningRegion = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getResolvedSigningRegion.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getRegionInfo.js var init_getRegionInfo = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/getRegionInfo.js"() { init_import_meta_url(); init_getHostnameFromVariants(); init_getResolvedHostname(); init_getResolvedPartition(); init_getResolvedSigningRegion(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/index.js var init_regionInfo = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/regionInfo/index.js"() { init_import_meta_url(); init_PartitionHash(); init_RegionHash(); init_getRegionInfo(); } }); // ../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/index.js var init_dist_es28 = __esm({ "../../node_modules/.pnpm/@smithy+config-resolver@3.0.13/node_modules/@smithy/config-resolver/dist-es/index.js"() { init_import_meta_url(); init_endpointsConfig(); init_regionConfig(); init_regionInfo(); } }); // ../../node_modules/.pnpm/@smithy+middleware-content-length@3.0.13/node_modules/@smithy/middleware-content-length/dist-es/index.js function contentLengthMiddleware(bodyLengthChecker) { return (next) => async (args) => { const request4 = args.request; if (HttpRequest.isInstance(request4)) { const { body, headers } = request4; if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) { try { const length = bodyLengthChecker(body); request4.headers = { ...request4.headers, [CONTENT_LENGTH_HEADER]: String(length) }; } catch (error2) { } } } return next({ ...args, request: request4 }); }; } var CONTENT_LENGTH_HEADER, contentLengthMiddlewareOptions, getContentLengthPlugin; var init_dist_es29 = __esm({ "../../node_modules/.pnpm/@smithy+middleware-content-length@3.0.13/node_modules/@smithy/middleware-content-length/dist-es/index.js"() { init_import_meta_url(); init_dist_es2(); CONTENT_LENGTH_HEADER = "content-length"; __name(contentLengthMiddleware, "contentLengthMiddleware"); contentLengthMiddlewareOptions = { step: "build", tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], name: "contentLengthMiddleware", override: true }; getContentLengthPlugin = /* @__PURE__ */ __name((options32) => ({ applyToStack: (clientStack) => { clientStack.add(contentLengthMiddleware(options32.bodyLengthChecker), contentLengthMiddlewareOptions); } }), "getContentLengthPlugin"); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js var resolveParamsForS3, DOMAIN_PATTERN, IP_ADDRESS_PATTERN, DOTS_PATTERN, isDnsCompatibleBucketName, isArnBucketName; var init_s3 = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js"() { init_import_meta_url(); resolveParamsForS3 = /* @__PURE__ */ __name(async (endpointParams) => { const bucket = endpointParams?.Bucket || ""; if (typeof endpointParams.Bucket === "string") { endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?")); } if (isArnBucketName(bucket)) { if (endpointParams.ForcePathStyle === true) { throw new Error("Path-style addressing cannot be used with ARN buckets"); } } else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) { endpointParams.ForcePathStyle = true; } if (endpointParams.DisableMultiRegionAccessPoints) { endpointParams.disableMultiRegionAccessPoints = true; endpointParams.DisableMRAP = true; } return endpointParams; }, "resolveParamsForS3"); DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; DOTS_PATTERN = /\.\./; isDnsCompatibleBucketName = /* @__PURE__ */ __name((bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName), "isDnsCompatibleBucketName"); isArnBucketName = /* @__PURE__ */ __name((bucketName) => { const [arn, partition2, service, , , bucket] = bucketName.split(":"); const isArn = arn === "arn" && bucketName.split(":").length >= 6; const isValidArn = Boolean(isArn && partition2 && service && bucket); if (isArn && !isValidArn) { throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); } return isValidArn; }, "isArnBucketName"); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/index.js var init_service_customizations = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/index.js"() { init_import_meta_url(); init_s3(); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js var createConfigValueProvider; var init_createConfigValueProvider = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js"() { init_import_meta_url(); createConfigValueProvider = /* @__PURE__ */ __name((configKey, canonicalEndpointParamKey, config) => { const configProvider = /* @__PURE__ */ __name(async () => { const configValue = config[configKey] ?? config[canonicalEndpointParamKey]; if (typeof configValue === "function") { return configValue(); } return configValue; }, "configProvider"); if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") { return async () => { const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; const configValue = credentials?.credentialScope ?? credentials?.CredentialScope; return configValue; }; } if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") { return async () => { const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials; const configValue = credentials?.accountId ?? credentials?.AccountId; return configValue; }; } if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") { return async () => { const endpoint = await configProvider(); if (endpoint && typeof endpoint === "object") { if ("url" in endpoint) { return endpoint.url.href; } if ("hostname" in endpoint) { const { protocol, hostname: hostname2, port, path: path72 } = endpoint; return `${protocol}//${hostname2}${port ? ":" + port : ""}${path72}`; } } return endpoint; }; } return configProvider; }, "createConfigValueProvider"); } }); // ../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/getSelectorName.js function getSelectorName(functionString) { try { const constants4 = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? [])); constants4.delete("CONFIG"); constants4.delete("CONFIG_PREFIX_SEPARATOR"); constants4.delete("ENV"); return [...constants4].join(", "); } catch (e7) { return functionString; } } var init_getSelectorName = __esm({ "../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/getSelectorName.js"() { init_import_meta_url(); __name(getSelectorName, "getSelectorName"); } }); // ../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/fromEnv.js var fromEnv; var init_fromEnv = __esm({ "../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/fromEnv.js"() { init_import_meta_url(); init_dist_es16(); init_getSelectorName(); fromEnv = /* @__PURE__ */ __name((envVarSelector, logger4) => async () => { try { const config = envVarSelector(process.env); if (config === void 0) { throw new Error(); } return config; } catch (e7) { throw new CredentialsProviderError(e7.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: logger4 }); } }, "fromEnv"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getHomeDir.js var import_os5, import_path15, homeDirCache, getHomeDirCacheKey, getHomeDir; var init_getHomeDir = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getHomeDir.js"() { init_import_meta_url(); import_os5 = require("os"); import_path15 = require("path"); homeDirCache = {}; getHomeDirCacheKey = /* @__PURE__ */ __name(() => { if (process && process.geteuid) { return `${process.geteuid()}`; } return "DEFAULT"; }, "getHomeDirCacheKey"); getHomeDir = /* @__PURE__ */ __name(() => { const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${import_path15.sep}` } = process.env; if (HOME) return HOME; if (USERPROFILE) return USERPROFILE; if (HOMEPATH) return `${HOMEDRIVE}${HOMEPATH}`; const homeDirCacheKey = getHomeDirCacheKey(); if (!homeDirCache[homeDirCacheKey]) homeDirCache[homeDirCacheKey] = (0, import_os5.homedir)(); return homeDirCache[homeDirCacheKey]; }, "getHomeDir"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js var ENV_PROFILE, DEFAULT_PROFILE, getProfileName; var init_getProfileName = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js"() { init_import_meta_url(); ENV_PROFILE = "AWS_PROFILE"; DEFAULT_PROFILE = "default"; getProfileName = /* @__PURE__ */ __name((init2) => init2.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE, "getProfileName"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js var import_crypto2, import_path16, getSSOTokenFilepath; var init_getSSOTokenFilepath = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js"() { init_import_meta_url(); import_crypto2 = require("crypto"); import_path16 = require("path"); init_getHomeDir(); getSSOTokenFilepath = /* @__PURE__ */ __name((id) => { const hasher = (0, import_crypto2.createHash)("sha1"); const cacheName = hasher.update(id).digest("hex"); return (0, import_path16.join)(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`); }, "getSSOTokenFilepath"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js var import_fs14, readFile10, getSSOTokenFromFile; var init_getSSOTokenFromFile = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js"() { init_import_meta_url(); import_fs14 = require("fs"); init_getSSOTokenFilepath(); ({ readFile: readFile10 } = import_fs14.promises); getSSOTokenFromFile = /* @__PURE__ */ __name(async (id) => { const ssoTokenFilepath = getSSOTokenFilepath(id); const ssoTokenText = await readFile10(ssoTokenFilepath, "utf8"); return JSON.parse(ssoTokenText); }, "getSSOTokenFromFile"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigData.js var getConfigData; var init_getConfigData = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigData.js"() { init_import_meta_url(); init_dist_es(); init_loadSharedConfigFiles(); getConfigData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => { const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); if (indexOfSeparator === -1) { return false; } return Object.values(IniSectionType).includes(key.substring(0, indexOfSeparator)); }).reduce((acc, [key, value]) => { const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); const updatedKey = key.substring(0, indexOfSeparator) === IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; acc[updatedKey] = value; return acc; }, { ...data.default && { default: data.default } }), "getConfigData"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js var import_path17, ENV_CONFIG_PATH, getConfigFilepath; var init_getConfigFilepath = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js"() { init_import_meta_url(); import_path17 = require("path"); init_getHomeDir(); ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; getConfigFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CONFIG_PATH] || (0, import_path17.join)(getHomeDir(), ".aws", "config"), "getConfigFilepath"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js var import_path18, ENV_CREDENTIALS_PATH, getCredentialsFilepath; var init_getCredentialsFilepath = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js"() { init_import_meta_url(); import_path18 = require("path"); init_getHomeDir(); ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; getCredentialsFilepath = /* @__PURE__ */ __name(() => process.env[ENV_CREDENTIALS_PATH] || (0, import_path18.join)(getHomeDir(), ".aws", "credentials"), "getCredentialsFilepath"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js var prefixKeyRegex, profileNameBlockList, parseIni; var init_parseIni = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js"() { init_import_meta_url(); init_dist_es(); init_loadSharedConfigFiles(); prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; profileNameBlockList = ["__proto__", "profile __proto__"]; parseIni = /* @__PURE__ */ __name((iniData) => { const map2 = {}; let currentSection; let currentSubSection; for (const iniLine of iniData.split(/\r?\n/)) { const trimmedLine = iniLine.split(/(^|\s)[;#]/)[0].trim(); const isSection = trimmedLine[0] === "[" && trimmedLine[trimmedLine.length - 1] === "]"; if (isSection) { currentSection = void 0; currentSubSection = void 0; const sectionName = trimmedLine.substring(1, trimmedLine.length - 1); const matches = prefixKeyRegex.exec(sectionName); if (matches) { const [, prefix, , name2] = matches; if (Object.values(IniSectionType).includes(prefix)) { currentSection = [prefix, name2].join(CONFIG_PREFIX_SEPARATOR); } } else { currentSection = sectionName; } if (profileNameBlockList.includes(sectionName)) { throw new Error(`Found invalid profile name "${sectionName}"`); } } else if (currentSection) { const indexOfEqualsSign = trimmedLine.indexOf("="); if (![0, -1].includes(indexOfEqualsSign)) { const [name2, value] = [ trimmedLine.substring(0, indexOfEqualsSign).trim(), trimmedLine.substring(indexOfEqualsSign + 1).trim() ]; if (value === "") { currentSubSection = name2; } else { if (currentSubSection && iniLine.trimStart() === iniLine) { currentSubSection = void 0; } map2[currentSection] = map2[currentSection] || {}; const key = currentSubSection ? [currentSubSection, name2].join(CONFIG_PREFIX_SEPARATOR) : name2; map2[currentSection][key] = value; } } } } return map2; }, "parseIni"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/slurpFile.js var import_fs15, readFile11, filePromisesHash, slurpFile; var init_slurpFile = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/slurpFile.js"() { init_import_meta_url(); import_fs15 = require("fs"); ({ readFile: readFile11 } = import_fs15.promises); filePromisesHash = {}; slurpFile = /* @__PURE__ */ __name((path72, options32) => { if (!filePromisesHash[path72] || options32?.ignoreCache) { filePromisesHash[path72] = readFile11(path72, "utf8"); } return filePromisesHash[path72]; }, "slurpFile"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js var import_path19, swallowError, CONFIG_PREFIX_SEPARATOR, loadSharedConfigFiles; var init_loadSharedConfigFiles = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js"() { init_import_meta_url(); import_path19 = require("path"); init_getConfigData(); init_getConfigFilepath(); init_getCredentialsFilepath(); init_getHomeDir(); init_parseIni(); init_slurpFile(); swallowError = /* @__PURE__ */ __name(() => ({}), "swallowError"); CONFIG_PREFIX_SEPARATOR = "."; loadSharedConfigFiles = /* @__PURE__ */ __name(async (init2 = {}) => { const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init2; const homeDir = getHomeDir(); const relativeHomeDirPrefix = "~/"; let resolvedFilepath = filepath; if (filepath.startsWith(relativeHomeDirPrefix)) { resolvedFilepath = (0, import_path19.join)(homeDir, filepath.slice(2)); } let resolvedConfigFilepath = configFilepath; if (configFilepath.startsWith(relativeHomeDirPrefix)) { resolvedConfigFilepath = (0, import_path19.join)(homeDir, configFilepath.slice(2)); } const parsedFiles = await Promise.all([ slurpFile(resolvedConfigFilepath, { ignoreCache: init2.ignoreCache }).then(parseIni).then(getConfigData).catch(swallowError), slurpFile(resolvedFilepath, { ignoreCache: init2.ignoreCache }).then(parseIni).catch(swallowError) ]); return { configFile: parsedFiles[0], credentialsFile: parsedFiles[1] }; }, "loadSharedConfigFiles"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js var getSsoSessionData; var init_getSsoSessionData = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js"() { init_import_meta_url(); init_dist_es(); init_loadSharedConfigFiles(); getSsoSessionData = /* @__PURE__ */ __name((data) => Object.entries(data).filter(([key]) => key.startsWith(IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}), "getSsoSessionData"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSsoSessionData.js var swallowError2, loadSsoSessionData; var init_loadSsoSessionData = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSsoSessionData.js"() { init_import_meta_url(); init_getConfigFilepath(); init_getSsoSessionData(); init_parseIni(); init_slurpFile(); swallowError2 = /* @__PURE__ */ __name(() => ({}), "swallowError"); loadSsoSessionData = /* @__PURE__ */ __name(async (init2 = {}) => slurpFile(init2.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError2), "loadSsoSessionData"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js var mergeConfigFiles; var init_mergeConfigFiles = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js"() { init_import_meta_url(); mergeConfigFiles = /* @__PURE__ */ __name((...files) => { const merged = {}; for (const file of files) { for (const [key, values] of Object.entries(file)) { if (merged[key] !== void 0) { Object.assign(merged[key], values); } else { merged[key] = values; } } } return merged; }, "mergeConfigFiles"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js var parseKnownFiles; var init_parseKnownFiles = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js"() { init_import_meta_url(); init_loadSharedConfigFiles(); init_mergeConfigFiles(); parseKnownFiles = /* @__PURE__ */ __name(async (init2) => { const parsedFiles = await loadSharedConfigFiles(init2); return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); }, "parseKnownFiles"); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/types.js var init_types5 = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/types.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/index.js var init_dist_es30 = __esm({ "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/index.js"() { init_import_meta_url(); init_getHomeDir(); init_getProfileName(); init_getSSOTokenFilepath(); init_getSSOTokenFromFile(); init_loadSharedConfigFiles(); init_loadSsoSessionData(); init_parseKnownFiles(); init_types5(); } }); // ../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/fromSharedConfigFiles.js var fromSharedConfigFiles; var init_fromSharedConfigFiles = __esm({ "../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/fromSharedConfigFiles.js"() { init_import_meta_url(); init_dist_es16(); init_dist_es30(); init_getSelectorName(); fromSharedConfigFiles = /* @__PURE__ */ __name((configSelector, { preferredFile = "config", ...init2 } = {}) => async () => { const profile = getProfileName(init2); const { configFile, credentialsFile } = await loadSharedConfigFiles(init2); const profileFromCredentials = credentialsFile[profile] || {}; const profileFromConfig = configFile[profile] || {}; const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials }; try { const cfgFile = preferredFile === "config" ? configFile : credentialsFile; const configValue = configSelector(mergedProfile, cfgFile); if (configValue === void 0) { throw new Error(); } return configValue; } catch (e7) { throw new CredentialsProviderError(e7.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init2.logger }); } }, "fromSharedConfigFiles"); } }); // ../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/fromStatic.js var isFunction2, fromStatic2; var init_fromStatic2 = __esm({ "../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/fromStatic.js"() { init_import_meta_url(); init_dist_es16(); isFunction2 = /* @__PURE__ */ __name((func) => typeof func === "function", "isFunction"); fromStatic2 = /* @__PURE__ */ __name((defaultValue) => isFunction2(defaultValue) ? async () => await defaultValue() : fromStatic(defaultValue), "fromStatic"); } }); // ../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/configLoader.js var loadConfig; var init_configLoader = __esm({ "../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/configLoader.js"() { init_import_meta_url(); init_dist_es16(); init_fromEnv(); init_fromSharedConfigFiles(); init_fromStatic2(); loadConfig = /* @__PURE__ */ __name(({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => memoize(chain(fromEnv(environmentVariableSelector), fromSharedConfigFiles(configFileSelector, configuration), fromStatic2(defaultValue))), "loadConfig"); } }); // ../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/index.js var init_dist_es31 = __esm({ "../../node_modules/.pnpm/@smithy+node-config-provider@3.1.12/node_modules/@smithy/node-config-provider/dist-es/index.js"() { init_import_meta_url(); init_configLoader(); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointUrlConfig.js var ENV_ENDPOINT_URL, CONFIG_ENDPOINT_URL, getEndpointUrlConfig; var init_getEndpointUrlConfig = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointUrlConfig.js"() { init_import_meta_url(); init_dist_es30(); ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; CONFIG_ENDPOINT_URL = "endpoint_url"; getEndpointUrlConfig = /* @__PURE__ */ __name((serviceId) => ({ environmentVariableSelector: (env6) => { const serviceSuffixParts = serviceId.split(" ").map((w6) => w6.toUpperCase()); const serviceEndpointUrl = env6[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")]; if (serviceEndpointUrl) return serviceEndpointUrl; const endpointUrl = env6[ENV_ENDPOINT_URL]; if (endpointUrl) return endpointUrl; return void 0; }, configFileSelector: (profile, config) => { if (config && profile.services) { const servicesSection = config[["services", profile.services].join(CONFIG_PREFIX_SEPARATOR)]; if (servicesSection) { const servicePrefixParts = serviceId.split(" ").map((w6) => w6.toLowerCase()); const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)]; if (endpointUrl2) return endpointUrl2; } } const endpointUrl = profile[CONFIG_ENDPOINT_URL]; if (endpointUrl) return endpointUrl; return void 0; }, default: void 0 }), "getEndpointUrlConfig"); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js var getEndpointFromConfig; var init_getEndpointFromConfig = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js"() { init_import_meta_url(); init_dist_es31(); init_getEndpointUrlConfig(); getEndpointFromConfig = /* @__PURE__ */ __name(async (serviceId) => loadConfig(getEndpointUrlConfig(serviceId ?? ""))(), "getEndpointFromConfig"); } }); // ../../node_modules/.pnpm/@smithy+querystring-parser@3.0.11/node_modules/@smithy/querystring-parser/dist-es/index.js function parseQueryString(querystring) { const query = {}; querystring = querystring.replace(/^\?/, ""); if (querystring) { for (const pair of querystring.split("&")) { let [key, value = null] = pair.split("="); key = decodeURIComponent(key); if (value) { value = decodeURIComponent(value); } if (!(key in query)) { query[key] = value; } else if (Array.isArray(query[key])) { query[key].push(value); } else { query[key] = [query[key], value]; } } } return query; } var init_dist_es32 = __esm({ "../../node_modules/.pnpm/@smithy+querystring-parser@3.0.11/node_modules/@smithy/querystring-parser/dist-es/index.js"() { init_import_meta_url(); __name(parseQueryString, "parseQueryString"); } }); // ../../node_modules/.pnpm/@smithy+url-parser@3.0.11/node_modules/@smithy/url-parser/dist-es/index.js var parseUrl; var init_dist_es33 = __esm({ "../../node_modules/.pnpm/@smithy+url-parser@3.0.11/node_modules/@smithy/url-parser/dist-es/index.js"() { init_import_meta_url(); init_dist_es32(); parseUrl = /* @__PURE__ */ __name((url4) => { if (typeof url4 === "string") { return parseUrl(new URL(url4)); } const { hostname: hostname2, pathname, port, protocol, search } = url4; let query; if (search) { query = parseQueryString(search); } return { hostname: hostname2, port: port ? parseInt(port) : void 0, protocol, path: pathname, query }; }, "parseUrl"); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js var toEndpointV1; var init_toEndpointV1 = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js"() { init_import_meta_url(); init_dist_es33(); toEndpointV1 = /* @__PURE__ */ __name((endpoint) => { if (typeof endpoint === "object") { if ("url" in endpoint) { return parseUrl(endpoint.url); } return endpoint; } return parseUrl(endpoint); }, "toEndpointV1"); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js var getEndpointFromInstructions, resolveParams; var init_getEndpointFromInstructions = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js"() { init_import_meta_url(); init_service_customizations(); init_createConfigValueProvider(); init_getEndpointFromConfig(); init_toEndpointV1(); getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig, context2) => { if (!clientConfig.endpoint) { let endpointFromConfig; if (clientConfig.serviceConfiguredEndpoint) { endpointFromConfig = await clientConfig.serviceConfiguredEndpoint(); } else { endpointFromConfig = await getEndpointFromConfig(clientConfig.serviceId); } if (endpointFromConfig) { clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig)); } } const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig); if (typeof clientConfig.endpointProvider !== "function") { throw new Error("config.endpointProvider is not set."); } const endpoint = clientConfig.endpointProvider(endpointParams, context2); return endpoint; }, "getEndpointFromInstructions"); resolveParams = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig) => { const endpointParams = {}; const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {}; for (const [name2, instruction] of Object.entries(instructions)) { switch (instruction.type) { case "staticContextParams": endpointParams[name2] = instruction.value; break; case "contextParams": endpointParams[name2] = commandInput[instruction.name]; break; case "clientContextParams": case "builtInParams": endpointParams[name2] = await createConfigValueProvider(instruction.name, name2, clientConfig)(); break; case "operationContextParams": endpointParams[name2] = instruction.get(commandInput); break; default: throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction)); } } if (Object.keys(instructions).length === 0) { Object.assign(endpointParams, clientConfig); } if (String(clientConfig.serviceId).toLowerCase() === "s3") { await resolveParamsForS3(endpointParams); } return endpointParams; }, "resolveParams"); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/index.js var init_adaptors = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/index.js"() { init_import_meta_url(); init_getEndpointFromInstructions(); init_toEndpointV1(); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js var endpointMiddleware; var init_endpointMiddleware = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js"() { init_import_meta_url(); init_dist_es15(); init_dist_es3(); init_getEndpointFromInstructions(); endpointMiddleware = /* @__PURE__ */ __name(({ config, instructions }) => { return (next, context2) => async (args) => { if (config.endpoint) { setFeature2(context2, "ENDPOINT_OVERRIDE", "N"); } const endpoint = await getEndpointFromInstructions(args.input, { getEndpointParameterInstructions() { return instructions; } }, { ...config }, context2); context2.endpointV2 = endpoint; context2.authSchemes = endpoint.properties?.authSchemes; const authScheme = context2.authSchemes?.[0]; if (authScheme) { context2["signing_region"] = authScheme.signingRegion; context2["signing_service"] = authScheme.signingName; const smithyContext = getSmithyContext(context2); const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption; if (httpAuthOption) { httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, { signing_region: authScheme.signingRegion, signingRegion: authScheme.signingRegion, signing_service: authScheme.signingName, signingName: authScheme.signingName, signingRegionSet: authScheme.signingRegionSet }, authScheme.properties); } } return next({ ...args }); }; }, "endpointMiddleware"); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js var endpointMiddlewareOptions, getEndpointPlugin; var init_getEndpointPlugin = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js"() { init_import_meta_url(); init_dist_es4(); init_endpointMiddleware(); endpointMiddlewareOptions = { step: "serialize", tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], name: "endpointV2Middleware", override: true, relation: "before", toMiddleware: serializerMiddlewareOption.name }; getEndpointPlugin = /* @__PURE__ */ __name((config, instructions) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(endpointMiddleware({ config, instructions }), endpointMiddlewareOptions); } }), "getEndpointPlugin"); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js var resolveEndpointConfig; var init_resolveEndpointConfig = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js"() { init_import_meta_url(); init_dist_es3(); init_getEndpointFromConfig(); init_toEndpointV1(); resolveEndpointConfig = /* @__PURE__ */ __name((input) => { const tls = input.tls ?? true; const { endpoint } = input; const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await normalizeProvider(endpoint)()) : void 0; const isCustomEndpoint = !!endpoint; const resolvedConfig = { ...input, endpoint: customEndpointProvider, tls, isCustomEndpoint, useDualstackEndpoint: normalizeProvider(input.useDualstackEndpoint ?? false), useFipsEndpoint: normalizeProvider(input.useFipsEndpoint ?? false) }; let configuredEndpointPromise = void 0; resolvedConfig.serviceConfiguredEndpoint = async () => { if (input.serviceId && !configuredEndpointPromise) { configuredEndpointPromise = getEndpointFromConfig(input.serviceId); } return configuredEndpointPromise; }; return resolvedConfig; }, "resolveEndpointConfig"); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/types.js var init_types6 = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/types.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/index.js var init_dist_es34 = __esm({ "../../node_modules/.pnpm/@smithy+middleware-endpoint@3.2.8/node_modules/@smithy/middleware-endpoint/dist-es/index.js"() { init_import_meta_url(); init_adaptors(); init_endpointMiddleware(); init_getEndpointPlugin(); init_resolveEndpointConfig(); init_types6(); } }); // ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/config.js var RETRY_MODES, DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE; var init_config3 = __esm({ "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/config.js"() { init_import_meta_url(); (function(RETRY_MODES2) { RETRY_MODES2["STANDARD"] = "standard"; RETRY_MODES2["ADAPTIVE"] = "adaptive"; })(RETRY_MODES || (RETRY_MODES = {})); DEFAULT_MAX_ATTEMPTS = 3; DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD; } }); // ../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/constants.js var THROTTLING_ERROR_CODES, TRANSIENT_ERROR_CODES, TRANSIENT_ERROR_STATUS_CODES, NODEJS_TIMEOUT_ERROR_CODES2; var init_constants5 = __esm({ "../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/constants.js"() { init_import_meta_url(); THROTTLING_ERROR_CODES = [ "BandwidthLimitExceeded", "EC2ThrottledException", "LimitExceededException", "PriorRequestNotComplete", "ProvisionedThroughputExceededException", "RequestLimitExceeded", "RequestThrottled", "RequestThrottledException", "SlowDown", "ThrottledException", "Throttling", "ThrottlingException", "TooManyRequestsException", "TransactionInProgressException" ]; TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; NODEJS_TIMEOUT_ERROR_CODES2 = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; } }); // ../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/index.js var isClockSkewCorrectedError, isThrottlingError, isTransientError, isServerError; var init_dist_es35 = __esm({ "../../node_modules/.pnpm/@smithy+service-error-classification@3.0.11/node_modules/@smithy/service-error-classification/dist-es/index.js"() { init_import_meta_url(); init_constants5(); isClockSkewCorrectedError = /* @__PURE__ */ __name((error2) => error2.$metadata?.clockSkewCorrected, "isClockSkewCorrectedError"); isThrottlingError = /* @__PURE__ */ __name((error2) => error2.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error2.name) || error2.$retryable?.throttling == true, "isThrottlingError"); isTransientError = /* @__PURE__ */ __name((error2, depth = 0) => isClockSkewCorrectedError(error2) || TRANSIENT_ERROR_CODES.includes(error2.name) || NODEJS_TIMEOUT_ERROR_CODES2.includes(error2?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error2.$metadata?.httpStatusCode || 0) || error2.cause !== void 0 && depth <= 10 && isTransientError(error2.cause, depth + 1), "isTransientError"); isServerError = /* @__PURE__ */ __name((error2) => { if (error2.$metadata?.httpStatusCode !== void 0) { const statusCode = error2.$metadata.httpStatusCode; if (500 <= statusCode && statusCode <= 599 && !isTransientError(error2)) { return true; } return false; } return false; }, "isServerError"); } }); // ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js var DefaultRateLimiter; var init_DefaultRateLimiter = __esm({ "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js"() { init_import_meta_url(); init_dist_es35(); DefaultRateLimiter = class { constructor(options32) { this.currentCapacity = 0; this.enabled = false; this.lastMaxRate = 0; this.measuredTxRate = 0; this.requestCount = 0; this.lastTimestamp = 0; this.timeWindow = 0; this.beta = options32?.beta ?? 0.7; this.minCapacity = options32?.minCapacity ?? 1; this.minFillRate = options32?.minFillRate ?? 0.5; this.scaleConstant = options32?.scaleConstant ?? 0.4; this.smooth = options32?.smooth ?? 0.8; const currentTimeInSeconds = this.getCurrentTimeInSeconds(); this.lastThrottleTime = currentTimeInSeconds; this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); this.fillRate = this.minFillRate; this.maxCapacity = this.minCapacity; } getCurrentTimeInSeconds() { return Date.now() / 1e3; } async getSendToken() { return this.acquireTokenBucket(1); } async acquireTokenBucket(amount) { if (!this.enabled) { return; } this.refillTokenBucket(); if (amount > this.currentCapacity) { const delay = (amount - this.currentCapacity) / this.fillRate * 1e3; await new Promise((resolve25) => DefaultRateLimiter.setTimeoutFn(resolve25, delay)); } this.currentCapacity = this.currentCapacity - amount; } refillTokenBucket() { const timestamp = this.getCurrentTimeInSeconds(); if (!this.lastTimestamp) { this.lastTimestamp = timestamp; return; } const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount); this.lastTimestamp = timestamp; } updateClientSendingRate(response) { let calculatedRate; this.updateMeasuredRate(); if (isThrottlingError(response)) { const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate); this.lastMaxRate = rateToUse; this.calculateTimeWindow(); this.lastThrottleTime = this.getCurrentTimeInSeconds(); calculatedRate = this.cubicThrottle(rateToUse); this.enableTokenBucket(); } else { this.calculateTimeWindow(); calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds()); } const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate); this.updateTokenBucketRate(newRate); } calculateTimeWindow() { this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3)); } cubicThrottle(rateToUse) { return this.getPrecise(rateToUse * this.beta); } cubicSuccess(timestamp) { return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate); } enableTokenBucket() { this.enabled = true; } updateTokenBucketRate(newRate) { this.refillTokenBucket(); this.fillRate = Math.max(newRate, this.minFillRate); this.maxCapacity = Math.max(newRate, this.minCapacity); this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity); } updateMeasuredRate() { const t7 = this.getCurrentTimeInSeconds(); const timeBucket = Math.floor(t7 * 2) / 2; this.requestCount++; if (timeBucket > this.lastTxRateBucket) { const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket); this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth)); this.requestCount = 0; this.lastTxRateBucket = timeBucket; } } getPrecise(num) { return parseFloat(num.toFixed(8)); } }; __name(DefaultRateLimiter, "DefaultRateLimiter"); DefaultRateLimiter.setTimeoutFn = setTimeout; } }); // ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/constants.js var DEFAULT_RETRY_DELAY_BASE, MAXIMUM_RETRY_DELAY, THROTTLING_RETRY_DELAY_BASE, INITIAL_RETRY_TOKENS, RETRY_COST, TIMEOUT_RETRY_COST, NO_RETRY_INCREMENT, INVOCATION_ID_HEADER, REQUEST_HEADER; var init_constants6 = __esm({ "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/constants.js"() { init_import_meta_url(); DEFAULT_RETRY_DELAY_BASE = 100; MAXIMUM_RETRY_DELAY = 20 * 1e3; THROTTLING_RETRY_DELAY_BASE = 500; INITIAL_RETRY_TOKENS = 500; RETRY_COST = 5; TIMEOUT_RETRY_COST = 10; NO_RETRY_INCREMENT = 1; INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; REQUEST_HEADER = "amz-sdk-request"; } }); // ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js var getDefaultRetryBackoffStrategy; var init_defaultRetryBackoffStrategy = __esm({ "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js"() { init_import_meta_url(); init_constants6(); getDefaultRetryBackoffStrategy = /* @__PURE__ */ __name(() => { let delayBase = DEFAULT_RETRY_DELAY_BASE; const computeNextBackoffDelay = /* @__PURE__ */ __name((attempts) => { return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); }, "computeNextBackoffDelay"); const setDelayBase = /* @__PURE__ */ __name((delay) => { delayBase = delay; }, "setDelayBase"); return { computeNextBackoffDelay, setDelayBase }; }, "getDefaultRetryBackoffStrategy"); } }); // ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js var createDefaultRetryToken; var init_defaultRetryToken = __esm({ "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js"() { init_import_meta_url(); init_constants6(); createDefaultRetryToken = /* @__PURE__ */ __name(({ retryDelay, retryCount, retryCost }) => { const getRetryCount = /* @__PURE__ */ __name(() => retryCount, "getRetryCount"); const getRetryDelay = /* @__PURE__ */ __name(() => Math.min(MAXIMUM_RETRY_DELAY, retryDelay), "getRetryDelay"); const getRetryCost = /* @__PURE__ */ __name(() => retryCost, "getRetryCost"); return { getRetryCount, getRetryDelay, getRetryCost }; }, "createDefaultRetryToken"); } }); // ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js var StandardRetryStrategy; var init_StandardRetryStrategy = __esm({ "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js"() { init_import_meta_url(); init_config3(); init_constants6(); init_defaultRetryBackoffStrategy(); init_defaultRetryToken(); StandardRetryStrategy = class { constructor(maxAttempts) { this.maxAttempts = maxAttempts; this.mode = RETRY_MODES.STANDARD; this.capacity = INITIAL_RETRY_TOKENS; this.retryBackoffStrategy = getDefaultRetryBackoffStrategy(); this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts; } async acquireInitialRetryToken(retryTokenScope) { return createDefaultRetryToken({ retryDelay: DEFAULT_RETRY_DELAY_BASE, retryCount: 0 }); } async refreshRetryTokenForRetry(token, errorInfo) { const maxAttempts = await this.getMaxAttempts(); if (this.shouldRetry(token, errorInfo, maxAttempts)) { const errorType = errorInfo.errorType; this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE); const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType; const capacityCost = this.getCapacityCost(errorType); this.capacity -= capacityCost; return createDefaultRetryToken({ retryDelay, retryCount: token.getRetryCount() + 1, retryCost: capacityCost }); } throw new Error("No retry token available"); } recordSuccess(token) { this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT)); } getCapacity() { return this.capacity; } async getMaxAttempts() { try { return await this.maxAttemptsProvider(); } catch (error2) { console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); return DEFAULT_MAX_ATTEMPTS; } } shouldRetry(tokenToRenew, errorInfo, maxAttempts) { const attempts = tokenToRenew.getRetryCount() + 1; return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType); } getCapacityCost(errorType) { return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST; } isRetryableError(errorType) { return errorType === "THROTTLING" || errorType === "TRANSIENT"; } }; __name(StandardRetryStrategy, "StandardRetryStrategy"); } }); // ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js var AdaptiveRetryStrategy; var init_AdaptiveRetryStrategy = __esm({ "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js"() { init_import_meta_url(); init_config3(); init_DefaultRateLimiter(); init_StandardRetryStrategy(); AdaptiveRetryStrategy = class { constructor(maxAttemptsProvider, options32) { this.maxAttemptsProvider = maxAttemptsProvider; this.mode = RETRY_MODES.ADAPTIVE; const { rateLimiter } = options32 ?? {}; this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider); } async acquireInitialRetryToken(retryTokenScope) { await this.rateLimiter.getSendToken(); return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); } async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { this.rateLimiter.updateClientSendingRate(errorInfo); return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); } recordSuccess(token) { this.rateLimiter.updateClientSendingRate({}); this.standardRetryStrategy.recordSuccess(token); } }; __name(AdaptiveRetryStrategy, "AdaptiveRetryStrategy"); } }); // ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js var init_ConfiguredRetryStrategy = __esm({ "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js"() { init_import_meta_url(); init_constants6(); init_StandardRetryStrategy(); } }); // ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/types.js var init_types7 = __esm({ "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/types.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/index.js var init_dist_es36 = __esm({ "../../node_modules/.pnpm/@smithy+util-retry@3.0.11/node_modules/@smithy/util-retry/dist-es/index.js"() { init_import_meta_url(); init_AdaptiveRetryStrategy(); init_ConfiguredRetryStrategy(); init_DefaultRateLimiter(); init_StandardRetryStrategy(); init_config3(); init_constants6(); init_types7(); } }); // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/rng.js function rng() { if (poolPtr > rnds8Pool.length - 16) { import_crypto3.default.randomFillSync(rnds8Pool); poolPtr = 0; } return rnds8Pool.slice(poolPtr, poolPtr += 16); } var import_crypto3, rnds8Pool, poolPtr; var init_rng = __esm({ "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/rng.js"() { init_import_meta_url(); import_crypto3 = __toESM(require("crypto")); rnds8Pool = new Uint8Array(256); poolPtr = rnds8Pool.length; __name(rng, "rng"); } }); // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/stringify.js function unsafeStringify(arr, offset = 0) { return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; } var byteToHex; var init_stringify = __esm({ "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/stringify.js"() { init_import_meta_url(); byteToHex = []; for (let i5 = 0; i5 < 256; ++i5) { byteToHex.push((i5 + 256).toString(16).slice(1)); } __name(unsafeStringify, "unsafeStringify"); } }); // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/native.js var import_crypto4, native_default; var init_native = __esm({ "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/native.js"() { init_import_meta_url(); import_crypto4 = __toESM(require("crypto")); native_default = { randomUUID: import_crypto4.default.randomUUID }; } }); // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/v4.js function v4(options32, buf, offset) { if (native_default.randomUUID && !buf && !options32) { return native_default.randomUUID(); } options32 = options32 || {}; const rnds = options32.random || (options32.rng || rng)(); rnds[6] = rnds[6] & 15 | 64; rnds[8] = rnds[8] & 63 | 128; if (buf) { offset = offset || 0; for (let i5 = 0; i5 < 16; ++i5) { buf[offset + i5] = rnds[i5]; } return buf; } return unsafeStringify(rnds); } var v4_default; var init_v4 = __esm({ "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/v4.js"() { init_import_meta_url(); init_native(); init_rng(); init_stringify(); __name(v4, "v4"); v4_default = v4; } }); // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/index.js var init_esm_node = __esm({ "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/index.js"() { init_import_meta_url(); init_v4(); } }); // ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/defaultRetryQuota.js var init_defaultRetryQuota = __esm({ "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/defaultRetryQuota.js"() { init_import_meta_url(); init_dist_es36(); } }); // ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/delayDecider.js var init_delayDecider = __esm({ "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/delayDecider.js"() { init_import_meta_url(); init_dist_es36(); } }); // ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/retryDecider.js var init_retryDecider = __esm({ "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/retryDecider.js"() { init_import_meta_url(); init_dist_es35(); } }); // ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/util.js var asSdkError; var init_util2 = __esm({ "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/util.js"() { init_import_meta_url(); asSdkError = /* @__PURE__ */ __name((error2) => { if (error2 instanceof Error) return error2; if (error2 instanceof Object) return Object.assign(new Error(), error2); if (typeof error2 === "string") return new Error(error2); return new Error(`AWS SDK error wrapper for ${error2}`); }, "asSdkError"); } }); // ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js var init_StandardRetryStrategy2 = __esm({ "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js"() { init_import_meta_url(); init_dist_es2(); init_dist_es35(); init_dist_es36(); init_defaultRetryQuota(); init_delayDecider(); init_retryDecider(); init_util2(); } }); // ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js var init_AdaptiveRetryStrategy2 = __esm({ "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js"() { init_import_meta_url(); init_dist_es36(); init_StandardRetryStrategy2(); } }); // ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/configurations.js var ENV_MAX_ATTEMPTS, CONFIG_MAX_ATTEMPTS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, resolveRetryConfig, ENV_RETRY_MODE, CONFIG_RETRY_MODE, NODE_RETRY_MODE_CONFIG_OPTIONS; var init_configurations2 = __esm({ "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/configurations.js"() { init_import_meta_url(); init_dist_es3(); init_dist_es36(); ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; CONFIG_MAX_ATTEMPTS = "max_attempts"; NODE_MAX_ATTEMPT_CONFIG_OPTIONS = { environmentVariableSelector: (env6) => { const value = env6[ENV_MAX_ATTEMPTS]; if (!value) return void 0; const maxAttempt = parseInt(value); if (Number.isNaN(maxAttempt)) { throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`); } return maxAttempt; }, configFileSelector: (profile) => { const value = profile[CONFIG_MAX_ATTEMPTS]; if (!value) return void 0; const maxAttempt = parseInt(value); if (Number.isNaN(maxAttempt)) { throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`); } return maxAttempt; }, default: DEFAULT_MAX_ATTEMPTS }; resolveRetryConfig = /* @__PURE__ */ __name((input) => { const { retryStrategy } = input; const maxAttempts = normalizeProvider(input.maxAttempts ?? DEFAULT_MAX_ATTEMPTS); return { ...input, maxAttempts, retryStrategy: async () => { if (retryStrategy) { return retryStrategy; } const retryMode = await normalizeProvider(input.retryMode)(); if (retryMode === RETRY_MODES.ADAPTIVE) { return new AdaptiveRetryStrategy(maxAttempts); } return new StandardRetryStrategy(maxAttempts); } }; }, "resolveRetryConfig"); ENV_RETRY_MODE = "AWS_RETRY_MODE"; CONFIG_RETRY_MODE = "retry_mode"; NODE_RETRY_MODE_CONFIG_OPTIONS = { environmentVariableSelector: (env6) => env6[ENV_RETRY_MODE], configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], default: DEFAULT_RETRY_MODE }; } }); // ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/omitRetryHeadersMiddleware.js var init_omitRetryHeadersMiddleware = __esm({ "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/omitRetryHeadersMiddleware.js"() { init_import_meta_url(); init_dist_es2(); init_dist_es36(); } }); // ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.js var import_stream10, isStreamingPayload; var init_isStreamingPayload = __esm({ "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.js"() { init_import_meta_url(); import_stream10 = require("stream"); isStreamingPayload = /* @__PURE__ */ __name((request4) => request4?.body instanceof import_stream10.Readable || typeof ReadableStream !== "undefined" && request4?.body instanceof ReadableStream, "isStreamingPayload"); } }); // ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js var retryMiddleware, isRetryStrategyV2, getRetryErrorInfo, getRetryErrorType, retryMiddlewareOptions, getRetryPlugin, getRetryAfterHint; var init_retryMiddleware = __esm({ "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js"() { init_import_meta_url(); init_dist_es2(); init_dist_es35(); init_dist_es19(); init_dist_es36(); init_esm_node(); init_isStreamingPayload(); init_util2(); retryMiddleware = /* @__PURE__ */ __name((options32) => (next, context2) => async (args) => { let retryStrategy = await options32.retryStrategy(); const maxAttempts = await options32.maxAttempts(); if (isRetryStrategyV2(retryStrategy)) { retryStrategy = retryStrategy; let retryToken = await retryStrategy.acquireInitialRetryToken(context2["partition_id"]); let lastError = new Error(); let attempts = 0; let totalRetryDelay = 0; const { request: request4 } = args; const isRequest = HttpRequest.isInstance(request4); if (isRequest) { request4.headers[INVOCATION_ID_HEADER] = v4_default(); } while (true) { try { if (isRequest) { request4.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; } const { response, output } = await next(args); retryStrategy.recordSuccess(retryToken); output.$metadata.attempts = attempts + 1; output.$metadata.totalRetryDelay = totalRetryDelay; return { response, output }; } catch (e7) { const retryErrorInfo = getRetryErrorInfo(e7); lastError = asSdkError(e7); if (isRequest && isStreamingPayload(request4)) { (context2.logger instanceof NoOpLogger ? console : context2.logger)?.warn("An error was encountered in a non-retryable streaming request."); throw lastError; } try { retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); } catch (refreshError) { if (!lastError.$metadata) { lastError.$metadata = {}; } lastError.$metadata.attempts = attempts + 1; lastError.$metadata.totalRetryDelay = totalRetryDelay; throw lastError; } attempts = retryToken.getRetryCount(); const delay = retryToken.getRetryDelay(); totalRetryDelay += delay; await new Promise((resolve25) => setTimeout(resolve25, delay)); } } } else { retryStrategy = retryStrategy; if (retryStrategy?.mode) context2.userAgent = [...context2.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]]; return retryStrategy.retry(next, args); } }, "retryMiddleware"); isRetryStrategyV2 = /* @__PURE__ */ __name((retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined", "isRetryStrategyV2"); getRetryErrorInfo = /* @__PURE__ */ __name((error2) => { const errorInfo = { error: error2, errorType: getRetryErrorType(error2) }; const retryAfterHint = getRetryAfterHint(error2.$response); if (retryAfterHint) { errorInfo.retryAfterHint = retryAfterHint; } return errorInfo; }, "getRetryErrorInfo"); getRetryErrorType = /* @__PURE__ */ __name((error2) => { if (isThrottlingError(error2)) return "THROTTLING"; if (isTransientError(error2)) return "TRANSIENT"; if (isServerError(error2)) return "SERVER_ERROR"; return "CLIENT_ERROR"; }, "getRetryErrorType"); retryMiddlewareOptions = { name: "retryMiddleware", tags: ["RETRY"], step: "finalizeRequest", priority: "high", override: true }; getRetryPlugin = /* @__PURE__ */ __name((options32) => ({ applyToStack: (clientStack) => { clientStack.add(retryMiddleware(options32), retryMiddlewareOptions); } }), "getRetryPlugin"); getRetryAfterHint = /* @__PURE__ */ __name((response) => { if (!HttpResponse.isInstance(response)) return; const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after"); if (!retryAfterHeaderName) return; const retryAfter = response.headers[retryAfterHeaderName]; const retryAfterSeconds = Number(retryAfter); if (!Number.isNaN(retryAfterSeconds)) return new Date(retryAfterSeconds * 1e3); const retryAfterDate = new Date(retryAfter); return retryAfterDate; }, "getRetryAfterHint"); } }); // ../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/index.js var init_dist_es37 = __esm({ "../../node_modules/.pnpm/@smithy+middleware-retry@3.0.34/node_modules/@smithy/middleware-retry/dist-es/index.js"() { init_import_meta_url(); init_AdaptiveRetryStrategy2(); init_StandardRetryStrategy2(); init_configurations2(); init_delayDecider(); init_omitRetryHeadersMiddleware(); init_retryDecider(); init_retryMiddleware(); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-env@3.716.0/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js var ENV_KEY, ENV_SECRET, ENV_SESSION, ENV_EXPIRATION, ENV_CREDENTIAL_SCOPE, ENV_ACCOUNT_ID, fromEnv2; var init_fromEnv2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-env@3.716.0/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js"() { init_import_meta_url(); init_client2(); init_dist_es16(); ENV_KEY = "AWS_ACCESS_KEY_ID"; ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; ENV_SESSION = "AWS_SESSION_TOKEN"; ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE"; ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID"; fromEnv2 = /* @__PURE__ */ __name((init2) => async () => { init2?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv"); const accessKeyId = process.env[ENV_KEY]; const secretAccessKey = process.env[ENV_SECRET]; const sessionToken = process.env[ENV_SESSION]; const expiry = process.env[ENV_EXPIRATION]; const credentialScope = process.env[ENV_CREDENTIAL_SCOPE]; const accountId = process.env[ENV_ACCOUNT_ID]; if (accessKeyId && secretAccessKey) { const credentials = { accessKeyId, secretAccessKey, ...sessionToken && { sessionToken }, ...expiry && { expiration: new Date(expiry) }, ...credentialScope && { credentialScope }, ...accountId && { accountId } }; setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS", "g"); return credentials; } throw new CredentialsProviderError("Unable to find environment variable credentials.", { logger: init2?.logger }); }, "fromEnv"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-env@3.716.0/node_modules/@aws-sdk/credential-provider-env/dist-es/index.js var dist_es_exports = {}; __export(dist_es_exports, { ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID, ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE, ENV_EXPIRATION: () => ENV_EXPIRATION, ENV_KEY: () => ENV_KEY, ENV_SECRET: () => ENV_SECRET, ENV_SESSION: () => ENV_SESSION, fromEnv: () => fromEnv2 }); var init_dist_es38 = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-env@3.716.0/node_modules/@aws-sdk/credential-provider-env/dist-es/index.js"() { init_import_meta_url(); init_fromEnv2(); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js function httpRequest(options32) { return new Promise((resolve25, reject) => { const req = (0, import_http2.request)({ method: "GET", ...options32, hostname: options32.hostname?.replace(/^\[(.+)\]$/, "$1") }); req.on("error", (err) => { reject(Object.assign(new ProviderError("Unable to connect to instance metadata service"), err)); req.destroy(); }); req.on("timeout", () => { reject(new ProviderError("TimeoutError from instance metadata service")); req.destroy(); }); req.on("response", (res) => { const { statusCode = 400 } = res; if (statusCode < 200 || 300 <= statusCode) { reject(Object.assign(new ProviderError("Error response received from instance metadata service"), { statusCode })); req.destroy(); } const chunks = []; res.on("data", (chunk) => { chunks.push(chunk); }); res.on("end", () => { resolve25(import_buffer4.Buffer.concat(chunks)); req.destroy(); }); }); req.end(); }); } var import_buffer4, import_http2; var init_httpRequest2 = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/httpRequest.js"() { init_import_meta_url(); init_dist_es16(); import_buffer4 = require("buffer"); import_http2 = require("http"); __name(httpRequest, "httpRequest"); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js var isImdsCredentials, fromImdsCredentials; var init_ImdsCredentials = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/ImdsCredentials.js"() { init_import_meta_url(); isImdsCredentials = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string", "isImdsCredentials"); fromImdsCredentials = /* @__PURE__ */ __name((creds) => ({ accessKeyId: creds.AccessKeyId, secretAccessKey: creds.SecretAccessKey, sessionToken: creds.Token, expiration: new Date(creds.Expiration), ...creds.AccountId && { accountId: creds.AccountId } }), "fromImdsCredentials"); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js var DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, providerConfigFromInit; var init_RemoteProviderInit = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/RemoteProviderInit.js"() { init_import_meta_url(); DEFAULT_TIMEOUT = 1e3; DEFAULT_MAX_RETRIES = 0; providerConfigFromInit = /* @__PURE__ */ __name(({ maxRetries = DEFAULT_MAX_RETRIES, timeout: timeout2 = DEFAULT_TIMEOUT }) => ({ maxRetries, timeout: timeout2 }), "providerConfigFromInit"); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/retry.js var retry; var init_retry3 = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/retry.js"() { init_import_meta_url(); retry = /* @__PURE__ */ __name((toRetry, maxRetries) => { let promise = toRetry(); for (let i5 = 0; i5 < maxRetries; i5++) { promise = promise.catch(toRetry); } return promise; }, "retry"); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js var import_url3, ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, ENV_CMDS_AUTH_TOKEN, fromContainerMetadata, requestFromEcsImds, CMDS_IP, GREENGRASS_HOSTS, GREENGRASS_PROTOCOLS, getCmdsUri; var init_fromContainerMetadata = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js"() { init_import_meta_url(); init_dist_es16(); import_url3 = require("url"); init_httpRequest2(); init_ImdsCredentials(); init_RemoteProviderInit(); init_retry3(); ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; fromContainerMetadata = /* @__PURE__ */ __name((init2 = {}) => { const { timeout: timeout2, maxRetries } = providerConfigFromInit(init2); return () => retry(async () => { const requestOptions = await getCmdsUri({ logger: init2.logger }); const credsResponse = JSON.parse(await requestFromEcsImds(timeout2, requestOptions)); if (!isImdsCredentials(credsResponse)) { throw new CredentialsProviderError("Invalid response received from instance metadata service.", { logger: init2.logger }); } return fromImdsCredentials(credsResponse); }, maxRetries); }, "fromContainerMetadata"); requestFromEcsImds = /* @__PURE__ */ __name(async (timeout2, options32) => { if (process.env[ENV_CMDS_AUTH_TOKEN]) { options32.headers = { ...options32.headers, Authorization: process.env[ENV_CMDS_AUTH_TOKEN] }; } const buffer = await httpRequest({ ...options32, timeout: timeout2 }); return buffer.toString(); }, "requestFromEcsImds"); CMDS_IP = "169.254.170.2"; GREENGRASS_HOSTS = { localhost: true, "127.0.0.1": true }; GREENGRASS_PROTOCOLS = { "http:": true, "https:": true }; getCmdsUri = /* @__PURE__ */ __name(async ({ logger: logger4 }) => { if (process.env[ENV_CMDS_RELATIVE_URI]) { return { hostname: CMDS_IP, path: process.env[ENV_CMDS_RELATIVE_URI] }; } if (process.env[ENV_CMDS_FULL_URI]) { const parsed = (0, import_url3.parse)(process.env[ENV_CMDS_FULL_URI]); if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { throw new CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, { tryNextLink: false, logger: logger4 }); } if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { throw new CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, { tryNextLink: false, logger: logger4 }); } return { ...parsed, port: parsed.port ? parseInt(parsed.port, 10) : void 0 }; } throw new CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${ENV_CMDS_RELATIVE_URI} or ${ENV_CMDS_FULL_URI} environment variable is set`, { tryNextLink: false, logger: logger4 }); }, "getCmdsUri"); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js var InstanceMetadataV1FallbackError; var init_InstanceMetadataV1FallbackError = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/error/InstanceMetadataV1FallbackError.js"() { init_import_meta_url(); init_dist_es16(); InstanceMetadataV1FallbackError = class extends CredentialsProviderError { constructor(message, tryNextLink = true) { super(message, tryNextLink); this.tryNextLink = tryNextLink; this.name = "InstanceMetadataV1FallbackError"; Object.setPrototypeOf(this, InstanceMetadataV1FallbackError.prototype); } }; __name(InstanceMetadataV1FallbackError, "InstanceMetadataV1FallbackError"); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/Endpoint.js var Endpoint; var init_Endpoint = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/Endpoint.js"() { init_import_meta_url(); (function(Endpoint2) { Endpoint2["IPv4"] = "http://169.254.169.254"; Endpoint2["IPv6"] = "http://[fd00:ec2::254]"; })(Endpoint || (Endpoint = {})); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointConfigOptions.js var ENV_ENDPOINT_NAME, CONFIG_ENDPOINT_NAME, ENDPOINT_CONFIG_OPTIONS; var init_EndpointConfigOptions = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointConfigOptions.js"() { init_import_meta_url(); ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; ENDPOINT_CONFIG_OPTIONS = { environmentVariableSelector: (env6) => env6[ENV_ENDPOINT_NAME], configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME], default: void 0 }; } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointMode.js var EndpointMode; var init_EndpointMode = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointMode.js"() { init_import_meta_url(); (function(EndpointMode2) { EndpointMode2["IPv4"] = "IPv4"; EndpointMode2["IPv6"] = "IPv6"; })(EndpointMode || (EndpointMode = {})); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js var ENV_ENDPOINT_MODE_NAME, CONFIG_ENDPOINT_MODE_NAME, ENDPOINT_MODE_CONFIG_OPTIONS; var init_EndpointModeConfigOptions = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/config/EndpointModeConfigOptions.js"() { init_import_meta_url(); init_EndpointMode(); ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; ENDPOINT_MODE_CONFIG_OPTIONS = { environmentVariableSelector: (env6) => env6[ENV_ENDPOINT_MODE_NAME], configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME], default: EndpointMode.IPv4 }; } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js var getInstanceMetadataEndpoint, getFromEndpointConfig, getFromEndpointModeConfig; var init_getInstanceMetadataEndpoint = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/getInstanceMetadataEndpoint.js"() { init_import_meta_url(); init_dist_es31(); init_dist_es33(); init_Endpoint(); init_EndpointConfigOptions(); init_EndpointMode(); init_EndpointModeConfigOptions(); getInstanceMetadataEndpoint = /* @__PURE__ */ __name(async () => parseUrl(await getFromEndpointConfig() || await getFromEndpointModeConfig()), "getInstanceMetadataEndpoint"); getFromEndpointConfig = /* @__PURE__ */ __name(async () => loadConfig(ENDPOINT_CONFIG_OPTIONS)(), "getFromEndpointConfig"); getFromEndpointModeConfig = /* @__PURE__ */ __name(async () => { const endpointMode = await loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)(); switch (endpointMode) { case EndpointMode.IPv4: return Endpoint.IPv4; case EndpointMode.IPv6: return Endpoint.IPv6; default: throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`); } }, "getFromEndpointModeConfig"); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS, STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS, STATIC_STABILITY_DOC_URL, getExtendedInstanceMetadataCredentials; var init_getExtendedInstanceMetadataCredentials = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/getExtendedInstanceMetadataCredentials.js"() { init_import_meta_url(); STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; getExtendedInstanceMetadataCredentials = /* @__PURE__ */ __name((credentials, logger4) => { const refreshInterval = STATIC_STABILITY_REFRESH_INTERVAL_SECONDS + Math.floor(Math.random() * STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS); const newExpiration = new Date(Date.now() + refreshInterval * 1e3); logger4.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(newExpiration)}. For more information, please visit: ` + STATIC_STABILITY_DOC_URL); const originalExpiration = credentials.originalExpiration ?? credentials.expiration; return { ...credentials, ...originalExpiration ? { originalExpiration } : {}, expiration: newExpiration }; }, "getExtendedInstanceMetadataCredentials"); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/staticStabilityProvider.js var staticStabilityProvider; var init_staticStabilityProvider = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/utils/staticStabilityProvider.js"() { init_import_meta_url(); init_getExtendedInstanceMetadataCredentials(); staticStabilityProvider = /* @__PURE__ */ __name((provider, options32 = {}) => { const logger4 = options32?.logger || console; let pastCredentials; return async () => { let credentials; try { credentials = await provider(); if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { credentials = getExtendedInstanceMetadataCredentials(credentials, logger4); } } catch (e7) { if (pastCredentials) { logger4.warn("Credential renew failed: ", e7); credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger4); } else { throw e7; } } pastCredentials = credentials; return credentials; }; }, "staticStabilityProvider"); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/fromInstanceMetadata.js var IMDS_PATH, IMDS_TOKEN_PATH, AWS_EC2_METADATA_V1_DISABLED, PROFILE_AWS_EC2_METADATA_V1_DISABLED, X_AWS_EC2_METADATA_TOKEN, fromInstanceMetadata, getInstanceMetadataProvider, getMetadataToken, getProfile, getCredentialsFromProfile; var init_fromInstanceMetadata = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/fromInstanceMetadata.js"() { init_import_meta_url(); init_dist_es31(); init_dist_es16(); init_InstanceMetadataV1FallbackError(); init_httpRequest2(); init_ImdsCredentials(); init_RemoteProviderInit(); init_retry3(); init_getInstanceMetadataEndpoint(); init_staticStabilityProvider(); IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; IMDS_TOKEN_PATH = "/latest/api/token"; AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED"; PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled"; X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token"; fromInstanceMetadata = /* @__PURE__ */ __name((init2 = {}) => staticStabilityProvider(getInstanceMetadataProvider(init2), { logger: init2.logger }), "fromInstanceMetadata"); getInstanceMetadataProvider = /* @__PURE__ */ __name((init2 = {}) => { let disableFetchToken = false; const { logger: logger4, profile } = init2; const { timeout: timeout2, maxRetries } = providerConfigFromInit(init2); const getCredentials2 = /* @__PURE__ */ __name(async (maxRetries2, options32) => { const isImdsV1Fallback = disableFetchToken || options32.headers?.[X_AWS_EC2_METADATA_TOKEN] == null; if (isImdsV1Fallback) { let fallbackBlockedFromProfile = false; let fallbackBlockedFromProcessEnv = false; const configValue = await loadConfig({ environmentVariableSelector: (env6) => { const envValue = env6[AWS_EC2_METADATA_V1_DISABLED]; fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false"; if (envValue === void 0) { throw new CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init2.logger }); } return fallbackBlockedFromProcessEnv; }, configFileSelector: (profile2) => { const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED]; fallbackBlockedFromProfile = !!profileValue && profileValue !== "false"; return fallbackBlockedFromProfile; }, default: false }, { profile })(); if (init2.ec2MetadataV1Disabled || configValue) { const causes = []; if (init2.ec2MetadataV1Disabled) causes.push("credential provider initialization (runtime option ec2MetadataV1Disabled)"); if (fallbackBlockedFromProfile) causes.push(`config file profile (${PROFILE_AWS_EC2_METADATA_V1_DISABLED})`); if (fallbackBlockedFromProcessEnv) causes.push(`process environment variable (${AWS_EC2_METADATA_V1_DISABLED})`); throw new InstanceMetadataV1FallbackError(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${causes.join(", ")}].`); } } const imdsProfile = (await retry(async () => { let profile2; try { profile2 = await getProfile(options32); } catch (err) { if (err.statusCode === 401) { disableFetchToken = false; } throw err; } return profile2; }, maxRetries2)).trim(); return retry(async () => { let creds; try { creds = await getCredentialsFromProfile(imdsProfile, options32, init2); } catch (err) { if (err.statusCode === 401) { disableFetchToken = false; } throw err; } return creds; }, maxRetries2); }, "getCredentials"); return async () => { const endpoint = await getInstanceMetadataEndpoint(); if (disableFetchToken) { logger4?.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)"); return getCredentials2(maxRetries, { ...endpoint, timeout: timeout2 }); } else { let token; try { token = (await getMetadataToken({ ...endpoint, timeout: timeout2 })).toString(); } catch (error2) { if (error2?.statusCode === 400) { throw Object.assign(error2, { message: "EC2 Metadata token request returned error" }); } else if (error2.message === "TimeoutError" || [403, 404, 405].includes(error2.statusCode)) { disableFetchToken = true; } logger4?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)"); return getCredentials2(maxRetries, { ...endpoint, timeout: timeout2 }); } return getCredentials2(maxRetries, { ...endpoint, headers: { [X_AWS_EC2_METADATA_TOKEN]: token }, timeout: timeout2 }); } }; }, "getInstanceMetadataProvider"); getMetadataToken = /* @__PURE__ */ __name(async (options32) => httpRequest({ ...options32, path: IMDS_TOKEN_PATH, method: "PUT", headers: { "x-aws-ec2-metadata-token-ttl-seconds": "21600" } }), "getMetadataToken"); getProfile = /* @__PURE__ */ __name(async (options32) => (await httpRequest({ ...options32, path: IMDS_PATH })).toString(), "getProfile"); getCredentialsFromProfile = /* @__PURE__ */ __name(async (profile, options32, init2) => { const credentialsResponse = JSON.parse((await httpRequest({ ...options32, path: IMDS_PATH + profile })).toString()); if (!isImdsCredentials(credentialsResponse)) { throw new CredentialsProviderError("Invalid response received from instance metadata service.", { logger: init2.logger }); } return fromImdsCredentials(credentialsResponse); }, "getCredentialsFromProfile"); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/types.js var init_types8 = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/types.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/index.js var dist_es_exports2 = {}; __export(dist_es_exports2, { DEFAULT_MAX_RETRIES: () => DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT: () => DEFAULT_TIMEOUT, ENV_CMDS_AUTH_TOKEN: () => ENV_CMDS_AUTH_TOKEN, ENV_CMDS_FULL_URI: () => ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI: () => ENV_CMDS_RELATIVE_URI, Endpoint: () => Endpoint, fromContainerMetadata: () => fromContainerMetadata, fromInstanceMetadata: () => fromInstanceMetadata, getInstanceMetadataEndpoint: () => getInstanceMetadataEndpoint, httpRequest: () => httpRequest, providerConfigFromInit: () => providerConfigFromInit }); var init_dist_es39 = __esm({ "../../node_modules/.pnpm/@smithy+credential-provider-imds@3.2.8/node_modules/@smithy/credential-provider-imds/dist-es/index.js"() { init_import_meta_url(); init_fromContainerMetadata(); init_fromInstanceMetadata(); init_RemoteProviderInit(); init_types8(); init_httpRequest2(); init_getInstanceMetadataEndpoint(); init_Endpoint(); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js var ECS_CONTAINER_HOST, EKS_CONTAINER_HOST_IPv4, EKS_CONTAINER_HOST_IPv6, checkUrl; var init_checkUrl = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/checkUrl.js"() { init_import_meta_url(); init_dist_es16(); ECS_CONTAINER_HOST = "169.254.170.2"; EKS_CONTAINER_HOST_IPv4 = "169.254.170.23"; EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]"; checkUrl = /* @__PURE__ */ __name((url4, logger4) => { if (url4.protocol === "https:") { return; } if (url4.hostname === ECS_CONTAINER_HOST || url4.hostname === EKS_CONTAINER_HOST_IPv4 || url4.hostname === EKS_CONTAINER_HOST_IPv6) { return; } if (url4.hostname.includes("[")) { if (url4.hostname === "[::1]" || url4.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") { return; } } else { if (url4.hostname === "localhost") { return; } const ipComponents = url4.hostname.split("."); const inRange = /* @__PURE__ */ __name((component) => { const num = parseInt(component, 10); return 0 <= num && num <= 255; }, "inRange"); if (ipComponents[0] === "127" && inRange(ipComponents[1]) && inRange(ipComponents[2]) && inRange(ipComponents[3]) && ipComponents.length === 4) { return; } } throw new CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following: - loopback CIDR 127.0.0.0/8 or [::1/128] - ECS container host 169.254.170.2 - EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger: logger4 }); }, "checkUrl"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js function createGetRequest(url4) { return new HttpRequest({ protocol: url4.protocol, hostname: url4.hostname, port: Number(url4.port), path: url4.pathname, query: Array.from(url4.searchParams.entries()).reduce((acc, [k6, v7]) => { acc[k6] = v7; return acc; }, {}), fragment: url4.hash }); } async function getCredentials(response, logger4) { const stream2 = sdkStreamMixin2(response.body); const str = await stream2.transformToString(); if (response.statusCode === 200) { const parsed = JSON.parse(str); if (typeof parsed.AccessKeyId !== "string" || typeof parsed.SecretAccessKey !== "string" || typeof parsed.Token !== "string" || typeof parsed.Expiration !== "string") { throw new CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger: logger4 }); } return { accessKeyId: parsed.AccessKeyId, secretAccessKey: parsed.SecretAccessKey, sessionToken: parsed.Token, expiration: parseRfc3339DateTime(parsed.Expiration) }; } if (response.statusCode >= 400 && response.statusCode < 500) { let parsedBody = {}; try { parsedBody = JSON.parse(str); } catch (e7) { } throw Object.assign(new CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger: logger4 }), { Code: parsedBody.Code, Message: parsedBody.Message }); } throw new CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger: logger4 }); } var init_requestHelpers = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/requestHelpers.js"() { init_import_meta_url(); init_dist_es16(); init_dist_es2(); init_dist_es19(); init_dist_es14(); __name(createGetRequest, "createGetRequest"); __name(getCredentials, "getCredentials"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/retry-wrapper.js var retryWrapper; var init_retry_wrapper = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/retry-wrapper.js"() { init_import_meta_url(); retryWrapper = /* @__PURE__ */ __name((toRetry, maxRetries, delayMs) => { return async () => { for (let i5 = 0; i5 < maxRetries; ++i5) { try { return await toRetry(); } catch (e7) { await new Promise((resolve25) => setTimeout(resolve25, delayMs)); } } return await toRetry(); }; }, "retryWrapper"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js var import_promises28, AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, DEFAULT_LINK_LOCAL_HOST, AWS_CONTAINER_CREDENTIALS_FULL_URI, AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE, AWS_CONTAINER_AUTHORIZATION_TOKEN, fromHttp; var init_fromHttp = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js"() { init_import_meta_url(); init_client2(); init_dist_es11(); init_dist_es16(); import_promises28 = __toESM(require("fs/promises")); init_checkUrl(); init_requestHelpers(); init_retry_wrapper(); AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2"; AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"; AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; fromHttp = /* @__PURE__ */ __name((options32 = {}) => { options32.logger?.debug("@aws-sdk/credential-provider-http - fromHttp"); let host; const relative15 = options32.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI]; const full = options32.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI]; const token = options32.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN]; const tokenFile = options32.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE]; const warn2 = options32.logger?.constructor?.name === "NoOpLogger" || !options32.logger ? console.warn : options32.logger.warn; if (relative15 && full) { warn2("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."); warn2("awsContainerCredentialsFullUri will take precedence."); } if (token && tokenFile) { warn2("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."); warn2("awsContainerAuthorizationToken will take precedence."); } if (full) { host = full; } else if (relative15) { host = `${DEFAULT_LINK_LOCAL_HOST}${relative15}`; } else { throw new CredentialsProviderError(`No HTTP credential provider host provided. Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options32.logger }); } const url4 = new URL(host); checkUrl(url4, options32.logger); const requestHandler = new NodeHttpHandler({ requestTimeout: options32.timeout ?? 1e3, connectionTimeout: options32.timeout ?? 1e3 }); return retryWrapper(async () => { const request4 = createGetRequest(url4); if (token) { request4.headers.Authorization = token; } else if (tokenFile) { request4.headers.Authorization = (await import_promises28.default.readFile(tokenFile)).toString(); } try { const result = await requestHandler.handle(request4); return getCredentials(result.response).then((creds) => setCredentialFeature(creds, "CREDENTIALS_HTTP", "z")); } catch (e7) { throw new CredentialsProviderError(String(e7), { logger: options32.logger }); } }, options32.maxRetries ?? 3, options32.timeout ?? 1e3); }, "fromHttp"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/index.js var dist_es_exports3 = {}; __export(dist_es_exports3, { fromHttp: () => fromHttp }); var init_dist_es40 = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-http@3.716.0/node_modules/@aws-sdk/credential-provider-http/dist-es/index.js"() { init_import_meta_url(); init_fromHttp(); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-node@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-st_nxdfcqjud2svw42kuw6i2zwn6q/node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js var ENV_IMDS_DISABLED, remoteProvider; var init_remoteProvider = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-node@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-st_nxdfcqjud2svw42kuw6i2zwn6q/node_modules/@aws-sdk/credential-provider-node/dist-es/remoteProvider.js"() { init_import_meta_url(); init_dist_es16(); ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; remoteProvider = /* @__PURE__ */ __name(async (init2) => { const { ENV_CMDS_FULL_URI: ENV_CMDS_FULL_URI2, ENV_CMDS_RELATIVE_URI: ENV_CMDS_RELATIVE_URI2, fromContainerMetadata: fromContainerMetadata2, fromInstanceMetadata: fromInstanceMetadata2 } = await Promise.resolve().then(() => (init_dist_es39(), dist_es_exports2)); if (process.env[ENV_CMDS_RELATIVE_URI2] || process.env[ENV_CMDS_FULL_URI2]) { init2.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata"); const { fromHttp: fromHttp2 } = await Promise.resolve().then(() => (init_dist_es40(), dist_es_exports3)); return chain(fromHttp2(init2), fromContainerMetadata2(init2)); } if (process.env[ENV_IMDS_DISABLED]) { return async () => { throw new CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init2.logger }); }; } init2.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"); return fromInstanceMetadata2(init2); }, "remoteProvider"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js var isSsoProfile; var init_isSsoProfile = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/isSsoProfile.js"() { init_import_meta_url(); isSsoProfile = /* @__PURE__ */ __name((arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string"), "isSsoProfile"); } }); // ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/constants.js var EXPIRE_WINDOW_MS, REFRESH_MESSAGE; var init_constants7 = __esm({ "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/constants.js"() { init_import_meta_url(); EXPIRE_WINDOW_MS = 5 * 60 * 1e3; REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/auth/httpAuthSchemeProvider.js function createAwsAuthSigv4HttpAuthOption2(authParameters) { return { schemeId: "aws.auth#sigv4", signingProperties: { name: "sso-oauth", region: authParameters.region }, propertiesExtractor: (config, context2) => ({ signingProperties: { config, context: context2 } }) }; } function createSmithyApiNoAuthHttpAuthOption(authParameters) { return { schemeId: "smithy.api#noAuth" }; } var defaultSSOOIDCHttpAuthSchemeParametersProvider, defaultSSOOIDCHttpAuthSchemeProvider, resolveHttpAuthSchemeConfig2; var init_httpAuthSchemeProvider = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/auth/httpAuthSchemeProvider.js"() { init_import_meta_url(); init_dist_es20(); init_dist_es3(); defaultSSOOIDCHttpAuthSchemeParametersProvider = /* @__PURE__ */ __name(async (config, context2, input) => { return { operation: getSmithyContext(context2).operation, region: await normalizeProvider(config.region)() || (() => { throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); })() }; }, "defaultSSOOIDCHttpAuthSchemeParametersProvider"); __name(createAwsAuthSigv4HttpAuthOption2, "createAwsAuthSigv4HttpAuthOption"); __name(createSmithyApiNoAuthHttpAuthOption, "createSmithyApiNoAuthHttpAuthOption"); defaultSSOOIDCHttpAuthSchemeProvider = /* @__PURE__ */ __name((authParameters) => { const options32 = []; switch (authParameters.operation) { case "CreateToken": { options32.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); break; } case "RegisterClient": { options32.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); break; } case "StartDeviceAuthorization": { options32.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); break; } default: { options32.push(createAwsAuthSigv4HttpAuthOption2(authParameters)); } } return options32; }, "defaultSSOOIDCHttpAuthSchemeProvider"); resolveHttpAuthSchemeConfig2 = /* @__PURE__ */ __name((config) => { const config_0 = resolveAwsSdkSigV4Config(config); return { ...config_0 }; }, "resolveHttpAuthSchemeConfig"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/EndpointParameters.js var resolveClientEndpointParameters2, commonParams2; var init_EndpointParameters = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/EndpointParameters.js"() { init_import_meta_url(); resolveClientEndpointParameters2 = /* @__PURE__ */ __name((options32) => { return { ...options32, useDualstackEndpoint: options32.useDualstackEndpoint ?? false, useFipsEndpoint: options32.useFipsEndpoint ?? false, defaultSigningName: "sso-oauth" }; }, "resolveClientEndpointParameters"); commonParams2 = { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, Endpoint: { type: "builtInParams", name: "endpoint" }, Region: { type: "builtInParams", name: "region" }, UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } }; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/package.json var package_default2; var init_package = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/package.json"() { package_default2 = { name: "@aws-sdk/client-sso-oidc", description: "AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native", version: "3.721.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "node ../../scripts/compilation/inline client-sso-oidc", "build:es": "tsc -p tsconfig.es.json", "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", clean: "rimraf ./dist-* && rimraf *.tsbuildinfo", "extract:docs": "api-extractor run --local", "generate:client": "node ../../scripts/generate-clients/single-service --solo sso-oidc" }, main: "./dist-cjs/index.js", types: "./dist-types/index.d.ts", module: "./dist-es/index.js", sideEffects: false, dependencies: { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/core": "3.716.0", "@aws-sdk/credential-provider-node": "3.721.0", "@aws-sdk/middleware-host-header": "3.714.0", "@aws-sdk/middleware-logger": "3.714.0", "@aws-sdk/middleware-recursion-detection": "3.714.0", "@aws-sdk/middleware-user-agent": "3.721.0", "@aws-sdk/region-config-resolver": "3.714.0", "@aws-sdk/types": "3.714.0", "@aws-sdk/util-endpoints": "3.714.0", "@aws-sdk/util-user-agent-browser": "3.714.0", "@aws-sdk/util-user-agent-node": "3.721.0", "@smithy/config-resolver": "^3.0.13", "@smithy/core": "^2.5.5", "@smithy/fetch-http-handler": "^4.1.2", "@smithy/hash-node": "^3.0.11", "@smithy/invalid-dependency": "^3.0.11", "@smithy/middleware-content-length": "^3.0.13", "@smithy/middleware-endpoint": "^3.2.6", "@smithy/middleware-retry": "^3.0.31", "@smithy/middleware-serde": "^3.0.11", "@smithy/middleware-stack": "^3.0.11", "@smithy/node-config-provider": "^3.1.12", "@smithy/node-http-handler": "^3.3.2", "@smithy/protocol-http": "^4.1.8", "@smithy/smithy-client": "^3.5.1", "@smithy/types": "^3.7.2", "@smithy/url-parser": "^3.0.11", "@smithy/util-base64": "^3.0.0", "@smithy/util-body-length-browser": "^3.0.0", "@smithy/util-body-length-node": "^3.0.0", "@smithy/util-defaults-mode-browser": "^3.0.31", "@smithy/util-defaults-mode-node": "^3.0.31", "@smithy/util-endpoints": "^2.1.7", "@smithy/util-middleware": "^3.0.11", "@smithy/util-retry": "^3.0.11", "@smithy/util-utf8": "^3.0.0", tslib: "^2.6.2" }, devDependencies: { "@tsconfig/node16": "16.1.3", "@types/node": "^16.18.96", concurrently: "7.0.0", "downlevel-dts": "0.10.1", rimraf: "3.0.2", typescript: "~4.9.5" }, engines: { node: ">=16.0.0" }, typesVersions: { "<4.0": { "dist-types/*": [ "dist-types/ts3.4/*" ] } }, files: [ "dist-*/**" ], author: { name: "AWS SDK for JavaScript Team", url: "https://aws.amazon.com/javascript/" }, license: "Apache-2.0", peerDependencies: { "@aws-sdk/client-sts": "^3.721.0" }, browser: { "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" }, "react-native": { "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" }, homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso-oidc", repository: { type: "git", url: "https://github.com/aws/aws-sdk-js-v3.git", directory: "clients/client-sso-oidc" } }; } }); // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/crt-availability.js var crtAvailability; var init_crt_availability = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/crt-availability.js"() { init_import_meta_url(); crtAvailability = { isCrtAvailable: false }; } }); // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js var isCrtAvailable; var init_is_crt_available = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js"() { init_import_meta_url(); init_crt_availability(); isCrtAvailable = /* @__PURE__ */ __name(() => { if (crtAvailability.isCrtAvailable) { return ["md/crt-avail"]; } return null; }, "isCrtAvailable"); } }); // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js var import_os6, import_process6, createDefaultUserAgentProvider; var init_defaultUserAgent = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js"() { init_import_meta_url(); import_os6 = require("os"); import_process6 = require("process"); init_is_crt_available(); init_crt_availability(); createDefaultUserAgentProvider = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => { return async (config) => { const sections = [ ["aws-sdk-js", clientVersion], ["ua", "2.1"], [`os/${(0, import_os6.platform)()}`, (0, import_os6.release)()], ["lang/js"], ["md/nodejs", `${import_process6.versions.node}`] ]; const crtAvailable = isCrtAvailable(); if (crtAvailable) { sections.push(crtAvailable); } if (serviceId) { sections.push([`api/${serviceId}`, clientVersion]); } if (import_process6.env.AWS_EXECUTION_ENV) { sections.push([`exec-env/${import_process6.env.AWS_EXECUTION_ENV}`]); } const appId = await config?.userAgentAppId?.(); const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; return resolvedUserAgent; }; }, "createDefaultUserAgentProvider"); } }); // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/nodeAppIdConfigOptions.js var UA_APP_ID_ENV_NAME, UA_APP_ID_INI_NAME, UA_APP_ID_INI_NAME_DEPRECATED, NODE_APP_ID_CONFIG_OPTIONS; var init_nodeAppIdConfigOptions = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/nodeAppIdConfigOptions.js"() { init_import_meta_url(); init_dist_es27(); UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; UA_APP_ID_INI_NAME = "sdk_ua_app_id"; UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id"; NODE_APP_ID_CONFIG_OPTIONS = { environmentVariableSelector: (env6) => env6[UA_APP_ID_ENV_NAME], configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED], default: DEFAULT_UA_APP_ID }; } }); // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js var init_dist_es41 = __esm({ "../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.721.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js"() { init_import_meta_url(); init_defaultUserAgent(); init_nodeAppIdConfigOptions(); } }); // ../../node_modules/.pnpm/@smithy+hash-node@3.0.11/node_modules/@smithy/hash-node/dist-es/index.js function castSourceData(toCast, encoding) { if (import_buffer5.Buffer.isBuffer(toCast)) { return toCast; } if (typeof toCast === "string") { return fromString(toCast, encoding); } if (ArrayBuffer.isView(toCast)) { return fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength); } return fromArrayBuffer(toCast); } var import_buffer5, import_crypto5, Hash; var init_dist_es42 = __esm({ "../../node_modules/.pnpm/@smithy+hash-node@3.0.11/node_modules/@smithy/hash-node/dist-es/index.js"() { init_import_meta_url(); init_dist_es6(); init_dist_es7(); import_buffer5 = require("buffer"); import_crypto5 = require("crypto"); Hash = class { constructor(algorithmIdentifier, secret2) { this.algorithmIdentifier = algorithmIdentifier; this.secret = secret2; this.reset(); } update(toHash, encoding) { this.hash.update(toUint8Array(castSourceData(toHash, encoding))); } digest() { return Promise.resolve(this.hash.digest()); } reset() { this.hash = this.secret ? (0, import_crypto5.createHmac)(this.algorithmIdentifier, castSourceData(this.secret)) : (0, import_crypto5.createHash)(this.algorithmIdentifier); } }; __name(Hash, "Hash"); __name(castSourceData, "castSourceData"); } }); // ../../node_modules/.pnpm/@smithy+util-body-length-node@3.0.0/node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js var import_fs16, calculateBodyLength; var init_calculateBodyLength = __esm({ "../../node_modules/.pnpm/@smithy+util-body-length-node@3.0.0/node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js"() { init_import_meta_url(); import_fs16 = require("fs"); calculateBodyLength = /* @__PURE__ */ __name((body) => { if (!body) { return 0; } if (typeof body === "string") { return Buffer.byteLength(body); } else if (typeof body.byteLength === "number") { return body.byteLength; } else if (typeof body.size === "number") { return body.size; } else if (typeof body.start === "number" && typeof body.end === "number") { return body.end + 1 - body.start; } else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) { return (0, import_fs16.lstatSync)(body.path).size; } else if (typeof body.fd === "number") { return (0, import_fs16.fstatSync)(body.fd).size; } throw new Error(`Body Length computation failed for ${body}`); }, "calculateBodyLength"); } }); // ../../node_modules/.pnpm/@smithy+util-body-length-node@3.0.0/node_modules/@smithy/util-body-length-node/dist-es/index.js var init_dist_es43 = __esm({ "../../node_modules/.pnpm/@smithy+util-body-length-node@3.0.0/node_modules/@smithy/util-body-length-node/dist-es/index.js"() { init_import_meta_url(); init_calculateBodyLength(); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/ruleset.js var u2, v3, w3, x3, a2, b3, c3, d3, e3, f2, g3, h3, i2, j3, k3, l3, m3, n2, o2, p3, q3, r3, s2, t3, _data2, ruleSet2; var init_ruleset = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/ruleset.js"() { init_import_meta_url(); u2 = "required"; v3 = "fn"; w3 = "argv"; x3 = "ref"; a2 = true; b3 = "isSet"; c3 = "booleanEquals"; d3 = "error"; e3 = "endpoint"; f2 = "tree"; g3 = "PartitionResult"; h3 = "getAttr"; i2 = { [u2]: false, "type": "String" }; j3 = { [u2]: true, "default": false, "type": "Boolean" }; k3 = { [x3]: "Endpoint" }; l3 = { [v3]: c3, [w3]: [{ [x3]: "UseFIPS" }, true] }; m3 = { [v3]: c3, [w3]: [{ [x3]: "UseDualStack" }, true] }; n2 = {}; o2 = { [v3]: h3, [w3]: [{ [x3]: g3 }, "supportsFIPS"] }; p3 = { [x3]: g3 }; q3 = { [v3]: c3, [w3]: [true, { [v3]: h3, [w3]: [p3, "supportsDualStack"] }] }; r3 = [l3]; s2 = [m3]; t3 = [{ [x3]: "Region" }]; _data2 = { version: "1.0", parameters: { Region: i2, UseDualStack: j3, UseFIPS: j3, Endpoint: i2 }, rules: [{ conditions: [{ [v3]: b3, [w3]: [k3] }], rules: [{ conditions: r3, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d3 }, { conditions: s2, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d3 }, { endpoint: { url: k3, properties: n2, headers: n2 }, type: e3 }], type: f2 }, { conditions: [{ [v3]: b3, [w3]: t3 }], rules: [{ conditions: [{ [v3]: "aws.partition", [w3]: t3, assign: g3 }], rules: [{ conditions: [l3, m3], rules: [{ conditions: [{ [v3]: c3, [w3]: [a2, o2] }, q3], rules: [{ endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n2, headers: n2 }, type: e3 }], type: f2 }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d3 }], type: f2 }, { conditions: r3, rules: [{ conditions: [{ [v3]: c3, [w3]: [o2, a2] }], rules: [{ conditions: [{ [v3]: "stringEquals", [w3]: [{ [v3]: h3, [w3]: [p3, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://oidc.{Region}.amazonaws.com", properties: n2, headers: n2 }, type: e3 }, { endpoint: { url: "https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n2, headers: n2 }, type: e3 }], type: f2 }, { error: "FIPS is enabled but this partition does not support FIPS", type: d3 }], type: f2 }, { conditions: s2, rules: [{ conditions: [q3], rules: [{ endpoint: { url: "https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n2, headers: n2 }, type: e3 }], type: f2 }, { error: "DualStack is enabled but this partition does not support DualStack", type: d3 }], type: f2 }, { endpoint: { url: "https://oidc.{Region}.{PartitionResult#dnsSuffix}", properties: n2, headers: n2 }, type: e3 }], type: f2 }], type: f2 }, { error: "Invalid Configuration: Missing Region", type: d3 }] }; ruleSet2 = _data2; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/endpointResolver.js var cache3, defaultEndpointResolver2; var init_endpointResolver = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/endpoint/endpointResolver.js"() { init_import_meta_url(); init_dist_es26(); init_dist_es25(); init_ruleset(); cache3 = new EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] }); defaultEndpointResolver2 = /* @__PURE__ */ __name((endpointParams, context2 = {}) => { return cache3.get(endpointParams, () => resolveEndpoint(ruleSet2, { endpointParams, logger: context2.logger })); }, "defaultEndpointResolver"); customEndpointFunctions.aws = awsEndpointFunctions; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.shared.js var getRuntimeConfig; var init_runtimeConfig_shared = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.shared.js"() { init_import_meta_url(); init_dist_es20(); init_dist_es15(); init_dist_es19(); init_dist_es33(); init_dist_es8(); init_dist_es7(); init_httpAuthSchemeProvider(); init_endpointResolver(); getRuntimeConfig = /* @__PURE__ */ __name((config) => { return { apiVersion: "2019-06-10", base64Decoder: config?.base64Decoder ?? fromBase64, base64Encoder: config?.base64Encoder ?? toBase64, disableHostPrefix: config?.disableHostPrefix ?? false, endpointProvider: config?.endpointProvider ?? defaultEndpointResolver2, extensions: config?.extensions ?? [], httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOOIDCHttpAuthSchemeProvider, httpAuthSchemes: config?.httpAuthSchemes ?? [ { schemeId: "aws.auth#sigv4", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), signer: new AwsSdkSigV4Signer() }, { schemeId: "smithy.api#noAuth", identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), signer: new NoAuthSigner() } ], logger: config?.logger ?? new NoOpLogger(), serviceId: config?.serviceId ?? "SSO OIDC", urlParser: config?.urlParser ?? parseUrl, utf8Decoder: config?.utf8Decoder ?? fromUtf8, utf8Encoder: config?.utf8Encoder ?? toUtf8 }; }, "getRuntimeConfig"); } }); // ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js var AWS_EXECUTION_ENV, AWS_REGION_ENV, AWS_DEFAULT_REGION_ENV, ENV_IMDS_DISABLED2, DEFAULTS_MODE_OPTIONS, IMDS_REGION_PATH; var init_constants8 = __esm({ "../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js"() { init_import_meta_url(); AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; AWS_REGION_ENV = "AWS_REGION"; AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; ENV_IMDS_DISABLED2 = "AWS_EC2_METADATA_DISABLED"; DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; IMDS_REGION_PATH = "/latest/meta-data/placement/region"; } }); // ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/defaultsModeConfig.js var AWS_DEFAULTS_MODE_ENV, AWS_DEFAULTS_MODE_CONFIG, NODE_DEFAULTS_MODE_CONFIG_OPTIONS; var init_defaultsModeConfig = __esm({ "../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/defaultsModeConfig.js"() { init_import_meta_url(); AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { environmentVariableSelector: (env6) => { return env6[AWS_DEFAULTS_MODE_ENV]; }, configFileSelector: (profile) => { return profile[AWS_DEFAULTS_MODE_CONFIG]; }, default: "legacy" }; } }); // ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js var resolveDefaultsModeConfig, resolveNodeDefaultsModeAuto, inferPhysicalRegion; var init_resolveDefaultsModeConfig = __esm({ "../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js"() { init_import_meta_url(); init_dist_es28(); init_dist_es31(); init_dist_es16(); init_constants8(); init_defaultsModeConfig(); resolveDefaultsModeConfig = /* @__PURE__ */ __name(({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => memoize(async () => { const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode; switch (mode?.toLowerCase()) { case "auto": return resolveNodeDefaultsModeAuto(region); case "in-region": case "cross-region": case "mobile": case "standard": case "legacy": return Promise.resolve(mode?.toLocaleLowerCase()); case void 0: return Promise.resolve("legacy"); default: throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`); } }), "resolveDefaultsModeConfig"); resolveNodeDefaultsModeAuto = /* @__PURE__ */ __name(async (clientRegion) => { if (clientRegion) { const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion; const inferredRegion = await inferPhysicalRegion(); if (!inferredRegion) { return "standard"; } if (resolvedRegion === inferredRegion) { return "in-region"; } else { return "cross-region"; } } return "standard"; }, "resolveNodeDefaultsModeAuto"); inferPhysicalRegion = /* @__PURE__ */ __name(async () => { if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) { return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV]; } if (!process.env[ENV_IMDS_DISABLED2]) { try { const { getInstanceMetadataEndpoint: getInstanceMetadataEndpoint2, httpRequest: httpRequest2 } = await Promise.resolve().then(() => (init_dist_es39(), dist_es_exports2)); const endpoint = await getInstanceMetadataEndpoint2(); return (await httpRequest2({ ...endpoint, path: IMDS_REGION_PATH })).toString(); } catch (e7) { } } }, "inferPhysicalRegion"); } }); // ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/index.js var init_dist_es44 = __esm({ "../../node_modules/.pnpm/@smithy+util-defaults-mode-node@3.0.34/node_modules/@smithy/util-defaults-mode-node/dist-es/index.js"() { init_import_meta_url(); init_resolveDefaultsModeConfig(); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.js var getRuntimeConfig2; var init_runtimeConfig = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeConfig.js"() { init_import_meta_url(); init_package(); init_dist_es20(); init_dist_es54(); init_dist_es41(); init_dist_es28(); init_dist_es42(); init_dist_es37(); init_dist_es31(); init_dist_es11(); init_dist_es43(); init_dist_es36(); init_runtimeConfig_shared(); init_dist_es19(); init_dist_es44(); init_dist_es19(); getRuntimeConfig2 = /* @__PURE__ */ __name((config) => { emitWarningIfUnsupportedVersion2(process.version); const defaultsMode = resolveDefaultsModeConfig(config); const defaultConfigProvider = /* @__PURE__ */ __name(() => defaultsMode().then(loadConfigsForDefaultMode), "defaultConfigProvider"); const clientSharedValues = getRuntimeConfig(config); emitWarningIfUnsupportedVersion(process.version); const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, runtime: "node", defaultsMode, bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default2.version }), maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? loadConfig({ ...NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig) }; }, "getRuntimeConfig"); } }); // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js var getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration; var init_extensions4 = __esm({ "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js"() { init_import_meta_url(); getAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { let runtimeConfigRegion = /* @__PURE__ */ __name(async () => { if (runtimeConfig.region === void 0) { throw new Error("Region is missing from runtimeConfig"); } const region = runtimeConfig.region; if (typeof region === "string") { return region; } return region(); }, "runtimeConfigRegion"); return { setRegion(region) { runtimeConfigRegion = region; }, region() { return runtimeConfigRegion; } }; }, "getAwsRegionExtensionConfiguration"); resolveAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((awsRegionExtensionConfiguration) => { return { region: awsRegionExtensionConfiguration.region() }; }, "resolveAwsRegionExtensionConfiguration"); } }); // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/config.js var init_config4 = __esm({ "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/config.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/isFipsRegion.js var init_isFipsRegion2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/isFipsRegion.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/getRealRegion.js var init_getRealRegion2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/getRealRegion.js"() { init_import_meta_url(); init_isFipsRegion2(); } }); // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/resolveRegionConfig.js var init_resolveRegionConfig2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/resolveRegionConfig.js"() { init_import_meta_url(); init_getRealRegion2(); init_isFipsRegion2(); } }); // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/index.js var init_regionConfig2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/index.js"() { init_import_meta_url(); init_config4(); init_resolveRegionConfig2(); } }); // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/index.js var init_dist_es45 = __esm({ "../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.714.0/node_modules/@aws-sdk/region-config-resolver/dist-es/index.js"() { init_import_meta_url(); init_extensions4(); init_regionConfig2(); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/auth/httpAuthExtensionConfiguration.js var getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig; var init_httpAuthExtensionConfiguration = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/auth/httpAuthExtensionConfiguration.js"() { init_import_meta_url(); getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => { const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; let _credentials = runtimeConfig.credentials; return { setHttpAuthScheme(httpAuthScheme) { const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); if (index === -1) { _httpAuthSchemes.push(httpAuthScheme); } else { _httpAuthSchemes.splice(index, 1, httpAuthScheme); } }, httpAuthSchemes() { return _httpAuthSchemes; }, setHttpAuthSchemeProvider(httpAuthSchemeProvider) { _httpAuthSchemeProvider = httpAuthSchemeProvider; }, httpAuthSchemeProvider() { return _httpAuthSchemeProvider; }, setCredentials(credentials) { _credentials = credentials; }, credentials() { return _credentials; } }; }, "getHttpAuthExtensionConfiguration"); resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => { return { httpAuthSchemes: config.httpAuthSchemes(), httpAuthSchemeProvider: config.httpAuthSchemeProvider(), credentials: config.credentials() }; }, "resolveHttpAuthRuntimeConfig"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeExtensions.js var asPartial, resolveRuntimeExtensions; var init_runtimeExtensions = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/runtimeExtensions.js"() { init_import_meta_url(); init_dist_es45(); init_dist_es2(); init_dist_es19(); init_httpAuthExtensionConfiguration(); asPartial = /* @__PURE__ */ __name((t7) => t7, "asPartial"); resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => { const extensionConfiguration = { ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)), ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)), ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)), ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)) }; extensions.forEach((extension) => extension.configure(extensionConfiguration)); return { ...runtimeConfig, ...resolveAwsRegionExtensionConfiguration(extensionConfiguration), ...resolveDefaultRuntimeConfig(extensionConfiguration), ...resolveHttpHandlerRuntimeConfig(extensionConfiguration), ...resolveHttpAuthRuntimeConfig(extensionConfiguration) }; }, "resolveRuntimeExtensions"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDCClient.js var SSOOIDCClient; var init_SSOOIDCClient = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDCClient.js"() { init_import_meta_url(); init_dist_es21(); init_dist_es22(); init_dist_es23(); init_dist_es27(); init_dist_es28(); init_dist_es15(); init_dist_es29(); init_dist_es34(); init_dist_es37(); init_dist_es19(); init_httpAuthSchemeProvider(); init_EndpointParameters(); init_runtimeConfig(); init_runtimeExtensions(); SSOOIDCClient = class extends Client { constructor(...[configuration]) { const _config_0 = getRuntimeConfig2(configuration || {}); const _config_1 = resolveClientEndpointParameters2(_config_0); const _config_2 = resolveUserAgentConfig(_config_1); const _config_3 = resolveRetryConfig(_config_2); const _config_4 = resolveRegionConfig(_config_3); const _config_5 = resolveHostHeaderConfig(_config_4); const _config_6 = resolveEndpointConfig(_config_5); const _config_7 = resolveHttpAuthSchemeConfig2(_config_6); const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); super(_config_8); this.config = _config_8; this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { httpAuthSchemeParametersProvider: defaultSSOOIDCHttpAuthSchemeParametersProvider, identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({ "aws.auth#sigv4": config.credentials }) })); this.middlewareStack.use(getHttpSigningPlugin(this.config)); } destroy() { super.destroy(); } }; __name(SSOOIDCClient, "SSOOIDCClient"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/SSOOIDCServiceException.js var SSOOIDCServiceException; var init_SSOOIDCServiceException = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/SSOOIDCServiceException.js"() { init_import_meta_url(); init_dist_es19(); SSOOIDCServiceException = class extends ServiceException { constructor(options32) { super(options32); Object.setPrototypeOf(this, SSOOIDCServiceException.prototype); } }; __name(SSOOIDCServiceException, "SSOOIDCServiceException"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/models_0.js var AccessDeniedException, AuthorizationPendingException, ExpiredTokenException, InternalServerException, InvalidClientException, InvalidGrantException, InvalidRequestException, InvalidScopeException, SlowDownException, UnauthorizedClientException, UnsupportedGrantTypeException, InvalidRequestRegionException, InvalidClientMetadataException, InvalidRedirectUriException, CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog, CreateTokenWithIAMRequestFilterSensitiveLog, CreateTokenWithIAMResponseFilterSensitiveLog, RegisterClientResponseFilterSensitiveLog, StartDeviceAuthorizationRequestFilterSensitiveLog; var init_models_0 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/models_0.js"() { init_import_meta_url(); init_dist_es19(); init_SSOOIDCServiceException(); AccessDeniedException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "AccessDeniedException", $fault: "client", ...opts }); this.name = "AccessDeniedException"; this.$fault = "client"; Object.setPrototypeOf(this, AccessDeniedException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(AccessDeniedException, "AccessDeniedException"); AuthorizationPendingException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "AuthorizationPendingException", $fault: "client", ...opts }); this.name = "AuthorizationPendingException"; this.$fault = "client"; Object.setPrototypeOf(this, AuthorizationPendingException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(AuthorizationPendingException, "AuthorizationPendingException"); ExpiredTokenException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "ExpiredTokenException", $fault: "client", ...opts }); this.name = "ExpiredTokenException"; this.$fault = "client"; Object.setPrototypeOf(this, ExpiredTokenException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(ExpiredTokenException, "ExpiredTokenException"); InternalServerException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "InternalServerException", $fault: "server", ...opts }); this.name = "InternalServerException"; this.$fault = "server"; Object.setPrototypeOf(this, InternalServerException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(InternalServerException, "InternalServerException"); InvalidClientException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "InvalidClientException", $fault: "client", ...opts }); this.name = "InvalidClientException"; this.$fault = "client"; Object.setPrototypeOf(this, InvalidClientException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(InvalidClientException, "InvalidClientException"); InvalidGrantException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "InvalidGrantException", $fault: "client", ...opts }); this.name = "InvalidGrantException"; this.$fault = "client"; Object.setPrototypeOf(this, InvalidGrantException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(InvalidGrantException, "InvalidGrantException"); InvalidRequestException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "InvalidRequestException", $fault: "client", ...opts }); this.name = "InvalidRequestException"; this.$fault = "client"; Object.setPrototypeOf(this, InvalidRequestException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(InvalidRequestException, "InvalidRequestException"); InvalidScopeException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "InvalidScopeException", $fault: "client", ...opts }); this.name = "InvalidScopeException"; this.$fault = "client"; Object.setPrototypeOf(this, InvalidScopeException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(InvalidScopeException, "InvalidScopeException"); SlowDownException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "SlowDownException", $fault: "client", ...opts }); this.name = "SlowDownException"; this.$fault = "client"; Object.setPrototypeOf(this, SlowDownException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(SlowDownException, "SlowDownException"); UnauthorizedClientException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "UnauthorizedClientException", $fault: "client", ...opts }); this.name = "UnauthorizedClientException"; this.$fault = "client"; Object.setPrototypeOf(this, UnauthorizedClientException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(UnauthorizedClientException, "UnauthorizedClientException"); UnsupportedGrantTypeException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "UnsupportedGrantTypeException", $fault: "client", ...opts }); this.name = "UnsupportedGrantTypeException"; this.$fault = "client"; Object.setPrototypeOf(this, UnsupportedGrantTypeException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(UnsupportedGrantTypeException, "UnsupportedGrantTypeException"); InvalidRequestRegionException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "InvalidRequestRegionException", $fault: "client", ...opts }); this.name = "InvalidRequestRegionException"; this.$fault = "client"; Object.setPrototypeOf(this, InvalidRequestRegionException.prototype); this.error = opts.error; this.error_description = opts.error_description; this.endpoint = opts.endpoint; this.region = opts.region; } }; __name(InvalidRequestRegionException, "InvalidRequestRegionException"); InvalidClientMetadataException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "InvalidClientMetadataException", $fault: "client", ...opts }); this.name = "InvalidClientMetadataException"; this.$fault = "client"; Object.setPrototypeOf(this, InvalidClientMetadataException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(InvalidClientMetadataException, "InvalidClientMetadataException"); InvalidRedirectUriException = class extends SSOOIDCServiceException { constructor(opts) { super({ name: "InvalidRedirectUriException", $fault: "client", ...opts }); this.name = "InvalidRedirectUriException"; this.$fault = "client"; Object.setPrototypeOf(this, InvalidRedirectUriException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; __name(InvalidRedirectUriException, "InvalidRedirectUriException"); CreateTokenRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.clientSecret && { clientSecret: SENSITIVE_STRING }, ...obj.refreshToken && { refreshToken: SENSITIVE_STRING }, ...obj.codeVerifier && { codeVerifier: SENSITIVE_STRING } }), "CreateTokenRequestFilterSensitiveLog"); CreateTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.accessToken && { accessToken: SENSITIVE_STRING }, ...obj.refreshToken && { refreshToken: SENSITIVE_STRING }, ...obj.idToken && { idToken: SENSITIVE_STRING } }), "CreateTokenResponseFilterSensitiveLog"); CreateTokenWithIAMRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.refreshToken && { refreshToken: SENSITIVE_STRING }, ...obj.assertion && { assertion: SENSITIVE_STRING }, ...obj.subjectToken && { subjectToken: SENSITIVE_STRING }, ...obj.codeVerifier && { codeVerifier: SENSITIVE_STRING } }), "CreateTokenWithIAMRequestFilterSensitiveLog"); CreateTokenWithIAMResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.accessToken && { accessToken: SENSITIVE_STRING }, ...obj.refreshToken && { refreshToken: SENSITIVE_STRING }, ...obj.idToken && { idToken: SENSITIVE_STRING } }), "CreateTokenWithIAMResponseFilterSensitiveLog"); RegisterClientResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.clientSecret && { clientSecret: SENSITIVE_STRING } }), "RegisterClientResponseFilterSensitiveLog"); StartDeviceAuthorizationRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.clientSecret && { clientSecret: SENSITIVE_STRING } }), "StartDeviceAuthorizationRequestFilterSensitiveLog"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/protocols/Aws_restJson1.js var se_CreateTokenCommand, se_CreateTokenWithIAMCommand, se_RegisterClientCommand, se_StartDeviceAuthorizationCommand, de_CreateTokenCommand, de_CreateTokenWithIAMCommand, de_RegisterClientCommand, de_StartDeviceAuthorizationCommand, de_CommandError2, throwDefaultError3, de_AccessDeniedExceptionRes, de_AuthorizationPendingExceptionRes, de_ExpiredTokenExceptionRes, de_InternalServerExceptionRes, de_InvalidClientExceptionRes, de_InvalidClientMetadataExceptionRes, de_InvalidGrantExceptionRes, de_InvalidRedirectUriExceptionRes, de_InvalidRequestExceptionRes, de_InvalidRequestRegionExceptionRes, de_InvalidScopeExceptionRes, de_SlowDownExceptionRes, de_UnauthorizedClientExceptionRes, de_UnsupportedGrantTypeExceptionRes, deserializeMetadata3, _ai; var init_Aws_restJson1 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/protocols/Aws_restJson1.js"() { init_import_meta_url(); init_dist_es20(); init_dist_es15(); init_dist_es19(); init_models_0(); init_SSOOIDCServiceException(); se_CreateTokenCommand = /* @__PURE__ */ __name(async (input, context2) => { const b6 = requestBuilder(input, context2); const headers = { "content-type": "application/json" }; b6.bp("/token"); let body; body = JSON.stringify(take(input, { clientId: [], clientSecret: [], code: [], codeVerifier: [], deviceCode: [], grantType: [], redirectUri: [], refreshToken: [], scope: (_4) => _json(_4) })); b6.m("POST").h(headers).b(body); return b6.build(); }, "se_CreateTokenCommand"); se_CreateTokenWithIAMCommand = /* @__PURE__ */ __name(async (input, context2) => { const b6 = requestBuilder(input, context2); const headers = { "content-type": "application/json" }; b6.bp("/token"); const query = map({ [_ai]: [, "t"] }); let body; body = JSON.stringify(take(input, { assertion: [], clientId: [], code: [], codeVerifier: [], grantType: [], redirectUri: [], refreshToken: [], requestedTokenType: [], scope: (_4) => _json(_4), subjectToken: [], subjectTokenType: [] })); b6.m("POST").h(headers).q(query).b(body); return b6.build(); }, "se_CreateTokenWithIAMCommand"); se_RegisterClientCommand = /* @__PURE__ */ __name(async (input, context2) => { const b6 = requestBuilder(input, context2); const headers = { "content-type": "application/json" }; b6.bp("/client/register"); let body; body = JSON.stringify(take(input, { clientName: [], clientType: [], entitledApplicationArn: [], grantTypes: (_4) => _json(_4), issuerUrl: [], redirectUris: (_4) => _json(_4), scopes: (_4) => _json(_4) })); b6.m("POST").h(headers).b(body); return b6.build(); }, "se_RegisterClientCommand"); se_StartDeviceAuthorizationCommand = /* @__PURE__ */ __name(async (input, context2) => { const b6 = requestBuilder(input, context2); const headers = { "content-type": "application/json" }; b6.bp("/device_authorization"); let body; body = JSON.stringify(take(input, { clientId: [], clientSecret: [], startUrl: [] })); b6.m("POST").h(headers).b(body); return b6.build(); }, "se_StartDeviceAuthorizationCommand"); de_CreateTokenCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError2(output, context2); } const contents = map({ $metadata: deserializeMetadata3(output) }); const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body"); const doc = take(data, { accessToken: expectString, expiresIn: expectInt32, idToken: expectString, refreshToken: expectString, tokenType: expectString }); Object.assign(contents, doc); return contents; }, "de_CreateTokenCommand"); de_CreateTokenWithIAMCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError2(output, context2); } const contents = map({ $metadata: deserializeMetadata3(output) }); const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body"); const doc = take(data, { accessToken: expectString, expiresIn: expectInt32, idToken: expectString, issuedTokenType: expectString, refreshToken: expectString, scope: _json, tokenType: expectString }); Object.assign(contents, doc); return contents; }, "de_CreateTokenWithIAMCommand"); de_RegisterClientCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError2(output, context2); } const contents = map({ $metadata: deserializeMetadata3(output) }); const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body"); const doc = take(data, { authorizationEndpoint: expectString, clientId: expectString, clientIdIssuedAt: expectLong, clientSecret: expectString, clientSecretExpiresAt: expectLong, tokenEndpoint: expectString }); Object.assign(contents, doc); return contents; }, "de_RegisterClientCommand"); de_StartDeviceAuthorizationCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError2(output, context2); } const contents = map({ $metadata: deserializeMetadata3(output) }); const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body"); const doc = take(data, { deviceCode: expectString, expiresIn: expectInt32, interval: expectInt32, userCode: expectString, verificationUri: expectString, verificationUriComplete: expectString }); Object.assign(contents, doc); return contents; }, "de_StartDeviceAuthorizationCommand"); de_CommandError2 = /* @__PURE__ */ __name(async (output, context2) => { const parsedOutput = { ...output, body: await parseJsonErrorBody(output.body, context2) }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "AccessDeniedException": case "com.amazonaws.ssooidc#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context2); case "AuthorizationPendingException": case "com.amazonaws.ssooidc#AuthorizationPendingException": throw await de_AuthorizationPendingExceptionRes(parsedOutput, context2); case "ExpiredTokenException": case "com.amazonaws.ssooidc#ExpiredTokenException": throw await de_ExpiredTokenExceptionRes(parsedOutput, context2); case "InternalServerException": case "com.amazonaws.ssooidc#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context2); case "InvalidClientException": case "com.amazonaws.ssooidc#InvalidClientException": throw await de_InvalidClientExceptionRes(parsedOutput, context2); case "InvalidGrantException": case "com.amazonaws.ssooidc#InvalidGrantException": throw await de_InvalidGrantExceptionRes(parsedOutput, context2); case "InvalidRequestException": case "com.amazonaws.ssooidc#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context2); case "InvalidScopeException": case "com.amazonaws.ssooidc#InvalidScopeException": throw await de_InvalidScopeExceptionRes(parsedOutput, context2); case "SlowDownException": case "com.amazonaws.ssooidc#SlowDownException": throw await de_SlowDownExceptionRes(parsedOutput, context2); case "UnauthorizedClientException": case "com.amazonaws.ssooidc#UnauthorizedClientException": throw await de_UnauthorizedClientExceptionRes(parsedOutput, context2); case "UnsupportedGrantTypeException": case "com.amazonaws.ssooidc#UnsupportedGrantTypeException": throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context2); case "InvalidRequestRegionException": case "com.amazonaws.ssooidc#InvalidRequestRegionException": throw await de_InvalidRequestRegionExceptionRes(parsedOutput, context2); case "InvalidClientMetadataException": case "com.amazonaws.ssooidc#InvalidClientMetadataException": throw await de_InvalidClientMetadataExceptionRes(parsedOutput, context2); case "InvalidRedirectUriException": case "com.amazonaws.ssooidc#InvalidRedirectUriException": throw await de_InvalidRedirectUriExceptionRes(parsedOutput, context2); default: const parsedBody = parsedOutput.body; return throwDefaultError3({ output, parsedBody, errorCode }); } }, "de_CommandError"); throwDefaultError3 = withBaseException(SSOOIDCServiceException); de_AccessDeniedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new AccessDeniedException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_AccessDeniedExceptionRes"); de_AuthorizationPendingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new AuthorizationPendingException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_AuthorizationPendingExceptionRes"); de_ExpiredTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new ExpiredTokenException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_ExpiredTokenExceptionRes"); de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new InternalServerException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_InternalServerExceptionRes"); de_InvalidClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new InvalidClientException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_InvalidClientExceptionRes"); de_InvalidClientMetadataExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new InvalidClientMetadataException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_InvalidClientMetadataExceptionRes"); de_InvalidGrantExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new InvalidGrantException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_InvalidGrantExceptionRes"); de_InvalidRedirectUriExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new InvalidRedirectUriException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_InvalidRedirectUriExceptionRes"); de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new InvalidRequestException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_InvalidRequestExceptionRes"); de_InvalidRequestRegionExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { endpoint: expectString, error: expectString, error_description: expectString, region: expectString }); Object.assign(contents, doc); const exception = new InvalidRequestRegionException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_InvalidRequestRegionExceptionRes"); de_InvalidScopeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new InvalidScopeException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_InvalidScopeExceptionRes"); de_SlowDownExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new SlowDownException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_SlowDownExceptionRes"); de_UnauthorizedClientExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new UnauthorizedClientException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_UnauthorizedClientExceptionRes"); de_UnsupportedGrantTypeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { error: expectString, error_description: expectString }); Object.assign(contents, doc); const exception = new UnsupportedGrantTypeException({ $metadata: deserializeMetadata3(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_UnsupportedGrantTypeExceptionRes"); deserializeMetadata3 = /* @__PURE__ */ __name((output) => ({ httpStatusCode: output.statusCode, requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], extendedRequestId: output.headers["x-amz-id-2"], cfId: output.headers["x-amz-cf-id"] }), "deserializeMetadata"); _ai = "aws_iam"; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenCommand.js var CreateTokenCommand; var init_CreateTokenCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters(); init_models_0(); init_Aws_restJson1(); CreateTokenCommand = class extends Command.classBuilder().ep(commonParams2).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").f(CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog).ser(se_CreateTokenCommand).de(de_CreateTokenCommand).build() { }; __name(CreateTokenCommand, "CreateTokenCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenWithIAMCommand.js var CreateTokenWithIAMCommand; var init_CreateTokenWithIAMCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/CreateTokenWithIAMCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters(); init_models_0(); init_Aws_restJson1(); CreateTokenWithIAMCommand = class extends Command.classBuilder().ep(commonParams2).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSSOOIDCService", "CreateTokenWithIAM", {}).n("SSOOIDCClient", "CreateTokenWithIAMCommand").f(CreateTokenWithIAMRequestFilterSensitiveLog, CreateTokenWithIAMResponseFilterSensitiveLog).ser(se_CreateTokenWithIAMCommand).de(de_CreateTokenWithIAMCommand).build() { }; __name(CreateTokenWithIAMCommand, "CreateTokenWithIAMCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/RegisterClientCommand.js var RegisterClientCommand; var init_RegisterClientCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/RegisterClientCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters(); init_models_0(); init_Aws_restJson1(); RegisterClientCommand = class extends Command.classBuilder().ep(commonParams2).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSSOOIDCService", "RegisterClient", {}).n("SSOOIDCClient", "RegisterClientCommand").f(void 0, RegisterClientResponseFilterSensitiveLog).ser(se_RegisterClientCommand).de(de_RegisterClientCommand).build() { }; __name(RegisterClientCommand, "RegisterClientCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/StartDeviceAuthorizationCommand.js var StartDeviceAuthorizationCommand; var init_StartDeviceAuthorizationCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/StartDeviceAuthorizationCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters(); init_models_0(); init_Aws_restJson1(); StartDeviceAuthorizationCommand = class extends Command.classBuilder().ep(commonParams2).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSSOOIDCService", "StartDeviceAuthorization", {}).n("SSOOIDCClient", "StartDeviceAuthorizationCommand").f(StartDeviceAuthorizationRequestFilterSensitiveLog, void 0).ser(se_StartDeviceAuthorizationCommand).de(de_StartDeviceAuthorizationCommand).build() { }; __name(StartDeviceAuthorizationCommand, "StartDeviceAuthorizationCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDC.js var commands, SSOOIDC; var init_SSOOIDC = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/SSOOIDC.js"() { init_import_meta_url(); init_dist_es19(); init_CreateTokenCommand(); init_CreateTokenWithIAMCommand(); init_RegisterClientCommand(); init_StartDeviceAuthorizationCommand(); init_SSOOIDCClient(); commands = { CreateTokenCommand, CreateTokenWithIAMCommand, RegisterClientCommand, StartDeviceAuthorizationCommand }; SSOOIDC = class extends SSOOIDCClient { }; __name(SSOOIDC, "SSOOIDC"); createAggregatedClient(commands, SSOOIDC); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/index.js var init_commands = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/commands/index.js"() { init_import_meta_url(); init_CreateTokenCommand(); init_CreateTokenWithIAMCommand(); init_RegisterClientCommand(); init_StartDeviceAuthorizationCommand(); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/index.js var init_models = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/models/index.js"() { init_import_meta_url(); init_models_0(); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/index.js var dist_es_exports4 = {}; __export(dist_es_exports4, { $Command: () => Command, AccessDeniedException: () => AccessDeniedException, AuthorizationPendingException: () => AuthorizationPendingException, CreateTokenCommand: () => CreateTokenCommand, CreateTokenRequestFilterSensitiveLog: () => CreateTokenRequestFilterSensitiveLog, CreateTokenResponseFilterSensitiveLog: () => CreateTokenResponseFilterSensitiveLog, CreateTokenWithIAMCommand: () => CreateTokenWithIAMCommand, CreateTokenWithIAMRequestFilterSensitiveLog: () => CreateTokenWithIAMRequestFilterSensitiveLog, CreateTokenWithIAMResponseFilterSensitiveLog: () => CreateTokenWithIAMResponseFilterSensitiveLog, ExpiredTokenException: () => ExpiredTokenException, InternalServerException: () => InternalServerException, InvalidClientException: () => InvalidClientException, InvalidClientMetadataException: () => InvalidClientMetadataException, InvalidGrantException: () => InvalidGrantException, InvalidRedirectUriException: () => InvalidRedirectUriException, InvalidRequestException: () => InvalidRequestException, InvalidRequestRegionException: () => InvalidRequestRegionException, InvalidScopeException: () => InvalidScopeException, RegisterClientCommand: () => RegisterClientCommand, RegisterClientResponseFilterSensitiveLog: () => RegisterClientResponseFilterSensitiveLog, SSOOIDC: () => SSOOIDC, SSOOIDCClient: () => SSOOIDCClient, SSOOIDCServiceException: () => SSOOIDCServiceException, SlowDownException: () => SlowDownException, StartDeviceAuthorizationCommand: () => StartDeviceAuthorizationCommand, StartDeviceAuthorizationRequestFilterSensitiveLog: () => StartDeviceAuthorizationRequestFilterSensitiveLog, UnauthorizedClientException: () => UnauthorizedClientException, UnsupportedGrantTypeException: () => UnsupportedGrantTypeException, __Client: () => Client }); var init_dist_es46 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sso-oidc/dist-es/index.js"() { init_import_meta_url(); init_SSOOIDCClient(); init_SSOOIDC(); init_commands(); init_models(); init_SSOOIDCServiceException(); } }); // ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js var getSsoOidcClient; var init_getSsoOidcClient = __esm({ "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js"() { init_import_meta_url(); getSsoOidcClient = /* @__PURE__ */ __name(async (ssoRegion, init2 = {}) => { const { SSOOIDCClient: SSOOIDCClient2 } = await Promise.resolve().then(() => (init_dist_es46(), dist_es_exports4)); const ssoOidcClient = new SSOOIDCClient2(Object.assign({}, init2.clientConfig ?? {}, { region: ssoRegion ?? init2.clientConfig?.region, logger: init2.clientConfig?.logger ?? init2.parentClientConfig?.logger })); return ssoOidcClient; }, "getSsoOidcClient"); } }); // ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js var getNewSsoOidcToken; var init_getNewSsoOidcToken = __esm({ "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js"() { init_import_meta_url(); init_getSsoOidcClient(); getNewSsoOidcToken = /* @__PURE__ */ __name(async (ssoToken, ssoRegion, init2 = {}) => { const { CreateTokenCommand: CreateTokenCommand2 } = await Promise.resolve().then(() => (init_dist_es46(), dist_es_exports4)); const ssoOidcClient = await getSsoOidcClient(ssoRegion, init2); return ssoOidcClient.send(new CreateTokenCommand2({ clientId: ssoToken.clientId, clientSecret: ssoToken.clientSecret, refreshToken: ssoToken.refreshToken, grantType: "refresh_token" })); }, "getNewSsoOidcToken"); } }); // ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js var validateTokenExpiry; var init_validateTokenExpiry = __esm({ "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js"() { init_import_meta_url(); init_dist_es16(); init_constants7(); validateTokenExpiry = /* @__PURE__ */ __name((token) => { if (token.expiration && token.expiration.getTime() < Date.now()) { throw new TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false); } }, "validateTokenExpiry"); } }); // ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js var validateTokenKey; var init_validateTokenKey = __esm({ "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js"() { init_import_meta_url(); init_dist_es16(); init_constants7(); validateTokenKey = /* @__PURE__ */ __name((key, value, forRefresh = false) => { if (typeof value === "undefined") { throw new TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false); } }, "validateTokenKey"); } }); // ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js var import_fs17, writeFile7, writeSSOTokenToFile; var init_writeSSOTokenToFile = __esm({ "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js"() { init_import_meta_url(); init_dist_es30(); import_fs17 = require("fs"); ({ writeFile: writeFile7 } = import_fs17.promises); writeSSOTokenToFile = /* @__PURE__ */ __name((id, ssoToken) => { const tokenFilepath = getSSOTokenFilepath(id); const tokenString = JSON.stringify(ssoToken, null, 2); return writeFile7(tokenFilepath, tokenString); }, "writeSSOTokenToFile"); } }); // ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js var lastRefreshAttemptTime, fromSso; var init_fromSso = __esm({ "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js"() { init_import_meta_url(); init_dist_es16(); init_dist_es30(); init_constants7(); init_getNewSsoOidcToken(); init_validateTokenExpiry(); init_validateTokenKey(); init_writeSSOTokenToFile(); lastRefreshAttemptTime = /* @__PURE__ */ new Date(0); fromSso = /* @__PURE__ */ __name((_init = {}) => async ({ callerClientConfig } = {}) => { const init2 = { ..._init, parentClientConfig: { ...callerClientConfig, ..._init.parentClientConfig } }; init2.logger?.debug("@aws-sdk/token-providers - fromSso"); const profiles = await parseKnownFiles(init2); const profileName = getProfileName({ profile: init2.profile ?? callerClientConfig?.profile }); const profile = profiles[profileName]; if (!profile) { throw new TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false); } else if (!profile["sso_session"]) { throw new TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`); } const ssoSessionName = profile["sso_session"]; const ssoSessions = await loadSsoSessionData(init2); const ssoSession = ssoSessions[ssoSessionName]; if (!ssoSession) { throw new TokenProviderError(`Sso session '${ssoSessionName}' could not be found in shared credentials file.`, false); } for (const ssoSessionRequiredKey of ["sso_start_url", "sso_region"]) { if (!ssoSession[ssoSessionRequiredKey]) { throw new TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false); } } const ssoStartUrl = ssoSession["sso_start_url"]; const ssoRegion = ssoSession["sso_region"]; let ssoToken; try { ssoToken = await getSSOTokenFromFile(ssoSessionName); } catch (e7) { throw new TokenProviderError(`The SSO session token associated with profile=${profileName} was not found or is invalid. ${REFRESH_MESSAGE}`, false); } validateTokenKey("accessToken", ssoToken.accessToken); validateTokenKey("expiresAt", ssoToken.expiresAt); const { accessToken, expiresAt } = ssoToken; const existingToken = { token: accessToken, expiration: new Date(expiresAt) }; if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) { return existingToken; } if (Date.now() - lastRefreshAttemptTime.getTime() < 30 * 1e3) { validateTokenExpiry(existingToken); return existingToken; } validateTokenKey("clientId", ssoToken.clientId, true); validateTokenKey("clientSecret", ssoToken.clientSecret, true); validateTokenKey("refreshToken", ssoToken.refreshToken, true); try { lastRefreshAttemptTime.setTime(Date.now()); const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init2); validateTokenKey("accessToken", newSsoOidcToken.accessToken); validateTokenKey("expiresIn", newSsoOidcToken.expiresIn); const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3); try { await writeSSOTokenToFile(ssoSessionName, { ...ssoToken, accessToken: newSsoOidcToken.accessToken, expiresAt: newTokenExpiration.toISOString(), refreshToken: newSsoOidcToken.refreshToken }); } catch (error2) { } return { token: newSsoOidcToken.accessToken, expiration: newTokenExpiration }; } catch (error2) { validateTokenExpiry(existingToken); return existingToken; } }, "fromSso"); } }); // ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js var init_fromStatic3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js"() { init_import_meta_url(); init_dist_es16(); } }); // ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js var init_nodeProvider = __esm({ "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js"() { init_import_meta_url(); init_dist_es16(); } }); // ../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/index.js var init_dist_es47 = __esm({ "../../node_modules/.pnpm/@aws-sdk+token-providers@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/token-providers/dist-es/index.js"() { init_import_meta_url(); init_fromSso(); init_fromStatic3(); init_nodeProvider(); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthSchemeProvider.js function createAwsAuthSigv4HttpAuthOption3(authParameters) { return { schemeId: "aws.auth#sigv4", signingProperties: { name: "awsssoportal", region: authParameters.region }, propertiesExtractor: (config, context2) => ({ signingProperties: { config, context: context2 } }) }; } function createSmithyApiNoAuthHttpAuthOption2(authParameters) { return { schemeId: "smithy.api#noAuth" }; } var defaultSSOHttpAuthSchemeParametersProvider, defaultSSOHttpAuthSchemeProvider, resolveHttpAuthSchemeConfig3; var init_httpAuthSchemeProvider2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthSchemeProvider.js"() { init_import_meta_url(); init_dist_es20(); init_dist_es3(); defaultSSOHttpAuthSchemeParametersProvider = /* @__PURE__ */ __name(async (config, context2, input) => { return { operation: getSmithyContext(context2).operation, region: await normalizeProvider(config.region)() || (() => { throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); })() }; }, "defaultSSOHttpAuthSchemeParametersProvider"); __name(createAwsAuthSigv4HttpAuthOption3, "createAwsAuthSigv4HttpAuthOption"); __name(createSmithyApiNoAuthHttpAuthOption2, "createSmithyApiNoAuthHttpAuthOption"); defaultSSOHttpAuthSchemeProvider = /* @__PURE__ */ __name((authParameters) => { const options32 = []; switch (authParameters.operation) { case "GetRoleCredentials": { options32.push(createSmithyApiNoAuthHttpAuthOption2(authParameters)); break; } case "ListAccountRoles": { options32.push(createSmithyApiNoAuthHttpAuthOption2(authParameters)); break; } case "ListAccounts": { options32.push(createSmithyApiNoAuthHttpAuthOption2(authParameters)); break; } case "Logout": { options32.push(createSmithyApiNoAuthHttpAuthOption2(authParameters)); break; } default: { options32.push(createAwsAuthSigv4HttpAuthOption3(authParameters)); } } return options32; }, "defaultSSOHttpAuthSchemeProvider"); resolveHttpAuthSchemeConfig3 = /* @__PURE__ */ __name((config) => { const config_0 = resolveAwsSdkSigV4Config(config); return { ...config_0 }; }, "resolveHttpAuthSchemeConfig"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/EndpointParameters.js var resolveClientEndpointParameters3, commonParams3; var init_EndpointParameters2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/EndpointParameters.js"() { init_import_meta_url(); resolveClientEndpointParameters3 = /* @__PURE__ */ __name((options32) => { return { ...options32, useDualstackEndpoint: options32.useDualstackEndpoint ?? false, useFipsEndpoint: options32.useFipsEndpoint ?? false, defaultSigningName: "awsssoportal" }; }, "resolveClientEndpointParameters"); commonParams3 = { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, Endpoint: { type: "builtInParams", name: "endpoint" }, Region: { type: "builtInParams", name: "region" }, UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } }; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/package.json var package_default3; var init_package2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/package.json"() { package_default3 = { name: "@aws-sdk/client-sso", description: "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native", version: "3.721.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "node ../../scripts/compilation/inline client-sso", "build:es": "tsc -p tsconfig.es.json", "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", clean: "rimraf ./dist-* && rimraf *.tsbuildinfo", "extract:docs": "api-extractor run --local", "generate:client": "node ../../scripts/generate-clients/single-service --solo sso" }, main: "./dist-cjs/index.js", types: "./dist-types/index.d.ts", module: "./dist-es/index.js", sideEffects: false, dependencies: { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/core": "3.716.0", "@aws-sdk/middleware-host-header": "3.714.0", "@aws-sdk/middleware-logger": "3.714.0", "@aws-sdk/middleware-recursion-detection": "3.714.0", "@aws-sdk/middleware-user-agent": "3.721.0", "@aws-sdk/region-config-resolver": "3.714.0", "@aws-sdk/types": "3.714.0", "@aws-sdk/util-endpoints": "3.714.0", "@aws-sdk/util-user-agent-browser": "3.714.0", "@aws-sdk/util-user-agent-node": "3.721.0", "@smithy/config-resolver": "^3.0.13", "@smithy/core": "^2.5.5", "@smithy/fetch-http-handler": "^4.1.2", "@smithy/hash-node": "^3.0.11", "@smithy/invalid-dependency": "^3.0.11", "@smithy/middleware-content-length": "^3.0.13", "@smithy/middleware-endpoint": "^3.2.6", "@smithy/middleware-retry": "^3.0.31", "@smithy/middleware-serde": "^3.0.11", "@smithy/middleware-stack": "^3.0.11", "@smithy/node-config-provider": "^3.1.12", "@smithy/node-http-handler": "^3.3.2", "@smithy/protocol-http": "^4.1.8", "@smithy/smithy-client": "^3.5.1", "@smithy/types": "^3.7.2", "@smithy/url-parser": "^3.0.11", "@smithy/util-base64": "^3.0.0", "@smithy/util-body-length-browser": "^3.0.0", "@smithy/util-body-length-node": "^3.0.0", "@smithy/util-defaults-mode-browser": "^3.0.31", "@smithy/util-defaults-mode-node": "^3.0.31", "@smithy/util-endpoints": "^2.1.7", "@smithy/util-middleware": "^3.0.11", "@smithy/util-retry": "^3.0.11", "@smithy/util-utf8": "^3.0.0", tslib: "^2.6.2" }, devDependencies: { "@tsconfig/node16": "16.1.3", "@types/node": "^16.18.96", concurrently: "7.0.0", "downlevel-dts": "0.10.1", rimraf: "3.0.2", typescript: "~4.9.5" }, engines: { node: ">=16.0.0" }, typesVersions: { "<4.0": { "dist-types/*": [ "dist-types/ts3.4/*" ] } }, files: [ "dist-*/**" ], author: { name: "AWS SDK for JavaScript Team", url: "https://aws.amazon.com/javascript/" }, license: "Apache-2.0", browser: { "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" }, "react-native": { "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" }, homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso", repository: { type: "git", url: "https://github.com/aws/aws-sdk-js-v3.git", directory: "clients/client-sso" } }; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/ruleset.js var u3, v5, w4, x4, a3, b4, c4, d4, e4, f3, g4, h4, i3, j4, k4, l4, m4, n3, o3, p4, q4, r4, s3, t4, _data3, ruleSet3; var init_ruleset2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/ruleset.js"() { init_import_meta_url(); u3 = "required"; v5 = "fn"; w4 = "argv"; x4 = "ref"; a3 = true; b4 = "isSet"; c4 = "booleanEquals"; d4 = "error"; e4 = "endpoint"; f3 = "tree"; g4 = "PartitionResult"; h4 = "getAttr"; i3 = { [u3]: false, "type": "String" }; j4 = { [u3]: true, "default": false, "type": "Boolean" }; k4 = { [x4]: "Endpoint" }; l4 = { [v5]: c4, [w4]: [{ [x4]: "UseFIPS" }, true] }; m4 = { [v5]: c4, [w4]: [{ [x4]: "UseDualStack" }, true] }; n3 = {}; o3 = { [v5]: h4, [w4]: [{ [x4]: g4 }, "supportsFIPS"] }; p4 = { [x4]: g4 }; q4 = { [v5]: c4, [w4]: [true, { [v5]: h4, [w4]: [p4, "supportsDualStack"] }] }; r4 = [l4]; s3 = [m4]; t4 = [{ [x4]: "Region" }]; _data3 = { version: "1.0", parameters: { Region: i3, UseDualStack: j4, UseFIPS: j4, Endpoint: i3 }, rules: [{ conditions: [{ [v5]: b4, [w4]: [k4] }], rules: [{ conditions: r4, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d4 }, { conditions: s3, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d4 }, { endpoint: { url: k4, properties: n3, headers: n3 }, type: e4 }], type: f3 }, { conditions: [{ [v5]: b4, [w4]: t4 }], rules: [{ conditions: [{ [v5]: "aws.partition", [w4]: t4, assign: g4 }], rules: [{ conditions: [l4, m4], rules: [{ conditions: [{ [v5]: c4, [w4]: [a3, o3] }, q4], rules: [{ endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n3, headers: n3 }, type: e4 }], type: f3 }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d4 }], type: f3 }, { conditions: r4, rules: [{ conditions: [{ [v5]: c4, [w4]: [o3, a3] }], rules: [{ conditions: [{ [v5]: "stringEquals", [w4]: [{ [v5]: h4, [w4]: [p4, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://portal.sso.{Region}.amazonaws.com", properties: n3, headers: n3 }, type: e4 }, { endpoint: { url: "https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n3, headers: n3 }, type: e4 }], type: f3 }, { error: "FIPS is enabled but this partition does not support FIPS", type: d4 }], type: f3 }, { conditions: s3, rules: [{ conditions: [q4], rules: [{ endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n3, headers: n3 }, type: e4 }], type: f3 }, { error: "DualStack is enabled but this partition does not support DualStack", type: d4 }], type: f3 }, { endpoint: { url: "https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", properties: n3, headers: n3 }, type: e4 }], type: f3 }], type: f3 }, { error: "Invalid Configuration: Missing Region", type: d4 }] }; ruleSet3 = _data3; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js var cache4, defaultEndpointResolver3; var init_endpointResolver2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/endpoint/endpointResolver.js"() { init_import_meta_url(); init_dist_es26(); init_dist_es25(); init_ruleset2(); cache4 = new EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] }); defaultEndpointResolver3 = /* @__PURE__ */ __name((endpointParams, context2 = {}) => { return cache4.get(endpointParams, () => resolveEndpoint(ruleSet3, { endpointParams, logger: context2.logger })); }, "defaultEndpointResolver"); customEndpointFunctions.aws = awsEndpointFunctions; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js var getRuntimeConfig3; var init_runtimeConfig_shared2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.shared.js"() { init_import_meta_url(); init_dist_es20(); init_dist_es15(); init_dist_es19(); init_dist_es33(); init_dist_es8(); init_dist_es7(); init_httpAuthSchemeProvider2(); init_endpointResolver2(); getRuntimeConfig3 = /* @__PURE__ */ __name((config) => { return { apiVersion: "2019-06-10", base64Decoder: config?.base64Decoder ?? fromBase64, base64Encoder: config?.base64Encoder ?? toBase64, disableHostPrefix: config?.disableHostPrefix ?? false, endpointProvider: config?.endpointProvider ?? defaultEndpointResolver3, extensions: config?.extensions ?? [], httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSSOHttpAuthSchemeProvider, httpAuthSchemes: config?.httpAuthSchemes ?? [ { schemeId: "aws.auth#sigv4", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), signer: new AwsSdkSigV4Signer() }, { schemeId: "smithy.api#noAuth", identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), signer: new NoAuthSigner() } ], logger: config?.logger ?? new NoOpLogger(), serviceId: config?.serviceId ?? "SSO", urlParser: config?.urlParser ?? parseUrl, utf8Decoder: config?.utf8Decoder ?? fromUtf8, utf8Encoder: config?.utf8Encoder ?? toUtf8 }; }, "getRuntimeConfig"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js var getRuntimeConfig4; var init_runtimeConfig2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js"() { init_import_meta_url(); init_package2(); init_dist_es20(); init_dist_es41(); init_dist_es28(); init_dist_es42(); init_dist_es37(); init_dist_es31(); init_dist_es11(); init_dist_es43(); init_dist_es36(); init_runtimeConfig_shared2(); init_dist_es19(); init_dist_es44(); init_dist_es19(); getRuntimeConfig4 = /* @__PURE__ */ __name((config) => { emitWarningIfUnsupportedVersion2(process.version); const defaultsMode = resolveDefaultsModeConfig(config); const defaultConfigProvider = /* @__PURE__ */ __name(() => defaultsMode().then(loadConfigsForDefaultMode), "defaultConfigProvider"); const clientSharedValues = getRuntimeConfig3(config); emitWarningIfUnsupportedVersion(process.version); const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, runtime: "node", defaultsMode, bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default3.version }), maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? loadConfig({ ...NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig) }; }, "getRuntimeConfig"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthExtensionConfiguration.js var getHttpAuthExtensionConfiguration2, resolveHttpAuthRuntimeConfig2; var init_httpAuthExtensionConfiguration2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/auth/httpAuthExtensionConfiguration.js"() { init_import_meta_url(); getHttpAuthExtensionConfiguration2 = /* @__PURE__ */ __name((runtimeConfig) => { const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; let _credentials = runtimeConfig.credentials; return { setHttpAuthScheme(httpAuthScheme) { const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); if (index === -1) { _httpAuthSchemes.push(httpAuthScheme); } else { _httpAuthSchemes.splice(index, 1, httpAuthScheme); } }, httpAuthSchemes() { return _httpAuthSchemes; }, setHttpAuthSchemeProvider(httpAuthSchemeProvider) { _httpAuthSchemeProvider = httpAuthSchemeProvider; }, httpAuthSchemeProvider() { return _httpAuthSchemeProvider; }, setCredentials(credentials) { _credentials = credentials; }, credentials() { return _credentials; } }; }, "getHttpAuthExtensionConfiguration"); resolveHttpAuthRuntimeConfig2 = /* @__PURE__ */ __name((config) => { return { httpAuthSchemes: config.httpAuthSchemes(), httpAuthSchemeProvider: config.httpAuthSchemeProvider(), credentials: config.credentials() }; }, "resolveHttpAuthRuntimeConfig"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeExtensions.js var asPartial2, resolveRuntimeExtensions2; var init_runtimeExtensions2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/runtimeExtensions.js"() { init_import_meta_url(); init_dist_es45(); init_dist_es2(); init_dist_es19(); init_httpAuthExtensionConfiguration2(); asPartial2 = /* @__PURE__ */ __name((t7) => t7, "asPartial"); resolveRuntimeExtensions2 = /* @__PURE__ */ __name((runtimeConfig, extensions) => { const extensionConfiguration = { ...asPartial2(getAwsRegionExtensionConfiguration(runtimeConfig)), ...asPartial2(getDefaultExtensionConfiguration(runtimeConfig)), ...asPartial2(getHttpHandlerExtensionConfiguration(runtimeConfig)), ...asPartial2(getHttpAuthExtensionConfiguration2(runtimeConfig)) }; extensions.forEach((extension) => extension.configure(extensionConfiguration)); return { ...runtimeConfig, ...resolveAwsRegionExtensionConfiguration(extensionConfiguration), ...resolveDefaultRuntimeConfig(extensionConfiguration), ...resolveHttpHandlerRuntimeConfig(extensionConfiguration), ...resolveHttpAuthRuntimeConfig2(extensionConfiguration) }; }, "resolveRuntimeExtensions"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js var SSOClient; var init_SSOClient = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/SSOClient.js"() { init_import_meta_url(); init_dist_es21(); init_dist_es22(); init_dist_es23(); init_dist_es27(); init_dist_es28(); init_dist_es15(); init_dist_es29(); init_dist_es34(); init_dist_es37(); init_dist_es19(); init_httpAuthSchemeProvider2(); init_EndpointParameters2(); init_runtimeConfig2(); init_runtimeExtensions2(); SSOClient = class extends Client { constructor(...[configuration]) { const _config_0 = getRuntimeConfig4(configuration || {}); const _config_1 = resolveClientEndpointParameters3(_config_0); const _config_2 = resolveUserAgentConfig(_config_1); const _config_3 = resolveRetryConfig(_config_2); const _config_4 = resolveRegionConfig(_config_3); const _config_5 = resolveHostHeaderConfig(_config_4); const _config_6 = resolveEndpointConfig(_config_5); const _config_7 = resolveHttpAuthSchemeConfig3(_config_6); const _config_8 = resolveRuntimeExtensions2(_config_7, configuration?.extensions || []); super(_config_8); this.config = _config_8; this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { httpAuthSchemeParametersProvider: defaultSSOHttpAuthSchemeParametersProvider, identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({ "aws.auth#sigv4": config.credentials }) })); this.middlewareStack.use(getHttpSigningPlugin(this.config)); } destroy() { super.destroy(); } }; __name(SSOClient, "SSOClient"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/models/SSOServiceException.js var SSOServiceException; var init_SSOServiceException = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/models/SSOServiceException.js"() { init_import_meta_url(); init_dist_es19(); SSOServiceException = class extends ServiceException { constructor(options32) { super(options32); Object.setPrototypeOf(this, SSOServiceException.prototype); } }; __name(SSOServiceException, "SSOServiceException"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js var InvalidRequestException2, ResourceNotFoundException, TooManyRequestsException, UnauthorizedException, GetRoleCredentialsRequestFilterSensitiveLog, RoleCredentialsFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog, ListAccountRolesRequestFilterSensitiveLog, ListAccountsRequestFilterSensitiveLog, LogoutRequestFilterSensitiveLog; var init_models_02 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/models/models_0.js"() { init_import_meta_url(); init_dist_es19(); init_SSOServiceException(); InvalidRequestException2 = class extends SSOServiceException { constructor(opts) { super({ name: "InvalidRequestException", $fault: "client", ...opts }); this.name = "InvalidRequestException"; this.$fault = "client"; Object.setPrototypeOf(this, InvalidRequestException2.prototype); } }; __name(InvalidRequestException2, "InvalidRequestException"); ResourceNotFoundException = class extends SSOServiceException { constructor(opts) { super({ name: "ResourceNotFoundException", $fault: "client", ...opts }); this.name = "ResourceNotFoundException"; this.$fault = "client"; Object.setPrototypeOf(this, ResourceNotFoundException.prototype); } }; __name(ResourceNotFoundException, "ResourceNotFoundException"); TooManyRequestsException = class extends SSOServiceException { constructor(opts) { super({ name: "TooManyRequestsException", $fault: "client", ...opts }); this.name = "TooManyRequestsException"; this.$fault = "client"; Object.setPrototypeOf(this, TooManyRequestsException.prototype); } }; __name(TooManyRequestsException, "TooManyRequestsException"); UnauthorizedException = class extends SSOServiceException { constructor(opts) { super({ name: "UnauthorizedException", $fault: "client", ...opts }); this.name = "UnauthorizedException"; this.$fault = "client"; Object.setPrototypeOf(this, UnauthorizedException.prototype); } }; __name(UnauthorizedException, "UnauthorizedException"); GetRoleCredentialsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.accessToken && { accessToken: SENSITIVE_STRING } }), "GetRoleCredentialsRequestFilterSensitiveLog"); RoleCredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.secretAccessKey && { secretAccessKey: SENSITIVE_STRING }, ...obj.sessionToken && { sessionToken: SENSITIVE_STRING } }), "RoleCredentialsFilterSensitiveLog"); GetRoleCredentialsResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.roleCredentials && { roleCredentials: RoleCredentialsFilterSensitiveLog(obj.roleCredentials) } }), "GetRoleCredentialsResponseFilterSensitiveLog"); ListAccountRolesRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.accessToken && { accessToken: SENSITIVE_STRING } }), "ListAccountRolesRequestFilterSensitiveLog"); ListAccountsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.accessToken && { accessToken: SENSITIVE_STRING } }), "ListAccountsRequestFilterSensitiveLog"); LogoutRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.accessToken && { accessToken: SENSITIVE_STRING } }), "LogoutRequestFilterSensitiveLog"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js var se_GetRoleCredentialsCommand, se_ListAccountRolesCommand, se_ListAccountsCommand, se_LogoutCommand, de_GetRoleCredentialsCommand, de_ListAccountRolesCommand, de_ListAccountsCommand, de_LogoutCommand, de_CommandError3, throwDefaultError4, de_InvalidRequestExceptionRes2, de_ResourceNotFoundExceptionRes, de_TooManyRequestsExceptionRes, de_UnauthorizedExceptionRes, deserializeMetadata4, _aI, _aT, _ai2, _mR, _mr, _nT, _nt, _rN, _rn, _xasbt; var init_Aws_restJson12 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js"() { init_import_meta_url(); init_dist_es20(); init_dist_es15(); init_dist_es19(); init_models_02(); init_SSOServiceException(); se_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (input, context2) => { const b6 = requestBuilder(input, context2); const headers = map({}, isSerializableHeaderValue, { [_xasbt]: input[_aT] }); b6.bp("/federation/credentials"); const query = map({ [_rn]: [, expectNonNull(input[_rN], `roleName`)], [_ai2]: [, expectNonNull(input[_aI], `accountId`)] }); let body; b6.m("GET").h(headers).q(query).b(body); return b6.build(); }, "se_GetRoleCredentialsCommand"); se_ListAccountRolesCommand = /* @__PURE__ */ __name(async (input, context2) => { const b6 = requestBuilder(input, context2); const headers = map({}, isSerializableHeaderValue, { [_xasbt]: input[_aT] }); b6.bp("/assignment/roles"); const query = map({ [_nt]: [, input[_nT]], [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()], [_ai2]: [, expectNonNull(input[_aI], `accountId`)] }); let body; b6.m("GET").h(headers).q(query).b(body); return b6.build(); }, "se_ListAccountRolesCommand"); se_ListAccountsCommand = /* @__PURE__ */ __name(async (input, context2) => { const b6 = requestBuilder(input, context2); const headers = map({}, isSerializableHeaderValue, { [_xasbt]: input[_aT] }); b6.bp("/assignment/accounts"); const query = map({ [_nt]: [, input[_nT]], [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()] }); let body; b6.m("GET").h(headers).q(query).b(body); return b6.build(); }, "se_ListAccountsCommand"); se_LogoutCommand = /* @__PURE__ */ __name(async (input, context2) => { const b6 = requestBuilder(input, context2); const headers = map({}, isSerializableHeaderValue, { [_xasbt]: input[_aT] }); b6.bp("/logout"); let body; b6.m("POST").h(headers).b(body); return b6.build(); }, "se_LogoutCommand"); de_GetRoleCredentialsCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError3(output, context2); } const contents = map({ $metadata: deserializeMetadata4(output) }); const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body"); const doc = take(data, { roleCredentials: _json }); Object.assign(contents, doc); return contents; }, "de_GetRoleCredentialsCommand"); de_ListAccountRolesCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError3(output, context2); } const contents = map({ $metadata: deserializeMetadata4(output) }); const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body"); const doc = take(data, { nextToken: expectString, roleList: _json }); Object.assign(contents, doc); return contents; }, "de_ListAccountRolesCommand"); de_ListAccountsCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError3(output, context2); } const contents = map({ $metadata: deserializeMetadata4(output) }); const data = expectNonNull(expectObject(await parseJsonBody(output.body, context2)), "body"); const doc = take(data, { accountList: _json, nextToken: expectString }); Object.assign(contents, doc); return contents; }, "de_ListAccountsCommand"); de_LogoutCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode !== 200 && output.statusCode >= 300) { return de_CommandError3(output, context2); } const contents = map({ $metadata: deserializeMetadata4(output) }); await collectBody(output.body, context2); return contents; }, "de_LogoutCommand"); de_CommandError3 = /* @__PURE__ */ __name(async (output, context2) => { const parsedOutput = { ...output, body: await parseJsonErrorBody(output.body, context2) }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { case "InvalidRequestException": case "com.amazonaws.sso#InvalidRequestException": throw await de_InvalidRequestExceptionRes2(parsedOutput, context2); case "ResourceNotFoundException": case "com.amazonaws.sso#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context2); case "TooManyRequestsException": case "com.amazonaws.sso#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context2); case "UnauthorizedException": case "com.amazonaws.sso#UnauthorizedException": throw await de_UnauthorizedExceptionRes(parsedOutput, context2); default: const parsedBody = parsedOutput.body; return throwDefaultError4({ output, parsedBody, errorCode }); } }, "de_CommandError"); throwDefaultError4 = withBaseException(SSOServiceException); de_InvalidRequestExceptionRes2 = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { message: expectString }); Object.assign(contents, doc); const exception = new InvalidRequestException2({ $metadata: deserializeMetadata4(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_InvalidRequestExceptionRes"); de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { message: expectString }); Object.assign(contents, doc); const exception = new ResourceNotFoundException({ $metadata: deserializeMetadata4(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_ResourceNotFoundExceptionRes"); de_TooManyRequestsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { message: expectString }); Object.assign(contents, doc); const exception = new TooManyRequestsException({ $metadata: deserializeMetadata4(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_TooManyRequestsExceptionRes"); de_UnauthorizedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const contents = map({}); const data = parsedOutput.body; const doc = take(data, { message: expectString }); Object.assign(contents, doc); const exception = new UnauthorizedException({ $metadata: deserializeMetadata4(parsedOutput), ...contents }); return decorateServiceException(exception, parsedOutput.body); }, "de_UnauthorizedExceptionRes"); deserializeMetadata4 = /* @__PURE__ */ __name((output) => ({ httpStatusCode: output.statusCode, requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], extendedRequestId: output.headers["x-amz-id-2"], cfId: output.headers["x-amz-cf-id"] }), "deserializeMetadata"); _aI = "accountId"; _aT = "accessToken"; _ai2 = "account_id"; _mR = "maxResults"; _mr = "max_result"; _nT = "nextToken"; _nt = "next_token"; _rN = "roleName"; _rn = "role_name"; _xasbt = "x-amz-sso_bearer_token"; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js var GetRoleCredentialsCommand; var init_GetRoleCredentialsCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/GetRoleCredentialsCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters2(); init_models_02(); init_Aws_restJson12(); GetRoleCredentialsCommand = class extends Command.classBuilder().ep(commonParams3).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").f(GetRoleCredentialsRequestFilterSensitiveLog, GetRoleCredentialsResponseFilterSensitiveLog).ser(se_GetRoleCredentialsCommand).de(de_GetRoleCredentialsCommand).build() { }; __name(GetRoleCredentialsCommand, "GetRoleCredentialsCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountRolesCommand.js var ListAccountRolesCommand; var init_ListAccountRolesCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountRolesCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters2(); init_models_02(); init_Aws_restJson12(); ListAccountRolesCommand = class extends Command.classBuilder().ep(commonParams3).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("SWBPortalService", "ListAccountRoles", {}).n("SSOClient", "ListAccountRolesCommand").f(ListAccountRolesRequestFilterSensitiveLog, void 0).ser(se_ListAccountRolesCommand).de(de_ListAccountRolesCommand).build() { }; __name(ListAccountRolesCommand, "ListAccountRolesCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountsCommand.js var ListAccountsCommand; var init_ListAccountsCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/ListAccountsCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters2(); init_models_02(); init_Aws_restJson12(); ListAccountsCommand = class extends Command.classBuilder().ep(commonParams3).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("SWBPortalService", "ListAccounts", {}).n("SSOClient", "ListAccountsCommand").f(ListAccountsRequestFilterSensitiveLog, void 0).ser(se_ListAccountsCommand).de(de_ListAccountsCommand).build() { }; __name(ListAccountsCommand, "ListAccountsCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/LogoutCommand.js var LogoutCommand; var init_LogoutCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/LogoutCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters2(); init_models_02(); init_Aws_restJson12(); LogoutCommand = class extends Command.classBuilder().ep(commonParams3).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("SWBPortalService", "Logout", {}).n("SSOClient", "LogoutCommand").f(LogoutRequestFilterSensitiveLog, void 0).ser(se_LogoutCommand).de(de_LogoutCommand).build() { }; __name(LogoutCommand, "LogoutCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/SSO.js var commands2, SSO; var init_SSO = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/SSO.js"() { init_import_meta_url(); init_dist_es19(); init_GetRoleCredentialsCommand(); init_ListAccountRolesCommand(); init_ListAccountsCommand(); init_LogoutCommand(); init_SSOClient(); commands2 = { GetRoleCredentialsCommand, ListAccountRolesCommand, ListAccountsCommand, LogoutCommand }; SSO = class extends SSOClient { }; __name(SSO, "SSO"); createAggregatedClient(commands2, SSO); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/index.js var init_commands2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/commands/index.js"() { init_import_meta_url(); init_GetRoleCredentialsCommand(); init_ListAccountRolesCommand(); init_ListAccountsCommand(); init_LogoutCommand(); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/Interfaces.js var init_Interfaces = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/Interfaces.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountRolesPaginator.js var paginateListAccountRoles; var init_ListAccountRolesPaginator = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountRolesPaginator.js"() { init_import_meta_url(); init_dist_es15(); init_ListAccountRolesCommand(); init_SSOClient(); paginateListAccountRoles = createPaginator(SSOClient, ListAccountRolesCommand, "nextToken", "nextToken", "maxResults"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountsPaginator.js var paginateListAccounts; var init_ListAccountsPaginator = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/ListAccountsPaginator.js"() { init_import_meta_url(); init_dist_es15(); init_ListAccountsCommand(); init_SSOClient(); paginateListAccounts = createPaginator(SSOClient, ListAccountsCommand, "nextToken", "nextToken", "maxResults"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/index.js var init_pagination2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/pagination/index.js"() { init_import_meta_url(); init_Interfaces(); init_ListAccountRolesPaginator(); init_ListAccountsPaginator(); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/models/index.js var init_models2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/models/index.js"() { init_import_meta_url(); init_models_02(); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/index.js var init_dist_es48 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sso@3.721.0/node_modules/@aws-sdk/client-sso/dist-es/index.js"() { init_import_meta_url(); init_SSOClient(); init_SSO(); init_commands2(); init_pagination2(); init_models2(); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/loadSso.js var loadSso_exports = {}; __export(loadSso_exports, { GetRoleCredentialsCommand: () => GetRoleCredentialsCommand, SSOClient: () => SSOClient }); var init_loadSso = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/loadSso.js"() { init_import_meta_url(); init_dist_es48(); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js var SHOULD_FAIL_CREDENTIAL_CHAIN, resolveSSOCredentials; var init_resolveSSOCredentials = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/resolveSSOCredentials.js"() { init_import_meta_url(); init_client2(); init_dist_es47(); init_dist_es16(); init_dist_es30(); SHOULD_FAIL_CREDENTIAL_CHAIN = false; resolveSSOCredentials = /* @__PURE__ */ __name(async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, profile, logger: logger4 }) => { let token; const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`; if (ssoSession) { try { const _token = await fromSso({ profile })(); token = { accessToken: _token.token, expiresAt: new Date(_token.expiration).toISOString() }; } catch (e7) { throw new CredentialsProviderError(e7.message, { tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, logger: logger4 }); } } else { try { token = await getSSOTokenFromFile(ssoStartUrl); } catch (e7) { throw new CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, { tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, logger: logger4 }); } } if (new Date(token.expiresAt).getTime() - Date.now() <= 0) { throw new CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, { tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, logger: logger4 }); } const { accessToken } = token; const { SSOClient: SSOClient2, GetRoleCredentialsCommand: GetRoleCredentialsCommand2 } = await Promise.resolve().then(() => (init_loadSso(), loadSso_exports)); const sso = ssoClient || new SSOClient2(Object.assign({}, clientConfig ?? {}, { logger: clientConfig?.logger ?? parentClientConfig?.logger, region: clientConfig?.region ?? ssoRegion })); let ssoResp; try { ssoResp = await sso.send(new GetRoleCredentialsCommand2({ accountId: ssoAccountId, roleName: ssoRoleName, accessToken })); } catch (e7) { throw new CredentialsProviderError(e7, { tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, logger: logger4 }); } const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp; if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) { throw new CredentialsProviderError("SSO returns an invalid temporary credential.", { tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, logger: logger4 }); } const credentials = { accessKeyId, secretAccessKey, sessionToken, expiration: new Date(expiration), ...credentialScope && { credentialScope }, ...accountId && { accountId } }; if (ssoSession) { setCredentialFeature(credentials, "CREDENTIALS_SSO", "s"); } else { setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u"); } return credentials; }, "resolveSSOCredentials"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js var validateSsoProfile; var init_validateSsoProfile = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/validateSsoProfile.js"() { init_import_meta_url(); init_dist_es16(); validateSsoProfile = /* @__PURE__ */ __name((profile, logger4) => { const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile; if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) { throw new CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(profile).join(", ")} Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger: logger4 }); } return profile; }, "validateSsoProfile"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js var fromSSO; var init_fromSSO = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/fromSSO.js"() { init_import_meta_url(); init_dist_es16(); init_dist_es30(); init_isSsoProfile(); init_resolveSSOCredentials(); init_validateSsoProfile(); fromSSO = /* @__PURE__ */ __name((init2 = {}) => async ({ callerClientConfig } = {}) => { init2.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO"); const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init2; const { ssoClient } = init2; const profileName = getProfileName({ profile: init2.profile ?? callerClientConfig?.profile }); if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { const profiles = await parseKnownFiles(init2); const profile = profiles[profileName]; if (!profile) { throw new CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init2.logger }); } if (!isSsoProfile(profile)) { throw new CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, { logger: init2.logger }); } if (profile?.sso_session) { const ssoSessions = await loadSsoSessionData(init2); const session = ssoSessions[profile.sso_session]; const conflictMsg = ` configurations in profile ${profileName} and sso-session ${profile.sso_session}`; if (ssoRegion && ssoRegion !== session.sso_region) { throw new CredentialsProviderError(`Conflicting SSO region` + conflictMsg, { tryNextLink: false, logger: init2.logger }); } if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) { throw new CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, { tryNextLink: false, logger: init2.logger }); } profile.sso_region = session.sso_region; profile.sso_start_url = session.sso_start_url; } const { sso_start_url, sso_account_id, sso_region, sso_role_name, sso_session } = validateSsoProfile(profile, init2.logger); return resolveSSOCredentials({ ssoStartUrl: sso_start_url, ssoSession: sso_session, ssoAccountId: sso_account_id, ssoRegion: sso_region, ssoRoleName: sso_role_name, ssoClient, clientConfig: init2.clientConfig, parentClientConfig: init2.parentClientConfig, profile: profileName }); } else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) { throw new CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init2.logger }); } else { return resolveSSOCredentials({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig: init2.clientConfig, parentClientConfig: init2.parentClientConfig, profile: profileName }); } }, "fromSSO"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/types.js var init_types9 = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/types.js"() { init_import_meta_url(); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js var dist_es_exports5 = {}; __export(dist_es_exports5, { fromSSO: () => fromSSO, isSsoProfile: () => isSsoProfile, validateSsoProfile: () => validateSsoProfile }); var init_dist_es49 = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-sso@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts@3.721.0_/node_modules/@aws-sdk/credential-provider-sso/dist-es/index.js"() { init_import_meta_url(); init_fromSSO(); init_isSsoProfile(); init_types9(); init_validateSsoProfile(); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js var resolveCredentialSource, setNamedProvider; var init_resolveCredentialSource = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveCredentialSource.js"() { init_import_meta_url(); init_client2(); init_dist_es16(); resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileName, logger4) => { const sourceProvidersMap = { EcsContainer: async (options32) => { const { fromHttp: fromHttp2 } = await Promise.resolve().then(() => (init_dist_es40(), dist_es_exports3)); const { fromContainerMetadata: fromContainerMetadata2 } = await Promise.resolve().then(() => (init_dist_es39(), dist_es_exports2)); logger4?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"); return async () => chain(fromHttp2(options32 ?? {}), fromContainerMetadata2(options32))().then(setNamedProvider); }, Ec2InstanceMetadata: async (options32) => { logger4?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata"); const { fromInstanceMetadata: fromInstanceMetadata2 } = await Promise.resolve().then(() => (init_dist_es39(), dist_es_exports2)); return async () => fromInstanceMetadata2(options32)().then(setNamedProvider); }, Environment: async (options32) => { logger4?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment"); const { fromEnv: fromEnv3 } = await Promise.resolve().then(() => (init_dist_es38(), dist_es_exports)); return async () => fromEnv3(options32)().then(setNamedProvider); } }; if (credentialSource in sourceProvidersMap) { return sourceProvidersMap[credentialSource]; } else { throw new CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger: logger4 }); } }, "resolveCredentialSource"); setNamedProvider = /* @__PURE__ */ __name((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p"), "setNamedProvider"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/auth/httpAuthSchemeProvider.js function createAwsAuthSigv4HttpAuthOption4(authParameters) { return { schemeId: "aws.auth#sigv4", signingProperties: { name: "sts", region: authParameters.region }, propertiesExtractor: (config, context2) => ({ signingProperties: { config, context: context2 } }) }; } function createSmithyApiNoAuthHttpAuthOption3(authParameters) { return { schemeId: "smithy.api#noAuth" }; } var defaultSTSHttpAuthSchemeParametersProvider, defaultSTSHttpAuthSchemeProvider, resolveStsAuthConfig, resolveHttpAuthSchemeConfig4; var init_httpAuthSchemeProvider3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/auth/httpAuthSchemeProvider.js"() { init_import_meta_url(); init_dist_es20(); init_dist_es3(); init_STSClient(); defaultSTSHttpAuthSchemeParametersProvider = /* @__PURE__ */ __name(async (config, context2, input) => { return { operation: getSmithyContext(context2).operation, region: await normalizeProvider(config.region)() || (() => { throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); })() }; }, "defaultSTSHttpAuthSchemeParametersProvider"); __name(createAwsAuthSigv4HttpAuthOption4, "createAwsAuthSigv4HttpAuthOption"); __name(createSmithyApiNoAuthHttpAuthOption3, "createSmithyApiNoAuthHttpAuthOption"); defaultSTSHttpAuthSchemeProvider = /* @__PURE__ */ __name((authParameters) => { const options32 = []; switch (authParameters.operation) { case "AssumeRoleWithSAML": { options32.push(createSmithyApiNoAuthHttpAuthOption3(authParameters)); break; } case "AssumeRoleWithWebIdentity": { options32.push(createSmithyApiNoAuthHttpAuthOption3(authParameters)); break; } default: { options32.push(createAwsAuthSigv4HttpAuthOption4(authParameters)); } } return options32; }, "defaultSTSHttpAuthSchemeProvider"); resolveStsAuthConfig = /* @__PURE__ */ __name((input) => ({ ...input, stsClientCtor: STSClient }), "resolveStsAuthConfig"); resolveHttpAuthSchemeConfig4 = /* @__PURE__ */ __name((config) => { const config_0 = resolveStsAuthConfig(config); const config_1 = resolveAwsSdkSigV4Config(config_0); return { ...config_1 }; }, "resolveHttpAuthSchemeConfig"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/endpoint/EndpointParameters.js var resolveClientEndpointParameters4, commonParams4; var init_EndpointParameters3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/endpoint/EndpointParameters.js"() { init_import_meta_url(); resolveClientEndpointParameters4 = /* @__PURE__ */ __name((options32) => { return { ...options32, useDualstackEndpoint: options32.useDualstackEndpoint ?? false, useFipsEndpoint: options32.useFipsEndpoint ?? false, useGlobalEndpoint: options32.useGlobalEndpoint ?? false, defaultSigningName: "sts" }; }, "resolveClientEndpointParameters"); commonParams4 = { UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" }, UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, Endpoint: { type: "builtInParams", name: "endpoint" }, Region: { type: "builtInParams", name: "region" }, UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } }; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/package.json var package_default4; var init_package3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/package.json"() { package_default4 = { name: "@aws-sdk/client-sts", description: "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native", version: "3.721.0", scripts: { build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "node ../../scripts/compilation/inline client-sts", "build:es": "tsc -p tsconfig.es.json", "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", "build:types": "rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", clean: "rimraf ./dist-* && rimraf *.tsbuildinfo", "extract:docs": "api-extractor run --local", "generate:client": "node ../../scripts/generate-clients/single-service --solo sts", test: "yarn g:vitest run", "test:watch": "yarn g:vitest watch" }, main: "./dist-cjs/index.js", types: "./dist-types/index.d.ts", module: "./dist-es/index.js", sideEffects: false, dependencies: { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/client-sso-oidc": "3.721.0", "@aws-sdk/core": "3.716.0", "@aws-sdk/credential-provider-node": "3.721.0", "@aws-sdk/middleware-host-header": "3.714.0", "@aws-sdk/middleware-logger": "3.714.0", "@aws-sdk/middleware-recursion-detection": "3.714.0", "@aws-sdk/middleware-user-agent": "3.721.0", "@aws-sdk/region-config-resolver": "3.714.0", "@aws-sdk/types": "3.714.0", "@aws-sdk/util-endpoints": "3.714.0", "@aws-sdk/util-user-agent-browser": "3.714.0", "@aws-sdk/util-user-agent-node": "3.721.0", "@smithy/config-resolver": "^3.0.13", "@smithy/core": "^2.5.5", "@smithy/fetch-http-handler": "^4.1.2", "@smithy/hash-node": "^3.0.11", "@smithy/invalid-dependency": "^3.0.11", "@smithy/middleware-content-length": "^3.0.13", "@smithy/middleware-endpoint": "^3.2.6", "@smithy/middleware-retry": "^3.0.31", "@smithy/middleware-serde": "^3.0.11", "@smithy/middleware-stack": "^3.0.11", "@smithy/node-config-provider": "^3.1.12", "@smithy/node-http-handler": "^3.3.2", "@smithy/protocol-http": "^4.1.8", "@smithy/smithy-client": "^3.5.1", "@smithy/types": "^3.7.2", "@smithy/url-parser": "^3.0.11", "@smithy/util-base64": "^3.0.0", "@smithy/util-body-length-browser": "^3.0.0", "@smithy/util-body-length-node": "^3.0.0", "@smithy/util-defaults-mode-browser": "^3.0.31", "@smithy/util-defaults-mode-node": "^3.0.31", "@smithy/util-endpoints": "^2.1.7", "@smithy/util-middleware": "^3.0.11", "@smithy/util-retry": "^3.0.11", "@smithy/util-utf8": "^3.0.0", tslib: "^2.6.2" }, devDependencies: { "@tsconfig/node16": "16.1.3", "@types/node": "^16.18.96", concurrently: "7.0.0", "downlevel-dts": "0.10.1", rimraf: "3.0.2", typescript: "~4.9.5" }, engines: { node: ">=16.0.0" }, typesVersions: { "<4.0": { "dist-types/*": [ "dist-types/ts3.4/*" ] } }, files: [ "dist-*/**" ], author: { name: "AWS SDK for JavaScript Team", url: "https://aws.amazon.com/javascript/" }, license: "Apache-2.0", browser: { "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" }, "react-native": { "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" }, homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts", repository: { type: "git", url: "https://github.com/aws/aws-sdk-js-v3.git", directory: "clients/client-sts" } }; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/endpoint/ruleset.js var F2, G3, H3, I3, J3, a4, b5, c5, d5, e5, f4, g5, h5, i4, j5, k5, l5, m5, n4, o4, p5, q5, r5, s4, t5, u4, v6, w5, x5, y3, z4, A2, B2, C2, D2, E2, _data4, ruleSet4; var init_ruleset3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/endpoint/ruleset.js"() { init_import_meta_url(); F2 = "required"; G3 = "type"; H3 = "fn"; I3 = "argv"; J3 = "ref"; a4 = false; b5 = true; c5 = "booleanEquals"; d5 = "stringEquals"; e5 = "sigv4"; f4 = "sts"; g5 = "us-east-1"; h5 = "endpoint"; i4 = "https://sts.{Region}.{PartitionResult#dnsSuffix}"; j5 = "tree"; k5 = "error"; l5 = "getAttr"; m5 = { [F2]: false, [G3]: "String" }; n4 = { [F2]: true, "default": false, [G3]: "Boolean" }; o4 = { [J3]: "Endpoint" }; p5 = { [H3]: "isSet", [I3]: [{ [J3]: "Region" }] }; q5 = { [J3]: "Region" }; r5 = { [H3]: "aws.partition", [I3]: [q5], "assign": "PartitionResult" }; s4 = { [J3]: "UseFIPS" }; t5 = { [J3]: "UseDualStack" }; u4 = { "url": "https://sts.amazonaws.com", "properties": { "authSchemes": [{ "name": e5, "signingName": f4, "signingRegion": g5 }] }, "headers": {} }; v6 = {}; w5 = { "conditions": [{ [H3]: d5, [I3]: [q5, "aws-global"] }], [h5]: u4, [G3]: h5 }; x5 = { [H3]: c5, [I3]: [s4, true] }; y3 = { [H3]: c5, [I3]: [t5, true] }; z4 = { [H3]: l5, [I3]: [{ [J3]: "PartitionResult" }, "supportsFIPS"] }; A2 = { [J3]: "PartitionResult" }; B2 = { [H3]: c5, [I3]: [true, { [H3]: l5, [I3]: [A2, "supportsDualStack"] }] }; C2 = [{ [H3]: "isSet", [I3]: [o4] }]; D2 = [x5]; E2 = [y3]; _data4 = { version: "1.0", parameters: { Region: m5, UseDualStack: n4, UseFIPS: n4, Endpoint: m5, UseGlobalEndpoint: n4 }, rules: [{ conditions: [{ [H3]: c5, [I3]: [{ [J3]: "UseGlobalEndpoint" }, b5] }, { [H3]: "not", [I3]: C2 }, p5, r5, { [H3]: c5, [I3]: [s4, a4] }, { [H3]: c5, [I3]: [t5, a4] }], rules: [{ conditions: [{ [H3]: d5, [I3]: [q5, "ap-northeast-1"] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, "ap-south-1"] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, "ap-southeast-1"] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, "ap-southeast-2"] }], endpoint: u4, [G3]: h5 }, w5, { conditions: [{ [H3]: d5, [I3]: [q5, "ca-central-1"] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, "eu-central-1"] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, "eu-north-1"] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, "eu-west-1"] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, "eu-west-2"] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, "eu-west-3"] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, "sa-east-1"] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, g5] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, "us-east-2"] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, "us-west-1"] }], endpoint: u4, [G3]: h5 }, { conditions: [{ [H3]: d5, [I3]: [q5, "us-west-2"] }], endpoint: u4, [G3]: h5 }, { endpoint: { url: i4, properties: { authSchemes: [{ name: e5, signingName: f4, signingRegion: "{Region}" }] }, headers: v6 }, [G3]: h5 }], [G3]: j5 }, { conditions: C2, rules: [{ conditions: D2, error: "Invalid Configuration: FIPS and custom endpoint are not supported", [G3]: k5 }, { conditions: E2, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", [G3]: k5 }, { endpoint: { url: o4, properties: v6, headers: v6 }, [G3]: h5 }], [G3]: j5 }, { conditions: [p5], rules: [{ conditions: [r5], rules: [{ conditions: [x5, y3], rules: [{ conditions: [{ [H3]: c5, [I3]: [b5, z4] }, B2], rules: [{ endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v6, headers: v6 }, [G3]: h5 }], [G3]: j5 }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", [G3]: k5 }], [G3]: j5 }, { conditions: D2, rules: [{ conditions: [{ [H3]: c5, [I3]: [z4, b5] }], rules: [{ conditions: [{ [H3]: d5, [I3]: [{ [H3]: l5, [I3]: [A2, "name"] }, "aws-us-gov"] }], endpoint: { url: "https://sts.{Region}.amazonaws.com", properties: v6, headers: v6 }, [G3]: h5 }, { endpoint: { url: "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", properties: v6, headers: v6 }, [G3]: h5 }], [G3]: j5 }, { error: "FIPS is enabled but this partition does not support FIPS", [G3]: k5 }], [G3]: j5 }, { conditions: E2, rules: [{ conditions: [B2], rules: [{ endpoint: { url: "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: v6, headers: v6 }, [G3]: h5 }], [G3]: j5 }, { error: "DualStack is enabled but this partition does not support DualStack", [G3]: k5 }], [G3]: j5 }, w5, { endpoint: { url: i4, properties: v6, headers: v6 }, [G3]: h5 }], [G3]: j5 }], [G3]: j5 }, { error: "Invalid Configuration: Missing Region", [G3]: k5 }] }; ruleSet4 = _data4; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/endpoint/endpointResolver.js var cache5, defaultEndpointResolver4; var init_endpointResolver3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/endpoint/endpointResolver.js"() { init_import_meta_url(); init_dist_es26(); init_dist_es25(); init_ruleset3(); cache5 = new EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"] }); defaultEndpointResolver4 = /* @__PURE__ */ __name((endpointParams, context2 = {}) => { return cache5.get(endpointParams, () => resolveEndpoint(ruleSet4, { endpointParams, logger: context2.logger })); }, "defaultEndpointResolver"); customEndpointFunctions.aws = awsEndpointFunctions; } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.shared.js var getRuntimeConfig5; var init_runtimeConfig_shared3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.shared.js"() { init_import_meta_url(); init_dist_es20(); init_dist_es15(); init_dist_es19(); init_dist_es33(); init_dist_es8(); init_dist_es7(); init_httpAuthSchemeProvider3(); init_endpointResolver3(); getRuntimeConfig5 = /* @__PURE__ */ __name((config) => { return { apiVersion: "2011-06-15", base64Decoder: config?.base64Decoder ?? fromBase64, base64Encoder: config?.base64Encoder ?? toBase64, disableHostPrefix: config?.disableHostPrefix ?? false, endpointProvider: config?.endpointProvider ?? defaultEndpointResolver4, extensions: config?.extensions ?? [], httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSTSHttpAuthSchemeProvider, httpAuthSchemes: config?.httpAuthSchemes ?? [ { schemeId: "aws.auth#sigv4", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), signer: new AwsSdkSigV4Signer() }, { schemeId: "smithy.api#noAuth", identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), signer: new NoAuthSigner() } ], logger: config?.logger ?? new NoOpLogger(), serviceId: config?.serviceId ?? "STS", urlParser: config?.urlParser ?? parseUrl, utf8Decoder: config?.utf8Decoder ?? fromUtf8, utf8Encoder: config?.utf8Encoder ?? toUtf8 }; }, "getRuntimeConfig"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js var getRuntimeConfig6; var init_runtimeConfig3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/runtimeConfig.js"() { init_import_meta_url(); init_package3(); init_dist_es20(); init_dist_es54(); init_dist_es41(); init_dist_es28(); init_dist_es15(); init_dist_es42(); init_dist_es37(); init_dist_es31(); init_dist_es11(); init_dist_es43(); init_dist_es36(); init_runtimeConfig_shared3(); init_dist_es19(); init_dist_es44(); init_dist_es19(); getRuntimeConfig6 = /* @__PURE__ */ __name((config) => { emitWarningIfUnsupportedVersion2(process.version); const defaultsMode = resolveDefaultsModeConfig(config); const defaultConfigProvider = /* @__PURE__ */ __name(() => defaultsMode().then(loadConfigsForDefaultMode), "defaultConfigProvider"); const clientSharedValues = getRuntimeConfig5(config); emitWarningIfUnsupportedVersion(process.version); const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, runtime: "node", defaultsMode, bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_default4.version }), httpAuthSchemes: config?.httpAuthSchemes ?? [ { schemeId: "aws.auth#sigv4", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await defaultProvider(idProps?.__config || {})()), signer: new AwsSdkSigV4Signer() }, { schemeId: "smithy.api#noAuth", identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), signer: new NoAuthSigner() } ], maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? loadConfig({ ...NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig) }; }, "getRuntimeConfig"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/auth/httpAuthExtensionConfiguration.js var getHttpAuthExtensionConfiguration3, resolveHttpAuthRuntimeConfig3; var init_httpAuthExtensionConfiguration3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/auth/httpAuthExtensionConfiguration.js"() { init_import_meta_url(); getHttpAuthExtensionConfiguration3 = /* @__PURE__ */ __name((runtimeConfig) => { const _httpAuthSchemes = runtimeConfig.httpAuthSchemes; let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider; let _credentials = runtimeConfig.credentials; return { setHttpAuthScheme(httpAuthScheme) { const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId); if (index === -1) { _httpAuthSchemes.push(httpAuthScheme); } else { _httpAuthSchemes.splice(index, 1, httpAuthScheme); } }, httpAuthSchemes() { return _httpAuthSchemes; }, setHttpAuthSchemeProvider(httpAuthSchemeProvider) { _httpAuthSchemeProvider = httpAuthSchemeProvider; }, httpAuthSchemeProvider() { return _httpAuthSchemeProvider; }, setCredentials(credentials) { _credentials = credentials; }, credentials() { return _credentials; } }; }, "getHttpAuthExtensionConfiguration"); resolveHttpAuthRuntimeConfig3 = /* @__PURE__ */ __name((config) => { return { httpAuthSchemes: config.httpAuthSchemes(), httpAuthSchemeProvider: config.httpAuthSchemeProvider(), credentials: config.credentials() }; }, "resolveHttpAuthRuntimeConfig"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/runtimeExtensions.js var asPartial3, resolveRuntimeExtensions3; var init_runtimeExtensions3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/runtimeExtensions.js"() { init_import_meta_url(); init_dist_es45(); init_dist_es2(); init_dist_es19(); init_httpAuthExtensionConfiguration3(); asPartial3 = /* @__PURE__ */ __name((t7) => t7, "asPartial"); resolveRuntimeExtensions3 = /* @__PURE__ */ __name((runtimeConfig, extensions) => { const extensionConfiguration = { ...asPartial3(getAwsRegionExtensionConfiguration(runtimeConfig)), ...asPartial3(getDefaultExtensionConfiguration(runtimeConfig)), ...asPartial3(getHttpHandlerExtensionConfiguration(runtimeConfig)), ...asPartial3(getHttpAuthExtensionConfiguration3(runtimeConfig)) }; extensions.forEach((extension) => extension.configure(extensionConfiguration)); return { ...runtimeConfig, ...resolveAwsRegionExtensionConfiguration(extensionConfiguration), ...resolveDefaultRuntimeConfig(extensionConfiguration), ...resolveHttpHandlerRuntimeConfig(extensionConfiguration), ...resolveHttpAuthRuntimeConfig3(extensionConfiguration) }; }, "resolveRuntimeExtensions"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/STSClient.js var STSClient; var init_STSClient = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/STSClient.js"() { init_import_meta_url(); init_dist_es21(); init_dist_es22(); init_dist_es23(); init_dist_es27(); init_dist_es28(); init_dist_es15(); init_dist_es29(); init_dist_es34(); init_dist_es37(); init_dist_es19(); init_httpAuthSchemeProvider3(); init_EndpointParameters3(); init_runtimeConfig3(); init_runtimeExtensions3(); STSClient = class extends Client { constructor(...[configuration]) { const _config_0 = getRuntimeConfig6(configuration || {}); const _config_1 = resolveClientEndpointParameters4(_config_0); const _config_2 = resolveUserAgentConfig(_config_1); const _config_3 = resolveRetryConfig(_config_2); const _config_4 = resolveRegionConfig(_config_3); const _config_5 = resolveHostHeaderConfig(_config_4); const _config_6 = resolveEndpointConfig(_config_5); const _config_7 = resolveHttpAuthSchemeConfig4(_config_6); const _config_8 = resolveRuntimeExtensions3(_config_7, configuration?.extensions || []); super(_config_8); this.config = _config_8; this.middlewareStack.use(getUserAgentPlugin(this.config)); this.middlewareStack.use(getRetryPlugin(this.config)); this.middlewareStack.use(getContentLengthPlugin(this.config)); this.middlewareStack.use(getHostHeaderPlugin(this.config)); this.middlewareStack.use(getLoggerPlugin(this.config)); this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { httpAuthSchemeParametersProvider: defaultSTSHttpAuthSchemeParametersProvider, identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({ "aws.auth#sigv4": config.credentials }) })); this.middlewareStack.use(getHttpSigningPlugin(this.config)); } destroy() { super.destroy(); } }; __name(STSClient, "STSClient"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/models/STSServiceException.js var STSServiceException; var init_STSServiceException = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/models/STSServiceException.js"() { init_import_meta_url(); init_dist_es19(); STSServiceException = class extends ServiceException { constructor(options32) { super(options32); Object.setPrototypeOf(this, STSServiceException.prototype); } }; __name(STSServiceException, "STSServiceException"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/models/models_0.js var ExpiredTokenException2, MalformedPolicyDocumentException, PackedPolicyTooLargeException, RegionDisabledException, IDPRejectedClaimException, InvalidIdentityTokenException, IDPCommunicationErrorException, InvalidAuthorizationMessageException, CredentialsFilterSensitiveLog, AssumeRoleResponseFilterSensitiveLog, AssumeRoleWithSAMLRequestFilterSensitiveLog, AssumeRoleWithSAMLResponseFilterSensitiveLog, AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog, AssumeRootResponseFilterSensitiveLog, GetFederationTokenResponseFilterSensitiveLog, GetSessionTokenResponseFilterSensitiveLog; var init_models_03 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/models/models_0.js"() { init_import_meta_url(); init_dist_es19(); init_STSServiceException(); ExpiredTokenException2 = class extends STSServiceException { constructor(opts) { super({ name: "ExpiredTokenException", $fault: "client", ...opts }); this.name = "ExpiredTokenException"; this.$fault = "client"; Object.setPrototypeOf(this, ExpiredTokenException2.prototype); } }; __name(ExpiredTokenException2, "ExpiredTokenException"); MalformedPolicyDocumentException = class extends STSServiceException { constructor(opts) { super({ name: "MalformedPolicyDocumentException", $fault: "client", ...opts }); this.name = "MalformedPolicyDocumentException"; this.$fault = "client"; Object.setPrototypeOf(this, MalformedPolicyDocumentException.prototype); } }; __name(MalformedPolicyDocumentException, "MalformedPolicyDocumentException"); PackedPolicyTooLargeException = class extends STSServiceException { constructor(opts) { super({ name: "PackedPolicyTooLargeException", $fault: "client", ...opts }); this.name = "PackedPolicyTooLargeException"; this.$fault = "client"; Object.setPrototypeOf(this, PackedPolicyTooLargeException.prototype); } }; __name(PackedPolicyTooLargeException, "PackedPolicyTooLargeException"); RegionDisabledException = class extends STSServiceException { constructor(opts) { super({ name: "RegionDisabledException", $fault: "client", ...opts }); this.name = "RegionDisabledException"; this.$fault = "client"; Object.setPrototypeOf(this, RegionDisabledException.prototype); } }; __name(RegionDisabledException, "RegionDisabledException"); IDPRejectedClaimException = class extends STSServiceException { constructor(opts) { super({ name: "IDPRejectedClaimException", $fault: "client", ...opts }); this.name = "IDPRejectedClaimException"; this.$fault = "client"; Object.setPrototypeOf(this, IDPRejectedClaimException.prototype); } }; __name(IDPRejectedClaimException, "IDPRejectedClaimException"); InvalidIdentityTokenException = class extends STSServiceException { constructor(opts) { super({ name: "InvalidIdentityTokenException", $fault: "client", ...opts }); this.name = "InvalidIdentityTokenException"; this.$fault = "client"; Object.setPrototypeOf(this, InvalidIdentityTokenException.prototype); } }; __name(InvalidIdentityTokenException, "InvalidIdentityTokenException"); IDPCommunicationErrorException = class extends STSServiceException { constructor(opts) { super({ name: "IDPCommunicationErrorException", $fault: "client", ...opts }); this.name = "IDPCommunicationErrorException"; this.$fault = "client"; Object.setPrototypeOf(this, IDPCommunicationErrorException.prototype); } }; __name(IDPCommunicationErrorException, "IDPCommunicationErrorException"); InvalidAuthorizationMessageException = class extends STSServiceException { constructor(opts) { super({ name: "InvalidAuthorizationMessageException", $fault: "client", ...opts }); this.name = "InvalidAuthorizationMessageException"; this.$fault = "client"; Object.setPrototypeOf(this, InvalidAuthorizationMessageException.prototype); } }; __name(InvalidAuthorizationMessageException, "InvalidAuthorizationMessageException"); CredentialsFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.SecretAccessKey && { SecretAccessKey: SENSITIVE_STRING } }), "CredentialsFilterSensitiveLog"); AssumeRoleResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) } }), "AssumeRoleResponseFilterSensitiveLog"); AssumeRoleWithSAMLRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.SAMLAssertion && { SAMLAssertion: SENSITIVE_STRING } }), "AssumeRoleWithSAMLRequestFilterSensitiveLog"); AssumeRoleWithSAMLResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) } }), "AssumeRoleWithSAMLResponseFilterSensitiveLog"); AssumeRoleWithWebIdentityRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.WebIdentityToken && { WebIdentityToken: SENSITIVE_STRING } }), "AssumeRoleWithWebIdentityRequestFilterSensitiveLog"); AssumeRoleWithWebIdentityResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) } }), "AssumeRoleWithWebIdentityResponseFilterSensitiveLog"); AssumeRootResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) } }), "AssumeRootResponseFilterSensitiveLog"); GetFederationTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) } }), "GetFederationTokenResponseFilterSensitiveLog"); GetSessionTokenResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.Credentials && { Credentials: CredentialsFilterSensitiveLog(obj.Credentials) } }), "GetSessionTokenResponseFilterSensitiveLog"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/protocols/Aws_query.js var se_AssumeRoleCommand, se_AssumeRoleWithSAMLCommand, se_AssumeRoleWithWebIdentityCommand, se_AssumeRootCommand, se_DecodeAuthorizationMessageCommand, se_GetAccessKeyInfoCommand, se_GetCallerIdentityCommand, se_GetFederationTokenCommand, se_GetSessionTokenCommand, de_AssumeRoleCommand, de_AssumeRoleWithSAMLCommand, de_AssumeRoleWithWebIdentityCommand, de_AssumeRootCommand, de_DecodeAuthorizationMessageCommand, de_GetAccessKeyInfoCommand, de_GetCallerIdentityCommand, de_GetFederationTokenCommand, de_GetSessionTokenCommand, de_CommandError4, de_ExpiredTokenExceptionRes2, de_IDPCommunicationErrorExceptionRes, de_IDPRejectedClaimExceptionRes, de_InvalidAuthorizationMessageExceptionRes, de_InvalidIdentityTokenExceptionRes, de_MalformedPolicyDocumentExceptionRes, de_PackedPolicyTooLargeExceptionRes, de_RegionDisabledExceptionRes, se_AssumeRoleRequest, se_AssumeRoleWithSAMLRequest, se_AssumeRoleWithWebIdentityRequest, se_AssumeRootRequest, se_DecodeAuthorizationMessageRequest, se_GetAccessKeyInfoRequest, se_GetCallerIdentityRequest, se_GetFederationTokenRequest, se_GetSessionTokenRequest, se_policyDescriptorListType, se_PolicyDescriptorType, se_ProvidedContext, se_ProvidedContextsListType, se_Tag, se_tagKeyListType, se_tagListType, de_AssumedRoleUser, de_AssumeRoleResponse, de_AssumeRoleWithSAMLResponse, de_AssumeRoleWithWebIdentityResponse, de_AssumeRootResponse, de_Credentials, de_DecodeAuthorizationMessageResponse, de_ExpiredTokenException, de_FederatedUser, de_GetAccessKeyInfoResponse, de_GetCallerIdentityResponse, de_GetFederationTokenResponse, de_GetSessionTokenResponse, de_IDPCommunicationErrorException, de_IDPRejectedClaimException, de_InvalidAuthorizationMessageException, de_InvalidIdentityTokenException, de_MalformedPolicyDocumentException, de_PackedPolicyTooLargeException, de_RegionDisabledException, deserializeMetadata5, throwDefaultError5, buildHttpRpcRequest, SHARED_HEADERS, _3, _A, _AKI2, _AR, _ARI, _ARU, _ARWSAML, _ARWWI, _ARs, _Ac, _Ar, _Au, _C2, _CA, _DAM, _DM, _DS, _E, _EI, _EM, _FU, _FUI, _GAKI, _GCI, _GFT, _GST, _I, _K, _N, _NQ, _P, _PA, _PAr, _PAro, _PC, _PI, _PPS, _Pr, _RA, _RSN, _S, _SAK2, _SAMLA, _SFWIT, _SI, _SN, _ST2, _STe, _T, _TC, _TP, _TPA, _TTK, _UI, _V, _Va, _WIT, _a2, _m, buildFormUrlencodedString, loadQueryErrorCode; var init_Aws_query = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/protocols/Aws_query.js"() { init_import_meta_url(); init_dist_es20(); init_dist_es2(); init_dist_es19(); init_models_03(); init_STSServiceException(); se_AssumeRoleCommand = /* @__PURE__ */ __name(async (input, context2) => { const headers = SHARED_HEADERS; let body; body = buildFormUrlencodedString({ ...se_AssumeRoleRequest(input, context2), [_A]: _AR, [_V]: _3 }); return buildHttpRpcRequest(context2, headers, "/", void 0, body); }, "se_AssumeRoleCommand"); se_AssumeRoleWithSAMLCommand = /* @__PURE__ */ __name(async (input, context2) => { const headers = SHARED_HEADERS; let body; body = buildFormUrlencodedString({ ...se_AssumeRoleWithSAMLRequest(input, context2), [_A]: _ARWSAML, [_V]: _3 }); return buildHttpRpcRequest(context2, headers, "/", void 0, body); }, "se_AssumeRoleWithSAMLCommand"); se_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (input, context2) => { const headers = SHARED_HEADERS; let body; body = buildFormUrlencodedString({ ...se_AssumeRoleWithWebIdentityRequest(input, context2), [_A]: _ARWWI, [_V]: _3 }); return buildHttpRpcRequest(context2, headers, "/", void 0, body); }, "se_AssumeRoleWithWebIdentityCommand"); se_AssumeRootCommand = /* @__PURE__ */ __name(async (input, context2) => { const headers = SHARED_HEADERS; let body; body = buildFormUrlencodedString({ ...se_AssumeRootRequest(input, context2), [_A]: _ARs, [_V]: _3 }); return buildHttpRpcRequest(context2, headers, "/", void 0, body); }, "se_AssumeRootCommand"); se_DecodeAuthorizationMessageCommand = /* @__PURE__ */ __name(async (input, context2) => { const headers = SHARED_HEADERS; let body; body = buildFormUrlencodedString({ ...se_DecodeAuthorizationMessageRequest(input, context2), [_A]: _DAM, [_V]: _3 }); return buildHttpRpcRequest(context2, headers, "/", void 0, body); }, "se_DecodeAuthorizationMessageCommand"); se_GetAccessKeyInfoCommand = /* @__PURE__ */ __name(async (input, context2) => { const headers = SHARED_HEADERS; let body; body = buildFormUrlencodedString({ ...se_GetAccessKeyInfoRequest(input, context2), [_A]: _GAKI, [_V]: _3 }); return buildHttpRpcRequest(context2, headers, "/", void 0, body); }, "se_GetAccessKeyInfoCommand"); se_GetCallerIdentityCommand = /* @__PURE__ */ __name(async (input, context2) => { const headers = SHARED_HEADERS; let body; body = buildFormUrlencodedString({ ...se_GetCallerIdentityRequest(input, context2), [_A]: _GCI, [_V]: _3 }); return buildHttpRpcRequest(context2, headers, "/", void 0, body); }, "se_GetCallerIdentityCommand"); se_GetFederationTokenCommand = /* @__PURE__ */ __name(async (input, context2) => { const headers = SHARED_HEADERS; let body; body = buildFormUrlencodedString({ ...se_GetFederationTokenRequest(input, context2), [_A]: _GFT, [_V]: _3 }); return buildHttpRpcRequest(context2, headers, "/", void 0, body); }, "se_GetFederationTokenCommand"); se_GetSessionTokenCommand = /* @__PURE__ */ __name(async (input, context2) => { const headers = SHARED_HEADERS; let body; body = buildFormUrlencodedString({ ...se_GetSessionTokenRequest(input, context2), [_A]: _GST, [_V]: _3 }); return buildHttpRpcRequest(context2, headers, "/", void 0, body); }, "se_GetSessionTokenCommand"); de_AssumeRoleCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode >= 300) { return de_CommandError4(output, context2); } const data = await parseXmlBody(output.body, context2); let contents = {}; contents = de_AssumeRoleResponse(data.AssumeRoleResult, context2); const response = { $metadata: deserializeMetadata5(output), ...contents }; return response; }, "de_AssumeRoleCommand"); de_AssumeRoleWithSAMLCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode >= 300) { return de_CommandError4(output, context2); } const data = await parseXmlBody(output.body, context2); let contents = {}; contents = de_AssumeRoleWithSAMLResponse(data.AssumeRoleWithSAMLResult, context2); const response = { $metadata: deserializeMetadata5(output), ...contents }; return response; }, "de_AssumeRoleWithSAMLCommand"); de_AssumeRoleWithWebIdentityCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode >= 300) { return de_CommandError4(output, context2); } const data = await parseXmlBody(output.body, context2); let contents = {}; contents = de_AssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context2); const response = { $metadata: deserializeMetadata5(output), ...contents }; return response; }, "de_AssumeRoleWithWebIdentityCommand"); de_AssumeRootCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode >= 300) { return de_CommandError4(output, context2); } const data = await parseXmlBody(output.body, context2); let contents = {}; contents = de_AssumeRootResponse(data.AssumeRootResult, context2); const response = { $metadata: deserializeMetadata5(output), ...contents }; return response; }, "de_AssumeRootCommand"); de_DecodeAuthorizationMessageCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode >= 300) { return de_CommandError4(output, context2); } const data = await parseXmlBody(output.body, context2); let contents = {}; contents = de_DecodeAuthorizationMessageResponse(data.DecodeAuthorizationMessageResult, context2); const response = { $metadata: deserializeMetadata5(output), ...contents }; return response; }, "de_DecodeAuthorizationMessageCommand"); de_GetAccessKeyInfoCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode >= 300) { return de_CommandError4(output, context2); } const data = await parseXmlBody(output.body, context2); let contents = {}; contents = de_GetAccessKeyInfoResponse(data.GetAccessKeyInfoResult, context2); const response = { $metadata: deserializeMetadata5(output), ...contents }; return response; }, "de_GetAccessKeyInfoCommand"); de_GetCallerIdentityCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode >= 300) { return de_CommandError4(output, context2); } const data = await parseXmlBody(output.body, context2); let contents = {}; contents = de_GetCallerIdentityResponse(data.GetCallerIdentityResult, context2); const response = { $metadata: deserializeMetadata5(output), ...contents }; return response; }, "de_GetCallerIdentityCommand"); de_GetFederationTokenCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode >= 300) { return de_CommandError4(output, context2); } const data = await parseXmlBody(output.body, context2); let contents = {}; contents = de_GetFederationTokenResponse(data.GetFederationTokenResult, context2); const response = { $metadata: deserializeMetadata5(output), ...contents }; return response; }, "de_GetFederationTokenCommand"); de_GetSessionTokenCommand = /* @__PURE__ */ __name(async (output, context2) => { if (output.statusCode >= 300) { return de_CommandError4(output, context2); } const data = await parseXmlBody(output.body, context2); let contents = {}; contents = de_GetSessionTokenResponse(data.GetSessionTokenResult, context2); const response = { $metadata: deserializeMetadata5(output), ...contents }; return response; }, "de_GetSessionTokenCommand"); de_CommandError4 = /* @__PURE__ */ __name(async (output, context2) => { const parsedOutput = { ...output, body: await parseXmlErrorBody(output.body, context2) }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { case "ExpiredTokenException": case "com.amazonaws.sts#ExpiredTokenException": throw await de_ExpiredTokenExceptionRes2(parsedOutput, context2); case "MalformedPolicyDocument": case "com.amazonaws.sts#MalformedPolicyDocumentException": throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context2); case "PackedPolicyTooLarge": case "com.amazonaws.sts#PackedPolicyTooLargeException": throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context2); case "RegionDisabledException": case "com.amazonaws.sts#RegionDisabledException": throw await de_RegionDisabledExceptionRes(parsedOutput, context2); case "IDPRejectedClaim": case "com.amazonaws.sts#IDPRejectedClaimException": throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context2); case "InvalidIdentityToken": case "com.amazonaws.sts#InvalidIdentityTokenException": throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context2); case "IDPCommunicationError": case "com.amazonaws.sts#IDPCommunicationErrorException": throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context2); case "InvalidAuthorizationMessageException": case "com.amazonaws.sts#InvalidAuthorizationMessageException": throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context2); default: const parsedBody = parsedOutput.body; return throwDefaultError5({ output, parsedBody: parsedBody.Error, errorCode }); } }, "de_CommandError"); de_ExpiredTokenExceptionRes2 = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const body = parsedOutput.body; const deserialized = de_ExpiredTokenException(body.Error, context2); const exception = new ExpiredTokenException2({ $metadata: deserializeMetadata5(parsedOutput), ...deserialized }); return decorateServiceException(exception, body); }, "de_ExpiredTokenExceptionRes"); de_IDPCommunicationErrorExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const body = parsedOutput.body; const deserialized = de_IDPCommunicationErrorException(body.Error, context2); const exception = new IDPCommunicationErrorException({ $metadata: deserializeMetadata5(parsedOutput), ...deserialized }); return decorateServiceException(exception, body); }, "de_IDPCommunicationErrorExceptionRes"); de_IDPRejectedClaimExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const body = parsedOutput.body; const deserialized = de_IDPRejectedClaimException(body.Error, context2); const exception = new IDPRejectedClaimException({ $metadata: deserializeMetadata5(parsedOutput), ...deserialized }); return decorateServiceException(exception, body); }, "de_IDPRejectedClaimExceptionRes"); de_InvalidAuthorizationMessageExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const body = parsedOutput.body; const deserialized = de_InvalidAuthorizationMessageException(body.Error, context2); const exception = new InvalidAuthorizationMessageException({ $metadata: deserializeMetadata5(parsedOutput), ...deserialized }); return decorateServiceException(exception, body); }, "de_InvalidAuthorizationMessageExceptionRes"); de_InvalidIdentityTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const body = parsedOutput.body; const deserialized = de_InvalidIdentityTokenException(body.Error, context2); const exception = new InvalidIdentityTokenException({ $metadata: deserializeMetadata5(parsedOutput), ...deserialized }); return decorateServiceException(exception, body); }, "de_InvalidIdentityTokenExceptionRes"); de_MalformedPolicyDocumentExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const body = parsedOutput.body; const deserialized = de_MalformedPolicyDocumentException(body.Error, context2); const exception = new MalformedPolicyDocumentException({ $metadata: deserializeMetadata5(parsedOutput), ...deserialized }); return decorateServiceException(exception, body); }, "de_MalformedPolicyDocumentExceptionRes"); de_PackedPolicyTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const body = parsedOutput.body; const deserialized = de_PackedPolicyTooLargeException(body.Error, context2); const exception = new PackedPolicyTooLargeException({ $metadata: deserializeMetadata5(parsedOutput), ...deserialized }); return decorateServiceException(exception, body); }, "de_PackedPolicyTooLargeExceptionRes"); de_RegionDisabledExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context2) => { const body = parsedOutput.body; const deserialized = de_RegionDisabledException(body.Error, context2); const exception = new RegionDisabledException({ $metadata: deserializeMetadata5(parsedOutput), ...deserialized }); return decorateServiceException(exception, body); }, "de_RegionDisabledExceptionRes"); se_AssumeRoleRequest = /* @__PURE__ */ __name((input, context2) => { const entries = {}; if (input[_RA] != null) { entries[_RA] = input[_RA]; } if (input[_RSN] != null) { entries[_RSN] = input[_RSN]; } if (input[_PA] != null) { const memberEntries = se_policyDescriptorListType(input[_PA], context2); if (input[_PA]?.length === 0) { entries.PolicyArns = []; } Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyArns.${key}`; entries[loc] = value; }); } if (input[_P] != null) { entries[_P] = input[_P]; } if (input[_DS] != null) { entries[_DS] = input[_DS]; } if (input[_T] != null) { const memberEntries = se_tagListType(input[_T], context2); if (input[_T]?.length === 0) { entries.Tags = []; } Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } if (input[_TTK] != null) { const memberEntries = se_tagKeyListType(input[_TTK], context2); if (input[_TTK]?.length === 0) { entries.TransitiveTagKeys = []; } Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TransitiveTagKeys.${key}`; entries[loc] = value; }); } if (input[_EI] != null) { entries[_EI] = input[_EI]; } if (input[_SN] != null) { entries[_SN] = input[_SN]; } if (input[_TC] != null) { entries[_TC] = input[_TC]; } if (input[_SI] != null) { entries[_SI] = input[_SI]; } if (input[_PC] != null) { const memberEntries = se_ProvidedContextsListType(input[_PC], context2); if (input[_PC]?.length === 0) { entries.ProvidedContexts = []; } Object.entries(memberEntries).forEach(([key, value]) => { const loc = `ProvidedContexts.${key}`; entries[loc] = value; }); } return entries; }, "se_AssumeRoleRequest"); se_AssumeRoleWithSAMLRequest = /* @__PURE__ */ __name((input, context2) => { const entries = {}; if (input[_RA] != null) { entries[_RA] = input[_RA]; } if (input[_PAr] != null) { entries[_PAr] = input[_PAr]; } if (input[_SAMLA] != null) { entries[_SAMLA] = input[_SAMLA]; } if (input[_PA] != null) { const memberEntries = se_policyDescriptorListType(input[_PA], context2); if (input[_PA]?.length === 0) { entries.PolicyArns = []; } Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyArns.${key}`; entries[loc] = value; }); } if (input[_P] != null) { entries[_P] = input[_P]; } if (input[_DS] != null) { entries[_DS] = input[_DS]; } return entries; }, "se_AssumeRoleWithSAMLRequest"); se_AssumeRoleWithWebIdentityRequest = /* @__PURE__ */ __name((input, context2) => { const entries = {}; if (input[_RA] != null) { entries[_RA] = input[_RA]; } if (input[_RSN] != null) { entries[_RSN] = input[_RSN]; } if (input[_WIT] != null) { entries[_WIT] = input[_WIT]; } if (input[_PI] != null) { entries[_PI] = input[_PI]; } if (input[_PA] != null) { const memberEntries = se_policyDescriptorListType(input[_PA], context2); if (input[_PA]?.length === 0) { entries.PolicyArns = []; } Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyArns.${key}`; entries[loc] = value; }); } if (input[_P] != null) { entries[_P] = input[_P]; } if (input[_DS] != null) { entries[_DS] = input[_DS]; } return entries; }, "se_AssumeRoleWithWebIdentityRequest"); se_AssumeRootRequest = /* @__PURE__ */ __name((input, context2) => { const entries = {}; if (input[_TP] != null) { entries[_TP] = input[_TP]; } if (input[_TPA] != null) { const memberEntries = se_PolicyDescriptorType(input[_TPA], context2); Object.entries(memberEntries).forEach(([key, value]) => { const loc = `TaskPolicyArn.${key}`; entries[loc] = value; }); } if (input[_DS] != null) { entries[_DS] = input[_DS]; } return entries; }, "se_AssumeRootRequest"); se_DecodeAuthorizationMessageRequest = /* @__PURE__ */ __name((input, context2) => { const entries = {}; if (input[_EM] != null) { entries[_EM] = input[_EM]; } return entries; }, "se_DecodeAuthorizationMessageRequest"); se_GetAccessKeyInfoRequest = /* @__PURE__ */ __name((input, context2) => { const entries = {}; if (input[_AKI2] != null) { entries[_AKI2] = input[_AKI2]; } return entries; }, "se_GetAccessKeyInfoRequest"); se_GetCallerIdentityRequest = /* @__PURE__ */ __name((input, context2) => { const entries = {}; return entries; }, "se_GetCallerIdentityRequest"); se_GetFederationTokenRequest = /* @__PURE__ */ __name((input, context2) => { const entries = {}; if (input[_N] != null) { entries[_N] = input[_N]; } if (input[_P] != null) { entries[_P] = input[_P]; } if (input[_PA] != null) { const memberEntries = se_policyDescriptorListType(input[_PA], context2); if (input[_PA]?.length === 0) { entries.PolicyArns = []; } Object.entries(memberEntries).forEach(([key, value]) => { const loc = `PolicyArns.${key}`; entries[loc] = value; }); } if (input[_DS] != null) { entries[_DS] = input[_DS]; } if (input[_T] != null) { const memberEntries = se_tagListType(input[_T], context2); if (input[_T]?.length === 0) { entries.Tags = []; } Object.entries(memberEntries).forEach(([key, value]) => { const loc = `Tags.${key}`; entries[loc] = value; }); } return entries; }, "se_GetFederationTokenRequest"); se_GetSessionTokenRequest = /* @__PURE__ */ __name((input, context2) => { const entries = {}; if (input[_DS] != null) { entries[_DS] = input[_DS]; } if (input[_SN] != null) { entries[_SN] = input[_SN]; } if (input[_TC] != null) { entries[_TC] = input[_TC]; } return entries; }, "se_GetSessionTokenRequest"); se_policyDescriptorListType = /* @__PURE__ */ __name((input, context2) => { const entries = {}; let counter = 1; for (const entry of input) { if (entry === null) { continue; } const memberEntries = se_PolicyDescriptorType(entry, context2); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; }); counter++; } return entries; }, "se_policyDescriptorListType"); se_PolicyDescriptorType = /* @__PURE__ */ __name((input, context2) => { const entries = {}; if (input[_a2] != null) { entries[_a2] = input[_a2]; } return entries; }, "se_PolicyDescriptorType"); se_ProvidedContext = /* @__PURE__ */ __name((input, context2) => { const entries = {}; if (input[_PAro] != null) { entries[_PAro] = input[_PAro]; } if (input[_CA] != null) { entries[_CA] = input[_CA]; } return entries; }, "se_ProvidedContext"); se_ProvidedContextsListType = /* @__PURE__ */ __name((input, context2) => { const entries = {}; let counter = 1; for (const entry of input) { if (entry === null) { continue; } const memberEntries = se_ProvidedContext(entry, context2); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; }); counter++; } return entries; }, "se_ProvidedContextsListType"); se_Tag = /* @__PURE__ */ __name((input, context2) => { const entries = {}; if (input[_K] != null) { entries[_K] = input[_K]; } if (input[_Va] != null) { entries[_Va] = input[_Va]; } return entries; }, "se_Tag"); se_tagKeyListType = /* @__PURE__ */ __name((input, context2) => { const entries = {}; let counter = 1; for (const entry of input) { if (entry === null) { continue; } entries[`member.${counter}`] = entry; counter++; } return entries; }, "se_tagKeyListType"); se_tagListType = /* @__PURE__ */ __name((input, context2) => { const entries = {}; let counter = 1; for (const entry of input) { if (entry === null) { continue; } const memberEntries = se_Tag(entry, context2); Object.entries(memberEntries).forEach(([key, value]) => { entries[`member.${counter}.${key}`] = value; }); counter++; } return entries; }, "se_tagListType"); de_AssumedRoleUser = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_ARI] != null) { contents[_ARI] = expectString(output[_ARI]); } if (output[_Ar] != null) { contents[_Ar] = expectString(output[_Ar]); } return contents; }, "de_AssumedRoleUser"); de_AssumeRoleResponse = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_C2] != null) { contents[_C2] = de_Credentials(output[_C2], context2); } if (output[_ARU] != null) { contents[_ARU] = de_AssumedRoleUser(output[_ARU], context2); } if (output[_PPS] != null) { contents[_PPS] = strictParseInt32(output[_PPS]); } if (output[_SI] != null) { contents[_SI] = expectString(output[_SI]); } return contents; }, "de_AssumeRoleResponse"); de_AssumeRoleWithSAMLResponse = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_C2] != null) { contents[_C2] = de_Credentials(output[_C2], context2); } if (output[_ARU] != null) { contents[_ARU] = de_AssumedRoleUser(output[_ARU], context2); } if (output[_PPS] != null) { contents[_PPS] = strictParseInt32(output[_PPS]); } if (output[_S] != null) { contents[_S] = expectString(output[_S]); } if (output[_ST2] != null) { contents[_ST2] = expectString(output[_ST2]); } if (output[_I] != null) { contents[_I] = expectString(output[_I]); } if (output[_Au] != null) { contents[_Au] = expectString(output[_Au]); } if (output[_NQ] != null) { contents[_NQ] = expectString(output[_NQ]); } if (output[_SI] != null) { contents[_SI] = expectString(output[_SI]); } return contents; }, "de_AssumeRoleWithSAMLResponse"); de_AssumeRoleWithWebIdentityResponse = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_C2] != null) { contents[_C2] = de_Credentials(output[_C2], context2); } if (output[_SFWIT] != null) { contents[_SFWIT] = expectString(output[_SFWIT]); } if (output[_ARU] != null) { contents[_ARU] = de_AssumedRoleUser(output[_ARU], context2); } if (output[_PPS] != null) { contents[_PPS] = strictParseInt32(output[_PPS]); } if (output[_Pr] != null) { contents[_Pr] = expectString(output[_Pr]); } if (output[_Au] != null) { contents[_Au] = expectString(output[_Au]); } if (output[_SI] != null) { contents[_SI] = expectString(output[_SI]); } return contents; }, "de_AssumeRoleWithWebIdentityResponse"); de_AssumeRootResponse = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_C2] != null) { contents[_C2] = de_Credentials(output[_C2], context2); } if (output[_SI] != null) { contents[_SI] = expectString(output[_SI]); } return contents; }, "de_AssumeRootResponse"); de_Credentials = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_AKI2] != null) { contents[_AKI2] = expectString(output[_AKI2]); } if (output[_SAK2] != null) { contents[_SAK2] = expectString(output[_SAK2]); } if (output[_STe] != null) { contents[_STe] = expectString(output[_STe]); } if (output[_E] != null) { contents[_E] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_E])); } return contents; }, "de_Credentials"); de_DecodeAuthorizationMessageResponse = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_DM] != null) { contents[_DM] = expectString(output[_DM]); } return contents; }, "de_DecodeAuthorizationMessageResponse"); de_ExpiredTokenException = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_m] != null) { contents[_m] = expectString(output[_m]); } return contents; }, "de_ExpiredTokenException"); de_FederatedUser = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_FUI] != null) { contents[_FUI] = expectString(output[_FUI]); } if (output[_Ar] != null) { contents[_Ar] = expectString(output[_Ar]); } return contents; }, "de_FederatedUser"); de_GetAccessKeyInfoResponse = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_Ac] != null) { contents[_Ac] = expectString(output[_Ac]); } return contents; }, "de_GetAccessKeyInfoResponse"); de_GetCallerIdentityResponse = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_UI] != null) { contents[_UI] = expectString(output[_UI]); } if (output[_Ac] != null) { contents[_Ac] = expectString(output[_Ac]); } if (output[_Ar] != null) { contents[_Ar] = expectString(output[_Ar]); } return contents; }, "de_GetCallerIdentityResponse"); de_GetFederationTokenResponse = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_C2] != null) { contents[_C2] = de_Credentials(output[_C2], context2); } if (output[_FU] != null) { contents[_FU] = de_FederatedUser(output[_FU], context2); } if (output[_PPS] != null) { contents[_PPS] = strictParseInt32(output[_PPS]); } return contents; }, "de_GetFederationTokenResponse"); de_GetSessionTokenResponse = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_C2] != null) { contents[_C2] = de_Credentials(output[_C2], context2); } return contents; }, "de_GetSessionTokenResponse"); de_IDPCommunicationErrorException = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_m] != null) { contents[_m] = expectString(output[_m]); } return contents; }, "de_IDPCommunicationErrorException"); de_IDPRejectedClaimException = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_m] != null) { contents[_m] = expectString(output[_m]); } return contents; }, "de_IDPRejectedClaimException"); de_InvalidAuthorizationMessageException = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_m] != null) { contents[_m] = expectString(output[_m]); } return contents; }, "de_InvalidAuthorizationMessageException"); de_InvalidIdentityTokenException = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_m] != null) { contents[_m] = expectString(output[_m]); } return contents; }, "de_InvalidIdentityTokenException"); de_MalformedPolicyDocumentException = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_m] != null) { contents[_m] = expectString(output[_m]); } return contents; }, "de_MalformedPolicyDocumentException"); de_PackedPolicyTooLargeException = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_m] != null) { contents[_m] = expectString(output[_m]); } return contents; }, "de_PackedPolicyTooLargeException"); de_RegionDisabledException = /* @__PURE__ */ __name((output, context2) => { const contents = {}; if (output[_m] != null) { contents[_m] = expectString(output[_m]); } return contents; }, "de_RegionDisabledException"); deserializeMetadata5 = /* @__PURE__ */ __name((output) => ({ httpStatusCode: output.statusCode, requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], extendedRequestId: output.headers["x-amz-id-2"], cfId: output.headers["x-amz-cf-id"] }), "deserializeMetadata"); throwDefaultError5 = withBaseException(STSServiceException); buildHttpRpcRequest = /* @__PURE__ */ __name(async (context2, headers, path72, resolvedHostname, body) => { const { hostname: hostname2, protocol = "https", port, path: basePath } = await context2.endpoint(); const contents = { protocol, hostname: hostname2, port, method: "POST", path: basePath.endsWith("/") ? basePath.slice(0, -1) + path72 : basePath + path72, headers }; if (resolvedHostname !== void 0) { contents.hostname = resolvedHostname; } if (body !== void 0) { contents.body = body; } return new HttpRequest(contents); }, "buildHttpRpcRequest"); SHARED_HEADERS = { "content-type": "application/x-www-form-urlencoded" }; _3 = "2011-06-15"; _A = "Action"; _AKI2 = "AccessKeyId"; _AR = "AssumeRole"; _ARI = "AssumedRoleId"; _ARU = "AssumedRoleUser"; _ARWSAML = "AssumeRoleWithSAML"; _ARWWI = "AssumeRoleWithWebIdentity"; _ARs = "AssumeRoot"; _Ac = "Account"; _Ar = "Arn"; _Au = "Audience"; _C2 = "Credentials"; _CA = "ContextAssertion"; _DAM = "DecodeAuthorizationMessage"; _DM = "DecodedMessage"; _DS = "DurationSeconds"; _E = "Expiration"; _EI = "ExternalId"; _EM = "EncodedMessage"; _FU = "FederatedUser"; _FUI = "FederatedUserId"; _GAKI = "GetAccessKeyInfo"; _GCI = "GetCallerIdentity"; _GFT = "GetFederationToken"; _GST = "GetSessionToken"; _I = "Issuer"; _K = "Key"; _N = "Name"; _NQ = "NameQualifier"; _P = "Policy"; _PA = "PolicyArns"; _PAr = "PrincipalArn"; _PAro = "ProviderArn"; _PC = "ProvidedContexts"; _PI = "ProviderId"; _PPS = "PackedPolicySize"; _Pr = "Provider"; _RA = "RoleArn"; _RSN = "RoleSessionName"; _S = "Subject"; _SAK2 = "SecretAccessKey"; _SAMLA = "SAMLAssertion"; _SFWIT = "SubjectFromWebIdentityToken"; _SI = "SourceIdentity"; _SN = "SerialNumber"; _ST2 = "SubjectType"; _STe = "SessionToken"; _T = "Tags"; _TC = "TokenCode"; _TP = "TargetPrincipal"; _TPA = "TaskPolicyArn"; _TTK = "TransitiveTagKeys"; _UI = "UserId"; _V = "Version"; _Va = "Value"; _WIT = "WebIdentityToken"; _a2 = "arn"; _m = "message"; buildFormUrlencodedString = /* @__PURE__ */ __name((formEntries) => Object.entries(formEntries).map(([key, value]) => extendedEncodeURIComponent(key) + "=" + extendedEncodeURIComponent(value)).join("&"), "buildFormUrlencodedString"); loadQueryErrorCode = /* @__PURE__ */ __name((output, data) => { if (data.Error?.Code !== void 0) { return data.Error.Code; } if (output.statusCode == 404) { return "NotFound"; } }, "loadQueryErrorCode"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleCommand.js var AssumeRoleCommand; var init_AssumeRoleCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters3(); init_models_03(); init_Aws_query(); AssumeRoleCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").f(void 0, AssumeRoleResponseFilterSensitiveLog).ser(se_AssumeRoleCommand).de(de_AssumeRoleCommand).build() { }; __name(AssumeRoleCommand, "AssumeRoleCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithSAMLCommand.js var AssumeRoleWithSAMLCommand; var init_AssumeRoleWithSAMLCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithSAMLCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters3(); init_models_03(); init_Aws_query(); AssumeRoleWithSAMLCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithSAML", {}).n("STSClient", "AssumeRoleWithSAMLCommand").f(AssumeRoleWithSAMLRequestFilterSensitiveLog, AssumeRoleWithSAMLResponseFilterSensitiveLog).ser(se_AssumeRoleWithSAMLCommand).de(de_AssumeRoleWithSAMLCommand).build() { }; __name(AssumeRoleWithSAMLCommand, "AssumeRoleWithSAMLCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithWebIdentityCommand.js var AssumeRoleWithWebIdentityCommand; var init_AssumeRoleWithWebIdentityCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRoleWithWebIdentityCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters3(); init_models_03(); init_Aws_query(); AssumeRoleWithWebIdentityCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").f(AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog).ser(se_AssumeRoleWithWebIdentityCommand).de(de_AssumeRoleWithWebIdentityCommand).build() { }; __name(AssumeRoleWithWebIdentityCommand, "AssumeRoleWithWebIdentityCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRootCommand.js var AssumeRootCommand; var init_AssumeRootCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/AssumeRootCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters3(); init_models_03(); init_Aws_query(); AssumeRootCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoot", {}).n("STSClient", "AssumeRootCommand").f(void 0, AssumeRootResponseFilterSensitiveLog).ser(se_AssumeRootCommand).de(de_AssumeRootCommand).build() { }; __name(AssumeRootCommand, "AssumeRootCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/DecodeAuthorizationMessageCommand.js var DecodeAuthorizationMessageCommand; var init_DecodeAuthorizationMessageCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/DecodeAuthorizationMessageCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters3(); init_Aws_query(); DecodeAuthorizationMessageCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "DecodeAuthorizationMessage", {}).n("STSClient", "DecodeAuthorizationMessageCommand").f(void 0, void 0).ser(se_DecodeAuthorizationMessageCommand).de(de_DecodeAuthorizationMessageCommand).build() { }; __name(DecodeAuthorizationMessageCommand, "DecodeAuthorizationMessageCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetAccessKeyInfoCommand.js var GetAccessKeyInfoCommand; var init_GetAccessKeyInfoCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetAccessKeyInfoCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters3(); init_Aws_query(); GetAccessKeyInfoCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "GetAccessKeyInfo", {}).n("STSClient", "GetAccessKeyInfoCommand").f(void 0, void 0).ser(se_GetAccessKeyInfoCommand).de(de_GetAccessKeyInfoCommand).build() { }; __name(GetAccessKeyInfoCommand, "GetAccessKeyInfoCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetCallerIdentityCommand.js var GetCallerIdentityCommand; var init_GetCallerIdentityCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetCallerIdentityCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters3(); init_Aws_query(); GetCallerIdentityCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "GetCallerIdentity", {}).n("STSClient", "GetCallerIdentityCommand").f(void 0, void 0).ser(se_GetCallerIdentityCommand).de(de_GetCallerIdentityCommand).build() { }; __name(GetCallerIdentityCommand, "GetCallerIdentityCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetFederationTokenCommand.js var GetFederationTokenCommand; var init_GetFederationTokenCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetFederationTokenCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters3(); init_models_03(); init_Aws_query(); GetFederationTokenCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "GetFederationToken", {}).n("STSClient", "GetFederationTokenCommand").f(void 0, GetFederationTokenResponseFilterSensitiveLog).ser(se_GetFederationTokenCommand).de(de_GetFederationTokenCommand).build() { }; __name(GetFederationTokenCommand, "GetFederationTokenCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetSessionTokenCommand.js var GetSessionTokenCommand; var init_GetSessionTokenCommand = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/GetSessionTokenCommand.js"() { init_import_meta_url(); init_dist_es34(); init_dist_es4(); init_dist_es19(); init_EndpointParameters3(); init_models_03(); init_Aws_query(); GetSessionTokenCommand = class extends Command.classBuilder().ep(commonParams4).m(function(Command2, cs3, config, o5) { return [ getSerdePlugin(config, this.serialize, this.deserialize), getEndpointPlugin(config, Command2.getEndpointParameterInstructions()) ]; }).s("AWSSecurityTokenServiceV20110615", "GetSessionToken", {}).n("STSClient", "GetSessionTokenCommand").f(void 0, GetSessionTokenResponseFilterSensitiveLog).ser(se_GetSessionTokenCommand).de(de_GetSessionTokenCommand).build() { }; __name(GetSessionTokenCommand, "GetSessionTokenCommand"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/STS.js var commands3, STS; var init_STS = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/STS.js"() { init_import_meta_url(); init_dist_es19(); init_AssumeRoleCommand(); init_AssumeRoleWithSAMLCommand(); init_AssumeRoleWithWebIdentityCommand(); init_AssumeRootCommand(); init_DecodeAuthorizationMessageCommand(); init_GetAccessKeyInfoCommand(); init_GetCallerIdentityCommand(); init_GetFederationTokenCommand(); init_GetSessionTokenCommand(); init_STSClient(); commands3 = { AssumeRoleCommand, AssumeRoleWithSAMLCommand, AssumeRoleWithWebIdentityCommand, AssumeRootCommand, DecodeAuthorizationMessageCommand, GetAccessKeyInfoCommand, GetCallerIdentityCommand, GetFederationTokenCommand, GetSessionTokenCommand }; STS = class extends STSClient { }; __name(STS, "STS"); createAggregatedClient(commands3, STS); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/index.js var init_commands3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/commands/index.js"() { init_import_meta_url(); init_AssumeRoleCommand(); init_AssumeRoleWithSAMLCommand(); init_AssumeRoleWithWebIdentityCommand(); init_AssumeRootCommand(); init_DecodeAuthorizationMessageCommand(); init_GetAccessKeyInfoCommand(); init_GetCallerIdentityCommand(); init_GetFederationTokenCommand(); init_GetSessionTokenCommand(); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/models/index.js var init_models3 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/models/index.js"() { init_import_meta_url(); init_models_03(); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/defaultStsRoleAssumers.js var ASSUME_ROLE_DEFAULT_REGION, getAccountIdFromAssumedRoleUser, resolveRegion, getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity, isH2; var init_defaultStsRoleAssumers = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/defaultStsRoleAssumers.js"() { init_import_meta_url(); init_client2(); init_AssumeRoleCommand(); init_AssumeRoleWithWebIdentityCommand(); ASSUME_ROLE_DEFAULT_REGION = "us-east-1"; getAccountIdFromAssumedRoleUser = /* @__PURE__ */ __name((assumedRoleUser) => { if (typeof assumedRoleUser?.Arn === "string") { const arnComponents = assumedRoleUser.Arn.split(":"); if (arnComponents.length > 4 && arnComponents[4] !== "") { return arnComponents[4]; } } return void 0; }, "getAccountIdFromAssumedRoleUser"); resolveRegion = /* @__PURE__ */ __name(async (_region, _parentRegion, credentialProviderLogger) => { const region = typeof _region === "function" ? await _region() : _region; const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion; credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (provider)`, `${parentRegion} (parent client)`, `${ASSUME_ROLE_DEFAULT_REGION} (STS default)`); return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION; }, "resolveRegion"); getDefaultRoleAssumer = /* @__PURE__ */ __name((stsOptions, stsClientCtor) => { let stsClient; let closureSourceCreds; return async (sourceCreds, params) => { closureSourceCreds = sourceCreds; if (!stsClient) { const { logger: logger4 = stsOptions?.parentClientConfig?.logger, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger } = stsOptions; const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger); const isCompatibleRequestHandler = !isH2(requestHandler); stsClient = new stsClientCtor({ credentialDefaultProvider: () => async () => closureSourceCreds, region: resolvedRegion, requestHandler: isCompatibleRequestHandler ? requestHandler : void 0, logger: logger4 }); } const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleCommand(params)); if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`); } const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser); const credentials = { accessKeyId: Credentials.AccessKeyId, secretAccessKey: Credentials.SecretAccessKey, sessionToken: Credentials.SessionToken, expiration: Credentials.Expiration, ...Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }, ...accountId && { accountId } }; setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i"); return credentials; }; }, "getDefaultRoleAssumer"); getDefaultRoleAssumerWithWebIdentity = /* @__PURE__ */ __name((stsOptions, stsClientCtor) => { let stsClient; return async (params) => { if (!stsClient) { const { logger: logger4 = stsOptions?.parentClientConfig?.logger, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger } = stsOptions; const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger); const isCompatibleRequestHandler = !isH2(requestHandler); stsClient = new stsClientCtor({ region: resolvedRegion, requestHandler: isCompatibleRequestHandler ? requestHandler : void 0, logger: logger4 }); } const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleWithWebIdentityCommand(params)); if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`); } const accountId = getAccountIdFromAssumedRoleUser(AssumedRoleUser); const credentials = { accessKeyId: Credentials.AccessKeyId, secretAccessKey: Credentials.SecretAccessKey, sessionToken: Credentials.SessionToken, expiration: Credentials.Expiration, ...Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }, ...accountId && { accountId } }; if (accountId) { setCredentialFeature(credentials, "RESOLVED_ACCOUNT_ID", "T"); } setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k"); return credentials; }; }, "getDefaultRoleAssumerWithWebIdentity"); isH2 = /* @__PURE__ */ __name((requestHandler) => { return requestHandler?.metadata?.handlerProtocol === "h2"; }, "isH2"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/defaultRoleAssumers.js var getCustomizableStsClientCtor, getDefaultRoleAssumer2, getDefaultRoleAssumerWithWebIdentity2, decorateDefaultCredentialProvider; var init_defaultRoleAssumers = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/defaultRoleAssumers.js"() { init_import_meta_url(); init_defaultStsRoleAssumers(); init_STSClient(); getCustomizableStsClientCtor = /* @__PURE__ */ __name((baseCtor, customizations) => { if (!customizations) return baseCtor; else return /* @__PURE__ */ __name(class CustomizableSTSClient extends baseCtor { constructor(config) { super(config); for (const customization of customizations) { this.middlewareStack.use(customization); } } }, "CustomizableSTSClient"); }, "getCustomizableStsClientCtor"); getDefaultRoleAssumer2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumer(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins)), "getDefaultRoleAssumer"); getDefaultRoleAssumerWithWebIdentity2 = /* @__PURE__ */ __name((stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins)), "getDefaultRoleAssumerWithWebIdentity"); decorateDefaultCredentialProvider = /* @__PURE__ */ __name((provider) => (input) => provider({ roleAssumer: getDefaultRoleAssumer2(input), roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity2(input), ...input }), "decorateDefaultCredentialProvider"); } }); // ../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/index.js var dist_es_exports6 = {}; __export(dist_es_exports6, { $Command: () => Command, AssumeRoleCommand: () => AssumeRoleCommand, AssumeRoleResponseFilterSensitiveLog: () => AssumeRoleResponseFilterSensitiveLog, AssumeRoleWithSAMLCommand: () => AssumeRoleWithSAMLCommand, AssumeRoleWithSAMLRequestFilterSensitiveLog: () => AssumeRoleWithSAMLRequestFilterSensitiveLog, AssumeRoleWithSAMLResponseFilterSensitiveLog: () => AssumeRoleWithSAMLResponseFilterSensitiveLog, AssumeRoleWithWebIdentityCommand: () => AssumeRoleWithWebIdentityCommand, AssumeRoleWithWebIdentityRequestFilterSensitiveLog: () => AssumeRoleWithWebIdentityRequestFilterSensitiveLog, AssumeRoleWithWebIdentityResponseFilterSensitiveLog: () => AssumeRoleWithWebIdentityResponseFilterSensitiveLog, AssumeRootCommand: () => AssumeRootCommand, AssumeRootResponseFilterSensitiveLog: () => AssumeRootResponseFilterSensitiveLog, CredentialsFilterSensitiveLog: () => CredentialsFilterSensitiveLog, DecodeAuthorizationMessageCommand: () => DecodeAuthorizationMessageCommand, ExpiredTokenException: () => ExpiredTokenException2, GetAccessKeyInfoCommand: () => GetAccessKeyInfoCommand, GetCallerIdentityCommand: () => GetCallerIdentityCommand, GetFederationTokenCommand: () => GetFederationTokenCommand, GetFederationTokenResponseFilterSensitiveLog: () => GetFederationTokenResponseFilterSensitiveLog, GetSessionTokenCommand: () => GetSessionTokenCommand, GetSessionTokenResponseFilterSensitiveLog: () => GetSessionTokenResponseFilterSensitiveLog, IDPCommunicationErrorException: () => IDPCommunicationErrorException, IDPRejectedClaimException: () => IDPRejectedClaimException, InvalidAuthorizationMessageException: () => InvalidAuthorizationMessageException, InvalidIdentityTokenException: () => InvalidIdentityTokenException, MalformedPolicyDocumentException: () => MalformedPolicyDocumentException, PackedPolicyTooLargeException: () => PackedPolicyTooLargeException, RegionDisabledException: () => RegionDisabledException, STS: () => STS, STSClient: () => STSClient, STSServiceException: () => STSServiceException, __Client: () => Client, decorateDefaultCredentialProvider: () => decorateDefaultCredentialProvider, getDefaultRoleAssumer: () => getDefaultRoleAssumer2, getDefaultRoleAssumerWithWebIdentity: () => getDefaultRoleAssumerWithWebIdentity2 }); var init_dist_es50 = __esm({ "../../node_modules/.pnpm/@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/client-sts/dist-es/index.js"() { init_import_meta_url(); init_STSClient(); init_STS(); init_commands3(); init_models3(); init_defaultRoleAssumers(); init_STSServiceException(); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js var isAssumeRoleProfile, isAssumeRoleWithSourceProfile, isCredentialSourceProfile, resolveAssumeRoleCredentials, isCredentialSourceWithoutRoleArn; var init_resolveAssumeRoleCredentials = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js"() { init_import_meta_url(); init_client2(); init_dist_es16(); init_dist_es30(); init_resolveCredentialSource(); init_resolveProfileData(); isAssumeRoleProfile = /* @__PURE__ */ __name((arg, { profile = "default", logger: logger4 } = {}) => { return Boolean(arg) && typeof arg === "object" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1 && ["undefined", "string"].indexOf(typeof arg.external_id) > -1 && ["undefined", "string"].indexOf(typeof arg.mfa_serial) > -1 && (isAssumeRoleWithSourceProfile(arg, { profile, logger: logger4 }) || isCredentialSourceProfile(arg, { profile, logger: logger4 })); }, "isAssumeRoleProfile"); isAssumeRoleWithSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger: logger4 }) => { const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined"; if (withSourceProfile) { logger4?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`); } return withSourceProfile; }, "isAssumeRoleWithSourceProfile"); isCredentialSourceProfile = /* @__PURE__ */ __name((arg, { profile, logger: logger4 }) => { const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined"; if (withProviderProfile) { logger4?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`); } return withProviderProfile; }, "isCredentialSourceProfile"); resolveAssumeRoleCredentials = /* @__PURE__ */ __name(async (profileName, profiles, options32, visitedProfiles = {}) => { options32.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)"); const profileData = profiles[profileName]; const { source_profile, region } = profileData; if (!options32.roleAssumer) { const { getDefaultRoleAssumer: getDefaultRoleAssumer3 } = await Promise.resolve().then(() => (init_dist_es50(), dist_es_exports6)); options32.roleAssumer = getDefaultRoleAssumer3({ ...options32.clientConfig, credentialProviderLogger: options32.logger, parentClientConfig: { ...options32?.parentClientConfig, region: region ?? options32?.parentClientConfig?.region } }, options32.clientPlugins); } if (source_profile && source_profile in visitedProfiles) { throw new CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${getProfileName(options32)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "), { logger: options32.logger }); } options32.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`); const sourceCredsProvider = source_profile ? resolveProfileData(source_profile, profiles, options32, { ...visitedProfiles, [source_profile]: true }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})) : (await resolveCredentialSource(profileData.credential_source, profileName, options32.logger)(options32))(); if (isCredentialSourceWithoutRoleArn(profileData)) { return sourceCredsProvider.then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o")); } else { const params = { RoleArn: profileData.role_arn, RoleSessionName: profileData.role_session_name || `aws-sdk-js-${Date.now()}`, ExternalId: profileData.external_id, DurationSeconds: parseInt(profileData.duration_seconds || "3600", 10) }; const { mfa_serial } = profileData; if (mfa_serial) { if (!options32.mfaCodeProvider) { throw new CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options32.logger, tryNextLink: false }); } params.SerialNumber = mfa_serial; params.TokenCode = await options32.mfaCodeProvider(mfa_serial); } const sourceCreds = await sourceCredsProvider; return options32.roleAssumer(sourceCreds, params).then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o")); } }, "resolveAssumeRoleCredentials"); isCredentialSourceWithoutRoleArn = /* @__PURE__ */ __name((section) => { return !section.role_arn && !!section.credential_source; }, "isCredentialSourceWithoutRoleArn"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js var getValidatedProcessCredentials; var init_getValidatedProcessCredentials = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/getValidatedProcessCredentials.js"() { init_import_meta_url(); init_client2(); getValidatedProcessCredentials = /* @__PURE__ */ __name((profileName, data, profiles) => { if (data.Version !== 1) { throw Error(`Profile ${profileName} credential_process did not return Version 1.`); } if (data.AccessKeyId === void 0 || data.SecretAccessKey === void 0) { throw Error(`Profile ${profileName} credential_process returned invalid credentials.`); } if (data.Expiration) { const currentTime = /* @__PURE__ */ new Date(); const expireTime = new Date(data.Expiration); if (expireTime < currentTime) { throw Error(`Profile ${profileName} credential_process returned expired credentials.`); } } let accountId = data.AccountId; if (!accountId && profiles?.[profileName]?.aws_account_id) { accountId = profiles[profileName].aws_account_id; } const credentials = { accessKeyId: data.AccessKeyId, secretAccessKey: data.SecretAccessKey, ...data.SessionToken && { sessionToken: data.SessionToken }, ...data.Expiration && { expiration: new Date(data.Expiration) }, ...data.CredentialScope && { credentialScope: data.CredentialScope }, ...accountId && { accountId } }; setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w"); return credentials; }, "getValidatedProcessCredentials"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js var import_child_process3, import_util14, resolveProcessCredentials; var init_resolveProcessCredentials = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js"() { init_import_meta_url(); init_dist_es16(); import_child_process3 = require("child_process"); import_util14 = require("util"); init_getValidatedProcessCredentials(); resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles, logger4) => { const profile = profiles[profileName]; if (profiles[profileName]) { const credentialProcess = profile["credential_process"]; if (credentialProcess !== void 0) { const execPromise = (0, import_util14.promisify)(import_child_process3.exec); try { const { stdout: stdout2 } = await execPromise(credentialProcess); let data; try { data = JSON.parse(stdout2.trim()); } catch { throw Error(`Profile ${profileName} credential_process returned invalid JSON.`); } return getValidatedProcessCredentials(profileName, data, profiles); } catch (error2) { throw new CredentialsProviderError(error2.message, { logger: logger4 }); } } else { throw new CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger: logger4 }); } } else { throw new CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, { logger: logger4 }); } }, "resolveProcessCredentials"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js var fromProcess; var init_fromProcess = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/fromProcess.js"() { init_import_meta_url(); init_dist_es30(); init_resolveProcessCredentials(); fromProcess = /* @__PURE__ */ __name((init2 = {}) => async ({ callerClientConfig } = {}) => { init2.logger?.debug("@aws-sdk/credential-provider-process - fromProcess"); const profiles = await parseKnownFiles(init2); return resolveProcessCredentials(getProfileName({ profile: init2.profile ?? callerClientConfig?.profile }), profiles, init2.logger); }, "fromProcess"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/index.js var dist_es_exports7 = {}; __export(dist_es_exports7, { fromProcess: () => fromProcess }); var init_dist_es51 = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/index.js"() { init_import_meta_url(); init_fromProcess(); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js var isProcessProfile, resolveProcessCredentials2; var init_resolveProcessCredentials2 = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProcessCredentials.js"() { init_import_meta_url(); init_client2(); isProcessProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string", "isProcessProfile"); resolveProcessCredentials2 = /* @__PURE__ */ __name(async (options32, profile) => Promise.resolve().then(() => (init_dist_es51(), dist_es_exports7)).then(({ fromProcess: fromProcess2 }) => fromProcess2({ ...options32, profile })().then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v"))), "resolveProcessCredentials"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js var resolveSsoCredentials, isSsoProfile2; var init_resolveSsoCredentials = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveSsoCredentials.js"() { init_import_meta_url(); init_client2(); resolveSsoCredentials = /* @__PURE__ */ __name(async (profile, profileData, options32 = {}) => { const { fromSSO: fromSSO2 } = await Promise.resolve().then(() => (init_dist_es49(), dist_es_exports5)); return fromSSO2({ profile, logger: options32.logger, parentClientConfig: options32.parentClientConfig, clientConfig: options32.clientConfig })().then((creds) => { if (profileData.sso_session) { return setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO", "r"); } else { return setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t"); } }); }, "resolveSsoCredentials"); isSsoProfile2 = /* @__PURE__ */ __name((arg) => arg && (typeof arg.sso_start_url === "string" || typeof arg.sso_account_id === "string" || typeof arg.sso_session === "string" || typeof arg.sso_region === "string" || typeof arg.sso_role_name === "string"), "isSsoProfile"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js var isStaticCredsProfile, resolveStaticCredentials; var init_resolveStaticCredentials = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveStaticCredentials.js"() { init_import_meta_url(); init_client2(); isStaticCredsProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.aws_access_key_id === "string" && typeof arg.aws_secret_access_key === "string" && ["undefined", "string"].indexOf(typeof arg.aws_session_token) > -1 && ["undefined", "string"].indexOf(typeof arg.aws_account_id) > -1, "isStaticCredsProfile"); resolveStaticCredentials = /* @__PURE__ */ __name(async (profile, options32) => { options32?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials"); const credentials = { accessKeyId: profile.aws_access_key_id, secretAccessKey: profile.aws_secret_access_key, sessionToken: profile.aws_session_token, ...profile.aws_credential_scope && { credentialScope: profile.aws_credential_scope }, ...profile.aws_account_id && { accountId: profile.aws_account_id } }; return setCredentialFeature(credentials, "CREDENTIALS_PROFILE", "n"); }, "resolveStaticCredentials"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.716.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js var fromWebToken; var init_fromWebToken = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.716.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js"() { init_import_meta_url(); fromWebToken = /* @__PURE__ */ __name((init2) => async (awsIdentityProperties) => { init2.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken"); const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init2; let { roleAssumerWithWebIdentity } = init2; if (!roleAssumerWithWebIdentity) { const { getDefaultRoleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity3 } = await Promise.resolve().then(() => (init_dist_es50(), dist_es_exports6)); roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity3({ ...init2.clientConfig, credentialProviderLogger: init2.logger, parentClientConfig: { ...awsIdentityProperties?.callerClientConfig, ...init2.parentClientConfig } }, init2.clientPlugins); } return roleAssumerWithWebIdentity({ RoleArn: roleArn, RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`, WebIdentityToken: webIdentityToken, ProviderId: providerId, PolicyArns: policyArns, Policy: policy, DurationSeconds: durationSeconds }); }, "fromWebToken"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.716.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js var import_fs18, ENV_TOKEN_FILE, ENV_ROLE_ARN, ENV_ROLE_SESSION_NAME, fromTokenFile; var init_fromTokenFile = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.716.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromTokenFile.js"() { init_import_meta_url(); init_client2(); init_dist_es16(); import_fs18 = require("fs"); init_fromWebToken(); ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; ENV_ROLE_ARN = "AWS_ROLE_ARN"; ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME"; fromTokenFile = /* @__PURE__ */ __name((init2 = {}) => async () => { init2.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile"); const webIdentityTokenFile = init2?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE]; const roleArn = init2?.roleArn ?? process.env[ENV_ROLE_ARN]; const roleSessionName = init2?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME]; if (!webIdentityTokenFile || !roleArn) { throw new CredentialsProviderError("Web identity configuration not specified", { logger: init2.logger }); } const credentials = await fromWebToken({ ...init2, webIdentityToken: (0, import_fs18.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }), roleArn, roleSessionName })(); if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) { setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h"); } return credentials; }, "fromTokenFile"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.716.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js var dist_es_exports8 = {}; __export(dist_es_exports8, { fromTokenFile: () => fromTokenFile, fromWebToken: () => fromWebToken }); var init_dist_es52 = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-web-identity@3.716.0_@aws-sdk+client-sts@3.721.0/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/index.js"() { init_import_meta_url(); init_fromTokenFile(); init_fromWebToken(); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js var isWebIdentityProfile, resolveWebIdentityCredentials; var init_resolveWebIdentityCredentials = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js"() { init_import_meta_url(); init_client2(); isWebIdentityProfile = /* @__PURE__ */ __name((arg) => Boolean(arg) && typeof arg === "object" && typeof arg.web_identity_token_file === "string" && typeof arg.role_arn === "string" && ["undefined", "string"].indexOf(typeof arg.role_session_name) > -1, "isWebIdentityProfile"); resolveWebIdentityCredentials = /* @__PURE__ */ __name(async (profile, options32) => Promise.resolve().then(() => (init_dist_es52(), dist_es_exports8)).then(({ fromTokenFile: fromTokenFile2 }) => fromTokenFile2({ webIdentityTokenFile: profile.web_identity_token_file, roleArn: profile.role_arn, roleSessionName: profile.role_session_name, roleAssumerWithWebIdentity: options32.roleAssumerWithWebIdentity, logger: options32.logger, parentClientConfig: options32.parentClientConfig })().then((creds) => setCredentialFeature(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q"))), "resolveWebIdentityCredentials"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js var resolveProfileData; var init_resolveProfileData = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveProfileData.js"() { init_import_meta_url(); init_dist_es16(); init_resolveAssumeRoleCredentials(); init_resolveProcessCredentials2(); init_resolveSsoCredentials(); init_resolveStaticCredentials(); init_resolveWebIdentityCredentials(); resolveProfileData = /* @__PURE__ */ __name(async (profileName, profiles, options32, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => { const data = profiles[profileName]; if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data)) { return resolveStaticCredentials(data, options32); } if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data, { profile: profileName, logger: options32.logger })) { return resolveAssumeRoleCredentials(profileName, profiles, options32, visitedProfiles); } if (isStaticCredsProfile(data)) { return resolveStaticCredentials(data, options32); } if (isWebIdentityProfile(data)) { return resolveWebIdentityCredentials(data, options32); } if (isProcessProfile(data)) { return resolveProcessCredentials2(options32, profileName); } if (isSsoProfile2(data)) { return await resolveSsoCredentials(profileName, data, options32); } throw new CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options32.logger }); }, "resolveProfileData"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js var fromIni; var init_fromIni = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/fromIni.js"() { init_import_meta_url(); init_dist_es30(); init_resolveProfileData(); fromIni = /* @__PURE__ */ __name((_init = {}) => async ({ callerClientConfig } = {}) => { const init2 = { ..._init, parentClientConfig: { ...callerClientConfig, ..._init.parentClientConfig } }; init2.logger?.debug("@aws-sdk/credential-provider-ini - fromIni"); const profiles = await parseKnownFiles(init2); return resolveProfileData(getProfileName({ profile: _init.profile ?? callerClientConfig?.profile }), profiles, init2); }, "fromIni"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js var dist_es_exports9 = {}; __export(dist_es_exports9, { fromIni: () => fromIni }); var init_dist_es53 = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-ini@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-sts_i6jy2uxuokszxcyf4p6ncee4ju/node_modules/@aws-sdk/credential-provider-ini/dist-es/index.js"() { init_import_meta_url(); init_fromIni(); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-node@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-st_nxdfcqjud2svw42kuw6i2zwn6q/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js var multipleCredentialSourceWarningEmitted, defaultProvider, credentialsWillNeedRefresh, credentialsTreatedAsExpired; var init_defaultProvider = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-node@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-st_nxdfcqjud2svw42kuw6i2zwn6q/node_modules/@aws-sdk/credential-provider-node/dist-es/defaultProvider.js"() { init_import_meta_url(); init_dist_es38(); init_dist_es16(); init_dist_es30(); init_remoteProvider(); multipleCredentialSourceWarningEmitted = false; defaultProvider = /* @__PURE__ */ __name((init2 = {}) => memoize(chain(async () => { const profile = init2.profile ?? process.env[ENV_PROFILE]; if (profile) { const envStaticCredentialsAreSet = process.env[ENV_KEY] && process.env[ENV_SECRET]; if (envStaticCredentialsAreSet) { if (!multipleCredentialSourceWarningEmitted) { const warnFn = init2.logger?.warn && init2.logger?.constructor?.name !== "NoOpLogger" ? init2.logger.warn : console.warn; warnFn(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING: Multiple credential sources detected: Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set. This SDK will proceed with the AWS_PROFILE value. However, a future version may change this behavior to prefer the ENV static credentials. Please ensure that your environment only sets either the AWS_PROFILE or the AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair. `); multipleCredentialSourceWarningEmitted = true; } } throw new CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.", { logger: init2.logger, tryNextLink: true }); } init2.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"); return fromEnv2(init2)(); }, async () => { init2.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO"); const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init2; if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { throw new CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).", { logger: init2.logger }); } const { fromSSO: fromSSO2 } = await Promise.resolve().then(() => (init_dist_es49(), dist_es_exports5)); return fromSSO2(init2)(); }, async () => { init2.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni"); const { fromIni: fromIni2 } = await Promise.resolve().then(() => (init_dist_es53(), dist_es_exports9)); return fromIni2(init2)(); }, async () => { init2.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess"); const { fromProcess: fromProcess2 } = await Promise.resolve().then(() => (init_dist_es51(), dist_es_exports7)); return fromProcess2(init2)(); }, async () => { init2.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile"); const { fromTokenFile: fromTokenFile2 } = await Promise.resolve().then(() => (init_dist_es52(), dist_es_exports8)); return fromTokenFile2(init2)(); }, async () => { init2.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"); return (await remoteProvider(init2))(); }, async () => { throw new CredentialsProviderError("Could not load credentials from any providers", { tryNextLink: false, logger: init2.logger }); }), credentialsTreatedAsExpired, credentialsWillNeedRefresh), "defaultProvider"); credentialsWillNeedRefresh = /* @__PURE__ */ __name((credentials) => credentials?.expiration !== void 0, "credentialsWillNeedRefresh"); credentialsTreatedAsExpired = /* @__PURE__ */ __name((credentials) => credentials?.expiration !== void 0 && credentials.expiration.getTime() - Date.now() < 3e5, "credentialsTreatedAsExpired"); } }); // ../../node_modules/.pnpm/@aws-sdk+credential-provider-node@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-st_nxdfcqjud2svw42kuw6i2zwn6q/node_modules/@aws-sdk/credential-provider-node/dist-es/index.js var init_dist_es54 = __esm({ "../../node_modules/.pnpm/@aws-sdk+credential-provider-node@3.721.0_@aws-sdk+client-sso-oidc@3.721.0_@aws-sdk+client-st_nxdfcqjud2svw42kuw6i2zwn6q/node_modules/@aws-sdk/credential-provider-node/dist-es/index.js"() { init_import_meta_url(); init_defaultProvider(); } }); // ../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/common.js var require_common2 = __commonJS({ "../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/common.js"(exports2, module3) { init_import_meta_url(); function setup(env6) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce2; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require_ms(); createDebug.destroy = destroy; Object.keys(env6).forEach((key) => { createDebug[key] = env6[key]; }); createDebug.names = []; createDebug.skips = []; createDebug.formatters = {}; function selectColor(namespace) { let hash = 0; for (let i5 = 0; i5 < namespace.length; i5++) { hash = (hash << 5) - hash + namespace.charCodeAt(i5); hash |= 0; } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } __name(selectColor, "selectColor"); createDebug.selectColor = selectColor; function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug(...args) { if (!debug.enabled) { return; } const self2 = debug; const curr = Number(/* @__PURE__ */ new Date()); const ms = curr - (prevTime || curr); self2.diff = ms; self2.prev = prevTime; self2.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== "string") { args.unshift("%O"); } let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format11) => { if (match2 === "%%") { return "%"; } index++; const formatter = createDebug.formatters[format11]; if (typeof formatter === "function") { const val2 = args[index]; match2 = formatter.call(self2, val2); args.splice(index, 1); index--; } return match2; }); createDebug.formatArgs.call(self2, args); const logFn = self2.log || createDebug.log; logFn.apply(self2, args); } __name(debug, "debug"); debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; Object.defineProperty(debug, "enabled", { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug.namespaces) { namespacesCache = createDebug.namespaces; enabledCache = createDebug.enabled(namespace); } return enabledCache; }, set: (v7) => { enableOverride = v7; } }); if (typeof createDebug.init === "function") { createDebug.init(debug); } return debug; } __name(createDebug, "createDebug"); function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); newDebug.log = this.log; return newDebug; } __name(extend, "extend"); function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean); for (const ns of split) { if (ns[0] === "-") { createDebug.skips.push(ns.slice(1)); } else { createDebug.names.push(ns); } } } __name(enable, "enable"); function matchesTemplate(search, template) { let searchIndex = 0; let templateIndex = 0; let starIndex = -1; let matchIndex = 0; while (searchIndex < search.length) { if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { if (template[templateIndex] === "*") { starIndex = templateIndex; matchIndex = searchIndex; templateIndex++; } else { searchIndex++; templateIndex++; } } else if (starIndex !== -1) { templateIndex = starIndex + 1; matchIndex++; searchIndex = matchIndex; } else { return false; } } while (templateIndex < template.length && template[templateIndex] === "*") { templateIndex++; } return templateIndex === template.length; } __name(matchesTemplate, "matchesTemplate"); function disable() { const namespaces = [ ...createDebug.names, ...createDebug.skips.map((namespace) => "-" + namespace) ].join(","); createDebug.enable(""); return namespaces; } __name(disable, "disable"); function enabled(name2) { for (const skip of createDebug.skips) { if (matchesTemplate(name2, skip)) { return false; } } for (const ns of createDebug.names) { if (matchesTemplate(name2, ns)) { return true; } } return false; } __name(enabled, "enabled"); function coerce2(val2) { if (val2 instanceof Error) { return val2.stack || val2.message; } return val2; } __name(coerce2, "coerce"); function destroy() { console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } __name(destroy, "destroy"); createDebug.enable(createDebug.load()); return createDebug; } __name(setup, "setup"); module3.exports = setup; } }); // ../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/browser.js var require_browser2 = __commonJS({ "../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/browser.js"(exports2, module3) { init_import_meta_url(); exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; exports2.storage = localstorage(); exports2.destroy = (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } }; })(); exports2.colors = [ "#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33" ]; function useColors() { if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { return true; } if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } let m6; return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== "undefined" && navigator.userAgent && (m6 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m6[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } __name(useColors, "useColors"); function formatArgs(args) { args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module3.exports.humanize(this.diff); if (!this.useColors) { return; } const c6 = "color: " + this.color; args.splice(1, 0, c6, "color: inherit"); let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, (match2) => { if (match2 === "%%") { return; } index++; if (match2 === "%c") { lastC = index; } }); args.splice(lastC, 0, c6); } __name(formatArgs, "formatArgs"); exports2.log = console.debug || console.log || (() => { }); function save(namespaces) { try { if (namespaces) { exports2.storage.setItem("debug", namespaces); } else { exports2.storage.removeItem("debug"); } } catch (error2) { } } __name(save, "save"); function load() { let r7; try { r7 = exports2.storage.getItem("debug"); } catch (error2) { } if (!r7 && typeof process !== "undefined" && "env" in process) { r7 = process.env.DEBUG; } return r7; } __name(load, "load"); function localstorage() { try { return localStorage; } catch (error2) { } } __name(localstorage, "localstorage"); module3.exports = require_common2()(exports2); var { formatters: formatters2 } = module3.exports; formatters2.j = function(v7) { try { return JSON.stringify(v7); } catch (error2) { return "[UnexpectedJSONParseError]: " + error2.message; } }; } }); // ../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/node.js var require_node5 = __commonJS({ "../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/node.js"(exports2, module3) { init_import_meta_url(); var tty3 = require("tty"); var util5 = require("util"); exports2.init = init2; exports2.log = log2; exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; exports2.destroy = util5.deprecate( () => { }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." ); exports2.colors = [6, 2, 3, 4, 5, 1]; try { const supportsColor3 = (init_supports_color(), __toCommonJS(supports_color_exports)); if (supportsColor3 && (supportsColor3.stderr || supportsColor3).level >= 2) { exports2.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error2) { } exports2.inspectOpts = Object.keys(process.env).filter((key) => { return /^debug_/i.test(key); }).reduce((obj, key) => { const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_4, k6) => { return k6.toUpperCase(); }); let val2 = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val2)) { val2 = true; } else if (/^(no|off|false|disabled)$/i.test(val2)) { val2 = false; } else if (val2 === "null") { val2 = null; } else { val2 = Number(val2); } obj[prop] = val2; return obj; }, {}); function useColors() { return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty3.isatty(process.stderr.fd); } __name(useColors, "useColors"); function formatArgs(args) { const { namespace: name2, useColors: useColors2 } = this; if (useColors2) { const c6 = this.color; const colorCode = "\x1B[3" + (c6 < 8 ? c6 : "8;5;" + c6); const prefix = ` ${colorCode};1m${name2} \x1B[0m`; args[0] = prefix + args[0].split("\n").join("\n" + prefix); args.push(colorCode + "m+" + module3.exports.humanize(this.diff) + "\x1B[0m"); } else { args[0] = getDate2() + name2 + " " + args[0]; } } __name(formatArgs, "formatArgs"); function getDate2() { if (exports2.inspectOpts.hideDate) { return ""; } return (/* @__PURE__ */ new Date()).toISOString() + " "; } __name(getDate2, "getDate"); function log2(...args) { return process.stderr.write(util5.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); } __name(log2, "log"); function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { delete process.env.DEBUG; } } __name(save, "save"); function load() { return process.env.DEBUG; } __name(load, "load"); function init2(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports2.inspectOpts); for (let i5 = 0; i5 < keys.length; i5++) { debug.inspectOpts[keys[i5]] = exports2.inspectOpts[keys[i5]]; } } __name(init2, "init"); module3.exports = require_common2()(exports2); var { formatters: formatters2 } = module3.exports; formatters2.o = function(v7) { this.inspectOpts.colors = this.useColors; return util5.inspect(v7, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); }; formatters2.O = function(v7) { this.inspectOpts.colors = this.useColors; return util5.inspect(v7, this.inspectOpts); }; } }); // ../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/index.js var require_src4 = __commonJS({ "../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/index.js"(exports2, module3) { init_import_meta_url(); if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { module3.exports = require_browser2(); } else { module3.exports = require_node5(); } } }); // ../../node_modules/.pnpm/agent-base@6.0.2_supports-color@9.2.2/node_modules/agent-base/dist/src/promisify.js var require_promisify = __commonJS({ "../../node_modules/.pnpm/agent-base@6.0.2_supports-color@9.2.2/node_modules/agent-base/dist/src/promisify.js"(exports2) { "use strict"; init_import_meta_url(); Object.defineProperty(exports2, "__esModule", { value: true }); function promisify3(fn2) { return function(req, opts) { return new Promise((resolve25, reject) => { fn2.call(this, req, opts, (err, rtn) => { if (err) { reject(err); } else { resolve25(rtn); } }); }); }; } __name(promisify3, "promisify"); exports2.default = promisify3; } }); // ../../node_modules/.pnpm/agent-base@6.0.2_supports-color@9.2.2/node_modules/agent-base/dist/src/index.js var require_src5 = __commonJS({ "../../node_modules/.pnpm/agent-base@6.0.2_supports-color@9.2.2/node_modules/agent-base/dist/src/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var __importDefault = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; var events_1 = require("events"); var debug_1 = __importDefault(require_src4()); var promisify_1 = __importDefault(require_promisify()); var debug = debug_1.default("agent-base"); function isAgent(v7) { return Boolean(v7) && typeof v7.addRequest === "function"; } __name(isAgent, "isAgent"); function isSecureEndpoint() { const { stack } = new Error(); if (typeof stack !== "string") return false; return stack.split("\n").some((l6) => l6.indexOf("(https.js:") !== -1 || l6.indexOf("node:https:") !== -1); } __name(isSecureEndpoint, "isSecureEndpoint"); function createAgent(callback, opts) { return new createAgent.Agent(callback, opts); } __name(createAgent, "createAgent"); (function(createAgent2) { class Agent extends events_1.EventEmitter { constructor(callback, _opts) { super(); let opts = _opts; if (typeof callback === "function") { this.callback = callback; } else if (callback) { opts = callback; } this.timeout = null; if (opts && typeof opts.timeout === "number") { this.timeout = opts.timeout; } this.maxFreeSockets = 1; this.maxSockets = 1; this.maxTotalSockets = Infinity; this.sockets = {}; this.freeSockets = {}; this.requests = {}; this.options = {}; } get defaultPort() { if (typeof this.explicitDefaultPort === "number") { return this.explicitDefaultPort; } return isSecureEndpoint() ? 443 : 80; } set defaultPort(v7) { this.explicitDefaultPort = v7; } get protocol() { if (typeof this.explicitProtocol === "string") { return this.explicitProtocol; } return isSecureEndpoint() ? "https:" : "http:"; } set protocol(v7) { this.explicitProtocol = v7; } callback(req, opts, fn2) { throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); } /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. * * @api public */ addRequest(req, _opts) { const opts = Object.assign({}, _opts); if (typeof opts.secureEndpoint !== "boolean") { opts.secureEndpoint = isSecureEndpoint(); } if (opts.host == null) { opts.host = "localhost"; } if (opts.port == null) { opts.port = opts.secureEndpoint ? 443 : 80; } if (opts.protocol == null) { opts.protocol = opts.secureEndpoint ? "https:" : "http:"; } if (opts.host && opts.path) { delete opts.path; } delete opts.agent; delete opts.hostname; delete opts._defaultAgent; delete opts.defaultPort; delete opts.createConnection; req._last = true; req.shouldKeepAlive = false; let timedOut = false; let timeoutId = null; const timeoutMs = opts.timeout || this.timeout; const onerror = /* @__PURE__ */ __name((err) => { if (req._hadError) return; req.emit("error", err); req._hadError = true; }, "onerror"); const ontimeout = /* @__PURE__ */ __name(() => { timeoutId = null; timedOut = true; const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); err.code = "ETIMEOUT"; onerror(err); }, "ontimeout"); const callbackError = /* @__PURE__ */ __name((err) => { if (timedOut) return; if (timeoutId !== null) { clearTimeout(timeoutId); timeoutId = null; } onerror(err); }, "callbackError"); const onsocket = /* @__PURE__ */ __name((socket) => { if (timedOut) return; if (timeoutId != null) { clearTimeout(timeoutId); timeoutId = null; } if (isAgent(socket)) { debug("Callback returned another Agent instance %o", socket.constructor.name); socket.addRequest(req, opts); return; } if (socket) { socket.once("free", () => { this.freeSocket(socket, opts); }); req.onSocket(socket); return; } const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); onerror(err); }, "onsocket"); if (typeof this.callback !== "function") { onerror(new Error("`callback` is not defined")); return; } if (!this.promisifiedCallback) { if (this.callback.length >= 3) { debug("Converting legacy callback function to promise"); this.promisifiedCallback = promisify_1.default(this.callback); } else { this.promisifiedCallback = this.callback; } } if (typeof timeoutMs === "number" && timeoutMs > 0) { timeoutId = setTimeout(ontimeout, timeoutMs); } if ("port" in opts && typeof opts.port !== "number") { opts.port = Number(opts.port); } try { debug("Resolving socket for %o request: %o", opts.protocol, `${req.method} ${req.path}`); Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); } catch (err) { Promise.reject(err).catch(callbackError); } } freeSocket(socket, opts) { debug("Freeing socket %o %o", socket.constructor.name, opts); socket.destroy(); } destroy() { debug("Destroying agent %o", this.constructor.name); } } __name(Agent, "Agent"); createAgent2.Agent = Agent; createAgent2.prototype = createAgent2.Agent.prototype; })(createAgent || (createAgent = {})); module3.exports = createAgent; } }); // ../../node_modules/.pnpm/https-proxy-agent@5.0.1_supports-color@9.2.2/node_modules/https-proxy-agent/dist/parse-proxy-response.js var require_parse_proxy_response2 = __commonJS({ "../../node_modules/.pnpm/https-proxy-agent@5.0.1_supports-color@9.2.2/node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports2) { "use strict"; init_import_meta_url(); var __importDefault = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); var debug_1 = __importDefault(require_src4()); var debug = debug_1.default("https-proxy-agent:parse-proxy-response"); function parseProxyResponse(socket) { return new Promise((resolve25, reject) => { let buffersLength = 0; const buffers = []; function read2() { const b6 = socket.read(); if (b6) ondata(b6); else socket.once("readable", read2); } __name(read2, "read"); function cleanup() { socket.removeListener("end", onend); socket.removeListener("error", onerror); socket.removeListener("close", onclose); socket.removeListener("readable", read2); } __name(cleanup, "cleanup"); function onclose(err) { debug("onclose had error %o", err); } __name(onclose, "onclose"); function onend() { debug("onend"); } __name(onend, "onend"); function onerror(err) { cleanup(); debug("onerror %o", err); reject(err); } __name(onerror, "onerror"); function ondata(b6) { buffers.push(b6); buffersLength += b6.length; const buffered = Buffer.concat(buffers, buffersLength); const endOfHeaders = buffered.indexOf("\r\n\r\n"); if (endOfHeaders === -1) { debug("have not received end of HTTP headers yet..."); read2(); return; } const firstLine = buffered.toString("ascii", 0, buffered.indexOf("\r\n")); const statusCode = +firstLine.split(" ")[1]; debug("got proxy server response: %o", firstLine); resolve25({ statusCode, buffered }); } __name(ondata, "ondata"); socket.on("error", onerror); socket.on("close", onclose); socket.on("end", onend); read2(); }); } __name(parseProxyResponse, "parseProxyResponse"); exports2.default = parseProxyResponse; } }); // ../../node_modules/.pnpm/https-proxy-agent@5.0.1_supports-color@9.2.2/node_modules/https-proxy-agent/dist/agent.js var require_agent2 = __commonJS({ "../../node_modules/.pnpm/https-proxy-agent@5.0.1_supports-color@9.2.2/node_modules/https-proxy-agent/dist/agent.js"(exports2) { "use strict"; init_import_meta_url(); var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P3, generator) { function adopt(value) { return value instanceof P3 ? value : new P3(function(resolve25) { resolve25(value); }); } __name(adopt, "adopt"); return new (P3 || (P3 = Promise))(function(resolve25, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e7) { reject(e7); } } __name(fulfilled, "fulfilled"); function rejected(value) { try { step(generator["throw"](value)); } catch (e7) { reject(e7); } } __name(rejected, "rejected"); function step(result) { result.done ? resolve25(result.value) : adopt(result.value).then(fulfilled, rejected); } __name(step, "step"); step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); var net_1 = __importDefault(require("net")); var tls_1 = __importDefault(require("tls")); var url_1 = __importDefault(require("url")); var assert_1 = __importDefault(require("assert")); var debug_1 = __importDefault(require_src4()); var agent_base_1 = require_src5(); var parse_proxy_response_1 = __importDefault(require_parse_proxy_response2()); var debug = debug_1.default("https-proxy-agent:agent"); var HttpsProxyAgent3 = class extends agent_base_1.Agent { constructor(_opts) { let opts; if (typeof _opts === "string") { opts = url_1.default.parse(_opts); } else { opts = _opts; } if (!opts) { throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!"); } debug("creating new HttpsProxyAgent instance: %o", opts); super(opts); const proxy2 = Object.assign({}, opts); this.secureProxy = opts.secureProxy || isHTTPS(proxy2.protocol); proxy2.host = proxy2.hostname || proxy2.host; if (typeof proxy2.port === "string") { proxy2.port = parseInt(proxy2.port, 10); } if (!proxy2.port && proxy2.host) { proxy2.port = this.secureProxy ? 443 : 80; } if (this.secureProxy && !("ALPNProtocols" in proxy2)) { proxy2.ALPNProtocols = ["http 1.1"]; } if (proxy2.host && proxy2.path) { delete proxy2.path; delete proxy2.pathname; } this.proxy = proxy2; } /** * Called when the node-core HTTP client library is creating a * new HTTP request. * * @api protected */ callback(req, opts) { return __awaiter2(this, void 0, void 0, function* () { const { proxy: proxy2, secureProxy } = this; let socket; if (secureProxy) { debug("Creating `tls.Socket`: %o", proxy2); socket = tls_1.default.connect(proxy2); } else { debug("Creating `net.Socket`: %o", proxy2); socket = net_1.default.connect(proxy2); } const headers = Object.assign({}, proxy2.headers); const hostname2 = `${opts.host}:${opts.port}`; let payload = `CONNECT ${hostname2} HTTP/1.1\r `; if (proxy2.auth) { headers["Proxy-Authorization"] = `Basic ${Buffer.from(proxy2.auth).toString("base64")}`; } let { host, port, secureEndpoint } = opts; if (!isDefaultPort(port, secureEndpoint)) { host += `:${port}`; } headers.Host = host; headers.Connection = "close"; for (const name2 of Object.keys(headers)) { payload += `${name2}: ${headers[name2]}\r `; } const proxyResponsePromise = parse_proxy_response_1.default(socket); socket.write(`${payload}\r `); const { statusCode, buffered } = yield proxyResponsePromise; if (statusCode === 200) { req.once("socket", resume); if (opts.secureEndpoint) { debug("Upgrading socket connection to TLS"); const servername = opts.servername || opts.host; return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, "host", "hostname", "path", "port")), { socket, servername })); } return socket; } socket.destroy(); const fakeSocket = new net_1.default.Socket({ writable: false }); fakeSocket.readable = true; req.once("socket", (s5) => { debug("replaying proxy buffer for failed request"); assert_1.default(s5.listenerCount("data") > 0); s5.push(buffered); s5.push(null); }); return fakeSocket; }); } }; __name(HttpsProxyAgent3, "HttpsProxyAgent"); exports2.default = HttpsProxyAgent3; function resume(socket) { socket.resume(); } __name(resume, "resume"); function isDefaultPort(port, secure) { return Boolean(!secure && port === 80 || secure && port === 443); } __name(isDefaultPort, "isDefaultPort"); function isHTTPS(protocol) { return typeof protocol === "string" ? /^https:?$/i.test(protocol) : false; } __name(isHTTPS, "isHTTPS"); function omit(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; } __name(omit, "omit"); } }); // ../../node_modules/.pnpm/https-proxy-agent@5.0.1_supports-color@9.2.2/node_modules/https-proxy-agent/dist/index.js var require_dist5 = __commonJS({ "../../node_modules/.pnpm/https-proxy-agent@5.0.1_supports-color@9.2.2/node_modules/https-proxy-agent/dist/index.js"(exports2, module3) { "use strict"; init_import_meta_url(); var __importDefault = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; var agent_1 = __importDefault(require_agent2()); function createHttpsProxyAgent(opts) { return new agent_1.default(opts); } __name(createHttpsProxyAgent, "createHttpsProxyAgent"); (function(createHttpsProxyAgent2) { createHttpsProxyAgent2.HttpsProxyAgent = agent_1.default; createHttpsProxyAgent2.prototype = agent_1.default.prototype; })(createHttpsProxyAgent || (createHttpsProxyAgent = {})); module3.exports = createHttpsProxyAgent; } }); // ../workers-shared/utils/configuration/constants.ts var REDIRECTS_VERSION, HEADERS_VERSION, PERMITTED_STATUS_CODES, HEADER_SEPARATOR, MAX_LINE_LENGTH, MAX_HEADER_RULES, MAX_DYNAMIC_REDIRECT_RULES, MAX_STATIC_REDIRECT_RULES, UNSET_OPERATOR, SPLAT_REGEX, PLACEHOLDER_REGEX; var init_constants9 = __esm({ "../workers-shared/utils/configuration/constants.ts"() { "use strict"; init_import_meta_url(); REDIRECTS_VERSION = 1; HEADERS_VERSION = 2; PERMITTED_STATUS_CODES = /* @__PURE__ */ new Set([200, 301, 302, 303, 307, 308]); HEADER_SEPARATOR = ":"; MAX_LINE_LENGTH = 2e3; MAX_HEADER_RULES = 100; MAX_DYNAMIC_REDIRECT_RULES = 100; MAX_STATIC_REDIRECT_RULES = 2e3; UNSET_OPERATOR = "! "; SPLAT_REGEX = /\*/g; PLACEHOLDER_REGEX = /:[A-Za-z]\w*/g; } }); // ../workers-shared/utils/configuration/constructConfiguration.ts function constructRedirects({ redirects, redirectsFile, logger: logger4 }) { if (!redirects) { return {}; } const num_valid = redirects.rules.length; const num_invalid = redirects.invalid.length; const redirectsRelativePath = redirectsFile ? (0, import_node_path63.relative)(process.cwd(), redirectsFile) : ""; logger4.log( `\u2728 Parsed ${num_valid} valid redirect rule${num_valid === 1 ? "" : "s"}.` ); if (num_invalid > 0) { let invalidRedirectRulesList = ``; for (const { line, lineNumber, message } of redirects.invalid) { invalidRedirectRulesList += `\u25B6\uFE0E ${message} `; if (line) { invalidRedirectRulesList += ` at ${redirectsRelativePath}${lineNumber ? `:${lineNumber}` : ""} | ${line} `; } } logger4.warn( `Found ${num_invalid} invalid redirect rule${num_invalid === 1 ? "" : "s"}: ${invalidRedirectRulesList}` ); } if (num_valid === 0) { return {}; } const staticRedirects = {}; const dynamicRedirects = {}; let canCreateStaticRule = true; for (const rule of redirects.rules) { if (!rule.from.match(SPLAT_REGEX) && !rule.from.match(PLACEHOLDER_REGEX)) { if (canCreateStaticRule) { staticRedirects[rule.from] = { status: rule.status, to: rule.to, lineNumber: rule.lineNumber }; continue; } else { logger4.info( `The redirect rule ${rule.from} \u2192 ${rule.status} ${rule.to} could be made more performant by bringing it above any lines with splats or placeholders.` ); } } dynamicRedirects[rule.from] = { status: rule.status, to: rule.to }; canCreateStaticRule = false; } return { redirects: { version: REDIRECTS_VERSION, staticRules: staticRedirects, rules: dynamicRedirects } }; } function constructHeaders({ headers, headersFile, logger: logger4 }) { if (!headers) { return {}; } const num_valid = headers.rules.length; const num_invalid = headers.invalid.length; const headersRelativePath = headersFile ? (0, import_node_path63.relative)(process.cwd(), headersFile) : ""; logger4.log( `\u2728 Parsed ${num_valid} valid header rule${num_valid === 1 ? "" : "s"}.` ); if (num_invalid > 0) { let invalidHeaderRulesList = ``; for (const { line, lineNumber, message } of headers.invalid) { invalidHeaderRulesList += `\u25B6\uFE0E ${message} `; if (line) { invalidHeaderRulesList += ` at ${headersRelativePath}${lineNumber ? `:${lineNumber}` : ""} | ${line} `; } } logger4.warn( `Found ${num_invalid} invalid header rule${num_invalid === 1 ? "" : "s"}: ${invalidHeaderRulesList}` ); } if (num_valid === 0) { return {}; } const rules = {}; for (const rule of headers.rules) { rules[rule.path] = {}; if (Object.keys(rule.headers).length) { rules[rule.path].set = rule.headers; } if (rule.unsetHeaders.length) { rules[rule.path].unset = rule.unsetHeaders; } } return { headers: { version: HEADERS_VERSION, rules } }; } var import_node_path63; var init_constructConfiguration = __esm({ "../workers-shared/utils/configuration/constructConfiguration.ts"() { init_import_meta_url(); import_node_path63 = require("node:path"); init_constants9(); __name(constructRedirects, "constructRedirects"); __name(constructHeaders, "constructHeaders"); } }); // ../pages-shared/metadata-generator/constants.ts var ANALYTICS_VERSION; var init_constants10 = __esm({ "../pages-shared/metadata-generator/constants.ts"() { init_import_meta_url(); ANALYTICS_VERSION = 1; } }); // ../pages-shared/metadata-generator/createMetadataObject.ts function createMetadataObject({ redirects, headers, redirectsFile, headersFile, webAnalyticsToken, deploymentId, failOpen, logger: logger4 = noopLogger }) { return { ...constructRedirects({ redirects, redirectsFile, logger: logger4 }), ...constructHeaders({ headers, headersFile, logger: logger4 }), ...constructWebAnalytics({ webAnalyticsToken, logger: logger4 }), deploymentId, failOpen }; } function constructWebAnalytics({ webAnalyticsToken }) { if (!webAnalyticsToken) { return {}; } return { analytics: { version: ANALYTICS_VERSION, token: webAnalyticsToken } }; } var noopLogger; var init_createMetadataObject = __esm({ "../pages-shared/metadata-generator/createMetadataObject.ts"() { init_import_meta_url(); init_constructConfiguration(); init_constants10(); noopLogger = { debug: (_message) => { }, log: (_message) => { }, info: (_message) => { }, warn: (_message) => { }, error: (_error) => { } }; __name(createMetadataObject, "createMetadataObject"); __name(constructWebAnalytics, "constructWebAnalytics"); } }); // ../workers-shared/utils/configuration/validateURL.ts function urlHasHost(token) { const host = URL_REGEX.exec(token); return Boolean(host && host.groups && host.groups.host); } var extractPathname, URL_REGEX, HOST_WITH_PORT_REGEX, PATH_REGEX, validateUrl; var init_validateURL = __esm({ "../workers-shared/utils/configuration/validateURL.ts"() { "use strict"; init_import_meta_url(); extractPathname = /* @__PURE__ */ __name((path72 = "/", includeSearch, includeHash) => { if (!path72.startsWith("/")) { path72 = `/${path72}`; } const url4 = new URL(`//${path72}`, "relative://"); return `${url4.pathname}${includeSearch ? url4.search : ""}${includeHash ? url4.hash : ""}`; }, "extractPathname"); URL_REGEX = /^https:\/\/+(?[^/]+)\/?(?.*)/; HOST_WITH_PORT_REGEX = /.*:\d+$/; PATH_REGEX = /^\//; validateUrl = /* @__PURE__ */ __name((token, onlyRelative = false, disallowPorts = false, includeSearch = false, includeHash = false) => { const host = URL_REGEX.exec(token); if (host && host.groups && host.groups.host) { if (onlyRelative) { return [ void 0, `Only relative URLs are allowed. Skipping absolute URL ${token}.` ]; } if (disallowPorts && host.groups.host.match(HOST_WITH_PORT_REGEX)) { return [ void 0, `Specifying ports is not supported. Skipping absolute URL ${token}.` ]; } return [ `https://${host.groups.host}${extractPathname( host.groups.path, includeSearch, includeHash )}`, void 0 ]; } else { if (!token.startsWith("/") && onlyRelative) { token = `/${token}`; } const path72 = PATH_REGEX.exec(token); if (path72) { try { return [extractPathname(token, includeSearch, includeHash), void 0]; } catch { return [void 0, `Error parsing URL segment ${token}. Skipping.`]; } } } return [ void 0, onlyRelative ? "URLs should begin with a forward-slash." : 'URLs should either be relative (e.g. begin with a forward-slash), or use HTTPS (e.g. begin with "https://").' ]; }, "validateUrl"); __name(urlHasHost, "urlHasHost"); } }); // ../workers-shared/utils/configuration/parseHeaders.ts function parseHeaders(input) { const lines = input.split("\n"); const rules = []; const invalid = []; let rule = void 0; for (let i5 = 0; i5 < lines.length; i5++) { const line = lines[i5].trim(); if (line.length === 0 || line.startsWith("#")) { continue; } if (line.length > MAX_LINE_LENGTH) { invalid.push({ message: `Ignoring line ${i5 + 1} as it exceeds the maximum allowed length of ${MAX_LINE_LENGTH}.` }); continue; } if (LINE_IS_PROBABLY_A_PATH.test(line)) { if (rules.length >= MAX_HEADER_RULES) { invalid.push({ message: `Maximum number of rules supported is ${MAX_HEADER_RULES}. Skipping remaining ${lines.length - i5} lines of file.` }); break; } if (rule) { if (isValidRule(rule)) { rules.push({ path: rule.path, headers: rule.headers, unsetHeaders: rule.unsetHeaders }); } else { invalid.push({ line: rule.line, lineNumber: i5 + 1, message: "No headers specified" }); } } const [path72, pathError] = validateUrl(line, false, true); if (pathError) { invalid.push({ line, lineNumber: i5 + 1, message: pathError }); rule = void 0; continue; } rule = { path: path72, line, headers: {}, unsetHeaders: [] }; continue; } if (!line.includes(HEADER_SEPARATOR)) { if (!rule) { invalid.push({ line, lineNumber: i5 + 1, message: "Expected a path beginning with at least one forward-slash" }); } else { if (line.trim().startsWith(UNSET_OPERATOR)) { rule.unsetHeaders.push(line.trim().replace(UNSET_OPERATOR, "")); } else { invalid.push({ line, lineNumber: i5 + 1, message: "Expected a colon-separated header pair (e.g. name: value)" }); } } continue; } const [rawName, ...rawValue] = line.split(HEADER_SEPARATOR); const name2 = rawName.trim().toLowerCase(); if (name2.includes(" ")) { invalid.push({ line, lineNumber: i5 + 1, message: "Header name cannot include spaces" }); continue; } const value = rawValue.join(HEADER_SEPARATOR).trim(); if (name2 === "") { invalid.push({ line, lineNumber: i5 + 1, message: "No header name specified" }); continue; } if (value === "") { invalid.push({ line, lineNumber: i5 + 1, message: "No header value specified" }); continue; } if (!rule) { invalid.push({ line, lineNumber: i5 + 1, message: `Path should come before header (${name2}: ${value})` }); continue; } const existingValues = rule.headers[name2]; rule.headers[name2] = existingValues ? `${existingValues}, ${value}` : value; } if (rule) { if (isValidRule(rule)) { rules.push({ path: rule.path, headers: rule.headers, unsetHeaders: rule.unsetHeaders }); } else { invalid.push({ line: rule.line, message: "No headers specified" }); } } return { rules, invalid }; } function isValidRule(rule) { return Object.keys(rule.headers).length > 0 || rule.unsetHeaders.length > 0; } var LINE_IS_PROBABLY_A_PATH; var init_parseHeaders = __esm({ "../workers-shared/utils/configuration/parseHeaders.ts"() { init_import_meta_url(); init_constants9(); init_validateURL(); LINE_IS_PROBABLY_A_PATH = new RegExp(/^([^\s]+:\/\/|^\/)/); __name(parseHeaders, "parseHeaders"); __name(isValidRule, "isValidRule"); } }); // ../workers-shared/utils/configuration/parseRedirects.ts function parseRedirects(input) { const lines = input.split("\n"); const rules = []; const seen_paths = /* @__PURE__ */ new Set(); const invalid = []; let staticRules = 0; let dynamicRules = 0; let canCreateStaticRule = true; for (let i5 = 0; i5 < lines.length; i5++) { const line = lines[i5].trim(); if (line.length === 0 || line.startsWith("#")) { continue; } if (line.length > MAX_LINE_LENGTH) { invalid.push({ message: `Ignoring line ${i5 + 1} as it exceeds the maximum allowed length of ${MAX_LINE_LENGTH}.` }); continue; } const tokens = line.split(/\s+/); if (tokens.length < 2 || tokens.length > 3) { invalid.push({ line, lineNumber: i5 + 1, message: `Expected exactly 2 or 3 whitespace-separated tokens. Got ${tokens.length}.` }); continue; } const [str_from, str_to, str_status = "302"] = tokens; const fromResult = validateUrl(str_from, true, true, false, false); if (fromResult[0] === void 0) { invalid.push({ line, lineNumber: i5 + 1, message: fromResult[1] }); continue; } const from = fromResult[0]; if (canCreateStaticRule && !from.match(SPLAT_REGEX) && !from.match(PLACEHOLDER_REGEX)) { staticRules += 1; if (staticRules > MAX_STATIC_REDIRECT_RULES) { invalid.push({ message: `Maximum number of static rules supported is ${MAX_STATIC_REDIRECT_RULES}. Skipping line.` }); continue; } } else { dynamicRules += 1; canCreateStaticRule = false; if (dynamicRules > MAX_DYNAMIC_REDIRECT_RULES) { invalid.push({ message: `Maximum number of dynamic rules supported is ${MAX_DYNAMIC_REDIRECT_RULES}. Skipping remaining ${lines.length - i5} lines of file.` }); break; } } const toResult = validateUrl(str_to, false, false, true, true); if (toResult[0] === void 0) { invalid.push({ line, lineNumber: i5 + 1, message: toResult[1] }); continue; } const to = toResult[0]; const status2 = Number(str_status); if (isNaN(status2) || !PERMITTED_STATUS_CODES.has(status2)) { invalid.push({ line, lineNumber: i5 + 1, message: `Valid status codes are 200, 301, 302 (default), 303, 307, or 308. Got ${str_status}.` }); continue; } if (/\/\*?$/.test(from) && /\/index(.html)?$/.test(to) && !urlHasHost(to)) { invalid.push({ line, lineNumber: i5 + 1, message: "Infinite loop detected in this rule and has been ignored. This will cause a redirect to strip `.html` or `/index` and end up triggering this rule again. Please fix or remove this rule to silence this warning." }); continue; } if (seen_paths.has(from)) { invalid.push({ line, lineNumber: i5 + 1, message: `Ignoring duplicate rule for path ${from}.` }); continue; } seen_paths.add(from); if (status2 === 200) { if (urlHasHost(to)) { invalid.push({ line, lineNumber: i5 + 1, message: `Proxy (200) redirects can only point to relative paths. Got ${to}` }); continue; } } rules.push({ from, to, status: status2, lineNumber: i5 + 1 }); } return { rules, invalid }; } var init_parseRedirects = __esm({ "../workers-shared/utils/configuration/parseRedirects.ts"() { init_import_meta_url(); init_constants9(); init_validateURL(); __name(parseRedirects, "parseRedirects"); } }); // ../pages-shared/environment-polyfills/index.ts var polyfill; var init_environment_polyfills = __esm({ "../pages-shared/environment-polyfills/index.ts"() { init_import_meta_url(); polyfill = /* @__PURE__ */ __name((environment) => { Object.entries(environment).map(([name2, value]) => { Object.defineProperty(globalThis, name2, { value, configurable: true, enumerable: true, writable: true }); }); }, "polyfill"); } }); // ../../node_modules/.pnpm/html-rewriter-wasm@0.4.1/node_modules/html-rewriter-wasm/dist/html_rewriter.js var require_html_rewriter = __commonJS({ "../../node_modules/.pnpm/html-rewriter-wasm@0.4.1/node_modules/html-rewriter-wasm/dist/html_rewriter.js"(exports2, module3) { init_import_meta_url(); var imports = {}; imports["__wbindgen_placeholder__"] = module3.exports; var wasm; var { awaitPromise, setWasmExports, wrap: wrap4 } = require(String.raw`./asyncify.js`); var { TextDecoder: TextDecoder2, TextEncoder: TextEncoder4 } = require(String.raw`util`); var heap = new Array(32).fill(void 0); heap.push(void 0, null, true, false); function getObject(idx) { return heap[idx]; } __name(getObject, "getObject"); var heap_next = heap.length; function dropObject(idx) { if (idx < 36) return; heap[idx] = heap_next; heap_next = idx; } __name(dropObject, "dropObject"); function takeObject(idx) { const ret = getObject(idx); dropObject(idx); return ret; } __name(takeObject, "takeObject"); var cachedTextDecoder = new TextDecoder2("utf-8", { ignoreBOM: true, fatal: true }); cachedTextDecoder.decode(); var cachegetUint8Memory0 = null; function getUint8Memory0() { if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); } return cachegetUint8Memory0; } __name(getUint8Memory0, "getUint8Memory0"); function getStringFromWasm0(ptr, len) { return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); } __name(getStringFromWasm0, "getStringFromWasm0"); function addHeapObject(obj) { if (heap_next === heap.length) heap.push(heap.length + 1); const idx = heap_next; heap_next = heap[idx]; heap[idx] = obj; return idx; } __name(addHeapObject, "addHeapObject"); function debugString(val2) { const type = typeof val2; if (type == "number" || type == "boolean" || val2 == null) { return `${val2}`; } if (type == "string") { return `"${val2}"`; } if (type == "symbol") { const description = val2.description; if (description == null) { return "Symbol"; } else { return `Symbol(${description})`; } } if (type == "function") { const name2 = val2.name; if (typeof name2 == "string" && name2.length > 0) { return `Function(${name2})`; } else { return "Function"; } } if (Array.isArray(val2)) { const length = val2.length; let debug = "["; if (length > 0) { debug += debugString(val2[0]); } for (let i5 = 1; i5 < length; i5++) { debug += ", " + debugString(val2[i5]); } debug += "]"; return debug; } const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val2)); let className; if (builtInMatches.length > 1) { className = builtInMatches[1]; } else { return toString.call(val2); } if (className == "Object") { try { return "Object(" + JSON.stringify(val2) + ")"; } catch (_4) { return "Object"; } } if (val2 instanceof Error) { return `${val2.name}: ${val2.message} ${val2.stack}`; } return className; } __name(debugString, "debugString"); var WASM_VECTOR_LEN = 0; var cachedTextEncoder = new TextEncoder4("utf-8"); var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) { return cachedTextEncoder.encodeInto(arg, view); } : function(arg, view) { const buf = cachedTextEncoder.encode(arg); view.set(buf); return { read: arg.length, written: buf.length }; }; function passStringToWasm0(arg, malloc, realloc) { if (realloc === void 0) { const buf = cachedTextEncoder.encode(arg); const ptr2 = malloc(buf.length); getUint8Memory0().subarray(ptr2, ptr2 + buf.length).set(buf); WASM_VECTOR_LEN = buf.length; return ptr2; } let len = arg.length; let ptr = malloc(len); const mem = getUint8Memory0(); let offset = 0; for (; offset < len; offset++) { const code = arg.charCodeAt(offset); if (code > 127) break; mem[ptr + offset] = code; } if (offset !== len) { if (offset !== 0) { arg = arg.slice(offset); } ptr = realloc(ptr, len, len = offset + arg.length * 3); const view = getUint8Memory0().subarray(ptr + offset, ptr + len); const ret = encodeString(arg, view); offset += ret.written; } WASM_VECTOR_LEN = offset; return ptr; } __name(passStringToWasm0, "passStringToWasm0"); var cachegetInt32Memory0 = null; function getInt32Memory0() { if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) { cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer); } return cachegetInt32Memory0; } __name(getInt32Memory0, "getInt32Memory0"); function isLikeNone(x6) { return x6 === void 0 || x6 === null; } __name(isLikeNone, "isLikeNone"); var stack_pointer = 32; function addBorrowedObject(obj) { if (stack_pointer == 1) throw new Error("out of js stack"); heap[--stack_pointer] = obj; return stack_pointer; } __name(addBorrowedObject, "addBorrowedObject"); function passArray8ToWasm0(arg, malloc) { const ptr = malloc(arg.length * 1); getUint8Memory0().set(arg, ptr / 1); WASM_VECTOR_LEN = arg.length; return ptr; } __name(passArray8ToWasm0, "passArray8ToWasm0"); function handleError(f5, args) { try { return f5.apply(this, args); } catch (e7) { wasm.__wbindgen_exn_store(addHeapObject(e7)); } } __name(handleError, "handleError"); var Comment = class { static __wrap(ptr) { const obj = Object.create(Comment.prototype); obj.ptr = ptr; return obj; } __destroy_into_raw() { const ptr = this.ptr; this.ptr = 0; return ptr; } free() { const ptr = this.__destroy_into_raw(); wasm.__wbg_comment_free(ptr); } /** * @param {string} content * @param {any | undefined} content_type */ before(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.comment_before(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** * @param {string} content * @param {any | undefined} content_type */ after(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.comment_after(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** * @param {string} content * @param {any | undefined} content_type */ replace(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.comment_replace(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** */ remove() { wasm.comment_remove(this.ptr); return this; } /** * @returns {boolean} */ get removed() { var ret = wasm.comment_removed(this.ptr); return ret !== 0; } /** * @returns {string} */ get text() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); wasm.comment_text(retptr, this.ptr); var r0 = getInt32Memory0()[retptr / 4 + 0]; var r1 = getInt32Memory0()[retptr / 4 + 1]; return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); wasm.__wbindgen_free(r0, r1); } } /** * @param {string} text */ set text(text) { var ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.comment_set_text(this.ptr, ptr0, len0); } }; __name(Comment, "Comment"); module3.exports.Comment = Comment; var Doctype = class { static __wrap(ptr) { const obj = Object.create(Doctype.prototype); obj.ptr = ptr; return obj; } __destroy_into_raw() { const ptr = this.ptr; this.ptr = 0; return ptr; } free() { const ptr = this.__destroy_into_raw(); wasm.__wbg_doctype_free(ptr); } /** * @returns {any} */ get name() { var ret = wasm.doctype_name(this.ptr); return takeObject(ret); } /** * @returns {any} */ get publicId() { var ret = wasm.doctype_public_id(this.ptr); return takeObject(ret); } /** * @returns {any} */ get systemId() { var ret = wasm.doctype_system_id(this.ptr); return takeObject(ret); } }; __name(Doctype, "Doctype"); module3.exports.Doctype = Doctype; var DocumentEnd = class { static __wrap(ptr) { const obj = Object.create(DocumentEnd.prototype); obj.ptr = ptr; return obj; } __destroy_into_raw() { const ptr = this.ptr; this.ptr = 0; return ptr; } free() { const ptr = this.__destroy_into_raw(); wasm.__wbg_documentend_free(ptr); } /** * @param {string} content * @param {any | undefined} content_type */ append(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.documentend_append(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } }; __name(DocumentEnd, "DocumentEnd"); module3.exports.DocumentEnd = DocumentEnd; var Element2 = class { static __wrap(ptr) { const obj = Object.create(Element2.prototype); obj.ptr = ptr; return obj; } __destroy_into_raw() { const ptr = this.ptr; this.ptr = 0; return ptr; } free() { const ptr = this.__destroy_into_raw(); wasm.__wbg_element_free(ptr); } /** * @param {string} content * @param {any | undefined} content_type */ before(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.element_before(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** * @param {string} content * @param {any | undefined} content_type */ after(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.element_after(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** * @param {string} content * @param {any | undefined} content_type */ replace(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.element_replace(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** */ remove() { wasm.element_remove(this.ptr); return this; } /** * @returns {boolean} */ get removed() { var ret = wasm.element_removed(this.ptr); return ret !== 0; } /** * @returns {string} */ get tagName() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); wasm.element_tag_name(retptr, this.ptr); var r0 = getInt32Memory0()[retptr / 4 + 0]; var r1 = getInt32Memory0()[retptr / 4 + 1]; return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); wasm.__wbindgen_free(r0, r1); } } /** * @param {string} name */ set tagName(name2) { var ptr0 = passStringToWasm0(name2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.element_set_tag_name(this.ptr, ptr0, len0); } /** * @returns {any} */ get namespaceURI() { var ret = wasm.element_namespace_uri(this.ptr); return takeObject(ret); } /** * @returns {any} */ get attributes() { var ret = wasm.element_attributes(this.ptr); return takeObject(ret)[Symbol.iterator](); } /** * @param {string} name * @returns {any} */ getAttribute(name2) { var ptr0 = passStringToWasm0(name2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; var ret = wasm.element_getAttribute(this.ptr, ptr0, len0); return takeObject(ret); } /** * @param {string} name * @returns {boolean} */ hasAttribute(name2) { var ptr0 = passStringToWasm0(name2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; var ret = wasm.element_hasAttribute(this.ptr, ptr0, len0); return ret !== 0; } /** * @param {string} name * @param {string} value */ setAttribute(name2, value) { var ptr0 = passStringToWasm0(name2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; var ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len1 = WASM_VECTOR_LEN; wasm.element_setAttribute(this.ptr, ptr0, len0, ptr1, len1); return this; } /** * @param {string} name */ removeAttribute(name2) { var ptr0 = passStringToWasm0(name2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.element_removeAttribute(this.ptr, ptr0, len0); return this; } /** * @param {string} content * @param {any | undefined} content_type */ prepend(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.element_prepend(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** * @param {string} content * @param {any | undefined} content_type */ append(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.element_append(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** * @param {string} content * @param {any | undefined} content_type */ setInnerContent(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.element_setInnerContent(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** */ removeAndKeepContent() { wasm.element_removeAndKeepContent(this.ptr); return this; } /** * @param {any} handler */ onEndTag(handler31) { wasm.element_onEndTag(this.ptr, addHeapObject(handler31.bind(this))); } }; __name(Element2, "Element"); module3.exports.Element = Element2; var EndTag = class { static __wrap(ptr) { const obj = Object.create(EndTag.prototype); obj.ptr = ptr; return obj; } __destroy_into_raw() { const ptr = this.ptr; this.ptr = 0; return ptr; } free() { const ptr = this.__destroy_into_raw(); wasm.__wbg_endtag_free(ptr); } /** * @returns {string} */ get name() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); wasm.endtag_name(retptr, this.ptr); var r0 = getInt32Memory0()[retptr / 4 + 0]; var r1 = getInt32Memory0()[retptr / 4 + 1]; return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); wasm.__wbindgen_free(r0, r1); } } /** * @param {string} name */ set name(name2) { var ptr0 = passStringToWasm0(name2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.endtag_set_name(this.ptr, ptr0, len0); } /** * @param {string} content * @param {any | undefined} content_type */ before(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.endtag_before(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** * @param {string} content * @param {any | undefined} content_type */ after(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.endtag_after(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** */ remove() { wasm.endtag_remove(this.ptr); return this; } }; __name(EndTag, "EndTag"); module3.exports.EndTag = EndTag; var HTMLRewriter3 = class { static __wrap(ptr) { const obj = Object.create(HTMLRewriter3.prototype); obj.ptr = ptr; return obj; } __destroy_into_raw() { const ptr = this.ptr; this.ptr = 0; return ptr; } free() { const ptr = this.__destroy_into_raw(); wasm.__wbg_htmlrewriter_free(ptr); } /** * @param {any} output_sink * @param {any | undefined} options */ constructor(output_sink, options32) { try { var ret = wasm.htmlrewriter_new(addBorrowedObject(output_sink), isLikeNone(options32) ? 0 : addHeapObject(options32)); return HTMLRewriter3.__wrap(ret); } finally { heap[stack_pointer++] = void 0; } } /** * @param {string} selector * @param {any} handlers */ on(selector, handlers2) { var ptr0 = passStringToWasm0(selector, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.htmlrewriter_on(this.ptr, ptr0, len0, addHeapObject(handlers2)); return this; } /** * @param {any} handlers */ onDocument(handlers2) { wasm.htmlrewriter_onDocument(this.ptr, addHeapObject(handlers2)); return this; } /** * @param {Uint8Array} chunk */ async write(chunk) { var ptr0 = passArray8ToWasm0(chunk, wasm.__wbindgen_malloc); var len0 = WASM_VECTOR_LEN; await wrap4(this, wasm.htmlrewriter_write, this.ptr, ptr0, len0); } /** */ async end() { await wrap4(this, wasm.htmlrewriter_end, this.ptr); } /** * @returns {number} */ get asyncifyStackPtr() { var ret = wasm.htmlrewriter_asyncify_stack_ptr(this.ptr); return ret; } }; __name(HTMLRewriter3, "HTMLRewriter"); module3.exports.HTMLRewriter = HTMLRewriter3; var TextChunk = class { static __wrap(ptr) { const obj = Object.create(TextChunk.prototype); obj.ptr = ptr; return obj; } __destroy_into_raw() { const ptr = this.ptr; this.ptr = 0; return ptr; } free() { const ptr = this.__destroy_into_raw(); wasm.__wbg_textchunk_free(ptr); } /** * @param {string} content * @param {any | undefined} content_type */ before(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.textchunk_before(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** * @param {string} content * @param {any | undefined} content_type */ after(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.textchunk_after(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** * @param {string} content * @param {any | undefined} content_type */ replace(content, content_type) { var ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; wasm.textchunk_replace(this.ptr, ptr0, len0, isLikeNone(content_type) ? 0 : addHeapObject(content_type)); return this; } /** */ remove() { wasm.textchunk_remove(this.ptr); return this; } /** * @returns {boolean} */ get removed() { var ret = wasm.textchunk_removed(this.ptr); return ret !== 0; } /** * @returns {string} */ get text() { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); wasm.textchunk_text(retptr, this.ptr); var r0 = getInt32Memory0()[retptr / 4 + 0]; var r1 = getInt32Memory0()[retptr / 4 + 1]; return getStringFromWasm0(r0, r1); } finally { wasm.__wbindgen_add_to_stack_pointer(16); wasm.__wbindgen_free(r0, r1); } } /** * @returns {boolean} */ get lastInTextNode() { var ret = wasm.textchunk_last_in_text_node(this.ptr); return ret !== 0; } }; __name(TextChunk, "TextChunk"); module3.exports.TextChunk = TextChunk; module3.exports.__wbindgen_object_drop_ref = function(arg0) { takeObject(arg0); }; module3.exports.__wbg_html_cd9a0f328493678b = function(arg0) { var ret = getObject(arg0).html; return isLikeNone(ret) ? 16777215 : ret ? 1 : 0; }; module3.exports.__wbindgen_string_new = function(arg0, arg1) { var ret = getStringFromWasm0(arg0, arg1); return addHeapObject(ret); }; module3.exports.__wbg_documentend_new = function(arg0) { var ret = DocumentEnd.__wrap(arg0); return addHeapObject(ret); }; module3.exports.__wbg_awaitPromise_39a1101fd8518869 = function(arg0, arg1) { awaitPromise(arg0, getObject(arg1)); }; module3.exports.__wbindgen_object_clone_ref = function(arg0) { var ret = getObject(arg0); return addHeapObject(ret); }; module3.exports.__wbg_element_c38470ed972aea27 = function(arg0) { var ret = getObject(arg0).element; return isLikeNone(ret) ? 0 : addHeapObject(ret); }; module3.exports.__wbg_comments_ba86bc03331d9378 = function(arg0) { var ret = getObject(arg0).comments; return isLikeNone(ret) ? 0 : addHeapObject(ret); }; module3.exports.__wbg_text_7800bf26cb443911 = function(arg0) { var ret = getObject(arg0).text; return isLikeNone(ret) ? 0 : addHeapObject(ret); }; module3.exports.__wbg_element_new = function(arg0) { var ret = Element2.__wrap(arg0); return addHeapObject(ret); }; module3.exports.__wbg_comment_new = function(arg0) { var ret = Comment.__wrap(arg0); return addHeapObject(ret); }; module3.exports.__wbg_textchunk_new = function(arg0) { var ret = TextChunk.__wrap(arg0); return addHeapObject(ret); }; module3.exports.__wbg_doctype_ac58c0964a59b61b = function(arg0) { var ret = getObject(arg0).doctype; return isLikeNone(ret) ? 0 : addHeapObject(ret); }; module3.exports.__wbg_comments_94d876f6c0502e82 = function(arg0) { var ret = getObject(arg0).comments; return isLikeNone(ret) ? 0 : addHeapObject(ret); }; module3.exports.__wbg_text_4606a16c30e4ae91 = function(arg0) { var ret = getObject(arg0).text; return isLikeNone(ret) ? 0 : addHeapObject(ret); }; module3.exports.__wbg_end_34efb9402eac8a4e = function(arg0) { var ret = getObject(arg0).end; return isLikeNone(ret) ? 0 : addHeapObject(ret); }; module3.exports.__wbg_doctype_new = function(arg0) { var ret = Doctype.__wrap(arg0); return addHeapObject(ret); }; module3.exports.__wbg_endtag_new = function(arg0) { var ret = EndTag.__wrap(arg0); return addHeapObject(ret); }; module3.exports.__wbg_enableEsiTags_de6b91cc61a25874 = function(arg0) { var ret = getObject(arg0).enableEsiTags; return isLikeNone(ret) ? 16777215 : ret ? 1 : 0; }; module3.exports.__wbg_String_60c4ba333b5ca1c6 = function(arg0, arg1) { var ret = String(getObject(arg1)); var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; getInt32Memory0()[arg0 / 4 + 1] = len0; getInt32Memory0()[arg0 / 4 + 0] = ptr0; }; module3.exports.__wbg_new_4fee7e2900033464 = function() { var ret = new Array(); return addHeapObject(ret); }; module3.exports.__wbg_push_ba9b5e3c25cff8f9 = function(arg0, arg1) { var ret = getObject(arg0).push(getObject(arg1)); return ret; }; module3.exports.__wbg_call_6c4ea719458624eb = function() { return handleError(function(arg0, arg1, arg2) { var ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); return addHeapObject(ret); }, arguments); }; module3.exports.__wbg_new_917809a3e20a4b00 = function(arg0, arg1) { var ret = new TypeError(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); }; module3.exports.__wbg_instanceof_Promise_c6535fc791fcc4d2 = function(arg0) { var obj = getObject(arg0); var ret = obj instanceof Promise || Object.prototype.toString.call(obj) === "[object Promise]"; return ret; }; module3.exports.__wbg_buffer_89a8560ab6a3d9c6 = function(arg0) { var ret = getObject(arg0).buffer; return addHeapObject(ret); }; module3.exports.__wbg_newwithbyteoffsetandlength_e45d8b33c02dc3b5 = function(arg0, arg1, arg2) { var ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); return addHeapObject(ret); }; module3.exports.__wbg_new_bd2e1d010adb8a1a = function(arg0) { var ret = new Uint8Array(getObject(arg0)); return addHeapObject(ret); }; module3.exports.__wbindgen_debug_string = function(arg0, arg1) { var ret = debugString(getObject(arg1)); var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len0 = WASM_VECTOR_LEN; getInt32Memory0()[arg0 / 4 + 1] = len0; getInt32Memory0()[arg0 / 4 + 0] = ptr0; }; module3.exports.__wbindgen_throw = function(arg0, arg1) { throw new Error(getStringFromWasm0(arg0, arg1)); }; module3.exports.__wbindgen_rethrow = function(arg0) { throw takeObject(arg0); }; module3.exports.__wbindgen_memory = function() { var ret = wasm.memory; return addHeapObject(ret); }; var path72 = require("path").join(__dirname, "html_rewriter_bg.wasm"); var bytes = require("fs").readFileSync(path72); var wasmModule = new WebAssembly.Module(bytes); var wasmInstance = new WebAssembly.Instance(wasmModule, imports); wasm = wasmInstance.exports; setWasmExports(wasm); module3.exports.__wasm = wasm; } }); // ../pages-shared/environment-polyfills/html-rewriter.ts var html_rewriter_exports = {}; __export(html_rewriter_exports, { HTMLRewriter: () => HTMLRewriter2 }); var import_web2, import_miniflare24, HTMLRewriter2; var init_html_rewriter = __esm({ "../pages-shared/environment-polyfills/html-rewriter.ts"() { init_import_meta_url(); import_web2 = require("stream/web"); import_miniflare24 = require("miniflare"); HTMLRewriter2 = class { #elementHandlers = []; #documentHandlers = []; on(selector, handlers2) { this.#elementHandlers.push([selector, handlers2]); return this; } onDocument(handlers2) { this.#documentHandlers.push(handlers2); return this; } transform(response) { const body = response.body; if (body === null) { return new import_miniflare24.Response(body, response); } response = new import_miniflare24.Response(response.body, response); let rewriter; const transformStream = new import_web2.TransformStream({ start: async (controller) => { const { HTMLRewriter: BaseHTMLRewriter // eslint-disable-next-line @typescript-eslint/consistent-type-imports } = await Promise.resolve().then(() => __toESM(require_html_rewriter())); rewriter = new BaseHTMLRewriter((output) => { if (output.length !== 0) { controller.enqueue(output); } }); for (const [selector, handlers2] of this.#elementHandlers) { rewriter.on(selector, handlers2); } for (const handlers2 of this.#documentHandlers) { rewriter.onDocument(handlers2); } }, // The finally() below will ensure the rewriter is always freed. // chunk is guaranteed to be a Uint8Array as we're using the // @miniflare/core Response class, which transforms to a byte stream. transform: (chunk) => rewriter.write(chunk), flush: () => rewriter.end() }); const promise = body.pipeTo(transformStream.writable); promise.catch(() => { }).finally(() => rewriter.free()); const res = new import_miniflare24.Response(transformStream.readable, response); res.headers.delete("Content-Length"); return res; } }; __name(HTMLRewriter2, "HTMLRewriter"); } }); // ../pages-shared/environment-polyfills/miniflare.ts var miniflare_exports2 = {}; __export(miniflare_exports2, { default: () => miniflare_default }); var miniflare_default; var init_miniflare = __esm({ "../pages-shared/environment-polyfills/miniflare.ts"() { init_import_meta_url(); init_environment_polyfills(); miniflare_default = /* @__PURE__ */ __name(async () => { const { HTMLRewriter: HTMLRewriter3 } = await Promise.resolve().then(() => (init_html_rewriter(), html_rewriter_exports)); const mf = await import("miniflare"); polyfill({ fetch: mf.fetch, Headers: mf.Headers, Request: mf.Request, Response: mf.Response, HTMLRewriter: HTMLRewriter3 }); }, "default"); } }); // ../workers-shared/asset-worker/src/utils/rules-engine.ts var ESCAPE_REGEX_CHARACTERS2, escapeRegex2, HOST_PLACEHOLDER_REGEX, PLACEHOLDER_REGEX2, replacer, generateRulesMatcher; var init_rules_engine = __esm({ "../workers-shared/asset-worker/src/utils/rules-engine.ts"() { init_import_meta_url(); ESCAPE_REGEX_CHARACTERS2 = /[-/\\^$*+?.()|[\]{}]/g; escapeRegex2 = /* @__PURE__ */ __name((str) => { return str.replace(ESCAPE_REGEX_CHARACTERS2, "\\$&"); }, "escapeRegex"); HOST_PLACEHOLDER_REGEX = /(?<=^https:\\\/\\\/[^/]*?):([A-Za-z]\w*)(?=\\)/g; PLACEHOLDER_REGEX2 = /:([A-Za-z]\w*)/g; replacer = /* @__PURE__ */ __name((str, replacements) => { for (const [replacement, value] of Object.entries(replacements)) { str = str.replaceAll(`:${replacement}`, value); } return str; }, "replacer"); generateRulesMatcher = /* @__PURE__ */ __name((rules, replacerFn = (match2) => match2) => { if (!rules) { return () => []; } const compiledRules = Object.entries(rules).map(([rule, match2]) => { const crossHost = rule.startsWith("https://"); rule = rule.split("*").map(escapeRegex2).join("(?.*)"); const host_matches = rule.matchAll(HOST_PLACEHOLDER_REGEX); for (const host_match of host_matches) { rule = rule.split(host_match[0]).join(`(?<${host_match[1]}>[^/.]+)`); } const path_matches = rule.matchAll(PLACEHOLDER_REGEX2); for (const path_match of path_matches) { rule = rule.split(path_match[0]).join(`(?<${path_match[1]}>[^/]+)`); } rule = "^" + rule + "$"; try { const regExp = new RegExp(rule); return [{ crossHost, regExp }, match2]; } catch { } }).filter((value) => value !== void 0); return ({ request: request4 }) => { const { pathname, hostname: hostname2 } = new URL(request4.url); return compiledRules.map(([{ crossHost, regExp }, match2]) => { const test = crossHost ? `https://${hostname2}${pathname}` : pathname; const result = regExp.exec(test); if (result) { return replacerFn(match2, result.groups || {}); } }).filter((value) => value !== void 0); }; }, "generateRulesMatcher"); } }); // ../pages-shared/asset-server/responses.ts function mergeHeaders(base, extra) { const baseHeaders = new Headers(base ?? {}); const extraHeaders = new Headers(extra ?? {}); return new Headers({ ...Object.fromEntries(baseHeaders.entries()), ...Object.fromEntries(extraHeaders.entries()) }); } function stripLeadingDoubleSlashes(location) { return location.replace(/^(\/|%2F|%2f|%5C|%5c|%09|\s|\\)+(.*)/, "/$2"); } var OkResponse, MovedPermanentlyResponse, FoundResponse, NotModifiedResponse, PermanentRedirectResponse, NotFoundResponse, MethodNotAllowedResponse, NotAcceptableResponse, InternalServerErrorResponse, SeeOtherResponse, TemporaryRedirectResponse; var init_responses = __esm({ "../pages-shared/asset-server/responses.ts"() { init_import_meta_url(); __name(mergeHeaders, "mergeHeaders"); __name(stripLeadingDoubleSlashes, "stripLeadingDoubleSlashes"); OkResponse = class extends Response { constructor(...[body, init2]) { super(body, { ...init2, status: 200, statusText: "OK" }); } }; __name(OkResponse, "OkResponse"); MovedPermanentlyResponse = class extends Response { constructor(location, init2, { preventLeadingDoubleSlash = true } = { preventLeadingDoubleSlash: true }) { location = preventLeadingDoubleSlash ? stripLeadingDoubleSlashes(location) : location; super(`Redirecting to ${location}`, { ...init2, status: 301, statusText: "Moved Permanently", headers: mergeHeaders(init2?.headers, { location }) }); } }; __name(MovedPermanentlyResponse, "MovedPermanentlyResponse"); FoundResponse = class extends Response { constructor(location, init2, { preventLeadingDoubleSlash = true } = { preventLeadingDoubleSlash: true }) { location = preventLeadingDoubleSlash ? stripLeadingDoubleSlashes(location) : location; super(`Redirecting to ${location}`, { ...init2, status: 302, statusText: "Found", headers: mergeHeaders(init2?.headers, { location }) }); } }; __name(FoundResponse, "FoundResponse"); NotModifiedResponse = class extends Response { constructor(...[_body, _init]) { super(void 0, { status: 304, statusText: "Not Modified" }); } }; __name(NotModifiedResponse, "NotModifiedResponse"); PermanentRedirectResponse = class extends Response { constructor(location, init2, { preventLeadingDoubleSlash = true } = { preventLeadingDoubleSlash: true }) { location = preventLeadingDoubleSlash ? stripLeadingDoubleSlashes(location) : location; super(void 0, { ...init2, status: 308, statusText: "Permanent Redirect", headers: mergeHeaders(init2?.headers, { location }) }); } }; __name(PermanentRedirectResponse, "PermanentRedirectResponse"); NotFoundResponse = class extends Response { constructor(...[body, init2]) { super(body, { ...init2, status: 404, statusText: "Not Found" }); } }; __name(NotFoundResponse, "NotFoundResponse"); MethodNotAllowedResponse = class extends Response { constructor(...[body, init2]) { super(body, { ...init2, status: 405, statusText: "Method Not Allowed" }); } }; __name(MethodNotAllowedResponse, "MethodNotAllowedResponse"); NotAcceptableResponse = class extends Response { constructor(...[body, init2]) { super(body, { ...init2, status: 406, statusText: "Not Acceptable" }); } }; __name(NotAcceptableResponse, "NotAcceptableResponse"); InternalServerErrorResponse = class extends Response { constructor(err, init2) { let body = void 0; if (globalThis.DEBUG) { body = `${err.message} ${err.stack}`; } super(body, { ...init2, status: 500, statusText: "Internal Server Error" }); } }; __name(InternalServerErrorResponse, "InternalServerErrorResponse"); SeeOtherResponse = class extends Response { constructor(location, init2, { preventLeadingDoubleSlash = true } = { preventLeadingDoubleSlash: true }) { location = preventLeadingDoubleSlash ? stripLeadingDoubleSlashes(location) : location; super(`Redirecting to ${location}`, { ...init2, status: 303, statusText: "See Other", headers: mergeHeaders(init2?.headers, { location }) }); } }; __name(SeeOtherResponse, "SeeOtherResponse"); TemporaryRedirectResponse = class extends Response { constructor(location, init2, { preventLeadingDoubleSlash = true } = { preventLeadingDoubleSlash: true }) { location = preventLeadingDoubleSlash ? stripLeadingDoubleSlashes(location) : location; super(`Redirecting to ${location}`, { ...init2, status: 307, statusText: "Temporary Redirect", headers: mergeHeaders(init2?.headers, { location }) }); } }; __name(TemporaryRedirectResponse, "TemporaryRedirectResponse"); } }); // ../pages-shared/asset-server/handler.ts var handler_exports = {}; __export(handler_exports, { ANALYTICS_VERSION: () => ANALYTICS_VERSION2, ASSET_PRESERVATION_CACHE: () => ASSET_PRESERVATION_CACHE, CACHE_CONTROL_BROWSER: () => CACHE_CONTROL_BROWSER, CACHE_PRESERVATION_WRITE_FREQUENCY: () => CACHE_PRESERVATION_WRITE_FREQUENCY, HEADERS_VERSION: () => HEADERS_VERSION2, HEADERS_VERSION_V1: () => HEADERS_VERSION_V1, REDIRECTS_VERSION: () => REDIRECTS_VERSION2, generateHandler: () => generateHandler2, isPreservationCacheResponseExpiring: () => isPreservationCacheResponseExpiring, normaliseHeaders: () => normaliseHeaders, parseQualityWeightedList: () => parseQualityWeightedList }); function normaliseHeaders(headers) { if (headers.version === HEADERS_VERSION2) { return headers.rules; } else if (headers.version === HEADERS_VERSION_V1) { return Object.keys(headers.rules).reduce( (acc, key) => { acc[key] = { set: headers.rules[key] }; return acc; }, {} ); } else { return {}; } } function generateETagHeader(assetKey) { const strongETag = `"${assetKey}"`; const weakETag = `W/"${assetKey}"`; return { strongETag, weakETag }; } function checkIfNoneMatch(request4, strongETag, weakETag) { const ifNoneMatch = request4.headers.get("if-none-match"); return ifNoneMatch === weakETag || ifNoneMatch === strongETag; } async function generateHandler2({ request: request4, metadata, xServerEnvHeader, xDeploymentIdHeader, logError, setMetrics, findAssetEntryForPath, getAssetKey, negotiateContent, fetchAsset, generateNotFoundResponse = /* @__PURE__ */ __name(async (notFoundRequest, notFoundFindAssetEntryForPath, notFoundServeAsset) => { let assetEntry; if (assetEntry = await notFoundFindAssetEntryForPath("/index.html")) { return notFoundServeAsset(assetEntry, { preserve: false }); } return new NotFoundResponse(); }, "generateNotFoundResponse"), attachAdditionalHeaders = /* @__PURE__ */ __name(() => { }, "attachAdditionalHeaders"), caches, waitUntil }) { const url4 = new URL(request4.url); const { protocol, host, search } = url4; let { pathname } = url4; const earlyHintsCache = metadata.deploymentId ? await caches?.open(`eh:${metadata.deploymentId}`) : void 0; const headerRules = metadata.headers ? normaliseHeaders(metadata.headers) : {}; const staticRules = metadata.redirects?.version === REDIRECTS_VERSION2 ? metadata.redirects.staticRules || {} : {}; const staticRedirectsMatcher = /* @__PURE__ */ __name(() => { const withHostMatch = staticRules[`https://${host}${pathname}`]; const withoutHostMatch = staticRules[pathname]; if (withHostMatch && withoutHostMatch) { if (withHostMatch.lineNumber < withoutHostMatch.lineNumber) { return withHostMatch; } else { return withoutHostMatch; } } return withHostMatch || withoutHostMatch; }, "staticRedirectsMatcher"); const generateRedirectsMatcher = /* @__PURE__ */ __name(() => generateRulesMatcher( metadata.redirects?.version === REDIRECTS_VERSION2 ? metadata.redirects.rules : {}, ({ status: status2, to }, replacements) => ({ status: status2, to: replacer(to, replacements) }) ), "generateRedirectsMatcher"); let assetEntry; async function generateResponse() { const match2 = staticRedirectsMatcher() || generateRedirectsMatcher()({ request: request4 })[0]; if (match2) { if (match2.status === 200) { pathname = new URL(match2.to, request4.url).pathname; } else { const { status: status2, to } = match2; const destination = new URL(to, request4.url); const location = destination.origin === new URL(request4.url).origin ? `${destination.pathname}${destination.search || search}${destination.hash}` : `${destination.href.slice(0, destination.href.length - (destination.search.length + destination.hash.length))}${destination.search ? destination.search : search}${destination.hash}`; switch (status2) { case 301: return new MovedPermanentlyResponse(location, void 0, { preventLeadingDoubleSlash: false }); case 303: return new SeeOtherResponse(location, void 0, { preventLeadingDoubleSlash: false }); case 307: return new TemporaryRedirectResponse(location, void 0, { preventLeadingDoubleSlash: false }); case 308: return new PermanentRedirectResponse(location, void 0, { preventLeadingDoubleSlash: false }); case 302: default: return new FoundResponse(location, void 0, { preventLeadingDoubleSlash: false }); } } } if (!request4.method.match(/^(get|head)$/i)) { return new MethodNotAllowedResponse(); } try { pathname = globalThis.decodeURIComponent(pathname); } catch (err) { } if (pathname.endsWith("/")) { if (assetEntry = await findAssetEntryForPath(`${pathname}index.html`)) { return serveAsset(assetEntry); } else if (pathname.endsWith("/index/")) { return new PermanentRedirectResponse( `/${pathname.slice(1, -"index/".length)}${search}` ); } else if (assetEntry = await findAssetEntryForPath( `${pathname.replace(/\/$/, ".html")}` )) { return new PermanentRedirectResponse( `/${pathname.slice(1, -1)}${search}` ); } else { return notFound(); } } if (assetEntry = await findAssetEntryForPath(pathname)) { if (pathname.endsWith(".html")) { const extensionlessPath = pathname.slice(0, -".html".length); if (extensionlessPath.endsWith("/index")) { return new PermanentRedirectResponse( `${extensionlessPath.replace(/\/index$/, "/")}${search}` ); } else if (await findAssetEntryForPath(extensionlessPath) || extensionlessPath === "/") { return serveAsset(assetEntry); } else { return new PermanentRedirectResponse(`${extensionlessPath}${search}`); } } else { return serveAsset(assetEntry); } } else if (pathname.endsWith("/index")) { return new PermanentRedirectResponse( `/${pathname.slice(1, -"index".length)}${search}` ); } else if (assetEntry = await findAssetEntryForPath(`${pathname}.html`)) { return serveAsset(assetEntry); } if (assetEntry = await findAssetEntryForPath(`${pathname}/index.html`)) { return new PermanentRedirectResponse(`${pathname}/${search}`); } else { return notFound(); } } __name(generateResponse, "generateResponse"); function isNullBodyStatus(status2) { return [101, 204, 205, 304].includes(status2); } __name(isNullBodyStatus, "isNullBodyStatus"); async function attachHeaders(response) { const existingHeaders = new Headers(response.headers); const eTag = existingHeaders.get("eTag")?.match(/^"(.*)"$/)?.[1]; const extraHeaders = new Headers({ "access-control-allow-origin": "*", "referrer-policy": "strict-origin-when-cross-origin", ...existingHeaders.has("content-type") ? { "x-content-type-options": "nosniff" } : {} }); const headers = new Headers({ // But we intentionally override existing headers ...Object.fromEntries(existingHeaders.entries()), ...Object.fromEntries(extraHeaders.entries()) }); if (earlyHintsCache && isHTMLContentType(response.headers.get("Content-Type")) && eTag) { const preEarlyHintsHeaders = new Headers(headers); const earlyHintsCacheKey = `${protocol}//${host}/${eTag}`; const earlyHintsResponse = await earlyHintsCache.match(earlyHintsCacheKey); if (earlyHintsResponse) { const earlyHintsLinkHeader = earlyHintsResponse.headers.get("Link"); if (earlyHintsLinkHeader) { headers.set("Link", earlyHintsLinkHeader); if (setMetrics) { setMetrics({ earlyHintsResult: "used-hit" }); } } else { if (setMetrics) { setMetrics({ earlyHintsResult: "notused-hit" }); } } } else { if (setMetrics) { setMetrics({ earlyHintsResult: "notused-miss" }); } const clonedResponse = response.clone(); if (waitUntil) { waitUntil( (async () => { try { const links = []; const transformedResponse = new HTMLRewriter().on( "link[rel~=preconnect],link[rel~=preload],link[rel~=modulepreload]", { element(element) { for (const [attributeName] of element.attributes) { if (!ALLOWED_EARLY_HINT_LINK_ATTRIBUTES.includes( attributeName.toLowerCase() )) { return; } } const href = element.getAttribute("href") || void 0; const rel = element.getAttribute("rel") || void 0; const as2 = element.getAttribute("as") || void 0; if (href && !href.startsWith("data:") && rel) { links.push({ href, rel, as: as2 }); } } } ).transform(clonedResponse); await transformedResponse.text(); links.forEach(({ href, rel, as: as2 }) => { let link = `<${href}>; rel="${rel}"`; if (as2) { link += `; as=${as2}`; } preEarlyHintsHeaders.append("Link", link); }); const linkHeader = preEarlyHintsHeaders.get("Link"); const earlyHintsHeaders = new Headers({ "Cache-Control": "max-age=2592000" // 30 days }); if (linkHeader) { earlyHintsHeaders.append("Link", linkHeader); } await earlyHintsCache.put( earlyHintsCacheKey, new Response(null, { headers: earlyHintsHeaders }) ); } catch (err) { await earlyHintsCache.put( earlyHintsCacheKey, new Response(null, { headers: { "Cache-Control": "max-age=86400" // 1 day } }) ); } })() ); } } } else { if (setMetrics) { setMetrics({ earlyHintsResult: "disabled" }); } } const headersMatcher = generateRulesMatcher( headerRules, ({ set = {}, unset = [] }, replacements) => { const replacedSet = {}; Object.keys(set).forEach((key) => { replacedSet[key] = replacer(set[key], replacements); }); return { set: replacedSet, unset }; } ); const matches = headersMatcher({ request: request4 }); const setMap = /* @__PURE__ */ new Set(); matches.forEach(({ set = {}, unset = [] }) => { unset.forEach((key) => { headers.delete(key); }); Object.keys(set).forEach((key) => { if (setMap.has(key.toLowerCase())) { headers.append(key, set[key]); } else { headers.set(key, set[key]); setMap.add(key.toLowerCase()); } }); }); return new Response( isNullBodyStatus(response.status) ? null : response.body, { headers, status: response.status, statusText: response.statusText } ); } __name(attachHeaders, "attachHeaders"); const responseWithoutHeaders = await generateResponse(); if (responseWithoutHeaders.status >= 500) { return responseWithoutHeaders; } const responseWithHeaders = await attachHeaders(responseWithoutHeaders); if (responseWithHeaders.status === 404) { if (responseWithHeaders.headers.has("cache-control")) { responseWithHeaders.headers.delete("cache-control"); } responseWithHeaders.headers.append("cache-control", "no-store"); } return responseWithHeaders; async function serveAsset(servingAssetEntry, options32 = { preserve: true }) { let content; try { content = negotiateContent(request4, servingAssetEntry); } catch (err) { return new NotAcceptableResponse(); } const assetKey = getAssetKey(servingAssetEntry, content); const { strongETag, weakETag } = generateETagHeader(assetKey); const isIfNoneMatch = checkIfNoneMatch(request4, strongETag, weakETag); if (isIfNoneMatch) { return new NotModifiedResponse(); } try { const asset = await fetchAsset(assetKey); const headers = { etag: strongETag, "content-type": asset.contentType }; let encodeBody = "automatic"; if (xServerEnvHeader) { headers["x-server-env"] = xServerEnvHeader; } if (xDeploymentIdHeader && metadata.deploymentId) { headers["x-deployment-id"] = metadata.deploymentId; } if (content.encoding) { encodeBody = "manual"; headers["cache-control"] = "no-transform"; headers["content-encoding"] = content.encoding; } const response = new OkResponse( request4.method === "HEAD" ? null : asset.body, { headers, encodeBody } ); if (isCacheable(request4)) { response.headers.append("cache-control", CACHE_CONTROL_BROWSER); } attachAdditionalHeaders(response, content, servingAssetEntry, asset); if (isPreview(new URL(request4.url))) { response.headers.set("x-robots-tag", "noindex"); } if (options32.preserve && waitUntil && caches) { waitUntil( (async () => { try { const assetPreservationCache = await caches.open( ASSET_PRESERVATION_CACHE ); const match2 = await assetPreservationCache.match(request4); if (!match2 || assetKey !== await match2.text() || isPreservationCacheResponseExpiring(match2)) { const preservedResponse = new Response(assetKey, response); preservedResponse.headers.set( "cache-control", CACHE_CONTROL_PRESERVATION ); preservedResponse.headers.set("x-robots-tag", "noindex"); await assetPreservationCache.put( request4.url, preservedResponse ); } } catch (err) { logError(err); } })() ); } if (isHTMLContentType(asset.contentType) && metadata.analytics?.version === ANALYTICS_VERSION2) { return new HTMLRewriter().on("body", { element(e7) { e7.append( ``, { html: true } ); } }).transform(response); } return response; } catch (err) { logError(err); return new InternalServerErrorResponse(err); } } __name(serveAsset, "serveAsset"); async function notFound() { if (caches) { try { const assetPreservationCache = await caches.open( ASSET_PRESERVATION_CACHE ); const preservedResponse = await assetPreservationCache.match( request4.url ); if (preservedResponse) { if (setMetrics) { setMetrics({ preservationCacheResult: "checked-hit" }); } const assetKey = await preservedResponse.text(); if (isNullBodyStatus(preservedResponse.status)) { return new Response(null, preservedResponse); } if (assetKey) { const { strongETag, weakETag } = generateETagHeader(assetKey); const isIfNoneMatch = checkIfNoneMatch( request4, strongETag, weakETag ); if (isIfNoneMatch) { if (setMetrics) { setMetrics({ preservationCacheResult: "not-modified" }); } return new NotModifiedResponse(); } const asset = await fetchAsset(assetKey); if (asset) { return new Response(asset.body, preservedResponse); } else { logError( new Error( `preservation cache contained assetKey that does not exist in storage: ${assetKey}` ) ); } } else { logError(new Error(`cached response had no assetKey: ${assetKey}`)); } } else { if (setMetrics) { setMetrics({ preservationCacheResult: "checked-miss" }); } } } catch (err) { logError(err); } } else { if (setMetrics) { setMetrics({ preservationCacheResult: "disabled" }); } } let cwd2 = pathname; while (cwd2) { cwd2 = cwd2.slice(0, cwd2.lastIndexOf("/")); if (assetEntry = await findAssetEntryForPath(`${cwd2}/404.html`)) { let content; try { content = negotiateContent(request4, assetEntry); } catch (err) { return new NotAcceptableResponse(); } const assetKey = getAssetKey(assetEntry, content); try { const { body, contentType } = await fetchAsset(assetKey); const response = new NotFoundResponse(body); response.headers.set("content-type", contentType); return response; } catch (err) { logError(err); return new InternalServerErrorResponse(err); } } } return await generateNotFoundResponse( request4, findAssetEntryForPath, serveAsset ); } __name(notFound, "notFound"); } function parseQualityWeightedList(list = "") { const items = {}; list.replace(/\s/g, "").split(",").forEach((el) => { const [item, weight] = el.split(";q="); items[item] = weight ? parseFloat(weight) : 1; }); return items; } function isCacheable(request4) { return !request4.headers.has("authorization") && !request4.headers.has("range"); } function isPreview(url4) { if (url4.hostname.endsWith(".pages.dev")) { return url4.hostname.split(".").length > 3 ? true : false; } return false; } function isPreservationCacheResponseExpiring(response) { const ageHeader = response.headers.get("age"); if (!ageHeader) { return false; } try { const age = parseInt(ageHeader); const jitter = Math.floor(Math.random() * 43200); if (age > CACHE_PRESERVATION_WRITE_FREQUENCY + jitter) { return true; } } catch { return false; } return false; } function isHTMLContentType(contentType) { return contentType?.toLowerCase().startsWith("text/html") || false; } var ASSET_PRESERVATION_CACHE, CACHE_CONTROL_PRESERVATION, CACHE_PRESERVATION_WRITE_FREQUENCY, CACHE_CONTROL_BROWSER, REDIRECTS_VERSION2, HEADERS_VERSION2, HEADERS_VERSION_V1, ANALYTICS_VERSION2, ALLOWED_EARLY_HINT_LINK_ATTRIBUTES; var init_handler2 = __esm({ "../pages-shared/asset-server/handler.ts"() { init_import_meta_url(); init_rules_engine(); init_responses(); ASSET_PRESERVATION_CACHE = "assetPreservationCacheV2"; CACHE_CONTROL_PRESERVATION = "public, s-maxage=604800"; CACHE_PRESERVATION_WRITE_FREQUENCY = 86400; CACHE_CONTROL_BROWSER = "public, max-age=0, must-revalidate"; REDIRECTS_VERSION2 = 1; HEADERS_VERSION2 = 2; HEADERS_VERSION_V1 = 1; ANALYTICS_VERSION2 = 1; ALLOWED_EARLY_HINT_LINK_ATTRIBUTES = ["rel", "as", "href"]; __name(normaliseHeaders, "normaliseHeaders"); __name(generateETagHeader, "generateETagHeader"); __name(checkIfNoneMatch, "checkIfNoneMatch"); __name(generateHandler2, "generateHandler"); __name(parseQualityWeightedList, "parseQualityWeightedList"); __name(isCacheable, "isCacheable"); __name(isPreview, "isPreview"); __name(isPreservationCacheResponseExpiring, "isPreservationCacheResponseExpiring"); __name(isHTMLContentType, "isHTMLContentType"); } }); // src/miniflare-cli/assets.ts var assets_exports = {}; __export(assets_exports, { default: () => generateASSETSBinding }); async function generateASSETSBinding(options32) { const assetsFetch = options32.directory !== void 0 ? await generateAssetsFetch(options32.directory, options32.log) : invalidAssetsFetch; return async function(miniflareRequest) { if (options32.proxyPort) { try { const url4 = new URL(miniflareRequest.url); url4.host = `localhost:${options32.proxyPort}`; const proxyRequest = new import_miniflare25.Request(url4, miniflareRequest); if (proxyRequest.headers.get("Upgrade") === "websocket") { proxyRequest.headers.delete("Sec-WebSocket-Accept"); proxyRequest.headers.delete("Sec-WebSocket-Key"); } return await (0, import_miniflare25.fetch)(proxyRequest, { dispatcher: new ProxyDispatcher(miniflareRequest.headers.get("Host")) }); } catch (thrown) { options32.log.error(new Error(`Could not proxy request: ${thrown}`)); return new import_miniflare25.Response(`[wrangler] Could not proxy request: ${thrown}`, { status: 502 }); } } else { try { return await assetsFetch(miniflareRequest); } catch (thrown) { options32.log.error(new Error(`Could not serve static asset: ${thrown}`)); return new import_miniflare25.Response( `[wrangler] Could not serve static asset: ${thrown}`, { status: 502 } ); } } }; } async function generateAssetsFetch(directory, log2) { directory = (0, import_node_path64.resolve)(directory); const polyfill2 = (await Promise.resolve().then(() => (init_miniflare(), miniflare_exports2))).default; await polyfill2(); const { generateHandler: generateHandler3, parseQualityWeightedList: parseQualityWeightedList2 } = await Promise.resolve().then(() => (init_handler2(), handler_exports)); const headersFile = (0, import_node_path64.join)(directory, "_headers"); const redirectsFile = (0, import_node_path64.join)(directory, "_redirects"); const workerFile = (0, import_node_path64.join)(directory, "_worker.js"); const ignoredFiles = [headersFile, redirectsFile, workerFile]; let redirects; if ((0, import_node_fs35.existsSync)(redirectsFile)) { const contents = (0, import_node_fs35.readFileSync)(redirectsFile, "utf-8"); redirects = parseRedirects(contents); } let headers; if ((0, import_node_fs35.existsSync)(headersFile)) { const contents = (0, import_node_fs35.readFileSync)(headersFile, "utf-8"); headers = parseHeaders(contents); } let metadata = createMetadataObject({ redirects, headers, headersFile, redirectsFile, logger: log2 }); watch([headersFile, redirectsFile], { persistent: true }).on( "change", (path72) => { switch (path72) { case headersFile: { log2.log("_headers modified. Re-evaluating..."); const contents = (0, import_node_fs35.readFileSync)(headersFile).toString(); headers = parseHeaders(contents); break; } case redirectsFile: { log2.log("_redirects modified. Re-evaluating..."); const contents = (0, import_node_fs35.readFileSync)(redirectsFile).toString(); redirects = parseRedirects(contents); break; } } metadata = createMetadataObject({ redirects, headers, redirectsFile, headersFile, logger: log2 }); } ); const generateResponse = /* @__PURE__ */ __name(async (request4) => { const assetKeyEntryMap = /* @__PURE__ */ new Map(); return await generateHandler3({ request: request4, metadata, xServerEnvHeader: "dev", logError: console.error, findAssetEntryForPath: async (path72) => { const filepath = (0, import_node_path64.resolve)((0, import_node_path64.join)(directory, path72)); if (!filepath.startsWith(directory)) { return null; } if ((0, import_node_fs35.existsSync)(filepath) && (0, import_node_fs35.lstatSync)(filepath).isFile() && !ignoredFiles.includes(filepath)) { const hash = hashFile(filepath); assetKeyEntryMap.set(hash, filepath); return hash; } return null; }, getAssetKey: (assetEntry) => { return assetEntry; }, negotiateContent: (contentRequest) => { let rawAcceptEncoding; if (contentRequest.cf && "clientAcceptEncoding" in contentRequest.cf && contentRequest.cf.clientAcceptEncoding) { rawAcceptEncoding = contentRequest.cf.clientAcceptEncoding; } else { rawAcceptEncoding = contentRequest.headers.get("Accept-Encoding") || void 0; } const acceptEncoding = parseQualityWeightedList2(rawAcceptEncoding); if (acceptEncoding["identity"] === 0 || acceptEncoding["*"] === 0 && acceptEncoding["identity"] === void 0) { throw new Error("No acceptable encodings available"); } return { encoding: null }; }, fetchAsset: async (assetKey) => { const filepath = assetKeyEntryMap.get(assetKey); if (!filepath) { throw new Error( "Could not fetch asset. Please file an issue on GitHub (https://github.com/cloudflare/workers-sdk/issues/new/choose) with reproduction steps." ); } const body = (0, import_node_fs35.readFileSync)(filepath); let contentType = (0, import_mime3.getType)(filepath) || "application/octet-stream"; if (contentType.startsWith("text/") && !contentType.includes("charset")) { contentType = `${contentType}; charset=utf-8`; } return { body, contentType }; } }); }, "generateResponse"); return async (input, init2) => { const request4 = new import_miniflare25.Request(input, init2); return await generateResponse(request4); }; } var import_node_assert26, import_node_fs35, import_node_path64, import_mime3, import_miniflare25, import_undici23, ProxyDispatcher, invalidAssetsFetch; var init_assets = __esm({ "src/miniflare-cli/assets.ts"() { init_import_meta_url(); import_node_assert26 = __toESM(require("node:assert")); import_node_fs35 = require("node:fs"); import_node_path64 = require("node:path"); init_createMetadataObject(); init_parseHeaders(); init_parseRedirects(); init_esm2(); import_mime3 = __toESM(require_mime()); import_miniflare25 = require("miniflare"); import_undici23 = __toESM(require_undici()); init_hash(); __name(generateASSETSBinding, "generateASSETSBinding"); ProxyDispatcher = class extends import_undici23.Dispatcher { constructor(host) { super(); this.host = host; } dispatcher = (0, import_undici23.getGlobalDispatcher)(); dispatch(options32, handler31) { if (this.host !== null) { ProxyDispatcher.reinstateHostHeader(options32.headers, this.host); } return this.dispatcher.dispatch(options32, handler31); } close() { return this.dispatcher.close(); } destroy() { return this.dispatcher.destroy(); } /** * Ensure that the request contains a Host header, which would have been deleted * by the `fetch()` function before calling `dispatcher.dispatch()`. */ static reinstateHostHeader(headers, host) { (0, import_node_assert26.default)(headers, "Expected all proxy requests to contain headers."); (0, import_node_assert26.default)( !Array.isArray(headers), "Expected proxy request headers to be a hash object" ); (0, import_node_assert26.default)( Object.keys(headers).every((h6) => h6.toLowerCase() !== "host"), "Expected Host header to have been deleted." ); headers["Host"] = host; } }; __name(ProxyDispatcher, "ProxyDispatcher"); __name(generateAssetsFetch, "generateAssetsFetch"); invalidAssetsFetch = /* @__PURE__ */ __name(() => { throw new Error( "Trying to fetch assets directly when there is no `directory` option specified." ); }, "invalidAssetsFetch"); } }); // src/cli.ts var cli_exports2 = {}; __export(cli_exports2, { experimental_patchConfig: () => experimental_patchConfig, experimental_readRawConfig: () => experimental_readRawConfig, getBindingsProxy: () => getBindingsProxy, getPlatformProxy: () => getPlatformProxy, unstable_DevEnv: () => DevEnv, unstable_dev: () => unstable_dev, unstable_generateASSETSBinding: () => generateASSETSBinding2, unstable_getMiniflareWorkerOptions: () => unstable_getMiniflareWorkerOptions, unstable_pages: () => unstable_pages, unstable_readConfig: () => readConfig, unstable_splitSqlQuery: () => splitSqlQuery, unstable_startWorker: () => startWorker }); module.exports = __toCommonJS(cli_exports2); init_import_meta_url(); var import_process7 = __toESM(require("process")); // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/helpers/helpers.mjs init_import_meta_url(); // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js init_import_meta_url(); // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js init_import_meta_url(); var YError = class extends Error { constructor(msg) { super(msg || "yargs error"); this.name = "YError"; if (Error.captureStackTrace) { Error.captureStackTrace(this, YError); } } }; __name(YError, "YError"); // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js var previouslyVisitedConfigs = []; var shim; function applyExtends(config, cwd2, mergeExtends, _shim) { shim = _shim; let defaultConfig = {}; if (Object.prototype.hasOwnProperty.call(config, "extends")) { if (typeof config.extends !== "string") return defaultConfig; const isPath = /\.json|\..*rc$/.test(config.extends); let pathToDefault = null; if (!isPath) { try { pathToDefault = require.resolve(config.extends); } catch (_err) { return config; } } else { pathToDefault = getPathToDefaultConfig(cwd2, config.extends); } checkForCircularExtends(pathToDefault); previouslyVisitedConfigs.push(pathToDefault); defaultConfig = isPath ? JSON.parse(shim.readFileSync(pathToDefault, "utf8")) : require(config.extends); delete config.extends; defaultConfig = applyExtends(defaultConfig, shim.path.dirname(pathToDefault), mergeExtends, shim); } previouslyVisitedConfigs = []; return mergeExtends ? mergeDeep(defaultConfig, config) : Object.assign({}, defaultConfig, config); } __name(applyExtends, "applyExtends"); function checkForCircularExtends(cfgPath) { if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) { throw new YError(`Circular extended configurations: '${cfgPath}'.`); } } __name(checkForCircularExtends, "checkForCircularExtends"); function getPathToDefaultConfig(cwd2, pathToExtend) { return shim.path.resolve(cwd2, pathToExtend); } __name(getPathToDefaultConfig, "getPathToDefaultConfig"); function mergeDeep(config1, config2) { const target = {}; function isObject2(obj) { return obj && typeof obj === "object" && !Array.isArray(obj); } __name(isObject2, "isObject"); Object.assign(target, config1); for (const key of Object.keys(config2)) { if (isObject2(config2[key]) && isObject2(target[key])) { target[key] = mergeDeep(config1[key], config2[key]); } else { target[key] = config2[key]; } } return target; } __name(mergeDeep, "mergeDeep"); // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/process-argv.js init_import_meta_url(); function getProcessArgvBinIndex() { if (isBundledElectronApp()) return 0; return 1; } __name(getProcessArgvBinIndex, "getProcessArgvBinIndex"); function isBundledElectronApp() { return isElectronApp() && !process.defaultApp; } __name(isBundledElectronApp, "isBundledElectronApp"); function isElectronApp() { return !!process.versions.electron; } __name(isElectronApp, "isElectronApp"); function hideBin(argv) { return argv.slice(getProcessArgvBinIndex() + 1); } __name(hideBin, "hideBin"); function getProcessArgvBin() { return process.argv[getProcessArgvBinIndex()]; } __name(getProcessArgvBin, "getProcessArgvBin"); // ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/index.js init_import_meta_url(); var import_util = require("util"); var import_path = require("path"); // ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/string-utils.js init_import_meta_url(); function camelCase(str) { const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase(); if (!isCamelCase) { str = str.toLowerCase(); } if (str.indexOf("-") === -1 && str.indexOf("_") === -1) { return str; } else { let camelcase = ""; let nextChrUpper = false; const leadingHyphens = str.match(/^-+/); for (let i5 = leadingHyphens ? leadingHyphens[0].length : 0; i5 < str.length; i5++) { let chr = str.charAt(i5); if (nextChrUpper) { nextChrUpper = false; chr = chr.toUpperCase(); } if (i5 !== 0 && (chr === "-" || chr === "_")) { nextChrUpper = true; } else if (chr !== "-" && chr !== "_") { camelcase += chr; } } return camelcase; } } __name(camelCase, "camelCase"); function decamelize(str, joinString) { const lowercase = str.toLowerCase(); joinString = joinString || "-"; let notCamelcase = ""; for (let i5 = 0; i5 < str.length; i5++) { const chrLower = lowercase.charAt(i5); const chrString = str.charAt(i5); if (chrLower !== chrString && i5 > 0) { notCamelcase += `${joinString}${lowercase.charAt(i5)}`; } else { notCamelcase += chrString; } } return notCamelcase; } __name(decamelize, "decamelize"); function looksLikeNumber(x6) { if (x6 === null || x6 === void 0) return false; if (typeof x6 === "number") return true; if (/^0x[0-9a-f]+$/i.test(x6)) return true; if (/^0[^.]/.test(x6)) return false; return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x6); } __name(looksLikeNumber, "looksLikeNumber"); // ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/yargs-parser.js init_import_meta_url(); // ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/tokenize-arg-string.js init_import_meta_url(); function tokenizeArgString(argString) { if (Array.isArray(argString)) { return argString.map((e7) => typeof e7 !== "string" ? e7 + "" : e7); } argString = argString.trim(); let i5 = 0; let prevC = null; let c6 = null; let opening = null; const args = []; for (let ii = 0; ii < argString.length; ii++) { prevC = c6; c6 = argString.charAt(ii); if (c6 === " " && !opening) { if (!(prevC === " ")) { i5++; } continue; } if (c6 === opening) { opening = null; } else if ((c6 === "'" || c6 === '"') && !opening) { opening = c6; } if (!args[i5]) args[i5] = ""; args[i5] += c6; } return args; } __name(tokenizeArgString, "tokenizeArgString"); // ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/yargs-parser-types.js init_import_meta_url(); var DefaultValuesForTypeKey; (function(DefaultValuesForTypeKey2) { DefaultValuesForTypeKey2["BOOLEAN"] = "boolean"; DefaultValuesForTypeKey2["STRING"] = "string"; DefaultValuesForTypeKey2["NUMBER"] = "number"; DefaultValuesForTypeKey2["ARRAY"] = "array"; })(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); // ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/yargs-parser.js var mixin; var YargsParser = class { constructor(_mixin) { mixin = _mixin; } parse(argsInput, options32) { const opts = Object.assign({ alias: void 0, array: void 0, boolean: void 0, config: void 0, configObjects: void 0, configuration: void 0, coerce: void 0, count: void 0, default: void 0, envPrefix: void 0, narg: void 0, normalize: void 0, string: void 0, number: void 0, __: void 0, key: void 0 }, options32); const args = tokenizeArgString(argsInput); const inputIsString = typeof argsInput === "string"; const aliases2 = combineAliases(Object.assign(/* @__PURE__ */ Object.create(null), opts.alias)); const configuration = Object.assign({ "boolean-negation": true, "camel-case-expansion": true, "combine-arrays": false, "dot-notation": true, "duplicate-arguments-array": true, "flatten-duplicate-arrays": true, "greedy-arrays": true, "halt-at-non-option": false, "nargs-eats-options": false, "negation-prefix": "no-", "parse-numbers": true, "parse-positional-numbers": true, "populate--": false, "set-placeholder-key": false, "short-option-groups": true, "strip-aliased": false, "strip-dashed": false, "unknown-options-as-args": false }, opts.configuration); const defaults = Object.assign(/* @__PURE__ */ Object.create(null), opts.default); const configObjects = opts.configObjects || []; const envPrefix = opts.envPrefix; const notFlagsOption = configuration["populate--"]; const notFlagsArgv = notFlagsOption ? "--" : "_"; const newAliases = /* @__PURE__ */ Object.create(null); const defaulted = /* @__PURE__ */ Object.create(null); const __ = opts.__ || mixin.format; const flags2 = { aliases: /* @__PURE__ */ Object.create(null), arrays: /* @__PURE__ */ Object.create(null), bools: /* @__PURE__ */ Object.create(null), strings: /* @__PURE__ */ Object.create(null), numbers: /* @__PURE__ */ Object.create(null), counts: /* @__PURE__ */ Object.create(null), normalize: /* @__PURE__ */ Object.create(null), configs: /* @__PURE__ */ Object.create(null), nargs: /* @__PURE__ */ Object.create(null), coercions: /* @__PURE__ */ Object.create(null), keys: [] }; const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; const negatedBoolean = new RegExp("^--" + configuration["negation-prefix"] + "(.+)"); [].concat(opts.array || []).filter(Boolean).forEach(function(opt) { const key = typeof opt === "object" ? opt.key : opt; const assignment = Object.keys(opt).map(function(key2) { const arrayFlagKeys = { boolean: "bools", string: "strings", number: "numbers" }; return arrayFlagKeys[key2]; }).filter(Boolean).pop(); if (assignment) { flags2[assignment][key] = true; } flags2.arrays[key] = true; flags2.keys.push(key); }); [].concat(opts.boolean || []).filter(Boolean).forEach(function(key) { flags2.bools[key] = true; flags2.keys.push(key); }); [].concat(opts.string || []).filter(Boolean).forEach(function(key) { flags2.strings[key] = true; flags2.keys.push(key); }); [].concat(opts.number || []).filter(Boolean).forEach(function(key) { flags2.numbers[key] = true; flags2.keys.push(key); }); [].concat(opts.count || []).filter(Boolean).forEach(function(key) { flags2.counts[key] = true; flags2.keys.push(key); }); [].concat(opts.normalize || []).filter(Boolean).forEach(function(key) { flags2.normalize[key] = true; flags2.keys.push(key); }); if (typeof opts.narg === "object") { Object.entries(opts.narg).forEach(([key, value]) => { if (typeof value === "number") { flags2.nargs[key] = value; flags2.keys.push(key); } }); } if (typeof opts.coerce === "object") { Object.entries(opts.coerce).forEach(([key, value]) => { if (typeof value === "function") { flags2.coercions[key] = value; flags2.keys.push(key); } }); } if (typeof opts.config !== "undefined") { if (Array.isArray(opts.config) || typeof opts.config === "string") { ; [].concat(opts.config).filter(Boolean).forEach(function(key) { flags2.configs[key] = true; }); } else if (typeof opts.config === "object") { Object.entries(opts.config).forEach(([key, value]) => { if (typeof value === "boolean" || typeof value === "function") { flags2.configs[key] = value; } }); } } extendAliases(opts.key, aliases2, opts.default, flags2.arrays); Object.keys(defaults).forEach(function(key) { (flags2.aliases[key] || []).forEach(function(alias) { defaults[alias] = defaults[key]; }); }); let error2 = null; checkConfiguration(); let notFlags = []; const argv = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }); const argvReturn = {}; for (let i5 = 0; i5 < args.length; i5++) { const arg = args[i5]; const truncatedArg = arg.replace(/^-{3,}/, "---"); let broken; let key; let letters; let m6; let next; let value; if (arg !== "--" && /^-/.test(arg) && isUnknownOptionAsArg(arg)) { pushPositional(arg); } else if (truncatedArg.match(/^---+(=|$)/)) { pushPositional(arg); continue; } else if (arg.match(/^--.+=/) || !configuration["short-option-groups"] && arg.match(/^-.+=/)) { m6 = arg.match(/^--?([^=]+)=([\s\S]*)$/); if (m6 !== null && Array.isArray(m6) && m6.length >= 3) { if (checkAllAliases(m6[1], flags2.arrays)) { i5 = eatArray(i5, m6[1], args, m6[2]); } else if (checkAllAliases(m6[1], flags2.nargs) !== false) { i5 = eatNargs(i5, m6[1], args, m6[2]); } else { setArg(m6[1], m6[2], true); } } } else if (arg.match(negatedBoolean) && configuration["boolean-negation"]) { m6 = arg.match(negatedBoolean); if (m6 !== null && Array.isArray(m6) && m6.length >= 2) { key = m6[1]; setArg(key, checkAllAliases(key, flags2.arrays) ? [false] : false); } } else if (arg.match(/^--.+/) || !configuration["short-option-groups"] && arg.match(/^-[^-]+/)) { m6 = arg.match(/^--?(.+)/); if (m6 !== null && Array.isArray(m6) && m6.length >= 2) { key = m6[1]; if (checkAllAliases(key, flags2.arrays)) { i5 = eatArray(i5, key, args); } else if (checkAllAliases(key, flags2.nargs) !== false) { i5 = eatNargs(i5, key, args); } else { next = args[i5 + 1]; if (next !== void 0 && (!next.match(/^-/) || next.match(negative)) && !checkAllAliases(key, flags2.bools) && !checkAllAliases(key, flags2.counts)) { setArg(key, next); i5++; } else if (/^(true|false)$/.test(next)) { setArg(key, next); i5++; } else { setArg(key, defaultValue(key)); } } } } else if (arg.match(/^-.\..+=/)) { m6 = arg.match(/^-([^=]+)=([\s\S]*)$/); if (m6 !== null && Array.isArray(m6) && m6.length >= 3) { setArg(m6[1], m6[2]); } } else if (arg.match(/^-.\..+/) && !arg.match(negative)) { next = args[i5 + 1]; m6 = arg.match(/^-(.\..+)/); if (m6 !== null && Array.isArray(m6) && m6.length >= 2) { key = m6[1]; if (next !== void 0 && !next.match(/^-/) && !checkAllAliases(key, flags2.bools) && !checkAllAliases(key, flags2.counts)) { setArg(key, next); i5++; } else { setArg(key, defaultValue(key)); } } } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { letters = arg.slice(1, -1).split(""); broken = false; for (let j6 = 0; j6 < letters.length; j6++) { next = arg.slice(j6 + 2); if (letters[j6 + 1] && letters[j6 + 1] === "=") { value = arg.slice(j6 + 3); key = letters[j6]; if (checkAllAliases(key, flags2.arrays)) { i5 = eatArray(i5, key, args, value); } else if (checkAllAliases(key, flags2.nargs) !== false) { i5 = eatNargs(i5, key, args, value); } else { setArg(key, value); } broken = true; break; } if (next === "-") { setArg(letters[j6], next); continue; } if (/[A-Za-z]/.test(letters[j6]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && checkAllAliases(next, flags2.bools) === false) { setArg(letters[j6], next); broken = true; break; } if (letters[j6 + 1] && letters[j6 + 1].match(/\W/)) { setArg(letters[j6], next); broken = true; break; } else { setArg(letters[j6], defaultValue(letters[j6])); } } key = arg.slice(-1)[0]; if (!broken && key !== "-") { if (checkAllAliases(key, flags2.arrays)) { i5 = eatArray(i5, key, args); } else if (checkAllAliases(key, flags2.nargs) !== false) { i5 = eatNargs(i5, key, args); } else { next = args[i5 + 1]; if (next !== void 0 && (!/^(-|--)[^-]/.test(next) || next.match(negative)) && !checkAllAliases(key, flags2.bools) && !checkAllAliases(key, flags2.counts)) { setArg(key, next); i5++; } else if (/^(true|false)$/.test(next)) { setArg(key, next); i5++; } else { setArg(key, defaultValue(key)); } } } } else if (arg.match(/^-[0-9]$/) && arg.match(negative) && checkAllAliases(arg.slice(1), flags2.bools)) { key = arg.slice(1); setArg(key, defaultValue(key)); } else if (arg === "--") { notFlags = args.slice(i5 + 1); break; } else if (configuration["halt-at-non-option"]) { notFlags = args.slice(i5); break; } else { pushPositional(arg); } } applyEnvVars(argv, true); applyEnvVars(argv, false); setConfig(argv); setConfigObjects(); applyDefaultsAndAliases(argv, flags2.aliases, defaults, true); applyCoercions(argv); if (configuration["set-placeholder-key"]) setPlaceholderKeys(argv); Object.keys(flags2.counts).forEach(function(key) { if (!hasKey2(argv, key.split("."))) setArg(key, 0); }); if (notFlagsOption && notFlags.length) argv[notFlagsArgv] = []; notFlags.forEach(function(key) { argv[notFlagsArgv].push(key); }); if (configuration["camel-case-expansion"] && configuration["strip-dashed"]) { Object.keys(argv).filter((key) => key !== "--" && key.includes("-")).forEach((key) => { delete argv[key]; }); } if (configuration["strip-aliased"]) { ; [].concat(...Object.keys(aliases2).map((k6) => aliases2[k6])).forEach((alias) => { if (configuration["camel-case-expansion"] && alias.includes("-")) { delete argv[alias.split(".").map((prop) => camelCase(prop)).join(".")]; } delete argv[alias]; }); } function pushPositional(arg) { const maybeCoercedNumber = maybeCoerceNumber("_", arg); if (typeof maybeCoercedNumber === "string" || typeof maybeCoercedNumber === "number") { argv._.push(maybeCoercedNumber); } } __name(pushPositional, "pushPositional"); function eatNargs(i5, key, args2, argAfterEqualSign) { let ii; let toEat = checkAllAliases(key, flags2.nargs); toEat = typeof toEat !== "number" || isNaN(toEat) ? 1 : toEat; if (toEat === 0) { if (!isUndefined(argAfterEqualSign)) { error2 = Error(__("Argument unexpected for: %s", key)); } setArg(key, defaultValue(key)); return i5; } let available = isUndefined(argAfterEqualSign) ? 0 : 1; if (configuration["nargs-eats-options"]) { if (args2.length - (i5 + 1) + available < toEat) { error2 = Error(__("Not enough arguments following: %s", key)); } available = toEat; } else { for (ii = i5 + 1; ii < args2.length; ii++) { if (!args2[ii].match(/^-[^0-9]/) || args2[ii].match(negative) || isUnknownOptionAsArg(args2[ii])) available++; else break; } if (available < toEat) error2 = Error(__("Not enough arguments following: %s", key)); } let consumed = Math.min(available, toEat); if (!isUndefined(argAfterEqualSign) && consumed > 0) { setArg(key, argAfterEqualSign); consumed--; } for (ii = i5 + 1; ii < consumed + i5 + 1; ii++) { setArg(key, args2[ii]); } return i5 + consumed; } __name(eatNargs, "eatNargs"); function eatArray(i5, key, args2, argAfterEqualSign) { let argsToSet = []; let next = argAfterEqualSign || args2[i5 + 1]; const nargsCount = checkAllAliases(key, flags2.nargs); if (checkAllAliases(key, flags2.bools) && !/^(true|false)$/.test(next)) { argsToSet.push(true); } else if (isUndefined(next) || isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) { if (defaults[key] !== void 0) { const defVal = defaults[key]; argsToSet = Array.isArray(defVal) ? defVal : [defVal]; } } else { if (!isUndefined(argAfterEqualSign)) { argsToSet.push(processValue(key, argAfterEqualSign, true)); } for (let ii = i5 + 1; ii < args2.length; ii++) { if (!configuration["greedy-arrays"] && argsToSet.length > 0 || nargsCount && typeof nargsCount === "number" && argsToSet.length >= nargsCount) break; next = args2[ii]; if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) break; i5 = ii; argsToSet.push(processValue(key, next, inputIsString)); } } if (typeof nargsCount === "number" && (nargsCount && argsToSet.length < nargsCount || isNaN(nargsCount) && argsToSet.length === 0)) { error2 = Error(__("Not enough arguments following: %s", key)); } setArg(key, argsToSet); return i5; } __name(eatArray, "eatArray"); function setArg(key, val2, shouldStripQuotes = inputIsString) { if (/-/.test(key) && configuration["camel-case-expansion"]) { const alias = key.split(".").map(function(prop) { return camelCase(prop); }).join("."); addNewAlias(key, alias); } const value = processValue(key, val2, shouldStripQuotes); const splitKey = key.split("."); setKey(argv, splitKey, value); if (flags2.aliases[key]) { flags2.aliases[key].forEach(function(x6) { const keyProperties = x6.split("."); setKey(argv, keyProperties, value); }); } if (splitKey.length > 1 && configuration["dot-notation"]) { ; (flags2.aliases[splitKey[0]] || []).forEach(function(x6) { let keyProperties = x6.split("."); const a5 = [].concat(splitKey); a5.shift(); keyProperties = keyProperties.concat(a5); if (!(flags2.aliases[key] || []).includes(keyProperties.join("."))) { setKey(argv, keyProperties, value); } }); } if (checkAllAliases(key, flags2.normalize) && !checkAllAliases(key, flags2.arrays)) { const keys = [key].concat(flags2.aliases[key] || []); keys.forEach(function(key2) { Object.defineProperty(argvReturn, key2, { enumerable: true, get() { return val2; }, set(value2) { val2 = typeof value2 === "string" ? mixin.normalize(value2) : value2; } }); }); } } __name(setArg, "setArg"); function addNewAlias(key, alias) { if (!(flags2.aliases[key] && flags2.aliases[key].length)) { flags2.aliases[key] = [alias]; newAliases[alias] = true; } if (!(flags2.aliases[alias] && flags2.aliases[alias].length)) { addNewAlias(alias, key); } } __name(addNewAlias, "addNewAlias"); function processValue(key, val2, shouldStripQuotes) { if (shouldStripQuotes) { val2 = stripQuotes(val2); } if (checkAllAliases(key, flags2.bools) || checkAllAliases(key, flags2.counts)) { if (typeof val2 === "string") val2 = val2 === "true"; } let value = Array.isArray(val2) ? val2.map(function(v7) { return maybeCoerceNumber(key, v7); }) : maybeCoerceNumber(key, val2); if (checkAllAliases(key, flags2.counts) && (isUndefined(value) || typeof value === "boolean")) { value = increment(); } if (checkAllAliases(key, flags2.normalize) && checkAllAliases(key, flags2.arrays)) { if (Array.isArray(val2)) value = val2.map((val3) => { return mixin.normalize(val3); }); else value = mixin.normalize(val2); } return value; } __name(processValue, "processValue"); function maybeCoerceNumber(key, value) { if (!configuration["parse-positional-numbers"] && key === "_") return value; if (!checkAllAliases(key, flags2.strings) && !checkAllAliases(key, flags2.bools) && !Array.isArray(value)) { const shouldCoerceNumber = looksLikeNumber(value) && configuration["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${value}`))); if (shouldCoerceNumber || !isUndefined(value) && checkAllAliases(key, flags2.numbers)) { value = Number(value); } } return value; } __name(maybeCoerceNumber, "maybeCoerceNumber"); function setConfig(argv2) { const configLookup = /* @__PURE__ */ Object.create(null); applyDefaultsAndAliases(configLookup, flags2.aliases, defaults); Object.keys(flags2.configs).forEach(function(configKey) { const configPath = argv2[configKey] || configLookup[configKey]; if (configPath) { try { let config = null; const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath); const resolveConfig2 = flags2.configs[configKey]; if (typeof resolveConfig2 === "function") { try { config = resolveConfig2(resolvedConfigPath); } catch (e7) { config = e7; } if (config instanceof Error) { error2 = config; return; } } else { config = mixin.require(resolvedConfigPath); } setConfigObject(config); } catch (ex) { if (ex.name === "PermissionDenied") error2 = ex; else if (argv2[configKey]) error2 = Error(__("Invalid JSON config file: %s", configPath)); } } }); } __name(setConfig, "setConfig"); function setConfigObject(config, prev) { Object.keys(config).forEach(function(key) { const value = config[key]; const fullKey = prev ? prev + "." + key : key; if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) { setConfigObject(value, fullKey); } else { if (!hasKey2(argv, fullKey.split(".")) || checkAllAliases(fullKey, flags2.arrays) && configuration["combine-arrays"]) { setArg(fullKey, value); } } }); } __name(setConfigObject, "setConfigObject"); function setConfigObjects() { if (typeof configObjects !== "undefined") { configObjects.forEach(function(configObject) { setConfigObject(configObject); }); } } __name(setConfigObjects, "setConfigObjects"); function applyEnvVars(argv2, configOnly) { if (typeof envPrefix === "undefined") return; const prefix = typeof envPrefix === "string" ? envPrefix : ""; const env6 = mixin.env(); Object.keys(env6).forEach(function(envVar) { if (prefix === "" || envVar.lastIndexOf(prefix, 0) === 0) { const keys = envVar.split("__").map(function(key, i5) { if (i5 === 0) { key = key.substring(prefix.length); } return camelCase(key); }); if ((configOnly && flags2.configs[keys.join(".")] || !configOnly) && !hasKey2(argv2, keys)) { setArg(keys.join("."), env6[envVar]); } } }); } __name(applyEnvVars, "applyEnvVars"); function applyCoercions(argv2) { let coerce2; const applied = /* @__PURE__ */ new Set(); Object.keys(argv2).forEach(function(key) { if (!applied.has(key)) { coerce2 = checkAllAliases(key, flags2.coercions); if (typeof coerce2 === "function") { try { const value = maybeCoerceNumber(key, coerce2(argv2[key])); [].concat(flags2.aliases[key] || [], key).forEach((ali) => { applied.add(ali); argv2[ali] = value; }); } catch (err) { error2 = err; } } } }); } __name(applyCoercions, "applyCoercions"); function setPlaceholderKeys(argv2) { flags2.keys.forEach((key) => { if (~key.indexOf(".")) return; if (typeof argv2[key] === "undefined") argv2[key] = void 0; }); return argv2; } __name(setPlaceholderKeys, "setPlaceholderKeys"); function applyDefaultsAndAliases(obj, aliases3, defaults2, canLog = false) { Object.keys(defaults2).forEach(function(key) { if (!hasKey2(obj, key.split("."))) { setKey(obj, key.split("."), defaults2[key]); if (canLog) defaulted[key] = true; (aliases3[key] || []).forEach(function(x6) { if (hasKey2(obj, x6.split("."))) return; setKey(obj, x6.split("."), defaults2[key]); }); } }); } __name(applyDefaultsAndAliases, "applyDefaultsAndAliases"); function hasKey2(obj, keys) { let o5 = obj; if (!configuration["dot-notation"]) keys = [keys.join(".")]; keys.slice(0, -1).forEach(function(key2) { o5 = o5[key2] || {}; }); const key = keys[keys.length - 1]; if (typeof o5 !== "object") return false; else return key in o5; } __name(hasKey2, "hasKey"); function setKey(obj, keys, value) { let o5 = obj; if (!configuration["dot-notation"]) keys = [keys.join(".")]; keys.slice(0, -1).forEach(function(key2) { key2 = sanitizeKey(key2); if (typeof o5 === "object" && o5[key2] === void 0) { o5[key2] = {}; } if (typeof o5[key2] !== "object" || Array.isArray(o5[key2])) { if (Array.isArray(o5[key2])) { o5[key2].push({}); } else { o5[key2] = [o5[key2], {}]; } o5 = o5[key2][o5[key2].length - 1]; } else { o5 = o5[key2]; } }); const key = sanitizeKey(keys[keys.length - 1]); const isTypeArray = checkAllAliases(keys.join("."), flags2.arrays); const isValueArray = Array.isArray(value); let duplicate = configuration["duplicate-arguments-array"]; if (!duplicate && checkAllAliases(key, flags2.nargs)) { duplicate = true; if (!isUndefined(o5[key]) && flags2.nargs[key] === 1 || Array.isArray(o5[key]) && o5[key].length === flags2.nargs[key]) { o5[key] = void 0; } } if (value === increment()) { o5[key] = increment(o5[key]); } else if (Array.isArray(o5[key])) { if (duplicate && isTypeArray && isValueArray) { o5[key] = configuration["flatten-duplicate-arrays"] ? o5[key].concat(value) : (Array.isArray(o5[key][0]) ? o5[key] : [o5[key]]).concat([value]); } else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { o5[key] = value; } else { o5[key] = o5[key].concat([value]); } } else if (o5[key] === void 0 && isTypeArray) { o5[key] = isValueArray ? value : [value]; } else if (duplicate && !(o5[key] === void 0 || checkAllAliases(key, flags2.counts) || checkAllAliases(key, flags2.bools))) { o5[key] = [o5[key], value]; } else { o5[key] = value; } } __name(setKey, "setKey"); function extendAliases(...args2) { args2.forEach(function(obj) { Object.keys(obj || {}).forEach(function(key) { if (flags2.aliases[key]) return; flags2.aliases[key] = [].concat(aliases2[key] || []); flags2.aliases[key].concat(key).forEach(function(x6) { if (/-/.test(x6) && configuration["camel-case-expansion"]) { const c6 = camelCase(x6); if (c6 !== key && flags2.aliases[key].indexOf(c6) === -1) { flags2.aliases[key].push(c6); newAliases[c6] = true; } } }); flags2.aliases[key].concat(key).forEach(function(x6) { if (x6.length > 1 && /[A-Z]/.test(x6) && configuration["camel-case-expansion"]) { const c6 = decamelize(x6, "-"); if (c6 !== key && flags2.aliases[key].indexOf(c6) === -1) { flags2.aliases[key].push(c6); newAliases[c6] = true; } } }); flags2.aliases[key].forEach(function(x6) { flags2.aliases[x6] = [key].concat(flags2.aliases[key].filter(function(y4) { return x6 !== y4; })); }); }); }); } __name(extendAliases, "extendAliases"); function checkAllAliases(key, flag) { const toCheck = [].concat(flags2.aliases[key] || [], key); const keys = Object.keys(flag); const setAlias = toCheck.find((key2) => keys.includes(key2)); return setAlias ? flag[setAlias] : false; } __name(checkAllAliases, "checkAllAliases"); function hasAnyFlag(key) { const flagsKeys = Object.keys(flags2); const toCheck = [].concat(flagsKeys.map((k6) => flags2[k6])); return toCheck.some(function(flag) { return Array.isArray(flag) ? flag.includes(key) : flag[key]; }); } __name(hasAnyFlag, "hasAnyFlag"); function hasFlagsMatching(arg, ...patterns) { const toCheck = [].concat(...patterns); return toCheck.some(function(pattern) { const match2 = arg.match(pattern); return match2 && hasAnyFlag(match2[1]); }); } __name(hasFlagsMatching, "hasFlagsMatching"); function hasAllShortFlags(arg) { if (arg.match(negative) || !arg.match(/^-[^-]+/)) { return false; } let hasAllFlags = true; let next; const letters = arg.slice(1).split(""); for (let j6 = 0; j6 < letters.length; j6++) { next = arg.slice(j6 + 2); if (!hasAnyFlag(letters[j6])) { hasAllFlags = false; break; } if (letters[j6 + 1] && letters[j6 + 1] === "=" || next === "-" || /[A-Za-z]/.test(letters[j6]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) || letters[j6 + 1] && letters[j6 + 1].match(/\W/)) { break; } } return hasAllFlags; } __name(hasAllShortFlags, "hasAllShortFlags"); function isUnknownOptionAsArg(arg) { return configuration["unknown-options-as-args"] && isUnknownOption(arg); } __name(isUnknownOptionAsArg, "isUnknownOptionAsArg"); function isUnknownOption(arg) { arg = arg.replace(/^-{3,}/, "--"); if (arg.match(negative)) { return false; } if (hasAllShortFlags(arg)) { return false; } const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; const normalFlag = /^-+([^=]+?)$/; const flagEndingInHyphen = /^-+([^=]+?)-$/; const flagEndingInDigits = /^-+([^=]+?\d+)$/; const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters); } __name(isUnknownOption, "isUnknownOption"); function defaultValue(key) { if (!checkAllAliases(key, flags2.bools) && !checkAllAliases(key, flags2.counts) && `${key}` in defaults) { return defaults[key]; } else { return defaultForType(guessType2(key)); } } __name(defaultValue, "defaultValue"); function defaultForType(type) { const def = { [DefaultValuesForTypeKey.BOOLEAN]: true, [DefaultValuesForTypeKey.STRING]: "", [DefaultValuesForTypeKey.NUMBER]: void 0, [DefaultValuesForTypeKey.ARRAY]: [] }; return def[type]; } __name(defaultForType, "defaultForType"); function guessType2(key) { let type = DefaultValuesForTypeKey.BOOLEAN; if (checkAllAliases(key, flags2.strings)) type = DefaultValuesForTypeKey.STRING; else if (checkAllAliases(key, flags2.numbers)) type = DefaultValuesForTypeKey.NUMBER; else if (checkAllAliases(key, flags2.bools)) type = DefaultValuesForTypeKey.BOOLEAN; else if (checkAllAliases(key, flags2.arrays)) type = DefaultValuesForTypeKey.ARRAY; return type; } __name(guessType2, "guessType"); function isUndefined(num) { return num === void 0; } __name(isUndefined, "isUndefined"); function checkConfiguration() { Object.keys(flags2.counts).find((key) => { if (checkAllAliases(key, flags2.arrays)) { error2 = Error(__("Invalid configuration: %s, opts.count excludes opts.array.", key)); return true; } else if (checkAllAliases(key, flags2.nargs)) { error2 = Error(__("Invalid configuration: %s, opts.count excludes opts.narg.", key)); return true; } return false; }); } __name(checkConfiguration, "checkConfiguration"); return { aliases: Object.assign({}, flags2.aliases), argv: Object.assign(argvReturn, argv), configuration, defaulted: Object.assign({}, defaulted), error: error2, newAliases: Object.assign({}, newAliases) }; } }; __name(YargsParser, "YargsParser"); function combineAliases(aliases2) { const aliasArrays = []; const combined = /* @__PURE__ */ Object.create(null); let change = true; Object.keys(aliases2).forEach(function(key) { aliasArrays.push([].concat(aliases2[key], key)); }); while (change) { change = false; for (let i5 = 0; i5 < aliasArrays.length; i5++) { for (let ii = i5 + 1; ii < aliasArrays.length; ii++) { const intersect = aliasArrays[i5].filter(function(v7) { return aliasArrays[ii].indexOf(v7) !== -1; }); if (intersect.length) { aliasArrays[i5] = aliasArrays[i5].concat(aliasArrays[ii]); aliasArrays.splice(ii, 1); change = true; break; } } } } aliasArrays.forEach(function(aliasArray) { aliasArray = aliasArray.filter(function(v7, i5, self2) { return self2.indexOf(v7) === i5; }); const lastAlias = aliasArray.pop(); if (lastAlias !== void 0 && typeof lastAlias === "string") { combined[lastAlias] = aliasArray; } }); return combined; } __name(combineAliases, "combineAliases"); function increment(orig) { return orig !== void 0 ? orig + 1 : 1; } __name(increment, "increment"); function sanitizeKey(key) { if (key === "__proto__") return "___proto___"; return key; } __name(sanitizeKey, "sanitizeKey"); function stripQuotes(val2) { return typeof val2 === "string" && (val2[0] === "'" || val2[0] === '"') && val2[val2.length - 1] === val2[0] ? val2.substring(1, val2.length - 1) : val2; } __name(stripQuotes, "stripQuotes"); // ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/index.js var import_fs = require("fs"); var _a; var _b; var _c; var minNodeVersion = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12; var nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1); if (nodeVersion) { const major = Number(nodeVersion.match(/^([^.]+)/)[1]); if (major < minNodeVersion) { throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); } } var env = process ? process.env : {}; var parser = new YargsParser({ cwd: process.cwd, env: () => { return env; }, format: import_util.format, normalize: import_path.normalize, resolve: import_path.resolve, // TODO: figure out a way to combine ESM and CJS coverage, such that // we can exercise all the lines below: require: (path72) => { if (typeof require !== "undefined") { return require(path72); } else if (path72.match(/\.json$/)) { return JSON.parse((0, import_fs.readFileSync)(path72, "utf8")); } else { throw Error("only .json config files are supported in ESM"); } } }); var yargsParser = /* @__PURE__ */ __name(function Parser(args, opts) { const result = parser.parse(args.slice(), opts); return result.argv; }, "Parser"); yargsParser.detailed = function(args, opts) { return parser.parse(args.slice(), opts); }; yargsParser.camelCase = camelCase; yargsParser.decamelize = decamelize; yargsParser.looksLikeNumber = looksLikeNumber; var lib_default = yargsParser; // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs init_import_meta_url(); var import_assert = require("assert"); // ../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/index.mjs init_import_meta_url(); // ../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/lib/index.js init_import_meta_url(); var align = { right: alignRight, center: alignCenter }; var top = 0; var right = 1; var bottom = 2; var left = 3; var UI = class { constructor(opts) { var _a3; this.width = opts.width; this.wrap = (_a3 = opts.wrap) !== null && _a3 !== void 0 ? _a3 : true; this.rows = []; } span(...args) { const cols = this.div(...args); cols.span = true; } resetOutput() { this.rows = []; } div(...args) { if (args.length === 0) { this.div(""); } if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === "string") { return this.applyLayoutDSL(args[0]); } const cols = args.map((arg) => { if (typeof arg === "string") { return this.colFromString(arg); } return arg; }); this.rows.push(cols); return cols; } shouldApplyLayoutDSL(...args) { return args.length === 1 && typeof args[0] === "string" && /[\t\n]/.test(args[0]); } applyLayoutDSL(str) { const rows = str.split("\n").map((row) => row.split(" ")); let leftColumnWidth = 0; rows.forEach((columns) => { if (columns.length > 1 && mixin2.stringWidth(columns[0]) > leftColumnWidth) { leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin2.stringWidth(columns[0])); } }); rows.forEach((columns) => { this.div(...columns.map((r7, i5) => { return { text: r7.trim(), padding: this.measurePadding(r7), width: i5 === 0 && columns.length > 1 ? leftColumnWidth : void 0 }; })); }); return this.rows[this.rows.length - 1]; } colFromString(text) { return { text, padding: this.measurePadding(text) }; } measurePadding(str) { const noAnsi = mixin2.stripAnsi(str); return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length]; } toString() { const lines = []; this.rows.forEach((row) => { this.rowToString(row, lines); }); return lines.filter((line) => !line.hidden).map((line) => line.text).join("\n"); } rowToString(row, lines) { this.rasterize(row).forEach((rrow, r7) => { let str = ""; rrow.forEach((col, c6) => { const { width } = row[c6]; const wrapWidth = this.negatePadding(row[c6]); let ts = col; if (wrapWidth > mixin2.stringWidth(col)) { ts += " ".repeat(wrapWidth - mixin2.stringWidth(col)); } if (row[c6].align && row[c6].align !== "left" && this.wrap) { const fn2 = align[row[c6].align]; ts = fn2(ts, wrapWidth); if (mixin2.stringWidth(ts) < wrapWidth) { ts += " ".repeat((width || 0) - mixin2.stringWidth(ts) - 1); } } const padding = row[c6].padding || [0, 0, 0, 0]; if (padding[left]) { str += " ".repeat(padding[left]); } str += addBorder(row[c6], ts, "| "); str += ts; str += addBorder(row[c6], ts, " |"); if (padding[right]) { str += " ".repeat(padding[right]); } if (r7 === 0 && lines.length > 0) { str = this.renderInline(str, lines[lines.length - 1]); } }); lines.push({ text: str.replace(/ +$/, ""), span: row.span }); }); return lines; } // if the full 'source' can render in // the target line, do so. renderInline(source, previousLine) { const match2 = source.match(/^ */); const leadingWhitespace = match2 ? match2[0].length : 0; const target = previousLine.text; const targetTextWidth = mixin2.stringWidth(target.trimRight()); if (!previousLine.span) { return source; } if (!this.wrap) { previousLine.hidden = true; return target + source; } if (leadingWhitespace < targetTextWidth) { return source; } previousLine.hidden = true; return target.trimRight() + " ".repeat(leadingWhitespace - targetTextWidth) + source.trimLeft(); } rasterize(row) { const rrows = []; const widths = this.columnWidths(row); let wrapped; row.forEach((col, c6) => { col.width = widths[c6]; if (this.wrap) { wrapped = mixin2.wrap(col.text, this.negatePadding(col), { hard: true }).split("\n"); } else { wrapped = col.text.split("\n"); } if (col.border) { wrapped.unshift("." + "-".repeat(this.negatePadding(col) + 2) + "."); wrapped.push("'" + "-".repeat(this.negatePadding(col) + 2) + "'"); } if (col.padding) { wrapped.unshift(...new Array(col.padding[top] || 0).fill("")); wrapped.push(...new Array(col.padding[bottom] || 0).fill("")); } wrapped.forEach((str, r7) => { if (!rrows[r7]) { rrows.push([]); } const rrow = rrows[r7]; for (let i5 = 0; i5 < c6; i5++) { if (rrow[i5] === void 0) { rrow.push(""); } } rrow.push(str); }); }); return rrows; } negatePadding(col) { let wrapWidth = col.width || 0; if (col.padding) { wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0); } if (col.border) { wrapWidth -= 4; } return wrapWidth; } columnWidths(row) { if (!this.wrap) { return row.map((col) => { return col.width || mixin2.stringWidth(col.text); }); } let unset = row.length; let remainingWidth = this.width; const widths = row.map((col) => { if (col.width) { unset--; remainingWidth -= col.width; return col.width; } return void 0; }); const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0; return widths.map((w6, i5) => { if (w6 === void 0) { return Math.max(unsetWidth, _minWidth(row[i5])); } return w6; }); } }; __name(UI, "UI"); function addBorder(col, ts, style) { if (col.border) { if (/[.']-+[.']/.test(ts)) { return ""; } if (ts.trim().length !== 0) { return style; } return " "; } return ""; } __name(addBorder, "addBorder"); function _minWidth(col) { const padding = col.padding || []; const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0); if (col.border) { return minWidth + 4; } return minWidth; } __name(_minWidth, "_minWidth"); function getWindowWidth() { if (typeof process === "object" && process.stdout && process.stdout.columns) { return process.stdout.columns; } return 80; } __name(getWindowWidth, "getWindowWidth"); function alignRight(str, width) { str = str.trim(); const strWidth = mixin2.stringWidth(str); if (strWidth < width) { return " ".repeat(width - strWidth) + str; } return str; } __name(alignRight, "alignRight"); function alignCenter(str, width) { str = str.trim(); const strWidth = mixin2.stringWidth(str); if (strWidth >= width) { return str; } return " ".repeat(width - strWidth >> 1) + str; } __name(alignCenter, "alignCenter"); var mixin2; function cliui(opts, _mixin) { mixin2 = _mixin; return new UI({ width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(), wrap: opts === null || opts === void 0 ? void 0 : opts.wrap }); } __name(cliui, "cliui"); // ../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/lib/string-utils.js init_import_meta_url(); var ansi = new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g"); function stripAnsi(str) { return str.replace(ansi, ""); } __name(stripAnsi, "stripAnsi"); function wrap(str, width) { const [start, end] = str.match(ansi) || ["", ""]; str = stripAnsi(str); let wrapped = ""; for (let i5 = 0; i5 < str.length; i5++) { if (i5 !== 0 && i5 % width === 0) { wrapped += "\n"; } wrapped += str.charAt(i5); } if (start && end) { wrapped = `${start}${wrapped}${end}`; } return wrapped; } __name(wrap, "wrap"); // ../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/index.mjs function ui(opts) { return cliui(opts, { stringWidth: (str) => { return [...str].length; }, stripAnsi, wrap }); } __name(ui, "ui"); // ../../node_modules/.pnpm/escalade@3.2.0/node_modules/escalade/sync/index.mjs init_import_meta_url(); var import_path2 = require("path"); var import_fs2 = require("fs"); function sync_default(start, callback) { let dir = (0, import_path2.resolve)(".", start); let tmp, stats = (0, import_fs2.statSync)(dir); if (!stats.isDirectory()) { dir = (0, import_path2.dirname)(dir); } while (true) { tmp = callback(dir, (0, import_fs2.readdirSync)(dir)); if (tmp) return (0, import_path2.resolve)(dir, tmp); dir = (0, import_path2.dirname)(tmp = dir); if (tmp === dir) break; } } __name(sync_default, "default"); // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs var import_util3 = require("util"); var import_fs4 = require("fs"); var import_url = require("url"); var import_path4 = require("path"); // ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/index.mjs init_import_meta_url(); // ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/lib/platform-shims/node.js init_import_meta_url(); var import_fs3 = require("fs"); var import_util2 = require("util"); var import_path3 = require("path"); var node_default = { fs: { readFileSync: import_fs3.readFileSync, writeFile: import_fs3.writeFile }, format: import_util2.format, resolve: import_path3.resolve, exists: (file) => { try { return (0, import_fs3.statSync)(file).isFile(); } catch (err) { return false; } } }; // ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/build/lib/index.js init_import_meta_url(); var shim2; var Y18N = class { constructor(opts) { opts = opts || {}; this.directory = opts.directory || "./locales"; this.updateFiles = typeof opts.updateFiles === "boolean" ? opts.updateFiles : true; this.locale = opts.locale || "en"; this.fallbackToLanguage = typeof opts.fallbackToLanguage === "boolean" ? opts.fallbackToLanguage : true; this.cache = /* @__PURE__ */ Object.create(null); this.writeQueue = []; } __(...args) { if (typeof arguments[0] !== "string") { return this._taggedLiteral(arguments[0], ...arguments); } const str = args.shift(); let cb2 = /* @__PURE__ */ __name(function() { }, "cb"); if (typeof args[args.length - 1] === "function") cb2 = args.pop(); cb2 = cb2 || function() { }; if (!this.cache[this.locale]) this._readLocaleFile(); if (!this.cache[this.locale][str] && this.updateFiles) { this.cache[this.locale][str] = str; this._enqueueWrite({ directory: this.directory, locale: this.locale, cb: cb2 }); } else { cb2(); } return shim2.format.apply(shim2.format, [this.cache[this.locale][str] || str].concat(args)); } __n() { const args = Array.prototype.slice.call(arguments); const singular = args.shift(); const plural2 = args.shift(); const quantity = args.shift(); let cb2 = /* @__PURE__ */ __name(function() { }, "cb"); if (typeof args[args.length - 1] === "function") cb2 = args.pop(); if (!this.cache[this.locale]) this._readLocaleFile(); let str = quantity === 1 ? singular : plural2; if (this.cache[this.locale][singular]) { const entry = this.cache[this.locale][singular]; str = entry[quantity === 1 ? "one" : "other"]; } if (!this.cache[this.locale][singular] && this.updateFiles) { this.cache[this.locale][singular] = { one: singular, other: plural2 }; this._enqueueWrite({ directory: this.directory, locale: this.locale, cb: cb2 }); } else { cb2(); } const values = [str]; if (~str.indexOf("%d")) values.push(quantity); return shim2.format.apply(shim2.format, values.concat(args)); } setLocale(locale) { this.locale = locale; } getLocale() { return this.locale; } updateLocale(obj) { if (!this.cache[this.locale]) this._readLocaleFile(); for (const key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { this.cache[this.locale][key] = obj[key]; } } } _taggedLiteral(parts, ...args) { let str = ""; parts.forEach(function(part, i5) { const arg = args[i5 + 1]; str += part; if (typeof arg !== "undefined") { str += "%s"; } }); return this.__.apply(this, [str].concat([].slice.call(args, 1))); } _enqueueWrite(work) { this.writeQueue.push(work); if (this.writeQueue.length === 1) this._processWriteQueue(); } _processWriteQueue() { const _this = this; const work = this.writeQueue[0]; const directory = work.directory; const locale = work.locale; const cb2 = work.cb; const languageFile = this._resolveLocaleFile(directory, locale); const serializedLocale = JSON.stringify(this.cache[locale], null, 2); shim2.fs.writeFile(languageFile, serializedLocale, "utf-8", function(err) { _this.writeQueue.shift(); if (_this.writeQueue.length > 0) _this._processWriteQueue(); cb2(err); }); } _readLocaleFile() { let localeLookup = {}; const languageFile = this._resolveLocaleFile(this.directory, this.locale); try { if (shim2.fs.readFileSync) { localeLookup = JSON.parse(shim2.fs.readFileSync(languageFile, "utf-8")); } } catch (err) { if (err instanceof SyntaxError) { err.message = "syntax error in " + languageFile; } if (err.code === "ENOENT") localeLookup = {}; else throw err; } this.cache[this.locale] = localeLookup; } _resolveLocaleFile(directory, locale) { let file = shim2.resolve(directory, "./", locale + ".json"); if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf("_")) { const languageFile = shim2.resolve(directory, "./", locale.split("_")[0] + ".json"); if (this._fileExistsSync(languageFile)) file = languageFile; } return file; } _fileExistsSync(file) { return shim2.exists(file); } }; __name(Y18N, "Y18N"); function y18n(opts, _shim) { shim2 = _shim; const y18n3 = new Y18N(opts); return { __: y18n3.__.bind(y18n3), __n: y18n3.__n.bind(y18n3), setLocale: y18n3.setLocale.bind(y18n3), getLocale: y18n3.getLocale.bind(y18n3), updateLocale: y18n3.updateLocale.bind(y18n3), locale: y18n3.locale }; } __name(y18n, "y18n"); // ../../node_modules/.pnpm/y18n@5.0.8/node_modules/y18n/index.mjs var y18n2 = /* @__PURE__ */ __name((opts) => { return y18n(opts, node_default); }, "y18n"); var y18n_default = y18n2; // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs var REQUIRE_ERROR = "require is not supported by ESM"; var REQUIRE_DIRECTORY_ERROR = "loading a directory of commands is not supported yet for ESM"; var __dirname2; try { __dirname2 = (0, import_url.fileURLToPath)(import_meta_url); } catch (e7) { __dirname2 = process.cwd(); } var mainFilename = __dirname2.substring(0, __dirname2.lastIndexOf("node_modules")); var esm_default = { assert: { notStrictEqual: import_assert.notStrictEqual, strictEqual: import_assert.strictEqual }, cliui: ui, findUp: sync_default, getEnv: (key) => { return process.env[key]; }, inspect: import_util3.inspect, getCallerFile: () => { throw new YError(REQUIRE_DIRECTORY_ERROR); }, getProcessArgvBin, mainFilename: mainFilename || process.cwd(), Parser: lib_default, path: { basename: import_path4.basename, dirname: import_path4.dirname, extname: import_path4.extname, relative: import_path4.relative, resolve: import_path4.resolve }, process: { argv: () => process.argv, cwd: process.cwd, emitWarning: (warning, type) => process.emitWarning(warning, type), execPath: () => process.execPath, exit: process.exit, nextTick: process.nextTick, stdColumns: typeof process.stdout.columns !== "undefined" ? process.stdout.columns : null }, readFileSync: import_fs4.readFileSync, require: () => { throw new YError(REQUIRE_ERROR); }, requireDirectory: () => { throw new YError(REQUIRE_DIRECTORY_ERROR); }, stringWidth: (str) => { return [...str].length; }, y18n: y18n_default({ directory: (0, import_path4.resolve)(__dirname2, "../../../locales"), updateFiles: false }) }; // src/api/index.ts init_import_meta_url(); // src/api/dev.ts init_import_meta_url(); var import_node_events6 = __toESM(require("node:events")); var import_undici24 = __toESM(require_undici()); // src/dev.ts init_import_meta_url(); var import_node_assert27 = __toESM(require("node:assert")); var import_node_events5 = __toESM(require("node:events")); var import_node_path65 = __toESM(require("node:path")); var import_node_util3 = __toESM(require("node:util")); var import_env2 = __toESM(require_dist()); // src/api/startDevWorker/MultiworkerRuntimeController.ts init_import_meta_url(); var import_node_assert7 = __toESM(require("node:assert")); var import_node_crypto6 = require("node:crypto"); // ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js init_import_meta_url(); // ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js init_import_meta_url(); var ANSI_BACKGROUND_OFFSET = 10; var wrapAnsi16 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${code + offset}m`, "wrapAnsi16"); var wrapAnsi256 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, "wrapAnsi256"); var wrapAnsi16m = /* @__PURE__ */ __name((offset = 0) => (red2, green2, blue2) => `\x1B[${38 + offset};2;${red2};${green2};${blue2}m`, "wrapAnsi16m"); var styles = { modifier: { reset: [0, 0], // 21 isn't widely supported and 22 does the same thing bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], // Bright color blackBright: [90, 39], gray: [90, 39], // Alias of `blackBright` grey: [90, 39], // Alias of `blackBright` redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], // Bright color bgBlackBright: [100, 49], bgGray: [100, 49], // Alias of `bgBlackBright` bgGrey: [100, 49], // Alias of `bgBlackBright` bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; var modifierNames = Object.keys(styles.modifier); var foregroundColorNames = Object.keys(styles.color); var backgroundColorNames = Object.keys(styles.bgColor); var colorNames = [...foregroundColorNames, ...backgroundColorNames]; function assembleStyles() { const codes = /* @__PURE__ */ new Map(); for (const [groupName, group] of Object.entries(styles)) { for (const [styleName, style] of Object.entries(group)) { styles[styleName] = { open: `\x1B[${style[0]}m`, close: `\x1B[${style[1]}m` }; group[styleName] = styles[styleName]; codes.set(style[0], style[1]); } Object.defineProperty(styles, groupName, { value: group, enumerable: false }); } Object.defineProperty(styles, "codes", { value: codes, enumerable: false }); styles.color.close = "\x1B[39m"; styles.bgColor.close = "\x1B[49m"; styles.color.ansi = wrapAnsi16(); styles.color.ansi256 = wrapAnsi256(); styles.color.ansi16m = wrapAnsi16m(); styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); Object.defineProperties(styles, { rgbToAnsi256: { value(red2, green2, blue2) { if (red2 === green2 && green2 === blue2) { if (red2 < 8) { return 16; } if (red2 > 248) { return 231; } return Math.round((red2 - 8) / 247 * 24) + 232; } return 16 + 36 * Math.round(red2 / 255 * 5) + 6 * Math.round(green2 / 255 * 5) + Math.round(blue2 / 255 * 5); }, enumerable: false }, hexToRgb: { value(hex) { const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); if (!matches) { return [0, 0, 0]; } let [colorString] = matches; if (colorString.length === 3) { colorString = [...colorString].map((character) => character + character).join(""); } const integer = Number.parseInt(colorString, 16); return [ /* eslint-disable no-bitwise */ integer >> 16 & 255, integer >> 8 & 255, integer & 255 /* eslint-enable no-bitwise */ ]; }, enumerable: false }, hexToAnsi256: { value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), enumerable: false }, ansi256ToAnsi: { value(code) { if (code < 8) { return 30 + code; } if (code < 16) { return 90 + (code - 8); } let red2; let green2; let blue2; if (code >= 232) { red2 = ((code - 232) * 10 + 8) / 255; green2 = red2; blue2 = red2; } else { code -= 16; const remainder = code % 36; red2 = Math.floor(code / 36) / 5; green2 = Math.floor(remainder / 6) / 5; blue2 = remainder % 6 / 5; } const value = Math.max(red2, green2, blue2) * 2; if (value === 0) { return 30; } let result = 30 + (Math.round(blue2) << 2 | Math.round(green2) << 1 | Math.round(red2)); if (value === 2) { result += 60; } return result; }, enumerable: false }, rgbToAnsi: { value: (red2, green2, blue2) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red2, green2, blue2)), enumerable: false }, hexToAnsi: { value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), enumerable: false } }); return styles; } __name(assembleStyles, "assembleStyles"); var ansiStyles = assembleStyles(); var ansi_styles_default = ansiStyles; // ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js init_import_meta_url(); var import_node_process = __toESM(require("node:process"), 1); var import_node_os = __toESM(require("node:os"), 1); var import_node_tty = __toESM(require("node:tty"), 1); function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) { const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; const position = argv.indexOf(prefix + flag); const terminatorPosition = argv.indexOf("--"); return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); } __name(hasFlag, "hasFlag"); var { env: env2 } = import_node_process.default; var flagForceColor; if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { flagForceColor = 0; } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { flagForceColor = 1; } function envForceColor() { if ("FORCE_COLOR" in env2) { if (env2.FORCE_COLOR === "true") { return 1; } if (env2.FORCE_COLOR === "false") { return 0; } return env2.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env2.FORCE_COLOR, 10), 3); } } __name(envForceColor, "envForceColor"); function translateLevel(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; } __name(translateLevel, "translateLevel"); function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { const noFlagForceColor = envForceColor(); if (noFlagForceColor !== void 0) { flagForceColor = noFlagForceColor; } const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; if (forceColor === 0) { return 0; } if (sniffFlags) { if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { return 3; } if (hasFlag("color=256")) { return 2; } } if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) { return 1; } if (haveStream && !streamIsTTY && forceColor === void 0) { return 0; } const min = forceColor || 0; if (env2.TERM === "dumb") { return min; } if (import_node_process.default.platform === "win32") { const osRelease = import_node_os.default.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } if ("CI" in env2) { if ("GITHUB_ACTIONS" in env2 || "GITEA_ACTIONS" in env2) { return 3; } if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") { return 1; } return min; } if ("TEAMCITY_VERSION" in env2) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0; } if (env2.COLORTERM === "truecolor") { return 3; } if (env2.TERM === "xterm-kitty") { return 3; } if ("TERM_PROGRAM" in env2) { const version4 = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env2.TERM_PROGRAM) { case "iTerm.app": { return version4 >= 3 ? 3 : 2; } case "Apple_Terminal": { return 2; } } } if (/-256(color)?$/i.test(env2.TERM)) { return 2; } if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) { return 1; } if ("COLORTERM" in env2) { return 1; } return min; } __name(_supportsColor, "_supportsColor"); function createSupportsColor(stream2, options32 = {}) { const level = _supportsColor(stream2, { streamIsTTY: stream2 && stream2.isTTY, ...options32 }); return translateLevel(level); } __name(createSupportsColor, "createSupportsColor"); var supportsColor = { stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }), stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) }) }; var supports_color_default = supportsColor; // ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js init_import_meta_url(); function stringReplaceAll(string, substring2, replacer2) { let index = string.indexOf(substring2); if (index === -1) { return string; } const substringLength = substring2.length; let endIndex = 0; let returnValue = ""; do { returnValue += string.slice(endIndex, index) + substring2 + replacer2; endIndex = index + substringLength; index = string.indexOf(substring2, endIndex); } while (index !== -1); returnValue += string.slice(endIndex); return returnValue; } __name(stringReplaceAll, "stringReplaceAll"); function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) { let endIndex = 0; let returnValue = ""; do { const gotCR = string[index - 1] === "\r"; returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix; endIndex = index + 1; index = string.indexOf("\n", endIndex); } while (index !== -1); returnValue += string.slice(endIndex); return returnValue; } __name(stringEncaseCRLFWithFirstIndex, "stringEncaseCRLFWithFirstIndex"); // ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default; var GENERATOR = Symbol("GENERATOR"); var STYLER = Symbol("STYLER"); var IS_EMPTY = Symbol("IS_EMPTY"); var levelMapping = [ "ansi", "ansi", "ansi256", "ansi16m" ]; var styles2 = /* @__PURE__ */ Object.create(null); var applyOptions = /* @__PURE__ */ __name((object, options32 = {}) => { if (options32.level && !(Number.isInteger(options32.level) && options32.level >= 0 && options32.level <= 3)) { throw new Error("The `level` option should be an integer from 0 to 3"); } const colorLevel = stdoutColor ? stdoutColor.level : 0; object.level = options32.level === void 0 ? colorLevel : options32.level; }, "applyOptions"); var chalkFactory = /* @__PURE__ */ __name((options32) => { const chalk2 = /* @__PURE__ */ __name((...strings) => strings.join(" "), "chalk"); applyOptions(chalk2, options32); Object.setPrototypeOf(chalk2, createChalk.prototype); return chalk2; }, "chalkFactory"); function createChalk(options32) { return chalkFactory(options32); } __name(createChalk, "createChalk"); Object.setPrototypeOf(createChalk.prototype, Function.prototype); for (const [styleName, style] of Object.entries(ansi_styles_default)) { styles2[styleName] = { get() { const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]); Object.defineProperty(this, styleName, { value: builder }); return builder; } }; } styles2.visible = { get() { const builder = createBuilder(this, this[STYLER], true); Object.defineProperty(this, "visible", { value: builder }); return builder; } }; var getModelAnsi = /* @__PURE__ */ __name((model, level, type, ...arguments_) => { if (model === "rgb") { if (level === "ansi16m") { return ansi_styles_default[type].ansi16m(...arguments_); } if (level === "ansi256") { return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)); } return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_)); } if (model === "hex") { return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_)); } return ansi_styles_default[type][model](...arguments_); }, "getModelAnsi"); var usedModels = ["rgb", "hex", "ansi256"]; for (const model of usedModels) { styles2[model] = { get() { const { level } = this; return function(...arguments_) { const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]); return createBuilder(this, styler, this[IS_EMPTY]); }; } }; const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); styles2[bgModel] = { get() { const { level } = this; return function(...arguments_) { const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]); return createBuilder(this, styler, this[IS_EMPTY]); }; } }; } var proto = Object.defineProperties(() => { }, { ...styles2, level: { enumerable: true, get() { return this[GENERATOR].level; }, set(level) { this[GENERATOR].level = level; } } }); var createStyler = /* @__PURE__ */ __name((open4, close2, parent) => { let openAll; let closeAll; if (parent === void 0) { openAll = open4; closeAll = close2; } else { openAll = parent.openAll + open4; closeAll = close2 + parent.closeAll; } return { open: open4, close: close2, openAll, closeAll, parent }; }, "createStyler"); var createBuilder = /* @__PURE__ */ __name((self2, _styler, _isEmpty) => { const builder = /* @__PURE__ */ __name((...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")), "builder"); Object.setPrototypeOf(builder, proto); builder[GENERATOR] = self2; builder[STYLER] = _styler; builder[IS_EMPTY] = _isEmpty; return builder; }, "createBuilder"); var applyStyle = /* @__PURE__ */ __name((self2, string) => { if (self2.level <= 0 || !string) { return self2[IS_EMPTY] ? "" : string; } let styler = self2[STYLER]; if (styler === void 0) { return string; } const { openAll, closeAll } = styler; if (string.includes("\x1B")) { while (styler !== void 0) { string = stringReplaceAll(string, styler.close, styler.open); styler = styler.parent; } } const lfIndex = string.indexOf("\n"); if (lfIndex !== -1) { string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); } return openAll + string + closeAll; }, "applyStyle"); Object.defineProperties(createChalk.prototype, styles2); var chalk = createChalk(); var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); var source_default = chalk; // src/api/startDevWorker/MultiworkerRuntimeController.ts var import_miniflare10 = require("miniflare"); // src/dev/miniflare/index.ts init_import_meta_url(); var import_node_assert5 = __toESM(require("node:assert")); var import_node_crypto4 = require("node:crypto"); var import_node_path17 = __toESM(require("node:path")); var import_miniflare8 = require("miniflare"); // src/ai/fetcher.ts init_import_meta_url(); var import_miniflare4 = require("miniflare"); // src/cfetch/internal.ts init_import_meta_url(); var import_node_assert3 = __toESM(require("node:assert")); var import_undici3 = __toESM(require_undici()); // package.json var name = "wrangler"; var version = "3.114.16"; // src/environment-variables/misc-variables.ts init_import_meta_url(); var import_node_path2 = __toESM(require("node:path")); // src/global-wrangler-config-path.ts init_import_meta_url(); var import_node_fs = __toESM(require("node:fs")); var import_node_os2 = __toESM(require("node:os")); var import_node_path = __toESM(require("node:path")); // ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/esm-wrapper/mod.esm.js var mod_esm_exports = {}; __export(mod_esm_exports, { default: () => mod_esm_default }); init_import_meta_url(); var import_mod_cjs = __toESM(require_mod_cjs3(), 1); __reExport(mod_esm_exports, __toESM(require_mod_cjs3(), 1)); var mod_esm_default = import_mod_cjs.default; // src/global-wrangler-config-path.ts function isDirectory(configPath) { try { return import_node_fs.default.statSync(configPath).isDirectory(); } catch (error2) { return false; } } __name(isDirectory, "isDirectory"); function getGlobalWranglerConfigPath() { const configDir = mod_esm_default(".wrangler").config(); const legacyConfigDir = import_node_path.default.join(import_node_os2.default.homedir(), ".wrangler"); if (isDirectory(legacyConfigDir)) { return legacyConfigDir; } else { return configDir; } } __name(getGlobalWranglerConfigPath, "getGlobalWranglerConfigPath"); // src/environment-variables/factory.ts init_import_meta_url(); // src/errors.ts init_import_meta_url(); var UserError = class extends Error { telemetryMessage; constructor(message, options32) { super(message, options32); Object.setPrototypeOf(this, new.target.prototype); this.telemetryMessage = options32?.telemetryMessage === true ? message : options32?.telemetryMessage; } }; __name(UserError, "UserError"); var DeprecationError = class extends UserError { constructor(message, options32) { super(`Deprecation: ${message}`, options32); } }; __name(DeprecationError, "DeprecationError"); var FatalError = class extends UserError { constructor(message, code, options32) { super(message, options32); this.code = code; } }; __name(FatalError, "FatalError"); var CommandLineArgsError = class extends UserError { }; __name(CommandLineArgsError, "CommandLineArgsError"); var JsonFriendlyFatalError = class extends FatalError { constructor(message, code, options32) { super(message, code, options32); this.code = code; } }; __name(JsonFriendlyFatalError, "JsonFriendlyFatalError"); var MissingConfigError = class extends Error { telemetryMessage; constructor(key) { super(`Missing config value for ${key}`); this.telemetryMessage = `Missing config value for ${key}`; } }; __name(MissingConfigError, "MissingConfigError"); function createFatalError(message, isJson, code, telemetryMessage) { if (isJson) { return new JsonFriendlyFatalError( JSON.stringify(message), code, telemetryMessage ); } else { return new FatalError(`${message}`, code, telemetryMessage); } } __name(createFatalError, "createFatalError"); // src/environment-variables/factory.ts function getBooleanEnvironmentVariableFactory(options32) { return () => { if (!(options32.variableName in process.env) || process.env[options32.variableName] === void 0) { return typeof options32.defaultValue === "function" ? options32.defaultValue() : options32.defaultValue; } switch (process.env[options32.variableName]?.toLowerCase()) { case "true": return true; case "false": return false; default: throw new UserError( `Expected ${options32.variableName} to be "true" or "false", but got ${JSON.stringify( process.env[options32.variableName] )}` ); } }; } __name(getBooleanEnvironmentVariableFactory, "getBooleanEnvironmentVariableFactory"); function getEnvironmentVariableFactory({ variableName, deprecatedName, defaultValue }) { let hasWarned = false; return () => { if (variableName in process.env) { return process.env[variableName]; } else if (deprecatedName && deprecatedName in process.env) { if (!hasWarned) { hasWarned = true; console.warn( `Using "${deprecatedName}" environment variable. This is deprecated. Please use "${variableName}", instead.` ); } return process.env[deprecatedName]; } else { return defaultValue?.(); } }; } __name(getEnvironmentVariableFactory, "getEnvironmentVariableFactory"); // src/environment-variables/misc-variables.ts var getC3CommandFromEnv = getEnvironmentVariableFactory({ variableName: "WRANGLER_C3_COMMAND", defaultValue: () => "create cloudflare@^2.5.0" }); var getWranglerSendMetricsFromEnv = getEnvironmentVariableFactory({ variableName: "WRANGLER_SEND_METRICS" }); var getWranglerSendErrorReportsFromEnv = getBooleanEnvironmentVariableFactory({ variableName: "WRANGLER_SEND_ERROR_REPORTS" }); var getCloudflareApiEnvironmentFromEnv = getEnvironmentVariableFactory( { variableName: "WRANGLER_API_ENVIRONMENT", defaultValue: () => "production" } ); var getCloudflareApiBaseUrl = getEnvironmentVariableFactory({ variableName: "CLOUDFLARE_API_BASE_URL", deprecatedName: "CF_API_BASE_URL", defaultValue: () => getCloudflareApiEnvironmentFromEnv() === "staging" ? "https://api.staging.cloudflare.com/client/v4" : "https://api.cloudflare.com/client/v4" }); var getSanitizeLogs = getEnvironmentVariableFactory({ variableName: "WRANGLER_LOG_SANITIZE", defaultValue() { return "true"; } }); var getOutputFileDirectoryFromEnv = getEnvironmentVariableFactory({ variableName: "WRANGLER_OUTPUT_FILE_DIRECTORY" }); var getOutputFilePathFromEnv = getEnvironmentVariableFactory({ variableName: "WRANGLER_OUTPUT_FILE_PATH" }); var getCIMatchTag = getEnvironmentVariableFactory({ variableName: "WRANGLER_CI_MATCH_TAG" }); var getCIOverrideName = getEnvironmentVariableFactory({ variableName: "WRANGLER_CI_OVERRIDE_NAME" }); var getBuildConditionsFromEnv = getEnvironmentVariableFactory({ variableName: "WRANGLER_BUILD_CONDITIONS" }); var getBuildPlatformFromEnv = getEnvironmentVariableFactory({ variableName: "WRANGLER_BUILD_PLATFORM" }); var getRegistryPath = getEnvironmentVariableFactory({ variableName: "WRANGLER_REGISTRY_PATH", defaultValue() { return import_node_path2.default.join(getGlobalWranglerConfigPath(), "registry"); } }); // src/logger.ts init_import_meta_url(); var import_node_util = require("node:util"); var import_cli_table3 = __toESM(require_cli_table3()); var import_esbuild2 = require("esbuild"); // src/parse.ts init_import_meta_url(); var fs2 = __toESM(require("node:fs")); var import_node_path3 = require("node:path"); var import_toml = __toESM(require_toml()); var import_esbuild = require("esbuild"); // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js init_import_meta_url(); // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/format.js init_import_meta_url(); // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js init_import_meta_url(); function createScanner(text, ignoreTrivia = false) { const len = text.length; let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0; function scanHexDigits(count, exact) { let digits = 0; let value2 = 0; while (digits < count || !exact) { let ch2 = text.charCodeAt(pos); if (ch2 >= 48 && ch2 <= 57) { value2 = value2 * 16 + ch2 - 48; } else if (ch2 >= 65 && ch2 <= 70) { value2 = value2 * 16 + ch2 - 65 + 10; } else if (ch2 >= 97 && ch2 <= 102) { value2 = value2 * 16 + ch2 - 97 + 10; } else { break; } pos++; digits++; } if (digits < count) { value2 = -1; } return value2; } __name(scanHexDigits, "scanHexDigits"); function setPosition(newPosition) { pos = newPosition; value = ""; tokenOffset = 0; token = 16; scanError = 0; } __name(setPosition, "setPosition"); function scanNumber() { let start = pos; if (text.charCodeAt(pos) === 48) { pos++; } else { pos++; while (pos < text.length && isDigit2(text.charCodeAt(pos))) { pos++; } } if (pos < text.length && text.charCodeAt(pos) === 46) { pos++; if (pos < text.length && isDigit2(text.charCodeAt(pos))) { pos++; while (pos < text.length && isDigit2(text.charCodeAt(pos))) { pos++; } } else { scanError = 3; return text.substring(start, pos); } } let end = pos; if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) { pos++; if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) { pos++; } if (pos < text.length && isDigit2(text.charCodeAt(pos))) { pos++; while (pos < text.length && isDigit2(text.charCodeAt(pos))) { pos++; } end = pos; } else { scanError = 3; } } return text.substring(start, end); } __name(scanNumber, "scanNumber"); function scanString() { let result = "", start = pos; while (true) { if (pos >= len) { result += text.substring(start, pos); scanError = 2; break; } const ch2 = text.charCodeAt(pos); if (ch2 === 34) { result += text.substring(start, pos); pos++; break; } if (ch2 === 92) { result += text.substring(start, pos); pos++; if (pos >= len) { scanError = 2; break; } const ch22 = text.charCodeAt(pos++); switch (ch22) { case 34: result += '"'; break; case 92: result += "\\"; break; case 47: result += "/"; break; case 98: result += "\b"; break; case 102: result += "\f"; break; case 110: result += "\n"; break; case 114: result += "\r"; break; case 116: result += " "; break; case 117: const ch3 = scanHexDigits(4, true); if (ch3 >= 0) { result += String.fromCharCode(ch3); } else { scanError = 4; } break; default: scanError = 5; } start = pos; continue; } if (ch2 >= 0 && ch2 <= 31) { if (isLineBreak(ch2)) { result += text.substring(start, pos); scanError = 2; break; } else { scanError = 6; } } pos++; } return result; } __name(scanString, "scanString"); function scanNext() { value = ""; scanError = 0; tokenOffset = pos; lineStartOffset = lineNumber; prevTokenLineStartOffset = tokenLineStartOffset; if (pos >= len) { tokenOffset = len; return token = 17; } let code = text.charCodeAt(pos); if (isWhiteSpace(code)) { do { pos++; value += String.fromCharCode(code); code = text.charCodeAt(pos); } while (isWhiteSpace(code)); return token = 15; } if (isLineBreak(code)) { pos++; value += String.fromCharCode(code); if (code === 13 && text.charCodeAt(pos) === 10) { pos++; value += "\n"; } lineNumber++; tokenLineStartOffset = pos; return token = 14; } switch (code) { case 123: pos++; return token = 1; case 125: pos++; return token = 2; case 91: pos++; return token = 3; case 93: pos++; return token = 4; case 58: pos++; return token = 6; case 44: pos++; return token = 5; case 34: pos++; value = scanString(); return token = 10; case 47: const start = pos - 1; if (text.charCodeAt(pos + 1) === 47) { pos += 2; while (pos < len) { if (isLineBreak(text.charCodeAt(pos))) { break; } pos++; } value = text.substring(start, pos); return token = 12; } if (text.charCodeAt(pos + 1) === 42) { pos += 2; const safeLength = len - 1; let commentClosed = false; while (pos < safeLength) { const ch2 = text.charCodeAt(pos); if (ch2 === 42 && text.charCodeAt(pos + 1) === 47) { pos += 2; commentClosed = true; break; } pos++; if (isLineBreak(ch2)) { if (ch2 === 13 && text.charCodeAt(pos) === 10) { pos++; } lineNumber++; tokenLineStartOffset = pos; } } if (!commentClosed) { pos++; scanError = 1; } value = text.substring(start, pos); return token = 13; } value += String.fromCharCode(code); pos++; return token = 16; case 45: value += String.fromCharCode(code); pos++; if (pos === len || !isDigit2(text.charCodeAt(pos))) { return token = 16; } case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: value += scanNumber(); return token = 11; default: while (pos < len && isUnknownContentCharacter(code)) { pos++; code = text.charCodeAt(pos); } if (tokenOffset !== pos) { value = text.substring(tokenOffset, pos); switch (value) { case "true": return token = 8; case "false": return token = 9; case "null": return token = 7; } return token = 16; } value += String.fromCharCode(code); pos++; return token = 16; } } __name(scanNext, "scanNext"); function isUnknownContentCharacter(code) { if (isWhiteSpace(code) || isLineBreak(code)) { return false; } switch (code) { case 125: case 93: case 123: case 91: case 34: case 58: case 44: case 47: return false; } return true; } __name(isUnknownContentCharacter, "isUnknownContentCharacter"); function scanNextNonTrivia() { let result; do { result = scanNext(); } while (result >= 12 && result <= 15); return result; } __name(scanNextNonTrivia, "scanNextNonTrivia"); return { setPosition, getPosition: () => pos, scan: ignoreTrivia ? scanNextNonTrivia : scanNext, getToken: () => token, getTokenValue: () => value, getTokenOffset: () => tokenOffset, getTokenLength: () => pos - tokenOffset, getTokenStartLine: () => lineStartOffset, getTokenStartCharacter: () => tokenOffset - prevTokenLineStartOffset, getTokenError: () => scanError }; } __name(createScanner, "createScanner"); function isWhiteSpace(ch2) { return ch2 === 32 || ch2 === 9; } __name(isWhiteSpace, "isWhiteSpace"); function isLineBreak(ch2) { return ch2 === 10 || ch2 === 13; } __name(isLineBreak, "isLineBreak"); function isDigit2(ch2) { return ch2 >= 48 && ch2 <= 57; } __name(isDigit2, "isDigit"); var CharacterCodes; (function(CharacterCodes2) { CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed"; CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn"; CharacterCodes2[CharacterCodes2["space"] = 32] = "space"; CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0"; CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1"; CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2"; CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3"; CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4"; CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5"; CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6"; CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7"; CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8"; CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9"; CharacterCodes2[CharacterCodes2["a"] = 97] = "a"; CharacterCodes2[CharacterCodes2["b"] = 98] = "b"; CharacterCodes2[CharacterCodes2["c"] = 99] = "c"; CharacterCodes2[CharacterCodes2["d"] = 100] = "d"; CharacterCodes2[CharacterCodes2["e"] = 101] = "e"; CharacterCodes2[CharacterCodes2["f"] = 102] = "f"; CharacterCodes2[CharacterCodes2["g"] = 103] = "g"; CharacterCodes2[CharacterCodes2["h"] = 104] = "h"; CharacterCodes2[CharacterCodes2["i"] = 105] = "i"; CharacterCodes2[CharacterCodes2["j"] = 106] = "j"; CharacterCodes2[CharacterCodes2["k"] = 107] = "k"; CharacterCodes2[CharacterCodes2["l"] = 108] = "l"; CharacterCodes2[CharacterCodes2["m"] = 109] = "m"; CharacterCodes2[CharacterCodes2["n"] = 110] = "n"; CharacterCodes2[CharacterCodes2["o"] = 111] = "o"; CharacterCodes2[CharacterCodes2["p"] = 112] = "p"; CharacterCodes2[CharacterCodes2["q"] = 113] = "q"; CharacterCodes2[CharacterCodes2["r"] = 114] = "r"; CharacterCodes2[CharacterCodes2["s"] = 115] = "s"; CharacterCodes2[CharacterCodes2["t"] = 116] = "t"; CharacterCodes2[CharacterCodes2["u"] = 117] = "u"; CharacterCodes2[CharacterCodes2["v"] = 118] = "v"; CharacterCodes2[CharacterCodes2["w"] = 119] = "w"; CharacterCodes2[CharacterCodes2["x"] = 120] = "x"; CharacterCodes2[CharacterCodes2["y"] = 121] = "y"; CharacterCodes2[CharacterCodes2["z"] = 122] = "z"; CharacterCodes2[CharacterCodes2["A"] = 65] = "A"; CharacterCodes2[CharacterCodes2["B"] = 66] = "B"; CharacterCodes2[CharacterCodes2["C"] = 67] = "C"; CharacterCodes2[CharacterCodes2["D"] = 68] = "D"; CharacterCodes2[CharacterCodes2["E"] = 69] = "E"; CharacterCodes2[CharacterCodes2["F"] = 70] = "F"; CharacterCodes2[CharacterCodes2["G"] = 71] = "G"; CharacterCodes2[CharacterCodes2["H"] = 72] = "H"; CharacterCodes2[CharacterCodes2["I"] = 73] = "I"; CharacterCodes2[CharacterCodes2["J"] = 74] = "J"; CharacterCodes2[CharacterCodes2["K"] = 75] = "K"; CharacterCodes2[CharacterCodes2["L"] = 76] = "L"; CharacterCodes2[CharacterCodes2["M"] = 77] = "M"; CharacterCodes2[CharacterCodes2["N"] = 78] = "N"; CharacterCodes2[CharacterCodes2["O"] = 79] = "O"; CharacterCodes2[CharacterCodes2["P"] = 80] = "P"; CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q"; CharacterCodes2[CharacterCodes2["R"] = 82] = "R"; CharacterCodes2[CharacterCodes2["S"] = 83] = "S"; CharacterCodes2[CharacterCodes2["T"] = 84] = "T"; CharacterCodes2[CharacterCodes2["U"] = 85] = "U"; CharacterCodes2[CharacterCodes2["V"] = 86] = "V"; CharacterCodes2[CharacterCodes2["W"] = 87] = "W"; CharacterCodes2[CharacterCodes2["X"] = 88] = "X"; CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y"; CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z"; CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk"; CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash"; CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace"; CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket"; CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon"; CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma"; CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot"; CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote"; CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus"; CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace"; CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket"; CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus"; CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash"; CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed"; CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab"; })(CharacterCodes || (CharacterCodes = {})); // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/format.js function format3(documentText, range, options32) { let initialIndentLevel; let formatText; let formatTextStart; let rangeStart; let rangeEnd; if (range) { rangeStart = range.offset; rangeEnd = rangeStart + range.length; formatTextStart = rangeStart; while (formatTextStart > 0 && !isEOL(documentText, formatTextStart - 1)) { formatTextStart--; } let endOffset = rangeEnd; while (endOffset < documentText.length && !isEOL(documentText, endOffset)) { endOffset++; } formatText = documentText.substring(formatTextStart, endOffset); initialIndentLevel = computeIndentLevel(formatText, options32); } else { formatText = documentText; initialIndentLevel = 0; formatTextStart = 0; rangeStart = 0; rangeEnd = documentText.length; } const eol = getEOL(options32, documentText); let numberLineBreaks = 0; let indentLevel = 0; let indentValue; if (options32.insertSpaces) { indentValue = repeat(" ", options32.tabSize || 4); } else { indentValue = " "; } let scanner = createScanner(formatText, false); let hasError = false; function newLinesAndIndent() { if (numberLineBreaks > 1) { return repeat(eol, numberLineBreaks) + repeat(indentValue, initialIndentLevel + indentLevel); } else { return eol + repeat(indentValue, initialIndentLevel + indentLevel); } } __name(newLinesAndIndent, "newLinesAndIndent"); function scanNext() { let token = scanner.scan(); numberLineBreaks = 0; while (token === 15 || token === 14) { if (token === 14 && options32.keepLines) { numberLineBreaks += 1; } else if (token === 14) { numberLineBreaks = 1; } token = scanner.scan(); } hasError = token === 16 || scanner.getTokenError() !== 0; return token; } __name(scanNext, "scanNext"); const editOperations = []; function addEdit(text, startOffset, endOffset) { if (!hasError && (!range || startOffset < rangeEnd && endOffset > rangeStart) && documentText.substring(startOffset, endOffset) !== text) { editOperations.push({ offset: startOffset, length: endOffset - startOffset, content: text }); } } __name(addEdit, "addEdit"); let firstToken = scanNext(); if (options32.keepLines && numberLineBreaks > 0) { addEdit(repeat(eol, numberLineBreaks), 0, 0); } if (firstToken !== 17) { let firstTokenStart = scanner.getTokenOffset() + formatTextStart; let initialIndent = repeat(indentValue, initialIndentLevel); addEdit(initialIndent, formatTextStart, firstTokenStart); } while (firstToken !== 17) { let firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart; let secondToken = scanNext(); let replaceContent = ""; let needsLineBreak = false; while (numberLineBreaks === 0 && (secondToken === 12 || secondToken === 13)) { let commentTokenStart = scanner.getTokenOffset() + formatTextStart; addEdit(" ", firstTokenEnd, commentTokenStart); firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart; needsLineBreak = secondToken === 12; replaceContent = needsLineBreak ? newLinesAndIndent() : ""; secondToken = scanNext(); } if (secondToken === 2) { if (firstToken !== 1) { indentLevel--; } ; if (options32.keepLines && numberLineBreaks > 0 || !options32.keepLines && firstToken !== 1) { replaceContent = newLinesAndIndent(); } else if (options32.keepLines) { replaceContent = " "; } } else if (secondToken === 4) { if (firstToken !== 3) { indentLevel--; } ; if (options32.keepLines && numberLineBreaks > 0 || !options32.keepLines && firstToken !== 3) { replaceContent = newLinesAndIndent(); } else if (options32.keepLines) { replaceContent = " "; } } else { switch (firstToken) { case 3: case 1: indentLevel++; if (options32.keepLines && numberLineBreaks > 0 || !options32.keepLines) { replaceContent = newLinesAndIndent(); } else { replaceContent = " "; } break; case 5: if (options32.keepLines && numberLineBreaks > 0 || !options32.keepLines) { replaceContent = newLinesAndIndent(); } else { replaceContent = " "; } break; case 12: replaceContent = newLinesAndIndent(); break; case 13: if (numberLineBreaks > 0) { replaceContent = newLinesAndIndent(); } else if (!needsLineBreak) { replaceContent = " "; } break; case 6: if (options32.keepLines && numberLineBreaks > 0) { replaceContent = newLinesAndIndent(); } else if (!needsLineBreak) { replaceContent = " "; } break; case 10: if (options32.keepLines && numberLineBreaks > 0) { replaceContent = newLinesAndIndent(); } else if (secondToken === 6 && !needsLineBreak) { replaceContent = ""; } break; case 7: case 8: case 9: case 11: case 2: case 4: if (options32.keepLines && numberLineBreaks > 0) { replaceContent = newLinesAndIndent(); } else { if ((secondToken === 12 || secondToken === 13) && !needsLineBreak) { replaceContent = " "; } else if (secondToken !== 5 && secondToken !== 17) { hasError = true; } } break; case 16: hasError = true; break; } if (numberLineBreaks > 0 && (secondToken === 12 || secondToken === 13)) { replaceContent = newLinesAndIndent(); } } if (secondToken === 17) { if (options32.keepLines && numberLineBreaks > 0) { replaceContent = newLinesAndIndent(); } else { replaceContent = options32.insertFinalNewline ? eol : ""; } } const secondTokenStart = scanner.getTokenOffset() + formatTextStart; addEdit(replaceContent, firstTokenEnd, secondTokenStart); firstToken = secondToken; } return editOperations; } __name(format3, "format"); function repeat(s5, count) { let result = ""; for (let i5 = 0; i5 < count; i5++) { result += s5; } return result; } __name(repeat, "repeat"); function computeIndentLevel(content, options32) { let i5 = 0; let nChars = 0; const tabSize = options32.tabSize || 4; while (i5 < content.length) { let ch2 = content.charAt(i5); if (ch2 === " ") { nChars++; } else if (ch2 === " ") { nChars += tabSize; } else { break; } i5++; } return Math.floor(nChars / tabSize); } __name(computeIndentLevel, "computeIndentLevel"); function getEOL(options32, text) { for (let i5 = 0; i5 < text.length; i5++) { const ch2 = text.charAt(i5); if (ch2 === "\r") { if (i5 + 1 < text.length && text.charAt(i5 + 1) === "\n") { return "\r\n"; } return "\r"; } else if (ch2 === "\n") { return "\n"; } } return options32 && options32.eol || "\n"; } __name(getEOL, "getEOL"); function isEOL(text, offset) { return "\r\n".indexOf(text.charAt(offset)) !== -1; } __name(isEOL, "isEOL"); // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/edit.js init_import_meta_url(); // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/parser.js init_import_meta_url(); var ParseOptions; (function(ParseOptions2) { ParseOptions2.DEFAULT = { allowTrailingComma: false }; })(ParseOptions || (ParseOptions = {})); function parse(text, errors = [], options32 = ParseOptions.DEFAULT) { let currentProperty = null; let currentParent = []; const previousParents = []; function onValue(value) { if (Array.isArray(currentParent)) { currentParent.push(value); } else if (currentProperty !== null) { currentParent[currentProperty] = value; } } __name(onValue, "onValue"); const visitor = { onObjectBegin: () => { const object = {}; onValue(object); previousParents.push(currentParent); currentParent = object; currentProperty = null; }, onObjectProperty: (name2) => { currentProperty = name2; }, onObjectEnd: () => { currentParent = previousParents.pop(); }, onArrayBegin: () => { const array = []; onValue(array); previousParents.push(currentParent); currentParent = array; currentProperty = null; }, onArrayEnd: () => { currentParent = previousParents.pop(); }, onLiteralValue: onValue, onError: (error2, offset, length) => { errors.push({ error: error2, offset, length }); } }; visit(text, visitor, options32); return currentParent[0]; } __name(parse, "parse"); function parseTree(text, errors = [], options32 = ParseOptions.DEFAULT) { let currentParent = { type: "array", offset: -1, length: -1, children: [], parent: void 0 }; function ensurePropertyComplete(endOffset) { if (currentParent.type === "property") { currentParent.length = endOffset - currentParent.offset; currentParent = currentParent.parent; } } __name(ensurePropertyComplete, "ensurePropertyComplete"); function onValue(valueNode) { currentParent.children.push(valueNode); return valueNode; } __name(onValue, "onValue"); const visitor = { onObjectBegin: (offset) => { currentParent = onValue({ type: "object", offset, length: -1, parent: currentParent, children: [] }); }, onObjectProperty: (name2, offset, length) => { currentParent = onValue({ type: "property", offset, length: -1, parent: currentParent, children: [] }); currentParent.children.push({ type: "string", value: name2, offset, length, parent: currentParent }); }, onObjectEnd: (offset, length) => { ensurePropertyComplete(offset + length); currentParent.length = offset + length - currentParent.offset; currentParent = currentParent.parent; ensurePropertyComplete(offset + length); }, onArrayBegin: (offset, length) => { currentParent = onValue({ type: "array", offset, length: -1, parent: currentParent, children: [] }); }, onArrayEnd: (offset, length) => { currentParent.length = offset + length - currentParent.offset; currentParent = currentParent.parent; ensurePropertyComplete(offset + length); }, onLiteralValue: (value, offset, length) => { onValue({ type: getNodeType(value), offset, length, parent: currentParent, value }); ensurePropertyComplete(offset + length); }, onSeparator: (sep5, offset, length) => { if (currentParent.type === "property") { if (sep5 === ":") { currentParent.colonOffset = offset; } else if (sep5 === ",") { ensurePropertyComplete(offset); } } }, onError: (error2, offset, length) => { errors.push({ error: error2, offset, length }); } }; visit(text, visitor, options32); const result = currentParent.children[0]; if (result) { delete result.parent; } return result; } __name(parseTree, "parseTree"); function findNodeAtLocation(root, path72) { if (!root) { return void 0; } let node2 = root; for (let segment of path72) { if (typeof segment === "string") { if (node2.type !== "object" || !Array.isArray(node2.children)) { return void 0; } let found = false; for (const propertyNode of node2.children) { if (Array.isArray(propertyNode.children) && propertyNode.children[0].value === segment && propertyNode.children.length === 2) { node2 = propertyNode.children[1]; found = true; break; } } if (!found) { return void 0; } } else { const index = segment; if (node2.type !== "array" || index < 0 || !Array.isArray(node2.children) || index >= node2.children.length) { return void 0; } node2 = node2.children[index]; } } return node2; } __name(findNodeAtLocation, "findNodeAtLocation"); function visit(text, visitor, options32 = ParseOptions.DEFAULT) { const _scanner = createScanner(text, false); const _jsonPath = []; function toNoArgVisit(visitFunction) { return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true; } __name(toNoArgVisit, "toNoArgVisit"); function toNoArgVisitWithPath(visitFunction) { return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true; } __name(toNoArgVisitWithPath, "toNoArgVisitWithPath"); function toOneArgVisit(visitFunction) { return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true; } __name(toOneArgVisit, "toOneArgVisit"); function toOneArgVisitWithPath(visitFunction) { return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true; } __name(toOneArgVisitWithPath, "toOneArgVisitWithPath"); const onObjectBegin = toNoArgVisitWithPath(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisitWithPath(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError); const disallowComments = options32 && options32.disallowComments; const allowTrailingComma = options32 && options32.allowTrailingComma; function scanNext() { while (true) { const token = _scanner.scan(); switch (_scanner.getTokenError()) { case 4: handleError( 14 /* ParseErrorCode.InvalidUnicode */ ); break; case 5: handleError( 15 /* ParseErrorCode.InvalidEscapeCharacter */ ); break; case 3: handleError( 13 /* ParseErrorCode.UnexpectedEndOfNumber */ ); break; case 1: if (!disallowComments) { handleError( 11 /* ParseErrorCode.UnexpectedEndOfComment */ ); } break; case 2: handleError( 12 /* ParseErrorCode.UnexpectedEndOfString */ ); break; case 6: handleError( 16 /* ParseErrorCode.InvalidCharacter */ ); break; } switch (token) { case 12: case 13: if (disallowComments) { handleError( 10 /* ParseErrorCode.InvalidCommentToken */ ); } else { onComment(); } break; case 16: handleError( 1 /* ParseErrorCode.InvalidSymbol */ ); break; case 15: case 14: break; default: return token; } } } __name(scanNext, "scanNext"); function handleError(error2, skipUntilAfter = [], skipUntil = []) { onError(error2); if (skipUntilAfter.length + skipUntil.length > 0) { let token = _scanner.getToken(); while (token !== 17) { if (skipUntilAfter.indexOf(token) !== -1) { scanNext(); break; } else if (skipUntil.indexOf(token) !== -1) { break; } token = scanNext(); } } } __name(handleError, "handleError"); function parseString(isValue) { const value = _scanner.getTokenValue(); if (isValue) { onLiteralValue(value); } else { onObjectProperty(value); _jsonPath.push(value); } scanNext(); return true; } __name(parseString, "parseString"); function parseLiteral() { switch (_scanner.getToken()) { case 11: const tokenValue = _scanner.getTokenValue(); let value = Number(tokenValue); if (isNaN(value)) { handleError( 2 /* ParseErrorCode.InvalidNumberFormat */ ); value = 0; } onLiteralValue(value); break; case 7: onLiteralValue(null); break; case 8: onLiteralValue(true); break; case 9: onLiteralValue(false); break; default: return false; } scanNext(); return true; } __name(parseLiteral, "parseLiteral"); function parseProperty() { if (_scanner.getToken() !== 10) { handleError(3, [], [ 2, 5 /* SyntaxKind.CommaToken */ ]); return false; } parseString(false); if (_scanner.getToken() === 6) { onSeparator(":"); scanNext(); if (!parseValue()) { handleError(4, [], [ 2, 5 /* SyntaxKind.CommaToken */ ]); } } else { handleError(5, [], [ 2, 5 /* SyntaxKind.CommaToken */ ]); } _jsonPath.pop(); return true; } __name(parseProperty, "parseProperty"); function parseObject() { onObjectBegin(); scanNext(); let needsComma = false; while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) { if (_scanner.getToken() === 5) { if (!needsComma) { handleError(4, [], []); } onSeparator(","); scanNext(); if (_scanner.getToken() === 2 && allowTrailingComma) { break; } } else if (needsComma) { handleError(6, [], []); } if (!parseProperty()) { handleError(4, [], [ 2, 5 /* SyntaxKind.CommaToken */ ]); } needsComma = true; } onObjectEnd(); if (_scanner.getToken() !== 2) { handleError(7, [ 2 /* SyntaxKind.CloseBraceToken */ ], []); } else { scanNext(); } return true; } __name(parseObject, "parseObject"); function parseArray() { onArrayBegin(); scanNext(); let isFirstElement = true; let needsComma = false; while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) { if (_scanner.getToken() === 5) { if (!needsComma) { handleError(4, [], []); } onSeparator(","); scanNext(); if (_scanner.getToken() === 4 && allowTrailingComma) { break; } } else if (needsComma) { handleError(6, [], []); } if (isFirstElement) { _jsonPath.push(0); isFirstElement = false; } else { _jsonPath[_jsonPath.length - 1]++; } if (!parseValue()) { handleError(4, [], [ 4, 5 /* SyntaxKind.CommaToken */ ]); } needsComma = true; } onArrayEnd(); if (!isFirstElement) { _jsonPath.pop(); } if (_scanner.getToken() !== 4) { handleError(8, [ 4 /* SyntaxKind.CloseBracketToken */ ], []); } else { scanNext(); } return true; } __name(parseArray, "parseArray"); function parseValue() { switch (_scanner.getToken()) { case 3: return parseArray(); case 1: return parseObject(); case 10: return parseString(true); default: return parseLiteral(); } } __name(parseValue, "parseValue"); scanNext(); if (_scanner.getToken() === 17) { if (options32.allowEmptyContent) { return true; } handleError(4, [], []); return false; } if (!parseValue()) { handleError(4, [], []); return false; } if (_scanner.getToken() !== 17) { handleError(9, [], []); } return true; } __name(visit, "visit"); function getNodeType(value) { switch (typeof value) { case "boolean": return "boolean"; case "number": return "number"; case "string": return "string"; case "object": { if (!value) { return "null"; } else if (Array.isArray(value)) { return "array"; } return "object"; } default: return "null"; } } __name(getNodeType, "getNodeType"); // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/edit.js function setProperty(text, originalPath, value, options32) { const path72 = originalPath.slice(); const errors = []; const root = parseTree(text, errors); let parent = void 0; let lastSegment = void 0; while (path72.length > 0) { lastSegment = path72.pop(); parent = findNodeAtLocation(root, path72); if (parent === void 0 && value !== void 0) { if (typeof lastSegment === "string") { value = { [lastSegment]: value }; } else { value = [value]; } } else { break; } } if (!parent) { if (value === void 0) { throw new Error("Can not delete in empty document"); } return withFormatting(text, { offset: root ? root.offset : 0, length: root ? root.length : 0, content: JSON.stringify(value) }, options32); } else if (parent.type === "object" && typeof lastSegment === "string" && Array.isArray(parent.children)) { const existing = findNodeAtLocation(parent, [lastSegment]); if (existing !== void 0) { if (value === void 0) { if (!existing.parent) { throw new Error("Malformed AST"); } const propertyIndex = parent.children.indexOf(existing.parent); let removeBegin; let removeEnd = existing.parent.offset + existing.parent.length; if (propertyIndex > 0) { let previous = parent.children[propertyIndex - 1]; removeBegin = previous.offset + previous.length; } else { removeBegin = parent.offset + 1; if (parent.children.length > 1) { let next = parent.children[1]; removeEnd = next.offset; } } return withFormatting(text, { offset: removeBegin, length: removeEnd - removeBegin, content: "" }, options32); } else { return withFormatting(text, { offset: existing.offset, length: existing.length, content: JSON.stringify(value) }, options32); } } else { if (value === void 0) { return []; } const newProperty = `${JSON.stringify(lastSegment)}: ${JSON.stringify(value)}`; const index = options32.getInsertionIndex ? options32.getInsertionIndex(parent.children.map((p6) => p6.children[0].value)) : parent.children.length; let edit; if (index > 0) { let previous = parent.children[index - 1]; edit = { offset: previous.offset + previous.length, length: 0, content: "," + newProperty }; } else if (parent.children.length === 0) { edit = { offset: parent.offset + 1, length: 0, content: newProperty }; } else { edit = { offset: parent.offset + 1, length: 0, content: newProperty + "," }; } return withFormatting(text, edit, options32); } } else if (parent.type === "array" && typeof lastSegment === "number" && Array.isArray(parent.children)) { const insertIndex = lastSegment; if (insertIndex === -1) { const newProperty = `${JSON.stringify(value)}`; let edit; if (parent.children.length === 0) { edit = { offset: parent.offset + 1, length: 0, content: newProperty }; } else { const previous = parent.children[parent.children.length - 1]; edit = { offset: previous.offset + previous.length, length: 0, content: "," + newProperty }; } return withFormatting(text, edit, options32); } else if (value === void 0 && parent.children.length >= 0) { const removalIndex = lastSegment; const toRemove = parent.children[removalIndex]; let edit; if (parent.children.length === 1) { edit = { offset: parent.offset + 1, length: parent.length - 2, content: "" }; } else if (parent.children.length - 1 === removalIndex) { let previous = parent.children[removalIndex - 1]; let offset = previous.offset + previous.length; let parentEndOffset = parent.offset + parent.length; edit = { offset, length: parentEndOffset - 2 - offset, content: "" }; } else { edit = { offset: toRemove.offset, length: parent.children[removalIndex + 1].offset - toRemove.offset, content: "" }; } return withFormatting(text, edit, options32); } else if (value !== void 0) { let edit; const newProperty = `${JSON.stringify(value)}`; if (!options32.isArrayInsertion && parent.children.length > lastSegment) { const toModify = parent.children[lastSegment]; edit = { offset: toModify.offset, length: toModify.length, content: newProperty }; } else if (parent.children.length === 0 || lastSegment === 0) { edit = { offset: parent.offset + 1, length: 0, content: parent.children.length === 0 ? newProperty : newProperty + "," }; } else { const index = lastSegment > parent.children.length ? parent.children.length : lastSegment; const previous = parent.children[index - 1]; edit = { offset: previous.offset + previous.length, length: 0, content: "," + newProperty }; } return withFormatting(text, edit, options32); } else { throw new Error(`Can not ${value === void 0 ? "remove" : options32.isArrayInsertion ? "insert" : "modify"} Array index ${insertIndex} as length is not sufficient`); } } else { throw new Error(`Can not add ${typeof lastSegment !== "number" ? "index" : "property"} to parent of type ${parent.type}`); } } __name(setProperty, "setProperty"); function withFormatting(text, edit, options32) { if (!options32.formattingOptions) { return [edit]; } let newText = applyEdit(text, edit); let begin = edit.offset; let end = edit.offset + edit.content.length; if (edit.length === 0 || edit.content.length === 0) { while (begin > 0 && !isEOL(newText, begin - 1)) { begin--; } while (end < newText.length && !isEOL(newText, end)) { end++; } } const edits = format3(newText, { offset: begin, length: end - begin }, { ...options32.formattingOptions, keepLines: false }); for (let i5 = edits.length - 1; i5 >= 0; i5--) { const edit2 = edits[i5]; newText = applyEdit(newText, edit2); begin = Math.min(begin, edit2.offset); end = Math.max(end, edit2.offset + edit2.length); end += edit2.content.length - edit2.length; } const editLength = text.length - (newText.length - end) - begin; return [{ offset: begin, length: editLength, content: newText.substring(begin, end) }]; } __name(withFormatting, "withFormatting"); function applyEdit(text, edit) { return text.substring(0, edit.offset) + edit.content + text.substring(edit.offset + edit.length); } __name(applyEdit, "applyEdit"); // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js var ScanError; (function(ScanError2) { ScanError2[ScanError2["None"] = 0] = "None"; ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment"; ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString"; ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber"; ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode"; ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter"; ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter"; })(ScanError || (ScanError = {})); var SyntaxKind; (function(SyntaxKind2) { SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken"; SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken"; SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken"; SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken"; SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken"; SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken"; SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword"; SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword"; SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword"; SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral"; SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral"; SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia"; SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia"; SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia"; SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia"; SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown"; SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF"; })(SyntaxKind || (SyntaxKind = {})); var parse2 = parse; var ParseErrorCode; (function(ParseErrorCode2) { ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol"; ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat"; ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected"; ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected"; ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected"; ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected"; ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected"; ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected"; ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected"; ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken"; ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment"; ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString"; ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber"; ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode"; ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter"; ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter"; })(ParseErrorCode || (ParseErrorCode = {})); function printParseErrorCode(code) { switch (code) { case 1: return "InvalidSymbol"; case 2: return "InvalidNumberFormat"; case 3: return "PropertyNameExpected"; case 4: return "ValueExpected"; case 5: return "ColonExpected"; case 6: return "CommaExpected"; case 7: return "CloseBraceExpected"; case 8: return "CloseBracketExpected"; case 9: return "EndOfFileExpected"; case 10: return "InvalidCommentToken"; case 11: return "UnexpectedEndOfComment"; case 12: return "UnexpectedEndOfString"; case 13: return "UnexpectedEndOfNumber"; case 14: return "InvalidUnicode"; case 15: return "InvalidEscapeCharacter"; case 16: return "InvalidCharacter"; } return ""; } __name(printParseErrorCode, "printParseErrorCode"); function format4(documentText, range, options32) { return format3(documentText, range, options32); } __name(format4, "format"); function modify(text, path72, value, options32) { return setProperty(text, path72, value, options32); } __name(modify, "modify"); function applyEdits(text, edits) { let sortedEdits = edits.slice(0).sort((a5, b6) => { const diff = a5.offset - b6.offset; if (diff === 0) { return a5.length - b6.length; } return diff; }); let lastModifiedOffset = text.length; for (let i5 = sortedEdits.length - 1; i5 >= 0; i5--) { let e7 = sortedEdits[i5]; if (e7.offset + e7.length <= lastModifiedOffset) { text = applyEdit(text, e7); } else { throw new Error("Overlapping edit"); } lastModifiedOffset = e7.offset; } return text; } __name(applyEdits, "applyEdits"); // src/parse.ts function formatMessage({ text, notes, location, kind = "error" }, color = true) { const input = { text, notes, location }; delete input.location?.fileText; for (const note of notes ?? []) { delete note.location?.fileText; } const lines = (0, import_esbuild.formatMessagesSync)([input], { color, kind, terminalWidth: logger.columns }); return lines.join("\n"); } __name(formatMessage, "formatMessage"); var ParseError = class extends UserError { text; notes; location; kind; constructor({ text, notes, location, kind, telemetryMessage }) { super(text, { telemetryMessage }); this.name = this.constructor.name; this.text = text; this.notes = notes ?? []; this.location = location; this.kind = kind ?? "error"; } }; __name(ParseError, "ParseError"); var APIError = class extends ParseError { #status; code; accountTag; constructor({ status: status2, ...rest }) { super(rest); this.name = this.constructor.name; this.#status = status2; } isGatewayError() { if (this.#status !== void 0) { return [524].includes(this.#status); } return false; } isRetryable() { return String(this.#status).startsWith("5"); } // Allow `APIError`s to be marked as handled. #reportable = true; get reportable() { return this.#reportable; } preventReport() { this.#reportable = false; } }; __name(APIError, "APIError"); var TOML_ERROR_NAME = "TomlError"; var TOML_ERROR_SUFFIX = " at row "; function parseTOML(input, file) { try { const normalizedInput = input.replace(/\r\n/g, "\n"); return import_toml.default.parse(normalizedInput); } catch (err) { const { name: name2, message, line, col } = err; if (name2 !== TOML_ERROR_NAME) { throw err; } const text = message.substring(0, message.lastIndexOf(TOML_ERROR_SUFFIX)); const lineText = input.split("\n")[line]; const location = { lineText, line: line + 1, column: col - 1, file, fileText: input }; throw new ParseError({ text, location, telemetryMessage: "TOML parse error" }); } } __name(parseTOML, "parseTOML"); function parsePackageJSON(input, file) { return parseJSON(input, file); } __name(parsePackageJSON, "parsePackageJSON"); function parseJSON(input, file) { return parseJSONC(input, file, { allowEmptyContent: false, allowTrailingComma: false, disallowComments: true }); } __name(parseJSON, "parseJSON"); function parseJSONC(input, file, options32 = { allowTrailingComma: true }) { const errors = []; const data = parse2(input, errors, options32); if (errors.length) { throw new ParseError({ text: printParseErrorCode(errors[0].error), location: { ...indexLocation({ file, fileText: input }, errors[0].offset + 1), length: errors[0].length }, telemetryMessage: "JSON(C) parse error" }); } return data; } __name(parseJSONC, "parseJSONC"); function readFileSyncToBuffer(file) { try { return fs2.readFileSync(file); } catch (err) { const { message } = err; throw new ParseError({ text: `Could not read file: ${file}`, notes: [ { text: message.replace(file, (0, import_node_path3.resolve)(file)) } ] }); } } __name(readFileSyncToBuffer, "readFileSyncToBuffer"); function readFileSync5(file) { try { const buffer = fs2.readFileSync(file); return removeBOMAndValidate(buffer, file); } catch (err) { if (err instanceof ParseError) { throw err; } const { message } = err; throw new ParseError({ text: `Could not read file: ${file}`, notes: [ { text: message.replace(file, (0, import_node_path3.resolve)(file)) } ], telemetryMessage: "Could not read file" }); } } __name(readFileSync5, "readFileSync"); function indexLocation(file, index) { let lineText, line = 0, column = 0, cursor = 0; const { fileText = "" } = file; for (const row of fileText.split("\n")) { line++; cursor += row.length + 1; if (cursor >= index) { lineText = row; column = row.length - (cursor - index); break; } } return { lineText, line, column, ...file }; } __name(indexLocation, "indexLocation"); var units = { nanoseconds: 1e-9, nanosecond: 1e-9, microseconds: 1e-6, microsecond: 1e-6, milliseconds: 1e-3, millisecond: 1e-3, seconds: 1, second: 1, minutes: 60, minute: 60, hours: 3600, hour: 3600, days: 86400, day: 86400, weeks: 604800, week: 604800, month: 18144e3, year: 220752e3, nsecs: 1e-9, nsec: 1e-9, usecs: 1e-6, usec: 1e-6, msecs: 1e-3, msec: 1e-3, secs: 1, sec: 1, mins: 60, min: 60, ns: 1e-9, us: 1e-6, ms: 1e-3, mo: 18144e3, yr: 220752e3, s: 1, m: 60, h: 3600, d: 86400, w: 604800, y: 220752e3 }; function parseHumanDuration(s5) { const unitsMap = new Map(Object.entries(units)); s5 = s5.trim().toLowerCase(); let base = 1; for (const [name2, _4] of unitsMap) { if (s5.endsWith(name2)) { s5 = s5.substring(0, s5.length - name2.length); base = unitsMap.get(name2) || 1; break; } } return Number(s5) * base; } __name(parseHumanDuration, "parseHumanDuration"); function parseNonHyphenedUuid(uuid) { if (uuid == null || uuid.includes("-")) { return uuid; } if (uuid.length != 32) { return null; } const uuid_parts = []; uuid_parts.push(uuid.slice(0, 8)); uuid_parts.push(uuid.slice(8, 12)); uuid_parts.push(uuid.slice(12, 16)); uuid_parts.push(uuid.slice(16, 20)); uuid_parts.push(uuid.slice(20)); let hyphenated = ""; uuid_parts.forEach((part) => hyphenated += part + "-"); return hyphenated.slice(0, 36); } __name(parseNonHyphenedUuid, "parseNonHyphenedUuid"); var UNSUPPORTED_BOMS = [ { buffer: Buffer.from([0, 0, 254, 255]), encoding: "UTF-32 BE" }, { buffer: Buffer.from([255, 254, 0, 0]), encoding: "UTF-32 LE" }, { buffer: Buffer.from([254, 255]), encoding: "UTF-16 BE" }, { buffer: Buffer.from([255, 254]), encoding: "UTF-16 LE" } ]; function removeBOMAndValidate(buffer, file) { for (const bom of UNSUPPORTED_BOMS) { if (buffer.length >= bom.buffer.length && buffer.subarray(0, bom.buffer.length).equals(bom.buffer)) { throw new ParseError({ text: `Configuration file contains ${bom.encoding} byte order marker`, notes: [ { text: `The file "${file}" appears to be encoded as ${bom.encoding}. Please save the file as UTF-8 without BOM.` } ], location: { file, line: 1, column: 0 }, telemetryMessage: `${bom.encoding} BOM detected` }); } } const content = buffer.toString("utf-8"); if (content.charCodeAt(0) === 65279) { return content.slice(1); } return content; } __name(removeBOMAndValidate, "removeBOMAndValidate"); // src/utils/log-file.ts init_import_meta_url(); var import_promises2 = require("node:fs/promises"); var import_node_path5 = __toESM(require("node:path")); var import_miniflare = require("miniflare"); var import_signal_exit = __toESM(require_signal_exit()); // ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js init_import_meta_url(); // ../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js init_import_meta_url(); function ansiRegex({ onlyFirst = false } = {}) { const pattern = [ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))" ].join("|"); return new RegExp(pattern, onlyFirst ? void 0 : "g"); } __name(ansiRegex, "ansiRegex"); // ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js var regex = ansiRegex(); function stripAnsi2(string) { if (typeof string !== "string") { throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); } return string.replace(regex, ""); } __name(stripAnsi2, "stripAnsi"); // src/utils/filesystem.ts init_import_meta_url(); var import_fs5 = require("fs"); var import_promises = require("fs/promises"); var import_path5 = __toESM(require("path")); // ../workers-shared/utils/helpers.ts init_import_meta_url(); var import_node_fs2 = require("node:fs"); var import_node_path4 = require("node:path"); var import_ignore = __toESM(require_ignore()); var import_mime = __toESM(require_mime()); // ../workers-shared/utils/constants.ts init_import_meta_url(); var PATH_HASH_SIZE = 16; var CONTENT_HASH_SIZE = 16; var TAIL_SIZE = 8; var ENTRY_SIZE = PATH_HASH_SIZE + CONTENT_HASH_SIZE + TAIL_SIZE; var MAX_ASSET_COUNT = 2e4; var MAX_ASSET_SIZE = 25 * 1024 * 1024; var CF_ASSETS_IGNORE_FILENAME = ".assetsignore"; var REDIRECTS_FILENAME = "_redirects"; var HEADERS_FILENAME = "_headers"; // ../workers-shared/utils/helpers.ts var normalizeFilePath = /* @__PURE__ */ __name((relativeFilepath) => { if ((0, import_node_path4.isAbsolute)(relativeFilepath)) { throw new Error(`Expected relative path`); } return "/" + relativeFilepath.split(import_node_path4.sep).join("/"); }, "normalizeFilePath"); var getContentType = /* @__PURE__ */ __name((absFilePath) => { let contentType = (0, import_mime.getType)(absFilePath); if (contentType && contentType.startsWith("text/") && !contentType.includes("charset")) { contentType = `${contentType}; charset=utf-8`; } return contentType; }, "getContentType"); function createPatternMatcher(patterns, exclude) { if (patterns.length === 0) { return (_filePath) => !exclude; } else { const ignorer = (0, import_ignore.default)().add(patterns); return (filePath) => ignorer.test(filePath).ignored; } } __name(createPatternMatcher, "createPatternMatcher"); function thrownIsDoesNotExistError(thrown) { return thrown instanceof Error && "code" in thrown && thrown.code === "ENOENT"; } __name(thrownIsDoesNotExistError, "thrownIsDoesNotExistError"); function maybeGetFile(filePath) { try { return (0, import_node_fs2.readFileSync)(filePath, "utf8"); } catch (e7) { if (!thrownIsDoesNotExistError(e7)) { throw e7; } } } __name(maybeGetFile, "maybeGetFile"); async function createAssetsIgnoreFunction(dir) { const cfAssetIgnorePath = (0, import_node_path4.resolve)(dir, CF_ASSETS_IGNORE_FILENAME); const ignorePatterns = [ // Ignore the `.assetsignore` file and other metafiles by default. // The ignore lib expects unix-style paths for its patterns `/${CF_ASSETS_IGNORE_FILENAME}`, `/${REDIRECTS_FILENAME}`, `/${HEADERS_FILENAME}` ]; let assetsIgnoreFilePresent = false; const assetsIgnore = maybeGetFile(cfAssetIgnorePath); if (assetsIgnore !== void 0) { assetsIgnoreFilePresent = true; ignorePatterns.push(...assetsIgnore.split("\n")); } return { assetsIgnoreFunction: createPatternMatcher(ignorePatterns, true), assetsIgnoreFilePresent }; } __name(createAssetsIgnoreFunction, "createAssetsIgnoreFunction"); // src/utils/filesystem.ts async function ensureDirectoryExists(filepath) { const dirpath = import_path5.default.dirname(filepath); await (0, import_promises.mkdir)(dirpath, { recursive: true }); } __name(ensureDirectoryExists, "ensureDirectoryExists"); function ensureDirectoryExistsSync(filepath) { const dirpath = import_path5.default.dirname(filepath); (0, import_fs5.mkdirSync)(dirpath, { recursive: true }); } __name(ensureDirectoryExistsSync, "ensureDirectoryExistsSync"); // src/utils/log-file.ts var getDebugFileDir = getEnvironmentVariableFactory({ variableName: "WRANGLER_LOG_PATH", defaultValue() { const gobalWranglerConfigDir = getGlobalWranglerConfigPath(); return import_node_path5.default.join(gobalWranglerConfigDir, "logs"); } }); function getDebugFilepath() { const dir = getDebugFileDir(); const date = (/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-").replace(".", "_").replace("T", "_").replace("Z", ""); const filepath = dir.endsWith(".log") ? dir : import_node_path5.default.join(dir, `wrangler-${date}.log`); return import_node_path5.default.resolve(filepath); } __name(getDebugFilepath, "getDebugFilepath"); var debugLogFilepath = getDebugFilepath(); var mutex = new import_miniflare.Mutex(); var hasLoggedLocation = false; var hasLoggedError = false; var hasSeenErrorMessage = false; async function appendToDebugLogFile(messageLevel, message) { const entry = ` --- ${(/* @__PURE__ */ new Date()).toISOString()} ${messageLevel} ${stripAnsi2(message)} --- `; if (!hasLoggedLocation) { hasLoggedLocation = true; logger.debug(`\u{1FAB5} Writing logs to "${debugLogFilepath}"`); (0, import_signal_exit.default)(() => { if (hasSeenErrorMessage) { logger.console( "warn", `\u{1FAB5} Logs were written to "${debugLogFilepath}"` ); } }); } if (!hasSeenErrorMessage) { hasSeenErrorMessage = messageLevel === "error"; } await mutex.runWith(async () => { try { await ensureDirectoryExists(debugLogFilepath); await (0, import_promises2.appendFile)(debugLogFilepath, entry); } catch (err) { if (!hasLoggedError) { hasLoggedError = true; logger.error(`Failed to write to log file`, err); logger.error(`Would have written:`, entry); } } }); } __name(appendToDebugLogFile, "appendToDebugLogFile"); // src/logger.ts var LOGGER_LEVELS = { none: -1, error: 0, warn: 1, info: 2, log: 3, debug: 4 }; var LOGGER_LEVEL_FORMAT_TYPE_MAP = { error: "error", warn: "warning", info: void 0, log: void 0, debug: void 0 }; var getLogLevelFromEnv = getEnvironmentVariableFactory({ variableName: "WRANGLER_LOG" }); function getLoggerLevel() { const fromEnv3 = getLogLevelFromEnv()?.toLowerCase(); if (fromEnv3 !== void 0) { if (fromEnv3 in LOGGER_LEVELS) { return fromEnv3; } const expected = Object.keys(LOGGER_LEVELS).map((level) => `"${level}"`).join(" | "); logger.once.warn( `Unrecognised WRANGLER_LOG value ${JSON.stringify( fromEnv3 )}, expected ${expected}, defaulting to "log"...` ); } return "log"; } __name(getLoggerLevel, "getLoggerLevel"); var _beforeLogHook, _afterLogHook; var _Logger = class { constructor() { } overrideLoggerLevel; onceHistory = /* @__PURE__ */ new Set(); get loggerLevel() { return this.overrideLoggerLevel ?? getLoggerLevel(); } set loggerLevel(val2) { this.overrideLoggerLevel = val2; } resetLoggerLevel() { this.overrideLoggerLevel = void 0; } columns = process.stdout.columns; debug = (...args) => this.doLog("debug", args); debugWithSanitization = (label, ...args) => { if (getSanitizeLogs() === "false") { this.doLog("debug", [label, ...args]); } else { this.doLog("debug", [ label, "omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data" ]); } }; info = (...args) => this.doLog("info", args); log = (...args) => this.doLog("log", args); warn = (...args) => this.doLog("warn", args); error(...args) { if (args.length === 1 && args[0] instanceof ParseError) { this.doLog("error", formatMessage(args[0])); } else { this.doLog("error", args); } } table(data) { const keys = data.length === 0 ? [] : Object.keys(data[0]); const t7 = new import_cli_table3.default({ head: keys, style: { head: source_default.level ? ["blue"] : [], border: source_default.level ? ["gray"] : [] } }); t7.push(...data.map((row) => keys.map((k6) => row[k6]))); return this.doLog("log", [t7.toString()]); } console(method, ...args) { var _a3, _b2; if (typeof console[method] !== "function") { throw new Error(`console.${method}() is not a function`); } (_a3 = __privateGet(_Logger, _beforeLogHook)) == null ? void 0 : _a3.call(_Logger); console[method].apply(console, args); (_b2 = __privateGet(_Logger, _afterLogHook)) == null ? void 0 : _b2.call(_Logger); } get once() { return { info: (...args) => this.doLogOnce("info", args), log: (...args) => this.doLogOnce("log", args), warn: (...args) => this.doLogOnce("warn", args), error: (...args) => this.doLogOnce("error", args) }; } clearHistory() { this.onceHistory.clear(); } doLogOnce(messageLevel, args) { const cacheKey = `${messageLevel}: ${args.join(" ")}`; if (!this.onceHistory.has(cacheKey)) { this.onceHistory.add(cacheKey); this.doLog(messageLevel, args); } } doLog(messageLevel, args) { var _a3, _b2; const message = Array.isArray(args) ? this.formatMessage(messageLevel, (0, import_node_util.format)(...args)) : args; const inUnitTests = typeof vitest !== "undefined"; if (!inUnitTests) { void appendToDebugLogFile(messageLevel, message); } if (LOGGER_LEVELS[this.loggerLevel] >= LOGGER_LEVELS[messageLevel]) { (_a3 = __privateGet(_Logger, _beforeLogHook)) == null ? void 0 : _a3.call(_Logger); console[messageLevel](message); (_b2 = __privateGet(_Logger, _afterLogHook)) == null ? void 0 : _b2.call(_Logger); } } static registerBeforeLogHook(callback) { __privateSet(this, _beforeLogHook, callback); } static registerAfterLogHook(callback) { __privateSet(this, _afterLogHook, callback); } formatMessage(level, message) { const kind = LOGGER_LEVEL_FORMAT_TYPE_MAP[level]; if (kind) { const [firstLine, ...otherLines] = message.split("\n"); const notes = otherLines.length > 0 ? otherLines.map((text) => ({ text })) : void 0; return (0, import_esbuild2.formatMessagesSync)([{ text: firstLine, notes }], { color: true, kind, terminalWidth: this.columns })[0]; } else { return message; } } }; var Logger = _Logger; __name(Logger, "Logger"); _beforeLogHook = new WeakMap(); _afterLogHook = new WeakMap(); __privateAdd(Logger, _beforeLogHook, void 0); __privateAdd(Logger, _afterLogHook, void 0); var logger = new Logger(); function logBuildWarnings(warnings) { const logs = (0, import_esbuild2.formatMessagesSync)(warnings, { kind: "warning", color: true }); for (const log2 of logs) { logger.console("warn", log2); } } __name(logBuildWarnings, "logBuildWarnings"); function logBuildFailure(errors, warnings) { if (errors.length > 0) { const logs = (0, import_esbuild2.formatMessagesSync)(errors, { kind: "error", color: true }); const errorStr = errors.length > 1 ? "errors" : "error"; logger.error( `Build failed with ${errors.length} ${errorStr}: ` + logs.join("\n") ); } logBuildWarnings(warnings); } __name(logBuildFailure, "logBuildFailure"); // src/user/index.ts init_import_meta_url(); // src/user/user.ts init_import_meta_url(); var import_node_assert2 = __toESM(require("node:assert")); var import_node_crypto2 = require("node:crypto"); var import_node_fs5 = require("node:fs"); var import_node_http = __toESM(require("node:http")); var import_node_path12 = __toESM(require("node:path")); var import_node_url5 = __toESM(require("node:url")); var import_node_util2 = require("node:util"); var import_toml4 = __toESM(require_toml()); var import_undici2 = __toESM(require_undici()); // src/config/index.ts init_import_meta_url(); var import_node_path11 = __toESM(require("node:path")); var import_toml3 = __toESM(require_toml()); var import_dotenv = __toESM(require_main2()); // src/pages/errors.ts init_import_meta_url(); // src/pages/constants.ts init_import_meta_url(); var isWindows = process.platform === "win32"; var MAX_ASSET_COUNT2 = 2e4; var MAX_ASSET_SIZE2 = 25 * 1024 * 1024; var PAGES_CONFIG_CACHE_FILENAME = "pages.json"; var MAX_BUCKET_SIZE = 40 * 1024 * 1024; var MAX_BUCKET_FILE_COUNT = isWindows ? 1e3 : 2e3; var BULK_UPLOAD_CONCURRENCY = 3; var MAX_UPLOAD_ATTEMPTS = 5; var MAX_UPLOAD_GATEWAY_ERRORS = 5; var MAX_DEPLOYMENT_ATTEMPTS = 3; var MAX_DEPLOYMENT_STATUS_ATTEMPTS = 5; var MAX_CHECK_MISSING_ATTEMPTS = 5; var SECONDS_TO_WAIT_FOR_PROXY = 5; var MAX_FUNCTIONS_ROUTES_RULES = 100; var MAX_FUNCTIONS_ROUTES_RULE_LENGTH = 100; var ROUTES_SPEC_VERSION = 1; var ROUTES_SPEC_DESCRIPTION = `Generated by wrangler@${version}`; // src/pages/functions/routes-validation.ts init_import_meta_url(); function isRoutesJSONSpec(data) { return typeof data === "object" && data && "version" in data && typeof data.version === "number" && data.version === ROUTES_SPEC_VERSION && Array.isArray(data.include) && Array.isArray(data.exclude) || false; } __name(isRoutesJSONSpec, "isRoutesJSONSpec"); function validateRoutes(routesJSON, routesPath) { if (!isRoutesJSONSpec(routesJSON)) { throw new FatalError( getRoutesValidationErrorMessage( 0 /* INVALID_JSON_SPEC */, routesPath ), 1 ); } if (!hasIncludeRules(routesJSON)) { throw new FatalError( getRoutesValidationErrorMessage( 1 /* NO_INCLUDE_RULES */, routesPath ), 1 ); } if (!hasValidRulesCount(routesJSON)) { throw new FatalError( getRoutesValidationErrorMessage( 3 /* TOO_MANY_RULES */, routesPath ), 1 ); } if (!hasValidRuleCharCount(routesJSON)) { throw new FatalError( getRoutesValidationErrorMessage( 4 /* RULE_TOO_LONG */, routesPath ), 1 ); } if (!hasValidRules(routesJSON)) { throw new FatalError( getRoutesValidationErrorMessage( 2 /* INVALID_RULES */, routesPath ), 1 ); } if (hasOverlappingRules(routesJSON.include) || hasOverlappingRules(routesJSON.exclude)) { throw new FatalError( getRoutesValidationErrorMessage( 5 /* OVERLAPPING_RULES */, routesPath ), 1 ); } } __name(validateRoutes, "validateRoutes"); function hasIncludeRules(routesJSON) { if (!routesJSON || !routesJSON.include) { throw new Error( "Function `hasIncludeRules` was called out of context. Attempting to validate include rules for routes that are undefined or an invalid RoutesJSONSpec" ); } return routesJSON?.include?.length > 0; } __name(hasIncludeRules, "hasIncludeRules"); function hasValidRulesCount(routesJSON) { if (!routesJSON || !routesJSON.include || !routesJSON.exclude) { throw new Error( "Function `hasValidRulesCount` was called out of context. Attempting to validate maximum rules count for routes that are undefined or an invalid RoutesJSONSpec" ); } return routesJSON.include.length + routesJSON.exclude.length <= MAX_FUNCTIONS_ROUTES_RULES; } __name(hasValidRulesCount, "hasValidRulesCount"); function hasValidRuleCharCount(routesJSON) { if (!routesJSON || !routesJSON.include || !routesJSON.exclude) { throw new Error( "Function `hasValidRuleCharCount` was called out of context. Attempting to validate rules maximum character count for routes that are undefined or an invalid RoutesJSONSpec" ); } const rules = [...routesJSON.include, ...routesJSON.exclude]; return rules.filter((rule) => rule.length > MAX_FUNCTIONS_ROUTES_RULE_LENGTH).length === 0; } __name(hasValidRuleCharCount, "hasValidRuleCharCount"); function hasValidRules(routesJSON) { if (!routesJSON || !routesJSON.include || !routesJSON.exclude) { throw new Error( "Function `hasValidRules` was called out of context. Attempting to validate rules for routes that are undefined or an invalid RoutesJSONSpec" ); } const rules = [...routesJSON.include, ...routesJSON.exclude]; return rules.filter((rule) => !rule.match(/^\//)).length === 0; } __name(hasValidRules, "hasValidRules"); function hasOverlappingRules(routes) { if (!routes) { throw new Error( "Function `hasverlappingRules` was called out of context. Attempting to validate rules for routes that are undefined" ); } const endingSplatRoutes = routes.filter((route2) => route2.endsWith("/*")); for (let i5 = 0; i5 < endingSplatRoutes.length; i5++) { const crrRoute = endingSplatRoutes[i5]; const crrRouteTrimmed = crrRoute.substring(0, crrRoute.length - 1); for (let j6 = 0; j6 < routes.length; j6++) { const nextRoute = routes[j6]; if (nextRoute !== crrRoute && nextRoute.startsWith(crrRouteTrimmed)) { return true; } } } return false; } __name(hasOverlappingRules, "hasOverlappingRules"); // src/pages/errors.ts var EXIT_CODE_FUNCTIONS_NO_ROUTES_ERROR = 156; var EXIT_CODE_FUNCTIONS_NOTHING_TO_BUILD_ERROR = 157; var EXIT_CODE_NO_CONFIG_FOUND = 158; var EXIT_CODE_INVALID_PAGES_CONFIG = 159; var FunctionsBuildError = class extends UserError { constructor(message) { super(message); } }; __name(FunctionsBuildError, "FunctionsBuildError"); var FunctionsNoRoutesError = class extends UserError { constructor(message) { super(message); } }; __name(FunctionsNoRoutesError, "FunctionsNoRoutesError"); function getFunctionsNoRoutesWarning(functionsDirectory, suffix) { return `No routes found when building Functions directory: ${functionsDirectory}${suffix ? " - " + suffix : ""}`; } __name(getFunctionsNoRoutesWarning, "getFunctionsNoRoutesWarning"); function getRoutesValidationErrorMessage(errorCode, routesPath) { switch (errorCode) { case 1 /* NO_INCLUDE_RULES */: return `Invalid _routes.json file found at: ${routesPath} Routes must have at least 1 include rule, but no include rules were detected.`; case 3 /* TOO_MANY_RULES */: return `Invalid _routes.json file found at: ${routesPath} Detected rules that are over the ${MAX_FUNCTIONS_ROUTES_RULES} rule limit. Please make sure you have a total of ${MAX_FUNCTIONS_ROUTES_RULES} include and exclude rules combined.`; case 4 /* RULE_TOO_LONG */: return `Invalid _routes.json file found at: ${routesPath} Detected rules the are over the ${MAX_FUNCTIONS_ROUTES_RULE_LENGTH} character limit. Please make sure that each include and exclude routing rule is at most ${MAX_FUNCTIONS_ROUTES_RULE_LENGTH} characters long.`; case 2 /* INVALID_RULES */: return `Invalid _routes.json file found at: ${routesPath} All rules must start with '/'.`; case 5 /* OVERLAPPING_RULES */: return `Invalid _routes.json file found at: ${routesPath} Overlapping rules found. Please make sure that rules ending with a splat (eg. "/api/*") don't overlap any other rules (eg. "/api/foo"). This applies to both include and exclude rules individually.`; case 0 /* INVALID_JSON_SPEC */: default: return `Invalid _routes.json file found at: ${routesPath} Please make sure the JSON object has the following format: { version: ${ROUTES_SPEC_VERSION}; include: string[]; exclude: string[]; } and that at least one include rule is provided. `; } } __name(getRoutesValidationErrorMessage, "getRoutesValidationErrorMessage"); // src/config/config-helpers.ts init_import_meta_url(); var import_node_fs4 = __toESM(require("node:fs")); var import_node_path8 = __toESM(require("node:path")); // ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js init_import_meta_url(); var import_node_path7 = __toESM(require("node:path"), 1); var import_node_url2 = require("node:url"); // ../../node_modules/.pnpm/locate-path@7.1.0/node_modules/locate-path/index.js init_import_meta_url(); var import_node_process2 = __toESM(require("node:process"), 1); var import_node_path6 = __toESM(require("node:path"), 1); var import_node_fs3 = __toESM(require("node:fs"), 1); var import_node_url = require("node:url"); // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js init_import_meta_url(); // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js init_import_meta_url(); // ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js init_import_meta_url(); var Node = class { value; next; constructor(value) { this.value = value; } }; __name(Node, "Node"); var Queue = class { #head; #tail; #size; constructor() { this.clear(); } enqueue(value) { const node2 = new Node(value); if (this.#head) { this.#tail.next = node2; this.#tail = node2; } else { this.#head = node2; this.#tail = node2; } this.#size++; } dequeue() { const current = this.#head; if (!current) { return; } this.#head = this.#head.next; this.#size--; return current.value; } clear() { this.#head = void 0; this.#tail = void 0; this.#size = 0; } get size() { return this.#size; } *[Symbol.iterator]() { let current = this.#head; while (current) { yield current.value; current = current.next; } } }; __name(Queue, "Queue"); // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js function pLimit(concurrency) { if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) { throw new TypeError("Expected `concurrency` to be a number from 1 and up"); } const queue = new Queue(); let activeCount = 0; const next = /* @__PURE__ */ __name(() => { activeCount--; if (queue.size > 0) { queue.dequeue()(); } }, "next"); const run2 = /* @__PURE__ */ __name(async (fn2, resolve25, args) => { activeCount++; const result = (async () => fn2(...args))(); resolve25(result); try { await result; } catch { } next(); }, "run"); const enqueue = /* @__PURE__ */ __name((fn2, resolve25, args) => { queue.enqueue(run2.bind(void 0, fn2, resolve25, args)); (async () => { await Promise.resolve(); if (activeCount < concurrency && queue.size > 0) { queue.dequeue()(); } })(); }, "enqueue"); const generator = /* @__PURE__ */ __name((fn2, ...args) => new Promise((resolve25) => { enqueue(fn2, resolve25, args); }), "generator"); Object.defineProperties(generator, { activeCount: { get: () => activeCount }, pendingCount: { get: () => queue.size }, clearQueue: { value: () => { queue.clear(); } } }); return generator; } __name(pLimit, "pLimit"); // ../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js var EndError = class extends Error { constructor(value) { super(); this.value = value; } }; __name(EndError, "EndError"); var testElement = /* @__PURE__ */ __name(async (element, tester) => tester(await element), "testElement"); var finder = /* @__PURE__ */ __name(async (element) => { const values = await Promise.all(element); if (values[1] === true) { throw new EndError(values[0]); } return false; }, "finder"); async function pLocate(iterable, tester, { concurrency = Number.POSITIVE_INFINITY, preserveOrder = true } = {}) { const limit = pLimit(concurrency); const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]); const checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY); try { await Promise.all(items.map((element) => checkLimit(finder, element))); } catch (error2) { if (error2 instanceof EndError) { return error2.value; } throw error2; } } __name(pLocate, "pLocate"); // ../../node_modules/.pnpm/locate-path@7.1.0/node_modules/locate-path/index.js var typeMappings = { directory: "isDirectory", file: "isFile" }; function checkType(type) { if (type in typeMappings) { return; } throw new Error(`Invalid type specified: ${type}`); } __name(checkType, "checkType"); var matchType = /* @__PURE__ */ __name((type, stat9) => type === void 0 || stat9[typeMappings[type]](), "matchType"); var toPath = /* @__PURE__ */ __name((urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath, "toPath"); async function locatePath(paths, { cwd: cwd2 = import_node_process2.default.cwd(), type = "file", allowSymlinks = true, concurrency, preserveOrder } = {}) { checkType(type); cwd2 = toPath(cwd2); const statFunction = allowSymlinks ? import_node_fs3.promises.stat : import_node_fs3.promises.lstat; return pLocate(paths, async (path_) => { try { const stat9 = await statFunction(import_node_path6.default.resolve(cwd2, path_)); return matchType(type, stat9); } catch { return false; } }, { concurrency, preserveOrder }); } __name(locatePath, "locatePath"); function locatePathSync(paths, { cwd: cwd2 = import_node_process2.default.cwd(), type = "file", allowSymlinks = true } = {}) { checkType(type); cwd2 = toPath(cwd2); const statFunction = allowSymlinks ? import_node_fs3.default.statSync : import_node_fs3.default.lstatSync; for (const path_ of paths) { try { const stat9 = statFunction(import_node_path6.default.resolve(cwd2, path_)); if (matchType(type, stat9)) { return path_; } } catch { } } } __name(locatePathSync, "locatePathSync"); // ../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js init_import_meta_url(); // ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js var toPath2 = /* @__PURE__ */ __name((urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url2.fileURLToPath)(urlOrPath) : urlOrPath, "toPath"); var findUpStop = Symbol("findUpStop"); async function findUpMultiple(name2, options32 = {}) { let directory = import_node_path7.default.resolve(toPath2(options32.cwd) || ""); const { root } = import_node_path7.default.parse(directory); const stopAt = import_node_path7.default.resolve(directory, options32.stopAt || root); const limit = options32.limit || Number.POSITIVE_INFINITY; const paths = [name2].flat(); const runMatcher = /* @__PURE__ */ __name(async (locateOptions) => { if (typeof name2 !== "function") { return locatePath(paths, locateOptions); } const foundPath = await name2(locateOptions.cwd); if (typeof foundPath === "string") { return locatePath([foundPath], locateOptions); } return foundPath; }, "runMatcher"); const matches = []; while (true) { const foundPath = await runMatcher({ ...options32, cwd: directory }); if (foundPath === findUpStop) { break; } if (foundPath) { matches.push(import_node_path7.default.resolve(directory, foundPath)); } if (directory === stopAt || matches.length >= limit) { break; } directory = import_node_path7.default.dirname(directory); } return matches; } __name(findUpMultiple, "findUpMultiple"); function findUpMultipleSync(name2, options32 = {}) { let directory = import_node_path7.default.resolve(toPath2(options32.cwd) || ""); const { root } = import_node_path7.default.parse(directory); const stopAt = options32.stopAt || root; const limit = options32.limit || Number.POSITIVE_INFINITY; const paths = [name2].flat(); const runMatcher = /* @__PURE__ */ __name((locateOptions) => { if (typeof name2 !== "function") { return locatePathSync(paths, locateOptions); } const foundPath = name2(locateOptions.cwd); if (typeof foundPath === "string") { return locatePathSync([foundPath], locateOptions); } return foundPath; }, "runMatcher"); const matches = []; while (true) { const foundPath = runMatcher({ ...options32, cwd: directory }); if (foundPath === findUpStop) { break; } if (foundPath) { matches.push(import_node_path7.default.resolve(directory, foundPath)); } if (directory === stopAt || matches.length >= limit) { break; } directory = import_node_path7.default.dirname(directory); } return matches; } __name(findUpMultipleSync, "findUpMultipleSync"); async function findUp(name2, options32 = {}) { const matches = await findUpMultiple(name2, { ...options32, limit: 1 }); return matches[0]; } __name(findUp, "findUp"); function findUpSync(name2, options32 = {}) { const matches = findUpMultipleSync(name2, { ...options32, limit: 1 }); return matches[0]; } __name(findUpSync, "findUpSync"); // ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js init_import_meta_url(); function dedent(templ) { var values = []; for (var _i = 1; _i < arguments.length; _i++) { values[_i - 1] = arguments[_i]; } var strings = Array.from(typeof templ === "string" ? [templ] : templ); strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, ""); var indentLengths = strings.reduce(function(arr, str) { var matches = str.match(/\n([\t ]+|(?!\s).)/g); if (matches) { return arr.concat(matches.map(function(match2) { var _a3, _b2; return (_b2 = (_a3 = match2.match(/[\t ]/g)) === null || _a3 === void 0 ? void 0 : _a3.length) !== null && _b2 !== void 0 ? _b2 : 0; })); } return arr; }, []); if (indentLengths.length) { var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g"); strings = strings.map(function(str) { return str.replace(pattern_1, "\n"); }); } strings[0] = strings[0].replace(/^\r?\n/, ""); var string = strings[0]; values.forEach(function(value, i5) { var endentations = string.match(/(?:^|\n)( *)$/); var endentation = endentations ? endentations[1] : ""; var indentedValue = value; if (typeof value === "string" && value.includes("\n")) { indentedValue = String(value).split("\n").map(function(str, i6) { return i6 === 0 ? str : "" + endentation + str; }).join("\n"); } string += indentedValue + strings[i5 + 1]; }); return string; } __name(dedent, "dedent"); var esm_default2 = dedent; // src/config/config-helpers.ts function resolveWranglerConfigPath({ config, script }, options32) { if (config !== void 0) { return { userConfigPath: config, configPath: config }; } const leafPath = script !== void 0 ? import_node_path8.default.dirname(script) : process.cwd(); return findWranglerConfig(leafPath, options32); } __name(resolveWranglerConfigPath, "resolveWranglerConfigPath"); function findWranglerConfig(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) { const userConfigPath = findUpSync(`wrangler.json`, { cwd: referencePath }) ?? findUpSync(`wrangler.jsonc`, { cwd: referencePath }) ?? findUpSync(`wrangler.toml`, { cwd: referencePath }); return { userConfigPath, configPath: useRedirectIfAvailable ? findRedirectedWranglerConfig(referencePath, userConfigPath) : userConfigPath }; } __name(findWranglerConfig, "findWranglerConfig"); function findRedirectedWranglerConfig(cwd2, userConfigPath) { const PATH_TO_DEPLOY_CONFIG = ".wrangler/deploy/config.json"; const deployConfigPath = findUpSync(PATH_TO_DEPLOY_CONFIG, { cwd: cwd2 }); if (deployConfigPath === void 0) { return userConfigPath; } let redirectedConfigPath; const deployConfigFile = readFileSync5(deployConfigPath); try { const deployConfig = parseJSONC(deployConfigFile, deployConfigPath); redirectedConfigPath = deployConfig.configPath && import_node_path8.default.resolve(import_node_path8.default.dirname(deployConfigPath), deployConfig.configPath); } catch (e7) { throw new UserError( esm_default2` Failed to parse the deploy configuration file at ${import_node_path8.default.relative(".", deployConfigPath)} ${e7 instanceof ParseError ? formatMessage(e7) : e7} ` ); } if (!redirectedConfigPath) { throw new UserError(esm_default2` A deploy configuration file was found at "${import_node_path8.default.relative(".", deployConfigPath)}". But this is not valid - the required "configPath" property was not found. Instead this file contains: \`\`\` ${deployConfigFile} \`\`\` `); } if (redirectedConfigPath) { if (!import_node_fs4.default.existsSync(redirectedConfigPath)) { throw new UserError(esm_default2` There is a deploy configuration at "${import_node_path8.default.relative(".", deployConfigPath)}". But the redirected configuration path it points to, "${import_node_path8.default.relative(".", redirectedConfigPath)}", does not exist. `); } if (userConfigPath) { if (import_node_path8.default.join(import_node_path8.default.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) { throw new UserError(esm_default2` Found both a user configuration file at "${import_node_path8.default.relative(".", userConfigPath)}" and a deploy configuration file at "${import_node_path8.default.relative(".", deployConfigPath)}". But these do not share the same base path so it is not clear which should be used. `); } } logger.info(esm_default2` Using redirected Wrangler configuration. - Configuration being used: "${import_node_path8.default.relative(".", redirectedConfigPath)}" - Original user's configuration: "${userConfigPath ? import_node_path8.default.relative(".", userConfigPath) : ""}" - Deploy configuration file: "${import_node_path8.default.relative(".", deployConfigPath)}" `); return redirectedConfigPath; } } __name(findRedirectedWranglerConfig, "findRedirectedWranglerConfig"); // src/config/validation.ts init_import_meta_url(); var import_node_assert = __toESM(require("node:assert")); var import_node_path10 = __toESM(require("node:path")); var import_toml2 = __toESM(require_toml()); // src/experimental-flags.ts init_import_meta_url(); var import_async_hooks = require("async_hooks"); var flags = new import_async_hooks.AsyncLocalStorage(); var run = /* @__PURE__ */ __name((flagValues, cb2) => flags.run(flagValues, cb2), "run"); var getFlag = /* @__PURE__ */ __name((flag) => { const store = flags.getStore(); if (store === void 0) { logger.debug("No experimental flag store instantiated"); } const value = flags.getStore()?.[flag]; if (value === void 0) { logger.debug( `Attempted to use flag "${flag}" which has not been instantiated` ); } return value; }, "getFlag"); // src/r2/helpers.ts init_import_meta_url(); var fs5 = __toESM(require("node:fs")); var import_web = require("node:stream/web"); var import_miniflare2 = require("miniflare"); // ../../node_modules/.pnpm/pretty-bytes@6.1.1/node_modules/pretty-bytes/index.js init_import_meta_url(); var BYTE_UNITS = [ "B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" ]; var BIBYTE_UNITS = [ "B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB" ]; var BIT_UNITS = [ "b", "kbit", "Mbit", "Gbit", "Tbit", "Pbit", "Ebit", "Zbit", "Ybit" ]; var BIBIT_UNITS = [ "b", "kibit", "Mibit", "Gibit", "Tibit", "Pibit", "Eibit", "Zibit", "Yibit" ]; var toLocaleString = /* @__PURE__ */ __name((number, locale, options32) => { let result = number; if (typeof locale === "string" || Array.isArray(locale)) { result = number.toLocaleString(locale, options32); } else if (locale === true || options32 !== void 0) { result = number.toLocaleString(void 0, options32); } return result; }, "toLocaleString"); function prettyBytes(number, options32) { if (!Number.isFinite(number)) { throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`); } options32 = { bits: false, binary: false, space: true, ...options32 }; const UNITS2 = options32.bits ? options32.binary ? BIBIT_UNITS : BIT_UNITS : options32.binary ? BIBYTE_UNITS : BYTE_UNITS; const separator = options32.space ? " " : ""; if (options32.signed && number === 0) { return ` 0${separator}${UNITS2[0]}`; } const isNegative2 = number < 0; const prefix = isNegative2 ? "-" : options32.signed ? "+" : ""; if (isNegative2) { number = -number; } let localeOptions; if (options32.minimumFractionDigits !== void 0) { localeOptions = { minimumFractionDigits: options32.minimumFractionDigits }; } if (options32.maximumFractionDigits !== void 0) { localeOptions = { maximumFractionDigits: options32.maximumFractionDigits, ...localeOptions }; } if (number < 1) { const numberString2 = toLocaleString(number, options32.locale, localeOptions); return prefix + numberString2 + separator + UNITS2[0]; } const exponent = Math.min(Math.floor(options32.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS2.length - 1); number /= (options32.binary ? 1024 : 1e3) ** exponent; if (!localeOptions) { number = number.toPrecision(3); } const numberString = toLocaleString(Number(number), options32.locale, localeOptions); const unit = UNITS2[exponent]; return prefix + numberString + separator + unit; } __name(prettyBytes, "prettyBytes"); // src/cfetch/index.ts init_import_meta_url(); var import_node_url3 = require("node:url"); // src/cfetch/errors.ts init_import_meta_url(); function buildDetailedError(message, ...extra) { return new ParseError({ text: message, notes: extra.map((text) => ({ text })) }); } __name(buildDetailedError, "buildDetailedError"); function maybeThrowFriendlyError(error2) { if (error2.message === "workers.api.error.email_verification_required") { throw buildDetailedError( "Please verify your account's email address and try again.", "Check your email for a verification link, or login to https://dash.cloudflare.com and request a new one." ); } } __name(maybeThrowFriendlyError, "maybeThrowFriendlyError"); // src/cfetch/index.ts async function fetchResult(resource, init2 = {}, queryParams, abortSignal) { const json = await fetchInternal( resource, init2, queryParams, abortSignal ); if (json.success) { return json.result; } else { throwFetchError(resource, json); } } __name(fetchResult, "fetchResult"); async function fetchGraphqlResult(init2 = {}, abortSignal) { const json = await fetchInternal( "/graphql", { ...init2, method: "POST" }, //Cloudflare API v4 doesn't allow GETs to /graphql void 0, abortSignal ); if (json) { return json; } else { throw new Error("A request to the Cloudflare API (/graphql) failed."); } } __name(fetchGraphqlResult, "fetchGraphqlResult"); async function fetchListResult(resource, init2 = {}, queryParams) { const results = []; let getMoreResults = true; let cursor; while (getMoreResults) { if (cursor) { queryParams = new import_node_url3.URLSearchParams(queryParams); queryParams.set("cursor", cursor); } const json = await fetchInternal( resource, init2, queryParams ); if (json.success) { results.push(...json.result); if (hasCursor(json.result_info)) { cursor = json.result_info?.cursor; } else { getMoreResults = false; } } else { throwFetchError(resource, json); } } return results; } __name(fetchListResult, "fetchListResult"); async function fetchPagedListResult(resource, init2 = {}, queryParams) { const results = []; let getMoreResults = true; let page = 1; while (getMoreResults) { queryParams = new import_node_url3.URLSearchParams(queryParams); queryParams.set("page", String(page)); const json = await fetchInternal( resource, init2, queryParams ); if (json.success) { results.push(...json.result); if (hasMorePages(json.result_info)) { page = page + 1; } else { getMoreResults = false; } } else { throwFetchError(resource, json); } } return results; } __name(fetchPagedListResult, "fetchPagedListResult"); function hasMorePages(result_info) { const page = result_info?.page; const per_page = result_info?.per_page; const total = result_info?.total_count; return page !== void 0 && per_page !== void 0 && total !== void 0 && page * per_page < total; } __name(hasMorePages, "hasMorePages"); function throwFetchError(resource, response) { if (typeof vitest !== "undefined" && !("errors" in response)) { throw response; } for (const error3 of response.errors) { maybeThrowFriendlyError(error3); } const error2 = new APIError({ text: `A request to the Cloudflare API (${resource}) failed.`, notes: [ ...response.errors.map((err) => ({ text: renderError(err) })), ...response.messages?.map((text) => ({ text })) ?? [] ] }); const code = response.errors[0]?.code; if (code) { error2.code = code; } error2.accountTag = extractAccountTag(resource); throw error2; } __name(throwFetchError, "throwFetchError"); function extractAccountTag(resource) { const re = new RegExp("/accounts/([a-zA-Z0-9]+)/?"); const matches = re.exec(resource); return matches?.[1]; } __name(extractAccountTag, "extractAccountTag"); function hasCursor(result_info) { const cursor = result_info?.cursor; return cursor !== void 0 && cursor !== null && cursor !== ""; } __name(hasCursor, "hasCursor"); function renderError(err, level = 0) { const indent = " ".repeat(level); const chainedMessages = err.error_chain?.map( (chainedError) => ` ${indent}- ${renderError(chainedError, level + 1)}` ).join("\n") ?? ""; return (err.code ? `${err.message} [code: ${err.code}]` : err.message) + (err.documentation_url ? ` ${indent}To learn more about this error, visit: ${err.documentation_url}` : "") + chainedMessages; } __name(renderError, "renderError"); // src/dev/get-local-persistence-path.ts init_import_meta_url(); var import_node_path9 = __toESM(require("node:path")); function getLocalPersistencePath(persistTo, { userConfigPath }) { return persistTo ? ( // If path specified, always treat it as relative to cwd() import_node_path9.default.resolve(process.cwd(), persistTo) ) : ( // Otherwise, treat it as relative to the Wrangler configuration file, // if one can be found, otherwise cwd() import_node_path9.default.resolve( userConfigPath ? import_node_path9.default.dirname(userConfigPath) : process.cwd(), ".wrangler/state" ) ); } __name(getLocalPersistencePath, "getLocalPersistencePath"); // src/queues/client.ts init_import_meta_url(); var import_node_url4 = require("node:url"); var queuesUrl = /* @__PURE__ */ __name((accountId, queueId) => { let url4 = `/accounts/${accountId}/queues`; if (queueId) { url4 += `/${queueId}`; } return url4; }, "queuesUrl"); var queueConsumersUrl = /* @__PURE__ */ __name((accountId, queueId, consumerId) => { let url4 = `${queuesUrl(accountId, queueId)}/consumers`; if (consumerId) { url4 += `/${consumerId}`; } return url4; }, "queueConsumersUrl"); async function createQueue(config, body) { const accountId = await requireAuth(config); return fetchResult(queuesUrl(accountId), { method: "POST", body: JSON.stringify(body) }); } __name(createQueue, "createQueue"); async function updateQueue(config, body, queue_id) { const accountId = await requireAuth(config); return fetchResult(queuesUrl(accountId, queue_id), { method: "PATCH", body: JSON.stringify(body) }); } __name(updateQueue, "updateQueue"); async function deleteQueue(config, queueName) { const queue = await getQueue(config, queueName); return deleteQueueById(config, queue.queue_id); } __name(deleteQueue, "deleteQueue"); async function deleteQueueById(config, queueId) { const accountId = await requireAuth(config); return fetchResult(queuesUrl(accountId, queueId), { method: "DELETE" }); } __name(deleteQueueById, "deleteQueueById"); async function listQueues(config, page, name2) { page = page ?? 1; const accountId = await requireAuth(config); const params = new import_node_url4.URLSearchParams({ page: page.toString() }); if (name2) { params.append("name", name2); } return fetchResult(queuesUrl(accountId), {}, params); } __name(listQueues, "listQueues"); async function listAllQueues(config, queueNames) { const accountId = await requireAuth(config); const params = new import_node_url4.URLSearchParams(); queueNames.forEach((e7) => { params.append("name", e7); }); return fetchPagedListResult(queuesUrl(accountId), {}, params); } __name(listAllQueues, "listAllQueues"); async function getQueue(config, queueName) { const queues2 = await listQueues(config, 1, queueName); if (queues2.length === 0) { throw new UserError( `Queue "${queueName}" does not exist. To create it, run: wrangler queues create ${queueName}` ); } return queues2[0]; } __name(getQueue, "getQueue"); async function ensureQueuesExistByConfig(config) { const producers = (config.queues.producers || []).map( (producer) => producer.queue ); const consumers2 = (config.queues.consumers || []).map( (consumer) => consumer.queue ); const queueNames = producers.concat(consumers2); await ensureQueuesExist(config, queueNames); } __name(ensureQueuesExistByConfig, "ensureQueuesExistByConfig"); async function ensureQueuesExist(config, queueNames) { if (queueNames.length > 0) { const existingQueues = (await listAllQueues(config, queueNames)).map( (q6) => q6.queue_name ); if (queueNames.length !== existingQueues.length) { const queueSet = new Set(existingQueues); for (const queue of queueNames) { if (!queueSet.has(queue)) { throw new UserError( `Queue "${queue}" does not exist. To create it, run: wrangler queues create ${queue}` ); } } } } } __name(ensureQueuesExist, "ensureQueuesExist"); async function getQueueById(accountId, queueId) { return fetchResult(queuesUrl(accountId, queueId), {}); } __name(getQueueById, "getQueueById"); async function postConsumer(config, queueName, body) { const queue = await getQueue(config, queueName); return postConsumerById(config, queue.queue_id, body); } __name(postConsumer, "postConsumer"); async function postConsumerById(config, queueId, body) { const accountId = await requireAuth(config); return fetchResult(queueConsumersUrl(accountId, queueId), { method: "POST", body: JSON.stringify(body) }); } __name(postConsumerById, "postConsumerById"); async function putConsumerById(config, queueId, consumerId, body) { const accountId = await requireAuth(config); return fetchResult(queueConsumersUrl(accountId, queueId, consumerId), { method: "PUT", body: JSON.stringify(body) }); } __name(putConsumerById, "putConsumerById"); async function putConsumer(config, queueName, scriptName, envName, body) { const queue = await getQueue(config, queueName); const targetConsumer = await resolveWorkerConsumerByName( config, scriptName, envName, queue ); return putConsumerById( config, queue.queue_id, targetConsumer.consumer_id, body ); } __name(putConsumer, "putConsumer"); async function resolveWorkerConsumerByName(config, consumerName, envName, queue) { const queueName = queue.queue_name; const consumers2 = queue.consumers.filter( (c6) => c6.type === "worker" && (c6.script === consumerName || c6.service === consumerName) ); if (consumers2.length === 0) { throw new UserError( `No worker consumer '${consumerName}' exists for queue ${queue.queue_name}` ); } if (consumers2.length > 1) { const targetEnv = envName ?? await getDefaultService(config, consumerName); const targetConsumers = consumers2.filter( (c6) => c6.environment === targetEnv ); if (targetConsumers.length === 0) { throw new UserError( `No worker consumer '${consumerName}' exists for queue ${queueName}` ); } return consumers2[0]; } if (consumers2[0].service) { const targetEnv = envName ?? await getDefaultService(config, consumerName); if (targetEnv != consumers2[0].environment) { throw new UserError( `No worker consumer '${consumerName}' exists for queue ${queueName}` ); } } return consumers2[0]; } __name(resolveWorkerConsumerByName, "resolveWorkerConsumerByName"); async function deleteConsumerById(config, queueId, consumerId) { const accountId = await requireAuth(config); return fetchResult(queueConsumersUrl(accountId, queueId, consumerId), { method: "DELETE" }); } __name(deleteConsumerById, "deleteConsumerById"); async function deletePullConsumer(config, queueName) { const queue = await getQueue(config, queueName); const consumer = queue.consumers[0]; if (consumer?.type !== "http_pull") { throw new UserError(`No http_pull consumer exists for queue ${queueName}`); } return deleteConsumerById(config, queue.queue_id, consumer.consumer_id); } __name(deletePullConsumer, "deletePullConsumer"); async function getDefaultService(config, serviceName) { const accountId = await requireAuth(config); const service = await fetchResult( `/accounts/${accountId}/workers/services/${serviceName}`, { method: "GET" } ); logger.info(service); return service.default_environment.environment; } __name(getDefaultService, "getDefaultService"); async function deleteWorkerConsumer(config, queueName, scriptName, envName) { const queue = await getQueue(config, queueName); const targetConsumer = await resolveWorkerConsumerByName( config, scriptName, envName, queue ); return deleteConsumerById(config, queue.queue_id, targetConsumer.consumer_id); } __name(deleteWorkerConsumer, "deleteWorkerConsumer"); // src/r2/helpers.ts async function listR2Buckets(accountId, jurisdiction) { const headers = {}; if (jurisdiction !== void 0) { headers["cf-r2-jurisdiction"] = jurisdiction; } const results = await fetchResult(`/accounts/${accountId}/r2/buckets`, { headers }); return results.buckets; } __name(listR2Buckets, "listR2Buckets"); function tablefromR2BucketsListResponse(buckets) { const rows = []; for (const bucket of buckets) { rows.push({ name: bucket.name, creation_date: bucket.creation_date }); } return rows; } __name(tablefromR2BucketsListResponse, "tablefromR2BucketsListResponse"); async function getR2Bucket(accountId, bucketName, jurisdiction) { const headers = {}; if (jurisdiction !== void 0) { headers["cf-r2-jurisdiction"] = jurisdiction; } const result = await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}`, { method: "GET", headers } ); return result; } __name(getR2Bucket, "getR2Bucket"); async function getR2BucketMetrics(accountId, bucketName, jurisdiction) { const today = /* @__PURE__ */ new Date(); const yesterday = new Date(new Date(today).setDate(today.getDate() - 1)); let fullBucketName = bucketName; if (jurisdiction) { fullBucketName = `${jurisdiction}_${bucketName}`; } const storageMetricsQuery = ` query getR2StorageMetrics($accountTag: String, $filter: R2StorageAdaptiveGroupsFilter_InputObject) { viewer { accounts(filter: { accountTag: $accountTag }) { r2StorageAdaptiveGroups( limit: 1 filter: $filter orderBy: [datetime_DESC] ) { max { objectCount payloadSize metadataSize } dimensions { datetime } } } } } `; const variables = { accountTag: accountId, filter: { datetime_geq: yesterday.toISOString(), datetime_leq: today.toISOString(), bucketName: fullBucketName } }; const storageMetricsResult = await fetchGraphqlResult({ method: "POST", body: JSON.stringify({ query: storageMetricsQuery, operationName: "getR2StorageMetrics", variables }), headers: { "Content-Type": "application/json" } }); if (storageMetricsResult) { const metricsData = storageMetricsResult.data?.viewer?.accounts[0]?.r2StorageAdaptiveGroups?.[0]; if (metricsData && metricsData.max) { const objectCount = metricsData.max.objectCount || 0; const totalSize = (metricsData.max.payloadSize || 0) + (metricsData.max.metadataSize || 0); return { objectCount, totalSize: prettyBytes(totalSize) }; } } return { objectCount: 0, totalSize: "0 B" }; } __name(getR2BucketMetrics, "getR2BucketMetrics"); async function createR2Bucket(accountId, bucketName, location, jurisdiction, storageClass) { const headers = {}; if (jurisdiction !== void 0) { headers["cf-r2-jurisdiction"] = jurisdiction; } return await fetchResult(`/accounts/${accountId}/r2/buckets`, { method: "POST", body: JSON.stringify({ name: bucketName, ...storageClass !== void 0 && { storageClass }, ...location !== void 0 && { locationHint: location } }), headers }); } __name(createR2Bucket, "createR2Bucket"); async function updateR2BucketStorageClass(accountId, bucketName, storageClass, jurisdiction) { const headers = {}; if (jurisdiction !== void 0) { headers["cf-r2-jurisdiction"] = jurisdiction; } headers["cf-r2-storage-class"] = storageClass; return await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}`, { method: "PATCH", headers } ); } __name(updateR2BucketStorageClass, "updateR2BucketStorageClass"); async function deleteR2Bucket(accountId, bucketName, jurisdiction) { const headers = {}; if (jurisdiction !== void 0) { headers["cf-r2-jurisdiction"] = jurisdiction; } return await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}`, { method: "DELETE", headers } ); } __name(deleteR2Bucket, "deleteR2Bucket"); function bucketAndKeyFromObjectPath(objectPath = "") { const match2 = /^(?[^/]+)\/(?.*)/.exec(objectPath); if (match2 === null || !match2.groups) { throw new UserError( `The object path must be in the form of {bucket}/{key} you provided ${objectPath}` ); } const { bucket, key } = match2.groups; if (!isValidR2BucketName(bucket)) { throw new UserError( `The bucket name "${bucket}" is invalid. ${bucketFormatMessage}` ); } return { bucket, key }; } __name(bucketAndKeyFromObjectPath, "bucketAndKeyFromObjectPath"); async function getR2Object(accountId, bucketName, objectName, jurisdiction) { const headers = {}; if (jurisdiction !== void 0) { headers["cf-r2-jurisdiction"] = jurisdiction; } const response = await fetchR2Objects( `/accounts/${accountId}/r2/buckets/${bucketName}/objects/${objectName}`, { method: "GET", headers } ); return response === null ? null : response.body; } __name(getR2Object, "getR2Object"); async function putR2Object(accountId, bucketName, objectName, object, options32, jurisdiction, storageClass) { const headerKeys = [ "content-length", "content-type", "content-disposition", "content-encoding", "content-language", "cache-control", "expires" ]; const headers = {}; for (const key of headerKeys) { const value = options32[key] || ""; if (value && typeof value === "string") { headers[key] = value; } } if (jurisdiction !== void 0) { headers["cf-r2-jurisdiction"] = jurisdiction; } if (storageClass !== void 0) { headers["cf-r2-storage-class"] = storageClass; } const result = await fetchR2Objects( `/accounts/${accountId}/r2/buckets/${bucketName}/objects/${objectName}`, { body: object, headers, method: "PUT", duplex: "half" } ); if (result === null) { throw new UserError("The specified bucket does not exist."); } } __name(putR2Object, "putR2Object"); async function deleteR2Object(accountId, bucketName, objectName, jurisdiction) { const headers = {}; if (jurisdiction !== void 0) { headers["cf-r2-jurisdiction"] = jurisdiction; } await fetchR2Objects( `/accounts/${accountId}/r2/buckets/${bucketName}/objects/${objectName}`, { method: "DELETE", headers } ); } __name(deleteR2Object, "deleteR2Object"); async function usingLocalBucket(persistTo, config, bucketName, closure) { const persist = getLocalPersistencePath(persistTo, config); const persistOptions = buildPersistOptions(persist); const mf = new import_miniflare2.Miniflare({ modules: true, // TODO(soon): import `reduceError()` from `miniflare:shared` script: ` function reduceError(e) { return { name: e?.name, message: e?.message ?? String(e), stack: e?.stack, cause: e?.cause === undefined ? undefined : reduceError(e.cause), }; } export default { async fetch(request, env, ctx) { try { if (request.method !== "PUT") return new Response(null, { status: 405 }); const url = new URL(request.url); const key = url.pathname.substring(1); const optsHeader = request.headers.get("Wrangler-R2-Put-Options"); const opts = JSON.parse(optsHeader); await env.BUCKET.put(key, request.body, opts); return new Response(null, { status: 204 }); } catch (e) { const error = reduceError(e); return Response.json(error, { status: 500, headers: { "MF-Experimental-Error-Stack": "true" }, }); } } }`, ...persistOptions, r2Buckets: { BUCKET: bucketName } }); const bucket = await mf.getR2Bucket("BUCKET"); try { return await closure(bucket, mf); } finally { await mf.dispose(); } } __name(usingLocalBucket, "usingLocalBucket"); async function getR2Sippy(accountId, bucketName, jurisdiction) { const headers = {}; if (jurisdiction !== void 0) { headers["cf-r2-jurisdiction"] = jurisdiction; } return await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}/sippy`, { method: "GET", headers } ); } __name(getR2Sippy, "getR2Sippy"); async function deleteR2Sippy(accountId, bucketName, jurisdiction) { const headers = {}; if (jurisdiction !== void 0) { headers["cf-r2-jurisdiction"] = jurisdiction; } return await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}/sippy`, { method: "DELETE", headers } ); } __name(deleteR2Sippy, "deleteR2Sippy"); async function putR2Sippy(accountId, bucketName, params, jurisdiction) { const headers = { "Content-Type": "application/json" }; if (jurisdiction !== void 0) { headers["cf-r2-jurisdiction"] = jurisdiction; } return await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}/sippy`, { method: "PUT", body: JSON.stringify(params), headers } ); } __name(putR2Sippy, "putR2Sippy"); var actionsForEventCategories = { "object-create": ["PutObject", "CompleteMultipartUpload", "CopyObject"], "object-delete": ["DeleteObject", "LifecycleDeletion"] }; function eventNotificationHeaders(apiCredentials, jurisdiction) { const headers = { "Content-Type": "application/json" }; if ("apiToken" in apiCredentials) { headers["Authorization"] = `Bearer ${apiCredentials.apiToken}`; } else { headers["X-Auth-Key"] = apiCredentials.authKey; headers["X-Auth-Email"] = apiCredentials.authEmail; } if (jurisdiction !== "") { headers["cf-r2-jurisdiction"] = jurisdiction; } return headers; } __name(eventNotificationHeaders, "eventNotificationHeaders"); function tableFromNotificationGetResponse(response) { const rows = []; for (const entry of response.queues) { for (const { prefix = "", suffix = "", actions, ruleId, createdAt = "" } of entry.rules) { rows.push({ rule_id: ruleId, created_at: createdAt, queue_name: entry.queueName, prefix: prefix || "(all prefixes)", suffix: suffix || "(all suffixes)", event_type: actions.join(",") }); } } return rows; } __name(tableFromNotificationGetResponse, "tableFromNotificationGetResponse"); async function listEventNotificationConfig(apiCredentials, accountId, bucketName, jurisdiction) { const headers = eventNotificationHeaders(apiCredentials, jurisdiction); logger.log(`Fetching notification rules for bucket ${bucketName}...`); const res = await fetchResult( `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration`, { method: "GET", headers } ); if ("bucketName" in res && "queues" in res) { return res; } const oldResult = res; const [oldBucketName, oldDetail] = Object.entries(oldResult)[0]; const newResult = { bucketName: oldBucketName, queues: await Promise.all( Object.values(oldDetail).map(async (oldQueue) => { const newQueue = { queueId: oldQueue.queue, queueName: (await getQueueById(accountId, oldQueue.queue)).queue_name, rules: oldQueue.rules.map((oldRule) => { const newRule = { ruleId: "", prefix: oldRule.prefix, suffix: oldRule.suffix, actions: oldRule.actions }; return newRule; }) }; return newQueue; }) ) }; return newResult; } __name(listEventNotificationConfig, "listEventNotificationConfig"); async function putEventNotificationConfig(config, apiCredentials, accountId, bucketName, jurisdiction, queueName, eventTypes, prefix, suffix, description) { const queue = await getQueue(config, queueName); const headers = eventNotificationHeaders(apiCredentials, jurisdiction); let actions = []; for (const et of eventTypes) { actions = actions.concat(actionsForEventCategories[et]); } const body = description === void 0 ? { rules: [{ prefix, suffix, actions }] } : { rules: [{ prefix, suffix, actions, description }] }; const ruleFor = eventTypes.map( (et) => et === "object-create" ? "creation" : "deletion" ); logger.log( `Creating event notification rule for object ${ruleFor.join( " and " )} (${actions.join(",")})` ); return await fetchResult( `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration/queues/${queue.queue_id}`, { method: "PUT", body: JSON.stringify(body), headers } ); } __name(putEventNotificationConfig, "putEventNotificationConfig"); async function deleteEventNotificationConfig(config, apiCredentials, accountId, bucketName, jurisdiction, queueName, ruleId) { const queue = await getQueue(config, queueName); const headers = eventNotificationHeaders(apiCredentials, jurisdiction); if (ruleId !== void 0) { logger.log(`Deleting event notifications rule "${ruleId}"...`); const body = ruleId !== void 0 ? { ruleIds: [ruleId] } : {}; return await fetchResult( `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration/queues/${queue.queue_id}`, { method: "DELETE", body: JSON.stringify(body), headers } ); } else { logger.log( `Deleting event notification rules associated with queue ${queueName}...` ); return await fetchResult( `/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration/queues/${queue.queue_id}`, { method: "DELETE", headers } ); } } __name(deleteEventNotificationConfig, "deleteEventNotificationConfig"); async function getCustomDomain(accountId, bucketName, domainName, jurisdiction) { const headers = {}; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } const result = await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom/${domainName}`, { method: "GET", headers } ); return result; } __name(getCustomDomain, "getCustomDomain"); async function attachCustomDomainToBucket(accountId, bucketName, config, jurisdiction) { const headers = { "Content-Type": "application/json" }; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom`, { method: "POST", headers, body: JSON.stringify({ ...config, enabled: true }) } ); } __name(attachCustomDomainToBucket, "attachCustomDomainToBucket"); async function removeCustomDomainFromBucket(accountId, bucketName, domainName, jurisdiction) { const headers = {}; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom/${domainName}`, { method: "DELETE", headers } ); } __name(removeCustomDomainFromBucket, "removeCustomDomainFromBucket"); function tableFromCustomDomainListResponse(domains) { const rows = []; for (const domainInfo of domains) { rows.push({ domain: domainInfo.domain, enabled: domainInfo.enabled ? "Yes" : "No", ownership_status: domainInfo.status.ownership || "(unknown)", ssl_status: domainInfo.status.ssl || "(unknown)", min_tls_version: domainInfo.minTLS || "1.0", zone_id: domainInfo.zoneId || "(none)", zone_name: domainInfo.zoneName || "(none)" }); } return rows; } __name(tableFromCustomDomainListResponse, "tableFromCustomDomainListResponse"); async function listCustomDomainsOfBucket(accountId, bucketName, jurisdiction) { const headers = {}; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } const result = await fetchResult(`/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom`, { method: "GET", headers }); return result.domains; } __name(listCustomDomainsOfBucket, "listCustomDomainsOfBucket"); async function configureCustomDomainSettings(accountId, bucketName, domainName, config, jurisdiction) { const headers = { "Content-Type": "application/json" }; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}/domains/custom/${domainName}`, { method: "PUT", headers, body: JSON.stringify(config) } ); } __name(configureCustomDomainSettings, "configureCustomDomainSettings"); async function getR2DevDomain(accountId, bucketName, jurisdiction) { const headers = {}; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } const result = await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}/domains/managed`, { method: "GET", headers } ); return result; } __name(getR2DevDomain, "getR2DevDomain"); async function updateR2DevDomain(accountId, bucketName, enabled, jurisdiction) { const headers = { "Content-Type": "application/json" }; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } const result = await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}/domains/managed`, { method: "PUT", headers, body: JSON.stringify({ enabled }) } ); return result; } __name(updateR2DevDomain, "updateR2DevDomain"); function formatCondition(condition) { if (condition.type === "Age" && typeof condition.maxAge === "number") { const days = condition.maxAge / 86400; return `after ${days} days`; } else if (condition.type === "Date" && condition.date) { const date = new Date(condition.date); const displayDate = date.toISOString().split("T")[0]; return `on ${displayDate}`; } return ""; } __name(formatCondition, "formatCondition"); function tableFromLifecycleRulesResponse(rules) { const rows = []; for (const rule of rules) { const actions = []; if (rule.deleteObjectsTransition) { const action = "Expire objects"; const condition = formatCondition(rule.deleteObjectsTransition.condition); actions.push(`${action} ${condition}`); } if (rule.storageClassTransitions && rule.storageClassTransitions.length > 0) { for (const transition of rule.storageClassTransitions) { const action = "Transition to Infrequent Access"; const condition = formatCondition(transition.condition); actions.push(`${action} ${condition}`); } } if (rule.abortMultipartUploadsTransition) { const action = "Abort incomplete multipart uploads"; const condition = formatCondition( rule.abortMultipartUploadsTransition.condition ); actions.push(`${action} ${condition}`); } rows.push({ name: rule.id, enabled: rule.enabled ? "Yes" : "No", prefix: rule.conditions.prefix || "(all prefixes)", action: actions.join(", ") || "(none)" }); } return rows; } __name(tableFromLifecycleRulesResponse, "tableFromLifecycleRulesResponse"); async function getLifecycleRules(accountId, bucket, jurisdiction) { const headers = {}; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } const result = await fetchResult( `/accounts/${accountId}/r2/buckets/${bucket}/lifecycle`, { method: "GET", headers } ); return result.rules; } __name(getLifecycleRules, "getLifecycleRules"); async function putLifecycleRules(accountId, bucket, rules, jurisdiction) { const headers = { "Content-Type": "application/json" }; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } await fetchResult(`/accounts/${accountId}/r2/buckets/${bucket}/lifecycle`, { method: "PUT", headers, body: JSON.stringify({ rules }) }); } __name(putLifecycleRules, "putLifecycleRules"); function tableFromBucketLockRulesResponse(rules) { const rows = []; for (const rule of rules) { const conditionString = formatLockCondition(rule.condition); rows.push({ name: rule.id, enabled: rule.enabled ? "Yes" : "No", prefix: rule.prefix || "(all prefixes)", condition: conditionString }); } return rows; } __name(tableFromBucketLockRulesResponse, "tableFromBucketLockRulesResponse"); function formatLockCondition(condition) { if (condition.type === "Age" && typeof condition.maxAgeSeconds === "number") { const days = condition.maxAgeSeconds / 86400; if (days == 1) { return `after ${days} day`; } else { return `after ${days} days`; } } else if (condition.type === "Date" && condition.date) { const date = new Date(condition.date); const displayDate = date.toISOString().split("T")[0]; return `on ${displayDate}`; } return `indefinitely`; } __name(formatLockCondition, "formatLockCondition"); async function getBucketLockRules(accountId, bucket, jurisdiction) { const headers = {}; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } const result = await fetchResult( `/accounts/${accountId}/r2/buckets/${bucket}/lock`, { method: "GET", headers } ); return result.rules; } __name(getBucketLockRules, "getBucketLockRules"); async function putBucketLockRules(accountId, bucket, rules, jurisdiction) { const headers = { "Content-Type": "application/json" }; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } await fetchResult(`/accounts/${accountId}/r2/buckets/${bucket}/lock`, { method: "PUT", headers, body: JSON.stringify({ rules }) }); } __name(putBucketLockRules, "putBucketLockRules"); function formatActionDescription(action) { switch (action) { case "expire": return "expire objects"; case "transition": return "transition to Infrequent Access storage class"; case "abort-multipart": return "abort incomplete multipart uploads"; default: return action; } } __name(formatActionDescription, "formatActionDescription"); function isValidDate(dateString) { const regex2 = /^\d{4}-\d{2}-\d{2}$/; if (!regex2.test(dateString)) { return false; } const date = /* @__PURE__ */ new Date(`${dateString}T00:00:00.000Z`); const timestamp = date.getTime(); if (isNaN(timestamp)) { return false; } const [year2, month2, day2] = dateString.split("-").map(Number); return date.getUTCFullYear() === year2 && date.getUTCMonth() + 1 === month2 && date.getUTCDate() === day2; } __name(isValidDate, "isValidDate"); function isNonNegativeNumber(str) { if (str === "") { return false; } const num = Number(str); return num >= 0; } __name(isNonNegativeNumber, "isNonNegativeNumber"); async function getCORSPolicy(accountId, bucketName, jurisdiction) { const headers = {}; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } const result = await fetchResult( `/accounts/${accountId}/r2/buckets/${bucketName}/cors`, { method: "GET", headers } ); return result.rules; } __name(getCORSPolicy, "getCORSPolicy"); function tableFromCORSPolicyResponse(rules) { const rows = []; for (const rule of rules) { rows.push({ allowed_origins: rule.allowed?.origins?.join(", ") || "(no origins)", allowed_methods: rule.allowed?.methods?.join(", ") || "(no methods)", allowed_headers: rule.allowed?.headers?.join(", ") || "(no headers)", exposed_headers: rule.exposeHeaders?.join(", ") || "(no exposed headers)", max_age_seconds: rule.maxAgeSeconds?.toString() || "(0 seconds)" }); } return rows; } __name(tableFromCORSPolicyResponse, "tableFromCORSPolicyResponse"); async function putCORSPolicy(accountId, bucketName, rules, jurisdiction) { const headers = { "Content-Type": "application/json" }; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } await fetchResult(`/accounts/${accountId}/r2/buckets/${bucketName}/cors`, { method: "PUT", headers, body: JSON.stringify({ rules }) }); } __name(putCORSPolicy, "putCORSPolicy"); async function deleteCORSPolicy(accountId, bucketName, jurisdiction) { const headers = {}; if (jurisdiction) { headers["cf-r2-jurisdiction"] = jurisdiction; } await fetchResult(`/accounts/${accountId}/r2/buckets/${bucketName}/cors`, { method: "DELETE", headers }); } __name(deleteCORSPolicy, "deleteCORSPolicy"); function isValidR2BucketName(name2) { return typeof name2 === "string" && /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/.test(name2); } __name(isValidR2BucketName, "isValidR2BucketName"); var bucketFormatMessage = `Bucket names must begin and end with an alphanumeric character, only contain lowercase letters, numbers, and hyphens, and be between 3 and 63 characters long.`; var CHUNK_SIZE = 1024; async function createFileReadableStream(filePath) { const handle = await fs5.promises.open(filePath, "r"); let position = 0; return new import_web.ReadableStream({ async pull(controller) { const buffer = new Uint8Array(CHUNK_SIZE); const { bytesRead } = await handle.read(buffer, 0, CHUNK_SIZE, position); if (bytesRead === 0) { await handle.close(); controller.close(); } else { position += bytesRead; controller.enqueue(buffer.subarray(0, bytesRead)); } }, cancel() { return handle.close(); } }); } __name(createFileReadableStream, "createFileReadableStream"); // src/utils/print-bindings.ts init_import_meta_url(); var friendlyBindingNames = { data_blobs: "Data Blobs", durable_objects: "Durable Objects", kv_namespaces: "KV Namespaces", send_email: "Send Email", queues: "Queues", d1_databases: "D1 Databases", vectorize: "Vectorize Indexes", hyperdrive: "Hyperdrive Configs", r2_buckets: "R2 Buckets", logfwdr: "logfwdr", services: "Services", analytics_engine_datasets: "Analytics Engine Datasets", text_blobs: "Text Blobs", browser: "Browser", ai: "AI", images: "Images", version_metadata: "Worker Version Metadata", unsafe: "Unsafe Metadata", vars: "Vars", wasm_modules: "Wasm Modules", dispatch_namespaces: "Dispatch Namespaces", mtls_certificates: "mTLS Certificates", workflows: "Workflows", pipelines: "Pipelines", assets: "Assets" }; function printBindings(bindings, context2 = {}) { let hasConnectionStatus = false; const addSuffix = createAddSuffix({ isProvisioning: context2.provisioning, isLocalDev: context2.local }); const truncate4 = /* @__PURE__ */ __name((item) => { const s5 = typeof item === "string" ? item : JSON.stringify(item); const maxLength = 40; if (s5.length < maxLength) { return s5; } return `${s5.substring(0, maxLength - 3)}...`; }, "truncate"); const output = []; const { data_blobs, durable_objects, workflows, kv_namespaces, send_email, queues: queues2, d1_databases, vectorize: vectorize2, hyperdrive: hyperdrive2, r2_buckets, logfwdr, services, analytics_engine_datasets, text_blobs, browser, images, ai: ai3, version_metadata, unsafe, vars, wasm_modules, dispatch_namespaces, mtls_certificates, pipelines: pipelines2 } = bindings; if (data_blobs !== void 0 && Object.keys(data_blobs).length > 0) { output.push({ name: friendlyBindingNames.data_blobs, entries: Object.entries(data_blobs).map(([key, value]) => ({ key, value: typeof value === "string" ? truncate4(value) : "" })) }); } if (durable_objects !== void 0 && durable_objects.bindings.length > 0) { output.push({ name: friendlyBindingNames.durable_objects, entries: durable_objects.bindings.map( ({ name: name2, class_name, script_name }) => { let value = class_name; if (script_name) { if (context2.local && context2.registry !== null) { const registryDefinition = context2.registry?.[script_name]; hasConnectionStatus = true; if (registryDefinition && registryDefinition.durableObjects.some( (d6) => d6.className === class_name )) { value += ` (defined in ${script_name} ${source_default.green("[connected]")})`; } else { value += ` (defined in ${script_name} ${source_default.red("[not connected]")})`; } } else { value += ` (defined in ${script_name})`; } } return { key: name2, value }; } ) }); } if (workflows !== void 0 && workflows.length > 0) { output.push({ name: friendlyBindingNames.workflows, entries: workflows.map(({ class_name, script_name, binding }) => { let value = class_name; if (script_name) { value += ` (defined in ${script_name})`; } return { key: binding, value: script_name ? value : addSuffix(value) }; }) }); } if (kv_namespaces !== void 0 && kv_namespaces.length > 0) { output.push({ name: friendlyBindingNames.kv_namespaces, entries: kv_namespaces.map(({ binding, id }) => { return { key: binding, value: addSuffix(id, { isSimulatedLocally: true }) }; }) }); } if (send_email !== void 0 && send_email.length > 0) { output.push({ name: friendlyBindingNames.send_email, entries: send_email.map( ({ name: name2, destination_address, allowed_destination_addresses }) => { return { key: name2, value: addSuffix( destination_address || allowed_destination_addresses?.join(", ") || "unrestricted" ) }; } ) }); } if (queues2 !== void 0 && queues2.length > 0) { output.push({ name: friendlyBindingNames.queues, entries: queues2.map(({ binding, queue_name }) => { return { key: binding, value: addSuffix(queue_name, { isSimulatedLocally: true }) }; }) }); } if (d1_databases !== void 0 && d1_databases.length > 0) { output.push({ name: friendlyBindingNames.d1_databases, entries: d1_databases.map( ({ binding, database_name, database_id, preview_database_id }) => { const remoteDatabaseId = typeof database_id === "string" ? database_id : null; let databaseValue = remoteDatabaseId && database_name ? `${database_name} (${remoteDatabaseId})` : remoteDatabaseId ?? database_name; if (preview_database_id && database_id !== "local") { databaseValue = `${databaseValue ? `${databaseValue}, ` : ""}Preview: (${preview_database_id})`; } return { key: binding, value: addSuffix(databaseValue, { isSimulatedLocally: true }) }; } ) }); } if (vectorize2 !== void 0 && vectorize2.length > 0) { output.push({ name: friendlyBindingNames.vectorize, entries: vectorize2.map(({ binding, index_name }) => { return { key: binding, value: addSuffix(index_name) }; }) }); } if (hyperdrive2 !== void 0 && hyperdrive2.length > 0) { output.push({ name: friendlyBindingNames.hyperdrive, entries: hyperdrive2.map(({ binding, id }) => { return { key: binding, value: addSuffix(id, { isSimulatedLocally: true }) }; }) }); } if (r2_buckets !== void 0 && r2_buckets.length > 0) { output.push({ name: friendlyBindingNames.r2_buckets, entries: r2_buckets.map(({ binding, bucket_name, jurisdiction }) => { let name2 = typeof bucket_name === "string" ? bucket_name : ""; if (jurisdiction !== void 0) { name2 += ` (${jurisdiction})`; } return { key: binding, value: addSuffix(name2, { isSimulatedLocally: true }) }; }) }); } if (logfwdr !== void 0 && logfwdr.bindings.length > 0) { output.push({ name: friendlyBindingNames.logfwdr, entries: logfwdr.bindings.map((binding) => { return { key: binding.name, value: addSuffix(binding.destination) }; }) }); } if (services !== void 0 && services.length > 0) { output.push({ name: friendlyBindingNames.services, entries: services.map(({ binding, service, entrypoint }) => { const isSelfBinding = service === context2.name; let value = service; if (entrypoint) { value += `#${entrypoint}`; } if (isSelfBinding) { value = value + " " + source_default.green("[connected]"); } else if (context2.local && context2.registry !== null) { const registryDefinition = context2.registry?.[service]; hasConnectionStatus = true; if (registryDefinition && (!entrypoint || registryDefinition.entrypointAddresses?.[entrypoint])) { value = value + " " + source_default.green("[connected]"); } else { value = value + " " + source_default.red("[not connected]"); } } return { key: binding, value }; }) }); } if (analytics_engine_datasets !== void 0 && analytics_engine_datasets.length > 0) { output.push({ name: friendlyBindingNames.analytics_engine_datasets, entries: analytics_engine_datasets.map(({ binding, dataset }) => { return { key: binding, value: addSuffix(dataset ?? binding) }; }) }); } if (text_blobs !== void 0 && Object.keys(text_blobs).length > 0) { output.push({ name: friendlyBindingNames.text_blobs, entries: Object.entries(text_blobs).map(([key, value]) => ({ key, value: addSuffix(truncate4(value)) })) }); } if (browser !== void 0) { output.push({ name: friendlyBindingNames.browser, entries: [{ key: "Name", value: browser.binding }] }); } if (images !== void 0) { const addImagesSuffix = createAddSuffix({ isProvisioning: context2.provisioning, isLocalDev: !!context2.imagesLocalMode }); output.push({ name: friendlyBindingNames.images, entries: [ { key: "Name", value: addImagesSuffix(images.binding) } ] }); } if (ai3 !== void 0) { const entries = [ { key: "Name", value: addSuffix(ai3.binding) } ]; if (ai3.staging) { entries.push({ key: "Staging", value: addSuffix(ai3.staging.toString()) }); } output.push({ name: friendlyBindingNames.ai, entries }); } if (pipelines2?.length) { output.push({ name: friendlyBindingNames.pipelines, entries: pipelines2.map(({ binding, pipeline }) => ({ key: binding, value: addSuffix(pipeline) })) }); } if (version_metadata !== void 0) { output.push({ name: friendlyBindingNames.version_metadata, entries: [{ key: "Name", value: addSuffix(version_metadata.binding) }] }); } if (unsafe?.bindings !== void 0 && unsafe.bindings.length > 0) { output.push({ name: friendlyBindingNames.unsafe, entries: unsafe.bindings.map(({ name: name2, type }) => ({ key: type, value: addSuffix(name2) })) }); } if (vars !== void 0 && Object.keys(vars).length > 0) { output.push({ name: friendlyBindingNames.vars, entries: Object.entries(vars).map(([key, value]) => { let parsedValue; if (typeof value === "string") { parsedValue = `"${truncate4(value)}"`; } else if (typeof value === "object") { parsedValue = JSON.stringify(value, null, 1); } else { parsedValue = `${truncate4(`${value}`)}`; } return { key, value: parsedValue }; }) }); } if (wasm_modules !== void 0 && Object.keys(wasm_modules).length > 0) { output.push({ name: friendlyBindingNames.wasm_modules, entries: Object.entries(wasm_modules).map(([key, value]) => ({ key, value: addSuffix( typeof value === "string" ? truncate4(value) : "" ) })) }); } if (dispatch_namespaces !== void 0 && dispatch_namespaces.length > 0) { output.push({ name: friendlyBindingNames.dispatch_namespaces, entries: dispatch_namespaces.map(({ binding, namespace, outbound }) => { return { key: binding, value: addSuffix( outbound ? `${namespace} (outbound -> ${outbound.service})` : namespace ) }; }) }); } if (mtls_certificates !== void 0 && mtls_certificates.length > 0) { output.push({ name: friendlyBindingNames.mtls_certificates, entries: mtls_certificates.map(({ binding, certificate_id }) => { return { key: binding, value: addSuffix(certificate_id) }; }) }); } if (unsafe?.metadata !== void 0) { output.push({ name: friendlyBindingNames.unsafe, entries: Object.entries(unsafe.metadata).map(([key, value]) => ({ key, value: addSuffix(JSON.stringify(value)) })) }); } if (output.length === 0) { logger.log("No bindings found."); return; } if (context2.local) { logger.once.log( `Your Worker and resources are simulated locally via Miniflare. For more information, see: https://developers.cloudflare.com/workers/testing/local-development. ` ); } let title; if (context2.provisioning) { title = "The following bindings need to be provisioned:"; } else if (context2.name && getFlag("MULTIWORKER")) { title = `${source_default.blue(context2.name)} has access to the following bindings:`; } else { title = "Your worker has access to the following bindings:"; } const message = [ title, ...output.map((bindingGroup) => { return [ `- ${bindingGroup.name}:`, bindingGroup.entries.map( ({ key, value }) => ` - ${key}${value ? ":" : ""} ${value}` ) ]; }).flat(2) ].join("\n"); logger.log(message); if (hasConnectionStatus) { logger.once.info( ` Service bindings & durable object bindings connect to other \`wrangler dev\` processes running locally, with their connection status indicated by ${source_default.green("[connected]")} or ${source_default.red("[not connected]")}. For more details, refer to https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/#local-development ` ); } } __name(printBindings, "printBindings"); function normalizeValue(value) { if (!value || typeof value === "symbol") { return ""; } return value; } __name(normalizeValue, "normalizeValue"); function createAddSuffix({ isProvisioning = false, isLocalDev = false }) { return /* @__PURE__ */ __name(function addSuffix(value, { isSimulatedLocally = false } = {}) { const normalizedValue = normalizeValue(value); if (isProvisioning || !isLocalDev) { return normalizedValue; } return isSimulatedLocally ? `${normalizedValue} [simulated locally]` : `${normalizedValue} [connected to remote resource]`; }, "addSuffix"); } __name(createAddSuffix, "createAddSuffix"); // src/config/diagnostics.ts init_import_meta_url(); var Diagnostics = class { /** * Create a new Diagnostics object. * @param description A general description of this collection of messages. */ constructor(description) { this.description = description; } errors = []; warnings = []; children = []; /** * Merge the given `diagnostics` into this as a child. */ addChild(diagnostics) { if (diagnostics.hasErrors() || diagnostics.hasWarnings()) { this.children.push(diagnostics); } } /** Does this or any of its children have errors. */ hasErrors() { if (this.errors.length > 0) { return true; } else { return this.children.some((child) => child.hasErrors()); } } /** Render the errors of this and all its children. */ renderErrors() { return this.render("errors"); } /** Does this or any of its children have warnings. */ hasWarnings() { if (this.warnings.length > 0) { return true; } else { return this.children.some((child) => child.hasWarnings()); } } /** Render the warnings of this and all its children. */ renderWarnings() { return this.render("warnings"); } render(field) { const hasMethod = field === "errors" ? "hasErrors" : "hasWarnings"; return indentText( `${this.description} ` + // Output all the fields (errors or warnings) at this level this[field].map((message) => `- ${indentText(message)}`).join("\n") + // Output all the child diagnostics at the next level this.children.map( (child) => child[hasMethod]() ? "\n- " + child.render(field) : "" ).filter((output) => output !== "").join("\n") ); } }; __name(Diagnostics, "Diagnostics"); function indentText(str) { return str.split("\n").map( (line, index) => (index === 0 ? line : ` ${line}`).replace(/^\s*$/, "") ).join("\n"); } __name(indentText, "indentText"); // src/config/validation-helpers.ts init_import_meta_url(); function deprecated(diagnostics, config, fieldPath, message, remove, title = "Deprecation", type = "warning") { const BOLD = "\x1B[1m"; const NORMAL = "\x1B[0m"; const diagnosticMessage = `${BOLD}${title}${NORMAL}: "${fieldPath}": ${message}`; const result = unwindPropertyPath(config, fieldPath); if (result !== void 0 && result.field in result.container) { diagnostics[`${type}s`].push(diagnosticMessage); if (remove) { delete result.container[result.field]; } } } __name(deprecated, "deprecated"); function experimental(diagnostics, config, fieldPath) { const result = unwindPropertyPath(config, fieldPath); if (result !== void 0 && result.field in result.container && !("WRANGLER_DISABLE_EXPERIMENTAL_WARNING" in process.env)) { diagnostics.warnings.push( `"${fieldPath}" fields are experimental and may change or break at any time.` ); } } __name(experimental, "experimental"); function inheritable(diagnostics, topLevelEnv, rawEnv, field, validate3, defaultValue, transformFn = (v7) => v7) { validate3(diagnostics, field, rawEnv[field], topLevelEnv); return ( // `rawEnv === topLevelEnv` is a special case where the user has provided an environment name // but that named environment is not actually defined in the configuration. // In that case we have reused the topLevelEnv as the rawEnv, // and so we need to process the `transformFn()` anyway rather than just using the field in the `rawEnv`. (rawEnv !== topLevelEnv ? rawEnv[field] : void 0) ?? transformFn(topLevelEnv?.[field]) ?? defaultValue ); } __name(inheritable, "inheritable"); function inheritableInLegacyEnvironments(diagnostics, isLegacyEnv2, topLevelEnv, rawEnv, field, validate3, transformFn = (v7) => v7, defaultValue) { return topLevelEnv === void 0 || isLegacyEnv2 === true ? inheritable( diagnostics, topLevelEnv, rawEnv, field, validate3, defaultValue, transformFn ) : notAllowedInNamedServiceEnvironment( diagnostics, topLevelEnv, rawEnv, field ); } __name(inheritableInLegacyEnvironments, "inheritableInLegacyEnvironments"); var appendEnvName = /* @__PURE__ */ __name((envName) => (fieldValue) => fieldValue ? `${fieldValue}-${envName}` : void 0, "appendEnvName"); function notAllowedInNamedServiceEnvironment(diagnostics, topLevelEnv, rawEnv, field) { if (field in rawEnv) { diagnostics.errors.push( `The "${field}" field is not allowed in named service environments. Please remove the field from this environment.` ); } return topLevelEnv[field]; } __name(notAllowedInNamedServiceEnvironment, "notAllowedInNamedServiceEnvironment"); function notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, field, validate3, defaultValue) { if (rawEnv[field] !== void 0) { validate3(diagnostics, field, rawEnv[field], topLevelEnv); } else { if (rawConfig?.[field] !== void 0) { diagnostics.warnings.push( `"${field}" exists at the top level, but not on "env.${envName}". This is not what you probably want, since "${field}" is not inherited by environments. Please add "${field}" to "env.${envName}".` ); } } return rawEnv[field] ?? defaultValue; } __name(notInheritable, "notInheritable"); function unwindPropertyPath(root, path72) { let container = root; const parts = path72.split("."); for (let i5 = 0; i5 < parts.length - 1; i5++) { if (!hasProperty(container, parts[i5])) { return; } container = container[parts[i5]]; } return { container, field: parts[parts.length - 1] }; } __name(unwindPropertyPath, "unwindPropertyPath"); var isString = /* @__PURE__ */ __name((diagnostics, field, value) => { if (value !== void 0 && typeof value !== "string") { diagnostics.errors.push( `Expected "${field}" to be of type string but got ${JSON.stringify( value )}.` ); return false; } return true; }, "isString"); var isValidName = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value === "string" && /^$|^[a-z0-9_][a-z0-9-_]*$/.test(value) || value === void 0) { return true; } else { diagnostics.errors.push( `Expected "${field}" to be of type string, alphanumeric and lowercase with dashes only but got ${JSON.stringify( value )}.` ); return false; } }, "isValidName"); var isValidDateTimeStringFormat = /* @__PURE__ */ __name((diagnostics, field, value) => { let isValid2 = true; if (value.includes("\u2013") || // en-dash value.includes("\u2014")) { diagnostics.errors.push( `"${field}" field should use ISO-8601 accepted hyphens (-) rather than en-dashes (\u2013) or em-dashes (\u2014).` ); isValid2 = false; } const data = new Date(value.replaceAll(/–|—/g, "-")); if (isNaN(data.getTime())) { diagnostics.errors.push( `"${field}" field should be a valid ISO-8601 date (YYYY-MM-DD), but got ${JSON.stringify(value)}.` ); isValid2 = false; } return isValid2; }, "isValidDateTimeStringFormat"); var isStringArray = /* @__PURE__ */ __name((diagnostics, field, value) => { if (value !== void 0 && (!Array.isArray(value) || value.some((item) => typeof item !== "string"))) { diagnostics.errors.push( `Expected "${field}" to be of type string array but got ${JSON.stringify( value )}.` ); return false; } return true; }, "isStringArray"); var isOneOf = /* @__PURE__ */ __name((...choices) => (diagnostics, field, value) => { if (value !== void 0 && !choices.some((choice) => value === choice)) { diagnostics.errors.push( `Expected "${field}" field to be one of ${JSON.stringify( choices )} but got ${JSON.stringify(value)}.` ); return false; } return true; }, "isOneOf"); var all = /* @__PURE__ */ __name((...validations) => { return (diagnostics, field, value, config) => { let passedValidations = true; for (const validate3 of validations) { if (!validate3(diagnostics, field, value, config)) { passedValidations = false; } } return passedValidations; }; }, "all"); var isMutuallyExclusiveWith = /* @__PURE__ */ __name((container, ...fields) => { return (diagnostics, field, value) => { if (value === void 0) { return true; } for (const exclusiveWith of fields) { if (container[exclusiveWith] !== void 0) { diagnostics.errors.push( `Expected exactly one of the following fields ${JSON.stringify([ field, ...fields ])}.` ); return false; } } return true; }; }, "isMutuallyExclusiveWith"); var isBoolean = /* @__PURE__ */ __name((diagnostics, field, value) => { if (value !== void 0 && typeof value !== "boolean") { diagnostics.errors.push( `Expected "${field}" to be of type boolean but got ${JSON.stringify( value )}.` ); return false; } return true; }, "isBoolean"); var validateRequiredProperty = /* @__PURE__ */ __name((diagnostics, container, key, value, type, choices) => { if (container) { container += "."; } if (value === void 0) { diagnostics.errors.push(`"${container}${key}" is a required field.`); return false; } else if (typeof value !== type) { diagnostics.errors.push( `Expected "${container}${key}" to be of type ${type} but got ${JSON.stringify( value )}.` ); return false; } else if (choices) { if (!isOneOf(...choices)(diagnostics, `${container}${key}`, value, void 0)) { return false; } } return true; }, "validateRequiredProperty"); var validateAtLeastOnePropertyRequired = /* @__PURE__ */ __name((diagnostics, container, properties) => { const containerPath = container ? `${container}.` : ""; if (properties.every((property) => property.value === void 0)) { diagnostics.errors.push( `${properties.map(({ key }) => `"${containerPath}${key}"`).join(" or ")} is required.` ); return false; } const errors = []; for (const prop of properties) { if (typeof prop.value === prop.type) { return true; } errors.push( `Expected "${containerPath}${prop.key}" to be of type ${prop.type} but got ${JSON.stringify( prop.value )}.` ); } diagnostics.errors.push(...errors); return false; }, "validateAtLeastOnePropertyRequired"); var validateOptionalProperty = /* @__PURE__ */ __name((diagnostics, container, key, value, type, choices) => { if (value !== void 0) { return validateRequiredProperty( diagnostics, container, key, value, type, choices ); } return true; }, "validateOptionalProperty"); var validateTypedArray = /* @__PURE__ */ __name((diagnostics, container, value, type) => { let isValid2 = true; if (!Array.isArray(value)) { diagnostics.errors.push( `Expected "${container}" to be an array of ${type}s but got ${JSON.stringify( value )}` ); isValid2 = false; } else { for (let i5 = 0; i5 < value.length; i5++) { isValid2 = validateRequiredProperty( diagnostics, container, `[${i5}]`, value[i5], type ) && isValid2; } } return isValid2; }, "validateTypedArray"); var validateOptionalTypedArray = /* @__PURE__ */ __name((diagnostics, container, value, type) => { if (value !== void 0) { return validateTypedArray(diagnostics, container, value, type); } return true; }, "validateOptionalTypedArray"); var isRequiredProperty = /* @__PURE__ */ __name((obj, prop, type, choices) => hasProperty(obj, prop) && typeof obj[prop] === type && (choices === void 0 || choices.includes(obj[prop])), "isRequiredProperty"); var isOptionalProperty = /* @__PURE__ */ __name((obj, prop, type) => !hasProperty(obj, prop) || typeof obj[prop] === type, "isOptionalProperty"); var hasProperty = /* @__PURE__ */ __name((obj, property) => property in obj, "hasProperty"); var validateAdditionalProperties = /* @__PURE__ */ __name((diagnostics, fieldPath, restProps, knownProps) => { const restPropSet = new Set(restProps); for (const knownProp of knownProps) { restPropSet.delete(knownProp); } if (restPropSet.size > 0) { const fields = Array.from(restPropSet.keys()).map((field) => `"${field}"`); diagnostics.warnings.push( `Unexpected fields found in ${fieldPath} field: ${fields}` ); return false; } return true; }, "validateAdditionalProperties"); var getBindingNames = /* @__PURE__ */ __name((value) => { if (typeof value !== "object" || value === null) { return []; } if (isBindingList(value)) { return value.bindings.map(({ name: name2 }) => name2); } else if (isNamespaceList(value)) { return value.map(({ binding }) => binding); } else if (isRecord(value)) { if (value["binding"] !== void 0) { return [value["binding"]]; } return Object.keys(value).filter((k6) => value[k6] !== void 0); } else { return []; } }, "getBindingNames"); var isBindingList = /* @__PURE__ */ __name((value) => isRecord(value) && "bindings" in value && Array.isArray(value.bindings) && value.bindings.every( (binding) => isRecord(binding) && "name" in binding && typeof binding.name === "string" ), "isBindingList"); var isNamespaceList = /* @__PURE__ */ __name((value) => Array.isArray(value) && value.every( (entry) => isRecord(entry) && "binding" in entry && typeof entry.binding === "string" ), "isNamespaceList"); var isRecord = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isRecord"); // src/config/validation.ts var ENGLISH = new Intl.ListFormat("en-US"); function isPagesConfig(rawConfig) { return rawConfig.pages_build_output_dir !== void 0; } __name(isPagesConfig, "isPagesConfig"); function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args) { const diagnostics = new Diagnostics( `Processing ${configPath ? import_node_path10.default.relative(process.cwd(), configPath) : "wrangler"} configuration:` ); deprecated( diagnostics, rawConfig, "miniflare", "Wrangler does not use configuration in the `miniflare` section. Unless you are using Miniflare directly you can remove this section.", true, "\u{1F636} Ignored" ); deprecated( diagnostics, rawConfig, "type", "Most common features now work out of the box with wrangler, including modules, jsx, typescript, etc. If you need anything more, use a custom build.", true, "\u{1F636} Ignored" ); deprecated( diagnostics, rawConfig, "webpack_config", "Most common features now work out of the box with wrangler, including modules, jsx, typescript, etc. If you need anything more, use a custom build.", true, "\u{1F636} Ignored" ); validateOptionalProperty( diagnostics, "", "legacy_env", rawConfig.legacy_env, "boolean" ); validateOptionalProperty( diagnostics, "", "send_metrics", rawConfig.send_metrics, "boolean" ); validateOptionalProperty( diagnostics, "", "keep_vars", rawConfig.keep_vars, "boolean" ); validateOptionalProperty( diagnostics, "", "pages_build_output_dir", rawConfig.pages_build_output_dir, "string" ); validateOptionalProperty( diagnostics, "", "$schema", rawConfig.$schema, "string" ); const isLegacyEnv2 = typeof args["legacy-env"] === "boolean" ? args["legacy-env"] : rawConfig.legacy_env ?? true; if (!isLegacyEnv2) { diagnostics.warnings.push( "Experimental: Service environments are in beta, and their behaviour is guaranteed to change in the future. DO NOT USE IN PRODUCTION." ); } const isDispatchNamespace = typeof args["dispatch-namespace"] === "string" && args["dispatch-namespace"].trim() !== ""; const topLevelEnv = normalizeAndValidateEnvironment( diagnostics, configPath, rawConfig, isDispatchNamespace ); const isRedirectedConfig = configPath && configPath !== userConfigPath; const definedEnvironments = Object.keys(rawConfig.env ?? {}); if (isRedirectedConfig && definedEnvironments.length > 0) { diagnostics.errors.push( dedent` Redirected configurations cannot include environments but the following have been found:\n${definedEnvironments.map((env6) => ` - ${env6}`).join("\n")} Such configurations are generated by tools, meaning that one of the tools your application is using is generating the incorrect configuration. Report this issue to the tool's author so that this can be fixed there. ` ); } const envName = args.env; (0, import_node_assert.default)(envName === void 0 || typeof envName === "string"); let activeEnv = topLevelEnv; if (envName !== void 0) { if (isRedirectedConfig) { if (!isPagesConfig(rawConfig)) { diagnostics.errors.push(dedent` You have specified the environment "${envName}", but are using a redirected configuration, produced by a build tool such as Vite. You need to set the environment in your build tool, rather than via Wrangler. For example, if you are using Vite, refer to these docs: https://developers.cloudflare.com/workers/vite-plugin/reference/cloudflare-environments/ `); } } else { const envDiagnostics = new Diagnostics( `"env.${envName}" environment configuration` ); const rawEnv = rawConfig.env?.[envName]; if (rawEnv !== void 0) { activeEnv = normalizeAndValidateEnvironment( envDiagnostics, configPath, rawEnv, isDispatchNamespace, envName, topLevelEnv, isLegacyEnv2, rawConfig ); diagnostics.addChild(envDiagnostics); } else if (!isPagesConfig(rawConfig)) { activeEnv = normalizeAndValidateEnvironment( envDiagnostics, configPath, topLevelEnv, // in this case reuse the topLevelEnv to ensure that nonInherited fields are not removed isDispatchNamespace, envName, topLevelEnv, isLegacyEnv2, rawConfig ); const envNames = rawConfig.env ? `The available configured environment names are: ${JSON.stringify( Object.keys(rawConfig.env) )} ` : ""; const message = `No environment found in configuration with name "${envName}". Before using \`--env=${envName}\` there should be an equivalent environment section in the configuration. ${envNames} Consider adding an environment configuration section to the ${configFileName(configPath)} file: \`\`\` [env.` + envName + "]\n```\n"; if (envNames.length > 0) { diagnostics.errors.push(message); } else { diagnostics.warnings.push(message); } } } } deprecated( diagnostics, rawConfig, "legacy_assets", `The \`legacy_assets\` feature has been deprecated. Please use \`assets\` instead.`, false ); const config = { configPath, userConfigPath, topLevelName: rawConfig.name, pages_build_output_dir: normalizeAndValidatePagesBuildOutputDir( configPath, rawConfig.pages_build_output_dir ), legacy_env: isLegacyEnv2, send_metrics: rawConfig.send_metrics, keep_vars: rawConfig.keep_vars, ...activeEnv, dev: normalizeAndValidateDev(diagnostics, rawConfig.dev ?? {}, args), site: normalizeAndValidateSite( diagnostics, configPath, rawConfig, activeEnv.main ), legacy_assets: normalizeAndValidateLegacyAssets( diagnostics, configPath, rawConfig ), alias: normalizeAndValidateAliases(diagnostics, configPath, rawConfig), wasm_modules: normalizeAndValidateModulePaths( diagnostics, configPath, "wasm_modules", rawConfig.wasm_modules ), text_blobs: normalizeAndValidateModulePaths( diagnostics, configPath, "text_blobs", rawConfig.text_blobs ), data_blobs: normalizeAndValidateModulePaths( diagnostics, configPath, "data_blobs", rawConfig.data_blobs ) }; validateBindingsHaveUniqueNames(diagnostics, config); validateAdditionalProperties( diagnostics, "top-level", Object.keys(rawConfig), [...Object.keys(config), "env", "$schema"] ); applyPythonConfig(config, args); return { config, diagnostics }; } __name(normalizeAndValidateConfig, "normalizeAndValidateConfig"); function applyPythonConfig(config, args) { const mainModule = args.script ?? config.main; if (typeof mainModule === "string" && mainModule.endsWith(".py")) { config.no_bundle = true; if (!config.rules.some((rule) => rule.type === "PythonModule")) { config.rules.push({ type: "PythonModule", globs: ["**/*.py"] }); } if (!config.compatibility_flags.includes("python_workers")) { throw new UserError( "The `python_workers` compatibility flag is required to use Python." ); } } } __name(applyPythonConfig, "applyPythonConfig"); function normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) { const { command: command2, cwd: cwd2, watch_dir = "./src", upload: upload2, ...rest } = rawBuild; const deprecatedUpload = { ...upload2 }; validateAdditionalProperties(diagnostics, "build", Object.keys(rest), []); validateOptionalProperty(diagnostics, "build", "command", command2, "string"); validateOptionalProperty(diagnostics, "build", "cwd", cwd2, "string"); if (Array.isArray(watch_dir)) { validateTypedArray(diagnostics, "build.watch_dir", watch_dir, "string"); } else { validateOptionalProperty( diagnostics, "build", "watch_dir", watch_dir, "string" ); } deprecated( diagnostics, rawEnv, "build.upload.format", "The format is inferred automatically from the code.", true ); if (rawEnv.main !== void 0 && rawBuild.upload?.main) { diagnostics.errors.push( `Don't define both the \`main\` and \`build.upload.main\` fields in your configuration. They serve the same purpose: to point to the entry-point of your worker. Delete the \`build.upload.main\` and \`build.upload.dir\` field from your config.` ); } else { deprecated( diagnostics, rawEnv, "build.upload.main", `Delete the \`build.upload.main\` and \`build.upload.dir\` fields. Then add the top level \`main\` field to your configuration file: \`\`\` main = "${import_node_path10.default.join( rawBuild.upload?.dir ?? "./dist", rawBuild.upload?.main ?? "." )}" \`\`\``, true ); deprecated( diagnostics, rawEnv, "build.upload.dir", `Use the top level "main" field or a command-line argument to specify the entry-point for the Worker.`, true ); } return { command: command2, watch_dir: ( // - `watch_dir` only matters when `command` is defined, so we apply // a default only when `command` is defined // - `configPath` will always be defined since `build` can only // be configured in the Wrangler configuration file, but who knows, that may // change in the future, so we do a check anyway command2 && configPath ? Array.isArray(watch_dir) ? watch_dir.map( (dir) => import_node_path10.default.relative( process.cwd(), import_node_path10.default.join(import_node_path10.default.dirname(configPath), `${dir}`) ) ) : import_node_path10.default.relative( process.cwd(), import_node_path10.default.join(import_node_path10.default.dirname(configPath), `${watch_dir}`) ) : watch_dir ), cwd: cwd2, deprecatedUpload }; } __name(normalizeAndValidateBuild, "normalizeAndValidateBuild"); function normalizeAndValidateMainField(configPath, rawMain, deprecatedUpload) { const configDir = import_node_path10.default.dirname(configPath ?? "wrangler.toml"); if (rawMain !== void 0) { if (typeof rawMain === "string") { const directory = import_node_path10.default.resolve(configDir); return import_node_path10.default.resolve(directory, rawMain); } else { return rawMain; } } else if (deprecatedUpload?.main !== void 0) { const directory = import_node_path10.default.resolve( configDir, deprecatedUpload?.dir || "./dist" ); return import_node_path10.default.resolve(directory, deprecatedUpload.main); } else { return; } } __name(normalizeAndValidateMainField, "normalizeAndValidateMainField"); function normalizeAndValidateBaseDirField(configPath, rawDir) { const configDir = import_node_path10.default.dirname(configPath ?? "wrangler.toml"); if (rawDir !== void 0) { if (typeof rawDir === "string") { const directory = import_node_path10.default.resolve(configDir); return import_node_path10.default.resolve(directory, rawDir); } else { return rawDir; } } else { return; } } __name(normalizeAndValidateBaseDirField, "normalizeAndValidateBaseDirField"); function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) { const configDir = import_node_path10.default.dirname(configPath ?? "wrangler.toml"); if (rawPagesDir !== void 0) { if (typeof rawPagesDir === "string") { const directory = import_node_path10.default.resolve(configDir); return import_node_path10.default.resolve(directory, rawPagesDir); } else { return rawPagesDir; } } else { return; } } __name(normalizeAndValidatePagesBuildOutputDir, "normalizeAndValidatePagesBuildOutputDir"); function normalizeAndValidateDev(diagnostics, rawDev, args) { (0, import_node_assert.default)(typeof args === "object" && args !== null && !Array.isArray(args)); const { localProtocol: localProtocolArg, upstreamProtocol: upstreamProtocolArg, remote: remoteArg } = args; (0, import_node_assert.default)( localProtocolArg === void 0 || localProtocolArg === "http" || localProtocolArg === "https" ); (0, import_node_assert.default)( upstreamProtocolArg === void 0 || upstreamProtocolArg === "http" || upstreamProtocolArg === "https" ); (0, import_node_assert.default)(remoteArg === void 0 || typeof remoteArg === "boolean"); const { // On Windows, when specifying `localhost` as the socket hostname, `workerd` // will only listen on the IPv4 loopback `127.0.0.1`, not the IPv6 `::1`: // https://github.com/cloudflare/workerd/issues/1408 // On Node 17+, `fetch()` will only try to fetch the IPv6 address. // For now, on Windows, we default to listening on IPv4 only and using // `127.0.0.1` when sending control requests to `workerd` (e.g. with the // `ProxyController`). ip = process.platform === "win32" ? "127.0.0.1" : "localhost", port, inspector_port, local_protocol = localProtocolArg ?? "http", // In remote mode upstream_protocol must be https, otherwise it defaults to local_protocol. upstream_protocol = upstreamProtocolArg ?? remoteArg ? "https" : local_protocol, host, ...rest } = rawDev; validateAdditionalProperties(diagnostics, "dev", Object.keys(rest), []); validateOptionalProperty(diagnostics, "dev", "ip", ip, "string"); validateOptionalProperty(diagnostics, "dev", "port", port, "number"); validateOptionalProperty( diagnostics, "dev", "inspector_port", inspector_port, "number" ); validateOptionalProperty( diagnostics, "dev", "local_protocol", local_protocol, "string", ["http", "https"] ); validateOptionalProperty( diagnostics, "dev", "upstream_protocol", upstream_protocol, "string", ["http", "https"] ); validateOptionalProperty(diagnostics, "dev", "host", host, "string"); return { ip, port, inspector_port, local_protocol, upstream_protocol, host }; } __name(normalizeAndValidateDev, "normalizeAndValidateDev"); function normalizeAndValidateAssets(diagnostics, topLevelEnv, rawEnv) { if (rawEnv?.assets !== void 0) { deprecated( diagnostics, rawEnv, "assets.experimental_serve_directly", `The "experimental_serve_directly" field is not longer supported. Please use run_worker_first. Read more: https://developers.cloudflare.com/workers/static-assets/binding/#run_worker_first`, false // Leave in for the moment, to be removed in a future release ); } return inheritable( diagnostics, topLevelEnv, rawEnv, "assets", validateAssetsConfig, void 0 ); } __name(normalizeAndValidateAssets, "normalizeAndValidateAssets"); function normalizeAndValidateSite(diagnostics, configPath, rawConfig, mainEntryPoint) { if (rawConfig?.site !== void 0) { const { bucket, include = [], exclude = [], ...rest } = rawConfig.site; validateAdditionalProperties(diagnostics, "site", Object.keys(rest), [ "entry-point" ]); validateRequiredProperty(diagnostics, "site", "bucket", bucket, "string"); validateTypedArray(diagnostics, "sites.include", include, "string"); validateTypedArray(diagnostics, "sites.exclude", exclude, "string"); validateOptionalProperty( diagnostics, "site", "entry-point", rawConfig.site["entry-point"], "string" ); deprecated( diagnostics, rawConfig, `site.entry-point`, `Delete the \`site.entry-point\` field, then add the top level \`main\` field to your configuration file: \`\`\` main = "${import_node_path10.default.join( String(rawConfig.site["entry-point"]) || "workers-site", import_node_path10.default.extname(String(rawConfig.site["entry-point"]) || "workers-site") ? "" : "index.js" )}" \`\`\``, false, void 0, "warning" ); let siteEntryPoint = rawConfig.site["entry-point"]; if (!mainEntryPoint && !siteEntryPoint) { diagnostics.warnings.push( `Because you've defined a [site] configuration, we're defaulting to "workers-site" for the deprecated \`site.entry-point\`field. Add the top level \`main\` field to your configuration file: \`\`\` main = "workers-site/index.js" \`\`\`` ); siteEntryPoint = "workers-site"; } else if (mainEntryPoint && siteEntryPoint) { diagnostics.errors.push( `Don't define both the \`main\` and \`site.entry-point\` fields in your configuration. They serve the same purpose: to point to the entry-point of your worker. Delete the deprecated \`site.entry-point\` field from your config.` ); } if (configPath && siteEntryPoint) { siteEntryPoint = import_node_path10.default.relative( process.cwd(), import_node_path10.default.join(import_node_path10.default.dirname(configPath), siteEntryPoint) ); } return { bucket, "entry-point": siteEntryPoint, include, exclude }; } return void 0; } __name(normalizeAndValidateSite, "normalizeAndValidateSite"); function normalizeAndValidateAliases(diagnostics, configPath, rawConfig) { if (rawConfig?.alias === void 0) { return void 0; } if (["string", "boolean", "number"].includes(typeof rawConfig?.alias) || typeof rawConfig?.alias !== "object") { diagnostics.errors.push( `Expected alias to be an object, but got ${typeof rawConfig?.alias}` ); return void 0; } let isValid2 = true; for (const [key, value] of Object.entries(rawConfig?.alias)) { if (typeof value !== "string") { diagnostics.errors.push( `Expected alias["${key}"] to be a string, but got ${typeof value}` ); isValid2 = false; } } if (isValid2) { return rawConfig.alias; } return; } __name(normalizeAndValidateAliases, "normalizeAndValidateAliases"); function normalizeAndValidateLegacyAssets(diagnostics, configPath, rawConfig) { const legacyAssetsConfig = rawConfig["legacy_assets"]; if (typeof legacyAssetsConfig === "string") { return { bucket: legacyAssetsConfig, include: [], exclude: [], browser_TTL: void 0, serve_single_page_app: false }; } if (legacyAssetsConfig === void 0) { return void 0; } if (typeof legacyAssetsConfig !== "object") { diagnostics.errors.push( `Expected the \`legacy_assets\` field to be a string or an object, but got ${typeof legacyAssetsConfig}.` ); return void 0; } const { bucket, include = [], exclude = [], browser_TTL, serve_single_page_app, ...rest } = legacyAssetsConfig; validateAdditionalProperties( diagnostics, "legacy_assets", Object.keys(rest), [] ); validateRequiredProperty( diagnostics, "legacy_assets", "bucket", bucket, "string" ); validateTypedArray(diagnostics, `legacy_assets.include`, include, "string"); validateTypedArray(diagnostics, `legacy_assets.exclude`, exclude, "string"); validateOptionalProperty( diagnostics, "legacy_assets", "browser_TTL", browser_TTL, "number" ); validateOptionalProperty( diagnostics, "legacy_assets", "serve_single_page_app", serve_single_page_app, "boolean" ); return { bucket, include, exclude, browser_TTL, serve_single_page_app }; } __name(normalizeAndValidateLegacyAssets, "normalizeAndValidateLegacyAssets"); function normalizeAndValidateModulePaths(diagnostics, configPath, field, rawMapping) { if (rawMapping === void 0) { return void 0; } const mapping = {}; for (const [name2, filePath] of Object.entries(rawMapping)) { if (isString(diagnostics, `${field}['${name2}']`, filePath, void 0)) { if (configPath) { mapping[name2] = configPath ? import_node_path10.default.relative( process.cwd(), import_node_path10.default.join(import_node_path10.default.dirname(configPath), filePath) ) : filePath; } } } return mapping; } __name(normalizeAndValidateModulePaths, "normalizeAndValidateModulePaths"); function isValidRouteValue(item) { if (!item) { return false; } if (typeof item === "string") { return true; } if (typeof item === "object") { if (!hasProperty(item, "pattern") || typeof item.pattern !== "string") { return false; } const otherKeys = Object.keys(item).length - 1; const hasZoneId = hasProperty(item, "zone_id") && typeof item.zone_id === "string"; const hasZoneName = hasProperty(item, "zone_name") && typeof item.zone_name === "string"; const hasCustomDomainFlag = hasProperty(item, "custom_domain") && typeof item.custom_domain === "boolean"; if (otherKeys === 2 && hasCustomDomainFlag && (hasZoneId || hasZoneName)) { return true; } else if (otherKeys === 1 && (hasZoneId || hasZoneName || hasCustomDomainFlag)) { return true; } } return false; } __name(isValidRouteValue, "isValidRouteValue"); function mutateEmptyStringAccountIDValue(diagnostics, rawEnv) { if (rawEnv.account_id === "") { diagnostics.warnings.push( `The "account_id" field in your configuration is an empty string and will be ignored. Please remove the "account_id" field from your configuration.` ); rawEnv.account_id = void 0; } return rawEnv; } __name(mutateEmptyStringAccountIDValue, "mutateEmptyStringAccountIDValue"); function mutateEmptyStringRouteValue(diagnostics, rawEnv) { if (rawEnv["route"] === "") { diagnostics.warnings.push( `The "route" field in your configuration is an empty string and will be ignored. Please remove the "route" field from your configuration.` ); rawEnv["route"] = void 0; } return rawEnv; } __name(mutateEmptyStringRouteValue, "mutateEmptyStringRouteValue"); var isRoute = /* @__PURE__ */ __name((diagnostics, field, value) => { if (value !== void 0 && !isValidRouteValue(value)) { diagnostics.errors.push( `Expected "${field}" to be either a string, or an object with shape { pattern, custom_domain, zone_id | zone_name }, but got ${JSON.stringify( value )}.` ); return false; } return true; }, "isRoute"); var isRouteArray = /* @__PURE__ */ __name((diagnostics, field, value) => { if (value === void 0) { return true; } if (!Array.isArray(value)) { diagnostics.errors.push( `Expected "${field}" to be an array but got ${JSON.stringify(value)}.` ); return false; } const invalidRoutes = []; for (const item of value) { if (!isValidRouteValue(item)) { invalidRoutes.push(item); } } if (invalidRoutes.length > 0) { diagnostics.errors.push( `Expected "${field}" to be an array of either strings or objects with the shape { pattern, custom_domain, zone_id | zone_name }, but these weren't valid: ${JSON.stringify( invalidRoutes, null, 2 )}.` ); } return invalidRoutes.length === 0; }, "isRouteArray"); function normalizeAndValidateRoute(diagnostics, topLevelEnv, rawEnv) { return inheritable( diagnostics, topLevelEnv, mutateEmptyStringRouteValue(diagnostics, rawEnv), "route", isRoute, void 0 ); } __name(normalizeAndValidateRoute, "normalizeAndValidateRoute"); function validateRoutes2(diagnostics, topLevelEnv, rawEnv) { return inheritable( diagnostics, topLevelEnv, rawEnv, "routes", all(isRouteArray, isMutuallyExclusiveWith(rawEnv, "route")), void 0 ); } __name(validateRoutes2, "validateRoutes"); function normalizeAndValidatePlacement(diagnostics, topLevelEnv, rawEnv) { if (rawEnv.placement) { validateRequiredProperty( diagnostics, "placement", "mode", rawEnv.placement.mode, "string", ["off", "smart"] ); validateOptionalProperty( diagnostics, "placement", "hint", rawEnv.placement.hint, "string" ); if (rawEnv.placement.hint && rawEnv.placement.mode !== "smart") { diagnostics.errors.push( `"placement.hint" cannot be set if "placement.mode" is not "smart"` ); } } return inheritable( diagnostics, topLevelEnv, rawEnv, "placement", () => true, void 0 ); } __name(normalizeAndValidatePlacement, "normalizeAndValidatePlacement"); function validateTailConsumer(diagnostics, field, value) { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"${field}" should be an object but got ${JSON.stringify(value)}.` ); return false; } let isValid2 = true; isValid2 = isValid2 && validateRequiredProperty( diagnostics, field, "service", value.service, "string" ); isValid2 = isValid2 && validateOptionalProperty( diagnostics, field, "environment", value.environment, "string" ); return isValid2; } __name(validateTailConsumer, "validateTailConsumer"); var validateTailConsumers = /* @__PURE__ */ __name((diagnostics, field, value) => { if (!value) { return true; } if (!Array.isArray(value)) { diagnostics.errors.push( `Expected "${field}" to be an array but got ${JSON.stringify(value)}.` ); return false; } let isValid2 = true; for (let i5 = 0; i5 < value.length; i5++) { isValid2 = validateTailConsumer(diagnostics, `${field}[${i5}]`, value[i5]) && isValid2; } return isValid2; }, "validateTailConsumers"); function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDispatchNamespace, envName = "top level", topLevelEnv, isLegacyEnv2, rawConfig) { deprecated( diagnostics, rawEnv, "kv-namespaces", `The "kv-namespaces" field is no longer supported, please rename to "kv_namespaces"`, true ); deprecated( diagnostics, rawEnv, "zone_id", "This is unnecessary since we can deduce this from routes directly.", false // We need to leave this in-place for the moment since `route` commands might use it. ); deprecated( diagnostics, rawEnv, "experimental_services", `The "experimental_services" field is no longer supported. Simply rename the [experimental_services] field to [services].`, true ); experimental(diagnostics, rawEnv, "unsafe"); const route2 = normalizeAndValidateRoute(diagnostics, topLevelEnv, rawEnv); const account_id = inheritableInLegacyEnvironments( diagnostics, isLegacyEnv2, topLevelEnv, mutateEmptyStringAccountIDValue(diagnostics, rawEnv), "account_id", isString, void 0, void 0 ); const routes = validateRoutes2(diagnostics, topLevelEnv, rawEnv); const workers_dev = inheritable( diagnostics, topLevelEnv, rawEnv, "workers_dev", isBoolean, void 0 ); const preview_urls = inheritable( diagnostics, topLevelEnv, rawEnv, "preview_urls", isBoolean, true ); const { deprecatedUpload, ...build5 } = normalizeAndValidateBuild( diagnostics, rawEnv, rawEnv.build ?? topLevelEnv?.build ?? {}, configPath ); const environment = { // Inherited fields account_id, compatibility_date: inheritable( diagnostics, topLevelEnv, rawEnv, "compatibility_date", validateCompatibilityDate, void 0 ), compatibility_flags: inheritable( diagnostics, topLevelEnv, rawEnv, "compatibility_flags", isStringArray, [] ), jsx_factory: inheritable( diagnostics, topLevelEnv, rawEnv, "jsx_factory", isString, "React.createElement" ), jsx_fragment: inheritable( diagnostics, topLevelEnv, rawEnv, "jsx_fragment", isString, "React.Fragment" ), tsconfig: validateAndNormalizeTsconfig( diagnostics, topLevelEnv, rawEnv, configPath ), rules: validateAndNormalizeRules( diagnostics, topLevelEnv, rawEnv, deprecatedUpload?.rules, envName, configPath ), name: inheritableInLegacyEnvironments( diagnostics, isLegacyEnv2, topLevelEnv, rawEnv, "name", isDispatchNamespace ? isString : isValidName, appendEnvName(envName), void 0 ), main: normalizeAndValidateMainField( configPath, inheritable( diagnostics, topLevelEnv, rawEnv, "main", isString, void 0 ), deprecatedUpload ), find_additional_modules: inheritable( diagnostics, topLevelEnv, rawEnv, "find_additional_modules", isBoolean, void 0 ), preserve_file_names: inheritable( diagnostics, topLevelEnv, rawEnv, "preserve_file_names", isBoolean, void 0 ), base_dir: normalizeAndValidateBaseDirField( configPath, inheritable( diagnostics, topLevelEnv, rawEnv, "base_dir", isString, void 0 ) ), route: route2, routes, triggers: inheritable( diagnostics, topLevelEnv, rawEnv, "triggers", validateTriggers, { crons: void 0 } ), assets: normalizeAndValidateAssets(diagnostics, topLevelEnv, rawEnv), usage_model: inheritable( diagnostics, topLevelEnv, rawEnv, "usage_model", isOneOf("bundled", "unbound"), void 0 ), limits: normalizeAndValidateLimits(diagnostics, topLevelEnv, rawEnv), placement: normalizeAndValidatePlacement(diagnostics, topLevelEnv, rawEnv), build: build5, workers_dev, preview_urls, // Not inherited fields vars: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "vars", validateVars(envName), {} ), define: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "define", validateDefines(envName), {} ), durable_objects: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "durable_objects", validateBindingsProperty(envName, validateDurableObjectBinding), { bindings: [] } ), workflows: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "workflows", validateBindingArray(envName, validateWorkflowBinding), [] ), migrations: inheritable( diagnostics, topLevelEnv, rawEnv, "migrations", validateMigrations, [] ), kv_namespaces: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "kv_namespaces", validateBindingArray(envName, validateKVBinding), [] ), cloudchamber: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "cloudchamber", validateCloudchamberConfig, {} ), containers: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "containers", validateContainerAppConfig, { app: [] } ), send_email: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "send_email", validateBindingArray(envName, validateSendEmailBinding), [] ), queues: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "queues", validateQueues(envName), { producers: [], consumers: [] } ), r2_buckets: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "r2_buckets", validateBindingArray(envName, validateR2Binding), [] ), d1_databases: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "d1_databases", validateBindingArray(envName, validateD1Binding), [] ), vectorize: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "vectorize", validateBindingArray(envName, validateVectorizeBinding), [] ), hyperdrive: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "hyperdrive", validateBindingArray(envName, validateHyperdriveBinding), [] ), services: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "services", validateBindingArray(envName, validateServiceBinding), [] ), analytics_engine_datasets: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "analytics_engine_datasets", validateBindingArray(envName, validateAnalyticsEngineBinding), [] ), dispatch_namespaces: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "dispatch_namespaces", validateBindingArray(envName, validateWorkerNamespaceBinding), [] ), mtls_certificates: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "mtls_certificates", validateBindingArray(envName, validateMTlsCertificateBinding), [] ), tail_consumers: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "tail_consumers", validateTailConsumers, void 0 ), unsafe: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "unsafe", validateUnsafeSettings(envName), {} ), browser: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "browser", validateNamedSimpleBinding(envName), void 0 ), ai: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "ai", validateAIBinding(envName), void 0 ), images: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "images", validateNamedSimpleBinding(envName), void 0 ), pipelines: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "pipelines", validateBindingArray(envName, validatePipelineBinding), [] ), version_metadata: notInheritable( diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "version_metadata", validateVersionMetadataBinding(envName), void 0 ), zone_id: rawEnv.zone_id, logfwdr: inheritable( diagnostics, topLevelEnv, rawEnv, "logfwdr", validateCflogfwdrObject(envName), { bindings: [] } ), no_bundle: inheritable( diagnostics, topLevelEnv, rawEnv, "no_bundle", isBoolean, void 0 ), minify: inheritable( diagnostics, topLevelEnv, rawEnv, "minify", isBoolean, void 0 ), node_compat: inheritable( diagnostics, topLevelEnv, rawEnv, "node_compat", isBoolean, void 0 ), first_party_worker: inheritable( diagnostics, topLevelEnv, rawEnv, "first_party_worker", isBoolean, void 0 ), logpush: inheritable( diagnostics, topLevelEnv, rawEnv, "logpush", isBoolean, void 0 ), upload_source_maps: inheritable( diagnostics, topLevelEnv, rawEnv, "upload_source_maps", isBoolean, void 0 ), observability: inheritable( diagnostics, topLevelEnv, rawEnv, "observability", validateObservability, void 0 ) }; warnIfDurableObjectsHaveNoMigrations( diagnostics, environment.durable_objects, environment.migrations, configPath ); return environment; } __name(normalizeAndValidateEnvironment, "normalizeAndValidateEnvironment"); function validateAndNormalizeTsconfig(diagnostics, topLevelEnv, rawEnv, configPath) { const tsconfig = inheritable( diagnostics, topLevelEnv, rawEnv, "tsconfig", isString, void 0 ); return configPath && tsconfig ? import_node_path10.default.relative( process.cwd(), import_node_path10.default.join(import_node_path10.default.dirname(configPath), tsconfig) ) : tsconfig; } __name(validateAndNormalizeTsconfig, "validateAndNormalizeTsconfig"); var validateAndNormalizeRules = /* @__PURE__ */ __name((diagnostics, topLevelEnv, rawEnv, deprecatedRules, envName, configPath) => { if (topLevelEnv === void 0) { if (rawEnv.rules && deprecatedRules) { diagnostics.errors.push( `You cannot configure both [rules] and [build.upload.rules] in your ${configFileName(configPath)}. Delete the \`build.upload\` section.` ); } else if (deprecatedRules) { diagnostics.warnings.push( `Deprecation: The \`build.upload.rules\` config field is no longer used, the rules should be specified via the \`rules\` config field. Delete the \`build.upload\` field from the configuration file, and add this: \`\`\` ` + import_toml2.default.stringify({ rules: deprecatedRules }) + "```" ); } } return inheritable( diagnostics, topLevelEnv, rawEnv, "rules", validateRules(envName), deprecatedRules ?? [] ); }, "validateAndNormalizeRules"); var validateTriggers = /* @__PURE__ */ __name((diagnostics, triggersFieldName, triggersValue) => { if (triggersValue === void 0 || triggersValue === null) { return true; } if (typeof triggersValue !== "object") { diagnostics.errors.push( `Expected "${triggersFieldName}" to be of type object but got ${JSON.stringify( triggersValue )}.` ); return false; } let isValid2 = true; if ("crons" in triggersValue && !Array.isArray(triggersValue.crons)) { diagnostics.errors.push( `Expected "${triggersFieldName}.crons" to be of type array, but got ${JSON.stringify(triggersValue)}.` ); isValid2 = false; } isValid2 = validateAdditionalProperties( diagnostics, triggersFieldName, Object.keys(triggersValue), ["crons"] ) && isValid2; return isValid2; }, "validateTriggers"); var validateRules = /* @__PURE__ */ __name((envName) => (diagnostics, field, envValue, config) => { if (!envValue) { return true; } const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`; if (!Array.isArray(envValue)) { diagnostics.errors.push( `The field "${fieldPath}" should be an array but got ${JSON.stringify( envValue )}.` ); return false; } let isValid2 = true; for (let i5 = 0; i5 < envValue.length; i5++) { isValid2 = validateRule(diagnostics, `${fieldPath}[${i5}]`, envValue[i5], config) && isValid2; } return isValid2; }, "validateRules"); var validateRule = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"${field}" should be an object but got ${JSON.stringify(value)}.` ); return false; } let isValid2 = true; const rule = value; if (!isRequiredProperty(rule, "type", "string", [ "ESModule", "CommonJS", "CompiledWasm", "Text", "Data" ])) { diagnostics.errors.push( `bindings should have a string "type" field, which contains one of "ESModule", "CommonJS", "CompiledWasm", "Text", or "Data".` ); isValid2 = false; } isValid2 = validateTypedArray(diagnostics, `${field}.globs`, rule.globs, "string") && isValid2; if (!isOptionalProperty(rule, "fallthrough", "boolean")) { diagnostics.errors.push( `the field "fallthrough", when present, should be a boolean.` ); isValid2 = false; } return isValid2; }, "validateRule"); var validateDefines = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => { let isValid2 = true; const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`; if (typeof value === "object" && value !== null) { for (const varName in value) { if (typeof value[varName] !== "string") { diagnostics.errors.push( `The field "${fieldPath}.${varName}" should be a string but got ${JSON.stringify( value[varName] )}.` ); isValid2 = false; } } } else { if (value !== void 0) { diagnostics.errors.push( `The field "${fieldPath}" should be an object but got ${JSON.stringify( value )}. ` ); isValid2 = false; } } const configDefines = Object.keys(config?.define ?? {}); if (configDefines.length > 0) { if (typeof value === "object" && value !== null) { const configEnvDefines = config === void 0 ? [] : Object.keys(value); for (const varName of configDefines) { if (!(varName in value)) { diagnostics.warnings.push( `"define.${varName}" exists at the top level, but not on "${fieldPath}". This is not what you probably want, since "define" configuration is not inherited by environments. Please add "define.${varName}" to "env.${envName}".` ); } } for (const varName of configEnvDefines) { if (!configDefines.includes(varName)) { diagnostics.warnings.push( `"${varName}" exists on "env.${envName}", but not on the top level. This is not what you probably want, since "define" configuration within environments can only override existing top level "define" configuration Please remove "${fieldPath}.${varName}", or add "define.${varName}".` ); } } } } return isValid2; }, "validateDefines"); var validateVars = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => { let isValid2 = true; const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`; const configVars = Object.keys(config?.vars ?? {}); if (configVars.length > 0) { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `The field "${fieldPath}" should be an object but got ${JSON.stringify( value )}. ` ); isValid2 = false; } else { for (const varName of configVars) { if (!(varName in value)) { diagnostics.warnings.push( `"vars.${varName}" exists at the top level, but not on "${fieldPath}". This is not what you probably want, since "vars" configuration is not inherited by environments. Please add "vars.${varName}" to "env.${envName}".` ); } } } } return isValid2; }, "validateVars"); var validateBindingsProperty = /* @__PURE__ */ __name((envName, validateBinding) => (diagnostics, field, value, config) => { let isValid2 = true; const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`; if (value !== void 0) { if (typeof value !== "object" || value === null || Array.isArray(value)) { diagnostics.errors.push( `The field "${fieldPath}" should be an object but got ${JSON.stringify( value )}.` ); isValid2 = false; } else if (!hasProperty(value, "bindings")) { diagnostics.errors.push( `The field "${fieldPath}" is missing the required "bindings" property.` ); isValid2 = false; } else if (!Array.isArray(value.bindings)) { diagnostics.errors.push( `The field "${fieldPath}.bindings" should be an array but got ${JSON.stringify( value.bindings )}.` ); isValid2 = false; } else { for (let i5 = 0; i5 < value.bindings.length; i5++) { const binding = value.bindings[i5]; const bindingDiagnostics = new Diagnostics( `"${fieldPath}.bindings[${i5}]": ${JSON.stringify(binding)}` ); isValid2 = validateBinding( bindingDiagnostics, `${fieldPath}.bindings[${i5}]`, binding, config ) && isValid2; diagnostics.addChild(bindingDiagnostics); } } const configBindingNames = getBindingNames( config?.[field] ); if (isValid2 && configBindingNames.length > 0) { const envBindingNames = new Set(getBindingNames(value)); const missingBindings = configBindingNames.filter( (name2) => !envBindingNames.has(name2) ); if (missingBindings.length > 0) { diagnostics.warnings.push( `The following bindings are at the top level, but not on "env.${envName}". This is not what you probably want, since "${field}" configuration is not inherited by environments. Please add a binding for each to "${fieldPath}.bindings": ` + missingBindings.map((name2) => `- ${name2}`).join("\n") ); } } } return isValid2; }, "validateBindingsProperty"); var validateUnsafeSettings = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => { const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`; if (typeof value !== "object" || value === null || Array.isArray(value)) { diagnostics.errors.push( `The field "${fieldPath}" should be an object but got ${JSON.stringify( value )}.` ); return false; } if (hasProperty(value, "bindings") && value.bindings !== void 0) { const validateBindingsFn = validateBindingsProperty( envName, validateUnsafeBinding ); const valid = validateBindingsFn(diagnostics, field, value, config); if (!valid) { return false; } } if (hasProperty(value, "metadata") && value.metadata !== void 0 && (typeof value.metadata !== "object" || value.metadata === null || Array.isArray(value.metadata))) { diagnostics.errors.push( `The field "${fieldPath}.metadata" should be an object but got ${JSON.stringify( value.metadata )}.` ); return false; } if (hasProperty(value, "capnp") && value.capnp !== void 0) { if (typeof value.capnp !== "object" || value.capnp === null || Array.isArray(value.capnp)) { diagnostics.errors.push( `The field "${fieldPath}.capnp" should be an object but got ${JSON.stringify( value.capnp )}.` ); return false; } if (hasProperty(value.capnp, "compiled_schema")) { if (hasProperty(value.capnp, "base_path") || hasProperty(value.capnp, "source_schemas")) { diagnostics.errors.push( `The field "${fieldPath}.capnp" cannot contain both "compiled_schema" and one of "base_path" or "source_schemas".` ); return false; } if (typeof value.capnp.compiled_schema !== "string") { diagnostics.errors.push( `The field "${fieldPath}.capnp.compiled_schema", when present, should be a string but got ${JSON.stringify( value.capnp.compiled_schema )}.` ); return false; } } else { if (!isRequiredProperty(value.capnp, "base_path", "string")) { diagnostics.errors.push( `The field "${fieldPath}.capnp.base_path", when present, should be a string but got ${JSON.stringify( value.capnp.base_path )}` ); } if (!validateTypedArray( diagnostics, `${fieldPath}.capnp.source_schemas`, value.capnp.source_schemas, "string" )) { return false; } } } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "bindings", "metadata", "capnp" ]); return true; }, "validateUnsafeSettings"); var validateDurableObjectBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `Expected "${field}" to be an object but got ${JSON.stringify(value)}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "name", "string")) { diagnostics.errors.push(`binding should have a string "name" field.`); isValid2 = false; } if (!isRequiredProperty(value, "class_name", "string")) { diagnostics.errors.push(`binding should have a string "class_name" field.`); isValid2 = false; } if (!isOptionalProperty(value, "script_name", "string")) { diagnostics.errors.push( `the field "script_name", when present, should be a string.` ); isValid2 = false; } if (!isOptionalProperty(value, "environment", "string")) { diagnostics.errors.push( `the field "environment", when present, should be a string.` ); isValid2 = false; } if ("environment" in value && !("script_name" in value)) { diagnostics.errors.push( `binding should have a "script_name" field if "environment" is present.` ); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "class_name", "environment", "name", "script_name" ]); return isValid2; }, "validateDurableObjectBinding"); var validateWorkflowBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"workflows" bindings should be objects, but got ${JSON.stringify(value)}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "binding" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isRequiredProperty(value, "name", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "name" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } else if (value.name.length > 64) { diagnostics.errors.push( `"${field}" binding "name" field must be 64 characters or less, but got ${value.name.length} characters.` ); isValid2 = false; } if (!isRequiredProperty(value, "class_name", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "class_name" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isOptionalProperty(value, "script_name", "string")) { diagnostics.errors.push( `"${field}" bindings should, optionally, have a string "script_name" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isOptionalProperty(value, "experimental_remote", "boolean")) { diagnostics.errors.push( `"${field}" bindings should, optionally, have a boolean "experimental_remote" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "binding", "name", "class_name", "script_name", "experimental_remote" ]); return isValid2; }, "validateWorkflowBinding"); var validateCflogfwdrObject = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, topLevelEnv) => { const bindingsValidation = validateBindingsProperty( envName, validateCflogfwdrBinding ); if (!bindingsValidation(diagnostics, field, value, topLevelEnv)) { return false; } const v7 = value; if (v7?.schema !== void 0) { diagnostics.errors.push( `"${field}" binding "schema" property has been replaced with the "unsafe.capnp" object, which expects a "base_path" and an array of "source_schemas" to compile, or a "compiled_schema" property.` ); return false; } return true; }, "validateCflogfwdrObject"); var validateCflogfwdrBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `Expected "${field}" to be an object but got ${JSON.stringify(value)}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "name", "string")) { diagnostics.errors.push(`binding should have a string "name" field.`); isValid2 = false; } if (!isRequiredProperty(value, "destination", "string")) { diagnostics.errors.push( `binding should have a string "destination" field.` ); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "destination", "name" ]); return isValid2; }, "validateCflogfwdrBinding"); var validateAssetsConfig = /* @__PURE__ */ __name((diagnostics, field, value) => { if (value === void 0) { return true; } if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"${field}" should be an object, but got value ${JSON.stringify( field )} of type ${typeof value}` ); return false; } let isValid2 = true; isValid2 = validateOptionalProperty( diagnostics, field, "directory", value.directory, "string" ) && isValid2; isValid2 = validateOptionalProperty( diagnostics, field, "binding", value.binding, "string" ) && isValid2; isValid2 = validateOptionalProperty( diagnostics, field, "html_handling", value.html_handling, "string", [ "auto-trailing-slash", "force-trailing-slash", "drop-trailing-slash", "none" ] ) && isValid2; isValid2 = validateOptionalProperty( diagnostics, field, "not_found_handling", value.not_found_handling, "string", ["single-page-application", "404-page", "none"] ) && isValid2; isValid2 = validateOptionalProperty( diagnostics, field, "run_worker_first", value.run_worker_first, "boolean" ) && isValid2; isValid2 = validateOptionalProperty( diagnostics, field, "experimental_serve_directly", value.experimental_serve_directly, "boolean" ) && isValid2; isValid2 = validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "directory", "binding", "html_handling", "not_found_handling", "run_worker_first", "experimental_serve_directly" ]) && isValid2; return isValid2; }, "validateAssetsConfig"); var validateNamedSimpleBinding = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => { const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`; if (typeof value !== "object" || value === null || Array.isArray(value)) { diagnostics.errors.push( `The field "${fieldPath}" should be an object but got ${JSON.stringify( value )}.` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push(`binding should have a string "binding" field.`); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "binding" ]); return isValid2; }, "validateNamedSimpleBinding"); var validateAIBinding = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => { const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`; if (typeof value !== "object" || value === null || Array.isArray(value)) { diagnostics.errors.push( `The field "${fieldPath}" should be an object but got ${JSON.stringify( value )}.` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push(`binding should have a string "binding" field.`); isValid2 = false; } return isValid2; }, "validateAIBinding"); var validateVersionMetadataBinding = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => { const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`; if (typeof value !== "object" || value === null || Array.isArray(value)) { diagnostics.errors.push( `The field "${fieldPath}" should be an object but got ${JSON.stringify( value )}.` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push(`binding should have a string "binding" field.`); isValid2 = false; } return isValid2; }, "validateVersionMetadataBinding"); var validateUnsafeBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `Expected ${field} to be an object but got ${JSON.stringify(value)}.` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "name", "string")) { diagnostics.errors.push(`binding should have a string "name" field.`); isValid2 = false; } if (isRequiredProperty(value, "type", "string")) { const safeBindings = [ "plain_text", "secret_text", "json", "wasm_module", "data_blob", "text_blob", "browser", "ai", "kv_namespace", "durable_object_namespace", "d1_database", "r2_bucket", "service", "logfwdr", "mtls_certificate", "pipeline" ]; if (safeBindings.includes(value.type)) { diagnostics.warnings.push( `The binding type "${value.type}" is directly supported by wrangler. Consider migrating this unsafe binding to a format for '${value.type}' bindings that is supported by wrangler for optimal support. For more details, see https://developers.cloudflare.com/workers/cli-wrangler/configuration` ); } if (value.type === "metadata" && isRequiredProperty(value, "name", "string")) { diagnostics.warnings.push( "The deployment object in the metadata binding is now deprecated. Please switch using the version_metadata binding for access to version specific fields: https://developers.cloudflare.com/workers/runtime-apis/bindings/version-metadata" ); } } else { diagnostics.errors.push(`binding should have a string "type" field.`); isValid2 = false; } return isValid2; }, "validateUnsafeBinding"); var validateBindingArray = /* @__PURE__ */ __name((envName, validateBinding) => (diagnostics, field, envValue, config) => { if (envValue === void 0) { return true; } const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`; if (!Array.isArray(envValue)) { diagnostics.errors.push( `The field "${fieldPath}" should be an array but got ${JSON.stringify( envValue )}.` ); return false; } let isValid2 = true; for (let i5 = 0; i5 < envValue.length; i5++) { isValid2 = validateBinding( diagnostics, `${fieldPath}[${i5}]`, envValue[i5], config ) && isValid2; } const configValue = config?.[field]; if (Array.isArray(configValue)) { const configBindingNames = configValue.map((value) => value.binding); if (configBindingNames.length > 0) { const envBindingNames = new Set(envValue.map((value) => value.binding)); for (const configBindingName of configBindingNames) { if (!envBindingNames.has(configBindingName)) { diagnostics.warnings.push( `There is a ${field} binding with name "${configBindingName}" at the top level, but not on "env.${envName}". This is not what you probably want, since "${field}" configuration is not inherited by environments. Please add a binding for "${configBindingName}" to "env.${envName}.${field}.bindings".` ); } } } } return isValid2; }, "validateBindingArray"); var validateContainerAppConfig = /* @__PURE__ */ __name((diagnostics, _field, value) => { if (!value) { diagnostics.errors.push( `"containers" should be an object, but got a falsy value` ); return false; } if (typeof value !== "object") { diagnostics.errors.push( `"containers" should be an object, but got ${typeof value}` ); return false; } if (Array.isArray(value)) { diagnostics.errors.push( `"containers" should be an object, but got an array` ); return false; } if (!("app" in value)) { return true; } value = value.app; if (!Array.isArray(value)) { diagnostics.errors.push( `"containers.app" should be an array, but got ${JSON.stringify(value)}` ); return false; } for (const containerApp of value) { const containerAppOptional = containerApp; if (!isRequiredProperty(containerAppOptional, "instances", "number")) { diagnostics.errors.push( `"containers.app.instances" should be defined and an integer` ); } if (!isRequiredProperty(containerAppOptional, "name", "string")) { diagnostics.errors.push( `"containers.app.name" should be defined and a string` ); } if (!("configuration" in containerAppOptional)) { diagnostics.errors.push( `"containers.app.configuration" should be defined` ); } else if (Array.isArray(containerAppOptional.configuration)) { diagnostics.errors.push( `"containers.app.configuration" is defined as an array, it should be an object` ); } else if (!isRequiredProperty( containerAppOptional.configuration, "image", "string" )) { diagnostics.errors.push( `"containers.app.configuration.image" should be defined and a string` ); } } if (diagnostics.errors.length > 0) { return false; } return true; }, "validateContainerAppConfig"); var validateCloudchamberConfig = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null || Array.isArray(value)) { diagnostics.errors.push( `"cloudchamber" should be an object, but got ${JSON.stringify(value)}` ); return false; } const optionalAttrsByType = { string: ["memory", "image", "location"], boolean: ["ipv4"], number: ["vcpu"] }; let isValid2 = true; Object.entries(optionalAttrsByType).forEach(([attrType, attrNames]) => { attrNames.forEach((key) => { if (!isOptionalProperty(value, key, attrType)) { diagnostics.errors.push( `"${field}" bindings should, optionally, have a ${attrType} "${key}" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } }); }); return isValid2; }, "validateCloudchamberConfig"); var validateKVBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"kv_namespaces" bindings should be objects, but got ${JSON.stringify( value )}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "binding" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (getFlag("RESOURCES_PROVISION") ? !isOptionalProperty(value, "id", "string") || value.id !== void 0 && value.id.length === 0 : !isRequiredProperty(value, "id", "string") || value.id.length === 0) { diagnostics.errors.push( `"${field}" bindings should have a string "id" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isOptionalProperty(value, "preview_id", "string")) { diagnostics.errors.push( `"${field}" bindings should, optionally, have a string "preview_id" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "binding", "id", "preview_id" ]); return isValid2; }, "validateKVBinding"); var validateSendEmailBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"send_email" bindings should be objects, but got ${JSON.stringify( value )}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "name", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "name" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isOptionalProperty(value, "destination_address", "string")) { diagnostics.errors.push( `"${field}" bindings should, optionally, have a string "destination_address" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isOptionalProperty(value, "allowed_destination_addresses", "object")) { diagnostics.errors.push( `"${field}" bindings should, optionally, have a []string "allowed_destination_addresses" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if ("destination_address" in value && "allowed_destination_addresses" in value) { diagnostics.errors.push( `"${field}" bindings should have either a "destination_address" or "allowed_destination_addresses" field, but not both.` ); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "allowed_destination_addresses", "destination_address", "name", "binding" ]); return isValid2; }, "validateSendEmailBinding"); var validateQueueBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"queue" bindings should be objects, but got ${JSON.stringify(value)}` ); return false; } if (!validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "binding", "queue", "delivery_delay" ])) { return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "binding" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isRequiredProperty(value, "queue", "string") || value.queue.length === 0) { diagnostics.errors.push( `"${field}" bindings should have a string "queue" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } const options32 = [{ key: "delivery_delay", type: "number" }]; for (const optionalOpt of options32) { if (!isOptionalProperty(value, optionalOpt.key, optionalOpt.type)) { diagnostics.errors.push( `"${field}" should, optionally, have a ${optionalOpt.type} "${optionalOpt.key}" field but got ${JSON.stringify(value)}.` ); isValid2 = false; } } return isValid2; }, "validateQueueBinding"); var validateR2Binding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"r2_buckets" bindings should be objects, but got ${JSON.stringify( value )}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "binding" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (getFlag("RESOURCES_PROVISION") ? !isOptionalProperty(value, "bucket_name", "string") || value.bucket_name !== void 0 && value.bucket_name.length === 0 : !isRequiredProperty(value, "bucket_name", "string") || value.bucket_name.length === 0) { diagnostics.errors.push( `"${field}" bindings should have a string "bucket_name" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (isValid2 && hasProperty(value, "bucket_name") && !isValidR2BucketName(value.bucket_name)) { diagnostics.errors.push( `${field}.bucket_name=${JSON.stringify(value.bucket_name)} is invalid. ${bucketFormatMessage}` ); isValid2 = false; } if (!isOptionalProperty(value, "preview_bucket_name", "string")) { diagnostics.errors.push( `"${field}" bindings should, optionally, have a string "preview_bucket_name" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (isValid2 && hasProperty(value, "preview_bucket_name") && !isValidR2BucketName(value.preview_bucket_name)) { diagnostics.errors.push( `${field}.preview_bucket_name= ${JSON.stringify(value.preview_bucket_name)} is invalid. ${bucketFormatMessage}` ); isValid2 = false; } if (!isOptionalProperty(value, "jurisdiction", "string")) { diagnostics.errors.push( `"${field}" bindings should, optionally, have a string "jurisdiction" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "binding", "bucket_name", "preview_bucket_name", "jurisdiction" ]); return isValid2; }, "validateR2Binding"); var validateD1Binding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"d1_databases" bindings should be objects, but got ${JSON.stringify( value )}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "binding" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (getFlag("RESOURCES_PROVISION") ? !isOptionalProperty(value, "database_id", "string") : ( // TODO: allow name only, where we look up the ID dynamically // !isOptionalProperty(value, "database_name", "string") && !isRequiredProperty(value, "database_id", "string") )) { diagnostics.errors.push( `"${field}" bindings must have a "database_id" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isOptionalProperty(value, "preview_database_id", "string")) { diagnostics.errors.push( `"${field}" bindings should, optionally, have a string "preview_database_id" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "binding", "database_id", "database_internal_env", "database_name", "migrations_dir", "migrations_table", "preview_database_id" ]); return isValid2; }, "validateD1Binding"); var validateVectorizeBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"vectorize" bindings should be objects, but got ${JSON.stringify(value)}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "binding" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isRequiredProperty(value, "index_name", "string")) { diagnostics.errors.push( `"${field}" bindings must have an "index_name" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "binding", "index_name" ]); return isValid2; }, "validateVectorizeBinding"); var validateHyperdriveBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"hyperdrive" bindings should be objects, but got ${JSON.stringify( value )}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "binding" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isRequiredProperty(value, "id", "string")) { diagnostics.errors.push( `"${field}" bindings must have a "id" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "binding", "id", "localConnectionString" ]); return isValid2; }, "validateHyperdriveBinding"); var validateBindingsHaveUniqueNames = /* @__PURE__ */ __name((diagnostics, config) => { let hasDuplicates = false; const bindingNamesArray = Object.entries(friendlyBindingNames); const bindingsGroupedByType = Object.fromEntries( bindingNamesArray.map(([bindingType, binding]) => [ binding, getBindingNames( bindingType === "queues" ? config[bindingType]?.producers : config[bindingType] ) ]) ); const bindingsGroupedByName = {}; for (const bindingType in bindingsGroupedByType) { const bindingNames = bindingsGroupedByType[bindingType]; for (const bindingName of bindingNames) { if (!(bindingName in bindingsGroupedByName)) { bindingsGroupedByName[bindingName] = []; } if (bindingName === "ASSETS" && isPagesConfig(config)) { diagnostics.errors.push( `The name 'ASSETS' is reserved in Pages projects. Please use a different name for your ${bindingType} binding.` ); } bindingsGroupedByName[bindingName].push(bindingType); } } for (const bindingName in bindingsGroupedByName) { const bindingTypes = bindingsGroupedByName[bindingName]; if (bindingTypes.length < 2) { continue; } hasDuplicates = true; const sameType = bindingTypes.filter((type, i5) => bindingTypes.indexOf(type) !== i5).filter( (type, i5, duplicateBindingTypes) => duplicateBindingTypes.indexOf(type) === i5 ); const differentTypes = bindingTypes.filter( (type, i5) => bindingTypes.indexOf(type) === i5 ); if (differentTypes.length > 1) { diagnostics.errors.push( `${bindingName} assigned to ${ENGLISH.format(differentTypes)} bindings.` ); } sameType.forEach((bindingType) => { diagnostics.errors.push( `${bindingName} assigned to multiple ${bindingType} bindings.` ); }); } if (hasDuplicates) { const problem = "Bindings must have unique names, so that they can all be referenced in the worker."; const resolution = "Please change your bindings to have unique names."; diagnostics.errors.push(`${problem} ${resolution}`); } return !hasDuplicates; }, "validateBindingsHaveUniqueNames"); var validateServiceBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"services" bindings should be objects, but got ${JSON.stringify(value)}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "binding" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isRequiredProperty(value, "service", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "service" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isOptionalProperty(value, "environment", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "environment" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isOptionalProperty(value, "entrypoint", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "entrypoint" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } return isValid2; }, "validateServiceBinding"); var validateAnalyticsEngineBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"analytics_engine" bindings should be objects, but got ${JSON.stringify( value )}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "binding" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isOptionalProperty(value, "dataset", "string") || value.dataset?.length === 0) { diagnostics.errors.push( `"${field}" bindings should, optionally, have a string "dataset" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "binding", "dataset" ]); return isValid2; }, "validateAnalyticsEngineBinding"); var validateWorkerNamespaceBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"${field}" binding should be objects, but got ${JSON.stringify(value)}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push( `"${field}" should have a string "binding" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isRequiredProperty(value, "namespace", "string")) { diagnostics.errors.push( `"${field}" should have a string "namespace" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (hasProperty(value, "outbound")) { if (!validateWorkerNamespaceOutbound( diagnostics, `${field}.outbound`, value.outbound ?? {} )) { diagnostics.errors.push(`"${field}" has an invalid outbound definition.`); isValid2 = false; } } return isValid2; }, "validateWorkerNamespaceBinding"); function validateWorkerNamespaceOutbound(diagnostics, field, value) { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"${field}" should be an object, but got ${JSON.stringify(value)}` ); return false; } let isValid2 = true; isValid2 = isValid2 && validateRequiredProperty( diagnostics, field, "service", value.service, "string" ); isValid2 = isValid2 && validateOptionalProperty( diagnostics, field, "environment", value.environment, "string" ); isValid2 = isValid2 && validateOptionalTypedArray( diagnostics, `${field}.parameters`, value.parameters, "string" ); return isValid2; } __name(validateWorkerNamespaceOutbound, "validateWorkerNamespaceOutbound"); var validateMTlsCertificateBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"mtls_certificates" bindings should be objects, but got ${JSON.stringify( value )}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push( `"${field}" bindings should have a string "binding" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isRequiredProperty(value, "certificate_id", "string") || value.certificate_id.length === 0) { diagnostics.errors.push( `"${field}" bindings should have a string "certificate_id" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "binding", "certificate_id" ]); return isValid2; }, "validateMTlsCertificateBinding"); function validateQueues(envName) { return (diagnostics, field, value, config) => { const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`; if (typeof value !== "object" || Array.isArray(value) || value === null) { diagnostics.errors.push( `The field "${fieldPath}" should be an object but got ${JSON.stringify( value )}.` ); return false; } let isValid2 = true; if (!validateAdditionalProperties( diagnostics, fieldPath, Object.keys(value), ["consumers", "producers"] )) { isValid2 = false; } if (hasProperty(value, "consumers")) { const consumers2 = value.consumers; if (!Array.isArray(consumers2)) { diagnostics.errors.push( `The field "${fieldPath}.consumers" should be an array but got ${JSON.stringify( consumers2 )}.` ); isValid2 = false; } for (let i5 = 0; i5 < consumers2.length; i5++) { const consumer = consumers2[i5]; const consumerPath = `${fieldPath}.consumers[${i5}]`; if (!validateConsumer(diagnostics, consumerPath, consumer, config)) { isValid2 = false; } } } if (hasProperty(value, "producers")) { if (!validateBindingArray(envName, validateQueueBinding)( diagnostics, `${field}.producers`, value.producers, config )) { isValid2 = false; } } return isValid2; }; } __name(validateQueues, "validateQueues"); var validateConsumer = /* @__PURE__ */ __name((diagnostics, field, value, _config) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"${field}" should be a objects, but got ${JSON.stringify(value)}` ); return false; } let isValid2 = true; if (!validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "queue", "type", "max_batch_size", "max_batch_timeout", "max_retries", "dead_letter_queue", "max_concurrency", "visibility_timeout_ms", "retry_delay" ])) { isValid2 = false; } if (!isRequiredProperty(value, "queue", "string")) { diagnostics.errors.push( `"${field}" should have a string "queue" field but got ${JSON.stringify( value )}.` ); } const options32 = [ { key: "type", type: "string" }, { key: "max_batch_size", type: "number" }, { key: "max_batch_timeout", type: "number" }, { key: "max_retries", type: "number" }, { key: "dead_letter_queue", type: "string" }, { key: "max_concurrency", type: "number" }, { key: "visibility_timeout_ms", type: "number" }, { key: "retry_delay", type: "number" } ]; for (const optionalOpt of options32) { if (!isOptionalProperty(value, optionalOpt.key, optionalOpt.type)) { diagnostics.errors.push( `"${field}" should, optionally, have a ${optionalOpt.type} "${optionalOpt.key}" field but got ${JSON.stringify(value)}.` ); isValid2 = false; } } return isValid2; }, "validateConsumer"); var validateCompatibilityDate = /* @__PURE__ */ __name((diagnostics, field, value) => { if (value === void 0) { return true; } if (typeof value !== "string") { diagnostics.errors.push( `Expected "${field}" to be of type string but got ${JSON.stringify(value)}.` ); return false; } return isValidDateTimeStringFormat(diagnostics, field, value); }, "validateCompatibilityDate"); var validatePipelineBinding = /* @__PURE__ */ __name((diagnostics, field, value) => { if (typeof value !== "object" || value === null) { diagnostics.errors.push( `"pipeline" bindings should be objects, but got ${JSON.stringify(value)}` ); return false; } let isValid2 = true; if (!isRequiredProperty(value, "binding", "string")) { diagnostics.errors.push( `"${field}" bindings must have a string "binding" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } if (!isRequiredProperty(value, "pipeline", "string")) { diagnostics.errors.push( `"${field}" bindings must have a string "pipeline" field but got ${JSON.stringify( value )}.` ); isValid2 = false; } validateAdditionalProperties(diagnostics, field, Object.keys(value), [ "binding", "pipeline" ]); return isValid2; }, "validatePipelineBinding"); function normalizeAndValidateLimits(diagnostics, topLevelEnv, rawEnv) { if (rawEnv.limits) { validateRequiredProperty( diagnostics, "limits", "cpu_ms", rawEnv.limits.cpu_ms, "number" ); } return inheritable( diagnostics, topLevelEnv, rawEnv, "limits", () => true, void 0 ); } __name(normalizeAndValidateLimits, "normalizeAndValidateLimits"); var validateMigrations = /* @__PURE__ */ __name((diagnostics, field, value) => { const rawMigrations = value ?? []; if (!Array.isArray(rawMigrations)) { diagnostics.errors.push( `The optional "${field}" field should be an array, but got ${JSON.stringify( rawMigrations )}` ); return false; } let valid = true; for (let i5 = 0; i5 < rawMigrations.length; i5++) { const { tag, new_classes, new_sqlite_classes, renamed_classes, deleted_classes, transferred_classes, ...rest } = rawMigrations[i5]; valid = validateAdditionalProperties( diagnostics, "migrations", Object.keys(rest), [] ) && valid; valid = validateRequiredProperty( diagnostics, `migrations[${i5}]`, `tag`, tag, "string" ) && valid; valid = validateOptionalTypedArray( diagnostics, `migrations[${i5}].new_classes`, new_classes, "string" ) && valid; valid = validateOptionalTypedArray( diagnostics, `migrations[${i5}].new_sqlite_classes`, new_sqlite_classes, "string" ) && valid; if (renamed_classes !== void 0) { if (!Array.isArray(renamed_classes)) { diagnostics.errors.push( `Expected "migrations[${i5}].renamed_classes" to be an array of "{from: string, to: string}" objects but got ${JSON.stringify( renamed_classes )}.` ); valid = false; } else if (renamed_classes.some( (c6) => typeof c6 !== "object" || !isRequiredProperty(c6, "from", "string") || !isRequiredProperty(c6, "to", "string") )) { diagnostics.errors.push( `Expected "migrations[${i5}].renamed_classes" to be an array of "{from: string, to: string}" objects but got ${JSON.stringify( renamed_classes )}.` ); valid = false; } } if (transferred_classes !== void 0) { if (!Array.isArray(transferred_classes)) { diagnostics.errors.push( `Expected "migrations[${i5}].transferred_classes" to be an array of "{from: string, from_script: string, to: string}" objects but got ${JSON.stringify( transferred_classes )}.` ); valid = false; } else if (transferred_classes.some( (c6) => typeof c6 !== "object" || !isRequiredProperty(c6, "from", "string") || !isRequiredProperty(c6, "from_script", "string") || !isRequiredProperty(c6, "to", "string") )) { diagnostics.errors.push( `Expected "migrations[${i5}].transferred_classes" to be an array of "{from: string, from_script: string, to: string}" objects but got ${JSON.stringify( transferred_classes )}.` ); valid = false; } } valid = validateOptionalTypedArray( diagnostics, `migrations[${i5}].deleted_classes`, deleted_classes, "string" ) && valid; } return valid; }, "validateMigrations"); var validateObservability = /* @__PURE__ */ __name((diagnostics, field, value) => { if (value === void 0) { return true; } if (typeof value !== "object") { diagnostics.errors.push( `"${field}" should be an object but got ${JSON.stringify(value)}.` ); return false; } const val2 = value; let isValid2 = true; isValid2 = validateAtLeastOnePropertyRequired(diagnostics, field, [ { key: "enabled", value: val2.enabled, type: "boolean" }, { key: "logs.enabled", value: val2.logs?.enabled, type: "boolean" } ]) && isValid2; isValid2 = validateOptionalProperty( diagnostics, field, "head_sampling_rate", val2.head_sampling_rate, "number" ) && isValid2; isValid2 = validateOptionalProperty(diagnostics, field, "logs", val2.logs, "object") && isValid2; isValid2 = validateAdditionalProperties(diagnostics, field, Object.keys(val2), [ "enabled", "head_sampling_rate", "logs" ]) && isValid2; if (typeof val2.logs === "object") { isValid2 = validateOptionalProperty( diagnostics, field, "logs.enabled", val2.logs.enabled, "boolean" ) && isValid2; isValid2 = validateOptionalProperty( diagnostics, field, "logs.head_sampling_rate", val2.logs.head_sampling_rate, "number" ) && isValid2; isValid2 = validateOptionalProperty( diagnostics, field, "logs.invocation_logs", val2.logs.invocation_logs, "boolean" ) && isValid2; isValid2 = validateAdditionalProperties(diagnostics, field, Object.keys(val2.logs), [ "enabled", "head_sampling_rate", "invocation_logs", "persist" ]) && isValid2; } const samplingRate = val2?.head_sampling_rate; if (samplingRate && (samplingRate < 0 || samplingRate > 1)) { diagnostics.errors.push( `"${field}.head_sampling_rate" must be a value between 0 and 1.` ); } return isValid2; }, "validateObservability"); function warnIfDurableObjectsHaveNoMigrations(diagnostics, durableObjects, migrations, configPath) { if (Array.isArray(durableObjects.bindings) && durableObjects.bindings.length > 0) { const exportedDurableObjects = (durableObjects.bindings || []).filter( (binding) => !binding.script_name ); if (exportedDurableObjects.length > 0 && migrations.length === 0) { if (!exportedDurableObjects.some( (exportedDurableObject) => typeof exportedDurableObject.class_name !== "string" )) { const durableObjectClassnames = exportedDurableObjects.map( (durable) => durable.class_name ); diagnostics.warnings.push(dedent` In your ${configFileName(configPath)} file, you have configured \`durable_objects\` exported by this Worker (${durableObjectClassnames.join(", ")}), but no \`migrations\` for them. This may not work as expected until you add a \`migrations\` section to your ${configFileName(configPath)} file. Add the following configuration: \`\`\` ${formatConfigSnippet( { migrations: [{ tag: "v1", new_classes: durableObjectClassnames }] }, configPath )} \`\`\` Refer to https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/ for more details.`); } } } } __name(warnIfDurableObjectsHaveNoMigrations, "warnIfDurableObjectsHaveNoMigrations"); // src/config/validation-pages.ts init_import_meta_url(); // src/config/config.ts init_import_meta_url(); var defaultWranglerConfig = { /* COMPUTED_FIELDS */ configPath: void 0, userConfigPath: void 0, topLevelName: void 0, /*====================================================*/ /* Fields supported by both Workers & Pages */ /*====================================================*/ /* TOP-LEVEL ONLY FIELDS */ pages_build_output_dir: void 0, send_metrics: void 0, dev: { ip: process.platform === "win32" ? "127.0.0.1" : "localhost", port: void 0, // the default of 8787 is set at runtime inspector_port: void 0, // the default of 9229 is set at runtime local_protocol: "http", upstream_protocol: "http", host: void 0 }, /** INHERITABLE ENVIRONMENT FIELDS **/ name: void 0, compatibility_date: void 0, compatibility_flags: [], limits: void 0, placement: void 0, /** NON-INHERITABLE ENVIRONMENT FIELDS **/ vars: {}, durable_objects: { bindings: [] }, kv_namespaces: [], queues: { producers: [], consumers: [] // WORKERS SUPPORT ONLY!! }, r2_buckets: [], d1_databases: [], vectorize: [], hyperdrive: [], workflows: [], services: [], analytics_engine_datasets: [], ai: void 0, images: void 0, version_metadata: void 0, /*====================================================*/ /* Fields supported by Workers only */ /*====================================================*/ /* TOP-LEVEL ONLY FIELDS */ legacy_env: true, site: void 0, legacy_assets: void 0, wasm_modules: void 0, text_blobs: void 0, data_blobs: void 0, keep_vars: void 0, alias: void 0, /** INHERITABLE ENVIRONMENT FIELDS **/ account_id: void 0, main: void 0, find_additional_modules: void 0, preserve_file_names: void 0, base_dir: void 0, workers_dev: void 0, preview_urls: true, route: void 0, routes: void 0, tsconfig: void 0, jsx_factory: "React.createElement", jsx_fragment: "React.Fragment", migrations: [], triggers: { crons: void 0 }, usage_model: void 0, rules: [], build: { command: void 0, watch_dir: "./src", cwd: void 0 }, no_bundle: void 0, minify: void 0, node_compat: void 0, dispatch_namespaces: [], first_party_worker: void 0, zone_id: void 0, logfwdr: { bindings: [] }, logpush: void 0, upload_source_maps: void 0, assets: void 0, observability: { enabled: true }, /** NON-INHERITABLE ENVIRONMENT FIELDS **/ define: {}, cloudchamber: {}, containers: { app: [] }, send_email: [], browser: void 0, unsafe: {}, mtls_certificates: [], tail_consumers: void 0, pipelines: [] }; // src/config/validation-pages.ts var supportedPagesConfigFields = [ "pages_build_output_dir", "name", "compatibility_date", "compatibility_flags", "send_metrics", "no_bundle", "limits", "placement", "vars", "durable_objects", "kv_namespaces", "queues", // `producers` ONLY "r2_buckets", "d1_databases", "vectorize", "hyperdrive", "services", "analytics_engine_datasets", "ai", "version_metadata", "dev", "mtls_certificates", "browser", "upload_source_maps", // normalizeAndValidateConfig() sets these values "configPath", "userConfigPath", "topLevelName" ]; function validatePagesConfig(config, envNames, projectName) { if (!config.pages_build_output_dir) { throw new FatalError(`Attempting to validate Pages configuration file, but "pages_build_output_dir" field was not found. "pages_build_output_dir" is required for Pages projects.`); } const diagnostics = new Diagnostics( `Running configuration file validation for Pages:` ); validateMainField(config, diagnostics); validateProjectName(projectName, diagnostics); validatePagesEnvironmentNames(envNames, diagnostics); validateUnsupportedFields(config, diagnostics); validateDurableObjectBinding2(config, diagnostics); return diagnostics; } __name(validatePagesConfig, "validatePagesConfig"); function validateMainField(config, diagnostics) { if (config.main !== void 0) { diagnostics.errors.push( `Configuration file cannot contain both both "main" and "pages_build_output_dir" configuration keys. Please use "main" if you are deploying a Worker, or "pages_build_output_dir" if you are deploying a Pages project.` ); } } __name(validateMainField, "validateMainField"); function validateProjectName(name2, diagnostics) { if (name2 === void 0 || name2.trim() === "") { diagnostics.errors.push( `Missing top-level field "name" in configuration file. Pages requires the name of your project to be configured at the top-level of your Wrangler configuration file. This is because, in Pages, environments target the same project.` ); } } __name(validateProjectName, "validateProjectName"); function validatePagesEnvironmentNames(envNames, diagnostics) { if (!envNames?.length) { return; } const unsupportedPagesEnvNames = envNames.filter( (name2) => name2 !== "preview" && name2 !== "production" ); if (unsupportedPagesEnvNames.length > 0) { diagnostics.errors.push( `Configuration file contains the following environment names that are not supported by Pages projects: ${unsupportedPagesEnvNames.map((name2) => `"${name2}"`).join()}. The supported named-environments for Pages are "preview" and "production".` ); } } __name(validatePagesEnvironmentNames, "validatePagesEnvironmentNames"); function validateUnsupportedFields(config, diagnostics) { const unsupportedFields = new Set(Object.keys(config)); for (const field of supportedPagesConfigFields) { if (field === "queues" && config.queues?.consumers?.length) { continue; } unsupportedFields.delete(field); } for (const field of unsupportedFields) { if (config[field] === void 0 || JSON.stringify(config[field]) === JSON.stringify(defaultWranglerConfig[field])) { unsupportedFields.delete(field); } } if (unsupportedFields.size > 0) { const fields = Array.from(unsupportedFields.keys()); fields.forEach((field) => { if (field === "queues" && config.queues?.consumers?.length) { diagnostics.errors.push( `Configuration file for Pages projects does not support "queues.consumers"` ); } else { diagnostics.errors.push( `Configuration file for Pages projects does not support "${field}"` ); } }); } } __name(validateUnsupportedFields, "validateUnsupportedFields"); function validateDurableObjectBinding2(config, diagnostics) { if (config.durable_objects.bindings.length > 0) { const invalidBindings = config.durable_objects.bindings.filter( (binding) => !isRequiredProperty(binding, "script_name", "string") ); if (invalidBindings.length > 0) { diagnostics.errors.push( `Durable Objects bindings should specify a "script_name". Pages requires Durable Object bindings to specify the name of the Worker where the Durable Object is defined.` ); } } } __name(validateDurableObjectBinding2, "validateDurableObjectBinding"); // src/config/index.ts function configFormat(configPath) { if (configPath?.endsWith("toml")) { return "toml"; } else if (configPath?.endsWith("json") || configPath?.endsWith("jsonc")) { return "jsonc"; } return "none"; } __name(configFormat, "configFormat"); function configFileName(configPath) { const format11 = configFormat(configPath); if (format11 === "toml") { return "wrangler.toml"; } else if (format11 === "jsonc") { return "wrangler.json"; } else { return "Wrangler configuration"; } } __name(configFileName, "configFileName"); function formatConfigSnippet(snippet, configPath, formatted = true) { const format11 = configFormat(configPath); if (format11 === "toml") { return import_toml3.default.stringify(snippet); } else { return formatted ? JSON.stringify(snippet, null, 2) : JSON.stringify(snippet); } } __name(formatConfigSnippet, "formatConfigSnippet"); function readConfig(args, options32 = {}) { const { rawConfig, configPath, userConfigPath } = experimental_readRawConfig( args, options32 ); const { config, diagnostics } = normalizeAndValidateConfig( rawConfig, configPath, userConfigPath, args ); if (diagnostics.hasWarnings() && !options32?.hideWarnings) { logger.warn(diagnostics.renderWarnings()); } if (diagnostics.hasErrors()) { throw new UserError(diagnostics.renderErrors()); } return config; } __name(readConfig, "readConfig"); function readPagesConfig(args, options32 = {}) { let rawConfig; let configPath; let userConfigPath; try { ({ rawConfig, configPath, userConfigPath } = experimental_readRawConfig( args, options32 )); } catch (e7) { logger.error(e7); throw new FatalError( `Your ${configFileName(configPath)} file is not a valid Pages configuration file`, EXIT_CODE_INVALID_PAGES_CONFIG ); } if (!isPagesConfig(rawConfig)) { throw new FatalError( `Your ${configFileName(configPath)} file is not a valid Pages configuration file`, EXIT_CODE_INVALID_PAGES_CONFIG ); } const { config, diagnostics } = normalizeAndValidateConfig( rawConfig, configPath, userConfigPath, args ); if (diagnostics.hasWarnings() && !options32.hideWarnings) { logger.warn(diagnostics.renderWarnings()); } if (diagnostics.hasErrors()) { throw new UserError(diagnostics.renderErrors()); } logger.debug( `Configuration file belonging to \u26A1\uFE0F Pages \u26A1\uFE0F project detected.` ); const envNames = rawConfig.env ? Object.keys(rawConfig.env) : []; const projectName = rawConfig?.name; const pagesDiagnostics = validatePagesConfig(config, envNames, projectName); if (pagesDiagnostics.hasWarnings()) { logger.warn(pagesDiagnostics.renderWarnings()); } if (pagesDiagnostics.hasErrors()) { throw new UserError(pagesDiagnostics.renderErrors()); } return config; } __name(readPagesConfig, "readPagesConfig"); var experimental_readRawConfig = /* @__PURE__ */ __name((args, options32 = {}) => { const { configPath, userConfigPath } = resolveWranglerConfigPath( args, options32 ); let rawConfig = {}; if (configPath?.endsWith("toml")) { rawConfig = parseTOML(readFileSync5(configPath), configPath); } else if (configPath?.endsWith("json") || configPath?.endsWith("jsonc")) { rawConfig = parseJSONC(readFileSync5(configPath), configPath); } return { rawConfig, configPath, userConfigPath }; }, "experimental_readRawConfig"); function withConfig(handler31, options32) { return (args) => { return handler31({ ...args, config: readConfig(args, options32) }); }; } __name(withConfig, "withConfig"); function tryLoadDotEnv(basePath) { try { const contents = maybeGetFile(basePath); if (contents === void 0) { logger.debug( `.env file not found at "${import_node_path11.default.relative(".", basePath)}". Continuing... For more details, refer to https://developers.cloudflare.com/workers/wrangler/system-environment-variables/` ); return; } const parsed = import_dotenv.default.parse(contents); return { path: basePath, parsed }; } catch (e7) { logger.debug( `Failed to load .env file "${import_node_path11.default.relative(".", basePath)}":`, e7 ); } } __name(tryLoadDotEnv, "tryLoadDotEnv"); function loadDotEnv(envPath, env6) { if (env6 === void 0) { return tryLoadDotEnv(envPath); } else { return tryLoadDotEnv(`${envPath}.${env6}`) ?? tryLoadDotEnv(envPath); } } __name(loadDotEnv, "loadDotEnv"); // src/config-cache.ts init_import_meta_url(); var import_fs6 = require("fs"); var path11 = __toESM(require("path")); // src/is-interactive.ts init_import_meta_url(); // ../cli/interactive.ts init_import_meta_url(); // ../../node_modules/.pnpm/@clack+core@0.3.2/node_modules/@clack/core/dist/index.mjs init_import_meta_url(); var import_sisteransi = __toESM(require_src(), 1); var import_node_process3 = require("node:process"); var import_node_readline = __toESM(require("node:readline"), 1); var import_node_tty2 = require("node:tty"); var import_picocolors = __toESM(require_picocolors(), 1); function z({ onlyFirst: t7 = false } = {}) { const u5 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|"); return new RegExp(u5, t7 ? void 0 : "g"); } __name(z, "z"); function $(t7) { if (typeof t7 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t7}\``); return t7.replace(z(), ""); } __name($, "$"); var m = {}; var G = { get exports() { return m; }, set exports(t7) { m = t7; } }; (function(t7) { var u5 = {}; t7.exports = u5, u5.eastAsianWidth = function(e7) { var s5 = e7.charCodeAt(0), C3 = e7.length == 2 ? e7.charCodeAt(1) : 0, D3 = s5; return 55296 <= s5 && s5 <= 56319 && 56320 <= C3 && C3 <= 57343 && (s5 &= 1023, C3 &= 1023, D3 = s5 << 10 | C3, D3 += 65536), D3 == 12288 || 65281 <= D3 && D3 <= 65376 || 65504 <= D3 && D3 <= 65510 ? "F" : D3 == 8361 || 65377 <= D3 && D3 <= 65470 || 65474 <= D3 && D3 <= 65479 || 65482 <= D3 && D3 <= 65487 || 65490 <= D3 && D3 <= 65495 || 65498 <= D3 && D3 <= 65500 || 65512 <= D3 && D3 <= 65518 ? "H" : 4352 <= D3 && D3 <= 4447 || 4515 <= D3 && D3 <= 4519 || 4602 <= D3 && D3 <= 4607 || 9001 <= D3 && D3 <= 9002 || 11904 <= D3 && D3 <= 11929 || 11931 <= D3 && D3 <= 12019 || 12032 <= D3 && D3 <= 12245 || 12272 <= D3 && D3 <= 12283 || 12289 <= D3 && D3 <= 12350 || 12353 <= D3 && D3 <= 12438 || 12441 <= D3 && D3 <= 12543 || 12549 <= D3 && D3 <= 12589 || 12593 <= D3 && D3 <= 12686 || 12688 <= D3 && D3 <= 12730 || 12736 <= D3 && D3 <= 12771 || 12784 <= D3 && D3 <= 12830 || 12832 <= D3 && D3 <= 12871 || 12880 <= D3 && D3 <= 13054 || 13056 <= D3 && D3 <= 19903 || 19968 <= D3 && D3 <= 42124 || 42128 <= D3 && D3 <= 42182 || 43360 <= D3 && D3 <= 43388 || 44032 <= D3 && D3 <= 55203 || 55216 <= D3 && D3 <= 55238 || 55243 <= D3 && D3 <= 55291 || 63744 <= D3 && D3 <= 64255 || 65040 <= D3 && D3 <= 65049 || 65072 <= D3 && D3 <= 65106 || 65108 <= D3 && D3 <= 65126 || 65128 <= D3 && D3 <= 65131 || 110592 <= D3 && D3 <= 110593 || 127488 <= D3 && D3 <= 127490 || 127504 <= D3 && D3 <= 127546 || 127552 <= D3 && D3 <= 127560 || 127568 <= D3 && D3 <= 127569 || 131072 <= D3 && D3 <= 194367 || 177984 <= D3 && D3 <= 196605 || 196608 <= D3 && D3 <= 262141 ? "W" : 32 <= D3 && D3 <= 126 || 162 <= D3 && D3 <= 163 || 165 <= D3 && D3 <= 166 || D3 == 172 || D3 == 175 || 10214 <= D3 && D3 <= 10221 || 10629 <= D3 && D3 <= 10630 ? "Na" : D3 == 161 || D3 == 164 || 167 <= D3 && D3 <= 168 || D3 == 170 || 173 <= D3 && D3 <= 174 || 176 <= D3 && D3 <= 180 || 182 <= D3 && D3 <= 186 || 188 <= D3 && D3 <= 191 || D3 == 198 || D3 == 208 || 215 <= D3 && D3 <= 216 || 222 <= D3 && D3 <= 225 || D3 == 230 || 232 <= D3 && D3 <= 234 || 236 <= D3 && D3 <= 237 || D3 == 240 || 242 <= D3 && D3 <= 243 || 247 <= D3 && D3 <= 250 || D3 == 252 || D3 == 254 || D3 == 257 || D3 == 273 || D3 == 275 || D3 == 283 || 294 <= D3 && D3 <= 295 || D3 == 299 || 305 <= D3 && D3 <= 307 || D3 == 312 || 319 <= D3 && D3 <= 322 || D3 == 324 || 328 <= D3 && D3 <= 331 || D3 == 333 || 338 <= D3 && D3 <= 339 || 358 <= D3 && D3 <= 359 || D3 == 363 || D3 == 462 || D3 == 464 || D3 == 466 || D3 == 468 || D3 == 470 || D3 == 472 || D3 == 474 || D3 == 476 || D3 == 593 || D3 == 609 || D3 == 708 || D3 == 711 || 713 <= D3 && D3 <= 715 || D3 == 717 || D3 == 720 || 728 <= D3 && D3 <= 731 || D3 == 733 || D3 == 735 || 768 <= D3 && D3 <= 879 || 913 <= D3 && D3 <= 929 || 931 <= D3 && D3 <= 937 || 945 <= D3 && D3 <= 961 || 963 <= D3 && D3 <= 969 || D3 == 1025 || 1040 <= D3 && D3 <= 1103 || D3 == 1105 || D3 == 8208 || 8211 <= D3 && D3 <= 8214 || 8216 <= D3 && D3 <= 8217 || 8220 <= D3 && D3 <= 8221 || 8224 <= D3 && D3 <= 8226 || 8228 <= D3 && D3 <= 8231 || D3 == 8240 || 8242 <= D3 && D3 <= 8243 || D3 == 8245 || D3 == 8251 || D3 == 8254 || D3 == 8308 || D3 == 8319 || 8321 <= D3 && D3 <= 8324 || D3 == 8364 || D3 == 8451 || D3 == 8453 || D3 == 8457 || D3 == 8467 || D3 == 8470 || 8481 <= D3 && D3 <= 8482 || D3 == 8486 || D3 == 8491 || 8531 <= D3 && D3 <= 8532 || 8539 <= D3 && D3 <= 8542 || 8544 <= D3 && D3 <= 8555 || 8560 <= D3 && D3 <= 8569 || D3 == 8585 || 8592 <= D3 && D3 <= 8601 || 8632 <= D3 && D3 <= 8633 || D3 == 8658 || D3 == 8660 || D3 == 8679 || D3 == 8704 || 8706 <= D3 && D3 <= 8707 || 8711 <= D3 && D3 <= 8712 || D3 == 8715 || D3 == 8719 || D3 == 8721 || D3 == 8725 || D3 == 8730 || 8733 <= D3 && D3 <= 8736 || D3 == 8739 || D3 == 8741 || 8743 <= D3 && D3 <= 8748 || D3 == 8750 || 8756 <= D3 && D3 <= 8759 || 8764 <= D3 && D3 <= 8765 || D3 == 8776 || D3 == 8780 || D3 == 8786 || 8800 <= D3 && D3 <= 8801 || 8804 <= D3 && D3 <= 8807 || 8810 <= D3 && D3 <= 8811 || 8814 <= D3 && D3 <= 8815 || 8834 <= D3 && D3 <= 8835 || 8838 <= D3 && D3 <= 8839 || D3 == 8853 || D3 == 8857 || D3 == 8869 || D3 == 8895 || D3 == 8978 || 9312 <= D3 && D3 <= 9449 || 9451 <= D3 && D3 <= 9547 || 9552 <= D3 && D3 <= 9587 || 9600 <= D3 && D3 <= 9615 || 9618 <= D3 && D3 <= 9621 || 9632 <= D3 && D3 <= 9633 || 9635 <= D3 && D3 <= 9641 || 9650 <= D3 && D3 <= 9651 || 9654 <= D3 && D3 <= 9655 || 9660 <= D3 && D3 <= 9661 || 9664 <= D3 && D3 <= 9665 || 9670 <= D3 && D3 <= 9672 || D3 == 9675 || 9678 <= D3 && D3 <= 9681 || 9698 <= D3 && D3 <= 9701 || D3 == 9711 || 9733 <= D3 && D3 <= 9734 || D3 == 9737 || 9742 <= D3 && D3 <= 9743 || 9748 <= D3 && D3 <= 9749 || D3 == 9756 || D3 == 9758 || D3 == 9792 || D3 == 9794 || 9824 <= D3 && D3 <= 9825 || 9827 <= D3 && D3 <= 9829 || 9831 <= D3 && D3 <= 9834 || 9836 <= D3 && D3 <= 9837 || D3 == 9839 || 9886 <= D3 && D3 <= 9887 || 9918 <= D3 && D3 <= 9919 || 9924 <= D3 && D3 <= 9933 || 9935 <= D3 && D3 <= 9953 || D3 == 9955 || 9960 <= D3 && D3 <= 9983 || D3 == 10045 || D3 == 10071 || 10102 <= D3 && D3 <= 10111 || 11093 <= D3 && D3 <= 11097 || 12872 <= D3 && D3 <= 12879 || 57344 <= D3 && D3 <= 63743 || 65024 <= D3 && D3 <= 65039 || D3 == 65533 || 127232 <= D3 && D3 <= 127242 || 127248 <= D3 && D3 <= 127277 || 127280 <= D3 && D3 <= 127337 || 127344 <= D3 && D3 <= 127386 || 917760 <= D3 && D3 <= 917999 || 983040 <= D3 && D3 <= 1048573 || 1048576 <= D3 && D3 <= 1114109 ? "A" : "N"; }, u5.characterLength = function(e7) { var s5 = this.eastAsianWidth(e7); return s5 == "F" || s5 == "W" || s5 == "A" ? 2 : 1; }; function F3(e7) { return e7.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || []; } __name(F3, "F"); u5.length = function(e7) { for (var s5 = F3(e7), C3 = 0, D3 = 0; D3 < s5.length; D3++) C3 = C3 + this.characterLength(s5[D3]); return C3; }, u5.slice = function(e7, s5, C3) { textLen = u5.length(e7), s5 = s5 || 0, C3 = C3 || 1, s5 < 0 && (s5 = textLen + s5), C3 < 0 && (C3 = textLen + C3); for (var D3 = "", i5 = 0, o5 = F3(e7), E3 = 0; E3 < o5.length; E3++) { var a5 = o5[E3], n6 = u5.length(a5); if (i5 >= s5 - (n6 == 2 ? 1 : 0)) if (i5 + n6 <= C3) D3 += a5; else break; i5 += n6; } return D3; }; })(G); var K = m; var Y = /* @__PURE__ */ __name(function() { return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; }, "Y"); function c(t7, u5 = {}) { if (typeof t7 != "string" || t7.length === 0 || (u5 = { ambiguousIsNarrow: true, ...u5 }, t7 = $(t7), t7.length === 0)) return 0; t7 = t7.replace(Y(), " "); const F3 = u5.ambiguousIsNarrow ? 1 : 2; let e7 = 0; for (const s5 of t7) { const C3 = s5.codePointAt(0); if (C3 <= 31 || C3 >= 127 && C3 <= 159 || C3 >= 768 && C3 <= 879) continue; switch (K.eastAsianWidth(s5)) { case "F": case "W": e7 += 2; break; case "A": e7 += F3; break; default: e7 += 1; } } return e7; } __name(c, "c"); var v = 10; var L = /* @__PURE__ */ __name((t7 = 0) => (u5) => `\x1B[${u5 + t7}m`, "L"); var M = /* @__PURE__ */ __name((t7 = 0) => (u5) => `\x1B[${38 + t7};5;${u5}m`, "M"); var T = /* @__PURE__ */ __name((t7 = 0) => (u5, F3, e7) => `\x1B[${38 + t7};2;${u5};${F3};${e7}m`, "T"); var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; Object.keys(r.modifier); var Z = Object.keys(r.color); var H = Object.keys(r.bgColor); [...Z, ...H]; function U() { const t7 = /* @__PURE__ */ new Map(); for (const [u5, F3] of Object.entries(r)) { for (const [e7, s5] of Object.entries(F3)) r[e7] = { open: `\x1B[${s5[0]}m`, close: `\x1B[${s5[1]}m` }, F3[e7] = r[e7], t7.set(s5[0], s5[1]); Object.defineProperty(r, u5, { value: F3, enumerable: false }); } return Object.defineProperty(r, "codes", { value: t7, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L(), r.color.ansi256 = M(), r.color.ansi16m = T(), r.bgColor.ansi = L(v), r.bgColor.ansi256 = M(v), r.bgColor.ansi16m = T(v), Object.defineProperties(r, { rgbToAnsi256: { value: (u5, F3, e7) => u5 === F3 && F3 === e7 ? u5 < 8 ? 16 : u5 > 248 ? 231 : Math.round((u5 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u5 / 255 * 5) + 6 * Math.round(F3 / 255 * 5) + Math.round(e7 / 255 * 5), enumerable: false }, hexToRgb: { value: (u5) => { const F3 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u5.toString(16)); if (!F3) return [0, 0, 0]; let [e7] = F3; e7.length === 3 && (e7 = [...e7].map((C3) => C3 + C3).join("")); const s5 = Number.parseInt(e7, 16); return [s5 >> 16 & 255, s5 >> 8 & 255, s5 & 255]; }, enumerable: false }, hexToAnsi256: { value: (u5) => r.rgbToAnsi256(...r.hexToRgb(u5)), enumerable: false }, ansi256ToAnsi: { value: (u5) => { if (u5 < 8) return 30 + u5; if (u5 < 16) return 90 + (u5 - 8); let F3, e7, s5; if (u5 >= 232) F3 = ((u5 - 232) * 10 + 8) / 255, e7 = F3, s5 = F3; else { u5 -= 16; const i5 = u5 % 36; F3 = Math.floor(u5 / 36) / 5, e7 = Math.floor(i5 / 6) / 5, s5 = i5 % 6 / 5; } const C3 = Math.max(F3, e7, s5) * 2; if (C3 === 0) return 30; let D3 = 30 + (Math.round(s5) << 2 | Math.round(e7) << 1 | Math.round(F3)); return C3 === 2 && (D3 += 60), D3; }, enumerable: false }, rgbToAnsi: { value: (u5, F3, e7) => r.ansi256ToAnsi(r.rgbToAnsi256(u5, F3, e7)), enumerable: false }, hexToAnsi: { value: (u5) => r.ansi256ToAnsi(r.hexToAnsi256(u5)), enumerable: false } }), r; } __name(U, "U"); var q = U(); var p = /* @__PURE__ */ new Set(["\x1B", "\x9B"]); var J = 39; var b = "\x07"; var W = "["; var Q = "]"; var I = "m"; var w = `${Q}8;;`; var N = /* @__PURE__ */ __name((t7) => `${p.values().next().value}${W}${t7}${I}`, "N"); var j = /* @__PURE__ */ __name((t7) => `${p.values().next().value}${w}${t7}${b}`, "j"); var X = /* @__PURE__ */ __name((t7) => t7.split(" ").map((u5) => c(u5)), "X"); var _2 = /* @__PURE__ */ __name((t7, u5, F3) => { const e7 = [...u5]; let s5 = false, C3 = false, D3 = c($(t7[t7.length - 1])); for (const [i5, o5] of e7.entries()) { const E3 = c(o5); if (D3 + E3 <= F3 ? t7[t7.length - 1] += o5 : (t7.push(o5), D3 = 0), p.has(o5) && (s5 = true, C3 = e7.slice(i5 + 1).join("").startsWith(w)), s5) { C3 ? o5 === b && (s5 = false, C3 = false) : o5 === I && (s5 = false); continue; } D3 += E3, D3 === F3 && i5 < e7.length - 1 && (t7.push(""), D3 = 0); } !D3 && t7[t7.length - 1].length > 0 && t7.length > 1 && (t7[t7.length - 2] += t7.pop()); }, "_"); var DD = /* @__PURE__ */ __name((t7) => { const u5 = t7.split(" "); let F3 = u5.length; for (; F3 > 0 && !(c(u5[F3 - 1]) > 0); ) F3--; return F3 === u5.length ? t7 : u5.slice(0, F3).join(" ") + u5.slice(F3).join(""); }, "DD"); var uD = /* @__PURE__ */ __name((t7, u5, F3 = {}) => { if (F3.trim !== false && t7.trim() === "") return ""; let e7 = "", s5, C3; const D3 = X(t7); let i5 = [""]; for (const [E3, a5] of t7.split(" ").entries()) { F3.trim !== false && (i5[i5.length - 1] = i5[i5.length - 1].trimStart()); let n6 = c(i5[i5.length - 1]); if (E3 !== 0 && (n6 >= u5 && (F3.wordWrap === false || F3.trim === false) && (i5.push(""), n6 = 0), (n6 > 0 || F3.trim === false) && (i5[i5.length - 1] += " ", n6++)), F3.hard && D3[E3] > u5) { const B3 = u5 - n6, A3 = 1 + Math.floor((D3[E3] - B3 - 1) / u5); Math.floor((D3[E3] - 1) / u5) < A3 && i5.push(""), _2(i5, a5, u5); continue; } if (n6 + D3[E3] > u5 && n6 > 0 && D3[E3] > 0) { if (F3.wordWrap === false && n6 < u5) { _2(i5, a5, u5); continue; } i5.push(""); } if (n6 + D3[E3] > u5 && F3.wordWrap === false) { _2(i5, a5, u5); continue; } i5[i5.length - 1] += a5; } F3.trim !== false && (i5 = i5.map((E3) => DD(E3))); const o5 = [...i5.join(` `)]; for (const [E3, a5] of o5.entries()) { if (e7 += a5, p.has(a5)) { const { groups: B3 } = new RegExp(`(?:\\${W}(?\\d+)m|\\${w}(?.*)${b})`).exec(o5.slice(E3).join("")) || { groups: {} }; if (B3.code !== void 0) { const A3 = Number.parseFloat(B3.code); s5 = A3 === J ? void 0 : A3; } else B3.uri !== void 0 && (C3 = B3.uri.length === 0 ? void 0 : B3.uri); } const n6 = q.codes.get(Number(s5)); o5[E3 + 1] === ` ` ? (C3 && (e7 += j("")), s5 && n6 && (e7 += N(n6))) : a5 === ` ` && (s5 && n6 && (e7 += N(s5)), C3 && (e7 += j(C3))); } return e7; }, "uD"); function P(t7, u5, F3) { return String(t7).normalize().replace(/\r\n/g, ` `).split(` `).map((e7) => uD(e7, u5, F3)).join(` `); } __name(P, "P"); function FD(t7, u5) { if (t7 === u5) return; const F3 = t7.split(` `), e7 = u5.split(` `), s5 = []; for (let C3 = 0; C3 < Math.max(F3.length, e7.length); C3++) F3[C3] !== e7[C3] && s5.push(C3); return s5; } __name(FD, "FD"); var R = Symbol("clack:cancel"); function eD(t7) { return t7 === R; } __name(eD, "eD"); function g(t7, u5) { t7.isTTY && t7.setRawMode(u5); } __name(g, "g"); var V = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]); var tD = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]); var h = class { constructor({ render: u5, input: F3 = import_node_process3.stdin, output: e7 = import_node_process3.stdout, ...s5 }, C3 = true) { this._track = false, this._cursor = 0, this.state = "initial", this.error = "", this.subscribers = /* @__PURE__ */ new Map(), this._prevFrame = "", this.opts = s5, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u5.bind(this), this._track = C3, this.input = F3, this.output = e7; } prompt() { const u5 = new import_node_tty2.WriteStream(0); return u5._write = (F3, e7, s5) => { this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s5(); }, this.input.pipe(u5), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u5, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), g(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F3, e7) => { this.once("submit", () => { this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), g(this.input, false), F3(this.value); }), this.once("cancel", () => { this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), g(this.input, false), F3(R); }); }); } on(u5, F3) { const e7 = this.subscribers.get(u5) ?? []; e7.push({ cb: F3 }), this.subscribers.set(u5, e7); } once(u5, F3) { const e7 = this.subscribers.get(u5) ?? []; e7.push({ cb: F3, once: true }), this.subscribers.set(u5, e7); } emit(u5, ...F3) { const e7 = this.subscribers.get(u5) ?? [], s5 = []; for (const C3 of e7) C3.cb(...F3), C3.once && s5.push(() => e7.splice(e7.indexOf(C3), 1)); for (const C3 of s5) C3(); } unsubscribe() { this.subscribers.clear(); } onKeypress(u5, F3) { if (this.state === "error" && (this.state = "active"), F3?.name && !this._track && V.has(F3.name) && this.emit("cursor", V.get(F3.name)), F3?.name && tD.has(F3.name) && this.emit("cursor", F3.name), u5 && (u5.toLowerCase() === "y" || u5.toLowerCase() === "n") && this.emit("confirm", u5.toLowerCase() === "y"), u5 && this.emit("key", u5.toLowerCase()), F3?.name === "return") { if (this.opts.validate) { const e7 = this.opts.validate(this.value); e7 && (this.error = e7, this.state = "error", this.rl.write(this.value)); } this.state !== "error" && (this.state = "submit"); } u5 === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close(); } close() { this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(` `), g(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe(); } restoreCursor() { const u5 = P(this._prevFrame, process.stdout.columns, { hard: true }).split(` `).length - 1; this.output.write(import_sisteransi.cursor.move(-999, u5 * -1)); } render() { const u5 = P(this._render(this) ?? "", process.stdout.columns, { hard: true }); if (u5 !== this._prevFrame) { if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide); else { const F3 = FD(this._prevFrame, u5); if (this.restoreCursor(), F3 && F3?.length === 1) { const e7 = F3[0]; this.output.write(import_sisteransi.cursor.move(0, e7)), this.output.write(import_sisteransi.erase.lines(1)); const s5 = u5.split(` `); this.output.write(s5[e7]), this._prevFrame = u5, this.output.write(import_sisteransi.cursor.move(0, s5.length - e7 - 1)); return; } else if (F3 && F3?.length > 1) { const e7 = F3[0]; this.output.write(import_sisteransi.cursor.move(0, e7)), this.output.write(import_sisteransi.erase.down()); const C3 = u5.split(` `).slice(e7); this.output.write(C3.join(` `)), this._prevFrame = u5; return; } this.output.write(import_sisteransi.erase.down()); } this.output.write(u5), this.state === "initial" && (this.state = "active"), this._prevFrame = u5; } } }; __name(h, "h"); var sD = class extends h { get cursor() { return this.value ? 0 : 1; } get _value() { return this.cursor === 0; } constructor(u5) { super(u5, false), this.value = !!u5.initialValue, this.on("value", () => { this.value = this._value; }), this.on("confirm", (F3) => { this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F3, this.state = "submit", this.close(); }), this.on("cursor", () => { this.value = !this.value; }); } }; __name(sD, "sD"); var iD = class extends h { constructor(u5) { super(u5, false), this.cursor = 0, this.options = u5.options, this.value = [...u5.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F3 }) => F3 === u5.cursorAt), 0), this.on("key", (F3) => { F3 === "a" && this.toggleAll(); }), this.on("cursor", (F3) => { switch (F3) { case "left": case "up": this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1; break; case "down": case "right": this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1; break; case "space": this.toggleValue(); break; } }); } get _value() { return this.options[this.cursor].value; } toggleAll() { const u5 = this.value.length === this.options.length; this.value = u5 ? [] : this.options.map((F3) => F3.value); } toggleValue() { const u5 = this.value.includes(this._value); this.value = u5 ? this.value.filter((F3) => F3 !== this._value) : [...this.value, this._value]; } }; __name(iD, "iD"); var ED = class extends h { constructor(u5) { super(u5, false), this.cursor = 0, this.options = u5.options, this.cursor = this.options.findIndex(({ value: F3 }) => F3 === u5.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F3) => { switch (F3) { case "left": case "up": this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1; break; case "down": case "right": this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1; break; } this.changeValue(); }); } get _value() { return this.options[this.cursor]; } changeValue() { this.value = this._value.value; } }; __name(ED, "ED"); var oD = class extends h { constructor(u5) { super(u5), this.valueWithCursor = "", this.on("finalize", () => { this.value || (this.value = u5.defaultValue), this.valueWithCursor = this.value; }), this.on("value", () => { if (this.cursor >= this.value.length) this.valueWithCursor = `${this.value}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`; else { const F3 = this.value.slice(0, this.cursor), e7 = this.value.slice(this.cursor); this.valueWithCursor = `${F3}${import_picocolors.default.inverse(e7[0])}${e7.slice(1)}`; } }); } get cursor() { return this._cursor; } }; __name(oD, "oD"); // ../../node_modules/.pnpm/log-update@5.0.1/node_modules/log-update/index.js init_import_meta_url(); var import_node_process6 = __toESM(require("node:process"), 1); // ../../node_modules/.pnpm/ansi-escapes@5.0.0/node_modules/ansi-escapes/index.js init_import_meta_url(); var ESC = "\x1B["; var OSC = "\x1B]"; var BEL = "\x07"; var SEP = ";"; var isTerminalApp = process.env.TERM_PROGRAM === "Apple_Terminal"; var ansiEscapes = {}; ansiEscapes.cursorTo = (x6, y4) => { if (typeof x6 !== "number") { throw new TypeError("The `x` argument is required"); } if (typeof y4 !== "number") { return ESC + (x6 + 1) + "G"; } return ESC + (y4 + 1) + ";" + (x6 + 1) + "H"; }; ansiEscapes.cursorMove = (x6, y4) => { if (typeof x6 !== "number") { throw new TypeError("The `x` argument is required"); } let returnValue = ""; if (x6 < 0) { returnValue += ESC + -x6 + "D"; } else if (x6 > 0) { returnValue += ESC + x6 + "C"; } if (y4 < 0) { returnValue += ESC + -y4 + "A"; } else if (y4 > 0) { returnValue += ESC + y4 + "B"; } return returnValue; }; ansiEscapes.cursorUp = (count = 1) => ESC + count + "A"; ansiEscapes.cursorDown = (count = 1) => ESC + count + "B"; ansiEscapes.cursorForward = (count = 1) => ESC + count + "C"; ansiEscapes.cursorBackward = (count = 1) => ESC + count + "D"; ansiEscapes.cursorLeft = ESC + "G"; ansiEscapes.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s"; ansiEscapes.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u"; ansiEscapes.cursorGetPosition = ESC + "6n"; ansiEscapes.cursorNextLine = ESC + "E"; ansiEscapes.cursorPrevLine = ESC + "F"; ansiEscapes.cursorHide = ESC + "?25l"; ansiEscapes.cursorShow = ESC + "?25h"; ansiEscapes.eraseLines = (count) => { let clear = ""; for (let i5 = 0; i5 < count; i5++) { clear += ansiEscapes.eraseLine + (i5 < count - 1 ? ansiEscapes.cursorUp() : ""); } if (count) { clear += ansiEscapes.cursorLeft; } return clear; }; ansiEscapes.eraseEndLine = ESC + "K"; ansiEscapes.eraseStartLine = ESC + "1K"; ansiEscapes.eraseLine = ESC + "2K"; ansiEscapes.eraseDown = ESC + "J"; ansiEscapes.eraseUp = ESC + "1J"; ansiEscapes.eraseScreen = ESC + "2J"; ansiEscapes.scrollUp = ESC + "S"; ansiEscapes.scrollDown = ESC + "T"; ansiEscapes.clearScreen = "\x1Bc"; ansiEscapes.clearTerminal = process.platform === "win32" ? `${ansiEscapes.eraseScreen}${ESC}0f` : ( // 1. Erases the screen (Only done in case `2` is not supported) // 2. Erases the whole screen including scrollback buffer // 3. Moves cursor to the top-left position // More info: https://www.real-world-systems.com/docs/ANSIcode.html `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H` ); ansiEscapes.beep = BEL; ansiEscapes.link = (text, url4) => { return [ OSC, "8", SEP, SEP, url4, BEL, text, OSC, "8", SEP, SEP, BEL ].join(""); }; ansiEscapes.image = (buffer, options32 = {}) => { let returnValue = `${OSC}1337;File=inline=1`; if (options32.width) { returnValue += `;width=${options32.width}`; } if (options32.height) { returnValue += `;height=${options32.height}`; } if (options32.preserveAspectRatio === false) { returnValue += ";preserveAspectRatio=0"; } return returnValue + ":" + buffer.toString("base64") + BEL; }; ansiEscapes.iTerm = { setCwd: (cwd2 = process.cwd()) => `${OSC}50;CurrentDir=${cwd2}${BEL}`, annotation: (message, options32 = {}) => { let returnValue = `${OSC}1337;`; const hasX = typeof options32.x !== "undefined"; const hasY = typeof options32.y !== "undefined"; if ((hasX || hasY) && !(hasX && hasY && typeof options32.length !== "undefined")) { throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined"); } message = message.replace(/\|/g, ""); returnValue += options32.isHidden ? "AddHiddenAnnotation=" : "AddAnnotation="; if (options32.length > 0) { returnValue += (hasX ? [message, options32.length, options32.x, options32.y] : [options32.length, message]).join("|"); } else { returnValue += message; } return returnValue + BEL; } }; var ansi_escapes_default = ansiEscapes; // ../../node_modules/.pnpm/cli-cursor@4.0.0/node_modules/cli-cursor/index.js init_import_meta_url(); var import_node_process5 = __toESM(require("node:process"), 1); // ../../node_modules/.pnpm/restore-cursor@4.0.0/node_modules/restore-cursor/index.js init_import_meta_url(); var import_node_process4 = __toESM(require("node:process"), 1); var import_onetime = __toESM(require_onetime(), 1); var import_signal_exit2 = __toESM(require_signal_exit(), 1); var restoreCursor = (0, import_onetime.default)(() => { (0, import_signal_exit2.default)(() => { import_node_process4.default.stderr.write("\x1B[?25h"); }, { alwaysLast: true }); }); var restore_cursor_default = restoreCursor; // ../../node_modules/.pnpm/cli-cursor@4.0.0/node_modules/cli-cursor/index.js var isHidden = false; var cliCursor = {}; cliCursor.show = (writableStream = import_node_process5.default.stderr) => { if (!writableStream.isTTY) { return; } isHidden = false; writableStream.write("\x1B[?25h"); }; cliCursor.hide = (writableStream = import_node_process5.default.stderr) => { if (!writableStream.isTTY) { return; } restore_cursor_default(); isHidden = true; writableStream.write("\x1B[?25l"); }; cliCursor.toggle = (force, writableStream) => { if (force !== void 0) { isHidden = force; } if (isHidden) { cliCursor.show(writableStream); } else { cliCursor.hide(writableStream); } }; var cli_cursor_default = cliCursor; // ../../node_modules/.pnpm/wrap-ansi@8.1.0/node_modules/wrap-ansi/index.js init_import_meta_url(); // ../../node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js init_import_meta_url(); var import_eastasianwidth = __toESM(require_eastasianwidth(), 1); var import_emoji_regex = __toESM(require_emoji_regex2(), 1); function stringWidth(string, options32 = {}) { if (typeof string !== "string" || string.length === 0) { return 0; } options32 = { ambiguousIsNarrow: true, ...options32 }; string = stripAnsi2(string); if (string.length === 0) { return 0; } string = string.replace((0, import_emoji_regex.default)(), " "); const ambiguousCharacterWidth = options32.ambiguousIsNarrow ? 1 : 2; let width = 0; for (const character of string) { const codePoint = character.codePointAt(0); if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) { continue; } if (codePoint >= 768 && codePoint <= 879) { continue; } const code = import_eastasianwidth.default.eastAsianWidth(character); switch (code) { case "F": case "W": width += 2; break; case "A": width += ambiguousCharacterWidth; break; default: width += 1; } } return width; } __name(stringWidth, "stringWidth"); // ../../node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js init_import_meta_url(); var ANSI_BACKGROUND_OFFSET2 = 10; var wrapAnsi162 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${code + offset}m`, "wrapAnsi16"); var wrapAnsi2562 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, "wrapAnsi256"); var wrapAnsi16m2 = /* @__PURE__ */ __name((offset = 0) => (red2, green2, blue2) => `\x1B[${38 + offset};2;${red2};${green2};${blue2}m`, "wrapAnsi16m"); var styles3 = { modifier: { reset: [0, 0], // 21 isn't widely supported and 22 does the same thing bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], // Bright color blackBright: [90, 39], gray: [90, 39], // Alias of `blackBright` grey: [90, 39], // Alias of `blackBright` redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], // Bright color bgBlackBright: [100, 49], bgGray: [100, 49], // Alias of `bgBlackBright` bgGrey: [100, 49], // Alias of `bgBlackBright` bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; var modifierNames2 = Object.keys(styles3.modifier); var foregroundColorNames2 = Object.keys(styles3.color); var backgroundColorNames2 = Object.keys(styles3.bgColor); var colorNames2 = [...foregroundColorNames2, ...backgroundColorNames2]; function assembleStyles2() { const codes = /* @__PURE__ */ new Map(); for (const [groupName, group] of Object.entries(styles3)) { for (const [styleName, style] of Object.entries(group)) { styles3[styleName] = { open: `\x1B[${style[0]}m`, close: `\x1B[${style[1]}m` }; group[styleName] = styles3[styleName]; codes.set(style[0], style[1]); } Object.defineProperty(styles3, groupName, { value: group, enumerable: false }); } Object.defineProperty(styles3, "codes", { value: codes, enumerable: false }); styles3.color.close = "\x1B[39m"; styles3.bgColor.close = "\x1B[49m"; styles3.color.ansi = wrapAnsi162(); styles3.color.ansi256 = wrapAnsi2562(); styles3.color.ansi16m = wrapAnsi16m2(); styles3.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2); styles3.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2); styles3.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2); Object.defineProperties(styles3, { rgbToAnsi256: { value: (red2, green2, blue2) => { if (red2 === green2 && green2 === blue2) { if (red2 < 8) { return 16; } if (red2 > 248) { return 231; } return Math.round((red2 - 8) / 247 * 24) + 232; } return 16 + 36 * Math.round(red2 / 255 * 5) + 6 * Math.round(green2 / 255 * 5) + Math.round(blue2 / 255 * 5); }, enumerable: false }, hexToRgb: { value: (hex) => { const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); if (!matches) { return [0, 0, 0]; } let [colorString] = matches; if (colorString.length === 3) { colorString = [...colorString].map((character) => character + character).join(""); } const integer = Number.parseInt(colorString, 16); return [ /* eslint-disable no-bitwise */ integer >> 16 & 255, integer >> 8 & 255, integer & 255 /* eslint-enable no-bitwise */ ]; }, enumerable: false }, hexToAnsi256: { value: (hex) => styles3.rgbToAnsi256(...styles3.hexToRgb(hex)), enumerable: false }, ansi256ToAnsi: { value: (code) => { if (code < 8) { return 30 + code; } if (code < 16) { return 90 + (code - 8); } let red2; let green2; let blue2; if (code >= 232) { red2 = ((code - 232) * 10 + 8) / 255; green2 = red2; blue2 = red2; } else { code -= 16; const remainder = code % 36; red2 = Math.floor(code / 36) / 5; green2 = Math.floor(remainder / 6) / 5; blue2 = remainder % 6 / 5; } const value = Math.max(red2, green2, blue2) * 2; if (value === 0) { return 30; } let result = 30 + (Math.round(blue2) << 2 | Math.round(green2) << 1 | Math.round(red2)); if (value === 2) { result += 60; } return result; }, enumerable: false }, rgbToAnsi: { value: (red2, green2, blue2) => styles3.ansi256ToAnsi(styles3.rgbToAnsi256(red2, green2, blue2)), enumerable: false }, hexToAnsi: { value: (hex) => styles3.ansi256ToAnsi(styles3.hexToAnsi256(hex)), enumerable: false } }); return styles3; } __name(assembleStyles2, "assembleStyles"); var ansiStyles2 = assembleStyles2(); var ansi_styles_default2 = ansiStyles2; // ../../node_modules/.pnpm/wrap-ansi@8.1.0/node_modules/wrap-ansi/index.js var ESCAPES = /* @__PURE__ */ new Set([ "\x1B", "\x9B" ]); var END_CODE = 39; var ANSI_ESCAPE_BELL = "\x07"; var ANSI_CSI = "["; var ANSI_OSC = "]"; var ANSI_SGR_TERMINATOR = "m"; var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`; var wrapAnsiCode = /* @__PURE__ */ __name((code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, "wrapAnsiCode"); var wrapAnsiHyperlink = /* @__PURE__ */ __name((uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`, "wrapAnsiHyperlink"); var wordLengths = /* @__PURE__ */ __name((string) => string.split(" ").map((character) => stringWidth(character)), "wordLengths"); var wrapWord = /* @__PURE__ */ __name((rows, word, columns) => { const characters = [...word]; let isInsideEscape = false; let isInsideLinkEscape = false; let visible = stringWidth(stripAnsi2(rows[rows.length - 1])); for (const [index, character] of characters.entries()) { const characterLength = stringWidth(character); if (visible + characterLength <= columns) { rows[rows.length - 1] += character; } else { rows.push(character); visible = 0; } if (ESCAPES.has(character)) { isInsideEscape = true; isInsideLinkEscape = characters.slice(index + 1).join("").startsWith(ANSI_ESCAPE_LINK); } if (isInsideEscape) { if (isInsideLinkEscape) { if (character === ANSI_ESCAPE_BELL) { isInsideEscape = false; isInsideLinkEscape = false; } } else if (character === ANSI_SGR_TERMINATOR) { isInsideEscape = false; } continue; } visible += characterLength; if (visible === columns && index < characters.length - 1) { rows.push(""); visible = 0; } } if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) { rows[rows.length - 2] += rows.pop(); } }, "wrapWord"); var stringVisibleTrimSpacesRight = /* @__PURE__ */ __name((string) => { const words = string.split(" "); let last = words.length; while (last > 0) { if (stringWidth(words[last - 1]) > 0) { break; } last--; } if (last === words.length) { return string; } return words.slice(0, last).join(" ") + words.slice(last).join(""); }, "stringVisibleTrimSpacesRight"); var exec = /* @__PURE__ */ __name((string, columns, options32 = {}) => { if (options32.trim !== false && string.trim() === "") { return ""; } let returnValue = ""; let escapeCode; let escapeUrl; const lengths = wordLengths(string); let rows = [""]; for (const [index, word] of string.split(" ").entries()) { if (options32.trim !== false) { rows[rows.length - 1] = rows[rows.length - 1].trimStart(); } let rowLength = stringWidth(rows[rows.length - 1]); if (index !== 0) { if (rowLength >= columns && (options32.wordWrap === false || options32.trim === false)) { rows.push(""); rowLength = 0; } if (rowLength > 0 || options32.trim === false) { rows[rows.length - 1] += " "; rowLength++; } } if (options32.hard && lengths[index] > columns) { const remainingColumns = columns - rowLength; const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns); const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns); if (breaksStartingNextLine < breaksStartingThisLine) { rows.push(""); } wrapWord(rows, word, columns); continue; } if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) { if (options32.wordWrap === false && rowLength < columns) { wrapWord(rows, word, columns); continue; } rows.push(""); } if (rowLength + lengths[index] > columns && options32.wordWrap === false) { wrapWord(rows, word, columns); continue; } rows[rows.length - 1] += word; } if (options32.trim !== false) { rows = rows.map((row) => stringVisibleTrimSpacesRight(row)); } const pre = [...rows.join("\n")]; for (const [index, character] of pre.entries()) { returnValue += character; if (ESCAPES.has(character)) { const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?\\d+)m|\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join("")) || { groups: {} }; if (groups.code !== void 0) { const code2 = Number.parseFloat(groups.code); escapeCode = code2 === END_CODE ? void 0 : code2; } else if (groups.uri !== void 0) { escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri; } } const code = ansi_styles_default2.codes.get(Number(escapeCode)); if (pre[index + 1] === "\n") { if (escapeUrl) { returnValue += wrapAnsiHyperlink(""); } if (escapeCode && code) { returnValue += wrapAnsiCode(code); } } else if (character === "\n") { if (escapeCode && code) { returnValue += wrapAnsiCode(escapeCode); } if (escapeUrl) { returnValue += wrapAnsiHyperlink(escapeUrl); } } } return returnValue; }, "exec"); function wrapAnsi(string, columns, options32) { return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options32)).join("\n"); } __name(wrapAnsi, "wrapAnsi"); // ../../node_modules/.pnpm/slice-ansi@5.0.0/node_modules/slice-ansi/index.js init_import_meta_url(); // ../../node_modules/.pnpm/is-fullwidth-code-point@4.0.0/node_modules/is-fullwidth-code-point/index.js init_import_meta_url(); function isFullwidthCodePoint(codePoint) { if (!Number.isInteger(codePoint)) { return false; } return codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET // CJK Radicals Supplement .. Enclosed CJK Letters and Months 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A 12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals 19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A 43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables 44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs 63744 <= codePoint && codePoint <= 64255 || // Vertical Forms 65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants 65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement 110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement 127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane 131072 <= codePoint && codePoint <= 262141); } __name(isFullwidthCodePoint, "isFullwidthCodePoint"); // ../../node_modules/.pnpm/slice-ansi@5.0.0/node_modules/slice-ansi/index.js var astralRegex = /^[\uD800-\uDBFF][\uDC00-\uDFFF]$/; var ESCAPES2 = [ "\x1B", "\x9B" ]; var wrapAnsi2 = /* @__PURE__ */ __name((code) => `${ESCAPES2[0]}[${code}m`, "wrapAnsi"); var checkAnsi = /* @__PURE__ */ __name((ansiCodes, isEscapes, endAnsiCode) => { let output = []; ansiCodes = [...ansiCodes]; for (let ansiCode of ansiCodes) { const ansiCodeOrigin = ansiCode; if (ansiCode.includes(";")) { ansiCode = ansiCode.split(";")[0][0] + "0"; } const item = ansi_styles_default2.codes.get(Number.parseInt(ansiCode, 10)); if (item) { const indexEscape = ansiCodes.indexOf(item.toString()); if (indexEscape === -1) { output.push(wrapAnsi2(isEscapes ? item : ansiCodeOrigin)); } else { ansiCodes.splice(indexEscape, 1); } } else if (isEscapes) { output.push(wrapAnsi2(0)); break; } else { output.push(wrapAnsi2(ansiCodeOrigin)); } } if (isEscapes) { output = output.filter((element, index) => output.indexOf(element) === index); if (endAnsiCode !== void 0) { const fistEscapeCode = wrapAnsi2(ansi_styles_default2.codes.get(Number.parseInt(endAnsiCode, 10))); output = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []); } } return output.join(""); }, "checkAnsi"); function sliceAnsi(string, begin, end) { const characters = [...string]; const ansiCodes = []; let stringEnd = typeof end === "number" ? end : characters.length; let isInsideEscape = false; let ansiCode; let visible = 0; let output = ""; for (const [index, character] of characters.entries()) { let leftEscape = false; if (ESCAPES2.includes(character)) { const code = /\d[^m]*/.exec(string.slice(index, index + 18)); ansiCode = code && code.length > 0 ? code[0] : void 0; if (visible < stringEnd) { isInsideEscape = true; if (ansiCode !== void 0) { ansiCodes.push(ansiCode); } } } else if (isInsideEscape && character === "m") { isInsideEscape = false; leftEscape = true; } if (!isInsideEscape && !leftEscape) { visible++; } if (!astralRegex.test(character) && isFullwidthCodePoint(character.codePointAt())) { visible++; if (typeof end !== "number") { stringEnd++; } } if (visible > begin && visible <= stringEnd) { output += character; } else if (visible === begin && !isInsideEscape && ansiCode !== void 0) { output = checkAnsi(ansiCodes); } else if (visible >= stringEnd) { output += checkAnsi(ansiCodes, true, ansiCode); break; } } return output; } __name(sliceAnsi, "sliceAnsi"); // ../../node_modules/.pnpm/log-update@5.0.1/node_modules/log-update/index.js var defaultTerminalHeight = 24; var getWidth = /* @__PURE__ */ __name((stream2) => { const { columns } = stream2; if (!columns) { return 80; } return columns; }, "getWidth"); var fitToTerminalHeight = /* @__PURE__ */ __name((stream2, text) => { const terminalHeight = stream2.rows || defaultTerminalHeight; const lines = text.split("\n"); const toRemove = lines.length - terminalHeight; if (toRemove <= 0) { return text; } return sliceAnsi( text, stripAnsi2(lines.slice(0, toRemove).join("\n")).length + 1 ); }, "fitToTerminalHeight"); function createLogUpdate(stream2, { showCursor = false } = {}) { let previousLineCount = 0; let previousWidth = getWidth(stream2); let previousOutput = ""; const render2 = /* @__PURE__ */ __name((...arguments_) => { if (!showCursor) { cli_cursor_default.hide(); } let output = arguments_.join(" ") + "\n"; output = fitToTerminalHeight(stream2, output); const width = getWidth(stream2); if (output === previousOutput && previousWidth === width) { return; } previousOutput = output; previousWidth = width; output = wrapAnsi(output, width, { trim: false, hard: true, wordWrap: false }); stream2.write(ansi_escapes_default.eraseLines(previousLineCount) + output); previousLineCount = output.split("\n").length; }, "render"); render2.clear = () => { stream2.write(ansi_escapes_default.eraseLines(previousLineCount)); previousOutput = ""; previousWidth = getWidth(stream2); previousLineCount = 0; }; render2.done = () => { previousOutput = ""; previousWidth = getWidth(stream2); previousLineCount = 0; if (!showCursor) { cli_cursor_default.show(); } }; return render2; } __name(createLogUpdate, "createLogUpdate"); var logUpdate = createLogUpdate(import_node_process6.default.stdout); var logUpdateStderr = createLogUpdate(import_node_process6.default.stderr); // ../cli/colors.ts init_import_meta_url(); var { white, gray, dim, hidden, bold, cyanBright, bgCyan } = source_default; var brandColor = source_default.hex("#BD5B08"); var black = source_default.hex("#111"); var blue = source_default.hex("#0E838F"); var bgBlue = black.bgHex("#0E838F"); var red = source_default.hex("#AB2526"); var bgRed = black.bgHex("#AB2526"); var green = source_default.hex("#218529"); var bgGreen = black.bgHex("#218529"); var yellow = source_default.hex("#7F7322"); var bgYellow = black.bgHex("#7F7322"); // ../cli/error.ts init_import_meta_url(); var CancelError = class extends Error { constructor(message, signal) { super(message); this.signal = signal; } }; __name(CancelError, "CancelError"); // ../cli/select-list.ts init_import_meta_url(); var SelectRefreshablePrompt = class extends h { options; cursor = 0; get _value() { return this.options[this.cursor]; } changeValue() { this.value = this._value.value; } constructor(opts) { super(opts, false); this.options = opts.options; this.cursor = this.options.findIndex( ({ value }) => value === opts.initialValue ); if (this.cursor === -1) { this.cursor = 0; } this.changeValue(); this.on("key", (c6) => { if (c6 !== "r") { return; } void opts.onRefresh().then((newOptions) => { this.options = [...newOptions]; this.cursor = 0; this.changeValue(); const that = this; if ("render" in that && typeof that.render === "function") { that.render(); } }).catch(() => { }); }); this.on("cursor", (key) => { switch (key) { case "left": case "up": this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1; break; case "down": case "right": this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1; break; } this.changeValue(); }); } }; __name(SelectRefreshablePrompt, "SelectRefreshablePrompt"); // ../cli/streams.ts init_import_meta_url(); var stdout = process.stdout; var stderr = process.stderr; // ../cli/index.ts init_import_meta_url(); var import_process = require("process"); // ../cli/check-macos-version.ts init_import_meta_url(); var import_node_os3 = __toESM(require("node:os")); var MINIMUM_MACOS_VERSION = "13.5.0"; function checkMacOSVersion(options32) { if (process.platform !== "darwin") { return; } if (process.env.CI) { return; } const release3 = import_node_os3.default.release(); const macOSVersion = darwinVersionToMacOSVersion(release3); if (macOSVersion && isVersionLessThan(macOSVersion, MINIMUM_MACOS_VERSION)) { if (options32.shouldThrow) { throw new Error( `Unsupported macOS version: The Cloudflare Workers runtime cannot run on the current version of macOS (${macOSVersion}). The minimum requirement is macOS ${MINIMUM_MACOS_VERSION}+. See https://github.com/cloudflare/workerd?tab=readme-ov-file#running-workerd If you cannot upgrade your version of macOS, you could try running in a DevContainer setup with a supported version of Linux (glibc 2.35+ required).` ); } else { console.warn( `\u26A0\uFE0F Warning: Unsupported macOS version detected (${macOSVersion}). The Cloudflare Workers runtime may not work correctly on macOS versions below ${MINIMUM_MACOS_VERSION}. Consider upgrading to macOS ${MINIMUM_MACOS_VERSION}+ or using a DevContainer setup with a supported version of Linux (glibc 2.35+ required).` ); } } } __name(checkMacOSVersion, "checkMacOSVersion"); function darwinVersionToMacOSVersion(darwinVersion) { const match2 = darwinVersion.match(/^(\d+)\.(\d+)\.(\d+)/); if (!match2) { return null; } const major = parseInt(match2[1], 10); if (major >= 20) { const macOSMajor = major - 9; const minor = parseInt(match2[2], 10); const patch = parseInt(match2[3], 10); return `${macOSMajor}.${minor}.${patch}`; } return null; } __name(darwinVersionToMacOSVersion, "darwinVersionToMacOSVersion"); function isVersionLessThan(version1, version22) { const versionRegex = /^(\d+)\.(\d+)\.(\d+)$/; const match1 = version1.match(versionRegex); const match2 = version22.match(versionRegex); if (!match1 || !match2) { throw new Error( `Invalid version format. Expected M.m.p format, got: ${version1}, ${version22}` ); } const [major1, minor1, patch1] = [ parseInt(match1[1], 10), parseInt(match1[2], 10), parseInt(match1[3], 10) ]; const [major2, minor2, patch2] = [ parseInt(match2[1], 10), parseInt(match2[2], 10), parseInt(match2[3], 10) ]; if (major1 !== major2) { return major1 < major2; } if (minor1 !== minor2) { return minor1 < minor2; } return patch1 < patch2; } __name(isVersionLessThan, "isVersionLessThan"); // ../cli/index.ts var shapes = { diamond: "\u25C7", dash: "\u2500", radioInactive: "\u25CB", radioActive: "\u25CF", backActive: "\u25C0", backInactive: "\u25C1", bar: "\u2502", leftT: "\u251C", rigthT: "\u2524", arrows: { left: "\u2039", right: "\u203A" }, corners: { tl: "\u256D", bl: "\u2570", tr: "\u256E", br: "\u256F" } }; var status = { error: bgRed(` ERROR `), warning: bgYellow(` WARNING `), info: bgBlue(` INFO `), success: bgGreen(` SUCCESS `), cancel: white.bgRed(` X `) }; var space = /* @__PURE__ */ __name((n6 = 1) => { return hidden("\u200A".repeat(n6)); }, "space"); var logRaw = /* @__PURE__ */ __name((msg) => { stdout.write(`${msg} `); }, "logRaw"); var log = /* @__PURE__ */ __name((msg) => { const lines = msg.split("\n").map((ln) => `${gray(shapes.bar)}${ln.length > 0 ? " " + white(ln) : ""}`); logRaw(lines.join("\n")); }, "log"); var newline = /* @__PURE__ */ __name(() => { log(""); }, "newline"); var format6 = /* @__PURE__ */ __name((msg, { linePrefix = gray(shapes.bar), firstLinePrefix = linePrefix, newlineBefore = false, newlineAfter = false, formatLine = /* @__PURE__ */ __name((line) => white(line), "formatLine"), multiline = true } = {}) => { const lines = multiline ? msg.split("\n") : [msg]; const formattedLines = lines.map( (line, i5) => (i5 === 0 ? firstLinePrefix : linePrefix) + space() + formatLine(line) ); if (newlineBefore) { formattedLines.unshift(linePrefix); } if (newlineAfter) { formattedLines.push(linePrefix); } return formattedLines.join("\n"); }, "format"); var updateStatus = /* @__PURE__ */ __name((msg, printNewLine = true) => { logRaw( format6(msg, { firstLinePrefix: gray(shapes.leftT), linePrefix: gray(shapes.bar), newlineAfter: printNewLine }) ); }, "updateStatus"); var startSection = /* @__PURE__ */ __name((heading, subheading, printNewLine = true) => { logRaw( `${gray(shapes.corners.tl)} ${brandColor(heading)} ${subheading ? dim(subheading) : ""}` ); if (printNewLine) { newline(); } }, "startSection"); var endSection = /* @__PURE__ */ __name((heading, subheading) => { logRaw( `${gray(shapes.corners.bl)} ${brandColor(heading)} ${subheading ? dim(subheading) : ""} ` ); }, "endSection"); var cancel = /* @__PURE__ */ __name((msg, { // current default is backcompat and makes sense going forward too shape = shapes.corners.bl, // current default for backcompat -- TODO: change default to true once all callees have been updated multiline = false } = {}) => { logRaw( format6(msg, { firstLinePrefix: `${gray(shape)} ${status.cancel}`, linePrefix: gray(shapes.bar), newlineBefore: true, formatLine: (line) => dim(line), // for backcompat but it's not ideal for this to be "dim" multiline }) ); }, "cancel"); var warn = /* @__PURE__ */ __name((msg, { // current default for backcompat -- TODO: change default to shapes.bar once all callees have been updated shape = shapes.corners.bl, // current default for backcompat -- TODO: change default to true once all callees have been updated multiline = false, newlineBefore = true } = {}) => { logRaw( format6(msg, { firstLinePrefix: gray(shape) + space() + status.warning, linePrefix: gray(shapes.bar), formatLine: (line) => dim(line), // for backcompat but it's not ideal for this to be "dim" multiline, newlineBefore }) ); }, "warn"); var success = /* @__PURE__ */ __name((msg, { // current default for backcompat -- TODO: change default to shapes.bar once all callees have been updated shape = shapes.corners.bl, // current default for backcompat -- TODO: change default to true once all callees have been updated multiline = false } = {}) => { logRaw( format6(msg, { firstLinePrefix: gray(shape) + space() + status.success, linePrefix: gray(shapes.bar), newlineBefore: true, formatLine: (line) => dim(line), // for backcompat but it's not ideal for this to be "dim" multiline }) ); }, "success"); var stripAnsi3 = /* @__PURE__ */ __name((str) => { const pattern = [ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))" ].join("|"); const regex2 = RegExp(pattern, "g"); return str.replace(linkRegex, "$2").replace(regex2, ""); }, "stripAnsi"); var linkRegex = ( // eslint-disable-next-line no-control-regex /\u001B\]8;;(?.+)\u001B\\(?