"use strict"; 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 __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], 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 __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); // node_modules/tunnel/lib/tunnel.js var require_tunnel = __commonJS({ "node_modules/tunnel/lib/tunnel.js"(exports2) { "use strict"; var net11 = require("net"); var tls8 = require("tls"); var http6 = require("http"); var https5 = require("https"); var events = require("events"); var assert4 = require("assert"); var util = require("util"); exports2.httpOverHttp = httpOverHttp2; exports2.httpsOverHttp = httpsOverHttp2; exports2.httpOverHttps = httpOverHttps2; exports2.httpsOverHttps = httpsOverHttps2; function httpOverHttp2(options) { var agent = new TunnelingAgent(options); agent.request = http6.request; return agent; } function httpsOverHttp2(options) { var agent = new TunnelingAgent(options); agent.request = http6.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function httpOverHttps2(options) { var agent = new TunnelingAgent(options); agent.request = https5.request; return agent; } function httpsOverHttps2(options) { var agent = new TunnelingAgent(options); agent.request = https5.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function TunnelingAgent(options) { var self = this; self.options = options || {}; self.proxyOptions = self.options.proxy || {}; self.maxSockets = self.options.maxSockets || http6.Agent.defaultMaxSockets; self.requests = []; self.sockets = []; self.on("free", function onFree(socket, host, port, localAddress) { var options2 = toOptions(host, port, localAddress); for (var i5 = 0, len = self.requests.length; i5 < len; ++i5) { var pending = self.requests[i5]; if (pending.host === options2.host && pending.port === options2.port) { self.requests.splice(i5, 1); pending.request.onSocket(socket); return; } } socket.destroy(); self.removeSocket(socket); }); } util.inherits(TunnelingAgent, events.EventEmitter); TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { var self = this; var options = mergeOptions({ request: req }, self.options, toOptions(host, port, localAddress)); if (self.sockets.length >= this.maxSockets) { self.requests.push(options); return; } self.createSocket(options, function(socket) { socket.on("free", onFree); socket.on("close", onCloseOrRemove); socket.on("agentRemove", onCloseOrRemove); req.onSocket(socket); function onFree() { self.emit("free", socket, options); } function onCloseOrRemove(err) { self.removeSocket(socket); socket.removeListener("free", onFree); socket.removeListener("close", onCloseOrRemove); socket.removeListener("agentRemove", onCloseOrRemove); } }); }; TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { var self = this; var placeholder = {}; self.sockets.push(placeholder); var connectOptions = mergeOptions({}, self.proxyOptions, { method: "CONNECT", path: options.host + ":" + options.port, agent: false, headers: { host: options.host + ":" + options.port } }); if (options.localAddress) { connectOptions.localAddress = options.localAddress; } if (connectOptions.proxyAuth) { connectOptions.headers = connectOptions.headers || {}; connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64"); } debug17("making CONNECT request"); var connectReq = self.request(connectOptions); connectReq.useChunkedEncodingByDefault = false; connectReq.once("response", onResponse); connectReq.once("upgrade", onUpgrade); connectReq.once("connect", onConnect); connectReq.once("error", onError); connectReq.end(); function onResponse(res) { res.upgrade = true; } function onUpgrade(res, socket, head) { process.nextTick(function() { onConnect(res, socket, head); }); } function onConnect(res, socket, head) { connectReq.removeAllListeners(); socket.removeAllListeners(); if (res.statusCode !== 200) { debug17( "tunneling socket could not be established, statusCode=%d", res.statusCode ); socket.destroy(); var error3 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); error3.code = "ECONNRESET"; options.request.emit("error", error3); self.removeSocket(placeholder); return; } if (head.length > 0) { debug17("got illegal response body from proxy"); socket.destroy(); var error3 = new Error("got illegal response body from proxy"); error3.code = "ECONNRESET"; options.request.emit("error", error3); self.removeSocket(placeholder); return; } debug17("tunneling connection has established"); self.sockets[self.sockets.indexOf(placeholder)] = socket; return cb(socket); } function onError(cause) { connectReq.removeAllListeners(); debug17( "tunneling socket could not be established, cause=%s\n", cause.message, cause.stack ); var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); error3.code = "ECONNRESET"; options.request.emit("error", error3); self.removeSocket(placeholder); } }; TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { var pos = this.sockets.indexOf(socket); if (pos === -1) { return; } this.sockets.splice(pos, 1); var pending = this.requests.shift(); if (pending) { this.createSocket(pending, function(socket2) { pending.request.onSocket(socket2); }); } }; function createSecureSocket(options, cb) { var self = this; TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { var hostHeader = options.request.getHeader("host"); var tlsOptions = mergeOptions({}, self.options, { socket, servername: hostHeader ? hostHeader.replace(/:.*$/, "") : options.host }); var secureSocket = tls8.connect(0, tlsOptions); self.sockets[self.sockets.indexOf(socket)] = secureSocket; cb(secureSocket); }); } function toOptions(host, port, localAddress) { if (typeof host === "string") { return { host, port, localAddress }; } return host; } function mergeOptions(target) { for (var i5 = 1, len = arguments.length; i5 < len; ++i5) { var overrides = arguments[i5]; if (typeof overrides === "object") { var keys = Object.keys(overrides); for (var j5 = 0, keyLen = keys.length; j5 < keyLen; ++j5) { var k5 = keys[j5]; if (overrides[k5] !== void 0) { target[k5] = overrides[k5]; } } } } return target; } var debug17; if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { debug17 = function() { var args = Array.prototype.slice.call(arguments); if (typeof args[0] === "string") { args[0] = "TUNNEL: " + args[0]; } else { args.unshift("TUNNEL:"); } console.error.apply(console, args); }; } else { debug17 = function() { }; } exports2.debug = debug17; } }); // node_modules/tunnel/index.js var require_tunnel2 = __commonJS({ "node_modules/tunnel/index.js"(exports2, module2) { module2.exports = require_tunnel(); } }); // node_modules/undici/lib/core/symbols.js var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { kClose: /* @__PURE__ */ Symbol("close"), kDestroy: /* @__PURE__ */ Symbol("destroy"), kDispatch: /* @__PURE__ */ Symbol("dispatch"), kUrl: /* @__PURE__ */ Symbol("url"), kWriting: /* @__PURE__ */ Symbol("writing"), kResuming: /* @__PURE__ */ Symbol("resuming"), kQueue: /* @__PURE__ */ Symbol("queue"), kConnect: /* @__PURE__ */ Symbol("connect"), kConnecting: /* @__PURE__ */ Symbol("connecting"), kKeepAliveDefaultTimeout: /* @__PURE__ */ Symbol("default keep alive timeout"), kKeepAliveMaxTimeout: /* @__PURE__ */ Symbol("max keep alive timeout"), kKeepAliveTimeoutThreshold: /* @__PURE__ */ Symbol("keep alive timeout threshold"), kKeepAliveTimeoutValue: /* @__PURE__ */ Symbol("keep alive timeout"), kKeepAlive: /* @__PURE__ */ Symbol("keep alive"), kHeadersTimeout: /* @__PURE__ */ Symbol("headers timeout"), kBodyTimeout: /* @__PURE__ */ Symbol("body timeout"), kServerName: /* @__PURE__ */ Symbol("server name"), kLocalAddress: /* @__PURE__ */ Symbol("local address"), kHost: /* @__PURE__ */ Symbol("host"), kNoRef: /* @__PURE__ */ Symbol("no ref"), kBodyUsed: /* @__PURE__ */ Symbol("used"), kBody: /* @__PURE__ */ Symbol("abstracted request body"), kRunning: /* @__PURE__ */ Symbol("running"), kBlocking: /* @__PURE__ */ Symbol("blocking"), kPending: /* @__PURE__ */ Symbol("pending"), kSize: /* @__PURE__ */ Symbol("size"), kBusy: /* @__PURE__ */ Symbol("busy"), kQueued: /* @__PURE__ */ Symbol("queued"), kFree: /* @__PURE__ */ Symbol("free"), kConnected: /* @__PURE__ */ Symbol("connected"), kClosed: /* @__PURE__ */ Symbol("closed"), kNeedDrain: /* @__PURE__ */ Symbol("need drain"), kReset: /* @__PURE__ */ Symbol("reset"), kDestroyed: /* @__PURE__ */ Symbol.for("nodejs.stream.destroyed"), kResume: /* @__PURE__ */ Symbol("resume"), kOnError: /* @__PURE__ */ Symbol("on error"), kMaxHeadersSize: /* @__PURE__ */ Symbol("max headers size"), kRunningIdx: /* @__PURE__ */ Symbol("running index"), kPendingIdx: /* @__PURE__ */ Symbol("pending index"), kError: /* @__PURE__ */ Symbol("error"), kClients: /* @__PURE__ */ Symbol("clients"), kClient: /* @__PURE__ */ Symbol("client"), kParser: /* @__PURE__ */ Symbol("parser"), kOnDestroyed: /* @__PURE__ */ Symbol("destroy callbacks"), kPipelining: /* @__PURE__ */ Symbol("pipelining"), kSocket: /* @__PURE__ */ Symbol("socket"), kHostHeader: /* @__PURE__ */ Symbol("host header"), kConnector: /* @__PURE__ */ Symbol("connector"), kStrictContentLength: /* @__PURE__ */ Symbol("strict content length"), kMaxRedirections: /* @__PURE__ */ Symbol("maxRedirections"), kMaxRequests: /* @__PURE__ */ Symbol("maxRequestsPerClient"), kProxy: /* @__PURE__ */ Symbol("proxy agent options"), kCounter: /* @__PURE__ */ Symbol("socket request counter"), kInterceptors: /* @__PURE__ */ Symbol("dispatch interceptors"), kMaxResponseSize: /* @__PURE__ */ Symbol("max response size"), kHTTP2Session: /* @__PURE__ */ Symbol("http2Session"), kHTTP2SessionState: /* @__PURE__ */ Symbol("http2Session state"), kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), kConstruct: /* @__PURE__ */ Symbol("constructable"), kListeners: /* @__PURE__ */ Symbol("listeners"), kHTTPContext: /* @__PURE__ */ Symbol("http context"), kMaxConcurrentStreams: /* @__PURE__ */ Symbol("max concurrent streams"), kNoProxyAgent: /* @__PURE__ */ Symbol("no proxy agent"), kHttpProxyAgent: /* @__PURE__ */ Symbol("http proxy agent"), kHttpsProxyAgent: /* @__PURE__ */ Symbol("https proxy agent") }; } }); // node_modules/undici/lib/core/errors.js var require_errors = __commonJS({ "node_modules/undici/lib/core/errors.js"(exports2, module2) { "use strict"; var kUndiciError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR"); var UndiciError = class extends Error { constructor(message) { super(message); this.name = "UndiciError"; this.code = "UND_ERR"; } static [Symbol.hasInstance](instance) { return instance && instance[kUndiciError] === true; } [kUndiciError] = true; }; var kConnectTimeoutError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"); var ConnectTimeoutError = class extends UndiciError { constructor(message) { super(message); this.name = "ConnectTimeoutError"; this.message = message || "Connect Timeout Error"; this.code = "UND_ERR_CONNECT_TIMEOUT"; } static [Symbol.hasInstance](instance) { return instance && instance[kConnectTimeoutError] === true; } [kConnectTimeoutError] = true; }; var kHeadersTimeoutError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"); var HeadersTimeoutError = class extends UndiciError { constructor(message) { super(message); this.name = "HeadersTimeoutError"; this.message = message || "Headers Timeout Error"; this.code = "UND_ERR_HEADERS_TIMEOUT"; } static [Symbol.hasInstance](instance) { return instance && instance[kHeadersTimeoutError] === true; } [kHeadersTimeoutError] = true; }; var kHeadersOverflowError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"); var HeadersOverflowError = class extends UndiciError { constructor(message) { super(message); this.name = "HeadersOverflowError"; this.message = message || "Headers Overflow Error"; this.code = "UND_ERR_HEADERS_OVERFLOW"; } static [Symbol.hasInstance](instance) { return instance && instance[kHeadersOverflowError] === true; } [kHeadersOverflowError] = true; }; var kBodyTimeoutError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"); var BodyTimeoutError = class extends UndiciError { constructor(message) { super(message); this.name = "BodyTimeoutError"; this.message = message || "Body Timeout Error"; this.code = "UND_ERR_BODY_TIMEOUT"; } static [Symbol.hasInstance](instance) { return instance && instance[kBodyTimeoutError] === true; } [kBodyTimeoutError] = true; }; var kResponseStatusCodeError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"); var ResponseStatusCodeError = class extends UndiciError { constructor(message, statusCode, headers, body) { super(message); this.name = "ResponseStatusCodeError"; this.message = message || "Response Status Code Error"; this.code = "UND_ERR_RESPONSE_STATUS_CODE"; this.body = body; this.status = statusCode; this.statusCode = statusCode; this.headers = headers; } static [Symbol.hasInstance](instance) { return instance && instance[kResponseStatusCodeError] === true; } [kResponseStatusCodeError] = true; }; var kInvalidArgumentError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_INVALID_ARG"); var InvalidArgumentError = class extends UndiciError { constructor(message) { super(message); this.name = "InvalidArgumentError"; this.message = message || "Invalid Argument Error"; this.code = "UND_ERR_INVALID_ARG"; } static [Symbol.hasInstance](instance) { return instance && instance[kInvalidArgumentError] === true; } [kInvalidArgumentError] = true; }; var kInvalidReturnValueError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"); var InvalidReturnValueError = class extends UndiciError { constructor(message) { super(message); this.name = "InvalidReturnValueError"; this.message = message || "Invalid Return Value Error"; this.code = "UND_ERR_INVALID_RETURN_VALUE"; } static [Symbol.hasInstance](instance) { return instance && instance[kInvalidReturnValueError] === true; } [kInvalidReturnValueError] = true; }; var kAbortError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_ABORT"); var AbortError = class extends UndiciError { constructor(message) { super(message); this.name = "AbortError"; this.message = message || "The operation was aborted"; this.code = "UND_ERR_ABORT"; } static [Symbol.hasInstance](instance) { return instance && instance[kAbortError] === true; } [kAbortError] = true; }; var kRequestAbortedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_ABORTED"); var RequestAbortedError = class extends AbortError { constructor(message) { super(message); this.name = "AbortError"; this.message = message || "Request aborted"; this.code = "UND_ERR_ABORTED"; } static [Symbol.hasInstance](instance) { return instance && instance[kRequestAbortedError] === true; } [kRequestAbortedError] = true; }; var kInformationalError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_INFO"); var InformationalError = class extends UndiciError { constructor(message) { super(message); this.name = "InformationalError"; this.message = message || "Request information"; this.code = "UND_ERR_INFO"; } static [Symbol.hasInstance](instance) { return instance && instance[kInformationalError] === true; } [kInformationalError] = true; }; var kRequestContentLengthMismatchError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"); var RequestContentLengthMismatchError = class extends UndiciError { constructor(message) { super(message); this.name = "RequestContentLengthMismatchError"; this.message = message || "Request body length does not match content-length header"; this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"; } static [Symbol.hasInstance](instance) { return instance && instance[kRequestContentLengthMismatchError] === true; } [kRequestContentLengthMismatchError] = true; }; var kResponseContentLengthMismatchError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"); var ResponseContentLengthMismatchError = class extends UndiciError { constructor(message) { super(message); this.name = "ResponseContentLengthMismatchError"; this.message = message || "Response body length does not match content-length header"; this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH"; } static [Symbol.hasInstance](instance) { return instance && instance[kResponseContentLengthMismatchError] === true; } [kResponseContentLengthMismatchError] = true; }; var kClientDestroyedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_DESTROYED"); var ClientDestroyedError = class extends UndiciError { constructor(message) { super(message); this.name = "ClientDestroyedError"; this.message = message || "The client is destroyed"; this.code = "UND_ERR_DESTROYED"; } static [Symbol.hasInstance](instance) { return instance && instance[kClientDestroyedError] === true; } [kClientDestroyedError] = true; }; var kClientClosedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_CLOSED"); var ClientClosedError = class extends UndiciError { constructor(message) { super(message); this.name = "ClientClosedError"; this.message = message || "The client is closed"; this.code = "UND_ERR_CLOSED"; } static [Symbol.hasInstance](instance) { return instance && instance[kClientClosedError] === true; } [kClientClosedError] = true; }; var kSocketError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_SOCKET"); var SocketError = class extends UndiciError { constructor(message, socket) { super(message); this.name = "SocketError"; this.message = message || "Socket error"; this.code = "UND_ERR_SOCKET"; this.socket = socket; } static [Symbol.hasInstance](instance) { return instance && instance[kSocketError] === true; } [kSocketError] = true; }; var kNotSupportedError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"); var NotSupportedError = class extends UndiciError { constructor(message) { super(message); this.name = "NotSupportedError"; this.message = message || "Not supported error"; this.code = "UND_ERR_NOT_SUPPORTED"; } static [Symbol.hasInstance](instance) { return instance && instance[kNotSupportedError] === true; } [kNotSupportedError] = true; }; var kBalancedPoolMissingUpstreamError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"); var BalancedPoolMissingUpstreamError = class extends UndiciError { constructor(message) { super(message); this.name = "MissingUpstreamError"; this.message = message || "No upstream has been added to the BalancedPool"; this.code = "UND_ERR_BPL_MISSING_UPSTREAM"; } static [Symbol.hasInstance](instance) { return instance && instance[kBalancedPoolMissingUpstreamError] === true; } [kBalancedPoolMissingUpstreamError] = true; }; var kHTTPParserError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_HTTP_PARSER"); var HTTPParserError = class extends Error { constructor(message, code, data3) { super(message); this.name = "HTTPParserError"; this.code = code ? `HPE_${code}` : void 0; this.data = data3 ? data3.toString() : void 0; } static [Symbol.hasInstance](instance) { return instance && instance[kHTTPParserError] === true; } [kHTTPParserError] = true; }; var kResponseExceededMaxSizeError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"); var ResponseExceededMaxSizeError = class extends UndiciError { constructor(message) { super(message); this.name = "ResponseExceededMaxSizeError"; this.message = message || "Response content exceeded max size"; this.code = "UND_ERR_RES_EXCEEDED_MAX_SIZE"; } static [Symbol.hasInstance](instance) { return instance && instance[kResponseExceededMaxSizeError] === true; } [kResponseExceededMaxSizeError] = true; }; var kRequestRetryError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_REQ_RETRY"); var RequestRetryError = class extends UndiciError { constructor(message, code, { headers, data: data3 }) { super(message); this.name = "RequestRetryError"; this.message = message || "Request retry error"; this.code = "UND_ERR_REQ_RETRY"; this.statusCode = code; this.data = data3; this.headers = headers; } static [Symbol.hasInstance](instance) { return instance && instance[kRequestRetryError] === true; } [kRequestRetryError] = true; }; var kResponseError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_RESPONSE"); var ResponseError = class extends UndiciError { constructor(message, code, { headers, data: data3 }) { super(message); this.name = "ResponseError"; this.message = message || "Response error"; this.code = "UND_ERR_RESPONSE"; this.statusCode = code; this.data = data3; this.headers = headers; } static [Symbol.hasInstance](instance) { return instance && instance[kResponseError] === true; } [kResponseError] = true; }; var kSecureProxyConnectionError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_PRX_TLS"); var SecureProxyConnectionError = class extends UndiciError { constructor(cause, message, options) { super(message, { cause, ...options ?? {} }); this.name = "SecureProxyConnectionError"; this.message = message || "Secure Proxy Connection failed"; this.code = "UND_ERR_PRX_TLS"; this.cause = cause; } static [Symbol.hasInstance](instance) { return instance && instance[kSecureProxyConnectionError] === true; } [kSecureProxyConnectionError] = true; }; var kMessageSizeExceededError = /* @__PURE__ */ Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"); var MessageSizeExceededError = class extends UndiciError { constructor(message) { super(message); this.name = "MessageSizeExceededError"; this.message = message || "Max decompressed message size exceeded"; this.code = "UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"; } static [Symbol.hasInstance](instance) { return instance && instance[kMessageSizeExceededError] === true; } get [kMessageSizeExceededError]() { return true; } }; module2.exports = { AbortError, HTTPParserError, UndiciError, HeadersTimeoutError, HeadersOverflowError, BodyTimeoutError, RequestContentLengthMismatchError, ConnectTimeoutError, ResponseStatusCodeError, InvalidArgumentError, InvalidReturnValueError, RequestAbortedError, ClientDestroyedError, ClientClosedError, InformationalError, SocketError, NotSupportedError, ResponseContentLengthMismatchError, BalancedPoolMissingUpstreamError, ResponseExceededMaxSizeError, RequestRetryError, ResponseError, SecureProxyConnectionError, MessageSizeExceededError }; } }); // node_modules/undici/lib/core/constants.js var require_constants = __commonJS({ "node_modules/undici/lib/core/constants.js"(exports2, module2) { "use strict"; 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); module2.exports = { wellknownHeaderNames, headerNameLowerCasedRecord }; } }); // node_modules/undici/lib/core/tree.js var require_tree = __commonJS({ "node_modules/undici/lib/core/tree.js"(exports2, module2) { "use strict"; var { wellknownHeaderNames, headerNameLowerCasedRecord } = require_constants(); var TstNode = class _TstNode { /** @type {any} */ value = null; /** @type {null | TstNode} */ left = null; /** @type {null | TstNode} */ middle = null; /** @type {null | TstNode} */ right = null; /** @type {number} */ code; /** * @param {string} key * @param {any} value * @param {number} index */ constructor(key, value, index) { if (index === void 0 || index >= key.length) { throw new TypeError("Unreachable"); } const code = this.code = key.charCodeAt(index); if (code > 127) { throw new TypeError("key must be ascii string"); } if (key.length !== ++index) { this.middle = new _TstNode(key, value, index); } else { this.value = value; } } /** * @param {string} key * @param {any} value */ add(key, value) { const length = key.length; if (length === 0) { throw new TypeError("Unreachable"); } let index = 0; let node = this; while (true) { const code = key.charCodeAt(index); if (code > 127) { throw new TypeError("key must be ascii string"); } if (node.code === code) { if (length === ++index) { node.value = value; break; } else if (node.middle !== null) { node = node.middle; } else { node.middle = new _TstNode(key, value, index); break; } } else if (node.code < code) { if (node.left !== null) { node = node.left; } else { node.left = new _TstNode(key, value, index); break; } } else if (node.right !== null) { node = node.right; } else { node.right = new _TstNode(key, value, index); break; } } } /** * @param {Uint8Array} key * @return {TstNode | null} */ search(key) { const keylength = key.length; let index = 0; let node = this; while (node !== null && index < keylength) { let code = key[index]; if (code <= 90 && code >= 65) { code |= 32; } while (node !== null) { if (code === node.code) { if (keylength === ++index) { return node; } node = node.middle; break; } node = node.code < code ? node.left : node.right; } } return null; } }; var TernarySearchTree = class { /** @type {TstNode | null} */ node = null; /** * @param {string} key * @param {any} value * */ insert(key, value) { if (this.node === null) { this.node = new TstNode(key, value, 0); } else { this.node.add(key, value); } } /** * @param {Uint8Array} key * @return {any} */ lookup(key) { return this.node?.search(key)?.value ?? null; } }; var tree = new TernarySearchTree(); for (let i5 = 0; i5 < wellknownHeaderNames.length; ++i5) { const key = headerNameLowerCasedRecord[wellknownHeaderNames[i5]]; tree.insert(key, key); } module2.exports = { TernarySearchTree, tree }; } }); // node_modules/undici/lib/core/util.js var require_util = __commonJS({ "node_modules/undici/lib/core/util.js"(exports2, module2) { "use strict"; var assert4 = require("node:assert"); var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols(); var { IncomingMessage } = require("node:http"); var stream = require("node:stream"); var net11 = require("node:net"); var { Blob: Blob2 } = require("node:buffer"); var nodeUtil = require("node:util"); var { stringify } = require("node:querystring"); var { EventEmitter: EE } = require("node:events"); var { InvalidArgumentError } = require_errors(); var { headerNameLowerCasedRecord } = require_constants(); var { tree } = require_tree(); var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v) => Number(v)); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; this[kBodyUsed] = false; } async *[Symbol.asyncIterator]() { assert4(!this[kBodyUsed], "disturbed"); this[kBodyUsed] = true; yield* this[kBody]; } }; function wrapRequestBody(body) { if (isStream(body)) { if (bodyLength(body) === 0) { body.on("data", function() { assert4(false); }); } if (typeof body.readableDidRead !== "boolean") { body[kBodyUsed] = false; EE.prototype.on.call(body, "data", function() { this[kBodyUsed] = true; }); } return body; } else if (body && typeof body.pipeTo === "function") { return new BodyAsyncIterable(body); } else if (body && typeof body !== "string" && !ArrayBuffer.isView(body) && isIterable(body)) { return new BodyAsyncIterable(body); } else { return body; } } function nop() { } function isStream(obj) { return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function"; } function isBlobLike(object) { if (object === null) { return false; } else if (object instanceof Blob2) { return true; } else if (typeof object !== "object") { return false; } else { const sTag = object[Symbol.toStringTag]; return (sTag === "Blob" || sTag === "File") && ("stream" in object && typeof object.stream === "function" || "arrayBuffer" in object && typeof object.arrayBuffer === "function"); } } function buildURL(url, queryParams) { if (url.includes("?") || url.includes("#")) { throw new Error('Query params cannot be passed when url already contains "?" or "#".'); } const stringified = stringify(queryParams); if (stringified) { url += "?" + stringified; } return url; } function isValidPort(port) { const value = parseInt(port, 10); return value === Number(port) && value >= 0 && value <= 65535; } function isHttpOrHttpsPrefixed(value) { return value != null && value[0] === "h" && value[1] === "t" && value[2] === "t" && value[3] === "p" && (value[4] === ":" || value[4] === "s" && value[5] === ":"); } function parseURL(url) { if (typeof url === "string") { url = new URL(url); if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); } return url; } if (!url || typeof url !== "object") { throw new InvalidArgumentError("Invalid URL: The URL argument must be a non-null object."); } if (!(url instanceof URL)) { if (url.port != null && url.port !== "" && isValidPort(url.port) === false) { throw new InvalidArgumentError("Invalid URL: port must be a valid integer or a string representation of an integer."); } if (url.path != null && typeof url.path !== "string") { throw new InvalidArgumentError("Invalid URL path: the path must be a string or null/undefined."); } if (url.pathname != null && typeof url.pathname !== "string") { throw new InvalidArgumentError("Invalid URL pathname: the pathname must be a string or null/undefined."); } if (url.hostname != null && typeof url.hostname !== "string") { throw new InvalidArgumentError("Invalid URL hostname: the hostname must be a string or null/undefined."); } if (url.origin != null && typeof url.origin !== "string") { throw new InvalidArgumentError("Invalid URL origin: the origin must be a string or null/undefined."); } if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); } const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80; let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`; let path3 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } if (path3 && path3[0] !== "/") { path3 = `/${path3}`; } return new URL(`${origin}${path3}`); } if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); } return url; } function parseOrigin(url) { url = parseURL(url); if (url.pathname !== "/" || url.search || url.hash) { throw new InvalidArgumentError("invalid url"); } return url; } function getHostname(host) { if (host[0] === "[") { const idx2 = host.indexOf("]"); assert4(idx2 !== -1); return host.substring(1, idx2); } const idx = host.indexOf(":"); if (idx === -1) return host; return host.substring(0, idx); } function getServerName(host) { if (!host) { return null; } assert4(typeof host === "string"); const servername = getHostname(host); if (net11.isIP(servername)) { return ""; } return servername; } function deepClone(obj) { return JSON.parse(JSON.stringify(obj)); } function isAsyncIterable(obj) { return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function"); } function isIterable(obj) { return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function")); } function bodyLength(body) { if (body == null) { return 0; } else if (isStream(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; } function isDestroyed(body) { return body && !!(body.destroyed || body[kDestroyed] || stream.isDestroyed?.(body)); } function destroy(stream2, err) { if (stream2 == null || !isStream(stream2) || isDestroyed(stream2)) { return; } if (typeof stream2.destroy === "function") { if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) { stream2.socket = null; } stream2.destroy(err); } else if (err) { queueMicrotask(() => { stream2.emit("error", err); }); } if (stream2.destroyed !== true) { stream2[kDestroyed] = true; } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; function parseKeepAliveTimeout(val) { const m3 = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m3 ? parseInt(m3[1], 10) * 1e3 : null; } function headerNameToString(value) { return typeof value === "string" ? headerNameLowerCasedRecord[value] ?? value.toLowerCase() : tree.lookup(value) ?? value.toString("latin1").toLowerCase(); } function bufferToLowerCasedHeaderName(value) { return tree.lookup(value) ?? value.toString("latin1").toLowerCase(); } function parseHeaders(headers, obj) { if (obj === void 0) obj = {}; for (let i5 = 0; i5 < headers.length; i5 += 2) { const key = headerNameToString(headers[i5]); let val = obj[key]; if (val) { if (typeof val === "string") { val = [val]; obj[key] = val; } val.push(headers[i5 + 1].toString("utf8")); } else { const headersValue = headers[i5 + 1]; if (typeof headersValue === "string") { obj[key] = headersValue; } else { obj[key] = Array.isArray(headersValue) ? headersValue.map((x) => x.toString("utf8")) : headersValue.toString("utf8"); } } } if ("content-length" in obj && "content-disposition" in obj) { obj["content-disposition"] = Buffer.from(obj["content-disposition"]).toString("latin1"); } return obj; } function parseRawHeaders(headers) { const len = headers.length; const ret = new Array(len); let hasContentLength = false; let contentDispositionIdx = -1; let key; let val; let kLen = 0; for (let n3 = 0; n3 < headers.length; n3 += 2) { key = headers[n3]; val = headers[n3 + 1]; typeof key !== "string" && (key = key.toString()); typeof val !== "string" && (val = val.toString("utf8")); kLen = key.length; if (kLen === 14 && key[7] === "-" && (key === "content-length" || key.toLowerCase() === "content-length")) { hasContentLength = true; } else if (kLen === 19 && key[7] === "-" && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { contentDispositionIdx = n3 + 1; } ret[n3] = key; ret[n3 + 1] = val; } if (hasContentLength && contentDispositionIdx !== -1) { ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString("latin1"); } return ret; } function isBuffer(buffer) { return buffer instanceof Uint8Array || Buffer.isBuffer(buffer); } function validateHandler(handler, method, upgrade) { if (!handler || typeof handler !== "object") { throw new InvalidArgumentError("handler must be an object"); } if (typeof handler.onConnect !== "function") { throw new InvalidArgumentError("invalid onConnect method"); } if (typeof handler.onError !== "function") { throw new InvalidArgumentError("invalid onError method"); } if (typeof handler.onBodySent !== "function" && handler.onBodySent !== void 0) { throw new InvalidArgumentError("invalid onBodySent method"); } if (upgrade || method === "CONNECT") { if (typeof handler.onUpgrade !== "function") { throw new InvalidArgumentError("invalid onUpgrade method"); } } else { if (typeof handler.onHeaders !== "function") { throw new InvalidArgumentError("invalid onHeaders method"); } if (typeof handler.onData !== "function") { throw new InvalidArgumentError("invalid onData method"); } if (typeof handler.onComplete !== "function") { throw new InvalidArgumentError("invalid onComplete method"); } } } function isDisturbed(body) { return !!(body && (stream.isDisturbed(body) || body[kBodyUsed])); } function isErrored(body) { return !!(body && stream.isErrored(body)); } function isReadable(body) { return !!(body && stream.isReadable(body)); } 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 }; } function ReadableStreamFrom(iterable) { let iterator; return new ReadableStream( { async start() { iterator = iterable[Symbol.asyncIterator](); }, async pull(controller) { const { done, value } = await iterator.next(); if (done) { queueMicrotask(() => { controller.close(); controller.byobRequest?.respond(0); }); } else { const buf = Buffer.isBuffer(value) ? value : Buffer.from(value); if (buf.byteLength) { controller.enqueue(new Uint8Array(buf)); } } return controller.desiredSize > 0; }, async cancel(reason) { await iterator.return(); }, type: "bytes" } ); } 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"; } 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); } var hasToWellFormed = typeof String.prototype.toWellFormed === "function"; var hasIsWellFormed = typeof String.prototype.isWellFormed === "function"; function toUSVString(val) { return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val); } function isUSVString(val) { return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}`; } function isTokenCharCode(c5) { switch (c5) { 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 c5 >= 33 && c5 <= 126; } } 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; } var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; function isValidHeaderValue(characters) { return !headerCharRegex.test(characters); } function parseRangeHeader(range2) { if (range2 == null || range2 === "") return { start: 0, end: null, size: null }; const m3 = range2 ? range2.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null; return m3 ? { start: parseInt(m3[1]), end: m3[2] ? parseInt(m3[2]) : null, size: m3[3] ? parseInt(m3[3]) : null } : null; } function addListener(obj, name, listener) { const listeners = obj[kListeners] ??= []; listeners.push([name, listener]); obj.on(name, listener); return obj; } function removeAllListeners(obj) { for (const [name, listener] of obj[kListeners] ?? []) { obj.removeListener(name, listener); } obj[kListeners] = null; } function errorRequest(client, request, err) { try { request.onError(err); assert4(request.aborted); } catch (err2) { client.emit("error", err2); } } var kEnumerableProperty = /* @__PURE__ */ Object.create(null); kEnumerableProperty.enumerable = true; var normalizedMethodRecordsBase = { delete: "DELETE", DELETE: "DELETE", get: "GET", GET: "GET", head: "HEAD", HEAD: "HEAD", options: "OPTIONS", OPTIONS: "OPTIONS", post: "POST", POST: "POST", put: "PUT", PUT: "PUT" }; var normalizedMethodRecords = { ...normalizedMethodRecordsBase, patch: "patch", PATCH: "PATCH" }; Object.setPrototypeOf(normalizedMethodRecordsBase, null); Object.setPrototypeOf(normalizedMethodRecords, null); module2.exports = { kEnumerableProperty, nop, isDisturbed, isErrored, isReadable, toUSVString, isUSVString, isBlobLike, parseOrigin, parseURL, getServerName, isStream, isIterable, isAsyncIterable, isDestroyed, headerNameToString, bufferToLowerCasedHeaderName, addListener, removeAllListeners, errorRequest, parseRawHeaders, parseHeaders, parseKeepAliveTimeout, destroy, bodyLength, deepClone, ReadableStreamFrom, isBuffer, validateHandler, getSocketInfo, isFormDataLike, buildURL, addAbortListener, isValidHTTPToken, isValidHeaderValue, isTokenCharCode, parseRangeHeader, normalizedMethodRecordsBase, normalizedMethodRecords, isValidPort, isHttpOrHttpsPrefixed, nodeMajor, nodeMinor, safeHTTPMethods: ["GET", "HEAD", "OPTIONS", "TRACE"], wrapRequestBody }; } }); // node_modules/undici/lib/core/diagnostics.js var require_diagnostics = __commonJS({ "node_modules/undici/lib/core/diagnostics.js"(exports2, module2) { "use strict"; var diagnosticsChannel = require("node:diagnostics_channel"); var util = require("node:util"); var undiciDebugLog = util.debuglog("undici"); var fetchDebuglog = util.debuglog("fetch"); var websocketDebuglog = util.debuglog("websocket"); var isClientSet = false; var channels = { // Client beforeConnect: diagnosticsChannel.channel("undici:client:beforeConnect"), connected: diagnosticsChannel.channel("undici:client:connected"), connectError: diagnosticsChannel.channel("undici:client:connectError"), sendHeaders: diagnosticsChannel.channel("undici:client:sendHeaders"), // Request create: diagnosticsChannel.channel("undici:request:create"), bodySent: diagnosticsChannel.channel("undici:request:bodySent"), headers: diagnosticsChannel.channel("undici:request:headers"), trailers: diagnosticsChannel.channel("undici:request:trailers"), error: diagnosticsChannel.channel("undici:request:error"), // WebSocket open: diagnosticsChannel.channel("undici:websocket:open"), close: diagnosticsChannel.channel("undici:websocket:close"), socketError: diagnosticsChannel.channel("undici:websocket:socket_error"), ping: diagnosticsChannel.channel("undici:websocket:ping"), pong: diagnosticsChannel.channel("undici:websocket:pong") }; if (undiciDebugLog.enabled || fetchDebuglog.enabled) { const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog; diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { const { connectParams: { version, protocol, port, host } } = evt; debuglog( "connecting to %s using %s%s", `${host}${port ? `:${port}` : ""}`, protocol, version ); }); diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { const { connectParams: { version, protocol, port, host } } = evt; debuglog( "connected to %s using %s%s", `${host}${port ? `:${port}` : ""}`, protocol, version ); }); diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { const { connectParams: { version, protocol, port, host }, error: error3 } = evt; debuglog( "connection to %s using %s%s errored - %s", `${host}${port ? `:${port}` : ""}`, protocol, version, error3.message ); }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { request: { method, path: path3, origin } } = evt; debuglog("sending request to %s %s/%s", method, origin, path3); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { request: { method, path: path3, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, path3, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { request: { method, path: path3, origin } } = evt; debuglog("trailers received from %s %s/%s", method, origin, path3); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { request: { method, path: path3, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, path3, error3.message ); }); isClientSet = true; } if (websocketDebuglog.enabled) { if (!isClientSet) { const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog; diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { const { connectParams: { version, protocol, port, host } } = evt; debuglog( "connecting to %s%s using %s%s", host, port ? `:${port}` : "", protocol, version ); }); diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { const { connectParams: { version, protocol, port, host } } = evt; debuglog( "connected to %s%s using %s%s", host, port ? `:${port}` : "", protocol, version ); }); diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { const { connectParams: { version, protocol, port, host }, error: error3 } = evt; debuglog( "connection to %s%s using %s%s errored - %s", host, port ? `:${port}` : "", protocol, version, error3.message ); }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { request: { method, path: path3, origin } } = evt; debuglog("sending request to %s %s/%s", method, origin, path3); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { const { address: { address, port } } = evt; websocketDebuglog("connection opened %s%s", address, port ? `:${port}` : ""); }); diagnosticsChannel.channel("undici:websocket:close").subscribe((evt) => { const { websocket, code, reason } = evt; websocketDebuglog( "closed connection to %s - %s %s", websocket.url, code, reason ); }); diagnosticsChannel.channel("undici:websocket:socket_error").subscribe((err) => { websocketDebuglog("connection errored - %s", err.message); }); diagnosticsChannel.channel("undici:websocket:ping").subscribe((evt) => { websocketDebuglog("ping received"); }); diagnosticsChannel.channel("undici:websocket:pong").subscribe((evt) => { websocketDebuglog("pong received"); }); } module2.exports = { channels }; } }); // node_modules/undici/lib/core/request.js var require_request = __commonJS({ "node_modules/undici/lib/core/request.js"(exports2, module2) { "use strict"; var { InvalidArgumentError, NotSupportedError } = require_errors(); var assert4 = require("node:assert"); var { isValidHTTPToken, isValidHeaderValue, isStream, destroy, isBuffer, isFormDataLike, isIterable, isBlobLike, buildURL, validateHandler, getServerName, normalizedMethodRecords } = require_util(); var { channels } = require_diagnostics(); var { headerNameLowerCasedRecord } = require_constants(); var invalidPathRegex = /[^\u0021-\u00ff]/; var kHandler = /* @__PURE__ */ Symbol("handler"); var Request2 = class { constructor(origin, { path: path3, method, body, headers, query, idempotent, blocking, upgrade, headersTimeout, bodyTimeout, reset, throwOnError, expectContinue, servername }, handler) { if (typeof path3 !== "string") { throw new InvalidArgumentError("path must be a string"); } else if (path3[0] !== "/" && !(path3.startsWith("http://") || path3.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); } else if (invalidPathRegex.test(path3)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { throw new InvalidArgumentError("method must be a string"); } else if (normalizedMethodRecords[method] === void 0 && !isValidHTTPToken(method)) { throw new InvalidArgumentError("invalid request method"); } if (upgrade && typeof upgrade !== "string") { throw new InvalidArgumentError("upgrade must be a string"); } if (upgrade && !isValidHeaderValue(upgrade)) { throw new InvalidArgumentError("invalid upgrade header"); } 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 (isStream(body)) { this.body = body; const rState = this.body._readableState; if (!rState || !rState.autoDestroy) { this.endHandler = function autoDestroy() { destroy(this); }; 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 (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 (isFormDataLike(body) || isIterable(body) || 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 ? buildURL(path3, query) : path3; 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") { if (headers[Symbol.iterator]) { for (const header of headers) { if (!Array.isArray(header) || header.length !== 2) { throw new InvalidArgumentError("headers must be in key-value pair format"); } processHeader(this, header[0], header[1]); } } else { const keys = Object.keys(headers); for (let i5 = 0; i5 < keys.length; ++i5) { processHeader(this, keys[i5], headers[keys[i5]]); } } } else if (headers != null) { throw new InvalidArgumentError("headers must be an object or an array"); } validateHandler(handler, method, upgrade); this.servername = servername || getServerName(this.host); this[kHandler] = handler; 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) { assert4(!this.aborted); assert4(!this.completed); if (this.error) { abort(this.error); } else { this.abort = abort; return this[kHandler].onConnect(abort); } } onResponseStarted() { return this[kHandler].onResponseStarted?.(); } onHeaders(statusCode, headers, resume3, statusText) { assert4(!this.aborted); assert4(!this.completed); if (channels.headers.hasSubscribers) { channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); } try { return this[kHandler].onHeaders(statusCode, headers, resume3, statusText); } catch (err) { this.abort(err); } } onData(chunk) { assert4(!this.aborted); assert4(!this.completed); try { return this[kHandler].onData(chunk); } catch (err) { this.abort(err); return false; } } onUpgrade(statusCode, headers, socket) { assert4(!this.aborted); assert4(!this.completed); return this[kHandler].onUpgrade(statusCode, headers, socket); } onComplete(trailers) { this.onFinally(); assert4(!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(error3) { this.onFinally(); if (channels.error.hasSubscribers) { channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; return this[kHandler].onError(error3); } 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; } } addHeader(key, value) { processHeader(this, key, value); return this; } }; function processHeader(request, key, val) { if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); } else if (val === void 0) { return; } let headerName = headerNameLowerCasedRecord[key]; if (headerName === void 0) { headerName = key.toLowerCase(); if (headerNameLowerCasedRecord[headerName] === void 0 && !isValidHTTPToken(headerName)) { throw new InvalidArgumentError("invalid header key"); } } if (Array.isArray(val)) { const arr = []; for (let i5 = 0; i5 < val.length; i5++) { if (typeof val[i5] === "string") { if (!isValidHeaderValue(val[i5])) { throw new InvalidArgumentError(`invalid ${key} header`); } arr.push(val[i5]); } else if (val[i5] === null) { arr.push(""); } else if (typeof val[i5] === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } else { arr.push(`${val[i5]}`); } } val = arr; } else if (typeof val === "string") { if (!isValidHeaderValue(val)) { throw new InvalidArgumentError(`invalid ${key} header`); } } else if (val === null) { val = ""; } else { val = `${val}`; } if (headerName === "host") { if (request.host !== null) { throw new InvalidArgumentError("duplicate host header"); } if (typeof val !== "string") { throw new InvalidArgumentError("invalid host header"); } request.host = val; } else if (headerName === "content-length") { if (request.contentLength !== null) { throw new InvalidArgumentError("duplicate content-length header"); } request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && headerName === "content-type") { request.contentType = val; request.headers.push(key, val); } else if (headerName === "transfer-encoding" || headerName === "keep-alive" || headerName === "upgrade") { throw new InvalidArgumentError(`invalid ${headerName} header`); } else if (headerName === "connection") { const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } if (value === "close") { request.reset = true; } } else if (headerName === "expect") { throw new NotSupportedError("expect header not supported"); } else { request.headers.push(key, val); } } module2.exports = Request2; } }); // node_modules/undici/lib/dispatcher/dispatcher.js var require_dispatcher = __commonJS({ "node_modules/undici/lib/dispatcher/dispatcher.js"(exports2, module2) { "use strict"; var EventEmitter = require("node:events"); var Dispatcher = class extends EventEmitter { dispatch() { throw new Error("not implemented"); } close() { throw new Error("not implemented"); } destroy() { throw new Error("not implemented"); } compose(...args) { const interceptors = Array.isArray(args[0]) ? args[0] : args; let dispatch = this.dispatch.bind(this); for (const interceptor of interceptors) { if (interceptor == null) { continue; } if (typeof interceptor !== "function") { throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`); } dispatch = interceptor(dispatch); if (dispatch == null || typeof dispatch !== "function" || dispatch.length !== 2) { throw new TypeError("invalid interceptor"); } } return new ComposedDispatcher(this, dispatch); } }; var ComposedDispatcher = class extends Dispatcher { #dispatcher = null; #dispatch = null; constructor(dispatcher, dispatch) { super(); this.#dispatcher = dispatcher; this.#dispatch = dispatch; } dispatch(...args) { this.#dispatch(...args); } close(...args) { return this.#dispatcher.close(...args); } destroy(...args) { return this.#dispatcher.destroy(...args); } }; module2.exports = Dispatcher; } }); // node_modules/undici/lib/dispatcher/dispatcher-base.js var require_dispatcher_base = __commonJS({ "node_modules/undici/lib/dispatcher/dispatcher-base.js"(exports2, module2) { "use strict"; var Dispatcher = require_dispatcher(); var { ClientDestroyedError, ClientClosedError, InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = require_symbols(); var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var kWebSocketOptions = /* @__PURE__ */ Symbol("webSocketOptions"); var DispatcherBase = class extends Dispatcher { constructor(opts) { super(); this[kDestroyed] = false; this[kOnDestroyed] = null; this[kClosed] = false; this[kOnClosed] = []; this[kWebSocketOptions] = opts?.webSocket ?? {}; } get webSocketOptions() { return { maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 }; } 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((resolve, reject) => { this.close((err, data3) => { return err ? reject(err) : resolve(data3); }); }); } 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 = () => { const callbacks = this[kOnClosed]; this[kOnClosed] = null; for (let i5 = 0; i5 < callbacks.length; i5++) { callbacks[i5](null, null); } }; 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((resolve, reject) => { this.destroy(err, (err2, data3) => { return err2 ? ( /* istanbul ignore next: should never error */ reject(err2) ) : resolve(data3); }); }); } 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 = () => { const callbacks = this[kOnDestroyed]; this[kOnDestroyed] = null; for (let i5 = 0; i5 < callbacks.length; i5++) { callbacks[i5](null, null); } }; this[kDestroy](err).then(() => { queueMicrotask(onDestroyed); }); } [kInterceptedDispatch](opts, handler) { if (!this[kInterceptors] || this[kInterceptors].length === 0) { this[kInterceptedDispatch] = this[kDispatch]; return this[kDispatch](opts, handler); } 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, handler); } dispatch(opts, handler) { if (!handler || typeof handler !== "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, handler); } catch (err) { if (typeof handler.onError !== "function") { throw new InvalidArgumentError("invalid onError method"); } handler.onError(err); return false; } } }; module2.exports = DispatcherBase; } }); // node_modules/undici/lib/util/timers.js var require_timers = __commonJS({ "node_modules/undici/lib/util/timers.js"(exports2, module2) { "use strict"; var fastNow = 0; var RESOLUTION_MS = 1e3; var TICK_MS = (RESOLUTION_MS >> 1) - 1; var fastNowTimeout; var kFastTimer = /* @__PURE__ */ Symbol("kFastTimer"); var fastTimers = []; var NOT_IN_LIST = -2; var TO_BE_CLEARED = -1; var PENDING = 0; var ACTIVE = 1; function onTick() { fastNow += TICK_MS; let idx = 0; let len = fastTimers.length; while (idx < len) { const timer = fastTimers[idx]; if (timer._state === PENDING) { timer._idleStart = fastNow - TICK_MS; timer._state = ACTIVE; } else if (timer._state === ACTIVE && fastNow >= timer._idleStart + timer._idleTimeout) { timer._state = TO_BE_CLEARED; timer._idleStart = -1; timer._onTimeout(timer._timerArg); } if (timer._state === TO_BE_CLEARED) { timer._state = NOT_IN_LIST; if (--len !== 0) { fastTimers[idx] = fastTimers[len]; } } else { ++idx; } } fastTimers.length = len; if (fastTimers.length !== 0) { refreshTimeout(); } } function refreshTimeout() { if (fastNowTimeout) { fastNowTimeout.refresh(); } else { clearTimeout(fastNowTimeout); fastNowTimeout = setTimeout(onTick, TICK_MS); if (fastNowTimeout.unref) { fastNowTimeout.unref(); } } } var FastTimer = class { [kFastTimer] = true; /** * The state of the timer, which can be one of the following: * - NOT_IN_LIST (-2) * - TO_BE_CLEARED (-1) * - PENDING (0) * - ACTIVE (1) * * @type {-2|-1|0|1} * @private */ _state = NOT_IN_LIST; /** * The number of milliseconds to wait before calling the callback. * * @type {number} * @private */ _idleTimeout = -1; /** * The time in milliseconds when the timer was started. This value is used to * calculate when the timer should expire. * * @type {number} * @default -1 * @private */ _idleStart = -1; /** * The function to be executed when the timer expires. * @type {Function} * @private */ _onTimeout; /** * The argument to be passed to the callback when the timer expires. * * @type {*} * @private */ _timerArg; /** * @constructor * @param {Function} callback A function to be executed after the timer * expires. * @param {number} delay The time, in milliseconds that the timer should wait * before the specified function or code is executed. * @param {*} arg */ constructor(callback, delay, arg) { this._onTimeout = callback; this._idleTimeout = delay; this._timerArg = arg; this.refresh(); } /** * Sets the timer's start time to the current time, and reschedules the timer * to call its callback at the previously specified duration adjusted to the * current time. * Using this on a timer that has already called its callback will reactivate * the timer. * * @returns {void} */ refresh() { if (this._state === NOT_IN_LIST) { fastTimers.push(this); } if (!fastNowTimeout || fastTimers.length === 1) { refreshTimeout(); } this._state = PENDING; } /** * The `clear` method cancels the timer, preventing it from executing. * * @returns {void} * @private */ clear() { this._state = TO_BE_CLEARED; this._idleStart = -1; } }; module2.exports = { /** * The setTimeout() method sets a timer which executes a function once the * timer expires. * @param {Function} callback A function to be executed after the timer * expires. * @param {number} delay The time, in milliseconds that the timer should * wait before the specified function or code is executed. * @param {*} [arg] An optional argument to be passed to the callback function * when the timer expires. * @returns {NodeJS.Timeout|FastTimer} */ setTimeout(callback, delay, arg) { return delay <= RESOLUTION_MS ? setTimeout(callback, delay, arg) : new FastTimer(callback, delay, arg); }, /** * The clearTimeout method cancels an instantiated Timer previously created * by calling setTimeout. * * @param {NodeJS.Timeout|FastTimer} timeout */ clearTimeout(timeout) { if (timeout[kFastTimer]) { timeout.clear(); } else { clearTimeout(timeout); } }, /** * The setFastTimeout() method sets a fastTimer which executes a function once * the timer expires. * @param {Function} callback A function to be executed after the timer * expires. * @param {number} delay The time, in milliseconds that the timer should * wait before the specified function or code is executed. * @param {*} [arg] An optional argument to be passed to the callback function * when the timer expires. * @returns {FastTimer} */ setFastTimeout(callback, delay, arg) { return new FastTimer(callback, delay, arg); }, /** * The clearTimeout method cancels an instantiated FastTimer previously * created by calling setFastTimeout. * * @param {FastTimer} timeout */ clearFastTimeout(timeout) { timeout.clear(); }, /** * The now method returns the value of the internal fast timer clock. * * @returns {number} */ now() { return fastNow; }, /** * Trigger the onTick function to process the fastTimers array. * Exported for testing purposes only. * Marking as deprecated to discourage any use outside of testing. * @deprecated * @param {number} [delay=0] The delay in milliseconds to add to the now value. */ tick(delay = 0) { fastNow += delay - RESOLUTION_MS + 1; onTick(); onTick(); }, /** * Reset FastTimers. * Exported for testing purposes only. * Marking as deprecated to discourage any use outside of testing. * @deprecated */ reset() { fastNow = 0; fastTimers.length = 0; clearTimeout(fastNowTimeout); fastNowTimeout = null; }, /** * Exporting for testing purposes only. * Marking as deprecated to discourage any use outside of testing. * @deprecated */ kFastTimer }; } }); // node_modules/undici/lib/core/connect.js var require_connect = __commonJS({ "node_modules/undici/lib/core/connect.js"(exports2, module2) { "use strict"; var net11 = require("node:net"); var assert4 = require("node:assert"); var util = require_util(); var { InvalidArgumentError, ConnectTimeoutError } = require_errors(); var timers = require_timers(); function noop() { } var tls8; var SessionCache; if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) { SessionCache = 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); } }; } else { SessionCache = 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); } }; } function buildConnector({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) { if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { throw new InvalidArgumentError("maxCachedSessions must be a positive integer or zero"); } const options = { path: socketPath, ...opts }; const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions); timeout = timeout == null ? 1e4 : timeout; allowH2 = allowH2 != null ? allowH2 : false; return function connect13({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { let socket; if (protocol === "https:") { if (!tls8) { tls8 = require("node:tls"); } servername = servername || options.servername || util.getServerName(host) || null; const sessionKey = servername || hostname; assert4(sessionKey); const session = customSession || sessionCache.get(sessionKey) || null; port = port || 443; socket = tls8.connect({ highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... ...options, servername, session, localAddress, // TODO(HTTP/2): Add support for h2c ALPNProtocols: allowH2 ? ["http/1.1", "h2"] : ["http/1.1"], socket: httpSocket, // upgrade socket connection port, host: hostname }); socket.on("session", function(session2) { sessionCache.set(sessionKey, session2); }); } else { assert4(!httpSocket, "httpSocket can only be sent on TLS update"); port = port || 80; socket = net11.connect({ highWaterMark: 64 * 1024, // Same as nodejs fs streams. ...options, localAddress, port, host: hostname }); } if (options.keepAlive == null || options.keepAlive) { const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay; socket.setKeepAlive(true, keepAliveInitialDelay); } const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port }); socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() { queueMicrotask(clearConnectTimeout); if (callback) { const cb = callback; callback = null; cb(null, this); } }).on("error", function(err) { queueMicrotask(clearConnectTimeout); if (callback) { const cb = callback; callback = null; cb(err); } }); return socket; }; } var setupConnectTimeout = process.platform === "win32" ? (socketWeakRef, opts) => { if (!opts.timeout) { return noop; } let s1 = null; let s2 = null; const fastTimer = timers.setFastTimeout(() => { s1 = setImmediate(() => { s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts)); }); }, opts.timeout); return () => { timers.clearFastTimeout(fastTimer); clearImmediate(s1); clearImmediate(s2); }; } : (socketWeakRef, opts) => { if (!opts.timeout) { return noop; } let s1 = null; const fastTimer = timers.setFastTimeout(() => { s1 = setImmediate(() => { onConnectTimeout(socketWeakRef.deref(), opts); }); }, opts.timeout); return () => { timers.clearFastTimeout(fastTimer); clearImmediate(s1); }; }; function onConnectTimeout(socket, opts) { if (socket == null) { return; } let message = "Connect Timeout Error"; if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) { message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(", ")},`; } else { message += ` (attempted address: ${opts.hostname}:${opts.port},`; } message += ` timeout: ${opts.timeout}ms)`; util.destroy(socket, new ConnectTimeoutError(message)); } module2.exports = buildConnector; } }); // node_modules/undici/lib/llhttp/utils.js var require_utils = __commonJS({ "node_modules/undici/lib/llhttp/utils.js"(exports2) { "use strict"; 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; } exports2.enumToMap = enumToMap; } }); // node_modules/undici/lib/llhttp/constants.js var require_constants2 = __commonJS({ "node_modules/undici/lib/llhttp/constants.js"(exports2) { "use strict"; 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((c5) => c5 !== 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/undici/lib/llhttp/llhttp-wasm.js var require_llhttp_wasm = __commonJS({ "node_modules/undici/lib/llhttp/llhttp-wasm.js"(exports2, module2) { "use strict"; var { Buffer: Buffer2 } = require("node:buffer"); module2.exports = Buffer2.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQN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ECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0E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IQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDE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BEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAk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BAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv", "base64"); } }); // node_modules/undici/lib/llhttp/llhttp_simd-wasm.js var require_llhttp_simd_wasm = __commonJS({ "node_modules/undici/lib/llhttp/llhttp_simd-wasm.js"(exports2, module2) { "use strict"; var { Buffer: Buffer2 } = require("node:buffer"); module2.exports = Buffer2.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25fa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ADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwN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AJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEB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CABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBT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gAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQ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FQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==", "base64"); } }); // node_modules/undici/lib/web/fetch/constants.js var require_constants3 = __commonJS({ "node_modules/undici/lib/web/fetch/constants.js"(exports2, module2) { "use strict"; var corsSafeListedMethods = ( /** @type {const} */ ["GET", "HEAD", "POST"] ); var corsSafeListedMethodsSet = new Set(corsSafeListedMethods); var nullBodyStatus = ( /** @type {const} */ [101, 204, 205, 304] ); var redirectStatus = ( /** @type {const} */ [301, 302, 303, 307, 308] ); var redirectStatusSet = new Set(redirectStatus); var badPorts = ( /** @type {const} */ [ "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", "4190", "5060", "5061", "6000", "6566", "6665", "6666", "6667", "6668", "6669", "6679", "6697", "10080" ] ); var badPortsSet = new Set(badPorts); var referrerPolicy = ( /** @type {const} */ [ "", "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 = ( /** @type {const} */ ["follow", "manual", "error"] ); var safeMethods = ( /** @type {const} */ ["GET", "HEAD", "OPTIONS", "TRACE"] ); var safeMethodsSet = new Set(safeMethods); var requestMode = ( /** @type {const} */ ["navigate", "same-origin", "no-cors", "cors"] ); var requestCredentials = ( /** @type {const} */ ["omit", "same-origin", "include"] ); var requestCache = ( /** @type {const} */ [ "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" ] ); var requestBodyHeader = ( /** @type {const} */ [ "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 = ( /** @type {const} */ [ "half" ] ); var forbiddenMethods = ( /** @type {const} */ ["CONNECT", "TRACE", "TRACK"] ); var forbiddenMethodsSet = new Set(forbiddenMethods); var subresource = ( /** @type {const} */ [ "audio", "audioworklet", "font", "image", "manifest", "paintworklet", "script", "style", "track", "video", "xslt", "" ] ); var subresourceSet = new Set(subresource); module2.exports = { subresource, forbiddenMethods, requestBodyHeader, referrerPolicy, requestRedirect, requestMode, requestCredentials, requestCache, redirectStatus, corsSafeListedMethods, nullBodyStatus, safeMethods, badPorts, requestDuplex, subresourceSet, badPortsSet, redirectStatusSet, corsSafeListedMethodsSet, safeMethodsSet, forbiddenMethodsSet, referrerPolicySet }; } }); // node_modules/undici/lib/web/fetch/global.js var require_global = __commonJS({ "node_modules/undici/lib/web/fetch/global.js"(exports2, module2) { "use strict"; var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } 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 }); } module2.exports = { getGlobalOrigin, setGlobalOrigin }; } }); // node_modules/undici/lib/web/fetch/data-url.js var require_data_url = __commonJS({ "node_modules/undici/lib/web/fetch/data-url.js"(exports2, module2) { "use strict"; var assert4 = require("node:assert"); var encoder = new TextEncoder(); var HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/; var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/; var ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g; var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/; function dataURLProcessor(dataURL) { assert4(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 }; } function URLSerializer(url, excludeFragment = false) { if (!excludeFragment) { return url.href; } const href = url.href; const hashLength = url.hash.length; const serialized = hashLength === 0 ? href : href.substring(0, href.length - hashLength); if (!hashLength && href.endsWith("#")) { return serialized.slice(0, -1); } return serialized; } function collectASequenceOfCodePoints(condition, input, position) { let result = ""; while (position.position < input.length && condition(input[position.position])) { result += input[position.position]; position.position++; } return result; } 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); } function stringPercentDecode(input) { const bytes = encoder.encode(input); return percentDecode(bytes); } function isHexCharByte(byte) { return byte >= 48 && byte <= 57 || byte >= 65 && byte <= 70 || byte >= 97 && byte <= 102; } function hexByteToNumber(byte) { return ( // 0-9 byte >= 48 && byte <= 57 ? byte - 48 : (byte & 223) - 55 ); } function percentDecode(input) { const length = input.length; const output = new Uint8Array(length); let j5 = 0; for (let i5 = 0; i5 < length; ++i5) { const byte = input[i5]; if (byte !== 37) { output[j5++] = byte; } else if (byte === 37 && !(isHexCharByte(input[i5 + 1]) && isHexCharByte(input[i5 + 2]))) { output[j5++] = 37; } else { output[j5++] = hexByteToNumber(input[i5 + 1]) << 4 | hexByteToNumber(input[i5 + 2]); i5 += 2; } } return length === j5 ? output : output.subarray(0, j5); } 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; } function forgivingBase64(data3) { data3 = data3.replace(ASCII_WHITESPACE_REPLACE_REGEX, ""); let dataLength = data3.length; if (dataLength % 4 === 0) { if (data3.charCodeAt(dataLength - 1) === 61) { --dataLength; if (data3.charCodeAt(dataLength - 1) === 61) { --dataLength; } } } if (dataLength % 4 === 1) { return "failure"; } if (/[^+/0-9A-Za-z]/.test(data3.length === dataLength ? data3 : data3.substring(0, dataLength))) { return "failure"; } const buffer = Buffer.from(data3, "base64"); return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); } function collectAnHTTPQuotedString(input, position, extractValue) { const positionStart = position.position; let value = ""; assert4(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 { assert4(quoteOrBackslash === '"'); break; } } if (extractValue) { return value; } return input.slice(positionStart, position.position); } function serializeAMimeType(mimeType) { assert4(mimeType !== "failure"); const { parameters, essence } = mimeType; let serialization = essence; for (let [name, value] of parameters.entries()) { serialization += ";"; serialization += name; serialization += "="; if (!HTTP_TOKEN_CODEPOINTS.test(value)) { value = value.replace(/(\\|")/g, "\\$1"); value = '"' + value; value += '"'; } serialization += value; } return serialization; } function isHTTPWhiteSpace(char) { return char === 13 || char === 10 || char === 9 || char === 32; } function removeHTTPWhitespace(str, leading = true, trailing = true) { return removeChars(str, leading, trailing, isHTTPWhiteSpace); } function isASCIIWhitespace(char) { return char === 13 || char === 10 || char === 9 || char === 12 || char === 32; } function removeASCIIWhitespace(str, leading = true, trailing = true) { return removeChars(str, leading, trailing, isASCIIWhitespace); } function removeChars(str, leading, trailing, predicate) { let lead = 0; let trail = str.length - 1; if (leading) { while (lead < str.length && predicate(str.charCodeAt(lead))) lead++; } if (trailing) { while (trail > 0 && predicate(str.charCodeAt(trail))) trail--; } return lead === 0 && trail === str.length - 1 ? str : str.slice(lead, trail + 1); } function isomorphicDecode(input) { const length = input.length; if ((2 << 15) - 1 > length) { return String.fromCharCode.apply(null, input); } let result = ""; let i5 = 0; let addition = (2 << 15) - 1; while (i5 < length) { if (i5 + addition > length) { addition = length - i5; } result += String.fromCharCode.apply(null, input.subarray(i5, i5 += addition)); } return result; } function minimizeSupportedMimeType(mimeType) { switch (mimeType.essence) { case "application/ecmascript": case "application/javascript": case "application/x-ecmascript": case "application/x-javascript": case "text/ecmascript": case "text/javascript": case "text/javascript1.0": case "text/javascript1.1": case "text/javascript1.2": case "text/javascript1.3": case "text/javascript1.4": case "text/javascript1.5": case "text/jscript": case "text/livescript": case "text/x-ecmascript": case "text/x-javascript": return "text/javascript"; case "application/json": case "text/json": return "application/json"; case "image/svg+xml": return "image/svg+xml"; case "text/xml": case "application/xml": return "application/xml"; } if (mimeType.subtype.endsWith("+json")) { return "application/json"; } if (mimeType.subtype.endsWith("+xml")) { return "application/xml"; } return ""; } module2.exports = { dataURLProcessor, URLSerializer, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, stringPercentDecode, parseMIMEType, collectAnHTTPQuotedString, serializeAMimeType, removeChars, removeHTTPWhitespace, minimizeSupportedMimeType, HTTP_TOKEN_CODEPOINTS, isomorphicDecode }; } }); // node_modules/undici/lib/web/fetch/webidl.js var require_webidl = __commonJS({ "node_modules/undici/lib/web/fetch/webidl.js"(exports2, module2) { "use strict"; var { types: types3, inspect } = require("node:util"); var { markAsUncloneable } = require("node:worker_threads"); var { toUSVString } = require_util(); var webidl = {}; webidl.converters = {}; webidl.util = {}; webidl.errors = {}; webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; webidl.errors.conversionFailed = function(context) { const plural = context.types.length === 1 ? "" : " one of"; const message = `${context.argument} could not be converted to${plural}: ${context.types.join(", ")}.`; return webidl.errors.exception({ header: context.prefix, message }); }; webidl.errors.invalidArgument = function(context) { return webidl.errors.exception({ header: context.prefix, message: `"${context.value}" is an invalid ${context.type}.` }); }; webidl.brandCheck = function(V, I, opts) { if (opts?.strict !== false) { if (!(V instanceof I)) { const err = new TypeError("Illegal invocation"); err.code = "ERR_INVALID_THIS"; throw err; } } else { if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) { const err = new TypeError("Illegal invocation"); err.code = "ERR_INVALID_THIS"; throw err; } } }; 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.`, header: ctx }); } }; webidl.illegalConstructor = function() { throw webidl.errors.exception({ header: "TypeError", message: "Illegal constructor" }); }; webidl.util.Type = function(V) { switch (typeof V) { 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 (V === null) { return "Null"; } return "Object"; } } }; webidl.util.markAsUncloneable = markAsUncloneable || (() => { }); webidl.util.ConvertToInt = function(V, bitLength, signedness, opts) { let upperBound; let lowerBound; if (bitLength === 64) { upperBound = Math.pow(2, 53) - 1; if (signedness === "unsigned") { lowerBound = 0; } else { lowerBound = Math.pow(-2, 53) + 1; } } else if (signedness === "unsigned") { lowerBound = 0; upperBound = Math.pow(2, bitLength) - 1; } else { lowerBound = Math.pow(-2, bitLength) - 1; upperBound = Math.pow(2, bitLength - 1) - 1; } let x = Number(V); if (x === 0) { x = 0; } if (opts?.enforceRange === true) { if (Number.isNaN(x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) { throw webidl.errors.exception({ header: "Integer conversion", message: `Could not convert ${webidl.util.Stringify(V)} to an integer.` }); } x = webidl.util.IntegerPart(x); if (x < lowerBound || x > upperBound) { throw webidl.errors.exception({ header: "Integer conversion", message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.` }); } return x; } if (!Number.isNaN(x) && opts?.clamp === true) { x = Math.min(Math.max(x, lowerBound), upperBound); if (Math.floor(x) % 2 === 0) { x = Math.floor(x); } else { x = Math.ceil(x); } return x; } if (Number.isNaN(x) || x === 0 && Object.is(0, x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) { return 0; } x = webidl.util.IntegerPart(x); x = x % Math.pow(2, bitLength); if (signedness === "signed" && x >= Math.pow(2, bitLength) - 1) { return x - Math.pow(2, bitLength); } return x; }; webidl.util.IntegerPart = function(n3) { const r5 = Math.floor(Math.abs(n3)); if (n3 < 0) { return -1 * r5; } return r5; }; webidl.util.Stringify = function(V) { const type = webidl.util.Type(V); switch (type) { case "Symbol": return `Symbol(${V.description})`; case "Object": return inspect(V); case "String": return `"${V}"`; default: return `${V}`; } }; webidl.sequenceConverter = function(converter) { return (V, prefix, argument, Iterable) => { if (webidl.util.Type(V) !== "Object") { throw webidl.errors.exception({ header: prefix, message: `${argument} (${webidl.util.Stringify(V)}) is not iterable.` }); } const method = typeof Iterable === "function" ? Iterable() : V?.[Symbol.iterator]?.(); const seq = []; let index = 0; if (method === void 0 || typeof method.next !== "function") { throw webidl.errors.exception({ header: prefix, message: `${argument} is not iterable.` }); } while (true) { const { done, value } = method.next(); if (done) { break; } seq.push(converter(value, prefix, `${argument}[${index++}]`)); } return seq; }; }; webidl.recordConverter = function(keyConverter, valueConverter) { return (O, prefix, argument) => { if (webidl.util.Type(O) !== "Object") { throw webidl.errors.exception({ header: prefix, message: `${argument} ("${webidl.util.Type(O)}") is not an Object.` }); } const result = {}; if (!types3.isProxy(O)) { const keys2 = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)]; for (const key of keys2) { const typedKey = keyConverter(key, prefix, argument); const typedValue = valueConverter(O[key], prefix, argument); result[typedKey] = typedValue; } return result; } const keys = Reflect.ownKeys(O); for (const key of keys) { const desc = Reflect.getOwnPropertyDescriptor(O, key); if (desc?.enumerable) { const typedKey = keyConverter(key, prefix, argument); const typedValue = valueConverter(O[key], prefix, argument); result[typedKey] = typedValue; } } return result; }; }; webidl.interfaceConverter = function(i5) { return (V, prefix, argument, opts) => { if (opts?.strict !== false && !(V instanceof i5)) { throw webidl.errors.exception({ header: prefix, message: `Expected ${argument} ("${webidl.util.Stringify(V)}") to be an instance of ${i5.name}.` }); } return V; }; }; webidl.dictionaryConverter = function(converters) { return (dictionary, prefix, argument) => { const type = webidl.util.Type(dictionary); const dict = {}; if (type === "Null" || type === "Undefined") { return dict; } else if (type !== "Object") { throw webidl.errors.exception({ header: prefix, message: `Expected ${dictionary} to be one of: Null, Undefined, Object.` }); } for (const options of converters) { const { key, defaultValue, required, converter } = options; if (required === true) { if (!Object.hasOwn(dictionary, key)) { throw webidl.errors.exception({ header: prefix, message: `Missing required key "${key}".` }); } } let value = dictionary[key]; const hasDefault = Object.hasOwn(options, "defaultValue"); if (hasDefault && value !== null) { value ??= defaultValue(); } if (required || hasDefault || value !== void 0) { value = converter(value, prefix, `${argument}.${key}`); if (options.allowedValues && !options.allowedValues.includes(value)) { throw webidl.errors.exception({ header: prefix, message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(", ")}.` }); } dict[key] = value; } } return dict; }; }; webidl.nullableConverter = function(converter) { return (V, prefix, argument) => { if (V === null) { return V; } return converter(V, prefix, argument); }; }; webidl.converters.DOMString = function(V, prefix, argument, opts) { if (V === null && opts?.legacyNullToEmptyString) { return ""; } if (typeof V === "symbol") { throw webidl.errors.exception({ header: prefix, message: `${argument} is a symbol, which cannot be converted to a DOMString.` }); } return String(V); }; webidl.converters.ByteString = function(V, prefix, argument) { const x = webidl.converters.DOMString(V, prefix, argument); for (let index = 0; index < x.length; index++) { if (x.charCodeAt(index) > 255) { throw new TypeError( `Cannot convert argument to a ByteString because the character at index ${index} has a value of ${x.charCodeAt(index)} which is greater than 255.` ); } } return x; }; webidl.converters.USVString = toUSVString; webidl.converters.boolean = function(V) { const x = Boolean(V); return x; }; webidl.converters.any = function(V) { return V; }; webidl.converters["long long"] = function(V, prefix, argument) { const x = webidl.util.ConvertToInt(V, 64, "signed", void 0, prefix, argument); return x; }; webidl.converters["unsigned long long"] = function(V, prefix, argument) { const x = webidl.util.ConvertToInt(V, 64, "unsigned", void 0, prefix, argument); return x; }; webidl.converters["unsigned long"] = function(V, prefix, argument) { const x = webidl.util.ConvertToInt(V, 32, "unsigned", void 0, prefix, argument); return x; }; webidl.converters["unsigned short"] = function(V, prefix, argument, opts) { const x = webidl.util.ConvertToInt(V, 16, "unsigned", opts, prefix, argument); return x; }; webidl.converters.ArrayBuffer = function(V, prefix, argument, opts) { if (webidl.util.Type(V) !== "Object" || !types3.isAnyArrayBuffer(V)) { throw webidl.errors.conversionFailed({ prefix, argument: `${argument} ("${webidl.util.Stringify(V)}")`, types: ["ArrayBuffer"] }); } if (opts?.allowShared === false && types3.isSharedArrayBuffer(V)) { throw webidl.errors.exception({ header: "ArrayBuffer", message: "SharedArrayBuffer is not allowed." }); } if (V.resizable || V.growable) { throw webidl.errors.exception({ header: "ArrayBuffer", message: "Received a resizable ArrayBuffer." }); } return V; }; webidl.converters.TypedArray = function(V, T, prefix, name, opts) { if (webidl.util.Type(V) !== "Object" || !types3.isTypedArray(V) || V.constructor.name !== T.name) { throw webidl.errors.conversionFailed({ prefix, argument: `${name} ("${webidl.util.Stringify(V)}")`, types: [T.name] }); } if (opts?.allowShared === false && types3.isSharedArrayBuffer(V.buffer)) { throw webidl.errors.exception({ header: "ArrayBuffer", message: "SharedArrayBuffer is not allowed." }); } if (V.buffer.resizable || V.buffer.growable) { throw webidl.errors.exception({ header: "ArrayBuffer", message: "Received a resizable ArrayBuffer." }); } return V; }; webidl.converters.DataView = function(V, prefix, name, opts) { if (webidl.util.Type(V) !== "Object" || !types3.isDataView(V)) { throw webidl.errors.exception({ header: prefix, message: `${name} is not a DataView.` }); } if (opts?.allowShared === false && types3.isSharedArrayBuffer(V.buffer)) { throw webidl.errors.exception({ header: "ArrayBuffer", message: "SharedArrayBuffer is not allowed." }); } if (V.buffer.resizable || V.buffer.growable) { throw webidl.errors.exception({ header: "ArrayBuffer", message: "Received a resizable ArrayBuffer." }); } return V; }; webidl.converters.BufferSource = function(V, prefix, name, opts) { if (types3.isAnyArrayBuffer(V)) { return webidl.converters.ArrayBuffer(V, prefix, name, { ...opts, allowShared: false }); } if (types3.isTypedArray(V)) { return webidl.converters.TypedArray(V, V.constructor, prefix, name, { ...opts, allowShared: false }); } if (types3.isDataView(V)) { return webidl.converters.DataView(V, prefix, name, { ...opts, allowShared: false }); } throw webidl.errors.conversionFailed({ prefix, argument: `${name} ("${webidl.util.Stringify(V)}")`, types: ["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 ); module2.exports = { webidl }; } }); // node_modules/undici/lib/web/fetch/util.js var require_util2 = __commonJS({ "node_modules/undici/lib/web/fetch/util.js"(exports2, module2) { "use strict"; var { Transform } = require("node:stream"); var zlib = require("node:zlib"); var { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require_constants3(); var { getGlobalOrigin } = require_global(); var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url(); var { performance: performance2 } = require("node:perf_hooks"); var { isBlobLike, ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util(); var assert4 = require("node:assert"); var { isUint8Array } = require("node:util/types"); var { webidl } = require_webidl(); var supportedHashes = []; var crypto4; try { crypto4 = require("node:crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; supportedHashes = crypto4.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(); } function responseLocationURL(response, requestFragment) { if (!redirectStatusSet.has(response.status)) { return null; } let location = response.headersList.get("location", true); if (location !== null && isValidHeaderValue(location)) { if (!isValidEncodedURL(location)) { location = normalizeBinaryStringToUtf8(location); } location = new URL(location, responseURL(response)); } if (location && !location.hash) { location.hash = requestFragment; } return location; } function isValidEncodedURL(url) { for (let i5 = 0; i5 < url.length; ++i5) { const code = url.charCodeAt(i5); if (code > 126 || // Non-US-ASCII + DEL code < 32) { return false; } } return true; } function normalizeBinaryStringToUtf8(value) { return Buffer.from(value, "binary").toString("utf8"); } function requestCurrentURL(request) { return request.urlList[request.urlList.length - 1]; } function requestBadPort(request) { const url = requestCurrentURL(request); if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) { return "blocked"; } return "allowed"; } function isErrorLike(object) { return object instanceof Error || (object?.constructor?.name === "Error" || object?.constructor?.name === "DOMException"); } function isValidReasonPhrase(statusText) { for (let i5 = 0; i5 < statusText.length; ++i5) { const c5 = statusText.charCodeAt(i5); if (!(c5 === 9 || // HTAB c5 >= 32 && c5 <= 126 || // SP / VCHAR c5 >= 128 && c5 <= 255)) { return false; } } return true; } var isValidHeaderName = isValidHTTPToken; function isValidHeaderValue(potentialValue) { return (potentialValue[0] === " " || potentialValue[0] === " " || potentialValue[potentialValue.length - 1] === " " || potentialValue[potentialValue.length - 1] === " " || potentialValue.includes("\n") || potentialValue.includes("\r") || potentialValue.includes("\0")) === false; } function setRequestReferrerPolicyOnRedirect(request, actualResponse) { const { headersList } = actualResponse; const policyHeader = (headersList.get("referrer-policy", true) ?? "").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 !== "") { request.referrerPolicy = policy; } } function crossOriginResourcePolicyCheck() { return "allowed"; } function corsCheck() { return "success"; } function TAOCheck() { return "success"; } function appendFetchMetadata(httpRequest) { let header = null; header = httpRequest.mode; httpRequest.headersList.set("sec-fetch-mode", header, true); } function appendRequestOriginHeader(request) { let serializedOrigin = request.origin; if (serializedOrigin === "client" || serializedOrigin === void 0) { return; } if (request.responseTainting === "cors" || request.mode === "websocket") { request.headersList.append("origin", serializedOrigin, true); } else if (request.method !== "GET" && request.method !== "HEAD") { switch (request.referrerPolicy) { case "no-referrer": serializedOrigin = null; break; case "no-referrer-when-downgrade": case "strict-origin": case "strict-origin-when-cross-origin": if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) { serializedOrigin = null; } break; case "same-origin": if (!sameOrigin(request, requestCurrentURL(request))) { serializedOrigin = null; } break; default: } request.headersList.append("origin", serializedOrigin, true); } } function coarsenTime(timestamp, crossOriginIsolatedCapability) { return timestamp; } function clampAndCoarsenConnectionTimingInfo(connectionTimingInfo, defaultStartTime, crossOriginIsolatedCapability) { if (!connectionTimingInfo?.startTime || connectionTimingInfo.startTime < defaultStartTime) { return { domainLookupStartTime: defaultStartTime, domainLookupEndTime: defaultStartTime, connectionStartTime: defaultStartTime, connectionEndTime: defaultStartTime, secureConnectionStartTime: defaultStartTime, ALPNNegotiatedProtocol: connectionTimingInfo?.ALPNNegotiatedProtocol }; } return { domainLookupStartTime: coarsenTime(connectionTimingInfo.domainLookupStartTime, crossOriginIsolatedCapability), domainLookupEndTime: coarsenTime(connectionTimingInfo.domainLookupEndTime, crossOriginIsolatedCapability), connectionStartTime: coarsenTime(connectionTimingInfo.connectionStartTime, crossOriginIsolatedCapability), connectionEndTime: coarsenTime(connectionTimingInfo.connectionEndTime, crossOriginIsolatedCapability), secureConnectionStartTime: coarsenTime(connectionTimingInfo.secureConnectionStartTime, crossOriginIsolatedCapability), ALPNNegotiatedProtocol: connectionTimingInfo.ALPNNegotiatedProtocol }; } function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) { return coarsenTime(performance2.now(), crossOriginIsolatedCapability); } 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 }; } function makePolicyContainer() { return { referrerPolicy: "strict-origin-when-cross-origin" }; } function clonePolicyContainer(policyContainer) { return { referrerPolicy: policyContainer.referrerPolicy }; } function determineRequestsReferrer(request) { const policy = request.referrerPolicy; assert4(policy); let referrerSource = null; if (request.referrer === "client") { const globalOrigin = getGlobalOrigin(); if (!globalOrigin || globalOrigin.origin === "null") { return "no-referrer"; } referrerSource = new URL(globalOrigin); } else if (request.referrer instanceof URL) { referrerSource = request.referrer; } let referrerURL = stripURLForReferrer(referrerSource); const referrerOrigin = stripURLForReferrer(referrerSource, true); if (referrerURL.toString().length > 4096) { referrerURL = referrerOrigin; } const areSameOrigin = sameOrigin(request, referrerURL); const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request.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(request); if (sameOrigin(referrerURL, currentURL)) { return referrerURL; } if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) { return "no-referrer"; } return referrerOrigin; } case "strict-origin": // eslint-disable-line /** * 1. If referrerURL is a potentially trustworthy URL and * request’s current URL is not a potentially trustworthy URL, * then return no referrer. * 2. Return referrerOrigin */ case "no-referrer-when-downgrade": // eslint-disable-line /** * 1. If referrerURL is a potentially trustworthy URL and * request’s current URL is not a potentially trustworthy URL, * then return no referrer. * 2. Return referrerOrigin */ default: return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin; } } function stripURLForReferrer(url, originOnly) { assert4(url instanceof URL); url = new URL(url); if (url.protocol === "file:" || url.protocol === "about:" || url.protocol === "blank:") { return "no-referrer"; } url.username = ""; url.password = ""; url.hash = ""; if (originOnly) { url.pathname = ""; url.search = ""; } return url; } function isURLPotentiallyTrustworthy(url) { if (!(url instanceof URL)) { return false; } if (url.href === "about:blank" || url.href === "about:srcdoc") { return true; } if (url.protocol === "data:") return true; if (url.protocol === "file:") return true; return isOriginPotentiallyTrustworthy(url.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; } } function bytesMatch(bytes, metadataList) { if (crypto4 === 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 = crypto4.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; } var parseHashWithOptions = /(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i; function parseMetadata(metadata) { const result = []; let empty = true; for (const token of metadata.split(" ")) { empty = 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 (empty === true) { return "no metadata"; } return result; } 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; } 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; } 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; } function tryUpgradeRequestToAPotentiallyTrustworthyURL(request) { } function sameOrigin(A, B) { if (A.origin === B.origin && A.origin === "null") { return true; } if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) { return true; } return false; } function createDeferredPromise() { let res; let rej; const promise = new Promise((resolve, reject) => { res = resolve; rej = reject; }); return { promise, resolve: res, reject: rej }; } function isAborted(fetchParams) { return fetchParams.controller.state === "aborted"; } function isCancelled(fetchParams) { return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated"; } function normalizeMethod(method) { return normalizedMethodRecordsBase[method.toLowerCase()] ?? method; } function serializeJavascriptValueToJSONString(value) { const result = JSON.stringify(value); if (result === void 0) { throw new TypeError("Value is not JSON serializable"); } assert4(typeof result === "string"); return result; } var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); function createIterator(name, kInternalIterator, keyIndex = 0, valueIndex = 1) { class FastIterableIterator { /** @type {any} */ #target; /** @type {'key' | 'value' | 'key+value'} */ #kind; /** @type {number} */ #index; /** * @see https://webidl.spec.whatwg.org/#dfn-default-iterator-object * @param {unknown} target * @param {'key' | 'value' | 'key+value'} kind */ constructor(target, kind) { this.#target = target; this.#kind = kind; this.#index = 0; } next() { if (typeof this !== "object" || this === null || !(#target in this)) { throw new TypeError( `'next' called on an object that does not implement interface ${name} Iterator.` ); } const index = this.#index; const values = this.#target[kInternalIterator]; const len = values.length; if (index >= len) { return { value: void 0, done: true }; } const { [keyIndex]: key, [valueIndex]: value } = values[index]; this.#index = index + 1; let result; switch (this.#kind) { case "key": result = key; break; case "value": result = value; break; case "key+value": result = [key, value]; break; } return { value: result, done: false }; } } delete FastIterableIterator.prototype.constructor; Object.setPrototypeOf(FastIterableIterator.prototype, esIteratorPrototype); Object.defineProperties(FastIterableIterator.prototype, { [Symbol.toStringTag]: { writable: false, enumerable: false, configurable: true, value: `${name} Iterator` }, next: { writable: true, enumerable: true, configurable: true } }); return function(target, kind) { return new FastIterableIterator(target, kind); }; } function iteratorMixin(name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) { const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex); const properties = { keys: { writable: true, enumerable: true, configurable: true, value: function keys() { webidl.brandCheck(this, object); return makeIterator(this, "key"); } }, values: { writable: true, enumerable: true, configurable: true, value: function values() { webidl.brandCheck(this, object); return makeIterator(this, "value"); } }, entries: { writable: true, enumerable: true, configurable: true, value: function entries() { webidl.brandCheck(this, object); return makeIterator(this, "key+value"); } }, forEach: { writable: true, enumerable: true, configurable: true, value: function forEach(callbackfn, thisArg = globalThis) { webidl.brandCheck(this, object); webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`); if (typeof callbackfn !== "function") { throw new TypeError( `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.` ); } for (const { 0: key, 1: value } of makeIterator(this, "key+value")) { callbackfn.call(thisArg, value, key, this); } } } }; return Object.defineProperties(object.prototype, { ...properties, [Symbol.iterator]: { writable: true, enumerable: false, configurable: true, value: properties.entries.value } }); } async function fullyReadBody(body, processBody, processBodyError) { const successSteps = processBody; const errorSteps = processBodyError; let reader; try { reader = body.stream.getReader(); } catch (e5) { errorSteps(e5); return; } try { successSteps(await readAllBytes(reader)); } catch (e5) { errorSteps(e5); } } function isReadableStreamLike(stream) { return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function"; } function readableStreamClose(controller) { try { controller.close(); controller.byobRequest?.respond(0); } catch (err) { if (!err.message.includes("Controller is already closed") && !err.message.includes("ReadableStream is already closed")) { throw err; } } } var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/; function isomorphicEncode(input) { assert4(!invalidIsomorphicEncodeValueRegex.test(input)); return input; } 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; } } function urlIsLocal(url) { assert4("protocol" in url); const protocol = url.protocol; return protocol === "about:" || protocol === "blob:" || protocol === "data:"; } function urlHasHttpsScheme(url) { return typeof url === "string" && url[5] === ":" && url[0] === "h" && url[1] === "t" && url[2] === "t" && url[3] === "p" && url[4] === "s" || url.protocol === "https:"; } function urlIsHttpHttpsScheme(url) { assert4("protocol" in url); const protocol = url.protocol; return protocol === "http:" || protocol === "https:"; } function simpleRangeHeaderValue(value, allowWhitespace) { const data3 = value; if (!data3.startsWith("bytes")) { return "failure"; } const position = { position: 5 }; if (allowWhitespace) { collectASequenceOfCodePoints( (char) => char === " " || char === " ", data3, position ); } if (data3.charCodeAt(position.position) !== 61) { return "failure"; } position.position++; if (allowWhitespace) { collectASequenceOfCodePoints( (char) => char === " " || char === " ", data3, position ); } const rangeStart = collectASequenceOfCodePoints( (char) => { const code = char.charCodeAt(0); return code >= 48 && code <= 57; }, data3, position ); const rangeStartValue = rangeStart.length ? Number(rangeStart) : null; if (allowWhitespace) { collectASequenceOfCodePoints( (char) => char === " " || char === " ", data3, position ); } if (data3.charCodeAt(position.position) !== 45) { return "failure"; } position.position++; if (allowWhitespace) { collectASequenceOfCodePoints( (char) => char === " " || char === " ", data3, position ); } const rangeEnd = collectASequenceOfCodePoints( (char) => { const code = char.charCodeAt(0); return code >= 48 && code <= 57; }, data3, position ); const rangeEndValue = rangeEnd.length ? Number(rangeEnd) : null; if (position.position < data3.length) { return "failure"; } if (rangeEndValue === null && rangeStartValue === null) { return "failure"; } if (rangeStartValue > rangeEndValue) { return "failure"; } return { rangeStartValue, rangeEndValue }; } function buildContentRange(rangeStart, rangeEnd, fullLength) { let contentRange = "bytes "; contentRange += isomorphicEncode(`${rangeStart}`); contentRange += "-"; contentRange += isomorphicEncode(`${rangeEnd}`); contentRange += "/"; contentRange += isomorphicEncode(`${fullLength}`); return contentRange; } var InflateStream = class extends Transform { #zlibOptions; /** @param {zlib.ZlibOptions} [zlibOptions] */ constructor(zlibOptions) { super(); this.#zlibOptions = zlibOptions; } _transform(chunk, encoding, callback) { if (!this._inflateStream) { if (chunk.length === 0) { callback(); return; } this._inflateStream = (chunk[0] & 15) === 8 ? zlib.createInflate(this.#zlibOptions) : zlib.createInflateRaw(this.#zlibOptions); this._inflateStream.on("data", this.push.bind(this)); this._inflateStream.on("end", () => this.push(null)); this._inflateStream.on("error", (err) => this.destroy(err)); } this._inflateStream.write(chunk, encoding, callback); } _final(callback) { if (this._inflateStream) { this._inflateStream.end(); this._inflateStream = null; } callback(); } }; function createInflate(zlibOptions) { return new InflateStream(zlibOptions); } function extractMimeType(headers) { let charset = null; let essence = null; let mimeType = null; const values = getDecodeSplit("content-type", headers); if (values === null) { return "failure"; } for (const value of values) { const temporaryMimeType = parseMIMEType(value); if (temporaryMimeType === "failure" || temporaryMimeType.essence === "*/*") { continue; } mimeType = temporaryMimeType; if (mimeType.essence !== essence) { charset = null; if (mimeType.parameters.has("charset")) { charset = mimeType.parameters.get("charset"); } essence = mimeType.essence; } else if (!mimeType.parameters.has("charset") && charset !== null) { mimeType.parameters.set("charset", charset); } } if (mimeType == null) { return "failure"; } return mimeType; } function gettingDecodingSplitting(value) { const input = value; const position = { position: 0 }; const values = []; let temporaryValue = ""; while (position.position < input.length) { temporaryValue += collectASequenceOfCodePoints( (char) => char !== '"' && char !== ",", input, position ); if (position.position < input.length) { if (input.charCodeAt(position.position) === 34) { temporaryValue += collectAnHTTPQuotedString( input, position ); if (position.position < input.length) { continue; } } else { assert4(input.charCodeAt(position.position) === 44); position.position++; } } temporaryValue = removeChars(temporaryValue, true, true, (char) => char === 9 || char === 32); values.push(temporaryValue); temporaryValue = ""; } return values; } function getDecodeSplit(name, list2) { const value = list2.get(name, true); if (value === null) { return null; } return gettingDecodingSplitting(value); } var textDecoder2 = new TextDecoder(); function utf8DecodeBytes(buffer) { if (buffer.length === 0) { return ""; } if (buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) { buffer = buffer.subarray(3); } const output = textDecoder2.decode(buffer); return output; } var EnvironmentSettingsObjectBase = class { get baseUrl() { return getGlobalOrigin(); } get origin() { return this.baseUrl?.origin; } policyContainer = makePolicyContainer(); }; var EnvironmentSettingsObject = class { settingsObject = new EnvironmentSettingsObjectBase(); }; var environmentSettingsObject = new EnvironmentSettingsObject(); module2.exports = { isAborted, isCancelled, isValidEncodedURL, createDeferredPromise, ReadableStreamFrom, tryUpgradeRequestToAPotentiallyTrustworthyURL, clampAndCoarsenConnectionTimingInfo, coarsenedSharedCurrentTime, determineRequestsReferrer, makePolicyContainer, clonePolicyContainer, appendFetchMetadata, appendRequestOriginHeader, TAOCheck, corsCheck, crossOriginResourcePolicyCheck, createOpaqueTimingInfo, setRequestReferrerPolicyOnRedirect, isValidHTTPToken, requestBadPort, requestCurrentURL, responseURL, responseLocationURL, isBlobLike, isURLPotentiallyTrustworthy, isValidReasonPhrase, sameOrigin, normalizeMethod, serializeJavascriptValueToJSONString, iteratorMixin, createIterator, isValidHeaderName, isValidHeaderValue, isErrorLike, fullyReadBody, bytesMatch, isReadableStreamLike, readableStreamClose, isomorphicEncode, urlIsLocal, urlHasHttpsScheme, urlIsHttpHttpsScheme, readAllBytes, simpleRangeHeaderValue, buildContentRange, parseMetadata, createInflate, extractMimeType, getDecodeSplit, utf8DecodeBytes, environmentSettingsObject }; } }); // node_modules/undici/lib/web/fetch/symbols.js var require_symbols2 = __commonJS({ "node_modules/undici/lib/web/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { kUrl: /* @__PURE__ */ Symbol("url"), kHeaders: /* @__PURE__ */ Symbol("headers"), kSignal: /* @__PURE__ */ Symbol("signal"), kState: /* @__PURE__ */ Symbol("state"), kDispatcher: /* @__PURE__ */ Symbol("dispatcher") }; } }); // node_modules/undici/lib/web/fetch/file.js var require_file = __commonJS({ "node_modules/undici/lib/web/fetch/file.js"(exports2, module2) { "use strict"; var { Blob: Blob2, File } = require("node:buffer"); var { kState } = require_symbols2(); var { webidl } = require_webidl(); var FileLike = class _FileLike { constructor(blobLike, fileName, options = {}) { const n3 = fileName; const t = options.type; const d5 = options.lastModified ?? Date.now(); this[kState] = { blobLike, name: n3, type: t, lastModified: d5 }; } 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"; } }; webidl.converters.Blob = webidl.interfaceConverter(Blob2); function isFileLike(object) { return object instanceof File || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File"; } module2.exports = { FileLike, isFileLike }; } }); // node_modules/undici/lib/web/fetch/formdata.js var require_formdata = __commonJS({ "node_modules/undici/lib/web/fetch/formdata.js"(exports2, module2) { "use strict"; var { isBlobLike, iteratorMixin } = require_util2(); var { kState } = require_symbols2(); var { kEnumerableProperty } = require_util(); var { FileLike, isFileLike } = require_file(); var { webidl } = require_webidl(); var { File: NativeFile } = require("node:buffer"); var nodeUtil = require("node:util"); var File = globalThis.File ?? NativeFile; var FormData = class _FormData { constructor(form) { webidl.util.markAsUncloneable(this); if (form !== void 0) { throw webidl.errors.conversionFailed({ prefix: "FormData constructor", argument: "Argument 1", types: ["undefined"] }); } this[kState] = []; } append(name, value, filename = void 0) { webidl.brandCheck(this, _FormData); const prefix = "FormData.append"; webidl.argumentLengthCheck(arguments, 2, prefix); if (arguments.length === 3 && !isBlobLike(value)) { throw new TypeError( "Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'" ); } name = webidl.converters.USVString(name, prefix, "name"); value = isBlobLike(value) ? webidl.converters.Blob(value, prefix, "value", { strict: false }) : webidl.converters.USVString(value, prefix, "value"); filename = arguments.length === 3 ? webidl.converters.USVString(filename, prefix, "filename") : void 0; const entry = makeEntry(name, value, filename); this[kState].push(entry); } delete(name) { webidl.brandCheck(this, _FormData); const prefix = "FormData.delete"; webidl.argumentLengthCheck(arguments, 1, prefix); name = webidl.converters.USVString(name, prefix, "name"); this[kState] = this[kState].filter((entry) => entry.name !== name); } get(name) { webidl.brandCheck(this, _FormData); const prefix = "FormData.get"; webidl.argumentLengthCheck(arguments, 1, prefix); name = webidl.converters.USVString(name, prefix, "name"); const idx = this[kState].findIndex((entry) => entry.name === name); if (idx === -1) { return null; } return this[kState][idx].value; } getAll(name) { webidl.brandCheck(this, _FormData); const prefix = "FormData.getAll"; webidl.argumentLengthCheck(arguments, 1, prefix); name = webidl.converters.USVString(name, prefix, "name"); return this[kState].filter((entry) => entry.name === name).map((entry) => entry.value); } has(name) { webidl.brandCheck(this, _FormData); const prefix = "FormData.has"; webidl.argumentLengthCheck(arguments, 1, prefix); name = webidl.converters.USVString(name, prefix, "name"); return this[kState].findIndex((entry) => entry.name === name) !== -1; } set(name, value, filename = void 0) { webidl.brandCheck(this, _FormData); const prefix = "FormData.set"; webidl.argumentLengthCheck(arguments, 2, prefix); if (arguments.length === 3 && !isBlobLike(value)) { throw new TypeError( "Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'" ); } name = webidl.converters.USVString(name, prefix, "name"); value = isBlobLike(value) ? webidl.converters.Blob(value, prefix, "name", { strict: false }) : webidl.converters.USVString(value, prefix, "name"); filename = arguments.length === 3 ? webidl.converters.USVString(filename, prefix, "name") : void 0; const entry = makeEntry(name, value, filename); const idx = this[kState].findIndex((entry2) => entry2.name === name); if (idx !== -1) { this[kState] = [ ...this[kState].slice(0, idx), entry, ...this[kState].slice(idx + 1).filter((entry2) => entry2.name !== name) ]; } else { this[kState].push(entry); } } [nodeUtil.inspect.custom](depth, options) { const state2 = this[kState].reduce((a5, b6) => { if (a5[b6.name]) { if (Array.isArray(a5[b6.name])) { a5[b6.name].push(b6.value); } else { a5[b6.name] = [a5[b6.name], b6.value]; } } else { a5[b6.name] = b6.value; } return a5; }, { __proto__: null }); options.depth ??= depth; options.colors ??= true; const output = nodeUtil.formatWithOptions(options, state2); return `FormData ${output.slice(output.indexOf("]") + 2)}`; } }; iteratorMixin("FormData", FormData, kState, "name", "value"); Object.defineProperties(FormData.prototype, { append: kEnumerableProperty, delete: kEnumerableProperty, get: kEnumerableProperty, getAll: kEnumerableProperty, has: kEnumerableProperty, set: kEnumerableProperty, [Symbol.toStringTag]: { value: "FormData", configurable: true } }); function makeEntry(name, value, filename) { if (typeof value === "string") { } else { if (!isFileLike(value)) { value = value instanceof Blob ? new File([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type }); } if (filename !== void 0) { const options = { type: value.type, lastModified: value.lastModified }; value = value instanceof NativeFile ? new File([value], filename, options) : new FileLike(value, filename, options); } } return { name, value }; } module2.exports = { FormData, makeEntry }; } }); // node_modules/undici/lib/web/fetch/formdata-parser.js var require_formdata_parser = __commonJS({ "node_modules/undici/lib/web/fetch/formdata-parser.js"(exports2, module2) { "use strict"; var { isUSVString, bufferToLowerCasedHeaderName } = require_util(); var { utf8DecodeBytes } = require_util2(); var { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require_data_url(); var { isFileLike } = require_file(); var { makeEntry } = require_formdata(); var assert4 = require("node:assert"); var { File: NodeFile } = require("node:buffer"); var File = globalThis.File ?? NodeFile; var formDataNameBuffer = Buffer.from('form-data; name="'); var filenameBuffer = Buffer.from("; filename"); var dd = Buffer.from("--"); var ddcrlf = Buffer.from("--\r\n"); function isAsciiString(chars) { for (let i5 = 0; i5 < chars.length; ++i5) { if ((chars.charCodeAt(i5) & ~127) !== 0) { return false; } } return true; } function validateBoundary(boundary) { const length = boundary.length; if (length < 27 || length > 70) { return false; } for (let i5 = 0; i5 < length; ++i5) { const cp = boundary.charCodeAt(i5); if (!(cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 39 || cp === 45 || cp === 95)) { return false; } } return true; } function multipartFormDataParser(input, mimeType) { assert4(mimeType !== "failure" && mimeType.essence === "multipart/form-data"); const boundaryString = mimeType.parameters.get("boundary"); if (boundaryString === void 0) { return "failure"; } const boundary = Buffer.from(`--${boundaryString}`, "utf8"); const entryList = []; const position = { position: 0 }; while (input[position.position] === 13 && input[position.position + 1] === 10) { position.position += 2; } let trailing = input.length; while (input[trailing - 1] === 10 && input[trailing - 2] === 13) { trailing -= 2; } if (trailing !== input.length) { input = input.subarray(0, trailing); } while (true) { if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) { position.position += boundary.length; } else { return "failure"; } if (position.position === input.length - 2 && bufferStartsWith(input, dd, position) || position.position === input.length - 4 && bufferStartsWith(input, ddcrlf, position)) { return entryList; } if (input[position.position] !== 13 || input[position.position + 1] !== 10) { return "failure"; } position.position += 2; const result = parseMultipartFormDataHeaders(input, position); if (result === "failure") { return "failure"; } let { name, filename, contentType, encoding } = result; position.position += 2; let body; { const boundaryIndex = input.indexOf(boundary.subarray(2), position.position); if (boundaryIndex === -1) { return "failure"; } body = input.subarray(position.position, boundaryIndex - 4); position.position += body.length; if (encoding === "base64") { body = Buffer.from(body.toString(), "base64"); } } if (input[position.position] !== 13 || input[position.position + 1] !== 10) { return "failure"; } else { position.position += 2; } let value; if (filename !== null) { contentType ??= "text/plain"; if (!isAsciiString(contentType)) { contentType = ""; } value = new File([body], filename, { type: contentType }); } else { value = utf8DecodeBytes(Buffer.from(body)); } assert4(isUSVString(name)); assert4(typeof value === "string" && isUSVString(value) || isFileLike(value)); entryList.push(makeEntry(name, value, filename)); } } function parseMultipartFormDataHeaders(input, position) { let name = null; let filename = null; let contentType = null; let encoding = null; while (true) { if (input[position.position] === 13 && input[position.position + 1] === 10) { if (name === null) { return "failure"; } return { name, filename, contentType, encoding }; } let headerName = collectASequenceOfBytes( (char) => char !== 10 && char !== 13 && char !== 58, input, position ); headerName = removeChars(headerName, true, true, (char) => char === 9 || char === 32); if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) { return "failure"; } if (input[position.position] !== 58) { return "failure"; } position.position++; collectASequenceOfBytes( (char) => char === 32 || char === 9, input, position ); switch (bufferToLowerCasedHeaderName(headerName)) { case "content-disposition": { name = filename = null; if (!bufferStartsWith(input, formDataNameBuffer, position)) { return "failure"; } position.position += 17; name = parseMultipartFormDataName(input, position); if (name === null) { return "failure"; } if (bufferStartsWith(input, filenameBuffer, position)) { let check = position.position + filenameBuffer.length; if (input[check] === 42) { position.position += 1; check += 1; } if (input[check] !== 61 || input[check + 1] !== 34) { return "failure"; } position.position += 12; filename = parseMultipartFormDataName(input, position); if (filename === null) { return "failure"; } } break; } case "content-type": { let headerValue = collectASequenceOfBytes( (char) => char !== 10 && char !== 13, input, position ); headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32); contentType = isomorphicDecode(headerValue); break; } case "content-transfer-encoding": { let headerValue = collectASequenceOfBytes( (char) => char !== 10 && char !== 13, input, position ); headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32); encoding = isomorphicDecode(headerValue); break; } default: { collectASequenceOfBytes( (char) => char !== 10 && char !== 13, input, position ); } } if (input[position.position] !== 13 && input[position.position + 1] !== 10) { return "failure"; } else { position.position += 2; } } } function parseMultipartFormDataName(input, position) { assert4(input[position.position - 1] === 34); let name = collectASequenceOfBytes( (char) => char !== 10 && char !== 13 && char !== 34, input, position ); if (input[position.position] !== 34) { return null; } else { position.position++; } name = new TextDecoder().decode(name).replace(/%0A/ig, "\n").replace(/%0D/ig, "\r").replace(/%22/g, '"'); return name; } function collectASequenceOfBytes(condition, input, position) { let start = position.position; while (start < input.length && condition(input[start])) { ++start; } return input.subarray(position.position, position.position = start); } function removeChars(buf, leading, trailing, predicate) { let lead = 0; let trail = buf.length - 1; if (leading) { while (lead < buf.length && predicate(buf[lead])) lead++; } if (trailing) { while (trail > 0 && predicate(buf[trail])) trail--; } return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1); } function bufferStartsWith(buffer, start, position) { if (buffer.length < start.length) { return false; } for (let i5 = 0; i5 < start.length; i5++) { if (start[i5] !== buffer[position.position + i5]) { return false; } } return true; } module2.exports = { multipartFormDataParser, validateBoundary }; } }); // node_modules/undici/lib/web/fetch/body.js var require_body = __commonJS({ "node_modules/undici/lib/web/fetch/body.js"(exports2, module2) { "use strict"; var util = require_util(); var { ReadableStreamFrom, isBlobLike, isReadableStreamLike, readableStreamClose, createDeferredPromise, fullyReadBody, extractMimeType, utf8DecodeBytes } = require_util2(); var { FormData } = require_formdata(); var { kState } = require_symbols2(); var { webidl } = require_webidl(); var { Blob: Blob2 } = require("node:buffer"); var assert4 = require("node:assert"); var { isErrored, isDisturbed } = require("node:stream"); var { isArrayBuffer } = require("node:util/types"); var { serializeAMimeType } = require_data_url(); var { multipartFormDataParser } = require_formdata_parser(); var random; try { const crypto4 = require("node:crypto"); random = (max) => crypto4.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } var textEncoder = new TextEncoder(); function noop() { } var hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf("v18") !== 0; var streamRegistry; if (hasFinalizationRegistry) { streamRegistry = new FinalizationRegistry((weakRef) => { const stream = weakRef.deref(); if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) { stream.cancel("Response object has been garbage collected").catch(noop); } }); } function extractBody(object, keepalive = false) { let stream = null; if (object instanceof ReadableStream) { stream = object; } else if (isBlobLike(object)) { stream = object.stream(); } else { stream = new ReadableStream({ async pull(controller) { const buffer = typeof source === "string" ? textEncoder.encode(source) : source; if (buffer.byteLength) { controller.enqueue(buffer); } queueMicrotask(() => readableStreamClose(controller)); }, start() { }, type: "bytes" }); } assert4(isReadableStreamLike(stream)); 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 (isArrayBuffer(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 (util.isFormDataLike(object)) { const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; const prefix = `--${boundary}\r Content-Disposition: form-data`; const escape = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"); const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n"); const blobParts = []; const rn = new Uint8Array([13, 10]); length = 0; let hasUnknownSizeValue = false; for (const [name, value] of object) { if (typeof value === "string") { const chunk2 = textEncoder.encode(prefix + `; name="${escape(normalizeLinefeeds(name))}"\r \r ${normalizeLinefeeds(value)}\r `); blobParts.push(chunk2); length += chunk2.byteLength; } else { const chunk2 = textEncoder.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${escape(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}--\r `); blobParts.push(chunk); length += chunk.byteLength; if (hasUnknownSizeValue) { length = null; } source = object; action = async function* () { for (const part of blobParts) { if (part.stream) { yield* part.stream(); } else { yield part; } } }; 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 (util.isDisturbed(object) || object.locked) { throw new TypeError( "Response body object should not be disturbed or locked" ); } stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object); } if (typeof source === "string" || util.isBuffer(source)) { length = Buffer.byteLength(source); } if (action != null) { let iterator; stream = new ReadableStream({ async start() { iterator = action(object)[Symbol.asyncIterator](); }, async pull(controller) { const { value, done } = await iterator.next(); if (done) { queueMicrotask(() => { controller.close(); controller.byobRequest?.respond(0); }); } else { if (!isErrored(stream)) { const buffer = new Uint8Array(value); if (buffer.byteLength) { controller.enqueue(buffer); } } } return controller.desiredSize > 0; }, async cancel(reason) { await iterator.return(); }, type: "bytes" }); } const body = { stream, source, length }; return [body, type]; } function safelyExtractBody(object, keepalive = false) { if (object instanceof ReadableStream) { assert4(!util.isDisturbed(object), "The body has already been consumed."); assert4(!object.locked, "The stream is locked."); } return extractBody(object, keepalive); } function cloneBody(instance, body) { const [out1, out2] = body.stream.tee(); body.stream = out1; return { stream: out2, length: body.length, source: body.source }; } function throwIfAborted(state2) { if (state2.aborted) { throw new DOMException("The operation was aborted.", "AbortError"); } } function bodyMixinMethods(instance) { const methods = { blob() { return consumeBody(this, (bytes) => { let mimeType = bodyMimeType(this); if (mimeType === null) { mimeType = ""; } else if (mimeType) { mimeType = serializeAMimeType(mimeType); } return new Blob2([bytes], { type: mimeType }); }, instance); }, arrayBuffer() { return consumeBody(this, (bytes) => { return new Uint8Array(bytes).buffer; }, instance); }, text() { return consumeBody(this, utf8DecodeBytes, instance); }, json() { return consumeBody(this, parseJSONFromBytes, instance); }, formData() { return consumeBody(this, (value) => { const mimeType = bodyMimeType(this); if (mimeType !== null) { switch (mimeType.essence) { case "multipart/form-data": { const parsed = multipartFormDataParser(value, mimeType); if (parsed === "failure") { throw new TypeError("Failed to parse body as FormData."); } const fd = new FormData(); fd[kState] = parsed; return fd; } case "application/x-www-form-urlencoded": { const entries = new URLSearchParams(value.toString()); const fd = new FormData(); for (const [name, value2] of entries) { fd.append(name, value2); } return fd; } } } throw new TypeError( 'Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".' ); }, instance); }, bytes() { return consumeBody(this, (bytes) => { return new Uint8Array(bytes); }, instance); } }; return methods; } function mixinBody(prototype) { Object.assign(prototype.prototype, bodyMixinMethods(prototype)); } async function consumeBody(object, convertBytesToJSValue, instance) { webidl.brandCheck(object, instance); if (bodyUnusable(object)) { throw new TypeError("Body is unusable: Body has already been read"); } throwIfAborted(object[kState]); const promise = createDeferredPromise(); const errorSteps = (error3) => promise.reject(error3); const successSteps = (data3) => { try { promise.resolve(convertBytesToJSValue(data3)); } catch (e5) { errorSteps(e5); } }; if (object[kState].body == null) { successSteps(Buffer.allocUnsafe(0)); return promise.promise; } await fullyReadBody(object[kState].body, successSteps, errorSteps); return promise.promise; } function bodyUnusable(object) { const body = object[kState].body; return body != null && (body.stream.locked || util.isDisturbed(body.stream)); } function parseJSONFromBytes(bytes) { return JSON.parse(utf8DecodeBytes(bytes)); } function bodyMimeType(requestOrResponse) { const headers = requestOrResponse[kState].headersList; const mimeType = extractMimeType(headers); if (mimeType === "failure") { return null; } return mimeType; } module2.exports = { extractBody, safelyExtractBody, cloneBody, mixinBody, streamRegistry, hasFinalizationRegistry, bodyUnusable }; } }); // node_modules/undici/lib/dispatcher/client-h1.js var require_client_h1 = __commonJS({ "node_modules/undici/lib/dispatcher/client-h1.js"(exports2, module2) { "use strict"; var assert4 = require("node:assert"); var util = require_util(); var { channels } = require_diagnostics(); var timers = require_timers(); var { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, RequestAbortedError, HeadersTimeoutError, HeadersOverflowError, SocketError, InformationalError, BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError } = require_errors(); var { kUrl, kReset, kClient, kParser, kBlocking, kRunning, kPending, kSize, kWriting, kQueue, kNoRef, kKeepAliveDefaultTimeout, kHostHeader, kPendingIdx, kRunningIdx, kError, kPipelining, kSocket, kKeepAliveTimeoutValue, kMaxHeadersSize, kKeepAliveMaxTimeout, kKeepAliveTimeoutThreshold, kHeadersTimeout, kBodyTimeout, kStrictContentLength, kMaxRequests, kCounter, kMaxResponseSize, kOnError, kResume, kHTTPContext } = require_symbols(); var constants3 = require_constants2(); var EMPTY_BUF = Buffer.alloc(0); var FastBuffer = Buffer[Symbol.species]; var addListener = util.addListener; var removeAllListeners = util.removeAllListeners; var extractBody; async function lazyllhttp() { const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0; let mod; try { mod = await WebAssembly.compile(require_llhttp_simd_wasm()); } catch (e5) { mod = await WebAssembly.compile(llhttpWasmData || require_llhttp_wasm()); } return await WebAssembly.instantiate(mod, { env: { /* eslint-disable camelcase */ wasm_on_url: (p2, at, len) => { return 0; }, wasm_on_status: (p2, at, len) => { assert4(currentParser.ptr === p2); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_message_begin: (p2) => { assert4(currentParser.ptr === p2); return currentParser.onMessageBegin() || 0; }, wasm_on_header_field: (p2, at, len) => { assert4(currentParser.ptr === p2); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_header_value: (p2, at, len) => { assert4(currentParser.ptr === p2); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_headers_complete: (p2, statusCode, upgrade, shouldKeepAlive) => { assert4(currentParser.ptr === p2); return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0; }, wasm_on_body: (p2, at, len) => { assert4(currentParser.ptr === p2); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_message_complete: (p2) => { assert4(currentParser.ptr === p2); return currentParser.onMessageComplete() || 0; } /* eslint-enable camelcase */ } }); } var llhttpInstance = null; var llhttpPromise = lazyllhttp(); llhttpPromise.catch(); var currentParser = null; var currentBufferRef = null; var currentBufferSize = 0; var currentBufferPtr = null; var USE_NATIVE_TIMER = 0; var USE_FAST_TIMER = 1; var TIMEOUT_HEADERS = 2 | USE_FAST_TIMER; var TIMEOUT_BODY = 4 | USE_FAST_TIMER; var TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER; var Parser = class { constructor(client, socket, { exports: exports3 }) { assert4(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); this.llhttp = exports3; this.ptr = this.llhttp.llhttp_alloc(constants3.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(delay, type) { if (delay !== this.timeoutValue || type & USE_FAST_TIMER ^ this.timeoutType & USE_FAST_TIMER) { if (this.timeout) { timers.clearTimeout(this.timeout); this.timeout = null; } if (delay) { if (type & USE_FAST_TIMER) { this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this)); } else { this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this)); this.timeout.unref(); } } this.timeoutValue = delay; } else if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); } } this.timeoutType = type; } resume() { if (this.socket.destroyed || !this.paused) { return; } assert4(this.ptr != null); assert4(currentParser == null); this.llhttp.llhttp_resume(this.ptr); assert4(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(data3) { assert4(this.ptr != null); assert4(currentParser == null); assert4(!this.paused); const { socket, llhttp } = this; if (data3.length > currentBufferSize) { if (currentBufferPtr) { llhttp.free(currentBufferPtr); } currentBufferSize = Math.ceil(data3.length / 4096) * 4096; currentBufferPtr = llhttp.malloc(currentBufferSize); } new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data3); try { let ret; try { currentBufferRef = data3; currentParser = this; ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data3.length); } catch (err) { throw err; } finally { currentParser = null; currentBufferRef = null; } const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr; if (ret === constants3.ERROR.PAUSED_UPGRADE) { this.onUpgrade(data3.slice(offset)); } else if (ret === constants3.ERROR.PAUSED) { this.paused = true; socket.unshift(data3.slice(offset)); } else if (ret !== constants3.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, constants3.ERROR[ret], data3.slice(offset)); } } catch (err) { util.destroy(socket, err); } } destroy() { assert4(this.ptr != null); assert4(currentParser == null); this.llhttp.llhttp_free(this.ptr); this.ptr = null; this.timeout && 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 request = client[kQueue][client[kRunningIdx]]; if (!request) { return -1; } request.onResponseStarted(); } 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) { const headerName = util.bufferToLowerCasedHeaderName(key); if (headerName === "keep-alive") { this.keepAlive += buf.toString(); } else if (headerName === "connection") { this.connection += buf.toString(); } } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === "content-length") { this.contentLength += buf.toString(); } this.trackHeader(buf.length); } trackHeader(len) { this.headersSize += len; if (this.headersSize >= this.headersMaxSize) { util.destroy(this.socket, new HeadersOverflowError()); } } onUpgrade(head) { const { upgrade, client, socket, headers, statusCode } = this; assert4(upgrade); assert4(client[kSocket] === socket); assert4(!socket.destroyed); assert4(!this.paused); assert4((headers.length & 1) === 0); const request = client[kQueue][client[kRunningIdx]]; assert4(request); assert4(request.upgrade || request.method === "CONNECT"); this.statusCode = null; this.statusText = ""; this.shouldKeepAlive = null; this.headers = []; this.headersSize = 0; socket.unshift(head); socket[kParser].destroy(); socket[kParser] = null; socket[kClient] = null; socket[kError] = null; removeAllListeners(socket); client[kSocket] = null; client[kHTTPContext] = null; client[kQueue][client[kRunningIdx]++] = null; client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade")); try { request.onUpgrade(statusCode, headers, socket); } catch (err) { util.destroy(socket, err); } client[kResume](); } onHeadersComplete(statusCode, upgrade, shouldKeepAlive) { const { client, socket, headers, statusText } = this; if (socket.destroyed) { return -1; } const request = client[kQueue][client[kRunningIdx]]; if (!request) { return -1; } assert4(!this.upgrade); assert4(this.statusCode < 200); if (statusCode === 100) { util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket))); return -1; } if (upgrade && !request.upgrade) { util.destroy(socket, new SocketError("bad upgrade", util.getSocketInfo(socket))); return -1; } assert4(this.timeoutType === TIMEOUT_HEADERS); this.statusCode = statusCode; this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. request.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive"; if (this.statusCode >= 200) { const bodyTimeout = request.bodyTimeout != null ? request.bodyTimeout : client[kBodyTimeout]; this.setTimeout(bodyTimeout, TIMEOUT_BODY); } else if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); } } if (request.method === "CONNECT") { assert4(client[kRunning] === 1); this.upgrade = true; return 2; } if (upgrade) { assert4(client[kRunning] === 1); this.upgrade = true; return 2; } assert4((this.headers.length & 1) === 0); this.headers = []; this.headersSize = 0; if (this.shouldKeepAlive && client[kPipelining]) { const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null; if (keepAliveTimeout != null) { const timeout = Math.min( keepAliveTimeout - client[kKeepAliveTimeoutThreshold], client[kKeepAliveMaxTimeout] ); if (timeout <= 0) { socket[kReset] = true; } else { client[kKeepAliveTimeoutValue] = timeout; } } else { client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]; } } else { socket[kReset] = true; } const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false; if (request.aborted) { return -1; } if (request.method === "HEAD") { return 1; } if (statusCode < 200) { return 1; } if (socket[kBlocking]) { socket[kBlocking] = false; client[kResume](); } return pause ? constants3.ERROR.PAUSED : 0; } onBody(buf) { const { client, socket, statusCode, maxResponseSize } = this; if (socket.destroyed) { return -1; } const request = client[kQueue][client[kRunningIdx]]; assert4(request); assert4(this.timeoutType === TIMEOUT_BODY); if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); } } assert4(statusCode >= 200); if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { util.destroy(socket, new ResponseExceededMaxSizeError()); return -1; } this.bytesRead += buf.length; if (request.onData(buf) === false) { return constants3.ERROR.PAUSED; } } onMessageComplete() { const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this; if (socket.destroyed && (!statusCode || shouldKeepAlive)) { return -1; } if (upgrade) { return; } assert4(statusCode >= 100); assert4((this.headers.length & 1) === 0); const request = client[kQueue][client[kRunningIdx]]; assert4(request); this.statusCode = null; this.statusText = ""; this.bytesRead = 0; this.contentLength = ""; this.keepAlive = ""; this.connection = ""; this.headers = []; this.headersSize = 0; if (statusCode < 200) { return; } if (request.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) { util.destroy(socket, new ResponseContentLengthMismatchError()); return -1; } request.onComplete(headers); client[kQueue][client[kRunningIdx]++] = null; if (socket[kWriting]) { assert4(client[kRunning] === 0); util.destroy(socket, new InformationalError("reset")); return constants3.ERROR.PAUSED; } else if (!shouldKeepAlive) { util.destroy(socket, new InformationalError("reset")); return constants3.ERROR.PAUSED; } else if (socket[kReset] && client[kRunning] === 0) { util.destroy(socket, new InformationalError("reset")); return constants3.ERROR.PAUSED; } else if (client[kPipelining] == null || client[kPipelining] === 1) { setImmediate(() => client[kResume]()); } else { client[kResume](); } } }; function onParserTimeout(parser) { const { socket, timeoutType, client, paused } = parser.deref(); if (timeoutType === TIMEOUT_HEADERS) { if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { assert4(!paused, "cannot be paused while waiting for headers"); util.destroy(socket, new HeadersTimeoutError()); } } else if (timeoutType === TIMEOUT_BODY) { if (!paused) { util.destroy(socket, new BodyTimeoutError()); } } else if (timeoutType === TIMEOUT_KEEP_ALIVE) { assert4(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); util.destroy(socket, new InformationalError("socket idle timeout")); } } async function connectH1(client, socket) { client[kSocket] = socket; if (!llhttpInstance) { llhttpInstance = await llhttpPromise; llhttpPromise = null; } socket[kNoRef] = false; socket[kWriting] = false; socket[kReset] = false; socket[kBlocking] = false; socket[kParser] = new Parser(client, socket, llhttpInstance); addListener(socket, "error", function(err) { assert4(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); const parser = this[kParser]; if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { parser.onMessageComplete(); return; } this[kError] = err; this[kClient][kOnError](err); }); addListener(socket, "readable", function() { const parser = this[kParser]; if (parser) { parser.readMore(); } }); addListener(socket, "end", function() { const parser = this[kParser]; if (parser.statusCode && !parser.shouldKeepAlive) { parser.onMessageComplete(); return; } util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); }); addListener(socket, "close", function() { const client2 = this[kClient]; const parser = this[kParser]; if (parser) { if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { parser.onMessageComplete(); } this[kParser].destroy(); this[kParser] = null; } const err = this[kError] || new SocketError("closed", util.getSocketInfo(this)); client2[kSocket] = null; client2[kHTTPContext] = null; if (client2.destroyed) { assert4(client2[kPending] === 0); const requests = client2[kQueue].splice(client2[kRunningIdx]); for (let i5 = 0; i5 < requests.length; i5++) { const request = requests[i5]; util.errorRequest(client2, request, err); } } else if (client2[kRunning] > 0 && err.code !== "UND_ERR_INFO") { const request = client2[kQueue][client2[kRunningIdx]]; client2[kQueue][client2[kRunningIdx]++] = null; util.errorRequest(client2, request, err); } client2[kPendingIdx] = client2[kRunningIdx]; assert4(client2[kRunning] === 0); client2.emit("disconnect", client2[kUrl], [client2], err); client2[kResume](); }); let closed = false; socket.on("close", () => { closed = true; }); return { version: "h1", defaultPipelining: 1, write(...args) { return writeH1(client, ...args); }, resume() { resumeH1(client); }, destroy(err, callback) { if (closed) { queueMicrotask(callback); } else { socket.destroy(err).on("close", callback); } }, get destroyed() { return socket.destroyed; }, busy(request) { if (socket[kWriting] || socket[kReset] || socket[kBlocking]) { return true; } if (request) { if (client[kRunning] > 0 && !request.idempotent) { return true; } if (client[kRunning] > 0 && (request.upgrade || request.method === "CONNECT")) { return true; } if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) { return true; } } return false; } }; } function resumeH1(client) { const socket = client[kSocket]; if (socket && !socket.destroyed) { 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_KEEP_ALIVE) { socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE); } } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { const request = client[kQueue][client[kRunningIdx]]; const headersTimeout = request.headersTimeout != null ? request.headersTimeout : client[kHeadersTimeout]; socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS); } } } } function shouldSendContentLength(method) { return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request) { const { method, path: path3, host, upgrade, blocking, reset } = request; let { body, headers, contentLength } = request; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { if (!extractBody) { extractBody = require_body().extractBody; } const [bodyStream, contentType] = extractBody(body); if (request.contentType == null) { headers.push("content-type", contentType); } body = bodyStream.stream; contentLength = bodyStream.length; } else if (util.isBlobLike(body) && request.contentType == null && body.type) { headers.push("content-type", body.type); } if (body && typeof body.read === "function") { body.read(0); } const bodyLength = util.bodyLength(body); contentLength = bodyLength ?? contentLength; if (contentLength === null) { contentLength = request.contentLength; } if (contentLength === 0 && !expectsPayload) { contentLength = null; } if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) { if (client[kStrictContentLength]) { util.errorRequest(client, request, new RequestContentLengthMismatchError()); return false; } process.emitWarning(new RequestContentLengthMismatchError()); } const socket = client[kSocket]; const abort = (err) => { if (request.aborted || request.completed) { return; } util.errorRequest(client, request, err || new RequestAbortedError()); util.destroy(body); util.destroy(socket, new InformationalError("aborted")); }; try { request.onConnect(abort); } catch (err) { util.errorRequest(client, request, err); } if (request.aborted) { return false; } if (method === "HEAD") { socket[kReset] = true; } if (upgrade || method === "CONNECT") { socket[kReset] = true; } if (reset != null) { socket[kReset] = reset; } if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { socket[kReset] = true; } if (blocking) { socket[kBlocking] = true; } let header = `${method} ${path3} 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[kReset]) { header += "connection: keep-alive\r\n"; } else { header += "connection: close\r\n"; } if (Array.isArray(headers)) { for (let n3 = 0; n3 < headers.length; n3 += 2) { const key = headers[n3 + 0]; const val = headers[n3 + 1]; if (Array.isArray(val)) { for (let i5 = 0; i5 < val.length; i5++) { header += `${key}: ${val[i5]}\r `; } } else { header += `${key}: ${val}\r `; } } } if (channels.sendHeaders.hasSubscribers) { channels.sendHeaders.publish({ request, headers: header, socket }); } if (!body || bodyLength === 0) { writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload); } else if (util.isBuffer(body)) { writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload); } else if (util.isBlobLike(body)) { if (typeof body.stream === "function") { writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload); } else { writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload); } } else if (util.isStream(body)) { writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload); } else if (util.isIterable(body)) { writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload); } else { assert4(false); } return true; } function writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload) { assert4(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); let finished = false; const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header }); const onData = function(chunk) { if (finished) { return; } try { if (!writer.write(chunk) && this.pause) { this.pause(); } } catch (err) { util.destroy(this, err); } }; const onDrain = function() { if (finished) { return; } if (body.resume) { body.resume(); } }; const onClose = function() { queueMicrotask(() => { body.removeListener("error", onFinished); }); if (!finished) { const err = new RequestAbortedError(); queueMicrotask(() => onFinished(err)); } }; const onFinished = function(err) { if (finished) { return; } finished = true; assert4(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); socket.off("drain", onDrain).off("error", onFinished); body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose); if (!err) { try { writer.end(); } catch (er) { err = er; } } writer.destroy(err); if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { util.destroy(body, err); } else { util.destroy(body); } }; body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onClose); if (body.resume) { body.resume(); } socket.on("drain", onDrain).on("error", onFinished); if (body.errorEmitted ?? body.errored) { setImmediate(() => onFinished(body.errored)); } else if (body.endEmitted ?? body.readableEnded) { setImmediate(() => onFinished(null)); } if (body.closeEmitted ?? body.closed) { setImmediate(onClose); } } function writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload) { try { if (!body) { if (contentLength === 0) { socket.write(`${header}content-length: 0\r \r `, "latin1"); } else { assert4(contentLength === null, "no body must not have content length"); socket.write(`${header}\r `, "latin1"); } } else if (util.isBuffer(body)) { assert4(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(); request.onBodySent(body); if (!expectsPayload && request.reset !== false) { socket[kReset] = true; } } request.onRequestSent(); client[kResume](); } catch (err) { abort(err); } } async function writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload) { assert4(contentLength === body.size, "blob body must have content length"); try { if (contentLength != null && contentLength !== body.size) { throw new RequestContentLengthMismatchError(); } const buffer = Buffer.from(await body.arrayBuffer()); socket.cork(); socket.write(`${header}content-length: ${contentLength}\r \r `, "latin1"); socket.write(buffer); socket.uncork(); request.onBodySent(buffer); request.onRequestSent(); if (!expectsPayload && request.reset !== false) { socket[kReset] = true; } client[kResume](); } catch (err) { abort(err); } } async function writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload) { assert4(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); let callback = null; function onDrain() { if (callback) { const cb = callback; callback = null; cb(); } } const waitForDrain = () => new Promise((resolve, reject) => { assert4(callback === null); if (socket[kError]) { reject(socket[kError]); } else { callback = resolve; } }); socket.on("close", onDrain).on("drain", onDrain); const writer = new AsyncWriter({ abort, socket, request, 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); } } var AsyncWriter = class { constructor({ abort, socket, request, contentLength, client, expectsPayload, header }) { this.socket = socket; this.request = request; this.contentLength = contentLength; this.client = client; this.bytesWritten = 0; this.expectsPayload = expectsPayload; this.header = header; this.abort = abort; socket[kWriting] = true; } write(chunk) { const { socket, request, 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 && request.reset !== false) { socket[kReset] = 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(); request.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 } = this; request.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(); } } client[kResume](); } destroy(err) { const { socket, client, abort } = this; socket[kWriting] = false; if (err) { assert4(client[kRunning] <= 1, "pipeline should only contain this request"); abort(err); } } }; module2.exports = connectH1; } }); // node_modules/undici/lib/dispatcher/client-h2.js var require_client_h2 = __commonJS({ "node_modules/undici/lib/dispatcher/client-h2.js"(exports2, module2) { "use strict"; var assert4 = require("node:assert"); var { pipeline } = require("node:stream"); var util = require_util(); var { RequestContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError } = require_errors(); var { kUrl, kReset, kClient, kRunning, kPending, kQueue, kPendingIdx, kRunningIdx, kError, kSocket, kStrictContentLength, kOnError, kMaxConcurrentStreams, kHTTP2Session, kResume, kSize, kHTTPContext } = require_symbols(); var kOpenStreams = /* @__PURE__ */ Symbol("open streams"); var extractBody; var h2ExperimentalWarned = false; var http22; try { http22 = require("node: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; function parseH2Headers(headers) { const result = []; for (const [name, value] of Object.entries(headers)) { if (Array.isArray(value)) { for (const subvalue of value) { result.push(Buffer.from(name), Buffer.from(subvalue)); } } else { result.push(Buffer.from(name), Buffer.from(value)); } } return result; } async function connectH2(client, socket) { client[kSocket] = socket; 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[kMaxConcurrentStreams] }); session[kOpenStreams] = 0; session[kClient] = client; session[kSocket] = socket; util.addListener(session, "error", onHttp2SessionError); util.addListener(session, "frameError", onHttp2FrameError); util.addListener(session, "end", onHttp2SessionEnd); util.addListener(session, "goaway", onHTTP2GoAway); util.addListener(session, "close", function() { const { [kClient]: client2 } = this; const { [kSocket]: socket2 } = client2; const err = this[kSocket][kError] || this[kError] || new SocketError("closed", util.getSocketInfo(socket2)); client2[kHTTP2Session] = null; if (client2.destroyed) { assert4(client2[kPending] === 0); const requests = client2[kQueue].splice(client2[kRunningIdx]); for (let i5 = 0; i5 < requests.length; i5++) { const request = requests[i5]; util.errorRequest(client2, request, err); } } }); session.unref(); client[kHTTP2Session] = session; socket[kHTTP2Session] = session; util.addListener(socket, "error", function(err) { assert4(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); this[kError] = err; this[kClient][kOnError](err); }); util.addListener(socket, "end", function() { util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); }); util.addListener(socket, "close", function() { const err = this[kError] || new SocketError("closed", util.getSocketInfo(this)); client[kSocket] = null; if (this[kHTTP2Session] != null) { this[kHTTP2Session].destroy(err); } client[kPendingIdx] = client[kRunningIdx]; assert4(client[kRunning] === 0); client.emit("disconnect", client[kUrl], [client], err); client[kResume](); }); let closed = false; socket.on("close", () => { closed = true; }); return { version: "h2", defaultPipelining: Infinity, write(...args) { return writeH2(client, ...args); }, resume() { resumeH2(client); }, destroy(err, callback) { if (closed) { queueMicrotask(callback); } else { socket.destroy(err).on("close", callback); } }, get destroyed() { return socket.destroyed; }, busy() { return false; } }; } function resumeH2(client) { const socket = client[kSocket]; if (socket?.destroyed === false) { if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) { socket.unref(); client[kHTTP2Session].unref(); } else { socket.ref(); client[kHTTP2Session].ref(); } } } function onHttp2SessionError(err) { assert4(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); this[kSocket][kError] = err; this[kClient][kOnError](err); } function onHttp2FrameError(type, code, id) { if (id === 0) { const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`); this[kSocket][kError] = err; this[kClient][kOnError](err); } } function onHttp2SessionEnd() { const err = new SocketError("other side closed", util.getSocketInfo(this[kSocket])); this.destroy(err); util.destroy(this[kSocket], err); } function onHTTP2GoAway(code) { const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${code}`, util.getSocketInfo(this)); const client = this[kClient]; client[kSocket] = null; client[kHTTPContext] = null; if (this[kHTTP2Session] != null) { this[kHTTP2Session].destroy(err); this[kHTTP2Session] = null; } util.destroy(this[kSocket], err); if (client[kRunningIdx] < client[kQueue].length) { const request = client[kQueue][client[kRunningIdx]]; client[kQueue][client[kRunningIdx]++] = null; util.errorRequest(client, request, err); client[kPendingIdx] = client[kRunningIdx]; } assert4(client[kRunning] === 0); client.emit("disconnect", client[kUrl], [client], err); client[kResume](); } function shouldSendContentLength(method) { return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH2(client, request) { const session = client[kHTTP2Session]; const { method, path: path3, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; let { body } = request; if (upgrade) { util.errorRequest(client, request, new Error("Upgrade not supported for H2")); return false; } const headers = {}; for (let n3 = 0; n3 < reqHeaders.length; n3 += 2) { const key = reqHeaders[n3 + 0]; const val = reqHeaders[n3 + 1]; if (Array.isArray(val)) { for (let i5 = 0; i5 < val.length; i5++) { if (headers[key]) { headers[key] += `,${val[i5]}`; } else { headers[key] = val[i5]; } } } else { headers[key] = val; } } let stream; const { hostname, port } = client[kUrl]; headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ""}`; headers[HTTP2_HEADER_METHOD] = method; const abort = (err) => { if (request.aborted || request.completed) { return; } err = err || new RequestAbortedError(); util.errorRequest(client, request, err); if (stream != null) { util.destroy(stream, err); } util.destroy(body, err); client[kQueue][client[kRunningIdx]++] = null; client[kResume](); }; try { request.onConnect(abort); } catch (err) { util.errorRequest(client, request, err); } if (request.aborted) { return false; } if (method === "CONNECT") { session.ref(); stream = session.request(headers, { endStream: false, signal }); if (stream.id && !stream.pending) { request.onUpgrade(null, null, stream); ++session[kOpenStreams]; client[kQueue][client[kRunningIdx]++] = null; } else { stream.once("ready", () => { request.onUpgrade(null, null, stream); ++session[kOpenStreams]; client[kQueue][client[kRunningIdx]++] = null; }); } stream.once("close", () => { session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) session.unref(); }); return true; } headers[HTTP2_HEADER_PATH] = path3; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); } let contentLength = util.bodyLength(body); if (util.isFormDataLike(body)) { extractBody ??= require_body().extractBody; const [bodyStream, contentType] = extractBody(body); headers["content-type"] = contentType; body = bodyStream.stream; contentLength = bodyStream.length; } if (contentLength == null) { contentLength = request.contentLength; } if (contentLength === 0 || !expectsPayload) { contentLength = null; } if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) { if (client[kStrictContentLength]) { util.errorRequest(client, request, new RequestContentLengthMismatchError()); return false; } process.emitWarning(new RequestContentLengthMismatchError()); } if (contentLength != null) { assert4(body, "no body must not have content length"); headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`; } session.ref(); const shouldEndStream = method === "GET" || method === "HEAD" || body === null; if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = "100-continue"; stream = session.request(headers, { endStream: shouldEndStream, signal }); stream.once("continue", writeBodyH2); } else { stream = session.request(headers, { endStream: shouldEndStream, signal }); writeBodyH2(); } ++session[kOpenStreams]; stream.once("response", (headers2) => { const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers2; request.onResponseStarted(); if (request.aborted) { const err = new RequestAbortedError(); util.errorRequest(client, request, err); util.destroy(stream, err); return; } if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), "") === false) { stream.pause(); } stream.on("data", (chunk) => { if (request.onData(chunk) === false) { stream.pause(); } }); }); stream.once("end", () => { if (stream.state?.state == null || stream.state.state < 6) { request.onComplete([]); } if (session[kOpenStreams] === 0) { session.unref(); } abort(new InformationalError("HTTP/2: stream half-closed (remote)")); client[kQueue][client[kRunningIdx]++] = null; client[kPendingIdx] = client[kRunningIdx]; client[kResume](); }); stream.once("close", () => { session[kOpenStreams] -= 1; if (session[kOpenStreams] === 0) { session.unref(); } }); stream.once("error", function(err) { abort(err); }); stream.once("frameError", (type, code) => { abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)); }); return true; function writeBodyH2() { if (!body || contentLength === 0) { writeBuffer( abort, stream, null, client, request, client[kSocket], contentLength, expectsPayload ); } else if (util.isBuffer(body)) { writeBuffer( abort, stream, body, client, request, client[kSocket], contentLength, expectsPayload ); } else if (util.isBlobLike(body)) { if (typeof body.stream === "function") { writeIterable( abort, stream, body.stream(), client, request, client[kSocket], contentLength, expectsPayload ); } else { writeBlob( abort, stream, body, client, request, client[kSocket], contentLength, expectsPayload ); } } else if (util.isStream(body)) { writeStream( abort, client[kSocket], expectsPayload, stream, body, client, request, contentLength ); } else if (util.isIterable(body)) { writeIterable( abort, stream, body, client, request, client[kSocket], contentLength, expectsPayload ); } else { assert4(false); } } } function writeBuffer(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { try { if (body != null && util.isBuffer(body)) { assert4(contentLength === body.byteLength, "buffer body must have content length"); h2stream.cork(); h2stream.write(body); h2stream.uncork(); h2stream.end(); request.onBodySent(body); } if (!expectsPayload) { socket[kReset] = true; } request.onRequestSent(); client[kResume](); } catch (error3) { abort(error3); } } function writeStream(abort, socket, expectsPayload, h2stream, body, client, request, contentLength) { assert4(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); const pipe = pipeline( body, h2stream, (err) => { if (err) { util.destroy(pipe, err); abort(err); } else { util.removeAllListeners(pipe); request.onRequestSent(); if (!expectsPayload) { socket[kReset] = true; } client[kResume](); } } ); util.addListener(pipe, "data", onPipeData); function onPipeData(chunk) { request.onBodySent(chunk); } } async function writeBlob(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { assert4(contentLength === body.size, "blob body must have content length"); try { if (contentLength != null && contentLength !== body.size) { throw new RequestContentLengthMismatchError(); } const buffer = Buffer.from(await body.arrayBuffer()); h2stream.cork(); h2stream.write(buffer); h2stream.uncork(); h2stream.end(); request.onBodySent(buffer); request.onRequestSent(); if (!expectsPayload) { socket[kReset] = true; } client[kResume](); } catch (err) { abort(err); } } async function writeIterable(abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { assert4(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); let callback = null; function onDrain() { if (callback) { const cb = callback; callback = null; cb(); } } const waitForDrain = () => new Promise((resolve, reject) => { assert4(callback === null); if (socket[kError]) { reject(socket[kError]); } else { callback = resolve; } }); 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); request.onBodySent(chunk); if (!res) { await waitForDrain(); } } h2stream.end(); request.onRequestSent(); if (!expectsPayload) { socket[kReset] = true; } client[kResume](); } catch (err) { abort(err); } finally { h2stream.off("close", onDrain).off("drain", onDrain); } } module2.exports = connectH2; } }); // node_modules/undici/lib/handler/redirect-handler.js var require_redirect_handler = __commonJS({ "node_modules/undici/lib/handler/redirect-handler.js"(exports2, module2) { "use strict"; var util = require_util(); var { kBodyUsed } = require_symbols(); var assert4 = require("node:assert"); var { InvalidArgumentError } = require_errors(); var EE = require("node:events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; this[kBodyUsed] = false; } async *[Symbol.asyncIterator]() { assert4(!this[kBodyUsed], "disturbed"); this[kBodyUsed] = true; yield* this[kBody]; } }; var RedirectHandler = class { constructor(dispatch, maxRedirections, opts, handler) { if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { throw new InvalidArgumentError("maxRedirections must be a positive number"); } util.validateHandler(handler, opts.method, opts.upgrade); this.dispatch = dispatch; this.location = null; this.abort = null; this.opts = { ...opts, maxRedirections: 0 }; this.maxRedirections = maxRedirections; this.handler = handler; this.history = []; this.redirectionLimitReached = false; if (util.isStream(this.opts.body)) { if (util.bodyLength(this.opts.body) === 0) { this.opts.body.on("data", function() { assert4(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) && util.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(error3) { this.handler.onError(error3); } onHeaders(statusCode, headers, resume3, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) { if (this.request) { this.request.abort(new Error("max redirects")); } this.redirectionLimitReached = true; this.abort(new Error("max redirects")); return; } if (this.opts.origin) { this.history.push(new URL(this.opts.path, this.opts.origin)); } if (!this.location) { return this.handler.onHeaders(statusCode, headers, resume3, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); const path3 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); this.opts.path = path3; 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); } } }; function parseLocation(statusCode, headers) { if (redirectableStatusCodes.indexOf(statusCode) === -1) { return null; } for (let i5 = 0; i5 < headers.length; i5 += 2) { if (headers[i5].length === 8 && util.headerNameToString(headers[i5]) === "location") { return headers[i5 + 1]; } } } function shouldRemoveHeader(header, removeContent, unknownOrigin) { if (header.length === 4) { return util.headerNameToString(header) === "host"; } if (removeContent && util.headerNameToString(header).startsWith("content-")) { return true; } if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { const name = util.headerNameToString(header); return name === "authorization" || name === "cookie" || name === "proxy-authorization"; } return false; } 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 { assert4(headers == null, "headers must be an object or an array"); } return ret; } module2.exports = RedirectHandler; } }); // node_modules/undici/lib/interceptor/redirect-interceptor.js var require_redirect_interceptor = __commonJS({ "node_modules/undici/lib/interceptor/redirect-interceptor.js"(exports2, module2) { "use strict"; var RedirectHandler = require_redirect_handler(); function createRedirectInterceptor({ maxRedirections: defaultMaxRedirections }) { return (dispatch) => { return function Intercept(opts, handler) { const { maxRedirections = defaultMaxRedirections } = opts; if (!maxRedirections) { return dispatch(opts, handler); } const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler); opts = { ...opts, maxRedirections: 0 }; return dispatch(opts, redirectHandler); }; }; } module2.exports = createRedirectInterceptor; } }); // node_modules/undici/lib/dispatcher/client.js var require_client = __commonJS({ "node_modules/undici/lib/dispatcher/client.js"(exports2, module2) { "use strict"; var assert4 = require("node:assert"); var net11 = require("node:net"); var http6 = require("node:http"); var util = require_util(); var { channels } = require_diagnostics(); var Request2 = require_request(); var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, InformationalError, ClientDestroyedError } = require_errors(); var buildConnector = require_connect(); var { kUrl, kServerName, kClient, kBusy, kConnect, kResuming, kRunning, kPending, kSize, kQueue, kConnected, kConnecting, kNeedDrain, kKeepAliveDefaultTimeout, kHostHeader, kPendingIdx, kRunningIdx, kError, kPipelining, kKeepAliveTimeoutValue, kMaxHeadersSize, kKeepAliveMaxTimeout, kKeepAliveTimeoutThreshold, kHeadersTimeout, kBodyTimeout, kStrictContentLength, kConnector, kMaxRedirections, kMaxRequests, kCounter, kClose, kDestroy, kDispatch, kInterceptors, kLocalAddress, kMaxResponseSize, kOnError, kHTTPContext, kMaxConcurrentStreams, kResume } = require_symbols(); var connectH1 = require_client_h1(); var connectH2 = require_client_h2(); var deprecatedInterceptorWarned = false; var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var noop = () => { }; function getPipelining(client) { return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1; } var Client2 = class extends DispatcherBase { /** * * @param {string|URL} url * @param {import('../../types/client.js').Client.Options} options */ constructor(url, { interceptors, maxHeaderSize, headersTimeout, socketTimeout, requestTimeout, connectTimeout, bodyTimeout, idleTimeout, keepAlive, keepAliveTimeout, maxKeepAliveTimeout, keepAliveMaxTimeout, keepAliveTimeoutThreshold, socketPath, pipelining, tls: tls8, strictContentLength, maxCachedSessions, maxRedirections, connect: connect14, maxRequestsPerClient, localAddress, maxResponseSize, autoSelectFamily, autoSelectFamilyAttemptTimeout, // h2 maxConcurrentStreams, allowH2, webSocket } = {}) { super({ webSocket }); 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 (requestTimeout !== 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 (connect14 != null && typeof connect14 !== "function" && typeof connect14 !== "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" || net11.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 positive integer, greater than 0"); } if (typeof connect14 !== "function") { connect14 = buildConnector({ ...tls8, maxCachedSessions, allowH2, socketPath, timeout: connectTimeout, ...autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, ...connect14 }); } if (interceptors?.Client && Array.isArray(interceptors.Client)) { this[kInterceptors] = interceptors.Client; if (!deprecatedInterceptorWarned) { deprecatedInterceptorWarned = true; process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.", { code: "UNDICI-CLIENT-INTERCEPTOR-DEPRECATED" }); } } else { this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })]; } this[kUrl] = util.parseOrigin(url); this[kConnector] = connect14; this[kPipelining] = pipelining != null ? pipelining : 1; this[kMaxHeadersSize] = maxHeaderSize || http6.maxHeaderSize; this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout; this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout; this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : 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[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100; this[kHTTPContext] = null; this[kQueue] = []; this[kRunningIdx] = 0; this[kPendingIdx] = 0; this[kResume] = (sync) => resume3(this, sync); this[kOnError] = (err) => onError(this, err); } get pipelining() { return this[kPipelining]; } set pipelining(value) { this[kPipelining] = value; this[kResume](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[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed; } get [kBusy]() { return Boolean( this[kHTTPContext]?.busy(null) || this[kSize] >= (getPipelining(this) || 1) || this[kPending] > 0 ); } /* istanbul ignore: only used for test */ [kConnect](cb) { connect13(this); this.once("connect", cb); } [kDispatch](opts, handler) { const origin = opts.origin || this[kUrl].origin; const request = new Request2(origin, opts, handler); this[kQueue].push(request); if (this[kResuming]) { } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { this[kResuming] = 1; queueMicrotask(() => resume3(this)); } else { this[kResume](true); } if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { this[kNeedDrain] = 2; } return this[kNeedDrain] < 2; } async [kClose]() { return new Promise((resolve) => { if (this[kSize]) { this[kClosedResolve] = resolve; } else { resolve(null); } }); } async [kDestroy](err) { return new Promise((resolve) => { const requests = this[kQueue].splice(this[kPendingIdx]); for (let i5 = 0; i5 < requests.length; i5++) { const request = requests[i5]; util.errorRequest(this, request, err); } const callback = () => { if (this[kClosedResolve]) { this[kClosedResolve](); this[kClosedResolve] = null; } resolve(null); }; if (this[kHTTPContext]) { this[kHTTPContext].destroy(err, callback); this[kHTTPContext] = null; } else { queueMicrotask(callback); } this[kResume](); }); } }; var createRedirectInterceptor = require_redirect_interceptor(); function onError(client, err) { if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { assert4(client[kPendingIdx] === client[kRunningIdx]); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i5 = 0; i5 < requests.length; i5++) { const request = requests[i5]; util.errorRequest(client, request, err); } assert4(client[kSize] === 0); } } async function connect13(client) { assert4(!client[kConnecting]); assert4(!client[kHTTPContext]); let { host, hostname, protocol, port } = client[kUrl]; if (hostname[0] === "[") { const idx = hostname.indexOf("]"); assert4(idx !== -1); const ip2 = hostname.substring(1, idx); assert4(net11.isIP(ip2)); hostname = ip2; } client[kConnecting] = true; if (channels.beforeConnect.hasSubscribers) { channels.beforeConnect.publish({ connectParams: { host, hostname, protocol, port, version: client[kHTTPContext]?.version, servername: client[kServerName], localAddress: client[kLocalAddress] }, connector: client[kConnector] }); } try { const socket = await new Promise((resolve, reject) => { client[kConnector]({ host, hostname, protocol, port, servername: client[kServerName], localAddress: client[kLocalAddress] }, (err, socket2) => { if (err) { reject(err); } else { resolve(socket2); } }); }); if (client.destroyed) { util.destroy(socket.on("error", noop), new ClientDestroyedError()); return; } assert4(socket); try { client[kHTTPContext] = socket.alpnProtocol === "h2" ? await connectH2(client, socket) : await connectH1(client, socket); } catch (err) { socket.destroy().on("error", noop); throw err; } client[kConnecting] = false; socket[kCounter] = 0; socket[kMaxRequests] = client[kMaxRequests]; socket[kClient] = client; socket[kError] = null; if (channels.connected.hasSubscribers) { channels.connected.publish({ connectParams: { host, hostname, protocol, port, version: client[kHTTPContext]?.version, 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, protocol, port, version: client[kHTTPContext]?.version, servername: client[kServerName], localAddress: client[kLocalAddress] }, connector: client[kConnector], error: err }); } if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { assert4(client[kRunning] === 0); while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { const request = client[kQueue][client[kPendingIdx]++]; util.errorRequest(client, request, err); } } else { onError(client, err); } client.emit("connectionError", client[kUrl], [client], err); } client[kResume](); } function emitDrain(client) { client[kNeedDrain] = 0; client.emit("drain", client[kUrl], [client]); } function resume3(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; } } function _resume(client, sync) { while (true) { if (client.destroyed) { assert4(client[kPending] === 0); return; } if (client[kClosedResolve] && !client[kSize]) { client[kClosedResolve](); client[kClosedResolve] = null; return; } if (client[kHTTPContext]) { client[kHTTPContext].resume(); } if (client[kBusy]) { client[kNeedDrain] = 2; } else if (client[kNeedDrain] === 2) { if (sync) { client[kNeedDrain] = 1; queueMicrotask(() => emitDrain(client)); } else { emitDrain(client); } continue; } if (client[kPending] === 0) { return; } if (client[kRunning] >= (getPipelining(client) || 1)) { return; } const request = client[kQueue][client[kPendingIdx]]; if (client[kUrl].protocol === "https:" && client[kServerName] !== request.servername) { if (client[kRunning] > 0) { return; } client[kServerName] = request.servername; client[kHTTPContext]?.destroy(new InformationalError("servername changed"), () => { client[kHTTPContext] = null; resume3(client); }); } if (client[kConnecting]) { return; } if (!client[kHTTPContext]) { connect13(client); return; } if (client[kHTTPContext].destroyed) { return; } if (client[kHTTPContext].busy(request)) { return; } if (!request.aborted && client[kHTTPContext].write(request)) { client[kPendingIdx]++; } else { client[kQueue].splice(client[kPendingIdx], 1); } } } module2.exports = Client2; } }); // node_modules/undici/lib/dispatcher/fixed-queue.js var require_fixed_queue = __commonJS({ "node_modules/undici/lib/dispatcher/fixed-queue.js"(exports2, module2) { "use strict"; 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(data3) { this.list[this.top] = data3; 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; } }; module2.exports = class FixedQueue { constructor() { this.head = this.tail = new FixedCircularBuffer(); } isEmpty() { return this.head.isEmpty(); } push(data3) { if (this.head.isFull()) { this.head = this.head.next = new FixedCircularBuffer(); } this.head.push(data3); } shift() { const tail = this.tail; const next = tail.shift(); if (tail.isEmpty() && tail.next !== null) { this.tail = tail.next; } return next; } }; } }); // node_modules/undici/lib/dispatcher/pool-stats.js var require_pool_stats = __commonJS({ "node_modules/undici/lib/dispatcher/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); var kPool = /* @__PURE__ */ 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]; } }; module2.exports = PoolStats; } }); // node_modules/undici/lib/dispatcher/pool-base.js var require_pool_base = __commonJS({ "node_modules/undici/lib/dispatcher/pool-base.js"(exports2, module2) { "use strict"; 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 = /* @__PURE__ */ Symbol("clients"); var kNeedDrain = /* @__PURE__ */ Symbol("needDrain"); var kQueue = /* @__PURE__ */ Symbol("queue"); var kClosedResolve = /* @__PURE__ */ Symbol("closed resolve"); var kOnDrain = /* @__PURE__ */ Symbol("onDrain"); var kOnConnect = /* @__PURE__ */ Symbol("onConnect"); var kOnDisconnect = /* @__PURE__ */ Symbol("onDisconnect"); var kOnConnectionError = /* @__PURE__ */ Symbol("onConnectionError"); var kGetDispatcher = /* @__PURE__ */ Symbol("get dispatcher"); var kAddClient = /* @__PURE__ */ Symbol("add client"); var kRemoveClient = /* @__PURE__ */ Symbol("remove client"); var kStats = /* @__PURE__ */ Symbol("stats"); var PoolBase = class extends DispatcherBase { constructor(opts) { super(opts); this[kQueue] = new FixedQueue(); this[kClients] = []; this[kQueued] = 0; const pool = this; this[kOnDrain] = function onDrain(origin, targets) { const queue = pool[kQueue]; let needDrain = false; while (!needDrain) { const item = queue.shift(); if (!item) { break; } pool[kQueued]--; needDrain = !this.dispatch(item.opts, item.handler); } this[kNeedDrain] = needDrain; if (!this[kNeedDrain] && pool[kNeedDrain]) { pool[kNeedDrain] = false; pool.emit("drain", origin, [pool, ...targets]); } if (pool[kClosedResolve] && queue.isEmpty()) { Promise.all(pool[kClients].map((c5) => c5.close())).then(pool[kClosedResolve]); } }; this[kOnConnect] = (origin, targets) => { pool.emit("connect", origin, [pool, ...targets]); }; this[kOnDisconnect] = (origin, targets, err) => { pool.emit("disconnect", origin, [pool, ...targets], err); }; this[kOnConnectionError] = (origin, targets, err) => { pool.emit("connectionError", origin, [pool, ...targets], err); }; this[kStats] = new PoolStats(this); } get [kBusy]() { return this[kNeedDrain]; } get [kConnected]() { return this[kClients].filter((client) => client[kConnected]).length; } get [kFree]() { return this[kClients].filter((client) => client[kConnected] && !client[kNeedDrain]).length; } get [kPending]() { let ret = this[kQueued]; for (const { [kPending]: pending } of this[kClients]) { ret += pending; } return ret; } get [kRunning]() { let ret = 0; for (const { [kRunning]: running } of this[kClients]) { ret += running; } return ret; } get [kSize]() { let ret = this[kQueued]; for (const { [kSize]: size } of this[kClients]) { ret += size; } return ret; } get stats() { return this[kStats]; } async [kClose]() { if (this[kQueue].isEmpty()) { await Promise.all(this[kClients].map((c5) => c5.close())); } else { await new Promise((resolve) => { this[kClosedResolve] = resolve; }); } } async [kDestroy](err) { while (true) { const item = this[kQueue].shift(); if (!item) { break; } item.handler.onError(err); } await Promise.all(this[kClients].map((c5) => c5.destroy(err))); } [kDispatch](opts, handler) { const dispatcher = this[kGetDispatcher](); if (!dispatcher) { this[kNeedDrain] = true; this[kQueue].push({ opts, handler }); this[kQueued]++; } else if (!dispatcher.dispatch(opts, handler)) { dispatcher[kNeedDrain] = true; this[kNeedDrain] = !this[kGetDispatcher](); } return !this[kNeedDrain]; } [kAddClient](client) { client.on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]); this[kClients].push(client); if (this[kNeedDrain]) { queueMicrotask(() => { if (this[kNeedDrain]) { this[kOnDrain](client[kUrl], [this, client]); } }); } return this; } [kRemoveClient](client) { client.close(() => { const idx = this[kClients].indexOf(client); if (idx !== -1) { this[kClients].splice(idx, 1); } }); this[kNeedDrain] = this[kClients].some((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true); } }; module2.exports = { PoolBase, kClients, kNeedDrain, kAddClient, kRemoveClient, kGetDispatcher }; } }); // node_modules/undici/lib/dispatcher/pool.js var require_pool = __commonJS({ "node_modules/undici/lib/dispatcher/pool.js"(exports2, module2) { "use strict"; var { PoolBase, kClients, kNeedDrain, kAddClient, kGetDispatcher } = require_pool_base(); var Client2 = require_client(); var { InvalidArgumentError } = require_errors(); var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); var kOptions = /* @__PURE__ */ Symbol("options"); var kConnections = /* @__PURE__ */ Symbol("connections"); var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client2(origin, opts); } var Pool = class extends PoolBase { constructor(origin, { connections, factory = defaultFactory, connect: connect13, connectTimeout, tls: tls8, maxCachedSessions, socketPath, autoSelectFamily, autoSelectFamilyAttemptTimeout, allowH2, ...options } = {}) { if (connections != null && (!Number.isFinite(connections) || connections < 0)) { throw new InvalidArgumentError("invalid connections"); } if (typeof factory !== "function") { throw new InvalidArgumentError("factory must be a function."); } if (connect13 != null && typeof connect13 !== "function" && typeof connect13 !== "object") { throw new InvalidArgumentError("connect must be a function or an object"); } if (typeof connect13 !== "function") { connect13 = buildConnector({ ...tls8, maxCachedSessions, allowH2, socketPath, timeout: connectTimeout, ...autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, ...connect13 }); } super(options); this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : []; this[kConnections] = connections || null; this[kUrl] = util.parseOrigin(origin); this[kOptions] = { ...util.deepClone(options), connect: connect13, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { this[kClients].splice(idx, 1); } } }); } [kGetDispatcher]() { for (const client of this[kClients]) { if (!client[kNeedDrain]) { return client; } } if (!this[kConnections] || this[kClients].length < this[kConnections]) { const dispatcher = this[kFactory](this[kUrl], this[kOptions]); this[kAddClient](dispatcher); return dispatcher; } } }; module2.exports = Pool; } }); // node_modules/undici/lib/dispatcher/balanced-pool.js var require_balanced_pool = __commonJS({ "node_modules/undici/lib/dispatcher/balanced-pool.js"(exports2, module2) { "use strict"; 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 = /* @__PURE__ */ Symbol("factory"); var kOptions = /* @__PURE__ */ Symbol("options"); var kGreatestCommonDivisor = /* @__PURE__ */ Symbol("kGreatestCommonDivisor"); var kCurrentWeight = /* @__PURE__ */ Symbol("kCurrentWeight"); var kIndex = /* @__PURE__ */ Symbol("kIndex"); var kWeight = /* @__PURE__ */ Symbol("kWeight"); var kMaxWeightPerServer = /* @__PURE__ */ Symbol("kMaxWeightPerServer"); var kErrorPenalty = /* @__PURE__ */ Symbol("kErrorPenalty"); function getGreatestCommonDivisor(a5, b6) { if (a5 === 0) return b6; while (b6 !== 0) { const t = b6; b6 = a5 % b6; a5 = t; } return a5; } function defaultFactory(origin, opts) { return new Pool(origin, opts); } 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?.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() { let result = 0; for (let i5 = 0; i5 < this[kClients].length; i5++) { result = getGreatestCommonDivisor(this[kClients][i5][kWeight], result); } this[kGreatestCommonDivisor] = result; } 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((p2) => p2[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]; } }; module2.exports = BalancedPool; } }); // node_modules/undici/lib/dispatcher/agent.js var require_agent = __commonJS({ "node_modules/undici/lib/dispatcher/agent.js"(exports2, module2) { "use strict"; 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 util = require_util(); var createRedirectInterceptor = require_redirect_interceptor(); var kOnConnect = /* @__PURE__ */ Symbol("onConnect"); var kOnDisconnect = /* @__PURE__ */ Symbol("onDisconnect"); var kOnConnectionError = /* @__PURE__ */ Symbol("onConnectionError"); var kMaxRedirections = /* @__PURE__ */ Symbol("maxRedirections"); var kOnDrain = /* @__PURE__ */ Symbol("onDrain"); var kFactory = /* @__PURE__ */ Symbol("factory"); var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client2(origin, opts) : new Pool(origin, opts); } var Agent9 = class extends DispatcherBase { constructor({ factory = defaultFactory, maxRedirections = 0, connect: connect13, ...options } = {}) { if (typeof factory !== "function") { throw new InvalidArgumentError("factory must be a function."); } if (connect13 != null && typeof connect13 !== "function" && typeof connect13 !== "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"); } super(options); if (connect13 && typeof connect13 !== "function") { connect13 = { ...connect13 }; } this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })]; this[kOptions] = { ...util.deepClone(options), connect: connect13 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kMaxRedirections] = maxRedirections; this[kFactory] = factory; this[kClients] = /* @__PURE__ */ new Map(); this[kOnDrain] = (origin, targets) => { this.emit("drain", origin, [this, ...targets]); }; this[kOnConnect] = (origin, targets) => { this.emit("connect", origin, [this, ...targets]); }; this[kOnDisconnect] = (origin, targets, err) => { this.emit("disconnect", origin, [this, ...targets], err); }; this[kOnConnectionError] = (origin, targets, err) => { this.emit("connectionError", origin, [this, ...targets], err); }; } get [kRunning]() { let ret = 0; for (const client of this[kClients].values()) { ret += client[kRunning]; } return ret; } [kDispatch](opts, handler) { 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."); } let dispatcher = this[kClients].get(key); 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, dispatcher); } return dispatcher.dispatch(opts, handler); } async [kClose]() { const closePromises = []; for (const client of this[kClients].values()) { closePromises.push(client.close()); } this[kClients].clear(); await Promise.all(closePromises); } async [kDestroy](err) { const destroyPromises = []; for (const client of this[kClients].values()) { destroyPromises.push(client.destroy(err)); } this[kClients].clear(); await Promise.all(destroyPromises); } }; module2.exports = Agent9; } }); // node_modules/undici/lib/dispatcher/proxy-agent.js var require_proxy_agent = __commonJS({ "node_modules/undici/lib/dispatcher/proxy-agent.js"(exports2, module2) { "use strict"; var { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols(); var { URL: URL10 } = require("node:url"); var Agent9 = require_agent(); var Pool = require_pool(); var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors(); var buildConnector = require_connect(); var Client2 = require_client(); var kAgent = /* @__PURE__ */ Symbol("proxy agent"); var kClient = /* @__PURE__ */ Symbol("proxy client"); var kProxyHeaders = /* @__PURE__ */ Symbol("proxy headers"); var kRequestTls = /* @__PURE__ */ Symbol("request tls settings"); var kProxyTls = /* @__PURE__ */ Symbol("proxy tls settings"); var kConnectEndpoint = /* @__PURE__ */ Symbol("connect endpoint function"); var kTunnelProxy = /* @__PURE__ */ Symbol("tunnel proxy"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } function defaultFactory(origin, opts) { return new Pool(origin, opts); } var noop = () => { }; function defaultAgentFactory(origin, opts) { if (opts.connections === 1) { return new Client2(origin, opts); } return new Pool(origin, opts); } var Http1ProxyWrapper = class extends DispatcherBase { #client; constructor(proxyUrl, { headers = {}, connect: connect13, factory }) { super(); if (!proxyUrl) { throw new InvalidArgumentError("Proxy URL is mandatory"); } this[kProxyHeaders] = headers; if (factory) { this.#client = factory(proxyUrl, { connect: connect13 }); } else { this.#client = new Client2(proxyUrl, { connect: connect13 }); } } [kDispatch](opts, handler) { const onHeaders = handler.onHeaders; handler.onHeaders = function(statusCode, data3, resume3) { if (statusCode === 407) { if (typeof handler.onError === "function") { handler.onError(new InvalidArgumentError("Proxy Authentication Required (407)")); } return; } if (onHeaders) onHeaders.call(this, statusCode, data3, resume3); }; const { origin, path: path3 = "/", headers = {} } = opts; opts.path = origin + path3; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL10(origin); headers.host = host; } opts.headers = { ...this[kProxyHeaders], ...headers }; return this.#client[kDispatch](opts, handler); } async [kClose]() { return this.#client.close(); } async [kDestroy](err) { return this.#client.destroy(err); } }; var ProxyAgent3 = class extends DispatcherBase { constructor(opts) { super(); if (!opts || typeof opts === "object" && !(opts instanceof URL10) && !opts.uri) { throw new InvalidArgumentError("Proxy uri is mandatory"); } const { clientFactory = defaultFactory } = opts; if (typeof clientFactory !== "function") { throw new InvalidArgumentError("Proxy opts.clientFactory must be a function."); } const { proxyTunnel = true } = opts; const url = this.#getUrl(opts); const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url; this[kProxy] = { uri: href, protocol }; this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) ? opts.interceptors.ProxyAgent : []; this[kRequestTls] = opts.requestTls; this[kProxyTls] = opts.proxyTls; this[kProxyHeaders] = opts.headers || {}; this[kTunnelProxy] = proxyTunnel; 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 connect13 = buildConnector({ ...opts.proxyTls }); this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }); const agentFactory = opts.factory || defaultAgentFactory; const factory = (origin2, options) => { const { protocol: protocol2 } = new URL10(origin2); if (!this[kTunnelProxy] && protocol2 === "http:" && this[kProxy].protocol === "http:") { return new Http1ProxyWrapper(this[kProxy].uri, { headers: this[kProxyHeaders], connect: connect13, factory: agentFactory }); } return agentFactory(origin2, options); }; this[kClient] = clientFactory(url, { connect: connect13 }); this[kAgent] = new Agent9({ ...opts, factory, connect: async (opts2, callback) => { let requestedPath = opts2.host; if (!opts2.port) { requestedPath += `:${defaultProtocolPort(opts2.protocol)}`; } try { const { socket, statusCode } = await this[kClient].connect({ origin, port, path: requestedPath, signal: opts2.signal, headers: { ...this[kProxyHeaders], host: opts2.host }, servername: this[kProxyTls]?.servername || proxyHostname }); if (statusCode !== 200) { socket.on("error", noop).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) { if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { callback(new SecureProxyConnectionError(err)); } else { callback(err); } } } }); } dispatch(opts, handler) { const headers = buildHeaders(opts.headers); throwIfProxyAuthIsSent(headers); if (headers && !("host" in headers) && !("Host" in headers)) { const { host } = new URL10(opts.origin); headers.host = host; } return this[kAgent].dispatch( { ...opts, headers }, handler ); } /** * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts * @returns {URL} */ #getUrl(opts) { if (typeof opts === "string") { return new URL10(opts); } else if (opts instanceof URL10) { return opts; } else { return new URL10(opts.uri); } } async [kClose]() { await this[kAgent].close(); await this[kClient].close(); } async [kDestroy]() { await this[kAgent].destroy(); await this[kClient].destroy(); } }; 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; } 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"); } } module2.exports = ProxyAgent3; } }); // node_modules/undici/lib/dispatcher/env-http-proxy-agent.js var require_env_http_proxy_agent = __commonJS({ "node_modules/undici/lib/dispatcher/env-http-proxy-agent.js"(exports2, module2) { "use strict"; var DispatcherBase = require_dispatcher_base(); var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols(); var ProxyAgent3 = require_proxy_agent(); var Agent9 = require_agent(); var DEFAULT_PORTS3 = { "http:": 80, "https:": 443 }; var experimentalWarned = false; var EnvHttpProxyAgent = class extends DispatcherBase { #noProxyValue = null; #noProxyEntries = null; #opts = null; constructor(opts = {}) { super(); this.#opts = opts; if (!experimentalWarned) { experimentalWarned = true; process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.", { code: "UNDICI-EHPA" }); } const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts; this[kNoProxyAgent] = new Agent9(agentOpts); const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY; if (HTTP_PROXY) { this[kHttpProxyAgent] = new ProxyAgent3({ ...agentOpts, uri: HTTP_PROXY }); } else { this[kHttpProxyAgent] = this[kNoProxyAgent]; } const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY; if (HTTPS_PROXY) { this[kHttpsProxyAgent] = new ProxyAgent3({ ...agentOpts, uri: HTTPS_PROXY }); } else { this[kHttpsProxyAgent] = this[kHttpProxyAgent]; } this.#parseNoProxy(); } [kDispatch](opts, handler) { const url = new URL(opts.origin); const agent = this.#getProxyAgentForUrl(url); return agent.dispatch(opts, handler); } async [kClose]() { await this[kNoProxyAgent].close(); if (!this[kHttpProxyAgent][kClosed]) { await this[kHttpProxyAgent].close(); } if (!this[kHttpsProxyAgent][kClosed]) { await this[kHttpsProxyAgent].close(); } } async [kDestroy](err) { await this[kNoProxyAgent].destroy(err); if (!this[kHttpProxyAgent][kDestroyed]) { await this[kHttpProxyAgent].destroy(err); } if (!this[kHttpsProxyAgent][kDestroyed]) { await this[kHttpsProxyAgent].destroy(err); } } #getProxyAgentForUrl(url) { let { protocol, host: hostname, port } = url; hostname = hostname.replace(/:\d*$/, "").toLowerCase(); port = Number.parseInt(port, 10) || DEFAULT_PORTS3[protocol] || 0; if (!this.#shouldProxy(hostname, port)) { return this[kNoProxyAgent]; } if (protocol === "https:") { return this[kHttpsProxyAgent]; } return this[kHttpProxyAgent]; } #shouldProxy(hostname, port) { if (this.#noProxyChanged) { this.#parseNoProxy(); } if (this.#noProxyEntries.length === 0) { return true; } if (this.#noProxyValue === "*") { return false; } for (let i5 = 0; i5 < this.#noProxyEntries.length; i5++) { const entry = this.#noProxyEntries[i5]; if (entry.port && entry.port !== port) { continue; } if (!/^[.*]/.test(entry.hostname)) { if (hostname === entry.hostname) { return false; } } else { if (hostname.endsWith(entry.hostname.replace(/^\*/, ""))) { return false; } } } return true; } #parseNoProxy() { const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv; const noProxySplit = noProxyValue.split(/[,\s]/); const noProxyEntries = []; for (let i5 = 0; i5 < noProxySplit.length; i5++) { const entry = noProxySplit[i5]; if (!entry) { continue; } const parsed = entry.match(/^(.+):(\d+)$/); noProxyEntries.push({ hostname: (parsed ? parsed[1] : entry).toLowerCase(), port: parsed ? Number.parseInt(parsed[2], 10) : 0 }); } this.#noProxyValue = noProxyValue; this.#noProxyEntries = noProxyEntries; } get #noProxyChanged() { if (this.#opts.noProxy !== void 0) { return false; } return this.#noProxyValue !== this.#noProxyEnv; } get #noProxyEnv() { return process.env.no_proxy ?? process.env.NO_PROXY ?? ""; } }; module2.exports = EnvHttpProxyAgent; } }); // node_modules/undici/lib/handler/retry-handler.js var require_retry_handler = __commonJS({ "node_modules/undici/lib/handler/retry-handler.js"(exports2, module2) { "use strict"; var assert4 = require("node:assert"); var { kRetryHandlerDefaultRetry } = require_symbols(); var { RequestRetryError } = require_errors(); var { isDisturbed, parseHeaders, parseRangeHeader, wrapRequestBody } = require_util(); function calculateRetryAfterHeader(retryAfter) { const current = Date.now(); return new Date(retryAfter).getTime() - current; } var RetryHandler = class _RetryHandler { constructor(opts, handlers) { const { retryOptions, ...dispatchOpts } = opts; const { // Retry scoped retry: retryFn, maxRetries, maxTimeout, minTimeout, timeoutFactor, // Response scoped methods, errorCodes, retryAfter, statusCodes } = retryOptions ?? {}; this.dispatch = handlers.dispatch; this.handler = handlers.handler; this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) }; this.abort = null; this.aborted = false; this.retryOpts = { retry: retryFn ?? _RetryHandler[kRetryHandlerDefaultRetry], retryAfter: retryAfter ?? true, maxTimeout: maxTimeout ?? 30 * 1e3, // 30s, minTimeout: 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", "UND_ERR_SOCKET" ] }; this.retryCount = 0; this.retryCountCheckpoint = 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 }, cb) { const { statusCode, code, headers } = err; const { method, retryOptions } = opts; const { maxRetries, minTimeout, maxTimeout, timeoutFactor, statusCodes, errorCodes, methods } = retryOptions; const { counter } = state2; if (code && code !== "UND_ERR_REQ_RETRY" && !errorCodes.includes(code)) { cb(err); return; } if (Array.isArray(methods) && !methods.includes(method)) { cb(err); return; } if (statusCode != null && Array.isArray(statusCodes) && !statusCodes.includes(statusCode)) { cb(err); return; } if (counter > maxRetries) { cb(err); return; } let retryAfterHeader = headers?.["retry-after"]; if (retryAfterHeader) { retryAfterHeader = Number(retryAfterHeader); retryAfterHeader = Number.isNaN(retryAfterHeader) ? calculateRetryAfterHeader(retryAfterHeader) : retryAfterHeader * 1e3; } const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout); setTimeout(() => cb(null), retryTimeout); } onHeaders(statusCode, rawHeaders, resume3, statusMessage) { const headers = parseHeaders(rawHeaders); this.retryCount += 1; if (statusCode >= 300) { if (this.retryOpts.statusCodes.includes(statusCode) === false) { return this.handler.onHeaders( statusCode, rawHeaders, resume3, statusMessage ); } else { this.abort( new RequestRetryError("Request failed", statusCode, { headers, data: { count: this.retryCount } }) ); return false; } } if (this.resume != null) { this.resume = null; if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) { this.abort( new RequestRetryError("server does not support the range header and the payload was partially consumed", statusCode, { headers, data: { count: this.retryCount } }) ); return false; } const contentRange = parseRangeHeader(headers["content-range"]); if (!contentRange) { this.abort( new RequestRetryError("Content-Range mismatch", statusCode, { headers, data: { count: this.retryCount } }) ); return false; } if (this.etag != null && this.etag !== headers.etag) { this.abort( new RequestRetryError("ETag mismatch", statusCode, { headers, data: { count: this.retryCount } }) ); return false; } const { start, size, end = size - 1 } = contentRange; assert4(this.start === start, "content-range mismatch"); assert4(this.end == null || this.end === end, "content-range mismatch"); this.resume = resume3; return true; } if (this.end == null) { if (statusCode === 206) { const range2 = parseRangeHeader(headers["content-range"]); if (range2 == null) { return this.handler.onHeaders( statusCode, rawHeaders, resume3, statusMessage ); } const { start, size, end = size - 1 } = range2; assert4( start != null && Number.isFinite(start), "content-range mismatch" ); assert4(end != null && Number.isFinite(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) - 1 : null; } assert4(Number.isFinite(this.start)); assert4( this.end == null || Number.isFinite(this.end), "invalid content-length" ); this.resume = resume3; this.etag = headers.etag != null ? headers.etag : null; if (this.etag != null && this.etag.startsWith("W/")) { this.etag = null; } return this.handler.onHeaders( statusCode, rawHeaders, resume3, statusMessage ); } const err = new RequestRetryError("Request failed", statusCode, { headers, data: { 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); } if (this.retryCount - this.retryCountCheckpoint > 0) { this.retryCount = this.retryCountCheckpoint + (this.retryCount - this.retryCountCheckpoint); } else { this.retryCount += 1; } this.retryOpts.retry( err, { state: { counter: this.retryCount }, 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) { const headers = { range: `bytes=${this.start}-${this.end ?? ""}` }; if (this.etag != null) { headers["if-match"] = this.etag; } this.opts = { ...this.opts, headers: { ...this.opts.headers, ...headers } }; } try { this.retryCountCheckpoint = this.retryCount; this.dispatch(this.opts, this); } catch (err3) { this.handler.onError(err3); } } } }; module2.exports = RetryHandler; } }); // node_modules/undici/lib/dispatcher/retry-agent.js var require_retry_agent = __commonJS({ "node_modules/undici/lib/dispatcher/retry-agent.js"(exports2, module2) { "use strict"; var Dispatcher = require_dispatcher(); var RetryHandler = require_retry_handler(); var RetryAgent = class extends Dispatcher { #agent = null; #options = null; constructor(agent, options = {}) { super(options); this.#agent = agent; this.#options = options; } dispatch(opts, handler) { const retry = new RetryHandler({ ...opts, retryOptions: this.#options }, { dispatch: this.#agent.dispatch.bind(this.#agent), handler }); return this.#agent.dispatch(opts, retry); } close() { return this.#agent.close(); } destroy() { return this.#agent.destroy(); } }; module2.exports = RetryAgent; } }); // node_modules/undici/lib/api/readable.js var require_readable = __commonJS({ "node_modules/undici/lib/api/readable.js"(exports2, module2) { "use strict"; var assert4 = require("node:assert"); var { Readable: Readable2 } = require("node:stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require_errors(); var util = require_util(); var { ReadableStreamFrom } = require_util(); var kConsume = /* @__PURE__ */ Symbol("kConsume"); var kReading = /* @__PURE__ */ Symbol("kReading"); var kBody = /* @__PURE__ */ Symbol("kBody"); var kAbort = /* @__PURE__ */ Symbol("kAbort"); var kContentType = /* @__PURE__ */ Symbol("kContentType"); var kContentLength = /* @__PURE__ */ Symbol("kContentLength"); var noop = () => { }; var BodyReadable = class extends Readable2 { constructor({ resume: resume3, abort, contentType = "", contentLength, highWaterMark = 64 * 1024 // Same as nodejs fs streams. }) { super({ autoDestroy: true, read: resume3, highWaterMark }); this._readableState.dataEmitted = false; this[kAbort] = abort; this[kConsume] = null; this[kBody] = null; this[kContentType] = contentType; this[kContentLength] = contentLength; this[kReading] = false; } destroy(err) { if (!err && !this._readableState.endEmitted) { err = new RequestAbortedError(); } if (err) { this[kAbort](); } return super.destroy(err); } _destroy(err, callback) { if (!this[kReading]) { setImmediate(() => { callback(err); }); } else { callback(err); } } 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) { 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-bytes async bytes() { return consume(this, "bytes"); } // 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 util.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(); assert4(this[kBody].locked); } } return this[kBody]; } async dump(opts) { let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024; const signal = opts?.signal; if (signal != null && (typeof signal !== "object" || !("aborted" in signal))) { throw new InvalidArgumentError("signal must be an AbortSignal"); } signal?.throwIfAborted(); if (this._readableState.closeEmitted) { return null; } return await new Promise((resolve, reject) => { if (this[kContentLength] > limit) { this.destroy(new AbortError()); } const onAbort = () => { this.destroy(signal.reason ?? new AbortError()); }; signal?.addEventListener("abort", onAbort); this.on("close", function() { signal?.removeEventListener("abort", onAbort); if (signal?.aborted) { reject(signal.reason ?? new AbortError()); } else { resolve(null); } }).on("error", noop).on("data", function(chunk) { limit -= chunk.length; if (limit <= 0) { this.destroy(); } }).resume(); }); } }; function isLocked(self) { return self[kBody] && self[kBody].locked === true || self[kConsume]; } function isUnusable(self) { return util.isDisturbed(self) || isLocked(self); } async function consume(stream, type) { assert4(!stream[kConsume]); return new Promise((resolve, reject) => { if (isUnusable(stream)) { const rState = stream._readableState; if (rState.destroyed && rState.closeEmitted === false) { stream.on("error", (err) => { reject(err); }).on("close", () => { reject(new TypeError("unusable")); }); } else { reject(rState.errored ?? new TypeError("unusable")); } } else { queueMicrotask(() => { stream[kConsume] = { type, stream, resolve, reject, length: 0, body: [] }; stream.on("error", function(err) { consumeFinish(this[kConsume], err); }).on("close", function() { if (this[kConsume].body !== null) { consumeFinish(this[kConsume], new RequestAbortedError()); } }); consumeStart(stream[kConsume]); }); } }); } function consumeStart(consume2) { if (consume2.body === null) { return; } const { _readableState: state2 } = consume2.stream; if (state2.bufferIndex) { const start = state2.bufferIndex; const end = state2.buffer.length; for (let n3 = start; n3 < end; n3++) { consumePush(consume2, state2.buffer[n3]); } } else { 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) { } } function chunksDecode(chunks, length) { if (chunks.length === 0 || length === 0) { return ""; } const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length); const bufferLength = buffer.length; const start = bufferLength > 2 && buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191 ? 3 : 0; return buffer.utf8Slice(start, bufferLength); } function chunksConcat(chunks, length) { if (chunks.length === 0 || length === 0) { return new Uint8Array(0); } if (chunks.length === 1) { return new Uint8Array(chunks[0]); } const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer); let offset = 0; for (let i5 = 0; i5 < chunks.length; ++i5) { const chunk = chunks[i5]; buffer.set(chunk, offset); offset += chunk.length; } return buffer; } function consumeEnd(consume2) { const { type, body, resolve, stream, length } = consume2; try { if (type === "text") { resolve(chunksDecode(body, length)); } else if (type === "json") { resolve(JSON.parse(chunksDecode(body, length))); } else if (type === "arrayBuffer") { resolve(chunksConcat(body, length).buffer); } else if (type === "blob") { resolve(new Blob(body, { type: stream[kContentType] })); } else if (type === "bytes") { resolve(chunksConcat(body, length)); } consumeFinish(consume2); } catch (err) { stream.destroy(err); } } function consumePush(consume2, chunk) { consume2.length += chunk.length; consume2.body.push(chunk); } 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; } module2.exports = { Readable: BodyReadable, chunksDecode }; } }); // node_modules/undici/lib/api/util.js var require_util3 = __commonJS({ "node_modules/undici/lib/api/util.js"(exports2, module2) { var assert4 = require("node:assert"); var { ResponseStatusCodeError } = require_errors(); var { chunksDecode } = require_readable(); var CHUNK_LIMIT = 128 * 1024; async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) { assert4(body); let chunks = []; let length = 0; try { for await (const chunk of body) { chunks.push(chunk); length += chunk.length; if (length > CHUNK_LIMIT) { chunks = []; length = 0; break; } } } catch { chunks = []; length = 0; } const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ""}`; if (statusCode === 204 || !contentType || !length) { queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers))); return; } const stackTraceLimit = Error.stackTraceLimit; Error.stackTraceLimit = 0; let payload2; try { if (isContentTypeApplicationJson(contentType)) { payload2 = JSON.parse(chunksDecode(chunks, length)); } else if (isContentTypeText(contentType)) { payload2 = chunksDecode(chunks, length); } } catch { } finally { Error.stackTraceLimit = stackTraceLimit; } queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload2))); } var isContentTypeApplicationJson = (contentType) => { return contentType.length > 15 && contentType[11] === "/" && contentType[0] === "a" && contentType[1] === "p" && contentType[2] === "p" && contentType[3] === "l" && contentType[4] === "i" && contentType[5] === "c" && contentType[6] === "a" && contentType[7] === "t" && contentType[8] === "i" && contentType[9] === "o" && contentType[10] === "n" && contentType[12] === "j" && contentType[13] === "s" && contentType[14] === "o" && contentType[15] === "n"; }; var isContentTypeText = (contentType) => { return contentType.length > 4 && contentType[4] === "/" && contentType[0] === "t" && contentType[1] === "e" && contentType[2] === "x" && contentType[3] === "t"; }; module2.exports = { getResolveErrorBodyCallback, isContentTypeApplicationJson, isContentTypeText }; } }); // node_modules/undici/lib/api/api-request.js var require_api_request = __commonJS({ "node_modules/undici/lib/api/api-request.js"(exports2, module2) { "use strict"; var assert4 = require("node:assert"); var { Readable: Readable2 } = require_readable(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var util = require_util(); var { getResolveErrorBodyCallback } = require_util3(); var { AsyncResource } = require("node:async_hooks"); var RequestHandler5 = 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 (util.isStream(body)) { util.destroy(body.on("error", util.nop), err); } throw err; } this.method = method; this.responseHeaders = responseHeaders || null; this.opaque = opaque || null; this.callback = callback; this.res = null; this.abort = null; this.body = body; this.trailers = {}; this.context = null; this.onInfo = onInfo || null; this.throwOnError = throwOnError; this.highWaterMark = highWaterMark; this.signal = signal; this.reason = null; this.removeAbortListener = null; if (util.isStream(body)) { body.on("error", (err) => { this.onError(err); }); } if (this.signal) { if (this.signal.aborted) { this.reason = this.signal.reason ?? new RequestAbortedError(); } else { this.removeAbortListener = util.addAbortListener(this.signal, () => { this.reason = this.signal.reason ?? new RequestAbortedError(); if (this.res) { util.destroy(this.res.on("error", util.nop), this.reason); } else if (this.abort) { this.abort(this.reason); } if (this.removeAbortListener) { this.res?.off("close", this.removeAbortListener); this.removeAbortListener(); this.removeAbortListener = null; } }); } } } onConnect(abort, context) { if (this.reason) { abort(this.reason); return; } assert4(this.callback); this.abort = abort; this.context = context; } onHeaders(statusCode, rawHeaders, resume3, statusMessage) { const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); } return; } const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; const contentLength = parsedHeaders["content-length"]; const res = new Readable2({ resume: resume3, abort, contentType, contentLength: this.method !== "HEAD" && contentLength ? Number(contentLength) : null, highWaterMark }); if (this.removeAbortListener) { res.on("close", this.removeAbortListener); } this.callback = null; this.res = res; if (callback !== null) { if (this.throwOnError && statusCode >= 400) { this.runInAsyncScope( getResolveErrorBodyCallback, null, { callback, body: res, contentType, statusCode, statusMessage, headers } ); } else { this.runInAsyncScope(callback, null, null, { statusCode, headers, trailers: this.trailers, opaque, body: res, context }); } } } onData(chunk) { return this.res.push(chunk); } onComplete(trailers) { util.parseHeaders(trailers, this.trailers); this.res.push(null); } onError(err) { const { res, callback, body, opaque } = this; if (callback) { this.callback = null; queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }); }); } if (res) { this.res = null; queueMicrotask(() => { util.destroy(res, err); }); } if (body) { this.body = null; util.destroy(body, err); } if (this.removeAbortListener) { res?.off("close", this.removeAbortListener); this.removeAbortListener(); this.removeAbortListener = null; } } }; function request(opts, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { request.call(this, opts, (err, data3) => { return err ? reject(err) : resolve(data3); }); }); } try { this.dispatch(opts, new RequestHandler5(opts, callback)); } catch (err) { if (typeof callback !== "function") { throw err; } const opaque = opts?.opaque; queueMicrotask(() => callback(err, { opaque })); } } module2.exports = request; module2.exports.RequestHandler = RequestHandler5; } }); // node_modules/undici/lib/api/abort-signal.js var require_abort_signal = __commonJS({ "node_modules/undici/lib/api/abort-signal.js"(exports2, module2) { var { addAbortListener } = require_util(); var { RequestAbortedError } = require_errors(); var kListener = /* @__PURE__ */ Symbol("kListener"); var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self) { if (self.abort) { self.abort(self[kSignal]?.reason); } else { self.reason = self[kSignal]?.reason ?? new RequestAbortedError(); } removeSignal(self); } function addSignal(self, signal) { self.reason = null; self[kSignal] = null; self[kListener] = null; if (!signal) { return; } if (signal.aborted) { abort(self); return; } self[kSignal] = signal; self[kListener] = () => { abort(self); }; addAbortListener(self[kSignal], self[kListener]); } function removeSignal(self) { if (!self[kSignal]) { return; } if ("removeEventListener" in self[kSignal]) { self[kSignal].removeEventListener("abort", self[kListener]); } else { self[kSignal].removeListener("abort", self[kListener]); } self[kSignal] = null; self[kListener] = null; } module2.exports = { addSignal, removeSignal }; } }); // node_modules/undici/lib/api/api-stream.js var require_api_stream = __commonJS({ "node_modules/undici/lib/api/api-stream.js"(exports2, module2) { "use strict"; var assert4 = require("node:assert"); var { finished, PassThrough: PassThrough2 } = require("node:stream"); var { InvalidArgumentError, InvalidReturnValueError } = require_errors(); var util = require_util(); var { getResolveErrorBodyCallback } = require_util3(); var { AsyncResource } = require("node: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 (util.isStream(body)) { util.destroy(body.on("error", util.nop), err); } throw err; } this.responseHeaders = responseHeaders || null; this.opaque = opaque || null; this.factory = factory; this.callback = callback; this.res = null; this.abort = null; this.context = null; this.trailers = null; this.body = body; this.onInfo = onInfo || null; this.throwOnError = throwOnError || false; if (util.isStream(body)) { body.on("error", (err) => { this.onError(err); }); } addSignal(this, signal); } onConnect(abort, context) { if (this.reason) { abort(this.reason); return; } assert4(this.callback); this.abort = abort; this.context = context; } onHeaders(statusCode, rawHeaders, resume3, statusMessage) { const { factory, opaque, context, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); } return; } this.factory = null; let res; if (this.throwOnError && statusCode >= 400) { const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; res = new PassThrough2(); this.callback = null; this.runInAsyncScope( getResolveErrorBodyCallback, null, { callback, body: res, contentType, statusCode, statusMessage, headers } ); } else { if (factory === null) { return; } res = this.runInAsyncScope(factory, null, { statusCode, headers, opaque, context }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); } finished(res, { readable: false }, (err) => { const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this; this.res = null; if (err || !res2.readable) { util.destroy(res2, err); } this.callback = null; this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers }); if (err) { abort(); } }); } res.on("drain", resume3); this.res = res; const needDrain = res.writableNeedDrain !== void 0 ? res.writableNeedDrain : res._writableState?.needDrain; return needDrain !== true; } onData(chunk) { const { res } = this; return res ? res.write(chunk) : true; } onComplete(trailers) { const { res } = this; removeSignal(this); if (!res) { return; } this.trailers = util.parseHeaders(trailers); res.end(); } onError(err) { const { res, callback, opaque, body } = this; removeSignal(this); this.factory = null; if (res) { this.res = null; util.destroy(res, err); } else if (callback) { this.callback = null; queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }); }); } if (body) { this.body = null; util.destroy(body, err); } } }; function stream(opts, factory, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { stream.call(this, opts, factory, (err, data3) => { return err ? reject(err) : resolve(data3); }); }); } try { this.dispatch(opts, new StreamHandler(opts, factory, callback)); } catch (err) { if (typeof callback !== "function") { throw err; } const opaque = opts?.opaque; queueMicrotask(() => callback(err, { opaque })); } } module2.exports = stream; } }); // node_modules/undici/lib/api/api-pipeline.js var require_api_pipeline = __commonJS({ "node_modules/undici/lib/api/api-pipeline.js"(exports2, module2) { "use strict"; var { Readable: Readable2, Duplex, PassThrough: PassThrough2 } = require("node:stream"); var { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError } = require_errors(); var util = require_util(); var { AsyncResource } = require("node:async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert4 = require("node:assert"); var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable2 { constructor() { super({ autoDestroy: true }); this[kResume] = null; } _read() { const { [kResume]: resume3 } = this; if (resume3) { this[kResume] = null; resume3(); } } _destroy(err, callback) { this._read(); callback(err); } }; var PipelineResponse = class extends Readable2 { constructor(resume3) { super({ autoDestroy: true }); this[kResume] = resume3; } _read() { this[kResume](); } _destroy(err, callback) { if (!err && !this._readableState.endEmitted) { err = new RequestAbortedError(); } callback(err); } }; var PipelineHandler = class extends AsyncResource { constructor(opts, handler) { if (!opts || typeof opts !== "object") { throw new InvalidArgumentError("invalid opts"); } if (typeof handler !== "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 = handler; this.abort = null; this.context = null; this.onInfo = onInfo || null; this.req = new PipelineRequest().on("error", util.nop); this.ret = new Duplex({ readableObjectMode: opts.objectMode, autoDestroy: true, read: () => { const { body } = this; if (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(); } util.destroy(body, err); util.destroy(req, err); util.destroy(res, err); removeSignal(this); callback(err); } }).on("prefinish", () => { const { req } = this; req.push(null); }); this.res = null; addSignal(this, signal); } onConnect(abort, context) { const { ret, res } = this; if (this.reason) { abort(this.reason); return; } assert4(!res, "pipeline cannot be retried"); assert4(!ret.destroyed); this.abort = abort; this.context = context; } onHeaders(statusCode, rawHeaders, resume3) { const { opaque, handler, context } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); this.onInfo({ statusCode, headers }); } return; } this.res = new PipelineResponse(resume3); let body; try { this.handler = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); body = this.runInAsyncScope(handler, null, { statusCode, headers, opaque, body: this.res, context }); } catch (err) { this.res.on("error", util.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; util.destroy(ret, err); }).on("end", () => { const { ret } = this; ret.push(null); }).on("close", () => { const { ret } = this; if (!ret._readableState.ended) { util.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; util.destroy(ret, err); } }; function pipeline(opts, handler) { try { const pipelineHandler = new PipelineHandler(opts, handler); this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler); return pipelineHandler.ret; } catch (err) { return new PassThrough2().destroy(err); } } module2.exports = pipeline; } }); // node_modules/undici/lib/api/api-upgrade.js var require_api_upgrade = __commonJS({ "node_modules/undici/lib/api/api-upgrade.js"(exports2, module2) { "use strict"; var { InvalidArgumentError, SocketError } = require_errors(); var { AsyncResource } = require("node:async_hooks"); var util = require_util(); var { addSignal, removeSignal } = require_abort_signal(); var assert4 = require("node: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, context) { if (this.reason) { abort(this.reason); return; } assert4(this.callback); this.abort = abort; this.context = null; } onHeaders() { throw new SocketError("bad upgrade", null); } onUpgrade(statusCode, rawHeaders, socket) { assert4(statusCode === 101); const { callback, opaque, context } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); this.runInAsyncScope(callback, null, null, { headers, socket, opaque, context }); } onError(err) { const { callback, opaque } = this; removeSignal(this); if (callback) { this.callback = null; queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }); }); } } }; function upgrade(opts, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { upgrade.call(this, opts, (err, data3) => { return err ? reject(err) : resolve(data3); }); }); } 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?.opaque; queueMicrotask(() => callback(err, { opaque })); } } module2.exports = upgrade; } }); // node_modules/undici/lib/api/api-connect.js var require_api_connect = __commonJS({ "node_modules/undici/lib/api/api-connect.js"(exports2, module2) { "use strict"; var assert4 = require("node:assert"); var { AsyncResource } = require("node:async_hooks"); var { InvalidArgumentError, SocketError } = require_errors(); var util = 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, context) { if (this.reason) { abort(this.reason); return; } assert4(this.callback); this.abort = abort; this.context = context; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { const { callback, opaque, context } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; if (headers != null) { headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); } this.runInAsyncScope(callback, null, null, { statusCode, headers, socket, opaque, context }); } onError(err) { const { callback, opaque } = this; removeSignal(this); if (callback) { this.callback = null; queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }); }); } } }; function connect13(opts, callback) { if (callback === void 0) { return new Promise((resolve, reject) => { connect13.call(this, opts, (err, data3) => { return err ? reject(err) : resolve(data3); }); }); } try { const connectHandler = new ConnectHandler(opts, callback); this.dispatch({ ...opts, method: "CONNECT" }, connectHandler); } catch (err) { if (typeof callback !== "function") { throw err; } const opaque = opts?.opaque; queueMicrotask(() => callback(err, { opaque })); } } module2.exports = connect13; } }); // node_modules/undici/lib/api/index.js var require_api = __commonJS({ "node_modules/undici/lib/api/index.js"(exports2, module2) { "use strict"; module2.exports.request = require_api_request(); module2.exports.stream = require_api_stream(); module2.exports.pipeline = require_api_pipeline(); module2.exports.upgrade = require_api_upgrade(); module2.exports.connect = require_api_connect(); } }); // node_modules/undici/lib/mock/mock-errors.js var require_mock_errors = __commonJS({ "node_modules/undici/lib/mock/mock-errors.js"(exports2, module2) { "use strict"; var { UndiciError } = require_errors(); var kMockNotMatchedError = /* @__PURE__ */ Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"); var MockNotMatchedError = class _MockNotMatchedError 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"; } static [Symbol.hasInstance](instance) { return instance && instance[kMockNotMatchedError] === true; } [kMockNotMatchedError] = true; }; module2.exports = { MockNotMatchedError }; } }); // node_modules/undici/lib/mock/mock-symbols.js var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { kAgent: /* @__PURE__ */ Symbol("agent"), kOptions: /* @__PURE__ */ Symbol("options"), kFactory: /* @__PURE__ */ Symbol("factory"), kDispatches: /* @__PURE__ */ Symbol("dispatches"), kDispatchKey: /* @__PURE__ */ Symbol("dispatch key"), kDefaultHeaders: /* @__PURE__ */ Symbol("default headers"), kDefaultTrailers: /* @__PURE__ */ Symbol("default trailers"), kContentLength: /* @__PURE__ */ Symbol("content length"), kMockAgent: /* @__PURE__ */ Symbol("mock agent"), kMockAgentSet: /* @__PURE__ */ Symbol("mock agent set"), kMockAgentGet: /* @__PURE__ */ Symbol("mock agent get"), kMockDispatch: /* @__PURE__ */ Symbol("mock dispatch"), kClose: /* @__PURE__ */ Symbol("close"), kOriginalClose: /* @__PURE__ */ Symbol("original agent close"), kOrigin: /* @__PURE__ */ Symbol("origin"), kIsMockActive: /* @__PURE__ */ Symbol("is mock active"), kNetConnect: /* @__PURE__ */ Symbol("net connect"), kGetNetConnect: /* @__PURE__ */ Symbol("get net connect"), kConnected: /* @__PURE__ */ Symbol("connected") }; } }); // node_modules/undici/lib/mock/mock-utils.js var require_mock_utils = __commonJS({ "node_modules/undici/lib/mock/mock-utils.js"(exports2, module2) { "use strict"; var { MockNotMatchedError } = require_mock_errors(); var { kDispatches, kMockAgent, kOriginalDispatch, kOrigin, kGetNetConnect } = require_mock_symbols(); var { buildURL } = require_util(); var { STATUS_CODES: STATUS_CODES2 } = require("node:http"); var { types: { isPromise } } = require("node:util"); function matchValue(match, value) { if (typeof match === "string") { return match === value; } if (match instanceof RegExp) { return match.test(value); } if (typeof match === "function") { return match(value) === true; } return false; } function lowerCaseEntries(headers) { return Object.fromEntries( Object.entries(headers).map(([headerName, headerValue]) => { return [headerName.toLocaleLowerCase(), headerValue]; }) ); } 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()]; } } 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); } 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; } function safeUrl(path3) { if (typeof path3 !== "string") { return path3; } const pathSegments = path3.split("?"); if (pathSegments.length !== 2) { return path3; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } function matchKey(mockDispatch2, { path: path3, method, body, headers }) { const pathMatch = matchValue(mockDispatch2.path, path3); 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; } function getResponseData(data3) { if (Buffer.isBuffer(data3)) { return data3; } else if (data3 instanceof Uint8Array) { return data3; } else if (data3 instanceof ArrayBuffer) { return data3; } else if (typeof data3 === "object") { return JSON.stringify(data3); } else { return data3.toString(); } } 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: path3 }) => matchValue(safeUrl(path3), 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}' on path '${resolvedPath2}'`); } 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}' on path '${resolvedPath2}'`); } matchedMockDispatches = matchedMockDispatches.filter((mockDispatch2) => matchHeaders(mockDispatch2, key.headers)); if (matchedMockDispatches.length === 0) { const headers = typeof key.headers === "object" ? JSON.stringify(key.headers) : key.headers; throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath2}'`); } return matchedMockDispatches[0]; } function addMockDispatch(mockDispatches, key, data3) { const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }; const replyData = typeof data3 === "function" ? { callback: data3 } : { ...data3 }; const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }; mockDispatches.push(newMockDispatch); return newMockDispatch; } 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); } } function buildKey(opts) { const { path: path3, method, body, headers, query } = opts; return { path: path3, method, body, headers, query }; } function generateKeyValues(data3) { const keys = Object.keys(data3); const result = []; for (let i5 = 0; i5 < keys.length; ++i5) { const key = keys[i5]; const value = data3[key]; const name = Buffer.from(`${key}`); if (Array.isArray(value)) { for (let j5 = 0; j5 < value.length; ++j5) { result.push(name, Buffer.from(`${value[j5]}`)); } } else { result.push(name, Buffer.from(`${value}`)); } } return result; } function getStatusText(statusCode) { return STATUS_CODES2[statusCode] || "unknown"; } async function getResponse(body) { const buffers = []; for await (const data3 of body) { buffers.push(data3); } return Buffer.concat(buffers).toString("utf8"); } function mockDispatch(opts, handler) { 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: data3, headers, trailers, error: error3 }, delay, persist } = mockDispatch2; const { timesInvoked, times } = mockDispatch2; mockDispatch2.consumed = !persist && timesInvoked >= times; mockDispatch2.pending = timesInvoked < times; if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); handler.onError(error3); return true; } if (typeof delay === "number" && delay > 0) { setTimeout(() => { handleReply(this[kDispatches]); }, delay); } else { handleReply(this[kDispatches]); } function handleReply(mockDispatches, _data5 = data3) { const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers; const body = typeof _data5 === "function" ? _data5({ ...opts, headers: optsHeaders }) : _data5; if (isPromise(body)) { body.then((newData) => handleReply(mockDispatches, newData)); return; } const responseData = getResponseData(body); const responseHeaders = generateKeyValues(headers); const responseTrailers = generateKeyValues(trailers); handler.onConnect?.((err) => handler.onError(err), null); handler.onHeaders?.(statusCode, responseHeaders, resume3, getStatusText(statusCode)); handler.onData?.(Buffer.from(responseData)); handler.onComplete?.(responseTrailers); deleteMockDispatch(mockDispatches, key); } function resume3() { } return true; } function buildMockDispatch() { const agent = this[kMockAgent]; const origin = this[kOrigin]; const originalDispatch = this[kOriginalDispatch]; return function dispatch(opts, handler) { if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); } catch (error3) { if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { throw error3; } } } else { originalDispatch.call(this, opts, handler); } }; } function checkNetConnect(netConnect, origin) { const url = new URL(origin); if (netConnect === true) { return true; } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) { return true; } return false; } function buildMockOptions(opts) { if (opts) { const { agent, ...mockOptions } = opts; return mockOptions; } } module2.exports = { getResponseData, getMockDispatch, addMockDispatch, deleteMockDispatch, buildKey, generateKeyValues, matchValue, getResponse, getStatusText, mockDispatch, buildMockDispatch, checkNetConnect, buildMockOptions, getHeaderByName, buildHeadersFromArray }; } }); // node_modules/undici/lib/mock/mock-interceptor.js var require_mock_interceptor = __commonJS({ "node_modules/undici/lib/mock/mock-interceptor.js"(exports2, module2) { "use strict"; 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; } }; 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: data3, responseOptions }) { const responseData = getResponseData(data3); const contentLength = this[kContentLength] ? { "content-length": responseData.length } : {}; const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }; const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }; return { statusCode, data: data3, headers, trailers }; } validateReplyParameters(replyParameters) { if (typeof replyParameters.statusCode === "undefined") { throw new InvalidArgumentError("statusCode must be defined"); } if (typeof replyParameters.responseOptions !== "object" || replyParameters.responseOptions === null) { throw new InvalidArgumentError("responseOptions must be an object"); } } /** * Mock an undici request with a defined reply. */ reply(replyOptionsCallbackOrStatusCode) { if (typeof replyOptionsCallbackOrStatusCode === "function") { const wrappedDefaultsCallback = (opts) => { const resolvedData = replyOptionsCallbackOrStatusCode(opts); if (typeof resolvedData !== "object" || resolvedData === null) { throw new InvalidArgumentError("reply options callback must return an object"); } const replyParameters2 = { data: "", responseOptions: {}, ...resolvedData }; this.validateReplyParameters(replyParameters2); return { ...this.createMockScopeDispatchData(replyParameters2) }; }; const newMockDispatch2 = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback); return new MockScope(newMockDispatch2); } const replyParameters = { statusCode: replyOptionsCallbackOrStatusCode, data: arguments[1] === void 0 ? "" : arguments[1], responseOptions: arguments[2] === void 0 ? {} : arguments[2] }; this.validateReplyParameters(replyParameters); const dispatchData = this.createMockScopeDispatchData(replyParameters); const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData); return new MockScope(newMockDispatch); } /** * Mock an undici request with a defined error. */ replyWithError(error3) { if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); 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; } }; module2.exports.MockInterceptor = MockInterceptor; module2.exports.MockScope = MockScope; } }); // node_modules/undici/lib/mock/mock-client.js var require_mock_client = __commonJS({ "node_modules/undici/lib/mock/mock-client.js"(exports2, module2) { "use strict"; var { promisify } = require("node: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 promisify(this[kOriginalClose])(); this[kConnected] = 0; this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); } }; module2.exports = MockClient; } }); // node_modules/undici/lib/mock/mock-pool.js var require_mock_pool = __commonJS({ "node_modules/undici/lib/mock/mock-pool.js"(exports2, module2) { "use strict"; var { promisify } = require("node: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 promisify(this[kOriginalClose])(); this[kConnected] = 0; this[kMockAgent][Symbols.kClients].delete(this[kOrigin]); } }; module2.exports = MockPool; } }); // node_modules/undici/lib/mock/pluralizer.js var require_pluralizer = __commonJS({ "node_modules/undici/lib/mock/pluralizer.js"(exports2, module2) { "use strict"; var singulars = { pronoun: "it", is: "is", was: "was", this: "this" }; var plurals = { pronoun: "they", is: "are", was: "were", this: "these" }; module2.exports = class Pluralizer { constructor(singular, plural) { this.singular = singular; this.plural = plural; } pluralize(count) { const one = count === 1; const keys = one ? singulars : plurals; const noun = one ? this.singular : this.plural; return { ...keys, count, noun }; } }; } }); // node_modules/undici/lib/mock/pending-interceptors-formatter.js var require_pending_interceptors_formatter = __commonJS({ "node_modules/undici/lib/mock/pending-interceptors-formatter.js"(exports2, module2) { "use strict"; var { Transform } = require("node:stream"); var { Console } = require("node:console"); var PERSISTENT = process.versions.icu ? "\u2705" : "Y "; var NOT_PERSISTENT = process.versions.icu ? "\u274C" : "N "; module2.exports = class PendingInterceptorsFormatter { constructor({ disableColors } = {}) { this.transform = new Transform({ transform(chunk, _enc, cb) { cb(null, chunk); } }); this.logger = new Console({ stdout: this.transform, inspectOptions: { colors: !disableColors && !process.env.CI } }); } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( ({ method, path: path3, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, Path: path3, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, Remaining: persist ? Infinity : times - timesInvoked }) ); this.logger.table(withPrettyHeaders); return this.transform.read().toString(); } }; } }); // node_modules/undici/lib/mock/mock-agent.js var require_mock_agent = __commonJS({ "node_modules/undici/lib/mock/mock-agent.js"(exports2, module2) { "use strict"; var { kClients } = require_symbols(); var Agent9 = 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 Dispatcher = require_dispatcher(); var Pluralizer = require_pluralizer(); var PendingInterceptorsFormatter = require_pending_interceptors_formatter(); var MockAgent = class extends Dispatcher { constructor(opts) { super(opts); this[kNetConnect] = true; this[kIsMockActive] = true; if (opts?.agent && typeof opts.agent.dispatch !== "function") { throw new InvalidArgumentError("Argument opts.agent must implement Agent"); } const agent = opts?.agent ? opts.agent : new Agent9(opts); this[kAgent] = agent; this[kClients] = agent[kClients]; this[kOptions] = buildMockOptions(opts); } get(origin) { let dispatcher = this[kMockAgentGet](origin); if (!dispatcher) { dispatcher = this[kFactory](origin); this[kMockAgentSet](origin, dispatcher); } return dispatcher; } dispatch(opts, handler) { this.get(opts.origin); return this[kAgent].dispatch(opts, handler); } async close() { await this[kAgent].close(); this[kClients].clear(); } deactivate() { this[kIsMockActive] = false; } activate() { this[kIsMockActive] = true; } enableNetConnect(matcher) { if (typeof matcher === "string" || typeof matcher === "function" || matcher instanceof RegExp) { if (Array.isArray(this[kNetConnect])) { this[kNetConnect].push(matcher); } else { this[kNetConnect] = [matcher]; } } else if (typeof matcher === "undefined") { this[kNetConnect] = true; } else { throw new InvalidArgumentError("Unsupported matcher. Must be one of String|Function|RegExp."); } } disableNetConnect() { this[kNetConnect] = false; } // This is required to bypass issues caused by using global symbols - see: // https://github.com/nodejs/undici/issues/1447 get isMockActive() { return this[kIsMockActive]; } [kMockAgentSet](origin, dispatcher) { this[kClients].set(origin, dispatcher); } [kFactory](origin) { const mockOptions = Object.assign({ agent: this }, this[kOptions]); return this[kOptions] && this[kOptions].connections === 1 ? new MockClient(origin, mockOptions) : new MockPool(origin, mockOptions); } [kMockAgentGet](origin) { const client = this[kClients].get(origin); if (client) { return client; } if (typeof origin !== "string") { const dispatcher = this[kFactory]("http://localhost:9999"); this[kMockAgentSet](origin, dispatcher); return dispatcher; } for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) { if (nonExplicitDispatcher && typeof keyMatcher !== "string" && matchValue(keyMatcher, origin)) { const dispatcher = this[kFactory](origin); this[kMockAgentSet](origin, dispatcher); dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]; return dispatcher; } } } [kGetNetConnect]() { return this[kNetConnect]; } pendingInterceptors() { const mockAgentClients = this[kClients]; return Array.from(mockAgentClients.entries()).flatMap(([origin, scope]) => scope[kDispatches].map((dispatch) => ({ ...dispatch, origin }))).filter(({ pending }) => pending); } assertNoPendingInterceptors({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { const pending = this.pendingInterceptors(); if (pending.length === 0) { return; } const pluralizer = new Pluralizer("interceptor", "interceptors").pluralize(pending.length); throw new UndiciError(` ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: ${pendingInterceptorsFormatter.format(pending)} `.trim()); } }; module2.exports = MockAgent; } }); // node_modules/undici/lib/global.js var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent9 = require_agent(); if (getGlobalDispatcher() === void 0) { setGlobalDispatcher(new Agent9()); } function setGlobalDispatcher(agent) { if (!agent || typeof agent.dispatch !== "function") { throw new InvalidArgumentError("Argument agent must implement Agent"); } Object.defineProperty(globalThis, globalDispatcher, { value: agent, writable: true, enumerable: false, configurable: false }); } function getGlobalDispatcher() { return globalThis[globalDispatcher]; } module2.exports = { setGlobalDispatcher, getGlobalDispatcher }; } }); // node_modules/undici/lib/handler/decorator-handler.js var require_decorator_handler = __commonJS({ "node_modules/undici/lib/handler/decorator-handler.js"(exports2, module2) { "use strict"; module2.exports = class DecoratorHandler { #handler; constructor(handler) { if (typeof handler !== "object" || handler === null) { throw new TypeError("handler must be an object"); } this.#handler = handler; } onConnect(...args) { return this.#handler.onConnect?.(...args); } onError(...args) { return this.#handler.onError?.(...args); } onUpgrade(...args) { return this.#handler.onUpgrade?.(...args); } onResponseStarted(...args) { return this.#handler.onResponseStarted?.(...args); } onHeaders(...args) { return this.#handler.onHeaders?.(...args); } onData(...args) { return this.#handler.onData?.(...args); } onComplete(...args) { return this.#handler.onComplete?.(...args); } onBodySent(...args) { return this.#handler.onBodySent?.(...args); } }; } }); // node_modules/undici/lib/interceptor/redirect.js var require_redirect = __commonJS({ "node_modules/undici/lib/interceptor/redirect.js"(exports2, module2) { "use strict"; var RedirectHandler = require_redirect_handler(); module2.exports = (opts) => { const globalMaxRedirections = opts?.maxRedirections; return (dispatch) => { return function redirectInterceptor(opts2, handler) { const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts2; if (!maxRedirections) { return dispatch(opts2, handler); } const redirectHandler = new RedirectHandler( dispatch, maxRedirections, opts2, handler ); return dispatch(baseOpts, redirectHandler); }; }; }; } }); // node_modules/undici/lib/interceptor/retry.js var require_retry = __commonJS({ "node_modules/undici/lib/interceptor/retry.js"(exports2, module2) { "use strict"; var RetryHandler = require_retry_handler(); module2.exports = (globalOpts) => { return (dispatch) => { return function retryInterceptor(opts, handler) { return dispatch( opts, new RetryHandler( { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } }, { handler, dispatch } ) ); }; }; }; } }); // node_modules/undici/lib/interceptor/dump.js var require_dump = __commonJS({ "node_modules/undici/lib/interceptor/dump.js"(exports2, module2) { "use strict"; var util = require_util(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var DecoratorHandler = require_decorator_handler(); var DumpHandler = class extends DecoratorHandler { #maxSize = 1024 * 1024; #abort = null; #dumped = false; #aborted = false; #size = 0; #reason = null; #handler = null; constructor({ maxSize }, handler) { super(handler); if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) { throw new InvalidArgumentError("maxSize must be a number greater than 0"); } this.#maxSize = maxSize ?? this.#maxSize; this.#handler = handler; } onConnect(abort) { this.#abort = abort; this.#handler.onConnect(this.#customAbort.bind(this)); } #customAbort(reason) { this.#aborted = true; this.#reason = reason; } // TODO: will require adjustment after new hooks are out onHeaders(statusCode, rawHeaders, resume3, statusMessage) { const headers = util.parseHeaders(rawHeaders); const contentLength = headers["content-length"]; if (contentLength != null && contentLength > this.#maxSize) { throw new RequestAbortedError( `Response size (${contentLength}) larger than maxSize (${this.#maxSize})` ); } if (this.#aborted) { return true; } return this.#handler.onHeaders( statusCode, rawHeaders, resume3, statusMessage ); } onError(err) { if (this.#dumped) { return; } err = this.#reason ?? err; this.#handler.onError(err); } onData(chunk) { this.#size = this.#size + chunk.length; if (this.#size >= this.#maxSize) { this.#dumped = true; if (this.#aborted) { this.#handler.onError(this.#reason); } else { this.#handler.onComplete([]); } } return true; } onComplete(trailers) { if (this.#dumped) { return; } if (this.#aborted) { this.#handler.onError(this.reason); return; } this.#handler.onComplete(trailers); } }; function createDumpInterceptor({ maxSize: defaultMaxSize } = { maxSize: 1024 * 1024 }) { return (dispatch) => { return function Intercept(opts, handler) { const { dumpMaxSize = defaultMaxSize } = opts; const dumpHandler = new DumpHandler( { maxSize: dumpMaxSize }, handler ); return dispatch(opts, dumpHandler); }; }; } module2.exports = createDumpInterceptor; } }); // node_modules/undici/lib/interceptor/dns.js var require_dns = __commonJS({ "node_modules/undici/lib/interceptor/dns.js"(exports2, module2) { "use strict"; var { isIP: isIP6 } = require("node:net"); var { lookup: lookup4 } = require("node:dns"); var DecoratorHandler = require_decorator_handler(); var { InvalidArgumentError, InformationalError } = require_errors(); var maxInt = Math.pow(2, 31) - 1; var DNSInstance = class { #maxTTL = 0; #maxItems = 0; #records = /* @__PURE__ */ new Map(); dualStack = true; affinity = null; lookup = null; pick = null; constructor(opts) { this.#maxTTL = opts.maxTTL; this.#maxItems = opts.maxItems; this.dualStack = opts.dualStack; this.affinity = opts.affinity; this.lookup = opts.lookup ?? this.#defaultLookup; this.pick = opts.pick ?? this.#defaultPick; } get full() { return this.#records.size === this.#maxItems; } runLookup(origin, opts, cb) { const ips = this.#records.get(origin.hostname); if (ips == null && this.full) { cb(null, origin.origin); return; } const newOpts = { affinity: this.affinity, dualStack: this.dualStack, lookup: this.lookup, pick: this.pick, ...opts.dns, maxTTL: this.#maxTTL, maxItems: this.#maxItems }; if (ips == null) { this.lookup(origin, newOpts, (err, addresses) => { if (err || addresses == null || addresses.length === 0) { cb(err ?? new InformationalError("No DNS entries found")); return; } this.setRecords(origin, addresses); const records = this.#records.get(origin.hostname); const ip2 = this.pick( origin, records, newOpts.affinity ); let port; if (typeof ip2.port === "number") { port = `:${ip2.port}`; } else if (origin.port !== "") { port = `:${origin.port}`; } else { port = ""; } cb( null, `${origin.protocol}//${ip2.family === 6 ? `[${ip2.address}]` : ip2.address}${port}` ); }); } else { const ip2 = this.pick( origin, ips, newOpts.affinity ); if (ip2 == null) { this.#records.delete(origin.hostname); this.runLookup(origin, opts, cb); return; } let port; if (typeof ip2.port === "number") { port = `:${ip2.port}`; } else if (origin.port !== "") { port = `:${origin.port}`; } else { port = ""; } cb( null, `${origin.protocol}//${ip2.family === 6 ? `[${ip2.address}]` : ip2.address}${port}` ); } } #defaultLookup(origin, opts, cb) { lookup4( origin.hostname, { all: true, family: this.dualStack === false ? this.affinity : 0, order: "ipv4first" }, (err, addresses) => { if (err) { return cb(err); } const results = /* @__PURE__ */ new Map(); for (const addr of addresses) { results.set(`${addr.address}:${addr.family}`, addr); } cb(null, results.values()); } ); } #defaultPick(origin, hostnameRecords, affinity) { let ip2 = null; const { records, offset } = hostnameRecords; let family; if (this.dualStack) { if (affinity == null) { if (offset == null || offset === maxInt) { hostnameRecords.offset = 0; affinity = 4; } else { hostnameRecords.offset++; affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4; } } if (records[affinity] != null && records[affinity].ips.length > 0) { family = records[affinity]; } else { family = records[affinity === 4 ? 6 : 4]; } } else { family = records[affinity]; } if (family == null || family.ips.length === 0) { return ip2; } if (family.offset == null || family.offset === maxInt) { family.offset = 0; } else { family.offset++; } const position = family.offset % family.ips.length; ip2 = family.ips[position] ?? null; if (ip2 == null) { return ip2; } if (Date.now() - ip2.timestamp > ip2.ttl) { family.ips.splice(position, 1); return this.pick(origin, hostnameRecords, affinity); } return ip2; } setRecords(origin, addresses) { const timestamp = Date.now(); const records = { records: { 4: null, 6: null } }; for (const record of addresses) { record.timestamp = timestamp; if (typeof record.ttl === "number") { record.ttl = Math.min(record.ttl, this.#maxTTL); } else { record.ttl = this.#maxTTL; } const familyRecords = records.records[record.family] ?? { ips: [] }; familyRecords.ips.push(record); records.records[record.family] = familyRecords; } this.#records.set(origin.hostname, records); } getHandler(meta, opts) { return new DNSDispatchHandler(this, meta, opts); } }; var DNSDispatchHandler = class extends DecoratorHandler { #state = null; #opts = null; #dispatch = null; #handler = null; #origin = null; constructor(state2, { origin, handler, dispatch }, opts) { super(handler); this.#origin = origin; this.#handler = handler; this.#opts = { ...opts }; this.#state = state2; this.#dispatch = dispatch; } onError(err) { switch (err.code) { case "ETIMEDOUT": case "ECONNREFUSED": { if (this.#state.dualStack) { this.#state.runLookup(this.#origin, this.#opts, (err2, newOrigin) => { if (err2) { return this.#handler.onError(err2); } const dispatchOpts = { ...this.#opts, origin: newOrigin }; this.#dispatch(dispatchOpts, this); }); return; } this.#handler.onError(err); return; } case "ENOTFOUND": this.#state.deleteRecord(this.#origin); // eslint-disable-next-line no-fallthrough default: this.#handler.onError(err); break; } } }; module2.exports = (interceptorOpts) => { if (interceptorOpts?.maxTTL != null && (typeof interceptorOpts?.maxTTL !== "number" || interceptorOpts?.maxTTL < 0)) { throw new InvalidArgumentError("Invalid maxTTL. Must be a positive number"); } if (interceptorOpts?.maxItems != null && (typeof interceptorOpts?.maxItems !== "number" || interceptorOpts?.maxItems < 1)) { throw new InvalidArgumentError( "Invalid maxItems. Must be a positive number and greater than zero" ); } if (interceptorOpts?.affinity != null && interceptorOpts?.affinity !== 4 && interceptorOpts?.affinity !== 6) { throw new InvalidArgumentError("Invalid affinity. Must be either 4 or 6"); } if (interceptorOpts?.dualStack != null && typeof interceptorOpts?.dualStack !== "boolean") { throw new InvalidArgumentError("Invalid dualStack. Must be a boolean"); } if (interceptorOpts?.lookup != null && typeof interceptorOpts?.lookup !== "function") { throw new InvalidArgumentError("Invalid lookup. Must be a function"); } if (interceptorOpts?.pick != null && typeof interceptorOpts?.pick !== "function") { throw new InvalidArgumentError("Invalid pick. Must be a function"); } const dualStack = interceptorOpts?.dualStack ?? true; let affinity; if (dualStack) { affinity = interceptorOpts?.affinity ?? null; } else { affinity = interceptorOpts?.affinity ?? 4; } const opts = { maxTTL: interceptorOpts?.maxTTL ?? 1e4, // Expressed in ms lookup: interceptorOpts?.lookup ?? null, pick: interceptorOpts?.pick ?? null, dualStack, affinity, maxItems: interceptorOpts?.maxItems ?? Infinity }; const instance = new DNSInstance(opts); return (dispatch) => { return function dnsInterceptor(origDispatchOpts, handler) { const origin = origDispatchOpts.origin.constructor === URL ? origDispatchOpts.origin : new URL(origDispatchOpts.origin); if (isIP6(origin.hostname) !== 0) { return dispatch(origDispatchOpts, handler); } instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => { if (err) { return handler.onError(err); } let dispatchOpts = null; dispatchOpts = { ...origDispatchOpts, servername: origin.hostname, // For SNI on TLS origin: newOrigin, headers: { host: origin.hostname, ...origDispatchOpts.headers } }; dispatch( dispatchOpts, instance.getHandler({ origin, dispatch, handler }, origDispatchOpts) ); }); return true; }; }; }; } }); // node_modules/undici/lib/web/fetch/headers.js var require_headers = __commonJS({ "node_modules/undici/lib/web/fetch/headers.js"(exports2, module2) { "use strict"; var { kConstruct } = require_symbols(); var { kEnumerableProperty } = require_util(); var { iteratorMixin, isValidHeaderName, isValidHeaderValue } = require_util2(); var { webidl } = require_webidl(); var assert4 = require("node:assert"); var util = require("node:util"); var kHeadersMap = /* @__PURE__ */ Symbol("headers map"); var kHeadersSortedMap = /* @__PURE__ */ Symbol("headers map sorted"); function isHTTPWhiteSpaceCharCode(code) { return code === 10 || code === 13 || code === 9 || code === 32; } function headerValueNormalize(potentialValue) { let i5 = 0; let j5 = potentialValue.length; while (j5 > i5 && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(j5 - 1))) --j5; while (j5 > i5 && isHTTPWhiteSpaceCharCode(potentialValue.charCodeAt(i5))) ++i5; return i5 === 0 && j5 === potentialValue.length ? potentialValue : potentialValue.substring(i5, j5); } function fill(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"] }); } } function appendHeader(headers, name, value) { value = headerValueNormalize(value); if (!isValidHeaderName(name)) { throw webidl.errors.invalidArgument({ prefix: "Headers.append", value: name, type: "header name" }); } else if (!isValidHeaderValue(value)) { throw webidl.errors.invalidArgument({ prefix: "Headers.append", value, type: "header value" }); } if (getHeadersGuard(headers) === "immutable") { throw new TypeError("immutable"); } return getHeadersList(headers).append(name, value, false); } function compareHeaderName(a5, b6) { return a5[0] < b6[0] ? -1 : 1; } var HeadersList = class _HeadersList { /** @type {[string, string][]|null} */ cookies = null; constructor(init) { if (init instanceof _HeadersList) { this[kHeadersMap] = new Map(init[kHeadersMap]); this[kHeadersSortedMap] = init[kHeadersSortedMap]; this.cookies = init.cookies === null ? null : [...init.cookies]; } else { this[kHeadersMap] = new Map(init); this[kHeadersSortedMap] = null; } } /** * @see https://fetch.spec.whatwg.org/#header-list-contains * @param {string} name * @param {boolean} isLowerCase */ contains(name, isLowerCase) { return this[kHeadersMap].has(isLowerCase ? name : name.toLowerCase()); } clear() { this[kHeadersMap].clear(); this[kHeadersSortedMap] = null; this.cookies = null; } /** * @see https://fetch.spec.whatwg.org/#concept-header-list-append * @param {string} name * @param {string} value * @param {boolean} isLowerCase */ append(name, value, isLowerCase) { this[kHeadersSortedMap] = null; const lowercaseName = isLowerCase ? name : name.toLowerCase(); const exists2 = this[kHeadersMap].get(lowercaseName); if (exists2) { const delimiter = lowercaseName === "cookie" ? "; " : ", "; this[kHeadersMap].set(lowercaseName, { name: exists2.name, value: `${exists2.value}${delimiter}${value}` }); } else { this[kHeadersMap].set(lowercaseName, { name, value }); } if (lowercaseName === "set-cookie") { (this.cookies ??= []).push(value); } } /** * @see https://fetch.spec.whatwg.org/#concept-header-list-set * @param {string} name * @param {string} value * @param {boolean} isLowerCase */ set(name, value, isLowerCase) { this[kHeadersSortedMap] = null; const lowercaseName = isLowerCase ? name : name.toLowerCase(); if (lowercaseName === "set-cookie") { this.cookies = [value]; } this[kHeadersMap].set(lowercaseName, { name, value }); } /** * @see https://fetch.spec.whatwg.org/#concept-header-list-delete * @param {string} name * @param {boolean} isLowerCase */ delete(name, isLowerCase) { this[kHeadersSortedMap] = null; if (!isLowerCase) name = name.toLowerCase(); if (name === "set-cookie") { this.cookies = null; } this[kHeadersMap].delete(name); } /** * @see https://fetch.spec.whatwg.org/#concept-header-list-get * @param {string} name * @param {boolean} isLowerCase * @returns {string | null} */ get(name, isLowerCase) { return this[kHeadersMap].get(isLowerCase ? name : name.toLowerCase())?.value ?? null; } *[Symbol.iterator]() { for (const { 0: name, 1: { value } } of this[kHeadersMap]) { yield [name, value]; } } get entries() { const headers = {}; if (this[kHeadersMap].size !== 0) { for (const { name, value } of this[kHeadersMap].values()) { headers[name] = value; } } return headers; } rawValues() { return this[kHeadersMap].values(); } get entriesList() { const headers = []; if (this[kHeadersMap].size !== 0) { for (const { 0: lowerName, 1: { name, value } } of this[kHeadersMap]) { if (lowerName === "set-cookie") { for (const cookie of this.cookies) { headers.push([name, cookie]); } } else { headers.push([name, value]); } } } return headers; } // https://fetch.spec.whatwg.org/#convert-header-names-to-a-sorted-lowercase-set toSortedArray() { const size = this[kHeadersMap].size; const array = new Array(size); if (size <= 32) { if (size === 0) { return array; } const iterator = this[kHeadersMap][Symbol.iterator](); const firstValue = iterator.next().value; array[0] = [firstValue[0], firstValue[1].value]; assert4(firstValue[1].value !== null); for (let i5 = 1, j5 = 0, right = 0, left = 0, pivot = 0, x, value; i5 < size; ++i5) { value = iterator.next().value; x = array[i5] = [value[0], value[1].value]; assert4(x[1] !== null); left = 0; right = i5; while (left < right) { pivot = left + (right - left >> 1); if (array[pivot][0] <= x[0]) { left = pivot + 1; } else { right = pivot; } } if (i5 !== pivot) { j5 = i5; while (j5 > left) { array[j5] = array[--j5]; } array[left] = x; } } if (!iterator.next().done) { throw new TypeError("Unreachable"); } return array; } else { let i5 = 0; for (const { 0: name, 1: { value } } of this[kHeadersMap]) { array[i5++] = [name, value]; assert4(value !== null); } return array.sort(compareHeaderName); } } }; var Headers3 = class _Headers { #guard; #headersList; constructor(init = void 0) { webidl.util.markAsUncloneable(this); if (init === kConstruct) { return; } this.#headersList = new HeadersList(); this.#guard = "none"; if (init !== void 0) { init = webidl.converters.HeadersInit(init, "Headers contructor", "init"); fill(this, init); } } // https://fetch.spec.whatwg.org/#dom-headers-append append(name, value) { webidl.brandCheck(this, _Headers); webidl.argumentLengthCheck(arguments, 2, "Headers.append"); const prefix = "Headers.append"; name = webidl.converters.ByteString(name, prefix, "name"); value = webidl.converters.ByteString(value, prefix, "value"); return appendHeader(this, name, value); } // https://fetch.spec.whatwg.org/#dom-headers-delete delete(name) { webidl.brandCheck(this, _Headers); webidl.argumentLengthCheck(arguments, 1, "Headers.delete"); const prefix = "Headers.delete"; name = webidl.converters.ByteString(name, prefix, "name"); if (!isValidHeaderName(name)) { throw webidl.errors.invalidArgument({ prefix: "Headers.delete", value: name, type: "header name" }); } if (this.#guard === "immutable") { throw new TypeError("immutable"); } if (!this.#headersList.contains(name, false)) { return; } this.#headersList.delete(name, false); } // https://fetch.spec.whatwg.org/#dom-headers-get get(name) { webidl.brandCheck(this, _Headers); webidl.argumentLengthCheck(arguments, 1, "Headers.get"); const prefix = "Headers.get"; name = webidl.converters.ByteString(name, prefix, "name"); if (!isValidHeaderName(name)) { throw webidl.errors.invalidArgument({ prefix, value: name, type: "header name" }); } return this.#headersList.get(name, false); } // https://fetch.spec.whatwg.org/#dom-headers-has has(name) { webidl.brandCheck(this, _Headers); webidl.argumentLengthCheck(arguments, 1, "Headers.has"); const prefix = "Headers.has"; name = webidl.converters.ByteString(name, prefix, "name"); if (!isValidHeaderName(name)) { throw webidl.errors.invalidArgument({ prefix, value: name, type: "header name" }); } return this.#headersList.contains(name, false); } // https://fetch.spec.whatwg.org/#dom-headers-set set(name, value) { webidl.brandCheck(this, _Headers); webidl.argumentLengthCheck(arguments, 2, "Headers.set"); const prefix = "Headers.set"; name = webidl.converters.ByteString(name, prefix, "name"); value = webidl.converters.ByteString(value, prefix, "value"); value = headerValueNormalize(value); if (!isValidHeaderName(name)) { throw webidl.errors.invalidArgument({ prefix, value: name, type: "header name" }); } else if (!isValidHeaderValue(value)) { throw webidl.errors.invalidArgument({ prefix, value, type: "header value" }); } if (this.#guard === "immutable") { throw new TypeError("immutable"); } this.#headersList.set(name, value, false); } // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie getSetCookie() { webidl.brandCheck(this, _Headers); const list2 = this.#headersList.cookies; if (list2) { return [...list2]; } return []; } // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine get [kHeadersSortedMap]() { if (this.#headersList[kHeadersSortedMap]) { return this.#headersList[kHeadersSortedMap]; } const headers = []; const names = this.#headersList.toSortedArray(); const cookies = this.#headersList.cookies; if (cookies === null || cookies.length === 1) { return this.#headersList[kHeadersSortedMap] = names; } for (let i5 = 0; i5 < names.length; ++i5) { const { 0: name, 1: value } = names[i5]; if (name === "set-cookie") { for (let j5 = 0; j5 < cookies.length; ++j5) { headers.push([name, cookies[j5]]); } } else { headers.push([name, value]); } } return this.#headersList[kHeadersSortedMap] = headers; } [util.inspect.custom](depth, options) { options.depth ??= depth; return `Headers ${util.formatWithOptions(options, this.#headersList.entries)}`; } static getHeadersGuard(o2) { return o2.#guard; } static setHeadersGuard(o2, guard) { o2.#guard = guard; } static getHeadersList(o2) { return o2.#headersList; } static setHeadersList(o2, list2) { o2.#headersList = list2; } }; var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers3; Reflect.deleteProperty(Headers3, "getHeadersGuard"); Reflect.deleteProperty(Headers3, "setHeadersGuard"); Reflect.deleteProperty(Headers3, "getHeadersList"); Reflect.deleteProperty(Headers3, "setHeadersList"); iteratorMixin("Headers", Headers3, kHeadersSortedMap, 0, 1); Object.defineProperties(Headers3.prototype, { append: kEnumerableProperty, delete: kEnumerableProperty, get: kEnumerableProperty, has: kEnumerableProperty, set: kEnumerableProperty, getSetCookie: kEnumerableProperty, [Symbol.toStringTag]: { value: "Headers", configurable: true }, [util.inspect.custom]: { enumerable: false } }); webidl.converters.HeadersInit = function(V, prefix, argument) { if (webidl.util.Type(V) === "Object") { const iterator = Reflect.get(V, Symbol.iterator); if (!util.types.isProxy(V) && iterator === Headers3.prototype.entries) { try { return getHeadersList(V).entriesList; } catch { } } if (typeof iterator === "function") { return webidl.converters["sequence>"](V, prefix, argument, iterator.bind(V)); } return webidl.converters["record"](V, prefix, argument); } throw webidl.errors.conversionFailed({ prefix: "Headers constructor", argument: "Argument 1", types: ["sequence>", "record"] }); }; module2.exports = { fill, // for test. compareHeaderName, Headers: Headers3, HeadersList, getHeadersGuard, setHeadersGuard, setHeadersList, getHeadersList }; } }); // node_modules/undici/lib/web/fetch/response.js var require_response = __commonJS({ "node_modules/undici/lib/web/fetch/response.js"(exports2, module2) { "use strict"; var { Headers: Headers3, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers(); var { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = require_body(); var util = require_util(); var nodeUtil = require("node:util"); var { kEnumerableProperty } = util; var { isValidReasonPhrase, isCancelled, isAborted, isBlobLike, serializeJavascriptValueToJSONString, isErrorLike, isomorphicEncode, environmentSettingsObject: relevantRealm } = require_util2(); var { redirectStatusSet, nullBodyStatus } = require_constants3(); var { kState, kHeaders } = require_symbols2(); var { webidl } = require_webidl(); var { FormData } = require_formdata(); var { URLSerializer } = require_data_url(); var { kConstruct } = require_symbols(); var assert4 = require("node:assert"); var { types: types3 } = require("node:util"); var textEncoder = new TextEncoder("utf-8"); var Response = class _Response { // Creates network error Response. static error() { const responseObject = fromInnerResponse(makeNetworkError(), "immutable"); return responseObject; } // https://fetch.spec.whatwg.org/#dom-response-json static json(data3, init = {}) { webidl.argumentLengthCheck(arguments, 1, "Response.json"); if (init !== null) { init = webidl.converters.ResponseInit(init); } const bytes = textEncoder.encode( serializeJavascriptValueToJSONString(data3) ); const body = extractBody(bytes); const responseObject = fromInnerResponse(makeResponse({}), "response"); initializeResponse(responseObject, init, { body: body[0], type: "application/json" }); return responseObject; } // Creates a redirect Response that redirects to url with status status. static redirect(url, status = 302) { webidl.argumentLengthCheck(arguments, 1, "Response.redirect"); url = webidl.converters.USVString(url); status = webidl.converters["unsigned short"](status); let parsedURL; try { parsedURL = new URL(url, relevantRealm.settingsObject.baseUrl); } catch (err) { throw new TypeError(`Failed to parse URL from ${url}`, { cause: err }); } if (!redirectStatusSet.has(status)) { throw new RangeError(`Invalid status code ${status}`); } const responseObject = fromInnerResponse(makeResponse({}), "immutable"); responseObject[kState].status = status; const value = isomorphicEncode(URLSerializer(parsedURL)); responseObject[kState].headersList.append("location", value, true); return responseObject; } // https://fetch.spec.whatwg.org/#dom-response constructor(body = null, init = {}) { webidl.util.markAsUncloneable(this); if (body === kConstruct) { return; } if (body !== null) { body = webidl.converters.BodyInit(body); } init = webidl.converters.ResponseInit(init); this[kState] = makeResponse({}); this[kHeaders] = new Headers3(kConstruct); setHeadersGuard(this[kHeaders], "response"); setHeadersList(this[kHeaders], this[kState].headersList); let bodyWithType = null; if (body != null) { const [extractedBody, type] = extractBody(body); bodyWithType = { body: extractedBody, type }; } initializeResponse(this, init, bodyWithType); } // Returns response’s type, e.g., "cors". get type() { webidl.brandCheck(this, _Response); return this[kState].type; } // Returns response’s URL, if it has one; otherwise the empty string. get url() { webidl.brandCheck(this, _Response); const urlList = this[kState].urlList; const url = urlList[urlList.length - 1] ?? null; if (url === null) { return ""; } return URLSerializer(url, true); } // Returns whether response was obtained through a redirect. get redirected() { webidl.brandCheck(this, _Response); return this[kState].urlList.length > 1; } // Returns response’s status. get status() { webidl.brandCheck(this, _Response); return this[kState].status; } // Returns whether response’s status is an ok status. get ok() { webidl.brandCheck(this, _Response); return this[kState].status >= 200 && this[kState].status <= 299; } // Returns response’s status message. get statusText() { webidl.brandCheck(this, _Response); return this[kState].statusText; } // Returns response’s headers as Headers. get headers() { webidl.brandCheck(this, _Response); return this[kHeaders]; } get body() { webidl.brandCheck(this, _Response); return this[kState].body ? this[kState].body.stream : null; } get bodyUsed() { webidl.brandCheck(this, _Response); return !!this[kState].body && util.isDisturbed(this[kState].body.stream); } // Returns a clone of response. clone() { webidl.brandCheck(this, _Response); if (bodyUnusable(this)) { throw webidl.errors.exception({ header: "Response.clone", message: "Body has already been consumed." }); } const clonedResponse = cloneResponse(this[kState]); if (hasFinalizationRegistry && this[kState].body?.stream) { streamRegistry.register(this, new WeakRef(this[kState].body.stream)); } return fromInnerResponse(clonedResponse, getHeadersGuard(this[kHeaders])); } [nodeUtil.inspect.custom](depth, options) { if (options.depth === null) { options.depth = 2; } options.colors ??= true; const properties = { status: this.status, statusText: this.statusText, headers: this.headers, body: this.body, bodyUsed: this.bodyUsed, ok: this.ok, redirected: this.redirected, type: this.type, url: this.url }; return `Response ${nodeUtil.formatWithOptions(options, properties)}`; } }; mixinBody(Response); Object.defineProperties(Response.prototype, { type: kEnumerableProperty, url: kEnumerableProperty, status: kEnumerableProperty, ok: kEnumerableProperty, redirected: kEnumerableProperty, statusText: kEnumerableProperty, headers: kEnumerableProperty, clone: kEnumerableProperty, body: kEnumerableProperty, bodyUsed: kEnumerableProperty, [Symbol.toStringTag]: { value: "Response", configurable: true } }); Object.defineProperties(Response, { json: kEnumerableProperty, redirect: kEnumerableProperty, error: kEnumerableProperty }); 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(newResponse, response.body); } return newResponse; } function makeResponse(init) { return { aborted: false, rangeRequested: false, timingAllowPassed: false, requestIncludesCredentials: false, type: "default", status: 200, timingInfo: null, cacheState: "", statusText: "", ...init, headersList: init?.headersList ? new HeadersList(init?.headersList) : new HeadersList(), urlList: init?.urlList ? [...init.urlList] : [] }; } function makeNetworkError(reason) { const isError = isErrorLike(reason); return makeResponse({ type: "error", status: 0, error: isError ? reason : new Error(reason ? String(reason) : reason), aborted: reason && reason.name === "AbortError" }); } function isNetworkError(response) { return ( // A network error is a response whose type is "error", response.type === "error" && // status is 0 response.status === 0 ); } function makeFilteredResponse(response, state2) { state2 = { internalResponse: response, ...state2 }; return new Proxy(response, { get(target, p2) { return p2 in state2 ? state2[p2] : target[p2]; }, set(target, p2, value) { assert4(!(p2 in state2)); target[p2] = value; return true; } }); } 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 { assert4(false); } } function makeAppropriateNetworkError(fetchParams, err = null) { assert4(isCancelled(fetchParams)); return isAborted(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err })); } function initializeResponse(response, init, body) { if (init.status !== null && (init.status < 200 || init.status > 599)) { throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.'); } if ("statusText" in init && init.statusText != null) { if (!isValidReasonPhrase(String(init.statusText))) { throw new TypeError("Invalid statusText"); } } if ("status" in init && init.status != null) { response[kState].status = init.status; } if ("statusText" in init && init.statusText != null) { response[kState].statusText = init.statusText; } if ("headers" in init && init.headers != null) { fill(response[kHeaders], init.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", true)) { response[kState].headersList.append("content-type", body.type, true); } } } function fromInnerResponse(innerResponse, guard) { const response = new Response(kConstruct); response[kState] = innerResponse; response[kHeaders] = new Headers3(kConstruct); setHeadersList(response[kHeaders], innerResponse.headersList); setHeadersGuard(response[kHeaders], guard); if (hasFinalizationRegistry && innerResponse.body?.stream) { streamRegistry.register(response, new WeakRef(innerResponse.body.stream)); } return response; } webidl.converters.ReadableStream = webidl.interfaceConverter( ReadableStream ); webidl.converters.FormData = webidl.interfaceConverter( FormData ); webidl.converters.URLSearchParams = webidl.interfaceConverter( URLSearchParams ); webidl.converters.XMLHttpRequestBodyInit = function(V, prefix, name) { if (typeof V === "string") { return webidl.converters.USVString(V, prefix, name); } if (isBlobLike(V)) { return webidl.converters.Blob(V, prefix, name, { strict: false }); } if (ArrayBuffer.isView(V) || types3.isArrayBuffer(V)) { return webidl.converters.BufferSource(V, prefix, name); } if (util.isFormDataLike(V)) { return webidl.converters.FormData(V, prefix, name, { strict: false }); } if (V instanceof URLSearchParams) { return webidl.converters.URLSearchParams(V, prefix, name); } return webidl.converters.DOMString(V, prefix, name); }; webidl.converters.BodyInit = function(V, prefix, argument) { if (V instanceof ReadableStream) { return webidl.converters.ReadableStream(V, prefix, argument); } if (V?.[Symbol.asyncIterator]) { return V; } return webidl.converters.XMLHttpRequestBodyInit(V, prefix, argument); }; webidl.converters.ResponseInit = webidl.dictionaryConverter([ { key: "status", converter: webidl.converters["unsigned short"], defaultValue: () => 200 }, { key: "statusText", converter: webidl.converters.ByteString, defaultValue: () => "" }, { key: "headers", converter: webidl.converters.HeadersInit } ]); module2.exports = { isNetworkError, makeNetworkError, makeResponse, makeAppropriateNetworkError, filterResponse, Response, cloneResponse, fromInnerResponse }; } }); // node_modules/undici/lib/web/fetch/dispatcher-weakref.js var require_dispatcher_weakref = __commonJS({ "node_modules/undici/lib/web/fetch/dispatcher-weakref.js"(exports2, module2) { "use strict"; 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; } }; 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); } }); } } unregister(key) { } }; module2.exports = function() { if (process.env.NODE_V8_COVERAGE && process.version.startsWith("v18")) { process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"); return { WeakRef: CompatWeakRef, FinalizationRegistry: CompatFinalizer }; } return { WeakRef, FinalizationRegistry }; }; } }); // node_modules/undici/lib/web/fetch/request.js var require_request2 = __commonJS({ "node_modules/undici/lib/web/fetch/request.js"(exports2, module2) { "use strict"; var { extractBody, mixinBody, cloneBody, bodyUnusable } = require_body(); var { Headers: Headers3, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers(); var { FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref()(); var util = require_util(); var nodeUtil = require("node:util"); var { isValidHTTPToken, sameOrigin, environmentSettingsObject } = require_util2(); var { forbiddenMethodsSet, corsSafeListedMethodsSet, referrerPolicy, requestRedirect, requestMode, requestCredentials, requestCache, requestDuplex } = require_constants3(); var { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util; var { kHeaders, kSignal, kState, kDispatcher } = require_symbols2(); var { webidl } = require_webidl(); var { URLSerializer } = require_data_url(); var { kConstruct } = require_symbols(); var assert4 = require("node:assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("node:events"); var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry2(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); var dependentControllerMap = /* @__PURE__ */ new WeakMap(); function buildAbort(acRef) { return abort; function abort() { const ac = acRef.deref(); if (ac !== void 0) { requestFinalizer.unregister(abort); this.removeEventListener("abort", abort); ac.abort(this.reason); const controllerList = dependentControllerMap.get(ac.signal); if (controllerList !== void 0) { if (controllerList.size !== 0) { for (const ref of controllerList) { const ctrl = ref.deref(); if (ctrl !== void 0) { ctrl.abort(this.reason); } } controllerList.clear(); } dependentControllerMap.delete(ac.signal); } } } } var patchMethodWarning = false; var Request2 = class _Request { // https://fetch.spec.whatwg.org/#dom-request constructor(input, init = {}) { webidl.util.markAsUncloneable(this); if (input === kConstruct) { return; } const prefix = "Request constructor"; webidl.argumentLengthCheck(arguments, 1, prefix); input = webidl.converters.RequestInfo(input, prefix, "input"); init = webidl.converters.RequestInit(init, prefix, "init"); let request = null; let fallbackMode = null; const baseUrl = environmentSettingsObject.settingsObject.baseUrl; let signal = null; if (typeof input === "string") { this[kDispatcher] = init.dispatcher; 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 ); } request = makeRequest({ urlList: [parsedURL] }); fallbackMode = "cors"; } else { this[kDispatcher] = init.dispatcher || input[kDispatcher]; assert4(input instanceof _Request); request = input[kState]; signal = input[kSignal]; } const origin = environmentSettingsObject.settingsObject.origin; let window2 = "client"; if (request.window?.constructor?.name === "EnvironmentSettingsObject" && sameOrigin(request.window, origin)) { window2 = request.window; } if (init.window != null) { throw new TypeError(`'window' option '${window2}' must be null`); } if ("window" in init) { window2 = "no-window"; } request = 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: request.method, // header list A copy of request’s header list. // undici implementation note: headersList is cloned in makeRequest headersList: request.headersList, // unsafe-request flag Set. unsafeRequest: request.unsafeRequest, // client This’s relevant settings object. client: environmentSettingsObject.settingsObject, // window window. window: window2, // priority request’s priority. priority: request.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: request.origin, // referrer request’s referrer. referrer: request.referrer, // referrer policy request’s referrer policy. referrerPolicy: request.referrerPolicy, // mode request’s mode. mode: request.mode, // credentials mode request’s credentials mode. credentials: request.credentials, // cache mode request’s cache mode. cache: request.cache, // redirect mode request’s redirect mode. redirect: request.redirect, // integrity metadata request’s integrity metadata. integrity: request.integrity, // keepalive request’s keepalive. keepalive: request.keepalive, // reload-navigation flag request’s reload-navigation flag. reloadNavigation: request.reloadNavigation, // history-navigation flag request’s history-navigation flag. historyNavigation: request.historyNavigation, // URL list A clone of request’s URL list. urlList: [...request.urlList] }); const initHasKey = Object.keys(init).length !== 0; if (initHasKey) { if (request.mode === "navigate") { request.mode = "same-origin"; } request.reloadNavigation = false; request.historyNavigation = false; request.origin = "client"; request.referrer = "client"; request.referrerPolicy = ""; request.url = request.urlList[request.urlList.length - 1]; request.urlList = [request.url]; } if (init.referrer !== void 0) { const referrer = init.referrer; if (referrer === "") { request.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, environmentSettingsObject.settingsObject.baseUrl)) { request.referrer = "client"; } else { request.referrer = parsedReferrer; } } } if (init.referrerPolicy !== void 0) { request.referrerPolicy = init.referrerPolicy; } let mode; if (init.mode !== void 0) { mode = init.mode; } else { mode = fallbackMode; } if (mode === "navigate") { throw webidl.errors.exception({ header: "Request constructor", message: "invalid request mode navigate." }); } if (mode != null) { request.mode = mode; } if (init.credentials !== void 0) { request.credentials = init.credentials; } if (init.cache !== void 0) { request.cache = init.cache; } if (request.cache === "only-if-cached" && request.mode !== "same-origin") { throw new TypeError( "'only-if-cached' can be set only with 'same-origin' mode" ); } if (init.redirect !== void 0) { request.redirect = init.redirect; } if (init.integrity != null) { request.integrity = String(init.integrity); } if (init.keepalive !== void 0) { request.keepalive = Boolean(init.keepalive); } if (init.method !== void 0) { let method = init.method; const mayBeNormalized = normalizedMethodRecords[method]; if (mayBeNormalized !== void 0) { request.method = mayBeNormalized; } else { if (!isValidHTTPToken(method)) { throw new TypeError(`'${method}' is not a valid HTTP method.`); } const upperCase = method.toUpperCase(); if (forbiddenMethodsSet.has(upperCase)) { throw new TypeError(`'${method}' HTTP method is unsupported.`); } method = normalizedMethodRecordsBase[upperCase] ?? method; request.method = method; } if (!patchMethodWarning && request.method === "patch") { process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.", { code: "UNDICI-FETCH-patch" }); patchMethodWarning = true; } } if (init.signal !== void 0) { signal = init.signal; } this[kState] = request; const ac = new AbortController(); this[kSignal] = ac.signal; 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) { ac.abort(signal.reason); } else { this[kAbortController] = ac; const acRef = new WeakRef(ac); const abort = buildAbort(acRef); try { if (typeof getMaxListeners === "function" && getMaxListeners(signal) === defaultMaxListeners) { setMaxListeners(1500, signal); } else if (getEventListeners(signal, "abort").length >= defaultMaxListeners) { setMaxListeners(1500, signal); } } catch { } util.addAbortListener(signal, abort); requestFinalizer.register(ac, { signal, abort }, abort); } } this[kHeaders] = new Headers3(kConstruct); setHeadersList(this[kHeaders], request.headersList); setHeadersGuard(this[kHeaders], "request"); if (mode === "no-cors") { if (!corsSafeListedMethodsSet.has(request.method)) { throw new TypeError( `'${request.method} is unsupported in no-cors mode.` ); } setHeadersGuard(this[kHeaders], "request-no-cors"); } if (initHasKey) { const headersList = getHeadersList(this[kHeaders]); const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { for (const { name, value } of headers.rawValues()) { headersList.append(name, value, false); } headersList.cookies = headers.cookies; } else { fillHeaders(this[kHeaders], headers); } } const inputBody = input instanceof _Request ? input[kState].body : null; if ((init.body != null || inputBody != null) && (request.method === "GET" || request.method === "HEAD")) { throw new TypeError("Request with GET/HEAD method cannot have body."); } let initBody = null; if (init.body != null) { const [extractedBody, contentType] = extractBody( init.body, request.keepalive ); initBody = extractedBody; if (contentType && !getHeadersList(this[kHeaders]).contains("content-type", true)) { this[kHeaders].append("content-type", contentType); } } const inputOrInitBody = initBody ?? inputBody; if (inputOrInitBody != null && inputOrInitBody.source == null) { if (initBody != null && init.duplex == null) { throw new TypeError("RequestInit: duplex option is required when sending a body."); } if (request.mode !== "same-origin" && request.mode !== "cors") { throw new TypeError( 'If request is made from ReadableStream, mode should be "same-origin" or "cors"' ); } request.useCORSPreflightFlag = true; } let finalBody = inputOrInitBody; if (initBody == null && inputBody != null) { if (bodyUnusable(input)) { throw new TypeError( "Cannot construct a Request with a Request object that has already been used." ); } const identityTransform = new TransformStream(); 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, _Request); return this[kState].method; } // Returns the URL of request as a string. get url() { webidl.brandCheck(this, _Request); 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, _Request); return this[kHeaders]; } // Returns the kind of resource requested by request, e.g., "document" // or "script". get destination() { webidl.brandCheck(this, _Request); 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, _Request); 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, _Request); 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, _Request); 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, _Request); 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, _Request); 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, _Request); 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, _Request); return this[kState].keepalive; } // Returns a boolean indicating whether or not request is for a reload // navigation. get isReloadNavigation() { webidl.brandCheck(this, _Request); return this[kState].reloadNavigation; } // Returns a boolean indicating whether or not request is for a history // navigation (a.k.a. back-forward navigation). get isHistoryNavigation() { webidl.brandCheck(this, _Request); 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, _Request); return this[kSignal]; } get body() { webidl.brandCheck(this, _Request); return this[kState].body ? this[kState].body.stream : null; } get bodyUsed() { webidl.brandCheck(this, _Request); return !!this[kState].body && util.isDisturbed(this[kState].body.stream); } get duplex() { webidl.brandCheck(this, _Request); return "half"; } // Returns a clone of request. clone() { webidl.brandCheck(this, _Request); if (bodyUnusable(this)) { throw new TypeError("unusable"); } const clonedRequest = cloneRequest(this[kState]); const ac = new AbortController(); if (this.signal.aborted) { ac.abort(this.signal.reason); } else { let list2 = dependentControllerMap.get(this.signal); if (list2 === void 0) { list2 = /* @__PURE__ */ new Set(); dependentControllerMap.set(this.signal, list2); } const acRef = new WeakRef(ac); list2.add(acRef); util.addAbortListener( ac.signal, buildAbort(acRef) ); } return fromInnerRequest(clonedRequest, ac.signal, getHeadersGuard(this[kHeaders])); } [nodeUtil.inspect.custom](depth, options) { if (options.depth === null) { options.depth = 2; } options.colors ??= true; const properties = { method: this.method, url: this.url, headers: this.headers, destination: this.destination, referrer: this.referrer, referrerPolicy: this.referrerPolicy, mode: this.mode, credentials: this.credentials, cache: this.cache, redirect: this.redirect, integrity: this.integrity, keepalive: this.keepalive, isReloadNavigation: this.isReloadNavigation, isHistoryNavigation: this.isHistoryNavigation, signal: this.signal }; return `Request ${nodeUtil.formatWithOptions(options, properties)}`; } }; mixinBody(Request2); function makeRequest(init) { return { method: init.method ?? "GET", localURLsOnly: init.localURLsOnly ?? false, unsafeRequest: init.unsafeRequest ?? false, body: init.body ?? null, client: init.client ?? null, reservedClient: init.reservedClient ?? null, replacesClientId: init.replacesClientId ?? "", window: init.window ?? "client", keepalive: init.keepalive ?? false, serviceWorkers: init.serviceWorkers ?? "all", initiator: init.initiator ?? "", destination: init.destination ?? "", priority: init.priority ?? null, origin: init.origin ?? "client", policyContainer: init.policyContainer ?? "client", referrer: init.referrer ?? "client", referrerPolicy: init.referrerPolicy ?? "", mode: init.mode ?? "no-cors", useCORSPreflightFlag: init.useCORSPreflightFlag ?? false, credentials: init.credentials ?? "same-origin", useCredentials: init.useCredentials ?? false, cache: init.cache ?? "default", redirect: init.redirect ?? "follow", integrity: init.integrity ?? "", cryptoGraphicsNonceMetadata: init.cryptoGraphicsNonceMetadata ?? "", parserMetadata: init.parserMetadata ?? "", reloadNavigation: init.reloadNavigation ?? false, historyNavigation: init.historyNavigation ?? false, userActivation: init.userActivation ?? false, taintedOrigin: init.taintedOrigin ?? false, redirectCount: init.redirectCount ?? 0, responseTainting: init.responseTainting ?? "basic", preventNoCacheCacheControlHeaderModification: init.preventNoCacheCacheControlHeaderModification ?? false, done: init.done ?? false, timingAllowFailed: init.timingAllowFailed ?? false, urlList: init.urlList, url: init.urlList[0], headersList: init.headersList ? new HeadersList(init.headersList) : new HeadersList() }; } function cloneRequest(request) { const newRequest = makeRequest({ ...request, body: null }); if (request.body != null) { newRequest.body = cloneBody(newRequest, request.body); } return newRequest; } function fromInnerRequest(innerRequest, signal, guard) { const request = new Request2(kConstruct); request[kState] = innerRequest; request[kSignal] = signal; request[kHeaders] = new Headers3(kConstruct); setHeadersList(request[kHeaders], innerRequest.headersList); setHeadersGuard(request[kHeaders], guard); return request; } Object.defineProperties(Request2.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( Request2 ); webidl.converters.RequestInfo = function(V, prefix, argument) { if (typeof V === "string") { return webidl.converters.USVString(V, prefix, argument); } if (V instanceof Request2) { return webidl.converters.Request(V, prefix, argument); } return webidl.converters.USVString(V, prefix, argument); }; 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, "RequestInit", "signal", { strict: false } ) ) }, { key: "window", converter: webidl.converters.any }, { key: "duplex", converter: webidl.converters.DOMString, allowedValues: requestDuplex }, { key: "dispatcher", // undici specific option converter: webidl.converters.any } ]); module2.exports = { Request: Request2, makeRequest, fromInnerRequest, cloneRequest }; } }); // node_modules/undici/lib/web/fetch/index.js var require_fetch = __commonJS({ "node_modules/undici/lib/web/fetch/index.js"(exports2, module2) { "use strict"; var { makeNetworkError, makeAppropriateNetworkError, filterResponse, makeResponse, fromInnerResponse } = require_response(); var { HeadersList } = require_headers(); var { Request: Request2, cloneRequest } = require_request2(); var zlib = require("node:zlib"); var { bytesMatch, makePolicyContainer, clonePolicyContainer, requestBadPort, TAOCheck, appendRequestOriginHeader, responseLocationURL, requestCurrentURL, setRequestReferrerPolicyOnRedirect, tryUpgradeRequestToAPotentiallyTrustworthyURL, createOpaqueTimingInfo, appendFetchMetadata, corsCheck, crossOriginResourcePolicyCheck, determineRequestsReferrer, coarsenedSharedCurrentTime, createDeferredPromise, isBlobLike, sameOrigin, isCancelled, isAborted, isErrorLike, fullyReadBody, readableStreamClose, isomorphicEncode, urlIsLocal, urlIsHttpHttpsScheme, urlHasHttpsScheme, clampAndCoarsenConnectionTimingInfo, simpleRangeHeaderValue, buildContentRange, createInflate, extractMimeType } = require_util2(); var { kState, kDispatcher } = require_symbols2(); var assert4 = require("node:assert"); var { safelyExtractBody, extractBody } = require_body(); var { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet } = require_constants3(); var EE = require("node:events"); var { Readable: Readable2, pipeline, finished } = require("node:stream"); var { addAbortListener, isErrored, isReadable, bufferToLowerCasedHeaderName } = require_util(); var { dataURLProcessor, serializeAMimeType, minimizeSupportedMimeType } = require_data_url(); var { getGlobalDispatcher } = require_global2(); var { webidl } = require_webidl(); var { STATUS_CODES: STATUS_CODES2 } = require("node:http"); var GET_OR_HEAD = ["GET", "HEAD"]; var defaultUserAgent = typeof __UNDICI_IS_NODE__ !== "undefined" || typeof esbuildDetection !== "undefined" ? "node" : "undici"; var resolveObjectURL; var Fetch = class extends EE { constructor(dispatcher) { super(); this.dispatcher = dispatcher; this.connection = null; this.dump = false; this.state = "ongoing"; } terminate(reason) { if (this.state !== "ongoing") { return; } this.state = "terminated"; this.connection?.destroy(reason); this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; if (!error3) { error3 = new DOMException("The operation was aborted.", "AbortError"); } this.serializedAbortReason = error3; this.connection?.destroy(error3); this.emit("terminated", error3); } }; function handleFetchDone(response) { finalizeAndReportTiming(response, "fetch"); } function fetch2(input, init = void 0) { webidl.argumentLengthCheck(arguments, 1, "globalThis.fetch"); let p2 = createDeferredPromise(); let requestObject; try { requestObject = new Request2(input, init); } catch (e5) { p2.reject(e5); return p2.promise; } const request = requestObject[kState]; if (requestObject.signal.aborted) { abortFetch(p2, request, null, requestObject.signal.reason); return p2.promise; } const globalObject = request.client.globalObject; if (globalObject?.constructor?.name === "ServiceWorkerGlobalScope") { request.serviceWorkers = "none"; } let responseObject = null; let locallyAborted = false; let controller = null; addAbortListener( requestObject.signal, () => { locallyAborted = true; assert4(controller != null); controller.abort(requestObject.signal.reason); const realResponse = responseObject?.deref(); abortFetch(p2, request, realResponse, requestObject.signal.reason); } ); const processResponse = (response) => { if (locallyAborted) { return; } if (response.aborted) { abortFetch(p2, request, responseObject, controller.serializedAbortReason); return; } if (response.type === "error") { p2.reject(new TypeError("fetch failed", { cause: response.error })); return; } responseObject = new WeakRef(fromInnerResponse(response, "immutable")); p2.resolve(responseObject.deref()); p2 = null; }; controller = fetching({ request, processResponseEndOfBody: handleFetchDone, processResponse, dispatcher: requestObject[kDispatcher] // undici }); return p2.promise; } 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.href, initiatorType, globalThis, cacheState ); } var markResourceTiming = performance.markResourceTiming; function abortFetch(p2, request, responseObject, error3) { if (p2) { p2.reject(error3); } if (request.body != null && isReadable(request.body?.stream)) { request.body.stream.cancel(error3).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(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } throw err; }); } } function fetching({ request, processRequestBodyChunkLength, processRequestEndOfBody, processResponse, processResponseEndOfBody, processResponseConsumeBody, useParallelQueue = false, dispatcher = getGlobalDispatcher() // undici }) { assert4(dispatcher); let taskDestination = null; let crossOriginIsolatedCapability = false; if (request.client != null) { taskDestination = request.client.globalObject; crossOriginIsolatedCapability = request.client.crossOriginIsolatedCapability; } const currentTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability); const timingInfo = createOpaqueTimingInfo({ startTime: currentTime }); const fetchParams = { controller: new Fetch(dispatcher), request, timingInfo, processRequestBodyChunkLength, processRequestEndOfBody, processResponse, processResponseConsumeBody, processResponseEndOfBody, taskDestination, crossOriginIsolatedCapability }; assert4(!request.body || request.body.stream); if (request.window === "client") { request.window = request.client?.globalObject?.constructor?.name === "Window" ? request.client : "no-window"; } if (request.origin === "client") { request.origin = request.client.origin; } if (request.policyContainer === "client") { if (request.client != null) { request.policyContainer = clonePolicyContainer( request.client.policyContainer ); } else { request.policyContainer = makePolicyContainer(); } } if (!request.headersList.contains("accept", true)) { const value = "*/*"; request.headersList.append("accept", value, true); } if (!request.headersList.contains("accept-language", true)) { request.headersList.append("accept-language", "*", true); } if (request.priority === null) { } if (subresourceSet.has(request.destination)) { } mainFetch(fetchParams).catch((err) => { fetchParams.controller.terminate(err); }); return fetchParams.controller; } async function mainFetch(fetchParams, recursive = false) { const request = fetchParams.request; let response = null; if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) { response = makeNetworkError("local URLs only"); } tryUpgradeRequestToAPotentiallyTrustworthyURL(request); if (requestBadPort(request) === "blocked") { response = makeNetworkError("bad port"); } if (request.referrerPolicy === "") { request.referrerPolicy = request.policyContainer.referrerPolicy; } if (request.referrer !== "no-referrer") { request.referrer = determineRequestsReferrer(request); } if (response === null) { response = await (async () => { const currentURL = requestCurrentURL(request); if ( // - request’s current URL’s origin is same origin with request’s origin, // and request’s response tainting is "basic" sameOrigin(currentURL, request.url) && request.responseTainting === "basic" || // request’s current URL’s scheme is "data" currentURL.protocol === "data:" || // - request’s mode is "navigate" or "websocket" (request.mode === "navigate" || request.mode === "websocket") ) { request.responseTainting = "basic"; return await schemeFetch(fetchParams); } if (request.mode === "same-origin") { return makeNetworkError('request mode cannot be "same-origin"'); } if (request.mode === "no-cors") { if (request.redirect !== "follow") { return makeNetworkError( 'redirect mode cannot be "follow" for "no-cors" request' ); } request.responseTainting = "opaque"; return await schemeFetch(fetchParams); } if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) { return makeNetworkError("URL scheme must be a HTTP(S) scheme"); } request.responseTainting = "cors"; return await httpFetch(fetchParams); })(); } if (recursive) { return response; } if (response.status !== 0 && !response.internalResponse) { if (request.responseTainting === "cors") { } if (request.responseTainting === "basic") { response = filterResponse(response, "basic"); } else if (request.responseTainting === "cors") { response = filterResponse(response, "cors"); } else if (request.responseTainting === "opaque") { response = filterResponse(response, "opaque"); } else { assert4(false); } } let internalResponse = response.status === 0 ? response : response.internalResponse; if (internalResponse.urlList.length === 0) { internalResponse.urlList.push(...request.urlList); } if (!request.timingAllowFailed) { response.timingAllowPassed = true; } if (response.type === "opaque" && internalResponse.status === 206 && internalResponse.rangeRequested && !request.headers.contains("range", true)) { response = internalResponse = makeNetworkError(); } if (response.status !== 0 && (request.method === "HEAD" || request.method === "CONNECT" || nullBodyStatus.includes(internalResponse.status))) { internalResponse.body = null; fetchParams.controller.dump = true; } if (request.integrity) { const processBodyError = (reason) => fetchFinale(fetchParams, makeNetworkError(reason)); if (request.responseTainting === "opaque" || response.body == null) { processBodyError(response.error); return; } const processBody = (bytes) => { if (!bytesMatch(bytes, request.integrity)) { processBodyError("integrity mismatch"); return; } response.body = safelyExtractBody(bytes)[0]; fetchFinale(fetchParams, response); }; await fullyReadBody(response.body, processBody, processBodyError); } else { fetchFinale(fetchParams, response); } } function schemeFetch(fetchParams) { if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) { return Promise.resolve(makeAppropriateNetworkError(fetchParams)); } const { request } = fetchParams; const { protocol: scheme } = requestCurrentURL(request); switch (scheme) { case "about:": { return Promise.resolve(makeNetworkError("about scheme is not supported")); } case "blob:": { if (!resolveObjectURL) { resolveObjectURL = require("node:buffer").resolveObjectURL; } const blobURLEntry = requestCurrentURL(request); if (blobURLEntry.search.length !== 0) { return Promise.resolve(makeNetworkError("NetworkError when attempting to fetch resource.")); } const blob = resolveObjectURL(blobURLEntry.toString()); if (request.method !== "GET" || !isBlobLike(blob)) { return Promise.resolve(makeNetworkError("invalid method")); } const response = makeResponse(); const fullLength = blob.size; const serializedFullLength = isomorphicEncode(`${fullLength}`); const type = blob.type; if (!request.headersList.contains("range", true)) { const bodyWithType = extractBody(blob); response.statusText = "OK"; response.body = bodyWithType[0]; response.headersList.set("content-length", serializedFullLength, true); response.headersList.set("content-type", type, true); } else { response.rangeRequested = true; const rangeHeader = request.headersList.get("range", true); const rangeValue = simpleRangeHeaderValue(rangeHeader, true); if (rangeValue === "failure") { return Promise.resolve(makeNetworkError("failed to fetch the data URL")); } let { rangeStartValue: rangeStart, rangeEndValue: rangeEnd } = rangeValue; if (rangeStart === null) { rangeStart = fullLength - rangeEnd; rangeEnd = rangeStart + rangeEnd - 1; } else { if (rangeStart >= fullLength) { return Promise.resolve(makeNetworkError("Range start is greater than the blob's size.")); } if (rangeEnd === null || rangeEnd >= fullLength) { rangeEnd = fullLength - 1; } } const slicedBlob = blob.slice(rangeStart, rangeEnd, type); const slicedBodyWithType = extractBody(slicedBlob); response.body = slicedBodyWithType[0]; const serializedSlicedLength = isomorphicEncode(`${slicedBlob.size}`); const contentRange = buildContentRange(rangeStart, rangeEnd, fullLength); response.status = 206; response.statusText = "Partial Content"; response.headersList.set("content-length", serializedSlicedLength, true); response.headersList.set("content-type", type, true); response.headersList.set("content-range", contentRange, true); } return Promise.resolve(response); } case "data:": { const currentURL = requestCurrentURL(request); 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")); } } } function finalizeResponse(fetchParams, response) { fetchParams.request.done = true; if (fetchParams.processResponseDone != null) { queueMicrotask(() => fetchParams.processResponseDone(response)); } } function fetchFinale(fetchParams, response) { let timingInfo = fetchParams.timingInfo; const processResponseEndOfBody = () => { const unsafeEndTime = Date.now(); if (fetchParams.request.destination === "document") { fetchParams.controller.fullTimingInfo = timingInfo; } fetchParams.controller.reportTimingSteps = () => { if (fetchParams.request.url.protocol !== "https:") { return; } timingInfo.endTime = unsafeEndTime; let cacheState = response.cacheState; const bodyInfo = response.bodyInfo; if (!response.timingAllowPassed) { timingInfo = createOpaqueTimingInfo(timingInfo); cacheState = ""; } let responseStatus = 0; if (fetchParams.request.mode !== "navigator" || !response.hasCrossOriginRedirects) { responseStatus = response.status; const mimeType = extractMimeType(response.headersList); if (mimeType !== "failure") { bodyInfo.contentType = minimizeSupportedMimeType(mimeType); } } if (fetchParams.request.initiatorType != null) { markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus); } }; const processResponseEndOfBodyTask = () => { fetchParams.request.done = true; if (fetchParams.processResponseEndOfBody != null) { queueMicrotask(() => fetchParams.processResponseEndOfBody(response)); } if (fetchParams.request.initiatorType != null) { fetchParams.controller.reportTimingSteps(); } }; queueMicrotask(() => processResponseEndOfBodyTask()); }; if (fetchParams.processResponse != null) { queueMicrotask(() => { fetchParams.processResponse(response); fetchParams.processResponse = null; }); } const internalResponse = response.type === "error" ? response : response.internalResponse ?? response; if (internalResponse.body == null) { processResponseEndOfBody(); } else { finished(internalResponse.body.stream, () => { processResponseEndOfBody(); }); } } async function httpFetch(fetchParams) { const request = fetchParams.request; let response = null; let actualResponse = null; const timingInfo = fetchParams.timingInfo; if (request.serviceWorkers === "all") { } if (response === null) { if (request.redirect === "follow") { request.serviceWorkers = "none"; } actualResponse = response = await httpNetworkOrCacheFetch(fetchParams); if (request.responseTainting === "cors" && corsCheck(request, response) === "failure") { return makeNetworkError("cors failure"); } if (TAOCheck(request, response) === "failure") { request.timingAllowFailed = true; } } if ((request.responseTainting === "opaque" || response.type === "opaque") && crossOriginResourcePolicyCheck( request.origin, request.client, request.destination, actualResponse ) === "blocked") { return makeNetworkError("blocked"); } if (redirectStatusSet.has(actualResponse.status)) { if (request.redirect !== "manual") { fetchParams.controller.connection.destroy(void 0, false); } if (request.redirect === "error") { response = makeNetworkError("unexpected redirect"); } else if (request.redirect === "manual") { response = actualResponse; } else if (request.redirect === "follow") { response = await httpRedirectFetch(fetchParams, response); } else { assert4(false); } } response.timingInfo = timingInfo; return response; } function httpRedirectFetch(fetchParams, response) { const request = fetchParams.request; const actualResponse = response.internalResponse ? response.internalResponse : response; let locationURL; try { locationURL = responseLocationURL( actualResponse, requestCurrentURL(request).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 (request.redirectCount === 20) { return Promise.resolve(makeNetworkError("redirect count exceeded")); } request.redirectCount += 1; if (request.mode === "cors" && (locationURL.username || locationURL.password) && !sameOrigin(request, locationURL)) { return Promise.resolve(makeNetworkError('cross origin not allowed for request mode "cors"')); } if (request.responseTainting === "cors" && (locationURL.username || locationURL.password)) { return Promise.resolve(makeNetworkError( 'URL cannot contain credentials for request mode "cors"' )); } if (actualResponse.status !== 303 && request.body != null && request.body.source == null) { return Promise.resolve(makeNetworkError()); } if ([301, 302].includes(actualResponse.status) && request.method === "POST" || actualResponse.status === 303 && !GET_OR_HEAD.includes(request.method)) { request.method = "GET"; request.body = null; for (const headerName of requestBodyHeader) { request.headersList.delete(headerName); } } if (!sameOrigin(requestCurrentURL(request), locationURL)) { request.headersList.delete("authorization", true); request.headersList.delete("proxy-authorization", true); request.headersList.delete("cookie", true); request.headersList.delete("host", true); } if (request.body != null) { assert4(request.body.source != null); request.body = safelyExtractBody(request.body.source)[0]; } const timingInfo = fetchParams.timingInfo; timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); if (timingInfo.redirectStartTime === 0) { timingInfo.redirectStartTime = timingInfo.startTime; } request.urlList.push(locationURL); setRequestReferrerPolicyOnRedirect(request, actualResponse); return mainFetch(fetchParams, true); } async function httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false) { const request = fetchParams.request; let httpFetchParams = null; let httpRequest = null; let response = null; const httpCache = null; const revalidatingFlag = false; if (request.window === "no-window" && request.redirect === "error") { httpFetchParams = fetchParams; httpRequest = request; } else { httpRequest = cloneRequest(request); httpFetchParams = { ...fetchParams }; httpFetchParams.request = httpRequest; } const includeCredentials = request.credentials === "include" || request.credentials === "same-origin" && request.responseTainting === "basic"; const contentLength = httpRequest.body ? httpRequest.body.length : null; let contentLengthHeaderValue = null; if (httpRequest.body == null && ["POST", "PUT"].includes(httpRequest.method)) { contentLengthHeaderValue = "0"; } if (contentLength != null) { contentLengthHeaderValue = isomorphicEncode(`${contentLength}`); } if (contentLengthHeaderValue != null) { httpRequest.headersList.append("content-length", contentLengthHeaderValue, true); } if (contentLength != null && httpRequest.keepalive) { } if (httpRequest.referrer instanceof URL) { httpRequest.headersList.append("referer", isomorphicEncode(httpRequest.referrer.href), true); } appendRequestOriginHeader(httpRequest); appendFetchMetadata(httpRequest); if (!httpRequest.headersList.contains("user-agent", true)) { httpRequest.headersList.append("user-agent", defaultUserAgent); } if (httpRequest.cache === "default" && (httpRequest.headersList.contains("if-modified-since", true) || httpRequest.headersList.contains("if-none-match", true) || httpRequest.headersList.contains("if-unmodified-since", true) || httpRequest.headersList.contains("if-match", true) || httpRequest.headersList.contains("if-range", true))) { httpRequest.cache = "no-store"; } if (httpRequest.cache === "no-cache" && !httpRequest.preventNoCacheCacheControlHeaderModification && !httpRequest.headersList.contains("cache-control", true)) { httpRequest.headersList.append("cache-control", "max-age=0", true); } if (httpRequest.cache === "no-store" || httpRequest.cache === "reload") { if (!httpRequest.headersList.contains("pragma", true)) { httpRequest.headersList.append("pragma", "no-cache", true); } if (!httpRequest.headersList.contains("cache-control", true)) { httpRequest.headersList.append("cache-control", "no-cache", true); } } if (httpRequest.headersList.contains("range", true)) { httpRequest.headersList.append("accept-encoding", "identity", true); } if (!httpRequest.headersList.contains("accept-encoding", true)) { if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) { httpRequest.headersList.append("accept-encoding", "br, gzip, deflate", true); } else { httpRequest.headersList.append("accept-encoding", "gzip, deflate", true); } } httpRequest.headersList.delete("host", true); if (includeCredentials) { } if (httpCache == null) { httpRequest.cache = "no-store"; } if (httpRequest.cache !== "no-store" && httpRequest.cache !== "reload") { } if (response == null) { if (httpRequest.cache === "only-if-cached") { return makeNetworkError("only if cached"); } const forwardResponse = await httpNetworkFetch( httpFetchParams, includeCredentials, isNewConnectionFetch ); if (!safeMethodsSet.has(httpRequest.method) && forwardResponse.status >= 200 && forwardResponse.status <= 399) { } if (revalidatingFlag && forwardResponse.status === 304) { } if (response == null) { response = forwardResponse; } } response.urlList = [...httpRequest.urlList]; if (httpRequest.headersList.contains("range", true)) { response.rangeRequested = true; } response.requestIncludesCredentials = includeCredentials; if (response.status === 407) { if (request.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 (request.body == null || request.body.source != null) ) { if (isCancelled(fetchParams)) { return makeAppropriateNetworkError(fetchParams); } fetchParams.controller.connection.destroy(); response = await httpNetworkOrCacheFetch( fetchParams, isAuthenticationFetch, true ); } if (isAuthenticationFetch) { } return response; } async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) { assert4(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); fetchParams.controller.connection = { abort: null, destroyed: false, destroy(err, abort = true) { if (!this.destroyed) { this.destroyed = true; if (abort) { this.abort?.(err ?? new DOMException("The operation was aborted.", "AbortError")); } } } }; const request = fetchParams.request; let response = null; const timingInfo = fetchParams.timingInfo; const httpCache = null; if (httpCache == null) { request.cache = "no-store"; } const newConnection = forceNewConnection ? "yes" : "no"; if (request.mode === "websocket") { } else { } let requestBody = null; if (request.body == null && fetchParams.processRequestEndOfBody) { queueMicrotask(() => fetchParams.processRequestEndOfBody()); } else if (request.body != null) { const processBodyChunk = async function* (bytes) { if (isCancelled(fetchParams)) { return; } yield bytes; fetchParams.processRequestBodyChunkLength?.(bytes.byteLength); }; const processEndOfBody = () => { if (isCancelled(fetchParams)) { return; } if (fetchParams.processRequestEndOfBody) { fetchParams.processRequestEndOfBody(); } }; const processBodyError = (e5) => { if (isCancelled(fetchParams)) { return; } if (e5.name === "AbortError") { fetchParams.controller.abort(); } else { fetchParams.controller.terminate(e5); } }; requestBody = (async function* () { try { for await (const bytes of request.body.stream) { yield* processBodyChunk(bytes); } processEndOfBody(); } catch (err) { processBodyError(err); } })(); } try { const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody }); if (socket) { response = makeResponse({ status, statusText, headersList, socket }); } else { const iterator = body[Symbol.asyncIterator](); fetchParams.controller.next = () => iterator.next(); response = makeResponse({ status, statusText, headersList }); } } catch (err) { if (err.name === "AbortError") { fetchParams.controller.connection.destroy(); return makeAppropriateNetworkError(fetchParams, err); } return makeNetworkError(err); } const pullAlgorithm = async () => { await fetchParams.controller.resume(); }; const cancelAlgorithm = (reason) => { if (!isCancelled(fetchParams)) { fetchParams.controller.abort(reason); } }; const stream = new ReadableStream( { async start(controller) { fetchParams.controller.controller = controller; }, async pull(controller) { await pullAlgorithm(controller); }, async cancel(reason) { await cancelAlgorithm(reason); }, type: "bytes" } ); response.body = { stream, source: null, length: null }; fetchParams.controller.onAborted = onAborted; fetchParams.controller.on("terminated", onAborted); fetchParams.controller.resume = async () => { while (true) { let bytes; let isFailure; try { const { done, value } = await fetchParams.controller.next(); if (isAborted(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; } const buffer = new Uint8Array(bytes); if (buffer.byteLength) { fetchParams.controller.controller.enqueue(buffer); } if (isErrored(stream)) { fetchParams.controller.terminate(); return; } if (fetchParams.controller.controller.desiredSize <= 0) { return; } } }; function onAborted(reason) { if (isAborted(fetchParams)) { response.aborted = true; if (isReadable(stream)) { fetchParams.controller.controller.error( fetchParams.controller.serializedAbortReason ); } } else { if (isReadable(stream)) { fetchParams.controller.controller.error(new TypeError("terminated", { cause: isErrorLike(reason) ? reason : void 0 })); } } fetchParams.controller.connection.destroy(); } return response; function dispatch({ body }) { const url = requestCurrentURL(request); const agent = fetchParams.controller.dispatcher; return new Promise((resolve, reject) => agent.dispatch( { path: url.pathname + url.search, origin: url.origin, method: request.method, body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body, headers: request.headersList.entries, maxRedirections: 0, upgrade: request.mode === "websocket" ? "websocket" : void 0 }, { body: null, abort: null, onConnect(abort) { const { connection } = fetchParams.controller; timingInfo.finalConnectionTimingInfo = clampAndCoarsenConnectionTimingInfo(void 0, timingInfo.postRedirectStartTime, fetchParams.crossOriginIsolatedCapability); if (connection.destroyed) { abort(new DOMException("The operation was aborted.", "AbortError")); } else { fetchParams.controller.on("terminated", abort); this.abort = connection.abort = abort; } timingInfo.finalNetworkRequestStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); }, onResponseStarted() { timingInfo.finalNetworkResponseStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability); }, onHeaders(status, rawHeaders, resume3, statusText) { if (status < 200) { return; } let location = ""; const headersList = new HeadersList(); for (let i5 = 0; i5 < rawHeaders.length; i5 += 2) { headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i5]), rawHeaders[i5 + 1].toString("latin1"), true); } location = headersList.get("location", true); this.body = new Readable2({ read: resume3 }); const decoders = []; const willFollow = location && request.redirect === "follow" && redirectStatusSet.has(status); if (request.method !== "HEAD" && request.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) { const contentEncoding = headersList.get("content-encoding", true); const codings = contentEncoding ? contentEncoding.toLowerCase().split(",") : []; const maxContentEncodings = 5; if (codings.length > maxContentEncodings) { reject(new Error(`too many content-encodings in response: ${codings.length}, maximum allowed is ${maxContentEncodings}`)); return true; } for (let i5 = codings.length - 1; i5 >= 0; --i5) { const coding = codings[i5].trim(); if (coding === "x-gzip" || coding === "gzip") { decoders.push(zlib.createGunzip({ // Be less strict when decoding compressed responses, since sometimes // servers send slightly invalid responses that are still accepted // by common browsers. // Always using Z_SYNC_FLUSH is what cURL does. flush: zlib.constants.Z_SYNC_FLUSH, finishFlush: zlib.constants.Z_SYNC_FLUSH })); } else if (coding === "deflate") { decoders.push(createInflate({ flush: zlib.constants.Z_SYNC_FLUSH, finishFlush: zlib.constants.Z_SYNC_FLUSH })); } else if (coding === "br") { decoders.push(zlib.createBrotliDecompress({ flush: zlib.constants.BROTLI_OPERATION_FLUSH, finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH })); } else { decoders.length = 0; break; } } } const onError = this.onError.bind(this); resolve({ status, statusText, headersList, body: decoders.length ? pipeline(this.body, ...decoders, (err) => { if (err) { this.onError(err); } }).on("error", onError) : this.body.on("error", onError) }); return true; }, onData(chunk) { if (fetchParams.controller.dump) { return; } const bytes = chunk; timingInfo.encodedBodySize += bytes.byteLength; return this.body.push(bytes); }, onComplete() { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } if (fetchParams.controller.onAborted) { fetchParams.controller.off("terminated", fetchParams.controller.onAborted); } fetchParams.controller.ended = true; this.body.push(null); }, onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } this.body?.destroy(error3); fetchParams.controller.terminate(error3); reject(error3); }, onUpgrade(status, rawHeaders, socket) { if (status !== 101) { return; } const headersList = new HeadersList(); for (let i5 = 0; i5 < rawHeaders.length; i5 += 2) { headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i5]), rawHeaders[i5 + 1].toString("latin1"), true); } resolve({ status, statusText: STATUS_CODES2[status], headersList, socket }); return true; } } )); } } module2.exports = { fetch: fetch2, Fetch, fetching, finalizeAndReportTiming }; } }); // node_modules/undici/lib/web/fileapi/symbols.js var require_symbols3 = __commonJS({ "node_modules/undici/lib/web/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { kState: /* @__PURE__ */ Symbol("FileReader state"), kResult: /* @__PURE__ */ Symbol("FileReader result"), kError: /* @__PURE__ */ Symbol("FileReader error"), kLastProgressEventFired: /* @__PURE__ */ Symbol("FileReader last progress event fired timestamp"), kEvents: /* @__PURE__ */ Symbol("FileReader events"), kAborted: /* @__PURE__ */ Symbol("FileReader aborted") }; } }); // node_modules/undici/lib/web/fileapi/progressevent.js var require_progressevent = __commonJS({ "node_modules/undici/lib/web/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type, eventInitDict = {}) { type = webidl.converters.DOMString(type, "ProgressEvent constructor", "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; } }; 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 } ]); module2.exports = { ProgressEvent }; } }); // node_modules/undici/lib/web/fileapi/encoding.js var require_encoding = __commonJS({ "node_modules/undici/lib/web/fileapi/encoding.js"(exports2, module2) { "use strict"; 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"; } } module2.exports = { getEncoding }; } }); // node_modules/undici/lib/web/fileapi/util.js var require_util4 = __commonJS({ "node_modules/undici/lib/web/fileapi/util.js"(exports2, module2) { "use strict"; var { kState, kError, kResult, kAborted, kLastProgressEventFired } = require_symbols3(); var { ProgressEvent } = require_progressevent(); var { getEncoding } = require_encoding(); var { serializeAMimeType, parseMIMEType } = require_data_url(); var { types: types3 } = require("node:util"); var { StringDecoder } = require("string_decoder"); var { btoa } = require("node:buffer"); var staticPropertyDescriptors = { enumerable: true, writable: false, configurable: false }; function readOperation(fr, blob, type, encodingName) { if (fr[kState] === "loading") { throw new DOMException("Invalid state", "InvalidStateError"); } fr[kState] = "loading"; fr[kResult] = null; fr[kError] = null; const stream = blob.stream(); const reader = stream.getReader(); const bytes = []; let chunkPromise = reader.read(); let isFirstChunk = true; (async () => { while (!fr[kAborted]) { try { const { done, value } = await chunkPromise; if (isFirstChunk && !fr[kAborted]) { queueMicrotask(() => { fireAProgressEvent("loadstart", fr); }); } isFirstChunk = false; if (!done && types3.isUint8Array(value)) { bytes.push(value); if ((fr[kLastProgressEventFired] === void 0 || Date.now() - fr[kLastProgressEventFired] >= 50) && !fr[kAborted]) { fr[kLastProgressEventFired] = Date.now(); queueMicrotask(() => { fireAProgressEvent("progress", fr); }); } chunkPromise = reader.read(); } else if (done) { queueMicrotask(() => { fr[kState] = "done"; try { const result = packageData(bytes, type, blob.type, encodingName); if (fr[kAborted]) { return; } fr[kResult] = result; fireAProgressEvent("load", fr); } catch (error3) { fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); } }); break; } } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); } }); break; } } })(); } function fireAProgressEvent(e5, reader) { const event = new ProgressEvent(e5, { bubbles: false, cancelable: false }); reader.dispatchEvent(event); } 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 decoder2 = new StringDecoder("latin1"); for (const chunk of bytes) { dataURL += btoa(decoder2.write(chunk)); } dataURL += btoa(decoder2.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 decode2(bytes, encoding); } case "ArrayBuffer": { const sequence = combineByteSequences(bytes); return sequence.buffer; } case "BinaryString": { let binaryString = ""; const decoder2 = new StringDecoder("latin1"); for (const chunk of bytes) { binaryString += decoder2.write(chunk); } binaryString += decoder2.end(); return binaryString; } } } function decode2(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); } function BOMSniffing(ioQueue) { const [a5, b6, c5] = ioQueue; if (a5 === 239 && b6 === 187 && c5 === 191) { return "UTF-8"; } else if (a5 === 254 && b6 === 255) { return "UTF-16BE"; } else if (a5 === 255 && b6 === 254) { return "UTF-16LE"; } return null; } 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)); } module2.exports = { staticPropertyDescriptors, readOperation, fireAProgressEvent }; } }); // node_modules/undici/lib/web/fileapi/filereader.js var require_filereader = __commonJS({ "node_modules/undici/lib/web/fileapi/filereader.js"(exports2, module2) { "use strict"; 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 _FileReader 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, _FileReader); webidl.argumentLengthCheck(arguments, 1, "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, _FileReader); webidl.argumentLengthCheck(arguments, 1, "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, _FileReader); webidl.argumentLengthCheck(arguments, 1, "FileReader.readAsText"); blob = webidl.converters.Blob(blob, { strict: false }); if (encoding !== void 0) { encoding = webidl.converters.DOMString(encoding, "FileReader.readAsText", "encoding"); } readOperation(this, blob, "Text", encoding); } /** * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL * @param {import('buffer').Blob} blob */ readAsDataURL(blob) { webidl.brandCheck(this, _FileReader); webidl.argumentLengthCheck(arguments, 1, "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, _FileReader); 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, _FileReader); return this[kResult]; } /** * @see https://w3c.github.io/FileAPI/#dom-filereader-error */ get error() { webidl.brandCheck(this, _FileReader); return this[kError]; } get onloadend() { webidl.brandCheck(this, _FileReader); return this[kEvents].loadend; } set onloadend(fn) { webidl.brandCheck(this, _FileReader); if (this[kEvents].loadend) { this.removeEventListener("loadend", this[kEvents].loadend); } if (typeof fn === "function") { this[kEvents].loadend = fn; this.addEventListener("loadend", fn); } else { this[kEvents].loadend = null; } } get onerror() { webidl.brandCheck(this, _FileReader); return this[kEvents].error; } set onerror(fn) { webidl.brandCheck(this, _FileReader); if (this[kEvents].error) { this.removeEventListener("error", this[kEvents].error); } if (typeof fn === "function") { this[kEvents].error = fn; this.addEventListener("error", fn); } else { this[kEvents].error = null; } } get onloadstart() { webidl.brandCheck(this, _FileReader); return this[kEvents].loadstart; } set onloadstart(fn) { webidl.brandCheck(this, _FileReader); if (this[kEvents].loadstart) { this.removeEventListener("loadstart", this[kEvents].loadstart); } if (typeof fn === "function") { this[kEvents].loadstart = fn; this.addEventListener("loadstart", fn); } else { this[kEvents].loadstart = null; } } get onprogress() { webidl.brandCheck(this, _FileReader); return this[kEvents].progress; } set onprogress(fn) { webidl.brandCheck(this, _FileReader); if (this[kEvents].progress) { this.removeEventListener("progress", this[kEvents].progress); } if (typeof fn === "function") { this[kEvents].progress = fn; this.addEventListener("progress", fn); } else { this[kEvents].progress = null; } } get onload() { webidl.brandCheck(this, _FileReader); return this[kEvents].load; } set onload(fn) { webidl.brandCheck(this, _FileReader); if (this[kEvents].load) { this.removeEventListener("load", this[kEvents].load); } if (typeof fn === "function") { this[kEvents].load = fn; this.addEventListener("load", fn); } else { this[kEvents].load = null; } } get onabort() { webidl.brandCheck(this, _FileReader); return this[kEvents].abort; } set onabort(fn) { webidl.brandCheck(this, _FileReader); if (this[kEvents].abort) { this.removeEventListener("abort", this[kEvents].abort); } if (typeof fn === "function") { this[kEvents].abort = fn; this.addEventListener("abort", fn); } else { this[kEvents].abort = null; } } }; 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 }); module2.exports = { FileReader: FileReader2 }; } }); // node_modules/undici/lib/web/cache/symbols.js var require_symbols4 = __commonJS({ "node_modules/undici/lib/web/cache/symbols.js"(exports2, module2) { "use strict"; module2.exports = { kConstruct: require_symbols().kConstruct }; } }); // node_modules/undici/lib/web/cache/util.js var require_util5 = __commonJS({ "node_modules/undici/lib/web/cache/util.js"(exports2, module2) { "use strict"; var assert4 = require("node:assert"); var { URLSerializer } = require_data_url(); var { isValidHeaderName } = require_util2(); function urlEquals(A, B, excludeFragment = false) { const serializedA = URLSerializer(A, excludeFragment); const serializedB = URLSerializer(B, excludeFragment); return serializedA === serializedB; } function getFieldValues(header) { assert4(header !== null); const values = []; for (let value of header.split(",")) { value = value.trim(); if (isValidHeaderName(value)) { values.push(value); } } return values; } module2.exports = { urlEquals, getFieldValues }; } }); // node_modules/undici/lib/web/cache/cache.js var require_cache = __commonJS({ "node_modules/undici/lib/web/cache/cache.js"(exports2, module2) { "use strict"; var { kConstruct } = require_symbols4(); var { urlEquals, getFieldValues } = require_util5(); var { kEnumerableProperty, isDisturbed } = require_util(); var { webidl } = require_webidl(); var { Response, cloneResponse, fromInnerResponse } = require_response(); var { Request: Request2, fromInnerRequest } = require_request2(); var { kState } = require_symbols2(); var { fetching } = require_fetch(); var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util2(); var assert4 = require("node:assert"); var Cache = class _Cache { /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list * @type {requestResponseList} */ #relevantRequestResponseList; constructor() { if (arguments[0] !== kConstruct) { webidl.illegalConstructor(); } webidl.util.markAsUncloneable(this); this.#relevantRequestResponseList = arguments[1]; } async match(request, options = {}) { webidl.brandCheck(this, _Cache); const prefix = "Cache.match"; webidl.argumentLengthCheck(arguments, 1, prefix); request = webidl.converters.RequestInfo(request, prefix, "request"); options = webidl.converters.CacheQueryOptions(options, prefix, "options"); const p2 = this.#internalMatchAll(request, options, 1); if (p2.length === 0) { return; } return p2[0]; } async matchAll(request = void 0, options = {}) { webidl.brandCheck(this, _Cache); const prefix = "Cache.matchAll"; if (request !== void 0) request = webidl.converters.RequestInfo(request, prefix, "request"); options = webidl.converters.CacheQueryOptions(options, prefix, "options"); return this.#internalMatchAll(request, options); } async add(request) { webidl.brandCheck(this, _Cache); const prefix = "Cache.add"; webidl.argumentLengthCheck(arguments, 1, prefix); request = webidl.converters.RequestInfo(request, prefix, "request"); const requests = [request]; const responseArrayPromise = this.addAll(requests); return await responseArrayPromise; } async addAll(requests) { webidl.brandCheck(this, _Cache); const prefix = "Cache.addAll"; webidl.argumentLengthCheck(arguments, 1, prefix); const responsePromises = []; const requestList = []; for (let request of requests) { if (request === void 0) { throw webidl.errors.conversionFailed({ prefix, argument: "Argument 1", types: ["undefined is not allowed"] }); } request = webidl.converters.RequestInfo(request); if (typeof request === "string") { continue; } const r5 = request[kState]; if (!urlIsHttpHttpsScheme(r5.url) || r5.method !== "GET") { throw webidl.errors.exception({ header: prefix, message: "Expected http/s scheme when method is not GET." }); } } const fetchControllers = []; for (const request of requests) { const r5 = new Request2(request)[kState]; if (!urlIsHttpHttpsScheme(r5.url)) { throw webidl.errors.exception({ header: prefix, message: "Expected http/s scheme." }); } r5.initiator = "fetch"; r5.destination = "subresource"; requestList.push(r5); const responsePromise = createDeferredPromise(); fetchControllers.push(fetching({ request: r5, 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 p2 = Promise.all(responsePromises); const responses = await p2; const operations = []; let index = 0; for (const response of responses) { const operation2 = { type: "put", // 7.3.2 request: requestList[index], // 7.3.3 response // 7.3.4 }; operations.push(operation2); index++; } const cacheJobPromise = createDeferredPromise(); let errorData = null; try { this.#batchCacheOperations(operations); } catch (e5) { errorData = e5; } queueMicrotask(() => { if (errorData === null) { cacheJobPromise.resolve(void 0); } else { cacheJobPromise.reject(errorData); } }); return cacheJobPromise.promise; } async put(request, response) { webidl.brandCheck(this, _Cache); const prefix = "Cache.put"; webidl.argumentLengthCheck(arguments, 2, prefix); request = webidl.converters.RequestInfo(request, prefix, "request"); response = webidl.converters.Response(response, prefix, "response"); let innerRequest = null; if (request instanceof Request2) { innerRequest = request[kState]; } else { innerRequest = new Request2(request)[kState]; } if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== "GET") { throw webidl.errors.exception({ header: prefix, message: "Expected an http/s scheme when method is not GET" }); } const innerResponse = response[kState]; if (innerResponse.status === 206) { throw webidl.errors.exception({ header: prefix, 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: prefix, message: "Got * vary field value" }); } } } if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { throw webidl.errors.exception({ header: prefix, message: "Response body is locked or disturbed" }); } const clonedResponse = cloneResponse(innerResponse); const bodyReadPromise = createDeferredPromise(); if (innerResponse.body != null) { const stream = innerResponse.body.stream; const reader = stream.getReader(); readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject); } else { bodyReadPromise.resolve(void 0); } const operations = []; const operation2 = { type: "put", // 14. request: innerRequest, // 15. response: clonedResponse // 16. }; operations.push(operation2); const bytes = await bodyReadPromise.promise; if (clonedResponse.body != null) { clonedResponse.body.source = bytes; } const cacheJobPromise = createDeferredPromise(); let errorData = null; try { this.#batchCacheOperations(operations); } catch (e5) { errorData = e5; } queueMicrotask(() => { if (errorData === null) { cacheJobPromise.resolve(); } else { cacheJobPromise.reject(errorData); } }); return cacheJobPromise.promise; } async delete(request, options = {}) { webidl.brandCheck(this, _Cache); const prefix = "Cache.delete"; webidl.argumentLengthCheck(arguments, 1, prefix); request = webidl.converters.RequestInfo(request, prefix, "request"); options = webidl.converters.CacheQueryOptions(options, prefix, "options"); let r5 = null; if (request instanceof Request2) { r5 = request[kState]; if (r5.method !== "GET" && !options.ignoreMethod) { return false; } } else { assert4(typeof request === "string"); r5 = new Request2(request)[kState]; } const operations = []; const operation2 = { type: "delete", request: r5, options }; operations.push(operation2); const cacheJobPromise = createDeferredPromise(); let errorData = null; let requestResponses; try { requestResponses = this.#batchCacheOperations(operations); } catch (e5) { errorData = e5; } 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 {Promise} */ async keys(request = void 0, options = {}) { webidl.brandCheck(this, _Cache); const prefix = "Cache.keys"; if (request !== void 0) request = webidl.converters.RequestInfo(request, prefix, "request"); options = webidl.converters.CacheQueryOptions(options, prefix, "options"); let r5 = null; if (request !== void 0) { if (request instanceof Request2) { r5 = request[kState]; if (r5.method !== "GET" && !options.ignoreMethod) { return []; } } else if (typeof request === "string") { r5 = new Request2(request)[kState]; } } const promise = createDeferredPromise(); const requests = []; if (request === void 0) { for (const requestResponse of this.#relevantRequestResponseList) { requests.push(requestResponse[0]); } } else { const requestResponses = this.#queryCache(r5, options); for (const requestResponse of requestResponses) { requests.push(requestResponse[0]); } } queueMicrotask(() => { const requestList = []; for (const request2 of requests) { const requestObject = fromInnerRequest( request2, new AbortController().signal, "immutable" ); 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 cache5 = this.#relevantRequestResponseList; const backupCache = [...cache5]; const addedItems = []; const resultList = []; try { for (const operation2 of operations) { if (operation2.type !== "delete" && operation2.type !== "put") { throw webidl.errors.exception({ header: "Cache.#batchCacheOperations", message: 'operation type does not match "delete" or "put"' }); } if (operation2.type === "delete" && operation2.response != null) { throw webidl.errors.exception({ header: "Cache.#batchCacheOperations", message: "delete operation should not have an associated response" }); } if (this.#queryCache(operation2.request, operation2.options, addedItems).length) { throw new DOMException("???", "InvalidStateError"); } let requestResponses; if (operation2.type === "delete") { requestResponses = this.#queryCache(operation2.request, operation2.options); if (requestResponses.length === 0) { return []; } for (const requestResponse of requestResponses) { const idx = cache5.indexOf(requestResponse); assert4(idx !== -1); cache5.splice(idx, 1); } } else if (operation2.type === "put") { if (operation2.response == null) { throw webidl.errors.exception({ header: "Cache.#batchCacheOperations", message: "put operation should have an associated response" }); } const r5 = operation2.request; if (!urlIsHttpHttpsScheme(r5.url)) { throw webidl.errors.exception({ header: "Cache.#batchCacheOperations", message: "expected http or https scheme" }); } if (r5.method !== "GET") { throw webidl.errors.exception({ header: "Cache.#batchCacheOperations", message: "not get method" }); } if (operation2.options != null) { throw webidl.errors.exception({ header: "Cache.#batchCacheOperations", message: "options must not be defined" }); } requestResponses = this.#queryCache(operation2.request); for (const requestResponse of requestResponses) { const idx = cache5.indexOf(requestResponse); assert4(idx !== -1); cache5.splice(idx, 1); } cache5.push([operation2.request, operation2.response]); addedItems.push([operation2.request, operation2.response]); } resultList.push([operation2.request, operation2.response]); } return resultList; } catch (e5) { this.#relevantRequestResponseList.length = 0; this.#relevantRequestResponseList = backupCache; throw e5; } } /** * @see https://w3c.github.io/ServiceWorker/#query-cache * @param {any} requestQuery * @param {import('../../types/cache').CacheQueryOptions} options * @param {requestResponseList} targetStorage * @returns {requestResponseList} */ #queryCache(requestQuery, options, targetStorage) { const resultList = []; const storage = targetStorage ?? this.#relevantRequestResponseList; for (const requestResponse of storage) { const [cachedRequest, cachedResponse] = requestResponse; if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) { 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, request, response = null, options) { const queryURL = new URL(requestQuery.url); const cachedURL = new URL(request.url); if (options?.ignoreSearch) { cachedURL.search = ""; queryURL.search = ""; } if (!urlEquals(queryURL, cachedURL, true)) { return false; } if (response == null || options?.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 = request.headersList.get(fieldValue); const queryValue = requestQuery.headersList.get(fieldValue); if (requestValue !== queryValue) { return false; } } return true; } #internalMatchAll(request, options, maxResponses = Infinity) { let r5 = null; if (request !== void 0) { if (request instanceof Request2) { r5 = request[kState]; if (r5.method !== "GET" && !options.ignoreMethod) { return []; } } else if (typeof request === "string") { r5 = new Request2(request)[kState]; } } const responses = []; if (request === void 0) { for (const requestResponse of this.#relevantRequestResponseList) { responses.push(requestResponse[1]); } } else { const requestResponses = this.#queryCache(r5, options); for (const requestResponse of requestResponses) { responses.push(requestResponse[1]); } } const responseList = []; for (const response of responses) { const responseObject = fromInnerResponse(response, "immutable"); responseList.push(responseObject.clone()); if (responseList.length >= maxResponses) { break; } } return Object.freeze(responseList); } }; Object.defineProperties(Cache.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(Response); webidl.converters["sequence"] = webidl.sequenceConverter( webidl.converters.RequestInfo ); module2.exports = { Cache }; } }); // node_modules/undici/lib/web/cache/cachestorage.js var require_cachestorage = __commonJS({ "node_modules/undici/lib/web/cache/cachestorage.js"(exports2, module2) { "use strict"; var { kConstruct } = require_symbols4(); var { Cache } = require_cache(); var { webidl } = require_webidl(); var { kEnumerableProperty } = require_util(); var CacheStorage = class _CacheStorage { /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map * @type {Map} */ async has(cacheName) { webidl.brandCheck(this, _CacheStorage); const prefix = "CacheStorage.has"; webidl.argumentLengthCheck(arguments, 1, prefix); cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName"); return this.#caches.has(cacheName); } /** * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open * @param {string} cacheName * @returns {Promise} */ async open(cacheName) { webidl.brandCheck(this, _CacheStorage); const prefix = "CacheStorage.open"; webidl.argumentLengthCheck(arguments, 1, prefix); cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName"); if (this.#caches.has(cacheName)) { const cache6 = this.#caches.get(cacheName); return new Cache(kConstruct, cache6); } const cache5 = []; this.#caches.set(cacheName, cache5); return new Cache(kConstruct, cache5); } /** * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete * @param {string} cacheName * @returns {Promise} */ async delete(cacheName) { webidl.brandCheck(this, _CacheStorage); const prefix = "CacheStorage.delete"; webidl.argumentLengthCheck(arguments, 1, prefix); cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName"); return this.#caches.delete(cacheName); } /** * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys * @returns {Promise} */ async keys() { webidl.brandCheck(this, _CacheStorage); const keys = this.#caches.keys(); return [...keys]; } }; Object.defineProperties(CacheStorage.prototype, { [Symbol.toStringTag]: { value: "CacheStorage", configurable: true }, match: kEnumerableProperty, has: kEnumerableProperty, open: kEnumerableProperty, delete: kEnumerableProperty, keys: kEnumerableProperty }); module2.exports = { CacheStorage }; } }); // node_modules/undici/lib/web/cookies/constants.js var require_constants4 = __commonJS({ "node_modules/undici/lib/web/cookies/constants.js"(exports2, module2) { "use strict"; var maxAttributeValueSize = 1024; var maxNameValuePairSize = 4096; module2.exports = { maxAttributeValueSize, maxNameValuePairSize }; } }); // node_modules/undici/lib/web/cookies/util.js var require_util6 = __commonJS({ "node_modules/undici/lib/web/cookies/util.js"(exports2, module2) { "use strict"; function isCTLExcludingHtab(value) { for (let i5 = 0; i5 < value.length; ++i5) { const code = value.charCodeAt(i5); if (code >= 0 && code <= 8 || code >= 10 && code <= 31 || code === 127) { return true; } } return false; } function validateCookieName(name) { for (let i5 = 0; i5 < name.length; ++i5) { const code = name.charCodeAt(i5); if (code < 33 || // exclude CTLs (0-31), SP and HT code > 126 || // exclude non-ascii and DEL code === 34 || // " code === 40 || // ( code === 41 || // ) code === 60 || // < code === 62 || // > code === 64 || // @ code === 44 || // , code === 59 || // ; code === 58 || // : code === 92 || // \ code === 47 || // / code === 91 || // [ code === 93 || // ] code === 63 || // ? code === 61 || // = code === 123 || // { code === 125) { throw new Error("Invalid cookie name"); } } } function validateCookieValue(value) { let len = value.length; let i5 = 0; if (value[0] === '"') { if (len === 1 || value[len - 1] !== '"') { throw new Error("Invalid cookie value"); } --len; ++i5; } while (i5 < len) { const code = value.charCodeAt(i5++); if (code < 33 || // exclude CTLs (0-31) code > 126 || // non-ascii and DEL (127) code === 34 || // " code === 44 || // , code === 59 || // ; code === 92) { throw new Error("Invalid cookie value"); } } } function validateCookiePath(path3) { for (let i5 = 0; i5 < path3.length; ++i5) { const code = path3.charCodeAt(i5); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { throw new Error("Invalid cookie path"); } } } function validateCookieDomain(domain) { if (domain.startsWith("-") || domain.endsWith(".") || domain.endsWith("-")) { throw new Error("Invalid cookie domain"); } } var IMFDays = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]; var IMFMonths = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; var IMFPaddedNumbers = Array(61).fill(0).map((_, i5) => i5.toString().padStart(2, "0")); function toIMFDate(date2) { if (typeof date2 === "number") { date2 = new Date(date2); } return `${IMFDays[date2.getUTCDay()]}, ${IMFPaddedNumbers[date2.getUTCDate()]} ${IMFMonths[date2.getUTCMonth()]} ${date2.getUTCFullYear()} ${IMFPaddedNumbers[date2.getUTCHours()]}:${IMFPaddedNumbers[date2.getUTCMinutes()]}:${IMFPaddedNumbers[date2.getUTCSeconds()]} GMT`; } function validateCookieMaxAge(maxAge) { if (maxAge < 0) { throw new Error("Invalid cookie max-age"); } } 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("; "); } module2.exports = { isCTLExcludingHtab, validateCookieName, validateCookiePath, validateCookieValue, toIMFDate, stringify }; } }); // node_modules/undici/lib/web/cookies/parse.js var require_parse = __commonJS({ "node_modules/undici/lib/web/cookies/parse.js"(exports2, module2) { "use strict"; var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4(); var { isCTLExcludingHtab } = require_util6(); var { collectASequenceOfCodePointsFast } = require_data_url(); var assert4 = require("node:assert"); function parseSetCookie(header) { if (isCTLExcludingHtab(header)) { return null; } let nameValuePair = ""; let unparsedAttributes = ""; let name = ""; 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 }; name = collectASequenceOfCodePointsFast( "=", nameValuePair, position ); value = nameValuePair.slice(position.position + 1); } name = name.trim(); value = value.trim(); if (name.length + value.length > maxNameValuePairSize) { return null; } return { name, value, ...parseUnparsedAttributes(unparsedAttributes) }; } function parseUnparsedAttributes(unparsedAttributes, cookieAttributeList = {}) { if (unparsedAttributes.length === 0) { return cookieAttributeList; } assert4(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); } module2.exports = { parseSetCookie, parseUnparsedAttributes }; } }); // node_modules/undici/lib/web/cookies/index.js var require_cookies = __commonJS({ "node_modules/undici/lib/web/cookies/index.js"(exports2, module2) { "use strict"; var { parseSetCookie } = require_parse(); var { stringify } = require_util6(); var { webidl } = require_webidl(); var { Headers: Headers3 } = require_headers(); function getCookies(headers) { webidl.argumentLengthCheck(arguments, 1, "getCookies"); webidl.brandCheck(headers, Headers3, { strict: false }); const cookie = headers.get("cookie"); const out = {}; if (!cookie) { return out; } for (const piece of cookie.split(";")) { const [name, ...value] = piece.split("="); out[name.trim()] = value.join("="); } return out; } function deleteCookie(headers, name, attributes) { webidl.brandCheck(headers, Headers3, { strict: false }); const prefix = "deleteCookie"; webidl.argumentLengthCheck(arguments, 2, prefix); name = webidl.converters.DOMString(name, prefix, "name"); attributes = webidl.converters.DeleteCookieAttributes(attributes); setCookie(headers, { name, value: "", expires: /* @__PURE__ */ new Date(0), ...attributes }); } function getSetCookies(headers) { webidl.argumentLengthCheck(arguments, 1, "getSetCookies"); webidl.brandCheck(headers, Headers3, { strict: false }); const cookies = headers.getSetCookie(); if (!cookies) { return []; } return cookies.map((pair) => parseSetCookie(pair)); } function setCookie(headers, cookie) { webidl.argumentLengthCheck(arguments, 2, "setCookie"); webidl.brandCheck(headers, Headers3, { strict: false }); cookie = webidl.converters.Cookie(cookie); const str = stringify(cookie); if (str) { headers.append("Set-Cookie", str); } } webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ { converter: webidl.nullableConverter(webidl.converters.DOMString), key: "path", defaultValue: () => null }, { converter: webidl.nullableConverter(webidl.converters.DOMString), key: "domain", defaultValue: () => null } ]); webidl.converters.Cookie = webidl.dictionaryConverter([ { converter: webidl.converters.DOMString, key: "name" }, { converter: webidl.converters.DOMString, key: "value" }, { converter: webidl.nullableConverter((value) => { if (typeof value === "number") { return webidl.converters["unsigned long long"](value); } return new Date(value); }), key: "expires", defaultValue: () => null }, { converter: webidl.nullableConverter(webidl.converters["long long"]), key: "maxAge", defaultValue: () => null }, { converter: webidl.nullableConverter(webidl.converters.DOMString), key: "domain", defaultValue: () => null }, { converter: webidl.nullableConverter(webidl.converters.DOMString), key: "path", defaultValue: () => null }, { converter: webidl.nullableConverter(webidl.converters.boolean), key: "secure", defaultValue: () => null }, { converter: webidl.nullableConverter(webidl.converters.boolean), key: "httpOnly", defaultValue: () => null }, { converter: webidl.converters.USVString, key: "sameSite", allowedValues: ["Strict", "Lax", "None"] }, { converter: webidl.sequenceConverter(webidl.converters.DOMString), key: "unparsed", defaultValue: () => new Array(0) } ]); module2.exports = { getCookies, deleteCookie, getSetCookies, setCookie }; } }); // node_modules/undici/lib/web/websocket/events.js var require_events = __commonJS({ "node_modules/undici/lib/web/websocket/events.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); var { kEnumerableProperty } = require_util(); var { kConstruct } = require_symbols(); var { MessagePort } = require("node:worker_threads"); var MessageEvent = class _MessageEvent extends Event { #eventInit; constructor(type, eventInitDict = {}) { if (type === kConstruct) { super(arguments[1], arguments[2]); webidl.util.markAsUncloneable(this); return; } const prefix = "MessageEvent constructor"; webidl.argumentLengthCheck(arguments, 1, prefix); type = webidl.converters.DOMString(type, prefix, "type"); eventInitDict = webidl.converters.MessageEventInit(eventInitDict, prefix, "eventInitDict"); super(type, eventInitDict); this.#eventInit = eventInitDict; webidl.util.markAsUncloneable(this); } 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, data3 = null, origin = "", lastEventId = "", source = null, ports = []) { webidl.brandCheck(this, _MessageEvent); webidl.argumentLengthCheck(arguments, 1, "MessageEvent.initMessageEvent"); return new _MessageEvent(type, { bubbles, cancelable, data: data3, origin, lastEventId, source, ports }); } static createFastMessageEvent(type, init) { const messageEvent = new _MessageEvent(kConstruct, type, init); messageEvent.#eventInit = init; messageEvent.#eventInit.data ??= null; messageEvent.#eventInit.origin ??= ""; messageEvent.#eventInit.lastEventId ??= ""; messageEvent.#eventInit.source ??= null; messageEvent.#eventInit.ports ??= []; return messageEvent; } }; var { createFastMessageEvent } = MessageEvent; delete MessageEvent.createFastMessageEvent; var CloseEvent = class _CloseEvent extends Event { #eventInit; constructor(type, eventInitDict = {}) { const prefix = "CloseEvent constructor"; webidl.argumentLengthCheck(arguments, 1, prefix); type = webidl.converters.DOMString(type, prefix, "type"); eventInitDict = webidl.converters.CloseEventInit(eventInitDict); super(type, eventInitDict); this.#eventInit = eventInitDict; webidl.util.markAsUncloneable(this); } 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; } }; var ErrorEvent = class _ErrorEvent extends Event { #eventInit; constructor(type, eventInitDict) { const prefix = "ErrorEvent constructor"; webidl.argumentLengthCheck(arguments, 1, prefix); super(type, eventInitDict); webidl.util.markAsUncloneable(this); type = webidl.converters.DOMString(type, prefix, "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; } }; 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"], defaultValue: () => new Array(0) } ]); 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 } ]); module2.exports = { MessageEvent, CloseEvent, ErrorEvent, createFastMessageEvent }; } }); // node_modules/undici/lib/web/websocket/constants.js var require_constants5 = __commonJS({ "node_modules/undici/lib/web/websocket/constants.js"(exports2, module2) { "use strict"; 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 sentCloseFrameState = { NOT_SENT: 0, PROCESSING: 1, SENT: 2 }; 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); var sendHints = { string: 1, typedArray: 2, arrayBuffer: 3, blob: 4 }; module2.exports = { uid, sentCloseFrameState, staticPropertyDescriptors, states, opcodes, maxUnsigned16Bit, parserStates, emptyBuffer, sendHints }; } }); // node_modules/undici/lib/web/websocket/symbols.js var require_symbols5 = __commonJS({ "node_modules/undici/lib/web/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { kWebSocketURL: /* @__PURE__ */ Symbol("url"), kReadyState: /* @__PURE__ */ Symbol("ready state"), kController: /* @__PURE__ */ Symbol("controller"), kResponse: /* @__PURE__ */ Symbol("response"), kBinaryType: /* @__PURE__ */ Symbol("binary type"), kSentClose: /* @__PURE__ */ Symbol("sent close"), kReceivedClose: /* @__PURE__ */ Symbol("received close"), kByteParser: /* @__PURE__ */ Symbol("byte parser") }; } }); // node_modules/undici/lib/web/websocket/util.js var require_util7 = __commonJS({ "node_modules/undici/lib/web/websocket/util.js"(exports2, module2) { "use strict"; var { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require_symbols5(); var { states, opcodes } = require_constants5(); var { ErrorEvent, createFastMessageEvent } = require_events(); var { isUtf8 } = require("node:buffer"); var { collectASequenceOfCodePointsFast, removeHTTPWhitespace } = require_data_url(); function isConnecting(ws) { return ws[kReadyState] === states.CONNECTING; } function isEstablished(ws) { return ws[kReadyState] === states.OPEN; } function isClosing(ws) { return ws[kReadyState] === states.CLOSING; } function isClosed(ws) { return ws[kReadyState] === states.CLOSED; } function fireEvent(e5, target, eventFactory = (type, init) => new Event(type, init), eventInitDict = {}) { const event = eventFactory(e5, eventInitDict); target.dispatchEvent(event); } function websocketMessageReceived(ws, type, data3) { if (ws[kReadyState] !== states.OPEN) { return; } let dataForEvent; if (type === opcodes.TEXT) { try { dataForEvent = utf8Decode(data3); } catch { failWebsocketConnection(ws, "Received invalid UTF-8 in text frame."); return; } } else if (type === opcodes.BINARY) { if (ws[kBinaryType] === "blob") { dataForEvent = new Blob([data3]); } else { dataForEvent = toArrayBuffer(data3); } } fireEvent("message", ws, createFastMessageEvent, { origin: ws[kWebSocketURL].origin, data: dataForEvent }); } function toArrayBuffer(buffer) { if (buffer.byteLength === buffer.buffer.byteLength) { return buffer.buffer; } return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength); } function isValidSubprotocol(protocol) { if (protocol.length === 0) { return false; } for (let i5 = 0; i5 < protocol.length; ++i5) { const code = protocol.charCodeAt(i5); if (code < 33 || // CTL, contains SP (0x20) and HT (0x09) code > 126 || code === 34 || // " code === 40 || // ( code === 41 || // ) code === 44 || // , code === 47 || // / code === 58 || // : code === 59 || // ; code === 60 || // < code === 61 || // = code === 62 || // > code === 63 || // ? code === 64 || // @ code === 91 || // [ code === 92 || // \ code === 93 || // ] code === 123 || // { code === 125) { return false; } } return true; } 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; } 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, (type, init) => new ErrorEvent(type, init), { error: new Error(reason), message: reason }); } } function isControlFrame(opcode) { return opcode === opcodes.CLOSE || opcode === opcodes.PING || opcode === opcodes.PONG; } function isContinuationFrame(opcode) { return opcode === opcodes.CONTINUATION; } function isTextBinaryFrame(opcode) { return opcode === opcodes.TEXT || opcode === opcodes.BINARY; } function isValidOpcode(opcode) { return isTextBinaryFrame(opcode) || isContinuationFrame(opcode) || isControlFrame(opcode); } function parseExtensions(extensions) { const position = { position: 0 }; const extensionList = /* @__PURE__ */ new Map(); while (position.position < extensions.length) { const pair = collectASequenceOfCodePointsFast(";", extensions, position); const [name, value = ""] = pair.split("="); extensionList.set( removeHTTPWhitespace(name, true, false), removeHTTPWhitespace(value, false, true) ); position.position++; } return extensionList; } function isValidClientWindowBits(value) { if (value.length === 0) { return false; } for (let i5 = 0; i5 < value.length; i5++) { const byte = value.charCodeAt(i5); if (byte < 48 || byte > 57) { return false; } } const num = Number.parseInt(value, 10); return num >= 8 && num <= 15; } var hasIntl = typeof process.versions.icu === "string"; var fatalDecoder = hasIntl ? new TextDecoder("utf-8", { fatal: true }) : void 0; var utf8Decode = hasIntl ? fatalDecoder.decode.bind(fatalDecoder) : function(buffer) { if (isUtf8(buffer)) { return buffer.toString("utf-8"); } throw new TypeError("Invalid utf-8 received."); }; module2.exports = { isConnecting, isEstablished, isClosing, isClosed, fireEvent, isValidSubprotocol, isValidStatusCode, failWebsocketConnection, websocketMessageReceived, utf8Decode, isControlFrame, isContinuationFrame, isTextBinaryFrame, isValidOpcode, parseExtensions, isValidClientWindowBits }; } }); // node_modules/undici/lib/web/websocket/frame.js var require_frame = __commonJS({ "node_modules/undici/lib/web/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); var BUFFER_SIZE = 16386; var crypto4; var buffer = null; var bufIdx = BUFFER_SIZE; try { crypto4 = require("node:crypto"); } catch { crypto4 = { // not full compatibility, but minimum. randomFillSync: function randomFillSync(buffer2, _offset2, _size) { for (let i5 = 0; i5 < buffer2.length; ++i5) { buffer2[i5] = Math.random() * 255 | 0; } return buffer2; } }; } function generateMask() { if (bufIdx === BUFFER_SIZE) { bufIdx = 0; crypto4.randomFillSync(buffer ??= Buffer.allocUnsafe(BUFFER_SIZE), 0, BUFFER_SIZE); } return [buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++], buffer[bufIdx++]]; } var WebsocketFrameSend = class { /** * @param {Buffer|undefined} data */ constructor(data3) { this.frameData = data3; } createFrame(opcode) { const frameData = this.frameData; const maskKey = generateMask(); const bodyLength = 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 buffer2 = Buffer.allocUnsafe(bodyLength + offset); buffer2[0] = buffer2[1] = 0; buffer2[0] |= 128; buffer2[0] = (buffer2[0] & 240) + opcode; buffer2[offset - 4] = maskKey[0]; buffer2[offset - 3] = maskKey[1]; buffer2[offset - 2] = maskKey[2]; buffer2[offset - 1] = maskKey[3]; buffer2[1] = payloadLength; if (payloadLength === 126) { buffer2.writeUInt16BE(bodyLength, 2); } else if (payloadLength === 127) { buffer2[2] = buffer2[3] = 0; buffer2.writeUIntBE(bodyLength, 4, 6); } buffer2[1] |= 128; for (let i5 = 0; i5 < bodyLength; ++i5) { buffer2[offset + i5] = frameData[i5] ^ maskKey[i5 & 3]; } return buffer2; } }; module2.exports = { WebsocketFrameSend }; } }); // node_modules/undici/lib/web/websocket/connection.js var require_connection = __commonJS({ "node_modules/undici/lib/web/websocket/connection.js"(exports2, module2) { "use strict"; var { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require_constants5(); var { kReadyState, kSentClose, kByteParser, kReceivedClose, kResponse } = require_symbols5(); var { fireEvent, failWebsocketConnection, isClosing, isClosed, isEstablished, parseExtensions } = require_util7(); var { channels } = require_diagnostics(); var { CloseEvent } = require_events(); var { makeRequest } = require_request2(); var { fetching } = require_fetch(); var { Headers: Headers3, getHeadersList } = require_headers(); var { getDecodeSplit } = require_util2(); var { WebsocketFrameSend } = require_frame(); var crypto4; try { crypto4 = require("node:crypto"); } catch { } function establishWebSocketConnection(url, protocols2, client, ws, onEstablish, options) { const requestURL = url; requestURL.protocol = url.protocol === "ws:" ? "http:" : "https:"; const request = makeRequest({ urlList: [requestURL], client, serviceWorkers: "none", referrer: "no-referrer", mode: "websocket", credentials: "include", cache: "no-store", redirect: "error" }); if (options.headers) { const headersList = getHeadersList(new Headers3(options.headers)); request.headersList = headersList; } const keyValue = crypto4.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols2) { request.headersList.append("sec-websocket-protocol", protocol); } const permessageDeflate = "permessage-deflate; client_max_window_bits"; request.headersList.append("sec-websocket-extensions", permessageDeflate); const controller = fetching({ request, useParallelQueue: true, dispatcher: options.dispatcher, processResponse(response) { if (response.type === "error" || response.status !== 101) { failWebsocketConnection(ws, "Received network error or non-101 status code."); return; } if (protocols2.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 = crypto4.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"); let extensions; if (secExtension !== null) { extensions = parseExtensions(secExtension); if (!extensions.has("permessage-deflate")) { failWebsocketConnection(ws, "Sec-WebSocket-Extensions header does not match."); return; } } const secProtocol = response.headersList.get("Sec-WebSocket-Protocol"); if (secProtocol !== null) { const requestProtocols = getDecodeSplit("sec-websocket-protocol", request.headersList); if (!requestProtocols.includes(secProtocol)) { failWebsocketConnection(ws, "Protocol was not set in the opening handshake."); return; } } response.socket.on("data", onSocketData); response.socket.on("close", onSocketClose); response.socket.on("error", onSocketError); if (channels.open.hasSubscribers) { channels.open.publish({ address: response.socket.address(), protocol: secProtocol, extensions: secExtension }); } onEstablish(response, extensions); } }); return controller; } function closeWebSocketConnection(ws, code, reason, reasonByteLength) { if (isClosing(ws) || isClosed(ws)) { } else if (!isEstablished(ws)) { failWebsocketConnection(ws, "Connection was closed before it was established."); ws[kReadyState] = states.CLOSING; } else if (ws[kSentClose] === sentCloseFrameState.NOT_SENT) { ws[kSentClose] = sentCloseFrameState.PROCESSING; 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 = ws[kResponse].socket; socket.write(frame.createFrame(opcodes.CLOSE)); ws[kSentClose] = sentCloseFrameState.SENT; ws[kReadyState] = states.CLOSING; } else { ws[kReadyState] = states.CLOSING; } } function onSocketData(chunk) { if (!this.ws[kByteParser].write(chunk)) { this.pause(); } } function onSocketClose() { const { ws } = this; const { [kResponse]: response } = ws; response.socket.off("data", onSocketData); response.socket.off("close", onSocketClose); response.socket.off("error", onSocketError); const wasClean = ws[kSentClose] === sentCloseFrameState.SENT && ws[kReceivedClose]; let code = 1005; let reason = ""; const result = ws[kByteParser].closingInfo; if (result && !result.error) { code = result.code ?? 1005; reason = result.reason; } else if (!ws[kReceivedClose]) { code = 1006; } ws[kReadyState] = states.CLOSED; fireEvent("close", ws, (type, init) => new CloseEvent(type, init), { wasClean, code, reason }); if (channels.close.hasSubscribers) { channels.close.publish({ websocket: ws, code, reason }); } } function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { channels.socketError.publish(error3); } this.destroy(); } module2.exports = { establishWebSocketConnection, closeWebSocketConnection }; } }); // node_modules/undici/lib/web/websocket/permessage-deflate.js var require_permessage_deflate = __commonJS({ "node_modules/undici/lib/web/websocket/permessage-deflate.js"(exports2, module2) { "use strict"; var { createInflateRaw, Z_DEFAULT_WINDOWBITS } = require("node:zlib"); var { isValidClientWindowBits } = require_util7(); var { MessageSizeExceededError } = require_errors(); var tail = Buffer.from([0, 0, 255, 255]); var kBuffer = /* @__PURE__ */ Symbol("kBuffer"); var kLength = /* @__PURE__ */ Symbol("kLength"); var PerMessageDeflate = class { /** @type {import('node:zlib').InflateRaw} */ #inflate; #options = {}; #maxPayloadSize = 0; /** * @param {Map} extensions */ constructor(extensions, options) { this.#options.serverNoContextTakeover = extensions.has("server_no_context_takeover"); this.#options.serverMaxWindowBits = extensions.get("server_max_window_bits"); this.#maxPayloadSize = options.maxPayloadSize; } /** * Decompress a compressed payload. * @param {Buffer} chunk Compressed data * @param {boolean} fin Final fragment flag * @param {Function} callback Callback function */ decompress(chunk, fin, callback) { if (!this.#inflate) { let windowBits = Z_DEFAULT_WINDOWBITS; if (this.#options.serverMaxWindowBits) { if (!isValidClientWindowBits(this.#options.serverMaxWindowBits)) { callback(new Error("Invalid server_max_window_bits")); return; } windowBits = Number.parseInt(this.#options.serverMaxWindowBits); } try { this.#inflate = createInflateRaw({ windowBits }); } catch (err) { callback(err); return; } this.#inflate[kBuffer] = []; this.#inflate[kLength] = 0; this.#inflate.on("data", (data3) => { this.#inflate[kLength] += data3.length; if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) { callback(new MessageSizeExceededError()); this.#inflate.removeAllListeners(); this.#inflate = null; return; } this.#inflate[kBuffer].push(data3); }); this.#inflate.on("error", (err) => { this.#inflate = null; callback(err); }); } this.#inflate.write(chunk); if (fin) { this.#inflate.write(tail); } this.#inflate.flush(() => { if (!this.#inflate) { return; } const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength]); this.#inflate[kBuffer].length = 0; this.#inflate[kLength] = 0; callback(null, full); }); } }; module2.exports = { PerMessageDeflate }; } }); // node_modules/undici/lib/web/websocket/receiver.js var require_receiver = __commonJS({ "node_modules/undici/lib/web/websocket/receiver.js"(exports2, module2) { "use strict"; var { Writable } = require("node:stream"); var assert4 = require("node:assert"); var { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants5(); var { kReadyState, kSentClose, kResponse, kReceivedClose } = require_symbols5(); var { channels } = require_diagnostics(); var { isValidStatusCode, isValidOpcode, failWebsocketConnection, websocketMessageReceived, utf8Decode, isControlFrame, isTextBinaryFrame, isContinuationFrame } = require_util7(); var { WebsocketFrameSend } = require_frame(); var { closeWebSocketConnection } = require_connection(); var { PerMessageDeflate } = require_permessage_deflate(); var { MessageSizeExceededError } = require_errors(); var ByteParser = class extends Writable { #buffers = []; #fragmentsBytes = 0; #byteOffset = 0; #loop = false; #state = parserStates.INFO; #info = {}; #fragments = []; /** @type {Map} */ #extensions; /** @type {number} */ #maxPayloadSize; /** * @param {import('./websocket').WebSocket} ws * @param {Map|null} extensions * @param {{ maxPayloadSize?: number }} [options] */ constructor(ws, extensions, options = {}) { super(); this.ws = ws; this.#extensions = extensions == null ? /* @__PURE__ */ new Map() : extensions; this.#maxPayloadSize = options.maxPayloadSize ?? 0; if (this.#extensions.has("permessage-deflate")) { this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions, options)); } } /** * @param {Buffer} chunk * @param {() => void} callback */ _write(chunk, _, callback) { this.#buffers.push(chunk); this.#byteOffset += chunk.length; this.#loop = true; this.run(callback); } #validatePayloadLength() { if (this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && this.#info.payloadLength > this.#maxPayloadSize) { failWebsocketConnection(this.ws, "Payload size exceeds maximum allowed size"); return false; } return true; } /** * 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 (this.#loop) { if (this.#state === parserStates.INFO) { if (this.#byteOffset < 2) { return callback(); } const buffer = this.consume(2); const fin = (buffer[0] & 128) !== 0; const opcode = buffer[0] & 15; const masked = (buffer[1] & 128) === 128; const fragmented = !fin && opcode !== opcodes.CONTINUATION; const payloadLength = buffer[1] & 127; const rsv1 = buffer[0] & 64; const rsv2 = buffer[0] & 32; const rsv3 = buffer[0] & 16; if (!isValidOpcode(opcode)) { failWebsocketConnection(this.ws, "Invalid opcode received"); return callback(); } if (masked) { failWebsocketConnection(this.ws, "Frame cannot be masked"); return callback(); } if (rsv1 !== 0 && !this.#extensions.has("permessage-deflate")) { failWebsocketConnection(this.ws, "Expected RSV1 to be clear."); return; } if (rsv2 !== 0 || rsv3 !== 0) { failWebsocketConnection(this.ws, "RSV1, RSV2, RSV3 must be clear"); return; } if (fragmented && !isTextBinaryFrame(opcode)) { failWebsocketConnection(this.ws, "Invalid frame type was fragmented."); return; } if (isTextBinaryFrame(opcode) && this.#fragments.length > 0) { failWebsocketConnection(this.ws, "Expected continuation frame"); return; } if (this.#info.fragmented && fragmented) { failWebsocketConnection(this.ws, "Fragmented frame exceeded 125 bytes."); return; } if ((payloadLength > 125 || fragmented) && isControlFrame(opcode)) { failWebsocketConnection(this.ws, "Control frame either too large or fragmented"); return; } if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) { failWebsocketConnection(this.ws, "Unexpected continuation frame"); return; } if (payloadLength <= 125) { this.#info.payloadLength = payloadLength; this.#state = parserStates.READ_DATA; if (!this.#validatePayloadLength()) { return; } } else if (payloadLength === 126) { this.#state = parserStates.PAYLOADLENGTH_16; } else if (payloadLength === 127) { this.#state = parserStates.PAYLOADLENGTH_64; } if (isTextBinaryFrame(opcode)) { this.#info.binaryType = opcode; this.#info.compressed = rsv1 !== 0; } this.#info.opcode = opcode; this.#info.masked = masked; this.#info.fin = fin; this.#info.fragmented = fragmented; } 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; if (!this.#validatePayloadLength()) { return; } } else if (this.#state === parserStates.PAYLOADLENGTH_64) { if (this.#byteOffset < 8) { return callback(); } const buffer = this.consume(8); const upper = buffer.readUInt32BE(0); const lower = buffer.readUInt32BE(4); if (upper !== 0 || lower > 2 ** 31 - 1) { failWebsocketConnection(this.ws, "Received payload length > 2^31 bytes."); return; } this.#info.payloadLength = lower; this.#state = parserStates.READ_DATA; if (!this.#validatePayloadLength()) { return; } } else if (this.#state === parserStates.READ_DATA) { if (this.#byteOffset < this.#info.payloadLength) { return callback(); } const body = this.consume(this.#info.payloadLength); if (isControlFrame(this.#info.opcode)) { this.#loop = this.parseControlFrame(body); this.#state = parserStates.INFO; } else { if (!this.#info.compressed) { this.writeFragments(body); if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { failWebsocketConnection(this.ws, new MessageSizeExceededError().message); return; } if (!this.#info.fragmented && this.#info.fin) { websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments()); } this.#state = parserStates.INFO; } else { this.#extensions.get("permessage-deflate").decompress( body, this.#info.fin, (error3, data3) => { if (error3) { failWebsocketConnection(this.ws, error3.message); return; } this.writeFragments(data3); if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) { failWebsocketConnection(this.ws, new MessageSizeExceededError().message); return; } if (!this.#info.fin) { this.#state = parserStates.INFO; this.#loop = true; this.run(callback); return; } websocketMessageReceived(this.ws, this.#info.binaryType, this.consumeFragments()); this.#loop = true; this.#state = parserStates.INFO; this.run(callback); } ); this.#loop = false; break; } } } } } /** * Take n bytes from the buffered Buffers * @param {number} n * @returns {Buffer} */ consume(n3) { if (n3 > this.#byteOffset) { throw new Error("Called consume() before buffers satiated."); } else if (n3 === 0) { return emptyBuffer; } if (this.#buffers[0].length === n3) { this.#byteOffset -= this.#buffers[0].length; return this.#buffers.shift(); } const buffer = Buffer.allocUnsafe(n3); let offset = 0; while (offset !== n3) { const next = this.#buffers[0]; const { length } = next; if (length + offset === n3) { buffer.set(this.#buffers.shift(), offset); break; } else if (length + offset > n3) { buffer.set(next.subarray(0, n3 - offset), offset); this.#buffers[0] = next.subarray(n3 - offset); break; } else { buffer.set(this.#buffers.shift(), offset); offset += next.length; } } this.#byteOffset -= n3; return buffer; } writeFragments(fragment) { this.#fragmentsBytes += fragment.length; this.#fragments.push(fragment); } consumeFragments() { const fragments = this.#fragments; if (fragments.length === 1) { this.#fragmentsBytes = 0; return fragments.shift(); } const output = Buffer.concat(fragments, this.#fragmentsBytes); this.#fragments = []; this.#fragmentsBytes = 0; return output; } parseCloseBody(data3) { assert4(data3.length !== 1); let code; if (data3.length >= 2) { code = data3.readUInt16BE(0); } if (code !== void 0 && !isValidStatusCode(code)) { return { code: 1002, reason: "Invalid status code", error: true }; } let reason = data3.subarray(2); if (reason[0] === 239 && reason[1] === 187 && reason[2] === 191) { reason = reason.subarray(3); } try { reason = utf8Decode(reason); } catch { return { code: 1007, reason: "Invalid UTF-8", error: true }; } return { code, reason, error: false }; } /** * Parses control frames. * @param {Buffer} body */ parseControlFrame(body) { const { opcode, payloadLength } = this.#info; if (opcode === opcodes.CLOSE) { if (payloadLength === 1) { failWebsocketConnection(this.ws, "Received close frame with a 1-byte body."); return false; } this.#info.closeInfo = this.parseCloseBody(body); if (this.#info.closeInfo.error) { const { code, reason } = this.#info.closeInfo; closeWebSocketConnection(this.ws, code, reason, reason.length); failWebsocketConnection(this.ws, reason); return false; } if (this.ws[kSentClose] !== sentCloseFrameState.SENT) { let body2 = emptyBuffer; if (this.#info.closeInfo.code) { 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] = sentCloseFrameState.SENT; } } ); } this.ws[kReadyState] = states.CLOSING; this.ws[kReceivedClose] = true; return false; } else if (opcode === opcodes.PING) { 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 }); } } } else if (opcode === opcodes.PONG) { if (channels.pong.hasSubscribers) { channels.pong.publish({ payload: body }); } } return true; } get closingInfo() { return this.#info.closeInfo; } }; module2.exports = { ByteParser }; } }); // node_modules/undici/lib/web/websocket/sender.js var require_sender = __commonJS({ "node_modules/undici/lib/web/websocket/sender.js"(exports2, module2) { "use strict"; var { WebsocketFrameSend } = require_frame(); var { opcodes, sendHints } = require_constants5(); var FixedQueue = require_fixed_queue(); var FastBuffer = Buffer[Symbol.species]; var SendQueue = class { /** * @type {FixedQueue} */ #queue = new FixedQueue(); /** * @type {boolean} */ #running = false; /** @type {import('node:net').Socket} */ #socket; constructor(socket) { this.#socket = socket; } add(item, cb, hint) { if (hint !== sendHints.blob) { const frame = createFrame(item, hint); if (!this.#running) { this.#socket.write(frame, cb); } else { const node2 = { promise: null, callback: cb, frame }; this.#queue.push(node2); } return; } const node = { promise: item.arrayBuffer().then((ab) => { node.promise = null; node.frame = createFrame(ab, hint); }), callback: cb, frame: null }; this.#queue.push(node); if (!this.#running) { this.#run(); } } async #run() { this.#running = true; const queue = this.#queue; while (!queue.isEmpty()) { const node = queue.shift(); if (node.promise !== null) { await node.promise; } this.#socket.write(node.frame, node.callback); node.callback = node.frame = null; } this.#running = false; } }; function createFrame(data3, hint) { return new WebsocketFrameSend(toBuffer2(data3, hint)).createFrame(hint === sendHints.string ? opcodes.TEXT : opcodes.BINARY); } function toBuffer2(data3, hint) { switch (hint) { case sendHints.string: return Buffer.from(data3); case sendHints.arrayBuffer: case sendHints.blob: return new FastBuffer(data3); case sendHints.typedArray: return new FastBuffer(data3.buffer, data3.byteOffset, data3.byteLength); } } module2.exports = { SendQueue }; } }); // node_modules/undici/lib/web/websocket/websocket.js var require_websocket = __commonJS({ "node_modules/undici/lib/web/websocket/websocket.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); var { URLSerializer } = require_data_url(); var { environmentSettingsObject } = require_util2(); var { staticPropertyDescriptors, states, sentCloseFrameState, sendHints } = require_constants5(); var { kWebSocketURL, kReadyState, kController, kBinaryType, kResponse, kSentClose, kByteParser } = require_symbols5(); var { isConnecting, isEstablished, isClosing, isValidSubprotocol, fireEvent } = require_util7(); var { establishWebSocketConnection, closeWebSocketConnection } = require_connection(); var { ByteParser } = require_receiver(); var { kEnumerableProperty, isBlobLike } = require_util(); var { getGlobalDispatcher } = require_global2(); var { types: types3 } = require("node:util"); var { ErrorEvent, CloseEvent } = require_events(); var { SendQueue } = require_sender(); var WebSocket = class _WebSocket extends EventTarget { #events = { open: null, error: null, close: null, message: null }; #bufferedAmount = 0; #protocol = ""; #extensions = ""; /** @type {SendQueue} */ #sendQueue; /** * @param {string} url * @param {string|string[]} protocols */ constructor(url, protocols2 = []) { super(); webidl.util.markAsUncloneable(this); const prefix = "WebSocket constructor"; webidl.argumentLengthCheck(arguments, 1, prefix); const options = webidl.converters["DOMString or sequence or WebSocketInit"](protocols2, prefix, "options"); url = webidl.converters.USVString(url, prefix, "url"); protocols2 = options.protocols; const baseURL = environmentSettingsObject.settingsObject.baseUrl; let urlRecord; try { urlRecord = new URL(url, baseURL); } catch (e5) { throw new DOMException(e5, "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 DOMException( `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`, "SyntaxError" ); } if (urlRecord.hash || urlRecord.href.endsWith("#")) { throw new DOMException("Got fragment", "SyntaxError"); } if (typeof protocols2 === "string") { protocols2 = [protocols2]; } if (protocols2.length !== new Set(protocols2.map((p2) => p2.toLowerCase())).size) { throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); } if (protocols2.length > 0 && !protocols2.every((p2) => isValidSubprotocol(p2))) { throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError"); } this[kWebSocketURL] = new URL(urlRecord.href); const client = environmentSettingsObject.settingsObject; this[kController] = establishWebSocketConnection( urlRecord, protocols2, client, this, (response, extensions) => this.#onConnectionEstablished(response, extensions), options ); this[kReadyState] = _WebSocket.CONNECTING; this[kSentClose] = sentCloseFrameState.NOT_SENT; 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, _WebSocket); const prefix = "WebSocket.close"; if (code !== void 0) { code = webidl.converters["unsigned short"](code, prefix, "code", { clamp: true }); } if (reason !== void 0) { reason = webidl.converters.USVString(reason, prefix, "reason"); } if (code !== void 0) { if (code !== 1e3 && (code < 3e3 || code > 4999)) { throw new DOMException("invalid code", "InvalidAccessError"); } } let reasonByteLength = 0; if (reason !== void 0) { reasonByteLength = Buffer.byteLength(reason); if (reasonByteLength > 123) { throw new DOMException( `Reason must be less than 123 bytes; received ${reasonByteLength}`, "SyntaxError" ); } } closeWebSocketConnection(this, code, reason, reasonByteLength); } /** * @see https://websockets.spec.whatwg.org/#dom-websocket-send * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data */ send(data3) { webidl.brandCheck(this, _WebSocket); const prefix = "WebSocket.send"; webidl.argumentLengthCheck(arguments, 1, prefix); data3 = webidl.converters.WebSocketSendData(data3, prefix, "data"); if (isConnecting(this)) { throw new DOMException("Sent before connected.", "InvalidStateError"); } if (!isEstablished(this) || isClosing(this)) { return; } if (typeof data3 === "string") { const length = Buffer.byteLength(data3); this.#bufferedAmount += length; this.#sendQueue.add(data3, () => { this.#bufferedAmount -= length; }, sendHints.string); } else if (types3.isArrayBuffer(data3)) { this.#bufferedAmount += data3.byteLength; this.#sendQueue.add(data3, () => { this.#bufferedAmount -= data3.byteLength; }, sendHints.arrayBuffer); } else if (ArrayBuffer.isView(data3)) { this.#bufferedAmount += data3.byteLength; this.#sendQueue.add(data3, () => { this.#bufferedAmount -= data3.byteLength; }, sendHints.typedArray); } else if (isBlobLike(data3)) { this.#bufferedAmount += data3.size; this.#sendQueue.add(data3, () => { this.#bufferedAmount -= data3.size; }, sendHints.blob); } } get readyState() { webidl.brandCheck(this, _WebSocket); return this[kReadyState]; } get bufferedAmount() { webidl.brandCheck(this, _WebSocket); return this.#bufferedAmount; } get url() { webidl.brandCheck(this, _WebSocket); return URLSerializer(this[kWebSocketURL]); } get extensions() { webidl.brandCheck(this, _WebSocket); return this.#extensions; } get protocol() { webidl.brandCheck(this, _WebSocket); return this.#protocol; } get onopen() { webidl.brandCheck(this, _WebSocket); return this.#events.open; } set onopen(fn) { webidl.brandCheck(this, _WebSocket); if (this.#events.open) { this.removeEventListener("open", this.#events.open); } if (typeof fn === "function") { this.#events.open = fn; this.addEventListener("open", fn); } else { this.#events.open = null; } } get onerror() { webidl.brandCheck(this, _WebSocket); return this.#events.error; } set onerror(fn) { webidl.brandCheck(this, _WebSocket); if (this.#events.error) { this.removeEventListener("error", this.#events.error); } if (typeof fn === "function") { this.#events.error = fn; this.addEventListener("error", fn); } else { this.#events.error = null; } } get onclose() { webidl.brandCheck(this, _WebSocket); return this.#events.close; } set onclose(fn) { webidl.brandCheck(this, _WebSocket); if (this.#events.close) { this.removeEventListener("close", this.#events.close); } if (typeof fn === "function") { this.#events.close = fn; this.addEventListener("close", fn); } else { this.#events.close = null; } } get onmessage() { webidl.brandCheck(this, _WebSocket); return this.#events.message; } set onmessage(fn) { webidl.brandCheck(this, _WebSocket); if (this.#events.message) { this.removeEventListener("message", this.#events.message); } if (typeof fn === "function") { this.#events.message = fn; this.addEventListener("message", fn); } else { this.#events.message = null; } } get binaryType() { webidl.brandCheck(this, _WebSocket); return this[kBinaryType]; } set binaryType(type) { webidl.brandCheck(this, _WebSocket); if (type !== "blob" && type !== "arraybuffer") { this[kBinaryType] = "blob"; } else { this[kBinaryType] = type; } } /** * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol */ #onConnectionEstablished(response, parsedExtensions) { this[kResponse] = response; const maxPayloadSize = this[kController]?.dispatcher?.webSocketOptions?.maxPayloadSize; const parser = new ByteParser(this, parsedExtensions, { maxPayloadSize }); parser.on("drain", onParserDrain); parser.on("error", onParserError.bind(this)); response.socket.ws = this; this[kByteParser] = parser; this.#sendQueue = new SendQueue(response.socket); 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); } }; WebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING; WebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN; WebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING; WebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED; Object.defineProperties(WebSocket.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(WebSocket, { CONNECTING: staticPropertyDescriptors, OPEN: staticPropertyDescriptors, CLOSING: staticPropertyDescriptors, CLOSED: staticPropertyDescriptors }); webidl.converters["sequence"] = webidl.sequenceConverter( webidl.converters.DOMString ); webidl.converters["DOMString or sequence"] = function(V, prefix, argument) { if (webidl.util.Type(V) === "Object" && Symbol.iterator in V) { return webidl.converters["sequence"](V); } return webidl.converters.DOMString(V, prefix, argument); }; webidl.converters.WebSocketInit = webidl.dictionaryConverter([ { key: "protocols", converter: webidl.converters["DOMString or sequence"], defaultValue: () => new Array(0) }, { key: "dispatcher", converter: webidl.converters.any, defaultValue: () => getGlobalDispatcher() }, { key: "headers", converter: webidl.nullableConverter(webidl.converters.HeadersInit) } ]); webidl.converters["DOMString or sequence or WebSocketInit"] = function(V) { if (webidl.util.Type(V) === "Object" && !(Symbol.iterator in V)) { return webidl.converters.WebSocketInit(V); } return { protocols: webidl.converters["DOMString or sequence"](V) }; }; webidl.converters.WebSocketSendData = function(V) { if (webidl.util.Type(V) === "Object") { if (isBlobLike(V)) { return webidl.converters.Blob(V, { strict: false }); } if (ArrayBuffer.isView(V) || types3.isArrayBuffer(V)) { return webidl.converters.BufferSource(V); } } return webidl.converters.USVString(V); }; function onParserDrain() { this.ws[kResponse].socket.resume(); } function onParserError(err) { let message; let code; if (err instanceof CloseEvent) { message = err.reason; code = err.code; } else { message = err.message; } fireEvent("error", this, () => new ErrorEvent("error", { error: err, message })); closeWebSocketConnection(this, code); } module2.exports = { WebSocket }; } }); // node_modules/undici/lib/web/eventsource/util.js var require_util8 = __commonJS({ "node_modules/undici/lib/web/eventsource/util.js"(exports2, module2) { "use strict"; function isValidLastEventId(value) { return value.indexOf("\0") === -1; } function isASCIINumber(value) { if (value.length === 0) return false; for (let i5 = 0; i5 < value.length; i5++) { if (value.charCodeAt(i5) < 48 || value.charCodeAt(i5) > 57) return false; } return true; } function delay(ms) { return new Promise((resolve) => { setTimeout(resolve, ms).unref(); }); } module2.exports = { isValidLastEventId, isASCIINumber, delay }; } }); // node_modules/undici/lib/web/eventsource/eventsource-stream.js var require_eventsource_stream = __commonJS({ "node_modules/undici/lib/web/eventsource/eventsource-stream.js"(exports2, module2) { "use strict"; var { Transform } = require("node:stream"); var { isASCIINumber, isValidLastEventId } = require_util8(); var BOM = [239, 187, 191]; var LF = 10; var CR = 13; var COLON = 58; var SPACE = 32; var EventSourceStream = class extends Transform { /** * @type {eventSourceSettings} */ state = null; /** * Leading byte-order-mark check. * @type {boolean} */ checkBOM = true; /** * @type {boolean} */ crlfCheck = false; /** * @type {boolean} */ eventEndCheck = false; /** * @type {Buffer} */ buffer = null; pos = 0; event = { data: void 0, event: void 0, id: void 0, retry: void 0 }; /** * @param {object} options * @param {eventSourceSettings} options.eventSourceSettings * @param {Function} [options.push] */ constructor(options = {}) { options.readableObjectMode = true; super(options); this.state = options.eventSourceSettings || {}; if (options.push) { this.push = options.push; } } /** * @param {Buffer} chunk * @param {string} _encoding * @param {Function} callback * @returns {void} */ _transform(chunk, _encoding, callback) { if (chunk.length === 0) { callback(); return; } if (this.buffer) { this.buffer = Buffer.concat([this.buffer, chunk]); } else { this.buffer = chunk; } if (this.checkBOM) { switch (this.buffer.length) { case 1: if (this.buffer[0] === BOM[0]) { callback(); return; } this.checkBOM = false; callback(); return; case 2: if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1]) { callback(); return; } this.checkBOM = false; break; case 3: if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1] && this.buffer[2] === BOM[2]) { this.buffer = Buffer.alloc(0); this.checkBOM = false; callback(); return; } this.checkBOM = false; break; default: if (this.buffer[0] === BOM[0] && this.buffer[1] === BOM[1] && this.buffer[2] === BOM[2]) { this.buffer = this.buffer.subarray(3); } this.checkBOM = false; break; } } while (this.pos < this.buffer.length) { if (this.eventEndCheck) { if (this.crlfCheck) { if (this.buffer[this.pos] === LF) { this.buffer = this.buffer.subarray(this.pos + 1); this.pos = 0; this.crlfCheck = false; continue; } this.crlfCheck = false; } if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) { if (this.buffer[this.pos] === CR) { this.crlfCheck = true; } this.buffer = this.buffer.subarray(this.pos + 1); this.pos = 0; if (this.event.data !== void 0 || this.event.event || this.event.id || this.event.retry) { this.processEvent(this.event); } this.clearEvent(); continue; } this.eventEndCheck = false; continue; } if (this.buffer[this.pos] === LF || this.buffer[this.pos] === CR) { if (this.buffer[this.pos] === CR) { this.crlfCheck = true; } this.parseLine(this.buffer.subarray(0, this.pos), this.event); this.buffer = this.buffer.subarray(this.pos + 1); this.pos = 0; this.eventEndCheck = true; continue; } this.pos++; } callback(); } /** * @param {Buffer} line * @param {EventStreamEvent} event */ parseLine(line, event) { if (line.length === 0) { return; } const colonPosition = line.indexOf(COLON); if (colonPosition === 0) { return; } let field = ""; let value = ""; if (colonPosition !== -1) { field = line.subarray(0, colonPosition).toString("utf8"); let valueStart = colonPosition + 1; if (line[valueStart] === SPACE) { ++valueStart; } value = line.subarray(valueStart).toString("utf8"); } else { field = line.toString("utf8"); value = ""; } switch (field) { case "data": if (event[field] === void 0) { event[field] = value; } else { event[field] += ` ${value}`; } break; case "retry": if (isASCIINumber(value)) { event[field] = value; } break; case "id": if (isValidLastEventId(value)) { event[field] = value; } break; case "event": if (value.length > 0) { event[field] = value; } break; } } /** * @param {EventSourceStreamEvent} event */ processEvent(event) { if (event.retry && isASCIINumber(event.retry)) { this.state.reconnectionTime = parseInt(event.retry, 10); } if (event.id && isValidLastEventId(event.id)) { this.state.lastEventId = event.id; } if (event.data !== void 0) { this.push({ type: event.event || "message", options: { data: event.data, lastEventId: this.state.lastEventId, origin: this.state.origin } }); } } clearEvent() { this.event = { data: void 0, event: void 0, id: void 0, retry: void 0 }; } }; module2.exports = { EventSourceStream }; } }); // node_modules/undici/lib/web/eventsource/eventsource.js var require_eventsource = __commonJS({ "node_modules/undici/lib/web/eventsource/eventsource.js"(exports2, module2) { "use strict"; var { pipeline } = require("node:stream"); var { fetching } = require_fetch(); var { makeRequest } = require_request2(); var { webidl } = require_webidl(); var { EventSourceStream } = require_eventsource_stream(); var { parseMIMEType } = require_data_url(); var { createFastMessageEvent } = require_events(); var { isNetworkError } = require_response(); var { delay } = require_util8(); var { kEnumerableProperty } = require_util(); var { environmentSettingsObject } = require_util2(); var experimentalWarned = false; var defaultReconnectionTime = 3e3; var CONNECTING = 0; var OPEN = 1; var CLOSED = 2; var ANONYMOUS = "anonymous"; var USE_CREDENTIALS = "use-credentials"; var EventSource = class _EventSource extends EventTarget { #events = { open: null, error: null, message: null }; #url = null; #withCredentials = false; #readyState = CONNECTING; #request = null; #controller = null; #dispatcher; /** * @type {import('./eventsource-stream').eventSourceSettings} */ #state; /** * Creates a new EventSource object. * @param {string} url * @param {EventSourceInit} [eventSourceInitDict] * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#the-eventsource-interface */ constructor(url, eventSourceInitDict = {}) { super(); webidl.util.markAsUncloneable(this); const prefix = "EventSource constructor"; webidl.argumentLengthCheck(arguments, 1, prefix); if (!experimentalWarned) { experimentalWarned = true; process.emitWarning("EventSource is experimental, expect them to change at any time.", { code: "UNDICI-ES" }); } url = webidl.converters.USVString(url, prefix, "url"); eventSourceInitDict = webidl.converters.EventSourceInitDict(eventSourceInitDict, prefix, "eventSourceInitDict"); this.#dispatcher = eventSourceInitDict.dispatcher; this.#state = { lastEventId: "", reconnectionTime: defaultReconnectionTime }; const settings = environmentSettingsObject; let urlRecord; try { urlRecord = new URL(url, settings.settingsObject.baseUrl); this.#state.origin = urlRecord.origin; } catch (e5) { throw new DOMException(e5, "SyntaxError"); } this.#url = urlRecord.href; let corsAttributeState = ANONYMOUS; if (eventSourceInitDict.withCredentials) { corsAttributeState = USE_CREDENTIALS; this.#withCredentials = true; } const initRequest = { redirect: "follow", keepalive: true, // @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-settings-attributes mode: "cors", credentials: corsAttributeState === "anonymous" ? "same-origin" : "omit", referrer: "no-referrer" }; initRequest.client = environmentSettingsObject.settingsObject; initRequest.headersList = [["accept", { name: "accept", value: "text/event-stream" }]]; initRequest.cache = "no-store"; initRequest.initiator = "other"; initRequest.urlList = [new URL(this.#url)]; this.#request = makeRequest(initRequest); this.#connect(); } /** * Returns the state of this EventSource object's connection. It can have the * values described below. * @returns {0|1|2} * @readonly */ get readyState() { return this.#readyState; } /** * Returns the URL providing the event stream. * @readonly * @returns {string} */ get url() { return this.#url; } /** * Returns a boolean indicating whether the EventSource object was * instantiated with CORS credentials set (true), or not (false, the default). */ get withCredentials() { return this.#withCredentials; } #connect() { if (this.#readyState === CLOSED) return; this.#readyState = CONNECTING; const fetchParams = { request: this.#request, dispatcher: this.#dispatcher }; const processEventSourceEndOfBody = (response) => { if (isNetworkError(response)) { this.dispatchEvent(new Event("error")); this.close(); } this.#reconnect(); }; fetchParams.processResponseEndOfBody = processEventSourceEndOfBody; fetchParams.processResponse = (response) => { if (isNetworkError(response)) { if (response.aborted) { this.close(); this.dispatchEvent(new Event("error")); return; } else { this.#reconnect(); return; } } const contentType = response.headersList.get("content-type", true); const mimeType = contentType !== null ? parseMIMEType(contentType) : "failure"; const contentTypeValid = mimeType !== "failure" && mimeType.essence === "text/event-stream"; if (response.status !== 200 || contentTypeValid === false) { this.close(); this.dispatchEvent(new Event("error")); return; } this.#readyState = OPEN; this.dispatchEvent(new Event("open")); this.#state.origin = response.urlList[response.urlList.length - 1].origin; const eventSourceStream = new EventSourceStream({ eventSourceSettings: this.#state, push: (event) => { this.dispatchEvent(createFastMessageEvent( event.type, event.options )); } }); pipeline( response.body.stream, eventSourceStream, (error3) => { if (error3?.aborted === false) { this.close(); this.dispatchEvent(new Event("error")); } } ); }; this.#controller = fetching(fetchParams); } /** * @see https://html.spec.whatwg.org/multipage/server-sent-events.html#sse-processing-model * @returns {Promise} */ async #reconnect() { if (this.#readyState === CLOSED) return; this.#readyState = CONNECTING; this.dispatchEvent(new Event("error")); await delay(this.#state.reconnectionTime); if (this.#readyState !== CONNECTING) return; if (this.#state.lastEventId.length) { this.#request.headersList.set("last-event-id", this.#state.lastEventId, true); } this.#connect(); } /** * Closes the connection, if any, and sets the readyState attribute to * CLOSED. */ close() { webidl.brandCheck(this, _EventSource); if (this.#readyState === CLOSED) return; this.#readyState = CLOSED; this.#controller.abort(); this.#request = null; } get onopen() { return this.#events.open; } set onopen(fn) { if (this.#events.open) { this.removeEventListener("open", this.#events.open); } if (typeof fn === "function") { this.#events.open = fn; this.addEventListener("open", fn); } else { this.#events.open = null; } } get onmessage() { return this.#events.message; } set onmessage(fn) { if (this.#events.message) { this.removeEventListener("message", this.#events.message); } if (typeof fn === "function") { this.#events.message = fn; this.addEventListener("message", fn); } else { this.#events.message = null; } } get onerror() { return this.#events.error; } set onerror(fn) { if (this.#events.error) { this.removeEventListener("error", this.#events.error); } if (typeof fn === "function") { this.#events.error = fn; this.addEventListener("error", fn); } else { this.#events.error = null; } } }; var constantsPropertyDescriptors = { CONNECTING: { __proto__: null, configurable: false, enumerable: true, value: CONNECTING, writable: false }, OPEN: { __proto__: null, configurable: false, enumerable: true, value: OPEN, writable: false }, CLOSED: { __proto__: null, configurable: false, enumerable: true, value: CLOSED, writable: false } }; Object.defineProperties(EventSource, constantsPropertyDescriptors); Object.defineProperties(EventSource.prototype, constantsPropertyDescriptors); Object.defineProperties(EventSource.prototype, { close: kEnumerableProperty, onerror: kEnumerableProperty, onmessage: kEnumerableProperty, onopen: kEnumerableProperty, readyState: kEnumerableProperty, url: kEnumerableProperty, withCredentials: kEnumerableProperty }); webidl.converters.EventSourceInitDict = webidl.dictionaryConverter([ { key: "withCredentials", converter: webidl.converters.boolean, defaultValue: () => false }, { key: "dispatcher", // undici only converter: webidl.converters.any } ]); module2.exports = { EventSource, defaultReconnectionTime }; } }); // node_modules/undici/index.js var require_undici = __commonJS({ "node_modules/undici/index.js"(exports2, module2) { "use strict"; var Client2 = require_client(); var Dispatcher = require_dispatcher(); var Pool = require_pool(); var BalancedPool = require_balanced_pool(); var Agent9 = require_agent(); var ProxyAgent3 = require_proxy_agent(); var EnvHttpProxyAgent = require_env_http_proxy_agent(); var RetryAgent = require_retry_agent(); var errors = require_errors(); var util = 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 RetryHandler = require_retry_handler(); var { getGlobalDispatcher, setGlobalDispatcher } = require_global2(); var DecoratorHandler = require_decorator_handler(); var RedirectHandler = require_redirect_handler(); var createRedirectInterceptor = require_redirect_interceptor(); Object.assign(Dispatcher.prototype, api); module2.exports.Dispatcher = Dispatcher; module2.exports.Client = Client2; module2.exports.Pool = Pool; module2.exports.BalancedPool = BalancedPool; module2.exports.Agent = Agent9; module2.exports.ProxyAgent = ProxyAgent3; module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent; module2.exports.RetryAgent = RetryAgent; module2.exports.RetryHandler = RetryHandler; module2.exports.DecoratorHandler = DecoratorHandler; module2.exports.RedirectHandler = RedirectHandler; module2.exports.createRedirectInterceptor = createRedirectInterceptor; module2.exports.interceptors = { redirect: require_redirect(), retry: require_retry(), dump: require_dump(), dns: require_dns() }; module2.exports.buildConnector = buildConnector; module2.exports.errors = errors; module2.exports.util = { parseHeaders: util.parseHeaders, headerNameToString: util.headerNameToString }; function makeDispatcher(fn) { return (url, opts, handler) => { if (typeof opts === "function") { handler = opts; opts = null; } if (!url || typeof url !== "string" && typeof url !== "object" && !(url 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 path3 = opts.path; if (!opts.path.startsWith("/")) { path3 = `/${path3}`; } url = new URL(util.parseOrigin(url).origin + path3); } else { if (!opts) { opts = typeof url === "object" ? url : {}; } url = util.parseURL(url); } const { agent, dispatcher = getGlobalDispatcher() } = opts; if (agent) { throw new InvalidArgumentError("unsupported opts.agent. Did you mean opts.client?"); } return fn.call(dispatcher, { ...opts, origin: url.origin, path: url.search ? `${url.pathname}${url.search}` : url.pathname, method: opts.method || (opts.body ? "PUT" : "GET") }, handler); }; } module2.exports.setGlobalDispatcher = setGlobalDispatcher; module2.exports.getGlobalDispatcher = getGlobalDispatcher; var fetchImpl = require_fetch().fetch; module2.exports.fetch = async function fetch2(init, options = void 0) { try { return await fetchImpl(init, options); } catch (err) { if (err && typeof err === "object") { Error.captureStackTrace(err); } throw err; } }; module2.exports.Headers = require_headers().Headers; module2.exports.Response = require_response().Response; module2.exports.Request = require_request2().Request; module2.exports.FormData = require_formdata().FormData; module2.exports.File = globalThis.File ?? require("node:buffer").File; module2.exports.FileReader = require_filereader().FileReader; var { setGlobalOrigin, getGlobalOrigin } = require_global(); module2.exports.setGlobalOrigin = setGlobalOrigin; module2.exports.getGlobalOrigin = getGlobalOrigin; var { CacheStorage } = require_cachestorage(); var { kConstruct } = require_symbols4(); module2.exports.caches = new CacheStorage(kConstruct); var { deleteCookie, getCookies, getSetCookies, setCookie } = require_cookies(); module2.exports.deleteCookie = deleteCookie; module2.exports.getCookies = getCookies; module2.exports.getSetCookies = getSetCookies; module2.exports.setCookie = setCookie; var { parseMIMEType, serializeAMimeType } = require_data_url(); module2.exports.parseMIMEType = parseMIMEType; module2.exports.serializeAMimeType = serializeAMimeType; var { CloseEvent, ErrorEvent, MessageEvent } = require_events(); module2.exports.WebSocket = require_websocket().WebSocket; module2.exports.CloseEvent = CloseEvent; module2.exports.ErrorEvent = ErrorEvent; module2.exports.MessageEvent = MessageEvent; module2.exports.request = makeDispatcher(api.request); module2.exports.stream = makeDispatcher(api.stream); module2.exports.pipeline = makeDispatcher(api.pipeline); module2.exports.connect = makeDispatcher(api.connect); module2.exports.upgrade = makeDispatcher(api.upgrade); module2.exports.MockClient = MockClient; module2.exports.MockPool = MockPool; module2.exports.MockAgent = MockAgent; module2.exports.mockErrors = mockErrors; var { EventSource } = require_eventsource(); module2.exports.EventSource = EventSource; } }); // node_modules/@smithy/types/dist-cjs/index.js var require_dist_cjs = __commonJS({ "node_modules/@smithy/types/dist-cjs/index.js"(exports2) { "use strict"; exports2.HttpAuthLocation = void 0; (function(HttpAuthLocation) { HttpAuthLocation["HEADER"] = "header"; HttpAuthLocation["QUERY"] = "query"; })(exports2.HttpAuthLocation || (exports2.HttpAuthLocation = {})); exports2.HttpApiKeyAuthLocation = void 0; (function(HttpApiKeyAuthLocation2) { HttpApiKeyAuthLocation2["HEADER"] = "header"; HttpApiKeyAuthLocation2["QUERY"] = "query"; })(exports2.HttpApiKeyAuthLocation || (exports2.HttpApiKeyAuthLocation = {})); exports2.EndpointURLScheme = void 0; (function(EndpointURLScheme) { EndpointURLScheme["HTTP"] = "http"; EndpointURLScheme["HTTPS"] = "https"; })(exports2.EndpointURLScheme || (exports2.EndpointURLScheme = {})); exports2.AlgorithmId = void 0; (function(AlgorithmId) { AlgorithmId["MD5"] = "md5"; AlgorithmId["CRC32"] = "crc32"; AlgorithmId["CRC32C"] = "crc32c"; AlgorithmId["SHA1"] = "sha1"; AlgorithmId["SHA256"] = "sha256"; })(exports2.AlgorithmId || (exports2.AlgorithmId = {})); var getChecksumConfiguration = (runtimeConfig) => { const checksumAlgorithms = []; if (runtimeConfig.sha256 !== void 0) { checksumAlgorithms.push({ algorithmId: () => exports2.AlgorithmId.SHA256, checksumConstructor: () => runtimeConfig.sha256 }); } if (runtimeConfig.md5 != void 0) { checksumAlgorithms.push({ algorithmId: () => exports2.AlgorithmId.MD5, checksumConstructor: () => runtimeConfig.md5 }); } return { addChecksumAlgorithm(algo) { checksumAlgorithms.push(algo); }, checksumAlgorithms() { return checksumAlgorithms; } }; }; var resolveChecksumRuntimeConfig = (clientConfig) => { const runtimeConfig = {}; clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor(); }); return runtimeConfig; }; var getDefaultClientConfiguration = (runtimeConfig) => { return getChecksumConfiguration(runtimeConfig); }; var resolveDefaultRuntimeConfig5 = (config) => { return resolveChecksumRuntimeConfig(config); }; exports2.FieldPosition = void 0; (function(FieldPosition) { FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER"; FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER"; })(exports2.FieldPosition || (exports2.FieldPosition = {})); var SMITHY_CONTEXT_KEY2 = "__smithy_context"; exports2.IniSectionType = void 0; (function(IniSectionType) { IniSectionType["PROFILE"] = "profile"; IniSectionType["SSO_SESSION"] = "sso-session"; IniSectionType["SERVICES"] = "services"; })(exports2.IniSectionType || (exports2.IniSectionType = {})); exports2.RequestHandlerProtocol = void 0; (function(RequestHandlerProtocol) { RequestHandlerProtocol["HTTP_0_9"] = "http/0.9"; RequestHandlerProtocol["HTTP_1_0"] = "http/1.0"; RequestHandlerProtocol["TDS_8_0"] = "tds/8.0"; })(exports2.RequestHandlerProtocol || (exports2.RequestHandlerProtocol = {})); exports2.SMITHY_CONTEXT_KEY = SMITHY_CONTEXT_KEY2; exports2.getDefaultClientConfiguration = getDefaultClientConfiguration; exports2.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig5; } }); // node_modules/@smithy/protocol-http/dist-cjs/index.js var require_dist_cjs2 = __commonJS({ "node_modules/@smithy/protocol-http/dist-cjs/index.js"(exports2) { "use strict"; var types3 = require_dist_cjs(); var getHttpHandlerExtensionConfiguration5 = (runtimeConfig) => { return { setHttpHandler(handler) { runtimeConfig.httpHandler = handler; }, httpHandler() { return runtimeConfig.httpHandler; }, updateHttpClientConfig(key, value) { runtimeConfig.httpHandler?.updateHttpClientConfig(key, value); }, httpHandlerConfigs() { return runtimeConfig.httpHandler.httpHandlerConfigs(); } }; }; var resolveHttpHandlerRuntimeConfig5 = (httpHandlerExtensionConfiguration) => { return { httpHandler: httpHandlerExtensionConfiguration.httpHandler() }; }; var Field = class { name; kind; values; constructor({ name, kind = types3.FieldPosition.HEADER, values = [] }) { this.name = name; this.kind = kind; this.values = values; } add(value) { this.values.push(value); } set(values) { this.values = values; } remove(value) { this.values = this.values.filter((v) => v !== value); } toString() { return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", "); } get() { return this.values; } }; var Fields = class { entries = {}; encoding; constructor({ fields = [], encoding = "utf-8" }) { fields.forEach(this.setField.bind(this)); this.encoding = encoding; } setField(field) { this.entries[field.name.toLowerCase()] = field; } getField(name) { return this.entries[name.toLowerCase()]; } removeField(name) { delete this.entries[name.toLowerCase()]; } getByType(kind) { return Object.values(this.entries).filter((field) => field.kind === kind); } }; var HttpRequest10 = class _HttpRequest { method; protocol; hostname; port; path; query; headers; username; password; fragment; body; constructor(options) { this.method = options.method || "GET"; this.hostname = options.hostname || "localhost"; this.port = options.port; this.query = options.query || {}; this.headers = options.headers || {}; this.body = options.body; this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:"; this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/"; this.username = options.username; this.password = options.password; this.fragment = options.fragment; } static clone(request) { const cloned = new _HttpRequest({ ...request, headers: { ...request.headers } }); if (cloned.query) { cloned.query = cloneQuery(cloned.query); } return cloned; } static isInstance(request) { if (!request) { return false; } const req = request; 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); } }; function cloneQuery(query) { return Object.keys(query).reduce((carry, paramName) => { const param = query[paramName]; return { ...carry, [paramName]: Array.isArray(param) ? [...param] : param }; }, {}); } var HttpResponse4 = class { statusCode; reason; headers; body; constructor(options) { this.statusCode = options.statusCode; this.reason = options.reason; this.headers = options.headers || {}; this.body = options.body; } static isInstance(response) { if (!response) return false; const resp = response; return typeof resp.statusCode === "number" && typeof resp.headers === "object"; } }; function isValidHostname(hostname) { const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/; return hostPattern.test(hostname); } exports2.Field = Field; exports2.Fields = Fields; exports2.HttpRequest = HttpRequest10; exports2.HttpResponse = HttpResponse4; exports2.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration5; exports2.isValidHostname = isValidHostname; exports2.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig5; } }); // node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js var require_dist_cjs3 = __commonJS({ "node_modules/@aws-sdk/middleware-host-header/dist-cjs/index.js"(exports2) { "use strict"; var protocolHttp = require_dist_cjs2(); function resolveHostHeaderConfig5(input) { return input; } var hostHeaderMiddleware = (options) => (next) => async (args) => { if (!protocolHttp.HttpRequest.isInstance(args.request)) return next(args); const { request } = args; const { handlerProtocol = "" } = options.requestHandler.metadata || {}; if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) { delete request.headers["host"]; request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : ""); } else if (!request.headers["host"]) { let host = request.hostname; if (request.port != null) host += `:${request.port}`; request.headers["host"] = host; } return next(args); }; var hostHeaderMiddlewareOptions = { name: "hostHeaderMiddleware", step: "build", priority: "low", tags: ["HOST"], override: true }; var getHostHeaderPlugin5 = (options) => ({ applyToStack: (clientStack) => { clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions); } }); exports2.getHostHeaderPlugin = getHostHeaderPlugin5; exports2.hostHeaderMiddleware = hostHeaderMiddleware; exports2.hostHeaderMiddlewareOptions = hostHeaderMiddlewareOptions; exports2.resolveHostHeaderConfig = resolveHostHeaderConfig5; } }); // node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js var require_dist_cjs4 = __commonJS({ "node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js"(exports2) { "use strict"; var loggerMiddleware = () => (next, context) => async (args) => { try { const response = await next(args); const { clientName, commandName, logger: logger2, dynamoDbDocumentClientOptions = {} } = context; const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions; const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog; const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog; const { $metadata, ...outputWithoutMetadata } = response.output; logger2?.info?.({ clientName, commandName, input: inputFilterSensitiveLog(args.input), output: outputFilterSensitiveLog(outputWithoutMetadata), metadata: $metadata }); return response; } catch (error3) { const { clientName, commandName, logger: logger2, dynamoDbDocumentClientOptions = {} } = context; const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions; const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog; logger2?.error?.({ clientName, commandName, input: inputFilterSensitiveLog(args.input), error: error3, metadata: error3.$metadata }); throw error3; } }; var loggerMiddlewareOptions = { name: "loggerMiddleware", tags: ["LOGGER"], step: "initialize", override: true }; var getLoggerPlugin5 = (options) => ({ applyToStack: (clientStack) => { clientStack.add(loggerMiddleware(), loggerMiddlewareOptions); } }); exports2.getLoggerPlugin = getLoggerPlugin5; exports2.loggerMiddleware = loggerMiddleware; exports2.loggerMiddlewareOptions = loggerMiddlewareOptions; } }); // node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js var invoke_store_exports = {}; __export(invoke_store_exports, { InvokeStore: () => InvokeStore, InvokeStoreBase: () => InvokeStoreBase }); var PROTECTED_KEYS, NO_GLOBAL_AWS_LAMBDA, InvokeStoreBase, InvokeStoreSingle, InvokeStoreMulti, InvokeStore; var init_invoke_store = __esm({ "node_modules/@aws/lambda-invoke-store/dist-es/invoke-store.js"() { PROTECTED_KEYS = { REQUEST_ID: /* @__PURE__ */ Symbol.for("_AWS_LAMBDA_REQUEST_ID"), X_RAY_TRACE_ID: /* @__PURE__ */ Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"), TENANT_ID: /* @__PURE__ */ Symbol.for("_AWS_LAMBDA_TENANT_ID") }; NO_GLOBAL_AWS_LAMBDA = ["true", "1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA ?? ""); if (!NO_GLOBAL_AWS_LAMBDA) { globalThis.awslambda = globalThis.awslambda || {}; } InvokeStoreBase = class { static PROTECTED_KEYS = PROTECTED_KEYS; isProtectedKey(key) { return Object.values(PROTECTED_KEYS).includes(key); } getRequestId() { return this.get(PROTECTED_KEYS.REQUEST_ID) ?? "-"; } getXRayTraceId() { return this.get(PROTECTED_KEYS.X_RAY_TRACE_ID); } getTenantId() { return this.get(PROTECTED_KEYS.TENANT_ID); } }; InvokeStoreSingle = class extends InvokeStoreBase { currentContext; getContext() { return this.currentContext; } hasContext() { return this.currentContext !== void 0; } get(key) { return this.currentContext?.[key]; } set(key, value) { if (this.isProtectedKey(key)) { throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`); } this.currentContext = this.currentContext || {}; this.currentContext[key] = value; } run(context, fn) { this.currentContext = context; return fn(); } }; InvokeStoreMulti = class _InvokeStoreMulti extends InvokeStoreBase { als; static async create() { const instance = new _InvokeStoreMulti(); const asyncHooks = await import("node:async_hooks"); instance.als = new asyncHooks.AsyncLocalStorage(); return instance; } getContext() { return this.als.getStore(); } hasContext() { return this.als.getStore() !== void 0; } get(key) { return this.als.getStore()?.[key]; } set(key, value) { if (this.isProtectedKey(key)) { throw new Error(`Cannot modify protected Lambda context field: ${String(key)}`); } const store = this.als.getStore(); if (!store) { throw new Error("No context available"); } store[key] = value; } run(context, fn) { return this.als.run(context, fn); } }; (function(InvokeStore2) { let instance = null; async function getInstanceAsync(forceInvokeStoreMulti) { if (!instance) { instance = (async () => { const isMulti = forceInvokeStoreMulti === true || "AWS_LAMBDA_MAX_CONCURRENCY" in process.env; const newInstance = isMulti ? await InvokeStoreMulti.create() : new InvokeStoreSingle(); if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda?.InvokeStore) { return globalThis.awslambda.InvokeStore; } else if (!NO_GLOBAL_AWS_LAMBDA && globalThis.awslambda) { globalThis.awslambda.InvokeStore = newInstance; return newInstance; } else { return newInstance; } })(); } return instance; } InvokeStore2.getInstanceAsync = getInstanceAsync; InvokeStore2._testing = process.env.AWS_LAMBDA_BENCHMARK_MODE === "1" ? { reset: () => { instance = null; if (globalThis.awslambda?.InvokeStore) { delete globalThis.awslambda.InvokeStore; } globalThis.awslambda = { InvokeStore: void 0 }; } } : void 0; })(InvokeStore || (InvokeStore = {})); } }); // node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js var require_recursionDetectionMiddleware = __commonJS({ "node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/recursionDetectionMiddleware.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.recursionDetectionMiddleware = void 0; var lambda_invoke_store_1 = (init_invoke_store(), __toCommonJS(invoke_store_exports)); var protocol_http_1 = require_dist_cjs2(); var TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id"; var ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME"; var ENV_TRACE_ID = "_X_AMZN_TRACE_ID"; var recursionDetectionMiddleware = () => (next) => async (args) => { const { request } = args; if (!protocol_http_1.HttpRequest.isInstance(request)) { return next(args); } const traceIdHeader = Object.keys(request.headers ?? {}).find((h5) => h5.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ?? TRACE_ID_HEADER_NAME; if (request.headers.hasOwnProperty(traceIdHeader)) { return next(args); } const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME]; const traceIdFromEnv = process.env[ENV_TRACE_ID]; const invokeStore = await lambda_invoke_store_1.InvokeStore.getInstanceAsync(); const traceIdFromInvokeStore = invokeStore?.getXRayTraceId(); const traceId = traceIdFromInvokeStore ?? traceIdFromEnv; const nonEmptyString = (str) => typeof str === "string" && str.length > 0; if (nonEmptyString(functionName) && nonEmptyString(traceId)) { request.headers[TRACE_ID_HEADER_NAME] = traceId; } return next({ ...args, request }); }; exports2.recursionDetectionMiddleware = recursionDetectionMiddleware; } }); // node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js var require_dist_cjs5 = __commonJS({ "node_modules/@aws-sdk/middleware-recursion-detection/dist-cjs/index.js"(exports2) { "use strict"; var recursionDetectionMiddleware = require_recursionDetectionMiddleware(); var recursionDetectionMiddlewareOptions = { step: "build", tags: ["RECURSION_DETECTION"], name: "recursionDetectionMiddleware", override: true, priority: "low" }; var getRecursionDetectionPlugin5 = (options) => ({ applyToStack: (clientStack) => { clientStack.add(recursionDetectionMiddleware.recursionDetectionMiddleware(), recursionDetectionMiddlewareOptions); } }); exports2.getRecursionDetectionPlugin = getRecursionDetectionPlugin5; Object.prototype.hasOwnProperty.call(recursionDetectionMiddleware, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: recursionDetectionMiddleware["__proto__"] }); Object.keys(recursionDetectionMiddleware).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = recursionDetectionMiddleware[k5]; }); } }); // node_modules/@smithy/core/dist-es/getSmithyContext.js var import_types, getSmithyContext; var init_getSmithyContext = __esm({ "node_modules/@smithy/core/dist-es/getSmithyContext.js"() { import_types = __toESM(require_dist_cjs()); getSmithyContext = (context) => context[import_types.SMITHY_CONTEXT_KEY] || (context[import_types.SMITHY_CONTEXT_KEY] = {}); } }); // node_modules/@smithy/util-middleware/dist-cjs/index.js var require_dist_cjs6 = __commonJS({ "node_modules/@smithy/util-middleware/dist-cjs/index.js"(exports2) { "use strict"; var types3 = require_dist_cjs(); var getSmithyContext11 = (context) => context[types3.SMITHY_CONTEXT_KEY] || (context[types3.SMITHY_CONTEXT_KEY] = {}); var normalizeProvider6 = (input) => { if (typeof input === "function") return input; const promisified = Promise.resolve(input); return () => promisified; }; exports2.getSmithyContext = getSmithyContext11; exports2.normalizeProvider = normalizeProvider6; } }); // node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/resolveAuthOptions.js var resolveAuthOptions; var init_resolveAuthOptions = __esm({ "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/resolveAuthOptions.js"() { resolveAuthOptions = (candidateAuthOptions, authSchemePreference) => { if (!authSchemePreference || authSchemePreference.length === 0) { return candidateAuthOptions; } const preferredAuthOptions = []; for (const preferredSchemeName of authSchemePreference) { for (const candidateAuthOption of candidateAuthOptions) { const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1]; if (candidateAuthSchemeName === preferredSchemeName) { preferredAuthOptions.push(candidateAuthOption); } } } for (const candidateAuthOption of candidateAuthOptions) { if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) { preferredAuthOptions.push(candidateAuthOption); } } return preferredAuthOptions; }; } }); // 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 import_util_middleware, httpAuthSchemeMiddleware; var init_httpAuthSchemeMiddleware = __esm({ "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js"() { import_util_middleware = __toESM(require_dist_cjs6()); init_resolveAuthOptions(); httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => { const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input)); const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : []; const resolvedOptions = resolveAuthOptions(options, authSchemePreference); const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes); const smithyContext = (0, import_util_middleware.getSmithyContext)(context); const failureReasons = []; for (const option of resolvedOptions) { 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, context) || {}; 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); }; } }); // node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js var httpAuthSchemeEndpointRuleSetMiddlewareOptions, getHttpAuthSchemeEndpointRuleSetPlugin; var init_getHttpAuthSchemeEndpointRuleSetPlugin = __esm({ "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js"() { init_httpAuthSchemeMiddleware(); httpAuthSchemeEndpointRuleSetMiddlewareOptions = { step: "serialize", tags: ["HTTP_AUTH_SCHEME"], name: "httpAuthSchemeMiddleware", override: true, relation: "before", toMiddleware: "endpointV2Middleware" }; getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }), httpAuthSchemeEndpointRuleSetMiddlewareOptions); } }); } }); // node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js var httpAuthSchemeMiddlewareOptions, getHttpAuthSchemePlugin; var init_getHttpAuthSchemePlugin = __esm({ "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js"() { init_httpAuthSchemeMiddleware(); httpAuthSchemeMiddlewareOptions = { step: "serialize", tags: ["HTTP_AUTH_SCHEME"], name: "httpAuthSchemeMiddleware", override: true, relation: "before", toMiddleware: "serializerMiddleware" }; getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }), httpAuthSchemeMiddlewareOptions); } }); } }); // node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js var init_middleware_http_auth_scheme = __esm({ "node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js"() { init_httpAuthSchemeMiddleware(); init_getHttpAuthSchemeEndpointRuleSetPlugin(); init_getHttpAuthSchemePlugin(); } }); // node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js var import_protocol_http, import_util_middleware2, defaultErrorHandler, defaultSuccessHandler, httpSigningMiddleware; var init_httpSigningMiddleware = __esm({ "node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js"() { import_protocol_http = __toESM(require_dist_cjs2()); import_util_middleware2 = __toESM(require_dist_cjs6()); defaultErrorHandler = (signingProperties) => (error3) => { throw error3; }; defaultSuccessHandler = (httpResponse, signingProperties) => { }; httpSigningMiddleware = (config) => (next, context) => async (args) => { if (!import_protocol_http.HttpRequest.isInstance(args.request)) { return next(args); } const smithyContext = (0, import_util_middleware2.getSmithyContext)(context); 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; }; } }); // node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js var httpSigningMiddlewareOptions, getHttpSigningPlugin; var init_getHttpSigningMiddleware = __esm({ "node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js"() { init_httpSigningMiddleware(); httpSigningMiddlewareOptions = { step: "finalizeRequest", tags: ["HTTP_SIGNING"], name: "httpSigningMiddleware", aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"], override: true, relation: "after", toMiddleware: "retryMiddleware" }; getHttpSigningPlugin = (config) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions); } }); } }); // node_modules/@smithy/core/dist-es/middleware-http-signing/index.js var init_middleware_http_signing = __esm({ "node_modules/@smithy/core/dist-es/middleware-http-signing/index.js"() { init_httpSigningMiddleware(); init_getHttpSigningMiddleware(); } }); // node_modules/@smithy/core/dist-es/normalizeProvider.js var normalizeProvider; var init_normalizeProvider = __esm({ "node_modules/@smithy/core/dist-es/normalizeProvider.js"() { normalizeProvider = (input) => { if (typeof input === "function") return input; const promisified = Promise.resolve(input); return () => promisified; }; } }); // node_modules/@smithy/core/dist-es/pagination/createPaginator.js function createPaginator(ClientCtor, CommandCtor, inputTokenName, outputTokenName, pageSizeTokenName) { return async function* paginateOperation(config, input, ...additionalArguments) { const _input = input; let token = config.startingToken ?? _input[inputTokenName]; 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, config.withCommand, ...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; }; } var makePagedClientRequest, get; var init_createPaginator = __esm({ "node_modules/@smithy/core/dist-es/pagination/createPaginator.js"() { makePagedClientRequest = async (CommandCtor, client, input, withCommand = (_) => _, ...args) => { let command = new CommandCtor(input); command = withCommand(command) ?? command; return await client.send(command, ...args); }; get = (fromObject, path3) => { let cursor2 = fromObject; const pathComponents = path3.split("."); for (const step of pathComponents) { if (!cursor2 || typeof cursor2 !== "object") { return void 0; } cursor2 = cursor2[step]; } return cursor2; }; } }); // node_modules/@smithy/is-array-buffer/dist-cjs/index.js var require_dist_cjs7 = __commonJS({ "node_modules/@smithy/is-array-buffer/dist-cjs/index.js"(exports2) { "use strict"; var isArrayBuffer = (arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]"; exports2.isArrayBuffer = isArrayBuffer; } }); // node_modules/@smithy/util-buffer-from/dist-cjs/index.js var require_dist_cjs8 = __commonJS({ "node_modules/@smithy/util-buffer-from/dist-cjs/index.js"(exports2) { "use strict"; var isArrayBuffer = require_dist_cjs7(); var buffer = require("buffer"); var fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { if (!isArrayBuffer.isArrayBuffer(input)) { throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); } return buffer.Buffer.from(input, offset, length); }; var fromString = (input, encoding) => { if (typeof input !== "string") { throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); } return encoding ? buffer.Buffer.from(input, encoding) : buffer.Buffer.from(input); }; exports2.fromArrayBuffer = fromArrayBuffer; exports2.fromString = fromString; } }); // node_modules/@smithy/util-base64/dist-cjs/fromBase64.js var require_fromBase64 = __commonJS({ "node_modules/@smithy/util-base64/dist-cjs/fromBase64.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.fromBase64 = void 0; var util_buffer_from_1 = require_dist_cjs8(); var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; var fromBase649 = (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 = (0, util_buffer_from_1.fromString)(input, "base64"); return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); }; exports2.fromBase64 = fromBase649; } }); // node_modules/@smithy/util-utf8/dist-cjs/index.js var require_dist_cjs9 = __commonJS({ "node_modules/@smithy/util-utf8/dist-cjs/index.js"(exports2) { "use strict"; var utilBufferFrom = require_dist_cjs8(); var fromUtf88 = (input) => { const buf = utilBufferFrom.fromString(input, "utf8"); return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT); }; var toUint8Array2 = (data3) => { if (typeof data3 === "string") { return fromUtf88(data3); } if (ArrayBuffer.isView(data3)) { return new Uint8Array(data3.buffer, data3.byteOffset, data3.byteLength / Uint8Array.BYTES_PER_ELEMENT); } return new Uint8Array(data3); }; var toUtf811 = (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 utilBufferFrom.fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8"); }; exports2.fromUtf8 = fromUtf88; exports2.toUint8Array = toUint8Array2; exports2.toUtf8 = toUtf811; } }); // node_modules/@smithy/util-base64/dist-cjs/toBase64.js var require_toBase64 = __commonJS({ "node_modules/@smithy/util-base64/dist-cjs/toBase64.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.toBase64 = void 0; var util_buffer_from_1 = require_dist_cjs8(); var util_utf8_1 = require_dist_cjs9(); var toBase649 = (_input) => { let input; if (typeof _input === "string") { input = (0, util_utf8_1.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 (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64"); }; exports2.toBase64 = toBase649; } }); // node_modules/@smithy/util-base64/dist-cjs/index.js var require_dist_cjs10 = __commonJS({ "node_modules/@smithy/util-base64/dist-cjs/index.js"(exports2) { "use strict"; var fromBase649 = require_fromBase64(); var toBase649 = require_toBase64(); Object.prototype.hasOwnProperty.call(fromBase649, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: fromBase649["__proto__"] }); Object.keys(fromBase649).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = fromBase649[k5]; }); Object.prototype.hasOwnProperty.call(toBase649, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: toBase649["__proto__"] }); Object.keys(toBase649).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = toBase649[k5]; }); } }); // node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js var require_ChecksumStream = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ChecksumStream = void 0; var util_base64_1 = require_dist_cjs10(); var stream_1 = require("stream"); var ChecksumStream = class extends stream_1.Duplex { expectedChecksum; checksumSourceLocation; checksum; source; base64Encoder; pendingCallback = null; constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) { super(); if (typeof source.pipe === "function") { this.source = source; } else { throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`); } this.base64Encoder = base64Encoder ?? util_base64_1.toBase64; this.expectedChecksum = expectedChecksum; this.checksum = checksum; this.checksumSourceLocation = checksumSourceLocation; this.source.pipe(this); } _read(size) { if (this.pendingCallback) { const callback = this.pendingCallback; this.pendingCallback = null; callback(); } } _write(chunk, encoding, callback) { try { this.checksum.update(chunk); const canPushMore = this.push(chunk); if (!canPushMore) { this.pendingCallback = callback; return; } } catch (e5) { return callback(e5); } return callback(); } async _final(callback) { try { const digest = await this.checksum.digest(); const received = this.base64Encoder(digest); if (this.expectedChecksum !== received) { return callback(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${received}" in response header "${this.checksumSourceLocation}".`)); } } catch (e5) { return callback(e5); } this.push(null); return callback(); } }; exports2.ChecksumStream = ChecksumStream; } }); // node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js var require_stream_type_check = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.isBlob = exports2.isReadableStream = void 0; var isReadableStream = (stream) => typeof ReadableStream === "function" && (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream); exports2.isReadableStream = isReadableStream; var isBlob = (blob) => { return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob); }; exports2.isBlob = isBlob; } }); // node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js var require_ChecksumStream_browser = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ChecksumStream = void 0; var ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function() { }; var ChecksumStream = class extends ReadableStreamRef { }; exports2.ChecksumStream = ChecksumStream; } }); // node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js var require_createChecksumStream_browser = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createChecksumStream = void 0; var util_base64_1 = require_dist_cjs10(); var stream_type_check_1 = require_stream_type_check(); var ChecksumStream_browser_1 = require_ChecksumStream_browser(); var createChecksumStream = ({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) => { if (!(0, stream_type_check_1.isReadableStream)(source)) { throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`); } const encoder = base64Encoder ?? util_base64_1.toBase64; if (typeof TransformStream !== "function") { throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream."); } const transform = new TransformStream({ start() { }, async transform(chunk, controller) { checksum.update(chunk); controller.enqueue(chunk); }, async flush(controller) { const digest = await checksum.digest(); const received = encoder(digest); if (expectedChecksum !== received) { const error3 = new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}" in response header "${checksumSourceLocation}".`); controller.error(error3); } else { controller.terminate(); } } }); source.pipeThrough(transform); const readable = transform.readable; Object.setPrototypeOf(readable, ChecksumStream_browser_1.ChecksumStream.prototype); return readable; }; exports2.createChecksumStream = createChecksumStream; } }); // node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js var require_createChecksumStream = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createChecksumStream = createChecksumStream; var stream_type_check_1 = require_stream_type_check(); var ChecksumStream_1 = require_ChecksumStream(); var createChecksumStream_browser_1 = require_createChecksumStream_browser(); function createChecksumStream(init) { if (typeof ReadableStream === "function" && (0, stream_type_check_1.isReadableStream)(init.source)) { return (0, createChecksumStream_browser_1.createChecksumStream)(init); } return new ChecksumStream_1.ChecksumStream(init); } } }); // node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js var require_ByteArrayCollector = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ByteArrayCollector = void 0; var ByteArrayCollector = class { allocByteArray; byteLength = 0; byteArrays = []; constructor(allocByteArray) { this.allocByteArray = allocByteArray; } push(byteArray) { this.byteArrays.push(byteArray); this.byteLength += byteArray.byteLength; } flush() { if (this.byteArrays.length === 1) { const bytes = this.byteArrays[0]; this.reset(); return bytes; } const aggregation = this.allocByteArray(this.byteLength); let cursor2 = 0; for (let i5 = 0; i5 < this.byteArrays.length; ++i5) { const bytes = this.byteArrays[i5]; aggregation.set(bytes, cursor2); cursor2 += bytes.byteLength; } this.reset(); return aggregation; } reset() { this.byteArrays = []; this.byteLength = 0; } }; exports2.ByteArrayCollector = ByteArrayCollector; } }); // node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js var require_createBufferedReadableStream = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createBufferedReadable = void 0; exports2.createBufferedReadableStream = createBufferedReadableStream; exports2.merge = merge; exports2.flush = flush; exports2.sizeOf = sizeOf; exports2.modeOf = modeOf; var ByteArrayCollector_1 = require_ByteArrayCollector(); function createBufferedReadableStream(upstream, size, logger2) { const reader = upstream.getReader(); let streamBufferingLoggedWarning = false; let bytesSeen = 0; const buffers = ["", new ByteArrayCollector_1.ByteArrayCollector((size2) => new Uint8Array(size2))]; let mode = -1; const pull = async (controller) => { const { value, done } = await reader.read(); const chunk = value; if (done) { if (mode !== -1) { const remainder = flush(buffers, mode); if (sizeOf(remainder) > 0) { controller.enqueue(remainder); } } controller.close(); } else { const chunkMode = modeOf(chunk, false); if (mode !== chunkMode) { if (mode >= 0) { controller.enqueue(flush(buffers, mode)); } mode = chunkMode; } if (mode === -1) { controller.enqueue(chunk); return; } const chunkSize = sizeOf(chunk); bytesSeen += chunkSize; const bufferSize = sizeOf(buffers[mode]); if (chunkSize >= size && bufferSize === 0) { controller.enqueue(chunk); } else { const newSize = merge(buffers, mode, chunk); if (!streamBufferingLoggedWarning && bytesSeen > size * 2) { streamBufferingLoggedWarning = true; logger2?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`); } if (newSize >= size) { controller.enqueue(flush(buffers, mode)); } else { await pull(controller); } } } }; return new ReadableStream({ pull }); } exports2.createBufferedReadable = createBufferedReadableStream; function merge(buffers, mode, chunk) { switch (mode) { case 0: buffers[0] += chunk; return sizeOf(buffers[0]); case 1: case 2: buffers[mode].push(chunk); return sizeOf(buffers[mode]); } } function flush(buffers, mode) { switch (mode) { case 0: const s = buffers[0]; buffers[0] = ""; return s; case 1: case 2: return buffers[mode].flush(); } throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`); } function sizeOf(chunk) { return chunk?.byteLength ?? chunk?.length ?? 0; } function modeOf(chunk, allowBuffer = true) { if (allowBuffer && typeof Buffer !== "undefined" && chunk instanceof Buffer) { return 2; } if (chunk instanceof Uint8Array) { return 1; } if (typeof chunk === "string") { return 0; } return -1; } } }); // node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js var require_createBufferedReadable = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createBufferedReadable = createBufferedReadable; var node_stream_1 = require("node:stream"); var ByteArrayCollector_1 = require_ByteArrayCollector(); var createBufferedReadableStream_1 = require_createBufferedReadableStream(); var stream_type_check_1 = require_stream_type_check(); function createBufferedReadable(upstream, size, logger2) { if ((0, stream_type_check_1.isReadableStream)(upstream)) { return (0, createBufferedReadableStream_1.createBufferedReadableStream)(upstream, size, logger2); } const downstream = new node_stream_1.Readable({ read() { } }); let streamBufferingLoggedWarning = false; let bytesSeen = 0; const buffers = [ "", new ByteArrayCollector_1.ByteArrayCollector((size2) => new Uint8Array(size2)), new ByteArrayCollector_1.ByteArrayCollector((size2) => Buffer.from(new Uint8Array(size2))) ]; let mode = -1; upstream.on("data", (chunk) => { const chunkMode = (0, createBufferedReadableStream_1.modeOf)(chunk, true); if (mode !== chunkMode) { if (mode >= 0) { downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode)); } mode = chunkMode; } if (mode === -1) { downstream.push(chunk); return; } const chunkSize = (0, createBufferedReadableStream_1.sizeOf)(chunk); bytesSeen += chunkSize; const bufferSize = (0, createBufferedReadableStream_1.sizeOf)(buffers[mode]); if (chunkSize >= size && bufferSize === 0) { downstream.push(chunk); } else { const newSize = (0, createBufferedReadableStream_1.merge)(buffers, mode, chunk); if (!streamBufferingLoggedWarning && bytesSeen > size * 2) { streamBufferingLoggedWarning = true; logger2?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`); } if (newSize >= size) { downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode)); } } }); upstream.on("end", () => { if (mode !== -1) { const remainder = (0, createBufferedReadableStream_1.flush)(buffers, mode); if ((0, createBufferedReadableStream_1.sizeOf)(remainder) > 0) { downstream.push(remainder); } } downstream.push(null); }); return downstream; } } }); // node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.browser.js var require_getAwsChunkedEncodingStream_browser = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.browser.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getAwsChunkedEncodingStream = void 0; var getAwsChunkedEncodingStream = (readableStream, options) => { const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; const checksumRequired = base64Encoder !== void 0 && bodyLengthChecker !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0; const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : void 0; const reader = readableStream.getReader(); return new ReadableStream({ async pull(controller) { const { value, done } = await reader.read(); if (done) { controller.enqueue(`0\r `); if (checksumRequired) { const checksum = base64Encoder(await digest); controller.enqueue(`${checksumLocationName}:${checksum}\r `); controller.enqueue(`\r `); } controller.close(); } else { controller.enqueue(`${(bodyLengthChecker(value) || 0).toString(16)}\r ${value}\r `); } } }); }; exports2.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; } }); // node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js var require_getAwsChunkedEncodingStream = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream; var node_stream_1 = require("node:stream"); var getAwsChunkedEncodingStream_browser_1 = require_getAwsChunkedEncodingStream_browser(); var stream_type_check_1 = require_stream_type_check(); function getAwsChunkedEncodingStream(stream, options) { const readable = stream; const readableStream = stream; if ((0, stream_type_check_1.isReadableStream)(readableStream)) { return (0, getAwsChunkedEncodingStream_browser_1.getAwsChunkedEncodingStream)(readableStream, options); } const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options; const checksumRequired = base64Encoder !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0; const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readable) : void 0; const awsChunkedEncodingStream = new node_stream_1.Readable({ read: () => { } }); readable.on("data", (data3) => { const length = bodyLengthChecker(data3) || 0; if (length === 0) { return; } awsChunkedEncodingStream.push(`${length.toString(16)}\r `); awsChunkedEncodingStream.push(data3); awsChunkedEncodingStream.push("\r\n"); }); readable.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; } } }); // node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js var require_headStream_browser = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.headStream = headStream; async function headStream(stream, bytes) { let byteLengthCounter = 0; const chunks = []; const reader = stream.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; } } }); // node_modules/@smithy/util-stream/dist-cjs/headStream.js var require_headStream = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/headStream.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.headStream = void 0; var stream_1 = require("stream"); var headStream_browser_1 = require_headStream_browser(); var stream_type_check_1 = require_stream_type_check(); var headStream = (stream, bytes) => { if ((0, stream_type_check_1.isReadableStream)(stream)) { return (0, headStream_browser_1.headStream)(stream, bytes); } return new Promise((resolve, reject) => { const collector = new Collector(); collector.limit = bytes; stream.pipe(collector); stream.on("error", (err) => { collector.end(); reject(err); }); collector.on("error", reject); collector.on("finish", function() { const bytes2 = new Uint8Array(Buffer.concat(this.buffers)); resolve(bytes2); }); }); }; exports2.headStream = headStream; var Collector = class extends stream_1.Writable { buffers = []; limit = Infinity; 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(); } }; } }); // node_modules/@smithy/util-uri-escape/dist-cjs/index.js var require_dist_cjs11 = __commonJS({ "node_modules/@smithy/util-uri-escape/dist-cjs/index.js"(exports2) { "use strict"; var escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode); var hexEncode = (c5) => `%${c5.charCodeAt(0).toString(16).toUpperCase()}`; var escapeUriPath = (uri) => uri.split("/").map(escapeUri).join("/"); exports2.escapeUri = escapeUri; exports2.escapeUriPath = escapeUriPath; } }); // node_modules/@smithy/querystring-builder/dist-cjs/index.js var require_dist_cjs12 = __commonJS({ "node_modules/@smithy/querystring-builder/dist-cjs/index.js"(exports2) { "use strict"; var utilUriEscape = require_dist_cjs11(); function buildQueryString(query) { const parts = []; for (let key of Object.keys(query).sort()) { const value = query[key]; key = utilUriEscape.escapeUri(key); if (Array.isArray(value)) { for (let i5 = 0, iLen = value.length; i5 < iLen; i5++) { parts.push(`${key}=${utilUriEscape.escapeUri(value[i5])}`); } } else { let qsEntry = key; if (value || typeof value === "string") { qsEntry += `=${utilUriEscape.escapeUri(value)}`; } parts.push(qsEntry); } } return parts.join("&"); } exports2.buildQueryString = buildQueryString; } }); // node_modules/@smithy/node-http-handler/dist-cjs/index.js var require_dist_cjs13 = __commonJS({ "node_modules/@smithy/node-http-handler/dist-cjs/index.js"(exports2) { "use strict"; var protocolHttp = require_dist_cjs2(); var querystringBuilder = require_dist_cjs12(); var node_https = require("node:https"); var node_stream = require("node:stream"); var http22 = require("node:http2"); function buildAbortError(abortSignal) { const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal ? abortSignal.reason : void 0; if (reason) { if (reason instanceof Error) { const abortError3 = new Error("Request aborted"); abortError3.name = "AbortError"; abortError3.cause = reason; return abortError3; } const abortError2 = new Error(String(reason)); abortError2.name = "AbortError"; return abortError2; } const abortError = new Error("Request aborted"); abortError.name = "AbortError"; return abortError; } var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "EPIPE", "ETIMEDOUT"]; var getTransformedHeaders = (headers) => { const transformedHeaders = {}; for (const name of Object.keys(headers)) { const headerValues = headers[name]; transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues; } return transformedHeaders; }; var timing = { setTimeout: (cb, ms) => setTimeout(cb, ms), clearTimeout: (timeoutId) => clearTimeout(timeoutId) }; var DEFER_EVENT_LISTENER_TIME$2 = 1e3; var setConnectionTimeout = (request, reject, timeoutInMs = 0) => { if (!timeoutInMs) { return -1; } const registerTimeout = (offset) => { const timeoutId = timing.setTimeout(() => { request.destroy(); reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`), { name: "TimeoutError" })); }, timeoutInMs - offset); const doWithSocket = (socket) => { if (socket?.connecting) { socket.on("connect", () => { timing.clearTimeout(timeoutId); }); } else { timing.clearTimeout(timeoutId); } }; if (request.socket) { doWithSocket(request.socket); } else { request.on("socket", doWithSocket); } }; if (timeoutInMs < 2e3) { registerTimeout(0); return 0; } return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME$2), DEFER_EVENT_LISTENER_TIME$2); }; var setRequestTimeout = (req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger2) => { if (timeoutInMs) { return timing.setTimeout(() => { let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`; if (throwOnRequestTimeout) { const error3 = Object.assign(new Error(msg), { name: "TimeoutError", code: "ETIMEDOUT" }); req.destroy(error3); reject(error3); } else { msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`; logger2?.warn?.(msg); } }, timeoutInMs); } return -1; }; var DEFER_EVENT_LISTENER_TIME$1 = 3e3; var setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME$1) => { if (keepAlive !== true) { return -1; } const registerListener = () => { if (request.socket) { request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); } else { request.on("socket", (socket) => { socket.setKeepAlive(keepAlive, keepAliveMsecs || 0); }); } }; if (deferTimeMs === 0) { registerListener(); return 0; } return timing.setTimeout(registerListener, deferTimeMs); }; var DEFER_EVENT_LISTENER_TIME = 3e3; var setSocketTimeout = (request, reject, timeoutInMs = 0) => { const registerTimeout = (offset) => { const timeout = timeoutInMs - offset; const onTimeout = () => { request.destroy(); reject(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" })); }; if (request.socket) { request.socket.setTimeout(timeout, onTimeout); request.on("close", () => request.socket?.removeListener("timeout", onTimeout)); } else { request.setTimeout(timeout, onTimeout); } }; if (0 < timeoutInMs && timeoutInMs < 6e3) { registerTimeout(0); return 0; } return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME); }; var MIN_WAIT_TIME = 6e3; async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) { const headers = request.headers ?? {}; const expect = headers.Expect || headers.expect; let timeoutId = -1; let sendBody = true; if (!externalAgent && expect === "100-continue") { sendBody = await Promise.race([ new Promise((resolve) => { timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs))); }), new Promise((resolve) => { httpRequest.on("continue", () => { timing.clearTimeout(timeoutId); resolve(true); }); httpRequest.on("response", () => { timing.clearTimeout(timeoutId); resolve(false); }); httpRequest.on("error", () => { timing.clearTimeout(timeoutId); resolve(false); }); }) ]); } if (sendBody) { writeBody(httpRequest, request.body); } } function writeBody(httpRequest, body) { if (body instanceof node_stream.Readable) { body.pipe(httpRequest); return; } if (body) { const isBuffer = Buffer.isBuffer(body); const isString = typeof body === "string"; if (isBuffer || isString) { if (isBuffer && body.byteLength === 0) { httpRequest.end(); } else { httpRequest.end(body); } return; } const uint8 = body; if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") { httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength)); return; } httpRequest.end(Buffer.from(body)); return; } httpRequest.end(); } var DEFAULT_REQUEST_TIMEOUT = 0; var hAgent = void 0; var hRequest = void 0; var NodeHttpHandler2 = class _NodeHttpHandler { config; configProvider; socketWarningTimestamp = 0; externalAgent = false; metadata = { handlerProtocol: "http/1.1" }; static create(instanceOrOptions) { if (typeof instanceOrOptions?.handle === "function") { return instanceOrOptions; } return new _NodeHttpHandler(instanceOrOptions); } static checkSocketUsage(agent, socketWarningTimestamp, logger2 = 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) { logger2?.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(options) { this.configProvider = new Promise((resolve, reject) => { if (typeof options === "function") { options().then((_options) => { resolve(this.resolveDefaultConfig(_options)); }).catch(reject); } else { resolve(this.resolveDefaultConfig(options)); } }); } destroy() { this.config?.httpAgent?.destroy(); this.config?.httpsAgent?.destroy(); } async handle(request, { abortSignal, requestTimeout } = {}) { if (!this.config) { this.config = await this.configProvider; } const config = this.config; const isSSL = request.protocol === "https:"; if (!isSSL && !this.config.httpAgent) { this.config.httpAgent = await this.config.httpAgentProvider(); } return new Promise((_resolve, _reject) => { let writeRequestBodyPromise = void 0; const timeouts = []; const resolve = async (arg) => { await writeRequestBodyPromise; timeouts.forEach(timing.clearTimeout); _resolve(arg); }; const reject = async (arg) => { await writeRequestBodyPromise; timeouts.forEach(timing.clearTimeout); _reject(arg); }; if (abortSignal?.aborted) { const abortError = buildAbortError(abortSignal); reject(abortError); return; } const headers = request.headers ?? {}; const expectContinue = (headers.Expect ?? headers.expect) === "100-continue"; let agent = isSSL ? config.httpsAgent : config.httpAgent; if (expectContinue && !this.externalAgent) { agent = new (isSSL ? node_https.Agent : hAgent)({ keepAlive: false, maxSockets: Infinity }); } timeouts.push(timing.setTimeout(() => { this.socketWarningTimestamp = _NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, config.logger); }, config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2e3) + (config.connectionTimeout ?? 1e3))); const queryString = querystringBuilder.buildQueryString(request.query || {}); let auth = void 0; if (request.username != null || request.password != null) { const username = request.username ?? ""; const password = request.password ?? ""; auth = `${username}:${password}`; } let path3 = request.path; if (queryString) { path3 += `?${queryString}`; } if (request.fragment) { path3 += `#${request.fragment}`; } let hostname = request.hostname ?? ""; if (hostname[0] === "[" && hostname.endsWith("]")) { hostname = request.hostname.slice(1, -1); } else { hostname = request.hostname; } const nodeHttpsOptions = { headers: request.headers, host: hostname, method: request.method, path: path3, port: request.port, agent, auth }; const requestFunc = isSSL ? node_https.request : hRequest; const req = requestFunc(nodeHttpsOptions, (res) => { const httpResponse = new protocolHttp.HttpResponse({ statusCode: res.statusCode || -1, reason: res.statusMessage, headers: getTransformedHeaders(res.headers), body: res }); resolve({ 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 = () => { req.destroy(); const abortError = buildAbortError(abortSignal); reject(abortError); }; 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; } } const effectiveRequestTimeout = requestTimeout ?? config.requestTimeout; timeouts.push(setConnectionTimeout(req, reject, config.connectionTimeout)); timeouts.push(setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, config.logger ?? console)); timeouts.push(setSocketTimeout(req, reject, config.socketTimeout)); const httpAgent = nodeHttpsOptions.agent; if (typeof httpAgent === "object" && "keepAlive" in httpAgent) { timeouts.push(setSocketKeepAlive(req, { keepAlive: httpAgent.keepAlive, keepAliveMsecs: httpAgent.keepAliveMsecs })); } writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout, this.externalAgent).catch((e5) => { timeouts.forEach(timing.clearTimeout); return _reject(e5); }); }); } updateHttpClientConfig(key, value) { this.config = void 0; this.configProvider = this.configProvider.then((config) => { return { ...config, [key]: value }; }); } httpHandlerConfigs() { return this.config ?? {}; } resolveDefaultConfig(options) { const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger: logger2 } = options || {}; const keepAlive = true; const maxSockets = 50; return { connectionTimeout, requestTimeout, socketTimeout, socketAcquisitionWarningTimeout, throwOnRequestTimeout, httpAgentProvider: async () => { const { Agent: Agent9, request } = await import("node:http"); hRequest = request; hAgent = Agent9; if (httpAgent instanceof hAgent || typeof httpAgent?.destroy === "function") { this.externalAgent = true; return httpAgent; } return new hAgent({ keepAlive, maxSockets, ...httpAgent }); }, httpsAgent: (() => { if (httpsAgent instanceof node_https.Agent || typeof httpsAgent?.destroy === "function") { this.externalAgent = true; return httpsAgent; } return new node_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); })(), logger: logger2 }; } }; var ids = new Uint16Array(1); var ClientHttp2SessionRef = class { id = ids[0]++; total = 0; max = 0; session; refs = 0; constructor(session) { session.unref(); this.session = session; } retain() { if (this.session.destroyed) { throw new Error("@smithy/node-http-handler - cannot acquire reference to destroyed session."); } this.refs += 1; this.total += 1; this.max = Math.max(this.refs, this.max); this.session.ref(); } free() { if (this.session.destroyed) { return; } this.refs -= 1; if (this.refs === 0) { this.session.unref(); } if (this.refs < 0) { throw new Error("@smithy/node-http-handler - ClientHttp2Session refcount at zero, cannot decrement."); } } deref() { return this.session; } close() { if (!this.session.closed) { this.session.close(); } } destroy() { this.refs = 0; if (!this.session.destroyed) { this.session.destroy(); } } useCount() { return this.refs; } }; var NodeHttp2ConnectionPool = class { sessions = []; maxConcurrency = 0; constructor(sessions) { this.sessions = (sessions ?? []).map((session) => new ClientHttp2SessionRef(session)); } poll() { let cleanup = false; for (const session of this.sessions) { if (session.deref().destroyed) { cleanup = true; continue; } if (!this.maxConcurrency || session.useCount() < this.maxConcurrency) { return session; } } if (cleanup) { for (const session of this.sessions) { if (session.deref().destroyed) { this.remove(session); } } } } offerLast(ref) { this.sessions.push(ref); } remove(ref) { const ix = this.sessions.indexOf(ref); if (ix > -1) { this.sessions.splice(ix, 1); } } [Symbol.iterator]() { return this.sessions[Symbol.iterator](); } setMaxConcurrency(maxConcurrency) { this.maxConcurrency = maxConcurrency; } destroy(ref) { this.remove(ref); ref.destroy(); } }; var NodeHttp2ConnectionManager = class { config; connectionPools = /* @__PURE__ */ new Map(); constructor(config) { this.config = config; if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) { throw new RangeError("maxConcurrency must be greater than zero."); } } lease(requestContext, connectionConfiguration) { const url = this.getUrlString(requestContext); const pool = this.getPool(url); if (!this.config.disableConcurrency && !connectionConfiguration.isEventStream) { const available = pool.poll(); if (available) { available.retain(); return available; } } const ref = new ClientHttp2SessionRef(http22.connect(url)); const session = ref.deref(); if (this.config.maxConcurrency) { session.settings({ maxConcurrentStreams: this.config.maxConcurrency }, (err) => { if (err) { throw new Error("Fail to set maxConcurrentStreams to " + this.config.maxConcurrency + "when creating new session for " + requestContext.destination.toString()); } }); } const graceful = () => { this.removeFromPoolAndClose(url, ref); }; const ensureDestroyed = () => { this.removeFromPoolAndCheckedDestroy(url, ref); }; session.on("goaway", graceful); session.on("error", ensureDestroyed); session.on("frameError", ensureDestroyed); session.on("close", ensureDestroyed); if (connectionConfiguration.requestTimeout) { session.setTimeout(connectionConfiguration.requestTimeout, ensureDestroyed); } pool.offerLast(ref); ref.retain(); return ref; } release(_requestContext, ref) { ref.free(); } createIsolatedSession(requestContext, connectionConfiguration) { const url = this.getUrlString(requestContext); const ref = new ClientHttp2SessionRef(http22.connect(url)); const session = ref.deref(); session.settings({ maxConcurrentStreams: 1 }); const ensureDestroyed = () => { ref.destroy(); }; session.on("error", ensureDestroyed); session.on("frameError", ensureDestroyed); session.on("close", ensureDestroyed); if (connectionConfiguration.requestTimeout) { session.setTimeout(connectionConfiguration.requestTimeout, ensureDestroyed); } ref.retain(); return ref; } destroy() { for (const [url, connectionPool] of this.connectionPools) { for (const session of [...connectionPool]) { session.destroy(); } this.connectionPools.delete(url); } } setMaxConcurrentStreams(maxConcurrentStreams) { if (maxConcurrentStreams && maxConcurrentStreams <= 0) { throw new RangeError("maxConcurrentStreams must be greater than zero."); } this.config.maxConcurrency = maxConcurrentStreams; for (const pool of this.connectionPools.values()) { pool.setMaxConcurrency(maxConcurrentStreams); } } setDisableConcurrentStreams(disableConcurrentStreams) { this.config.disableConcurrency = disableConcurrentStreams; } debug() { const pools = {}; for (const [url, pool] of this.connectionPools) { const sessions = []; for (const ref of pool) { sessions.push({ id: ref.id, active: ref.useCount(), maxConcurrent: ref.max, totalRequests: ref.total }); } pools[url] = { sessions }; } return pools; } removeFromPoolAndClose(authority, ref) { this.connectionPools.get(authority)?.remove(ref); ref.close(); } removeFromPoolAndCheckedDestroy(authority, ref) { this.connectionPools.get(authority)?.remove(ref); ref.destroy(); } getPool(url) { if (!this.connectionPools.has(url)) { const pool = new NodeHttp2ConnectionPool(); if (this.config.maxConcurrency) { pool.setMaxConcurrency(this.config.maxConcurrency); } this.connectionPools.set(url, pool); } return this.connectionPools.get(url); } getUrlString(request) { return request.destination.toString(); } }; var NodeHttp2Handler = class _NodeHttp2Handler { config; configProvider; metadata = { handlerProtocol: "h2" }; connectionManager = new NodeHttp2ConnectionManager({}); static create(instanceOrOptions) { if (typeof instanceOrOptions?.handle === "function") { return instanceOrOptions; } return new _NodeHttp2Handler(instanceOrOptions); } constructor(options) { this.configProvider = new Promise((resolve, reject) => { if (typeof options === "function") { options().then((opts) => { resolve(opts || {}); }).catch(reject); } else { resolve(options || {}); } }); } destroy() { this.connectionManager.destroy(); } async handle(request, { abortSignal, requestTimeout, isEventStream } = {}) { if (!this.config) { this.config = await this.configProvider; const { disableConcurrentStreams: disableConcurrentStreams2, maxConcurrentStreams } = this.config; this.connectionManager.setDisableConcurrentStreams(disableConcurrentStreams2 ?? false); if (maxConcurrentStreams) { this.connectionManager.setMaxConcurrentStreams(maxConcurrentStreams); } } const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config; const useIsolatedSession = disableConcurrentStreams || isEventStream; const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout; return new Promise((_resolve, _reject) => { let fulfilled = false; let writeRequestBodyPromise = void 0; const resolve = async (arg) => { await writeRequestBodyPromise; _resolve(arg); }; const reject = async (arg) => { await writeRequestBodyPromise; _reject(arg); }; if (abortSignal?.aborted) { fulfilled = true; const abortError = buildAbortError(abortSignal); reject(abortError); return; } const { hostname, method, port, protocol, query } = request; let auth = ""; if (request.username != null || request.password != null) { const username = request.username ?? ""; const password = request.password ?? ""; auth = `${username}:${password}@`; } const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`; const requestContext = { destination: new URL(authority) }; const connectConfig = { requestTimeout: this.config?.sessionTimeout, isEventStream }; const ref = useIsolatedSession ? this.connectionManager.createIsolatedSession(requestContext, connectConfig) : this.connectionManager.lease(requestContext, connectConfig); const session = ref.deref(); const rejectWithDestroy = (err) => { if (useIsolatedSession) { ref.destroy(); } fulfilled = true; reject(err); }; const queryString = querystringBuilder.buildQueryString(query ?? {}); let path3 = request.path; if (queryString) { path3 += `?${queryString}`; } if (request.fragment) { path3 += `#${request.fragment}`; } const clientHttp2Stream = session.request({ ...request.headers, [http22.constants.HTTP2_HEADER_PATH]: path3, [http22.constants.HTTP2_HEADER_METHOD]: method }); if (effectiveRequestTimeout) { clientHttp2Stream.setTimeout(effectiveRequestTimeout, () => { clientHttp2Stream.close(); const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`); timeoutError.name = "TimeoutError"; rejectWithDestroy(timeoutError); }); } if (abortSignal) { const onAbort = () => { clientHttp2Stream.close(); const abortError = buildAbortError(abortSignal); rejectWithDestroy(abortError); }; if (typeof abortSignal.addEventListener === "function") { const signal = abortSignal; signal.addEventListener("abort", onAbort, { once: true }); clientHttp2Stream.once("close", () => signal.removeEventListener("abort", onAbort)); } else { abortSignal.onabort = onAbort; } } clientHttp2Stream.on("frameError", (type, code, id) => { rejectWithDestroy(new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`)); }); clientHttp2Stream.on("error", rejectWithDestroy); clientHttp2Stream.on("aborted", () => { rejectWithDestroy(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${clientHttp2Stream.rstCode}.`)); }); clientHttp2Stream.on("response", (headers) => { const httpResponse = new protocolHttp.HttpResponse({ statusCode: headers[":status"] ?? -1, headers: getTransformedHeaders(headers), body: clientHttp2Stream }); fulfilled = true; resolve({ response: httpResponse }); if (useIsolatedSession) { session.close(); } }); clientHttp2Stream.on("close", () => { if (useIsolatedSession) { ref.destroy(); } else { this.connectionManager.release(requestContext, ref); } if (!fulfilled) { rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response")); } }); writeRequestBodyPromise = writeRequestBody(clientHttp2Stream, request, effectiveRequestTimeout); }); } updateHttpClientConfig(key, value) { this.config = void 0; this.configProvider = this.configProvider.then((config) => { return { ...config, [key]: value }; }); } httpHandlerConfigs() { return this.config ?? {}; } }; var Collector = class extends node_stream.Writable { bufferedBytes = []; _write(chunk, encoding, callback) { this.bufferedBytes.push(chunk); callback(); } }; var streamCollector5 = (stream) => { if (isReadableStreamInstance(stream)) { return collectReadableStream(stream); } return new Promise((resolve, reject) => { const collector = new Collector(); stream.pipe(collector); stream.on("error", (err) => { collector.end(); reject(err); }); collector.on("error", reject); collector.on("finish", function() { const bytes = new Uint8Array(Buffer.concat(this.bufferedBytes)); resolve(bytes); }); }); }; var isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream; async function collectReadableStream(stream) { const chunks = []; const reader = stream.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; } exports2.DEFAULT_REQUEST_TIMEOUT = DEFAULT_REQUEST_TIMEOUT; exports2.NodeHttp2Handler = NodeHttp2Handler; exports2.NodeHttpHandler = NodeHttpHandler2; exports2.streamCollector = streamCollector5; } }); // node_modules/@smithy/fetch-http-handler/dist-cjs/index.js var require_dist_cjs14 = __commonJS({ "node_modules/@smithy/fetch-http-handler/dist-cjs/index.js"(exports2) { "use strict"; var protocolHttp = require_dist_cjs2(); var querystringBuilder = require_dist_cjs12(); var utilBase64 = require_dist_cjs10(); function createRequest(url, requestOptions) { return new Request(url, requestOptions); } function requestTimeout(timeoutInMs = 0) { return new Promise((resolve, reject) => { if (timeoutInMs) { setTimeout(() => { const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`); timeoutError.name = "TimeoutError"; reject(timeoutError); }, timeoutInMs); } }); } var keepAliveSupport = { supported: void 0 }; var FetchHttpHandler = class _FetchHttpHandler { config; configProvider; static create(instanceOrOptions) { if (typeof instanceOrOptions?.handle === "function") { return instanceOrOptions; } return new _FetchHttpHandler(instanceOrOptions); } constructor(options) { if (typeof options === "function") { this.configProvider = options().then((opts) => opts || {}); } else { this.config = options ?? {}; this.configProvider = Promise.resolve(this.config); } if (keepAliveSupport.supported === void 0) { keepAliveSupport.supported = Boolean(typeof Request !== "undefined" && "keepalive" in createRequest("https://[::1]")); } } destroy() { } async handle(request, { abortSignal, requestTimeout: requestTimeout$1 } = {}) { if (!this.config) { this.config = await this.configProvider; } const requestTimeoutInMs = requestTimeout$1 ?? this.config.requestTimeout; const keepAlive = this.config.keepAlive === true; const credentials = this.config.credentials; if (abortSignal?.aborted) { const abortError = buildAbortError(abortSignal); return Promise.reject(abortError); } let path3 = request.path; const queryString = querystringBuilder.buildQueryString(request.query || {}); if (queryString) { path3 += `?${queryString}`; } if (request.fragment) { path3 += `#${request.fragment}`; } let auth = ""; if (request.username != null || request.password != null) { const username = request.username ?? ""; const password = request.password ?? ""; auth = `${username}:${password}@`; } const { port, method } = request; const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path3}`; const body = method === "GET" || method === "HEAD" ? void 0 : request.body; const requestOptions = { body, headers: new Headers(request.headers), method, credentials }; if (this.config?.cache) { requestOptions.cache = this.config.cache; } if (body) { requestOptions.duplex = "half"; } if (typeof AbortController !== "undefined") { requestOptions.signal = abortSignal; } if (keepAliveSupport.supported) { requestOptions.keepalive = keepAlive; } if (typeof this.config.requestInit === "function") { Object.assign(requestOptions, this.config.requestInit(request)); } let removeSignalEventListener = () => { }; const fetchRequest = createRequest(url, requestOptions); const raceOfPromises = [ fetch(fetchRequest).then((response) => { const fetchHeaders = response.headers; const transformedHeaders = {}; for (const pair of fetchHeaders.entries()) { transformedHeaders[pair[0]] = pair[1]; } const hasReadableStream = response.body != void 0; if (!hasReadableStream) { return response.blob().then((body2) => ({ response: new protocolHttp.HttpResponse({ headers: transformedHeaders, reason: response.statusText, statusCode: response.status, body: body2 }) })); } return { response: new protocolHttp.HttpResponse({ headers: transformedHeaders, reason: response.statusText, statusCode: response.status, body: response.body }) }; }), requestTimeout(requestTimeoutInMs) ]; if (abortSignal) { raceOfPromises.push(new Promise((resolve, reject) => { const onAbort = () => { const abortError = buildAbortError(abortSignal); reject(abortError); }; if (typeof abortSignal.addEventListener === "function") { const signal = abortSignal; signal.addEventListener("abort", onAbort, { once: true }); removeSignalEventListener = () => signal.removeEventListener("abort", onAbort); } else { abortSignal.onabort = onAbort; } })); } return Promise.race(raceOfPromises).finally(removeSignalEventListener); } updateHttpClientConfig(key, value) { this.config = void 0; this.configProvider = this.configProvider.then((config) => { config[key] = value; return config; }); } httpHandlerConfigs() { return this.config ?? {}; } }; function buildAbortError(abortSignal) { const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal ? abortSignal.reason : void 0; if (reason) { if (reason instanceof Error) { const abortError3 = new Error("Request aborted"); abortError3.name = "AbortError"; abortError3.cause = reason; return abortError3; } const abortError2 = new Error(String(reason)); abortError2.name = "AbortError"; return abortError2; } const abortError = new Error("Request aborted"); abortError.name = "AbortError"; return abortError; } var streamCollector5 = async (stream) => { if (typeof Blob === "function" && stream instanceof Blob || stream.constructor?.name === "Blob") { if (Blob.prototype.arrayBuffer !== void 0) { return new Uint8Array(await stream.arrayBuffer()); } return collectBlob(stream); } return collectStream(stream); }; async function collectBlob(blob) { const base64 = await readToBase64(blob); const arrayBuffer = utilBase64.fromBase64(base64); return new Uint8Array(arrayBuffer); } async function collectStream(stream) { const chunks = []; const reader = stream.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((resolve, 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; resolve(result.substring(dataOffset)); }; reader.onabort = () => reject(new Error("Read aborted")); reader.onerror = () => reject(reader.error); reader.readAsDataURL(blob); }); } exports2.FetchHttpHandler = FetchHttpHandler; exports2.keepAliveSupport = keepAliveSupport; exports2.streamCollector = streamCollector5; } }); // node_modules/@smithy/util-hex-encoding/dist-cjs/index.js var require_dist_cjs15 = __commonJS({ "node_modules/@smithy/util-hex-encoding/dist-cjs/index.js"(exports2) { "use strict"; var SHORT_TO_HEX = {}; var 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; } 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; } exports2.fromHex = fromHex; exports2.toHex = toHex; } }); // node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js var require_sdk_stream_mixin_browser = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.sdkStreamMixin = void 0; var fetch_http_handler_1 = require_dist_cjs14(); var util_base64_1 = require_dist_cjs10(); var util_hex_encoding_1 = require_dist_cjs15(); var util_utf8_1 = require_dist_cjs9(); var stream_type_check_1 = require_stream_type_check(); var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; var sdkStreamMixin2 = (stream) => { if (!isBlobInstance(stream) && !(0, stream_type_check_1.isReadableStream)(stream)) { const name = stream?.__proto__?.constructor?.name || stream; throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`); } let transformed = false; const transformToByteArray = async () => { if (transformed) { throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); } transformed = true; return await (0, fetch_http_handler_1.streamCollector)(stream); }; const blobToWebStream = (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(); }; return Object.assign(stream, { transformToByteArray, transformToString: async (encoding) => { const buf = await transformToByteArray(); if (encoding === "base64") { return (0, util_base64_1.toBase64)(buf); } else if (encoding === "hex") { return (0, util_hex_encoding_1.toHex)(buf); } else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") { return (0, util_utf8_1.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(stream)) { return blobToWebStream(stream); } else if ((0, stream_type_check_1.isReadableStream)(stream)) { return stream; } else { throw new Error(`Cannot transform payload to web stream, got ${stream}`); } } }); }; exports2.sdkStreamMixin = sdkStreamMixin2; var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob; } }); // node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js var require_sdk_stream_mixin = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.sdkStreamMixin = void 0; var node_http_handler_1 = require_dist_cjs13(); var util_buffer_from_1 = require_dist_cjs8(); var stream_1 = require("stream"); var sdk_stream_mixin_browser_1 = require_sdk_stream_mixin_browser(); var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed."; var sdkStreamMixin2 = (stream) => { if (!(stream instanceof stream_1.Readable)) { try { return (0, sdk_stream_mixin_browser_1.sdkStreamMixin)(stream); } catch (e5) { const name = stream?.__proto__?.constructor?.name || stream; throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`); } } let transformed = false; const transformToByteArray = async () => { if (transformed) { throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); } transformed = true; return await (0, node_http_handler_1.streamCollector)(stream); }; return Object.assign(stream, { transformToByteArray, transformToString: async (encoding) => { const buf = await transformToByteArray(); if (encoding === void 0 || Buffer.isEncoding(encoding)) { return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding); } else { const decoder2 = new TextDecoder(encoding); return decoder2.decode(buf); } }, transformToWebStream: () => { if (transformed) { throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED); } if (stream.readableFlowing !== null) { throw new Error("The stream has been consumed by other callbacks."); } if (typeof stream_1.Readable.toWeb !== "function") { throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available."); } transformed = true; return stream_1.Readable.toWeb(stream); } }); }; exports2.sdkStreamMixin = sdkStreamMixin2; } }); // node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js var require_splitStream_browser = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.splitStream = splitStream; async function splitStream(stream) { if (typeof stream.stream === "function") { stream = stream.stream(); } const readableStream = stream; return readableStream.tee(); } } }); // node_modules/@smithy/util-stream/dist-cjs/splitStream.js var require_splitStream = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/splitStream.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.splitStream = splitStream; var stream_1 = require("stream"); var splitStream_browser_1 = require_splitStream_browser(); var stream_type_check_1 = require_stream_type_check(); async function splitStream(stream) { if ((0, stream_type_check_1.isReadableStream)(stream) || (0, stream_type_check_1.isBlob)(stream)) { return (0, splitStream_browser_1.splitStream)(stream); } const stream1 = new stream_1.PassThrough(); const stream2 = new stream_1.PassThrough(); stream.pipe(stream1); stream.pipe(stream2); return [stream1, stream2]; } } }); // node_modules/@smithy/util-stream/dist-cjs/index.js var require_dist_cjs16 = __commonJS({ "node_modules/@smithy/util-stream/dist-cjs/index.js"(exports2) { "use strict"; var utilBase64 = require_dist_cjs10(); var utilUtf8 = require_dist_cjs9(); var ChecksumStream = require_ChecksumStream(); var createChecksumStream = require_createChecksumStream(); var createBufferedReadable = require_createBufferedReadable(); var getAwsChunkedEncodingStream = require_getAwsChunkedEncodingStream(); var headStream = require_headStream(); var sdkStreamMixin2 = require_sdk_stream_mixin(); var splitStream = require_splitStream(); var streamTypeCheck = require_stream_type_check(); var Uint8ArrayBlobAdapter2 = class _Uint8ArrayBlobAdapter extends Uint8Array { static fromString(source, encoding = "utf-8") { if (typeof source === "string") { if (encoding === "base64") { return _Uint8ArrayBlobAdapter.mutate(utilBase64.fromBase64(source)); } return _Uint8ArrayBlobAdapter.mutate(utilUtf8.fromUtf8(source)); } throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`); } static mutate(source) { Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter.prototype); return source; } transformToString(encoding = "utf-8") { if (encoding === "base64") { return utilBase64.toBase64(this); } return utilUtf8.toUtf8(this); } }; exports2.isBlob = streamTypeCheck.isBlob; exports2.isReadableStream = streamTypeCheck.isReadableStream; exports2.Uint8ArrayBlobAdapter = Uint8ArrayBlobAdapter2; Object.prototype.hasOwnProperty.call(ChecksumStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: ChecksumStream["__proto__"] }); Object.keys(ChecksumStream).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = ChecksumStream[k5]; }); Object.prototype.hasOwnProperty.call(createChecksumStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: createChecksumStream["__proto__"] }); Object.keys(createChecksumStream).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = createChecksumStream[k5]; }); Object.prototype.hasOwnProperty.call(createBufferedReadable, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: createBufferedReadable["__proto__"] }); Object.keys(createBufferedReadable).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = createBufferedReadable[k5]; }); Object.prototype.hasOwnProperty.call(getAwsChunkedEncodingStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: getAwsChunkedEncodingStream["__proto__"] }); Object.keys(getAwsChunkedEncodingStream).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = getAwsChunkedEncodingStream[k5]; }); Object.prototype.hasOwnProperty.call(headStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: headStream["__proto__"] }); Object.keys(headStream).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = headStream[k5]; }); Object.prototype.hasOwnProperty.call(sdkStreamMixin2, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: sdkStreamMixin2["__proto__"] }); Object.keys(sdkStreamMixin2).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = sdkStreamMixin2[k5]; }); Object.prototype.hasOwnProperty.call(splitStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: splitStream["__proto__"] }); Object.keys(splitStream).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = splitStream[k5]; }); } }); // node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js var import_util_stream, collectBody; var init_collect_stream_body = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js"() { import_util_stream = __toESM(require_dist_cjs16()); collectBody = async (streamBody = new Uint8Array(), context) => { if (streamBody instanceof Uint8Array) { return import_util_stream.Uint8ArrayBlobAdapter.mutate(streamBody); } if (!streamBody) { return import_util_stream.Uint8ArrayBlobAdapter.mutate(new Uint8Array()); } const fromContext = context.streamCollector(streamBody); return import_util_stream.Uint8ArrayBlobAdapter.mutate(await fromContext); }; } }); // node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js function extendedEncodeURIComponent(str) { return encodeURIComponent(str).replace(/[!'()*]/g, function(c5) { return "%" + c5.charCodeAt(0).toString(16).toUpperCase(); }); } var init_extended_encode_uri_component = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js"() { } }); // node_modules/@smithy/core/dist-es/submodules/schema/deref.js var deref; var init_deref = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/deref.js"() { deref = (schemaRef) => { if (typeof schemaRef === "function") { return schemaRef(); } return schemaRef; }; } }); // node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js var operation; var init_operation = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js"() { operation = (namespace, name, traits, input, output) => ({ name, namespace, traits, input, output }); } }); // node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js var import_protocol_http2, import_util_middleware3, schemaDeserializationMiddleware, findHeader; var init_schemaDeserializationMiddleware = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js"() { import_protocol_http2 = __toESM(require_dist_cjs2()); import_util_middleware3 = __toESM(require_dist_cjs6()); init_operation(); schemaDeserializationMiddleware = (config) => (next, context) => async (args) => { const { response } = await next(args); const { operationSchema } = (0, import_util_middleware3.getSmithyContext)(context); const [, ns, n3, t, i5, o2] = operationSchema ?? []; try { const parsed = await config.protocol.deserializeResponse(operation(ns, n3, t, i5, o2), { ...config, ...context }, response); return { response, output: parsed }; } catch (error3) { Object.defineProperty(error3, "$response", { value: response, enumerable: false, writable: false, configurable: false }); if (!("$metadata" in error3)) { const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; try { error3.message += "\n " + hint; } catch (e5) { if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") { console.warn(hint); } else { context.logger?.warn?.(hint); } } if (typeof error3.$responseBodyText !== "undefined") { if (error3.$response) { error3.$response.body = error3.$responseBodyText; } } try { if (import_protocol_http2.HttpResponse.isInstance(response)) { const { headers = {} } = response; const headerEntries = Object.entries(headers); error3.$metadata = { httpStatusCode: response.statusCode, requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries), extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries), cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries) }; } } catch (e5) { } } throw error3; } }; findHeader = (pattern, headers) => { return (headers.find(([k5]) => { return k5.match(pattern); }) || [void 0, void 0])[1]; }; } }); // node_modules/@smithy/querystring-parser/dist-cjs/index.js var require_dist_cjs17 = __commonJS({ "node_modules/@smithy/querystring-parser/dist-cjs/index.js"(exports2) { "use strict"; 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; } exports2.parseQueryString = parseQueryString; } }); // node_modules/@smithy/url-parser/dist-cjs/index.js var require_dist_cjs18 = __commonJS({ "node_modules/@smithy/url-parser/dist-cjs/index.js"(exports2) { "use strict"; var querystringParser = require_dist_cjs17(); var parseUrl7 = (url) => { if (typeof url === "string") { return parseUrl7(new URL(url)); } const { hostname, pathname, port, protocol, search } = url; let query; if (search) { query = querystringParser.parseQueryString(search); } return { hostname, port: port ? parseInt(port) : void 0, protocol, path: pathname, query }; }; exports2.parseUrl = parseUrl7; } }); // node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js var import_url_parser, toEndpointV1; var init_toEndpointV1 = __esm({ "node_modules/@smithy/core/dist-es/submodules/endpoints/toEndpointV1.js"() { import_url_parser = __toESM(require_dist_cjs18()); toEndpointV1 = (endpoint) => { if (typeof endpoint === "object") { if ("url" in endpoint) { const v1Endpoint = (0, import_url_parser.parseUrl)(endpoint.url); if (endpoint.headers) { v1Endpoint.headers = {}; for (const name in endpoint.headers) { v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", "); } } return v1Endpoint; } return endpoint; } return (0, import_url_parser.parseUrl)(endpoint); }; } }); // node_modules/@smithy/core/dist-es/submodules/endpoints/index.js var endpoints_exports = {}; __export(endpoints_exports, { toEndpointV1: () => toEndpointV1 }); var init_endpoints = __esm({ "node_modules/@smithy/core/dist-es/submodules/endpoints/index.js"() { init_toEndpointV1(); } }); // node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js var import_util_middleware4, schemaSerializationMiddleware; var init_schemaSerializationMiddleware = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js"() { init_endpoints(); import_util_middleware4 = __toESM(require_dist_cjs6()); init_operation(); schemaSerializationMiddleware = (config) => (next, context) => async (args) => { const { operationSchema } = (0, import_util_middleware4.getSmithyContext)(context); const [, ns, n3, t, i5, o2] = operationSchema ?? []; const endpoint = context.endpointV2 ? async () => toEndpointV1(context.endpointV2) : config.endpoint; const request = await config.protocol.serializeRequest(operation(ns, n3, t, i5, o2), args.input, { ...config, ...context, endpoint }); return next({ ...args, request }); }; } }); // node_modules/@smithy/core/dist-es/submodules/schema/middleware/getSchemaSerdePlugin.js function getSchemaSerdePlugin(config) { return { applyToStack: (commandStack) => { commandStack.add(schemaSerializationMiddleware(config), serializerMiddlewareOption); commandStack.add(schemaDeserializationMiddleware(config), deserializerMiddlewareOption); config.protocol.setSerdeContext(config); } }; } var deserializerMiddlewareOption, serializerMiddlewareOption; var init_getSchemaSerdePlugin = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/middleware/getSchemaSerdePlugin.js"() { init_schemaDeserializationMiddleware(); init_schemaSerializationMiddleware(); deserializerMiddlewareOption = { name: "deserializerMiddleware", step: "deserialize", tags: ["DESERIALIZER"], override: true }; serializerMiddlewareOption = { name: "serializerMiddleware", step: "serialize", tags: ["SERIALIZER"], override: true }; } }); // node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js var Schema; var init_Schema = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js"() { Schema = class { name; namespace; traits; static assign(instance, values) { const schema = Object.assign(instance, values); return schema; } static [Symbol.hasInstance](lhs) { const isPrototype = this.prototype.isPrototypeOf(lhs); if (!isPrototype && typeof lhs === "object" && lhs !== null) { const list2 = lhs; return list2.symbol === this.symbol; } return isPrototype; } getName() { return this.namespace + "#" + this.name; } }; } }); // node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js var ListSchema, list; var init_ListSchema = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js"() { init_Schema(); ListSchema = class _ListSchema extends Schema { static symbol = /* @__PURE__ */ Symbol.for("@smithy/lis"); name; traits; valueSchema; symbol = _ListSchema.symbol; }; list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSchema(), { name, namespace, traits, valueSchema }); } }); // node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js var MapSchema, map; var init_MapSchema = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js"() { init_Schema(); MapSchema = class _MapSchema extends Schema { static symbol = /* @__PURE__ */ Symbol.for("@smithy/map"); name; traits; keySchema; valueSchema; symbol = _MapSchema.symbol; }; map = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(new MapSchema(), { name, namespace, traits, keySchema, valueSchema }); } }); // node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js var OperationSchema, op; var init_OperationSchema = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js"() { init_Schema(); OperationSchema = class _OperationSchema extends Schema { static symbol = /* @__PURE__ */ Symbol.for("@smithy/ope"); name; traits; input; output; symbol = _OperationSchema.symbol; }; op = (namespace, name, traits, input, output) => Schema.assign(new OperationSchema(), { name, namespace, traits, input, output }); } }); // node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js var StructureSchema, struct; var init_StructureSchema = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js"() { init_Schema(); StructureSchema = class _StructureSchema extends Schema { static symbol = /* @__PURE__ */ Symbol.for("@smithy/str"); name; traits; memberNames; memberList; symbol = _StructureSchema.symbol; }; struct = (namespace, name, traits, memberNames, memberList) => Schema.assign(new StructureSchema(), { name, namespace, traits, memberNames, memberList }); } }); // node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js var ErrorSchema, error2; var init_ErrorSchema = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js"() { init_Schema(); init_StructureSchema(); ErrorSchema = class _ErrorSchema extends StructureSchema { static symbol = /* @__PURE__ */ Symbol.for("@smithy/err"); ctor; symbol = _ErrorSchema.symbol; }; error2 = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema(), { name, namespace, traits, memberNames, memberList, ctor: null }); } }); // node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js function translateTraits(indicator) { if (typeof indicator === "object") { return indicator; } indicator = indicator | 0; if (traitsCache[indicator]) { return traitsCache[indicator]; } const traits = {}; let i5 = 0; for (const trait of [ "httpLabel", "idempotent", "idempotencyToken", "sensitive", "httpPayload", "httpResponseCode", "httpQueryParams" ]) { if ((indicator >> i5++ & 1) === 1) { traits[trait] = 1; } } return traitsCache[indicator] = traits; } var traitsCache; var init_translateTraits = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js"() { traitsCache = []; } }); // node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js function member(memberSchema, memberName) { if (memberSchema instanceof NormalizedSchema) { return Object.assign(memberSchema, { memberName, _isMemberSchema: true }); } const internalCtorAccess = NormalizedSchema; return new internalCtorAccess(memberSchema, memberName); } var anno, simpleSchemaCacheN, simpleSchemaCacheS, NormalizedSchema, isMemberSchema, isStaticSchema; var init_NormalizedSchema = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js"() { init_deref(); init_translateTraits(); anno = { it: /* @__PURE__ */ Symbol.for("@smithy/nor-struct-it"), ns: /* @__PURE__ */ Symbol.for("@smithy/ns") }; simpleSchemaCacheN = []; simpleSchemaCacheS = {}; NormalizedSchema = class _NormalizedSchema { ref; memberName; static symbol = /* @__PURE__ */ Symbol.for("@smithy/nor"); symbol = _NormalizedSchema.symbol; name; schema; _isMemberSchema; traits; memberTraits; normalizedTraits; constructor(ref, memberName) { this.ref = ref; this.memberName = memberName; const traitStack = []; let _ref = ref; let schema = ref; this._isMemberSchema = false; while (isMemberSchema(_ref)) { traitStack.push(_ref[1]); _ref = _ref[0]; schema = deref(_ref); this._isMemberSchema = true; } if (traitStack.length > 0) { this.memberTraits = {}; for (let i5 = traitStack.length - 1; i5 >= 0; --i5) { const traitSet = traitStack[i5]; Object.assign(this.memberTraits, translateTraits(traitSet)); } } else { this.memberTraits = 0; } if (schema instanceof _NormalizedSchema) { const computedMemberTraits = this.memberTraits; Object.assign(this, schema); this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits()); this.normalizedTraits = void 0; this.memberName = memberName ?? schema.memberName; return; } this.schema = deref(schema); if (isStaticSchema(this.schema)) { this.name = `${this.schema[1]}#${this.schema[2]}`; this.traits = this.schema[3]; } else { this.name = this.memberName ?? String(schema); this.traits = 0; } if (this._isMemberSchema && !memberName) { throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`); } } static [Symbol.hasInstance](lhs) { const isPrototype = this.prototype.isPrototypeOf(lhs); if (!isPrototype && typeof lhs === "object" && lhs !== null) { const ns = lhs; return ns.symbol === this.symbol; } return isPrototype; } static of(ref) { const keyAble = typeof ref === "function" || typeof ref === "object" && ref !== null; if (typeof ref === "number") { if (simpleSchemaCacheN[ref]) { return simpleSchemaCacheN[ref]; } } else if (typeof ref === "string") { if (simpleSchemaCacheS[ref]) { return simpleSchemaCacheS[ref]; } } else if (keyAble) { if (ref[anno.ns]) { return ref[anno.ns]; } } const sc = deref(ref); if (sc instanceof _NormalizedSchema) { return sc; } if (isMemberSchema(sc)) { const [ns2, traits] = sc; if (ns2 instanceof _NormalizedSchema) { Object.assign(ns2.getMergedTraits(), translateTraits(traits)); return ns2; } throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`); } const ns = new _NormalizedSchema(sc); if (keyAble) { return ref[anno.ns] = ns; } if (typeof sc === "string") { return simpleSchemaCacheS[sc] = ns; } if (typeof sc === "number") { return simpleSchemaCacheN[sc] = ns; } return ns; } getSchema() { const sc = this.schema; if (Array.isArray(sc) && sc[0] === 0) { return sc[4]; } return sc; } getName(withNamespace = false) { const { name } = this; const short = !withNamespace && name && name.includes("#"); return short ? name.split("#")[1] : name || void 0; } getMemberName() { return this.memberName; } isMemberSchema() { return this._isMemberSchema; } isListSchema() { const sc = this.getSchema(); return typeof sc === "number" ? sc >= 64 && sc < 128 : sc[0] === 1; } isMapSchema() { const sc = this.getSchema(); return typeof sc === "number" ? sc >= 128 && sc <= 255 : sc[0] === 2; } isStructSchema() { const sc = this.getSchema(); if (typeof sc !== "object") { return false; } const id = sc[0]; return id === 3 || id === -3 || id === 4; } isUnionSchema() { const sc = this.getSchema(); if (typeof sc !== "object") { return false; } return sc[0] === 4; } isBlobSchema() { const sc = this.getSchema(); return sc === 21 || sc === 42; } isTimestampSchema() { const sc = this.getSchema(); return typeof sc === "number" && sc >= 4 && sc <= 7; } isUnitSchema() { return this.getSchema() === "unit"; } isDocumentSchema() { return this.getSchema() === 15; } isStringSchema() { return this.getSchema() === 0; } isBooleanSchema() { return this.getSchema() === 2; } isNumericSchema() { return this.getSchema() === 1; } isBigIntegerSchema() { return this.getSchema() === 17; } isBigDecimalSchema() { return this.getSchema() === 19; } isStreaming() { const { streaming } = this.getMergedTraits(); return !!streaming || this.getSchema() === 42; } isIdempotencyToken() { return !!this.getMergedTraits().idempotencyToken; } getMergedTraits() { return this.normalizedTraits ?? (this.normalizedTraits = { ...this.getOwnTraits(), ...this.getMemberTraits() }); } getMemberTraits() { return translateTraits(this.memberTraits); } getOwnTraits() { return translateTraits(this.traits); } getKeySchema() { const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()]; if (!isDoc && !isMap) { throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`); } const schema = this.getSchema(); const memberSchema = isDoc ? 15 : schema[4] ?? 0; return member([memberSchema, 0], "key"); } getValueSchema() { const sc = this.getSchema(); const [isDoc, isMap, isList] = [this.isDocumentSchema(), this.isMapSchema(), this.isListSchema()]; const memberSchema = typeof sc === "number" ? 63 & sc : sc && typeof sc === "object" && (isMap || isList) ? sc[3 + sc[0]] : isDoc ? 15 : void 0; if (memberSchema != null) { return member([memberSchema, 0], isMap ? "value" : "member"); } throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`); } getMemberSchema(memberName) { const struct2 = this.getSchema(); if (this.isStructSchema() && struct2[4].includes(memberName)) { const i5 = struct2[4].indexOf(memberName); const memberSchema = struct2[5][i5]; return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName); } if (this.isDocumentSchema()) { return member([15, 0], memberName); } throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${memberName}.`); } getMemberSchemas() { const buffer = {}; try { for (const [k5, v] of this.structIterator()) { buffer[k5] = v; } } catch (ignored) { } return buffer; } getEventStreamMember() { if (this.isStructSchema()) { for (const [memberName, memberSchema] of this.structIterator()) { if (memberSchema.isStreaming() && memberSchema.isStructSchema()) { return memberName; } } } return ""; } *structIterator() { if (this.isUnitSchema()) { return; } if (!this.isStructSchema()) { throw new Error("@smithy/core/schema - cannot iterate non-struct schema."); } const struct2 = this.getSchema(); const z = struct2[4].length; let it = struct2[anno.it]; if (it && z === it.length) { yield* it; return; } it = Array(z); for (let i5 = 0; i5 < z; ++i5) { const k5 = struct2[4][i5]; const v = member([struct2[5][i5], 0], k5); yield it[i5] = [k5, v]; } struct2[anno.it] = it; } }; isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2; isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5; } }); // node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js var SimpleSchema, sim, simAdapter; var init_SimpleSchema = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js"() { init_Schema(); SimpleSchema = class _SimpleSchema extends Schema { static symbol = /* @__PURE__ */ Symbol.for("@smithy/sim"); name; schemaRef; traits; symbol = _SimpleSchema.symbol; }; sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema(), { name, namespace, traits, schemaRef }); simAdapter = (namespace, name, traits, schemaRef) => Schema.assign(new SimpleSchema(), { name, namespace, traits, schemaRef }); } }); // node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js var SCHEMA; var init_sentinels = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js"() { SCHEMA = { BLOB: 21, STREAMING_BLOB: 42, BOOLEAN: 2, STRING: 0, NUMERIC: 1, BIG_INTEGER: 17, BIG_DECIMAL: 19, DOCUMENT: 15, TIMESTAMP_DEFAULT: 4, TIMESTAMP_DATE_TIME: 5, TIMESTAMP_HTTP_DATE: 6, TIMESTAMP_EPOCH_SECONDS: 7, LIST_MODIFIER: 64, MAP_MODIFIER: 128 }; } }); // node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js var TypeRegistry; var init_TypeRegistry = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js"() { TypeRegistry = class _TypeRegistry { namespace; schemas; exceptions; static registries = /* @__PURE__ */ new Map(); constructor(namespace, schemas = /* @__PURE__ */ new Map(), exceptions = /* @__PURE__ */ new Map()) { this.namespace = namespace; this.schemas = schemas; this.exceptions = exceptions; } static for(namespace) { if (!_TypeRegistry.registries.has(namespace)) { _TypeRegistry.registries.set(namespace, new _TypeRegistry(namespace)); } return _TypeRegistry.registries.get(namespace); } copyFrom(other) { const { schemas, exceptions } = this; for (const [k5, v] of other.schemas) { if (!schemas.has(k5)) { schemas.set(k5, v); } } for (const [k5, v] of other.exceptions) { if (!exceptions.has(k5)) { exceptions.set(k5, v); } } } register(shapeId, schema) { const qualifiedName = this.normalizeShapeId(shapeId); for (const r5 of [this, _TypeRegistry.for(qualifiedName.split("#")[0])]) { r5.schemas.set(qualifiedName, schema); } } getSchema(shapeId) { const id = this.normalizeShapeId(shapeId); if (!this.schemas.has(id)) { throw new Error(`@smithy/core/schema - schema not found for ${id}`); } return this.schemas.get(id); } registerError(es, ctor) { const $error = es; const ns = $error[1]; for (const r5 of [this, _TypeRegistry.for(ns)]) { r5.schemas.set(ns + "#" + $error[2], $error); r5.exceptions.set($error, ctor); } } getErrorCtor(es) { const $error = es; if (this.exceptions.has($error)) { return this.exceptions.get($error); } const registry = _TypeRegistry.for($error[1]); return registry.exceptions.get($error); } getBaseException() { for (const exceptionKey of this.exceptions.keys()) { if (Array.isArray(exceptionKey)) { const [, ns, name] = exceptionKey; const id = ns + "#" + name; if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) { return exceptionKey; } } } return void 0; } find(predicate) { for (const schema of this.schemas.values()) { if (predicate(schema)) { return schema; } } return void 0; } clear() { this.schemas.clear(); this.exceptions.clear(); } normalizeShapeId(shapeId) { if (shapeId.includes("#")) { return shapeId; } return this.namespace + "#" + shapeId; } }; } }); // node_modules/@smithy/core/dist-es/submodules/schema/index.js var schema_exports = {}; __export(schema_exports, { ErrorSchema: () => ErrorSchema, ListSchema: () => ListSchema, MapSchema: () => MapSchema, NormalizedSchema: () => NormalizedSchema, OperationSchema: () => OperationSchema, SCHEMA: () => SCHEMA, Schema: () => Schema, SimpleSchema: () => SimpleSchema, StructureSchema: () => StructureSchema, TypeRegistry: () => TypeRegistry, deref: () => deref, deserializerMiddlewareOption: () => deserializerMiddlewareOption, error: () => error2, getSchemaSerdePlugin: () => getSchemaSerdePlugin, isStaticSchema: () => isStaticSchema, list: () => list, map: () => map, op: () => op, operation: () => operation, serializerMiddlewareOption: () => serializerMiddlewareOption, sim: () => sim, simAdapter: () => simAdapter, simpleSchemaCacheN: () => simpleSchemaCacheN, simpleSchemaCacheS: () => simpleSchemaCacheS, struct: () => struct, traitsCache: () => traitsCache, translateTraits: () => translateTraits }); var init_schema = __esm({ "node_modules/@smithy/core/dist-es/submodules/schema/index.js"() { init_deref(); init_getSchemaSerdePlugin(); init_ListSchema(); init_MapSchema(); init_OperationSchema(); init_operation(); init_ErrorSchema(); init_NormalizedSchema(); init_Schema(); init_SimpleSchema(); init_StructureSchema(); init_sentinels(); init_translateTraits(); init_TypeRegistry(); } }); // node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js var copyDocumentWithTransform; var init_copyDocumentWithTransform = __esm({ "node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js"() { copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => source; } }); // node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js var parseBoolean, expectBoolean, expectNumber, MAX_FLOAT, expectFloat32, expectLong, expectInt, expectInt32, expectShort, expectByte, expectSizedInt, castInt, expectNonNull, expectObject, expectString, expectUnion, strictParseDouble, strictParseFloat, strictParseFloat32, NUMBER_REGEX, parseNumber, limitedParseDouble, handleFloat, limitedParseFloat, limitedParseFloat32, parseFloatString, strictParseLong, strictParseInt, strictParseInt32, strictParseShort, strictParseByte, stackTraceWarning, logger; var init_parse_utils = __esm({ "node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js"() { parseBoolean = (value) => { switch (value) { case "true": return true; case "false": return false; default: throw new Error(`Unable to parse boolean value "${value}"`); } }; expectBoolean = (value) => { if (value === null || value === void 0) { return void 0; } if (typeof value === "number") { if (value === 0 || value === 1) { logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); } if (value === 0) { return false; } if (value === 1) { return true; } } if (typeof value === "string") { const lower = value.toLowerCase(); if (lower === "false" || lower === "true") { logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`)); } if (lower === "false") { return false; } if (lower === "true") { return true; } } if (typeof value === "boolean") { return value; } throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`); }; expectNumber = (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)) { logger.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}`); }; MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23)); expectFloat32 = (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; }; expectLong = (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}`); }; expectInt = expectLong; expectInt32 = (value) => expectSizedInt(value, 32); expectShort = (value) => expectSizedInt(value, 16); expectByte = (value) => expectSizedInt(value, 8); expectSizedInt = (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; }; castInt = (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]; } }; expectNonNull = (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; }; expectObject = (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}`); }; expectString = (value) => { if (value === null || value === void 0) { return void 0; } if (typeof value === "string") { return value; } if (["boolean", "number", "bigint"].includes(typeof value)) { logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`)); return String(value); } throw new TypeError(`Expected string, got ${typeof value}: ${value}`); }; expectUnion = (value) => { if (value === null || value === void 0) { return void 0; } const asObject = expectObject(value); const setKeys = []; for (const k5 in asObject) { if (asObject[k5] != null) { setKeys.push(k5); } } if (setKeys.length === 0) { throw new TypeError(`Unions must have exactly one non-null member. None were found.`); } if (setKeys.length > 1) { throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`); } return asObject; }; strictParseDouble = (value) => { if (typeof value == "string") { return expectNumber(parseNumber(value)); } return expectNumber(value); }; strictParseFloat = strictParseDouble; strictParseFloat32 = (value) => { if (typeof value == "string") { return expectFloat32(parseNumber(value)); } return expectFloat32(value); }; NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g; parseNumber = (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); }; limitedParseDouble = (value) => { if (typeof value == "string") { return parseFloatString(value); } return expectNumber(value); }; handleFloat = limitedParseDouble; limitedParseFloat = limitedParseDouble; limitedParseFloat32 = (value) => { if (typeof value == "string") { return parseFloatString(value); } return expectFloat32(value); }; parseFloatString = (value) => { switch (value) { case "NaN": return NaN; case "Infinity": return Infinity; case "-Infinity": return -Infinity; default: throw new Error(`Unable to parse float value: ${value}`); } }; strictParseLong = (value) => { if (typeof value === "string") { return expectLong(parseNumber(value)); } return expectLong(value); }; strictParseInt = strictParseLong; strictParseInt32 = (value) => { if (typeof value === "string") { return expectInt32(parseNumber(value)); } return expectInt32(value); }; strictParseShort = (value) => { if (typeof value === "string") { return expectShort(parseNumber(value)); } return expectShort(value); }; strictParseByte = (value) => { if (typeof value === "string") { return expectByte(parseNumber(value)); } return expectByte(value); }; stackTraceWarning = (message) => { return String(new TypeError(message).stack || message).split("\n").slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join("\n"); }; logger = { warn: console.warn }; } }); // node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js function dateToUtcString(date2) { const year2 = date2.getUTCFullYear(); const month = date2.getUTCMonth(); const dayOfWeek = date2.getUTCDay(); const dayOfMonthInt = date2.getUTCDate(); const hoursInt = date2.getUTCHours(); const minutesInt = date2.getUTCMinutes(); const secondsInt = date2.getUTCSeconds(); const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`; const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`; const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`; const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`; return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year2} ${hoursString}:${minutesString}:${secondsString} GMT`; } var DAYS, MONTHS, RFC3339, parseRfc3339DateTime, RFC3339_WITH_OFFSET, parseRfc3339DateTimeWithOffset, IMF_FIXDATE, RFC_850_DATE, ASC_TIME, parseRfc7231DateTime, parseEpochTimestamp, buildDate, parseTwoDigitYear, FIFTY_YEARS_IN_MILLIS, adjustRfc850Year, parseMonthByShortName, DAYS_IN_MONTH, validateDayOfMonth, isLeapYear, parseDateValue, parseMilliseconds, parseOffsetToMilliseconds, stripLeadingZeroes; var init_date_utils = __esm({ "node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js"() { init_parse_utils(); DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; 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 = (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 match = RFC3339.exec(value); if (!match) { throw new TypeError("Invalid RFC-3339 date-time value"); } const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match; const year2 = strictParseShort(stripLeadingZeroes(yearStr)); const month = parseDateValue(monthStr, "month", 1, 12); const day = parseDateValue(dayStr, "day", 1, 31); return buildDate(year2, month, day, { hours, minutes, seconds, fractionalMilliseconds }); }; 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 = (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 match = RFC3339_WITH_OFFSET.exec(value); if (!match) { throw new TypeError("Invalid RFC-3339 date-time value"); } const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match; const year2 = strictParseShort(stripLeadingZeroes(yearStr)); const month = parseDateValue(monthStr, "month", 1, 12); const day = parseDateValue(dayStr, "day", 1, 31); const date2 = buildDate(year2, month, day, { hours, minutes, seconds, fractionalMilliseconds }); if (offsetStr.toUpperCase() != "Z") { date2.setTime(date2.getTime() - parseOffsetToMilliseconds(offsetStr)); } return date2; }; 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})$/); parseRfc7231DateTime = (value) => { if (value === null || value === void 0) { return void 0; } if (typeof value !== "string") { throw new TypeError("RFC-7231 date-times must be expressed as strings"); } let match = IMF_FIXDATE.exec(value); if (match) { const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); } match = RFC_850_DATE.exec(value); if (match) { const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match; return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds })); } match = ASC_TIME.exec(value); if (match) { const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match; return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds }); } throw new TypeError("Invalid RFC-7231 date-time value"); }; parseEpochTimestamp = (value) => { if (value === null || value === void 0) { return void 0; } let valueAsDouble; if (typeof value === "number") { valueAsDouble = value; } else if (typeof value === "string") { valueAsDouble = strictParseDouble(value); } else if (typeof value === "object" && value.tag === 1) { valueAsDouble = value.value; } else { throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation"); } if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) { throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics"); } return new Date(Math.round(valueAsDouble * 1e3)); }; buildDate = (year2, month, day, time2) => { const adjustedMonth = month - 1; validateDayOfMonth(year2, adjustedMonth, day); return new Date(Date.UTC(year2, adjustedMonth, day, parseDateValue(time2.hours, "hour", 0, 23), parseDateValue(time2.minutes, "minute", 0, 59), parseDateValue(time2.seconds, "seconds", 0, 60), parseMilliseconds(time2.fractionalMilliseconds))); }; parseTwoDigitYear = (value) => { const thisYear = (/* @__PURE__ */ new Date()).getUTCFullYear(); const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value)); if (valueInThisCentury < thisYear) { return valueInThisCentury + 100; } return valueInThisCentury; }; FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3; adjustRfc850Year = (input) => { if (input.getTime() - (/* @__PURE__ */ new Date()).getTime() > FIFTY_YEARS_IN_MILLIS) { return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds())); } return input; }; parseMonthByShortName = (value) => { const monthIdx = MONTHS.indexOf(value); if (monthIdx < 0) { throw new TypeError(`Invalid month: ${value}`); } return monthIdx + 1; }; DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; validateDayOfMonth = (year2, month, day) => { let maxDays = DAYS_IN_MONTH[month]; if (month === 1 && isLeapYear(year2)) { maxDays = 29; } if (day > maxDays) { throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year2}: ${day}`); } }; isLeapYear = (year2) => { return year2 % 4 === 0 && (year2 % 100 !== 0 || year2 % 400 === 0); }; parseDateValue = (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; }; parseMilliseconds = (value) => { if (value === null || value === void 0) { return 0; } return strictParseFloat32("0." + value) * 1e3; }; parseOffsetToMilliseconds = (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 hour = Number(value.substring(1, 3)); const minute = Number(value.substring(4, 6)); return direction * (hour * 60 + minute) * 60 * 1e3; }; stripLeadingZeroes = (value) => { let idx = 0; while (idx < value.length - 1 && value.charAt(idx) === "0") { idx++; } if (idx === 0) { return value; } return value.slice(idx); }; } }); // node_modules/tslib/tslib.es6.mjs var tslib_es6_exports = {}; __export(tslib_es6_exports, { __addDisposableResource: () => __addDisposableResource, __assign: () => __assign, __asyncDelegator: () => __asyncDelegator, __asyncGenerator: () => __asyncGenerator, __asyncValues: () => __asyncValues, __await: () => __await, __awaiter: () => __awaiter6, __classPrivateFieldGet: () => __classPrivateFieldGet, __classPrivateFieldIn: () => __classPrivateFieldIn, __classPrivateFieldSet: () => __classPrivateFieldSet, __createBinding: () => __createBinding, __decorate: () => __decorate, __disposeResources: () => __disposeResources, __esDecorate: () => __esDecorate, __exportStar: () => __exportStar, __extends: () => __extends, __generator: () => __generator, __importDefault: () => __importDefault, __importStar: () => __importStar, __makeTemplateObject: () => __makeTemplateObject, __metadata: () => __metadata, __param: () => __param, __propKey: () => __propKey, __read: () => __read, __rest: () => __rest, __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension, __runInitializers: () => __runInitializers, __setFunctionName: () => __setFunctionName, __spread: () => __spread, __spreadArray: () => __spreadArray, __spreadArrays: () => __spreadArrays, __values: () => __values, default: () => tslib_es6_default }); function __extends(d5, b6) { if (typeof b6 !== "function" && b6 !== null) throw new TypeError("Class extends value " + String(b6) + " is not a constructor or null"); extendStatics(d5, b6); function __() { this.constructor = d5; } d5.prototype = b6 === null ? Object.create(b6) : (__.prototype = b6.prototype, new __()); } function __rest(s, e5) { var t = {}; for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e5.indexOf(p2) < 0) t[p2] = s[p2]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i5 = 0, p2 = Object.getOwnPropertySymbols(s); i5 < p2.length; i5++) { if (e5.indexOf(p2[i5]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i5])) t[p2[i5]] = s[p2[i5]]; } return t; } function __decorate(decorators, target, key, desc) { var c5 = arguments.length, r5 = c5 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d5; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r5 = Reflect.decorate(decorators, target, key, desc); else for (var i5 = decorators.length - 1; i5 >= 0; i5--) if (d5 = decorators[i5]) r5 = (c5 < 3 ? d5(r5) : c5 > 3 ? d5(target, key, r5) : d5(target, key)) || r5; return c5 > 3 && r5 && Object.defineProperty(target, key, r5), r5; } function __param(paramIndex, decorator) { return function(target, key) { decorator(target, key, paramIndex); }; } function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { function accept(f5) { if (f5 !== void 0 && typeof f5 !== "function") throw new TypeError("Function expected"); return f5; } var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i5 = decorators.length - 1; i5 >= 0; i5--) { var context = {}; for (var p2 in contextIn) context[p2] = p2 === "access" ? {} : contextIn[p2]; for (var p2 in contextIn.access) context.access[p2] = contextIn.access[p2]; context.addInitializer = function(f5) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f5 || null)); }; var result = (0, decorators[i5])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); if (_ = accept(result.get)) descriptor.get = _; if (_ = accept(result.set)) descriptor.set = _; if (_ = accept(result.init)) initializers.unshift(_); } else if (_ = accept(result)) { if (kind === "field") initializers.unshift(_); else descriptor[key] = _; } } if (target) Object.defineProperty(target, contextIn.name, descriptor); done = true; } function __runInitializers(thisArg, initializers, value) { var useValue = arguments.length > 2; for (var i5 = 0; i5 < initializers.length; i5++) { value = useValue ? initializers[i5].call(thisArg, value) : initializers[i5].call(thisArg); } return useValue ? value : void 0; } function __propKey(x) { return typeof x === "symbol" ? x : "".concat(x); } function __setFunctionName(f5, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f5, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter6(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); }); } return new (P || (P = Promise))(function(resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e5) { reject(e5); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e5) { reject(e5); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f5, y, t, g5 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); return g5.next = verb(0), g5["throw"] = verb(1), g5["return"] = verb(2), typeof Symbol === "function" && (g5[Symbol.iterator] = function() { return this; }), g5; function verb(n3) { return function(v) { return step([n3, v]); }; } function step(op2) { if (f5) throw new TypeError("Generator is already executing."); while (g5 && (g5 = 0, op2[0] && (_ = 0)), _) try { if (f5 = 1, y && (t = op2[0] & 2 ? y["return"] : op2[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op2[1])).done) return t; if (y = 0, t) op2 = [op2[0] & 2, t.value]; switch (op2[0]) { case 0: case 1: t = op2; break; case 4: _.label++; return { value: op2[1], done: false }; case 5: _.label++; y = op2[1]; op2 = [0]; continue; case 7: op2 = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op2[0] === 6 || op2[0] === 2)) { _ = 0; continue; } if (op2[0] === 3 && (!t || op2[1] > t[0] && op2[1] < t[3])) { _.label = op2[1]; break; } if (op2[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op2; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op2); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op2 = body.call(thisArg, _); } catch (e5) { op2 = [6, e5]; y = 0; } finally { f5 = t = 0; } if (op2[0] & 5) throw op2[1]; return { value: op2[0] ? op2[1] : void 0, done: true }; } } function __exportStar(m3, o2) { for (var p2 in m3) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(o2, p2)) __createBinding(o2, m3, p2); } function __values(o2) { var s = typeof Symbol === "function" && Symbol.iterator, m3 = s && o2[s], i5 = 0; if (m3) return m3.call(o2); if (o2 && typeof o2.length === "number") return { next: function() { if (o2 && i5 >= o2.length) o2 = void 0; return { value: o2 && o2[i5++], done: !o2 }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o2, n3) { var m3 = typeof Symbol === "function" && o2[Symbol.iterator]; if (!m3) return o2; var i5 = m3.call(o2), r5, ar = [], e5; try { while ((n3 === void 0 || n3-- > 0) && !(r5 = i5.next()).done) ar.push(r5.value); } catch (error3) { e5 = { error: error3 }; } finally { try { if (r5 && !r5.done && (m3 = i5["return"])) m3.call(i5); } finally { if (e5) throw e5.error; } } return ar; } function __spread() { for (var ar = [], i5 = 0; i5 < arguments.length; i5++) ar = ar.concat(__read(arguments[i5])); return ar; } function __spreadArrays() { for (var s = 0, i5 = 0, il = arguments.length; i5 < il; i5++) s += arguments[i5].length; for (var r5 = Array(s), k5 = 0, i5 = 0; i5 < il; i5++) for (var a5 = arguments[i5], j5 = 0, jl = a5.length; j5 < jl; j5++, k5++) r5[k5] = a5[j5]; return r5; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i5 = 0, l3 = from.length, ar; i5 < l3; i5++) { if (ar || !(i5 in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i5); ar[i5] = from[i5]; } } return to.concat(ar || Array.prototype.slice.call(from)); } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g5 = generator.apply(thisArg, _arguments || []), i5, q2 = []; return i5 = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i5[Symbol.asyncIterator] = function() { return this; }, i5; function awaitReturn(f5) { return function(v) { return Promise.resolve(v).then(f5, reject); }; } function verb(n3, f5) { if (g5[n3]) { i5[n3] = function(v) { return new Promise(function(a5, b6) { q2.push([n3, v, a5, b6]) > 1 || resume3(n3, v); }); }; if (f5) i5[n3] = f5(i5[n3]); } } function resume3(n3, v) { try { step(g5[n3](v)); } catch (e5) { settle(q2[0][3], e5); } } function step(r5) { r5.value instanceof __await ? Promise.resolve(r5.value.v).then(fulfill, reject) : settle(q2[0][2], r5); } function fulfill(value) { resume3("next", value); } function reject(value) { resume3("throw", value); } function settle(f5, v) { if (f5(v), q2.shift(), q2.length) resume3(q2[0][0], q2[0][1]); } } function __asyncDelegator(o2) { var i5, p2; return i5 = {}, verb("next"), verb("throw", function(e5) { throw e5; }), verb("return"), i5[Symbol.iterator] = function() { return this; }, i5; function verb(n3, f5) { i5[n3] = o2[n3] ? function(v) { return (p2 = !p2) ? { value: __await(o2[n3](v)), done: false } : f5 ? f5(v) : v; } : f5; } } function __asyncValues(o2) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m3 = o2[Symbol.asyncIterator], i5; return m3 ? m3.call(o2) : (o2 = typeof __values === "function" ? __values(o2) : o2[Symbol.iterator](), i5 = {}, verb("next"), verb("throw"), verb("return"), i5[Symbol.asyncIterator] = function() { return this; }, i5); function verb(n3) { i5[n3] = o2[n3] && function(v) { return new Promise(function(resolve, reject) { v = o2[n3](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d5, v) { Promise.resolve(v).then(function(v2) { resolve({ value: v2, done: d5 }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; } function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k5 = ownKeys(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding(result, mod, k5[i5]); } __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return mod && mod.__esModule ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, state2, kind, f5) { if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter"); if (typeof state2 === "function" ? receiver !== state2 || !f5 : !state2.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state2.get(receiver); } function __classPrivateFieldSet(receiver, state2, value, kind, f5) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a setter"); if (typeof state2 === "function" ? receiver !== state2 || !f5 : !state2.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return kind === "a" ? f5.call(receiver, value) : f5 ? f5.value = value : state2.set(receiver, value), value; } function __classPrivateFieldIn(state2, receiver) { if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object"); return typeof state2 === "function" ? receiver === state2 : state2.has(receiver); } function __addDisposableResource(env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); var dispose, inner; if (async) { if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); dispose = value[Symbol.asyncDispose]; } if (dispose === void 0) { if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); dispose = value[Symbol.dispose]; if (async) inner = dispose; } if (typeof dispose !== "function") throw new TypeError("Object not disposable."); if (inner) dispose = function() { try { inner.call(this); } catch (e5) { return Promise.reject(e5); } }; env.stack.push({ value, dispose, async }); } else if (async) { env.stack.push({ async: true }); } return value; } function __disposeResources(env) { function fail(e5) { env.error = env.hasError ? new _SuppressedError(e5, env.error, "An error was suppressed during disposal.") : e5; env.hasError = true; } var r5, s = 0; function next() { while (r5 = env.stack.pop()) { try { if (!r5.async && s === 1) return s = 0, env.stack.push(r5), Promise.resolve().then(next); if (r5.dispose) { var result = r5.dispose.call(r5.value); if (r5.async) return s |= 2, Promise.resolve(result).then(next, function(e5) { fail(e5); return next(); }); } else s |= 1; } catch (e5) { fail(e5); } } if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); if (env.hasError) throw env.error; } return next(); } function __rewriteRelativeImportExtension(path3, preserveJsx) { if (typeof path3 === "string" && /^\.\.?\//.test(path3)) { return path3.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m3, tsx, d5, ext, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d5 && (!ext || !cm) ? m3 : d5 + ext + "." + cm.toLowerCase() + "js"; }); } return path3; } var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; var init_tslib_es6 = __esm({ "node_modules/tslib/tslib.es6.mjs"() { extendStatics = function(d5, b6) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d6, b7) { d6.__proto__ = b7; } || function(d6, b7) { for (var p2 in b7) if (Object.prototype.hasOwnProperty.call(b7, p2)) d6[p2] = b7[p2]; }; return extendStatics(d5, b6); }; __assign = function() { __assign = Object.assign || function __assign2(t) { for (var s, i5 = 1, n3 = arguments.length; i5 < n3; i5++) { s = arguments[i5]; for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2)) t[p2] = s[p2]; } return t; }; return __assign.apply(this, arguments); }; __createBinding = Object.create ? (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; var desc = Object.getOwnPropertyDescriptor(m3, k5); if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m3[k5]; } }; } Object.defineProperty(o2, k22, desc); }) : (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; o2[k22] = m3[k5]; }); __setModuleDefault = Object.create ? (function(o2, v) { Object.defineProperty(o2, "default", { enumerable: true, value: v }); }) : function(o2, v) { o2["default"] = v; }; ownKeys = function(o2) { ownKeys = Object.getOwnPropertyNames || function(o3) { var ar = []; for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; return ar; }; return ownKeys(o2); }; _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error3, suppressed, message) { var e5 = new Error(message); return e5.name = "SuppressedError", e5.error = error3, e5.suppressed = suppressed, e5; }; tslib_es6_default = { __extends, __assign, __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __awaiter: __awaiter6, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources, __rewriteRelativeImportExtension }; } }); // node_modules/@smithy/uuid/dist-cjs/randomUUID.js var require_randomUUID = __commonJS({ "node_modules/@smithy/uuid/dist-cjs/randomUUID.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.randomUUID = void 0; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var crypto_1 = tslib_1.__importDefault(require("crypto")); exports2.randomUUID = crypto_1.default.randomUUID.bind(crypto_1.default); } }); // node_modules/@smithy/uuid/dist-cjs/index.js var require_dist_cjs19 = __commonJS({ "node_modules/@smithy/uuid/dist-cjs/index.js"(exports2) { "use strict"; var randomUUID2 = require_randomUUID(); var decimalToHex = Array.from({ length: 256 }, (_, i5) => i5.toString(16).padStart(2, "0")); var v4 = () => { if (randomUUID2.randomUUID) { return randomUUID2.randomUUID(); } const rnds = new Uint8Array(16); crypto.getRandomValues(rnds); rnds[6] = rnds[6] & 15 | 64; rnds[8] = rnds[8] & 63 | 128; return decimalToHex[rnds[0]] + decimalToHex[rnds[1]] + decimalToHex[rnds[2]] + decimalToHex[rnds[3]] + "-" + decimalToHex[rnds[4]] + decimalToHex[rnds[5]] + "-" + decimalToHex[rnds[6]] + decimalToHex[rnds[7]] + "-" + decimalToHex[rnds[8]] + decimalToHex[rnds[9]] + "-" + decimalToHex[rnds[10]] + decimalToHex[rnds[11]] + decimalToHex[rnds[12]] + decimalToHex[rnds[13]] + decimalToHex[rnds[14]] + decimalToHex[rnds[15]]; }; exports2.v4 = v4; } }); // node_modules/@smithy/core/dist-es/submodules/serde/generateIdempotencyToken.js var import_uuid; var init_generateIdempotencyToken = __esm({ "node_modules/@smithy/core/dist-es/submodules/serde/generateIdempotencyToken.js"() { import_uuid = __toESM(require_dist_cjs19()); } }); // node_modules/@smithy/core/dist-es/submodules/serde/lazy-json.js var LazyJsonString; var init_lazy_json = __esm({ "node_modules/@smithy/core/dist-es/submodules/serde/lazy-json.js"() { LazyJsonString = function LazyJsonString2(val) { const str = Object.assign(new String(val), { deserializeJSON() { return JSON.parse(String(val)); }, toString() { return String(val); }, toJSON() { return String(val); } }); return str; }; 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/@smithy/core/dist-es/submodules/serde/quote-header.js function quoteHeader(part) { if (part.includes(",") || part.includes('"')) { part = `"${part.replace(/"/g, '\\"')}"`; } return part; } var init_quote_header = __esm({ "node_modules/@smithy/core/dist-es/submodules/serde/quote-header.js"() { } }); // node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js function range(v, min, max) { const _v = Number(v); if (_v < min || _v > max) { throw new Error(`Value ${_v} out of range [${min}, ${max}]`); } } var ddd, mmm, time, date, year, RFC3339_WITH_OFFSET2, IMF_FIXDATE2, RFC_850_DATE2, ASC_TIME2, months, _parseEpochTimestamp, _parseRfc3339DateTimeWithOffset, _parseRfc7231DateTime; var init_schema_date_utils = __esm({ "node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js"() { ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`; mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`; time = `(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`; date = `(\\d?\\d)`; year = `(\\d{4})`; RFC3339_WITH_OFFSET2 = new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/); IMF_FIXDATE2 = new RegExp(`^${ddd}, ${date} ${mmm} ${year} ${time} GMT$`); RFC_850_DATE2 = new RegExp(`^${ddd}, ${date}-${mmm}-(\\d\\d) ${time} GMT$`); ASC_TIME2 = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time} ${year}$`); months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; _parseEpochTimestamp = (value) => { if (value == null) { return void 0; } let num = NaN; if (typeof value === "number") { num = value; } else if (typeof value === "string") { if (!/^-?\d*\.?\d+$/.test(value)) { throw new TypeError(`parseEpochTimestamp - numeric string invalid.`); } num = Number.parseFloat(value); } else if (typeof value === "object" && value.tag === 1) { num = value.value; } if (isNaN(num) || Math.abs(num) === Infinity) { throw new TypeError("Epoch timestamps must be valid finite numbers."); } return new Date(Math.round(num * 1e3)); }; _parseRfc3339DateTimeWithOffset = (value) => { if (value == null) { return void 0; } if (typeof value !== "string") { throw new TypeError("RFC3339 timestamps must be strings"); } const matches = RFC3339_WITH_OFFSET2.exec(value); if (!matches) { throw new TypeError(`Invalid RFC3339 timestamp format ${value}`); } const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches; range(monthStr, 1, 12); range(dayStr, 1, 31); range(hours, 0, 23); range(minutes, 0, 59); range(seconds, 0, 60); const date2 = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1e3) : 0)); date2.setUTCFullYear(Number(yearStr)); if (offsetStr.toUpperCase() != "Z") { const [, sign, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0]; const scalar = sign === "-" ? 1 : -1; date2.setTime(date2.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1e3 + Number(offsetM) * 60 * 1e3)); } return date2; }; _parseRfc7231DateTime = (value) => { if (value == null) { return void 0; } if (typeof value !== "string") { throw new TypeError("RFC7231 timestamps must be strings."); } let day; let month; let year2; let hour; let minute; let second; let fraction; let matches; if (matches = IMF_FIXDATE2.exec(value)) { [, day, month, year2, hour, minute, second, fraction] = matches; } else if (matches = RFC_850_DATE2.exec(value)) { [, day, month, year2, hour, minute, second, fraction] = matches; year2 = (Number(year2) + 1900).toString(); } else if (matches = ASC_TIME2.exec(value)) { [, month, day, hour, minute, second, fraction, year2] = matches; } if (year2 && second) { const timestamp = Date.UTC(Number(year2), months.indexOf(month), Number(day), Number(hour), Number(minute), Number(second), fraction ? Math.round(parseFloat(`0.${fraction}`) * 1e3) : 0); range(day, 1, 31); range(hour, 0, 23); range(minute, 0, 59); range(second, 0, 60); const date2 = new Date(timestamp); date2.setUTCFullYear(Number(year2)); return date2; } throw new TypeError(`Invalid RFC7231 date-time value ${value}.`); }; } }); // node_modules/@smithy/core/dist-es/submodules/serde/split-every.js function splitEvery(value, delimiter, numDelimiters) { if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) { throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery."); } const segments = value.split(delimiter); if (numDelimiters === 1) { return segments; } const compoundSegments = []; let currentSegment = ""; for (let i5 = 0; i5 < segments.length; i5++) { if (currentSegment === "") { currentSegment = segments[i5]; } else { currentSegment += delimiter + segments[i5]; } if ((i5 + 1) % numDelimiters === 0) { compoundSegments.push(currentSegment); currentSegment = ""; } } if (currentSegment !== "") { compoundSegments.push(currentSegment); } return compoundSegments; } var init_split_every = __esm({ "node_modules/@smithy/core/dist-es/submodules/serde/split-every.js"() { } }); // node_modules/@smithy/core/dist-es/submodules/serde/split-header.js var splitHeader; var init_split_header = __esm({ "node_modules/@smithy/core/dist-es/submodules/serde/split-header.js"() { splitHeader = (value) => { const z = value.length; const values = []; let withinQuotes = false; let prevChar = void 0; let anchor = 0; for (let i5 = 0; i5 < z; ++i5) { const char = value[i5]; switch (char) { case `"`: if (prevChar !== "\\") { withinQuotes = !withinQuotes; } break; case ",": if (!withinQuotes) { values.push(value.slice(anchor, i5)); anchor = i5 + 1; } break; default: } prevChar = char; } values.push(value.slice(anchor)); return values.map((v) => { v = v.trim(); const z2 = v.length; if (z2 < 2) { return v; } if (v[0] === `"` && v[z2 - 1] === `"`) { v = v.slice(1, z2 - 1); } return v.replace(/\\"/g, '"'); }); }; } }); // node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js function nv(input) { return new NumericValue(String(input), "bigDecimal"); } var format, NumericValue; var init_NumericValue = __esm({ "node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js"() { format = /^-?\d*(\.\d+)?$/; NumericValue = class _NumericValue { string; type; constructor(string, type) { this.string = string; this.type = type; if (!format.test(string)) { throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`); } } toString() { return this.string; } static [Symbol.hasInstance](object) { if (!object || typeof object !== "object") { return false; } const _nv = object; return _NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" && format.test(_nv.string); } }; } }); // node_modules/@smithy/core/dist-es/submodules/serde/index.js var serde_exports = {}; __export(serde_exports, { LazyJsonString: () => LazyJsonString, NumericValue: () => NumericValue, _parseEpochTimestamp: () => _parseEpochTimestamp, _parseRfc3339DateTimeWithOffset: () => _parseRfc3339DateTimeWithOffset, _parseRfc7231DateTime: () => _parseRfc7231DateTime, copyDocumentWithTransform: () => copyDocumentWithTransform, dateToUtcString: () => dateToUtcString, expectBoolean: () => expectBoolean, expectByte: () => expectByte, expectFloat32: () => expectFloat32, expectInt: () => expectInt, expectInt32: () => expectInt32, expectLong: () => expectLong, expectNonNull: () => expectNonNull, expectNumber: () => expectNumber, expectObject: () => expectObject, expectShort: () => expectShort, expectString: () => expectString, expectUnion: () => expectUnion, generateIdempotencyToken: () => import_uuid.v4, handleFloat: () => handleFloat, limitedParseDouble: () => limitedParseDouble, limitedParseFloat: () => limitedParseFloat, limitedParseFloat32: () => limitedParseFloat32, logger: () => logger, nv: () => nv, parseBoolean: () => parseBoolean, parseEpochTimestamp: () => parseEpochTimestamp, parseRfc3339DateTime: () => parseRfc3339DateTime, parseRfc3339DateTimeWithOffset: () => parseRfc3339DateTimeWithOffset, parseRfc7231DateTime: () => parseRfc7231DateTime, quoteHeader: () => quoteHeader, splitEvery: () => splitEvery, splitHeader: () => splitHeader, strictParseByte: () => strictParseByte, strictParseDouble: () => strictParseDouble, strictParseFloat: () => strictParseFloat, strictParseFloat32: () => strictParseFloat32, strictParseInt: () => strictParseInt, strictParseInt32: () => strictParseInt32, strictParseLong: () => strictParseLong, strictParseShort: () => strictParseShort }); var init_serde = __esm({ "node_modules/@smithy/core/dist-es/submodules/serde/index.js"() { init_copyDocumentWithTransform(); init_date_utils(); init_generateIdempotencyToken(); init_lazy_json(); init_parse_utils(); init_quote_header(); init_schema_date_utils(); init_split_every(); init_split_header(); init_NumericValue(); } }); // node_modules/@smithy/core/dist-es/submodules/protocols/SerdeContext.js var SerdeContext; var init_SerdeContext = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/SerdeContext.js"() { SerdeContext = class { serdeContext; setSerdeContext(serdeContext) { this.serdeContext = serdeContext; } }; } }); // node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js var import_util_utf8, EventStreamSerde; var init_EventStreamSerde = __esm({ "node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js"() { import_util_utf8 = __toESM(require_dist_cjs9()); EventStreamSerde = class { marshaller; serializer; deserializer; serdeContext; defaultContentType; constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType }) { this.marshaller = marshaller; this.serializer = serializer; this.deserializer = deserializer; this.serdeContext = serdeContext; this.defaultContentType = defaultContentType; } async serializeEventStream({ eventStream, requestSchema, initialRequest }) { const marshaller = this.marshaller; const eventStreamMember = requestSchema.getEventStreamMember(); const unionSchema = requestSchema.getMemberSchema(eventStreamMember); const serializer = this.serializer; const defaultContentType = this.defaultContentType; const initialRequestMarker = /* @__PURE__ */ Symbol("initialRequestMarker"); const eventStreamIterable = { async *[Symbol.asyncIterator]() { if (initialRequest) { const headers = { ":event-type": { type: "string", value: "initial-request" }, ":message-type": { type: "string", value: "event" }, ":content-type": { type: "string", value: defaultContentType } }; serializer.write(requestSchema, initialRequest); const body = serializer.flush(); yield { [initialRequestMarker]: true, headers, body }; } for await (const page of eventStream) { yield page; } } }; return marshaller.serialize(eventStreamIterable, (event) => { if (event[initialRequestMarker]) { return { headers: event.headers, body: event.body }; } let unionMember = ""; for (const key in event) { if (key !== "__type") { unionMember = key; break; } } const { additionalHeaders, body, eventType, explicitPayloadContentType } = this.writeEventBody(unionMember, unionSchema, event); const headers = { ":event-type": { type: "string", value: eventType }, ":message-type": { type: "string", value: "event" }, ":content-type": { type: "string", value: explicitPayloadContentType ?? defaultContentType }, ...additionalHeaders }; return { headers, body }; }); } async deserializeEventStream({ response, responseSchema, initialResponseContainer }) { const marshaller = this.marshaller; const eventStreamMember = responseSchema.getEventStreamMember(); const unionSchema = responseSchema.getMemberSchema(eventStreamMember); const memberSchemas = unionSchema.getMemberSchemas(); const initialResponseMarker = /* @__PURE__ */ Symbol("initialResponseMarker"); const asyncIterable = marshaller.deserialize(response.body, async (event) => { let unionMember = ""; for (const key in event) { if (key !== "__type") { unionMember = key; break; } } const body = event[unionMember].body; if (unionMember === "initial-response") { const dataObject = await this.deserializer.read(responseSchema, body); delete dataObject[eventStreamMember]; return { [initialResponseMarker]: true, ...dataObject }; } else if (unionMember in memberSchemas) { const eventStreamSchema = memberSchemas[unionMember]; if (eventStreamSchema.isStructSchema()) { const out = {}; let hasBindings = false; for (const [name, member2] of eventStreamSchema.structIterator()) { const { eventHeader, eventPayload } = member2.getMergedTraits(); hasBindings = hasBindings || Boolean(eventHeader || eventPayload); if (eventPayload) { if (member2.isBlobSchema()) { out[name] = body; } else if (member2.isStringSchema()) { out[name] = (this.serdeContext?.utf8Encoder ?? import_util_utf8.toUtf8)(body); } else if (member2.isStructSchema()) { out[name] = await this.deserializer.read(member2, body); } } else if (eventHeader) { const value = event[unionMember].headers[name]?.value; if (value != null) { if (member2.isNumericSchema()) { if (value && typeof value === "object" && "bytes" in value) { out[name] = BigInt(value.toString()); } else { out[name] = Number(value); } } else { out[name] = value; } } } } if (hasBindings) { return { [unionMember]: out }; } if (body.byteLength === 0) { return { [unionMember]: {} }; } } return { [unionMember]: await this.deserializer.read(eventStreamSchema, body) }; } else { return { $unknown: event }; } }); const asyncIterator = asyncIterable[Symbol.asyncIterator](); const firstEvent = await asyncIterator.next(); if (firstEvent.done) { return asyncIterable; } if (firstEvent.value?.[initialResponseMarker]) { if (!responseSchema) { throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given."); } for (const key in firstEvent.value) { initialResponseContainer[key] = firstEvent.value[key]; } } return { async *[Symbol.asyncIterator]() { if (!firstEvent?.value?.[initialResponseMarker]) { yield firstEvent.value; } while (true) { const { done, value } = await asyncIterator.next(); if (done) { break; } yield value; } } }; } writeEventBody(unionMember, unionSchema, event) { const serializer = this.serializer; let eventType = unionMember; let explicitPayloadMember = null; let explicitPayloadContentType; const isKnownSchema = (() => { const struct2 = unionSchema.getSchema(); return struct2[4].includes(unionMember); })(); const additionalHeaders = {}; if (!isKnownSchema) { const [type, value] = event[unionMember]; eventType = type; serializer.write(15, value); } else { const eventSchema = unionSchema.getMemberSchema(unionMember); if (eventSchema.isStructSchema()) { for (const [memberName, memberSchema] of eventSchema.structIterator()) { const { eventHeader, eventPayload } = memberSchema.getMergedTraits(); if (eventPayload) { explicitPayloadMember = memberName; } else if (eventHeader) { const value = event[unionMember][memberName]; let type = "binary"; if (memberSchema.isNumericSchema()) { if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) { type = "integer"; } else { type = "long"; } } else if (memberSchema.isTimestampSchema()) { type = "timestamp"; } else if (memberSchema.isStringSchema()) { type = "string"; } else if (memberSchema.isBooleanSchema()) { type = "boolean"; } if (value != null) { additionalHeaders[memberName] = { type, value }; delete event[unionMember][memberName]; } } } if (explicitPayloadMember !== null) { const payloadSchema = eventSchema.getMemberSchema(explicitPayloadMember); if (payloadSchema.isBlobSchema()) { explicitPayloadContentType = "application/octet-stream"; } else if (payloadSchema.isStringSchema()) { explicitPayloadContentType = "text/plain"; } serializer.write(payloadSchema, event[unionMember][explicitPayloadMember]); } else { serializer.write(eventSchema, event[unionMember]); } } else if (eventSchema.isUnitSchema()) { serializer.write(eventSchema, {}); } else { throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union."); } } const messageSerialization = serializer.flush() ?? new Uint8Array(); const body = typeof messageSerialization === "string" ? (this.serdeContext?.utf8Decoder ?? import_util_utf8.fromUtf8)(messageSerialization) : messageSerialization; return { body, eventType, explicitPayloadContentType, additionalHeaders }; } }; } }); // node_modules/@smithy/core/dist-es/submodules/event-streams/index.js var event_streams_exports = {}; __export(event_streams_exports, { EventStreamSerde: () => EventStreamSerde }); var init_event_streams = __esm({ "node_modules/@smithy/core/dist-es/submodules/event-streams/index.js"() { init_EventStreamSerde(); } }); // node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js var import_protocol_http3, HttpProtocol; var init_HttpProtocol = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js"() { init_schema(); import_protocol_http3 = __toESM(require_dist_cjs2()); init_SerdeContext(); HttpProtocol = class extends SerdeContext { options; compositeErrorRegistry; constructor(options) { super(); this.options = options; this.compositeErrorRegistry = TypeRegistry.for(options.defaultNamespace); for (const etr of options.errorTypeRegistries ?? []) { this.compositeErrorRegistry.copyFrom(etr); } } getRequestType() { return import_protocol_http3.HttpRequest; } getResponseType() { return import_protocol_http3.HttpResponse; } setSerdeContext(serdeContext) { this.serdeContext = serdeContext; this.serializer.setSerdeContext(serdeContext); this.deserializer.setSerdeContext(serdeContext); if (this.getPayloadCodec()) { this.getPayloadCodec().setSerdeContext(serdeContext); } } updateServiceEndpoint(request, endpoint) { if ("url" in endpoint) { request.protocol = endpoint.url.protocol; request.hostname = endpoint.url.hostname; request.port = endpoint.url.port ? Number(endpoint.url.port) : void 0; request.path = endpoint.url.pathname; request.fragment = endpoint.url.hash || void 0; request.username = endpoint.url.username || void 0; request.password = endpoint.url.password || void 0; if (!request.query) { request.query = {}; } for (const [k5, v] of endpoint.url.searchParams.entries()) { request.query[k5] = v; } if (endpoint.headers) { for (const name in endpoint.headers) { request.headers[name] = endpoint.headers[name].join(", "); } } return request; } else { request.protocol = endpoint.protocol; request.hostname = endpoint.hostname; request.port = endpoint.port ? Number(endpoint.port) : void 0; request.path = endpoint.path; request.query = { ...endpoint.query }; if (endpoint.headers) { for (const name in endpoint.headers) { request.headers[name] = endpoint.headers[name]; } } return request; } } setHostPrefix(request, operationSchema, input) { if (this.serdeContext?.disableHostPrefix) { return; } const inputNs = NormalizedSchema.of(operationSchema.input); const opTraits = translateTraits(operationSchema.traits ?? {}); if (opTraits.endpoint) { let hostPrefix = opTraits.endpoint?.[0]; if (typeof hostPrefix === "string") { for (const [name, member2] of inputNs.structIterator()) { if (!member2.getMergedTraits().hostLabel) { continue; } const replacement = input[name]; if (typeof replacement !== "string") { throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`); } hostPrefix = hostPrefix.replace(`{${name}}`, replacement); } request.hostname = hostPrefix + request.hostname; } } } deserializeMetadata(output) { return { 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"] }; } async serializeEventStream({ eventStream, requestSchema, initialRequest }) { const eventStreamSerde = await this.loadEventStreamCapability(); return eventStreamSerde.serializeEventStream({ eventStream, requestSchema, initialRequest }); } async deserializeEventStream({ response, responseSchema, initialResponseContainer }) { const eventStreamSerde = await this.loadEventStreamCapability(); return eventStreamSerde.deserializeEventStream({ response, responseSchema, initialResponseContainer }); } async loadEventStreamCapability() { const { EventStreamSerde: EventStreamSerde2 } = await Promise.resolve().then(() => (init_event_streams(), event_streams_exports)); return new EventStreamSerde2({ marshaller: this.getEventStreamMarshaller(), serializer: this.serializer, deserializer: this.deserializer, serdeContext: this.serdeContext, defaultContentType: this.getDefaultContentType() }); } getDefaultContentType() { throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`); } async deserializeHttpMessage(schema, context, response, arg4, arg5) { void schema; void context; void response; void arg4; void arg5; return []; } getEventStreamMarshaller() { const context = this.serdeContext; if (!context.eventStreamMarshaller) { throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext."); } return context.eventStreamMarshaller; } }; } }); // node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js var import_protocol_http4, import_util_stream2, HttpBindingProtocol; var init_HttpBindingProtocol = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js"() { init_schema(); init_serde(); import_protocol_http4 = __toESM(require_dist_cjs2()); import_util_stream2 = __toESM(require_dist_cjs16()); init_collect_stream_body(); init_extended_encode_uri_component(); init_HttpProtocol(); HttpBindingProtocol = class extends HttpProtocol { async serializeRequest(operationSchema, _input, context) { const input = _input && typeof _input === "object" ? _input : {}; const serializer = this.serializer; const query = {}; const headers = {}; const endpoint = await context.endpoint(); const ns = NormalizedSchema.of(operationSchema?.input); const payloadMemberNames = []; const payloadMemberSchemas = []; let hasNonHttpBindingMember = false; let payload2; const request = new import_protocol_http4.HttpRequest({ protocol: "", hostname: "", port: void 0, path: "", fragment: void 0, query, headers, body: void 0 }); if (endpoint) { this.updateServiceEndpoint(request, endpoint); this.setHostPrefix(request, operationSchema, input); const opTraits = translateTraits(operationSchema.traits); if (opTraits.http) { request.method = opTraits.http[0]; const [path3, search] = opTraits.http[1].split("?"); if (request.path == "/") { request.path = path3; } else { request.path += path3; } const traitSearchParams = new URLSearchParams(search ?? ""); for (const [key, value] of traitSearchParams) { query[key] = value; } } } for (const [memberName, memberNs] of ns.structIterator()) { const memberTraits = memberNs.getMergedTraits() ?? {}; const inputMemberValue = input[memberName]; if (inputMemberValue == null && !memberNs.isIdempotencyToken()) { if (memberTraits.httpLabel) { if (request.path.includes(`{${memberName}+}`) || request.path.includes(`{${memberName}}`)) { throw new Error(`No value provided for input HTTP label: ${memberName}.`); } } continue; } if (memberTraits.httpPayload) { const isStreaming = memberNs.isStreaming(); if (isStreaming) { const isEventStream = memberNs.isStructSchema(); if (isEventStream) { if (input[memberName]) { payload2 = await this.serializeEventStream({ eventStream: input[memberName], requestSchema: ns }); } } else { payload2 = inputMemberValue; } } else { serializer.write(memberNs, inputMemberValue); payload2 = serializer.flush(); } } else if (memberTraits.httpLabel) { serializer.write(memberNs, inputMemberValue); const replacement = serializer.flush(); if (request.path.includes(`{${memberName}+}`)) { request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/")); } else if (request.path.includes(`{${memberName}}`)) { request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement)); } } else if (memberTraits.httpHeader) { serializer.write(memberNs, inputMemberValue); headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush()); } else if (typeof memberTraits.httpPrefixHeaders === "string") { for (const key in inputMemberValue) { const val = inputMemberValue[key]; const amalgam = memberTraits.httpPrefixHeaders + key; serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val); headers[amalgam.toLowerCase()] = serializer.flush(); } } else if (memberTraits.httpQuery || memberTraits.httpQueryParams) { this.serializeQuery(memberNs, inputMemberValue, query); } else { hasNonHttpBindingMember = true; payloadMemberNames.push(memberName); payloadMemberSchemas.push(memberNs); } } if (hasNonHttpBindingMember && input) { const [namespace, name] = (ns.getName(true) ?? "#Unknown").split("#"); const requiredMembers = ns.getSchema()[6]; const payloadSchema = [ 3, namespace, name, ns.getMergedTraits(), payloadMemberNames, payloadMemberSchemas, void 0 ]; if (requiredMembers) { payloadSchema[6] = requiredMembers; } else { payloadSchema.pop(); } serializer.write(payloadSchema, input); payload2 = serializer.flush(); } request.headers = headers; request.query = query; request.body = payload2; return request; } serializeQuery(ns, data3, query) { const serializer = this.serializer; const traits = ns.getMergedTraits(); if (traits.httpQueryParams) { for (const key in data3) { if (!(key in query)) { const val = data3[key]; const valueSchema = ns.getValueSchema(); Object.assign(valueSchema.getMergedTraits(), { ...traits, httpQuery: key, httpQueryParams: void 0 }); this.serializeQuery(valueSchema, val, query); } } return; } if (ns.isListSchema()) { const sparse = !!ns.getMergedTraits().sparse; const buffer = []; for (const item of data3) { serializer.write([ns.getValueSchema(), traits], item); const serializable = serializer.flush(); if (sparse || serializable !== void 0) { buffer.push(serializable); } } query[traits.httpQuery] = buffer; } else { serializer.write([ns, traits], data3); query[traits.httpQuery] = serializer.flush(); } } async deserializeResponse(operationSchema, context, response) { const deserializer = this.deserializer; const ns = NormalizedSchema.of(operationSchema.output); const dataObject = {}; if (response.statusCode >= 300) { const bytes = await collectBody(response.body, context); if (bytes.byteLength > 0) { Object.assign(dataObject, await deserializer.read(15, bytes)); } await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw."); } for (const header in response.headers) { const value = response.headers[header]; delete response.headers[header]; response.headers[header.toLowerCase()] = value; } const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject); if (nonHttpBindingMembers.length) { const bytes = await collectBody(response.body, context); if (bytes.byteLength > 0) { const dataFromBody = await deserializer.read(ns, bytes); for (const member2 of nonHttpBindingMembers) { if (dataFromBody[member2] != null) { dataObject[member2] = dataFromBody[member2]; } } } } else if (nonHttpBindingMembers.discardResponseBody) { await collectBody(response.body, context); } dataObject.$metadata = this.deserializeMetadata(response); return dataObject; } async deserializeHttpMessage(schema, context, response, arg4, arg5) { let dataObject; if (arg4 instanceof Set) { dataObject = arg5; } else { dataObject = arg4; } let discardResponseBody = true; const deserializer = this.deserializer; const ns = NormalizedSchema.of(schema); const nonHttpBindingMembers = []; for (const [memberName, memberSchema] of ns.structIterator()) { const memberTraits = memberSchema.getMemberTraits(); if (memberTraits.httpPayload) { discardResponseBody = false; const isStreaming = memberSchema.isStreaming(); if (isStreaming) { const isEventStream = memberSchema.isStructSchema(); if (isEventStream) { dataObject[memberName] = await this.deserializeEventStream({ response, responseSchema: ns }); } else { dataObject[memberName] = (0, import_util_stream2.sdkStreamMixin)(response.body); } } else if (response.body) { const bytes = await collectBody(response.body, context); if (bytes.byteLength > 0) { dataObject[memberName] = await deserializer.read(memberSchema, bytes); } } } else if (memberTraits.httpHeader) { const key = String(memberTraits.httpHeader).toLowerCase(); const value = response.headers[key]; if (null != value) { if (memberSchema.isListSchema()) { const headerListValueSchema = memberSchema.getValueSchema(); headerListValueSchema.getMergedTraits().httpHeader = key; let sections; if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === 4) { sections = splitEvery(value, ",", 2); } else { sections = splitHeader(value); } const list2 = []; for (const section of sections) { list2.push(await deserializer.read(headerListValueSchema, section.trim())); } dataObject[memberName] = list2; } else { dataObject[memberName] = await deserializer.read(memberSchema, value); } } } else if (memberTraits.httpPrefixHeaders !== void 0) { dataObject[memberName] = {}; for (const header in response.headers) { if (header.startsWith(memberTraits.httpPrefixHeaders)) { const value = response.headers[header]; const valueSchema = memberSchema.getValueSchema(); valueSchema.getMergedTraits().httpHeader = header; dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value); } } } else if (memberTraits.httpResponseCode) { dataObject[memberName] = response.statusCode; } else { nonHttpBindingMembers.push(memberName); } } nonHttpBindingMembers.discardResponseBody = discardResponseBody; return nonHttpBindingMembers; } }; } }); // node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js var import_protocol_http5, RpcProtocol; var init_RpcProtocol = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js"() { init_schema(); import_protocol_http5 = __toESM(require_dist_cjs2()); init_collect_stream_body(); init_HttpProtocol(); RpcProtocol = class extends HttpProtocol { async serializeRequest(operationSchema, _input, context) { const serializer = this.serializer; const query = {}; const headers = {}; const endpoint = await context.endpoint(); const ns = NormalizedSchema.of(operationSchema?.input); const schema = ns.getSchema(); let payload2; const input = _input && typeof _input === "object" ? _input : {}; const request = new import_protocol_http5.HttpRequest({ protocol: "", hostname: "", port: void 0, path: "/", fragment: void 0, query, headers, body: void 0 }); if (endpoint) { this.updateServiceEndpoint(request, endpoint); this.setHostPrefix(request, operationSchema, input); } if (input) { const eventStreamMember = ns.getEventStreamMember(); if (eventStreamMember) { if (input[eventStreamMember]) { const initialRequest = {}; for (const [memberName, memberSchema] of ns.structIterator()) { if (memberName !== eventStreamMember && input[memberName]) { serializer.write(memberSchema, input[memberName]); initialRequest[memberName] = serializer.flush(); } } payload2 = await this.serializeEventStream({ eventStream: input[eventStreamMember], requestSchema: ns, initialRequest }); } } else { serializer.write(schema, input); payload2 = serializer.flush(); } } request.headers = Object.assign(request.headers, headers); request.query = query; request.body = payload2; request.method = "POST"; return request; } async deserializeResponse(operationSchema, context, response) { const deserializer = this.deserializer; const ns = NormalizedSchema.of(operationSchema.output); const dataObject = {}; if (response.statusCode >= 300) { const bytes = await collectBody(response.body, context); if (bytes.byteLength > 0) { Object.assign(dataObject, await deserializer.read(15, bytes)); } await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw."); } for (const header in response.headers) { const value = response.headers[header]; delete response.headers[header]; response.headers[header.toLowerCase()] = value; } const eventStreamMember = ns.getEventStreamMember(); if (eventStreamMember) { dataObject[eventStreamMember] = await this.deserializeEventStream({ response, responseSchema: ns, initialResponseContainer: dataObject }); } else { const bytes = await collectBody(response.body, context); if (bytes.byteLength > 0) { Object.assign(dataObject, await deserializer.read(ns, bytes)); } } dataObject.$metadata = this.deserializeMetadata(response); return dataObject; } }; } }); // node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js var resolvedPath; var init_resolve_path = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js"() { init_extended_encode_uri_component(); resolvedPath = (resolvedPath2, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => { if (input != null && input[memberName] !== void 0) { const labelValue = labelValueProvider(); if (labelValue == null || 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; }; } }); // node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js function requestBuilder(input, context) { return new RequestBuilder(input, context); } var import_protocol_http6, RequestBuilder; var init_requestBuilder = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js"() { import_protocol_http6 = __toESM(require_dist_cjs2()); init_resolve_path(); RequestBuilder = class { input; context; query = {}; method = ""; headers = {}; path = ""; body = null; hostname = ""; resolvePathStack = []; constructor(input, context) { this.input = input; this.context = context; } async build() { const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint(); this.path = basePath; for (const resolvePath of this.resolvePathStack) { resolvePath(this.path); } return new import_protocol_http6.HttpRequest({ protocol, hostname: this.hostname || hostname, port, method: this.method, path: this.path, query: this.query, body: this.body, headers: this.headers }); } hn(hostname) { this.hostname = hostname; 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((path3) => { this.path = resolvedPath(path3, 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; } }; } }); // node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js function determineTimestampFormat(ns, settings) { if (settings.timestampFormat.useTrait) { if (ns.isTimestampSchema() && (ns.getSchema() === 5 || ns.getSchema() === 6 || ns.getSchema() === 7)) { return ns.getSchema(); } } const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits(); const bindingFormat = settings.httpBindings ? typeof httpPrefixHeaders === "string" || Boolean(httpHeader) ? 6 : Boolean(httpQuery) || Boolean(httpLabel) ? 5 : void 0 : void 0; return bindingFormat ?? settings.timestampFormat.default; } var init_determineTimestampFormat = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js"() { } }); // node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js var import_util_base64, import_util_utf82, FromStringShapeDeserializer; var init_FromStringShapeDeserializer = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js"() { init_schema(); init_serde(); import_util_base64 = __toESM(require_dist_cjs10()); import_util_utf82 = __toESM(require_dist_cjs9()); init_SerdeContext(); init_determineTimestampFormat(); FromStringShapeDeserializer = class extends SerdeContext { settings; constructor(settings) { super(); this.settings = settings; } read(_schema, data3) { const ns = NormalizedSchema.of(_schema); if (ns.isListSchema()) { return splitHeader(data3).map((item) => this.read(ns.getValueSchema(), item)); } if (ns.isBlobSchema()) { return (this.serdeContext?.base64Decoder ?? import_util_base64.fromBase64)(data3); } if (ns.isTimestampSchema()) { const format2 = determineTimestampFormat(ns, this.settings); switch (format2) { case 5: return _parseRfc3339DateTimeWithOffset(data3); case 6: return _parseRfc7231DateTime(data3); case 7: return _parseEpochTimestamp(data3); default: console.warn("Missing timestamp format, parsing value with Date constructor:", data3); return new Date(data3); } } if (ns.isStringSchema()) { const mediaType = ns.getMergedTraits().mediaType; let intermediateValue = data3; if (mediaType) { if (ns.getMergedTraits().httpHeader) { intermediateValue = this.base64ToUtf8(intermediateValue); } const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); if (isJson) { intermediateValue = LazyJsonString.from(intermediateValue); } return intermediateValue; } } if (ns.isNumericSchema()) { return Number(data3); } if (ns.isBigIntegerSchema()) { return BigInt(data3); } if (ns.isBigDecimalSchema()) { return new NumericValue(data3, "bigDecimal"); } if (ns.isBooleanSchema()) { return String(data3).toLowerCase() === "true"; } return data3; } base64ToUtf8(base64String) { return (this.serdeContext?.utf8Encoder ?? import_util_utf82.toUtf8)((this.serdeContext?.base64Decoder ?? import_util_base64.fromBase64)(base64String)); } }; } }); // node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js var import_util_utf83, HttpInterceptingShapeDeserializer; var init_HttpInterceptingShapeDeserializer = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js"() { init_schema(); import_util_utf83 = __toESM(require_dist_cjs9()); init_SerdeContext(); init_FromStringShapeDeserializer(); HttpInterceptingShapeDeserializer = class extends SerdeContext { codecDeserializer; stringDeserializer; constructor(codecDeserializer, codecSettings) { super(); this.codecDeserializer = codecDeserializer; this.stringDeserializer = new FromStringShapeDeserializer(codecSettings); } setSerdeContext(serdeContext) { this.stringDeserializer.setSerdeContext(serdeContext); this.codecDeserializer.setSerdeContext(serdeContext); this.serdeContext = serdeContext; } read(schema, data3) { const ns = NormalizedSchema.of(schema); const traits = ns.getMergedTraits(); const toString = this.serdeContext?.utf8Encoder ?? import_util_utf83.toUtf8; if (traits.httpHeader || traits.httpResponseCode) { return this.stringDeserializer.read(ns, toString(data3)); } if (traits.httpPayload) { if (ns.isBlobSchema()) { const toBytes = this.serdeContext?.utf8Decoder ?? import_util_utf83.fromUtf8; if (typeof data3 === "string") { return toBytes(data3); } return data3; } else if (ns.isStringSchema()) { if ("byteLength" in data3) { return toString(data3); } return data3; } } return this.codecDeserializer.read(ns, data3); } }; } }); // node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js var import_util_base642, ToStringShapeSerializer; var init_ToStringShapeSerializer = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js"() { init_schema(); init_serde(); import_util_base642 = __toESM(require_dist_cjs10()); init_SerdeContext(); init_determineTimestampFormat(); ToStringShapeSerializer = class extends SerdeContext { settings; stringBuffer = ""; constructor(settings) { super(); this.settings = settings; } write(schema, value) { const ns = NormalizedSchema.of(schema); switch (typeof value) { case "object": if (value === null) { this.stringBuffer = "null"; return; } if (ns.isTimestampSchema()) { if (!(value instanceof Date)) { throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`); } const format2 = determineTimestampFormat(ns, this.settings); switch (format2) { case 5: this.stringBuffer = value.toISOString().replace(".000Z", "Z"); break; case 6: this.stringBuffer = dateToUtcString(value); break; case 7: this.stringBuffer = String(value.getTime() / 1e3); break; default: console.warn("Missing timestamp format, using epoch seconds", value); this.stringBuffer = String(value.getTime() / 1e3); } return; } if (ns.isBlobSchema() && "byteLength" in value) { this.stringBuffer = (this.serdeContext?.base64Encoder ?? import_util_base642.toBase64)(value); return; } if (ns.isListSchema() && Array.isArray(value)) { let buffer = ""; for (const item of value) { this.write([ns.getValueSchema(), ns.getMergedTraits()], item); const headerItem = this.flush(); const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : quoteHeader(headerItem); if (buffer !== "") { buffer += ", "; } buffer += serialized; } this.stringBuffer = buffer; return; } this.stringBuffer = JSON.stringify(value, null, 2); break; case "string": const mediaType = ns.getMergedTraits().mediaType; let intermediateValue = value; if (mediaType) { const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); if (isJson) { intermediateValue = LazyJsonString.from(intermediateValue); } if (ns.getMergedTraits().httpHeader) { this.stringBuffer = (this.serdeContext?.base64Encoder ?? import_util_base642.toBase64)(intermediateValue.toString()); return; } } this.stringBuffer = value; break; default: if (ns.isIdempotencyToken()) { this.stringBuffer = (0, import_uuid.v4)(); } else { this.stringBuffer = String(value); } } } flush() { const buffer = this.stringBuffer; this.stringBuffer = ""; return buffer; } }; } }); // node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js var HttpInterceptingShapeSerializer; var init_HttpInterceptingShapeSerializer = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js"() { init_schema(); init_ToStringShapeSerializer(); HttpInterceptingShapeSerializer = class { codecSerializer; stringSerializer; buffer; constructor(codecSerializer, codecSettings, stringSerializer = new ToStringShapeSerializer(codecSettings)) { this.codecSerializer = codecSerializer; this.stringSerializer = stringSerializer; } setSerdeContext(serdeContext) { this.codecSerializer.setSerdeContext(serdeContext); this.stringSerializer.setSerdeContext(serdeContext); } write(schema, value) { const ns = NormalizedSchema.of(schema); const traits = ns.getMergedTraits(); if (traits.httpHeader || traits.httpLabel || traits.httpQuery) { this.stringSerializer.write(ns, value); this.buffer = this.stringSerializer.flush(); return; } return this.codecSerializer.write(ns, value); } flush() { if (this.buffer !== void 0) { const buffer = this.buffer; this.buffer = void 0; return buffer; } return this.codecSerializer.flush(); } }; } }); // node_modules/@smithy/core/dist-es/submodules/protocols/index.js var protocols_exports = {}; __export(protocols_exports, { FromStringShapeDeserializer: () => FromStringShapeDeserializer, HttpBindingProtocol: () => HttpBindingProtocol, HttpInterceptingShapeDeserializer: () => HttpInterceptingShapeDeserializer, HttpInterceptingShapeSerializer: () => HttpInterceptingShapeSerializer, HttpProtocol: () => HttpProtocol, RequestBuilder: () => RequestBuilder, RpcProtocol: () => RpcProtocol, SerdeContext: () => SerdeContext, ToStringShapeSerializer: () => ToStringShapeSerializer, collectBody: () => collectBody, determineTimestampFormat: () => determineTimestampFormat, extendedEncodeURIComponent: () => extendedEncodeURIComponent, requestBuilder: () => requestBuilder, resolvedPath: () => resolvedPath }); var init_protocols = __esm({ "node_modules/@smithy/core/dist-es/submodules/protocols/index.js"() { init_collect_stream_body(); init_extended_encode_uri_component(); init_HttpBindingProtocol(); init_HttpProtocol(); init_RpcProtocol(); init_requestBuilder(); init_resolve_path(); init_FromStringShapeDeserializer(); init_HttpInterceptingShapeDeserializer(); init_HttpInterceptingShapeSerializer(); init_ToStringShapeSerializer(); init_determineTimestampFormat(); init_SerdeContext(); } }); // node_modules/@smithy/core/dist-es/request-builder/requestBuilder.js var init_requestBuilder2 = __esm({ "node_modules/@smithy/core/dist-es/request-builder/requestBuilder.js"() { init_protocols(); } }); // node_modules/@smithy/core/dist-es/setFeature.js function setFeature(context, feature, value) { if (!context.__smithy_context) { context.__smithy_context = { features: {} }; } else if (!context.__smithy_context.features) { context.__smithy_context.features = {}; } context.__smithy_context.features[feature] = value; } var init_setFeature = __esm({ "node_modules/@smithy/core/dist-es/setFeature.js"() { } }); // node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js var DefaultIdentityProviderConfig; var init_DefaultIdentityProviderConfig = __esm({ "node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js"() { DefaultIdentityProviderConfig = class { authSchemes = /* @__PURE__ */ new Map(); constructor(config) { for (const key in config) { const value = config[key]; if (value !== void 0) { this.authSchemes.set(key, value); } } } getIdentityProvider(schemeId) { return this.authSchemes.get(schemeId); } }; } }); // node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js var import_protocol_http7, import_types2, HttpApiKeyAuthSigner; var init_httpApiKeyAuth = __esm({ "node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js"() { import_protocol_http7 = __toESM(require_dist_cjs2()); import_types2 = __toESM(require_dist_cjs()); HttpApiKeyAuthSigner = class { async sign(httpRequest, identity, signingProperties) { if (!signingProperties) { throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing"); } if (!signingProperties.name) { throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing"); } if (!signingProperties.in) { throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing"); } if (!identity.apiKey) { throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined"); } const clonedRequest = import_protocol_http7.HttpRequest.clone(httpRequest); if (signingProperties.in === import_types2.HttpApiKeyAuthLocation.QUERY) { clonedRequest.query[signingProperties.name] = identity.apiKey; } else if (signingProperties.in === import_types2.HttpApiKeyAuthLocation.HEADER) { clonedRequest.headers[signingProperties.name] = signingProperties.scheme ? `${signingProperties.scheme} ${identity.apiKey}` : identity.apiKey; } else { throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `" + signingProperties.in + "`"); } return clonedRequest; } }; } }); // node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js var import_protocol_http8, HttpBearerAuthSigner; var init_httpBearerAuth = __esm({ "node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js"() { import_protocol_http8 = __toESM(require_dist_cjs2()); HttpBearerAuthSigner = class { async sign(httpRequest, identity, signingProperties) { const clonedRequest = import_protocol_http8.HttpRequest.clone(httpRequest); if (!identity.token) { throw new Error("request could not be signed with `token` since the `token` is not defined"); } clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`; return clonedRequest; } }; } }); // node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js var NoAuthSigner; var init_noAuth = __esm({ "node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/noAuth.js"() { NoAuthSigner = class { async sign(httpRequest, identity, signingProperties) { return httpRequest; } }; } }); // node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js var init_httpAuthSchemes = __esm({ "node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js"() { init_httpApiKeyAuth(); init_httpBearerAuth(); init_noAuth(); } }); // 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/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js"() { createIsIdentityExpiredFunction = (expirationMs) => function isIdentityExpired2(identity) { return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs; }; EXPIRATION_MS = 3e5; isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS); doesIdentityRequireRefresh = (identity) => identity.expiration !== void 0; memoizeIdentityProvider = (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 = async (options) => { if (!pending) { pending = normalizedProvider(options); } try { resolved = await pending; hasResult = true; isConstant = false; } finally { pending = void 0; } return resolved; }; if (isExpired === void 0) { return async (options) => { if (!hasResult || options?.forceRefresh) { resolved = await coalesceProvider(options); } return resolved; }; } return async (options) => { if (!hasResult || options?.forceRefresh) { resolved = await coalesceProvider(options); } if (isConstant) { return resolved; } if (!requiresRefresh(resolved)) { isConstant = true; return resolved; } if (isExpired(resolved)) { await coalesceProvider(options); return resolved; } return resolved; }; }; } }); // node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js var init_util_identity_and_auth = __esm({ "node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js"() { init_DefaultIdentityProviderConfig(); init_httpAuthSchemes(); init_memoizeIdentityProvider(); } }); // node_modules/@smithy/core/dist-es/index.js var dist_es_exports = {}; __export(dist_es_exports, { DefaultIdentityProviderConfig: () => DefaultIdentityProviderConfig, EXPIRATION_MS: () => EXPIRATION_MS, HttpApiKeyAuthSigner: () => HttpApiKeyAuthSigner, HttpBearerAuthSigner: () => HttpBearerAuthSigner, NoAuthSigner: () => NoAuthSigner, createIsIdentityExpiredFunction: () => createIsIdentityExpiredFunction, createPaginator: () => createPaginator, doesIdentityRequireRefresh: () => doesIdentityRequireRefresh, getHttpAuthSchemeEndpointRuleSetPlugin: () => getHttpAuthSchemeEndpointRuleSetPlugin, getHttpAuthSchemePlugin: () => getHttpAuthSchemePlugin, getHttpSigningPlugin: () => getHttpSigningPlugin, getSmithyContext: () => getSmithyContext, httpAuthSchemeEndpointRuleSetMiddlewareOptions: () => httpAuthSchemeEndpointRuleSetMiddlewareOptions, httpAuthSchemeMiddleware: () => httpAuthSchemeMiddleware, httpAuthSchemeMiddlewareOptions: () => httpAuthSchemeMiddlewareOptions, httpSigningMiddleware: () => httpSigningMiddleware, httpSigningMiddlewareOptions: () => httpSigningMiddlewareOptions, isIdentityExpired: () => isIdentityExpired, memoizeIdentityProvider: () => memoizeIdentityProvider, normalizeProvider: () => normalizeProvider, requestBuilder: () => requestBuilder, setFeature: () => setFeature }); var init_dist_es = __esm({ "node_modules/@smithy/core/dist-es/index.js"() { init_getSmithyContext(); init_middleware_http_auth_scheme(); init_middleware_http_signing(); init_normalizeProvider(); init_createPaginator(); init_requestBuilder2(); init_setFeature(); init_util_identity_and_auth(); } }); // node_modules/@smithy/util-endpoints/dist-cjs/index.js var require_dist_cjs20 = __commonJS({ "node_modules/@smithy/util-endpoints/dist-cjs/index.js"(exports2) { "use strict"; var types3 = require_dist_cjs(); var BinaryDecisionDiagram5 = class _BinaryDecisionDiagram { nodes; root; conditions; results; constructor(bdd5, root5, conditions, results) { this.nodes = bdd5; this.root = root5; this.conditions = conditions; this.results = results; } static from(bdd5, root5, conditions, results) { return new _BinaryDecisionDiagram(bdd5, root5, conditions, results); } }; var EndpointCache5 = class { capacity; data = /* @__PURE__ */ new Map(); parameters = []; constructor({ size, params }) { 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 val = String(endpointParams[param] ?? ""); if (val.includes("|;")) { return false; } buffer += val + "|;"; } return buffer; } }; var EndpointError = class extends Error { constructor(message) { super(message); this.name = "EndpointError"; } }; var debugId = "endpoints"; 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 customEndpointFunctions5 = {}; var booleanEquals = (value1, value2) => value1 === value2; function coalesce(...args) { for (const arg of args) { if (arg != null) { return arg; } } return void 0; } var getAttrPathList = (path3) => { const parts = path3.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: '${path3}' 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: '${path3}'`); } if (squareBracketIndex !== 0) { pathList.push(part.slice(0, squareBracketIndex)); } pathList.push(arrayIndex); } else { pathList.push(part); } } return pathList; }; var getAttr = (value, path3) => getAttrPathList(path3).reduce((acc, index) => { if (typeof acc !== "object") { throw new EndpointError(`Index '${index}' in '${path3}' not found in '${JSON.stringify(value)}'`); } else if (Array.isArray(acc)) { const i5 = parseInt(index); return acc[i5 < 0 ? acc.length + i5 : i5]; } return acc[index]; }, value); var isSet = (value) => value != null; var VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`); var isValidHostLabel = (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; }; function ite(condition, trueValue, falseValue) { return condition ? trueValue : falseValue; } var not = (value) => !value; var 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}$`); var isIpAddress = (value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"); var DEFAULT_PORTS3 = { [types3.EndpointURLScheme.HTTP]: 80, [types3.EndpointURLScheme.HTTPS]: 443 }; var parseURL = (value) => { const whatwgURL = (() => { try { if (value instanceof URL) { return value; } if (typeof value === "object" && "hostname" in value) { const { hostname: hostname2, port, protocol: protocol2 = "", path: path3 = "", query = {} } = value; const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path3}`); url.search = Object.entries(query).map(([k5, v]) => `${k5}=${v}`).join("&"); return url; } return new URL(value); } catch (error3) { 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, pathname, protocol, search } = whatwgURL; if (search) { return null; } const scheme = protocol.slice(0, -1); if (!Object.values(types3.EndpointURLScheme).includes(scheme)) { return null; } const isIp = isIpAddress(hostname); const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS3[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS3[scheme]}`); const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS3[scheme]}` : ``}`; return { scheme, authority, path: pathname, normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`, isIp }; }; function split(value, delimiter, limit) { if (limit === 1) { return [value]; } if (value === "") { return [""]; } const parts = value.split(delimiter); if (limit === 0) { return parts; } return parts.slice(0, limit - 1).concat(parts.slice(1).join(delimiter)); } var stringEquals = (value1, value2) => value1 === value2; var substring = (input, start, stop, reverse) => { if (input == null || start >= stop || input.length < stop || /[^\u0000-\u007f]/.test(input)) { return null; } if (!reverse) { return input.substring(start, stop); } return input.substring(input.length - stop, input.length - start); }; var uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c5) => `%${c5.charCodeAt(0).toString(16).toUpperCase()}`); var endpointFunctions = { booleanEquals, coalesce, getAttr, isSet, isValidHostLabel, ite, not, parseURL, split, stringEquals, substring, uriEncode }; var evaluateTemplate = (template, options) => { const evaluatedTemplateArr = []; const { referenceRecord, endpointParams } = options; 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(referenceRecord[refName] ?? endpointParams[refName], attrName)); } else { evaluatedTemplateArr.push(referenceRecord[parameterName] ?? endpointParams[parameterName]); } currentIndex = closingBraceIndex + 1; } return evaluatedTemplateArr.join(""); }; var getReferenceValue = ({ ref }, options) => { return options.referenceRecord[ref] ?? options.endpointParams[ref]; }; var evaluateExpression = (obj, keyName, options) => { if (typeof obj === "string") { return evaluateTemplate(obj, options); } else if (obj["fn"]) { return group$2.callFunction(obj, options); } else if (obj["ref"]) { return getReferenceValue(obj, options); } throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`); }; var callFunction = ({ fn, argv }, options) => { const evaluatedArgs = Array(argv.length); for (let i5 = 0; i5 < evaluatedArgs.length; ++i5) { const arg = argv[i5]; if (typeof arg === "boolean" || typeof arg === "number") { evaluatedArgs[i5] = arg; } else { evaluatedArgs[i5] = group$2.evaluateExpression(arg, "arg", options); } } const namespaceSeparatorIndex = fn.indexOf("."); if (namespaceSeparatorIndex !== -1) { const namespaceFunctions = customEndpointFunctions5[fn.slice(0, namespaceSeparatorIndex)]; const customFunction = namespaceFunctions?.[fn.slice(namespaceSeparatorIndex + 1)]; if (typeof customFunction === "function") { return customFunction(...evaluatedArgs); } } const callable = endpointFunctions[fn]; if (typeof callable === "function") { return callable(...evaluatedArgs); } throw new Error(`function ${fn} not loaded in endpointFunctions.`); }; var group$2 = { evaluateExpression, callFunction }; var evaluateCondition = (condition, options) => { const { assign } = condition; if (assign && assign in options.referenceRecord) { throw new EndpointError(`'${assign}' is already defined in Reference Record.`); } const value = callFunction(condition, options); options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(condition)} = ${toDebugString(value)}`); const result = value === "" ? true : !!value; if (assign != null) { return { result, toAssign: { name: assign, value } }; } return { result }; }; var getEndpointHeaders = (headers, options) => Object.entries(headers ?? {}).reduce((acc, [headerKey, headerVal]) => { acc[headerKey] = headerVal.map((headerValEntry) => { const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options); if (typeof processedExpr !== "string") { throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`); } return processedExpr; }); return acc; }, {}); var getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => { acc[propertyKey] = group$1.getEndpointProperty(propertyVal, options); return acc; }, {}); var getEndpointProperty = (property, options) => { if (Array.isArray(property)) { return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options)); } switch (typeof property) { case "string": return evaluateTemplate(property, options); case "object": if (property === null) { throw new EndpointError(`Unexpected endpoint property: ${property}`); } return group$1.getEndpointProperties(property, options); case "boolean": return property; default: throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`); } }; var group$1 = { getEndpointProperty, getEndpointProperties }; var getEndpointUrl = (endpointUrl, options) => { const expression = evaluateExpression(endpointUrl, "Endpoint URL", options); if (typeof expression === "string") { try { return new URL(expression); } catch (error3) { console.error(`Failed to construct URL with ${expression}`, error3); throw error3; } } throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`); }; var RESULT = 1e8; var decideEndpoint5 = (bdd5, options) => { const { nodes: nodes5, root: root5, results, conditions } = bdd5; let ref = root5; const referenceRecord = {}; const closure = { referenceRecord, endpointParams: options.endpointParams, logger: options.logger }; while (ref !== 1 && ref !== -1 && ref < RESULT) { const node_i = 3 * (Math.abs(ref) - 1); const [condition_i, highRef, lowRef] = [nodes5[node_i], nodes5[node_i + 1], nodes5[node_i + 2]]; const [fn, argv, assign] = conditions[condition_i]; const evaluation = evaluateCondition({ fn, assign, argv }, closure); if (evaluation.toAssign) { const { name, value } = evaluation.toAssign; referenceRecord[name] = value; } ref = ref >= 0 === evaluation.result ? highRef : lowRef; } if (ref >= RESULT) { const result = results[ref - RESULT]; if (result[0] === -1) { const [, errorExpression] = result; throw new EndpointError(evaluateExpression(errorExpression, "Error", closure)); } const [url, properties, headers] = result; return { url: getEndpointUrl(url, closure), properties: getEndpointProperties(properties, closure), headers: getEndpointHeaders(headers ?? {}, closure) }; } throw new EndpointError(`No matching endpoint.`); }; var evaluateConditions = (conditions = [], options) => { const conditionsReferenceRecord = {}; const conditionOptions = { ...options, referenceRecord: { ...options.referenceRecord } }; let didAssign = false; for (const condition of conditions) { const { result, toAssign } = evaluateCondition(condition, conditionOptions); if (!result) { return { result }; } if (toAssign) { didAssign = true; conditionsReferenceRecord[toAssign.name] = toAssign.value; conditionOptions.referenceRecord[toAssign.name] = toAssign.value; options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`); } } if (didAssign) { return { result: true, referenceRecord: conditionsReferenceRecord }; } return { result: true }; }; var evaluateEndpointRule = (endpointRule, options) => { const { conditions, endpoint } = endpointRule; const { result, referenceRecord } = evaluateConditions(conditions, options); if (!result) { return; } const endpointRuleOptions = referenceRecord ? { ...options, referenceRecord: { ...options.referenceRecord, ...referenceRecord } } : options; const { url, properties, headers } = endpoint; options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`); const endpointToReturn = { url: getEndpointUrl(url, endpointRuleOptions) }; if (headers != null) { endpointToReturn.headers = getEndpointHeaders(headers, endpointRuleOptions); } if (properties != null) { endpointToReturn.properties = getEndpointProperties(properties, endpointRuleOptions); } return endpointToReturn; }; var evaluateErrorRule = (errorRule, options) => { const { conditions, error: error3 } = errorRule; const { result, referenceRecord } = evaluateConditions(conditions, options); if (!result) { return; } const errorRuleOptions = referenceRecord ? { ...options, referenceRecord: { ...options.referenceRecord, ...referenceRecord } } : options; throw new EndpointError(evaluateExpression(error3, "Error", errorRuleOptions)); }; var evaluateRules = (rules, options) => { for (const rule of rules) { if (rule.type === "endpoint") { const endpointOrUndefined = evaluateEndpointRule(rule, options); if (endpointOrUndefined) { return endpointOrUndefined; } } else if (rule.type === "error") { evaluateErrorRule(rule, options); } else if (rule.type === "tree") { const endpointOrUndefined = group.evaluateTreeRule(rule, options); if (endpointOrUndefined) { return endpointOrUndefined; } } else { throw new EndpointError(`Unknown endpoint rule: ${rule}`); } } throw new EndpointError(`Rules evaluation failed`); }; var evaluateTreeRule = (treeRule, options) => { const { conditions, rules } = treeRule; const { result, referenceRecord } = evaluateConditions(conditions, options); if (!result) { return; } const treeRuleOptions = referenceRecord ? { ...options, referenceRecord: { ...options.referenceRecord, ...referenceRecord } } : options; return group.evaluateRules(rules, treeRuleOptions); }; var group = { evaluateRules, evaluateTreeRule }; var resolveEndpoint = (ruleSetObject, options) => { const { endpointParams, logger: logger2 } = options; const { parameters, rules } = ruleSetObject; options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`); for (const paramKey in parameters) { const parameter = parameters[paramKey]; const endpointParam = endpointParams[paramKey]; if (endpointParam == null && parameter.default != null) { endpointParams[paramKey] = parameter.default; continue; } if (parameter.required && endpointParam == null) { throw new EndpointError(`Missing required parameter: '${paramKey}'`); } } const endpoint = evaluateRules(rules, { endpointParams, logger: logger2, referenceRecord: {} }); options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`); return endpoint; }; exports2.BinaryDecisionDiagram = BinaryDecisionDiagram5; exports2.EndpointCache = EndpointCache5; exports2.EndpointError = EndpointError; exports2.customEndpointFunctions = customEndpointFunctions5; exports2.decideEndpoint = decideEndpoint5; exports2.isIpAddress = isIpAddress; exports2.isValidHostLabel = isValidHostLabel; exports2.resolveEndpoint = resolveEndpoint; } }); // node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js var require_dist_cjs21 = __commonJS({ "node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js"(exports2) { "use strict"; var utilEndpoints = require_dist_cjs20(); var urlParser = require_dist_cjs18(); var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => { if (allowSubDomains) { for (const label of value.split(".")) { if (!isVirtualHostableS3Bucket(label)) { return false; } } return true; } if (!utilEndpoints.isValidHostLabel(value)) { return false; } if (value.length < 3 || value.length > 63) { return false; } if (value !== value.toLowerCase()) { return false; } if (utilEndpoints.isIpAddress(value)) { return false; } return true; }; var ARN_DELIMITER = ":"; var RESOURCE_DELIMITER = "/"; var parseArn = (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 }; }; var 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-east-2": { description: "Asia Pacific (Taipei)" }, "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)" }, "ap-southeast-6": { description: "Asia Pacific (New Zealand)" }, "ap-southeast-7": { description: "Asia Pacific (Thailand)" }, "aws-global": { description: "aws 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)" }, "mx-central-1": { description: "Mexico (Central)" }, "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-cn global region" }, "cn-north-1": { description: "China (Beijing)" }, "cn-northwest-1": { description: "China (Ningxia)" } } }, { id: "aws-eusc", outputs: { dnsSuffix: "amazonaws.eu", dualStackDnsSuffix: "api.amazonwebservices.eu", implicitGlobalRegion: "eusc-de-east-1", name: "aws-eusc", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", regions: { "eusc-de-east-1": { description: "AWS European Sovereign Cloud (Germany)" } } }, { id: "aws-iso", outputs: { dnsSuffix: "c2s.ic.gov", dualStackDnsSuffix: "api.aws.ic.gov", implicitGlobalRegion: "us-iso-east-1", name: "aws-iso", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^us\\-iso\\-\\w+\\-\\d+$", regions: { "aws-iso-global": { description: "aws-iso 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: "api.aws.scloud", implicitGlobalRegion: "us-isob-east-1", name: "aws-iso-b", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^us\\-isob\\-\\w+\\-\\d+$", regions: { "aws-iso-b-global": { description: "aws-iso-b global region" }, "us-isob-east-1": { description: "US ISOB East (Ohio)" }, "us-isob-west-1": { description: "US ISOB West" } } }, { id: "aws-iso-e", outputs: { dnsSuffix: "cloud.adc-e.uk", dualStackDnsSuffix: "api.cloud-aws.adc-e.uk", implicitGlobalRegion: "eu-isoe-west-1", name: "aws-iso-e", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", regions: { "aws-iso-e-global": { description: "aws-iso-e global region" }, "eu-isoe-west-1": { description: "EU ISOE West" } } }, { id: "aws-iso-f", outputs: { dnsSuffix: "csp.hci.ic.gov", dualStackDnsSuffix: "api.aws.hci.ic.gov", implicitGlobalRegion: "us-isof-south-1", name: "aws-iso-f", supportsDualStack: true, supportsFIPS: true }, regionRegex: "^us\\-isof\\-\\w+\\-\\d+$", regions: { "aws-iso-f-global": { description: "aws-iso-f global region" }, "us-isof-east-1": { description: "US ISOF EAST" }, "us-isof-south-1": { description: "US ISOF SOUTH" } } }, { 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-us-gov global region" }, "us-gov-east-1": { description: "AWS GovCloud (US-East)" }, "us-gov-west-1": { description: "AWS GovCloud (US-West)" } } } ]; var version = "1.1"; var partitionsInfo = { partitions, version }; var selectedPartitionsInfo = partitionsInfo; var selectedUserAgentPrefix = ""; var partition = (value) => { const { partitions: partitions2 } = selectedPartitionsInfo; for (const partition2 of partitions2) { const { regions, outputs } = partition2; for (const [region, regionData] of Object.entries(regions)) { if (region === value) { return { ...outputs, ...regionData }; } } } for (const partition2 of partitions2) { const { regionRegex, outputs } = partition2; if (new RegExp(regionRegex).test(value)) { return { ...outputs }; } } const DEFAULT_PARTITION = partitions2.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 }; }; var setPartitionInfo = (partitionsInfo2, userAgentPrefix = "") => { selectedPartitionsInfo = partitionsInfo2; selectedUserAgentPrefix = userAgentPrefix; }; var useDefaultPartitionInfo = () => { setPartitionInfo(partitionsInfo, ""); }; var getUserAgentPrefix = () => selectedUserAgentPrefix; var awsEndpointFunctions5 = { isVirtualHostableS3Bucket, parseArn, partition }; utilEndpoints.customEndpointFunctions.aws = awsEndpointFunctions5; var resolveDefaultAwsRegionalEndpointsConfig = (input) => { if (typeof input.endpointProvider !== "function") { throw new Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client."); } const { endpoint } = input; if (endpoint === void 0) { input.endpoint = async () => { return toEndpointV12(input.endpointProvider({ Region: typeof input.region === "function" ? await input.region() : input.region, UseDualStack: typeof input.useDualstackEndpoint === "function" ? await input.useDualstackEndpoint() : input.useDualstackEndpoint, UseFIPS: typeof input.useFipsEndpoint === "function" ? await input.useFipsEndpoint() : input.useFipsEndpoint, Endpoint: void 0 }, { logger: input.logger })); }; } return input; }; var toEndpointV12 = (endpoint) => urlParser.parseUrl(endpoint.url); exports2.EndpointError = utilEndpoints.EndpointError; exports2.isIpAddress = utilEndpoints.isIpAddress; exports2.resolveEndpoint = utilEndpoints.resolveEndpoint; exports2.awsEndpointFunctions = awsEndpointFunctions5; exports2.getUserAgentPrefix = getUserAgentPrefix; exports2.partition = partition; exports2.resolveDefaultAwsRegionalEndpointsConfig = resolveDefaultAwsRegionalEndpointsConfig; exports2.setPartitionInfo = setPartitionInfo; exports2.toEndpointV1 = toEndpointV12; exports2.useDefaultPartitionInfo = useDefaultPartitionInfo; } }); // node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js var state, emitWarningIfUnsupportedVersion; var init_emitWarningIfUnsupportedVersion = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js"() { state = { warningEmitted: false }; emitWarningIfUnsupportedVersion = (version) => { if (version && !state.warningEmitted) { if (process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED === "true") { state.warningEmitted = true; return; } const userMajorVersion = parseInt(version.substring(1, version.indexOf("."))); const vv = 22; if (userMajorVersion < vv) { state.warningEmitted = true; process.emitWarning(`NodeVersionSupportWarning: The AWS SDK for JavaScript (v3) versions published after the first week of January 2027 will require node >=${vv}. You are running node ${version}. To continue receiving updates to AWS services, bug fixes, and security updates please upgrade to node >=${vv}. More information can be found at: https://a.co/c895JFp`); } } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/client/longPollMiddleware.js var longPollMiddleware, longPollMiddlewareOptions, getLongPollPlugin; var init_longPollMiddleware = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/client/longPollMiddleware.js"() { longPollMiddleware = () => (next, context) => async (args) => { context.__retryLongPoll = true; return next(args); }; longPollMiddlewareOptions = { name: "longPollMiddleware", tags: ["RETRY"], step: "initialize", override: true }; getLongPollPlugin = (options) => ({ applyToStack: (clientStack) => { clientStack.add(longPollMiddleware(), longPollMiddlewareOptions); } }); } }); // 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/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js"() { } }); // node_modules/@smithy/service-error-classification/dist-cjs/index.js var require_dist_cjs22 = __commonJS({ "node_modules/@smithy/service-error-classification/dist-cjs/index.js"(exports2) { "use strict"; var CLOCK_SKEW_ERROR_CODES = [ "AuthFailure", "InvalidSignatureException", "RequestExpired", "RequestInTheFuture", "RequestTimeTooSkewed", "SignatureDoesNotMatch" ]; var THROTTLING_ERROR_CODES = [ "BandwidthLimitExceeded", "EC2ThrottledException", "LimitExceededException", "PriorRequestNotComplete", "ProvisionedThroughputExceededException", "RequestLimitExceeded", "RequestThrottled", "RequestThrottledException", "SlowDown", "ThrottledException", "Throttling", "ThrottlingException", "TooManyRequestsException", "TransactionInProgressException" ]; var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"]; var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504]; var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"]; var NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"]; var isRetryableByTrait = (error3) => error3?.$retryable !== void 0; var isClockSkewError = (error3) => CLOCK_SKEW_ERROR_CODES.includes(error3.name); var isClockSkewCorrectedError = (error3) => error3.$metadata?.clockSkewCorrected; var isBrowserNetworkError = (error3) => { const errorMessages = /* @__PURE__ */ new Set([ "Failed to fetch", "NetworkError when attempting to fetch resource", "The Internet connection appears to be offline", "Load failed", "Network request failed" ]); const isValid = error3 && error3 instanceof TypeError; if (!isValid) { return false; } return errorMessages.has(error3.message); }; var isThrottlingError = (error3) => error3.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error3.name) || error3.$retryable?.throttling == true; var isTransientError = (error3, depth = 0) => isRetryableByTrait(error3) || isClockSkewCorrectedError(error3) || error3.name === "InvalidSignatureException" && error3.message?.includes("Signature expired") || TRANSIENT_ERROR_CODES.includes(error3.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error3?.code || "") || NODEJS_NETWORK_ERROR_CODES.includes(error3?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error3.$metadata?.httpStatusCode || 0) || isBrowserNetworkError(error3) || isNodeJsHttp2TransientError(error3) || error3.cause !== void 0 && depth <= 10 && isTransientError(error3.cause, depth + 1); var isServerError = (error3) => { if (error3.$metadata?.httpStatusCode !== void 0) { const statusCode = error3.$metadata.httpStatusCode; if (500 <= statusCode && statusCode <= 599 && !isTransientError(error3)) { return true; } return false; } return false; }; function isNodeJsHttp2TransientError(error3) { return error3.code === "ERR_HTTP2_STREAM_ERROR" && error3.message.includes("NGHTTP2_REFUSED_STREAM"); } exports2.isBrowserNetworkError = isBrowserNetworkError; exports2.isClockSkewCorrectedError = isClockSkewCorrectedError; exports2.isClockSkewError = isClockSkewError; exports2.isNodeJsHttp2TransientError = isNodeJsHttp2TransientError; exports2.isRetryableByTrait = isRetryableByTrait; exports2.isServerError = isServerError; exports2.isThrottlingError = isThrottlingError; exports2.isTransientError = isTransientError; } }); // node_modules/@smithy/util-retry/dist-cjs/index.js var require_dist_cjs23 = __commonJS({ "node_modules/@smithy/util-retry/dist-cjs/index.js"(exports2) { "use strict"; var serviceErrorClassification = require_dist_cjs22(); exports2.RETRY_MODES = void 0; (function(RETRY_MODES) { RETRY_MODES["STANDARD"] = "standard"; RETRY_MODES["ADAPTIVE"] = "adaptive"; })(exports2.RETRY_MODES || (exports2.RETRY_MODES = {})); var DEFAULT_MAX_ATTEMPTS = 3; var DEFAULT_RETRY_MODE5 = exports2.RETRY_MODES.STANDARD; var DefaultRateLimiter = class _DefaultRateLimiter { static setTimeoutFn = setTimeout; beta; minCapacity; minFillRate; scaleConstant; smooth; enabled = false; availableTokens = 0; lastMaxRate = 0; measuredTxRate = 0; requestCount = 0; fillRate; lastThrottleTime; lastTimestamp = 0; lastTxRateBucket; maxCapacity; timeWindow = 0; constructor(options) { this.beta = options?.beta ?? 0.7; this.minCapacity = options?.minCapacity ?? 1; this.minFillRate = options?.minFillRate ?? 0.5; this.scaleConstant = options?.scaleConstant ?? 0.4; this.smooth = options?.smooth ?? 0.8; this.lastThrottleTime = this.getCurrentTimeInSeconds(); this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds()); this.fillRate = this.minFillRate; this.maxCapacity = this.minCapacity; } async getSendToken() { return this.acquireTokenBucket(1); } updateClientSendingRate(response) { let calculatedRate; this.updateMeasuredRate(); const retryErrorInfo = response; const isThrottling = retryErrorInfo?.errorType === "THROTTLING" || serviceErrorClassification.isThrottlingError(retryErrorInfo?.error ?? response); if (isThrottling) { 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); } getCurrentTimeInSeconds() { return Date.now() / 1e3; } async acquireTokenBucket(amount) { if (!this.enabled) { return; } this.refillTokenBucket(); while (amount > this.availableTokens) { const delay = (amount - this.availableTokens) / this.fillRate * 1e3; await new Promise((resolve) => _DefaultRateLimiter.setTimeoutFn(resolve, delay)); this.refillTokenBucket(); } this.availableTokens = this.availableTokens - amount; } refillTokenBucket() { const timestamp = this.getCurrentTimeInSeconds(); if (!this.lastTimestamp) { this.lastTimestamp = timestamp; return; } const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate; this.availableTokens = Math.min(this.maxCapacity, this.availableTokens + fillAmount); this.lastTimestamp = timestamp; } 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.availableTokens = Math.min(this.availableTokens, this.maxCapacity); } updateMeasuredRate() { const t = this.getCurrentTimeInSeconds(); const timeBucket = Math.floor(t * 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)); } }; var DEFAULT_RETRY_DELAY_BASE = 100; var MAXIMUM_RETRY_DELAY = 20 * 1e3; var THROTTLING_RETRY_DELAY_BASE = 500; var INITIAL_RETRY_TOKENS = 500; var RETRY_COST = 5; var TIMEOUT_RETRY_COST = 10; var NO_RETRY_INCREMENT = 1; var INVOCATION_ID_HEADER = "amz-sdk-invocation-id"; var REQUEST_HEADER = "amz-sdk-request"; var Retry2 = class _Retry { static v2026 = typeof process !== "undefined" && process.env?.SMITHY_NEW_RETRIES_2026 === "true"; static delay() { return _Retry.v2026 ? 50 : 100; } static throttlingDelay() { return _Retry.v2026 ? 1e3 : 500; } static cost() { return _Retry.v2026 ? 14 : 5; } static throttlingCost() { return _Retry.v2026 ? 5 : 10; } static modifiedCostType() { return _Retry.v2026 ? "THROTTLING" : "TRANSIENT"; } }; var DefaultRetryBackoffStrategy = class { x = Retry2.delay(); computeNextBackoffDelay(i5) { const b6 = Math.random(); const r5 = 2; const t_i = b6 * Math.min(this.x * r5 ** i5, MAXIMUM_RETRY_DELAY); return Math.floor(t_i); } setDelayBase(delay) { this.x = delay; } }; var DefaultRetryToken = class { delay; count; cost; longPoll; constructor(delay, count, cost, longPoll) { this.delay = delay; this.count = count; this.cost = cost; this.longPoll = longPoll; } getRetryCount() { return this.count; } getRetryDelay() { return Math.min(MAXIMUM_RETRY_DELAY, this.delay); } getRetryCost() { return this.cost; } isLongPoll() { return this.longPoll; } }; var refusal = { incompatible: 1, attempts: 2, capacity: 3 }; var StandardRetryStrategy = class { mode = exports2.RETRY_MODES.STANDARD; capacity = INITIAL_RETRY_TOKENS; retryBackoffStrategy; maxAttemptsProvider; baseDelay; constructor(arg1) { if (typeof arg1 === "number") { this.maxAttemptsProvider = async () => arg1; } else if (typeof arg1 === "function") { this.maxAttemptsProvider = arg1; } else if (arg1 && typeof arg1 === "object") { this.maxAttemptsProvider = async () => arg1.maxAttempts; this.baseDelay = arg1.baseDelay; this.retryBackoffStrategy = arg1.backoff; } this.maxAttemptsProvider ??= async () => DEFAULT_MAX_ATTEMPTS; this.baseDelay ??= Retry2.delay(); this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy(); } async acquireInitialRetryToken(retryTokenScope) { return new DefaultRetryToken(Retry2.delay(), 0, void 0, Retry2.v2026 && retryTokenScope.includes(":longpoll")); } async refreshRetryTokenForRetry(token, errorInfo) { const maxAttempts = await this.getMaxAttempts(); const retryCode = this.retryCode(token, errorInfo, maxAttempts); const shouldRetry = retryCode === 0; const isLongPoll = token.isLongPoll?.(); if (shouldRetry || isLongPoll) { const errorType = errorInfo.errorType; this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? Retry2.throttlingDelay() : this.baseDelay); const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount()); let retryDelay = delayFromErrorType; if (errorInfo.retryAfterHint instanceof Date) { retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5e3)); } if (!shouldRetry) { throw Object.assign(new Error("No retry token available"), { $backoff: Retry2.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0 }); } else { const capacityCost = this.getCapacityCost(errorType); this.capacity -= capacityCost; return new DefaultRetryToken(retryDelay, token.getRetryCount() + 1, capacityCost, token.isLongPoll?.() ?? false); } } throw new Error("No retry token available"); } recordSuccess(token) { this.capacity = Math.min(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT)); } getCapacity() { return this.capacity; } async maxAttempts() { return this.maxAttemptsProvider(); } async getMaxAttempts() { try { return await this.maxAttemptsProvider(); } catch (error3) { console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`); return DEFAULT_MAX_ATTEMPTS; } } retryCode(tokenToRenew, errorInfo, maxAttempts) { const attempts = tokenToRenew.getRetryCount() + 1; const retryableStatus = this.isRetryableError(errorInfo.errorType) ? 0 : refusal.incompatible; const attemptStatus = attempts < maxAttempts ? 0 : refusal.attempts; const capacityStatus = this.capacity >= this.getCapacityCost(errorInfo.errorType) ? 0 : refusal.capacity; return retryableStatus || attemptStatus || capacityStatus; } getCapacityCost(errorType) { return errorType === Retry2.modifiedCostType() ? Retry2.throttlingCost() : Retry2.cost(); } isRetryableError(errorType) { return errorType === "THROTTLING" || errorType === "TRANSIENT"; } }; var AdaptiveRetryStrategy = class { mode = exports2.RETRY_MODES.ADAPTIVE; rateLimiter; standardRetryStrategy; constructor(maxAttemptsProvider, options) { const { rateLimiter } = options ?? {}; this.rateLimiter = rateLimiter ?? new DefaultRateLimiter(); this.standardRetryStrategy = options ? new StandardRetryStrategy({ maxAttempts: typeof maxAttemptsProvider === "number" ? maxAttemptsProvider : 3, ...options }) : new StandardRetryStrategy(maxAttemptsProvider); } async acquireInitialRetryToken(retryTokenScope) { const token = await this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope); await this.rateLimiter.getSendToken(); return token; } async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { this.rateLimiter.updateClientSendingRate(errorInfo); const token = await this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo); await this.rateLimiter.getSendToken(); return token; } recordSuccess(token) { this.rateLimiter.updateClientSendingRate({}); this.standardRetryStrategy.recordSuccess(token); } async maxAttemptsProvider() { return this.standardRetryStrategy.maxAttempts(); } }; var ConfiguredRetryStrategy = class extends StandardRetryStrategy { computeNextBackoffDelay; constructor(maxAttempts, computeNextBackoffDelay = Retry2.delay()) { super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts); if (typeof computeNextBackoffDelay === "number") { this.computeNextBackoffDelay = () => computeNextBackoffDelay; } else { this.computeNextBackoffDelay = computeNextBackoffDelay; } } async refreshRetryTokenForRetry(tokenToRenew, errorInfo) { const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo); token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount()); return token; } }; exports2.AdaptiveRetryStrategy = AdaptiveRetryStrategy; exports2.ConfiguredRetryStrategy = ConfiguredRetryStrategy; exports2.DEFAULT_MAX_ATTEMPTS = DEFAULT_MAX_ATTEMPTS; exports2.DEFAULT_RETRY_DELAY_BASE = DEFAULT_RETRY_DELAY_BASE; exports2.DEFAULT_RETRY_MODE = DEFAULT_RETRY_MODE5; exports2.DefaultRateLimiter = DefaultRateLimiter; exports2.INITIAL_RETRY_TOKENS = INITIAL_RETRY_TOKENS; exports2.INVOCATION_ID_HEADER = INVOCATION_ID_HEADER; exports2.MAXIMUM_RETRY_DELAY = MAXIMUM_RETRY_DELAY; exports2.NO_RETRY_INCREMENT = NO_RETRY_INCREMENT; exports2.REQUEST_HEADER = REQUEST_HEADER; exports2.RETRY_COST = RETRY_COST; exports2.Retry = Retry2; exports2.StandardRetryStrategy = StandardRetryStrategy; exports2.THROTTLING_RETRY_DELAY_BASE = THROTTLING_RETRY_DELAY_BASE; exports2.TIMEOUT_RETRY_COST = TIMEOUT_RETRY_COST; } }); // node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js function setFeature2(context, feature, value) { if (!context.__aws_sdk_context) { context.__aws_sdk_context = { features: {} }; } else if (!context.__aws_sdk_context.features) { context.__aws_sdk_context.features = {}; } context.__aws_sdk_context.features[feature] = value; } var import_util_retry; var init_setFeature2 = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js"() { import_util_retry = __toESM(require_dist_cjs23()); import_util_retry.Retry.v2026 ||= typeof process === "object" && process.env?.AWS_NEW_RETRIES_2026 === "true"; } }); // node_modules/@aws-sdk/core/dist-es/submodules/client/setTokenFeature.js function setTokenFeature(token, feature, value) { if (!token.$source) { token.$source = {}; } token.$source[feature] = value; return token; } var init_setTokenFeature = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/client/setTokenFeature.js"() { } }); // node_modules/@aws-sdk/core/dist-es/submodules/client/index.js var client_exports = {}; __export(client_exports, { emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion, getLongPollPlugin: () => getLongPollPlugin, setCredentialFeature: () => setCredentialFeature, setFeature: () => setFeature2, setTokenFeature: () => setTokenFeature, state: () => state }); var init_client = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/client/index.js"() { init_emitWarningIfUnsupportedVersion(); init_longPollMiddleware(); init_setCredentialFeature(); init_setFeature2(); init_setTokenFeature(); } }); // node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js var require_dist_cjs24 = __commonJS({ "node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js"(exports2) { "use strict"; var core = (init_dist_es(), __toCommonJS(dist_es_exports)); var utilEndpoints = require_dist_cjs21(); var protocolHttp = require_dist_cjs2(); var client = (init_client(), __toCommonJS(client_exports)); var utilRetry = require_dist_cjs23(); var DEFAULT_UA_APP_ID = void 0; function isValidUserAgentAppId(appId) { if (appId === void 0) { return true; } return typeof appId === "string" && appId.length <= 50; } function resolveUserAgentConfig5(input) { const normalizedAppIdProvider = core.normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID); const { customUserAgent } = input; return Object.assign(input, { customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent, userAgentAppId: async () => { const appId = await normalizedAppIdProvider(); if (!isValidUserAgentAppId(appId)) { const logger2 = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger; if (typeof appId !== "string") { logger2?.warn("userAgentAppId must be a string or undefined."); } else if (appId.length > 50) { logger2?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters."); } } return appId; } }); } var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/; async function checkFeatures(context, config, args) { const request = args.request; if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") { client.setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M"); } if (typeof config.retryStrategy === "function") { const retryStrategy = await config.retryStrategy(); if (typeof retryStrategy.mode === "string") { switch (retryStrategy.mode) { case utilRetry.RETRY_MODES.ADAPTIVE: client.setFeature(context, "RETRY_MODE_ADAPTIVE", "F"); break; case utilRetry.RETRY_MODES.STANDARD: client.setFeature(context, "RETRY_MODE_STANDARD", "E"); break; } } } if (typeof config.accountIdEndpointMode === "function") { const endpointV2 = context.endpointV2; if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) { client.setFeature(context, "ACCOUNT_ID_ENDPOINT", "O"); } switch (await config.accountIdEndpointMode?.()) { case "disabled": client.setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q"); break; case "preferred": client.setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P"); break; case "required": client.setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R"); break; } } const identity = context.__smithy_context?.selectedHttpAuthScheme?.identity; if (identity?.$source) { const credentials = identity; if (credentials.accountId) { client.setFeature(context, "RESOLVED_ACCOUNT_ID", "T"); } for (const [key, value] of Object.entries(credentials.$source ?? {})) { client.setFeature(context, key, value); } } } var USER_AGENT2 = "user-agent"; var X_AMZ_USER_AGENT = "x-amz-user-agent"; var SPACE = " "; var UA_NAME_SEPARATOR = "/"; var UA_NAME_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w]/g; var UA_VALUE_ESCAPE_REGEX = /[^!$%&'*+\-.^_`|~\w#]/g; var UA_ESCAPE_CHAR = "-"; var BYTE_LIMIT = 1024; function encodeFeatures(features) { let buffer = ""; for (const key in features) { const val = features[key]; if (buffer.length + val.length + 1 <= BYTE_LIMIT) { if (buffer.length) { buffer += "," + val; } else { buffer += val; } continue; } break; } return buffer; } var userAgentMiddleware = (options) => (next, context) => async (args) => { const { request } = args; if (!protocolHttp.HttpRequest.isInstance(request)) { return next(args); } const { headers } = request; const userAgent = context?.userAgent?.map(escapeUserAgent) || []; const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent); await checkFeatures(context, options, args); const awsContext = context; defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`); const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || []; const appId = await options.userAgentAppId(); if (appId) { defaultUserAgent.push(escapeUserAgent([`app`, `${appId}`])); } const prefix = utilEndpoints.getUserAgentPrefix(); const sdkUserAgentValue = (prefix ? [prefix] : []).concat([...defaultUserAgent, ...userAgent, ...customUserAgent]).join(SPACE); const normalUAValue = [ ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")), ...customUserAgent ].join(SPACE); if (options.runtime !== "browser") { if (normalUAValue) { headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT2]} ${normalUAValue}` : normalUAValue; } headers[USER_AGENT2] = sdkUserAgentValue; } else { headers[X_AMZ_USER_AGENT] = sdkUserAgentValue; } return next({ ...args, request }); }; var escapeUserAgent = (userAgentPair) => { const name = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR); const version = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR); const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR); const prefix = name.substring(0, prefixSeparatorIndex); let uaName = name.substring(prefixSeparatorIndex + 1); if (prefix === "api") { uaName = uaName.toLowerCase(); } return [prefix, uaName, version].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}`; } }, ""); }; var getUserAgentMiddlewareOptions = { name: "getUserAgentMiddleware", step: "build", priority: "low", tags: ["SET_USER_AGENT", "USER_AGENT"], override: true }; var getUserAgentPlugin5 = (config) => ({ applyToStack: (clientStack) => { clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions); } }); exports2.DEFAULT_UA_APP_ID = DEFAULT_UA_APP_ID; exports2.getUserAgentMiddlewareOptions = getUserAgentMiddlewareOptions; exports2.getUserAgentPlugin = getUserAgentPlugin5; exports2.resolveUserAgentConfig = resolveUserAgentConfig5; exports2.userAgentMiddleware = userAgentMiddleware; } }); // node_modules/@smithy/util-config-provider/dist-cjs/index.js var require_dist_cjs25 = __commonJS({ "node_modules/@smithy/util-config-provider/dist-cjs/index.js"(exports2) { "use strict"; var booleanSelector = (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]}.`); }; var numberSelector = (obj, key, type) => { if (!(key in obj)) return void 0; const numberValue = parseInt(obj[key], 10); if (Number.isNaN(numberValue)) { throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`); } return numberValue; }; exports2.SelectorType = void 0; (function(SelectorType) { SelectorType["ENV"] = "env"; SelectorType["CONFIG"] = "shared config entry"; })(exports2.SelectorType || (exports2.SelectorType = {})); exports2.booleanSelector = booleanSelector; exports2.numberSelector = numberSelector; } }); // node_modules/@smithy/config-resolver/dist-cjs/index.js var require_dist_cjs26 = __commonJS({ "node_modules/@smithy/config-resolver/dist-cjs/index.js"(exports2) { "use strict"; var utilConfigProvider = require_dist_cjs25(); var utilMiddleware = require_dist_cjs6(); var utilEndpoints = require_dist_cjs20(); var ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT"; var CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint"; var DEFAULT_USE_DUALSTACK_ENDPOINT = false; var NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS5 = { environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.ENV), configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.CONFIG), default: false }; var nodeDualstackConfigSelectors = { environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.ENV), configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, utilConfigProvider.SelectorType.CONFIG), default: void 0 }; var ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT"; var CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint"; var DEFAULT_USE_FIPS_ENDPOINT = false; var NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS5 = { environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, ENV_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.ENV), configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.CONFIG), default: false }; var nodeFipsConfigSelectors = { environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, ENV_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.ENV), configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, utilConfigProvider.SelectorType.CONFIG), default: void 0 }; var resolveCustomEndpointsConfig = (input) => { const { tls: tls8, endpoint, urlParser, useDualstackEndpoint } = input; return Object.assign(input, { tls: tls8 ?? true, endpoint: utilMiddleware.normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint), isCustomEndpoint: true, useDualstackEndpoint: utilMiddleware.normalizeProvider(useDualstackEndpoint ?? false) }); }; var getEndpointFromRegion = async (input) => { const { tls: tls8 = true } = input; const region = await input.region(); const dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/); if (!dnsHostRegex.test(region)) { throw new Error("Invalid region in client config"); } const useDualstackEndpoint = await input.useDualstackEndpoint(); const useFipsEndpoint = await input.useFipsEndpoint(); const { hostname } = await input.regionInfoProvider(region, { useDualstackEndpoint, useFipsEndpoint }) ?? {}; if (!hostname) { throw new Error("Cannot resolve hostname from client config"); } return input.urlParser(`${tls8 ? "https:" : "http:"}//${hostname}`); }; var resolveEndpointsConfig = (input) => { const useDualstackEndpoint = utilMiddleware.normalizeProvider(input.useDualstackEndpoint ?? false); const { endpoint, useFipsEndpoint, urlParser, tls: tls8 } = input; return Object.assign(input, { tls: tls8 ?? true, endpoint: endpoint ? utilMiddleware.normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint) : () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }), isCustomEndpoint: !!endpoint, useDualstackEndpoint }); }; var REGION_ENV_NAME = "AWS_REGION"; var REGION_INI_NAME = "region"; var NODE_REGION_CONFIG_OPTIONS5 = { environmentVariableSelector: (env) => env[REGION_ENV_NAME], configFileSelector: (profile) => profile[REGION_INI_NAME], default: () => { throw new Error("Region is missing"); } }; var NODE_REGION_CONFIG_FILE_OPTIONS5 = { preferredFile: "credentials" }; var validRegions = /* @__PURE__ */ new Set(); var checkRegion = (region, check = utilEndpoints.isValidHostLabel) => { if (!validRegions.has(region) && !check(region)) { if (region === "*") { console.warn(`@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`); } else { throw new Error(`Region not accepted: region="${region}" is not a valid hostname component.`); } } else { validRegions.add(region); } }; var isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")); var getRealRegion = (region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region; var resolveRegionConfig5 = (input) => { const { region, useFipsEndpoint } = input; if (!region) { throw new Error("Region is missing"); } return Object.assign(input, { region: async () => { const providedRegion = typeof region === "function" ? await region() : region; const realRegion = getRealRegion(providedRegion); checkRegion(realRegion); return realRegion; }, useFipsEndpoint: async () => { const providedRegion = typeof region === "string" ? region : await region(); if (isFipsRegion(providedRegion)) { return true; } return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint(); } }); }; var getHostnameFromVariants = (variants = [], { useFipsEndpoint, useDualstackEndpoint }) => variants.find(({ tags }) => useFipsEndpoint === tags.includes("fips") && useDualstackEndpoint === tags.includes("dualstack"))?.hostname; var getResolvedHostname = (resolvedRegion, { regionHostname, partitionHostname }) => regionHostname ? regionHostname : partitionHostname ? partitionHostname.replace("{region}", resolvedRegion) : void 0; var getResolvedPartition = (region, { partitionHash }) => Object.keys(partitionHash || {}).find((key) => partitionHash[key].regions.includes(region)) ?? "aws"; var getResolvedSigningRegion = (hostname, { signingRegion, regionRegex, useFipsEndpoint }) => { if (signingRegion) { return signingRegion; } else if (useFipsEndpoint) { const regionRegexJs = regionRegex.replace("\\\\", "\\").replace(/^\^/g, "\\.").replace(/\$$/g, "\\."); const regionRegexmatchArray = hostname.match(regionRegexJs); if (regionRegexmatchArray) { return regionRegexmatchArray[0].slice(1, -1); } } }; var getRegionInfo = (region, { useFipsEndpoint = false, useDualstackEndpoint = false, signingService, regionHash, partitionHash }) => { const partition = getResolvedPartition(region, { partitionHash }); const resolvedRegion = region in regionHash ? region : partitionHash[partition]?.endpoint ?? region; const hostnameOptions = { useFipsEndpoint, useDualstackEndpoint }; const regionHostname = getHostnameFromVariants(regionHash[resolvedRegion]?.variants, hostnameOptions); const partitionHostname = getHostnameFromVariants(partitionHash[partition]?.variants, hostnameOptions); const hostname = getResolvedHostname(resolvedRegion, { regionHostname, partitionHostname }); if (hostname === void 0) { throw new Error(`Endpoint resolution failed for: ${{ resolvedRegion, useFipsEndpoint, useDualstackEndpoint }}`); } const signingRegion = getResolvedSigningRegion(hostname, { signingRegion: regionHash[resolvedRegion]?.signingRegion, regionRegex: partitionHash[partition].regionRegex, useFipsEndpoint }); return { partition, signingService, hostname, ...signingRegion && { signingRegion }, ...regionHash[resolvedRegion]?.signingService && { signingService: regionHash[resolvedRegion].signingService } }; }; exports2.CONFIG_USE_DUALSTACK_ENDPOINT = CONFIG_USE_DUALSTACK_ENDPOINT; exports2.CONFIG_USE_FIPS_ENDPOINT = CONFIG_USE_FIPS_ENDPOINT; exports2.DEFAULT_USE_DUALSTACK_ENDPOINT = DEFAULT_USE_DUALSTACK_ENDPOINT; exports2.DEFAULT_USE_FIPS_ENDPOINT = DEFAULT_USE_FIPS_ENDPOINT; exports2.ENV_USE_DUALSTACK_ENDPOINT = ENV_USE_DUALSTACK_ENDPOINT; exports2.ENV_USE_FIPS_ENDPOINT = ENV_USE_FIPS_ENDPOINT; exports2.NODE_REGION_CONFIG_FILE_OPTIONS = NODE_REGION_CONFIG_FILE_OPTIONS5; exports2.NODE_REGION_CONFIG_OPTIONS = NODE_REGION_CONFIG_OPTIONS5; exports2.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS5; exports2.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS5; exports2.REGION_ENV_NAME = REGION_ENV_NAME; exports2.REGION_INI_NAME = REGION_INI_NAME; exports2.getRegionInfo = getRegionInfo; exports2.nodeDualstackConfigSelectors = nodeDualstackConfigSelectors; exports2.nodeFipsConfigSelectors = nodeFipsConfigSelectors; exports2.resolveCustomEndpointsConfig = resolveCustomEndpointsConfig; exports2.resolveEndpointsConfig = resolveEndpointsConfig; exports2.resolveRegionConfig = resolveRegionConfig5; } }); // node_modules/@smithy/middleware-content-length/dist-cjs/index.js var require_dist_cjs27 = __commonJS({ "node_modules/@smithy/middleware-content-length/dist-cjs/index.js"(exports2) { "use strict"; var protocolHttp = require_dist_cjs2(); var CONTENT_LENGTH_HEADER = "content-length"; function contentLengthMiddleware(bodyLengthChecker) { return (next) => async (args) => { const request = args.request; if (protocolHttp.HttpRequest.isInstance(request)) { const { body, headers } = request; if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) { try { const length = bodyLengthChecker(body); request.headers = { ...request.headers, [CONTENT_LENGTH_HEADER]: String(length) }; } catch (error3) { } } } return next({ ...args, request }); }; } var contentLengthMiddlewareOptions = { step: "build", tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"], name: "contentLengthMiddleware", override: true }; var getContentLengthPlugin5 = (options) => ({ applyToStack: (clientStack) => { clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions); } }); exports2.contentLengthMiddleware = contentLengthMiddleware; exports2.contentLengthMiddlewareOptions = contentLengthMiddlewareOptions; exports2.getContentLengthPlugin = getContentLengthPlugin5; } }); // node_modules/@smithy/property-provider/dist-cjs/index.js var require_dist_cjs28 = __commonJS({ "node_modules/@smithy/property-provider/dist-cjs/index.js"(exports2) { "use strict"; var ProviderError2 = class _ProviderError extends Error { name = "ProviderError"; tryNextLink; constructor(message, options = true) { let logger2; let tryNextLink = true; if (typeof options === "boolean") { logger2 = void 0; tryNextLink = options; } else if (options != null && typeof options === "object") { logger2 = options.logger; tryNextLink = options.tryNextLink ?? true; } super(message); this.tryNextLink = tryNextLink; Object.setPrototypeOf(this, _ProviderError.prototype); logger2?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`); } static from(error3, options = true) { return Object.assign(new this(error3.message, options), error3); } }; var CredentialsProviderError = class _CredentialsProviderError extends ProviderError2 { name = "CredentialsProviderError"; constructor(message, options = true) { super(message, options); Object.setPrototypeOf(this, _CredentialsProviderError.prototype); } }; var TokenProviderError = class _TokenProviderError extends ProviderError2 { name = "TokenProviderError"; constructor(message, options = true) { super(message, options); Object.setPrototypeOf(this, _TokenProviderError.prototype); } }; var chain = (...providers) => async () => { if (providers.length === 0) { throw new ProviderError2("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; }; var fromStatic = (staticValue) => () => Promise.resolve(staticValue); var memoize = (provider, isExpired, requiresRefresh) => { let resolved; let pending; let hasResult; let isConstant = false; const coalesceProvider = async () => { if (!pending) { pending = provider(); } try { resolved = await pending; hasResult = true; isConstant = false; } finally { pending = void 0; } return resolved; }; if (isExpired === void 0) { return async (options) => { if (!hasResult || options?.forceRefresh) { resolved = await coalesceProvider(); } return resolved; }; } return async (options) => { if (!hasResult || options?.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; }; }; exports2.CredentialsProviderError = CredentialsProviderError; exports2.ProviderError = ProviderError2; exports2.TokenProviderError = TokenProviderError; exports2.chain = chain; exports2.fromStatic = fromStatic; exports2.memoize = memoize; } }); // node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js var require_getHomeDir = __commonJS({ "node_modules/@smithy/shared-ini-file-loader/dist-cjs/getHomeDir.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getHomeDir = void 0; var os_1 = require("os"); var path_1 = require("path"); var homeDirCache = {}; var getHomeDirCacheKey = () => { if (process && process.geteuid) { return `${process.geteuid()}`; } return "DEFAULT"; }; var getHomeDir = () => { const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path_1.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, os_1.homedir)(); return homeDirCache[homeDirCacheKey]; }; exports2.getHomeDir = getHomeDir; } }); // node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js var require_getSSOTokenFilepath = __commonJS({ "node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFilepath.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getSSOTokenFilepath = void 0; var crypto_1 = require("crypto"); var path_1 = require("path"); var getHomeDir_1 = require_getHomeDir(); var getSSOTokenFilepath = (id) => { const hasher = (0, crypto_1.createHash)("sha1"); const cacheName = hasher.update(id).digest("hex"); return (0, path_1.join)((0, getHomeDir_1.getHomeDir)(), ".aws", "sso", "cache", `${cacheName}.json`); }; exports2.getSSOTokenFilepath = getSSOTokenFilepath; } }); // node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js var require_getSSOTokenFromFile = __commonJS({ "node_modules/@smithy/shared-ini-file-loader/dist-cjs/getSSOTokenFromFile.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getSSOTokenFromFile = exports2.tokenIntercept = void 0; var promises_1 = require("fs/promises"); var getSSOTokenFilepath_1 = require_getSSOTokenFilepath(); exports2.tokenIntercept = {}; var getSSOTokenFromFile = async (id) => { if (exports2.tokenIntercept[id]) { return exports2.tokenIntercept[id]; } const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id); const ssoTokenText = await (0, promises_1.readFile)(ssoTokenFilepath, "utf8"); return JSON.parse(ssoTokenText); }; exports2.getSSOTokenFromFile = getSSOTokenFromFile; } }); // node_modules/@smithy/shared-ini-file-loader/dist-cjs/readFile.js var require_readFile = __commonJS({ "node_modules/@smithy/shared-ini-file-loader/dist-cjs/readFile.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.readFile = exports2.fileIntercept = exports2.filePromises = void 0; var promises_1 = require("node:fs/promises"); exports2.filePromises = {}; exports2.fileIntercept = {}; var readFile = (path3, options) => { if (exports2.fileIntercept[path3] !== void 0) { return exports2.fileIntercept[path3]; } if (!exports2.filePromises[path3] || options?.ignoreCache) { exports2.filePromises[path3] = (0, promises_1.readFile)(path3, "utf8"); } return exports2.filePromises[path3]; }; exports2.readFile = readFile; } }); // node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js var require_dist_cjs29 = __commonJS({ "node_modules/@smithy/shared-ini-file-loader/dist-cjs/index.js"(exports2) { "use strict"; var getHomeDir = require_getHomeDir(); var getSSOTokenFilepath = require_getSSOTokenFilepath(); var getSSOTokenFromFile = require_getSSOTokenFromFile(); var path3 = require("path"); var types3 = require_dist_cjs(); var readFile = require_readFile(); var ENV_PROFILE = "AWS_PROFILE"; var DEFAULT_PROFILE = "default"; var getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE; var CONFIG_PREFIX_SEPARATOR = "."; var getConfigData = (data3) => Object.entries(data3).filter(([key]) => { const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); if (indexOfSeparator === -1) { return false; } return Object.values(types3.IniSectionType).includes(key.substring(0, indexOfSeparator)); }).reduce((acc, [key, value]) => { const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); const updatedKey = key.substring(0, indexOfSeparator) === types3.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; acc[updatedKey] = value; return acc; }, { ...data3.default && { default: data3.default } }); var ENV_CONFIG_PATH = "AWS_CONFIG_FILE"; var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path3.join(getHomeDir.getHomeDir(), ".aws", "config"); var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE"; var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path3.join(getHomeDir.getHomeDir(), ".aws", "credentials"); var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/; var profileNameBlockList = ["__proto__", "profile __proto__"]; var parseIni2 = (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, , name] = matches; if (Object.values(types3.IniSectionType).includes(prefix)) { currentSection = [prefix, name].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 [name, value] = [ trimmedLine.substring(0, indexOfEqualsSign).trim(), trimmedLine.substring(indexOfEqualsSign + 1).trim() ]; if (value === "") { currentSubSection = name; } else { if (currentSubSection && iniLine.trimStart() === iniLine) { currentSubSection = void 0; } map2[currentSection] = map2[currentSection] || {}; const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name; map2[currentSection][key] = value; } } } } return map2; }; var swallowError$1 = () => ({}); var loadSharedConfigFiles = async (init = {}) => { const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; const homeDir = getHomeDir.getHomeDir(); const relativeHomeDirPrefix = "~/"; let resolvedFilepath = filepath; if (filepath.startsWith(relativeHomeDirPrefix)) { resolvedFilepath = path3.join(homeDir, filepath.slice(2)); } let resolvedConfigFilepath = configFilepath; if (configFilepath.startsWith(relativeHomeDirPrefix)) { resolvedConfigFilepath = path3.join(homeDir, configFilepath.slice(2)); } const parsedFiles = await Promise.all([ readFile.readFile(resolvedConfigFilepath, { ignoreCache: init.ignoreCache }).then(parseIni2).then(getConfigData).catch(swallowError$1), readFile.readFile(resolvedFilepath, { ignoreCache: init.ignoreCache }).then(parseIni2).catch(swallowError$1) ]); return { configFile: parsedFiles[0], credentialsFile: parsedFiles[1] }; }; var getSsoSessionData = (data3) => Object.entries(data3).filter(([key]) => key.startsWith(types3.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {}); var swallowError = () => ({}); var loadSsoSessionData = async (init = {}) => readFile.readFile(init.configFilepath ?? getConfigFilepath()).then(parseIni2).then(getSsoSessionData).catch(swallowError); var mergeConfigFiles = (...files) => { const merged = {}; for (const file2 of files) { for (const [key, values] of Object.entries(file2)) { if (merged[key] !== void 0) { Object.assign(merged[key], values); } else { merged[key] = values; } } } return merged; }; var parseKnownFiles = async (init) => { const parsedFiles = await loadSharedConfigFiles(init); return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile); }; var externalDataInterceptor = { getFileRecord() { return readFile.fileIntercept; }, interceptFile(path4, contents) { readFile.fileIntercept[path4] = Promise.resolve(contents); }, getTokenRecord() { return getSSOTokenFromFile.tokenIntercept; }, interceptToken(id, contents) { getSSOTokenFromFile.tokenIntercept[id] = contents; } }; exports2.getSSOTokenFromFile = getSSOTokenFromFile.getSSOTokenFromFile; exports2.readFile = readFile.readFile; exports2.CONFIG_PREFIX_SEPARATOR = CONFIG_PREFIX_SEPARATOR; exports2.DEFAULT_PROFILE = DEFAULT_PROFILE; exports2.ENV_PROFILE = ENV_PROFILE; exports2.externalDataInterceptor = externalDataInterceptor; exports2.getProfileName = getProfileName; exports2.loadSharedConfigFiles = loadSharedConfigFiles; exports2.loadSsoSessionData = loadSsoSessionData; exports2.parseKnownFiles = parseKnownFiles; Object.prototype.hasOwnProperty.call(getHomeDir, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: getHomeDir["__proto__"] }); Object.keys(getHomeDir).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = getHomeDir[k5]; }); Object.prototype.hasOwnProperty.call(getSSOTokenFilepath, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: getSSOTokenFilepath["__proto__"] }); Object.keys(getSSOTokenFilepath).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = getSSOTokenFilepath[k5]; }); } }); // node_modules/@smithy/node-config-provider/dist-cjs/index.js var require_dist_cjs30 = __commonJS({ "node_modules/@smithy/node-config-provider/dist-cjs/index.js"(exports2) { "use strict"; var propertyProvider = require_dist_cjs28(); var sharedIniFileLoader = require_dist_cjs29(); function getSelectorName(functionString) { try { const constants3 = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? [])); constants3.delete("CONFIG"); constants3.delete("CONFIG_PREFIX_SEPARATOR"); constants3.delete("ENV"); return [...constants3].join(", "); } catch (e5) { return functionString; } } var fromEnv = (envVarSelector, options) => async () => { try { const config = envVarSelector(process.env, options); if (config === void 0) { throw new Error(); } return config; } catch (e5) { throw new propertyProvider.CredentialsProviderError(e5.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger }); } }; var fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => { const profile = sharedIniFileLoader.getProfileName(init); const { configFile, credentialsFile } = await sharedIniFileLoader.loadSharedConfigFiles(init); 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 (e5) { throw new propertyProvider.CredentialsProviderError(e5.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger }); } }; var isFunction = (func) => typeof func === "function"; var fromStatic = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : propertyProvider.fromStatic(defaultValue); var loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => { const { signingName, logger: logger2 } = configuration; const envOptions = { signingName, logger: logger2 }; return propertyProvider.memoize(propertyProvider.chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic(defaultValue))); }; exports2.loadConfig = loadConfig; } }); // node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js var require_getEndpointUrlConfig = __commonJS({ "node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointUrlConfig.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getEndpointUrlConfig = void 0; var shared_ini_file_loader_1 = require_dist_cjs29(); var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL"; var CONFIG_ENDPOINT_URL = "endpoint_url"; var getEndpointUrlConfig = (serviceId) => ({ environmentVariableSelector: (env) => { const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase()); const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")]; if (serviceEndpointUrl) return serviceEndpointUrl; const endpointUrl = env[ENV_ENDPOINT_URL]; if (endpointUrl) return endpointUrl; return void 0; }, configFileSelector: (profile, config) => { if (config && profile.services) { const servicesSection = config[["services", profile.services].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; if (servicesSection) { const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase()); const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(shared_ini_file_loader_1.CONFIG_PREFIX_SEPARATOR)]; if (endpointUrl2) return endpointUrl2; } } const endpointUrl = profile[CONFIG_ENDPOINT_URL]; if (endpointUrl) return endpointUrl; return void 0; }, default: void 0 }); exports2.getEndpointUrlConfig = getEndpointUrlConfig; } }); // node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js var require_getEndpointFromConfig = __commonJS({ "node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getEndpointFromConfig = void 0; var node_config_provider_1 = require_dist_cjs30(); var getEndpointUrlConfig_1 = require_getEndpointUrlConfig(); var getEndpointFromConfig = async (serviceId) => (0, node_config_provider_1.loadConfig)((0, getEndpointUrlConfig_1.getEndpointUrlConfig)(serviceId ?? ""))(); exports2.getEndpointFromConfig = getEndpointFromConfig; } }); // node_modules/@smithy/middleware-serde/dist-cjs/index.js var require_dist_cjs31 = __commonJS({ "node_modules/@smithy/middleware-serde/dist-cjs/index.js"(exports2) { "use strict"; var protocolHttp = require_dist_cjs2(); var endpoints = (init_endpoints(), __toCommonJS(endpoints_exports)); var deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => { const { response } = await next(args); try { const parsed = await deserializer(response, options); return { response, output: parsed }; } catch (error3) { Object.defineProperty(error3, "$response", { value: response, enumerable: false, writable: false, configurable: false }); if (!("$metadata" in error3)) { const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`; try { error3.message += "\n " + hint; } catch (e5) { if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") { console.warn(hint); } else { context.logger?.warn?.(hint); } } if (typeof error3.$responseBodyText !== "undefined") { if (error3.$response) { error3.$response.body = error3.$responseBodyText; } } try { if (protocolHttp.HttpResponse.isInstance(response)) { const { headers = {} } = response; const headerEntries = Object.entries(headers); error3.$metadata = { httpStatusCode: response.statusCode, requestId: findHeader2(/^x-[\w-]+-request-?id$/, headerEntries), extendedRequestId: findHeader2(/^x-[\w-]+-id-2$/, headerEntries), cfId: findHeader2(/^x-[\w-]+-cf-id$/, headerEntries) }; } } catch (e5) { } } throw error3; } }; var findHeader2 = (pattern, headers) => { return (headers.find(([k5]) => { return k5.match(pattern); }) || [void 0, void 0])[1]; }; var serializerMiddleware = (options, serializer) => (next, context) => async (args) => { const endpointConfig = options; const endpoint = context.endpointV2 ? async () => endpoints.toEndpointV1(context.endpointV2) : endpointConfig.endpoint; if (!endpoint) { throw new Error("No valid endpoint provider available."); } const request = await serializer(args.input, { ...options, endpoint }); return next({ ...args, request }); }; var deserializerMiddlewareOption2 = { name: "deserializerMiddleware", step: "deserialize", tags: ["DESERIALIZER"], override: true }; var serializerMiddlewareOption2 = { name: "serializerMiddleware", step: "serialize", tags: ["SERIALIZER"], override: true }; function getSerdePlugin(config, serializer, deserializer) { return { applyToStack: (commandStack) => { commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption2); commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption2); } }; } exports2.deserializerMiddleware = deserializerMiddleware; exports2.deserializerMiddlewareOption = deserializerMiddlewareOption2; exports2.getSerdePlugin = getSerdePlugin; exports2.serializerMiddleware = serializerMiddleware; exports2.serializerMiddlewareOption = serializerMiddlewareOption2; } }); // node_modules/@smithy/middleware-endpoint/dist-cjs/index.js var require_dist_cjs32 = __commonJS({ "node_modules/@smithy/middleware-endpoint/dist-cjs/index.js"(exports2) { "use strict"; var core = (init_dist_es(), __toCommonJS(dist_es_exports)); var utilMiddleware = require_dist_cjs6(); var getEndpointFromConfig = require_getEndpointFromConfig(); var urlParser = require_dist_cjs18(); var middlewareSerde = require_dist_cjs31(); var resolveParamsForS3 = 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; }; var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/; var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/; var DOTS_PATTERN = /\.\./; var isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName); var isArnBucketName = (bucketName) => { const [arn, partition, service, , , bucket] = bucketName.split(":"); const isArn = arn === "arn" && bucketName.split(":").length >= 6; const isValidArn = Boolean(isArn && partition && service && bucket); if (isArn && !isValidArn) { throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`); } return isValidArn; }; var createConfigValueProvider = (configKey, canonicalEndpointParamKey, config, isClientContextParam = false) => { const configProvider = async () => { let configValue; if (isClientContextParam) { const clientContextParams = config.clientContextParams; const nestedValue = clientContextParams?.[configKey]; configValue = nestedValue ?? config[configKey] ?? config[canonicalEndpointParamKey]; } else { configValue = config[configKey] ?? config[canonicalEndpointParamKey]; } if (typeof configValue === "function") { return configValue(); } return configValue; }; 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 () => { if (config.isCustomEndpoint === false) { return void 0; } const endpoint = await configProvider(); if (endpoint && typeof endpoint === "object") { if ("url" in endpoint) { return endpoint.url.href; } if ("hostname" in endpoint) { const { protocol, hostname, port, path: path3 } = endpoint; return `${protocol}//${hostname}${port ? ":" + port : ""}${path3}`; } } return endpoint; }; } return configProvider; }; var toEndpointV12 = (endpoint) => { if (typeof endpoint === "object") { if ("url" in endpoint) { const v1Endpoint = urlParser.parseUrl(endpoint.url); if (endpoint.headers) { v1Endpoint.headers = {}; for (const [name, values] of Object.entries(endpoint.headers)) { v1Endpoint.headers[name.toLowerCase()] = values.join(", "); } } return v1Endpoint; } return endpoint; } return urlParser.parseUrl(endpoint); }; var getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => { if (!clientConfig.isCustomEndpoint) { let endpointFromConfig; if (clientConfig.serviceConfiguredEndpoint) { endpointFromConfig = await clientConfig.serviceConfiguredEndpoint(); } else { endpointFromConfig = await getEndpointFromConfig.getEndpointFromConfig(clientConfig.serviceId); } if (endpointFromConfig) { clientConfig.endpoint = () => Promise.resolve(toEndpointV12(endpointFromConfig)); clientConfig.isCustomEndpoint = true; } } const endpointParams = await resolveParams2(commandInput, instructionsSupplier, clientConfig); if (typeof clientConfig.endpointProvider !== "function") { throw new Error("config.endpointProvider is not set."); } const endpoint = clientConfig.endpointProvider(endpointParams, context); if (clientConfig.isCustomEndpoint && clientConfig.endpoint) { const customEndpoint = await clientConfig.endpoint(); if (customEndpoint?.headers) { endpoint.headers ??= {}; for (const [name, value] of Object.entries(customEndpoint.headers)) { endpoint.headers[name] = Array.isArray(value) ? value : [value]; } } } return endpoint; }; var resolveParams2 = async (commandInput, instructionsSupplier, clientConfig) => { const endpointParams = {}; const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {}; for (const [name, instruction] of Object.entries(instructions)) { switch (instruction.type) { case "staticContextParams": endpointParams[name] = instruction.value; break; case "contextParams": endpointParams[name] = commandInput[instruction.name]; break; case "clientContextParams": case "builtInParams": endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig, instruction.type !== "builtInParams")(); break; case "operationContextParams": endpointParams[name] = 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; }; var endpointMiddleware = ({ config, instructions }) => { return (next, context) => async (args) => { if (config.isCustomEndpoint) { core.setFeature(context, "ENDPOINT_OVERRIDE", "N"); } const endpoint = await getEndpointFromInstructions(args.input, { getEndpointParameterInstructions() { return instructions; } }, { ...config }, context); context.endpointV2 = endpoint; context.authSchemes = endpoint.properties?.authSchemes; const authScheme = context.authSchemes?.[0]; if (authScheme) { context["signing_region"] = authScheme.signingRegion; context["signing_service"] = authScheme.signingName; const smithyContext = utilMiddleware.getSmithyContext(context); 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 }); }; }; var endpointMiddlewareOptions = { step: "serialize", tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"], name: "endpointV2Middleware", override: true, relation: "before", toMiddleware: middlewareSerde.serializerMiddlewareOption.name }; var getEndpointPlugin6 = (config, instructions) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(endpointMiddleware({ config, instructions }), endpointMiddlewareOptions); } }); var resolveEndpointConfig5 = (input) => { const tls8 = input.tls ?? true; const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input; const customEndpointProvider = endpoint != null ? async () => toEndpointV12(await utilMiddleware.normalizeProvider(endpoint)()) : void 0; const isCustomEndpoint = !!endpoint; const resolvedConfig = Object.assign(input, { endpoint: customEndpointProvider, tls: tls8, isCustomEndpoint, useDualstackEndpoint: utilMiddleware.normalizeProvider(useDualstackEndpoint ?? false), useFipsEndpoint: utilMiddleware.normalizeProvider(useFipsEndpoint ?? false) }); let configuredEndpointPromise = void 0; resolvedConfig.serviceConfiguredEndpoint = async () => { if (input.serviceId && !configuredEndpointPromise) { configuredEndpointPromise = getEndpointFromConfig.getEndpointFromConfig(input.serviceId); } return configuredEndpointPromise; }; return resolvedConfig; }; var resolveEndpointRequiredConfig = (input) => { const { endpoint } = input; if (endpoint === void 0) { input.endpoint = async () => { throw new Error("@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint."); }; } return input; }; exports2.endpointMiddleware = endpointMiddleware; exports2.endpointMiddlewareOptions = endpointMiddlewareOptions; exports2.getEndpointFromInstructions = getEndpointFromInstructions; exports2.getEndpointPlugin = getEndpointPlugin6; exports2.resolveEndpointConfig = resolveEndpointConfig5; exports2.resolveEndpointRequiredConfig = resolveEndpointRequiredConfig; exports2.resolveParams = resolveParams2; exports2.toEndpointV1 = toEndpointV12; } }); // node_modules/@smithy/middleware-stack/dist-cjs/index.js var require_dist_cjs33 = __commonJS({ "node_modules/@smithy/middleware-stack/dist-cjs/index.js"(exports2) { "use strict"; var getAllAliases = (name, aliases) => { const _aliases = []; if (name) { _aliases.push(name); } if (aliases) { for (const alias of aliases) { _aliases.push(alias); } } return _aliases; }; var getMiddlewareNameWithAliases = (name, aliases) => { return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`; }; var constructStack = () => { let absoluteEntries = []; let relativeEntries = []; let identifyOnResolve = false; const entriesNameSet = /* @__PURE__ */ new Set(); const sort = (entries) => entries.sort((a5, b6) => stepWeights[b6.step] - stepWeights[a5.step] || priorityWeights[b6.priority || "normal"] - priorityWeights[a5.priority || "normal"]); const removeByName = (toRemove) => { let isRemoved = false; const filterCb = (entry) => { const aliases = getAllAliases(entry.name, entry.aliases); if (aliases.includes(toRemove)) { isRemoved = true; for (const alias of aliases) { entriesNameSet.delete(alias); } return false; } return true; }; absoluteEntries = absoluteEntries.filter(filterCb); relativeEntries = relativeEntries.filter(filterCb); return isRemoved; }; const removeByReference = (toRemove) => { let isRemoved = false; const filterCb = (entry) => { if (entry.middleware === toRemove) { isRemoved = true; for (const alias of getAllAliases(entry.name, entry.aliases)) { entriesNameSet.delete(alias); } return false; } return true; }; absoluteEntries = absoluteEntries.filter(filterCb); relativeEntries = relativeEntries.filter(filterCb); return isRemoved; }; const cloneTo = (toStack) => { absoluteEntries.forEach((entry) => { toStack.add(entry.middleware, { ...entry }); }); relativeEntries.forEach((entry) => { toStack.addRelativeTo(entry.middleware, { ...entry }); }); toStack.identifyOnResolve?.(stack.identifyOnResolve()); return toStack; }; const expandRelativeMiddlewareList = (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; }; const getMiddlewareList = (debug17 = 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 (debug17) { 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; }; const stack = { add: (middleware, options = {}) => { const { name, override, aliases: _aliases } = options; const entry = { step: "initialize", priority: "normal", middleware, ...options }; const aliases = getAllAliases(name, _aliases); if (aliases.length > 0) { if (aliases.some((alias) => entriesNameSet.has(alias))) { if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); for (const alias of aliases) { 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(name, _aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.`); } absoluteEntries.splice(toOverrideIndex, 1); } } for (const alias of aliases) { entriesNameSet.add(alias); } } absoluteEntries.push(entry); }, addRelativeTo: (middleware, options) => { const { name, override, aliases: _aliases } = options; const entry = { middleware, ...options }; const aliases = getAllAliases(name, _aliases); if (aliases.length > 0) { if (aliases.some((alias) => entriesNameSet.has(alias))) { if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`); for (const alias of aliases) { 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(name, _aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.`); } relativeEntries.splice(toOverrideIndex, 1); } } for (const alias of aliases) { 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 = (entry) => { const { tags, name, aliases: _aliases } = entry; if (tags && tags.includes(toRemove)) { const aliases = getAllAliases(name, _aliases); for (const alias of aliases) { entriesNameSet.delete(alias); } isRemoved = true; return false; } return true; }; 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: (handler, context) => { for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) { handler = middleware(handler, context); } if (identifyOnResolve) { console.log(stack.identify()); } return handler; } }; return stack; }; var stepWeights = { initialize: 5, serialize: 4, build: 3, finalizeRequest: 2, deserialize: 1 }; var priorityWeights = { high: 3, normal: 2, low: 1 }; exports2.constructStack = constructStack; } }); // node_modules/@smithy/smithy-client/dist-cjs/index.js var require_dist_cjs34 = __commonJS({ "node_modules/@smithy/smithy-client/dist-cjs/index.js"(exports2) { "use strict"; var middlewareStack = require_dist_cjs33(); var types3 = require_dist_cjs(); var schema = (init_schema(), __toCommonJS(schema_exports)); var serde = (init_serde(), __toCommonJS(serde_exports)); var protocols2 = (init_protocols(), __toCommonJS(protocols_exports)); var Client2 = class { config; middlewareStack = middlewareStack.constructStack(); initConfig; handlers; constructor(config) { this.config = config; const { protocol, protocolSettings } = config; if (protocolSettings) { if (typeof protocol === "function") { config.protocol = new protocol(protocolSettings); } } } send(command, optionsOrCb, cb) { const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0; const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb; const useHandlerCache = options === void 0 && this.config.cacheMiddleware === true; let handler; if (useHandlerCache) { if (!this.handlers) { this.handlers = /* @__PURE__ */ new WeakMap(); } const handlers = this.handlers; if (handlers.has(command.constructor)) { handler = handlers.get(command.constructor); } else { handler = command.resolveMiddleware(this.middlewareStack, this.config, options); handlers.set(command.constructor, handler); } } else { delete this.handlers; handler = command.resolveMiddleware(this.middlewareStack, this.config, options); } if (callback) { handler(command).then((result) => callback(null, result.output), (err) => callback(err)).catch(() => { }); } else { return handler(command).then((result) => result.output); } } destroy() { this.config?.requestHandler?.destroy?.(); delete this.handlers; } }; var SENSITIVE_STRING$1 = "***SensitiveInformation***"; function schemaLogFilter(schema$1, data3) { if (data3 == null) { return data3; } const ns = schema.NormalizedSchema.of(schema$1); if (ns.getMergedTraits().sensitive) { return SENSITIVE_STRING$1; } if (ns.isListSchema()) { const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive; if (isSensitive) { return SENSITIVE_STRING$1; } } else if (ns.isMapSchema()) { const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive; if (isSensitive) { return SENSITIVE_STRING$1; } } else if (ns.isStructSchema() && typeof data3 === "object") { const object = data3; const newObject = {}; for (const [member2, memberNs] of ns.structIterator()) { if (object[member2] != null) { newObject[member2] = schemaLogFilter(memberNs, object[member2]); } } return newObject; } return data3; } var Command2 = class { middlewareStack = middlewareStack.constructStack(); schema; static classBuilder() { return new ClassBuilder(); } resolveMiddlewareWithContext(clientStack, configuration, options, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor }) { for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) { this.middlewareStack.use(mw); } const stack = clientStack.concat(this.middlewareStack); const { logger: logger2 } = configuration; const handlerExecutionContext = { logger: logger2, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, [types3.SMITHY_CONTEXT_KEY]: { commandInstance: this, ...smithyContext }, ...additionalContext }; const { requestHandler } = configuration; let requestOptions = options ?? {}; if (smithyContext.eventStream) { requestOptions = { isEventStream: true, ...requestOptions }; } return stack.resolve((request) => requestHandler.handle(request.request, requestOptions), handlerExecutionContext); } }; var ClassBuilder = class { _init = () => { }; _ep = {}; _middlewareFn = () => []; _commandName = ""; _clientName = ""; _additionalContext = {}; _smithyContext = {}; _inputFilterSensitiveLog = void 0; _outputFilterSensitiveLog = void 0; _serializer = null; _deserializer = null; _operationSchema; init(cb) { this._init = cb; } ep(endpointParameterInstructions) { this._ep = endpointParameterInstructions; return this; } m(middlewareSupplier) { this._middlewareFn = middlewareSupplier; return this; } s(service, operation2, smithyContext = {}) { this._smithyContext = { service, operation: operation2, ...smithyContext }; return this; } c(additionalContext = {}) { this._additionalContext = additionalContext; return this; } n(clientName, commandName) { this._clientName = clientName; this._commandName = commandName; return this; } f(inputFilter = (_) => _, outputFilter = (_) => _) { this._inputFilterSensitiveLog = inputFilter; this._outputFilterSensitiveLog = outputFilter; return this; } ser(serializer) { this._serializer = serializer; return this; } de(deserializer) { this._deserializer = deserializer; return this; } sc(operation2) { this._operationSchema = operation2; this._smithyContext.operationSchema = operation2; return this; } build() { const closure = this; let CommandRef; return CommandRef = class extends Command2 { input; static getEndpointParameterInstructions() { return closure._ep; } constructor(...[input]) { super(); this.input = input ?? {}; closure._init(this); this.schema = closure._operationSchema; } resolveMiddleware(stack, configuration, options) { const op2 = closure._operationSchema; const input = op2?.[4] ?? op2?.input; const output = op2?.[5] ?? op2?.output; return this.resolveMiddlewareWithContext(stack, configuration, options, { CommandCtor: CommandRef, middlewareFn: closure._middlewareFn, clientName: closure._clientName, commandName: closure._commandName, inputFilterSensitiveLog: closure._inputFilterSensitiveLog ?? (op2 ? schemaLogFilter.bind(null, input) : (_) => _), outputFilterSensitiveLog: closure._outputFilterSensitiveLog ?? (op2 ? schemaLogFilter.bind(null, output) : (_) => _), smithyContext: closure._smithyContext, additionalContext: closure._additionalContext }); } serialize = closure._serializer; deserialize = closure._deserializer; }; } }; var SENSITIVE_STRING = "***SensitiveInformation***"; var createAggregatedClient5 = (commands5, Client3, options) => { for (const [command, CommandCtor] of Object.entries(commands5)) { const methodImpl = async function(args, optionsOrCb, cb) { const command2 = new CommandCtor(args); if (typeof optionsOrCb === "function") { this.send(command2, optionsOrCb); } else if (typeof cb === "function") { if (typeof optionsOrCb !== "object") throw new Error(`Expected http options but got ${typeof optionsOrCb}`); this.send(command2, optionsOrCb || {}, cb); } else { return this.send(command2, optionsOrCb); } }; const methodName = (command[0].toLowerCase() + command.slice(1)).replace(/Command$/, ""); Client3.prototype[methodName] = methodImpl; } const { paginators = {}, waiters = {} } = options ?? {}; for (const [paginatorName, paginatorFn] of Object.entries(paginators)) { if (Client3.prototype[paginatorName] === void 0) { Client3.prototype[paginatorName] = function(commandInput = {}, paginationConfiguration, ...rest) { return paginatorFn({ ...paginationConfiguration, client: this }, commandInput, ...rest); }; } } for (const [waiterName, waiterFn] of Object.entries(waiters)) { if (Client3.prototype[waiterName] === void 0) { Client3.prototype[waiterName] = async function(commandInput = {}, waiterConfiguration, ...rest) { let config = waiterConfiguration; if (typeof waiterConfiguration === "number") { config = { maxWaitTime: waiterConfiguration }; } return waiterFn({ ...config, client: this }, commandInput, ...rest); }; } } }; var ServiceException = class _ServiceException extends Error { $fault; $response; $retryable; $metadata; constructor(options) { super(options.message); Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype); this.name = options.name; this.$fault = options.$fault; this.$metadata = options.$metadata; } static isInstance(value) { if (!value) return false; const candidate = value; return _ServiceException.prototype.isPrototypeOf(candidate) || Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server"); } static [Symbol.hasInstance](instance) { if (!instance) return false; const candidate = instance; if (this === _ServiceException) { return _ServiceException.isInstance(instance); } if (_ServiceException.isInstance(instance)) { if (candidate.name && this.name) { return this.prototype.isPrototypeOf(instance) || candidate.name === this.name; } return this.prototype.isPrototypeOf(instance); } return false; } }; var decorateServiceException2 = (exception, additions = {}) => { Object.entries(additions).filter(([, v]) => v !== void 0).forEach(([k5, v]) => { if (exception[k5] == void 0 || exception[k5] === "") { exception[k5] = v; } }); const message = exception.message || exception.Message || "UnknownError"; exception.message = message; delete exception.Message; return exception; }; var throwDefaultError = ({ 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 decorateServiceException2(response, parsedBody); }; var withBaseException = (ExceptionCtor) => { return ({ output, parsedBody, errorCode }) => { throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode }); }; }; var deserializeMetadata = (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"] }); var loadConfigsForDefaultMode5 = (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 {}; } }; var warningEmitted = false; var emitWarningIfUnsupportedVersion6 = (version) => { if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) { warningEmitted = true; } }; var knownAlgorithms = Object.values(types3.AlgorithmId); var getChecksumConfiguration = (runtimeConfig) => { const checksumAlgorithms = []; for (const id in types3.AlgorithmId) { const algorithmId = types3.AlgorithmId[id]; if (runtimeConfig[algorithmId] === void 0) { continue; } checksumAlgorithms.push({ algorithmId: () => algorithmId, checksumConstructor: () => runtimeConfig[algorithmId] }); } for (const [id, ChecksumCtor] of Object.entries(runtimeConfig.checksumAlgorithms ?? {})) { checksumAlgorithms.push({ algorithmId: () => id, checksumConstructor: () => ChecksumCtor }); } return { addChecksumAlgorithm(algo) { runtimeConfig.checksumAlgorithms = runtimeConfig.checksumAlgorithms ?? {}; const id = algo.algorithmId(); const ctor = algo.checksumConstructor(); if (knownAlgorithms.includes(id)) { runtimeConfig.checksumAlgorithms[id.toUpperCase()] = ctor; } else { runtimeConfig.checksumAlgorithms[id] = ctor; } checksumAlgorithms.push(algo); }, checksumAlgorithms() { return checksumAlgorithms; } }; }; var resolveChecksumRuntimeConfig = (clientConfig) => { const runtimeConfig = {}; clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => { const id = checksumAlgorithm.algorithmId(); if (knownAlgorithms.includes(id)) { runtimeConfig[id] = checksumAlgorithm.checksumConstructor(); } }); return runtimeConfig; }; var getRetryConfiguration = (runtimeConfig) => { return { setRetryStrategy(retryStrategy) { runtimeConfig.retryStrategy = retryStrategy; }, retryStrategy() { return runtimeConfig.retryStrategy; } }; }; var resolveRetryRuntimeConfig = (retryStrategyConfiguration) => { const runtimeConfig = {}; runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy(); return runtimeConfig; }; var getDefaultExtensionConfiguration5 = (runtimeConfig) => { return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig)); }; var getDefaultClientConfiguration = getDefaultExtensionConfiguration5; var resolveDefaultRuntimeConfig5 = (config) => { return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config)); }; var getArrayIfSingleItem = (mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray]; var getValueFromTextNode3 = (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] = getValueFromTextNode3(obj[key]); } } return obj; }; var isSerializableHeaderValue = (value) => { return value != null; }; var NoOpLogger5 = class { trace() { } debug() { } info() { } warn() { } error() { } }; function map2(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 convertMap = (target) => { const output = {}; for (const [k5, v] of Object.entries(target || {})) { output[k5] = [, v]; } return output; }; var take = (source, instructions) => { const out = {}; for (const key in instructions) { applyInstruction(out, source, instructions, key); } return out; }; var mapWithFilter = (target, filter, instructions) => { return map2(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; }, {})); }; var applyInstruction = (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; } } }; var nonNullish = (_) => _ != null; var pass = (_) => _; var serializeFloat = (value) => { if (value !== value) { return "NaN"; } switch (value) { case Infinity: return "Infinity"; case -Infinity: return "-Infinity"; default: return value; } }; var serializeDateTime = (date2) => date2.toISOString().replace(".000Z", "Z"); var _json = (obj) => { if (obj == null) { return {}; } if (Array.isArray(obj)) { return obj.filter((_) => _ != 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; }; exports2.collectBody = protocols2.collectBody; exports2.extendedEncodeURIComponent = protocols2.extendedEncodeURIComponent; exports2.resolvedPath = protocols2.resolvedPath; exports2.Client = Client2; exports2.Command = Command2; exports2.NoOpLogger = NoOpLogger5; exports2.SENSITIVE_STRING = SENSITIVE_STRING; exports2.ServiceException = ServiceException; exports2._json = _json; exports2.convertMap = convertMap; exports2.createAggregatedClient = createAggregatedClient5; exports2.decorateServiceException = decorateServiceException2; exports2.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion6; exports2.getArrayIfSingleItem = getArrayIfSingleItem; exports2.getDefaultClientConfiguration = getDefaultClientConfiguration; exports2.getDefaultExtensionConfiguration = getDefaultExtensionConfiguration5; exports2.getValueFromTextNode = getValueFromTextNode3; exports2.isSerializableHeaderValue = isSerializableHeaderValue; exports2.loadConfigsForDefaultMode = loadConfigsForDefaultMode5; exports2.map = map2; exports2.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig5; exports2.serializeDateTime = serializeDateTime; exports2.serializeFloat = serializeFloat; exports2.take = take; exports2.throwDefaultError = throwDefaultError; exports2.withBaseException = withBaseException; Object.prototype.hasOwnProperty.call(serde, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: serde["__proto__"] }); Object.keys(serde).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = serde[k5]; }); } }); // node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js var require_isStreamingPayload = __commonJS({ "node_modules/@smithy/middleware-retry/dist-cjs/isStreamingPayload/isStreamingPayload.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.isStreamingPayload = void 0; var stream_1 = require("stream"); var isStreamingPayload = (request) => request?.body instanceof stream_1.Readable || typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream; exports2.isStreamingPayload = isStreamingPayload; } }); // node_modules/@smithy/middleware-retry/dist-cjs/index.js var require_dist_cjs35 = __commonJS({ "node_modules/@smithy/middleware-retry/dist-cjs/index.js"(exports2) { "use strict"; var utilRetry = require_dist_cjs23(); var protocolHttp = require_dist_cjs2(); var serviceErrorClassification = require_dist_cjs22(); var uuid = require_dist_cjs19(); var utilMiddleware = require_dist_cjs6(); var smithyClient = require_dist_cjs34(); var isStreamingPayload = require_isStreamingPayload(); var serde = (init_serde(), __toCommonJS(serde_exports)); var asSdkError = (error3) => { if (error3 instanceof Error) return error3; if (error3 instanceof Object) return Object.assign(new Error(), error3); if (typeof error3 === "string") return new Error(error3); return new Error(`AWS SDK error wrapper for ${error3}`); }; var getDefaultRetryQuota = (initialRetryTokens, options) => { const MAX_CAPACITY = initialRetryTokens; const noRetryIncrement = utilRetry.NO_RETRY_INCREMENT; const retryCost = utilRetry.RETRY_COST; const timeoutRetryCost = utilRetry.TIMEOUT_RETRY_COST; let availableCapacity = initialRetryTokens; const getCapacityAmount = (error3) => error3.name === "TimeoutError" ? timeoutRetryCost : retryCost; const hasRetryTokens = (error3) => getCapacityAmount(error3) <= availableCapacity; const retrieveRetryTokens = (error3) => { if (!hasRetryTokens(error3)) { throw new Error("No retry token available"); } const capacityAmount = getCapacityAmount(error3); availableCapacity -= capacityAmount; return capacityAmount; }; const releaseRetryTokens = (capacityReleaseAmount) => { availableCapacity += capacityReleaseAmount ?? noRetryIncrement; availableCapacity = Math.min(availableCapacity, MAX_CAPACITY); }; return Object.freeze({ hasRetryTokens, retrieveRetryTokens, releaseRetryTokens }); }; var defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(utilRetry.MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase)); var defaultRetryDecider = (error3) => { if (!error3) { return false; } return serviceErrorClassification.isRetryableByTrait(error3) || serviceErrorClassification.isClockSkewError(error3) || serviceErrorClassification.isThrottlingError(error3) || serviceErrorClassification.isTransientError(error3); }; var StandardRetryStrategy = class { maxAttemptsProvider; retryDecider; delayDecider; retryQuota; mode = utilRetry.RETRY_MODES.STANDARD; constructor(maxAttemptsProvider, options) { this.maxAttemptsProvider = maxAttemptsProvider; this.retryDecider = options?.retryDecider ?? defaultRetryDecider; this.delayDecider = options?.delayDecider ?? defaultDelayDecider; this.retryQuota = options?.retryQuota ?? getDefaultRetryQuota(utilRetry.INITIAL_RETRY_TOKENS); } shouldRetry(error3, attempts, maxAttempts) { return attempts < maxAttempts && this.retryDecider(error3) && this.retryQuota.hasRetryTokens(error3); } async getMaxAttempts() { let maxAttempts; try { maxAttempts = await this.maxAttemptsProvider(); } catch (error3) { maxAttempts = utilRetry.DEFAULT_MAX_ATTEMPTS; } return maxAttempts; } async retry(next, args, options) { let retryTokenAmount; let attempts = 0; let totalDelay = 0; const maxAttempts = await this.getMaxAttempts(); const { request } = args; if (protocolHttp.HttpRequest.isInstance(request)) { request.headers[utilRetry.INVOCATION_ID_HEADER] = uuid.v4(); } while (true) { try { if (protocolHttp.HttpRequest.isInstance(request)) { request.headers[utilRetry.REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`; } if (options?.beforeRequest) { await options.beforeRequest(); } const { response, output } = await next(args); if (options?.afterRequest) { options.afterRequest(response); } this.retryQuota.releaseRetryTokens(retryTokenAmount); output.$metadata.attempts = attempts + 1; output.$metadata.totalRetryDelay = totalDelay; return { response, output }; } catch (e5) { const err = asSdkError(e5); attempts++; if (this.shouldRetry(err, attempts, maxAttempts)) { retryTokenAmount = this.retryQuota.retrieveRetryTokens(err); const delayFromDecider = this.delayDecider(serviceErrorClassification.isThrottlingError(err) ? utilRetry.THROTTLING_RETRY_DELAY_BASE : utilRetry.DEFAULT_RETRY_DELAY_BASE, attempts); const delayFromResponse = getDelayFromRetryAfterHeader(err.$response); const delay = Math.max(delayFromResponse || 0, delayFromDecider); totalDelay += delay; await new Promise((resolve) => setTimeout(resolve, delay)); continue; } if (!err.$metadata) { err.$metadata = {}; } err.$metadata.attempts = attempts; err.$metadata.totalRetryDelay = totalDelay; throw err; } } } }; var getDelayFromRetryAfterHeader = (response) => { if (!protocolHttp.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 retryAfterSeconds * 1e3; const retryAfterDate = new Date(retryAfter); return retryAfterDate.getTime() - Date.now(); }; var AdaptiveRetryStrategy = class extends StandardRetryStrategy { rateLimiter; constructor(maxAttemptsProvider, options) { const { rateLimiter, ...superOptions } = options ?? {}; super(maxAttemptsProvider, superOptions); this.rateLimiter = rateLimiter ?? new utilRetry.DefaultRateLimiter(); this.mode = utilRetry.RETRY_MODES.ADAPTIVE; } async retry(next, args) { return super.retry(next, args, { beforeRequest: async () => { return this.rateLimiter.getSendToken(); }, afterRequest: (response) => { this.rateLimiter.updateClientSendingRate(response); } }); } }; var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS"; var CONFIG_MAX_ATTEMPTS = "max_attempts"; var NODE_MAX_ATTEMPT_CONFIG_OPTIONS5 = { environmentVariableSelector: (env) => { const value = env[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: utilRetry.DEFAULT_MAX_ATTEMPTS }; var resolveRetryConfig5 = (input) => { const { retryStrategy, retryMode } = input; const maxAttempts = utilMiddleware.normalizeProvider(input.maxAttempts ?? utilRetry.DEFAULT_MAX_ATTEMPTS); let controller = retryStrategy ? Promise.resolve(retryStrategy) : void 0; const getDefault = async () => await utilMiddleware.normalizeProvider(retryMode)() === utilRetry.RETRY_MODES.ADAPTIVE ? new utilRetry.AdaptiveRetryStrategy(maxAttempts) : new utilRetry.StandardRetryStrategy(maxAttempts); return Object.assign(input, { maxAttempts, retryStrategy: () => controller ??= getDefault() }); }; var ENV_RETRY_MODE = "AWS_RETRY_MODE"; var CONFIG_RETRY_MODE = "retry_mode"; var NODE_RETRY_MODE_CONFIG_OPTIONS5 = { environmentVariableSelector: (env) => env[ENV_RETRY_MODE], configFileSelector: (profile) => profile[CONFIG_RETRY_MODE], default: utilRetry.DEFAULT_RETRY_MODE }; var omitRetryHeadersMiddleware = () => (next) => async (args) => { const { request } = args; if (protocolHttp.HttpRequest.isInstance(request)) { delete request.headers[utilRetry.INVOCATION_ID_HEADER]; delete request.headers[utilRetry.REQUEST_HEADER]; } return next(args); }; var omitRetryHeadersMiddlewareOptions = { name: "omitRetryHeadersMiddleware", tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"], relation: "before", toMiddleware: "awsAuthMiddleware", override: true }; var getOmitRetryHeadersPlugin = (options) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions); } }); function parseRetryAfterHeader(response, logger2) { if (!protocolHttp.HttpResponse.isInstance(response)) { return; } for (const header of Object.keys(response.headers)) { const h5 = header.toLowerCase(); if (h5 === "retry-after") { const retryAfter = response.headers[header]; let retryAfterSeconds = NaN; if (retryAfter.endsWith("GMT")) { try { const date2 = serde.parseRfc7231DateTime(retryAfter); retryAfterSeconds = (date2.getTime() - Date.now()) / 1e3; } catch (e5) { logger2?.trace?.("Failed to parse retry-after header"); logger2?.trace?.(e5); } } else if (retryAfter.match(/ GMT, ((\d+)|(\d+\.\d+))$/)) { retryAfterSeconds = Number(retryAfter.match(/ GMT, ([\d.]+)$/)?.[1]); } else if (retryAfter.match(/^((\d+)|(\d+\.\d+))$/)) { retryAfterSeconds = Number(retryAfter); } else if (Date.parse(retryAfter) >= Date.now()) { retryAfterSeconds = (Date.parse(retryAfter) - Date.now()) / 1e3; } if (isNaN(retryAfterSeconds)) { return; } return new Date(Date.now() + retryAfterSeconds * 1e3); } else if (h5 === "x-amz-retry-after") { const v = response.headers[header]; const backoffMilliseconds = Number(v); if (isNaN(backoffMilliseconds)) { logger2?.trace?.(`Failed to parse x-amz-retry-after=${v}`); return; } return new Date(Date.now() + backoffMilliseconds); } } } function getRetryAfterHint(response, logger2) { return parseRetryAfterHeader(response, logger2); } var retryMiddleware = (options) => (next, context) => async (args) => { let retryStrategy = await options.retryStrategy(); const maxAttempts = await options.maxAttempts(); if (isRetryStrategyV2(retryStrategy)) { retryStrategy = retryStrategy; let retryToken = await retryStrategy.acquireInitialRetryToken((context["partition_id"] ?? "") + (context.__retryLongPoll ? ":longpoll" : "")); let lastError = new Error(); let attempts = 0; let totalRetryDelay = 0; const { request } = args; const isRequest = protocolHttp.HttpRequest.isInstance(request); if (isRequest) { request.headers[utilRetry.INVOCATION_ID_HEADER] = uuid.v4(); } while (true) { try { if (isRequest) { request.headers[utilRetry.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 (e5) { const retryErrorInfo = getRetryErrorInfo(e5, options.logger); lastError = asSdkError(e5); if (isRequest && isStreamingPayload.isStreamingPayload(request)) { (context.logger instanceof smithyClient.NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request."); throw lastError; } try { retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo); } catch (refreshError) { if (typeof refreshError.$backoff === "number") { await cooldown(refreshError.$backoff); } 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 cooldown(delay); } } } else { retryStrategy = retryStrategy; if (retryStrategy?.mode) { context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]]; } return retryStrategy.retry(next, args); } }; var cooldown = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined"; var getRetryErrorInfo = (error3, logger2) => { const errorInfo = { error: error3, errorType: getRetryErrorType(error3) }; const retryAfterHint = parseRetryAfterHeader(error3.$response, logger2); if (retryAfterHint) { errorInfo.retryAfterHint = retryAfterHint; } return errorInfo; }; var getRetryErrorType = (error3) => { if (serviceErrorClassification.isThrottlingError(error3)) return "THROTTLING"; if (serviceErrorClassification.isTransientError(error3)) return "TRANSIENT"; if (serviceErrorClassification.isServerError(error3)) return "SERVER_ERROR"; return "CLIENT_ERROR"; }; var retryMiddlewareOptions = { name: "retryMiddleware", tags: ["RETRY"], step: "finalizeRequest", priority: "high", override: true }; var getRetryPlugin5 = (options) => ({ applyToStack: (clientStack) => { clientStack.add(retryMiddleware(options), retryMiddlewareOptions); } }); exports2.AdaptiveRetryStrategy = AdaptiveRetryStrategy; exports2.CONFIG_MAX_ATTEMPTS = CONFIG_MAX_ATTEMPTS; exports2.CONFIG_RETRY_MODE = CONFIG_RETRY_MODE; exports2.ENV_MAX_ATTEMPTS = ENV_MAX_ATTEMPTS; exports2.ENV_RETRY_MODE = ENV_RETRY_MODE; exports2.NODE_MAX_ATTEMPT_CONFIG_OPTIONS = NODE_MAX_ATTEMPT_CONFIG_OPTIONS5; exports2.NODE_RETRY_MODE_CONFIG_OPTIONS = NODE_RETRY_MODE_CONFIG_OPTIONS5; exports2.StandardRetryStrategy = StandardRetryStrategy; exports2.defaultDelayDecider = defaultDelayDecider; exports2.defaultRetryDecider = defaultRetryDecider; exports2.getOmitRetryHeadersPlugin = getOmitRetryHeadersPlugin; exports2.getRetryAfterHint = getRetryAfterHint; exports2.getRetryPlugin = getRetryPlugin5; exports2.omitRetryHeadersMiddleware = omitRetryHeadersMiddleware; exports2.omitRetryHeadersMiddlewareOptions = omitRetryHeadersMiddlewareOptions; exports2.resolveRetryConfig = resolveRetryConfig5; exports2.retryMiddleware = retryMiddleware; exports2.retryMiddlewareOptions = retryMiddlewareOptions; } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js var import_protocol_http9, getDateHeader; var init_getDateHeader = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js"() { import_protocol_http9 = __toESM(require_dist_cjs2()); getDateHeader = (response) => import_protocol_http9.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0; } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js var getSkewCorrectedDate; var init_getSkewCorrectedDate = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js"() { getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset); } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js var isClockSkewed; var init_isClockSkewed = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js"() { init_getSkewCorrectedDate(); isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5; } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js var getUpdatedSystemClockOffset; var init_getUpdatedSystemClockOffset = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js"() { init_isClockSkewed(); getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => { const clockTimeInMs = Date.parse(clockTime); if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) { return clockTimeInMs - Date.now(); } return currentSystemClockOffset; }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js var init_utils = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/index.js"() { init_getDateHeader(); init_getSkewCorrectedDate(); init_getUpdatedSystemClockOffset(); } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js var import_protocol_http10, throwSigningPropertyError, validateSigningProperties, AwsSdkSigV4Signer, AWSSDKSigV4Signer; var init_AwsSdkSigV4Signer = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js"() { import_protocol_http10 = __toESM(require_dist_cjs2()); init_utils(); throwSigningPropertyError = (name, property) => { if (!property) { throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`); } return property; }; validateSigningProperties = async (signingProperties) => { const context = throwSigningPropertyError("context", signingProperties.context); const config = throwSigningPropertyError("config", signingProperties.config); const authScheme = context.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 }; }; AwsSdkSigV4Signer = class { async sign(httpRequest, identity, signingProperties) { if (!import_protocol_http10.HttpRequest.isInstance(httpRequest)) { 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(httpRequest, { signingDate: getSkewCorrectedDate(config.systemClockOffset), signingRegion, signingService: signingName }); return signedRequest; } errorHandler(signingProperties) { return (error3) => { const serverTime = error3.ServerTime ?? getDateHeader(error3.$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 && error3.$metadata) { error3.$metadata.clockSkewCorrected = true; } } throw error3; }; } successHandler(httpResponse, signingProperties) { const dateHeader = getDateHeader(httpResponse); if (dateHeader) { const config = throwSigningPropertyError("config", signingProperties.config); config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset); } } }; AWSSDKSigV4Signer = AwsSdkSigV4Signer; } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js var import_protocol_http11, AwsSdkSigV4ASigner; var init_AwsSdkSigV4ASigner = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js"() { import_protocol_http11 = __toESM(require_dist_cjs2()); init_utils(); init_AwsSdkSigV4Signer(); AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer { async sign(httpRequest, identity, signingProperties) { if (!import_protocol_http11.HttpRequest.isInstance(httpRequest)) { 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(httpRequest, { signingDate: getSkewCorrectedDate(config.systemClockOffset), signingRegion: multiRegionOverride, signingService: signingName }); return signedRequest; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.js var getArrayForCommaSeparatedString; var init_getArrayForCommaSeparatedString = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.js"() { getArrayForCommaSeparatedString = (str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : []; } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.js var getBearerTokenEnvKey; var init_getBearerTokenEnvKey = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.js"() { getBearerTokenEnvKey = (signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`; } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js var NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY, NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS; var init_NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js"() { init_getArrayForCommaSeparatedString(); init_getBearerTokenEnvKey(); NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE"; NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference"; NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = { environmentVariableSelector: (env, options) => { if (options?.signingName) { const bearerTokenKey = getBearerTokenEnvKey(options.signingName); if (bearerTokenKey in env) return ["httpBearerAuth"]; } if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env)) return void 0; return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]); }, configFileSelector: (profile) => { if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) return void 0; return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]); }, default: [] }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js var import_property_provider, resolveAwsSdkSigV4AConfig, NODE_SIGV4A_CONFIG_OPTIONS; var init_resolveAwsSdkSigV4AConfig = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js"() { init_dist_es(); import_property_provider = __toESM(require_dist_cjs28()); resolveAwsSdkSigV4AConfig = (config) => { config.sigv4aSigningRegionSet = normalizeProvider(config.sigv4aSigningRegionSet); return config; }; NODE_SIGV4A_CONFIG_OPTIONS = { environmentVariableSelector(env) { if (env.AWS_SIGV4A_SIGNING_REGION_SET) { return env.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim()); } throw new import_property_provider.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((_) => _.trim()); } throw new import_property_provider.ProviderError("sigv4a_signing_region_set not set in profile.", { tryNextLink: true }); }, default: void 0 }; } }); // node_modules/@smithy/signature-v4/dist-cjs/index.js var require_dist_cjs36 = __commonJS({ "node_modules/@smithy/signature-v4/dist-cjs/index.js"(exports2) { "use strict"; var utilHexEncoding = require_dist_cjs15(); var utilUtf8 = require_dist_cjs9(); var isArrayBuffer = require_dist_cjs7(); var protocolHttp = require_dist_cjs2(); var utilMiddleware = require_dist_cjs6(); var utilUriEscape = require_dist_cjs11(); var ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; var CREDENTIAL_QUERY_PARAM = "X-Amz-Credential"; var AMZ_DATE_QUERY_PARAM = "X-Amz-Date"; var SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; var EXPIRES_QUERY_PARAM = "X-Amz-Expires"; var SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; var TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; var REGION_SET_PARAM = "X-Amz-Region-Set"; var AUTH_HEADER = "authorization"; var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); var DATE_HEADER = "date"; var GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); var SHA256_HEADER = "x-amz-content-sha256"; var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); var HOST_HEADER = "host"; var 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 }; var PROXY_HEADER_PATTERN = /^proxy-/; var SEC_HEADER_PATTERN = /^sec-/; var UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i]; var ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; var ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; var EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; var UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; var MAX_CACHE_SIZE = 50; var KEY_TYPE_IDENTIFIER = "aws4_request"; var MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7; var signingKeyCache = {}; var cacheQueue = []; var createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`; var getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => { const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId); const cacheKey = `${shortDate}:${region}:${service}:${utilHexEncoding.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; }; var clearCredentialCache = () => { cacheQueue.length = 0; Object.keys(signingKeyCache).forEach((cacheKey) => { delete signingKeyCache[cacheKey]; }); }; var hmac = (ctor, secret, data3) => { const hash = new ctor(secret); hash.update(utilUtf8.toUint8Array(data3)); return hash.digest(); }; var getCanonicalHeaders = ({ 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; }; var getPayloadHash = 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.isArrayBuffer(body)) { const hashCtor = new hashConstructor(); hashCtor.update(utilUtf8.toUint8Array(body)); return utilHexEncoding.toHex(await hashCtor.digest()); } return UNSIGNED_PAYLOAD; }; var HeaderFormatter = class { format(headers) { const chunks = []; for (const headerName of Object.keys(headers)) { const bytes = utilUtf8.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 = utilUtf8.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(utilHexEncoding.fromHex(header.value.replace(/\-/g, "")), 1); return uuidBytes; } } }; var HEADER_VALUE_TYPE; (function(HEADER_VALUE_TYPE2) { HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["boolTrue"] = 0] = "boolTrue"; HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["boolFalse"] = 1] = "boolFalse"; HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["byte"] = 2] = "byte"; HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["short"] = 3] = "short"; HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["integer"] = 4] = "integer"; HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["long"] = 5] = "long"; HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["byteArray"] = 6] = "byteArray"; HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["string"] = 7] = "string"; HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["timestamp"] = 8] = "timestamp"; HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["uuid"] = 9] = "uuid"; })(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {})); var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/; var Int64 = class _Int64 { bytes; 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(utilHexEncoding.toHex(bytes), 16) * (negative ? -1 : 1); } toString() { return String(this.valueOf()); } }; 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 hasHeader = (soughtHeader, headers) => { soughtHeader = soughtHeader.toLowerCase(); for (const headerName of Object.keys(headers)) { if (soughtHeader === headerName.toLowerCase()) { return true; } } return false; }; var moveHeadersToQuery = (request, options = {}) => { const { headers, query = {} } = protocolHttp.HttpRequest.clone(request); for (const name of Object.keys(headers)) { const lname = name.toLowerCase(); if (lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname) || options.hoistableHeaders?.has(lname)) { query[name] = headers[name]; delete headers[name]; } } return { ...request, headers, query }; }; var prepareRequest = (request) => { request = protocolHttp.HttpRequest.clone(request); for (const headerName of Object.keys(request.headers)) { if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) { delete request.headers[headerName]; } } return request; }; var getCanonicalQuery = ({ query = {} }) => { const keys = []; const serialized = {}; for (const key of Object.keys(query)) { if (key.toLowerCase() === SIGNATURE_HEADER) { continue; } const encodedKey = utilUriEscape.escapeUri(key); keys.push(encodedKey); const value = query[key]; if (typeof value === "string") { serialized[encodedKey] = `${encodedKey}=${utilUriEscape.escapeUri(value)}`; } else if (Array.isArray(value)) { serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${encodedKey}=${utilUriEscape.escapeUri(value2)}`]), []).sort().join("&"); } } return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&"); }; var iso8601 = (time2) => toDate(time2).toISOString().replace(/\.\d{3}Z$/, "Z"); var toDate = (time2) => { if (typeof time2 === "number") { return new Date(time2 * 1e3); } if (typeof time2 === "string") { if (Number(time2)) { return new Date(Number(time2) * 1e3); } return new Date(time2); } return time2; }; var SignatureV4Base = class { service; regionProvider; credentialProvider; sha256; uriEscapePath; applyChecksum; constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) { this.service = service; this.sha256 = sha256; this.uriEscapePath = uriEscapePath; this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true; this.regionProvider = utilMiddleware.normalizeProvider(region); this.credentialProvider = utilMiddleware.normalizeProvider(credentials); } createCanonicalRequest(request, canonicalHeaders, payloadHash) { const sortedHeaders = Object.keys(canonicalHeaders).sort(); return `${request.method} ${this.getCanonicalPath(request)} ${getCanonicalQuery(request)} ${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} ${sortedHeaders.join(";")} ${payloadHash}`; } async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) { const hash = new this.sha256(); hash.update(utilUtf8.toUint8Array(canonicalRequest)); const hashedRequest = await hash.digest(); return `${algorithmIdentifier} ${longDate} ${credentialScope} ${utilHexEncoding.toHex(hashedRequest)}`; } getCanonicalPath({ path: path3 }) { if (this.uriEscapePath) { const normalizedPathSegments = []; for (const pathSegment of path3.split("/")) { if (pathSegment?.length === 0) continue; if (pathSegment === ".") continue; if (pathSegment === "..") { normalizedPathSegments.pop(); } else { normalizedPathSegments.push(pathSegment); } } const normalizedPath = `${path3?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path3?.endsWith("/") ? "/" : ""}`; const doubleEncoded = utilUriEscape.escapeUri(normalizedPath); return doubleEncoded.replace(/%2F/g, "/"); } return path3; } validateResolvedCredentials(credentials) { if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") { throw new Error("Resolved credential object is not valid"); } } formatDate(now) { const longDate = iso8601(now).replace(/[\-:]/g, ""); return { longDate, shortDate: longDate.slice(0, 8) }; } getCanonicalHeaderList(headers) { return Object.keys(headers).sort().join(";"); } }; var SignatureV42 = class extends SignatureV4Base { headerFormatter = new HeaderFormatter(); constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) { super({ applyChecksum, credentials, region, service, sha256, uriEscapePath }); } async presign(originalRequest, options = {}) { const { signingDate = /* @__PURE__ */ new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, hoistableHeaders, signingRegion, signingService } = options; const credentials = await this.credentialProvider(); this.validateResolvedCredentials(credentials); const region = signingRegion ?? await this.regionProvider(); const { longDate, shortDate } = this.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 request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders }); if (credentials.sessionToken) { request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken; } request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER; request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`; request.query[AMZ_DATE_QUERY_PARAM] = longDate; request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); request.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders); request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256))); return request; } async sign(toSign, options) { if (typeof toSign === "string") { return this.signString(toSign, options); } else if (toSign.headers && toSign.payload) { return this.signEvent(toSign, options); } else if (toSign.message) { return this.signMessage(toSign, options); } else { return this.signRequest(toSign, options); } } async signEvent({ headers, payload: payload2 }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService, eventStreamCredentials }) { const region = signingRegion ?? await this.regionProvider(); const { shortDate, longDate } = this.formatDate(signingDate); const scope = createScope(shortDate, region, signingService ?? this.service); const hashedPayload = await getPayloadHash({ headers: {}, body: payload2 }, this.sha256); const hash = new this.sha256(); hash.update(headers); const hashedHeaders = utilHexEncoding.toHex(await hash.digest()); const stringToSign = [ EVENT_ALGORITHM_IDENTIFIER, longDate, scope, priorSignature, hashedHeaders, hashedPayload ].join("\n"); return this.signString(stringToSign, { signingDate, signingRegion: region, signingService, eventStreamCredentials }); } async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService, eventStreamCredentials }) { const promise = this.signEvent({ headers: this.headerFormatter.format(signableMessage.message.headers), payload: signableMessage.message.body }, { signingDate, signingRegion, signingService, priorSignature: signableMessage.priorSignature, eventStreamCredentials }); return promise.then((signature) => { return { message: signableMessage.message, signature }; }); } async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService, eventStreamCredentials } = {}) { const credentials = eventStreamCredentials ?? await this.credentialProvider(); this.validateResolvedCredentials(credentials); const region = signingRegion ?? await this.regionProvider(); const { shortDate } = this.formatDate(signingDate); const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); hash.update(utilUtf8.toUint8Array(stringToSign)); return utilHexEncoding.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 request = prepareRequest(requestToSign); const { longDate, shortDate } = this.formatDate(signingDate); const scope = createScope(shortDate, region, signingService ?? this.service); request.headers[AMZ_DATE_HEADER] = longDate; if (credentials.sessionToken) { request.headers[TOKEN_HEADER] = credentials.sessionToken; } const payloadHash = await getPayloadHash(request, this.sha256); if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) { request.headers[SHA256_HEADER] = payloadHash; } const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash)); request.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`; return request; } async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest, ALGORITHM_IDENTIFIER); const hash = new this.sha256(await keyPromise); hash.update(utilUtf8.toUint8Array(stringToSign)); return utilHexEncoding.toHex(await hash.digest()); } getSigningKey(credentials, region, shortDate, service) { return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); } }; var signatureV4aContainer = { SignatureV4a: null }; exports2.ALGORITHM_IDENTIFIER = ALGORITHM_IDENTIFIER; exports2.ALGORITHM_IDENTIFIER_V4A = ALGORITHM_IDENTIFIER_V4A; exports2.ALGORITHM_QUERY_PARAM = ALGORITHM_QUERY_PARAM; exports2.ALWAYS_UNSIGNABLE_HEADERS = ALWAYS_UNSIGNABLE_HEADERS; exports2.AMZ_DATE_HEADER = AMZ_DATE_HEADER; exports2.AMZ_DATE_QUERY_PARAM = AMZ_DATE_QUERY_PARAM; exports2.AUTH_HEADER = AUTH_HEADER; exports2.CREDENTIAL_QUERY_PARAM = CREDENTIAL_QUERY_PARAM; exports2.DATE_HEADER = DATE_HEADER; exports2.EVENT_ALGORITHM_IDENTIFIER = EVENT_ALGORITHM_IDENTIFIER; exports2.EXPIRES_QUERY_PARAM = EXPIRES_QUERY_PARAM; exports2.GENERATED_HEADERS = GENERATED_HEADERS; exports2.HOST_HEADER = HOST_HEADER; exports2.KEY_TYPE_IDENTIFIER = KEY_TYPE_IDENTIFIER; exports2.MAX_CACHE_SIZE = MAX_CACHE_SIZE; exports2.MAX_PRESIGNED_TTL = MAX_PRESIGNED_TTL; exports2.PROXY_HEADER_PATTERN = PROXY_HEADER_PATTERN; exports2.REGION_SET_PARAM = REGION_SET_PARAM; exports2.SEC_HEADER_PATTERN = SEC_HEADER_PATTERN; exports2.SHA256_HEADER = SHA256_HEADER; exports2.SIGNATURE_HEADER = SIGNATURE_HEADER; exports2.SIGNATURE_QUERY_PARAM = SIGNATURE_QUERY_PARAM; exports2.SIGNED_HEADERS_QUERY_PARAM = SIGNED_HEADERS_QUERY_PARAM; exports2.SignatureV4 = SignatureV42; exports2.SignatureV4Base = SignatureV4Base; exports2.TOKEN_HEADER = TOKEN_HEADER; exports2.TOKEN_QUERY_PARAM = TOKEN_QUERY_PARAM; exports2.UNSIGNABLE_PATTERNS = UNSIGNABLE_PATTERNS; exports2.UNSIGNED_PAYLOAD = UNSIGNED_PAYLOAD; exports2.clearCredentialCache = clearCredentialCache; exports2.createScope = createScope; exports2.getCanonicalHeaders = getCanonicalHeaders; exports2.getCanonicalQuery = getCanonicalQuery; exports2.getPayloadHash = getPayloadHash; exports2.getSigningKey = getSigningKey; exports2.hasHeader = hasHeader; exports2.moveHeadersToQuery = moveHeadersToQuery; exports2.prepareRequest = prepareRequest; exports2.signatureV4aContainer = signatureV4aContainer; } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js function normalizeCredentialProvider(config, { credentials, credentialDefaultProvider }) { let credentialsProvider; if (credentials) { if (!credentials?.memoized) { credentialsProvider = memoizeIdentityProvider(credentials, isIdentityExpired, doesIdentityRequireRefresh); } else { credentialsProvider = credentials; } } else { if (credentialDefaultProvider) { credentialsProvider = normalizeProvider(credentialDefaultProvider(Object.assign({}, config, { parentClientConfig: config }))); } else { credentialsProvider = async () => { throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured."); }; } } credentialsProvider.memoized = true; return credentialsProvider; } function bindCallerConfig(config, credentialsProvider) { if (credentialsProvider.configBound) { return credentialsProvider; } const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config }); fn.memoized = credentialsProvider.memoized; fn.configBound = true; return fn; } var import_signature_v4, resolveAwsSdkSigV4Config, resolveAWSSDKSigV4Config; var init_resolveAwsSdkSigV4Config = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js"() { init_client(); init_dist_es(); import_signature_v4 = __toESM(require_dist_cjs36()); resolveAwsSdkSigV4Config = (config) => { let inputCredentials = config.credentials; let isUserSupplied = !!config.credentials; let resolvedCredentials = void 0; Object.defineProperty(config, "credentials", { set(credentials) { if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) { isUserSupplied = true; } inputCredentials = credentials; const memoizedProvider = normalizeCredentialProvider(config, { credentials: inputCredentials, credentialDefaultProvider: config.credentialDefaultProvider }); const boundProvider = bindCallerConfig(config, memoizedProvider); if (isUserSupplied && !boundProvider.attributed) { const isCredentialObject = typeof inputCredentials === "object" && inputCredentials !== null; resolvedCredentials = async (options) => { const creds = await boundProvider(options); const attributedCreds = creds; if (isCredentialObject && (!attributedCreds.$source || Object.keys(attributedCreds.$source).length === 0)) { return setCredentialFeature(attributedCreds, "CREDENTIALS_CODE", "e"); } return attributedCreds; }; resolvedCredentials.memoized = boundProvider.memoized; resolvedCredentials.configBound = boundProvider.configBound; resolvedCredentials.attributed = true; } else { resolvedCredentials = boundProvider; } }, get() { return resolvedCredentials; }, enumerable: true, configurable: true }); config.credentials = inputCredentials; const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256 } = config; let signer; if (config.signer) { signer = normalizeProvider(config.signer); } else if (config.regionInfoProvider) { signer = () => normalizeProvider(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: config.credentials, region: config.signingRegion, service: config.signingName, sha256, uriEscapePath: signingEscapePath }; const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4; return new SignerCtor(params); }); } else { signer = async (authScheme) => { authScheme = Object.assign({}, { name: "sigv4", signingName: config.signingName || config.defaultSigningName, signingRegion: await normalizeProvider(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: config.credentials, region: config.signingRegion, service: config.signingName, sha256, uriEscapePath: signingEscapePath }; const SignerCtor = config.signerConstructor || import_signature_v4.SignatureV4; return new SignerCtor(params); }; } const resolvedConfig = Object.assign(config, { systemClockOffset, signingEscapePath, signer }); return resolvedConfig; }; resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config; } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js var init_aws_sdk = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js"() { init_AwsSdkSigV4Signer(); init_AwsSdkSigV4ASigner(); init_NODE_AUTH_SCHEME_PREFERENCE_OPTIONS(); init_resolveAwsSdkSigV4AConfig(); init_resolveAwsSdkSigV4Config(); } }); // node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js var httpAuthSchemes_exports = {}; __export(httpAuthSchemes_exports, { AWSSDKSigV4Signer: () => AWSSDKSigV4Signer, AwsSdkSigV4ASigner: () => AwsSdkSigV4ASigner, AwsSdkSigV4Signer: () => AwsSdkSigV4Signer, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS: () => NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, NODE_SIGV4A_CONFIG_OPTIONS: () => NODE_SIGV4A_CONFIG_OPTIONS, getBearerTokenEnvKey: () => getBearerTokenEnvKey, resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config, resolveAwsSdkSigV4AConfig: () => resolveAwsSdkSigV4AConfig, resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config, validateSigningProperties: () => validateSigningProperties }); var init_httpAuthSchemes2 = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js"() { init_aws_sdk(); init_getBearerTokenEnvKey(); } }); // node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/toStream.js var require_toStream = __commonJS({ "node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/toStream.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.toStream = toStream; var node_stream_1 = require("node:stream"); function toStream(bytes) { return node_stream_1.Readable.from(Buffer.from(bytes)); } } }); // node_modules/@aws-sdk/util-arn-parser/dist-cjs/index.js var require_dist_cjs37 = __commonJS({ "node_modules/@aws-sdk/util-arn-parser/dist-cjs/index.js"(exports2) { "use strict"; var validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6; var parse = (arn) => { const segments = arn.split(":"); if (segments.length < 6 || segments[0] !== "arn") throw new Error("Malformed ARN"); const [, partition, service, region, accountId, ...resource] = segments; return { partition, service, region, accountId, resource: resource.join(":") }; }; var build = (arnObject) => { const { partition = "aws", service, region, accountId, resource } = arnObject; if ([service, region, accountId, resource].some((segment) => typeof segment !== "string")) { throw new Error("Input ARN object is invalid"); } return `arn:${partition}:${service}:${region}:${accountId}:${resource}`; }; exports2.build = build; exports2.parse = parse; exports2.validate = validate; } }); // node_modules/@smithy/core/dist-es/submodules/cbor/cbor-types.js function alloc(size) { return typeof Buffer !== "undefined" ? Buffer.alloc(size) : new Uint8Array(size); } function tag(data3) { data3[tagSymbol] = true; return data3; } var majorUint64, majorNegativeInt64, majorUnstructuredByteString, majorUtf8String, majorList, majorMap, majorTag, majorSpecial, specialFalse, specialTrue, specialNull, specialUndefined, extendedOneByte, extendedFloat16, extendedFloat32, extendedFloat64, minorIndefinite, tagSymbol; var init_cbor_types = __esm({ "node_modules/@smithy/core/dist-es/submodules/cbor/cbor-types.js"() { majorUint64 = 0; majorNegativeInt64 = 1; majorUnstructuredByteString = 2; majorUtf8String = 3; majorList = 4; majorMap = 5; majorTag = 6; majorSpecial = 7; specialFalse = 20; specialTrue = 21; specialNull = 22; specialUndefined = 23; extendedOneByte = 24; extendedFloat16 = 25; extendedFloat32 = 26; extendedFloat64 = 27; minorIndefinite = 31; tagSymbol = /* @__PURE__ */ Symbol("@smithy/core/cbor::tagSymbol"); } }); // node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js function setPayload(bytes) { payload = bytes; dataView = new DataView(payload.buffer, payload.byteOffset, payload.byteLength); } function decode(at, to) { if (at >= to) { throw new Error("unexpected end of (decode) payload."); } const major = (payload[at] & 224) >> 5; const minor = payload[at] & 31; switch (major) { case majorUint64: case majorNegativeInt64: case majorTag: let unsignedInt; let offset; if (minor < 24) { unsignedInt = minor; offset = 1; } else { switch (minor) { case extendedOneByte: case extendedFloat16: case extendedFloat32: case extendedFloat64: const countLength = minorValueToArgumentLength[minor]; const countOffset = countLength + 1; offset = countOffset; if (to - at < countOffset) { throw new Error(`countLength ${countLength} greater than remaining buf len.`); } const countIndex = at + 1; if (countLength === 1) { unsignedInt = payload[countIndex]; } else if (countLength === 2) { unsignedInt = dataView.getUint16(countIndex); } else if (countLength === 4) { unsignedInt = dataView.getUint32(countIndex); } else { unsignedInt = dataView.getBigUint64(countIndex); } break; default: throw new Error(`unexpected minor value ${minor}.`); } } if (major === majorUint64) { _offset = offset; return castBigInt(unsignedInt); } else if (major === majorNegativeInt64) { let negativeInt; if (typeof unsignedInt === "bigint") { negativeInt = BigInt(-1) - unsignedInt; } else { negativeInt = -1 - unsignedInt; } _offset = offset; return castBigInt(negativeInt); } else { if (minor === 2 || minor === 3) { const length = decodeCount(at + offset, to); let b6 = BigInt(0); const start = at + offset + _offset; for (let i5 = start; i5 < start + length; ++i5) { b6 = b6 << BigInt(8) | BigInt(payload[i5]); } _offset = offset + _offset + length; return minor === 3 ? -b6 - BigInt(1) : b6; } else if (minor === 4) { const decimalFraction = decode(at + offset, to); const [exponent, mantissa] = decimalFraction; const normalizer = mantissa < 0 ? -1 : 1; const mantissaStr = "0".repeat(Math.abs(exponent) + 1) + String(BigInt(normalizer) * BigInt(mantissa)); let numericString; const sign = mantissa < 0 ? "-" : ""; numericString = exponent === 0 ? mantissaStr : mantissaStr.slice(0, mantissaStr.length + exponent) + "." + mantissaStr.slice(exponent); numericString = numericString.replace(/^0+/g, ""); if (numericString === "") { numericString = "0"; } if (numericString[0] === ".") { numericString = "0" + numericString; } numericString = sign + numericString; _offset = offset + _offset; return nv(numericString); } else { const value = decode(at + offset, to); const valueOffset = _offset; _offset = offset + valueOffset; return tag({ tag: castBigInt(unsignedInt), value }); } } case majorUtf8String: case majorMap: case majorList: case majorUnstructuredByteString: if (minor === minorIndefinite) { switch (major) { case majorUtf8String: return decodeUtf8StringIndefinite(at, to); case majorMap: return decodeMapIndefinite(at, to); case majorList: return decodeListIndefinite(at, to); case majorUnstructuredByteString: return decodeUnstructuredByteStringIndefinite(at, to); } } else { switch (major) { case majorUtf8String: return decodeUtf8String(at, to); case majorMap: return decodeMap(at, to); case majorList: return decodeList(at, to); case majorUnstructuredByteString: return decodeUnstructuredByteString(at, to); } } default: return decodeSpecial(at, to); } } function bytesToUtf8(bytes, at, to) { if (USE_BUFFER && bytes.constructor?.name === "Buffer") { return bytes.toString("utf-8", at, to); } if (textDecoder) { return textDecoder.decode(bytes.subarray(at, to)); } return (0, import_util_utf84.toUtf8)(bytes.subarray(at, to)); } function demote(bigInteger) { const num = Number(bigInteger); if (num < Number.MIN_SAFE_INTEGER || Number.MAX_SAFE_INTEGER < num) { console.warn(new Error(`@smithy/core/cbor - truncating BigInt(${bigInteger}) to ${num} with loss of precision.`)); } return num; } function bytesToFloat16(a5, b6) { const sign = a5 >> 7; const exponent = (a5 & 124) >> 2; const fraction = (a5 & 3) << 8 | b6; const scalar = sign === 0 ? 1 : -1; let exponentComponent; let summation; if (exponent === 0) { if (fraction === 0) { return 0; } else { exponentComponent = Math.pow(2, 1 - 15); summation = 0; } } else if (exponent === 31) { if (fraction === 0) { return scalar * Infinity; } else { return NaN; } } else { exponentComponent = Math.pow(2, exponent - 15); summation = 1; } summation += fraction / 1024; return scalar * (exponentComponent * summation); } function decodeCount(at, to) { const minor = payload[at] & 31; if (minor < 24) { _offset = 1; return minor; } if (minor === extendedOneByte || minor === extendedFloat16 || minor === extendedFloat32 || minor === extendedFloat64) { const countLength = minorValueToArgumentLength[minor]; _offset = countLength + 1; if (to - at < _offset) { throw new Error(`countLength ${countLength} greater than remaining buf len.`); } const countIndex = at + 1; if (countLength === 1) { return payload[countIndex]; } else if (countLength === 2) { return dataView.getUint16(countIndex); } else if (countLength === 4) { return dataView.getUint32(countIndex); } return demote(dataView.getBigUint64(countIndex)); } throw new Error(`unexpected minor value ${minor}.`); } function decodeUtf8String(at, to) { const length = decodeCount(at, to); const offset = _offset; at += offset; if (to - at < length) { throw new Error(`string len ${length} greater than remaining buf len.`); } const value = bytesToUtf8(payload, at, at + length); _offset = offset + length; return value; } function decodeUtf8StringIndefinite(at, to) { at += 1; const vector = []; for (const base = at; at < to; ) { if (payload[at] === 255) { const data3 = alloc(vector.length); data3.set(vector, 0); _offset = at - base + 2; return bytesToUtf8(data3, 0, data3.length); } const major = (payload[at] & 224) >> 5; const minor = payload[at] & 31; if (major !== majorUtf8String) { throw new Error(`unexpected major type ${major} in indefinite string.`); } if (minor === minorIndefinite) { throw new Error("nested indefinite string."); } const bytes = decodeUnstructuredByteString(at, to); const length = _offset; at += length; for (let i5 = 0; i5 < bytes.length; ++i5) { vector.push(bytes[i5]); } } throw new Error("expected break marker."); } function decodeUnstructuredByteString(at, to) { const length = decodeCount(at, to); const offset = _offset; at += offset; if (to - at < length) { throw new Error(`unstructured byte string len ${length} greater than remaining buf len.`); } const value = payload.subarray(at, at + length); _offset = offset + length; return value; } function decodeUnstructuredByteStringIndefinite(at, to) { at += 1; const vector = []; for (const base = at; at < to; ) { if (payload[at] === 255) { const data3 = alloc(vector.length); data3.set(vector, 0); _offset = at - base + 2; return data3; } const major = (payload[at] & 224) >> 5; const minor = payload[at] & 31; if (major !== majorUnstructuredByteString) { throw new Error(`unexpected major type ${major} in indefinite string.`); } if (minor === minorIndefinite) { throw new Error("nested indefinite string."); } const bytes = decodeUnstructuredByteString(at, to); const length = _offset; at += length; for (let i5 = 0; i5 < bytes.length; ++i5) { vector.push(bytes[i5]); } } throw new Error("expected break marker."); } function decodeList(at, to) { const listDataLength = decodeCount(at, to); const offset = _offset; at += offset; const base = at; const list2 = Array(listDataLength); for (let i5 = 0; i5 < listDataLength; ++i5) { const item = decode(at, to); const itemOffset = _offset; list2[i5] = item; at += itemOffset; } _offset = offset + (at - base); return list2; } function decodeListIndefinite(at, to) { at += 1; const list2 = []; for (const base = at; at < to; ) { if (payload[at] === 255) { _offset = at - base + 2; return list2; } const item = decode(at, to); const n3 = _offset; at += n3; list2.push(item); } throw new Error("expected break marker."); } function decodeMap(at, to) { const mapDataLength = decodeCount(at, to); const offset = _offset; at += offset; const base = at; const map2 = {}; for (let i5 = 0; i5 < mapDataLength; ++i5) { if (at >= to) { throw new Error("unexpected end of map payload."); } const major = (payload[at] & 224) >> 5; if (major !== majorUtf8String) { throw new Error(`unexpected major type ${major} for map key at index ${at}.`); } const key = decode(at, to); at += _offset; const value = decode(at, to); at += _offset; map2[key] = value; } _offset = offset + (at - base); return map2; } function decodeMapIndefinite(at, to) { at += 1; const base = at; const map2 = {}; for (; at < to; ) { if (at >= to) { throw new Error("unexpected end of map payload."); } if (payload[at] === 255) { _offset = at - base + 2; return map2; } const major = (payload[at] & 224) >> 5; if (major !== majorUtf8String) { throw new Error(`unexpected major type ${major} for map key.`); } const key = decode(at, to); at += _offset; const value = decode(at, to); at += _offset; map2[key] = value; } throw new Error("expected break marker."); } function decodeSpecial(at, to) { const minor = payload[at] & 31; switch (minor) { case specialTrue: case specialFalse: _offset = 1; return minor === specialTrue; case specialNull: _offset = 1; return null; case specialUndefined: _offset = 1; return null; case extendedFloat16: if (to - at < 3) { throw new Error("incomplete float16 at end of buf."); } _offset = 3; return bytesToFloat16(payload[at + 1], payload[at + 2]); case extendedFloat32: if (to - at < 5) { throw new Error("incomplete float32 at end of buf."); } _offset = 5; return dataView.getFloat32(at + 1); case extendedFloat64: if (to - at < 9) { throw new Error("incomplete float64 at end of buf."); } _offset = 9; return dataView.getFloat64(at + 1); default: throw new Error(`unexpected minor value ${minor}.`); } } function castBigInt(bigInt) { if (typeof bigInt === "number") { return bigInt; } const num = Number(bigInt); if (Number.MIN_SAFE_INTEGER <= num && num <= Number.MAX_SAFE_INTEGER) { return num; } return bigInt; } var import_util_utf84, USE_TEXT_DECODER, USE_BUFFER, payload, dataView, textDecoder, _offset, minorValueToArgumentLength; var init_cbor_decode = __esm({ "node_modules/@smithy/core/dist-es/submodules/cbor/cbor-decode.js"() { init_serde(); import_util_utf84 = __toESM(require_dist_cjs9()); init_cbor_types(); USE_TEXT_DECODER = typeof TextDecoder !== "undefined"; USE_BUFFER = typeof Buffer !== "undefined"; payload = alloc(0); dataView = new DataView(payload.buffer, payload.byteOffset, payload.byteLength); textDecoder = USE_TEXT_DECODER ? new TextDecoder() : null; _offset = 0; minorValueToArgumentLength = { [extendedOneByte]: 1, [extendedFloat16]: 2, [extendedFloat32]: 4, [extendedFloat64]: 8 }; } }); // node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js function ensureSpace(bytes) { const remaining = data.byteLength - cursor; if (remaining < bytes) { if (cursor < 16e6) { resize(Math.max(data.byteLength * 4, data.byteLength + bytes)); } else { resize(data.byteLength + bytes + 16e6); } } } function toUint8Array() { const out = alloc(cursor); out.set(data.subarray(0, cursor), 0); cursor = 0; return out; } function resize(size) { const old = data; data = alloc(size); if (old) { if (old.copy) { old.copy(data, 0, 0, old.byteLength); } else { data.set(old, 0); } } dataView2 = new DataView(data.buffer, data.byteOffset, data.byteLength); } function encodeHeader(major, value) { if (value < 24) { data[cursor++] = major << 5 | value; } else if (value < 1 << 8) { data[cursor++] = major << 5 | 24; data[cursor++] = value; } else if (value < 1 << 16) { data[cursor++] = major << 5 | extendedFloat16; dataView2.setUint16(cursor, value); cursor += 2; } else if (value < 2 ** 32) { data[cursor++] = major << 5 | extendedFloat32; dataView2.setUint32(cursor, value); cursor += 4; } else { data[cursor++] = major << 5 | extendedFloat64; dataView2.setBigUint64(cursor, typeof value === "bigint" ? value : BigInt(value)); cursor += 8; } } function encode(_input) { const encodeStack = [_input]; while (encodeStack.length) { const input = encodeStack.pop(); ensureSpace(typeof input === "string" ? input.length * 4 : 64); if (typeof input === "string") { if (USE_BUFFER2) { encodeHeader(majorUtf8String, Buffer.byteLength(input)); cursor += data.write(input, cursor); } else { const bytes = (0, import_util_utf85.fromUtf8)(input); encodeHeader(majorUtf8String, bytes.byteLength); data.set(bytes, cursor); cursor += bytes.byteLength; } continue; } else if (typeof input === "number") { if (Number.isInteger(input)) { const nonNegative = input >= 0; const major = nonNegative ? majorUint64 : majorNegativeInt64; const value = nonNegative ? input : -input - 1; if (value < 24) { data[cursor++] = major << 5 | value; } else if (value < 256) { data[cursor++] = major << 5 | 24; data[cursor++] = value; } else if (value < 65536) { data[cursor++] = major << 5 | extendedFloat16; data[cursor++] = value >> 8; data[cursor++] = value; } else if (value < 4294967296) { data[cursor++] = major << 5 | extendedFloat32; dataView2.setUint32(cursor, value); cursor += 4; } else { data[cursor++] = major << 5 | extendedFloat64; dataView2.setBigUint64(cursor, BigInt(value)); cursor += 8; } continue; } data[cursor++] = majorSpecial << 5 | extendedFloat64; dataView2.setFloat64(cursor, input); cursor += 8; continue; } else if (typeof input === "bigint") { const nonNegative = input >= 0; const major = nonNegative ? majorUint64 : majorNegativeInt64; const value = nonNegative ? input : -input - BigInt(1); const n3 = Number(value); if (n3 < 24) { data[cursor++] = major << 5 | n3; } else if (n3 < 256) { data[cursor++] = major << 5 | 24; data[cursor++] = n3; } else if (n3 < 65536) { data[cursor++] = major << 5 | extendedFloat16; data[cursor++] = n3 >> 8; data[cursor++] = n3 & 255; } else if (n3 < 4294967296) { data[cursor++] = major << 5 | extendedFloat32; dataView2.setUint32(cursor, n3); cursor += 4; } else if (value < BigInt("18446744073709551616")) { data[cursor++] = major << 5 | extendedFloat64; dataView2.setBigUint64(cursor, value); cursor += 8; } else { const binaryBigInt = value.toString(2); const bigIntBytes = new Uint8Array(Math.ceil(binaryBigInt.length / 8)); let b6 = value; let i5 = 0; while (bigIntBytes.byteLength - ++i5 >= 0) { bigIntBytes[bigIntBytes.byteLength - i5] = Number(b6 & BigInt(255)); b6 >>= BigInt(8); } ensureSpace(bigIntBytes.byteLength * 2); data[cursor++] = nonNegative ? 194 : 195; if (USE_BUFFER2) { encodeHeader(majorUnstructuredByteString, Buffer.byteLength(bigIntBytes)); } else { encodeHeader(majorUnstructuredByteString, bigIntBytes.byteLength); } data.set(bigIntBytes, cursor); cursor += bigIntBytes.byteLength; } continue; } else if (input === null) { data[cursor++] = majorSpecial << 5 | specialNull; continue; } else if (typeof input === "boolean") { data[cursor++] = majorSpecial << 5 | (input ? specialTrue : specialFalse); continue; } else if (typeof input === "undefined") { throw new Error("@smithy/core/cbor: client may not serialize undefined value."); } else if (Array.isArray(input)) { for (let i5 = input.length - 1; i5 >= 0; --i5) { encodeStack.push(input[i5]); } encodeHeader(majorList, input.length); continue; } else if (typeof input.byteLength === "number") { ensureSpace(input.length * 2); encodeHeader(majorUnstructuredByteString, input.length); data.set(input, cursor); cursor += input.byteLength; continue; } else if (typeof input === "object") { if (input instanceof NumericValue) { const decimalIndex = input.string.indexOf("."); const exponent = decimalIndex === -1 ? 0 : decimalIndex - input.string.length + 1; const mantissa = BigInt(input.string.replace(".", "")); data[cursor++] = 196; encodeStack.push(mantissa); encodeStack.push(exponent); encodeHeader(majorList, 2); continue; } if (input[tagSymbol]) { if ("tag" in input && "value" in input) { encodeStack.push(input.value); encodeHeader(majorTag, input.tag); continue; } else { throw new Error("tag encountered with missing fields, need 'tag' and 'value', found: " + JSON.stringify(input)); } } const keys = Object.keys(input); for (let i5 = keys.length - 1; i5 >= 0; --i5) { const key = keys[i5]; encodeStack.push(input[key]); encodeStack.push(key); } encodeHeader(majorMap, keys.length); continue; } throw new Error(`data type ${input?.constructor?.name ?? typeof input} not compatible for encoding.`); } } var import_util_utf85, USE_BUFFER2, initialSize, data, dataView2, cursor; var init_cbor_encode = __esm({ "node_modules/@smithy/core/dist-es/submodules/cbor/cbor-encode.js"() { init_serde(); import_util_utf85 = __toESM(require_dist_cjs9()); init_cbor_types(); USE_BUFFER2 = typeof Buffer !== "undefined"; initialSize = 2048; data = alloc(initialSize); dataView2 = new DataView(data.buffer, data.byteOffset, data.byteLength); cursor = 0; } }); // node_modules/@smithy/core/dist-es/submodules/cbor/cbor.js var cbor; var init_cbor = __esm({ "node_modules/@smithy/core/dist-es/submodules/cbor/cbor.js"() { init_cbor_decode(); init_cbor_encode(); cbor = { deserialize(payload2) { setPayload(payload2); return decode(0, payload2.length); }, serialize(input) { try { encode(input); return toUint8Array(); } catch (e5) { toUint8Array(); throw e5; } }, resizeEncodingBuffer(size) { resize(size); } }; } }); // node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js var dateToTag, loadSmithyRpcV2CborErrorCode; var init_parseCborBody = __esm({ "node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js"() { init_cbor_types(); dateToTag = (date2) => { return tag({ tag: 1, value: date2.getTime() / 1e3 }); }; loadSmithyRpcV2CborErrorCode = (output, data3) => { const sanitizeErrorCode2 = (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; }; if (data3["__type"] !== void 0) { return sanitizeErrorCode2(data3["__type"]); } let codeKey; for (const key in data3) { if (key.toLowerCase() === "code") { codeKey = key; break; } } if (codeKey && data3[codeKey] !== void 0) { return sanitizeErrorCode2(data3[codeKey]); } }; } }); // node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js var import_util_base643, CborCodec, CborShapeSerializer, CborShapeDeserializer; var init_CborCodec = __esm({ "node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js"() { init_protocols(); init_schema(); init_serde(); init_serde(); import_util_base643 = __toESM(require_dist_cjs10()); init_cbor(); init_parseCborBody(); CborCodec = class extends SerdeContext { createSerializer() { const serializer = new CborShapeSerializer(); serializer.setSerdeContext(this.serdeContext); return serializer; } createDeserializer() { const deserializer = new CborShapeDeserializer(); deserializer.setSerdeContext(this.serdeContext); return deserializer; } }; CborShapeSerializer = class extends SerdeContext { value; write(schema, value) { this.value = this.serialize(schema, value); } serialize(schema, source) { const ns = NormalizedSchema.of(schema); if (source == null) { if (ns.isIdempotencyToken()) { return (0, import_uuid.v4)(); } return source; } if (ns.isBlobSchema()) { if (typeof source === "string") { return (this.serdeContext?.base64Decoder ?? import_util_base643.fromBase64)(source); } return source; } if (ns.isTimestampSchema()) { if (typeof source === "number" || typeof source === "bigint") { return dateToTag(new Date(Number(source) / 1e3 | 0)); } return dateToTag(source); } if (typeof source === "function" || typeof source === "object") { const sourceObject = source; if (ns.isListSchema() && Array.isArray(sourceObject)) { const sparse = !!ns.getMergedTraits().sparse; const newArray = []; let i5 = 0; for (const item of sourceObject) { const value = this.serialize(ns.getValueSchema(), item); if (value != null || sparse) { newArray[i5++] = value; } } return newArray; } if (sourceObject instanceof Date) { return dateToTag(sourceObject); } const newObject = {}; if (ns.isMapSchema()) { const sparse = !!ns.getMergedTraits().sparse; for (const key in sourceObject) { const value = this.serialize(ns.getValueSchema(), sourceObject[key]); if (value != null || sparse) { newObject[key] = value; } } } else if (ns.isStructSchema()) { for (const [key, memberSchema] of ns.structIterator()) { const value = this.serialize(memberSchema, sourceObject[key]); if (value != null) { newObject[key] = value; } } const isUnion = ns.isUnionSchema(); if (isUnion && Array.isArray(sourceObject.$unknown)) { const [k5, v] = sourceObject.$unknown; newObject[k5] = v; } else if (typeof sourceObject.__type === "string") { for (const k5 in sourceObject) { if (!(k5 in newObject)) { newObject[k5] = this.serialize(15, sourceObject[k5]); } } } } else if (ns.isDocumentSchema()) { for (const key in sourceObject) { newObject[key] = this.serialize(ns.getValueSchema(), sourceObject[key]); } } else if (ns.isBigDecimalSchema()) { return sourceObject; } return newObject; } return source; } flush() { const buffer = cbor.serialize(this.value); this.value = void 0; return buffer; } }; CborShapeDeserializer = class extends SerdeContext { read(schema, bytes) { const data3 = cbor.deserialize(bytes); return this.readValue(schema, data3); } readValue(_schema, value) { const ns = NormalizedSchema.of(_schema); if (ns.isTimestampSchema()) { if (typeof value === "number") { return _parseEpochTimestamp(value); } if (typeof value === "object") { if (value.tag === 1 && "value" in value) { return _parseEpochTimestamp(value.value); } } } if (ns.isBlobSchema()) { if (typeof value === "string") { return (this.serdeContext?.base64Decoder ?? import_util_base643.fromBase64)(value); } return value; } if (typeof value === "undefined" || typeof value === "boolean" || typeof value === "number" || typeof value === "string" || typeof value === "bigint" || typeof value === "symbol") { return value; } else if (typeof value === "object") { if (value === null) { return null; } if ("byteLength" in value) { return value; } if (value instanceof Date) { return value; } if (ns.isDocumentSchema()) { return value; } if (ns.isListSchema()) { const newArray = []; const memberSchema = ns.getValueSchema(); for (const item of value) { const itemValue = this.readValue(memberSchema, item); newArray.push(itemValue); } return newArray; } const newObject = {}; if (ns.isMapSchema()) { const targetSchema = ns.getValueSchema(); for (const key in value) { const itemValue = this.readValue(targetSchema, value[key]); newObject[key] = itemValue; } } else if (ns.isStructSchema()) { const isUnion = ns.isUnionSchema(); let keys; if (isUnion) { keys = /* @__PURE__ */ new Set(); for (const k5 in value) { if (k5 !== "__type") { keys.add(k5); } } } for (const [key, memberSchema] of ns.structIterator()) { if (isUnion) { keys.delete(key); } if (value[key] != null) { newObject[key] = this.readValue(memberSchema, value[key]); } } if (isUnion && keys?.size === 1) { let newObjectEmpty = true; for (const _ in newObject) { newObjectEmpty = false; break; } if (newObjectEmpty) { const k5 = keys.values().next().value; newObject.$unknown = [k5, value[k5]]; } } else if (typeof value.__type === "string") { for (const k5 in value) { if (!(k5 in newObject)) { newObject[k5] = value[k5]; } } } } else if (value instanceof NumericValue) { return value; } return newObject; } else { return value; } } }; } }); // node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js var import_util_middleware5, SmithyRpcV2CborProtocol; var init_SmithyRpcV2CborProtocol = __esm({ "node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js"() { init_protocols(); init_schema(); init_schema(); import_util_middleware5 = __toESM(require_dist_cjs6()); init_CborCodec(); init_parseCborBody(); SmithyRpcV2CborProtocol = class extends RpcProtocol { codec = new CborCodec(); serializer = this.codec.createSerializer(); deserializer = this.codec.createDeserializer(); constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }) { super({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }); } getShapeId() { return "smithy.protocols#rpcv2Cbor"; } getPayloadCodec() { return this.codec; } async serializeRequest(operationSchema, input, context) { const request = await super.serializeRequest(operationSchema, input, context); Object.assign(request.headers, { "content-type": this.getDefaultContentType(), "smithy-protocol": "rpc-v2-cbor", accept: this.getDefaultContentType() }); if (deref(operationSchema.input) === "unit") { delete request.body; delete request.headers["content-type"]; } else { if (!request.body) { this.serializer.write(15, {}); request.body = this.serializer.flush(); } try { request.headers["content-length"] = String(request.body.byteLength); } catch (e5) { } } const { service, operation: operation2 } = (0, import_util_middleware5.getSmithyContext)(context); const path3 = `/service/${service}/operation/${operation2}`; if (request.path.endsWith("/")) { request.path += path3.slice(1); } else { request.path += path3; } return request; } async deserializeResponse(operationSchema, context, response) { return super.deserializeResponse(operationSchema, context, response); } async handleError(operationSchema, context, response, dataObject, metadata) { const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; const errorMetadata = { $metadata: metadata, $fault: response.statusCode <= 500 ? "client" : "server" }; let namespace = this.options.defaultNamespace; if (errorName.includes("#")) { [namespace] = errorName.split("#"); } const registry = this.compositeErrorRegistry; const nsRegistry = TypeRegistry.for(namespace); registry.copyFrom(nsRegistry); let errorSchema; try { errorSchema = registry.getSchema(errorName); } catch (e5) { if (dataObject.Message) { dataObject.message = dataObject.Message; } const syntheticRegistry = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace); registry.copyFrom(syntheticRegistry); const baseExceptionSchema = registry.getBaseException(); if (baseExceptionSchema) { const ErrorCtor2 = registry.getErrorCtor(baseExceptionSchema); throw Object.assign(new ErrorCtor2({ name: errorName }), errorMetadata, dataObject); } throw Object.assign(new Error(errorName), errorMetadata, dataObject); } const ns = NormalizedSchema.of(errorSchema); const ErrorCtor = registry.getErrorCtor(errorSchema); const message = dataObject.message ?? dataObject.Message ?? "Unknown"; const exception = new ErrorCtor(message); const output = {}; for (const [name, member2] of ns.structIterator()) { output[name] = this.deserializer.readValue(member2, dataObject[name]); } throw Object.assign(exception, errorMetadata, { $fault: ns.getMergedTraits().error, message }, output); } getDefaultContentType() { return "application/cbor"; } }; } }); // node_modules/@smithy/core/dist-es/submodules/cbor/index.js var init_cbor2 = __esm({ "node_modules/@smithy/core/dist-es/submodules/cbor/index.js"() { init_parseCborBody(); init_SmithyRpcV2CborProtocol(); init_CborCodec(); } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js var import_smithy_client, ProtocolLib; var init_ProtocolLib = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js"() { init_schema(); import_smithy_client = __toESM(require_dist_cjs34()); ProtocolLib = class { queryCompat; errorRegistry; constructor(queryCompat = false) { this.queryCompat = queryCompat; } resolveRestContentType(defaultContentType, inputSchema) { const members = inputSchema.getMemberSchemas(); const httpPayloadMember = Object.values(members).find((m3) => { return !!m3.getMergedTraits().httpPayload; }); if (httpPayloadMember) { const mediaType = httpPayloadMember.getMergedTraits().mediaType; if (mediaType) { return mediaType; } else if (httpPayloadMember.isStringSchema()) { return "text/plain"; } else if (httpPayloadMember.isBlobSchema()) { return "application/octet-stream"; } else { return defaultContentType; } } else if (!inputSchema.isUnitSchema()) { const hasBody = Object.values(members).find((m3) => { const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m3.getMergedTraits(); const noPrefixHeaders = httpPrefixHeaders === void 0; return !httpQuery && !httpQueryParams && !httpHeader && !httpLabel && noPrefixHeaders; }); if (hasBody) { return defaultContentType; } } } async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) { let errorName = errorIdentifier; if (errorIdentifier.includes("#")) { [, errorName] = errorIdentifier.split("#"); } const errorMetadata = { $metadata: metadata, $fault: response.statusCode < 500 ? "client" : "server" }; if (!this.errorRegistry) { throw new Error("@aws-sdk/core/protocols - error handler not initialized."); } try { const errorSchema = getErrorSchema?.(this.errorRegistry, errorName) ?? this.errorRegistry.getSchema(errorIdentifier); return { errorSchema, errorMetadata }; } catch (e5) { dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError"; const synthetic = this.errorRegistry; const baseExceptionSchema = synthetic.getBaseException(); if (baseExceptionSchema) { const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error; throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject); } const d5 = dataObject; const message = d5?.message ?? d5?.Message ?? d5?.Error?.Message ?? d5?.Error?.message; throw this.decorateServiceException(Object.assign(new Error(message), { name: errorName }, errorMetadata), dataObject); } } compose(composite, errorIdentifier, defaultNamespace) { let namespace = defaultNamespace; if (errorIdentifier.includes("#")) { [namespace] = errorIdentifier.split("#"); } const staticRegistry = TypeRegistry.for(namespace); const defaultSyntheticRegistry = TypeRegistry.for("smithy.ts.sdk.synthetic." + defaultNamespace); composite.copyFrom(staticRegistry); composite.copyFrom(defaultSyntheticRegistry); this.errorRegistry = composite; } decorateServiceException(exception, additions = {}) { if (this.queryCompat) { const msg = exception.Message ?? additions.Message; const error3 = (0, import_smithy_client.decorateServiceException)(exception, additions); if (msg) { error3.message = msg; } const errorObj = error3.Error ?? {}; errorObj.Type = error3.Error?.Type; errorObj.Code = error3.Error?.Code; errorObj.Message = error3.Error?.message ?? error3.Error?.Message ?? msg; error3.Error = errorObj; const reqId = error3.$metadata.requestId; if (reqId) { error3.RequestId = reqId; } return error3; } return (0, import_smithy_client.decorateServiceException)(exception, additions); } setQueryCompatError(output, response) { const queryErrorHeader = response.headers?.["x-amzn-query-error"]; if (output !== void 0 && queryErrorHeader != null) { const [Code, Type] = queryErrorHeader.split(";"); const keys = Object.keys(output); const Error2 = { Code, Type }; output.Code = Code; output.Type = Type; for (let i5 = 0; i5 < keys.length; i5++) { const k5 = keys[i5]; Error2[k5 === "message" ? "Message" : k5] = output[k5]; } delete Error2.__type; output.Error = Error2; } } queryCompatOutput(queryCompatErrorData, errorData) { if (queryCompatErrorData.Error) { errorData.Error = queryCompatErrorData.Error; } if (queryCompatErrorData.Type) { errorData.Type = queryCompatErrorData.Type; } if (queryCompatErrorData.Code) { errorData.Code = queryCompatErrorData.Code; } } findQueryCompatibleError(registry, errorName) { try { return registry.getSchema(errorName); } catch (e5) { return registry.find((schema) => NormalizedSchema.of(schema).getMergedTraits().awsQueryError?.[0] === errorName); } } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js var AwsSmithyRpcV2CborProtocol; var init_AwsSmithyRpcV2CborProtocol = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js"() { init_cbor2(); init_schema(); init_ProtocolLib(); AwsSmithyRpcV2CborProtocol = class extends SmithyRpcV2CborProtocol { awsQueryCompatible; mixin; constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5, awsQueryCompatible }) { super({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }); this.awsQueryCompatible = !!awsQueryCompatible; this.mixin = new ProtocolLib(this.awsQueryCompatible); } async serializeRequest(operationSchema, input, context) { const request = await super.serializeRequest(operationSchema, input, context); if (this.awsQueryCompatible) { request.headers["x-amzn-query-mode"] = "true"; } return request; } async handleError(operationSchema, context, response, dataObject, metadata) { if (this.awsQueryCompatible) { this.mixin.setQueryCompatError(dataObject, response); } const errorName = (() => { const compatHeader = response.headers["x-amzn-query-error"]; if (compatHeader && this.awsQueryCompatible) { return compatHeader.split(";")[0]; } return loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown"; })(); this.mixin.compose(this.compositeErrorRegistry, errorName, this.options.defaultNamespace); const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : void 0); const ns = NormalizedSchema.of(errorSchema); const message = dataObject.message ?? dataObject.Message ?? "UnknownError"; const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error; const exception = new ErrorCtor(message); const output = {}; for (const [name, member2] of ns.structIterator()) { if (dataObject[name] != null) { output[name] = this.deserializer.readValue(member2, dataObject[name]); } } if (this.awsQueryCompatible) { this.mixin.queryCompatOutput(dataObject, output); } throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { $fault: ns.getMergedTraits().error, message }, output), dataObject); } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js var _toStr, _toBool, _toNum; var init_coercing_serializers = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js"() { _toStr = (val) => { if (val == null) { return val; } if (typeof val === "number" || typeof val === "bigint") { const warning2 = new Error(`Received number ${val} where a string was expected.`); warning2.name = "Warning"; console.warn(warning2); return String(val); } if (typeof val === "boolean") { const warning2 = new Error(`Received boolean ${val} where a string was expected.`); warning2.name = "Warning"; console.warn(warning2); return String(val); } return val; }; _toBool = (val) => { if (val == null) { return val; } if (typeof val === "number") { } if (typeof val === "string") { const lowercase = val.toLowerCase(); if (val !== "" && lowercase !== "false" && lowercase !== "true") { const warning2 = new Error(`Received string "${val}" where a boolean was expected.`); warning2.name = "Warning"; console.warn(warning2); } return val !== "" && lowercase !== "false"; } return val; }; _toNum = (val) => { if (val == null) { return val; } if (typeof val === "boolean") { } if (typeof val === "string") { const num = Number(val); if (num.toString() !== val) { const warning2 = new Error(`Received string "${val}" where a number was expected.`); warning2.name = "Warning"; console.warn(warning2); return val; } return num; } return val; }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js var SerdeContextConfig; var init_ConfigurableSerdeContext = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js"() { SerdeContextConfig = class { serdeContext; setSerdeContext(serdeContext) { this.serdeContext = serdeContext; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js var UnionSerde; var init_UnionSerde = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js"() { UnionSerde = class { from; to; keys; constructor(from, to) { this.from = from; this.to = to; const keys = Object.keys(this.from); const set = new Set(keys); set.delete("__type"); this.keys = set; } mark(key) { this.keys.delete(key); } hasUnknown() { return this.keys.size === 1 && Object.keys(this.to).length === 0; } writeUnknown() { if (this.hasUnknown()) { const k5 = this.keys.values().next().value; const v = this.from[k5]; this.to.$unknown = [k5, v]; } } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js function jsonReviver(key, value, context) { if (context?.source) { const numericString = context.source; if (typeof value === "number") { if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) { const isFractional = numericString.includes("."); if (isFractional) { return new NumericValue(numericString, "bigDecimal"); } else { return BigInt(numericString); } } } } return value; } var init_jsonReviver = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js"() { init_serde(); } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js var import_smithy_client2, import_util_utf86, collectBodyString; var init_common = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js"() { import_smithy_client2 = __toESM(require_dist_cjs34()); import_util_utf86 = __toESM(require_dist_cjs9()); collectBodyString = (streamBody, context) => (0, import_smithy_client2.collectBody)(streamBody, context).then((body) => (context?.utf8Encoder ?? import_util_utf86.toUtf8)(body)); } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js var parseJsonBody, parseJsonErrorBody, findKey, sanitizeErrorCode, loadRestJsonErrorCode; var init_parseJsonBody = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js"() { init_common(); parseJsonBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { if (encoded.length) { try { return JSON.parse(encoded); } catch (e5) { if (e5?.name === "SyntaxError") { Object.defineProperty(e5, "$responseBodyText", { value: encoded }); } throw e5; } } return {}; }); parseJsonErrorBody = async (errorBody, context) => { const value = await parseJsonBody(errorBody, context); value.message = value.message ?? value.Message; return value; }; findKey = (object, key) => Object.keys(object).find((k5) => k5.toLowerCase() === key.toLowerCase()); sanitizeErrorCode = (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; }; loadRestJsonErrorCode = (output, data3) => { const headerKey = findKey(output.headers, "x-amzn-errortype"); if (headerKey !== void 0) { return sanitizeErrorCode(output.headers[headerKey]); } if (data3 && typeof data3 === "object") { const codeKey = findKey(data3, "code"); if (codeKey && data3[codeKey] !== void 0) { return sanitizeErrorCode(data3[codeKey]); } if (data3["__type"] !== void 0) { return sanitizeErrorCode(data3["__type"]); } } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js var import_util_base644, JsonShapeDeserializer; var init_JsonShapeDeserializer = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js"() { init_protocols(); init_schema(); init_serde(); import_util_base644 = __toESM(require_dist_cjs10()); init_ConfigurableSerdeContext(); init_UnionSerde(); init_jsonReviver(); init_parseJsonBody(); JsonShapeDeserializer = class extends SerdeContextConfig { settings; constructor(settings) { super(); this.settings = settings; } async read(schema, data3) { return this._read(schema, typeof data3 === "string" ? JSON.parse(data3, jsonReviver) : await parseJsonBody(data3, this.serdeContext)); } readObject(schema, data3) { return this._read(schema, data3); } _read(schema, value) { const isObject = value !== null && typeof value === "object"; const ns = NormalizedSchema.of(schema); if (isObject) { if (ns.isStructSchema()) { const record = value; const union = ns.isUnionSchema(); const out = {}; let nameMap = void 0; const { jsonName } = this.settings; if (jsonName) { nameMap = {}; } let unionSerde; if (union) { unionSerde = new UnionSerde(record, out); } for (const [memberName, memberSchema] of ns.structIterator()) { let fromKey = memberName; if (jsonName) { fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey; nameMap[fromKey] = memberName; } if (union) { unionSerde.mark(fromKey); } if (record[fromKey] != null) { out[memberName] = this._read(memberSchema, record[fromKey]); } } if (union) { unionSerde.writeUnknown(); } else if (typeof record.__type === "string") { for (const k5 in record) { const v = record[k5]; const t = jsonName ? nameMap[k5] ?? k5 : k5; if (!(t in out)) { out[t] = v; } } } return out; } if (Array.isArray(value) && ns.isListSchema()) { const listMember = ns.getValueSchema(); const out = []; for (const item of value) { out.push(this._read(listMember, item)); } return out; } if (ns.isMapSchema()) { const mapMember = ns.getValueSchema(); const out = {}; for (const _k in value) { out[_k] = this._read(mapMember, value[_k]); } return out; } } if (ns.isBlobSchema() && typeof value === "string") { return (0, import_util_base644.fromBase64)(value); } const mediaType = ns.getMergedTraits().mediaType; if (ns.isStringSchema() && typeof value === "string" && mediaType) { const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); if (isJson) { return LazyJsonString.from(value); } return value; } if (ns.isTimestampSchema() && value != null) { const format2 = determineTimestampFormat(ns, this.settings); switch (format2) { case 5: return parseRfc3339DateTimeWithOffset(value); case 6: return parseRfc7231DateTime(value); case 7: return parseEpochTimestamp(value); default: console.warn("Missing timestamp format, parsing value with Date constructor:", value); return new Date(value); } } if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) { return BigInt(value); } if (ns.isBigDecimalSchema() && value != void 0) { if (value instanceof NumericValue) { return value; } const untyped = value; if (untyped.type === "bigDecimal" && "string" in untyped) { return new NumericValue(untyped.string, untyped.type); } return new NumericValue(String(value), "bigDecimal"); } if (ns.isNumericSchema() && typeof value === "string") { switch (value) { case "Infinity": return Infinity; case "-Infinity": return -Infinity; case "NaN": return NaN; } return value; } if (ns.isDocumentSchema()) { if (isObject) { const out = Array.isArray(value) ? [] : {}; for (const k5 in value) { const v = value[k5]; if (v instanceof NumericValue) { out[k5] = v; } else { out[k5] = this._read(ns, v); } } return out; } else { return structuredClone(value); } } return value; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js var NUMERIC_CONTROL_CHAR, JsonReplacer; var init_jsonReplacer = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js"() { init_serde(); NUMERIC_CONTROL_CHAR = String.fromCharCode(925); JsonReplacer = class { values = /* @__PURE__ */ new Map(); counter = 0; stage = 0; createReplacer() { if (this.stage === 1) { throw new Error("@aws-sdk/core/protocols - JsonReplacer already created."); } if (this.stage === 2) { throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted."); } this.stage = 1; return (key, value) => { if (value instanceof NumericValue) { const v = `${NUMERIC_CONTROL_CHAR + "nv" + this.counter++}_` + value.string; this.values.set(`"${v}"`, value.string); return v; } if (typeof value === "bigint") { const s = value.toString(); const v = `${NUMERIC_CONTROL_CHAR + "b" + this.counter++}_` + s; this.values.set(`"${v}"`, s); return v; } return value; }; } replaceInJson(json) { if (this.stage === 0) { throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet."); } if (this.stage === 2) { throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted."); } this.stage = 2; if (this.counter === 0) { return json; } for (const [key, value] of this.values) { json = json.replace(key, value); } return json; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js var import_util_base645, JsonShapeSerializer; var init_JsonShapeSerializer = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js"() { init_protocols(); init_schema(); init_serde(); import_util_base645 = __toESM(require_dist_cjs10()); init_ConfigurableSerdeContext(); init_jsonReplacer(); JsonShapeSerializer = class extends SerdeContextConfig { settings; buffer; useReplacer = false; rootSchema; constructor(settings) { super(); this.settings = settings; } write(schema, value) { this.rootSchema = NormalizedSchema.of(schema); this.buffer = this._write(this.rootSchema, value); } flush() { const { rootSchema, useReplacer } = this; this.rootSchema = void 0; this.useReplacer = false; if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) { if (!useReplacer) { return JSON.stringify(this.buffer); } const replacer = new JsonReplacer(); return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0)); } return this.buffer; } writeDiscriminatedDocument(schema, value) { this.write(schema, value); if (typeof this.buffer === "object") { this.buffer.__type = NormalizedSchema.of(schema).getName(true); } } _write(schema, value, container) { const isObject = value !== null && typeof value === "object"; const ns = NormalizedSchema.of(schema); if (isObject) { if (ns.isStructSchema()) { const record = value; const out = {}; const { jsonName } = this.settings; let nameMap = void 0; if (jsonName) { nameMap = {}; } let outCount = 0; for (const [memberName, memberSchema] of ns.structIterator()) { const serializableValue = this._write(memberSchema, record[memberName], ns); if (serializableValue !== void 0) { let targetKey = memberName; if (jsonName) { targetKey = memberSchema.getMergedTraits().jsonName ?? memberName; nameMap[memberName] = targetKey; } out[targetKey] = serializableValue; outCount++; } } if (ns.isUnionSchema() && outCount === 0) { const { $unknown } = record; if (Array.isArray($unknown)) { const [k5, v] = $unknown; out[k5] = this._write(15, v); } } else if (typeof record.__type === "string") { for (const k5 in record) { const v = record[k5]; const targetKey = jsonName ? nameMap[k5] ?? k5 : k5; if (!(targetKey in out)) { out[targetKey] = this._write(15, v); } } } return out; } if (Array.isArray(value) && ns.isListSchema()) { const listMember = ns.getValueSchema(); const out = []; const sparse = !!ns.getMergedTraits().sparse; for (const item of value) { if (sparse || item != null) { out.push(this._write(listMember, item)); } } return out; } if (ns.isMapSchema()) { const mapMember = ns.getValueSchema(); const out = {}; const sparse = !!ns.getMergedTraits().sparse; for (const _k in value) { const _v = value[_k]; if (sparse || _v != null) { out[_k] = this._write(mapMember, _v); } } return out; } if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) { if (ns === this.rootSchema) { return value; } return (this.serdeContext?.base64Encoder ?? import_util_base645.toBase64)(value); } if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) { const format2 = determineTimestampFormat(ns, this.settings); switch (format2) { case 5: return value.toISOString().replace(".000Z", "Z"); case 6: return dateToUtcString(value); case 7: return value.getTime() / 1e3; default: console.warn("Missing timestamp format, using epoch seconds", value); return value.getTime() / 1e3; } } if (value instanceof NumericValue) { this.useReplacer = true; } } if (value === null && container?.isStructSchema()) { return void 0; } if (ns.isStringSchema()) { if (typeof value === "undefined" && ns.isIdempotencyToken()) { return (0, import_uuid.v4)(); } const mediaType = ns.getMergedTraits().mediaType; if (value != null && mediaType) { const isJson = mediaType === "application/json" || mediaType.endsWith("+json"); if (isJson) { return LazyJsonString.from(value); } } return value; } if (typeof value === "number" && ns.isNumericSchema()) { if (Math.abs(value) === Infinity || isNaN(value)) { return String(value); } return value; } if (typeof value === "string" && ns.isBlobSchema()) { if (ns === this.rootSchema) { return value; } return (this.serdeContext?.base64Encoder ?? import_util_base645.toBase64)(value); } if (typeof value === "bigint") { this.useReplacer = true; } if (ns.isDocumentSchema()) { if (isObject) { const out = Array.isArray(value) ? [] : {}; for (const k5 in value) { const v = value[k5]; if (v instanceof NumericValue) { this.useReplacer = true; out[k5] = v; } else { out[k5] = this._write(ns, v); } } return out; } else { return structuredClone(value); } } return value; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonCodec.js var JsonCodec; var init_JsonCodec = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonCodec.js"() { init_ConfigurableSerdeContext(); init_JsonShapeDeserializer(); init_JsonShapeSerializer(); JsonCodec = class extends SerdeContextConfig { settings; constructor(settings) { super(); this.settings = settings; } createSerializer() { const serializer = new JsonShapeSerializer(this.settings); serializer.setSerdeContext(this.serdeContext); return serializer; } createDeserializer() { const deserializer = new JsonShapeDeserializer(this.settings); deserializer.setSerdeContext(this.serdeContext); return deserializer; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js var AwsJsonRpcProtocol; var init_AwsJsonRpcProtocol = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js"() { init_protocols(); init_schema(); init_ProtocolLib(); init_JsonCodec(); init_parseJsonBody(); AwsJsonRpcProtocol = class extends RpcProtocol { serializer; deserializer; serviceTarget; codec; mixin; awsQueryCompatible; constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5, serviceTarget, awsQueryCompatible, jsonCodec }) { super({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }); this.serviceTarget = serviceTarget; this.codec = jsonCodec ?? new JsonCodec({ timestampFormat: { useTrait: true, default: 7 }, jsonName: false }); this.serializer = this.codec.createSerializer(); this.deserializer = this.codec.createDeserializer(); this.awsQueryCompatible = !!awsQueryCompatible; this.mixin = new ProtocolLib(this.awsQueryCompatible); } async serializeRequest(operationSchema, input, context) { const request = await super.serializeRequest(operationSchema, input, context); if (!request.path.endsWith("/")) { request.path += "/"; } request.headers["content-type"] = `application/x-amz-json-${this.getJsonRpcVersion()}`; request.headers["x-amz-target"] = `${this.serviceTarget}.${operationSchema.name}`; if (this.awsQueryCompatible) { request.headers["x-amzn-query-mode"] = "true"; } if (deref(operationSchema.input) === "unit" || !request.body) { request.body = "{}"; } return request; } getPayloadCodec() { return this.codec; } async handleError(operationSchema, context, response, dataObject, metadata) { if (this.awsQueryCompatible) { this.mixin.setQueryCompatError(dataObject, response); } const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace); const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : void 0); const ns = NormalizedSchema.of(errorSchema); const message = dataObject.message ?? dataObject.Message ?? "UnknownError"; const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error; const exception = new ErrorCtor(message); const output = {}; const errorDeserializer = this.codec.createDeserializer(); for (const [name, member2] of ns.structIterator()) { if (dataObject[name] != null) { output[name] = errorDeserializer.readObject(member2, dataObject[name]); } } if (this.awsQueryCompatible) { this.mixin.queryCompatOutput(dataObject, output); } throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { $fault: ns.getMergedTraits().error, message }, output), dataObject); } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js var AwsJson1_0Protocol; var init_AwsJson1_0Protocol = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js"() { init_AwsJsonRpcProtocol(); AwsJson1_0Protocol = class extends AwsJsonRpcProtocol { constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5, serviceTarget, awsQueryCompatible, jsonCodec }) { super({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5, serviceTarget, awsQueryCompatible, jsonCodec }); } getShapeId() { return "aws.protocols#awsJson1_0"; } getJsonRpcVersion() { return "1.0"; } getDefaultContentType() { return "application/x-amz-json-1.0"; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js var AwsJson1_1Protocol; var init_AwsJson1_1Protocol = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js"() { init_AwsJsonRpcProtocol(); AwsJson1_1Protocol = class extends AwsJsonRpcProtocol { constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5, serviceTarget, awsQueryCompatible, jsonCodec }) { super({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5, serviceTarget, awsQueryCompatible, jsonCodec }); } getShapeId() { return "aws.protocols#awsJson1_1"; } getJsonRpcVersion() { return "1.1"; } getDefaultContentType() { return "application/x-amz-json-1.1"; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js var AwsRestJsonProtocol; var init_AwsRestJsonProtocol = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js"() { init_protocols(); init_schema(); init_ProtocolLib(); init_JsonCodec(); init_parseJsonBody(); AwsRestJsonProtocol = class extends HttpBindingProtocol { serializer; deserializer; codec; mixin = new ProtocolLib(); constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }) { super({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }); const settings = { timestampFormat: { useTrait: true, default: 7 }, httpBindings: true, jsonName: true }; this.codec = new JsonCodec(settings); this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); } getShapeId() { return "aws.protocols#restJson1"; } getPayloadCodec() { return this.codec; } setSerdeContext(serdeContext) { this.codec.setSerdeContext(serdeContext); super.setSerdeContext(serdeContext); } async serializeRequest(operationSchema, input, context) { const request = await super.serializeRequest(operationSchema, input, context); const inputSchema = NormalizedSchema.of(operationSchema.input); if (!request.headers["content-type"]) { const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); if (contentType) { request.headers["content-type"] = contentType; } } if (request.body == null && request.headers["content-type"] === this.getDefaultContentType()) { request.body = "{}"; } return request; } async deserializeResponse(operationSchema, context, response) { const output = await super.deserializeResponse(operationSchema, context, response); const outputSchema = NormalizedSchema.of(operationSchema.output); for (const [name, member2] of outputSchema.structIterator()) { if (member2.getMemberTraits().httpPayload && !(name in output)) { output[name] = null; } } return output; } async handleError(operationSchema, context, response, dataObject, metadata) { const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown"; this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace); const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); const ns = NormalizedSchema.of(errorSchema); const message = dataObject.message ?? dataObject.Message ?? "UnknownError"; const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error; const exception = new ErrorCtor(message); await this.deserializeHttpMessage(errorSchema, context, response, dataObject); const output = {}; const errorDeserializer = this.codec.createDeserializer(); for (const [name, member2] of ns.structIterator()) { const target = member2.getMergedTraits().jsonName ?? name; output[name] = errorDeserializer.readObject(member2, dataObject[target]); } throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { $fault: ns.getMergedTraits().error, message }, output), dataObject); } getDefaultContentType() { return "application/json"; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js var import_smithy_client3, awsExpectUnion; var init_awsExpectUnion = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js"() { import_smithy_client3 = __toESM(require_dist_cjs34()); awsExpectUnion = (value) => { if (value == null) { return void 0; } if (typeof value === "object" && "__type" in value) { delete value.__type; } return (0, import_smithy_client3.expectUnion)(value); }; } }); // node_modules/fast-xml-parser/lib/fxp.cjs var require_fxp = __commonJS({ "node_modules/fast-xml-parser/lib/fxp.cjs"(exports2, module2) { (() => { "use strict"; var t = { d: (e6, n4) => { for (var i6 in n4) t.o(n4, i6) && !t.o(e6, i6) && Object.defineProperty(e6, i6, { enumerable: true, get: n4[i6] }); }, o: (t2, e6) => Object.prototype.hasOwnProperty.call(t2, e6), r: (t2) => { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t2, "__esModule", { value: true }); } }, e5 = {}; t.r(e5), t.d(e5, { XMLBuilder: () => Bt, XMLParser: () => Tt, XMLValidator: () => Ut }); const n3 = ":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", i5 = new RegExp("^[" + n3 + "][" + n3 + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); function s(t2, e6) { const n4 = []; let i6 = e6.exec(t2); for (; i6; ) { const s2 = []; s2.startIndex = e6.lastIndex - i6[0].length; const r6 = i6.length; for (let t3 = 0; t3 < r6; t3++) s2.push(i6[t3]); n4.push(s2), i6 = e6.exec(t2); } return n4; } const r5 = function(t2) { return !(null == i5.exec(t2)); }, o2 = ["hasOwnProperty", "toString", "valueOf", "__defineGetter__", "__defineSetter__", "__lookupGetter__", "__lookupSetter__"], a5 = ["__proto__", "constructor", "prototype"], h5 = { allowBooleanAttributes: false, unpairedTags: [] }; function l3(t2, e6) { e6 = Object.assign({}, h5, e6); const n4 = []; let i6 = false, s2 = false; "\uFEFF" === t2[0] && (t2 = t2.substr(1)); for (let r6 = 0; r6 < t2.length; r6++) if ("<" === t2[r6] && "?" === t2[r6 + 1]) { if (r6 += 2, r6 = p2(t2, r6), r6.err) return r6; } else { if ("<" !== t2[r6]) { if (u(t2[r6])) continue; return b6("InvalidChar", "char '" + t2[r6] + "' is not expected.", w(t2, r6)); } { let o3 = r6; if (r6++, "!" === t2[r6]) { r6 = c5(t2, r6); continue; } { let a6 = false; "/" === t2[r6] && (a6 = true, r6++); let h6 = ""; for (; r6 < t2.length && ">" !== t2[r6] && " " !== t2[r6] && " " !== t2[r6] && "\n" !== t2[r6] && "\r" !== t2[r6]; r6++) h6 += t2[r6]; if (h6 = h6.trim(), "/" === h6[h6.length - 1] && (h6 = h6.substring(0, h6.length - 1), r6--), !E(h6)) { let e7; return e7 = 0 === h6.trim().length ? "Invalid space after '<'." : "Tag '" + h6 + "' is an invalid name.", b6("InvalidTag", e7, w(t2, r6)); } const l4 = g5(t2, r6); if (false === l4) return b6("InvalidAttr", "Attributes for '" + h6 + "' have open quote.", w(t2, r6)); let d6 = l4.value; if (r6 = l4.index, "/" === d6[d6.length - 1]) { const n5 = r6 - d6.length; d6 = d6.substring(0, d6.length - 1); const s3 = x(d6, e6); if (true !== s3) return b6(s3.err.code, s3.err.msg, w(t2, n5 + s3.err.line)); i6 = true; } else if (a6) { if (!l4.tagClosed) return b6("InvalidTag", "Closing tag '" + h6 + "' doesn't have proper closing.", w(t2, r6)); if (d6.trim().length > 0) return b6("InvalidTag", "Closing tag '" + h6 + "' can't have attributes or invalid starting.", w(t2, o3)); if (0 === n4.length) return b6("InvalidTag", "Closing tag '" + h6 + "' has not been opened.", w(t2, o3)); { const e7 = n4.pop(); if (h6 !== e7.tagName) { let n5 = w(t2, e7.tagStartPos); return b6("InvalidTag", "Expected closing tag '" + e7.tagName + "' (opened in line " + n5.line + ", col " + n5.col + ") instead of closing tag '" + h6 + "'.", w(t2, o3)); } 0 == n4.length && (s2 = true); } } else { const a7 = x(d6, e6); if (true !== a7) return b6(a7.err.code, a7.err.msg, w(t2, r6 - d6.length + a7.err.line)); if (true === s2) return b6("InvalidXml", "Multiple possible root nodes found.", w(t2, r6)); -1 !== e6.unpairedTags.indexOf(h6) || n4.push({ tagName: h6, tagStartPos: o3 }), i6 = true; } for (r6++; r6 < t2.length; r6++) if ("<" === t2[r6]) { if ("!" === t2[r6 + 1]) { r6++, r6 = c5(t2, r6); continue; } if ("?" !== t2[r6 + 1]) break; if (r6 = p2(t2, ++r6), r6.err) return r6; } else if ("&" === t2[r6]) { const e7 = N(t2, r6); if (-1 == e7) return b6("InvalidChar", "char '&' is not expected.", w(t2, r6)); r6 = e7; } else if (true === s2 && !u(t2[r6])) return b6("InvalidXml", "Extra text at the end", w(t2, r6)); "<" === t2[r6] && r6--; } } } return i6 ? 1 == n4.length ? b6("InvalidTag", "Unclosed tag '" + n4[0].tagName + "'.", w(t2, n4[0].tagStartPos)) : !(n4.length > 0) || b6("InvalidXml", "Invalid '" + JSON.stringify(n4.map((t3) => t3.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : b6("InvalidXml", "Start tag expected.", 1); } function u(t2) { return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } function p2(t2, e6) { const n4 = e6; for (; e6 < t2.length; e6++) if ("?" == t2[e6] || " " == t2[e6]) { const i6 = t2.substr(n4, e6 - n4); if (e6 > 5 && "xml" === i6) return b6("InvalidXml", "XML declaration allowed only at the start of the document.", w(t2, e6)); if ("?" == t2[e6] && ">" == t2[e6 + 1]) { e6++; break; } continue; } return e6; } function c5(t2, e6) { if (t2.length > e6 + 5 && "-" === t2[e6 + 1] && "-" === t2[e6 + 2]) { for (e6 += 3; e6 < t2.length; e6++) if ("-" === t2[e6] && "-" === t2[e6 + 1] && ">" === t2[e6 + 2]) { e6 += 2; break; } } else if (t2.length > e6 + 8 && "D" === t2[e6 + 1] && "O" === t2[e6 + 2] && "C" === t2[e6 + 3] && "T" === t2[e6 + 4] && "Y" === t2[e6 + 5] && "P" === t2[e6 + 6] && "E" === t2[e6 + 7]) { let n4 = 1; for (e6 += 8; e6 < t2.length; e6++) if ("<" === t2[e6]) n4++; else if (">" === t2[e6] && (n4--, 0 === n4)) break; } else if (t2.length > e6 + 9 && "[" === t2[e6 + 1] && "C" === t2[e6 + 2] && "D" === t2[e6 + 3] && "A" === t2[e6 + 4] && "T" === t2[e6 + 5] && "A" === t2[e6 + 6] && "[" === t2[e6 + 7]) { for (e6 += 8; e6 < t2.length; e6++) if ("]" === t2[e6] && "]" === t2[e6 + 1] && ">" === t2[e6 + 2]) { e6 += 2; break; } } return e6; } const d5 = '"', f5 = "'"; function g5(t2, e6) { let n4 = "", i6 = "", s2 = false; for (; e6 < t2.length; e6++) { if (t2[e6] === d5 || t2[e6] === f5) "" === i6 ? i6 = t2[e6] : i6 !== t2[e6] || (i6 = ""); else if (">" === t2[e6] && "" === i6) { s2 = true; break; } n4 += t2[e6]; } return "" === i6 && { value: n4, index: e6, tagClosed: s2 }; } const m3 = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function x(t2, e6) { const n4 = s(t2, m3), i6 = {}; for (let t3 = 0; t3 < n4.length; t3++) { if (0 === n4[t3][1].length) return b6("InvalidAttr", "Attribute '" + n4[t3][2] + "' has no space in starting.", v(n4[t3])); if (void 0 !== n4[t3][3] && void 0 === n4[t3][4]) return b6("InvalidAttr", "Attribute '" + n4[t3][2] + "' is without value.", v(n4[t3])); if (void 0 === n4[t3][3] && !e6.allowBooleanAttributes) return b6("InvalidAttr", "boolean attribute '" + n4[t3][2] + "' is not allowed.", v(n4[t3])); const s2 = n4[t3][2]; if (!y(s2)) return b6("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", v(n4[t3])); if (Object.prototype.hasOwnProperty.call(i6, s2)) return b6("InvalidAttr", "Attribute '" + s2 + "' is repeated.", v(n4[t3])); i6[s2] = 1; } return true; } function N(t2, e6) { if (";" === t2[++e6]) return -1; if ("#" === t2[e6]) return (function(t3, e7) { let n5 = /\d/; for ("x" === t3[e7] && (e7++, n5 = /[\da-fA-F]/); e7 < t3.length; e7++) { if (";" === t3[e7]) return e7; if (!t3[e7].match(n5)) break; } return -1; })(t2, ++e6); let n4 = 0; for (; e6 < t2.length; e6++, n4++) if (!(t2[e6].match(/\w/) && n4 < 20)) { if (";" === t2[e6]) break; return -1; } return e6; } function b6(t2, e6, n4) { return { err: { code: t2, msg: e6, line: n4.line || n4, col: n4.col } }; } function y(t2) { return r5(t2); } function E(t2) { return r5(t2); } function w(t2, e6) { const n4 = t2.substring(0, e6).split(/\r?\n/); return { line: n4.length, col: n4[n4.length - 1].length + 1 }; } function v(t2) { return t2.startIndex + t2[1].length; } const S = (t2) => o2.includes(t2) ? "__" + t2 : t2, _ = { preserveOrder: false, attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, removeNSPrefix: false, allowBooleanAttributes: false, parseTagValue: true, parseAttributeValue: false, trimValues: true, cdataPropName: false, numberParseOptions: { hex: true, leadingZeros: true, eNotation: true }, tagValueProcessor: function(t2, e6) { return e6; }, attributeValueProcessor: function(t2, e6) { return e6; }, stopNodes: [], alwaysCreateTextNode: false, isArray: () => false, commentPropName: false, unpairedTags: [], processEntities: true, htmlEntities: false, entityDecoder: null, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e6, n4) { return t2; }, captureMetaData: false, maxNestedTags: 100, strictReservedNames: true, jPath: true, onDangerousProperty: S }; function A(t2, e6) { if ("string" != typeof t2) return; const n4 = t2.toLowerCase(); if (o2.some((t3) => n4 === t3.toLowerCase())) throw new Error(`[SECURITY] Invalid ${e6}: "${t2}" is a reserved JavaScript keyword that could cause prototype pollution`); if (a5.some((t3) => n4 === t3.toLowerCase())) throw new Error(`[SECURITY] Invalid ${e6}: "${t2}" is a reserved JavaScript keyword that could cause prototype pollution`); } function T(t2, e6) { return "boolean" == typeof t2 ? { enabled: t2, maxEntitySize: 1e4, maxExpansionDepth: 1e4, maxTotalExpansions: 1 / 0, maxExpandedLength: 1e5, maxEntityCount: 1e3, allowedTags: null, tagFilter: null, appliesTo: "all" } : "object" == typeof t2 && null !== t2 ? { enabled: false !== t2.enabled, maxEntitySize: Math.max(1, t2.maxEntitySize ?? 1e4), maxExpansionDepth: Math.max(1, t2.maxExpansionDepth ?? 1e4), maxTotalExpansions: Math.max(1, t2.maxTotalExpansions ?? 1 / 0), maxExpandedLength: Math.max(1, t2.maxExpandedLength ?? 1e5), maxEntityCount: Math.max(1, t2.maxEntityCount ?? 1e3), allowedTags: t2.allowedTags ?? null, tagFilter: t2.tagFilter ?? null, appliesTo: t2.appliesTo ?? "all" } : T(true); } const C = function(t2) { const e6 = Object.assign({}, _, t2), n4 = [{ value: e6.attributeNamePrefix, name: "attributeNamePrefix" }, { value: e6.attributesGroupName, name: "attributesGroupName" }, { value: e6.textNodeName, name: "textNodeName" }, { value: e6.cdataPropName, name: "cdataPropName" }, { value: e6.commentPropName, name: "commentPropName" }]; for (const { value: t3, name: e7 } of n4) t3 && A(t3, e7); return null === e6.onDangerousProperty && (e6.onDangerousProperty = S), e6.processEntities = T(e6.processEntities, e6.htmlEntities), e6.unpairedTagsSet = new Set(e6.unpairedTags), e6.stopNodes && Array.isArray(e6.stopNodes) && (e6.stopNodes = e6.stopNodes.map((t3) => "string" == typeof t3 && t3.startsWith("*.") ? ".." + t3.substring(2) : t3)), e6; }; let P; P = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); class O { constructor(t2) { this.tagname = t2, this.child = [], this[":@"] = /* @__PURE__ */ Object.create(null); } add(t2, e6) { "__proto__" === t2 && (t2 = "#__proto__"), this.child.push({ [t2]: e6 }); } addChild(t2, e6) { "__proto__" === t2.tagname && (t2.tagname = "#__proto__"), t2[":@"] && Object.keys(t2[":@"]).length > 0 ? this.child.push({ [t2.tagname]: t2.child, ":@": t2[":@"] }) : this.child.push({ [t2.tagname]: t2.child }), void 0 !== e6 && (this.child[this.child.length - 1][P] = { startIndex: e6 }); } static getMetaDataSymbol() { return P; } } class $ { constructor(t2) { this.suppressValidationErr = !t2, this.options = t2; } readDocType(t2, e6) { const n4 = /* @__PURE__ */ Object.create(null); let i6 = 0; if ("O" !== t2[e6 + 3] || "C" !== t2[e6 + 4] || "T" !== t2[e6 + 5] || "Y" !== t2[e6 + 6] || "P" !== t2[e6 + 7] || "E" !== t2[e6 + 8]) throw new Error("Invalid Tag instead of DOCTYPE"); { e6 += 9; let s2 = 1, r6 = false, o3 = false, a6 = ""; for (; e6 < t2.length; e6++) if ("<" !== t2[e6] || o3) if (">" === t2[e6]) { if (o3 ? "-" === t2[e6 - 1] && "-" === t2[e6 - 2] && (o3 = false, s2--) : s2--, 0 === s2) break; } else "[" === t2[e6] ? r6 = true : a6 += t2[e6]; else { if (r6 && D(t2, "!ENTITY", e6)) { let s3, r7; if (e6 += 7, [s3, r7, e6] = this.readEntityExp(t2, e6 + 1, this.suppressValidationErr), -1 === r7.indexOf("&")) { if (false !== this.options.enabled && null != this.options.maxEntityCount && i6 >= this.options.maxEntityCount) throw new Error(`Entity count (${i6 + 1}) exceeds maximum allowed (${this.options.maxEntityCount})`); n4[s3] = r7, i6++; } } else if (r6 && D(t2, "!ELEMENT", e6)) { e6 += 8; const { index: n5 } = this.readElementExp(t2, e6 + 1); e6 = n5; } else if (r6 && D(t2, "!ATTLIST", e6)) e6 += 8; else if (r6 && D(t2, "!NOTATION", e6)) { e6 += 9; const { index: n5 } = this.readNotationExp(t2, e6 + 1, this.suppressValidationErr); e6 = n5; } else { if (!D(t2, "!--", e6)) throw new Error("Invalid DOCTYPE"); o3 = true; } s2++, a6 = ""; } if (0 !== s2) throw new Error("Unclosed DOCTYPE"); } return { entities: n4, i: e6 }; } readEntityExp(t2, e6) { const n4 = e6 = I(t2, e6); for (; e6 < t2.length && !/\s/.test(t2[e6]) && '"' !== t2[e6] && "'" !== t2[e6]; ) e6++; let i6 = t2.substring(n4, e6); if (M(i6), e6 = I(t2, e6), !this.suppressValidationErr) { if ("SYSTEM" === t2.substring(e6, e6 + 6).toUpperCase()) throw new Error("External entities are not supported"); if ("%" === t2[e6]) throw new Error("Parameter entities are not supported"); } let s2 = ""; if ([e6, s2] = this.readIdentifierVal(t2, e6, "entity"), false !== this.options.enabled && null != this.options.maxEntitySize && s2.length > this.options.maxEntitySize) throw new Error(`Entity "${i6}" size (${s2.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`); return [i6, s2, --e6]; } readNotationExp(t2, e6) { const n4 = e6 = I(t2, e6); for (; e6 < t2.length && !/\s/.test(t2[e6]); ) e6++; let i6 = t2.substring(n4, e6); !this.suppressValidationErr && M(i6), e6 = I(t2, e6); const s2 = t2.substring(e6, e6 + 6).toUpperCase(); if (!this.suppressValidationErr && "SYSTEM" !== s2 && "PUBLIC" !== s2) throw new Error(`Expected SYSTEM or PUBLIC, found "${s2}"`); e6 += s2.length, e6 = I(t2, e6); let r6 = null, o3 = null; if ("PUBLIC" === s2) [e6, r6] = this.readIdentifierVal(t2, e6, "publicIdentifier"), '"' !== t2[e6 = I(t2, e6)] && "'" !== t2[e6] || ([e6, o3] = this.readIdentifierVal(t2, e6, "systemIdentifier")); else if ("SYSTEM" === s2 && ([e6, o3] = this.readIdentifierVal(t2, e6, "systemIdentifier"), !this.suppressValidationErr && !o3)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); return { notationName: i6, publicIdentifier: r6, systemIdentifier: o3, index: --e6 }; } readIdentifierVal(t2, e6, n4) { let i6 = ""; const s2 = t2[e6]; if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); const r6 = ++e6; for (; e6 < t2.length && t2[e6] !== s2; ) e6++; if (i6 = t2.substring(r6, e6), t2[e6] !== s2) throw new Error(`Unterminated ${n4} value`); return [++e6, i6]; } readElementExp(t2, e6) { const n4 = e6 = I(t2, e6); for (; e6 < t2.length && !/\s/.test(t2[e6]); ) e6++; let i6 = t2.substring(n4, e6); if (!this.suppressValidationErr && !r5(i6)) throw new Error(`Invalid element name: "${i6}"`); let s2 = ""; if ("E" === t2[e6 = I(t2, e6)] && D(t2, "MPTY", e6)) e6 += 4; else if ("A" === t2[e6] && D(t2, "NY", e6)) e6 += 2; else if ("(" === t2[e6]) { const n5 = ++e6; for (; e6 < t2.length && ")" !== t2[e6]; ) e6++; if (s2 = t2.substring(n5, e6), ")" !== t2[e6]) throw new Error("Unterminated content model"); } else if (!this.suppressValidationErr) throw new Error(`Invalid Element Expression, found "${t2[e6]}"`); return { elementName: i6, contentModel: s2.trim(), index: e6 }; } readAttlistExp(t2, e6) { let n4 = e6 = I(t2, e6); for (; e6 < t2.length && !/\s/.test(t2[e6]); ) e6++; let i6 = t2.substring(n4, e6); for (M(i6), n4 = e6 = I(t2, e6); e6 < t2.length && !/\s/.test(t2[e6]); ) e6++; let s2 = t2.substring(n4, e6); if (!M(s2)) throw new Error(`Invalid attribute name: "${s2}"`); e6 = I(t2, e6); let r6 = ""; if ("NOTATION" === t2.substring(e6, e6 + 8).toUpperCase()) { if (r6 = "NOTATION", "(" !== t2[e6 = I(t2, e6 += 8)]) throw new Error(`Expected '(', found "${t2[e6]}"`); e6++; let n5 = []; for (; e6 < t2.length && ")" !== t2[e6]; ) { const i7 = e6; for (; e6 < t2.length && "|" !== t2[e6] && ")" !== t2[e6]; ) e6++; let s3 = t2.substring(i7, e6); if (s3 = s3.trim(), !M(s3)) throw new Error(`Invalid notation name: "${s3}"`); n5.push(s3), "|" === t2[e6] && (e6++, e6 = I(t2, e6)); } if (")" !== t2[e6]) throw new Error("Unterminated list of notations"); e6++, r6 += " (" + n5.join("|") + ")"; } else { const n5 = e6; for (; e6 < t2.length && !/\s/.test(t2[e6]); ) e6++; r6 += t2.substring(n5, e6); const i7 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; if (!this.suppressValidationErr && !i7.includes(r6.toUpperCase())) throw new Error(`Invalid attribute type: "${r6}"`); } e6 = I(t2, e6); let o3 = ""; return "#REQUIRED" === t2.substring(e6, e6 + 8).toUpperCase() ? (o3 = "#REQUIRED", e6 += 8) : "#IMPLIED" === t2.substring(e6, e6 + 7).toUpperCase() ? (o3 = "#IMPLIED", e6 += 7) : [e6, o3] = this.readIdentifierVal(t2, e6, "ATTLIST"), { elementName: i6, attributeName: s2, attributeType: r6, defaultValue: o3, index: e6 }; } } const I = (t2, e6) => { for (; e6 < t2.length && /\s/.test(t2[e6]); ) e6++; return e6; }; function D(t2, e6, n4) { for (let i6 = 0; i6 < e6.length; i6++) if (e6[i6] !== t2[n4 + i6 + 1]) return false; return true; } function M(t2) { if (r5(t2)) return t2; throw new Error(`Invalid entity name ${t2}`); } const j5 = /^[-+]?0x[a-fA-F0-9]+$/, V = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, L = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true, infinity: "original" }; const k5 = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; class F { constructor(t2) { this._matcher = t2; } get separator() { return this._matcher.separator; } getCurrentTag() { const t2 = this._matcher.path; return t2.length > 0 ? t2[t2.length - 1].tag : void 0; } getCurrentNamespace() { const t2 = this._matcher.path; return t2.length > 0 ? t2[t2.length - 1].namespace : void 0; } getAttrValue(t2) { const e6 = this._matcher.path; if (0 !== e6.length) return e6[e6.length - 1].values?.[t2]; } hasAttr(t2) { const e6 = this._matcher.path; if (0 === e6.length) return false; const n4 = e6[e6.length - 1]; return void 0 !== n4.values && t2 in n4.values; } getPosition() { const t2 = this._matcher.path; return 0 === t2.length ? -1 : t2[t2.length - 1].position ?? 0; } getCounter() { const t2 = this._matcher.path; return 0 === t2.length ? -1 : t2[t2.length - 1].counter ?? 0; } getIndex() { return this.getPosition(); } getDepth() { return this._matcher.path.length; } toString(t2, e6 = true) { return this._matcher.toString(t2, e6); } toArray() { return this._matcher.path.map((t2) => t2.tag); } matches(t2) { return this._matcher.matches(t2); } matchesAny(t2) { return t2.matchesAny(this._matcher); } } class R { constructor(t2 = {}) { this.separator = t2.separator || ".", this.path = [], this.siblingStacks = [], this._pathStringCache = null, this._view = new F(this); } push(t2, e6 = null, n4 = null) { this._pathStringCache = null, this.path.length > 0 && (this.path[this.path.length - 1].values = void 0); const i6 = this.path.length; this.siblingStacks[i6] || (this.siblingStacks[i6] = /* @__PURE__ */ new Map()); const s2 = this.siblingStacks[i6], r6 = n4 ? `${n4}:${t2}` : t2, o3 = s2.get(r6) || 0; let a6 = 0; for (const t3 of s2.values()) a6 += t3; s2.set(r6, o3 + 1); const h6 = { tag: t2, position: a6, counter: o3 }; null != n4 && (h6.namespace = n4), null != e6 && (h6.values = e6), this.path.push(h6); } pop() { if (0 === this.path.length) return; this._pathStringCache = null; const t2 = this.path.pop(); return this.siblingStacks.length > this.path.length + 1 && (this.siblingStacks.length = this.path.length + 1), t2; } updateCurrent(t2) { if (this.path.length > 0) { const e6 = this.path[this.path.length - 1]; null != t2 && (e6.values = t2); } } getCurrentTag() { return this.path.length > 0 ? this.path[this.path.length - 1].tag : void 0; } getCurrentNamespace() { return this.path.length > 0 ? this.path[this.path.length - 1].namespace : void 0; } getAttrValue(t2) { if (0 !== this.path.length) return this.path[this.path.length - 1].values?.[t2]; } hasAttr(t2) { if (0 === this.path.length) return false; const e6 = this.path[this.path.length - 1]; return void 0 !== e6.values && t2 in e6.values; } getPosition() { return 0 === this.path.length ? -1 : this.path[this.path.length - 1].position ?? 0; } getCounter() { return 0 === this.path.length ? -1 : this.path[this.path.length - 1].counter ?? 0; } getIndex() { return this.getPosition(); } getDepth() { return this.path.length; } toString(t2, e6 = true) { const n4 = t2 || this.separator; if (n4 === this.separator && true === e6) { if (null !== this._pathStringCache) return this._pathStringCache; const t3 = this.path.map((t4) => t4.namespace ? `${t4.namespace}:${t4.tag}` : t4.tag).join(n4); return this._pathStringCache = t3, t3; } return this.path.map((t3) => e6 && t3.namespace ? `${t3.namespace}:${t3.tag}` : t3.tag).join(n4); } toArray() { return this.path.map((t2) => t2.tag); } reset() { this._pathStringCache = null, this.path = [], this.siblingStacks = []; } matches(t2) { const e6 = t2.segments; return 0 !== e6.length && (t2.hasDeepWildcard() ? this._matchWithDeepWildcard(e6) : this._matchSimple(e6)); } _matchSimple(t2) { if (this.path.length !== t2.length) return false; for (let e6 = 0; e6 < t2.length; e6++) if (!this._matchSegment(t2[e6], this.path[e6], e6 === this.path.length - 1)) return false; return true; } _matchWithDeepWildcard(t2) { let e6 = this.path.length - 1, n4 = t2.length - 1; for (; n4 >= 0 && e6 >= 0; ) { const i6 = t2[n4]; if ("deep-wildcard" === i6.type) { if (n4--, n4 < 0) return true; const i7 = t2[n4]; let s2 = false; for (let t3 = e6; t3 >= 0; t3--) if (this._matchSegment(i7, this.path[t3], t3 === this.path.length - 1)) { e6 = t3 - 1, n4--, s2 = true; break; } if (!s2) return false; } else { if (!this._matchSegment(i6, this.path[e6], e6 === this.path.length - 1)) return false; e6--, n4--; } } return n4 < 0; } _matchSegment(t2, e6, n4) { if ("*" !== t2.tag && t2.tag !== e6.tag) return false; if (void 0 !== t2.namespace && "*" !== t2.namespace && t2.namespace !== e6.namespace) return false; if (void 0 !== t2.attrName) { if (!n4) return false; if (!e6.values || !(t2.attrName in e6.values)) return false; if (void 0 !== t2.attrValue && String(e6.values[t2.attrName]) !== String(t2.attrValue)) return false; } if (void 0 !== t2.position) { if (!n4) return false; const i6 = e6.counter ?? 0; if ("first" === t2.position && 0 !== i6) return false; if ("odd" === t2.position && i6 % 2 != 1) return false; if ("even" === t2.position && i6 % 2 != 0) return false; if ("nth" === t2.position && i6 !== t2.positionValue) return false; } return true; } matchesAny(t2) { return t2.matchesAny(this); } snapshot() { return { path: this.path.map((t2) => ({ ...t2 })), siblingStacks: this.siblingStacks.map((t2) => new Map(t2)) }; } restore(t2) { this._pathStringCache = null, this.path = t2.path.map((t3) => ({ ...t3 })), this.siblingStacks = t2.siblingStacks.map((t3) => new Map(t3)); } readOnly() { return this._view; } } class G { constructor(t2, e6 = {}, n4) { this.pattern = t2, this.separator = e6.separator || ".", this.segments = this._parse(t2), this.data = n4, this._hasDeepWildcard = this.segments.some((t3) => "deep-wildcard" === t3.type), this._hasAttributeCondition = this.segments.some((t3) => void 0 !== t3.attrName), this._hasPositionSelector = this.segments.some((t3) => void 0 !== t3.position); } _parse(t2) { const e6 = []; let n4 = 0, i6 = ""; for (; n4 < t2.length; ) t2[n4] === this.separator ? n4 + 1 < t2.length && t2[n4 + 1] === this.separator ? (i6.trim() && (e6.push(this._parseSegment(i6.trim())), i6 = ""), e6.push({ type: "deep-wildcard" }), n4 += 2) : (i6.trim() && e6.push(this._parseSegment(i6.trim())), i6 = "", n4++) : (i6 += t2[n4], n4++); return i6.trim() && e6.push(this._parseSegment(i6.trim())), e6; } _parseSegment(t2) { const e6 = { type: "tag" }; let n4 = null, i6 = t2; const s2 = t2.match(/^([^\[]+)(\[[^\]]*\])(.*)$/); if (s2 && (i6 = s2[1] + s2[3], s2[2])) { const t3 = s2[2].slice(1, -1); t3 && (n4 = t3); } let r6, o3, a6 = i6; if (i6.includes("::")) { const e7 = i6.indexOf("::"); if (r6 = i6.substring(0, e7).trim(), a6 = i6.substring(e7 + 2).trim(), !r6) throw new Error(`Invalid namespace in pattern: ${t2}`); } let h6 = null; if (a6.includes(":")) { const t3 = a6.lastIndexOf(":"), e7 = a6.substring(0, t3).trim(), n5 = a6.substring(t3 + 1).trim(); ["first", "last", "odd", "even"].includes(n5) || /^nth\(\d+\)$/.test(n5) ? (o3 = e7, h6 = n5) : o3 = a6; } else o3 = a6; if (!o3) throw new Error(`Invalid segment pattern: ${t2}`); if (e6.tag = o3, r6 && (e6.namespace = r6), n4) if (n4.includes("=")) { const t3 = n4.indexOf("="); e6.attrName = n4.substring(0, t3).trim(), e6.attrValue = n4.substring(t3 + 1).trim(); } else e6.attrName = n4.trim(); if (h6) { const t3 = h6.match(/^nth\((\d+)\)$/); t3 ? (e6.position = "nth", e6.positionValue = parseInt(t3[1], 10)) : e6.position = h6; } return e6; } get length() { return this.segments.length; } hasDeepWildcard() { return this._hasDeepWildcard; } hasAttributeCondition() { return this._hasAttributeCondition; } hasPositionSelector() { return this._hasPositionSelector; } toString() { return this.pattern; } } class B { constructor() { this._byDepthAndTag = /* @__PURE__ */ new Map(), this._wildcardByDepth = /* @__PURE__ */ new Map(), this._deepWildcards = [], this._patterns = /* @__PURE__ */ new Set(), this._sealed = false; } add(t2) { if (this._sealed) throw new TypeError("ExpressionSet is sealed. Create a new ExpressionSet to add more expressions."); if (this._patterns.has(t2.pattern)) return this; if (this._patterns.add(t2.pattern), t2.hasDeepWildcard()) return this._deepWildcards.push(t2), this; const e6 = t2.length, n4 = t2.segments[t2.segments.length - 1], i6 = n4?.tag; if (i6 && "*" !== i6) { const n5 = `${e6}:${i6}`; this._byDepthAndTag.has(n5) || this._byDepthAndTag.set(n5, []), this._byDepthAndTag.get(n5).push(t2); } else this._wildcardByDepth.has(e6) || this._wildcardByDepth.set(e6, []), this._wildcardByDepth.get(e6).push(t2); return this; } addAll(t2) { for (const e6 of t2) this.add(e6); return this; } has(t2) { return this._patterns.has(t2.pattern); } get size() { return this._patterns.size; } seal() { return this._sealed = true, this; } get isSealed() { return this._sealed; } matchesAny(t2) { return null !== this.findMatch(t2); } findMatch(t2) { const e6 = t2.getDepth(), n4 = `${e6}:${t2.getCurrentTag()}`, i6 = this._byDepthAndTag.get(n4); if (i6) { for (let e7 = 0; e7 < i6.length; e7++) if (t2.matches(i6[e7])) return i6[e7]; } const s2 = this._wildcardByDepth.get(e6); if (s2) { for (let e7 = 0; e7 < s2.length; e7++) if (t2.matches(s2[e7])) return s2[e7]; } for (let e7 = 0; e7 < this._deepWildcards.length; e7++) if (t2.matches(this._deepWildcards[e7])) return this._deepWildcards[e7]; return null; } } const U = { cent: "\xA2", pound: "\xA3", curren: "\xA4", yen: "\xA5", euro: "\u20AC", dollar: "$", euro: "\u20AC", fnof: "\u0192", inr: "\u20B9", af: "\u060B", birr: "\u1265\u122D", peso: "\u20B1", rub: "\u20BD", won: "\u20A9", yuan: "\xA5", cedil: "\xB8" }, W = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' }, X = { nbsp: "\xA0", copy: "\xA9", reg: "\xAE", trade: "\u2122", mdash: "\u2014", ndash: "\u2013", hellip: "\u2026", laquo: "\xAB", raquo: "\xBB", lsquo: "\u2018", rsquo: "\u2019", ldquo: "\u201C", rdquo: "\u201D", bull: "\u2022", para: "\xB6", sect: "\xA7", deg: "\xB0", frac12: "\xBD", frac14: "\xBC", frac34: "\xBE" }, Y = new Set("!?\\\\/[]$%{}^&*()<>|+"); function z(t2) { if ("#" === t2[0]) throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${t2}"`); for (const e6 of t2) if (Y.has(e6)) throw new Error(`[EntityReplacer] Invalid character '${e6}' in entity name: "${t2}"`); return t2; } function q2(...t2) { const e6 = /* @__PURE__ */ Object.create(null); for (const n4 of t2) if (n4) for (const t3 of Object.keys(n4)) { const i6 = n4[t3]; if ("string" == typeof i6) e6[t3] = i6; else if (i6 && "object" == typeof i6 && void 0 !== i6.val) { const n5 = i6.val; "string" == typeof n5 && (e6[t3] = n5); } } return e6; } const Z = "external", J = "base", K = "all", Q = Object.freeze({ allow: 0, leave: 1, remove: 2, throw: 3 }), H = /* @__PURE__ */ new Set([9, 10, 13]); class tt { constructor(t2 = {}) { var e6; this._limit = t2.limit || {}, this._maxTotalExpansions = this._limit.maxTotalExpansions || 0, this._maxExpandedLength = this._limit.maxExpandedLength || 0, this._postCheck = "function" == typeof t2.postCheck ? t2.postCheck : (t3) => t3, this._limitTiers = (e6 = this._limit.applyLimitsTo ?? Z) && e6 !== Z ? e6 === K ? /* @__PURE__ */ new Set([K]) : e6 === J ? /* @__PURE__ */ new Set([J]) : Array.isArray(e6) ? new Set(e6) : /* @__PURE__ */ new Set([Z]) : /* @__PURE__ */ new Set([Z]), this._numericAllowed = t2.numericAllowed ?? true, this._baseMap = q2(W, t2.namedEntities || null), this._externalMap = /* @__PURE__ */ Object.create(null), this._inputMap = /* @__PURE__ */ Object.create(null), this._totalExpansions = 0, this._expandedLength = 0, this._removeSet = new Set(t2.remove && Array.isArray(t2.remove) ? t2.remove : []), this._leaveSet = new Set(t2.leave && Array.isArray(t2.leave) ? t2.leave : []); const n4 = (function(t3) { if (!t3) return { xmlVersion: 1, onLevel: Q.allow, nullLevel: Q.remove }; const e7 = 1.1 === t3.xmlVersion ? 1.1 : 1, n5 = Q[t3.onNCR] ?? Q.allow, i6 = Q[t3.nullNCR] ?? Q.remove; return { xmlVersion: e7, onLevel: n5, nullLevel: Math.max(i6, Q.remove) }; })(t2.ncr); this._ncrXmlVersion = n4.xmlVersion, this._ncrOnLevel = n4.onLevel, this._ncrNullLevel = n4.nullLevel; } setExternalEntities(t2) { if (t2) for (const e6 of Object.keys(t2)) z(e6); this._externalMap = q2(t2); } addExternalEntity(t2, e6) { z(t2), "string" == typeof e6 && -1 === e6.indexOf("&") && (this._externalMap[t2] = e6); } addInputEntities(t2) { this._totalExpansions = 0, this._expandedLength = 0, this._inputMap = q2(t2); } reset() { return this._inputMap = /* @__PURE__ */ Object.create(null), this._totalExpansions = 0, this._expandedLength = 0, this; } setXmlVersion(t2) { this._ncrXmlVersion = 1.1 === t2 ? 1.1 : 1; } decode(t2) { if ("string" != typeof t2 || 0 === t2.length) return t2; const e6 = t2, n4 = [], i6 = t2.length; let s2 = 0, r6 = 0; const o3 = this._maxTotalExpansions > 0, a6 = this._maxExpandedLength > 0, h6 = o3 || a6; for (; r6 < i6; ) { if (38 !== t2.charCodeAt(r6)) { r6++; continue; } let e7 = r6 + 1; for (; e7 < i6 && 59 !== t2.charCodeAt(e7) && e7 - r6 <= 32; ) e7++; if (e7 >= i6 || 59 !== t2.charCodeAt(e7)) { r6++; continue; } const l5 = t2.slice(r6 + 1, e7); if (0 === l5.length) { r6++; continue; } let u2, p3; if (this._removeSet.has(l5)) u2 = "", void 0 === p3 && (p3 = Z); else { if (this._leaveSet.has(l5)) { r6++; continue; } if (35 === l5.charCodeAt(0)) { const t3 = this._resolveNCR(l5); if (void 0 === t3) { r6++; continue; } u2 = t3, p3 = J; } else { const t3 = this._resolveName(l5); u2 = t3?.value, p3 = t3?.tier; } } if (void 0 !== u2) { if (r6 > s2 && n4.push(t2.slice(s2, r6)), n4.push(u2), s2 = e7 + 1, r6 = s2, h6 && this._tierCounts(p3)) { if (o3 && (this._totalExpansions++, this._totalExpansions > this._maxTotalExpansions)) throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`); if (a6) { const t3 = u2.length - (l5.length + 2); if (t3 > 0 && (this._expandedLength += t3, this._expandedLength > this._maxExpandedLength)) throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`); } } } else r6++; } s2 < i6 && n4.push(t2.slice(s2)); const l4 = 0 === n4.length ? t2 : n4.join(""); return this._postCheck(l4, e6); } _tierCounts(t2) { return !!this._limitTiers.has(K) || this._limitTiers.has(t2); } _resolveName(t2) { return t2 in this._inputMap ? { value: this._inputMap[t2], tier: Z } : t2 in this._externalMap ? { value: this._externalMap[t2], tier: Z } : t2 in this._baseMap ? { value: this._baseMap[t2], tier: J } : void 0; } _classifyNCR(t2) { return 0 === t2 ? this._ncrNullLevel : t2 >= 55296 && t2 <= 57343 || 1 === this._ncrXmlVersion && t2 >= 1 && t2 <= 31 && !H.has(t2) ? Q.remove : -1; } _applyNCRAction(t2, e6, n4) { switch (t2) { case Q.allow: return String.fromCodePoint(n4); case Q.remove: return ""; case Q.leave: return; case Q.throw: throw new Error(`[EntityDecoder] Prohibited numeric character reference &${e6}; (U+${n4.toString(16).toUpperCase().padStart(4, "0")})`); default: return String.fromCodePoint(n4); } } _resolveNCR(t2) { const e6 = t2.charCodeAt(1); let n4; if (n4 = 120 === e6 || 88 === e6 ? parseInt(t2.slice(2), 16) : parseInt(t2.slice(1), 10), Number.isNaN(n4) || n4 < 0 || n4 > 1114111) return; const i6 = this._classifyNCR(n4); if (!this._numericAllowed && i6 < Q.remove) return; const s2 = -1 === i6 ? this._ncrOnLevel : Math.max(this._ncrOnLevel, i6); return this._applyNCRAction(s2, t2, n4); } } function et(t2, e6) { if (!t2) return {}; const n4 = e6.attributesGroupName ? t2[e6.attributesGroupName] : t2; if (!n4) return {}; const i6 = {}; for (const t3 in n4) t3.startsWith(e6.attributeNamePrefix) ? i6[t3.substring(e6.attributeNamePrefix.length)] = n4[t3] : i6[t3] = n4[t3]; return i6; } function nt(t2) { if (!t2 || "string" != typeof t2) return; const e6 = t2.indexOf(":"); if (-1 !== e6 && e6 > 0) { const n4 = t2.substring(0, e6); if ("xmlns" !== n4) return n4; } } class it { constructor(t2, e6) { var n4; this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.parseXml = ht, this.parseTextData = st, this.resolveNameSpace = rt, this.buildAttributesMap = at, this.isItStopNode = ct, this.replaceEntitiesValue = ut, this.readStopNodeData = mt, this.saveTextToParentTag = pt, this.addChild = lt, this.ignoreAttributesFn = "function" == typeof (n4 = this.options.ignoreAttributes) ? n4 : Array.isArray(n4) ? (t3) => { for (const e7 of n4) { if ("string" == typeof e7 && t3 === e7) return true; if (e7 instanceof RegExp && e7.test(t3)) return true; } } : () => false, this.entityExpansionCount = 0, this.currentExpandedLength = 0; let i6 = { ...W }; this.options.entityDecoder ? this.entityDecoder = this.options.entityDecoder : ("object" == typeof this.options.htmlEntities ? i6 = this.options.htmlEntities : true === this.options.htmlEntities && (i6 = { ...X, ...U }), this.entityDecoder = new tt({ namedEntities: { ...i6, ...e6 }, numericAllowed: this.options.htmlEntities, limit: { maxTotalExpansions: this.options.processEntities.maxTotalExpansions, maxExpandedLength: this.options.processEntities.maxExpandedLength, applyLimitsTo: this.options.processEntities.appliesTo } })), this.matcher = new R(), this.readonlyMatcher = this.matcher.readOnly(), this.isCurrentNodeStopNode = false, this.stopNodeExpressionsSet = new B(); const s2 = this.options.stopNodes; if (s2 && s2.length > 0) { for (let t3 = 0; t3 < s2.length; t3++) { const e7 = s2[t3]; "string" == typeof e7 ? this.stopNodeExpressionsSet.add(new G(e7)) : e7 instanceof G && this.stopNodeExpressionsSet.add(e7); } this.stopNodeExpressionsSet.seal(); } } } function st(t2, e6, n4, i6, s2, r6, o3) { const a6 = this.options; if (void 0 !== t2 && (a6.trimValues && !i6 && (t2 = t2.trim()), t2.length > 0)) { o3 || (t2 = this.replaceEntitiesValue(t2, e6, n4)); const i7 = a6.jPath ? n4.toString() : n4, h6 = a6.tagValueProcessor(e6, t2, i7, s2, r6); return null == h6 ? t2 : typeof h6 != typeof t2 || h6 !== t2 ? h6 : a6.trimValues || t2.trim() === t2 ? xt(t2, a6.parseTagValue, a6.numberParseOptions) : t2; } } function rt(t2) { if (this.options.removeNSPrefix) { const e6 = t2.split(":"), n4 = "/" === t2.charAt(0) ? "/" : ""; if ("xmlns" === e6[0]) return ""; 2 === e6.length && (t2 = n4 + e6[1]); } return t2; } const ot = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function at(t2, e6, n4, i6 = false) { const r6 = this.options; if (true === i6 || true !== r6.ignoreAttributes && "string" == typeof t2) { const i7 = s(t2, ot), o3 = i7.length, a6 = {}, h6 = new Array(o3); let l4 = false; const u2 = {}; for (let t3 = 0; t3 < o3; t3++) { const e7 = this.resolveNameSpace(i7[t3][1]), s2 = i7[t3][4]; if (e7.length && void 0 !== s2) { let i8 = s2; r6.trimValues && (i8 = i8.trim()), i8 = this.replaceEntitiesValue(i8, n4, this.readonlyMatcher), h6[t3] = i8, u2[e7] = i8, l4 = true; } } l4 && "object" == typeof e6 && e6.updateCurrent && e6.updateCurrent(u2); const p3 = r6.jPath ? e6.toString() : this.readonlyMatcher; let c6 = false; for (let t3 = 0; t3 < o3; t3++) { const e7 = this.resolveNameSpace(i7[t3][1]); if (this.ignoreAttributesFn(e7, p3)) continue; let n5 = r6.attributeNamePrefix + e7; if (e7.length) if (r6.transformAttributeName && (n5 = r6.transformAttributeName(n5)), n5 = bt(n5, r6), void 0 !== i7[t3][4]) { const i8 = h6[t3], s2 = r6.attributeValueProcessor(e7, i8, p3); a6[n5] = null == s2 ? i8 : typeof s2 != typeof i8 || s2 !== i8 ? s2 : xt(i8, r6.parseAttributeValue, r6.numberParseOptions), c6 = true; } else r6.allowBooleanAttributes && (a6[n5] = true, c6 = true); } if (!c6) return; if (r6.attributesGroupName && !r6.preserveOrder) { const t3 = {}; return t3[r6.attributesGroupName] = a6, t3; } return a6; } } const ht = function(t2) { t2 = t2.replace(/\r\n?/g, "\n"); const e6 = new O("!xml"); let n4 = e6, i6 = ""; this.matcher.reset(), this.entityDecoder.reset(), this.entityExpansionCount = 0, this.currentExpandedLength = 0; const s2 = this.options, r6 = new $(s2.processEntities), o3 = t2.length; for (let a6 = 0; a6 < o3; a6++) if ("<" === t2[a6]) { const h6 = t2.charCodeAt(a6 + 1); if (47 === h6) { const e7 = dt(t2, ">", a6, "Closing Tag is not closed."); let r7 = t2.substring(a6 + 2, e7).trim(); if (s2.removeNSPrefix) { const t3 = r7.indexOf(":"); -1 !== t3 && (r7 = r7.substr(t3 + 1)); } r7 = Nt(s2.transformTagName, r7, "", s2).tagName, n4 && (i6 = this.saveTextToParentTag(i6, n4, this.readonlyMatcher)); const o4 = this.matcher.getCurrentTag(); if (r7 && s2.unpairedTagsSet.has(r7)) throw new Error(`Unpaired tag can not be used as closing tag: `); o4 && s2.unpairedTagsSet.has(o4) && (this.matcher.pop(), this.tagsNodeStack.pop()), this.matcher.pop(), this.isCurrentNodeStopNode = false, n4 = this.tagsNodeStack.pop(), i6 = "", a6 = e7; } else if (63 === h6) { let e7 = gt(t2, a6, false, "?>"); if (!e7) throw new Error("Pi Tag is not closed."); i6 = this.saveTextToParentTag(i6, n4, this.readonlyMatcher); const r7 = this.buildAttributesMap(e7.tagExp, this.matcher, e7.tagName, true); if (r7) { const t3 = r7[this.options.attributeNamePrefix + "version"]; this.entityDecoder.setXmlVersion(Number(t3) || 1); } if (s2.ignoreDeclaration && "?xml" === e7.tagName || s2.ignorePiTags) ; else { const t3 = new O(e7.tagName); t3.add(s2.textNodeName, ""), e7.tagName !== e7.tagExp && e7.attrExpPresent && true !== s2.ignoreAttributes && (t3[":@"] = r7), this.addChild(n4, t3, this.readonlyMatcher, a6); } a6 = e7.closeIndex + 1; } else if (33 === h6 && 45 === t2.charCodeAt(a6 + 2) && 45 === t2.charCodeAt(a6 + 3)) { const e7 = dt(t2, "-->", a6 + 4, "Comment is not closed."); if (s2.commentPropName) { const r7 = t2.substring(a6 + 4, e7 - 2); i6 = this.saveTextToParentTag(i6, n4, this.readonlyMatcher), n4.add(s2.commentPropName, [{ [s2.textNodeName]: r7 }]); } a6 = e7; } else if (33 === h6 && 68 === t2.charCodeAt(a6 + 2)) { const e7 = r6.readDocType(t2, a6); this.entityDecoder.addInputEntities(e7.entities), a6 = e7.i; } else if (33 === h6 && 91 === t2.charCodeAt(a6 + 2)) { const e7 = dt(t2, "]]>", a6, "CDATA is not closed.") - 2, r7 = t2.substring(a6 + 9, e7); i6 = this.saveTextToParentTag(i6, n4, this.readonlyMatcher); let o4 = this.parseTextData(r7, n4.tagname, this.readonlyMatcher, true, false, true, true); null == o4 && (o4 = ""), s2.cdataPropName ? n4.add(s2.cdataPropName, [{ [s2.textNodeName]: r7 }]) : n4.add(s2.textNodeName, o4), a6 = e7 + 2; } else { let r7 = gt(t2, a6, s2.removeNSPrefix); if (!r7) { const e7 = t2.substring(Math.max(0, a6 - 50), Math.min(o3, a6 + 50)); throw new Error(`readTagExp returned undefined at position ${a6}. Context: "${e7}"`); } let h7 = r7.tagName; const l4 = r7.rawTagName; let u2 = r7.tagExp, p3 = r7.attrExpPresent, c6 = r7.closeIndex; if ({ tagName: h7, tagExp: u2 } = Nt(s2.transformTagName, h7, u2, s2), s2.strictReservedNames && (h7 === s2.commentPropName || h7 === s2.cdataPropName || h7 === s2.textNodeName || h7 === s2.attributesGroupName)) throw new Error(`Invalid tag name: ${h7}`); n4 && i6 && "!xml" !== n4.tagname && (i6 = this.saveTextToParentTag(i6, n4, this.readonlyMatcher, false)); const d6 = n4; d6 && s2.unpairedTagsSet.has(d6.tagname) && (n4 = this.tagsNodeStack.pop(), this.matcher.pop()); let f6 = false; u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1 && (f6 = true, "/" === h7[h7.length - 1] ? (h7 = h7.substr(0, h7.length - 1), u2 = h7) : u2 = u2.substr(0, u2.length - 1), p3 = h7 !== u2); let g6, m4 = null, x2 = {}; g6 = nt(l4), h7 !== e6.tagname && this.matcher.push(h7, {}, g6), h7 !== u2 && p3 && (m4 = this.buildAttributesMap(u2, this.matcher, h7), m4 && (x2 = et(m4, s2))), h7 !== e6.tagname && (this.isCurrentNodeStopNode = this.isItStopNode()); const N2 = a6; if (this.isCurrentNodeStopNode) { let e7 = ""; if (f6) a6 = r7.closeIndex; else if (s2.unpairedTagsSet.has(h7)) a6 = r7.closeIndex; else { const n5 = this.readStopNodeData(t2, l4, c6 + 1); if (!n5) throw new Error(`Unexpected end of ${l4}`); a6 = n5.i, e7 = n5.tagContent; } const i7 = new O(h7); m4 && (i7[":@"] = m4), i7.add(s2.textNodeName, e7), this.matcher.pop(), this.isCurrentNodeStopNode = false, this.addChild(n4, i7, this.readonlyMatcher, N2); } else { if (f6) { ({ tagName: h7, tagExp: u2 } = Nt(s2.transformTagName, h7, u2, s2)); const t3 = new O(h7); m4 && (t3[":@"] = m4), this.addChild(n4, t3, this.readonlyMatcher, N2), this.matcher.pop(), this.isCurrentNodeStopNode = false; } else { if (s2.unpairedTagsSet.has(h7)) { const t3 = new O(h7); m4 && (t3[":@"] = m4), this.addChild(n4, t3, this.readonlyMatcher, N2), this.matcher.pop(), this.isCurrentNodeStopNode = false, a6 = r7.closeIndex; continue; } { const t3 = new O(h7); if (this.tagsNodeStack.length > s2.maxNestedTags) throw new Error("Maximum nested tags exceeded"); this.tagsNodeStack.push(n4), m4 && (t3[":@"] = m4), this.addChild(n4, t3, this.readonlyMatcher, N2), n4 = t3; } } i6 = "", a6 = c6; } } } else i6 += t2[a6]; return e6.child; }; function lt(t2, e6, n4, i6) { this.options.captureMetaData || (i6 = void 0); const s2 = this.options.jPath ? n4.toString() : n4, r6 = this.options.updateTag(e6.tagname, s2, e6[":@"]); false === r6 || ("string" == typeof r6 ? (e6.tagname = r6, t2.addChild(e6, i6)) : t2.addChild(e6, i6)); } function ut(t2, e6, n4) { const i6 = this.options.processEntities; if (!i6 || !i6.enabled) return t2; if (i6.allowedTags) { const s2 = this.options.jPath ? n4.toString() : n4; if (!(Array.isArray(i6.allowedTags) ? i6.allowedTags.includes(e6) : i6.allowedTags(e6, s2))) return t2; } if (i6.tagFilter) { const s2 = this.options.jPath ? n4.toString() : n4; if (!i6.tagFilter(e6, s2)) return t2; } return this.entityDecoder.decode(t2); } function pt(t2, e6, n4, i6) { return t2 && (void 0 === i6 && (i6 = 0 === e6.child.length), void 0 !== (t2 = this.parseTextData(t2, e6.tagname, n4, false, !!e6[":@"] && 0 !== Object.keys(e6[":@"]).length, i6)) && "" !== t2 && e6.add(this.options.textNodeName, t2), t2 = ""), t2; } function ct() { return 0 !== this.stopNodeExpressionsSet.size && this.matcher.matchesAny(this.stopNodeExpressionsSet); } function dt(t2, e6, n4, i6) { const s2 = t2.indexOf(e6, n4); if (-1 === s2) throw new Error(i6); return s2 + e6.length - 1; } function ft(t2, e6, n4, i6) { const s2 = t2.indexOf(e6, n4); if (-1 === s2) throw new Error(i6); return s2; } function gt(t2, e6, n4, i6 = ">") { const s2 = (function(t3, e7, n5 = ">") { let i7 = 0; const s3 = t3.length, r7 = n5.charCodeAt(0), o4 = n5.length > 1 ? n5.charCodeAt(1) : -1; let a7 = "", h7 = e7; for (let n6 = e7; n6 < s3; n6++) { const e8 = t3.charCodeAt(n6); if (i7) e8 === i7 && (i7 = 0); else if (34 === e8 || 39 === e8) i7 = e8; else if (e8 === r7) { if (-1 === o4) return a7 += t3.substring(h7, n6), { data: a7, index: n6 }; if (t3.charCodeAt(n6 + 1) === o4) return a7 += t3.substring(h7, n6), { data: a7, index: n6 }; } else 9 !== e8 || i7 || (a7 += t3.substring(h7, n6) + " ", h7 = n6 + 1); } })(t2, e6 + 1, i6); if (!s2) return; let r6 = s2.data; const o3 = s2.index, a6 = r6.search(/\s/); let h6 = r6, l4 = true; -1 !== a6 && (h6 = r6.substring(0, a6), r6 = r6.substring(a6 + 1).trimStart()); const u2 = h6; if (n4) { const t3 = h6.indexOf(":"); -1 !== t3 && (h6 = h6.substr(t3 + 1), l4 = h6 !== s2.data.substr(t3 + 1)); } return { tagName: h6, tagExp: r6, closeIndex: o3, attrExpPresent: l4, rawTagName: u2 }; } function mt(t2, e6, n4) { const i6 = n4; let s2 = 1; const r6 = t2.length; for (; n4 < r6; n4++) if ("<" === t2[n4]) { const r7 = t2.charCodeAt(n4 + 1); if (47 === r7) { const r8 = ft(t2, ">", n4, `${e6} is not closed`); if (t2.substring(n4 + 2, r8).trim() === e6 && (s2--, 0 === s2)) return { tagContent: t2.substring(i6, n4), i: r8 }; n4 = r8; } else if (63 === r7) n4 = dt(t2, "?>", n4 + 1, "StopNode is not closed."); else if (33 === r7 && 45 === t2.charCodeAt(n4 + 2) && 45 === t2.charCodeAt(n4 + 3)) n4 = dt(t2, "-->", n4 + 3, "StopNode is not closed."); else if (33 === r7 && 91 === t2.charCodeAt(n4 + 2)) n4 = dt(t2, "]]>", n4, "StopNode is not closed.") - 2; else { const i7 = gt(t2, n4, ">"); i7 && ((i7 && i7.tagName) === e6 && "/" !== i7.tagExp[i7.tagExp.length - 1] && s2++, n4 = i7.closeIndex); } } } function xt(t2, e6, n4) { if (e6 && "string" == typeof t2) { const e7 = t2.trim(); return "true" === e7 || "false" !== e7 && (function(t3, e8 = {}) { if (e8 = Object.assign({}, L, e8), !t3 || "string" != typeof t3) return t3; let n5 = t3.trim(); if (0 === n5.length) return t3; if (void 0 !== e8.skipLike && e8.skipLike.test(n5)) return t3; if ("0" === n5) return 0; if (e8.hex && j5.test(n5)) return (function(t4) { if (parseInt) return parseInt(t4, 16); if (Number.parseInt) return Number.parseInt(t4, 16); if (window && window.parseInt) return window.parseInt(t4, 16); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); })(n5); if (isFinite(n5)) { if (n5.includes("e") || n5.includes("E")) return (function(t4, e9, n6) { if (!n6.eNotation) return t4; const i7 = e9.match(k5); if (i7) { let s2 = i7[1] || ""; const r6 = -1 === i7[3].indexOf("e") ? "E" : "e", o3 = i7[2], a6 = s2 ? t4[o3.length + 1] === r6 : t4[o3.length] === r6; return o3.length > 1 && a6 ? t4 : (1 !== o3.length || !i7[3].startsWith(`.${r6}`) && i7[3][0] !== r6) && o3.length > 0 ? n6.leadingZeros && !a6 ? (e9 = (i7[1] || "") + i7[3], Number(e9)) : t4 : Number(e9); } return t4; })(t3, n5, e8); { const s2 = V.exec(n5); if (s2) { const r6 = s2[1] || "", o3 = s2[2]; let a6 = (i6 = s2[3]) && -1 !== i6.indexOf(".") ? ("." === (i6 = i6.replace(/0+$/, "")) ? i6 = "0" : "." === i6[0] ? i6 = "0" + i6 : "." === i6[i6.length - 1] && (i6 = i6.substring(0, i6.length - 1)), i6) : i6; const h6 = r6 ? "." === t3[o3.length + 1] : "." === t3[o3.length]; if (!e8.leadingZeros && (o3.length > 1 || 1 === o3.length && !h6)) return t3; { const i7 = Number(n5), s3 = String(i7); if (0 === i7) return i7; if (-1 !== s3.search(/[eE]/)) return e8.eNotation ? i7 : t3; if (-1 !== n5.indexOf(".")) return "0" === s3 || s3 === a6 || s3 === `${r6}${a6}` ? i7 : t3; let h7 = o3 ? a6 : n5; return o3 ? h7 === s3 || r6 + h7 === s3 ? i7 : t3 : h7 === s3 || h7 === r6 + s3 ? i7 : t3; } } return t3; } } var i6; return (function(t4, e9, n6) { const i7 = e9 === 1 / 0; switch (n6.infinity.toLowerCase()) { case "null": return null; case "infinity": return e9; case "string": return i7 ? "Infinity" : "-Infinity"; default: return t4; } })(t3, Number(n5), e8); })(t2, n4); } return void 0 !== t2 ? t2 : ""; } function Nt(t2, e6, n4, i6) { if (t2) { const i7 = t2(e6); n4 === e6 && (n4 = i7), e6 = i7; } return { tagName: e6 = bt(e6, i6), tagExp: n4 }; } function bt(t2, e6) { if (a5.includes(t2)) throw new Error(`[SECURITY] Invalid name: "${t2}" is a reserved JavaScript keyword that could cause prototype pollution`); return o2.includes(t2) ? e6.onDangerousProperty(t2) : t2; } const yt = O.getMetaDataSymbol(); function Et(t2, e6) { if (!t2 || "object" != typeof t2) return {}; if (!e6) return t2; const n4 = {}; for (const i6 in t2) i6.startsWith(e6) ? n4[i6.substring(e6.length)] = t2[i6] : n4[i6] = t2[i6]; return n4; } function wt(t2, e6, n4, i6) { return vt(t2, e6, n4, i6); } function vt(t2, e6, n4, i6) { let s2; const r6 = {}; for (let o3 = 0; o3 < t2.length; o3++) { const a6 = t2[o3], h6 = St(a6); if (void 0 !== h6 && h6 !== e6.textNodeName) { const t3 = Et(a6[":@"] || {}, e6.attributeNamePrefix); n4.push(h6, t3); } if (h6 === e6.textNodeName) void 0 === s2 ? s2 = a6[h6] : s2 += "" + a6[h6]; else { if (void 0 === h6) continue; if (a6[h6]) { let t3 = vt(a6[h6], e6, n4, i6); const s3 = At(t3, e6); if (a6[":@"] ? _t(t3, a6[":@"], i6, e6) : 1 !== Object.keys(t3).length || void 0 === t3[e6.textNodeName] || e6.alwaysCreateTextNode ? 0 === Object.keys(t3).length && (e6.alwaysCreateTextNode ? t3[e6.textNodeName] = "" : t3 = "") : t3 = t3[e6.textNodeName], void 0 !== a6[yt] && "object" == typeof t3 && null !== t3 && (t3[yt] = a6[yt]), void 0 !== r6[h6] && Object.prototype.hasOwnProperty.call(r6, h6)) Array.isArray(r6[h6]) || (r6[h6] = [r6[h6]]), r6[h6].push(t3); else { const n5 = e6.jPath ? i6.toString() : i6; e6.isArray(h6, n5, s3) ? r6[h6] = [t3] : r6[h6] = t3; } void 0 !== h6 && h6 !== e6.textNodeName && n4.pop(); } } } return "string" == typeof s2 ? s2.length > 0 && (r6[e6.textNodeName] = s2) : void 0 !== s2 && (r6[e6.textNodeName] = s2), r6; } function St(t2) { const e6 = Object.keys(t2); for (let t3 = 0; t3 < e6.length; t3++) { const n4 = e6[t3]; if (":@" !== n4) return n4; } } function _t(t2, e6, n4, i6) { if (e6) { const s2 = Object.keys(e6), r6 = s2.length; for (let o3 = 0; o3 < r6; o3++) { const r7 = s2[o3], a6 = r7.startsWith(i6.attributeNamePrefix) ? r7.substring(i6.attributeNamePrefix.length) : r7, h6 = i6.jPath ? n4.toString() + "." + a6 : n4; i6.isArray(r7, h6, true, true) ? t2[r7] = [e6[r7]] : t2[r7] = e6[r7]; } } } function At(t2, e6) { const { textNodeName: n4 } = e6, i6 = Object.keys(t2).length; return 0 === i6 || !(1 !== i6 || !t2[n4] && "boolean" != typeof t2[n4] && 0 !== t2[n4]); } class Tt { constructor(t2) { this.externalEntities = {}, this.options = C(t2); } parse(t2, e6) { if ("string" != typeof t2 && t2.toString) t2 = t2.toString(); else if ("string" != typeof t2) throw new Error("XML data is accepted in String or Bytes[] form."); if (e6) { true === e6 && (e6 = {}); const n5 = l3(t2, e6); if (true !== n5) throw Error(`${n5.err.msg}:${n5.err.line}:${n5.err.col}`); } const n4 = new it(this.options, this.externalEntities), i6 = n4.parseXml(t2); return this.options.preserveOrder || void 0 === i6 ? i6 : wt(i6, this.options, n4.matcher, n4.readonlyMatcher); } addEntity(t2, e6) { if (-1 !== e6.indexOf("&")) throw new Error("Entity value can't have '&'"); if (-1 !== t2.indexOf("&") || -1 !== t2.indexOf(";")) throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); if ("&" === e6) throw new Error("An entity with value '&' is not permitted"); this.externalEntities[t2] = e6; } static getMetaDataSymbol() { return O.getMetaDataSymbol(); } } function Ct(t2, e6) { let n4 = ""; e6.format && e6.indentBy.length > 0 && (n4 = "\n"); const i6 = []; if (e6.stopNodes && Array.isArray(e6.stopNodes)) for (let t3 = 0; t3 < e6.stopNodes.length; t3++) { const n5 = e6.stopNodes[t3]; "string" == typeof n5 ? i6.push(new G(n5)) : n5 instanceof G && i6.push(n5); } return Pt(t2, e6, n4, new R(), i6); } function Pt(t2, e6, n4, i6, s2) { let r6 = "", o3 = false; if (e6.maxNestedTags && i6.getDepth() > e6.maxNestedTags) throw new Error("Maximum nested tags exceeded"); if (!Array.isArray(t2)) { if (null != t2) { let n5 = t2.toString(); return n5 = Vt(n5, e6), n5; } return ""; } for (let a6 = 0; a6 < t2.length; a6++) { const h6 = t2[a6], l4 = Dt(h6); if (void 0 === l4) continue; const u2 = Ot(h6[":@"], e6); i6.push(l4, u2); const p3 = jt(i6, s2); if (l4 === e6.textNodeName) { let t3 = h6[l4]; p3 || (t3 = e6.tagValueProcessor(l4, t3), t3 = Vt(t3, e6)), o3 && (r6 += n4), r6 += t3, o3 = false, i6.pop(); continue; } if (l4 === e6.cdataPropName) { o3 && (r6 += n4); const t3 = h6[l4][0][e6.textNodeName]; r6 += `/g, "]]]]>")}]]>`, o3 = false, i6.pop(); continue; } if (l4 === e6.commentPropName) { const t3 = h6[l4][0][e6.textNodeName]; r6 += n4 + ``, o3 = true, i6.pop(); continue; } if ("?" === l4[0]) { const t3 = Mt(h6[":@"], e6, p3), s3 = "?xml" === l4 ? "" : n4; let a7 = h6[l4][0][e6.textNodeName]; a7 = 0 !== a7.length ? " " + a7 : "", r6 += s3 + `<${l4}${a7}${t3}?>`, o3 = true, i6.pop(); continue; } let c6 = n4; "" !== c6 && (c6 += e6.indentBy); const d6 = n4 + `<${l4}${Mt(h6[":@"], e6, p3)}`; let f6; f6 = p3 ? $t(h6[l4], e6) : Pt(h6[l4], e6, c6, i6, s2), -1 !== e6.unpairedTags.indexOf(l4) ? e6.suppressUnpairedNode ? r6 += d6 + ">" : r6 += d6 + "/>" : f6 && 0 !== f6.length || !e6.suppressEmptyNode ? f6 && f6.endsWith(">") ? r6 += d6 + `>${f6}${n4}` : (r6 += d6 + ">", f6 && "" !== n4 && (f6.includes("/>") || f6.includes("`) : r6 += d6 + "/>", o3 = true, i6.pop(); } return r6; } function Ot(t2, e6) { if (!t2 || e6.ignoreAttributes) return null; const n4 = {}; let i6 = false; for (let s2 in t2) Object.prototype.hasOwnProperty.call(t2, s2) && (n4[s2.startsWith(e6.attributeNamePrefix) ? s2.substr(e6.attributeNamePrefix.length) : s2] = t2[s2], i6 = true); return i6 ? n4 : null; } function $t(t2, e6) { if (!Array.isArray(t2)) return null != t2 ? t2.toString() : ""; let n4 = ""; for (let i6 = 0; i6 < t2.length; i6++) { const s2 = t2[i6], r6 = Dt(s2); if (r6 === e6.textNodeName) n4 += s2[r6]; else if (r6 === e6.cdataPropName) n4 += s2[r6][0][e6.textNodeName]; else if (r6 === e6.commentPropName) n4 += s2[r6][0][e6.textNodeName]; else { if (r6 && "?" === r6[0]) continue; if (r6) { const t3 = It(s2[":@"], e6), i7 = $t(s2[r6], e6); i7 && 0 !== i7.length ? n4 += `<${r6}${t3}>${i7}` : n4 += `<${r6}${t3}/>`; } } } return n4; } function It(t2, e6) { let n4 = ""; if (t2 && !e6.ignoreAttributes) for (let i6 in t2) { if (!Object.prototype.hasOwnProperty.call(t2, i6)) continue; let s2 = t2[i6]; true === s2 && e6.suppressBooleanAttributes ? n4 += ` ${i6.substr(e6.attributeNamePrefix.length)}` : n4 += ` ${i6.substr(e6.attributeNamePrefix.length)}="${s2}"`; } return n4; } function Dt(t2) { const e6 = Object.keys(t2); for (let n4 = 0; n4 < e6.length; n4++) { const i6 = e6[n4]; if (Object.prototype.hasOwnProperty.call(t2, i6) && ":@" !== i6) return i6; } } function Mt(t2, e6, n4) { let i6 = ""; if (t2 && !e6.ignoreAttributes) for (let s2 in t2) { if (!Object.prototype.hasOwnProperty.call(t2, s2)) continue; let r6; n4 ? r6 = t2[s2] : (r6 = e6.attributeValueProcessor(s2, t2[s2]), r6 = Vt(r6, e6)), true === r6 && e6.suppressBooleanAttributes ? i6 += ` ${s2.substr(e6.attributeNamePrefix.length)}` : i6 += ` ${s2.substr(e6.attributeNamePrefix.length)}="${r6}"`; } return i6; } function jt(t2, e6) { if (!e6 || 0 === e6.length) return false; for (let n4 = 0; n4 < e6.length; n4++) if (t2.matches(e6[n4])) return true; return false; } function Vt(t2, e6) { if (t2 && t2.length > 0 && e6.processEntities) for (let n4 = 0; n4 < e6.entities.length; n4++) { const i6 = e6.entities[n4]; t2 = t2.replace(i6.regex, i6.val); } return t2; } const Lt = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: function(t2, e6) { return e6; }, attributeValueProcessor: function(t2, e6) { return e6; }, preserveOrder: false, commentPropName: false, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&" }, { regex: new RegExp(">", "g"), val: ">" }, { regex: new RegExp("<", "g"), val: "<" }, { regex: new RegExp("'", "g"), val: "'" }, { regex: new RegExp('"', "g"), val: """ }], processEntities: true, stopNodes: [], oneListGroup: false, maxNestedTags: 100, jPath: true }; function kt(t2) { if (this.options = Object.assign({}, Lt, t2), this.options.stopNodes && Array.isArray(this.options.stopNodes) && (this.options.stopNodes = this.options.stopNodes.map((t3) => "string" == typeof t3 && t3.startsWith("*.") ? ".." + t3.substring(2) : t3)), this.stopNodeExpressions = [], this.options.stopNodes && Array.isArray(this.options.stopNodes)) for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { const e7 = this.options.stopNodes[t3]; "string" == typeof e7 ? this.stopNodeExpressions.push(new G(e7)) : e7 instanceof G && this.stopNodeExpressions.push(e7); } var e6; true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { return false; } : (this.ignoreAttributesFn = "function" == typeof (e6 = this.options.ignoreAttributes) ? e6 : Array.isArray(e6) ? (t3) => { for (const n4 of e6) { if ("string" == typeof n4 && t3 === n4) return true; if (n4 instanceof RegExp && n4.test(t3)) return true; } } : () => false, this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Gt), this.processTextOrObjNode = Ft, this.options.format ? (this.indentate = Rt, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } function Ft(t2, e6, n4, i6) { const s2 = this.extractAttributes(t2); if (i6.push(e6, s2), this.checkStopNode(i6)) { const s3 = this.buildRawContent(t2), r7 = this.buildAttributesForStopNode(t2); return i6.pop(), this.buildObjectNode(s3, e6, r7, n4); } const r6 = this.j2x(t2, n4 + 1, i6); return i6.pop(), void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e6, r6.attrStr, n4, i6) : this.buildObjectNode(r6.val, e6, r6.attrStr, n4); } function Rt(t2) { return this.options.indentBy.repeat(t2); } function Gt(t2) { return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); } kt.prototype.build = function(t2) { if (this.options.preserveOrder) return Ct(t2, this.options); { Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }); const e6 = new R(); return this.j2x(t2, 0, e6).val; } }, kt.prototype.j2x = function(t2, e6, n4) { let i6 = "", s2 = ""; if (this.options.maxNestedTags && n4.getDepth() >= this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded"); const r6 = this.options.jPath ? n4.toString() : n4, o3 = this.checkStopNode(n4); for (let a6 in t2) if (Object.prototype.hasOwnProperty.call(t2, a6)) if (void 0 === t2[a6]) this.isAttribute(a6) && (s2 += ""); else if (null === t2[a6]) this.isAttribute(a6) || a6 === this.options.cdataPropName ? s2 += "" : "?" === a6[0] ? s2 += this.indentate(e6) + "<" + a6 + "?" + this.tagEndChar : s2 += this.indentate(e6) + "<" + a6 + "/" + this.tagEndChar; else if (t2[a6] instanceof Date) s2 += this.buildTextValNode(t2[a6], a6, "", e6, n4); else if ("object" != typeof t2[a6]) { const h6 = this.isAttribute(a6); if (h6 && !this.ignoreAttributesFn(h6, r6)) i6 += this.buildAttrPairStr(h6, "" + t2[a6], o3); else if (!h6) if (a6 === this.options.textNodeName) { let e7 = this.options.tagValueProcessor(a6, "" + t2[a6]); s2 += this.replaceEntitiesValue(e7); } else { n4.push(a6); const i7 = this.checkStopNode(n4); if (n4.pop(), i7) { const n5 = "" + t2[a6]; s2 += "" === n5 ? this.indentate(e6) + "<" + a6 + this.closeTag(a6) + this.tagEndChar : this.indentate(e6) + "<" + a6 + ">" + n5 + "" + t4 + "${t3}`; else if ("object" == typeof t3 && null !== t3) { const i7 = this.buildRawContent(t3), s2 = this.buildAttributesForStopNode(t3); e6 += "" === i7 ? `<${n4}${s2}/>` : `<${n4}${s2}>${i7}`; } } else if ("object" == typeof i6 && null !== i6) { const t3 = this.buildRawContent(i6), s2 = this.buildAttributesForStopNode(i6); e6 += "" === t3 ? `<${n4}${s2}/>` : `<${n4}${s2}>${t3}`; } else e6 += `<${n4}>${i6}`; } return e6; }, kt.prototype.buildAttributesForStopNode = function(t2) { if (!t2 || "object" != typeof t2) return ""; let e6 = ""; if (this.options.attributesGroupName && t2[this.options.attributesGroupName]) { const n4 = t2[this.options.attributesGroupName]; for (let t3 in n4) { if (!Object.prototype.hasOwnProperty.call(n4, t3)) continue; const i6 = t3.startsWith(this.options.attributeNamePrefix) ? t3.substring(this.options.attributeNamePrefix.length) : t3, s2 = n4[t3]; true === s2 && this.options.suppressBooleanAttributes ? e6 += " " + i6 : e6 += " " + i6 + '="' + s2 + '"'; } } else for (let n4 in t2) { if (!Object.prototype.hasOwnProperty.call(t2, n4)) continue; const i6 = this.isAttribute(n4); if (i6) { const s2 = t2[n4]; true === s2 && this.options.suppressBooleanAttributes ? e6 += " " + i6 : e6 += " " + i6 + '="' + s2 + '"'; } } return e6; }, kt.prototype.buildObjectNode = function(t2, e6, n4, i6) { if ("" === t2) return "?" === e6[0] ? this.indentate(i6) + "<" + e6 + n4 + "?" + this.tagEndChar : this.indentate(i6) + "<" + e6 + n4 + this.closeTag(e6) + this.tagEndChar; { let s2 = "` + this.newLine : this.indentate(i6) + "<" + e6 + n4 + r6 + this.tagEndChar + t2 + this.indentate(i6) + s2 : this.indentate(i6) + "<" + e6 + n4 + r6 + ">" + t2 + s2; } }, kt.prototype.closeTag = function(t2) { let e6 = ""; return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e6 = "/") : e6 = this.options.suppressEmptyNode ? "/" : `>/g, "]]]]>"); return this.indentate(i6) + `` + this.newLine; } if (false !== this.options.commentPropName && e6 === this.options.commentPropName) { const e7 = String(t2).replace(/--/g, "- -").replace(/-$/, "- "); return this.indentate(i6) + `` + this.newLine; } if ("?" === e6[0]) return this.indentate(i6) + "<" + e6 + n4 + "?" + this.tagEndChar; { let s3 = this.options.tagValueProcessor(e6, t2); return s3 = this.replaceEntitiesValue(s3), "" === s3 ? this.indentate(i6) + "<" + e6 + n4 + this.closeTag(e6) + this.tagEndChar : this.indentate(i6) + "<" + e6 + n4 + ">" + s3 + " 0 && this.options.processEntities) for (let e6 = 0; e6 < this.options.entities.length; e6++) { const n4 = this.options.entities[e6]; t2 = t2.replace(n4.regex, n4.val); } return t2; }; const Bt = kt, Ut = { validate: l3 }; module2.exports = e5; })(); } }); // node_modules/@aws-sdk/xml-builder/dist-cjs/xml-external/nodable_entities.js var require_nodable_entities = __commonJS({ "node_modules/@aws-sdk/xml-builder/dist-cjs/xml-external/nodable_entities.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.EntityDecoderImpl = exports2.CURRENCY = exports2.COMMON_HTML = exports2.XML = void 0; exports2.XML = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' }; exports2.COMMON_HTML = { nbsp: "\xA0", copy: "\xA9", reg: "\xAE", trade: "\u2122", mdash: "\u2014", ndash: "\u2013", hellip: "\u2026", laquo: "\xAB", raquo: "\xBB", lsquo: "\u2018", rsquo: "\u2019", ldquo: "\u201C", rdquo: "\u201D", bull: "\u2022", para: "\xB6", sect: "\xA7", deg: "\xB0", frac12: "\xBD", frac14: "\xBC", frac34: "\xBE" }; exports2.CURRENCY = { cent: "\xA2", pound: "\xA3", curren: "\xA4", yen: "\xA5", euro: "\u20AC", dollar: "$", fnof: "\u0192", inr: "\u20B9", af: "\u060B", birr: "\u1265\u122D", peso: "\u20B1", rub: "\u20BD", won: "\u20A9", yuan: "\xA5", cedil: "\xB8" }; var SPECIAL_CHARS = new Set("!?\\/[]$%{}^&*()<>|+"); function validateEntityName(name) { if (name[0] === "#") { throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${name}"`); } for (const ch of name) { if (SPECIAL_CHARS.has(ch)) { throw new Error(`[EntityReplacer] Invalid character '${ch}' in entity name: "${name}"`); } } return name; } function mergeEntityMaps(...maps) { const out = /* @__PURE__ */ Object.create(null); for (const map2 of maps) { if (!map2) { continue; } for (const key of Object.keys(map2)) { const raw = map2[key]; if (typeof raw === "string") { out[key] = raw; } else if (raw && typeof raw === "object" && raw.val !== void 0) { const val = raw.val; if (typeof val === "string") { out[key] = val; } } } } return out; } var LIMIT_TIER_EXTERNAL = "external"; var LIMIT_TIER_BASE = "base"; var LIMIT_TIER_ALL = "all"; function parseLimitTiers(raw) { if (!raw || raw === LIMIT_TIER_EXTERNAL) { return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL]); } if (raw === LIMIT_TIER_ALL) { return /* @__PURE__ */ new Set([LIMIT_TIER_ALL]); } if (raw === LIMIT_TIER_BASE) { return /* @__PURE__ */ new Set([LIMIT_TIER_BASE]); } if (Array.isArray(raw)) { return new Set(raw); } return /* @__PURE__ */ new Set([LIMIT_TIER_EXTERNAL]); } var NCR_LEVEL = Object.freeze({ allow: 0, leave: 1, remove: 2, throw: 3 }); var XML10_ALLOWED_C0 = /* @__PURE__ */ new Set([9, 10, 13]); function parseNCRConfig(ncr) { if (!ncr) { return { xmlVersion: 1, onLevel: NCR_LEVEL.allow, nullLevel: NCR_LEVEL.remove }; } const xmlVersion = ncr.xmlVersion === 1.1 ? 1.1 : 1; const onLevel = NCR_LEVEL[ncr.onNCR ?? "allow"] ?? NCR_LEVEL.allow; const nullLevel = NCR_LEVEL[ncr.nullNCR ?? "remove"] ?? NCR_LEVEL.remove; const clampedNull = Math.max(nullLevel, NCR_LEVEL.remove); return { xmlVersion, onLevel, nullLevel: clampedNull }; } var EntityDecoderImpl = class EntityDecoderImpl { _limit; _maxTotalExpansions; _maxExpandedLength; _postCheck; _limitTiers; _numericAllowed; _baseMap; _externalMap; _inputMap; _totalExpansions; _expandedLength; _removeSet; _leaveSet; _ncrXmlVersion; _ncrOnLevel; _ncrNullLevel; constructor(options = {}) { this._limit = options.limit || {}; this._maxTotalExpansions = this._limit.maxTotalExpansions || 0; this._maxExpandedLength = this._limit.maxExpandedLength || 0; this._postCheck = typeof options.postCheck === "function" ? options.postCheck : (r5) => r5; this._limitTiers = parseLimitTiers(this._limit.applyLimitsTo ?? LIMIT_TIER_EXTERNAL); this._numericAllowed = options.numericAllowed ?? true; this._baseMap = mergeEntityMaps(exports2.XML, options.namedEntities || null); this._externalMap = /* @__PURE__ */ Object.create(null); this._inputMap = /* @__PURE__ */ Object.create(null); this._totalExpansions = 0; this._expandedLength = 0; this._removeSet = new Set(options.remove && Array.isArray(options.remove) ? options.remove : []); this._leaveSet = new Set(options.leave && Array.isArray(options.leave) ? options.leave : []); const ncrCfg = parseNCRConfig(options.ncr); this._ncrXmlVersion = ncrCfg.xmlVersion; this._ncrOnLevel = ncrCfg.onLevel; this._ncrNullLevel = ncrCfg.nullLevel; } setExternalEntities(map2) { if (map2) { for (const key of Object.keys(map2)) { validateEntityName(key); } } this._externalMap = mergeEntityMaps(map2); } addExternalEntity(key, value) { validateEntityName(key); if (typeof value === "string" && value.indexOf("&") === -1) { this._externalMap[key] = value; } } addInputEntities(map2) { this._totalExpansions = 0; this._expandedLength = 0; this._inputMap = mergeEntityMaps(map2); } reset() { this._inputMap = /* @__PURE__ */ Object.create(null); this._totalExpansions = 0; this._expandedLength = 0; return this; } setXmlVersion(version) { this._ncrXmlVersion = version === "1.1" || version === 1.1 ? 1.1 : 1; } decode(str) { if (typeof str !== "string" || str.length === 0) { return str; } const original = str; const chunks = []; const len = str.length; let last = 0; let i5 = 0; const limitExpansions = this._maxTotalExpansions > 0; const limitLength = this._maxExpandedLength > 0; const checkLimits = limitExpansions || limitLength; while (i5 < len) { if (str.charCodeAt(i5) !== 38) { i5++; continue; } let j5 = i5 + 1; while (j5 < len && str.charCodeAt(j5) !== 59 && j5 - i5 <= 32) { j5++; } if (j5 >= len || str.charCodeAt(j5) !== 59) { i5++; continue; } const token = str.slice(i5 + 1, j5); if (token.length === 0) { i5++; continue; } let replacement; let tier; if (this._removeSet.has(token)) { replacement = ""; if (tier === void 0) { tier = LIMIT_TIER_EXTERNAL; } } else if (this._leaveSet.has(token)) { i5++; continue; } else if (token.charCodeAt(0) === 35) { const ncrResult = this._resolveNCR(token); if (ncrResult === void 0) { i5++; continue; } replacement = ncrResult; tier = LIMIT_TIER_BASE; } else { const resolved = this._resolveName(token); replacement = resolved?.value; tier = resolved?.tier; } if (replacement === void 0) { i5++; continue; } if (i5 > last) { chunks.push(str.slice(last, i5)); } chunks.push(replacement); last = j5 + 1; i5 = last; if (checkLimits && this._tierCounts(tier)) { if (limitExpansions) { this._totalExpansions++; if (this._totalExpansions > this._maxTotalExpansions) { throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`); } } if (limitLength) { const delta = replacement.length - (token.length + 2); if (delta > 0) { this._expandedLength += delta; if (this._expandedLength > this._maxExpandedLength) { throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`); } } } } } if (last < len) { chunks.push(str.slice(last)); } const result = chunks.length === 0 ? str : chunks.join(""); return this._postCheck(result, original); } _tierCounts(tier) { if (this._limitTiers.has(LIMIT_TIER_ALL)) { return true; } return this._limitTiers.has(tier); } _resolveName(name) { if (name in this._inputMap) { return { value: this._inputMap[name], tier: LIMIT_TIER_EXTERNAL }; } if (name in this._externalMap) { return { value: this._externalMap[name], tier: LIMIT_TIER_EXTERNAL }; } if (name in this._baseMap) { return { value: this._baseMap[name], tier: LIMIT_TIER_BASE }; } return void 0; } _classifyNCR(cp) { if (cp === 0) { return this._ncrNullLevel; } if (cp >= 55296 && cp <= 57343) { return NCR_LEVEL.remove; } if (this._ncrXmlVersion === 1) { if (cp >= 1 && cp <= 31 && !XML10_ALLOWED_C0.has(cp)) { return NCR_LEVEL.remove; } } return -1; } _applyNCRAction(action, token, cp) { switch (action) { case NCR_LEVEL.allow: return String.fromCodePoint(cp); case NCR_LEVEL.remove: return ""; case NCR_LEVEL.leave: return void 0; case NCR_LEVEL.throw: throw new Error(`[EntityDecoder] Prohibited numeric character reference &${token}; (U+${cp.toString(16).toUpperCase().padStart(4, "0")})`); default: return String.fromCodePoint(cp); } } _resolveNCR(token) { const second = token.charCodeAt(1); let cp; if (second === 120 || second === 88) { cp = parseInt(token.slice(2), 16); } else { cp = parseInt(token.slice(1), 10); } if (Number.isNaN(cp) || cp < 0 || cp > 1114111) { return void 0; } const minimum = this._classifyNCR(cp); if (!this._numericAllowed && minimum < NCR_LEVEL.remove) { return void 0; } const effective = minimum === -1 ? this._ncrOnLevel : Math.max(this._ncrOnLevel, minimum); return this._applyNCRAction(effective, token, cp); } }; exports2.EntityDecoderImpl = EntityDecoderImpl; } }); // node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js var require_xml_parser = __commonJS({ "node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.parseXML = parseXML3; var fast_xml_parser_1 = require_fxp(); var nodable_entities_1 = require_nodable_entities(); var entityDecoder = new nodable_entities_1.EntityDecoderImpl({ namedEntities: { ...nodable_entities_1.XML, ...nodable_entities_1.COMMON_HTML, ...nodable_entities_1.CURRENCY }, numericAllowed: true, limit: { maxTotalExpansions: Infinity }, ncr: { xmlVersion: 1.1 } }); var parser = new fast_xml_parser_1.XMLParser({ attributeNamePrefix: "", processEntities: { enabled: true, maxTotalExpansions: Infinity }, htmlEntities: true, entityDecoder: { setExternalEntities: (entities) => { entityDecoder.setExternalEntities(entities); }, addInputEntities: (entities) => { entityDecoder.addInputEntities(entities); }, reset: () => { entityDecoder.reset(); }, decode: (text) => { return entityDecoder.decode(text); }, setXmlVersion: (version) => void {} }, ignoreAttributes: false, ignoreDeclaration: true, parseTagValue: false, trimValues: false, tagValueProcessor: (_, val) => val.trim() === "" && val.includes("\n") ? "" : void 0, maxNestedTags: Infinity }); function parseXML3(xmlString) { return parser.parse(xmlString, true); } } }); // node_modules/@aws-sdk/xml-builder/dist-cjs/index.js var require_dist_cjs38 = __commonJS({ "node_modules/@aws-sdk/xml-builder/dist-cjs/index.js"(exports2) { "use strict"; var xmlParser = require_xml_parser(); var ATTR_ESCAPE_RE = /[&<>"]/g; var ATTR_ESCAPE_MAP = { "&": "&", "<": "<", ">": ">", '"': """ }; function escapeAttribute(value) { return value.replace(ATTR_ESCAPE_RE, (ch) => ATTR_ESCAPE_MAP[ch]); } var ELEMENT_ESCAPE_RE = /[&"'<>\r\n\u0085\u2028]/g; var ELEMENT_ESCAPE_MAP = { "&": "&", '"': """, "'": "'", "<": "<", ">": ">", "\r": " ", "\n": " ", "\x85": "…", "\u2028": "
" }; function escapeElement(value) { return value.replace(ELEMENT_ESCAPE_RE, (ch) => ELEMENT_ESCAPE_MAP[ch]); } var XmlText2 = class { value; constructor(value) { this.value = value; } toString() { return escapeElement("" + this.value); } }; var XmlNode2 = class _XmlNode { name; children; attributes = {}; static of(name, childText, withName) { const node = new _XmlNode(name); if (childText !== void 0) { node.addChildNode(new XmlText2(childText)); } if (withName !== void 0) { node.withName(withName); } return node; } constructor(name, children = []) { this.name = name; this.children = children; } withName(name) { this.name = name; return this; } addAttribute(name, value) { this.attributes[name] = value; return this; } addChildNode(child) { this.children.push(child); return this; } removeAttribute(name) { delete this.attributes[name]; return this; } n(name) { this.name = name; return this; } c(child) { this.children.push(child); return this; } a(name, value) { if (value != null) { this.attributes[name] = value; } return this; } cc(input, field, withName = field) { if (input[field] != null) { const node = _XmlNode.of(field, input[field]).withName(withName); this.c(node); } } l(input, listName, memberName, valueProvider) { if (input[listName] != null) { const nodes5 = valueProvider(); nodes5.map((node) => { node.withName(memberName); this.c(node); }); } } lc(input, listName, memberName, valueProvider) { if (input[listName] != null) { const nodes5 = valueProvider(); const containerNode = new _XmlNode(memberName); nodes5.map((node) => { containerNode.c(node); }); this.c(containerNode); } } toString() { const hasChildren = Boolean(this.children.length); let xmlText = `<${this.name}`; const attributes = this.attributes; for (const attributeName of Object.keys(attributes)) { const attribute = attributes[attributeName]; if (attribute != null) { xmlText += ` ${attributeName}="${escapeAttribute("" + attribute)}"`; } } return xmlText += !hasChildren ? "/>" : `>${this.children.map((c5) => c5.toString()).join("")}`; } }; exports2.parseXML = xmlParser.parseXML; exports2.XmlNode = XmlNode2; exports2.XmlText = XmlText2; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js var import_xml_builder, import_smithy_client4, import_util_utf87, XmlShapeDeserializer; var init_XmlShapeDeserializer = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js"() { import_xml_builder = __toESM(require_dist_cjs38()); init_protocols(); init_schema(); import_smithy_client4 = __toESM(require_dist_cjs34()); import_util_utf87 = __toESM(require_dist_cjs9()); init_ConfigurableSerdeContext(); init_UnionSerde(); XmlShapeDeserializer = class extends SerdeContextConfig { settings; stringDeserializer; constructor(settings) { super(); this.settings = settings; this.stringDeserializer = new FromStringShapeDeserializer(settings); } setSerdeContext(serdeContext) { this.serdeContext = serdeContext; this.stringDeserializer.setSerdeContext(serdeContext); } read(schema, bytes, key) { const ns = NormalizedSchema.of(schema); const memberSchemas = ns.getMemberSchemas(); const isEventPayload = ns.isStructSchema() && ns.isMemberSchema() && !!Object.values(memberSchemas).find((memberNs) => { return !!memberNs.getMemberTraits().eventPayload; }); if (isEventPayload) { const output = {}; const memberName = Object.keys(memberSchemas)[0]; const eventMemberSchema = memberSchemas[memberName]; if (eventMemberSchema.isBlobSchema()) { output[memberName] = bytes; } else { output[memberName] = this.read(memberSchemas[memberName], bytes); } return output; } const xmlString = (this.serdeContext?.utf8Encoder ?? import_util_utf87.toUtf8)(bytes); const parsedObject = this.parseXml(xmlString); return this.readSchema(schema, key ? parsedObject[key] : parsedObject); } readSchema(_schema, value) { const ns = NormalizedSchema.of(_schema); if (ns.isUnitSchema()) { return; } const traits = ns.getMergedTraits(); if (ns.isListSchema() && !Array.isArray(value)) { return this.readSchema(ns, [value]); } if (value == null) { return value; } if (typeof value === "object") { const flat = !!traits.xmlFlattened; if (ns.isListSchema()) { const listValue = ns.getValueSchema(); const buffer2 = []; const sourceKey = listValue.getMergedTraits().xmlName ?? "member"; const source = flat ? value : (value[0] ?? value)[sourceKey]; if (source == null) { return buffer2; } const sourceArray = Array.isArray(source) ? source : [source]; for (const v of sourceArray) { buffer2.push(this.readSchema(listValue, v)); } return buffer2; } const buffer = {}; if (ns.isMapSchema()) { const keyNs = ns.getKeySchema(); const memberNs = ns.getValueSchema(); let entries; if (flat) { entries = Array.isArray(value) ? value : [value]; } else { entries = Array.isArray(value.entry) ? value.entry : [value.entry]; } const keyProperty = keyNs.getMergedTraits().xmlName ?? "key"; const valueProperty = memberNs.getMergedTraits().xmlName ?? "value"; for (const entry of entries) { const key = entry[keyProperty]; const value2 = entry[valueProperty]; buffer[key] = this.readSchema(memberNs, value2); } return buffer; } if (ns.isStructSchema()) { const union = ns.isUnionSchema(); let unionSerde; if (union) { unionSerde = new UnionSerde(value, buffer); } for (const [memberName, memberSchema] of ns.structIterator()) { const memberTraits = memberSchema.getMergedTraits(); const xmlObjectKey = !memberTraits.httpPayload ? memberSchema.getMemberTraits().xmlName ?? memberName : memberTraits.xmlName ?? memberSchema.getName(); if (union) { unionSerde.mark(xmlObjectKey); } if (value[xmlObjectKey] != null) { buffer[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]); } } if (union) { unionSerde.writeUnknown(); } return buffer; } if (ns.isDocumentSchema()) { return value; } throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns.getName(true)}`); } if (ns.isListSchema()) { return []; } if (ns.isMapSchema() || ns.isStructSchema()) { return {}; } return this.stringDeserializer.read(ns, value); } parseXml(xml) { if (xml.length) { let parsedObj; try { parsedObj = (0, import_xml_builder.parseXML)(xml); } catch (e5) { if (e5 && typeof e5 === "object") { Object.defineProperty(e5, "$responseBodyText", { value: xml }); } throw e5; } const textNodeName = "#text"; const key = Object.keys(parsedObj)[0]; const parsedObjToReturn = parsedObj[key]; if (parsedObjToReturn[textNodeName]) { parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; delete parsedObjToReturn[textNodeName]; } return (0, import_smithy_client4.getValueFromTextNode)(parsedObjToReturn); } return {}; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js var import_smithy_client5, import_util_base646, QueryShapeSerializer; var init_QueryShapeSerializer = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js"() { init_protocols(); init_schema(); init_serde(); import_smithy_client5 = __toESM(require_dist_cjs34()); import_util_base646 = __toESM(require_dist_cjs10()); init_ConfigurableSerdeContext(); QueryShapeSerializer = class extends SerdeContextConfig { settings; buffer; constructor(settings) { super(); this.settings = settings; } write(schema, value, prefix = "") { if (this.buffer === void 0) { this.buffer = ""; } const ns = NormalizedSchema.of(schema); if (prefix && !prefix.endsWith(".")) { prefix += "."; } if (ns.isBlobSchema()) { if (typeof value === "string" || value instanceof Uint8Array) { this.writeKey(prefix); this.writeValue((this.serdeContext?.base64Encoder ?? import_util_base646.toBase64)(value)); } } else if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isStringSchema()) { if (value != null) { this.writeKey(prefix); this.writeValue(String(value)); } else if (ns.isIdempotencyToken()) { this.writeKey(prefix); this.writeValue((0, import_uuid.v4)()); } } else if (ns.isBigIntegerSchema()) { if (value != null) { this.writeKey(prefix); this.writeValue(String(value)); } } else if (ns.isBigDecimalSchema()) { if (value != null) { this.writeKey(prefix); this.writeValue(value instanceof NumericValue ? value.string : String(value)); } } else if (ns.isTimestampSchema()) { if (value instanceof Date) { this.writeKey(prefix); const format2 = determineTimestampFormat(ns, this.settings); switch (format2) { case 5: this.writeValue(value.toISOString().replace(".000Z", "Z")); break; case 6: this.writeValue((0, import_smithy_client5.dateToUtcString)(value)); break; case 7: this.writeValue(String(value.getTime() / 1e3)); break; } } } else if (ns.isDocumentSchema()) { if (Array.isArray(value)) { this.write(64 | 15, value, prefix); } else if (value instanceof Date) { this.write(4, value, prefix); } else if (value instanceof Uint8Array) { this.write(21, value, prefix); } else if (value && typeof value === "object") { this.write(128 | 15, value, prefix); } else { this.writeKey(prefix); this.writeValue(String(value)); } } else if (ns.isListSchema()) { if (Array.isArray(value)) { if (value.length === 0) { if (this.settings.serializeEmptyLists) { this.writeKey(prefix); this.writeValue(""); } } else { const member2 = ns.getValueSchema(); const flat = this.settings.flattenLists || ns.getMergedTraits().xmlFlattened; let i5 = 1; for (const item of value) { if (item == null) { continue; } const traits = member2.getMergedTraits(); const suffix = this.getKey("member", traits.xmlName, traits.ec2QueryName); const key = flat ? `${prefix}${i5}` : `${prefix}${suffix}.${i5}`; this.write(member2, item, key); ++i5; } } } } else if (ns.isMapSchema()) { if (value && typeof value === "object") { const keySchema = ns.getKeySchema(); const memberSchema = ns.getValueSchema(); const flat = ns.getMergedTraits().xmlFlattened; let i5 = 1; for (const k5 in value) { const v = value[k5]; if (v == null) { continue; } const keyTraits = keySchema.getMergedTraits(); const keySuffix = this.getKey("key", keyTraits.xmlName, keyTraits.ec2QueryName); const key = flat ? `${prefix}${i5}.${keySuffix}` : `${prefix}entry.${i5}.${keySuffix}`; const valTraits = memberSchema.getMergedTraits(); const valueSuffix = this.getKey("value", valTraits.xmlName, valTraits.ec2QueryName); const valueKey = flat ? `${prefix}${i5}.${valueSuffix}` : `${prefix}entry.${i5}.${valueSuffix}`; this.write(keySchema, k5, key); this.write(memberSchema, v, valueKey); ++i5; } } } else if (ns.isStructSchema()) { if (value && typeof value === "object") { let didWriteMember = false; for (const [memberName, member2] of ns.structIterator()) { if (value[memberName] == null && !member2.isIdempotencyToken()) { continue; } const traits = member2.getMergedTraits(); const suffix = this.getKey(memberName, traits.xmlName, traits.ec2QueryName, "struct"); const key = `${prefix}${suffix}`; this.write(member2, value[memberName], key); didWriteMember = true; } if (!didWriteMember && ns.isUnionSchema()) { const { $unknown } = value; if (Array.isArray($unknown)) { const [k5, v] = $unknown; const key = `${prefix}${k5}`; this.write(15, v, key); } } } } else if (ns.isUnitSchema()) { } else { throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${ns.getName(true)}`); } } flush() { if (this.buffer === void 0) { throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer."); } const str = this.buffer; delete this.buffer; return str; } getKey(memberName, xmlName, ec2QueryName, keySource) { const { ec2, capitalizeKeys } = this.settings; if (ec2 && ec2QueryName) { return ec2QueryName; } const key = xmlName ?? memberName; if (capitalizeKeys && keySource === "struct") { return key[0].toUpperCase() + key.slice(1); } return key; } writeKey(key) { if (key.endsWith(".")) { key = key.slice(0, key.length - 1); } this.buffer += `&${extendedEncodeURIComponent(key)}=`; } writeValue(value) { this.buffer += extendedEncodeURIComponent(value); } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js var AwsQueryProtocol; var init_AwsQueryProtocol = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js"() { init_protocols(); init_schema(); init_ProtocolLib(); init_XmlShapeDeserializer(); init_QueryShapeSerializer(); AwsQueryProtocol = class extends RpcProtocol { options; serializer; deserializer; mixin = new ProtocolLib(); constructor(options) { super({ defaultNamespace: options.defaultNamespace, errorTypeRegistries: options.errorTypeRegistries }); this.options = options; const settings = { timestampFormat: { useTrait: true, default: 5 }, httpBindings: false, xmlNamespace: options.xmlNamespace, serviceNamespace: options.defaultNamespace, serializeEmptyLists: true }; this.serializer = new QueryShapeSerializer(settings); this.deserializer = new XmlShapeDeserializer(settings); } getShapeId() { return "aws.protocols#awsQuery"; } setSerdeContext(serdeContext) { this.serializer.setSerdeContext(serdeContext); this.deserializer.setSerdeContext(serdeContext); } getPayloadCodec() { throw new Error("AWSQuery protocol has no payload codec."); } async serializeRequest(operationSchema, input, context) { const request = await super.serializeRequest(operationSchema, input, context); if (!request.path.endsWith("/")) { request.path += "/"; } request.headers["content-type"] = "application/x-www-form-urlencoded"; if (deref(operationSchema.input) === "unit" || !request.body) { request.body = ""; } const action = operationSchema.name.split("#")[1] ?? operationSchema.name; request.body = `Action=${action}&Version=${this.options.version}` + request.body; if (request.body.endsWith("&")) { request.body = request.body.slice(-1); } return request; } async deserializeResponse(operationSchema, context, response) { const deserializer = this.deserializer; const ns = NormalizedSchema.of(operationSchema.output); const dataObject = {}; if (response.statusCode >= 300) { const bytes2 = await collectBody(response.body, context); if (bytes2.byteLength > 0) { Object.assign(dataObject, await deserializer.read(15, bytes2)); } await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response)); } for (const header in response.headers) { const value = response.headers[header]; delete response.headers[header]; response.headers[header.toLowerCase()] = value; } const shortName = operationSchema.name.split("#")[1] ?? operationSchema.name; const awsQueryResultKey = ns.isStructSchema() && this.useNestedResult() ? shortName + "Result" : void 0; const bytes = await collectBody(response.body, context); if (bytes.byteLength > 0) { Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey)); } dataObject.$metadata = this.deserializeMetadata(response); return dataObject; } useNestedResult() { return true; } async handleError(operationSchema, context, response, dataObject, metadata) { const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown"; this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace); const errorData = this.loadQueryError(dataObject) ?? {}; const message = this.loadQueryErrorMessage(dataObject); errorData.message = message; errorData.Error = { Type: errorData.Type, Code: errorData.Code, Message: message }; const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, this.mixin.findQueryCompatibleError); const ns = NormalizedSchema.of(errorSchema); const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error; const exception = new ErrorCtor(message); const output = { Type: errorData.Error.Type, Code: errorData.Error.Code, Error: errorData.Error }; for (const [name, member2] of ns.structIterator()) { const target = member2.getMergedTraits().xmlName ?? name; const value = errorData[target] ?? dataObject[target]; output[name] = this.deserializer.readSchema(member2, value); } throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { $fault: ns.getMergedTraits().error, message }, output), dataObject); } loadQueryErrorCode(output, data3) { const code = (data3.Errors?.[0]?.Error ?? data3.Errors?.Error ?? data3.Error)?.Code; if (code !== void 0) { return code; } if (output.statusCode == 404) { return "NotFound"; } } loadQueryError(data3) { return data3.Errors?.[0]?.Error ?? data3.Errors?.Error ?? data3.Error; } loadQueryErrorMessage(data3) { const errorData = this.loadQueryError(data3); return errorData?.message ?? errorData?.Message ?? data3.message ?? data3.Message ?? "Unknown"; } getDefaultContentType() { return "application/x-www-form-urlencoded"; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js var AwsEc2QueryProtocol; var init_AwsEc2QueryProtocol = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js"() { init_AwsQueryProtocol(); AwsEc2QueryProtocol = class extends AwsQueryProtocol { options; constructor(options) { super(options); this.options = options; const ec2Settings = { capitalizeKeys: true, flattenLists: true, serializeEmptyLists: false, ec2: true }; Object.assign(this.serializer.settings, ec2Settings); } getShapeId() { return "aws.protocols#ec2Query"; } useNestedResult() { return false; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QuerySerializerSettings.js var init_QuerySerializerSettings = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QuerySerializerSettings.js"() { } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js var import_xml_builder2, import_smithy_client6, parseXmlBody, parseXmlErrorBody, loadRestXmlErrorCode; var init_parseXmlBody = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js"() { import_xml_builder2 = __toESM(require_dist_cjs38()); import_smithy_client6 = __toESM(require_dist_cjs34()); init_common(); parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => { if (encoded.length) { let parsedObj; try { parsedObj = (0, import_xml_builder2.parseXML)(encoded); } catch (e5) { if (e5 && typeof e5 === "object") { Object.defineProperty(e5, "$responseBodyText", { value: encoded }); } throw e5; } const textNodeName = "#text"; const key = Object.keys(parsedObj)[0]; const parsedObjToReturn = parsedObj[key]; if (parsedObjToReturn[textNodeName]) { parsedObjToReturn[key] = parsedObjToReturn[textNodeName]; delete parsedObjToReturn[textNodeName]; } return (0, import_smithy_client6.getValueFromTextNode)(parsedObjToReturn); } return {}; }); parseXmlErrorBody = async (errorBody, context) => { const value = await parseXmlBody(errorBody, context); if (value.Error) { value.Error.message = value.Error.message ?? value.Error.Message; } return value; }; loadRestXmlErrorCode = (output, data3) => { if (data3?.Error?.Code !== void 0) { return data3.Error.Code; } if (data3?.Code !== void 0) { return data3.Code; } if (output.statusCode == 404) { return "NotFound"; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js var import_xml_builder3, import_smithy_client7, import_util_base647, XmlShapeSerializer; var init_XmlShapeSerializer = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js"() { import_xml_builder3 = __toESM(require_dist_cjs38()); init_protocols(); init_schema(); init_serde(); import_smithy_client7 = __toESM(require_dist_cjs34()); import_util_base647 = __toESM(require_dist_cjs10()); init_ConfigurableSerdeContext(); XmlShapeSerializer = class extends SerdeContextConfig { settings; stringBuffer; byteBuffer; buffer; constructor(settings) { super(); this.settings = settings; } write(schema, value) { const ns = NormalizedSchema.of(schema); if (ns.isStringSchema() && typeof value === "string") { this.stringBuffer = value; } else if (ns.isBlobSchema()) { this.byteBuffer = "byteLength" in value ? value : (this.serdeContext?.base64Decoder ?? import_util_base647.fromBase64)(value); } else { this.buffer = this.writeStruct(ns, value, void 0); const traits = ns.getMergedTraits(); if (traits.httpPayload && !traits.xmlName) { this.buffer.withName(ns.getName()); } } } flush() { if (this.byteBuffer !== void 0) { const bytes = this.byteBuffer; delete this.byteBuffer; return bytes; } if (this.stringBuffer !== void 0) { const str = this.stringBuffer; delete this.stringBuffer; return str; } const buffer = this.buffer; if (this.settings.xmlNamespace) { if (!buffer?.attributes?.["xmlns"]) { buffer.addAttribute("xmlns", this.settings.xmlNamespace); } } delete this.buffer; return buffer.toString(); } writeStruct(ns, value, parentXmlns) { const traits = ns.getMergedTraits(); const name = ns.isMemberSchema() && !traits.httpPayload ? ns.getMemberTraits().xmlName ?? ns.getMemberName() : traits.xmlName ?? ns.getName(); if (!name || !ns.isStructSchema()) { throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(true)}.`); } const structXmlNode = import_xml_builder3.XmlNode.of(name); const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); for (const [memberName, memberSchema] of ns.structIterator()) { const val = value[memberName]; if (val != null || memberSchema.isIdempotencyToken()) { if (memberSchema.getMergedTraits().xmlAttribute) { structXmlNode.addAttribute(memberSchema.getMergedTraits().xmlName ?? memberName, this.writeSimple(memberSchema, val)); continue; } if (memberSchema.isListSchema()) { this.writeList(memberSchema, val, structXmlNode, xmlns); } else if (memberSchema.isMapSchema()) { this.writeMap(memberSchema, val, structXmlNode, xmlns); } else if (memberSchema.isStructSchema()) { structXmlNode.addChildNode(this.writeStruct(memberSchema, val, xmlns)); } else { const memberNode = import_xml_builder3.XmlNode.of(memberSchema.getMergedTraits().xmlName ?? memberSchema.getMemberName()); this.writeSimpleInto(memberSchema, val, memberNode, xmlns); structXmlNode.addChildNode(memberNode); } } } const { $unknown } = value; if ($unknown && ns.isUnionSchema() && Array.isArray($unknown) && Object.keys(value).length === 1) { const [k5, v] = $unknown; const node = import_xml_builder3.XmlNode.of(k5); if (typeof v !== "string") { if (value instanceof import_xml_builder3.XmlNode || value instanceof import_xml_builder3.XmlText) { structXmlNode.addChildNode(value); } else { throw new Error(`@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.`); } } this.writeSimpleInto(0, v, node, xmlns); structXmlNode.addChildNode(node); } if (xmlns) { structXmlNode.addAttribute(xmlnsAttr, xmlns); } return structXmlNode; } writeList(listMember, array, container, parentXmlns) { if (!listMember.isMemberSchema()) { throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`); } const listTraits = listMember.getMergedTraits(); const listValueSchema = listMember.getValueSchema(); const listValueTraits = listValueSchema.getMergedTraits(); const sparse = !!listValueTraits.sparse; const flat = !!listTraits.xmlFlattened; const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(listMember, parentXmlns); const writeItem = (container2, value) => { if (listValueSchema.isListSchema()) { this.writeList(listValueSchema, Array.isArray(value) ? value : [value], container2, xmlns); } else if (listValueSchema.isMapSchema()) { this.writeMap(listValueSchema, value, container2, xmlns); } else if (listValueSchema.isStructSchema()) { const struct2 = this.writeStruct(listValueSchema, value, xmlns); container2.addChildNode(struct2.withName(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member")); } else { const listItemNode = import_xml_builder3.XmlNode.of(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member"); this.writeSimpleInto(listValueSchema, value, listItemNode, xmlns); container2.addChildNode(listItemNode); } }; if (flat) { for (const value of array) { if (sparse || value != null) { writeItem(container, value); } } } else { const listNode = import_xml_builder3.XmlNode.of(listTraits.xmlName ?? listMember.getMemberName()); if (xmlns) { listNode.addAttribute(xmlnsAttr, xmlns); } for (const value of array) { if (sparse || value != null) { writeItem(listNode, value); } } container.addChildNode(listNode); } } writeMap(mapMember, map2, container, parentXmlns, containerIsMap = false) { if (!mapMember.isMemberSchema()) { throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(true)}`); } const mapTraits = mapMember.getMergedTraits(); const mapKeySchema = mapMember.getKeySchema(); const mapKeyTraits = mapKeySchema.getMergedTraits(); const keyTag = mapKeyTraits.xmlName ?? "key"; const mapValueSchema = mapMember.getValueSchema(); const mapValueTraits = mapValueSchema.getMergedTraits(); const valueTag = mapValueTraits.xmlName ?? "value"; const sparse = !!mapValueTraits.sparse; const flat = !!mapTraits.xmlFlattened; const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(mapMember, parentXmlns); const addKeyValue = (entry, key, val) => { const keyNode = import_xml_builder3.XmlNode.of(keyTag, key); const [keyXmlnsAttr, keyXmlns] = this.getXmlnsAttribute(mapKeySchema, xmlns); if (keyXmlns) { keyNode.addAttribute(keyXmlnsAttr, keyXmlns); } entry.addChildNode(keyNode); let valueNode = import_xml_builder3.XmlNode.of(valueTag); if (mapValueSchema.isListSchema()) { this.writeList(mapValueSchema, val, valueNode, xmlns); } else if (mapValueSchema.isMapSchema()) { this.writeMap(mapValueSchema, val, valueNode, xmlns, true); } else if (mapValueSchema.isStructSchema()) { valueNode = this.writeStruct(mapValueSchema, val, xmlns); } else { this.writeSimpleInto(mapValueSchema, val, valueNode, xmlns); } entry.addChildNode(valueNode); }; if (flat) { for (const key in map2) { const val = map2[key]; if (sparse || val != null) { const entry = import_xml_builder3.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); addKeyValue(entry, key, val); container.addChildNode(entry); } } } else { let mapNode; if (!containerIsMap) { mapNode = import_xml_builder3.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName()); if (xmlns) { mapNode.addAttribute(xmlnsAttr, xmlns); } container.addChildNode(mapNode); } for (const key in map2) { const val = map2[key]; if (sparse || val != null) { const entry = import_xml_builder3.XmlNode.of("entry"); addKeyValue(entry, key, val); (containerIsMap ? container : mapNode).addChildNode(entry); } } } } writeSimple(_schema, value) { if (null === value) { throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value."); } const ns = NormalizedSchema.of(_schema); let nodeContents = null; if (value && typeof value === "object") { if (ns.isBlobSchema()) { nodeContents = (this.serdeContext?.base64Encoder ?? import_util_base647.toBase64)(value); } else if (ns.isTimestampSchema() && value instanceof Date) { const format2 = determineTimestampFormat(ns, this.settings); switch (format2) { case 5: nodeContents = value.toISOString().replace(".000Z", "Z"); break; case 6: nodeContents = (0, import_smithy_client7.dateToUtcString)(value); break; case 7: nodeContents = String(value.getTime() / 1e3); break; default: console.warn("Missing timestamp format, using http date", value); nodeContents = (0, import_smithy_client7.dateToUtcString)(value); break; } } else if (ns.isBigDecimalSchema() && value) { if (value instanceof NumericValue) { return value.string; } return String(value); } else if (ns.isMapSchema() || ns.isListSchema()) { throw new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead."); } else { throw new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(true)}`); } } if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) { nodeContents = String(value); } if (ns.isStringSchema()) { if (value === void 0 && ns.isIdempotencyToken()) { nodeContents = (0, import_uuid.v4)(); } else { nodeContents = String(value); } } if (nodeContents === null) { throw new Error(`Unhandled schema-value pair ${ns.getName(true)}=${value}`); } return nodeContents; } writeSimpleInto(_schema, value, into, parentXmlns) { const nodeContents = this.writeSimple(_schema, value); const ns = NormalizedSchema.of(_schema); const content = new import_xml_builder3.XmlText(nodeContents); const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns); if (xmlns) { into.addAttribute(xmlnsAttr, xmlns); } into.addChildNode(content); } getXmlnsAttribute(ns, parentXmlns) { const traits = ns.getMergedTraits(); const [prefix, xmlns] = traits.xmlNamespace ?? []; if (xmlns && xmlns !== parentXmlns) { return [prefix ? `xmlns:${prefix}` : "xmlns", xmlns]; } return [void 0, void 0]; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js var XmlCodec; var init_XmlCodec = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js"() { init_ConfigurableSerdeContext(); init_XmlShapeDeserializer(); init_XmlShapeSerializer(); XmlCodec = class extends SerdeContextConfig { settings; constructor(settings) { super(); this.settings = settings; } createSerializer() { const serializer = new XmlShapeSerializer(this.settings); serializer.setSerdeContext(this.serdeContext); return serializer; } createDeserializer() { const deserializer = new XmlShapeDeserializer(this.settings); deserializer.setSerdeContext(this.serdeContext); return deserializer; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js var AwsRestXmlProtocol; var init_AwsRestXmlProtocol = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js"() { init_protocols(); init_schema(); init_ProtocolLib(); init_parseXmlBody(); init_XmlCodec(); AwsRestXmlProtocol = class extends HttpBindingProtocol { codec; serializer; deserializer; mixin = new ProtocolLib(); constructor(options) { super(options); const settings = { timestampFormat: { useTrait: true, default: 5 }, httpBindings: true, xmlNamespace: options.xmlNamespace, serviceNamespace: options.defaultNamespace }; this.codec = new XmlCodec(settings); this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings); this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings); } getPayloadCodec() { return this.codec; } getShapeId() { return "aws.protocols#restXml"; } async serializeRequest(operationSchema, input, context) { const request = await super.serializeRequest(operationSchema, input, context); const inputSchema = NormalizedSchema.of(operationSchema.input); if (!request.headers["content-type"]) { const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema); if (contentType) { request.headers["content-type"] = contentType; } } if (typeof request.body === "string" && request.headers["content-type"] === this.getDefaultContentType() && !request.body.startsWith("' + request.body; } return request; } async deserializeResponse(operationSchema, context, response) { return super.deserializeResponse(operationSchema, context, response); } async handleError(operationSchema, context, response, dataObject, metadata) { const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown"; this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace); if (dataObject.Error && typeof dataObject.Error === "object") { for (const key of Object.keys(dataObject.Error)) { dataObject[key] = dataObject.Error[key]; if (key.toLowerCase() === "message") { dataObject.message = dataObject.Error[key]; } } } if (dataObject.RequestId && !metadata.requestId) { metadata.requestId = dataObject.RequestId; } const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata); const ns = NormalizedSchema.of(errorSchema); const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "UnknownError"; const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error; const exception = new ErrorCtor(message); await this.deserializeHttpMessage(errorSchema, context, response, dataObject); const output = {}; const errorDeserializer = this.codec.createDeserializer(); for (const [name, member2] of ns.structIterator()) { const target = member2.getMergedTraits().xmlName ?? name; const value = dataObject.Error?.[target] ?? dataObject[target]; output[name] = errorDeserializer.readSchema(member2, value); } throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, { $fault: ns.getMergedTraits().error, message }, output), dataObject); } getDefaultContentType() { return "application/xml"; } hasUnstructuredPayloadBinding(ns) { for (const [, member2] of ns.structIterator()) { if (member2.getMergedTraits().httpPayload) { return !(member2.isStructSchema() || member2.isMapSchema() || member2.isListSchema()); } } return false; } }; } }); // node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js var protocols_exports2 = {}; __export(protocols_exports2, { AwsEc2QueryProtocol: () => AwsEc2QueryProtocol, AwsJson1_0Protocol: () => AwsJson1_0Protocol, AwsJson1_1Protocol: () => AwsJson1_1Protocol, AwsJsonRpcProtocol: () => AwsJsonRpcProtocol, AwsQueryProtocol: () => AwsQueryProtocol, AwsRestJsonProtocol: () => AwsRestJsonProtocol, AwsRestXmlProtocol: () => AwsRestXmlProtocol, AwsSmithyRpcV2CborProtocol: () => AwsSmithyRpcV2CborProtocol, JsonCodec: () => JsonCodec, JsonShapeDeserializer: () => JsonShapeDeserializer, JsonShapeSerializer: () => JsonShapeSerializer, QueryShapeSerializer: () => QueryShapeSerializer, XmlCodec: () => XmlCodec, XmlShapeDeserializer: () => XmlShapeDeserializer, XmlShapeSerializer: () => XmlShapeSerializer, _toBool: () => _toBool, _toNum: () => _toNum, _toStr: () => _toStr, awsExpectUnion: () => awsExpectUnion, loadRestJsonErrorCode: () => loadRestJsonErrorCode, loadRestXmlErrorCode: () => loadRestXmlErrorCode, parseJsonBody: () => parseJsonBody, parseJsonErrorBody: () => parseJsonErrorBody, parseXmlBody: () => parseXmlBody, parseXmlErrorBody: () => parseXmlErrorBody }); var init_protocols2 = __esm({ "node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js"() { init_AwsSmithyRpcV2CborProtocol(); init_coercing_serializers(); init_AwsJson1_0Protocol(); init_AwsJson1_1Protocol(); init_AwsJsonRpcProtocol(); init_AwsRestJsonProtocol(); init_JsonCodec(); init_JsonShapeDeserializer(); init_JsonShapeSerializer(); init_awsExpectUnion(); init_parseJsonBody(); init_AwsEc2QueryProtocol(); init_AwsQueryProtocol(); init_QuerySerializerSettings(); init_QueryShapeSerializer(); init_AwsRestXmlProtocol(); init_XmlCodec(); init_XmlShapeDeserializer(); init_XmlShapeSerializer(); init_parseXmlBody(); } }); // node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js var require_dist_cjs39 = __commonJS({ "node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js"(exports2) { "use strict"; var protocolHttp = require_dist_cjs2(); var smithyClient = require_dist_cjs34(); var toStream = require_toStream(); var utilArnParser = require_dist_cjs37(); var protocols2 = (init_protocols2(), __toCommonJS(protocols_exports2)); var schema = (init_schema(), __toCommonJS(schema_exports)); var signatureV4 = require_dist_cjs36(); var utilConfigProvider = require_dist_cjs25(); var client = (init_client(), __toCommonJS(client_exports)); var core = (init_dist_es(), __toCommonJS(dist_es_exports)); var utilMiddleware = require_dist_cjs6(); var CONTENT_LENGTH_HEADER = "content-length"; var DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length"; function checkContentLengthHeader() { return (next, context) => async (args) => { const { request } = args; if (protocolHttp.HttpRequest.isInstance(request)) { if (!(CONTENT_LENGTH_HEADER in request.headers) && !(DECODED_CONTENT_LENGTH_HEADER in request.headers)) { const message = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`; if (typeof context?.logger?.warn === "function" && !(context.logger instanceof smithyClient.NoOpLogger)) { context.logger.warn(message); } else { console.warn(message); } } } return next({ ...args }); }; } var checkContentLengthHeaderMiddlewareOptions = { step: "finalizeRequest", tags: ["CHECK_CONTENT_LENGTH_HEADER"], name: "getCheckContentLengthHeaderPlugin", override: true }; var getCheckContentLengthHeaderPlugin = (unused) => ({ applyToStack: (clientStack) => { clientStack.add(checkContentLengthHeader(), checkContentLengthHeaderMiddlewareOptions); } }); var regionRedirectEndpointMiddleware = (config) => { return (next, context) => async (args) => { const originalRegion = await config.region(); const regionProviderRef = config.region; let unlock = () => { }; if (context.__s3RegionRedirect) { Object.defineProperty(config, "region", { writable: false, value: async () => { return context.__s3RegionRedirect; } }); unlock = () => Object.defineProperty(config, "region", { writable: true, value: regionProviderRef }); } try { const result = await next(args); if (context.__s3RegionRedirect) { unlock(); const region = await config.region(); if (originalRegion !== region) { throw new Error("Region was not restored following S3 region redirect."); } } return result; } catch (e5) { unlock(); throw e5; } }; }; var regionRedirectEndpointMiddlewareOptions = { tags: ["REGION_REDIRECT", "S3"], name: "regionRedirectEndpointMiddleware", override: true, relation: "before", toMiddleware: "endpointV2Middleware" }; function regionRedirectMiddleware(clientConfig) { return (next, context) => async (args) => { try { return await next(args); } catch (err) { if (clientConfig.followRegionRedirects) { const statusCode = err?.$metadata?.httpStatusCode; const isHeadBucket = context.commandName === "HeadBucketCommand"; const bucketRegionHeader = err?.$response?.headers?.["x-amz-bucket-region"]; if (bucketRegionHeader) { if (statusCode === 301 || statusCode === 400 && (err?.name === "IllegalLocationConstraintException" || isHeadBucket)) { try { const actualRegion = bucketRegionHeader; context.logger?.debug(`Redirecting from ${await clientConfig.region()} to ${actualRegion}`); context.__s3RegionRedirect = actualRegion; } catch (e5) { throw new Error("Region redirect failed: " + e5); } return next(args); } } } throw err; } }; } var regionRedirectMiddlewareOptions = { step: "initialize", tags: ["REGION_REDIRECT", "S3"], name: "regionRedirectMiddleware", override: true }; var getRegionRedirectMiddlewarePlugin = (clientConfig) => ({ applyToStack: (clientStack) => { clientStack.add(regionRedirectMiddleware(clientConfig), regionRedirectMiddlewareOptions); clientStack.addRelativeTo(regionRedirectEndpointMiddleware(clientConfig), regionRedirectEndpointMiddlewareOptions); } }); var s3ExpiresMiddleware = (config) => { return (next, context) => async (args) => { const result = await next(args); const { response } = result; if (protocolHttp.HttpResponse.isInstance(response)) { if (response.headers.expires) { response.headers.expiresstring = response.headers.expires; try { smithyClient.parseRfc7231DateTime(response.headers.expires); } catch (e5) { context.logger?.warn(`AWS SDK Warning for ${context.clientName}::${context.commandName} response parsing (${response.headers.expires}): ${e5}`); delete response.headers.expires; } } } return result; }; }; var s3ExpiresMiddlewareOptions = { tags: ["S3"], name: "s3ExpiresMiddleware", override: true, relation: "after", toMiddleware: "deserializerMiddleware" }; var getS3ExpiresMiddlewarePlugin = (clientConfig) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(s3ExpiresMiddleware(), s3ExpiresMiddlewareOptions); } }); var S3ExpressIdentityCache = class _S3ExpressIdentityCache { data; lastPurgeTime = Date.now(); static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS = 3e4; constructor(data3 = {}) { this.data = data3; } get(key) { const entry = this.data[key]; if (!entry) { return; } return entry; } set(key, entry) { this.data[key] = entry; return entry; } delete(key) { delete this.data[key]; } async purgeExpired() { const now = Date.now(); if (this.lastPurgeTime + _S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) { return; } for (const key in this.data) { const entry = this.data[key]; if (!entry.isRefreshing) { const credential = await entry.identity; if (credential.expiration) { if (credential.expiration.getTime() < now) { delete this.data[key]; } } } } } }; var S3ExpressIdentityCacheEntry = class { _identity; isRefreshing; accessed; constructor(_identity, isRefreshing = false, accessed = Date.now()) { this._identity = _identity; this.isRefreshing = isRefreshing; this.accessed = accessed; } get identity() { this.accessed = Date.now(); return this._identity; } }; var S3ExpressIdentityProviderImpl = class _S3ExpressIdentityProviderImpl { createSessionFn; cache; static REFRESH_WINDOW_MS = 6e4; constructor(createSessionFn, cache5 = new S3ExpressIdentityCache()) { this.createSessionFn = createSessionFn; this.cache = cache5; } async getS3ExpressIdentity(awsIdentity, identityProperties) { const key = identityProperties.Bucket; const { cache: cache5 } = this; const entry = cache5.get(key); if (entry) { return entry.identity.then((identity) => { const isExpired = (identity.expiration?.getTime() ?? 0) < Date.now(); if (isExpired) { return cache5.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity; } const isExpiringSoon = (identity.expiration?.getTime() ?? 0) < Date.now() + _S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS; if (isExpiringSoon && !entry.isRefreshing) { entry.isRefreshing = true; this.getIdentity(key).then((id) => { cache5.set(key, new S3ExpressIdentityCacheEntry(Promise.resolve(id))); }); } return identity; }); } return cache5.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity; } async getIdentity(key) { await this.cache.purgeExpired().catch((error3) => { console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error3); }); const session = await this.createSessionFn(key); if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) { throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey."); } const identity = { accessKeyId: session.Credentials.AccessKeyId, secretAccessKey: session.Credentials.SecretAccessKey, sessionToken: session.Credentials.SessionToken, expiration: session.Credentials.Expiration ? new Date(session.Credentials.Expiration) : void 0 }; return identity; } }; var S3_EXPRESS_BUCKET_TYPE = "Directory"; var S3_EXPRESS_BACKEND = "S3Express"; var S3_EXPRESS_AUTH_SCHEME = "sigv4-s3express"; var SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token"; var SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase(); var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH"; var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = "s3_disable_express_session_auth"; var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = { environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, utilConfigProvider.SelectorType.ENV), configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, utilConfigProvider.SelectorType.CONFIG), default: false }; var SignatureV4S3Express = class extends signatureV4.SignatureV4 { async signWithCredentials(requestToSign, credentials, options) { const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials); requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken; const privateAccess = this; setSingleOverride(privateAccess, credentialsWithoutSessionToken); return privateAccess.signRequest(requestToSign, options ?? {}); } async presignWithCredentials(requestToSign, credentials, options) { const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials); delete requestToSign.headers[SESSION_TOKEN_HEADER]; requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken; requestToSign.query = requestToSign.query ?? {}; requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken; const privateAccess = this; setSingleOverride(privateAccess, credentialsWithoutSessionToken); return this.presign(requestToSign, options); } }; function getCredentialsWithoutSessionToken(credentials) { const credentialsWithoutSessionToken = { accessKeyId: credentials.accessKeyId, secretAccessKey: credentials.secretAccessKey, expiration: credentials.expiration }; return credentialsWithoutSessionToken; } function setSingleOverride(privateAccess, credentialsWithoutSessionToken) { const id = setTimeout(() => { throw new Error("SignatureV4S3Express credential override was created but not called."); }, 10); const currentCredentialProvider = privateAccess.credentialProvider; const overrideCredentialsProviderOnce = () => { clearTimeout(id); privateAccess.credentialProvider = currentCredentialProvider; return Promise.resolve(credentialsWithoutSessionToken); }; privateAccess.credentialProvider = overrideCredentialsProviderOnce; } var s3ExpressMiddleware = (options) => { return (next, context) => async (args) => { if (context.endpointV2) { const endpoint = context.endpointV2; const isS3ExpressAuth = endpoint.properties?.authSchemes?.[0]?.name === S3_EXPRESS_AUTH_SCHEME; const isS3ExpressBucket = endpoint.properties?.backend === S3_EXPRESS_BACKEND || endpoint.properties?.bucketType === S3_EXPRESS_BUCKET_TYPE; if (isS3ExpressBucket) { client.setFeature(context, "S3_EXPRESS_BUCKET", "J"); context.isS3ExpressBucket = true; } if (isS3ExpressAuth) { const requestBucket = args.input.Bucket; if (requestBucket) { const s3ExpressIdentity = await options.s3ExpressIdentityProvider.getS3ExpressIdentity(await options.credentials(), { Bucket: requestBucket }); context.s3ExpressIdentity = s3ExpressIdentity; if (protocolHttp.HttpRequest.isInstance(args.request) && s3ExpressIdentity.sessionToken) { args.request.headers[SESSION_TOKEN_HEADER] = s3ExpressIdentity.sessionToken; } } } } return next(args); }; }; var s3ExpressMiddlewareOptions = { name: "s3ExpressMiddleware", step: "build", tags: ["S3", "S3_EXPRESS"], override: true }; var getS3ExpressPlugin = (options) => ({ applyToStack: (clientStack) => { clientStack.add(s3ExpressMiddleware(options), s3ExpressMiddlewareOptions); } }); var signS3Express = async (s3ExpressIdentity, signingOptions, request, sigV4MultiRegionSigner) => { const signedRequest = await sigV4MultiRegionSigner.signWithCredentials(request, s3ExpressIdentity, {}); if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) { throw new Error("X-Amz-Security-Token must not be set for s3-express requests."); } return signedRequest; }; var defaultErrorHandler2 = (signingProperties) => (error3) => { throw error3; }; var defaultSuccessHandler2 = (httpResponse, signingProperties) => { }; var s3ExpressHttpSigningMiddlewareOptions = core.httpSigningMiddlewareOptions; var s3ExpressHttpSigningMiddleware = (config) => (next, context) => async (args) => { if (!protocolHttp.HttpRequest.isInstance(args.request)) { return next(args); } const smithyContext = utilMiddleware.getSmithyContext(context); const scheme = smithyContext.selectedHttpAuthScheme; if (!scheme) { throw new Error(`No HttpAuthScheme was selected: unable to sign request`); } const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme; let request; if (context.s3ExpressIdentity) { request = await signS3Express(context.s3ExpressIdentity, signingProperties, args.request, await config.signer()); } else { request = await signer.sign(args.request, identity, signingProperties); } const output = await next({ ...args, request }).catch((signer.errorHandler || defaultErrorHandler2)(signingProperties)); (signer.successHandler || defaultSuccessHandler2)(output.response, signingProperties); return output; }; var getS3ExpressHttpSigningPlugin = (config) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config), core.httpSigningMiddlewareOptions); } }); var resolveS3Config = (input, { session }) => { const [s3ClientProvider, CreateSessionCommandCtor] = session; const { forcePathStyle, useAccelerateEndpoint, disableMultiregionAccessPoints, followRegionRedirects, s3ExpressIdentityProvider, bucketEndpoint, expectContinueHeader } = input; return Object.assign(input, { forcePathStyle: forcePathStyle ?? false, useAccelerateEndpoint: useAccelerateEndpoint ?? false, disableMultiregionAccessPoints: disableMultiregionAccessPoints ?? false, followRegionRedirects: followRegionRedirects ?? false, s3ExpressIdentityProvider: s3ExpressIdentityProvider ?? new S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({ Bucket: key }))), bucketEndpoint: bucketEndpoint ?? false, expectContinueHeader: expectContinueHeader ?? 2097152 }); }; var THROW_IF_EMPTY_BODY = { CopyObjectCommand: true, UploadPartCopyCommand: true, CompleteMultipartUploadCommand: true }; var throw200ExceptionsMiddleware = (config) => (next, context) => async (args) => { const result = await next(args); const { response } = result; if (!protocolHttp.HttpResponse.isInstance(response)) { return result; } const { statusCode, body } = response; if (statusCode < 200 || statusCode >= 300) { return result; } const bodyBytes = await collectBody3(body, config); response.body = toStream.toStream(bodyBytes); if (bodyBytes.length === 0 && THROW_IF_EMPTY_BODY[context.commandName]) { const err = new Error("S3 aborted request"); err.$metadata = { httpStatusCode: 503 }; err.name = "InternalError"; throw err; } const bodyStringTail = config.utf8Encoder(bodyBytes.subarray(bodyBytes.length - 16)); if (bodyStringTail && bodyStringTail.endsWith("")) { response.statusCode = 503; } return result; }; var collectBody3 = (streamBody = new Uint8Array(), context) => { if (streamBody instanceof Uint8Array) { return Promise.resolve(streamBody); } return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array()); }; var throw200ExceptionsMiddlewareOptions = { relation: "after", toMiddleware: "deserializerMiddleware", tags: ["THROW_200_EXCEPTIONS", "S3"], name: "throw200ExceptionsMiddleware", override: true }; var getThrow200ExceptionsPlugin = (config) => ({ applyToStack: (clientStack) => { clientStack.addRelativeTo(throw200ExceptionsMiddleware(config), throw200ExceptionsMiddlewareOptions); } }); function bucketEndpointMiddleware(options) { return (next, context) => async (args) => { if (options.bucketEndpoint) { const endpoint = context.endpointV2; if (endpoint) { const bucket = args.input.Bucket; if (typeof bucket === "string") { try { const bucketEndpointUrl = new URL(bucket); context.endpointV2 = { ...endpoint, url: bucketEndpointUrl }; } catch (e5) { const warning2 = `@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${bucket} could not be parsed as URL.`; if (context.logger?.constructor?.name === "NoOpLogger") { console.warn(warning2); } else { context.logger?.warn?.(warning2); } throw e5; } } } } return next(args); }; } var bucketEndpointMiddlewareOptions = { name: "bucketEndpointMiddleware", override: true, relation: "after", toMiddleware: "endpointV2Middleware" }; function validateBucketNameMiddleware({ bucketEndpoint }) { return (next) => async (args) => { const { input: { Bucket } } = args; if (!bucketEndpoint && typeof Bucket === "string" && !utilArnParser.validate(Bucket) && Bucket.indexOf("/") >= 0) { const err = new Error(`Bucket name shouldn't contain '/', received '${Bucket}'`); err.name = "InvalidBucketName"; throw err; } return next({ ...args }); }; } var validateBucketNameMiddlewareOptions = { step: "initialize", tags: ["VALIDATE_BUCKET_NAME"], name: "validateBucketNameMiddleware", override: true }; var getValidateBucketNamePlugin = (options) => ({ applyToStack: (clientStack) => { clientStack.add(validateBucketNameMiddleware(options), validateBucketNameMiddlewareOptions); clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions); } }); var S3RestXmlProtocol = class extends protocols2.AwsRestXmlProtocol { async serializeRequest(operationSchema, input, context) { const request = await super.serializeRequest(operationSchema, input, context); const ns = schema.NormalizedSchema.of(operationSchema.input); const staticStructureSchema = ns.getSchema(); let bucketMemberIndex = 0; const requiredMemberCount = staticStructureSchema[6] ?? 0; if (input && typeof input === "object") { for (const [memberName, memberNs] of ns.structIterator()) { if (++bucketMemberIndex > requiredMemberCount) { break; } if (memberName === "Bucket") { if (!input.Bucket && memberNs.getMergedTraits().httpLabel) { throw new Error(`No value provided for input HTTP label: Bucket.`); } break; } } } return request; } }; exports2.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS; exports2.S3ExpressIdentityCache = S3ExpressIdentityCache; exports2.S3ExpressIdentityCacheEntry = S3ExpressIdentityCacheEntry; exports2.S3ExpressIdentityProviderImpl = S3ExpressIdentityProviderImpl; exports2.S3RestXmlProtocol = S3RestXmlProtocol; exports2.SignatureV4S3Express = SignatureV4S3Express; exports2.checkContentLengthHeader = checkContentLengthHeader; exports2.checkContentLengthHeaderMiddlewareOptions = checkContentLengthHeaderMiddlewareOptions; exports2.getCheckContentLengthHeaderPlugin = getCheckContentLengthHeaderPlugin; exports2.getRegionRedirectMiddlewarePlugin = getRegionRedirectMiddlewarePlugin; exports2.getS3ExpiresMiddlewarePlugin = getS3ExpiresMiddlewarePlugin; exports2.getS3ExpressHttpSigningPlugin = getS3ExpressHttpSigningPlugin; exports2.getS3ExpressPlugin = getS3ExpressPlugin; exports2.getThrow200ExceptionsPlugin = getThrow200ExceptionsPlugin; exports2.getValidateBucketNamePlugin = getValidateBucketNamePlugin; exports2.regionRedirectEndpointMiddleware = regionRedirectEndpointMiddleware; exports2.regionRedirectEndpointMiddlewareOptions = regionRedirectEndpointMiddlewareOptions; exports2.regionRedirectMiddleware = regionRedirectMiddleware; exports2.regionRedirectMiddlewareOptions = regionRedirectMiddlewareOptions; exports2.resolveS3Config = resolveS3Config; exports2.s3ExpiresMiddleware = s3ExpiresMiddleware; exports2.s3ExpiresMiddlewareOptions = s3ExpiresMiddlewareOptions; exports2.s3ExpressHttpSigningMiddleware = s3ExpressHttpSigningMiddleware; exports2.s3ExpressHttpSigningMiddlewareOptions = s3ExpressHttpSigningMiddlewareOptions; exports2.s3ExpressMiddleware = s3ExpressMiddleware; exports2.s3ExpressMiddlewareOptions = s3ExpressMiddlewareOptions; exports2.throw200ExceptionsMiddleware = throw200ExceptionsMiddleware; exports2.throw200ExceptionsMiddlewareOptions = throw200ExceptionsMiddlewareOptions; exports2.validateBucketNameMiddleware = validateBucketNameMiddleware; exports2.validateBucketNameMiddlewareOptions = validateBucketNameMiddlewareOptions; } }); // node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js var require_dist_cjs40 = __commonJS({ "node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js"(exports2) { "use strict"; var middlewareSdkS3 = require_dist_cjs39(); var signatureV4 = require_dist_cjs36(); var signatureV4CrtContainer = { CrtSignerV4: null }; var SignatureV4MultiRegion3 = class { sigv4aSigner; sigv4Signer; signerOptions; static sigv4aDependency() { if (typeof signatureV4CrtContainer.CrtSignerV4 === "function") { return "crt"; } else if (typeof signatureV4.signatureV4aContainer.SignatureV4a === "function") { return "js"; } return "none"; } constructor(options) { this.sigv4Signer = new middlewareSdkS3.SignatureV4S3Express(options); this.signerOptions = options; } async sign(requestToSign, options = {}) { if (options.signingRegion === "*") { return this.getSigv4aSigner().sign(requestToSign, options); } return this.sigv4Signer.sign(requestToSign, options); } async signWithCredentials(requestToSign, credentials, options = {}) { if (options.signingRegion === "*") { const signer = this.getSigv4aSigner(); const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; if (CrtSignerV4 && signer instanceof CrtSignerV4) { return signer.signWithCredentials(requestToSign, credentials, options); } else { throw new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`); } } return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options); } async presign(originalRequest, options = {}) { if (options.signingRegion === "*") { const signer = this.getSigv4aSigner(); const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; if (CrtSignerV4 && signer instanceof CrtSignerV4) { return signer.presign(originalRequest, options); } else { throw new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`); } } return this.sigv4Signer.presign(originalRequest, options); } async presignWithCredentials(originalRequest, credentials, options = {}) { if (options.signingRegion === "*") { throw new Error("Method presignWithCredentials is not supported for [signingRegion=*]."); } return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options); } getSigv4aSigner() { if (!this.sigv4aSigner) { const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; const JsSigV4aSigner = signatureV4.signatureV4aContainer.SignatureV4a; if (this.signerOptions.runtime === "node") { if (!CrtSignerV4 && !JsSigV4aSigner) { throw new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"); } if (CrtSignerV4 && typeof CrtSignerV4 === "function") { this.sigv4aSigner = new CrtSignerV4({ ...this.signerOptions, signingAlgorithm: 1 }); } else if (JsSigV4aSigner && typeof JsSigV4aSigner === "function") { this.sigv4aSigner = new JsSigV4aSigner({ ...this.signerOptions }); } else { throw new Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt"); } } else { if (!JsSigV4aSigner || typeof JsSigV4aSigner !== "function") { throw new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a"); } this.sigv4aSigner = new JsSigV4aSigner({ ...this.signerOptions }); } } return this.sigv4aSigner; } }; exports2.SignatureV4MultiRegion = SignatureV4MultiRegion3; exports2.signatureV4CrtContainer = signatureV4CrtContainer; } }); // node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/bdd.js var require_bdd = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/bdd.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.bdd = void 0; var util_endpoints_1 = require_dist_cjs20(); var q2 = "ref"; var a5 = -1; var b6 = true; var c5 = "isSet"; var d5 = "PartitionResult"; var e5 = "booleanEquals"; var f5 = "stringEquals"; var g5 = "getAttr"; var h5 = "us-east-1"; var i5 = "sigv4"; var j5 = "sts"; var k5 = "https://sts.{Region}.{PartitionResult#dnsSuffix}"; var l3 = { [q2]: "Endpoint" }; var m3 = { [q2]: "Region" }; var n3 = { [q2]: d5 }; var o2 = {}; var p2 = [m3]; var _data5 = { conditions: [ [c5, [l3]], [c5, p2], ["aws.partition", p2, d5], [e5, [{ [q2]: "UseFIPS" }, b6]], [e5, [{ [q2]: "UseDualStack" }, b6]], [f5, [m3, "aws-global"]], [e5, [{ [q2]: "UseGlobalEndpoint" }, b6]], [f5, [m3, "eu-central-1"]], [e5, [{ fn: g5, argv: [n3, "supportsDualStack"] }, b6]], [e5, [{ fn: g5, argv: [n3, "supportsFIPS"] }, b6]], [f5, [m3, "ap-south-1"]], [f5, [m3, "eu-north-1"]], [f5, [m3, "eu-west-1"]], [f5, [m3, "eu-west-2"]], [f5, [m3, "eu-west-3"]], [f5, [m3, "sa-east-1"]], [f5, [m3, h5]], [f5, [m3, "us-east-2"]], [f5, [m3, "us-west-2"]], [f5, [m3, "us-west-1"]], [f5, [m3, "ca-central-1"]], [f5, [m3, "ap-southeast-1"]], [f5, [m3, "ap-northeast-1"]], [f5, [m3, "ap-southeast-2"]], [f5, [{ fn: g5, argv: [n3, "name"] }, "aws-us-gov"]] ], results: [ [a5], ["https://sts.amazonaws.com", { authSchemes: [{ name: i5, signingName: j5, signingRegion: h5 }] }], [k5, { authSchemes: [{ name: i5, signingName: j5, signingRegion: "{Region}" }] }], [a5, "Invalid Configuration: FIPS and custom endpoint are not supported"], [a5, "Invalid Configuration: Dualstack and custom endpoint are not supported"], [l3, o2], ["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", o2], [a5, "FIPS and DualStack are enabled, but this partition does not support one or both"], ["https://sts.{Region}.amazonaws.com", o2], ["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", o2], [a5, "FIPS is enabled but this partition does not support FIPS"], ["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", o2], [a5, "DualStack is enabled but this partition does not support DualStack"], [k5, o2], [a5, "Invalid Configuration: Missing Region"] ] }; var root5 = 2; var r5 = 1e8; var nodes5 = new Int32Array([ -1, 1, -1, 0, 30, 3, 1, 4, r5 + 14, 2, 5, r5 + 14, 3, 25, 6, 4, 24, 7, 5, r5 + 1, 8, 6, 9, r5 + 13, 7, r5 + 1, 10, 10, r5 + 1, 11, 11, r5 + 1, 12, 12, r5 + 1, 13, 13, r5 + 1, 14, 14, r5 + 1, 15, 15, r5 + 1, 16, 16, r5 + 1, 17, 17, r5 + 1, 18, 18, r5 + 1, 19, 19, r5 + 1, 20, 20, r5 + 1, 21, 21, r5 + 1, 22, 22, r5 + 1, 23, 23, r5 + 1, r5 + 2, 8, r5 + 11, r5 + 12, 4, 28, 26, 9, 27, r5 + 10, 24, r5 + 8, r5 + 9, 8, 29, r5 + 7, 9, r5 + 6, r5 + 7, 3, r5 + 3, 31, 4, r5 + 4, r5 + 5 ]); exports2.bdd = util_endpoints_1.BinaryDecisionDiagram.from(nodes5, root5, _data5.conditions, _data5.results); } }); // node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js var require_endpointResolver = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.defaultEndpointResolver = void 0; var util_endpoints_1 = require_dist_cjs21(); var util_endpoints_2 = require_dist_cjs20(); var bdd_1 = require_bdd(); var cache5 = new util_endpoints_2.EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"] }); var defaultEndpointResolver5 = (endpointParams, context = {}) => { return cache5.get(endpointParams, () => (0, util_endpoints_2.decideEndpoint)(bdd_1.bdd, { endpointParams, logger: context.logger })); }; exports2.defaultEndpointResolver = defaultEndpointResolver5; util_endpoints_2.customEndpointFunctions.aws = util_endpoints_1.awsEndpointFunctions; } }); // node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js var require_httpAuthSchemeProvider = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.resolveHttpAuthSchemeConfig = exports2.resolveStsAuthConfig = exports2.defaultSTSHttpAuthSchemeProvider = exports2.defaultSTSHttpAuthSchemeParametersProvider = void 0; var httpAuthSchemes_1 = (init_httpAuthSchemes2(), __toCommonJS(httpAuthSchemes_exports)); var signature_v4_multi_region_1 = require_dist_cjs40(); var middleware_endpoint_1 = require_dist_cjs32(); var util_middleware_1 = require_dist_cjs6(); var endpointResolver_1 = require_endpointResolver(); var STSClient_1 = require_STSClient(); var createEndpointRuleSetHttpAuthSchemeParametersProvider2 = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => { if (!input) { throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`"); } const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input); const instructionsFn = (0, util_middleware_1.getSmithyContext)(context)?.commandInstance?.constructor?.getEndpointParameterInstructions; if (!instructionsFn) { throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`); } const endpointParameters = await (0, middleware_endpoint_1.resolveParams)(input, { getEndpointParameterInstructions: instructionsFn }, config); return Object.assign(defaultParameters, endpointParameters); }; var _defaultSTSHttpAuthSchemeParametersProvider2 = async (config, context, input) => { return { operation: (0, util_middleware_1.getSmithyContext)(context).operation, region: await (0, util_middleware_1.normalizeProvider)(config.region)() || (() => { throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); })() }; }; exports2.defaultSTSHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider2(_defaultSTSHttpAuthSchemeParametersProvider2); function createAwsAuthSigv4HttpAuthOption5(authParameters) { return { schemeId: "aws.auth#sigv4", signingProperties: { name: "sts", region: authParameters.region }, propertiesExtractor: (config, context) => ({ signingProperties: { config, context } }) }; } function createAwsAuthSigv4aHttpAuthOption2(authParameters) { return { schemeId: "aws.auth#sigv4a", signingProperties: { name: "sts", region: authParameters.region }, propertiesExtractor: (config, context) => ({ signingProperties: { config, context } }) }; } function createSmithyApiNoAuthHttpAuthOption5(authParameters) { return { schemeId: "smithy.api#noAuth" }; } var createEndpointRuleSetHttpAuthSchemeProvider2 = (defaultEndpointResolver5, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => { const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => { const endpoint = defaultEndpointResolver5(authParameters); const authSchemes = endpoint.properties?.authSchemes; if (!authSchemes) { return defaultHttpAuthSchemeResolver(authParameters); } const options = []; for (const scheme of authSchemes) { const { name: resolvedName, properties = {}, ...rest } = scheme; const name = resolvedName.toLowerCase(); if (resolvedName !== name) { console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`); } let schemeId; if (name === "sigv4a") { schemeId = "aws.auth#sigv4a"; const sigv4Present = authSchemes.find((s) => { const name2 = s.name.toLowerCase(); return name2 !== "sigv4a" && name2.startsWith("sigv4"); }); if (signature_v4_multi_region_1.SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) { continue; } } else if (name.startsWith("sigv4")) { schemeId = "aws.auth#sigv4"; } else { throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`); } const createOption = createHttpAuthOptionFunctions[schemeId]; if (!createOption) { throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`); } const option = createOption(authParameters); option.schemeId = schemeId; option.signingProperties = { ...option.signingProperties || {}, ...rest, ...properties }; options.push(option); } return options; }; return endpointRuleSetHttpAuthSchemeProvider; }; var _defaultSTSHttpAuthSchemeProvider2 = (authParameters) => { const options = []; switch (authParameters.operation) { case "AssumeRoleWithSAML": { options.push(createSmithyApiNoAuthHttpAuthOption5(authParameters)); options.push(createAwsAuthSigv4aHttpAuthOption2(authParameters)); break; } case "AssumeRoleWithWebIdentity": { options.push(createSmithyApiNoAuthHttpAuthOption5(authParameters)); options.push(createAwsAuthSigv4aHttpAuthOption2(authParameters)); break; } default: { options.push(createAwsAuthSigv4HttpAuthOption5(authParameters)); options.push(createAwsAuthSigv4aHttpAuthOption2(authParameters)); } } return options; }; exports2.defaultSTSHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider2(endpointResolver_1.defaultEndpointResolver, _defaultSTSHttpAuthSchemeProvider2, { "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption5, "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption2, "smithy.api#noAuth": createSmithyApiNoAuthHttpAuthOption5 }); var resolveStsAuthConfig2 = (input) => Object.assign(input, { stsClientCtor: STSClient_1.STSClient }); exports2.resolveStsAuthConfig = resolveStsAuthConfig2; var resolveHttpAuthSchemeConfig5 = (config) => { const config_0 = (0, exports2.resolveStsAuthConfig)(config); const config_1 = (0, httpAuthSchemes_1.resolveAwsSdkSigV4Config)(config_0); const config_2 = (0, httpAuthSchemes_1.resolveAwsSdkSigV4AConfig)(config_1); return Object.assign(config_2, { authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []) }); }; exports2.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig5; } }); // node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js var require_EndpointParameters = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.commonParams = exports2.resolveClientEndpointParameters = void 0; var resolveClientEndpointParameters5 = (options) => { return Object.assign(options, { useDualstackEndpoint: options.useDualstackEndpoint ?? false, useFipsEndpoint: options.useFipsEndpoint ?? false, useGlobalEndpoint: options.useGlobalEndpoint ?? false, defaultSigningName: "sts" }); }; exports2.resolveClientEndpointParameters = resolveClientEndpointParameters5; exports2.commonParams = { 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/@aws-sdk/client-sts/package.json var require_package = __commonJS({ "node_modules/@aws-sdk/client-sts/package.json"(exports2, module2) { module2.exports = { name: "@aws-sdk/client-sts", description: "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native", version: "3.1044.0", scripts: { build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs", "build:cjs": "node ../../scripts/compilation/inline client-sts", "build:es": "tsc -p tsconfig.es.json", "build:include:deps": 'yarn g:turbo run build -F="$npm_package_name"', "build:types": "premove ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", clean: "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo", "extract:docs": "api-extractor run --local", "generate:client": "node ../../scripts/generate-clients/single-service --solo sts", test: "yarn g:vitest run", "test:e2e": "yarn g:vitest run -c vitest.config.e2e.mts --mode development", "test:e2e:watch": "yarn g:vitest watch -c vitest.config.e2e.mts", "test:index": "tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs", "test:integration": "yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts", "test:integration:watch": "yarn g:vitest run --passWithNoTests -c vitest.config.integ.mts", "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/core": "^3.974.8", "@aws-sdk/credential-provider-node": "^3.972.39", "@aws-sdk/middleware-host-header": "^3.972.10", "@aws-sdk/middleware-logger": "^3.972.10", "@aws-sdk/middleware-recursion-detection": "^3.972.11", "@aws-sdk/middleware-user-agent": "^3.972.38", "@aws-sdk/region-config-resolver": "^3.972.13", "@aws-sdk/signature-v4-multi-region": "^3.996.25", "@aws-sdk/types": "^3.973.8", "@aws-sdk/util-endpoints": "^3.996.8", "@aws-sdk/util-user-agent-browser": "^3.972.10", "@aws-sdk/util-user-agent-node": "^3.973.24", "@smithy/config-resolver": "^4.4.17", "@smithy/core": "^3.23.17", "@smithy/fetch-http-handler": "^5.3.17", "@smithy/hash-node": "^4.2.14", "@smithy/invalid-dependency": "^4.2.14", "@smithy/middleware-content-length": "^4.2.14", "@smithy/middleware-endpoint": "^4.4.32", "@smithy/middleware-retry": "^4.5.7", "@smithy/middleware-serde": "^4.2.20", "@smithy/middleware-stack": "^4.2.14", "@smithy/node-config-provider": "^4.3.14", "@smithy/node-http-handler": "^4.6.1", "@smithy/protocol-http": "^5.3.14", "@smithy/smithy-client": "^4.12.13", "@smithy/types": "^4.14.1", "@smithy/url-parser": "^4.2.14", "@smithy/util-base64": "^4.3.2", "@smithy/util-body-length-browser": "^4.2.2", "@smithy/util-body-length-node": "^4.2.3", "@smithy/util-defaults-mode-browser": "^4.3.49", "@smithy/util-defaults-mode-node": "^4.2.54", "@smithy/util-endpoints": "^3.4.2", "@smithy/util-middleware": "^4.2.14", "@smithy/util-retry": "^4.3.6", "@smithy/util-utf8": "^4.2.2", tslib: "^2.6.2" }, devDependencies: { "@smithy/snapshot-testing": "^2.0.8", "@tsconfig/node20": "20.1.8", "@types/node": "^20.14.8", concurrently: "7.0.0", "downlevel-dts": "0.10.1", premove: "4.0.0", typescript: "~5.8.3", vitest: "^4.0.17" }, engines: { node: ">=20.0.0" }, typesVersions: { "<4.5": { "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/@aws-sdk/credential-provider-env/dist-cjs/index.js var require_dist_cjs41 = __commonJS({ "node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js"(exports2) { "use strict"; var client = (init_client(), __toCommonJS(client_exports)); var propertyProvider = require_dist_cjs28(); var ENV_KEY = "AWS_ACCESS_KEY_ID"; var ENV_SECRET = "AWS_SECRET_ACCESS_KEY"; var ENV_SESSION = "AWS_SESSION_TOKEN"; var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION"; var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE"; var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID"; var fromEnv = (init) => async () => { init?.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 } }; client.setCredentialFeature(credentials, "CREDENTIALS_ENV_VARS", "g"); return credentials; } throw new propertyProvider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger }); }; exports2.ENV_ACCOUNT_ID = ENV_ACCOUNT_ID; exports2.ENV_CREDENTIAL_SCOPE = ENV_CREDENTIAL_SCOPE; exports2.ENV_EXPIRATION = ENV_EXPIRATION; exports2.ENV_KEY = ENV_KEY; exports2.ENV_SECRET = ENV_SECRET; exports2.ENV_SESSION = ENV_SESSION; exports2.fromEnv = fromEnv; } }); // node_modules/@smithy/credential-provider-imds/dist-cjs/index.js var require_dist_cjs42 = __commonJS({ "node_modules/@smithy/credential-provider-imds/dist-cjs/index.js"(exports2) { "use strict"; var propertyProvider = require_dist_cjs28(); var url = require("url"); var buffer = require("buffer"); var http6 = require("http"); var nodeConfigProvider = require_dist_cjs30(); var urlParser = require_dist_cjs18(); function httpRequest(options) { return new Promise((resolve, reject) => { const req = http6.request({ method: "GET", ...options, hostname: options.hostname?.replace(/^\[(.+)\]$/, "$1") }); req.on("error", (err) => { reject(Object.assign(new propertyProvider.ProviderError("Unable to connect to instance metadata service"), err)); req.destroy(); }); req.on("timeout", () => { reject(new propertyProvider.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 propertyProvider.ProviderError("Error response received from instance metadata service"), { statusCode })); req.destroy(); } const chunks = []; res.on("data", (chunk) => { chunks.push(chunk); }); res.on("end", () => { resolve(buffer.Buffer.concat(chunks)); req.destroy(); }); }); req.end(); }); } var isImdsCredentials = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.AccessKeyId === "string" && typeof arg.SecretAccessKey === "string" && typeof arg.Token === "string" && typeof arg.Expiration === "string"; var fromImdsCredentials = (creds) => ({ accessKeyId: creds.AccessKeyId, secretAccessKey: creds.SecretAccessKey, sessionToken: creds.Token, expiration: new Date(creds.Expiration), ...creds.AccountId && { accountId: creds.AccountId } }); var DEFAULT_TIMEOUT = 1e3; var DEFAULT_MAX_RETRIES = 0; var providerConfigFromInit = ({ maxRetries = DEFAULT_MAX_RETRIES, timeout = DEFAULT_TIMEOUT }) => ({ maxRetries, timeout }); var retry = (toRetry, maxRetries) => { let promise = toRetry(); for (let i5 = 0; i5 < maxRetries; i5++) { promise = promise.catch(toRetry); } return promise; }; var ENV_CMDS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; var ENV_CMDS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; var ENV_CMDS_AUTH_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; var fromContainerMetadata = (init = {}) => { const { timeout, maxRetries } = providerConfigFromInit(init); return () => retry(async () => { const requestOptions = await getCmdsUri({ logger: init.logger }); const credsResponse = JSON.parse(await requestFromEcsImds(timeout, requestOptions)); if (!isImdsCredentials(credsResponse)) { throw new propertyProvider.CredentialsProviderError("Invalid response received from instance metadata service.", { logger: init.logger }); } return fromImdsCredentials(credsResponse); }, maxRetries); }; var requestFromEcsImds = async (timeout, options) => { if (process.env[ENV_CMDS_AUTH_TOKEN]) { options.headers = { ...options.headers, Authorization: process.env[ENV_CMDS_AUTH_TOKEN] }; } const buffer2 = await httpRequest({ ...options, timeout }); return buffer2.toString(); }; var CMDS_IP = "169.254.170.2"; var GREENGRASS_HOSTS = { localhost: true, "127.0.0.1": true }; var GREENGRASS_PROTOCOLS = { "http:": true, "https:": true }; var getCmdsUri = async ({ logger: logger2 }) => { 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 = url.parse(process.env[ENV_CMDS_FULL_URI]); if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) { throw new propertyProvider.CredentialsProviderError(`${parsed.hostname} is not a valid container metadata service hostname`, { tryNextLink: false, logger: logger2 }); } if (!parsed.protocol || !(parsed.protocol in GREENGRASS_PROTOCOLS)) { throw new propertyProvider.CredentialsProviderError(`${parsed.protocol} is not a valid container metadata service protocol`, { tryNextLink: false, logger: logger2 }); } return { ...parsed, port: parsed.port ? parseInt(parsed.port, 10) : void 0 }; } throw new propertyProvider.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: logger2 }); }; var InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends propertyProvider.CredentialsProviderError { tryNextLink; name = "InstanceMetadataV1FallbackError"; constructor(message, tryNextLink = true) { super(message, tryNextLink); this.tryNextLink = tryNextLink; Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError.prototype); } }; exports2.Endpoint = void 0; (function(Endpoint) { Endpoint["IPv4"] = "http://169.254.169.254"; Endpoint["IPv6"] = "http://[fd00:ec2::254]"; })(exports2.Endpoint || (exports2.Endpoint = {})); var ENV_ENDPOINT_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT"; var CONFIG_ENDPOINT_NAME = "ec2_metadata_service_endpoint"; var ENDPOINT_CONFIG_OPTIONS = { environmentVariableSelector: (env) => env[ENV_ENDPOINT_NAME], configFileSelector: (profile) => profile[CONFIG_ENDPOINT_NAME], default: void 0 }; var EndpointMode; (function(EndpointMode2) { EndpointMode2["IPv4"] = "IPv4"; EndpointMode2["IPv6"] = "IPv6"; })(EndpointMode || (EndpointMode = {})); var ENV_ENDPOINT_MODE_NAME = "AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE"; var CONFIG_ENDPOINT_MODE_NAME = "ec2_metadata_service_endpoint_mode"; var ENDPOINT_MODE_CONFIG_OPTIONS = { environmentVariableSelector: (env) => env[ENV_ENDPOINT_MODE_NAME], configFileSelector: (profile) => profile[CONFIG_ENDPOINT_MODE_NAME], default: EndpointMode.IPv4 }; var getInstanceMetadataEndpoint = async () => urlParser.parseUrl(await getFromEndpointConfig() || await getFromEndpointModeConfig()); var getFromEndpointConfig = async () => nodeConfigProvider.loadConfig(ENDPOINT_CONFIG_OPTIONS)(); var getFromEndpointModeConfig = async () => { const endpointMode = await nodeConfigProvider.loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS)(); switch (endpointMode) { case EndpointMode.IPv4: return exports2.Endpoint.IPv4; case EndpointMode.IPv6: return exports2.Endpoint.IPv6; default: throw new Error(`Unsupported endpoint mode: ${endpointMode}. Select from ${Object.values(EndpointMode)}`); } }; var STATIC_STABILITY_REFRESH_INTERVAL_SECONDS = 5 * 60; var STATIC_STABILITY_REFRESH_INTERVAL_JITTER_WINDOW_SECONDS = 5 * 60; var STATIC_STABILITY_DOC_URL = "https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html"; var getExtendedInstanceMetadataCredentials = (credentials, logger2) => { 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); logger2.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 }; }; var staticStabilityProvider = (provider, options = {}) => { const logger2 = options?.logger || console; let pastCredentials; return async () => { let credentials; try { credentials = await provider(); if (credentials.expiration && credentials.expiration.getTime() < Date.now()) { credentials = getExtendedInstanceMetadataCredentials(credentials, logger2); } } catch (e5) { if (pastCredentials) { logger2.warn("Credential renew failed: ", e5); credentials = getExtendedInstanceMetadataCredentials(pastCredentials, logger2); } else { throw e5; } } pastCredentials = credentials; return credentials; }; }; var IMDS_PATH = "/latest/meta-data/iam/security-credentials/"; var IMDS_TOKEN_PATH = "/latest/api/token"; var AWS_EC2_METADATA_V1_DISABLED = "AWS_EC2_METADATA_V1_DISABLED"; var PROFILE_AWS_EC2_METADATA_V1_DISABLED = "ec2_metadata_v1_disabled"; var X_AWS_EC2_METADATA_TOKEN = "x-aws-ec2-metadata-token"; var fromInstanceMetadata = (init = {}) => staticStabilityProvider(getInstanceMetadataProvider(init), { logger: init.logger }); var getInstanceMetadataProvider = (init = {}) => { let disableFetchToken = false; const { logger: logger2, profile } = init; const { timeout, maxRetries } = providerConfigFromInit(init); const getCredentials = async (maxRetries2, options) => { const isImdsV1Fallback = disableFetchToken || options.headers?.[X_AWS_EC2_METADATA_TOKEN] == null; if (isImdsV1Fallback) { let fallbackBlockedFromProfile = false; let fallbackBlockedFromProcessEnv = false; const configValue = await nodeConfigProvider.loadConfig({ environmentVariableSelector: (env) => { const envValue = env[AWS_EC2_METADATA_V1_DISABLED]; fallbackBlockedFromProcessEnv = !!envValue && envValue !== "false"; if (envValue === void 0) { throw new propertyProvider.CredentialsProviderError(`${AWS_EC2_METADATA_V1_DISABLED} not set in env, checking config file next.`, { logger: init.logger }); } return fallbackBlockedFromProcessEnv; }, configFileSelector: (profile2) => { const profileValue = profile2[PROFILE_AWS_EC2_METADATA_V1_DISABLED]; fallbackBlockedFromProfile = !!profileValue && profileValue !== "false"; return fallbackBlockedFromProfile; }, default: false }, { profile })(); if (init.ec2MetadataV1Disabled || configValue) { const causes = []; if (init.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(options); } catch (err) { if (err.statusCode === 401) { disableFetchToken = false; } throw err; } return profile2; }, maxRetries2)).trim(); return retry(async () => { let creds; try { creds = await getCredentialsFromProfile(imdsProfile, options, init); } catch (err) { if (err.statusCode === 401) { disableFetchToken = false; } throw err; } return creds; }, maxRetries2); }; return async () => { const endpoint = await getInstanceMetadataEndpoint(); if (disableFetchToken) { logger2?.debug("AWS SDK Instance Metadata", "using v1 fallback (no token fetch)"); return getCredentials(maxRetries, { ...endpoint, timeout }); } else { let token; try { token = (await getMetadataToken({ ...endpoint, timeout })).toString(); } catch (error3) { if (error3?.statusCode === 400) { throw Object.assign(error3, { message: "EC2 Metadata token request returned error" }); } else if (error3.message === "TimeoutError" || [403, 404, 405].includes(error3.statusCode)) { disableFetchToken = true; } logger2?.debug("AWS SDK Instance Metadata", "using v1 fallback (initial)"); return getCredentials(maxRetries, { ...endpoint, timeout }); } return getCredentials(maxRetries, { ...endpoint, headers: { [X_AWS_EC2_METADATA_TOKEN]: token }, timeout }); } }; }; var getMetadataToken = async (options) => httpRequest({ ...options, path: IMDS_TOKEN_PATH, method: "PUT", headers: { "x-aws-ec2-metadata-token-ttl-seconds": "21600" } }); var getProfile = async (options) => (await httpRequest({ ...options, path: IMDS_PATH })).toString(); var getCredentialsFromProfile = async (profile, options, init) => { const credentialsResponse = JSON.parse((await httpRequest({ ...options, path: IMDS_PATH + profile })).toString()); if (!isImdsCredentials(credentialsResponse)) { throw new propertyProvider.CredentialsProviderError("Invalid response received from instance metadata service.", { logger: init.logger }); } return fromImdsCredentials(credentialsResponse); }; exports2.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES; exports2.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT; exports2.ENV_CMDS_AUTH_TOKEN = ENV_CMDS_AUTH_TOKEN; exports2.ENV_CMDS_FULL_URI = ENV_CMDS_FULL_URI; exports2.ENV_CMDS_RELATIVE_URI = ENV_CMDS_RELATIVE_URI; exports2.fromContainerMetadata = fromContainerMetadata; exports2.fromInstanceMetadata = fromInstanceMetadata; exports2.getInstanceMetadataEndpoint = getInstanceMetadataEndpoint; exports2.httpRequest = httpRequest; exports2.providerConfigFromInit = providerConfigFromInit; } }); // node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js var require_checkUrl = __commonJS({ "node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/checkUrl.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.checkUrl = void 0; var property_provider_1 = require_dist_cjs28(); var ECS_CONTAINER_HOST = "169.254.170.2"; var EKS_CONTAINER_HOST_IPv4 = "169.254.170.23"; var EKS_CONTAINER_HOST_IPv6 = "[fd00:ec2::23]"; var checkUrl = (url, logger2) => { if (url.protocol === "https:") { return; } if (url.hostname === ECS_CONTAINER_HOST || url.hostname === EKS_CONTAINER_HOST_IPv4 || url.hostname === EKS_CONTAINER_HOST_IPv6) { return; } if (url.hostname.includes("[")) { if (url.hostname === "[::1]" || url.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]") { return; } } else { if (url.hostname === "localhost") { return; } const ipComponents = url.hostname.split("."); const inRange = (component) => { const num = parseInt(component, 10); return 0 <= num && num <= 255; }; if (ipComponents[0] === "127" && inRange(ipComponents[1]) && inRange(ipComponents[2]) && inRange(ipComponents[3]) && ipComponents.length === 4) { return; } } throw new property_provider_1.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: logger2 }); }; exports2.checkUrl = checkUrl; } }); // node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js var require_requestHelpers = __commonJS({ "node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/requestHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createGetRequest = createGetRequest; exports2.getCredentials = getCredentials; var property_provider_1 = require_dist_cjs28(); var protocol_http_1 = require_dist_cjs2(); var smithy_client_1 = require_dist_cjs34(); var util_stream_1 = require_dist_cjs16(); function createGetRequest(url) { return new protocol_http_1.HttpRequest({ protocol: url.protocol, hostname: url.hostname, port: Number(url.port), path: url.pathname, query: Array.from(url.searchParams.entries()).reduce((acc, [k5, v]) => { acc[k5] = v; return acc; }, {}), fragment: url.hash }); } async function getCredentials(response, logger2) { const stream = (0, util_stream_1.sdkStreamMixin)(response.body); const str = await stream.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 property_provider_1.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger: logger2 }); } return { accessKeyId: parsed.AccessKeyId, secretAccessKey: parsed.SecretAccessKey, sessionToken: parsed.Token, expiration: (0, smithy_client_1.parseRfc3339DateTime)(parsed.Expiration) }; } if (response.statusCode >= 400 && response.statusCode < 500) { let parsedBody = {}; try { parsedBody = JSON.parse(str); } catch (e5) { } throw Object.assign(new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger: logger2 }), { Code: parsedBody.Code, Message: parsedBody.Message }); } throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger: logger2 }); } } }); // node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js var require_retry_wrapper = __commonJS({ "node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/retry-wrapper.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.retryWrapper = void 0; var retryWrapper = (toRetry, maxRetries, delayMs) => { return async () => { for (let i5 = 0; i5 < maxRetries; ++i5) { try { return await toRetry(); } catch (e5) { await new Promise((resolve) => setTimeout(resolve, delayMs)); } } return await toRetry(); }; }; exports2.retryWrapper = retryWrapper; } }); // node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js var require_fromHttp = __commonJS({ "node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.fromHttp = void 0; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var client_1 = (init_client(), __toCommonJS(client_exports)); var node_http_handler_1 = require_dist_cjs13(); var property_provider_1 = require_dist_cjs28(); var promises_1 = tslib_1.__importDefault(require("node:fs/promises")); var checkUrl_1 = require_checkUrl(); var requestHelpers_1 = require_requestHelpers(); var retry_wrapper_1 = require_retry_wrapper(); var AWS_CONTAINER_CREDENTIALS_RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"; var DEFAULT_LINK_LOCAL_HOST = "http://169.254.170.2"; var AWS_CONTAINER_CREDENTIALS_FULL_URI = "AWS_CONTAINER_CREDENTIALS_FULL_URI"; var AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE = "AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE"; var AWS_CONTAINER_AUTHORIZATION_TOKEN = "AWS_CONTAINER_AUTHORIZATION_TOKEN"; var fromHttp = (options = {}) => { options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp"); let host; const relative = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI]; const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI]; const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN]; const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE]; const warn2 = options.logger?.constructor?.name === "NoOpLogger" || !options.logger?.warn ? console.warn : options.logger.warn.bind(options.logger); if (relative && 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 (relative) { host = `${DEFAULT_LINK_LOCAL_HOST}${relative}`; } else { throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided. Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger }); } const url = new URL(host); (0, checkUrl_1.checkUrl)(url, options.logger); const requestHandler = node_http_handler_1.NodeHttpHandler.create({ requestTimeout: options.timeout ?? 1e3, connectionTimeout: options.timeout ?? 1e3 }); return (0, retry_wrapper_1.retryWrapper)(async () => { const request = (0, requestHelpers_1.createGetRequest)(url); if (token) { request.headers.Authorization = token; } else if (tokenFile) { request.headers.Authorization = (await promises_1.default.readFile(tokenFile)).toString(); } try { const result = await requestHandler.handle(request); return (0, requestHelpers_1.getCredentials)(result.response).then((creds) => (0, client_1.setCredentialFeature)(creds, "CREDENTIALS_HTTP", "z")); } catch (e5) { throw new property_provider_1.CredentialsProviderError(String(e5), { logger: options.logger }); } }, options.maxRetries ?? 3, options.timeout ?? 1e3); }; exports2.fromHttp = fromHttp; } }); // node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js var require_dist_cjs43 = __commonJS({ "node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.fromHttp = void 0; var fromHttp_1 = require_fromHttp(); Object.defineProperty(exports2, "fromHttp", { enumerable: true, get: function() { return fromHttp_1.fromHttp; } }); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js function createAwsAuthSigv4HttpAuthOption(authParameters) { return { schemeId: "aws.auth#sigv4", signingProperties: { name: "sso-oauth", region: authParameters.region }, propertiesExtractor: (config, context) => ({ signingProperties: { config, context } }) }; } function createSmithyApiNoAuthHttpAuthOption(authParameters) { return { schemeId: "smithy.api#noAuth" }; } var import_util_middleware6, defaultSSOOIDCHttpAuthSchemeParametersProvider, defaultSSOOIDCHttpAuthSchemeProvider, resolveHttpAuthSchemeConfig; var init_httpAuthSchemeProvider = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthSchemeProvider.js"() { init_httpAuthSchemes2(); import_util_middleware6 = __toESM(require_dist_cjs6()); defaultSSOOIDCHttpAuthSchemeParametersProvider = async (config, context, input) => { return { operation: (0, import_util_middleware6.getSmithyContext)(context).operation, region: await (0, import_util_middleware6.normalizeProvider)(config.region)() || (() => { throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); })() }; }; defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => { const options = []; switch (authParameters.operation) { case "CreateToken": { options.push(createSmithyApiNoAuthHttpAuthOption(authParameters)); break; } default: { options.push(createAwsAuthSigv4HttpAuthOption(authParameters)); } } return options; }; resolveHttpAuthSchemeConfig = (config) => { const config_0 = resolveAwsSdkSigV4Config(config); return Object.assign(config_0, { authSchemePreference: (0, import_util_middleware6.normalizeProvider)(config.authSchemePreference ?? []) }); }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/EndpointParameters.js var resolveClientEndpointParameters, commonParams; var init_EndpointParameters = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/EndpointParameters.js"() { resolveClientEndpointParameters = (options) => { return Object.assign(options, { useDualstackEndpoint: options.useDualstackEndpoint ?? false, useFipsEndpoint: options.useFipsEndpoint ?? false, defaultSigningName: "sso-oauth" }); }; commonParams = { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, Endpoint: { type: "builtInParams", name: "endpoint" }, Region: { type: "builtInParams", name: "region" }, UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } }; } }); // node_modules/@aws-sdk/nested-clients/package.json var package_default; var init_package = __esm({ "node_modules/@aws-sdk/nested-clients/package.json"() { package_default = { name: "@aws-sdk/nested-clients", version: "3.997.6", description: "Nested clients for AWS SDK packages.", main: "./dist-cjs/index.js", module: "./dist-es/index.js", types: "./dist-types/index.d.ts", scripts: { build: "yarn lint && concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs", "build:cjs": "node ../../scripts/compilation/inline nested-clients", "build:es": "tsc -p tsconfig.es.json", "build:include:deps": 'yarn g:turbo run build -F="$npm_package_name"', "build:types": "tsc -p tsconfig.types.json", "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", clean: "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo", lint: "node ../../scripts/validation/submodules-linter.js --pkg nested-clients", test: "yarn g:vitest run", "test:watch": "yarn g:vitest watch" }, engines: { node: ">=20.0.0" }, sideEffects: false, author: { name: "AWS SDK for JavaScript Team", url: "https://aws.amazon.com/javascript/" }, license: "Apache-2.0", dependencies: { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/core": "^3.974.8", "@aws-sdk/middleware-host-header": "^3.972.10", "@aws-sdk/middleware-logger": "^3.972.10", "@aws-sdk/middleware-recursion-detection": "^3.972.11", "@aws-sdk/middleware-user-agent": "^3.972.38", "@aws-sdk/region-config-resolver": "^3.972.13", "@aws-sdk/signature-v4-multi-region": "^3.996.25", "@aws-sdk/types": "^3.973.8", "@aws-sdk/util-endpoints": "^3.996.8", "@aws-sdk/util-user-agent-browser": "^3.972.10", "@aws-sdk/util-user-agent-node": "^3.973.24", "@smithy/config-resolver": "^4.4.17", "@smithy/core": "^3.23.17", "@smithy/fetch-http-handler": "^5.3.17", "@smithy/hash-node": "^4.2.14", "@smithy/invalid-dependency": "^4.2.14", "@smithy/middleware-content-length": "^4.2.14", "@smithy/middleware-endpoint": "^4.4.32", "@smithy/middleware-retry": "^4.5.7", "@smithy/middleware-serde": "^4.2.20", "@smithy/middleware-stack": "^4.2.14", "@smithy/node-config-provider": "^4.3.14", "@smithy/node-http-handler": "^4.6.1", "@smithy/protocol-http": "^5.3.14", "@smithy/smithy-client": "^4.12.13", "@smithy/types": "^4.14.1", "@smithy/url-parser": "^4.2.14", "@smithy/util-base64": "^4.3.2", "@smithy/util-body-length-browser": "^4.2.2", "@smithy/util-body-length-node": "^4.2.3", "@smithy/util-defaults-mode-browser": "^4.3.49", "@smithy/util-defaults-mode-node": "^4.2.54", "@smithy/util-endpoints": "^3.4.2", "@smithy/util-middleware": "^4.2.14", "@smithy/util-retry": "^4.3.6", "@smithy/util-utf8": "^4.2.2", tslib: "^2.6.2" }, devDependencies: { concurrently: "7.0.0", "downlevel-dts": "0.10.1", premove: "4.0.0", typescript: "~5.8.3" }, typesVersions: { "<4.5": { "dist-types/*": [ "dist-types/ts3.4/*" ] } }, files: [ "./cognito-identity.d.ts", "./cognito-identity.js", "./signin.d.ts", "./signin.js", "./sso-oidc.d.ts", "./sso-oidc.js", "./sso.d.ts", "./sso.js", "./sts.d.ts", "./sts.js", "dist-*/**" ], browser: { "./dist-es/submodules/cognito-identity/runtimeConfig": "./dist-es/submodules/cognito-identity/runtimeConfig.browser", "./dist-es/submodules/signin/runtimeConfig": "./dist-es/submodules/signin/runtimeConfig.browser", "./dist-es/submodules/sso-oidc/runtimeConfig": "./dist-es/submodules/sso-oidc/runtimeConfig.browser", "./dist-es/submodules/sso/runtimeConfig": "./dist-es/submodules/sso/runtimeConfig.browser", "./dist-es/submodules/sts/runtimeConfig": "./dist-es/submodules/sts/runtimeConfig.browser" }, "react-native": {}, homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients", repository: { type: "git", url: "https://github.com/aws/aws-sdk-js-v3.git", directory: "packages/nested-clients" }, exports: { "./package.json": "./package.json", "./sso-oidc": { types: "./dist-types/submodules/sso-oidc/index.d.ts", module: "./dist-es/submodules/sso-oidc/index.js", node: "./dist-cjs/submodules/sso-oidc/index.js", import: "./dist-es/submodules/sso-oidc/index.js", require: "./dist-cjs/submodules/sso-oidc/index.js" }, "./sts": { types: "./dist-types/submodules/sts/index.d.ts", module: "./dist-es/submodules/sts/index.js", node: "./dist-cjs/submodules/sts/index.js", import: "./dist-es/submodules/sts/index.js", require: "./dist-cjs/submodules/sts/index.js" }, "./signin": { types: "./dist-types/submodules/signin/index.d.ts", module: "./dist-es/submodules/signin/index.js", node: "./dist-cjs/submodules/signin/index.js", import: "./dist-es/submodules/signin/index.js", require: "./dist-cjs/submodules/signin/index.js" }, "./cognito-identity": { types: "./dist-types/submodules/cognito-identity/index.d.ts", module: "./dist-es/submodules/cognito-identity/index.js", node: "./dist-cjs/submodules/cognito-identity/index.js", import: "./dist-es/submodules/cognito-identity/index.js", require: "./dist-cjs/submodules/cognito-identity/index.js" }, "./sso": { types: "./dist-types/submodules/sso/index.d.ts", module: "./dist-es/submodules/sso/index.js", node: "./dist-cjs/submodules/sso/index.js", import: "./dist-es/submodules/sso/index.js", require: "./dist-cjs/submodules/sso/index.js" } } }; } }); // node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js var require_dist_cjs44 = __commonJS({ "node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js"(exports2) { "use strict"; var node_os = require("node:os"); var node_process = require("node:process"); var utilConfigProvider = require_dist_cjs25(); var promises3 = require("node:fs/promises"); var node_path = require("node:path"); var middlewareUserAgent = require_dist_cjs24(); var getRuntimeUserAgentPair = () => { const runtimesToCheck = ["deno", "bun", "llrt"]; for (const runtime of runtimesToCheck) { if (node_process.versions[runtime]) { return [`md/${runtime}`, node_process.versions[runtime]]; } } return ["md/nodejs", node_process.versions.node]; }; var getNodeModulesParentDirs = (dirname3) => { const cwd = process.cwd(); if (!dirname3) { return [cwd]; } const normalizedPath = node_path.normalize(dirname3); const parts = normalizedPath.split(node_path.sep); const nodeModulesIndex = parts.indexOf("node_modules"); const parentDir = nodeModulesIndex !== -1 ? parts.slice(0, nodeModulesIndex).join(node_path.sep) : normalizedPath; if (cwd === parentDir) { return [cwd]; } return [parentDir, cwd]; }; var SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/; var getSanitizedTypeScriptVersion = (version = "") => { const match = version.match(SEMVER_REGEX); if (!match) { return void 0; } const [major, minor, patch, prerelease] = [match[1], match[2], match[3], match[4]]; return prerelease ? `${major}.${minor}.${patch}-${prerelease}` : `${major}.${minor}.${patch}`; }; var ALLOWED_PREFIXES = ["^", "~", ">=", "<=", ">", "<"]; var ALLOWED_DIST_TAGS = ["latest", "beta", "dev", "rc", "insiders", "next"]; var getSanitizedDevTypeScriptVersion = (version = "") => { if (ALLOWED_DIST_TAGS.includes(version)) { return version; } const prefix = ALLOWED_PREFIXES.find((p2) => version.startsWith(p2)) ?? ""; const sanitizedTypeScriptVersion = getSanitizedTypeScriptVersion(version.slice(prefix.length)); if (!sanitizedTypeScriptVersion) { return void 0; } return `${prefix}${sanitizedTypeScriptVersion}`; }; var tscVersion; var TS_PACKAGE_JSON = node_path.join("node_modules", "typescript", "package.json"); var getTypeScriptUserAgentPair = async () => { if (tscVersion === null) { return void 0; } else if (typeof tscVersion === "string") { return ["md/tsc", tscVersion]; } let isTypeScriptDetectionDisabled = false; try { isTypeScriptDetectionDisabled = utilConfigProvider.booleanSelector(process.env, "AWS_SDK_JS_TYPESCRIPT_DETECTION_DISABLED", utilConfigProvider.SelectorType.ENV) || false; } catch { } if (isTypeScriptDetectionDisabled) { tscVersion = null; return void 0; } const dirname3 = typeof __dirname !== "undefined" ? __dirname : void 0; const nodeModulesParentDirs = getNodeModulesParentDirs(dirname3); let versionFromApp; for (const nodeModulesParentDir of nodeModulesParentDirs) { try { const appPackageJsonPath = node_path.join(nodeModulesParentDir, "package.json"); const packageJson = await promises3.readFile(appPackageJsonPath, "utf-8"); const { dependencies, devDependencies } = JSON.parse(packageJson); const version = devDependencies?.typescript ?? dependencies?.typescript; if (typeof version !== "string") { continue; } versionFromApp = version; break; } catch { } } if (!versionFromApp) { tscVersion = null; return void 0; } let versionFromNodeModules; for (const nodeModulesParentDir of nodeModulesParentDirs) { try { const tsPackageJsonPath = node_path.join(nodeModulesParentDir, TS_PACKAGE_JSON); const packageJson = await promises3.readFile(tsPackageJsonPath, "utf-8"); const { version } = JSON.parse(packageJson); const sanitizedVersion2 = getSanitizedTypeScriptVersion(version); if (typeof sanitizedVersion2 !== "string") { continue; } versionFromNodeModules = sanitizedVersion2; break; } catch { } } if (versionFromNodeModules) { tscVersion = versionFromNodeModules; return ["md/tsc", tscVersion]; } const sanitizedVersion = getSanitizedDevTypeScriptVersion(versionFromApp); if (typeof sanitizedVersion !== "string") { tscVersion = null; return void 0; } tscVersion = `dev_${sanitizedVersion}`; return ["md/tsc", tscVersion]; }; var crtAvailability = { isCrtAvailable: false }; var isCrtAvailable = () => { if (crtAvailability.isCrtAvailable) { return ["md/crt-avail"]; } return null; }; var createDefaultUserAgentProvider5 = ({ serviceId, clientVersion }) => { const runtimeUserAgentPair = getRuntimeUserAgentPair(); return async (config) => { const sections = [ ["aws-sdk-js", clientVersion], ["ua", "2.1"], [`os/${node_os.platform()}`, node_os.release()], ["lang/js"], runtimeUserAgentPair ]; const typescriptUserAgentPair = await getTypeScriptUserAgentPair(); if (typescriptUserAgentPair) { sections.push(typescriptUserAgentPair); } const crtAvailable = isCrtAvailable(); if (crtAvailable) { sections.push(crtAvailable); } if (serviceId) { sections.push([`api/${serviceId}`, clientVersion]); } if (node_process.env.AWS_EXECUTION_ENV) { sections.push([`exec-env/${node_process.env.AWS_EXECUTION_ENV}`]); } const appId = await config?.userAgentAppId?.(); const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections]; return resolvedUserAgent; }; }; var defaultUserAgent = createDefaultUserAgentProvider5; var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID"; var UA_APP_ID_INI_NAME = "sdk_ua_app_id"; var UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id"; var NODE_APP_ID_CONFIG_OPTIONS5 = { environmentVariableSelector: (env) => env[UA_APP_ID_ENV_NAME], configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED], default: middlewareUserAgent.DEFAULT_UA_APP_ID }; exports2.NODE_APP_ID_CONFIG_OPTIONS = NODE_APP_ID_CONFIG_OPTIONS5; exports2.UA_APP_ID_ENV_NAME = UA_APP_ID_ENV_NAME; exports2.UA_APP_ID_INI_NAME = UA_APP_ID_INI_NAME; exports2.createDefaultUserAgentProvider = createDefaultUserAgentProvider5; exports2.crtAvailability = crtAvailability; exports2.defaultUserAgent = defaultUserAgent; } }); // node_modules/@smithy/hash-node/dist-cjs/index.js var require_dist_cjs45 = __commonJS({ "node_modules/@smithy/hash-node/dist-cjs/index.js"(exports2) { "use strict"; var utilBufferFrom = require_dist_cjs8(); var utilUtf8 = require_dist_cjs9(); var buffer = require("buffer"); var crypto4 = require("crypto"); var Hash5 = class { algorithmIdentifier; secret; hash; constructor(algorithmIdentifier, secret) { this.algorithmIdentifier = algorithmIdentifier; this.secret = secret; this.reset(); } update(toHash, encoding) { this.hash.update(utilUtf8.toUint8Array(castSourceData(toHash, encoding))); } digest() { return Promise.resolve(this.hash.digest()); } reset() { this.hash = this.secret ? crypto4.createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : crypto4.createHash(this.algorithmIdentifier); } }; function castSourceData(toCast, encoding) { if (buffer.Buffer.isBuffer(toCast)) { return toCast; } if (typeof toCast === "string") { return utilBufferFrom.fromString(toCast, encoding); } if (ArrayBuffer.isView(toCast)) { return utilBufferFrom.fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength); } return utilBufferFrom.fromArrayBuffer(toCast); } exports2.Hash = Hash5; } }); // node_modules/@smithy/util-body-length-node/dist-cjs/index.js var require_dist_cjs46 = __commonJS({ "node_modules/@smithy/util-body-length-node/dist-cjs/index.js"(exports2) { "use strict"; var node_fs = require("node:fs"); var calculateBodyLength5 = (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 (body instanceof node_fs.ReadStream) { if (body.path != null) { return node_fs.lstatSync(body.path).size; } else if (typeof body.fd === "number") { return node_fs.fstatSync(body.fd).size; } } throw new Error(`Body Length computation failed for ${body}`); }; exports2.calculateBodyLength = calculateBodyLength5; } }); // node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js var require_dist_cjs47 = __commonJS({ "node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js"(exports2) { "use strict"; var configResolver = require_dist_cjs26(); var nodeConfigProvider = require_dist_cjs30(); var propertyProvider = require_dist_cjs28(); var AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV"; var AWS_REGION_ENV = "AWS_REGION"; var AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION"; var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; var DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"]; var IMDS_REGION_PATH = "/latest/meta-data/placement/region"; var AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE"; var AWS_DEFAULTS_MODE_CONFIG = "defaults_mode"; var NODE_DEFAULTS_MODE_CONFIG_OPTIONS = { environmentVariableSelector: (env) => { return env[AWS_DEFAULTS_MODE_ENV]; }, configFileSelector: (profile) => { return profile[AWS_DEFAULTS_MODE_CONFIG]; }, default: "legacy" }; var resolveDefaultsModeConfig5 = ({ region = nodeConfigProvider.loadConfig(configResolver.NODE_REGION_CONFIG_OPTIONS), defaultsMode = nodeConfigProvider.loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => propertyProvider.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}`); } }); var resolveNodeDefaultsModeAuto = 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"; }; var inferPhysicalRegion = 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_DISABLED]) { try { const { getInstanceMetadataEndpoint, httpRequest } = await Promise.resolve().then(() => __toESM(require_dist_cjs42())); const endpoint = await getInstanceMetadataEndpoint(); return (await httpRequest({ ...endpoint, path: IMDS_REGION_PATH })).toString(); } catch (e5) { } } }; exports2.resolveDefaultsModeConfig = resolveDefaultsModeConfig5; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/bdd.js var import_util_endpoints, k, a, b, c, d, e, f, g, h, i, j, _data, root, r, nodes, bdd; var init_bdd = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/bdd.js"() { import_util_endpoints = __toESM(require_dist_cjs20()); k = "ref"; a = -1; b = true; c = "isSet"; d = "PartitionResult"; e = "booleanEquals"; f = "getAttr"; g = { [k]: "Endpoint" }; h = { [k]: d }; i = {}; j = [{ [k]: "Region" }]; _data = { conditions: [ [c, [g]], [c, j], ["aws.partition", j, d], [e, [{ [k]: "UseFIPS" }, b]], [e, [{ [k]: "UseDualStack" }, b]], [e, [{ fn: f, argv: [h, "supportsDualStack"] }, b]], [e, [{ fn: f, argv: [h, "supportsFIPS"] }, b]], ["stringEquals", [{ fn: f, argv: [h, "name"] }, "aws-us-gov"]] ], results: [ [a], [a, "Invalid Configuration: FIPS and custom endpoint are not supported"], [a, "Invalid Configuration: Dualstack and custom endpoint are not supported"], [g, i], ["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", i], [a, "FIPS and DualStack are enabled, but this partition does not support one or both"], ["https://oidc.{Region}.amazonaws.com", i], ["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}", i], [a, "FIPS is enabled but this partition does not support FIPS"], ["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}", i], [a, "DualStack is enabled but this partition does not support DualStack"], ["https://oidc.{Region}.{PartitionResult#dnsSuffix}", i], [a, "Invalid Configuration: Missing Region"] ] }; root = 2; r = 1e8; nodes = new Int32Array([ -1, 1, -1, 0, 13, 3, 1, 4, r + 12, 2, 5, r + 12, 3, 8, 6, 4, 7, r + 11, 5, r + 9, r + 10, 4, 11, 9, 6, 10, r + 8, 7, r + 6, r + 7, 5, 12, r + 5, 6, r + 4, r + 5, 3, r + 1, 14, 4, r + 2, r + 3 ]); bdd = import_util_endpoints.BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js var import_util_endpoints2, import_util_endpoints3, cache, defaultEndpointResolver; var init_endpointResolver = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/endpoint/endpointResolver.js"() { import_util_endpoints2 = __toESM(require_dist_cjs21()); import_util_endpoints3 = __toESM(require_dist_cjs20()); init_bdd(); cache = new import_util_endpoints3.EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] }); defaultEndpointResolver = (endpointParams, context = {}) => { return cache.get(endpointParams, () => (0, import_util_endpoints3.decideEndpoint)(bdd, { endpointParams, logger: context.logger })); }; import_util_endpoints3.customEndpointFunctions.aws = import_util_endpoints2.awsEndpointFunctions; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js var import_smithy_client8, SSOOIDCServiceException; var init_SSOOIDCServiceException = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js"() { import_smithy_client8 = __toESM(require_dist_cjs34()); SSOOIDCServiceException = class _SSOOIDCServiceException extends import_smithy_client8.ServiceException { constructor(options) { super(options); Object.setPrototypeOf(this, _SSOOIDCServiceException.prototype); } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js var AccessDeniedException, AuthorizationPendingException, ExpiredTokenException, InternalServerException, InvalidClientException, InvalidGrantException, InvalidRequestException, InvalidScopeException, SlowDownException, UnauthorizedClientException, UnsupportedGrantTypeException; var init_errors = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js"() { init_SSOOIDCServiceException(); AccessDeniedException = class _AccessDeniedException extends SSOOIDCServiceException { name = "AccessDeniedException"; $fault = "client"; error; reason; error_description; constructor(opts) { super({ name: "AccessDeniedException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _AccessDeniedException.prototype); this.error = opts.error; this.reason = opts.reason; this.error_description = opts.error_description; } }; AuthorizationPendingException = class _AuthorizationPendingException extends SSOOIDCServiceException { name = "AuthorizationPendingException"; $fault = "client"; error; error_description; constructor(opts) { super({ name: "AuthorizationPendingException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _AuthorizationPendingException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; ExpiredTokenException = class _ExpiredTokenException extends SSOOIDCServiceException { name = "ExpiredTokenException"; $fault = "client"; error; error_description; constructor(opts) { super({ name: "ExpiredTokenException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _ExpiredTokenException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; InternalServerException = class _InternalServerException extends SSOOIDCServiceException { name = "InternalServerException"; $fault = "server"; error; error_description; constructor(opts) { super({ name: "InternalServerException", $fault: "server", ...opts }); Object.setPrototypeOf(this, _InternalServerException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; InvalidClientException = class _InvalidClientException extends SSOOIDCServiceException { name = "InvalidClientException"; $fault = "client"; error; error_description; constructor(opts) { super({ name: "InvalidClientException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _InvalidClientException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; InvalidGrantException = class _InvalidGrantException extends SSOOIDCServiceException { name = "InvalidGrantException"; $fault = "client"; error; error_description; constructor(opts) { super({ name: "InvalidGrantException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _InvalidGrantException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; InvalidRequestException = class _InvalidRequestException extends SSOOIDCServiceException { name = "InvalidRequestException"; $fault = "client"; error; reason; error_description; constructor(opts) { super({ name: "InvalidRequestException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _InvalidRequestException.prototype); this.error = opts.error; this.reason = opts.reason; this.error_description = opts.error_description; } }; InvalidScopeException = class _InvalidScopeException extends SSOOIDCServiceException { name = "InvalidScopeException"; $fault = "client"; error; error_description; constructor(opts) { super({ name: "InvalidScopeException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _InvalidScopeException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; SlowDownException = class _SlowDownException extends SSOOIDCServiceException { name = "SlowDownException"; $fault = "client"; error; error_description; constructor(opts) { super({ name: "SlowDownException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _SlowDownException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; UnauthorizedClientException = class _UnauthorizedClientException extends SSOOIDCServiceException { name = "UnauthorizedClientException"; $fault = "client"; error; error_description; constructor(opts) { super({ name: "UnauthorizedClientException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _UnauthorizedClientException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; UnsupportedGrantTypeException = class _UnsupportedGrantTypeException extends SSOOIDCServiceException { name = "UnsupportedGrantTypeException"; $fault = "client"; error; error_description; constructor(opts) { super({ name: "UnsupportedGrantTypeException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _UnsupportedGrantTypeException.prototype); this.error = opts.error; this.error_description = opts.error_description; } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js var _ADE, _APE, _AT, _CS, _CT, _CTR, _CTRr, _CV, _ETE, _ICE, _IGE, _IRE, _ISE, _ISEn, _IT, _RT, _SDE, _UCE, _UGTE, _aT, _c, _cI, _cS, _cV, _co, _dC, _e, _eI, _ed, _gT, _h, _hE, _iT, _r, _rT, _rU, _s, _sc, _se, _tT, n0, _s_registry, SSOOIDCServiceException$, n0_registry, AccessDeniedException$, AuthorizationPendingException$, ExpiredTokenException$, InternalServerException$, InvalidClientException$, InvalidGrantException$, InvalidRequestException$, InvalidScopeException$, SlowDownException$, UnauthorizedClientException$, UnsupportedGrantTypeException$, errorTypeRegistries, AccessToken, ClientSecret, CodeVerifier, IdToken, RefreshToken, CreateTokenRequest$, CreateTokenResponse$, Scopes, CreateToken$; var init_schemas_0 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js"() { init_schema(); init_errors(); init_SSOOIDCServiceException(); _ADE = "AccessDeniedException"; _APE = "AuthorizationPendingException"; _AT = "AccessToken"; _CS = "ClientSecret"; _CT = "CreateToken"; _CTR = "CreateTokenRequest"; _CTRr = "CreateTokenResponse"; _CV = "CodeVerifier"; _ETE = "ExpiredTokenException"; _ICE = "InvalidClientException"; _IGE = "InvalidGrantException"; _IRE = "InvalidRequestException"; _ISE = "InternalServerException"; _ISEn = "InvalidScopeException"; _IT = "IdToken"; _RT = "RefreshToken"; _SDE = "SlowDownException"; _UCE = "UnauthorizedClientException"; _UGTE = "UnsupportedGrantTypeException"; _aT = "accessToken"; _c = "client"; _cI = "clientId"; _cS = "clientSecret"; _cV = "codeVerifier"; _co = "code"; _dC = "deviceCode"; _e = "error"; _eI = "expiresIn"; _ed = "error_description"; _gT = "grantType"; _h = "http"; _hE = "httpError"; _iT = "idToken"; _r = "reason"; _rT = "refreshToken"; _rU = "redirectUri"; _s = "smithy.ts.sdk.synthetic.com.amazonaws.ssooidc"; _sc = "scope"; _se = "server"; _tT = "tokenType"; n0 = "com.amazonaws.ssooidc"; _s_registry = TypeRegistry.for(_s); SSOOIDCServiceException$ = [-3, _s, "SSOOIDCServiceException", 0, [], []]; _s_registry.registerError(SSOOIDCServiceException$, SSOOIDCServiceException); n0_registry = TypeRegistry.for(n0); AccessDeniedException$ = [ -3, n0, _ADE, { [_e]: _c, [_hE]: 400 }, [_e, _r, _ed], [0, 0, 0] ]; n0_registry.registerError(AccessDeniedException$, AccessDeniedException); AuthorizationPendingException$ = [ -3, n0, _APE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0] ]; n0_registry.registerError(AuthorizationPendingException$, AuthorizationPendingException); ExpiredTokenException$ = [-3, n0, _ETE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]]; n0_registry.registerError(ExpiredTokenException$, ExpiredTokenException); InternalServerException$ = [-3, n0, _ISE, { [_e]: _se, [_hE]: 500 }, [_e, _ed], [0, 0]]; n0_registry.registerError(InternalServerException$, InternalServerException); InvalidClientException$ = [-3, n0, _ICE, { [_e]: _c, [_hE]: 401 }, [_e, _ed], [0, 0]]; n0_registry.registerError(InvalidClientException$, InvalidClientException); InvalidGrantException$ = [-3, n0, _IGE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]]; n0_registry.registerError(InvalidGrantException$, InvalidGrantException); InvalidRequestException$ = [ -3, n0, _IRE, { [_e]: _c, [_hE]: 400 }, [_e, _r, _ed], [0, 0, 0] ]; n0_registry.registerError(InvalidRequestException$, InvalidRequestException); InvalidScopeException$ = [-3, n0, _ISEn, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]]; n0_registry.registerError(InvalidScopeException$, InvalidScopeException); SlowDownException$ = [-3, n0, _SDE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0]]; n0_registry.registerError(SlowDownException$, SlowDownException); UnauthorizedClientException$ = [ -3, n0, _UCE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0] ]; n0_registry.registerError(UnauthorizedClientException$, UnauthorizedClientException); UnsupportedGrantTypeException$ = [ -3, n0, _UGTE, { [_e]: _c, [_hE]: 400 }, [_e, _ed], [0, 0] ]; n0_registry.registerError(UnsupportedGrantTypeException$, UnsupportedGrantTypeException); errorTypeRegistries = [_s_registry, n0_registry]; AccessToken = [0, n0, _AT, 8, 0]; ClientSecret = [0, n0, _CS, 8, 0]; CodeVerifier = [0, n0, _CV, 8, 0]; IdToken = [0, n0, _IT, 8, 0]; RefreshToken = [0, n0, _RT, 8, 0]; CreateTokenRequest$ = [ 3, n0, _CTR, 0, [_cI, _cS, _gT, _dC, _co, _rT, _sc, _rU, _cV], [0, [() => ClientSecret, 0], 0, 0, 0, [() => RefreshToken, 0], 64 | 0, 0, [() => CodeVerifier, 0]], 3 ]; CreateTokenResponse$ = [ 3, n0, _CTRr, 0, [_aT, _tT, _eI, _rT, _iT], [[() => AccessToken, 0], 0, 1, [() => RefreshToken, 0], [() => IdToken, 0]] ]; Scopes = 64 | 0; CreateToken$ = [ 9, n0, _CT, { [_h]: ["POST", "/token", 200] }, () => CreateTokenRequest$, () => CreateTokenResponse$ ]; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.shared.js var import_smithy_client9, import_url_parser2, import_util_base648, import_util_utf88, getRuntimeConfig; var init_runtimeConfig_shared = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.shared.js"() { init_httpAuthSchemes2(); init_protocols2(); init_dist_es(); import_smithy_client9 = __toESM(require_dist_cjs34()); import_url_parser2 = __toESM(require_dist_cjs18()); import_util_base648 = __toESM(require_dist_cjs10()); import_util_utf88 = __toESM(require_dist_cjs9()); init_httpAuthSchemeProvider(); init_endpointResolver(); init_schemas_0(); getRuntimeConfig = (config) => { return { apiVersion: "2019-06-10", base64Decoder: config?.base64Decoder ?? import_util_base648.fromBase64, base64Encoder: config?.base64Encoder ?? import_util_base648.toBase64, disableHostPrefix: config?.disableHostPrefix ?? false, endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, 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 import_smithy_client9.NoOpLogger(), protocol: config?.protocol ?? AwsRestJsonProtocol, protocolSettings: config?.protocolSettings ?? { defaultNamespace: "com.amazonaws.ssooidc", errorTypeRegistries, version: "2019-06-10", serviceTarget: "AWSSSOOIDCService" }, serviceId: config?.serviceId ?? "SSO OIDC", urlParser: config?.urlParser ?? import_url_parser2.parseUrl, utf8Decoder: config?.utf8Decoder ?? import_util_utf88.fromUtf8, utf8Encoder: config?.utf8Encoder ?? import_util_utf88.toUtf8 }; }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js var import_util_user_agent_node, import_config_resolver, import_hash_node, import_middleware_retry, import_node_config_provider, import_node_http_handler, import_smithy_client10, import_util_body_length_node, import_util_defaults_mode_node, import_util_retry2, getRuntimeConfig2; var init_runtimeConfig = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js"() { init_package(); init_client(); init_httpAuthSchemes2(); import_util_user_agent_node = __toESM(require_dist_cjs44()); import_config_resolver = __toESM(require_dist_cjs26()); import_hash_node = __toESM(require_dist_cjs45()); import_middleware_retry = __toESM(require_dist_cjs35()); import_node_config_provider = __toESM(require_dist_cjs30()); import_node_http_handler = __toESM(require_dist_cjs13()); import_smithy_client10 = __toESM(require_dist_cjs34()); import_util_body_length_node = __toESM(require_dist_cjs46()); import_util_defaults_mode_node = __toESM(require_dist_cjs47()); import_util_retry2 = __toESM(require_dist_cjs23()); init_runtimeConfig_shared(); getRuntimeConfig2 = (config) => { (0, import_smithy_client10.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, import_util_defaults_mode_node.resolveDefaultsModeConfig)(config); const defaultConfigProvider = () => defaultsMode().then(import_smithy_client10.loadConfigsForDefaultMode); const clientSharedValues = getRuntimeConfig(config); emitWarningIfUnsupportedVersion(process.version); const loaderConfig = { profile: config?.profile, logger: clientSharedValues.logger }; return { ...clientSharedValues, ...config, runtime: "node", defaultsMode, authSchemePreference: config?.authSchemePreference ?? (0, import_node_config_provider.loadConfig)(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), bodyLengthChecker: config?.bodyLengthChecker ?? import_util_body_length_node.calculateBodyLength, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, import_util_user_agent_node.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), maxAttempts: config?.maxAttempts ?? (0, import_node_config_provider.loadConfig)(import_middleware_retry.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), region: config?.region ?? (0, import_node_config_provider.loadConfig)(import_config_resolver.NODE_REGION_CONFIG_OPTIONS, { ...import_config_resolver.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), requestHandler: import_node_http_handler.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? (0, import_node_config_provider.loadConfig)({ ...import_middleware_retry.NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || import_util_retry2.DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? import_hash_node.Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? import_node_http_handler.streamCollector, useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, import_node_config_provider.loadConfig)(import_config_resolver.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), useFipsEndpoint: config?.useFipsEndpoint ?? (0, import_node_config_provider.loadConfig)(import_config_resolver.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), userAgentAppId: config?.userAgentAppId ?? (0, import_node_config_provider.loadConfig)(import_util_user_agent_node.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) }; }; } }); // node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js var require_stsRegionDefaultResolver = __commonJS({ "node_modules/@aws-sdk/region-config-resolver/dist-cjs/regionConfig/stsRegionDefaultResolver.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.warning = void 0; exports2.stsRegionDefaultResolver = stsRegionDefaultResolver2; var config_resolver_1 = require_dist_cjs26(); var node_config_provider_1 = require_dist_cjs30(); function stsRegionDefaultResolver2(loaderConfig = {}) { return (0, node_config_provider_1.loadConfig)({ ...config_resolver_1.NODE_REGION_CONFIG_OPTIONS, async default() { if (!exports2.warning.silence) { console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly."); } return "us-east-1"; } }, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }); } exports2.warning = { silence: false }; } }); // node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js var require_dist_cjs48 = __commonJS({ "node_modules/@aws-sdk/region-config-resolver/dist-cjs/index.js"(exports2) { "use strict"; var stsRegionDefaultResolver2 = require_stsRegionDefaultResolver(); var configResolver = require_dist_cjs26(); var getAwsRegionExtensionConfiguration5 = (runtimeConfig) => { return { setRegion(region) { runtimeConfig.region = region; }, region() { return runtimeConfig.region; } }; }; var resolveAwsRegionExtensionConfiguration5 = (awsRegionExtensionConfiguration) => { return { region: awsRegionExtensionConfiguration.region() }; }; exports2.NODE_REGION_CONFIG_FILE_OPTIONS = configResolver.NODE_REGION_CONFIG_FILE_OPTIONS; exports2.NODE_REGION_CONFIG_OPTIONS = configResolver.NODE_REGION_CONFIG_OPTIONS; exports2.REGION_ENV_NAME = configResolver.REGION_ENV_NAME; exports2.REGION_INI_NAME = configResolver.REGION_INI_NAME; exports2.resolveRegionConfig = configResolver.resolveRegionConfig; exports2.getAwsRegionExtensionConfiguration = getAwsRegionExtensionConfiguration5; exports2.resolveAwsRegionExtensionConfiguration = resolveAwsRegionExtensionConfiguration5; Object.prototype.hasOwnProperty.call(stsRegionDefaultResolver2, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: stsRegionDefaultResolver2["__proto__"] }); Object.keys(stsRegionDefaultResolver2).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = stsRegionDefaultResolver2[k5]; }); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.js var getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig; var init_httpAuthExtensionConfiguration = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.js"() { getHttpAuthExtensionConfiguration = (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; } }; }; resolveHttpAuthRuntimeConfig = (config) => { return { httpAuthSchemes: config.httpAuthSchemes(), httpAuthSchemeProvider: config.httpAuthSchemeProvider(), credentials: config.credentials() }; }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeExtensions.js var import_region_config_resolver, import_protocol_http12, import_smithy_client11, resolveRuntimeExtensions; var init_runtimeExtensions = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeExtensions.js"() { import_region_config_resolver = __toESM(require_dist_cjs48()); import_protocol_http12 = __toESM(require_dist_cjs2()); import_smithy_client11 = __toESM(require_dist_cjs34()); init_httpAuthExtensionConfiguration(); resolveRuntimeExtensions = (runtimeConfig, extensions) => { const extensionConfiguration = Object.assign((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, import_smithy_client11.getDefaultExtensionConfiguration)(runtimeConfig), (0, import_protocol_http12.getHttpHandlerExtensionConfiguration)(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig)); extensions.forEach((extension) => extension.configure(extensionConfiguration)); return Object.assign(runtimeConfig, (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, import_smithy_client11.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, import_protocol_http12.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration)); }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDCClient.js var import_middleware_host_header, import_middleware_logger, import_middleware_recursion_detection, import_middleware_user_agent, import_config_resolver2, import_middleware_content_length, import_middleware_endpoint, import_middleware_retry2, import_smithy_client12, SSOOIDCClient; var init_SSOOIDCClient = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDCClient.js"() { import_middleware_host_header = __toESM(require_dist_cjs3()); import_middleware_logger = __toESM(require_dist_cjs4()); import_middleware_recursion_detection = __toESM(require_dist_cjs5()); import_middleware_user_agent = __toESM(require_dist_cjs24()); import_config_resolver2 = __toESM(require_dist_cjs26()); init_dist_es(); init_schema(); import_middleware_content_length = __toESM(require_dist_cjs27()); import_middleware_endpoint = __toESM(require_dist_cjs32()); import_middleware_retry2 = __toESM(require_dist_cjs35()); import_smithy_client12 = __toESM(require_dist_cjs34()); init_httpAuthSchemeProvider(); init_EndpointParameters(); init_runtimeConfig(); init_runtimeExtensions(); SSOOIDCClient = class extends import_smithy_client12.Client { config; constructor(...[configuration]) { const _config_0 = getRuntimeConfig2(configuration || {}); super(_config_0); this.initConfig = _config_0; const _config_1 = resolveClientEndpointParameters(_config_0); const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1); const _config_3 = (0, import_middleware_retry2.resolveRetryConfig)(_config_2); const _config_4 = (0, import_config_resolver2.resolveRegionConfig)(_config_3); const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4); const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5); const _config_7 = resolveHttpAuthSchemeConfig(_config_6); const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); this.config = _config_8; this.middlewareStack.use(getSchemaSerdePlugin(this.config)); this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_retry2.getRetryPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_recursion_detection.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(); } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/CreateTokenCommand.js var import_middleware_endpoint2, import_smithy_client13, CreateTokenCommand; var init_CreateTokenCommand = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/CreateTokenCommand.js"() { import_middleware_endpoint2 = __toESM(require_dist_cjs32()); import_smithy_client13 = __toESM(require_dist_cjs34()); init_EndpointParameters(); init_schemas_0(); CreateTokenCommand = class extends import_smithy_client13.Command.classBuilder().ep(commonParams).m(function(Command2, cs, config, o2) { return [(0, import_middleware_endpoint2.getEndpointPlugin)(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSSOOIDCService", "CreateToken", {}).n("SSOOIDCClient", "CreateTokenCommand").sc(CreateToken$).build() { }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDC.js var import_smithy_client14, commands, SSOOIDC; var init_SSOOIDC = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDC.js"() { import_smithy_client14 = __toESM(require_dist_cjs34()); init_CreateTokenCommand(); init_SSOOIDCClient(); commands = { CreateTokenCommand }; SSOOIDC = class extends SSOOIDCClient { }; (0, import_smithy_client14.createAggregatedClient)(commands, SSOOIDC); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/index.js var init_commands = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/commands/index.js"() { init_CreateTokenCommand(); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/enums.js var AccessDeniedExceptionReason, InvalidRequestExceptionReason; var init_enums = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/enums.js"() { AccessDeniedExceptionReason = { KMS_ACCESS_DENIED: "KMS_AccessDeniedException" }; InvalidRequestExceptionReason = { KMS_DISABLED_KEY: "KMS_DisabledException", KMS_INVALID_KEY_USAGE: "KMS_InvalidKeyUsageException", KMS_INVALID_STATE: "KMS_InvalidStateException", KMS_KEY_NOT_FOUND: "KMS_NotFoundException" }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/models_0.js var init_models_0 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/models_0.js"() { } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/index.js var sso_oidc_exports = {}; __export(sso_oidc_exports, { $Command: () => import_smithy_client13.Command, AccessDeniedException: () => AccessDeniedException, AccessDeniedException$: () => AccessDeniedException$, AccessDeniedExceptionReason: () => AccessDeniedExceptionReason, AuthorizationPendingException: () => AuthorizationPendingException, AuthorizationPendingException$: () => AuthorizationPendingException$, CreateToken$: () => CreateToken$, CreateTokenCommand: () => CreateTokenCommand, CreateTokenRequest$: () => CreateTokenRequest$, CreateTokenResponse$: () => CreateTokenResponse$, ExpiredTokenException: () => ExpiredTokenException, ExpiredTokenException$: () => ExpiredTokenException$, InternalServerException: () => InternalServerException, InternalServerException$: () => InternalServerException$, InvalidClientException: () => InvalidClientException, InvalidClientException$: () => InvalidClientException$, InvalidGrantException: () => InvalidGrantException, InvalidGrantException$: () => InvalidGrantException$, InvalidRequestException: () => InvalidRequestException, InvalidRequestException$: () => InvalidRequestException$, InvalidRequestExceptionReason: () => InvalidRequestExceptionReason, InvalidScopeException: () => InvalidScopeException, InvalidScopeException$: () => InvalidScopeException$, SSOOIDC: () => SSOOIDC, SSOOIDCClient: () => SSOOIDCClient, SSOOIDCServiceException: () => SSOOIDCServiceException, SSOOIDCServiceException$: () => SSOOIDCServiceException$, SlowDownException: () => SlowDownException, SlowDownException$: () => SlowDownException$, UnauthorizedClientException: () => UnauthorizedClientException, UnauthorizedClientException$: () => UnauthorizedClientException$, UnsupportedGrantTypeException: () => UnsupportedGrantTypeException, UnsupportedGrantTypeException$: () => UnsupportedGrantTypeException$, __Client: () => import_smithy_client12.Client, errorTypeRegistries: () => errorTypeRegistries }); var init_sso_oidc = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/index.js"() { init_SSOOIDCClient(); init_SSOOIDC(); init_commands(); init_schemas_0(); init_enums(); init_errors(); init_models_0(); init_SSOOIDCServiceException(); } }); // node_modules/@aws-sdk/token-providers/dist-cjs/index.js var require_dist_cjs49 = __commonJS({ "node_modules/@aws-sdk/token-providers/dist-cjs/index.js"(exports2) { "use strict"; var client = (init_client(), __toCommonJS(client_exports)); var httpAuthSchemes = (init_httpAuthSchemes2(), __toCommonJS(httpAuthSchemes_exports)); var propertyProvider = require_dist_cjs28(); var sharedIniFileLoader = require_dist_cjs29(); var node_fs = require("node:fs"); var fromEnvSigningName = ({ logger: logger2, signingName } = {}) => async () => { logger2?.debug?.("@aws-sdk/token-providers - fromEnvSigningName"); if (!signingName) { throw new propertyProvider.TokenProviderError("Please pass 'signingName' to compute environment variable key", { logger: logger2 }); } const bearerTokenKey = httpAuthSchemes.getBearerTokenEnvKey(signingName); if (!(bearerTokenKey in process.env)) { throw new propertyProvider.TokenProviderError(`Token not present in '${bearerTokenKey}' environment variable`, { logger: logger2 }); } const token = { token: process.env[bearerTokenKey] }; client.setTokenFeature(token, "BEARER_SERVICE_ENV_VARS", "3"); return token; }; var EXPIRE_WINDOW_MS = 5 * 60 * 1e3; var REFRESH_MESSAGE = `To refresh this SSO session run 'aws sso login' with the corresponding profile.`; var getSsoOidcClient = async (ssoRegion, init = {}, callerClientConfig) => { const { SSOOIDCClient: SSOOIDCClient2 } = await Promise.resolve().then(() => (init_sso_oidc(), sso_oidc_exports)); const coalesce = (prop) => init.clientConfig?.[prop] ?? init.parentClientConfig?.[prop] ?? callerClientConfig?.[prop]; const ssoOidcClient = new SSOOIDCClient2(Object.assign({}, init.clientConfig ?? {}, { region: ssoRegion ?? init.clientConfig?.region, logger: coalesce("logger"), userAgentAppId: coalesce("userAgentAppId") })); return ssoOidcClient; }; var getNewSsoOidcToken = async (ssoToken, ssoRegion, init = {}, callerClientConfig) => { const { CreateTokenCommand: CreateTokenCommand2 } = await Promise.resolve().then(() => (init_sso_oidc(), sso_oidc_exports)); const ssoOidcClient = await getSsoOidcClient(ssoRegion, init, callerClientConfig); return ssoOidcClient.send(new CreateTokenCommand2({ clientId: ssoToken.clientId, clientSecret: ssoToken.clientSecret, refreshToken: ssoToken.refreshToken, grantType: "refresh_token" })); }; var validateTokenExpiry = (token) => { if (token.expiration && token.expiration.getTime() < Date.now()) { throw new propertyProvider.TokenProviderError(`Token is expired. ${REFRESH_MESSAGE}`, false); } }; var validateTokenKey = (key, value, forRefresh = false) => { if (typeof value === "undefined") { throw new propertyProvider.TokenProviderError(`Value not present for '${key}' in SSO Token${forRefresh ? ". Cannot refresh" : ""}. ${REFRESH_MESSAGE}`, false); } }; var { writeFile: writeFile2 } = node_fs.promises; var writeSSOTokenToFile = (id, ssoToken) => { const tokenFilepath = sharedIniFileLoader.getSSOTokenFilepath(id); const tokenString = JSON.stringify(ssoToken, null, 2); return writeFile2(tokenFilepath, tokenString); }; var lastRefreshAttemptTime = /* @__PURE__ */ new Date(0); var fromSso = (init = {}) => async ({ callerClientConfig } = {}) => { init.logger?.debug("@aws-sdk/token-providers - fromSso"); const profiles = await sharedIniFileLoader.parseKnownFiles(init); const profileName = sharedIniFileLoader.getProfileName({ profile: init.profile ?? callerClientConfig?.profile }); const profile = profiles[profileName]; if (!profile) { throw new propertyProvider.TokenProviderError(`Profile '${profileName}' could not be found in shared credentials file.`, false); } else if (!profile["sso_session"]) { throw new propertyProvider.TokenProviderError(`Profile '${profileName}' is missing required property 'sso_session'.`); } const ssoSessionName = profile["sso_session"]; const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init); const ssoSession = ssoSessions[ssoSessionName]; if (!ssoSession) { throw new propertyProvider.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 propertyProvider.TokenProviderError(`Sso session '${ssoSessionName}' is missing required property '${ssoSessionRequiredKey}'.`, false); } } ssoSession["sso_start_url"]; const ssoRegion = ssoSession["sso_region"]; let ssoToken; try { ssoToken = await sharedIniFileLoader.getSSOTokenFromFile(ssoSessionName); } catch (e5) { throw new propertyProvider.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, init, callerClientConfig); 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 (error3) { } return { token: newSsoOidcToken.accessToken, expiration: newTokenExpiration }; } catch (error3) { validateTokenExpiry(existingToken); return existingToken; } }; var fromStatic = ({ token, logger: logger2 }) => async () => { logger2?.debug("@aws-sdk/token-providers - fromStatic"); if (!token || !token.token) { throw new propertyProvider.TokenProviderError(`Please pass a valid token to fromStatic`, false); } return token; }; var nodeProvider = (init = {}) => propertyProvider.memoize(propertyProvider.chain(fromSso(init), async () => { throw new propertyProvider.TokenProviderError("Could not load token from any providers", false); }), (token) => token.expiration !== void 0 && token.expiration.getTime() - Date.now() < 3e5, (token) => token.expiration !== void 0); exports2.fromEnvSigningName = fromEnvSigningName; exports2.fromSso = fromSso; exports2.fromStatic = fromStatic; exports2.nodeProvider = nodeProvider; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthSchemeProvider.js function createAwsAuthSigv4HttpAuthOption2(authParameters) { return { schemeId: "aws.auth#sigv4", signingProperties: { name: "awsssoportal", region: authParameters.region }, propertiesExtractor: (config, context) => ({ signingProperties: { config, context } }) }; } function createSmithyApiNoAuthHttpAuthOption2(authParameters) { return { schemeId: "smithy.api#noAuth" }; } var import_util_middleware7, defaultSSOHttpAuthSchemeParametersProvider, defaultSSOHttpAuthSchemeProvider, resolveHttpAuthSchemeConfig2; var init_httpAuthSchemeProvider2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthSchemeProvider.js"() { init_httpAuthSchemes2(); import_util_middleware7 = __toESM(require_dist_cjs6()); defaultSSOHttpAuthSchemeParametersProvider = async (config, context, input) => { return { operation: (0, import_util_middleware7.getSmithyContext)(context).operation, region: await (0, import_util_middleware7.normalizeProvider)(config.region)() || (() => { throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); })() }; }; defaultSSOHttpAuthSchemeProvider = (authParameters) => { const options = []; switch (authParameters.operation) { case "GetRoleCredentials": { options.push(createSmithyApiNoAuthHttpAuthOption2(authParameters)); break; } default: { options.push(createAwsAuthSigv4HttpAuthOption2(authParameters)); } } return options; }; resolveHttpAuthSchemeConfig2 = (config) => { const config_0 = resolveAwsSdkSigV4Config(config); return Object.assign(config_0, { authSchemePreference: (0, import_util_middleware7.normalizeProvider)(config.authSchemePreference ?? []) }); }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/EndpointParameters.js var resolveClientEndpointParameters2, commonParams2; var init_EndpointParameters2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/EndpointParameters.js"() { resolveClientEndpointParameters2 = (options) => { return Object.assign(options, { useDualstackEndpoint: options.useDualstackEndpoint ?? false, useFipsEndpoint: options.useFipsEndpoint ?? false, defaultSigningName: "awsssoportal" }); }; commonParams2 = { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, Endpoint: { type: "builtInParams", name: "endpoint" }, Region: { type: "builtInParams", name: "region" }, UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/bdd.js var import_util_endpoints4, k2, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, _data2, root2, r2, nodes2, bdd2; var init_bdd2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/bdd.js"() { import_util_endpoints4 = __toESM(require_dist_cjs20()); k2 = "ref"; a2 = -1; b2 = true; c2 = "isSet"; d2 = "PartitionResult"; e2 = "booleanEquals"; f2 = "getAttr"; g2 = { [k2]: "Endpoint" }; h2 = { [k2]: d2 }; i2 = {}; j2 = [{ [k2]: "Region" }]; _data2 = { conditions: [ [c2, [g2]], [c2, j2], ["aws.partition", j2, d2], [e2, [{ [k2]: "UseFIPS" }, b2]], [e2, [{ [k2]: "UseDualStack" }, b2]], [e2, [{ fn: f2, argv: [h2, "supportsDualStack"] }, b2]], [e2, [{ fn: f2, argv: [h2, "supportsFIPS"] }, b2]], ["stringEquals", [{ fn: f2, argv: [h2, "name"] }, "aws-us-gov"]] ], results: [ [a2], [a2, "Invalid Configuration: FIPS and custom endpoint are not supported"], [a2, "Invalid Configuration: Dualstack and custom endpoint are not supported"], [g2, i2], ["https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", i2], [a2, "FIPS and DualStack are enabled, but this partition does not support one or both"], ["https://portal.sso.{Region}.amazonaws.com", i2], ["https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}", i2], [a2, "FIPS is enabled but this partition does not support FIPS"], ["https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}", i2], [a2, "DualStack is enabled but this partition does not support DualStack"], ["https://portal.sso.{Region}.{PartitionResult#dnsSuffix}", i2], [a2, "Invalid Configuration: Missing Region"] ] }; root2 = 2; r2 = 1e8; nodes2 = new Int32Array([ -1, 1, -1, 0, 13, 3, 1, 4, r2 + 12, 2, 5, r2 + 12, 3, 8, 6, 4, 7, r2 + 11, 5, r2 + 9, r2 + 10, 4, 11, 9, 6, 10, r2 + 8, 7, r2 + 6, r2 + 7, 5, 12, r2 + 5, 6, r2 + 4, r2 + 5, 3, r2 + 1, 14, 4, r2 + 2, r2 + 3 ]); bdd2 = import_util_endpoints4.BinaryDecisionDiagram.from(nodes2, root2, _data2.conditions, _data2.results); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/endpointResolver.js var import_util_endpoints5, import_util_endpoints6, cache2, defaultEndpointResolver2; var init_endpointResolver2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/endpoint/endpointResolver.js"() { import_util_endpoints5 = __toESM(require_dist_cjs21()); import_util_endpoints6 = __toESM(require_dist_cjs20()); init_bdd2(); cache2 = new import_util_endpoints6.EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] }); defaultEndpointResolver2 = (endpointParams, context = {}) => { return cache2.get(endpointParams, () => (0, import_util_endpoints6.decideEndpoint)(bdd2, { endpointParams, logger: context.logger })); }; import_util_endpoints6.customEndpointFunctions.aws = import_util_endpoints5.awsEndpointFunctions; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js var import_smithy_client15, SSOServiceException; var init_SSOServiceException = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js"() { import_smithy_client15 = __toESM(require_dist_cjs34()); SSOServiceException = class _SSOServiceException extends import_smithy_client15.ServiceException { constructor(options) { super(options); Object.setPrototypeOf(this, _SSOServiceException.prototype); } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/errors.js var InvalidRequestException2, ResourceNotFoundException, TooManyRequestsException, UnauthorizedException; var init_errors2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/errors.js"() { init_SSOServiceException(); InvalidRequestException2 = class _InvalidRequestException extends SSOServiceException { name = "InvalidRequestException"; $fault = "client"; constructor(opts) { super({ name: "InvalidRequestException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _InvalidRequestException.prototype); } }; ResourceNotFoundException = class _ResourceNotFoundException extends SSOServiceException { name = "ResourceNotFoundException"; $fault = "client"; constructor(opts) { super({ name: "ResourceNotFoundException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _ResourceNotFoundException.prototype); } }; TooManyRequestsException = class _TooManyRequestsException extends SSOServiceException { name = "TooManyRequestsException"; $fault = "client"; constructor(opts) { super({ name: "TooManyRequestsException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _TooManyRequestsException.prototype); } }; UnauthorizedException = class _UnauthorizedException extends SSOServiceException { name = "UnauthorizedException"; $fault = "client"; constructor(opts) { super({ name: "UnauthorizedException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _UnauthorizedException.prototype); } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js var _ATT, _GRC, _GRCR, _GRCRe, _IRE2, _RC, _RNFE, _SAKT, _STT, _TMRE, _UE, _aI, _aKI, _aT2, _ai, _c2, _e2, _ex, _h2, _hE2, _hH, _hQ, _m, _rC, _rN, _rn, _s2, _sAK, _sT, _xasbt, n02, _s_registry2, SSOServiceException$, n0_registry2, InvalidRequestException$2, ResourceNotFoundException$, TooManyRequestsException$, UnauthorizedException$, errorTypeRegistries2, AccessTokenType, SecretAccessKeyType, SessionTokenType, GetRoleCredentialsRequest$, GetRoleCredentialsResponse$, RoleCredentials$, GetRoleCredentials$; var init_schemas_02 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js"() { init_schema(); init_errors2(); init_SSOServiceException(); _ATT = "AccessTokenType"; _GRC = "GetRoleCredentials"; _GRCR = "GetRoleCredentialsRequest"; _GRCRe = "GetRoleCredentialsResponse"; _IRE2 = "InvalidRequestException"; _RC = "RoleCredentials"; _RNFE = "ResourceNotFoundException"; _SAKT = "SecretAccessKeyType"; _STT = "SessionTokenType"; _TMRE = "TooManyRequestsException"; _UE = "UnauthorizedException"; _aI = "accountId"; _aKI = "accessKeyId"; _aT2 = "accessToken"; _ai = "account_id"; _c2 = "client"; _e2 = "error"; _ex = "expiration"; _h2 = "http"; _hE2 = "httpError"; _hH = "httpHeader"; _hQ = "httpQuery"; _m = "message"; _rC = "roleCredentials"; _rN = "roleName"; _rn = "role_name"; _s2 = "smithy.ts.sdk.synthetic.com.amazonaws.sso"; _sAK = "secretAccessKey"; _sT = "sessionToken"; _xasbt = "x-amz-sso_bearer_token"; n02 = "com.amazonaws.sso"; _s_registry2 = TypeRegistry.for(_s2); SSOServiceException$ = [-3, _s2, "SSOServiceException", 0, [], []]; _s_registry2.registerError(SSOServiceException$, SSOServiceException); n0_registry2 = TypeRegistry.for(n02); InvalidRequestException$2 = [-3, n02, _IRE2, { [_e2]: _c2, [_hE2]: 400 }, [_m], [0]]; n0_registry2.registerError(InvalidRequestException$2, InvalidRequestException2); ResourceNotFoundException$ = [-3, n02, _RNFE, { [_e2]: _c2, [_hE2]: 404 }, [_m], [0]]; n0_registry2.registerError(ResourceNotFoundException$, ResourceNotFoundException); TooManyRequestsException$ = [-3, n02, _TMRE, { [_e2]: _c2, [_hE2]: 429 }, [_m], [0]]; n0_registry2.registerError(TooManyRequestsException$, TooManyRequestsException); UnauthorizedException$ = [-3, n02, _UE, { [_e2]: _c2, [_hE2]: 401 }, [_m], [0]]; n0_registry2.registerError(UnauthorizedException$, UnauthorizedException); errorTypeRegistries2 = [_s_registry2, n0_registry2]; AccessTokenType = [0, n02, _ATT, 8, 0]; SecretAccessKeyType = [0, n02, _SAKT, 8, 0]; SessionTokenType = [0, n02, _STT, 8, 0]; GetRoleCredentialsRequest$ = [ 3, n02, _GRCR, 0, [_rN, _aI, _aT2], [ [0, { [_hQ]: _rn }], [0, { [_hQ]: _ai }], [() => AccessTokenType, { [_hH]: _xasbt }] ], 3 ]; GetRoleCredentialsResponse$ = [ 3, n02, _GRCRe, 0, [_rC], [[() => RoleCredentials$, 0]] ]; RoleCredentials$ = [ 3, n02, _RC, 0, [_aKI, _sAK, _sT, _ex], [0, [() => SecretAccessKeyType, 0], [() => SessionTokenType, 0], 1] ]; GetRoleCredentials$ = [ 9, n02, _GRC, { [_h2]: ["GET", "/federation/credentials", 200] }, () => GetRoleCredentialsRequest$, () => GetRoleCredentialsResponse$ ]; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.shared.js var import_smithy_client16, import_url_parser3, import_util_base649, import_util_utf89, getRuntimeConfig3; var init_runtimeConfig_shared2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.shared.js"() { init_httpAuthSchemes2(); init_protocols2(); init_dist_es(); import_smithy_client16 = __toESM(require_dist_cjs34()); import_url_parser3 = __toESM(require_dist_cjs18()); import_util_base649 = __toESM(require_dist_cjs10()); import_util_utf89 = __toESM(require_dist_cjs9()); init_httpAuthSchemeProvider2(); init_endpointResolver2(); init_schemas_02(); getRuntimeConfig3 = (config) => { return { apiVersion: "2019-06-10", base64Decoder: config?.base64Decoder ?? import_util_base649.fromBase64, base64Encoder: config?.base64Encoder ?? import_util_base649.toBase64, disableHostPrefix: config?.disableHostPrefix ?? false, endpointProvider: config?.endpointProvider ?? defaultEndpointResolver2, 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 import_smithy_client16.NoOpLogger(), protocol: config?.protocol ?? AwsRestJsonProtocol, protocolSettings: config?.protocolSettings ?? { defaultNamespace: "com.amazonaws.sso", errorTypeRegistries: errorTypeRegistries2, version: "2019-06-10", serviceTarget: "SWBPortalService" }, serviceId: config?.serviceId ?? "SSO", urlParser: config?.urlParser ?? import_url_parser3.parseUrl, utf8Decoder: config?.utf8Decoder ?? import_util_utf89.fromUtf8, utf8Encoder: config?.utf8Encoder ?? import_util_utf89.toUtf8 }; }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js var import_util_user_agent_node2, import_config_resolver3, import_hash_node2, import_middleware_retry3, import_node_config_provider2, import_node_http_handler2, import_smithy_client17, import_util_body_length_node2, import_util_defaults_mode_node2, import_util_retry3, getRuntimeConfig4; var init_runtimeConfig2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeConfig.js"() { init_package(); init_client(); init_httpAuthSchemes2(); import_util_user_agent_node2 = __toESM(require_dist_cjs44()); import_config_resolver3 = __toESM(require_dist_cjs26()); import_hash_node2 = __toESM(require_dist_cjs45()); import_middleware_retry3 = __toESM(require_dist_cjs35()); import_node_config_provider2 = __toESM(require_dist_cjs30()); import_node_http_handler2 = __toESM(require_dist_cjs13()); import_smithy_client17 = __toESM(require_dist_cjs34()); import_util_body_length_node2 = __toESM(require_dist_cjs46()); import_util_defaults_mode_node2 = __toESM(require_dist_cjs47()); import_util_retry3 = __toESM(require_dist_cjs23()); init_runtimeConfig_shared2(); getRuntimeConfig4 = (config) => { (0, import_smithy_client17.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, import_util_defaults_mode_node2.resolveDefaultsModeConfig)(config); const defaultConfigProvider = () => defaultsMode().then(import_smithy_client17.loadConfigsForDefaultMode); const clientSharedValues = getRuntimeConfig3(config); emitWarningIfUnsupportedVersion(process.version); const loaderConfig = { profile: config?.profile, logger: clientSharedValues.logger }; return { ...clientSharedValues, ...config, runtime: "node", defaultsMode, authSchemePreference: config?.authSchemePreference ?? (0, import_node_config_provider2.loadConfig)(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), bodyLengthChecker: config?.bodyLengthChecker ?? import_util_body_length_node2.calculateBodyLength, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, import_util_user_agent_node2.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), maxAttempts: config?.maxAttempts ?? (0, import_node_config_provider2.loadConfig)(import_middleware_retry3.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), region: config?.region ?? (0, import_node_config_provider2.loadConfig)(import_config_resolver3.NODE_REGION_CONFIG_OPTIONS, { ...import_config_resolver3.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), requestHandler: import_node_http_handler2.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? (0, import_node_config_provider2.loadConfig)({ ...import_middleware_retry3.NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || import_util_retry3.DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? import_hash_node2.Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? import_node_http_handler2.streamCollector, useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, import_node_config_provider2.loadConfig)(import_config_resolver3.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), useFipsEndpoint: config?.useFipsEndpoint ?? (0, import_node_config_provider2.loadConfig)(import_config_resolver3.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), userAgentAppId: config?.userAgentAppId ?? (0, import_node_config_provider2.loadConfig)(import_util_user_agent_node2.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) }; }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthExtensionConfiguration.js var getHttpAuthExtensionConfiguration2, resolveHttpAuthRuntimeConfig2; var init_httpAuthExtensionConfiguration2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/auth/httpAuthExtensionConfiguration.js"() { getHttpAuthExtensionConfiguration2 = (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; } }; }; resolveHttpAuthRuntimeConfig2 = (config) => { return { httpAuthSchemes: config.httpAuthSchemes(), httpAuthSchemeProvider: config.httpAuthSchemeProvider(), credentials: config.credentials() }; }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeExtensions.js var import_region_config_resolver2, import_protocol_http13, import_smithy_client18, resolveRuntimeExtensions2; var init_runtimeExtensions2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/runtimeExtensions.js"() { import_region_config_resolver2 = __toESM(require_dist_cjs48()); import_protocol_http13 = __toESM(require_dist_cjs2()); import_smithy_client18 = __toESM(require_dist_cjs34()); init_httpAuthExtensionConfiguration2(); resolveRuntimeExtensions2 = (runtimeConfig, extensions) => { const extensionConfiguration = Object.assign((0, import_region_config_resolver2.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, import_smithy_client18.getDefaultExtensionConfiguration)(runtimeConfig), (0, import_protocol_http13.getHttpHandlerExtensionConfiguration)(runtimeConfig), getHttpAuthExtensionConfiguration2(runtimeConfig)); extensions.forEach((extension) => extension.configure(extensionConfiguration)); return Object.assign(runtimeConfig, (0, import_region_config_resolver2.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, import_smithy_client18.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, import_protocol_http13.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), resolveHttpAuthRuntimeConfig2(extensionConfiguration)); }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSOClient.js var import_middleware_host_header2, import_middleware_logger2, import_middleware_recursion_detection2, import_middleware_user_agent2, import_config_resolver4, import_middleware_content_length2, import_middleware_endpoint3, import_middleware_retry4, import_smithy_client19, SSOClient; var init_SSOClient = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSOClient.js"() { import_middleware_host_header2 = __toESM(require_dist_cjs3()); import_middleware_logger2 = __toESM(require_dist_cjs4()); import_middleware_recursion_detection2 = __toESM(require_dist_cjs5()); import_middleware_user_agent2 = __toESM(require_dist_cjs24()); import_config_resolver4 = __toESM(require_dist_cjs26()); init_dist_es(); init_schema(); import_middleware_content_length2 = __toESM(require_dist_cjs27()); import_middleware_endpoint3 = __toESM(require_dist_cjs32()); import_middleware_retry4 = __toESM(require_dist_cjs35()); import_smithy_client19 = __toESM(require_dist_cjs34()); init_httpAuthSchemeProvider2(); init_EndpointParameters2(); init_runtimeConfig2(); init_runtimeExtensions2(); SSOClient = class extends import_smithy_client19.Client { config; constructor(...[configuration]) { const _config_0 = getRuntimeConfig4(configuration || {}); super(_config_0); this.initConfig = _config_0; const _config_1 = resolveClientEndpointParameters2(_config_0); const _config_2 = (0, import_middleware_user_agent2.resolveUserAgentConfig)(_config_1); const _config_3 = (0, import_middleware_retry4.resolveRetryConfig)(_config_2); const _config_4 = (0, import_config_resolver4.resolveRegionConfig)(_config_3); const _config_5 = (0, import_middleware_host_header2.resolveHostHeaderConfig)(_config_4); const _config_6 = (0, import_middleware_endpoint3.resolveEndpointConfig)(_config_5); const _config_7 = resolveHttpAuthSchemeConfig2(_config_6); const _config_8 = resolveRuntimeExtensions2(_config_7, configuration?.extensions || []); this.config = _config_8; this.middlewareStack.use(getSchemaSerdePlugin(this.config)); this.middlewareStack.use((0, import_middleware_user_agent2.getUserAgentPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_retry4.getRetryPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_content_length2.getContentLengthPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_host_header2.getHostHeaderPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_logger2.getLoggerPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_recursion_detection2.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(); } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/GetRoleCredentialsCommand.js var import_middleware_endpoint4, import_smithy_client20, GetRoleCredentialsCommand; var init_GetRoleCredentialsCommand = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/GetRoleCredentialsCommand.js"() { import_middleware_endpoint4 = __toESM(require_dist_cjs32()); import_smithy_client20 = __toESM(require_dist_cjs34()); init_EndpointParameters2(); init_schemas_02(); GetRoleCredentialsCommand = class extends import_smithy_client20.Command.classBuilder().ep(commonParams2).m(function(Command2, cs, config, o2) { return [(0, import_middleware_endpoint4.getEndpointPlugin)(config, Command2.getEndpointParameterInstructions())]; }).s("SWBPortalService", "GetRoleCredentials", {}).n("SSOClient", "GetRoleCredentialsCommand").sc(GetRoleCredentials$).build() { }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSO.js var import_smithy_client21, commands2, SSO; var init_SSO = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSO.js"() { import_smithy_client21 = __toESM(require_dist_cjs34()); init_GetRoleCredentialsCommand(); init_SSOClient(); commands2 = { GetRoleCredentialsCommand }; SSO = class extends SSOClient { }; (0, import_smithy_client21.createAggregatedClient)(commands2, SSO); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/index.js var init_commands2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/commands/index.js"() { init_GetRoleCredentialsCommand(); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/models_0.js var init_models_02 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/models_0.js"() { } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/index.js var sso_exports = {}; __export(sso_exports, { $Command: () => import_smithy_client20.Command, GetRoleCredentials$: () => GetRoleCredentials$, GetRoleCredentialsCommand: () => GetRoleCredentialsCommand, GetRoleCredentialsRequest$: () => GetRoleCredentialsRequest$, GetRoleCredentialsResponse$: () => GetRoleCredentialsResponse$, InvalidRequestException: () => InvalidRequestException2, InvalidRequestException$: () => InvalidRequestException$2, ResourceNotFoundException: () => ResourceNotFoundException, ResourceNotFoundException$: () => ResourceNotFoundException$, RoleCredentials$: () => RoleCredentials$, SSO: () => SSO, SSOClient: () => SSOClient, SSOServiceException: () => SSOServiceException, SSOServiceException$: () => SSOServiceException$, TooManyRequestsException: () => TooManyRequestsException, TooManyRequestsException$: () => TooManyRequestsException$, UnauthorizedException: () => UnauthorizedException, UnauthorizedException$: () => UnauthorizedException$, __Client: () => import_smithy_client19.Client, errorTypeRegistries: () => errorTypeRegistries2 }); var init_sso = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/index.js"() { init_SSOClient(); init_SSO(); init_commands2(); init_schemas_02(); init_errors2(); init_models_02(); init_SSOServiceException(); } }); // node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js var require_loadSso_BKDNrsal = __commonJS({ "node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-BKDNrsal.js"(exports2) { "use strict"; var sso = (init_sso(), __toCommonJS(sso_exports)); exports2.GetRoleCredentialsCommand = sso.GetRoleCredentialsCommand; exports2.SSOClient = sso.SSOClient; } }); // node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js var require_dist_cjs50 = __commonJS({ "node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js"(exports2) { "use strict"; var propertyProvider = require_dist_cjs28(); var sharedIniFileLoader = require_dist_cjs29(); var client = (init_client(), __toCommonJS(client_exports)); var tokenProviders = require_dist_cjs49(); var isSsoProfile = (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"); var SHOULD_FAIL_CREDENTIAL_CHAIN = false; var resolveSSOCredentials = async ({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig, parentClientConfig, callerClientConfig, profile, filepath, configFilepath, ignoreCache, logger: logger2 }) => { let token; const refreshMessage = `To refresh this SSO session run aws sso login with the corresponding profile.`; if (ssoSession) { try { const _token = await tokenProviders.fromSso({ profile, filepath, configFilepath, ignoreCache })(); token = { accessToken: _token.token, expiresAt: new Date(_token.expiration).toISOString() }; } catch (e5) { throw new propertyProvider.CredentialsProviderError(e5.message, { tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, logger: logger2 }); } } else { try { token = await sharedIniFileLoader.getSSOTokenFromFile(ssoStartUrl); } catch (e5) { throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${refreshMessage}`, { tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, logger: logger2 }); } } if (new Date(token.expiresAt).getTime() - Date.now() <= 0) { throw new propertyProvider.CredentialsProviderError(`The SSO session associated with this profile has expired. ${refreshMessage}`, { tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, logger: logger2 }); } const { accessToken } = token; const { SSOClient: SSOClient2, GetRoleCredentialsCommand: GetRoleCredentialsCommand2 } = await Promise.resolve().then(function() { return require_loadSso_BKDNrsal(); }); const sso = ssoClient || new SSOClient2(Object.assign({}, clientConfig ?? {}, { logger: clientConfig?.logger ?? callerClientConfig?.logger ?? parentClientConfig?.logger, region: clientConfig?.region ?? ssoRegion, userAgentAppId: clientConfig?.userAgentAppId ?? callerClientConfig?.userAgentAppId ?? parentClientConfig?.userAgentAppId })); let ssoResp; try { ssoResp = await sso.send(new GetRoleCredentialsCommand2({ accountId: ssoAccountId, roleName: ssoRoleName, accessToken })); } catch (e5) { throw new propertyProvider.CredentialsProviderError(e5, { tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, logger: logger2 }); } const { roleCredentials: { accessKeyId, secretAccessKey, sessionToken, expiration, credentialScope, accountId } = {} } = ssoResp; if (!accessKeyId || !secretAccessKey || !sessionToken || !expiration) { throw new propertyProvider.CredentialsProviderError("SSO returns an invalid temporary credential.", { tryNextLink: SHOULD_FAIL_CREDENTIAL_CHAIN, logger: logger2 }); } const credentials = { accessKeyId, secretAccessKey, sessionToken, expiration: new Date(expiration), ...credentialScope && { credentialScope }, ...accountId && { accountId } }; if (ssoSession) { client.setCredentialFeature(credentials, "CREDENTIALS_SSO", "s"); } else { client.setCredentialFeature(credentials, "CREDENTIALS_SSO_LEGACY", "u"); } return credentials; }; var validateSsoProfile = (profile, logger2) => { 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 propertyProvider.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: logger2 }); } return profile; }; var fromSSO = (init = {}) => async ({ callerClientConfig } = {}) => { init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO"); const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; const { ssoClient } = init; const profileName = sharedIniFileLoader.getProfileName({ profile: init.profile ?? callerClientConfig?.profile }); if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { const profiles = await sharedIniFileLoader.parseKnownFiles(init); const profile = profiles[profileName]; if (!profile) { throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} was not found.`, { logger: init.logger }); } if (!isSsoProfile(profile)) { throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} is not configured with SSO credentials.`, { logger: init.logger }); } if (profile?.sso_session) { const ssoSessions = await sharedIniFileLoader.loadSsoSessionData(init); 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 propertyProvider.CredentialsProviderError(`Conflicting SSO region` + conflictMsg, { tryNextLink: false, logger: init.logger }); } if (ssoStartUrl && ssoStartUrl !== session.sso_start_url) { throw new propertyProvider.CredentialsProviderError(`Conflicting SSO start_url` + conflictMsg, { tryNextLink: false, logger: init.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, init.logger); return resolveSSOCredentials({ ssoStartUrl: sso_start_url, ssoSession: sso_session, ssoAccountId: sso_account_id, ssoRegion: sso_region, ssoRoleName: sso_role_name, ssoClient, clientConfig: init.clientConfig, parentClientConfig: init.parentClientConfig, callerClientConfig: init.callerClientConfig, profile: profileName, filepath: init.filepath, configFilepath: init.configFilepath, ignoreCache: init.ignoreCache, logger: init.logger }); } else if (!ssoStartUrl || !ssoAccountId || !ssoRegion || !ssoRoleName) { throw new propertyProvider.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"', { tryNextLink: false, logger: init.logger }); } else { return resolveSSOCredentials({ ssoStartUrl, ssoSession, ssoAccountId, ssoRegion, ssoRoleName, ssoClient, clientConfig: init.clientConfig, parentClientConfig: init.parentClientConfig, callerClientConfig: init.callerClientConfig, profile: profileName, filepath: init.filepath, configFilepath: init.configFilepath, ignoreCache: init.ignoreCache, logger: init.logger }); } }; exports2.fromSSO = fromSSO; exports2.isSsoProfile = isSsoProfile; exports2.validateSsoProfile = validateSsoProfile; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js function createAwsAuthSigv4HttpAuthOption3(authParameters) { return { schemeId: "aws.auth#sigv4", signingProperties: { name: "signin", region: authParameters.region }, propertiesExtractor: (config, context) => ({ signingProperties: { config, context } }) }; } function createSmithyApiNoAuthHttpAuthOption3(authParameters) { return { schemeId: "smithy.api#noAuth" }; } var import_util_middleware8, defaultSigninHttpAuthSchemeParametersProvider, defaultSigninHttpAuthSchemeProvider, resolveHttpAuthSchemeConfig3; var init_httpAuthSchemeProvider3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthSchemeProvider.js"() { init_httpAuthSchemes2(); import_util_middleware8 = __toESM(require_dist_cjs6()); defaultSigninHttpAuthSchemeParametersProvider = async (config, context, input) => { return { operation: (0, import_util_middleware8.getSmithyContext)(context).operation, region: await (0, import_util_middleware8.normalizeProvider)(config.region)() || (() => { throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); })() }; }; defaultSigninHttpAuthSchemeProvider = (authParameters) => { const options = []; switch (authParameters.operation) { case "CreateOAuth2Token": { options.push(createSmithyApiNoAuthHttpAuthOption3(authParameters)); break; } default: { options.push(createAwsAuthSigv4HttpAuthOption3(authParameters)); } } return options; }; resolveHttpAuthSchemeConfig3 = (config) => { const config_0 = resolveAwsSdkSigV4Config(config); return Object.assign(config_0, { authSchemePreference: (0, import_util_middleware8.normalizeProvider)(config.authSchemePreference ?? []) }); }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/EndpointParameters.js var resolveClientEndpointParameters3, commonParams3; var init_EndpointParameters3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/EndpointParameters.js"() { resolveClientEndpointParameters3 = (options) => { return Object.assign(options, { useDualstackEndpoint: options.useDualstackEndpoint ?? false, useFipsEndpoint: options.useFipsEndpoint ?? false, defaultSigningName: "signin" }); }; commonParams3 = { UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, Endpoint: { type: "builtInParams", name: "endpoint" }, Region: { type: "builtInParams", name: "region" }, UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js var import_util_endpoints7, m, a3, b3, c3, d3, e3, f3, g3, h3, i3, j3, k3, l, _data3, root3, r3, nodes3, bdd3; var init_bdd3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/bdd.js"() { import_util_endpoints7 = __toESM(require_dist_cjs20()); m = "ref"; a3 = -1; b3 = true; c3 = "isSet"; d3 = "PartitionResult"; e3 = "booleanEquals"; f3 = "getAttr"; g3 = "stringEquals"; h3 = { [m]: "Endpoint" }; i3 = { [m]: d3 }; j3 = { fn: f3, argv: [i3, "name"] }; k3 = {}; l = [{ [m]: "Region" }]; _data3 = { conditions: [ [c3, [h3]], [c3, l], ["aws.partition", l, d3], [e3, [{ [m]: "UseFIPS" }, b3]], [e3, [{ [m]: "UseDualStack" }, b3]], [e3, [{ fn: f3, argv: [i3, "supportsDualStack"] }, b3]], [e3, [{ fn: f3, argv: [i3, "supportsFIPS"] }, b3]], [g3, [j3, "aws"]], [g3, [j3, "aws-cn"]], [g3, [j3, "aws-us-gov"]] ], results: [ [a3], [a3, "Invalid Configuration: FIPS and custom endpoint are not supported"], [a3, "Invalid Configuration: Dualstack and custom endpoint are not supported"], [h3, k3], ["https://{Region}.signin.aws.amazon.com", k3], ["https://{Region}.signin.amazonaws.cn", k3], ["https://{Region}.signin.amazonaws-us-gov.com", k3], ["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", k3], [a3, "FIPS and DualStack are enabled, but this partition does not support one or both"], ["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}", k3], [a3, "FIPS is enabled but this partition does not support FIPS"], ["https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}", k3], [a3, "DualStack is enabled but this partition does not support DualStack"], ["https://signin.{Region}.{PartitionResult#dnsSuffix}", k3], [a3, "Invalid Configuration: Missing Region"] ] }; root3 = 2; r3 = 1e8; nodes3 = new Int32Array([ -1, 1, -1, 0, 15, 3, 1, 4, r3 + 14, 2, 5, r3 + 14, 3, 11, 6, 4, 10, 7, 7, r3 + 4, 8, 8, r3 + 5, 9, 9, r3 + 6, r3 + 13, 5, r3 + 11, r3 + 12, 4, 13, 12, 6, r3 + 9, r3 + 10, 5, 14, r3 + 8, 6, r3 + 7, r3 + 8, 3, r3 + 1, 16, 4, r3 + 2, r3 + 3 ]); bdd3 = import_util_endpoints7.BinaryDecisionDiagram.from(nodes3, root3, _data3.conditions, _data3.results); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js var import_util_endpoints8, import_util_endpoints9, cache3, defaultEndpointResolver3; var init_endpointResolver3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/endpoint/endpointResolver.js"() { import_util_endpoints8 = __toESM(require_dist_cjs21()); import_util_endpoints9 = __toESM(require_dist_cjs20()); init_bdd3(); cache3 = new import_util_endpoints9.EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"] }); defaultEndpointResolver3 = (endpointParams, context = {}) => { return cache3.get(endpointParams, () => (0, import_util_endpoints9.decideEndpoint)(bdd3, { endpointParams, logger: context.logger })); }; import_util_endpoints9.customEndpointFunctions.aws = import_util_endpoints8.awsEndpointFunctions; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js var import_smithy_client22, SigninServiceException; var init_SigninServiceException = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js"() { import_smithy_client22 = __toESM(require_dist_cjs34()); SigninServiceException = class _SigninServiceException extends import_smithy_client22.ServiceException { constructor(options) { super(options); Object.setPrototypeOf(this, _SigninServiceException.prototype); } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js var AccessDeniedException2, InternalServerException2, TooManyRequestsError, ValidationException; var init_errors3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js"() { init_SigninServiceException(); AccessDeniedException2 = class _AccessDeniedException extends SigninServiceException { name = "AccessDeniedException"; $fault = "client"; error; constructor(opts) { super({ name: "AccessDeniedException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _AccessDeniedException.prototype); this.error = opts.error; } }; InternalServerException2 = class _InternalServerException extends SigninServiceException { name = "InternalServerException"; $fault = "server"; error; constructor(opts) { super({ name: "InternalServerException", $fault: "server", ...opts }); Object.setPrototypeOf(this, _InternalServerException.prototype); this.error = opts.error; } }; TooManyRequestsError = class _TooManyRequestsError extends SigninServiceException { name = "TooManyRequestsError"; $fault = "client"; error; constructor(opts) { super({ name: "TooManyRequestsError", $fault: "client", ...opts }); Object.setPrototypeOf(this, _TooManyRequestsError.prototype); this.error = opts.error; } }; ValidationException = class _ValidationException extends SigninServiceException { name = "ValidationException"; $fault = "client"; error; constructor(opts) { super({ name: "ValidationException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _ValidationException.prototype); this.error = opts.error; } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js var _ADE2, _AT2, _COAT, _COATR, _COATRB, _COATRBr, _COATRr, _ISE2, _RT2, _TMRE2, _VE, _aKI2, _aT3, _c3, _cI2, _cV2, _co2, _e3, _eI2, _gT2, _h3, _hE3, _iT2, _jN, _m2, _rT2, _rU2, _s3, _sAK2, _sT2, _se2, _tI, _tO, _tT2, n03, _s_registry3, SigninServiceException$, n0_registry3, AccessDeniedException$2, InternalServerException$2, TooManyRequestsError$, ValidationException$, errorTypeRegistries3, RefreshToken2, AccessToken$, CreateOAuth2TokenRequest$, CreateOAuth2TokenRequestBody$, CreateOAuth2TokenResponse$, CreateOAuth2TokenResponseBody$, CreateOAuth2Token$; var init_schemas_03 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js"() { init_schema(); init_errors3(); init_SigninServiceException(); _ADE2 = "AccessDeniedException"; _AT2 = "AccessToken"; _COAT = "CreateOAuth2Token"; _COATR = "CreateOAuth2TokenRequest"; _COATRB = "CreateOAuth2TokenRequestBody"; _COATRBr = "CreateOAuth2TokenResponseBody"; _COATRr = "CreateOAuth2TokenResponse"; _ISE2 = "InternalServerException"; _RT2 = "RefreshToken"; _TMRE2 = "TooManyRequestsError"; _VE = "ValidationException"; _aKI2 = "accessKeyId"; _aT3 = "accessToken"; _c3 = "client"; _cI2 = "clientId"; _cV2 = "codeVerifier"; _co2 = "code"; _e3 = "error"; _eI2 = "expiresIn"; _gT2 = "grantType"; _h3 = "http"; _hE3 = "httpError"; _iT2 = "idToken"; _jN = "jsonName"; _m2 = "message"; _rT2 = "refreshToken"; _rU2 = "redirectUri"; _s3 = "smithy.ts.sdk.synthetic.com.amazonaws.signin"; _sAK2 = "secretAccessKey"; _sT2 = "sessionToken"; _se2 = "server"; _tI = "tokenInput"; _tO = "tokenOutput"; _tT2 = "tokenType"; n03 = "com.amazonaws.signin"; _s_registry3 = TypeRegistry.for(_s3); SigninServiceException$ = [-3, _s3, "SigninServiceException", 0, [], []]; _s_registry3.registerError(SigninServiceException$, SigninServiceException); n0_registry3 = TypeRegistry.for(n03); AccessDeniedException$2 = [-3, n03, _ADE2, { [_e3]: _c3 }, [_e3, _m2], [0, 0], 2]; n0_registry3.registerError(AccessDeniedException$2, AccessDeniedException2); InternalServerException$2 = [-3, n03, _ISE2, { [_e3]: _se2, [_hE3]: 500 }, [_e3, _m2], [0, 0], 2]; n0_registry3.registerError(InternalServerException$2, InternalServerException2); TooManyRequestsError$ = [-3, n03, _TMRE2, { [_e3]: _c3, [_hE3]: 429 }, [_e3, _m2], [0, 0], 2]; n0_registry3.registerError(TooManyRequestsError$, TooManyRequestsError); ValidationException$ = [-3, n03, _VE, { [_e3]: _c3, [_hE3]: 400 }, [_e3, _m2], [0, 0], 2]; n0_registry3.registerError(ValidationException$, ValidationException); errorTypeRegistries3 = [_s_registry3, n0_registry3]; RefreshToken2 = [0, n03, _RT2, 8, 0]; AccessToken$ = [ 3, n03, _AT2, 8, [_aKI2, _sAK2, _sT2], [ [0, { [_jN]: _aKI2 }], [0, { [_jN]: _sAK2 }], [0, { [_jN]: _sT2 }] ], 3 ]; CreateOAuth2TokenRequest$ = [ 3, n03, _COATR, 0, [_tI], [[() => CreateOAuth2TokenRequestBody$, 16]], 1 ]; CreateOAuth2TokenRequestBody$ = [ 3, n03, _COATRB, 0, [_cI2, _gT2, _co2, _rU2, _cV2, _rT2], [ [0, { [_jN]: _cI2 }], [0, { [_jN]: _gT2 }], 0, [0, { [_jN]: _rU2 }], [0, { [_jN]: _cV2 }], [() => RefreshToken2, { [_jN]: _rT2 }] ], 2 ]; CreateOAuth2TokenResponse$ = [ 3, n03, _COATRr, 0, [_tO], [[() => CreateOAuth2TokenResponseBody$, 16]], 1 ]; CreateOAuth2TokenResponseBody$ = [ 3, n03, _COATRBr, 0, [_aT3, _tT2, _eI2, _rT2, _iT2], [ [() => AccessToken$, { [_jN]: _aT3 }], [0, { [_jN]: _tT2 }], [1, { [_jN]: _eI2 }], [() => RefreshToken2, { [_jN]: _rT2 }], [0, { [_jN]: _iT2 }] ], 4 ]; CreateOAuth2Token$ = [ 9, n03, _COAT, { [_h3]: ["POST", "/v1/token", 200] }, () => CreateOAuth2TokenRequest$, () => CreateOAuth2TokenResponse$ ]; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.shared.js var import_smithy_client23, import_url_parser4, import_util_base6410, import_util_utf810, getRuntimeConfig5; var init_runtimeConfig_shared3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.shared.js"() { init_httpAuthSchemes2(); init_protocols2(); init_dist_es(); import_smithy_client23 = __toESM(require_dist_cjs34()); import_url_parser4 = __toESM(require_dist_cjs18()); import_util_base6410 = __toESM(require_dist_cjs10()); import_util_utf810 = __toESM(require_dist_cjs9()); init_httpAuthSchemeProvider3(); init_endpointResolver3(); init_schemas_03(); getRuntimeConfig5 = (config) => { return { apiVersion: "2023-01-01", base64Decoder: config?.base64Decoder ?? import_util_base6410.fromBase64, base64Encoder: config?.base64Encoder ?? import_util_base6410.toBase64, disableHostPrefix: config?.disableHostPrefix ?? false, endpointProvider: config?.endpointProvider ?? defaultEndpointResolver3, extensions: config?.extensions ?? [], httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSigninHttpAuthSchemeProvider, 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 import_smithy_client23.NoOpLogger(), protocol: config?.protocol ?? AwsRestJsonProtocol, protocolSettings: config?.protocolSettings ?? { defaultNamespace: "com.amazonaws.signin", errorTypeRegistries: errorTypeRegistries3, version: "2023-01-01", serviceTarget: "Signin" }, serviceId: config?.serviceId ?? "Signin", urlParser: config?.urlParser ?? import_url_parser4.parseUrl, utf8Decoder: config?.utf8Decoder ?? import_util_utf810.fromUtf8, utf8Encoder: config?.utf8Encoder ?? import_util_utf810.toUtf8 }; }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js var import_util_user_agent_node3, import_config_resolver5, import_hash_node3, import_middleware_retry5, import_node_config_provider3, import_node_http_handler3, import_smithy_client24, import_util_body_length_node3, import_util_defaults_mode_node3, import_util_retry4, getRuntimeConfig6; var init_runtimeConfig3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeConfig.js"() { init_package(); init_client(); init_httpAuthSchemes2(); import_util_user_agent_node3 = __toESM(require_dist_cjs44()); import_config_resolver5 = __toESM(require_dist_cjs26()); import_hash_node3 = __toESM(require_dist_cjs45()); import_middleware_retry5 = __toESM(require_dist_cjs35()); import_node_config_provider3 = __toESM(require_dist_cjs30()); import_node_http_handler3 = __toESM(require_dist_cjs13()); import_smithy_client24 = __toESM(require_dist_cjs34()); import_util_body_length_node3 = __toESM(require_dist_cjs46()); import_util_defaults_mode_node3 = __toESM(require_dist_cjs47()); import_util_retry4 = __toESM(require_dist_cjs23()); init_runtimeConfig_shared3(); getRuntimeConfig6 = (config) => { (0, import_smithy_client24.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, import_util_defaults_mode_node3.resolveDefaultsModeConfig)(config); const defaultConfigProvider = () => defaultsMode().then(import_smithy_client24.loadConfigsForDefaultMode); const clientSharedValues = getRuntimeConfig5(config); emitWarningIfUnsupportedVersion(process.version); const loaderConfig = { profile: config?.profile, logger: clientSharedValues.logger }; return { ...clientSharedValues, ...config, runtime: "node", defaultsMode, authSchemePreference: config?.authSchemePreference ?? (0, import_node_config_provider3.loadConfig)(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), bodyLengthChecker: config?.bodyLengthChecker ?? import_util_body_length_node3.calculateBodyLength, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, import_util_user_agent_node3.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), maxAttempts: config?.maxAttempts ?? (0, import_node_config_provider3.loadConfig)(import_middleware_retry5.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), region: config?.region ?? (0, import_node_config_provider3.loadConfig)(import_config_resolver5.NODE_REGION_CONFIG_OPTIONS, { ...import_config_resolver5.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), requestHandler: import_node_http_handler3.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? (0, import_node_config_provider3.loadConfig)({ ...import_middleware_retry5.NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || import_util_retry4.DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? import_hash_node3.Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? import_node_http_handler3.streamCollector, useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, import_node_config_provider3.loadConfig)(import_config_resolver5.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), useFipsEndpoint: config?.useFipsEndpoint ?? (0, import_node_config_provider3.loadConfig)(import_config_resolver5.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), userAgentAppId: config?.userAgentAppId ?? (0, import_node_config_provider3.loadConfig)(import_util_user_agent_node3.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) }; }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthExtensionConfiguration.js var getHttpAuthExtensionConfiguration3, resolveHttpAuthRuntimeConfig3; var init_httpAuthExtensionConfiguration3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/auth/httpAuthExtensionConfiguration.js"() { getHttpAuthExtensionConfiguration3 = (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; } }; }; resolveHttpAuthRuntimeConfig3 = (config) => { return { httpAuthSchemes: config.httpAuthSchemes(), httpAuthSchemeProvider: config.httpAuthSchemeProvider(), credentials: config.credentials() }; }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeExtensions.js var import_region_config_resolver3, import_protocol_http14, import_smithy_client25, resolveRuntimeExtensions3; var init_runtimeExtensions3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/runtimeExtensions.js"() { import_region_config_resolver3 = __toESM(require_dist_cjs48()); import_protocol_http14 = __toESM(require_dist_cjs2()); import_smithy_client25 = __toESM(require_dist_cjs34()); init_httpAuthExtensionConfiguration3(); resolveRuntimeExtensions3 = (runtimeConfig, extensions) => { const extensionConfiguration = Object.assign((0, import_region_config_resolver3.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, import_smithy_client25.getDefaultExtensionConfiguration)(runtimeConfig), (0, import_protocol_http14.getHttpHandlerExtensionConfiguration)(runtimeConfig), getHttpAuthExtensionConfiguration3(runtimeConfig)); extensions.forEach((extension) => extension.configure(extensionConfiguration)); return Object.assign(runtimeConfig, (0, import_region_config_resolver3.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, import_smithy_client25.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, import_protocol_http14.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), resolveHttpAuthRuntimeConfig3(extensionConfiguration)); }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js var import_middleware_host_header3, import_middleware_logger3, import_middleware_recursion_detection3, import_middleware_user_agent3, import_config_resolver6, import_middleware_content_length3, import_middleware_endpoint5, import_middleware_retry6, import_smithy_client26, SigninClient; var init_SigninClient = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js"() { import_middleware_host_header3 = __toESM(require_dist_cjs3()); import_middleware_logger3 = __toESM(require_dist_cjs4()); import_middleware_recursion_detection3 = __toESM(require_dist_cjs5()); import_middleware_user_agent3 = __toESM(require_dist_cjs24()); import_config_resolver6 = __toESM(require_dist_cjs26()); init_dist_es(); init_schema(); import_middleware_content_length3 = __toESM(require_dist_cjs27()); import_middleware_endpoint5 = __toESM(require_dist_cjs32()); import_middleware_retry6 = __toESM(require_dist_cjs35()); import_smithy_client26 = __toESM(require_dist_cjs34()); init_httpAuthSchemeProvider3(); init_EndpointParameters3(); init_runtimeConfig3(); init_runtimeExtensions3(); SigninClient = class extends import_smithy_client26.Client { config; constructor(...[configuration]) { const _config_0 = getRuntimeConfig6(configuration || {}); super(_config_0); this.initConfig = _config_0; const _config_1 = resolveClientEndpointParameters3(_config_0); const _config_2 = (0, import_middleware_user_agent3.resolveUserAgentConfig)(_config_1); const _config_3 = (0, import_middleware_retry6.resolveRetryConfig)(_config_2); const _config_4 = (0, import_config_resolver6.resolveRegionConfig)(_config_3); const _config_5 = (0, import_middleware_host_header3.resolveHostHeaderConfig)(_config_4); const _config_6 = (0, import_middleware_endpoint5.resolveEndpointConfig)(_config_5); const _config_7 = resolveHttpAuthSchemeConfig3(_config_6); const _config_8 = resolveRuntimeExtensions3(_config_7, configuration?.extensions || []); this.config = _config_8; this.middlewareStack.use(getSchemaSerdePlugin(this.config)); this.middlewareStack.use((0, import_middleware_user_agent3.getUserAgentPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_retry6.getRetryPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_content_length3.getContentLengthPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_host_header3.getHostHeaderPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_logger3.getLoggerPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_recursion_detection3.getRecursionDetectionPlugin)(this.config)); this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { httpAuthSchemeParametersProvider: defaultSigninHttpAuthSchemeParametersProvider, identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({ "aws.auth#sigv4": config.credentials }) })); this.middlewareStack.use(getHttpSigningPlugin(this.config)); } destroy() { super.destroy(); } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js var import_middleware_endpoint6, import_smithy_client27, CreateOAuth2TokenCommand; var init_CreateOAuth2TokenCommand = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/CreateOAuth2TokenCommand.js"() { import_middleware_endpoint6 = __toESM(require_dist_cjs32()); import_smithy_client27 = __toESM(require_dist_cjs34()); init_EndpointParameters3(); init_schemas_03(); CreateOAuth2TokenCommand = class extends import_smithy_client27.Command.classBuilder().ep(commonParams3).m(function(Command2, cs, config, o2) { return [(0, import_middleware_endpoint6.getEndpointPlugin)(config, Command2.getEndpointParameterInstructions())]; }).s("Signin", "CreateOAuth2Token", {}).n("SigninClient", "CreateOAuth2TokenCommand").sc(CreateOAuth2Token$).build() { }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/Signin.js var import_smithy_client28, commands3, Signin; var init_Signin = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/Signin.js"() { import_smithy_client28 = __toESM(require_dist_cjs34()); init_CreateOAuth2TokenCommand(); init_SigninClient(); commands3 = { CreateOAuth2TokenCommand }; Signin = class extends SigninClient { }; (0, import_smithy_client28.createAggregatedClient)(commands3, Signin); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/index.js var init_commands3 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/commands/index.js"() { init_CreateOAuth2TokenCommand(); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js var OAuth2ErrorCode; var init_enums2 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/enums.js"() { OAuth2ErrorCode = { AUTHCODE_EXPIRED: "AUTHCODE_EXPIRED", INSUFFICIENT_PERMISSIONS: "INSUFFICIENT_PERMISSIONS", INVALID_REQUEST: "INVALID_REQUEST", SERVER_ERROR: "server_error", TOKEN_EXPIRED: "TOKEN_EXPIRED", USER_CREDENTIALS_CHANGED: "USER_CREDENTIALS_CHANGED" }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/models_0.js var init_models_03 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/models_0.js"() { } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/index.js var signin_exports = {}; __export(signin_exports, { $Command: () => import_smithy_client27.Command, AccessDeniedException: () => AccessDeniedException2, AccessDeniedException$: () => AccessDeniedException$2, AccessToken$: () => AccessToken$, CreateOAuth2Token$: () => CreateOAuth2Token$, CreateOAuth2TokenCommand: () => CreateOAuth2TokenCommand, CreateOAuth2TokenRequest$: () => CreateOAuth2TokenRequest$, CreateOAuth2TokenRequestBody$: () => CreateOAuth2TokenRequestBody$, CreateOAuth2TokenResponse$: () => CreateOAuth2TokenResponse$, CreateOAuth2TokenResponseBody$: () => CreateOAuth2TokenResponseBody$, InternalServerException: () => InternalServerException2, InternalServerException$: () => InternalServerException$2, OAuth2ErrorCode: () => OAuth2ErrorCode, Signin: () => Signin, SigninClient: () => SigninClient, SigninServiceException: () => SigninServiceException, SigninServiceException$: () => SigninServiceException$, TooManyRequestsError: () => TooManyRequestsError, TooManyRequestsError$: () => TooManyRequestsError$, ValidationException: () => ValidationException, ValidationException$: () => ValidationException$, __Client: () => import_smithy_client26.Client, errorTypeRegistries: () => errorTypeRegistries3 }); var init_signin = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/index.js"() { init_SigninClient(); init_Signin(); init_commands3(); init_schemas_03(); init_enums2(); init_errors3(); init_models_03(); init_SigninServiceException(); } }); // node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js var require_dist_cjs51 = __commonJS({ "node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js"(exports2) { "use strict"; var client = (init_client(), __toCommonJS(client_exports)); var propertyProvider = require_dist_cjs28(); var sharedIniFileLoader = require_dist_cjs29(); var protocolHttp = require_dist_cjs2(); var node_crypto = require("node:crypto"); var node_fs = require("node:fs"); var node_os = require("node:os"); var node_path = require("node:path"); var LoginCredentialsFetcher = class _LoginCredentialsFetcher { profileData; init; callerClientConfig; static REFRESH_THRESHOLD = 5 * 60 * 1e3; constructor(profileData, init, callerClientConfig) { this.profileData = profileData; this.init = init; this.callerClientConfig = callerClientConfig; } async loadCredentials() { const token = await this.loadToken(); if (!token) { throw new propertyProvider.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`, { tryNextLink: false, logger: this.logger }); } const accessToken = token.accessToken; const now = Date.now(); const expiryTime = new Date(accessToken.expiresAt).getTime(); const timeUntilExpiry = expiryTime - now; if (timeUntilExpiry <= _LoginCredentialsFetcher.REFRESH_THRESHOLD) { return this.refresh(token); } return { accessKeyId: accessToken.accessKeyId, secretAccessKey: accessToken.secretAccessKey, sessionToken: accessToken.sessionToken, accountId: accessToken.accountId, expiration: new Date(accessToken.expiresAt) }; } get logger() { return this.init?.logger; } get loginSession() { return this.profileData.login_session; } async refresh(token) { const { SigninClient: SigninClient2, CreateOAuth2TokenCommand: CreateOAuth2TokenCommand2 } = await Promise.resolve().then(() => (init_signin(), signin_exports)); const { logger: logger2, userAgentAppId } = this.callerClientConfig ?? {}; const isH22 = (requestHandler2) => { return requestHandler2?.metadata?.handlerProtocol === "h2"; }; const requestHandler = isH22(this.callerClientConfig?.requestHandler) ? void 0 : this.callerClientConfig?.requestHandler; const region = this.profileData.region ?? await this.callerClientConfig?.region?.() ?? process.env.AWS_REGION; const client2 = new SigninClient2({ credentials: { accessKeyId: "", secretAccessKey: "" }, region, requestHandler, logger: logger2, userAgentAppId, ...this.init?.clientConfig }); this.createDPoPInterceptor(client2.middlewareStack); const commandInput = { tokenInput: { clientId: token.clientId, refreshToken: token.refreshToken, grantType: "refresh_token" } }; try { const response = await client2.send(new CreateOAuth2TokenCommand2(commandInput)); const { accessKeyId, secretAccessKey, sessionToken } = response.tokenOutput?.accessToken ?? {}; const { refreshToken, expiresIn } = response.tokenOutput ?? {}; if (!accessKeyId || !secretAccessKey || !sessionToken || !refreshToken) { throw new propertyProvider.CredentialsProviderError("Token refresh response missing required fields", { logger: this.logger, tryNextLink: false }); } const expiresInMs = (expiresIn ?? 900) * 1e3; const expiration = new Date(Date.now() + expiresInMs); const updatedToken = { ...token, accessToken: { ...token.accessToken, accessKeyId, secretAccessKey, sessionToken, expiresAt: expiration.toISOString() }, refreshToken }; await this.saveToken(updatedToken); const newAccessToken = updatedToken.accessToken; return { accessKeyId: newAccessToken.accessKeyId, secretAccessKey: newAccessToken.secretAccessKey, sessionToken: newAccessToken.sessionToken, accountId: newAccessToken.accountId, expiration }; } catch (error3) { if (error3.name === "AccessDeniedException") { const errorType = error3.error; let message; switch (errorType) { case "TOKEN_EXPIRED": message = "Your session has expired. Please reauthenticate."; break; case "USER_CREDENTIALS_CHANGED": message = "Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password."; break; case "INSUFFICIENT_PERMISSIONS": message = "Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action."; break; default: message = `Failed to refresh token: ${String(error3)}. Please re-authenticate using \`aws login\``; } throw new propertyProvider.CredentialsProviderError(message, { logger: this.logger, tryNextLink: false }); } throw new propertyProvider.CredentialsProviderError(`Failed to refresh token: ${String(error3)}. Please re-authenticate using aws login`, { logger: this.logger }); } } async loadToken() { const tokenFilePath = this.getTokenFilePath(); try { let tokenData; try { tokenData = await sharedIniFileLoader.readFile(tokenFilePath, { ignoreCache: this.init?.ignoreCache }); } catch { tokenData = await node_fs.promises.readFile(tokenFilePath, "utf8"); } const token = JSON.parse(tokenData); const missingFields = ["accessToken", "clientId", "refreshToken", "dpopKey"].filter((k5) => !token[k5]); if (!token.accessToken?.accountId) { missingFields.push("accountId"); } if (missingFields.length > 0) { throw new propertyProvider.CredentialsProviderError(`Token validation failed, missing fields: ${missingFields.join(", ")}`, { logger: this.logger, tryNextLink: false }); } return token; } catch (error3) { throw new propertyProvider.CredentialsProviderError(`Failed to load token from ${tokenFilePath}: ${String(error3)}`, { logger: this.logger, tryNextLink: false }); } } async saveToken(token) { const tokenFilePath = this.getTokenFilePath(); const directory = node_path.dirname(tokenFilePath); try { await node_fs.promises.mkdir(directory, { recursive: true }); } catch (error3) { } await node_fs.promises.writeFile(tokenFilePath, JSON.stringify(token, null, 2), "utf8"); } getTokenFilePath() { const directory = process.env.AWS_LOGIN_CACHE_DIRECTORY ?? node_path.join(node_os.homedir(), ".aws", "login", "cache"); const loginSessionBytes = Buffer.from(this.loginSession, "utf8"); const loginSessionSha256 = node_crypto.createHash("sha256").update(loginSessionBytes).digest("hex"); return node_path.join(directory, `${loginSessionSha256}.json`); } derToRawSignature(derSignature) { let offset = 2; if (derSignature[offset] !== 2) { throw new Error("Invalid DER signature"); } offset++; const rLength = derSignature[offset++]; let r5 = derSignature.subarray(offset, offset + rLength); offset += rLength; if (derSignature[offset] !== 2) { throw new Error("Invalid DER signature"); } offset++; const sLength = derSignature[offset++]; let s = derSignature.subarray(offset, offset + sLength); r5 = r5[0] === 0 ? r5.subarray(1) : r5; s = s[0] === 0 ? s.subarray(1) : s; const rPadded = Buffer.concat([Buffer.alloc(32 - r5.length), r5]); const sPadded = Buffer.concat([Buffer.alloc(32 - s.length), s]); return Buffer.concat([rPadded, sPadded]); } createDPoPInterceptor(middlewareStack) { middlewareStack.add((next) => async (args) => { if (protocolHttp.HttpRequest.isInstance(args.request)) { const request = args.request; const actualEndpoint = `${request.protocol}//${request.hostname}${request.port ? `:${request.port}` : ""}${request.path}`; const dpop = await this.generateDpop(request.method, actualEndpoint); request.headers = { ...request.headers, DPoP: dpop }; } return next(args); }, { step: "finalizeRequest", name: "dpopInterceptor", override: true }); } async generateDpop(method = "POST", endpoint) { const token = await this.loadToken(); try { const privateKey = node_crypto.createPrivateKey({ key: token.dpopKey, format: "pem", type: "sec1" }); const publicKey = node_crypto.createPublicKey(privateKey); const publicDer = publicKey.export({ format: "der", type: "spki" }); let pointStart = -1; for (let i5 = 0; i5 < publicDer.length; i5++) { if (publicDer[i5] === 4) { pointStart = i5; break; } } const x = publicDer.slice(pointStart + 1, pointStart + 33); const y = publicDer.slice(pointStart + 33, pointStart + 65); const header = { alg: "ES256", typ: "dpop+jwt", jwk: { kty: "EC", crv: "P-256", x: x.toString("base64url"), y: y.toString("base64url") } }; const payload2 = { jti: crypto.randomUUID(), htm: method, htu: endpoint, iat: Math.floor(Date.now() / 1e3) }; const headerB64 = Buffer.from(JSON.stringify(header)).toString("base64url"); const payloadB64 = Buffer.from(JSON.stringify(payload2)).toString("base64url"); const message = `${headerB64}.${payloadB64}`; const asn1Signature = node_crypto.sign("sha256", Buffer.from(message), privateKey); const rawSignature = this.derToRawSignature(asn1Signature); const signatureB64 = rawSignature.toString("base64url"); return `${message}.${signatureB64}`; } catch (error3) { throw new propertyProvider.CredentialsProviderError(`Failed to generate Dpop proof: ${error3 instanceof Error ? error3.message : String(error3)}`, { logger: this.logger, tryNextLink: false }); } } }; var fromLoginCredentials = (init) => async ({ callerClientConfig } = {}) => { init?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials"); const profiles = await sharedIniFileLoader.parseKnownFiles(init || {}); const profileName = sharedIniFileLoader.getProfileName({ profile: init?.profile ?? callerClientConfig?.profile }); const profile = profiles[profileName]; if (!profile?.login_session) { throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} does not contain login_session.`, { tryNextLink: true, logger: init?.logger }); } const fetcher = new LoginCredentialsFetcher(profile, init, callerClientConfig); const credentials = await fetcher.loadCredentials(); return client.setCredentialFeature(credentials, "CREDENTIALS_LOGIN", "AD"); }; exports2.fromLoginCredentials = fromLoginCredentials; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/bdd.js var import_util_endpoints10, q, a4, b4, c4, d4, e4, f4, g4, h4, i4, j4, k4, l2, m2, n, o, p, _data4, root4, r4, nodes4, bdd4; var init_bdd4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/bdd.js"() { import_util_endpoints10 = __toESM(require_dist_cjs20()); q = "ref"; a4 = -1; b4 = true; c4 = "isSet"; d4 = "PartitionResult"; e4 = "booleanEquals"; f4 = "stringEquals"; g4 = "getAttr"; h4 = "us-east-1"; i4 = "sigv4"; j4 = "sts"; k4 = "https://sts.{Region}.{PartitionResult#dnsSuffix}"; l2 = { [q]: "Endpoint" }; m2 = { [q]: "Region" }; n = { [q]: d4 }; o = {}; p = [m2]; _data4 = { conditions: [ [c4, [l2]], [c4, p], ["aws.partition", p, d4], [e4, [{ [q]: "UseFIPS" }, b4]], [e4, [{ [q]: "UseDualStack" }, b4]], [f4, [m2, "aws-global"]], [e4, [{ [q]: "UseGlobalEndpoint" }, b4]], [f4, [m2, "eu-central-1"]], [e4, [{ fn: g4, argv: [n, "supportsDualStack"] }, b4]], [e4, [{ fn: g4, argv: [n, "supportsFIPS"] }, b4]], [f4, [m2, "ap-south-1"]], [f4, [m2, "eu-north-1"]], [f4, [m2, "eu-west-1"]], [f4, [m2, "eu-west-2"]], [f4, [m2, "eu-west-3"]], [f4, [m2, "sa-east-1"]], [f4, [m2, h4]], [f4, [m2, "us-east-2"]], [f4, [m2, "us-west-2"]], [f4, [m2, "us-west-1"]], [f4, [m2, "ca-central-1"]], [f4, [m2, "ap-southeast-1"]], [f4, [m2, "ap-northeast-1"]], [f4, [m2, "ap-southeast-2"]], [f4, [{ fn: g4, argv: [n, "name"] }, "aws-us-gov"]] ], results: [ [a4], ["https://sts.amazonaws.com", { authSchemes: [{ name: i4, signingName: j4, signingRegion: h4 }] }], [k4, { authSchemes: [{ name: i4, signingName: j4, signingRegion: "{Region}" }] }], [a4, "Invalid Configuration: FIPS and custom endpoint are not supported"], [a4, "Invalid Configuration: Dualstack and custom endpoint are not supported"], [l2, o], ["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", o], [a4, "FIPS and DualStack are enabled, but this partition does not support one or both"], ["https://sts.{Region}.amazonaws.com", o], ["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", o], [a4, "FIPS is enabled but this partition does not support FIPS"], ["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", o], [a4, "DualStack is enabled but this partition does not support DualStack"], [k4, o], [a4, "Invalid Configuration: Missing Region"] ] }; root4 = 2; r4 = 1e8; nodes4 = new Int32Array([ -1, 1, -1, 0, 30, 3, 1, 4, r4 + 14, 2, 5, r4 + 14, 3, 25, 6, 4, 24, 7, 5, r4 + 1, 8, 6, 9, r4 + 13, 7, r4 + 1, 10, 10, r4 + 1, 11, 11, r4 + 1, 12, 12, r4 + 1, 13, 13, r4 + 1, 14, 14, r4 + 1, 15, 15, r4 + 1, 16, 16, r4 + 1, 17, 17, r4 + 1, 18, 18, r4 + 1, 19, 19, r4 + 1, 20, 20, r4 + 1, 21, 21, r4 + 1, 22, 22, r4 + 1, 23, 23, r4 + 1, r4 + 2, 8, r4 + 11, r4 + 12, 4, 28, 26, 9, 27, r4 + 10, 24, r4 + 8, r4 + 9, 8, 29, r4 + 7, 9, r4 + 6, r4 + 7, 3, r4 + 3, 31, 4, r4 + 4, r4 + 5 ]); bdd4 = import_util_endpoints10.BinaryDecisionDiagram.from(nodes4, root4, _data4.conditions, _data4.results); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js var import_util_endpoints11, import_util_endpoints12, cache4, defaultEndpointResolver4; var init_endpointResolver4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/endpointResolver.js"() { import_util_endpoints11 = __toESM(require_dist_cjs21()); import_util_endpoints12 = __toESM(require_dist_cjs20()); init_bdd4(); cache4 = new import_util_endpoints12.EndpointCache({ size: 50, params: ["Endpoint", "Region", "UseDualStack", "UseFIPS", "UseGlobalEndpoint"] }); defaultEndpointResolver4 = (endpointParams, context = {}) => { return cache4.get(endpointParams, () => (0, import_util_endpoints12.decideEndpoint)(bdd4, { endpointParams, logger: context.logger })); }; import_util_endpoints12.customEndpointFunctions.aws = import_util_endpoints11.awsEndpointFunctions; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js function createAwsAuthSigv4HttpAuthOption4(authParameters) { return { schemeId: "aws.auth#sigv4", signingProperties: { name: "sts", region: authParameters.region }, propertiesExtractor: (config, context) => ({ signingProperties: { config, context } }) }; } function createAwsAuthSigv4aHttpAuthOption(authParameters) { return { schemeId: "aws.auth#sigv4a", signingProperties: { name: "sts", region: authParameters.region }, propertiesExtractor: (config, context) => ({ signingProperties: { config, context } }) }; } function createSmithyApiNoAuthHttpAuthOption4(authParameters) { return { schemeId: "smithy.api#noAuth" }; } var import_signature_v4_multi_region, import_middleware_endpoint7, import_util_middleware9, createEndpointRuleSetHttpAuthSchemeParametersProvider, _defaultSTSHttpAuthSchemeParametersProvider, defaultSTSHttpAuthSchemeParametersProvider, createEndpointRuleSetHttpAuthSchemeProvider, _defaultSTSHttpAuthSchemeProvider, defaultSTSHttpAuthSchemeProvider, resolveStsAuthConfig, resolveHttpAuthSchemeConfig4; var init_httpAuthSchemeProvider4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthSchemeProvider.js"() { init_httpAuthSchemes2(); import_signature_v4_multi_region = __toESM(require_dist_cjs40()); import_middleware_endpoint7 = __toESM(require_dist_cjs32()); import_util_middleware9 = __toESM(require_dist_cjs6()); init_endpointResolver4(); init_STSClient(); createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => { if (!input) { throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`"); } const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input); const instructionsFn = (0, import_util_middleware9.getSmithyContext)(context)?.commandInstance?.constructor?.getEndpointParameterInstructions; if (!instructionsFn) { throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`); } const endpointParameters = await (0, import_middleware_endpoint7.resolveParams)(input, { getEndpointParameterInstructions: instructionsFn }, config); return Object.assign(defaultParameters, endpointParameters); }; _defaultSTSHttpAuthSchemeParametersProvider = async (config, context, input) => { return { operation: (0, import_util_middleware9.getSmithyContext)(context).operation, region: await (0, import_util_middleware9.normalizeProvider)(config.region)() || (() => { throw new Error("expected `region` to be configured for `aws.auth#sigv4`"); })() }; }; defaultSTSHttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultSTSHttpAuthSchemeParametersProvider); createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver5, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => { const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => { const endpoint = defaultEndpointResolver5(authParameters); const authSchemes = endpoint.properties?.authSchemes; if (!authSchemes) { return defaultHttpAuthSchemeResolver(authParameters); } const options = []; for (const scheme of authSchemes) { const { name: resolvedName, properties = {}, ...rest } = scheme; const name = resolvedName.toLowerCase(); if (resolvedName !== name) { console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`); } let schemeId; if (name === "sigv4a") { schemeId = "aws.auth#sigv4a"; const sigv4Present = authSchemes.find((s) => { const name2 = s.name.toLowerCase(); return name2 !== "sigv4a" && name2.startsWith("sigv4"); }); if (import_signature_v4_multi_region.SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) { continue; } } else if (name.startsWith("sigv4")) { schemeId = "aws.auth#sigv4"; } else { throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`); } const createOption = createHttpAuthOptionFunctions[schemeId]; if (!createOption) { throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`); } const option = createOption(authParameters); option.schemeId = schemeId; option.signingProperties = { ...option.signingProperties || {}, ...rest, ...properties }; options.push(option); } return options; }; return endpointRuleSetHttpAuthSchemeProvider; }; _defaultSTSHttpAuthSchemeProvider = (authParameters) => { const options = []; switch (authParameters.operation) { case "AssumeRoleWithWebIdentity": { options.push(createSmithyApiNoAuthHttpAuthOption4(authParameters)); options.push(createAwsAuthSigv4aHttpAuthOption(authParameters)); break; } default: { options.push(createAwsAuthSigv4HttpAuthOption4(authParameters)); options.push(createAwsAuthSigv4aHttpAuthOption(authParameters)); } } return options; }; defaultSTSHttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver4, _defaultSTSHttpAuthSchemeProvider, { "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption4, "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption, "smithy.api#noAuth": createSmithyApiNoAuthHttpAuthOption4 }); resolveStsAuthConfig = (input) => Object.assign(input, { stsClientCtor: STSClient }); resolveHttpAuthSchemeConfig4 = (config) => { const config_0 = resolveStsAuthConfig(config); const config_1 = resolveAwsSdkSigV4Config(config_0); const config_2 = resolveAwsSdkSigV4AConfig(config_1); return Object.assign(config_2, { authSchemePreference: (0, import_util_middleware9.normalizeProvider)(config.authSchemePreference ?? []) }); }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/EndpointParameters.js var resolveClientEndpointParameters4, commonParams4; var init_EndpointParameters4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/endpoint/EndpointParameters.js"() { resolveClientEndpointParameters4 = (options) => { return Object.assign(options, { useDualstackEndpoint: options.useDualstackEndpoint ?? false, useFipsEndpoint: options.useFipsEndpoint ?? false, useGlobalEndpoint: options.useGlobalEndpoint ?? false, defaultSigningName: "sts" }); }; 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/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js var import_smithy_client29, STSServiceException; var init_STSServiceException = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js"() { import_smithy_client29 = __toESM(require_dist_cjs34()); STSServiceException = class _STSServiceException extends import_smithy_client29.ServiceException { constructor(options) { super(options); Object.setPrototypeOf(this, _STSServiceException.prototype); } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js var ExpiredTokenException2, MalformedPolicyDocumentException, PackedPolicyTooLargeException, RegionDisabledException, IDPRejectedClaimException, InvalidIdentityTokenException, IDPCommunicationErrorException; var init_errors4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js"() { init_STSServiceException(); ExpiredTokenException2 = class _ExpiredTokenException extends STSServiceException { name = "ExpiredTokenException"; $fault = "client"; constructor(opts) { super({ name: "ExpiredTokenException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _ExpiredTokenException.prototype); } }; MalformedPolicyDocumentException = class _MalformedPolicyDocumentException extends STSServiceException { name = "MalformedPolicyDocumentException"; $fault = "client"; constructor(opts) { super({ name: "MalformedPolicyDocumentException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype); } }; PackedPolicyTooLargeException = class _PackedPolicyTooLargeException extends STSServiceException { name = "PackedPolicyTooLargeException"; $fault = "client"; constructor(opts) { super({ name: "PackedPolicyTooLargeException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _PackedPolicyTooLargeException.prototype); } }; RegionDisabledException = class _RegionDisabledException extends STSServiceException { name = "RegionDisabledException"; $fault = "client"; constructor(opts) { super({ name: "RegionDisabledException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _RegionDisabledException.prototype); } }; IDPRejectedClaimException = class _IDPRejectedClaimException extends STSServiceException { name = "IDPRejectedClaimException"; $fault = "client"; constructor(opts) { super({ name: "IDPRejectedClaimException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _IDPRejectedClaimException.prototype); } }; InvalidIdentityTokenException = class _InvalidIdentityTokenException extends STSServiceException { name = "InvalidIdentityTokenException"; $fault = "client"; constructor(opts) { super({ name: "InvalidIdentityTokenException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _InvalidIdentityTokenException.prototype); } }; IDPCommunicationErrorException = class _IDPCommunicationErrorException extends STSServiceException { name = "IDPCommunicationErrorException"; $fault = "client"; $retryable = {}; constructor(opts) { super({ name: "IDPCommunicationErrorException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype); } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js var _A, _AKI, _AR, _ARI, _ARR, _ARRs, _ARU, _ARWWI, _ARWWIR, _ARWWIRs, _Au, _C, _CA, _DS, _E, _EI, _ETE2, _IDPCEE, _IDPRCE, _IITE, _K, _MPDE, _P, _PA, _PAr, _PC, _PCLT, _PCr, _PDT, _PI, _PPS, _PPTLE, _Pr, _RA, _RDE, _RSN, _SAK, _SFWIT, _SI, _SN, _ST, _T, _TC, _TTK, _Ta, _V, _WIT, _a, _aKST, _aQE, _c4, _cTT, _e4, _hE4, _m3, _pDLT, _s4, _tLT, n04, _s_registry4, STSServiceException$, n0_registry4, ExpiredTokenException$2, IDPCommunicationErrorException$, IDPRejectedClaimException$, InvalidIdentityTokenException$, MalformedPolicyDocumentException$, PackedPolicyTooLargeException$, RegionDisabledException$, errorTypeRegistries4, accessKeySecretType, clientTokenType, AssumedRoleUser$, AssumeRoleRequest$, AssumeRoleResponse$, AssumeRoleWithWebIdentityRequest$, AssumeRoleWithWebIdentityResponse$, Credentials$, PolicyDescriptorType$, ProvidedContext$, Tag$, policyDescriptorListType, ProvidedContextsListType, tagKeyListType, tagListType, AssumeRole$, AssumeRoleWithWebIdentity$; var init_schemas_04 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js"() { init_schema(); init_errors4(); init_STSServiceException(); _A = "Arn"; _AKI = "AccessKeyId"; _AR = "AssumeRole"; _ARI = "AssumedRoleId"; _ARR = "AssumeRoleRequest"; _ARRs = "AssumeRoleResponse"; _ARU = "AssumedRoleUser"; _ARWWI = "AssumeRoleWithWebIdentity"; _ARWWIR = "AssumeRoleWithWebIdentityRequest"; _ARWWIRs = "AssumeRoleWithWebIdentityResponse"; _Au = "Audience"; _C = "Credentials"; _CA = "ContextAssertion"; _DS = "DurationSeconds"; _E = "Expiration"; _EI = "ExternalId"; _ETE2 = "ExpiredTokenException"; _IDPCEE = "IDPCommunicationErrorException"; _IDPRCE = "IDPRejectedClaimException"; _IITE = "InvalidIdentityTokenException"; _K = "Key"; _MPDE = "MalformedPolicyDocumentException"; _P = "Policy"; _PA = "PolicyArns"; _PAr = "ProviderArn"; _PC = "ProvidedContexts"; _PCLT = "ProvidedContextsListType"; _PCr = "ProvidedContext"; _PDT = "PolicyDescriptorType"; _PI = "ProviderId"; _PPS = "PackedPolicySize"; _PPTLE = "PackedPolicyTooLargeException"; _Pr = "Provider"; _RA = "RoleArn"; _RDE = "RegionDisabledException"; _RSN = "RoleSessionName"; _SAK = "SecretAccessKey"; _SFWIT = "SubjectFromWebIdentityToken"; _SI = "SourceIdentity"; _SN = "SerialNumber"; _ST = "SessionToken"; _T = "Tags"; _TC = "TokenCode"; _TTK = "TransitiveTagKeys"; _Ta = "Tag"; _V = "Value"; _WIT = "WebIdentityToken"; _a = "arn"; _aKST = "accessKeySecretType"; _aQE = "awsQueryError"; _c4 = "client"; _cTT = "clientTokenType"; _e4 = "error"; _hE4 = "httpError"; _m3 = "message"; _pDLT = "policyDescriptorListType"; _s4 = "smithy.ts.sdk.synthetic.com.amazonaws.sts"; _tLT = "tagListType"; n04 = "com.amazonaws.sts"; _s_registry4 = TypeRegistry.for(_s4); STSServiceException$ = [-3, _s4, "STSServiceException", 0, [], []]; _s_registry4.registerError(STSServiceException$, STSServiceException); n0_registry4 = TypeRegistry.for(n04); ExpiredTokenException$2 = [ -3, n04, _ETE2, { [_aQE]: [`ExpiredTokenException`, 400], [_e4]: _c4, [_hE4]: 400 }, [_m3], [0] ]; n0_registry4.registerError(ExpiredTokenException$2, ExpiredTokenException2); IDPCommunicationErrorException$ = [ -3, n04, _IDPCEE, { [_aQE]: [`IDPCommunicationError`, 400], [_e4]: _c4, [_hE4]: 400 }, [_m3], [0] ]; n0_registry4.registerError(IDPCommunicationErrorException$, IDPCommunicationErrorException); IDPRejectedClaimException$ = [ -3, n04, _IDPRCE, { [_aQE]: [`IDPRejectedClaim`, 403], [_e4]: _c4, [_hE4]: 403 }, [_m3], [0] ]; n0_registry4.registerError(IDPRejectedClaimException$, IDPRejectedClaimException); InvalidIdentityTokenException$ = [ -3, n04, _IITE, { [_aQE]: [`InvalidIdentityToken`, 400], [_e4]: _c4, [_hE4]: 400 }, [_m3], [0] ]; n0_registry4.registerError(InvalidIdentityTokenException$, InvalidIdentityTokenException); MalformedPolicyDocumentException$ = [ -3, n04, _MPDE, { [_aQE]: [`MalformedPolicyDocument`, 400], [_e4]: _c4, [_hE4]: 400 }, [_m3], [0] ]; n0_registry4.registerError(MalformedPolicyDocumentException$, MalformedPolicyDocumentException); PackedPolicyTooLargeException$ = [ -3, n04, _PPTLE, { [_aQE]: [`PackedPolicyTooLarge`, 400], [_e4]: _c4, [_hE4]: 400 }, [_m3], [0] ]; n0_registry4.registerError(PackedPolicyTooLargeException$, PackedPolicyTooLargeException); RegionDisabledException$ = [ -3, n04, _RDE, { [_aQE]: [`RegionDisabledException`, 403], [_e4]: _c4, [_hE4]: 403 }, [_m3], [0] ]; n0_registry4.registerError(RegionDisabledException$, RegionDisabledException); errorTypeRegistries4 = [_s_registry4, n0_registry4]; accessKeySecretType = [0, n04, _aKST, 8, 0]; clientTokenType = [0, n04, _cTT, 8, 0]; AssumedRoleUser$ = [3, n04, _ARU, 0, [_ARI, _A], [0, 0], 2]; AssumeRoleRequest$ = [ 3, n04, _ARR, 0, [_RA, _RSN, _PA, _P, _DS, _T, _TTK, _EI, _SN, _TC, _SI, _PC], [0, 0, () => policyDescriptorListType, 0, 1, () => tagListType, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType], 2 ]; AssumeRoleResponse$ = [ 3, n04, _ARRs, 0, [_C, _ARU, _PPS, _SI], [[() => Credentials$, 0], () => AssumedRoleUser$, 1, 0] ]; AssumeRoleWithWebIdentityRequest$ = [ 3, n04, _ARWWIR, 0, [_RA, _RSN, _WIT, _PI, _PA, _P, _DS], [0, 0, [() => clientTokenType, 0], 0, () => policyDescriptorListType, 0, 1], 3 ]; AssumeRoleWithWebIdentityResponse$ = [ 3, n04, _ARWWIRs, 0, [_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI], [[() => Credentials$, 0], 0, () => AssumedRoleUser$, 1, 0, 0, 0] ]; Credentials$ = [ 3, n04, _C, 0, [_AKI, _SAK, _ST, _E], [0, [() => accessKeySecretType, 0], 0, 4], 4 ]; PolicyDescriptorType$ = [3, n04, _PDT, 0, [_a], [0]]; ProvidedContext$ = [3, n04, _PCr, 0, [_PAr, _CA], [0, 0]]; Tag$ = [3, n04, _Ta, 0, [_K, _V], [0, 0], 2]; policyDescriptorListType = [1, n04, _pDLT, 0, () => PolicyDescriptorType$]; ProvidedContextsListType = [1, n04, _PCLT, 0, () => ProvidedContext$]; tagKeyListType = 64 | 0; tagListType = [1, n04, _tLT, 0, () => Tag$]; AssumeRole$ = [9, n04, _AR, 0, () => AssumeRoleRequest$, () => AssumeRoleResponse$]; AssumeRoleWithWebIdentity$ = [ 9, n04, _ARWWI, 0, () => AssumeRoleWithWebIdentityRequest$, () => AssumeRoleWithWebIdentityResponse$ ]; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js var import_signature_v4_multi_region2, import_smithy_client30, import_url_parser5, import_util_base6411, import_util_utf811, getRuntimeConfig7; var init_runtimeConfig_shared4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.shared.js"() { init_httpAuthSchemes2(); init_protocols2(); import_signature_v4_multi_region2 = __toESM(require_dist_cjs40()); init_dist_es(); import_smithy_client30 = __toESM(require_dist_cjs34()); import_url_parser5 = __toESM(require_dist_cjs18()); import_util_base6411 = __toESM(require_dist_cjs10()); import_util_utf811 = __toESM(require_dist_cjs9()); init_httpAuthSchemeProvider4(); init_endpointResolver4(); init_schemas_04(); getRuntimeConfig7 = (config) => { return { apiVersion: "2011-06-15", base64Decoder: config?.base64Decoder ?? import_util_base6411.fromBase64, base64Encoder: config?.base64Encoder ?? import_util_base6411.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: "aws.auth#sigv4a", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"), signer: new AwsSdkSigV4ASigner() }, { schemeId: "smithy.api#noAuth", identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), signer: new NoAuthSigner() } ], logger: config?.logger ?? new import_smithy_client30.NoOpLogger(), protocol: config?.protocol ?? AwsQueryProtocol, protocolSettings: config?.protocolSettings ?? { defaultNamespace: "com.amazonaws.sts", errorTypeRegistries: errorTypeRegistries4, xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/", version: "2011-06-15", serviceTarget: "AWSSecurityTokenServiceV20110615" }, serviceId: config?.serviceId ?? "STS", signerConstructor: config?.signerConstructor ?? import_signature_v4_multi_region2.SignatureV4MultiRegion, urlParser: config?.urlParser ?? import_url_parser5.parseUrl, utf8Decoder: config?.utf8Decoder ?? import_util_utf811.fromUtf8, utf8Encoder: config?.utf8Encoder ?? import_util_utf811.toUtf8 }; }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js var import_util_user_agent_node4, import_config_resolver7, import_hash_node4, import_middleware_retry7, import_node_config_provider4, import_node_http_handler4, import_smithy_client31, import_util_body_length_node4, import_util_defaults_mode_node4, import_util_retry5, getRuntimeConfig8; var init_runtimeConfig4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js"() { init_package(); init_client(); init_httpAuthSchemes2(); import_util_user_agent_node4 = __toESM(require_dist_cjs44()); import_config_resolver7 = __toESM(require_dist_cjs26()); init_dist_es(); import_hash_node4 = __toESM(require_dist_cjs45()); import_middleware_retry7 = __toESM(require_dist_cjs35()); import_node_config_provider4 = __toESM(require_dist_cjs30()); import_node_http_handler4 = __toESM(require_dist_cjs13()); import_smithy_client31 = __toESM(require_dist_cjs34()); import_util_body_length_node4 = __toESM(require_dist_cjs46()); import_util_defaults_mode_node4 = __toESM(require_dist_cjs47()); import_util_retry5 = __toESM(require_dist_cjs23()); init_runtimeConfig_shared4(); getRuntimeConfig8 = (config) => { (0, import_smithy_client31.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, import_util_defaults_mode_node4.resolveDefaultsModeConfig)(config); const defaultConfigProvider = () => defaultsMode().then(import_smithy_client31.loadConfigsForDefaultMode); const clientSharedValues = getRuntimeConfig7(config); emitWarningIfUnsupportedVersion(process.version); const loaderConfig = { profile: config?.profile, logger: clientSharedValues.logger }; return { ...clientSharedValues, ...config, runtime: "node", defaultsMode, authSchemePreference: config?.authSchemePreference ?? (0, import_node_config_provider4.loadConfig)(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), bodyLengthChecker: config?.bodyLengthChecker ?? import_util_body_length_node4.calculateBodyLength, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, import_util_user_agent_node4.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_default.version }), httpAuthSchemes: config?.httpAuthSchemes ?? [ { schemeId: "aws.auth#sigv4", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await config.credentialDefaultProvider(idProps?.__config || {})()), signer: new AwsSdkSigV4Signer() }, { schemeId: "aws.auth#sigv4a", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"), signer: new AwsSdkSigV4ASigner() }, { schemeId: "smithy.api#noAuth", identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), signer: new NoAuthSigner() } ], maxAttempts: config?.maxAttempts ?? (0, import_node_config_provider4.loadConfig)(import_middleware_retry7.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), region: config?.region ?? (0, import_node_config_provider4.loadConfig)(import_config_resolver7.NODE_REGION_CONFIG_OPTIONS, { ...import_config_resolver7.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), requestHandler: import_node_http_handler4.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? (0, import_node_config_provider4.loadConfig)({ ...import_middleware_retry7.NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || import_util_retry5.DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? import_hash_node4.Hash.bind(null, "sha256"), sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? (0, import_node_config_provider4.loadConfig)(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig), streamCollector: config?.streamCollector ?? import_node_http_handler4.streamCollector, useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, import_node_config_provider4.loadConfig)(import_config_resolver7.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), useFipsEndpoint: config?.useFipsEndpoint ?? (0, import_node_config_provider4.loadConfig)(import_config_resolver7.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), userAgentAppId: config?.userAgentAppId ?? (0, import_node_config_provider4.loadConfig)(import_util_user_agent_node4.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) }; }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthExtensionConfiguration.js var getHttpAuthExtensionConfiguration4, resolveHttpAuthRuntimeConfig4; var init_httpAuthExtensionConfiguration4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/auth/httpAuthExtensionConfiguration.js"() { getHttpAuthExtensionConfiguration4 = (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; } }; }; resolveHttpAuthRuntimeConfig4 = (config) => { return { httpAuthSchemes: config.httpAuthSchemes(), httpAuthSchemeProvider: config.httpAuthSchemeProvider(), credentials: config.credentials() }; }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js var import_region_config_resolver4, import_protocol_http15, import_smithy_client32, resolveRuntimeExtensions4; var init_runtimeExtensions4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeExtensions.js"() { import_region_config_resolver4 = __toESM(require_dist_cjs48()); import_protocol_http15 = __toESM(require_dist_cjs2()); import_smithy_client32 = __toESM(require_dist_cjs34()); init_httpAuthExtensionConfiguration4(); resolveRuntimeExtensions4 = (runtimeConfig, extensions) => { const extensionConfiguration = Object.assign((0, import_region_config_resolver4.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, import_smithy_client32.getDefaultExtensionConfiguration)(runtimeConfig), (0, import_protocol_http15.getHttpHandlerExtensionConfiguration)(runtimeConfig), getHttpAuthExtensionConfiguration4(runtimeConfig)); extensions.forEach((extension) => extension.configure(extensionConfiguration)); return Object.assign(runtimeConfig, (0, import_region_config_resolver4.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, import_smithy_client32.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, import_protocol_http15.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), resolveHttpAuthRuntimeConfig4(extensionConfiguration)); }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js var import_middleware_host_header4, import_middleware_logger4, import_middleware_recursion_detection4, import_middleware_user_agent4, import_config_resolver8, import_middleware_content_length4, import_middleware_endpoint8, import_middleware_retry8, import_smithy_client33, STSClient; var init_STSClient = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js"() { import_middleware_host_header4 = __toESM(require_dist_cjs3()); import_middleware_logger4 = __toESM(require_dist_cjs4()); import_middleware_recursion_detection4 = __toESM(require_dist_cjs5()); import_middleware_user_agent4 = __toESM(require_dist_cjs24()); import_config_resolver8 = __toESM(require_dist_cjs26()); init_dist_es(); init_schema(); import_middleware_content_length4 = __toESM(require_dist_cjs27()); import_middleware_endpoint8 = __toESM(require_dist_cjs32()); import_middleware_retry8 = __toESM(require_dist_cjs35()); import_smithy_client33 = __toESM(require_dist_cjs34()); init_httpAuthSchemeProvider4(); init_EndpointParameters4(); init_runtimeConfig4(); init_runtimeExtensions4(); STSClient = class extends import_smithy_client33.Client { config; constructor(...[configuration]) { const _config_0 = getRuntimeConfig8(configuration || {}); super(_config_0); this.initConfig = _config_0; const _config_1 = resolveClientEndpointParameters4(_config_0); const _config_2 = (0, import_middleware_user_agent4.resolveUserAgentConfig)(_config_1); const _config_3 = (0, import_middleware_retry8.resolveRetryConfig)(_config_2); const _config_4 = (0, import_config_resolver8.resolveRegionConfig)(_config_3); const _config_5 = (0, import_middleware_host_header4.resolveHostHeaderConfig)(_config_4); const _config_6 = (0, import_middleware_endpoint8.resolveEndpointConfig)(_config_5); const _config_7 = resolveHttpAuthSchemeConfig4(_config_6); const _config_8 = resolveRuntimeExtensions4(_config_7, configuration?.extensions || []); this.config = _config_8; this.middlewareStack.use(getSchemaSerdePlugin(this.config)); this.middlewareStack.use((0, import_middleware_user_agent4.getUserAgentPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_retry8.getRetryPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_content_length4.getContentLengthPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_host_header4.getHostHeaderPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_logger4.getLoggerPlugin)(this.config)); this.middlewareStack.use((0, import_middleware_recursion_detection4.getRecursionDetectionPlugin)(this.config)); this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, { httpAuthSchemeParametersProvider: defaultSTSHttpAuthSchemeParametersProvider, identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({ "aws.auth#sigv4": config.credentials, "aws.auth#sigv4a": config.credentials }) })); this.middlewareStack.use(getHttpSigningPlugin(this.config)); } destroy() { super.destroy(); } }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js var import_middleware_endpoint9, import_smithy_client34, AssumeRoleCommand; var init_AssumeRoleCommand = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleCommand.js"() { import_middleware_endpoint9 = __toESM(require_dist_cjs32()); import_smithy_client34 = __toESM(require_dist_cjs34()); init_EndpointParameters4(); init_schemas_04(); AssumeRoleCommand = class extends import_smithy_client34.Command.classBuilder().ep(commonParams4).m(function(Command2, cs, config, o2) { return [(0, import_middleware_endpoint9.getEndpointPlugin)(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").sc(AssumeRole$).build() { }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js var import_middleware_endpoint10, import_smithy_client35, AssumeRoleWithWebIdentityCommand; var init_AssumeRoleWithWebIdentityCommand = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.js"() { import_middleware_endpoint10 = __toESM(require_dist_cjs32()); import_smithy_client35 = __toESM(require_dist_cjs34()); init_EndpointParameters4(); init_schemas_04(); AssumeRoleWithWebIdentityCommand = class extends import_smithy_client35.Command.classBuilder().ep(commonParams4).m(function(Command2, cs, config, o2) { return [(0, import_middleware_endpoint10.getEndpointPlugin)(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").sc(AssumeRoleWithWebIdentity$).build() { }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js var import_smithy_client36, commands4, STS; var init_STS = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js"() { import_smithy_client36 = __toESM(require_dist_cjs34()); init_AssumeRoleCommand(); init_AssumeRoleWithWebIdentityCommand(); init_STSClient(); commands4 = { AssumeRoleCommand, AssumeRoleWithWebIdentityCommand }; STS = class extends STSClient { }; (0, import_smithy_client36.createAggregatedClient)(commands4, STS); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/index.js var init_commands4 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/commands/index.js"() { init_AssumeRoleCommand(); init_AssumeRoleWithWebIdentityCommand(); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/models_0.js var init_models_04 = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/models_0.js"() { } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js var import_region_config_resolver5, getAccountIdFromAssumedRoleUser, resolveRegion, getDefaultRoleAssumer, getDefaultRoleAssumerWithWebIdentity, isH2; var init_defaultStsRoleAssumers = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultStsRoleAssumers.js"() { init_client(); import_region_config_resolver5 = __toESM(require_dist_cjs48()); init_AssumeRoleCommand(); init_AssumeRoleWithWebIdentityCommand(); getAccountIdFromAssumedRoleUser = (assumedRoleUser) => { if (typeof assumedRoleUser?.Arn === "string") { const arnComponents = assumedRoleUser.Arn.split(":"); if (arnComponents.length > 4 && arnComponents[4] !== "") { return arnComponents[4]; } } return void 0; }; resolveRegion = async (_region, _parentRegion, credentialProviderLogger, loaderConfig = {}) => { const region = typeof _region === "function" ? await _region() : _region; const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion; let stsDefaultRegion = ""; const resolvedRegion = region ?? parentRegion ?? (stsDefaultRegion = await (0, import_region_config_resolver5.stsRegionDefaultResolver)(loaderConfig)()); credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (credential provider clientConfig)`, `${parentRegion} (contextual client)`, `${stsDefaultRegion} (STS default: AWS_REGION, profile region, or us-east-1)`); return resolvedRegion; }; getDefaultRoleAssumer = (stsOptions, STSClient3) => { let stsClient; let closureSourceCreds; return async (sourceCreds, params) => { closureSourceCreds = sourceCreds; if (!stsClient) { const { logger: logger2 = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions; const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, { logger: logger2, profile }); const isCompatibleRequestHandler = !isH2(requestHandler); stsClient = new STSClient3({ ...stsOptions, userAgentAppId, profile, credentialDefaultProvider: () => async () => closureSourceCreds, region: resolvedRegion, requestHandler: isCompatibleRequestHandler ? requestHandler : void 0, logger: logger2 }); } 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; }; }; getDefaultRoleAssumerWithWebIdentity = (stsOptions, STSClient3) => { let stsClient; return async (params) => { if (!stsClient) { const { logger: logger2 = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions; const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, { logger: logger2, profile }); const isCompatibleRequestHandler = !isH2(requestHandler); stsClient = new STSClient3({ ...stsOptions, userAgentAppId, profile, region: resolvedRegion, requestHandler: isCompatibleRequestHandler ? requestHandler : void 0, logger: logger2 }); } 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; }; }; isH2 = (requestHandler) => { return requestHandler?.metadata?.handlerProtocol === "h2"; }; } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js var getCustomizableStsClientCtor, getDefaultRoleAssumer2, getDefaultRoleAssumerWithWebIdentity2, decorateDefaultCredentialProvider; var init_defaultRoleAssumers = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/defaultRoleAssumers.js"() { init_defaultStsRoleAssumers(); init_STSClient(); getCustomizableStsClientCtor = (baseCtor, customizations) => { if (!customizations) return baseCtor; else return class CustomizableSTSClient extends baseCtor { constructor(config) { super(config); for (const customization of customizations) { this.middlewareStack.use(customization); } } }; }; getDefaultRoleAssumer2 = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins)); getDefaultRoleAssumerWithWebIdentity2 = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity(stsOptions, getCustomizableStsClientCtor(STSClient, stsPlugins)); decorateDefaultCredentialProvider = (provider) => (input) => provider({ roleAssumer: getDefaultRoleAssumer2(input), roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity2(input), ...input }); } }); // node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/index.js var sts_exports = {}; __export(sts_exports, { AssumeRole$: () => AssumeRole$, AssumeRoleCommand: () => AssumeRoleCommand, AssumeRoleRequest$: () => AssumeRoleRequest$, AssumeRoleResponse$: () => AssumeRoleResponse$, AssumeRoleWithWebIdentity$: () => AssumeRoleWithWebIdentity$, AssumeRoleWithWebIdentityCommand: () => AssumeRoleWithWebIdentityCommand, AssumeRoleWithWebIdentityRequest$: () => AssumeRoleWithWebIdentityRequest$, AssumeRoleWithWebIdentityResponse$: () => AssumeRoleWithWebIdentityResponse$, AssumedRoleUser$: () => AssumedRoleUser$, Credentials$: () => Credentials$, ExpiredTokenException: () => ExpiredTokenException2, ExpiredTokenException$: () => ExpiredTokenException$2, IDPCommunicationErrorException: () => IDPCommunicationErrorException, IDPCommunicationErrorException$: () => IDPCommunicationErrorException$, IDPRejectedClaimException: () => IDPRejectedClaimException, IDPRejectedClaimException$: () => IDPRejectedClaimException$, InvalidIdentityTokenException: () => InvalidIdentityTokenException, InvalidIdentityTokenException$: () => InvalidIdentityTokenException$, MalformedPolicyDocumentException: () => MalformedPolicyDocumentException, MalformedPolicyDocumentException$: () => MalformedPolicyDocumentException$, PackedPolicyTooLargeException: () => PackedPolicyTooLargeException, PackedPolicyTooLargeException$: () => PackedPolicyTooLargeException$, PolicyDescriptorType$: () => PolicyDescriptorType$, ProvidedContext$: () => ProvidedContext$, RegionDisabledException: () => RegionDisabledException, RegionDisabledException$: () => RegionDisabledException$, STS: () => STS, STSClient: () => STSClient, STSServiceException: () => STSServiceException, STSServiceException$: () => STSServiceException$, Tag$: () => Tag$, __Client: () => import_smithy_client33.Client, decorateDefaultCredentialProvider: () => decorateDefaultCredentialProvider, errorTypeRegistries: () => errorTypeRegistries4, getDefaultRoleAssumer: () => getDefaultRoleAssumer2, getDefaultRoleAssumerWithWebIdentity: () => getDefaultRoleAssumerWithWebIdentity2 }); var init_sts = __esm({ "node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/index.js"() { init_STSClient(); init_STS(); init_commands4(); init_schemas_04(); init_errors4(); init_models_04(); init_defaultRoleAssumers(); init_STSServiceException(); } }); // node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js var require_dist_cjs52 = __commonJS({ "node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js"(exports2) { "use strict"; var sharedIniFileLoader = require_dist_cjs29(); var propertyProvider = require_dist_cjs28(); var node_child_process = require("node:child_process"); var node_util = require("node:util"); var client = (init_client(), __toCommonJS(client_exports)); var getValidatedProcessCredentials = (profileName, data3, profiles) => { if (data3.Version !== 1) { throw Error(`Profile ${profileName} credential_process did not return Version 1.`); } if (data3.AccessKeyId === void 0 || data3.SecretAccessKey === void 0) { throw Error(`Profile ${profileName} credential_process returned invalid credentials.`); } if (data3.Expiration) { const currentTime = /* @__PURE__ */ new Date(); const expireTime = new Date(data3.Expiration); if (expireTime < currentTime) { throw Error(`Profile ${profileName} credential_process returned expired credentials.`); } } let accountId = data3.AccountId; if (!accountId && profiles?.[profileName]?.aws_account_id) { accountId = profiles[profileName].aws_account_id; } const credentials = { accessKeyId: data3.AccessKeyId, secretAccessKey: data3.SecretAccessKey, ...data3.SessionToken && { sessionToken: data3.SessionToken }, ...data3.Expiration && { expiration: new Date(data3.Expiration) }, ...data3.CredentialScope && { credentialScope: data3.CredentialScope }, ...accountId && { accountId } }; client.setCredentialFeature(credentials, "CREDENTIALS_PROCESS", "w"); return credentials; }; var resolveProcessCredentials = async (profileName, profiles, logger2) => { const profile = profiles[profileName]; if (profiles[profileName]) { const credentialProcess = profile["credential_process"]; if (credentialProcess !== void 0) { const execPromise = node_util.promisify(sharedIniFileLoader.externalDataInterceptor?.getTokenRecord?.().exec ?? node_child_process.exec); try { const { stdout } = await execPromise(credentialProcess); let data3; try { data3 = JSON.parse(stdout.trim()); } catch { throw Error(`Profile ${profileName} credential_process returned invalid JSON.`); } return getValidatedProcessCredentials(profileName, data3, profiles); } catch (error3) { throw new propertyProvider.CredentialsProviderError(error3.message, { logger: logger2 }); } } else { throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} did not contain credential_process.`, { logger: logger2 }); } } else { throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} could not be found in shared credentials file.`, { logger: logger2 }); } }; var fromProcess = (init = {}) => async ({ callerClientConfig } = {}) => { init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess"); const profiles = await sharedIniFileLoader.parseKnownFiles(init); return resolveProcessCredentials(sharedIniFileLoader.getProfileName({ profile: init.profile ?? callerClientConfig?.profile }), profiles, init.logger); }; exports2.fromProcess = fromProcess; } }); // node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js var require_fromWebToken = __commonJS({ "node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js"(exports2) { "use strict"; var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; var desc = Object.getOwnPropertyDescriptor(m3, k5); if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m3[k5]; } }; } Object.defineProperty(o2, k22, desc); }) : (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; o2[k22] = m3[k5]; })); var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { Object.defineProperty(o2, "default", { enumerable: true, value: v }); }) : function(o2, v) { o2["default"] = v; }); var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { var ownKeys2 = function(o2) { ownKeys2 = Object.getOwnPropertyNames || function(o3) { var ar = []; for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; return ar; }; return ownKeys2(o2); }; return function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k5 = ownKeys2(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding2(result, mod, k5[i5]); } __setModuleDefault2(result, mod); return result; }; })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.fromWebToken = void 0; var fromWebToken = (init) => async (awsIdentityProperties) => { init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken"); const { roleArn, roleSessionName, webIdentityToken, providerId, policyArns, policy, durationSeconds } = init; let { roleAssumerWithWebIdentity } = init; if (!roleAssumerWithWebIdentity) { const { getDefaultRoleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity3 } = await Promise.resolve().then(() => __importStar2((init_sts(), __toCommonJS(sts_exports)))); roleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity3({ ...init.clientConfig, credentialProviderLogger: init.logger, parentClientConfig: { ...awsIdentityProperties?.callerClientConfig, ...init.parentClientConfig } }, init.clientPlugins); } return roleAssumerWithWebIdentity({ RoleArn: roleArn, RoleSessionName: roleSessionName ?? `aws-sdk-js-session-${Date.now()}`, WebIdentityToken: webIdentityToken, ProviderId: providerId, PolicyArns: policyArns, Policy: policy, DurationSeconds: durationSeconds }); }; exports2.fromWebToken = fromWebToken; } }); // node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js var require_fromTokenFile = __commonJS({ "node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromTokenFile.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.fromTokenFile = void 0; var client_1 = (init_client(), __toCommonJS(client_exports)); var property_provider_1 = require_dist_cjs28(); var shared_ini_file_loader_1 = require_dist_cjs29(); var node_fs_1 = require("node:fs"); var fromWebToken_1 = require_fromWebToken(); var ENV_TOKEN_FILE = "AWS_WEB_IDENTITY_TOKEN_FILE"; var ENV_ROLE_ARN = "AWS_ROLE_ARN"; var ENV_ROLE_SESSION_NAME = "AWS_ROLE_SESSION_NAME"; var fromTokenFile = (init = {}) => async (awsIdentityProperties) => { init.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile"); const webIdentityTokenFile = init?.webIdentityTokenFile ?? process.env[ENV_TOKEN_FILE]; const roleArn = init?.roleArn ?? process.env[ENV_ROLE_ARN]; const roleSessionName = init?.roleSessionName ?? process.env[ENV_ROLE_SESSION_NAME]; if (!webIdentityTokenFile || !roleArn) { throw new property_provider_1.CredentialsProviderError("Web identity configuration not specified", { logger: init.logger }); } const credentials = await (0, fromWebToken_1.fromWebToken)({ ...init, webIdentityToken: shared_ini_file_loader_1.externalDataInterceptor?.getTokenRecord?.()[webIdentityTokenFile] ?? (0, node_fs_1.readFileSync)(webIdentityTokenFile, { encoding: "ascii" }), roleArn, roleSessionName })(awsIdentityProperties); if (webIdentityTokenFile === process.env[ENV_TOKEN_FILE]) { (0, client_1.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN", "h"); } return credentials; }; exports2.fromTokenFile = fromTokenFile; } }); // node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js var require_dist_cjs53 = __commonJS({ "node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js"(exports2) { "use strict"; var fromTokenFile = require_fromTokenFile(); var fromWebToken = require_fromWebToken(); Object.prototype.hasOwnProperty.call(fromTokenFile, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: fromTokenFile["__proto__"] }); Object.keys(fromTokenFile).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = fromTokenFile[k5]; }); Object.prototype.hasOwnProperty.call(fromWebToken, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: fromWebToken["__proto__"] }); Object.keys(fromWebToken).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = fromWebToken[k5]; }); } }); // node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js var require_dist_cjs54 = __commonJS({ "node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js"(exports2) { "use strict"; var sharedIniFileLoader = require_dist_cjs29(); var propertyProvider = require_dist_cjs28(); var client = (init_client(), __toCommonJS(client_exports)); var credentialProviderLogin = require_dist_cjs51(); var resolveCredentialSource = (credentialSource, profileName, logger2) => { const sourceProvidersMap = { EcsContainer: async (options) => { const { fromHttp } = await Promise.resolve().then(() => __toESM(require_dist_cjs43())); const { fromContainerMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs42())); logger2?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"); return async () => propertyProvider.chain(fromHttp(options ?? {}), fromContainerMetadata(options))().then(setNamedProvider); }, Ec2InstanceMetadata: async (options) => { logger2?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata"); const { fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs42())); return async () => fromInstanceMetadata(options)().then(setNamedProvider); }, Environment: async (options) => { logger2?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment"); const { fromEnv } = await Promise.resolve().then(() => __toESM(require_dist_cjs41())); return async () => fromEnv(options)().then(setNamedProvider); } }; if (credentialSource in sourceProvidersMap) { return sourceProvidersMap[credentialSource]; } else { throw new propertyProvider.CredentialsProviderError(`Unsupported credential source in profile ${profileName}. Got ${credentialSource}, expected EcsContainer or Ec2InstanceMetadata or Environment.`, { logger: logger2 }); } }; var setNamedProvider = (creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_NAMED_PROVIDER", "p"); var isAssumeRoleProfile = (arg, { profile = "default", logger: logger2 } = {}) => { 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: logger2 }) || isCredentialSourceProfile(arg, { profile, logger: logger2 })); }; var isAssumeRoleWithSourceProfile = (arg, { profile, logger: logger2 }) => { const withSourceProfile = typeof arg.source_profile === "string" && typeof arg.credential_source === "undefined"; if (withSourceProfile) { logger2?.debug?.(` ${profile} isAssumeRoleWithSourceProfile source_profile=${arg.source_profile}`); } return withSourceProfile; }; var isCredentialSourceProfile = (arg, { profile, logger: logger2 }) => { const withProviderProfile = typeof arg.credential_source === "string" && typeof arg.source_profile === "undefined"; if (withProviderProfile) { logger2?.debug?.(` ${profile} isCredentialSourceProfile credential_source=${arg.credential_source}`); } return withProviderProfile; }; var resolveAssumeRoleCredentials = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, resolveProfileData2) => { options.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)"); const profileData = profiles[profileName]; const { source_profile, region } = profileData; if (!options.roleAssumer) { const { getDefaultRoleAssumer: getDefaultRoleAssumer3 } = await Promise.resolve().then(() => (init_sts(), sts_exports)); options.roleAssumer = getDefaultRoleAssumer3({ ...options.clientConfig, credentialProviderLogger: options.logger, parentClientConfig: { ...callerClientConfig, ...options?.parentClientConfig, region: region ?? options?.parentClientConfig?.region ?? callerClientConfig?.region } }, options.clientPlugins); } if (source_profile && source_profile in visitedProfiles) { throw new propertyProvider.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${sharedIniFileLoader.getProfileName(options)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "), { logger: options.logger }); } options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`); const sourceCredsProvider = source_profile ? resolveProfileData2(source_profile, profiles, options, callerClientConfig, { ...visitedProfiles, [source_profile]: true }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})) : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))(); if (isCredentialSourceWithoutRoleArn(profileData)) { return sourceCredsProvider.then((creds) => client.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 (!options.mfaCodeProvider) { throw new propertyProvider.CredentialsProviderError(`Profile ${profileName} requires multi-factor authentication, but no MFA code callback was provided.`, { logger: options.logger, tryNextLink: false }); } params.SerialNumber = mfa_serial; params.TokenCode = await options.mfaCodeProvider(mfa_serial); } const sourceCreds = await sourceCredsProvider; return options.roleAssumer(sourceCreds, params).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SOURCE_PROFILE", "o")); } }; var isCredentialSourceWithoutRoleArn = (section) => { return !section.role_arn && !!section.credential_source; }; var isLoginProfile = (data3) => { return Boolean(data3 && data3.login_session); }; var resolveLoginCredentials = async (profileName, options, callerClientConfig) => { const credentials = await credentialProviderLogin.fromLoginCredentials({ ...options, profile: profileName })({ callerClientConfig }); return client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE_LOGIN", "AC"); }; var isProcessProfile = (arg) => Boolean(arg) && typeof arg === "object" && typeof arg.credential_process === "string"; var resolveProcessCredentials = async (options, profile) => Promise.resolve().then(() => __toESM(require_dist_cjs52())).then(({ fromProcess }) => fromProcess({ ...options, profile })().then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_PROCESS", "v"))); var resolveSsoCredentials = async (profile, profileData, options = {}, callerClientConfig) => { const { fromSSO } = await Promise.resolve().then(() => __toESM(require_dist_cjs50())); return fromSSO({ profile, logger: options.logger, parentClientConfig: options.parentClientConfig, clientConfig: options.clientConfig })({ callerClientConfig }).then((creds) => { if (profileData.sso_session) { return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO", "r"); } else { return client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_SSO_LEGACY", "t"); } }); }; var isSsoProfile = (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"); var isStaticCredsProfile = (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; var resolveStaticCredentials = async (profile, options) => { options?.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 client.setCredentialFeature(credentials, "CREDENTIALS_PROFILE", "n"); }; var isWebIdentityProfile = (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; var resolveWebIdentityCredentials = async (profile, options, callerClientConfig) => Promise.resolve().then(() => __toESM(require_dist_cjs53())).then(({ fromTokenFile }) => fromTokenFile({ webIdentityTokenFile: profile.web_identity_token_file, roleArn: profile.role_arn, roleSessionName: profile.role_session_name, roleAssumerWithWebIdentity: options.roleAssumerWithWebIdentity, logger: options.logger, parentClientConfig: options.parentClientConfig })({ callerClientConfig }).then((creds) => client.setCredentialFeature(creds, "CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN", "q"))); var resolveProfileData = async (profileName, profiles, options, callerClientConfig, visitedProfiles = {}, isAssumeRoleRecursiveCall = false) => { const data3 = profiles[profileName]; if (Object.keys(visitedProfiles).length > 0 && isStaticCredsProfile(data3)) { return resolveStaticCredentials(data3, options); } if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data3, { profile: profileName, logger: options.logger })) { return resolveAssumeRoleCredentials(profileName, profiles, options, callerClientConfig, visitedProfiles, resolveProfileData); } if (isStaticCredsProfile(data3)) { return resolveStaticCredentials(data3, options); } if (isWebIdentityProfile(data3)) { return resolveWebIdentityCredentials(data3, options, callerClientConfig); } if (isProcessProfile(data3)) { return resolveProcessCredentials(options, profileName); } if (isSsoProfile(data3)) { return await resolveSsoCredentials(profileName, data3, options, callerClientConfig); } if (isLoginProfile(data3)) { return resolveLoginCredentials(profileName, options, callerClientConfig); } throw new propertyProvider.CredentialsProviderError(`Could not resolve credentials using profile: [${profileName}] in configuration/credentials file(s).`, { logger: options.logger }); }; var fromIni = (init = {}) => async ({ callerClientConfig } = {}) => { init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni"); const profiles = await sharedIniFileLoader.parseKnownFiles(init); return resolveProfileData(sharedIniFileLoader.getProfileName({ profile: init.profile ?? callerClientConfig?.profile }), profiles, init, callerClientConfig); }; exports2.fromIni = fromIni; } }); // node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js var require_dist_cjs55 = __commonJS({ "node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js"(exports2) { "use strict"; var credentialProviderEnv = require_dist_cjs41(); var propertyProvider = require_dist_cjs28(); var sharedIniFileLoader = require_dist_cjs29(); var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED"; var remoteProvider = async (init) => { const { ENV_CMDS_FULL_URI, ENV_CMDS_RELATIVE_URI, fromContainerMetadata, fromInstanceMetadata } = await Promise.resolve().then(() => __toESM(require_dist_cjs42())); if (process.env[ENV_CMDS_RELATIVE_URI] || process.env[ENV_CMDS_FULL_URI]) { init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata"); const { fromHttp } = await Promise.resolve().then(() => __toESM(require_dist_cjs43())); return propertyProvider.chain(fromHttp(init), fromContainerMetadata(init)); } if (process.env[ENV_IMDS_DISABLED] && process.env[ENV_IMDS_DISABLED] !== "false") { return async () => { throw new propertyProvider.CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init.logger }); }; } init.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"); return fromInstanceMetadata(init); }; function memoizeChain(providers, treatAsExpired) { const chain = internalCreateChain(providers); let activeLock; let passiveLock; let credentials; const provider = async (options) => { if (options?.forceRefresh) { return await chain(options); } if (credentials?.expiration) { if (credentials?.expiration?.getTime() < Date.now()) { credentials = void 0; } } if (activeLock) { await activeLock; } else if (!credentials || treatAsExpired?.(credentials)) { if (credentials) { if (!passiveLock) { passiveLock = chain(options).then((c5) => { credentials = c5; }).finally(() => { passiveLock = void 0; }); } } else { activeLock = chain(options).then((c5) => { credentials = c5; }).finally(() => { activeLock = void 0; }); return provider(options); } } return credentials; }; return provider; } var internalCreateChain = (providers) => async (awsIdentityProperties) => { let lastProviderError; for (const provider of providers) { try { return await provider(awsIdentityProperties); } catch (err) { lastProviderError = err; if (err?.tryNextLink) { continue; } throw err; } } throw lastProviderError; }; var multipleCredentialSourceWarningEmitted = false; var defaultProvider = (init = {}) => memoizeChain([ async () => { const profile = init.profile ?? process.env[sharedIniFileLoader.ENV_PROFILE]; if (profile) { const envStaticCredentialsAreSet = process.env[credentialProviderEnv.ENV_KEY] && process.env[credentialProviderEnv.ENV_SECRET]; if (envStaticCredentialsAreSet) { if (!multipleCredentialSourceWarningEmitted) { const warnFn = init.logger?.warn && init.logger?.constructor?.name !== "NoOpLogger" ? init.logger.warn.bind(init.logger) : 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 propertyProvider.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.", { logger: init.logger, tryNextLink: true }); } init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"); return credentialProviderEnv.fromEnv(init)(); }, async (awsIdentityProperties) => { init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO"); const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { throw new propertyProvider.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).", { logger: init.logger }); } const { fromSSO } = await Promise.resolve().then(() => __toESM(require_dist_cjs50())); return fromSSO(init)(awsIdentityProperties); }, async (awsIdentityProperties) => { init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni"); const { fromIni } = await Promise.resolve().then(() => __toESM(require_dist_cjs54())); return fromIni(init)(awsIdentityProperties); }, async (awsIdentityProperties) => { init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess"); const { fromProcess } = await Promise.resolve().then(() => __toESM(require_dist_cjs52())); return fromProcess(init)(awsIdentityProperties); }, async (awsIdentityProperties) => { init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile"); const { fromTokenFile } = await Promise.resolve().then(() => __toESM(require_dist_cjs53())); return fromTokenFile(init)(awsIdentityProperties); }, async () => { init.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"); return (await remoteProvider(init))(); }, async () => { throw new propertyProvider.CredentialsProviderError("Could not load credentials from any providers", { tryNextLink: false, logger: init.logger }); } ], credentialsTreatedAsExpired); var credentialsWillNeedRefresh = (credentials) => credentials?.expiration !== void 0; var credentialsTreatedAsExpired = (credentials) => credentials?.expiration !== void 0 && credentials.expiration.getTime() - Date.now() < 3e5; exports2.credentialsTreatedAsExpired = credentialsTreatedAsExpired; exports2.credentialsWillNeedRefresh = credentialsWillNeedRefresh; exports2.defaultProvider = defaultProvider; } }); // node_modules/@aws-sdk/client-sts/dist-cjs/models/STSServiceException.js var require_STSServiceException = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/models/STSServiceException.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.STSServiceException = exports2.__ServiceException = void 0; var smithy_client_1 = require_dist_cjs34(); Object.defineProperty(exports2, "__ServiceException", { enumerable: true, get: function() { return smithy_client_1.ServiceException; } }); var STSServiceException2 = class _STSServiceException extends smithy_client_1.ServiceException { constructor(options) { super(options); Object.setPrototypeOf(this, _STSServiceException.prototype); } }; exports2.STSServiceException = STSServiceException2; } }); // node_modules/@aws-sdk/client-sts/dist-cjs/models/errors.js var require_errors2 = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/models/errors.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SessionDurationEscalationException = exports2.OutboundWebIdentityFederationDisabledException = exports2.JWTPayloadSizeExceededException = exports2.ExpiredTradeInTokenException = exports2.InvalidAuthorizationMessageException = exports2.IDPCommunicationErrorException = exports2.InvalidIdentityTokenException = exports2.IDPRejectedClaimException = exports2.RegionDisabledException = exports2.PackedPolicyTooLargeException = exports2.MalformedPolicyDocumentException = exports2.ExpiredTokenException = void 0; var STSServiceException_1 = require_STSServiceException(); var ExpiredTokenException3 = class _ExpiredTokenException extends STSServiceException_1.STSServiceException { name = "ExpiredTokenException"; $fault = "client"; constructor(opts) { super({ name: "ExpiredTokenException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _ExpiredTokenException.prototype); } }; exports2.ExpiredTokenException = ExpiredTokenException3; var MalformedPolicyDocumentException2 = class _MalformedPolicyDocumentException extends STSServiceException_1.STSServiceException { name = "MalformedPolicyDocumentException"; $fault = "client"; constructor(opts) { super({ name: "MalformedPolicyDocumentException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _MalformedPolicyDocumentException.prototype); } }; exports2.MalformedPolicyDocumentException = MalformedPolicyDocumentException2; var PackedPolicyTooLargeException2 = class _PackedPolicyTooLargeException extends STSServiceException_1.STSServiceException { name = "PackedPolicyTooLargeException"; $fault = "client"; constructor(opts) { super({ name: "PackedPolicyTooLargeException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _PackedPolicyTooLargeException.prototype); } }; exports2.PackedPolicyTooLargeException = PackedPolicyTooLargeException2; var RegionDisabledException2 = class _RegionDisabledException extends STSServiceException_1.STSServiceException { name = "RegionDisabledException"; $fault = "client"; constructor(opts) { super({ name: "RegionDisabledException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _RegionDisabledException.prototype); } }; exports2.RegionDisabledException = RegionDisabledException2; var IDPRejectedClaimException2 = class _IDPRejectedClaimException extends STSServiceException_1.STSServiceException { name = "IDPRejectedClaimException"; $fault = "client"; constructor(opts) { super({ name: "IDPRejectedClaimException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _IDPRejectedClaimException.prototype); } }; exports2.IDPRejectedClaimException = IDPRejectedClaimException2; var InvalidIdentityTokenException2 = class _InvalidIdentityTokenException extends STSServiceException_1.STSServiceException { name = "InvalidIdentityTokenException"; $fault = "client"; constructor(opts) { super({ name: "InvalidIdentityTokenException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _InvalidIdentityTokenException.prototype); } }; exports2.InvalidIdentityTokenException = InvalidIdentityTokenException2; var IDPCommunicationErrorException2 = class _IDPCommunicationErrorException extends STSServiceException_1.STSServiceException { name = "IDPCommunicationErrorException"; $fault = "client"; $retryable = {}; constructor(opts) { super({ name: "IDPCommunicationErrorException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _IDPCommunicationErrorException.prototype); } }; exports2.IDPCommunicationErrorException = IDPCommunicationErrorException2; var InvalidAuthorizationMessageException = class _InvalidAuthorizationMessageException extends STSServiceException_1.STSServiceException { name = "InvalidAuthorizationMessageException"; $fault = "client"; constructor(opts) { super({ name: "InvalidAuthorizationMessageException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _InvalidAuthorizationMessageException.prototype); } }; exports2.InvalidAuthorizationMessageException = InvalidAuthorizationMessageException; var ExpiredTradeInTokenException = class _ExpiredTradeInTokenException extends STSServiceException_1.STSServiceException { name = "ExpiredTradeInTokenException"; $fault = "client"; constructor(opts) { super({ name: "ExpiredTradeInTokenException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _ExpiredTradeInTokenException.prototype); } }; exports2.ExpiredTradeInTokenException = ExpiredTradeInTokenException; var JWTPayloadSizeExceededException = class _JWTPayloadSizeExceededException extends STSServiceException_1.STSServiceException { name = "JWTPayloadSizeExceededException"; $fault = "client"; constructor(opts) { super({ name: "JWTPayloadSizeExceededException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _JWTPayloadSizeExceededException.prototype); } }; exports2.JWTPayloadSizeExceededException = JWTPayloadSizeExceededException; var OutboundWebIdentityFederationDisabledException = class _OutboundWebIdentityFederationDisabledException extends STSServiceException_1.STSServiceException { name = "OutboundWebIdentityFederationDisabledException"; $fault = "client"; constructor(opts) { super({ name: "OutboundWebIdentityFederationDisabledException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _OutboundWebIdentityFederationDisabledException.prototype); } }; exports2.OutboundWebIdentityFederationDisabledException = OutboundWebIdentityFederationDisabledException; var SessionDurationEscalationException = class _SessionDurationEscalationException extends STSServiceException_1.STSServiceException { name = "SessionDurationEscalationException"; $fault = "client"; constructor(opts) { super({ name: "SessionDurationEscalationException", $fault: "client", ...opts }); Object.setPrototypeOf(this, _SessionDurationEscalationException.prototype); } }; exports2.SessionDurationEscalationException = SessionDurationEscalationException; } }); // node_modules/@aws-sdk/client-sts/dist-cjs/schemas/schemas_0.js var require_schemas_0 = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/schemas/schemas_0.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.GetDelegatedAccessToken$ = exports2.GetCallerIdentity$ = exports2.GetAccessKeyInfo$ = exports2.DecodeAuthorizationMessage$ = exports2.AssumeRoot$ = exports2.AssumeRoleWithWebIdentity$ = exports2.AssumeRoleWithSAML$ = exports2.AssumeRole$ = exports2.Tag$ = exports2.ProvidedContext$ = exports2.PolicyDescriptorType$ = exports2.GetWebIdentityTokenResponse$ = exports2.GetWebIdentityTokenRequest$ = exports2.GetSessionTokenResponse$ = exports2.GetSessionTokenRequest$ = exports2.GetFederationTokenResponse$ = exports2.GetFederationTokenRequest$ = exports2.GetDelegatedAccessTokenResponse$ = exports2.GetDelegatedAccessTokenRequest$ = exports2.GetCallerIdentityResponse$ = exports2.GetCallerIdentityRequest$ = exports2.GetAccessKeyInfoResponse$ = exports2.GetAccessKeyInfoRequest$ = exports2.FederatedUser$ = exports2.DecodeAuthorizationMessageResponse$ = exports2.DecodeAuthorizationMessageRequest$ = exports2.Credentials$ = exports2.AssumeRootResponse$ = exports2.AssumeRootRequest$ = exports2.AssumeRoleWithWebIdentityResponse$ = exports2.AssumeRoleWithWebIdentityRequest$ = exports2.AssumeRoleWithSAMLResponse$ = exports2.AssumeRoleWithSAMLRequest$ = exports2.AssumeRoleResponse$ = exports2.AssumeRoleRequest$ = exports2.AssumedRoleUser$ = exports2.errorTypeRegistries = exports2.SessionDurationEscalationException$ = exports2.RegionDisabledException$ = exports2.PackedPolicyTooLargeException$ = exports2.OutboundWebIdentityFederationDisabledException$ = exports2.MalformedPolicyDocumentException$ = exports2.JWTPayloadSizeExceededException$ = exports2.InvalidIdentityTokenException$ = exports2.InvalidAuthorizationMessageException$ = exports2.IDPRejectedClaimException$ = exports2.IDPCommunicationErrorException$ = exports2.ExpiredTradeInTokenException$ = exports2.ExpiredTokenException$ = exports2.STSServiceException$ = void 0; exports2.GetWebIdentityToken$ = exports2.GetSessionToken$ = exports2.GetFederationToken$ = void 0; var _A2 = "Arn"; var _AKI2 = "AccessKeyId"; var _AP = "AssumedPrincipal"; var _AR2 = "AssumeRole"; var _ARI2 = "AssumedRoleId"; var _ARR2 = "AssumeRoleRequest"; var _ARRs2 = "AssumeRoleResponse"; var _ARRss = "AssumeRootRequest"; var _ARRssu = "AssumeRootResponse"; var _ARU2 = "AssumedRoleUser"; var _ARWSAML = "AssumeRoleWithSAML"; var _ARWSAMLR = "AssumeRoleWithSAMLRequest"; var _ARWSAMLRs = "AssumeRoleWithSAMLResponse"; var _ARWWI2 = "AssumeRoleWithWebIdentity"; var _ARWWIR2 = "AssumeRoleWithWebIdentityRequest"; var _ARWWIRs2 = "AssumeRoleWithWebIdentityResponse"; var _ARs = "AssumeRoot"; var _Ac = "Account"; var _Au2 = "Audience"; var _C2 = "Credentials"; var _CA2 = "ContextAssertion"; var _DAM = "DecodeAuthorizationMessage"; var _DAMR = "DecodeAuthorizationMessageRequest"; var _DAMRe = "DecodeAuthorizationMessageResponse"; var _DM = "DecodedMessage"; var _DS2 = "DurationSeconds"; var _E2 = "Expiration"; var _EI2 = "ExternalId"; var _EM = "EncodedMessage"; var _ETE3 = "ExpiredTokenException"; var _ETITE = "ExpiredTradeInTokenException"; var _FU = "FederatedUser"; var _FUI = "FederatedUserId"; var _GAKI = "GetAccessKeyInfo"; var _GAKIR = "GetAccessKeyInfoRequest"; var _GAKIRe = "GetAccessKeyInfoResponse"; var _GCI = "GetCallerIdentity"; var _GCIR = "GetCallerIdentityRequest"; var _GCIRe = "GetCallerIdentityResponse"; var _GDAT = "GetDelegatedAccessToken"; var _GDATR = "GetDelegatedAccessTokenRequest"; var _GDATRe = "GetDelegatedAccessTokenResponse"; var _GFT = "GetFederationToken"; var _GFTR = "GetFederationTokenRequest"; var _GFTRe = "GetFederationTokenResponse"; var _GST = "GetSessionToken"; var _GSTR = "GetSessionTokenRequest"; var _GSTRe = "GetSessionTokenResponse"; var _GWIT = "GetWebIdentityToken"; var _GWITR = "GetWebIdentityTokenRequest"; var _GWITRe = "GetWebIdentityTokenResponse"; var _I = "Issuer"; var _IAME = "InvalidAuthorizationMessageException"; var _IDPCEE2 = "IDPCommunicationErrorException"; var _IDPRCE2 = "IDPRejectedClaimException"; var _IITE2 = "InvalidIdentityTokenException"; var _JWTPSEE = "JWTPayloadSizeExceededException"; var _K2 = "Key"; var _MPDE2 = "MalformedPolicyDocumentException"; var _N = "Name"; var _NQ = "NameQualifier"; var _OWIFDE = "OutboundWebIdentityFederationDisabledException"; var _P2 = "Policy"; var _PA2 = "PolicyArns"; var _PAr2 = "PrincipalArn"; var _PAro = "ProviderArn"; var _PC2 = "ProvidedContexts"; var _PCLT2 = "ProvidedContextsListType"; var _PCr2 = "ProvidedContext"; var _PDT2 = "PolicyDescriptorType"; var _PI2 = "ProviderId"; var _PPS2 = "PackedPolicySize"; var _PPTLE2 = "PackedPolicyTooLargeException"; var _Pr2 = "Provider"; var _RA2 = "RoleArn"; var _RDE2 = "RegionDisabledException"; var _RSN2 = "RoleSessionName"; var _S = "Subject"; var _SA = "SigningAlgorithm"; var _SAK2 = "SecretAccessKey"; var _SAMLA = "SAMLAssertion"; var _SAMLAT = "SAMLAssertionType"; var _SDEE = "SessionDurationEscalationException"; var _SFWIT2 = "SubjectFromWebIdentityToken"; var _SI2 = "SourceIdentity"; var _SN2 = "SerialNumber"; var _ST2 = "SubjectType"; var _STe = "SessionToken"; var _T2 = "Tags"; var _TC2 = "TokenCode"; var _TIT = "TradeInToken"; var _TP = "TargetPrincipal"; var _TPA = "TaskPolicyArn"; var _TTK2 = "TransitiveTagKeys"; var _Ta2 = "Tag"; var _UI = "UserId"; var _V2 = "Value"; var _WIT2 = "WebIdentityToken"; var _a2 = "arn"; var _aKST2 = "accessKeySecretType"; var _aQE2 = "awsQueryError"; var _c5 = "client"; var _cTT2 = "clientTokenType"; var _e5 = "error"; var _hE5 = "httpError"; var _m4 = "message"; var _pDLT2 = "policyDescriptorListType"; var _s5 = "smithy.ts.sdk.synthetic.com.amazonaws.sts"; var _tITT = "tradeInTokenType"; var _tLT2 = "tagListType"; var _wITT = "webIdentityTokenType"; var n05 = "com.amazonaws.sts"; var schema_1 = (init_schema(), __toCommonJS(schema_exports)); var errors_1 = require_errors2(); var STSServiceException_1 = require_STSServiceException(); var _s_registry5 = schema_1.TypeRegistry.for(_s5); exports2.STSServiceException$ = [-3, _s5, "STSServiceException", 0, [], []]; _s_registry5.registerError(exports2.STSServiceException$, STSServiceException_1.STSServiceException); var n0_registry5 = schema_1.TypeRegistry.for(n05); exports2.ExpiredTokenException$ = [ -3, n05, _ETE3, { [_aQE2]: [`ExpiredTokenException`, 400], [_e5]: _c5, [_hE5]: 400 }, [_m4], [0] ]; n0_registry5.registerError(exports2.ExpiredTokenException$, errors_1.ExpiredTokenException); exports2.ExpiredTradeInTokenException$ = [ -3, n05, _ETITE, { [_aQE2]: [`ExpiredTradeInTokenException`, 400], [_e5]: _c5, [_hE5]: 400 }, [_m4], [0] ]; n0_registry5.registerError(exports2.ExpiredTradeInTokenException$, errors_1.ExpiredTradeInTokenException); exports2.IDPCommunicationErrorException$ = [ -3, n05, _IDPCEE2, { [_aQE2]: [`IDPCommunicationError`, 400], [_e5]: _c5, [_hE5]: 400 }, [_m4], [0] ]; n0_registry5.registerError(exports2.IDPCommunicationErrorException$, errors_1.IDPCommunicationErrorException); exports2.IDPRejectedClaimException$ = [ -3, n05, _IDPRCE2, { [_aQE2]: [`IDPRejectedClaim`, 403], [_e5]: _c5, [_hE5]: 403 }, [_m4], [0] ]; n0_registry5.registerError(exports2.IDPRejectedClaimException$, errors_1.IDPRejectedClaimException); exports2.InvalidAuthorizationMessageException$ = [ -3, n05, _IAME, { [_aQE2]: [`InvalidAuthorizationMessageException`, 400], [_e5]: _c5, [_hE5]: 400 }, [_m4], [0] ]; n0_registry5.registerError(exports2.InvalidAuthorizationMessageException$, errors_1.InvalidAuthorizationMessageException); exports2.InvalidIdentityTokenException$ = [ -3, n05, _IITE2, { [_aQE2]: [`InvalidIdentityToken`, 400], [_e5]: _c5, [_hE5]: 400 }, [_m4], [0] ]; n0_registry5.registerError(exports2.InvalidIdentityTokenException$, errors_1.InvalidIdentityTokenException); exports2.JWTPayloadSizeExceededException$ = [ -3, n05, _JWTPSEE, { [_aQE2]: [`JWTPayloadSizeExceededException`, 400], [_e5]: _c5, [_hE5]: 400 }, [_m4], [0] ]; n0_registry5.registerError(exports2.JWTPayloadSizeExceededException$, errors_1.JWTPayloadSizeExceededException); exports2.MalformedPolicyDocumentException$ = [ -3, n05, _MPDE2, { [_aQE2]: [`MalformedPolicyDocument`, 400], [_e5]: _c5, [_hE5]: 400 }, [_m4], [0] ]; n0_registry5.registerError(exports2.MalformedPolicyDocumentException$, errors_1.MalformedPolicyDocumentException); exports2.OutboundWebIdentityFederationDisabledException$ = [ -3, n05, _OWIFDE, { [_aQE2]: [`OutboundWebIdentityFederationDisabledException`, 403], [_e5]: _c5, [_hE5]: 403 }, [_m4], [0] ]; n0_registry5.registerError(exports2.OutboundWebIdentityFederationDisabledException$, errors_1.OutboundWebIdentityFederationDisabledException); exports2.PackedPolicyTooLargeException$ = [ -3, n05, _PPTLE2, { [_aQE2]: [`PackedPolicyTooLarge`, 400], [_e5]: _c5, [_hE5]: 400 }, [_m4], [0] ]; n0_registry5.registerError(exports2.PackedPolicyTooLargeException$, errors_1.PackedPolicyTooLargeException); exports2.RegionDisabledException$ = [ -3, n05, _RDE2, { [_aQE2]: [`RegionDisabledException`, 403], [_e5]: _c5, [_hE5]: 403 }, [_m4], [0] ]; n0_registry5.registerError(exports2.RegionDisabledException$, errors_1.RegionDisabledException); exports2.SessionDurationEscalationException$ = [ -3, n05, _SDEE, { [_aQE2]: [`SessionDurationEscalationException`, 403], [_e5]: _c5, [_hE5]: 403 }, [_m4], [0] ]; n0_registry5.registerError(exports2.SessionDurationEscalationException$, errors_1.SessionDurationEscalationException); exports2.errorTypeRegistries = [ _s_registry5, n0_registry5 ]; var accessKeySecretType2 = [0, n05, _aKST2, 8, 0]; var clientTokenType2 = [0, n05, _cTT2, 8, 0]; var SAMLAssertionType = [0, n05, _SAMLAT, 8, 0]; var tradeInTokenType = [0, n05, _tITT, 8, 0]; var webIdentityTokenType = [0, n05, _wITT, 8, 0]; exports2.AssumedRoleUser$ = [ 3, n05, _ARU2, 0, [_ARI2, _A2], [0, 0], 2 ]; exports2.AssumeRoleRequest$ = [ 3, n05, _ARR2, 0, [_RA2, _RSN2, _PA2, _P2, _DS2, _T2, _TTK2, _EI2, _SN2, _TC2, _SI2, _PC2], [0, 0, () => policyDescriptorListType2, 0, 1, () => tagListType2, 64 | 0, 0, 0, 0, 0, () => ProvidedContextsListType2], 2 ]; exports2.AssumeRoleResponse$ = [ 3, n05, _ARRs2, 0, [_C2, _ARU2, _PPS2, _SI2], [[() => exports2.Credentials$, 0], () => exports2.AssumedRoleUser$, 1, 0] ]; exports2.AssumeRoleWithSAMLRequest$ = [ 3, n05, _ARWSAMLR, 0, [_RA2, _PAr2, _SAMLA, _PA2, _P2, _DS2], [0, 0, [() => SAMLAssertionType, 0], () => policyDescriptorListType2, 0, 1], 3 ]; exports2.AssumeRoleWithSAMLResponse$ = [ 3, n05, _ARWSAMLRs, 0, [_C2, _ARU2, _PPS2, _S, _ST2, _I, _Au2, _NQ, _SI2], [[() => exports2.Credentials$, 0], () => exports2.AssumedRoleUser$, 1, 0, 0, 0, 0, 0, 0] ]; exports2.AssumeRoleWithWebIdentityRequest$ = [ 3, n05, _ARWWIR2, 0, [_RA2, _RSN2, _WIT2, _PI2, _PA2, _P2, _DS2], [0, 0, [() => clientTokenType2, 0], 0, () => policyDescriptorListType2, 0, 1], 3 ]; exports2.AssumeRoleWithWebIdentityResponse$ = [ 3, n05, _ARWWIRs2, 0, [_C2, _SFWIT2, _ARU2, _PPS2, _Pr2, _Au2, _SI2], [[() => exports2.Credentials$, 0], 0, () => exports2.AssumedRoleUser$, 1, 0, 0, 0] ]; exports2.AssumeRootRequest$ = [ 3, n05, _ARRss, 0, [_TP, _TPA, _DS2], [0, () => exports2.PolicyDescriptorType$, 1], 2 ]; exports2.AssumeRootResponse$ = [ 3, n05, _ARRssu, 0, [_C2, _SI2], [[() => exports2.Credentials$, 0], 0] ]; exports2.Credentials$ = [ 3, n05, _C2, 0, [_AKI2, _SAK2, _STe, _E2], [0, [() => accessKeySecretType2, 0], 0, 4], 4 ]; exports2.DecodeAuthorizationMessageRequest$ = [ 3, n05, _DAMR, 0, [_EM], [0], 1 ]; exports2.DecodeAuthorizationMessageResponse$ = [ 3, n05, _DAMRe, 0, [_DM], [0] ]; exports2.FederatedUser$ = [ 3, n05, _FU, 0, [_FUI, _A2], [0, 0], 2 ]; exports2.GetAccessKeyInfoRequest$ = [ 3, n05, _GAKIR, 0, [_AKI2], [0], 1 ]; exports2.GetAccessKeyInfoResponse$ = [ 3, n05, _GAKIRe, 0, [_Ac], [0] ]; exports2.GetCallerIdentityRequest$ = [ 3, n05, _GCIR, 0, [], [] ]; exports2.GetCallerIdentityResponse$ = [ 3, n05, _GCIRe, 0, [_UI, _Ac, _A2], [0, 0, 0] ]; exports2.GetDelegatedAccessTokenRequest$ = [ 3, n05, _GDATR, 0, [_TIT], [[() => tradeInTokenType, 0]], 1 ]; exports2.GetDelegatedAccessTokenResponse$ = [ 3, n05, _GDATRe, 0, [_C2, _PPS2, _AP], [[() => exports2.Credentials$, 0], 1, 0] ]; exports2.GetFederationTokenRequest$ = [ 3, n05, _GFTR, 0, [_N, _P2, _PA2, _DS2, _T2], [0, 0, () => policyDescriptorListType2, 1, () => tagListType2], 1 ]; exports2.GetFederationTokenResponse$ = [ 3, n05, _GFTRe, 0, [_C2, _FU, _PPS2], [[() => exports2.Credentials$, 0], () => exports2.FederatedUser$, 1] ]; exports2.GetSessionTokenRequest$ = [ 3, n05, _GSTR, 0, [_DS2, _SN2, _TC2], [1, 0, 0] ]; exports2.GetSessionTokenResponse$ = [ 3, n05, _GSTRe, 0, [_C2], [[() => exports2.Credentials$, 0]] ]; exports2.GetWebIdentityTokenRequest$ = [ 3, n05, _GWITR, 0, [_Au2, _SA, _DS2, _T2], [64 | 0, 0, 1, () => tagListType2], 2 ]; exports2.GetWebIdentityTokenResponse$ = [ 3, n05, _GWITRe, 0, [_WIT2, _E2], [[() => webIdentityTokenType, 0], 4] ]; exports2.PolicyDescriptorType$ = [ 3, n05, _PDT2, 0, [_a2], [0] ]; exports2.ProvidedContext$ = [ 3, n05, _PCr2, 0, [_PAro, _CA2], [0, 0] ]; exports2.Tag$ = [ 3, n05, _Ta2, 0, [_K2, _V2], [0, 0], 2 ]; var policyDescriptorListType2 = [ 1, n05, _pDLT2, 0, () => exports2.PolicyDescriptorType$ ]; var ProvidedContextsListType2 = [ 1, n05, _PCLT2, 0, () => exports2.ProvidedContext$ ]; var tagKeyListType2 = 64 | 0; var tagListType2 = [ 1, n05, _tLT2, 0, () => exports2.Tag$ ]; var webIdentityTokenAudienceListType = 64 | 0; exports2.AssumeRole$ = [ 9, n05, _AR2, 0, () => exports2.AssumeRoleRequest$, () => exports2.AssumeRoleResponse$ ]; exports2.AssumeRoleWithSAML$ = [ 9, n05, _ARWSAML, 0, () => exports2.AssumeRoleWithSAMLRequest$, () => exports2.AssumeRoleWithSAMLResponse$ ]; exports2.AssumeRoleWithWebIdentity$ = [ 9, n05, _ARWWI2, 0, () => exports2.AssumeRoleWithWebIdentityRequest$, () => exports2.AssumeRoleWithWebIdentityResponse$ ]; exports2.AssumeRoot$ = [ 9, n05, _ARs, 0, () => exports2.AssumeRootRequest$, () => exports2.AssumeRootResponse$ ]; exports2.DecodeAuthorizationMessage$ = [ 9, n05, _DAM, 0, () => exports2.DecodeAuthorizationMessageRequest$, () => exports2.DecodeAuthorizationMessageResponse$ ]; exports2.GetAccessKeyInfo$ = [ 9, n05, _GAKI, 0, () => exports2.GetAccessKeyInfoRequest$, () => exports2.GetAccessKeyInfoResponse$ ]; exports2.GetCallerIdentity$ = [ 9, n05, _GCI, 0, () => exports2.GetCallerIdentityRequest$, () => exports2.GetCallerIdentityResponse$ ]; exports2.GetDelegatedAccessToken$ = [ 9, n05, _GDAT, 0, () => exports2.GetDelegatedAccessTokenRequest$, () => exports2.GetDelegatedAccessTokenResponse$ ]; exports2.GetFederationToken$ = [ 9, n05, _GFT, 0, () => exports2.GetFederationTokenRequest$, () => exports2.GetFederationTokenResponse$ ]; exports2.GetSessionToken$ = [ 9, n05, _GST, 0, () => exports2.GetSessionTokenRequest$, () => exports2.GetSessionTokenResponse$ ]; exports2.GetWebIdentityToken$ = [ 9, n05, _GWIT, 0, () => exports2.GetWebIdentityTokenRequest$, () => exports2.GetWebIdentityTokenResponse$ ]; } }); // node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js var require_runtimeConfig_shared = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeConfig = void 0; var httpAuthSchemes_1 = (init_httpAuthSchemes2(), __toCommonJS(httpAuthSchemes_exports)); var protocols_1 = (init_protocols2(), __toCommonJS(protocols_exports2)); var signature_v4_multi_region_1 = require_dist_cjs40(); var core_1 = (init_dist_es(), __toCommonJS(dist_es_exports)); var smithy_client_1 = require_dist_cjs34(); var url_parser_1 = require_dist_cjs18(); var util_base64_1 = require_dist_cjs10(); var util_utf8_1 = require_dist_cjs9(); var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider(); var endpointResolver_1 = require_endpointResolver(); var schemas_0_1 = require_schemas_0(); var getRuntimeConfig9 = (config) => { return { apiVersion: "2011-06-15", base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64, base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64, disableHostPrefix: config?.disableHostPrefix ?? false, endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver, extensions: config?.extensions ?? [], httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeProvider, httpAuthSchemes: config?.httpAuthSchemes ?? [ { schemeId: "aws.auth#sigv4", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"), signer: new httpAuthSchemes_1.AwsSdkSigV4Signer() }, { schemeId: "aws.auth#sigv4a", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"), signer: new httpAuthSchemes_1.AwsSdkSigV4ASigner() }, { schemeId: "smithy.api#noAuth", identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), signer: new core_1.NoAuthSigner() } ], logger: config?.logger ?? new smithy_client_1.NoOpLogger(), protocol: config?.protocol ?? protocols_1.AwsQueryProtocol, protocolSettings: config?.protocolSettings ?? { defaultNamespace: "com.amazonaws.sts", errorTypeRegistries: schemas_0_1.errorTypeRegistries, xmlNamespace: "https://sts.amazonaws.com/doc/2011-06-15/", version: "2011-06-15", serviceTarget: "AWSSecurityTokenServiceV20110615" }, serviceId: config?.serviceId ?? "STS", signerConstructor: config?.signerConstructor ?? signature_v4_multi_region_1.SignatureV4MultiRegion, urlParser: config?.urlParser ?? url_parser_1.parseUrl, utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8, utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8 }; }; exports2.getRuntimeConfig = getRuntimeConfig9; } }); // node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js var require_runtimeConfig = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRuntimeConfig = void 0; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var package_json_1 = tslib_1.__importDefault(require_package()); var client_1 = (init_client(), __toCommonJS(client_exports)); var httpAuthSchemes_1 = (init_httpAuthSchemes2(), __toCommonJS(httpAuthSchemes_exports)); var credential_provider_node_1 = require_dist_cjs55(); var util_user_agent_node_1 = require_dist_cjs44(); var config_resolver_1 = require_dist_cjs26(); var core_1 = (init_dist_es(), __toCommonJS(dist_es_exports)); var hash_node_1 = require_dist_cjs45(); var middleware_retry_1 = require_dist_cjs35(); var node_config_provider_1 = require_dist_cjs30(); var node_http_handler_1 = require_dist_cjs13(); var smithy_client_1 = require_dist_cjs34(); var util_body_length_node_1 = require_dist_cjs46(); var util_defaults_mode_node_1 = require_dist_cjs47(); var util_retry_1 = require_dist_cjs23(); var runtimeConfig_shared_1 = require_runtimeConfig_shared(); var getRuntimeConfig9 = (config) => { (0, smithy_client_1.emitWarningIfUnsupportedVersion)(process.version); const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config); const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode); const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config); (0, client_1.emitWarningIfUnsupportedVersion)(process.version); const loaderConfig = { profile: config?.profile, logger: clientSharedValues.logger }; return { ...clientSharedValues, ...config, runtime: "node", defaultsMode, authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(httpAuthSchemes_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig), bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }), httpAuthSchemes: config?.httpAuthSchemes ?? [ { schemeId: "aws.auth#sigv4", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4") || (async (idProps) => await (0, credential_provider_node_1.defaultProvider)(idProps?.__config || {})()), signer: new httpAuthSchemes_1.AwsSdkSigV4Signer() }, { schemeId: "aws.auth#sigv4a", identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"), signer: new httpAuthSchemes_1.AwsSdkSigV4ASigner() }, { schemeId: "smithy.api#noAuth", identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})), signer: new core_1.NoAuthSigner() } ], maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, { ...config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }), requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? (0, node_config_provider_1.loadConfig)({ ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE }, config), sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"), sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? (0, node_config_provider_1.loadConfig)(httpAuthSchemes_1.NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig), streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector, useDualstackEndpoint: config?.useDualstackEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig), useFipsEndpoint: config?.useFipsEndpoint ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig), userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, loaderConfig) }; }; exports2.getRuntimeConfig = getRuntimeConfig9; } }); // node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js var require_httpAuthExtensionConfiguration = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.resolveHttpAuthRuntimeConfig = exports2.getHttpAuthExtensionConfiguration = void 0; var getHttpAuthExtensionConfiguration5 = (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; } }; }; exports2.getHttpAuthExtensionConfiguration = getHttpAuthExtensionConfiguration5; var resolveHttpAuthRuntimeConfig5 = (config) => { return { httpAuthSchemes: config.httpAuthSchemes(), httpAuthSchemeProvider: config.httpAuthSchemeProvider(), credentials: config.credentials() }; }; exports2.resolveHttpAuthRuntimeConfig = resolveHttpAuthRuntimeConfig5; } }); // node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js var require_runtimeExtensions = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.resolveRuntimeExtensions = void 0; var region_config_resolver_1 = require_dist_cjs48(); var protocol_http_1 = require_dist_cjs2(); var smithy_client_1 = require_dist_cjs34(); var httpAuthExtensionConfiguration_1 = require_httpAuthExtensionConfiguration(); var resolveRuntimeExtensions5 = (runtimeConfig, extensions) => { const extensionConfiguration = Object.assign((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig), (0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig)); extensions.forEach((extension) => extension.configure(extensionConfiguration)); return Object.assign(runtimeConfig, (0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), (0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration)); }; exports2.resolveRuntimeExtensions = resolveRuntimeExtensions5; } }); // node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js var require_STSClient = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.STSClient = exports2.__Client = void 0; var middleware_host_header_1 = require_dist_cjs3(); var middleware_logger_1 = require_dist_cjs4(); var middleware_recursion_detection_1 = require_dist_cjs5(); var middleware_user_agent_1 = require_dist_cjs24(); var config_resolver_1 = require_dist_cjs26(); var core_1 = (init_dist_es(), __toCommonJS(dist_es_exports)); var schema_1 = (init_schema(), __toCommonJS(schema_exports)); var middleware_content_length_1 = require_dist_cjs27(); var middleware_endpoint_1 = require_dist_cjs32(); var middleware_retry_1 = require_dist_cjs35(); var smithy_client_1 = require_dist_cjs34(); Object.defineProperty(exports2, "__Client", { enumerable: true, get: function() { return smithy_client_1.Client; } }); var httpAuthSchemeProvider_1 = require_httpAuthSchemeProvider(); var EndpointParameters_1 = require_EndpointParameters(); var runtimeConfig_1 = require_runtimeConfig(); var runtimeExtensions_1 = require_runtimeExtensions(); var STSClient3 = class extends smithy_client_1.Client { config; constructor(...[configuration]) { const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {}); super(_config_0); this.initConfig = _config_0; const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0); const _config_2 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_1); const _config_3 = (0, middleware_retry_1.resolveRetryConfig)(_config_2); const _config_4 = (0, config_resolver_1.resolveRegionConfig)(_config_3); const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4); const _config_6 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_5); const _config_7 = (0, httpAuthSchemeProvider_1.resolveHttpAuthSchemeConfig)(_config_6); const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []); this.config = _config_8; this.middlewareStack.use((0, schema_1.getSchemaSerdePlugin)(this.config)); this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config)); this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config)); this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config)); this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config)); this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config)); this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config)); this.middlewareStack.use((0, core_1.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, { httpAuthSchemeParametersProvider: httpAuthSchemeProvider_1.defaultSTSHttpAuthSchemeParametersProvider, identityProviderConfigProvider: async (config) => new core_1.DefaultIdentityProviderConfig({ "aws.auth#sigv4": config.credentials, "aws.auth#sigv4a": config.credentials }) })); this.middlewareStack.use((0, core_1.getHttpSigningPlugin)(this.config)); } destroy() { super.destroy(); } }; exports2.STSClient = STSClient3; } }); // node_modules/@aws-sdk/client-sts/dist-cjs/index.js var require_dist_cjs56 = __commonJS({ "node_modules/@aws-sdk/client-sts/dist-cjs/index.js"(exports2) { "use strict"; var STSClient3 = require_STSClient(); var smithyClient = require_dist_cjs34(); var middlewareEndpoint = require_dist_cjs32(); var EndpointParameters = require_EndpointParameters(); var schemas_0 = require_schemas_0(); var errors = require_errors2(); var client = (init_client(), __toCommonJS(client_exports)); var regionConfigResolver = require_dist_cjs48(); var STSServiceException2 = require_STSServiceException(); var AssumeRoleCommand3 = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRole", {}).n("STSClient", "AssumeRoleCommand").sc(schemas_0.AssumeRole$).build() { }; var AssumeRoleWithSAMLCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithSAML", {}).n("STSClient", "AssumeRoleWithSAMLCommand").sc(schemas_0.AssumeRoleWithSAML$).build() { }; var AssumeRoleWithWebIdentityCommand3 = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoleWithWebIdentity", {}).n("STSClient", "AssumeRoleWithWebIdentityCommand").sc(schemas_0.AssumeRoleWithWebIdentity$).build() { }; var AssumeRootCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "AssumeRoot", {}).n("STSClient", "AssumeRootCommand").sc(schemas_0.AssumeRoot$).build() { }; var DecodeAuthorizationMessageCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "DecodeAuthorizationMessage", {}).n("STSClient", "DecodeAuthorizationMessageCommand").sc(schemas_0.DecodeAuthorizationMessage$).build() { }; var GetAccessKeyInfoCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "GetAccessKeyInfo", {}).n("STSClient", "GetAccessKeyInfoCommand").sc(schemas_0.GetAccessKeyInfo$).build() { }; var GetCallerIdentityCommand2 = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "GetCallerIdentity", {}).n("STSClient", "GetCallerIdentityCommand").sc(schemas_0.GetCallerIdentity$).build() { }; var GetDelegatedAccessTokenCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "GetDelegatedAccessToken", {}).n("STSClient", "GetDelegatedAccessTokenCommand").sc(schemas_0.GetDelegatedAccessToken$).build() { }; var GetFederationTokenCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "GetFederationToken", {}).n("STSClient", "GetFederationTokenCommand").sc(schemas_0.GetFederationToken$).build() { }; var GetSessionTokenCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "GetSessionToken", {}).n("STSClient", "GetSessionTokenCommand").sc(schemas_0.GetSessionToken$).build() { }; var GetWebIdentityTokenCommand = class extends smithyClient.Command.classBuilder().ep(EndpointParameters.commonParams).m(function(Command2, cs, config, o2) { return [middlewareEndpoint.getEndpointPlugin(config, Command2.getEndpointParameterInstructions())]; }).s("AWSSecurityTokenServiceV20110615", "GetWebIdentityToken", {}).n("STSClient", "GetWebIdentityTokenCommand").sc(schemas_0.GetWebIdentityToken$).build() { }; var commands5 = { AssumeRoleCommand: AssumeRoleCommand3, AssumeRoleWithSAMLCommand, AssumeRoleWithWebIdentityCommand: AssumeRoleWithWebIdentityCommand3, AssumeRootCommand, DecodeAuthorizationMessageCommand, GetAccessKeyInfoCommand, GetCallerIdentityCommand: GetCallerIdentityCommand2, GetDelegatedAccessTokenCommand, GetFederationTokenCommand, GetSessionTokenCommand, GetWebIdentityTokenCommand }; var STS2 = class extends STSClient3.STSClient { }; smithyClient.createAggregatedClient(commands5, STS2); var getAccountIdFromAssumedRoleUser2 = (assumedRoleUser) => { if (typeof assumedRoleUser?.Arn === "string") { const arnComponents = assumedRoleUser.Arn.split(":"); if (arnComponents.length > 4 && arnComponents[4] !== "") { return arnComponents[4]; } } return void 0; }; var resolveRegion2 = async (_region, _parentRegion, credentialProviderLogger, loaderConfig = {}) => { const region = typeof _region === "function" ? await _region() : _region; const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion; let stsDefaultRegion = ""; const resolvedRegion = region ?? parentRegion ?? (stsDefaultRegion = await regionConfigResolver.stsRegionDefaultResolver(loaderConfig)()); credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (credential provider clientConfig)`, `${parentRegion} (contextual client)`, `${stsDefaultRegion} (STS default: AWS_REGION, profile region, or us-east-1)`); return resolvedRegion; }; var getDefaultRoleAssumer$1 = (stsOptions, STSClient4) => { let stsClient; let closureSourceCreds; return async (sourceCreds, params) => { closureSourceCreds = sourceCreds; if (!stsClient) { const { logger: logger2 = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions; const resolvedRegion = await resolveRegion2(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, { logger: logger2, profile }); const isCompatibleRequestHandler = !isH22(requestHandler); stsClient = new STSClient4({ ...stsOptions, userAgentAppId, profile, credentialDefaultProvider: () => async () => closureSourceCreds, region: resolvedRegion, requestHandler: isCompatibleRequestHandler ? requestHandler : void 0, logger: logger2 }); } const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleCommand3(params)); if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { throw new Error(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`); } const accountId = getAccountIdFromAssumedRoleUser2(AssumedRoleUser); const credentials = { accessKeyId: Credentials.AccessKeyId, secretAccessKey: Credentials.SecretAccessKey, sessionToken: Credentials.SessionToken, expiration: Credentials.Expiration, ...Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }, ...accountId && { accountId } }; client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE", "i"); return credentials; }; }; var getDefaultRoleAssumerWithWebIdentity$1 = (stsOptions, STSClient4) => { let stsClient; return async (params) => { if (!stsClient) { const { logger: logger2 = stsOptions?.parentClientConfig?.logger, profile = stsOptions?.parentClientConfig?.profile, region, requestHandler = stsOptions?.parentClientConfig?.requestHandler, credentialProviderLogger, userAgentAppId = stsOptions?.parentClientConfig?.userAgentAppId } = stsOptions; const resolvedRegion = await resolveRegion2(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger, { logger: logger2, profile }); const isCompatibleRequestHandler = !isH22(requestHandler); stsClient = new STSClient4({ ...stsOptions, userAgentAppId, profile, region: resolvedRegion, requestHandler: isCompatibleRequestHandler ? requestHandler : void 0, logger: logger2 }); } const { Credentials, AssumedRoleUser } = await stsClient.send(new AssumeRoleWithWebIdentityCommand3(params)); if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) { throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${params.RoleArn}`); } const accountId = getAccountIdFromAssumedRoleUser2(AssumedRoleUser); const credentials = { accessKeyId: Credentials.AccessKeyId, secretAccessKey: Credentials.SecretAccessKey, sessionToken: Credentials.SessionToken, expiration: Credentials.Expiration, ...Credentials.CredentialScope && { credentialScope: Credentials.CredentialScope }, ...accountId && { accountId } }; if (accountId) { client.setCredentialFeature(credentials, "RESOLVED_ACCOUNT_ID", "T"); } client.setCredentialFeature(credentials, "CREDENTIALS_STS_ASSUME_ROLE_WEB_ID", "k"); return credentials; }; }; var isH22 = (requestHandler) => { return requestHandler?.metadata?.handlerProtocol === "h2"; }; var getCustomizableStsClientCtor2 = (baseCtor, customizations) => { if (!customizations) return baseCtor; else return class CustomizableSTSClient extends baseCtor { constructor(config) { super(config); for (const customization of customizations) { this.middlewareStack.use(customization); } } }; }; var getDefaultRoleAssumer3 = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumer$1(stsOptions, getCustomizableStsClientCtor2(STSClient3.STSClient, stsPlugins)); var getDefaultRoleAssumerWithWebIdentity3 = (stsOptions = {}, stsPlugins) => getDefaultRoleAssumerWithWebIdentity$1(stsOptions, getCustomizableStsClientCtor2(STSClient3.STSClient, stsPlugins)); var decorateDefaultCredentialProvider2 = (provider) => (input) => provider({ roleAssumer: getDefaultRoleAssumer3(input), roleAssumerWithWebIdentity: getDefaultRoleAssumerWithWebIdentity3(input), ...input }); exports2.$Command = smithyClient.Command; exports2.STSServiceException = STSServiceException2.STSServiceException; exports2.AssumeRoleCommand = AssumeRoleCommand3; exports2.AssumeRoleWithSAMLCommand = AssumeRoleWithSAMLCommand; exports2.AssumeRoleWithWebIdentityCommand = AssumeRoleWithWebIdentityCommand3; exports2.AssumeRootCommand = AssumeRootCommand; exports2.DecodeAuthorizationMessageCommand = DecodeAuthorizationMessageCommand; exports2.GetAccessKeyInfoCommand = GetAccessKeyInfoCommand; exports2.GetCallerIdentityCommand = GetCallerIdentityCommand2; exports2.GetDelegatedAccessTokenCommand = GetDelegatedAccessTokenCommand; exports2.GetFederationTokenCommand = GetFederationTokenCommand; exports2.GetSessionTokenCommand = GetSessionTokenCommand; exports2.GetWebIdentityTokenCommand = GetWebIdentityTokenCommand; exports2.STS = STS2; exports2.decorateDefaultCredentialProvider = decorateDefaultCredentialProvider2; exports2.getDefaultRoleAssumer = getDefaultRoleAssumer3; exports2.getDefaultRoleAssumerWithWebIdentity = getDefaultRoleAssumerWithWebIdentity3; Object.prototype.hasOwnProperty.call(STSClient3, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: STSClient3["__proto__"] }); Object.keys(STSClient3).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = STSClient3[k5]; }); Object.prototype.hasOwnProperty.call(schemas_0, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: schemas_0["__proto__"] }); Object.keys(schemas_0).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = schemas_0[k5]; }); Object.prototype.hasOwnProperty.call(errors, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", { enumerable: true, value: errors["__proto__"] }); Object.keys(errors).forEach(function(k5) { if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = errors[k5]; }); } }); // node_modules/proxy-agent/node_modules/agent-base/dist/helpers.js var init_helpers = __esm({ "node_modules/proxy-agent/node_modules/agent-base/dist/helpers.js"() { } }); // node_modules/proxy-agent/node_modules/agent-base/dist/index.js var net, http2, import_https, INTERNAL, Agent4; var init_dist = __esm({ "node_modules/proxy-agent/node_modules/agent-base/dist/index.js"() { net = __toESM(require("net"), 1); http2 = __toESM(require("http"), 1); import_https = require("https"); init_helpers(); INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState"); Agent4 = class extends http2.Agent { constructor(opts) { super(opts); this[INTERNAL] = {}; } /** * Determine whether this is an `http` or `https` request. */ isSecureEndpoint(options) { if (options) { if (typeof options.secureEndpoint === "boolean") { return options.secureEndpoint; } if (typeof options.protocol === "string") { return options.protocol === "https:"; } } const { stack } = new Error(); if (typeof stack !== "string") return false; return stack.split("\n").some((l3) => l3.indexOf("(https.js:") !== -1 || l3.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(name) { if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) { return null; } if (!this.sockets[name]) { this.sockets[name] = []; } const fakeSocket = new net.Socket({ writable: false }); this.sockets[name].push(fakeSocket); this.totalSocketCount++; return fakeSocket; } decrementSockets(name, socket) { if (!this.sockets[name] || socket === null) { return; } const sockets = this.sockets[name]; const index = sockets.indexOf(socket); if (index !== -1) { sockets.splice(index, 1); this.totalSocketCount--; if (sockets.length === 0) { delete this.sockets[name]; } } } // In order to properly update the socket pool, we need to call `getName()` on // the core `https.Agent` if it is a secureEndpoint. getName(options) { const secureEndpoint = this.isSecureEndpoint(options); if (secureEndpoint) { return import_https.Agent.prototype.getName.call(this, options); } return super.getName(options); } createSocket(req, options, cb) { const connectOpts = { ...options, secureEndpoint: this.isSecureEndpoint(options) }; const name = this.getName(connectOpts); const fakeSocket = this.incrementSockets(name); Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => { this.decrementSockets(name, fakeSocket); if (typeof socket.addRequest === "function") { try { return socket.addRequest(req, connectOpts); } catch (err) { return cb(err); } } this[INTERNAL].currentSocket = socket; super.createSocket(req, options, cb); }, (err) => { this.decrementSockets(name, fakeSocket); cb(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(v) { if (this[INTERNAL]) { this[INTERNAL].defaultPort = v; } } get protocol() { return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); } set protocol(v) { if (this[INTERNAL]) { this[INTERNAL].protocol = v; } } }; } }); // node_modules/ms/index.js var require_ms = __commonJS({ "node_modules/ms/index.js"(exports2, module2) { var s = 1e3; var m3 = s * 60; var h5 = m3 * 60; var d5 = h5 * 24; var w = d5 * 7; var y = d5 * 365.25; module2.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === "string" && val.length > 0) { return parse(val); } else if (type === "number" && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) ); }; function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\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 (!match) { return; } var n3 = parseFloat(match[1]); var type = (match[2] || "ms").toLowerCase(); switch (type) { case "years": case "year": case "yrs": case "yr": case "y": return n3 * y; case "weeks": case "week": case "w": return n3 * w; case "days": case "day": case "d": return n3 * d5; case "hours": case "hour": case "hrs": case "hr": case "h": return n3 * h5; case "minutes": case "minute": case "mins": case "min": case "m": return n3 * m3; case "seconds": case "second": case "secs": case "sec": case "s": return n3 * s; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": return n3; default: return void 0; } } function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d5) { return Math.round(ms / d5) + "d"; } if (msAbs >= h5) { return Math.round(ms / h5) + "h"; } if (msAbs >= m3) { return Math.round(ms / m3) + "m"; } if (msAbs >= s) { return Math.round(ms / s) + "s"; } return ms + "ms"; } function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d5) { return plural(ms, msAbs, d5, "day"); } if (msAbs >= h5) { return plural(ms, msAbs, h5, "hour"); } if (msAbs >= m3) { return plural(ms, msAbs, m3, "minute"); } if (msAbs >= s) { return plural(ms, msAbs, s, "second"); } return ms + " ms"; } function plural(ms, msAbs, n3, name) { var isPlural = msAbs >= n3 * 1.5; return Math.round(ms / n3) + " " + name + (isPlural ? "s" : ""); } } }); // node_modules/debug/src/common.js var require_common = __commonJS({ "node_modules/debug/src/common.js"(exports2, module2) { function setup(env) { createDebug16.debug = createDebug16; createDebug16.default = createDebug16; createDebug16.coerce = coerce; createDebug16.disable = disable; createDebug16.enable = enable; createDebug16.enabled = enabled; createDebug16.humanize = require_ms(); createDebug16.destroy = destroy; Object.keys(env).forEach((key) => { createDebug16[key] = env[key]; }); createDebug16.names = []; createDebug16.skips = []; createDebug16.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 createDebug16.colors[Math.abs(hash) % createDebug16.colors.length]; } createDebug16.selectColor = selectColor; function createDebug16(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug17(...args) { if (!debug17.enabled) { return; } const self = debug17; const curr = Number(/* @__PURE__ */ new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug16.coerce(args[0]); if (typeof args[0] !== "string") { args.unshift("%O"); } let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format2) => { if (match === "%%") { return "%"; } index++; const formatter = createDebug16.formatters[format2]; if (typeof formatter === "function") { const val = args[index]; match = formatter.call(self, val); args.splice(index, 1); index--; } return match; }); createDebug16.formatArgs.call(self, args); const logFn = self.log || createDebug16.log; logFn.apply(self, args); } debug17.namespace = namespace; debug17.useColors = createDebug16.useColors(); debug17.color = createDebug16.selectColor(namespace); debug17.extend = extend; debug17.destroy = createDebug16.destroy; Object.defineProperty(debug17, "enabled", { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug16.namespaces) { namespacesCache = createDebug16.namespaces; enabledCache = createDebug16.enabled(namespace); } return enabledCache; }, set: (v) => { enableOverride = v; } }); if (typeof createDebug16.init === "function") { createDebug16.init(debug17); } return debug17; } function extend(namespace, delimiter) { const newDebug = createDebug16(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); newDebug.log = this.log; return newDebug; } function enable(namespaces) { createDebug16.save(namespaces); createDebug16.namespaces = namespaces; createDebug16.names = []; createDebug16.skips = []; const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); for (const ns of split) { if (ns[0] === "-") { createDebug16.skips.push(ns.slice(1)); } else { createDebug16.names.push(ns); } } } 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; } function disable() { const namespaces = [ ...createDebug16.names, ...createDebug16.skips.map((namespace) => "-" + namespace) ].join(","); createDebug16.enable(""); return namespaces; } function enabled(name) { for (const skip of createDebug16.skips) { if (matchesTemplate(name, skip)) { return false; } } for (const ns of createDebug16.names) { if (matchesTemplate(name, ns)) { return true; } } return false; } function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } 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`."); } createDebug16.enable(createDebug16.load()); return createDebug16; } module2.exports = setup; } }); // node_modules/debug/src/browser.js var require_browser = __commonJS({ "node_modules/debug/src/browser.js"(exports2, module2) { exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; exports2.storage = localstorage(); exports2.destroy = /* @__PURE__ */ (() => { let warned2 = false; return () => { if (!warned2) { warned2 = 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 m3; 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 && (m3 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m3[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+)/); } function formatArgs(args) { args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); if (!this.useColors) { return; } const c5 = "color: " + this.color; args.splice(1, 0, c5, "color: inherit"); let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, (match) => { if (match === "%%") { return; } index++; if (match === "%c") { lastC = index; } }); args.splice(lastC, 0, c5); } exports2.log = console.debug || console.log || (() => { }); function save(namespaces) { try { if (namespaces) { exports2.storage.setItem("debug", namespaces); } else { exports2.storage.removeItem("debug"); } } catch (error3) { } } function load() { let r5; try { r5 = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); } catch (error3) { } if (!r5 && typeof process !== "undefined" && "env" in process) { r5 = process.env.DEBUG; } return r5; } function localstorage() { try { return localStorage; } catch (error3) { } } module2.exports = require_common()(exports2); var { formatters } = module2.exports; formatters.j = function(v) { try { return JSON.stringify(v); } catch (error3) { return "[UnexpectedJSONParseError]: " + error3.message; } }; } }); // node_modules/has-flag/index.js var require_has_flag = __commonJS({ "node_modules/has-flag/index.js"(exports2, module2) { "use strict"; module2.exports = (flag, argv = process.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); }; } }); // node_modules/supports-color/index.js var require_supports_color = __commonJS({ "node_modules/supports-color/index.js"(exports2, module2) { "use strict"; var os7 = require("os"); var tty = require("tty"); var hasFlag = require_has_flag(); var { env } = process; var forceColor; if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { forceColor = 0; } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { forceColor = 1; } if ("FORCE_COLOR" in env) { if (env.FORCE_COLOR === "true") { forceColor = 1; } else if (env.FORCE_COLOR === "false") { forceColor = 0; } else { forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); } } function translateLevel(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; } function supportsColor(haveStream, streamIsTTY) { if (forceColor === 0) { return 0; } if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { return 3; } if (hasFlag("color=256")) { return 2; } if (haveStream && !streamIsTTY && forceColor === void 0) { return 0; } const min = forceColor || 0; if (env.TERM === "dumb") { return min; } if (process.platform === "win32") { const osRelease = os7.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } if ("CI" in env) { if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { return 1; } return min; } if ("TEAMCITY_VERSION" in env) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } if (env.COLORTERM === "truecolor") { return 3; } if ("TERM_PROGRAM" in env) { const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env.TERM_PROGRAM) { case "iTerm.app": return version >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } } if (/-256(color)?$/i.test(env.TERM)) { return 2; } if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { return 1; } if ("COLORTERM" in env) { return 1; } return min; } function getSupportLevel(stream) { const level = supportsColor(stream, stream && stream.isTTY); return translateLevel(level); } module2.exports = { supportsColor: getSupportLevel, stdout: translateLevel(supportsColor(true, tty.isatty(1))), stderr: translateLevel(supportsColor(true, tty.isatty(2))) }; } }); // node_modules/debug/src/node.js var require_node = __commonJS({ "node_modules/debug/src/node.js"(exports2, module2) { var tty = require("tty"); var util = require("util"); exports2.init = init; exports2.log = log; exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; exports2.destroy = util.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 supportsColor = require_supports_color(); if (supportsColor && (supportsColor.stderr || supportsColor).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 (error3) { } 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, (_, k5) => { return k5.toUpperCase(); }); let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === "null") { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); function useColors() { return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd); } function formatArgs(args) { const { namespace: name, useColors: useColors2 } = this; if (useColors2) { const c5 = this.color; const colorCode = "\x1B[3" + (c5 < 8 ? c5 : "8;5;" + c5); const prefix = ` ${colorCode};1m${name} \x1B[0m`; args[0] = prefix + args[0].split("\n").join("\n" + prefix); args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); } else { args[0] = getDate() + name + " " + args[0]; } } function getDate() { if (exports2.inspectOpts.hideDate) { return ""; } return (/* @__PURE__ */ new Date()).toISOString() + " "; } function log(...args) { return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); } function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { delete process.env.DEBUG; } } function load() { return process.env.DEBUG; } function init(debug17) { debug17.inspectOpts = {}; const keys = Object.keys(exports2.inspectOpts); for (let i5 = 0; i5 < keys.length; i5++) { debug17.inspectOpts[keys[i5]] = exports2.inspectOpts[keys[i5]]; } } module2.exports = require_common()(exports2); var { formatters } = module2.exports; formatters.o = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); }; formatters.O = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; } }); // node_modules/debug/src/index.js var require_src = __commonJS({ "node_modules/debug/src/index.js"(exports2, module2) { if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { module2.exports = require_browser(); } else { module2.exports = require_node(); } } }); // node_modules/proxy-agent/node_modules/http-proxy-agent/dist/index.js var dist_exports = {}; __export(dist_exports, { HttpProxyAgent: () => HttpProxyAgent }); function omit(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; } var net2, tls, import_debug, import_events, import_url, debug2, HttpProxyAgent; var init_dist2 = __esm({ "node_modules/proxy-agent/node_modules/http-proxy-agent/dist/index.js"() { net2 = __toESM(require("net"), 1); tls = __toESM(require("tls"), 1); import_debug = __toESM(require_src(), 1); import_events = require("events"); init_dist(); import_url = require("url"); debug2 = (0, import_debug.default)("http-proxy-agent"); HttpProxyAgent = class extends Agent4 { constructor(proxy, opts) { super(opts); this.proxy = typeof proxy === "string" ? new import_url.URL(proxy) : proxy; this.proxyHeaders = opts?.headers ?? {}; debug2("Creating new HttpProxyAgent 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 = { ...opts ? omit(opts, "headers") : null, host, port }; } addRequest(req, opts) { req._header = null; this.setRequestProps(req, opts); super.addRequest(req, opts); } setRequestProps(req, opts) { const { proxy } = this; const protocol = opts.secureEndpoint ? "https:" : "http:"; const hostname = req.getHeader("host") || "localhost"; const base = `${protocol}//${hostname}`; const url = new import_url.URL(req.path, base); if (opts.port !== 80) { url.port = String(opts.port); } req.path = String(url); const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; if (proxy.username || proxy.password) { const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } if (!headers["Proxy-Connection"]) { headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } for (const name of Object.keys(headers)) { const value = headers[name]; if (value) { req.setHeader(name, value); } } } async connect(req, opts) { req._header = null; if (!req.path.includes("://")) { this.setRequestProps(req, opts); } let first; let endOfHeaders; debug2("Regenerating stored HTTP header string for request"); req._implicitHeader(); if (req.outputData && req.outputData.length > 0) { debug2("Patching connection write() output buffer with updated header"); first = req.outputData[0].data; endOfHeaders = first.indexOf("\r\n\r\n") + 4; req.outputData[0].data = req._header + first.substring(endOfHeaders); debug2("Output buffer: %o", req.outputData[0].data); } let socket; if (this.proxy.protocol === "https:") { debug2("Creating `tls.Socket`: %o", this.connectOpts); socket = tls.connect(this.connectOpts); } else { debug2("Creating `net.Socket`: %o", this.connectOpts); socket = net2.connect(this.connectOpts); } await (0, import_events.once)(socket, "connect"); return socket; } }; HttpProxyAgent.protocols = ["http", "https"]; } }); // node_modules/proxy-agent/node_modules/https-proxy-agent/dist/parse-proxy-response.js function parseProxyResponse(socket) { return new Promise((resolve, reject) => { let buffersLength = 0; const buffers = []; function read() { const b6 = socket.read(); if (b6) ondata(b6); else socket.once("readable", read); } function cleanup() { socket.removeListener("end", onend); socket.removeListener("error", onerror); socket.removeListener("readable", read); } function onend() { cleanup(); debug3("onend"); reject(new Error("Proxy connection ended before receiving CONNECT response")); } function onerror(err) { cleanup(); debug3("onerror %o", err); reject(err); } 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) { debug3("have not received end of HTTP headers yet..."); read(); 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; } } debug3("got proxy server response: %o %o", firstLine, headers); cleanup(); resolve({ connect: { statusCode, statusText, headers }, buffered }); } socket.on("error", onerror); socket.on("end", onend); read(); }); } var import_debug2, debug3; var init_parse_proxy_response = __esm({ "node_modules/proxy-agent/node_modules/https-proxy-agent/dist/parse-proxy-response.js"() { import_debug2 = __toESM(require_src(), 1); debug3 = (0, import_debug2.default)("https-proxy-agent:parse-proxy-response"); } }); // node_modules/proxy-agent/node_modules/https-proxy-agent/dist/index.js var dist_exports2 = {}; __export(dist_exports2, { HttpsProxyAgent: () => HttpsProxyAgent }); function resume(socket) { socket.resume(); } function omit2(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; } var net3, tls2, import_assert, import_debug3, import_url2, debug4, setServernameFromNonIpHost, HttpsProxyAgent; var init_dist3 = __esm({ "node_modules/proxy-agent/node_modules/https-proxy-agent/dist/index.js"() { net3 = __toESM(require("net"), 1); tls2 = __toESM(require("tls"), 1); import_assert = __toESM(require("assert"), 1); import_debug3 = __toESM(require_src(), 1); init_dist(); import_url2 = require("url"); init_parse_proxy_response(); debug4 = (0, import_debug3.default)("https-proxy-agent"); setServernameFromNonIpHost = (options) => { if (options.servername === void 0 && options.host && !net3.isIP(options.host)) { return { ...options, servername: options.host }; } return options; }; HttpsProxyAgent = class extends Agent4 { constructor(proxy, opts) { super(opts); this.options = { path: void 0 }; this.proxy = typeof proxy === "string" ? new import_url2.URL(proxy) : proxy; this.proxyHeaders = opts?.headers ?? {}; debug4("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 ? omit2(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 } = this; if (!opts.host) { throw new TypeError('No "host" provided'); } let socket; if (proxy.protocol === "https:") { debug4("Creating `tls.Socket`: %o", this.connectOpts); socket = tls2.connect(setServernameFromNonIpHost(this.connectOpts)); } else { debug4("Creating `net.Socket`: %o", this.connectOpts); socket = net3.connect(this.connectOpts); } const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; const host = net3.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; let payload2 = `CONNECT ${host}:${opts.port} HTTP/1.1\r `; if (proxy.username || proxy.password) { const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.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 name of Object.keys(headers)) { payload2 += `${name}: ${headers[name]}\r `; } const proxyResponsePromise = parseProxyResponse(socket); socket.write(`${payload2}\r `); const { connect: connect13, buffered } = await proxyResponsePromise; req.emit("proxyConnect", connect13); this.emit("proxyConnect", connect13, req); if (connect13.statusCode === 200) { req.once("socket", resume); if (opts.secureEndpoint) { debug4("Upgrading socket connection to TLS"); return tls2.connect({ ...omit2(setServernameFromNonIpHost(opts), "host", "path", "port"), socket }); } return socket; } socket.destroy(); const fakeSocket = new net3.Socket({ writable: false }); fakeSocket.readable = true; req.once("socket", (s) => { debug4("Replaying proxy buffer for failed request"); (0, import_assert.default)(s.listenerCount("data") > 0); s.push(buffered); s.push(null); }); return fakeSocket; } }; HttpsProxyAgent.protocols = ["http", "https"]; } }); // node_modules/smart-buffer/build/utils.js var require_utils2 = __commonJS({ "node_modules/smart-buffer/build/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var buffer_1 = require("buffer"); var ERRORS = { INVALID_ENCODING: "Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.", INVALID_SMARTBUFFER_SIZE: "Invalid size provided. Size must be a valid integer greater than zero.", INVALID_SMARTBUFFER_BUFFER: "Invalid Buffer provided in SmartBufferOptions.", INVALID_SMARTBUFFER_OBJECT: "Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.", INVALID_OFFSET: "An invalid offset value was provided.", INVALID_OFFSET_NON_NUMBER: "An invalid offset value was provided. A numeric value is required.", INVALID_LENGTH: "An invalid length value was provided.", INVALID_LENGTH_NON_NUMBER: "An invalid length value was provived. A numeric value is required.", INVALID_TARGET_OFFSET: "Target offset is beyond the bounds of the internal SmartBuffer data.", INVALID_TARGET_LENGTH: "Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.", INVALID_READ_BEYOND_BOUNDS: "Attempted to read beyond the bounds of the managed data.", INVALID_WRITE_BEYOND_BOUNDS: "Attempted to write beyond the bounds of the managed data." }; exports2.ERRORS = ERRORS; function checkEncoding(encoding) { if (!buffer_1.Buffer.isEncoding(encoding)) { throw new Error(ERRORS.INVALID_ENCODING); } } exports2.checkEncoding = checkEncoding; function isFiniteInteger(value) { return typeof value === "number" && isFinite(value) && isInteger(value); } exports2.isFiniteInteger = isFiniteInteger; function checkOffsetOrLengthValue(value, offset) { if (typeof value === "number") { if (!isFiniteInteger(value) || value < 0) { throw new Error(offset ? ERRORS.INVALID_OFFSET : ERRORS.INVALID_LENGTH); } } else { throw new Error(offset ? ERRORS.INVALID_OFFSET_NON_NUMBER : ERRORS.INVALID_LENGTH_NON_NUMBER); } } function checkLengthValue(length) { checkOffsetOrLengthValue(length, false); } exports2.checkLengthValue = checkLengthValue; function checkOffsetValue(offset) { checkOffsetOrLengthValue(offset, true); } exports2.checkOffsetValue = checkOffsetValue; function checkTargetOffset(offset, buff) { if (offset < 0 || offset > buff.length) { throw new Error(ERRORS.INVALID_TARGET_OFFSET); } } exports2.checkTargetOffset = checkTargetOffset; function isInteger(value) { return typeof value === "number" && isFinite(value) && Math.floor(value) === value; } function bigIntAndBufferInt64Check(bufferMethod) { if (typeof BigInt === "undefined") { throw new Error("Platform does not support JS BigInt type."); } if (typeof buffer_1.Buffer.prototype[bufferMethod] === "undefined") { throw new Error(`Platform does not support Buffer.prototype.${bufferMethod}.`); } } exports2.bigIntAndBufferInt64Check = bigIntAndBufferInt64Check; } }); // node_modules/smart-buffer/build/smartbuffer.js var require_smartbuffer = __commonJS({ "node_modules/smart-buffer/build/smartbuffer.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var utils_1 = require_utils2(); var DEFAULT_SMARTBUFFER_SIZE = 4096; var DEFAULT_SMARTBUFFER_ENCODING = "utf8"; var SmartBuffer = class _SmartBuffer { /** * Creates a new SmartBuffer instance. * * @param options { SmartBufferOptions } The SmartBufferOptions to apply to this instance. */ constructor(options) { this.length = 0; this._encoding = DEFAULT_SMARTBUFFER_ENCODING; this._writeOffset = 0; this._readOffset = 0; if (_SmartBuffer.isSmartBufferOptions(options)) { if (options.encoding) { utils_1.checkEncoding(options.encoding); this._encoding = options.encoding; } if (options.size) { if (utils_1.isFiniteInteger(options.size) && options.size > 0) { this._buff = Buffer.allocUnsafe(options.size); } else { throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_SIZE); } } else if (options.buff) { if (Buffer.isBuffer(options.buff)) { this._buff = options.buff; this.length = options.buff.length; } else { throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_BUFFER); } } else { this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE); } } else { if (typeof options !== "undefined") { throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_OBJECT); } this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE); } } /** * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding. * * @param size { Number } The size of the internal Buffer. * @param encoding { String } The BufferEncoding to use for strings. * * @return { SmartBuffer } */ static fromSize(size, encoding) { return new this({ size, encoding }); } /** * Creates a new SmartBuffer instance with the provided Buffer and optional encoding. * * @param buffer { Buffer } The Buffer to use as the internal Buffer value. * @param encoding { String } The BufferEncoding to use for strings. * * @return { SmartBuffer } */ static fromBuffer(buff, encoding) { return new this({ buff, encoding }); } /** * Creates a new SmartBuffer instance with the provided SmartBufferOptions options. * * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance. */ static fromOptions(options) { return new this(options); } /** * Type checking function that determines if an object is a SmartBufferOptions object. */ static isSmartBufferOptions(options) { const castOptions = options; return castOptions && (castOptions.encoding !== void 0 || castOptions.size !== void 0 || castOptions.buff !== void 0); } // Signed integers /** * Reads an Int8 value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt8(offset) { return this._readNumberValue(Buffer.prototype.readInt8, 1, offset); } /** * Reads an Int16BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt16BE(offset) { return this._readNumberValue(Buffer.prototype.readInt16BE, 2, offset); } /** * Reads an Int16LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt16LE(offset) { return this._readNumberValue(Buffer.prototype.readInt16LE, 2, offset); } /** * Reads an Int32BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt32BE(offset) { return this._readNumberValue(Buffer.prototype.readInt32BE, 4, offset); } /** * Reads an Int32LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt32LE(offset) { return this._readNumberValue(Buffer.prototype.readInt32LE, 4, offset); } /** * Reads a BigInt64BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { BigInt } */ readBigInt64BE(offset) { utils_1.bigIntAndBufferInt64Check("readBigInt64BE"); return this._readNumberValue(Buffer.prototype.readBigInt64BE, 8, offset); } /** * Reads a BigInt64LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { BigInt } */ readBigInt64LE(offset) { utils_1.bigIntAndBufferInt64Check("readBigInt64LE"); return this._readNumberValue(Buffer.prototype.readBigInt64LE, 8, offset); } /** * Writes an Int8 value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt8(value, offset) { this._writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset); return this; } /** * Inserts an Int8 value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt8(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt8, 1, value, offset); } /** * Writes an Int16BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt16BE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset); } /** * Inserts an Int16BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt16BE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset); } /** * Writes an Int16LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt16LE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset); } /** * Inserts an Int16LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt16LE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset); } /** * Writes an Int32BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt32BE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset); } /** * Inserts an Int32BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt32BE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset); } /** * Writes an Int32LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt32LE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset); } /** * Inserts an Int32LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt32LE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset); } /** * Writes a BigInt64BE value to the current write position (or at optional offset). * * @param value { BigInt } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeBigInt64BE(value, offset) { utils_1.bigIntAndBufferInt64Check("writeBigInt64BE"); return this._writeNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset); } /** * Inserts a BigInt64BE value at the given offset value. * * @param value { BigInt } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertBigInt64BE(value, offset) { utils_1.bigIntAndBufferInt64Check("writeBigInt64BE"); return this._insertNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset); } /** * Writes a BigInt64LE value to the current write position (or at optional offset). * * @param value { BigInt } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeBigInt64LE(value, offset) { utils_1.bigIntAndBufferInt64Check("writeBigInt64LE"); return this._writeNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset); } /** * Inserts a Int64LE value at the given offset value. * * @param value { BigInt } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertBigInt64LE(value, offset) { utils_1.bigIntAndBufferInt64Check("writeBigInt64LE"); return this._insertNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset); } // Unsigned Integers /** * Reads an UInt8 value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt8(offset) { return this._readNumberValue(Buffer.prototype.readUInt8, 1, offset); } /** * Reads an UInt16BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt16BE(offset) { return this._readNumberValue(Buffer.prototype.readUInt16BE, 2, offset); } /** * Reads an UInt16LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt16LE(offset) { return this._readNumberValue(Buffer.prototype.readUInt16LE, 2, offset); } /** * Reads an UInt32BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt32BE(offset) { return this._readNumberValue(Buffer.prototype.readUInt32BE, 4, offset); } /** * Reads an UInt32LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt32LE(offset) { return this._readNumberValue(Buffer.prototype.readUInt32LE, 4, offset); } /** * Reads a BigUInt64BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { BigInt } */ readBigUInt64BE(offset) { utils_1.bigIntAndBufferInt64Check("readBigUInt64BE"); return this._readNumberValue(Buffer.prototype.readBigUInt64BE, 8, offset); } /** * Reads a BigUInt64LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { BigInt } */ readBigUInt64LE(offset) { utils_1.bigIntAndBufferInt64Check("readBigUInt64LE"); return this._readNumberValue(Buffer.prototype.readBigUInt64LE, 8, offset); } /** * Writes an UInt8 value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt8(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset); } /** * Inserts an UInt8 value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt8(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt8, 1, value, offset); } /** * Writes an UInt16BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt16BE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset); } /** * Inserts an UInt16BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt16BE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset); } /** * Writes an UInt16LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt16LE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset); } /** * Inserts an UInt16LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt16LE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset); } /** * Writes an UInt32BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt32BE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset); } /** * Inserts an UInt32BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt32BE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset); } /** * Writes an UInt32LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt32LE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset); } /** * Inserts an UInt32LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt32LE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset); } /** * Writes a BigUInt64BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeBigUInt64BE(value, offset) { utils_1.bigIntAndBufferInt64Check("writeBigUInt64BE"); return this._writeNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset); } /** * Inserts a BigUInt64BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertBigUInt64BE(value, offset) { utils_1.bigIntAndBufferInt64Check("writeBigUInt64BE"); return this._insertNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset); } /** * Writes a BigUInt64LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeBigUInt64LE(value, offset) { utils_1.bigIntAndBufferInt64Check("writeBigUInt64LE"); return this._writeNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset); } /** * Inserts a BigUInt64LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertBigUInt64LE(value, offset) { utils_1.bigIntAndBufferInt64Check("writeBigUInt64LE"); return this._insertNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset); } // Floating Point /** * Reads an FloatBE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readFloatBE(offset) { return this._readNumberValue(Buffer.prototype.readFloatBE, 4, offset); } /** * Reads an FloatLE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readFloatLE(offset) { return this._readNumberValue(Buffer.prototype.readFloatLE, 4, offset); } /** * Writes a FloatBE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeFloatBE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset); } /** * Inserts a FloatBE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertFloatBE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset); } /** * Writes a FloatLE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeFloatLE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset); } /** * Inserts a FloatLE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertFloatLE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset); } // Double Floating Point /** * Reads an DoublEBE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readDoubleBE(offset) { return this._readNumberValue(Buffer.prototype.readDoubleBE, 8, offset); } /** * Reads an DoubleLE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readDoubleLE(offset) { return this._readNumberValue(Buffer.prototype.readDoubleLE, 8, offset); } /** * Writes a DoubleBE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeDoubleBE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset); } /** * Inserts a DoubleBE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertDoubleBE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset); } /** * Writes a DoubleLE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeDoubleLE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset); } /** * Inserts a DoubleLE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertDoubleLE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset); } // Strings /** * Reads a String from the current read position. * * @param arg1 { Number | String } The number of bytes to read as a String, or the BufferEncoding to use for * the string (Defaults to instance level encoding). * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). * * @return { String } */ readString(arg1, encoding) { let lengthVal; if (typeof arg1 === "number") { utils_1.checkLengthValue(arg1); lengthVal = Math.min(arg1, this.length - this._readOffset); } else { encoding = arg1; lengthVal = this.length - this._readOffset; } if (typeof encoding !== "undefined") { utils_1.checkEncoding(encoding); } const value = this._buff.slice(this._readOffset, this._readOffset + lengthVal).toString(encoding || this._encoding); this._readOffset += lengthVal; return value; } /** * Inserts a String * * @param value { String } The String value to insert. * @param offset { Number } The offset to insert the string at. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). * * @return this */ insertString(value, offset, encoding) { utils_1.checkOffsetValue(offset); return this._handleString(value, true, offset, encoding); } /** * Writes a String * * @param value { String } The String value to write. * @param arg2 { Number | String } The offset to write the string at, or the BufferEncoding to use. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). * * @return this */ writeString(value, arg2, encoding) { return this._handleString(value, false, arg2, encoding); } /** * Reads a null-terminated String from the current read position. * * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). * * @return { String } */ readStringNT(encoding) { if (typeof encoding !== "undefined") { utils_1.checkEncoding(encoding); } let nullPos = this.length; for (let i5 = this._readOffset; i5 < this.length; i5++) { if (this._buff[i5] === 0) { nullPos = i5; break; } } const value = this._buff.slice(this._readOffset, nullPos); this._readOffset = nullPos + 1; return value.toString(encoding || this._encoding); } /** * Inserts a null-terminated String. * * @param value { String } The String value to write. * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). * * @return this */ insertStringNT(value, offset, encoding) { utils_1.checkOffsetValue(offset); this.insertString(value, offset, encoding); this.insertUInt8(0, offset + value.length); return this; } /** * Writes a null-terminated String. * * @param value { String } The String value to write. * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). * * @return this */ writeStringNT(value, arg2, encoding) { this.writeString(value, arg2, encoding); this.writeUInt8(0, typeof arg2 === "number" ? arg2 + value.length : this.writeOffset); return this; } // Buffers /** * Reads a Buffer from the internal read position. * * @param length { Number } The length of data to read as a Buffer. * * @return { Buffer } */ readBuffer(length) { if (typeof length !== "undefined") { utils_1.checkLengthValue(length); } const lengthVal = typeof length === "number" ? length : this.length; const endPoint = Math.min(this.length, this._readOffset + lengthVal); const value = this._buff.slice(this._readOffset, endPoint); this._readOffset = endPoint; return value; } /** * Writes a Buffer to the current write position. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. * * @return this */ insertBuffer(value, offset) { utils_1.checkOffsetValue(offset); return this._handleBuffer(value, true, offset); } /** * Writes a Buffer to the current write position. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. * * @return this */ writeBuffer(value, offset) { return this._handleBuffer(value, false, offset); } /** * Reads a null-terminated Buffer from the current read poisiton. * * @return { Buffer } */ readBufferNT() { let nullPos = this.length; for (let i5 = this._readOffset; i5 < this.length; i5++) { if (this._buff[i5] === 0) { nullPos = i5; break; } } const value = this._buff.slice(this._readOffset, nullPos); this._readOffset = nullPos + 1; return value; } /** * Inserts a null-terminated Buffer. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. * * @return this */ insertBufferNT(value, offset) { utils_1.checkOffsetValue(offset); this.insertBuffer(value, offset); this.insertUInt8(0, offset + value.length); return this; } /** * Writes a null-terminated Buffer. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. * * @return this */ writeBufferNT(value, offset) { if (typeof offset !== "undefined") { utils_1.checkOffsetValue(offset); } this.writeBuffer(value, offset); this.writeUInt8(0, typeof offset === "number" ? offset + value.length : this._writeOffset); return this; } /** * Clears the SmartBuffer instance to its original empty state. */ clear() { this._writeOffset = 0; this._readOffset = 0; this.length = 0; return this; } /** * Gets the remaining data left to be read from the SmartBuffer instance. * * @return { Number } */ remaining() { return this.length - this._readOffset; } /** * Gets the current read offset value of the SmartBuffer instance. * * @return { Number } */ get readOffset() { return this._readOffset; } /** * Sets the read offset value of the SmartBuffer instance. * * @param offset { Number } - The offset value to set. */ set readOffset(offset) { utils_1.checkOffsetValue(offset); utils_1.checkTargetOffset(offset, this); this._readOffset = offset; } /** * Gets the current write offset value of the SmartBuffer instance. * * @return { Number } */ get writeOffset() { return this._writeOffset; } /** * Sets the write offset value of the SmartBuffer instance. * * @param offset { Number } - The offset value to set. */ set writeOffset(offset) { utils_1.checkOffsetValue(offset); utils_1.checkTargetOffset(offset, this); this._writeOffset = offset; } /** * Gets the currently set string encoding of the SmartBuffer instance. * * @return { BufferEncoding } The string Buffer encoding currently set. */ get encoding() { return this._encoding; } /** * Sets the string encoding of the SmartBuffer instance. * * @param encoding { BufferEncoding } The string Buffer encoding to set. */ set encoding(encoding) { utils_1.checkEncoding(encoding); this._encoding = encoding; } /** * Gets the underlying internal Buffer. (This includes unmanaged data in the Buffer) * * @return { Buffer } The Buffer value. */ get internalBuffer() { return this._buff; } /** * Gets the value of the internal managed Buffer (Includes managed data only) * * @param { Buffer } */ toBuffer() { return this._buff.slice(0, this.length); } /** * Gets the String value of the internal managed Buffer * * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding). */ toString(encoding) { const encodingVal = typeof encoding === "string" ? encoding : this._encoding; utils_1.checkEncoding(encodingVal); return this._buff.toString(encodingVal, 0, this.length); } /** * Destroys the SmartBuffer instance. */ destroy() { this.clear(); return this; } /** * Handles inserting and writing strings. * * @param value { String } The String value to insert. * @param isInsert { Boolean } True if inserting a string, false if writing. * @param arg2 { Number | String } The offset to insert the string at, or the BufferEncoding to use. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). */ _handleString(value, isInsert, arg3, encoding) { let offsetVal = this._writeOffset; let encodingVal = this._encoding; if (typeof arg3 === "number") { offsetVal = arg3; } else if (typeof arg3 === "string") { utils_1.checkEncoding(arg3); encodingVal = arg3; } if (typeof encoding === "string") { utils_1.checkEncoding(encoding); encodingVal = encoding; } const byteLength = Buffer.byteLength(value, encodingVal); if (isInsert) { this.ensureInsertable(byteLength, offsetVal); } else { this._ensureWriteable(byteLength, offsetVal); } this._buff.write(value, offsetVal, byteLength, encodingVal); if (isInsert) { this._writeOffset += byteLength; } else { if (typeof arg3 === "number") { this._writeOffset = Math.max(this._writeOffset, offsetVal + byteLength); } else { this._writeOffset += byteLength; } } return this; } /** * Handles writing or insert of a Buffer. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. */ _handleBuffer(value, isInsert, offset) { const offsetVal = typeof offset === "number" ? offset : this._writeOffset; if (isInsert) { this.ensureInsertable(value.length, offsetVal); } else { this._ensureWriteable(value.length, offsetVal); } value.copy(this._buff, offsetVal); if (isInsert) { this._writeOffset += value.length; } else { if (typeof offset === "number") { this._writeOffset = Math.max(this._writeOffset, offsetVal + value.length); } else { this._writeOffset += value.length; } } return this; } /** * Ensures that the internal Buffer is large enough to read data. * * @param length { Number } The length of the data that needs to be read. * @param offset { Number } The offset of the data that needs to be read. */ ensureReadable(length, offset) { let offsetVal = this._readOffset; if (typeof offset !== "undefined") { utils_1.checkOffsetValue(offset); offsetVal = offset; } if (offsetVal < 0 || offsetVal + length > this.length) { throw new Error(utils_1.ERRORS.INVALID_READ_BEYOND_BOUNDS); } } /** * Ensures that the internal Buffer is large enough to insert data. * * @param dataLength { Number } The length of the data that needs to be written. * @param offset { Number } The offset of the data to be written. */ ensureInsertable(dataLength, offset) { utils_1.checkOffsetValue(offset); this._ensureCapacity(this.length + dataLength); if (offset < this.length) { this._buff.copy(this._buff, offset + dataLength, offset, this._buff.length); } if (offset + dataLength > this.length) { this.length = offset + dataLength; } else { this.length += dataLength; } } /** * Ensures that the internal Buffer is large enough to write data. * * @param dataLength { Number } The length of the data that needs to be written. * @param offset { Number } The offset of the data to be written (defaults to writeOffset). */ _ensureWriteable(dataLength, offset) { const offsetVal = typeof offset === "number" ? offset : this._writeOffset; this._ensureCapacity(offsetVal + dataLength); if (offsetVal + dataLength > this.length) { this.length = offsetVal + dataLength; } } /** * Ensures that the internal Buffer is large enough to write at least the given amount of data. * * @param minLength { Number } The minimum length of the data needs to be written. */ _ensureCapacity(minLength) { const oldLength = this._buff.length; if (minLength > oldLength) { let data3 = this._buff; let newLength = oldLength * 3 / 2 + 1; if (newLength < minLength) { newLength = minLength; } this._buff = Buffer.allocUnsafe(newLength); data3.copy(this._buff, 0, 0, oldLength); } } /** * Reads a numeric number value using the provided function. * * @typeparam T { number | bigint } The type of the value to be read * * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with. * @param byteSize { Number } The number of bytes read. * @param offset { Number } The offset to read from (optional). When this is not provided, the managed readOffset is used instead. * * @returns { T } the number value */ _readNumberValue(func, byteSize, offset) { this.ensureReadable(byteSize, offset); const value = func.call(this._buff, typeof offset === "number" ? offset : this._readOffset); if (typeof offset === "undefined") { this._readOffset += byteSize; } return value; } /** * Inserts a numeric number value based on the given offset and value. * * @typeparam T { number | bigint } The type of the value to be written * * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with. * @param byteSize { Number } The number of bytes written. * @param value { T } The number value to write. * @param offset { Number } the offset to write the number at (REQUIRED). * * @returns SmartBuffer this buffer */ _insertNumberValue(func, byteSize, value, offset) { utils_1.checkOffsetValue(offset); this.ensureInsertable(byteSize, offset); func.call(this._buff, value, offset); this._writeOffset += byteSize; return this; } /** * Writes a numeric number value based on the given offset and value. * * @typeparam T { number | bigint } The type of the value to be written * * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with. * @param byteSize { Number } The number of bytes written. * @param value { T } The number value to write. * @param offset { Number } the offset to write the number at (REQUIRED). * * @returns SmartBuffer this buffer */ _writeNumberValue(func, byteSize, value, offset) { if (typeof offset === "number") { if (offset < 0) { throw new Error(utils_1.ERRORS.INVALID_WRITE_BEYOND_BOUNDS); } utils_1.checkOffsetValue(offset); } const offsetVal = typeof offset === "number" ? offset : this._writeOffset; this._ensureWriteable(byteSize, offsetVal); func.call(this._buff, value, offsetVal); if (typeof offset === "number") { this._writeOffset = Math.max(this._writeOffset, offsetVal + byteSize); } else { this._writeOffset += byteSize; } return this; } }; exports2.SmartBuffer = SmartBuffer; } }); // node_modules/socks/build/common/constants.js var require_constants6 = __commonJS({ "node_modules/socks/build/common/constants.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SOCKS5_NO_ACCEPTABLE_AUTH = exports2.SOCKS5_CUSTOM_AUTH_END = exports2.SOCKS5_CUSTOM_AUTH_START = exports2.SOCKS_INCOMING_PACKET_SIZES = exports2.SocksClientState = exports2.Socks5Response = exports2.Socks5HostType = exports2.Socks5Auth = exports2.Socks4Response = exports2.SocksCommand = exports2.ERRORS = exports2.DEFAULT_TIMEOUT = void 0; var DEFAULT_TIMEOUT = 3e4; exports2.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT; var ERRORS = { InvalidSocksCommand: "An invalid SOCKS command was provided. Valid options are connect, bind, and associate.", InvalidSocksCommandForOperation: "An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.", InvalidSocksCommandChain: "An invalid SOCKS command was provided. Chaining currently only supports the connect command.", InvalidSocksClientOptionsDestination: "An invalid destination host was provided.", InvalidSocksClientOptionsExistingSocket: "An invalid existing socket was provided. This should be an instance of stream.Duplex.", InvalidSocksClientOptionsProxy: "Invalid SOCKS proxy details were provided.", InvalidSocksClientOptionsTimeout: "An invalid timeout value was provided. Please enter a value above 0 (in ms).", InvalidSocksClientOptionsProxiesLength: "At least two socks proxies must be provided for chaining.", InvalidSocksClientOptionsCustomAuthRange: "Custom auth must be a value between 0x80 and 0xFE.", InvalidSocksClientOptionsCustomAuthOptions: "When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.", NegotiationError: "Negotiation error", SocketClosed: "Socket closed", ProxyConnectionTimedOut: "Proxy connection timed out", InternalError: "SocksClient internal error (this should not happen)", InvalidSocks4HandshakeResponse: "Received invalid Socks4 handshake response", Socks4ProxyRejectedConnection: "Socks4 Proxy rejected connection", InvalidSocks4IncomingConnectionResponse: "Socks4 invalid incoming connection response", Socks4ProxyRejectedIncomingBoundConnection: "Socks4 Proxy rejected incoming bound connection", InvalidSocks5InitialHandshakeResponse: "Received invalid Socks5 initial handshake response", InvalidSocks5IntiailHandshakeSocksVersion: "Received invalid Socks5 initial handshake (invalid socks version)", InvalidSocks5InitialHandshakeNoAcceptedAuthType: "Received invalid Socks5 initial handshake (no accepted authentication type)", InvalidSocks5InitialHandshakeUnknownAuthType: "Received invalid Socks5 initial handshake (unknown authentication type)", Socks5AuthenticationFailed: "Socks5 Authentication failed", InvalidSocks5FinalHandshake: "Received invalid Socks5 final handshake response", InvalidSocks5FinalHandshakeRejected: "Socks5 proxy rejected connection", InvalidSocks5IncomingConnectionResponse: "Received invalid Socks5 incoming connection response", Socks5ProxyRejectedIncomingBoundConnection: "Socks5 Proxy rejected incoming bound connection" }; exports2.ERRORS = ERRORS; var SOCKS_INCOMING_PACKET_SIZES = { Socks5InitialHandshakeResponse: 2, Socks5UserPassAuthenticationResponse: 2, // Command response + incoming connection (bind) Socks5ResponseHeader: 5, // We need at least 5 to read the hostname length, then we wait for the address+port information. Socks5ResponseIPv4: 10, // 4 header + 4 ip + 2 port Socks5ResponseIPv6: 22, // 4 header + 16 ip + 2 port Socks5ResponseHostname: (hostNameLength) => hostNameLength + 7, // 4 header + 1 host length + host + 2 port // Command response + incoming connection (bind) Socks4Response: 8 // 2 header + 2 port + 4 ip }; exports2.SOCKS_INCOMING_PACKET_SIZES = SOCKS_INCOMING_PACKET_SIZES; var SocksCommand; (function(SocksCommand2) { SocksCommand2[SocksCommand2["connect"] = 1] = "connect"; SocksCommand2[SocksCommand2["bind"] = 2] = "bind"; SocksCommand2[SocksCommand2["associate"] = 3] = "associate"; })(SocksCommand || (exports2.SocksCommand = SocksCommand = {})); var Socks4Response; (function(Socks4Response2) { Socks4Response2[Socks4Response2["Granted"] = 90] = "Granted"; Socks4Response2[Socks4Response2["Failed"] = 91] = "Failed"; Socks4Response2[Socks4Response2["Rejected"] = 92] = "Rejected"; Socks4Response2[Socks4Response2["RejectedIdent"] = 93] = "RejectedIdent"; })(Socks4Response || (exports2.Socks4Response = Socks4Response = {})); var Socks5Auth; (function(Socks5Auth2) { Socks5Auth2[Socks5Auth2["NoAuth"] = 0] = "NoAuth"; Socks5Auth2[Socks5Auth2["GSSApi"] = 1] = "GSSApi"; Socks5Auth2[Socks5Auth2["UserPass"] = 2] = "UserPass"; })(Socks5Auth || (exports2.Socks5Auth = Socks5Auth = {})); var SOCKS5_CUSTOM_AUTH_START = 128; exports2.SOCKS5_CUSTOM_AUTH_START = SOCKS5_CUSTOM_AUTH_START; var SOCKS5_CUSTOM_AUTH_END = 254; exports2.SOCKS5_CUSTOM_AUTH_END = SOCKS5_CUSTOM_AUTH_END; var SOCKS5_NO_ACCEPTABLE_AUTH = 255; exports2.SOCKS5_NO_ACCEPTABLE_AUTH = SOCKS5_NO_ACCEPTABLE_AUTH; var Socks5Response; (function(Socks5Response2) { Socks5Response2[Socks5Response2["Granted"] = 0] = "Granted"; Socks5Response2[Socks5Response2["Failure"] = 1] = "Failure"; Socks5Response2[Socks5Response2["NotAllowed"] = 2] = "NotAllowed"; Socks5Response2[Socks5Response2["NetworkUnreachable"] = 3] = "NetworkUnreachable"; Socks5Response2[Socks5Response2["HostUnreachable"] = 4] = "HostUnreachable"; Socks5Response2[Socks5Response2["ConnectionRefused"] = 5] = "ConnectionRefused"; Socks5Response2[Socks5Response2["TTLExpired"] = 6] = "TTLExpired"; Socks5Response2[Socks5Response2["CommandNotSupported"] = 7] = "CommandNotSupported"; Socks5Response2[Socks5Response2["AddressNotSupported"] = 8] = "AddressNotSupported"; })(Socks5Response || (exports2.Socks5Response = Socks5Response = {})); var Socks5HostType; (function(Socks5HostType2) { Socks5HostType2[Socks5HostType2["IPv4"] = 1] = "IPv4"; Socks5HostType2[Socks5HostType2["Hostname"] = 3] = "Hostname"; Socks5HostType2[Socks5HostType2["IPv6"] = 4] = "IPv6"; })(Socks5HostType || (exports2.Socks5HostType = Socks5HostType = {})); var SocksClientState; (function(SocksClientState2) { SocksClientState2[SocksClientState2["Created"] = 0] = "Created"; SocksClientState2[SocksClientState2["Connecting"] = 1] = "Connecting"; SocksClientState2[SocksClientState2["Connected"] = 2] = "Connected"; SocksClientState2[SocksClientState2["SentInitialHandshake"] = 3] = "SentInitialHandshake"; SocksClientState2[SocksClientState2["ReceivedInitialHandshakeResponse"] = 4] = "ReceivedInitialHandshakeResponse"; SocksClientState2[SocksClientState2["SentAuthentication"] = 5] = "SentAuthentication"; SocksClientState2[SocksClientState2["ReceivedAuthenticationResponse"] = 6] = "ReceivedAuthenticationResponse"; SocksClientState2[SocksClientState2["SentFinalHandshake"] = 7] = "SentFinalHandshake"; SocksClientState2[SocksClientState2["ReceivedFinalResponse"] = 8] = "ReceivedFinalResponse"; SocksClientState2[SocksClientState2["BoundWaitingForConnection"] = 9] = "BoundWaitingForConnection"; SocksClientState2[SocksClientState2["Established"] = 10] = "Established"; SocksClientState2[SocksClientState2["Disconnected"] = 11] = "Disconnected"; SocksClientState2[SocksClientState2["Error"] = 99] = "Error"; })(SocksClientState || (exports2.SocksClientState = SocksClientState = {})); } }); // node_modules/socks/build/common/util.js var require_util9 = __commonJS({ "node_modules/socks/build/common/util.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.shuffleArray = exports2.SocksClientError = void 0; var SocksClientError = class extends Error { constructor(message, options) { super(message); this.options = options; } }; exports2.SocksClientError = SocksClientError; function shuffleArray(array) { for (let i5 = array.length - 1; i5 > 0; i5--) { const j5 = Math.floor(Math.random() * (i5 + 1)); [array[i5], array[j5]] = [array[j5], array[i5]]; } } exports2.shuffleArray = shuffleArray; } }); // node_modules/ip-address/dist/address-error.js var require_address_error = __commonJS({ "node_modules/ip-address/dist/address-error.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.AddressError = void 0; var AddressError = class extends Error { constructor(message, parseMessage) { super(message); this.name = "AddressError"; this.parseMessage = parseMessage; } }; exports2.AddressError = AddressError; } }); // node_modules/ip-address/dist/common.js var require_common2 = __commonJS({ "node_modules/ip-address/dist/common.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.isInSubnet = isInSubnet; exports2.isCorrect = isCorrect; exports2.prefixLengthFromMask = prefixLengthFromMask; exports2.numberToPaddedHex = numberToPaddedHex; exports2.stringToPaddedHex = stringToPaddedHex; exports2.testBit = testBit; var address_error_1 = require_address_error(); function isInSubnet(address) { if (this.subnetMask < address.subnetMask) { return false; } if (this.mask(address.subnetMask) === address.mask()) { return true; } return false; } function isCorrect(defaultBits) { return function() { if (this.addressMinusSuffix !== this.correctForm()) { return false; } if (this.subnetMask === defaultBits && !this.parsedSubnet) { return true; } return this.parsedSubnet === String(this.subnetMask); }; } function prefixLengthFromMask(value, totalBits) { const binary = value.toString(2).padStart(totalBits, "0"); if (binary.length > totalBits) { throw new address_error_1.AddressError("Invalid subnet mask."); } const firstZero = binary.indexOf("0"); if (firstZero === -1) { return totalBits; } if (binary.slice(firstZero).includes("1")) { throw new address_error_1.AddressError("Invalid subnet mask."); } return firstZero; } function numberToPaddedHex(number) { return number.toString(16).padStart(2, "0"); } function stringToPaddedHex(numberString) { return numberToPaddedHex(parseInt(numberString, 10)); } function testBit(binaryValue, position) { const { length } = binaryValue; if (position > length) { return false; } const positionInString = length - position; return binaryValue.substring(positionInString, positionInString + 1) === "1"; } } }); // node_modules/ip-address/dist/v4/constants.js var require_constants7 = __commonJS({ "node_modules/ip-address/dist/v4/constants.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RE_SUBNET_STRING = exports2.RE_ADDRESS = exports2.GROUPS = exports2.BITS = void 0; exports2.BITS = 32; exports2.GROUPS = 4; exports2.RE_ADDRESS = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g; exports2.RE_SUBNET_STRING = /\/\d{1,2}$/; } }); // node_modules/ip-address/dist/ipv4.js var require_ipv4 = __commonJS({ "node_modules/ip-address/dist/ipv4.js"(exports2) { "use strict"; var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; var desc = Object.getOwnPropertyDescriptor(m3, k5); if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m3[k5]; } }; } Object.defineProperty(o2, k22, desc); }) : (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; o2[k22] = m3[k5]; })); var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { Object.defineProperty(o2, "default", { enumerable: true, value: v }); }) : function(o2, v) { o2["default"] = v; }); var __importStar2 = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k5 in mod) if (k5 !== "default" && Object.prototype.hasOwnProperty.call(mod, k5)) __createBinding2(result, mod, k5); } __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Address4 = void 0; var common = __importStar2(require_common2()); var constants3 = __importStar2(require_constants7()); var address_error_1 = require_address_error(); var isCorrect4 = common.isCorrect(constants3.BITS); var Address4 = class _Address4 { constructor(address) { this.groups = constants3.GROUPS; this.parsedAddress = []; this.parsedSubnet = ""; this.subnet = "/32"; this.subnetMask = 32; this.v4 = true; this.isCorrect = isCorrect4; this.isInSubnet = common.isInSubnet; this.address = address; const subnet = constants3.RE_SUBNET_STRING.exec(address); if (subnet) { this.parsedSubnet = subnet[0].replace("/", ""); this.subnetMask = parseInt(this.parsedSubnet, 10); this.subnet = `/${this.subnetMask}`; if (this.subnetMask < 0 || this.subnetMask > constants3.BITS) { throw new address_error_1.AddressError("Invalid subnet mask."); } address = address.replace(constants3.RE_SUBNET_STRING, ""); } this.addressMinusSuffix = address; this.parsedAddress = this.parse(address); } /** * Returns true if the given string is a valid IPv4 address (with optional * CIDR subnet), false otherwise. Host bits in the subnet portion are * allowed (e.g. `192.168.1.5/24` is valid); for strict network-address * validation compare `correctForm()` to `startAddress().correctForm()`, * or use `networkForm()`. */ static isValid(address) { try { new _Address4(address); return true; } catch (e5) { return false; } } /** * Parses an IPv4 address string into its four octet groups and stores the * result on `this.parsedAddress`. Called automatically by the constructor; * you typically don't need to call it directly. Throws `AddressError` if * the input is not a valid IPv4 address. */ parse(address) { const groups = address.split("."); if (!address.match(constants3.RE_ADDRESS)) { throw new address_error_1.AddressError("Invalid IPv4 address."); } return groups; } /** * Returns the address in correct form: octets joined with `.` and any * leading zeros stripped (e.g. `192.168.1.1`). For IPv4 this matches the * canonical dotted-decimal representation. */ correctForm() { return this.parsedAddress.map((part) => parseInt(part, 10)).join("."); } /** * Construct an `Address4` from an address and a dotted-decimal subnet * mask given as separate strings (e.g. as returned by Node's * `os.networkInterfaces()`). Throws `AddressError` if the mask is * non-contiguous (e.g. `255.0.255.0`). * @example * var address = Address4.fromAddressAndMask('192.168.1.1', '255.255.255.0'); * address.subnetMask; // 24 */ static fromAddressAndMask(address, mask) { const bits = common.prefixLengthFromMask(new _Address4(mask).bigInt(), constants3.BITS); return new _Address4(`${address}/${bits}`); } /** * Construct an `Address4` from an address and a Cisco-style wildcard mask * given as separate strings (e.g. `0.0.0.255` for a `/24`). The wildcard * mask is the bitwise inverse of the subnet mask. Throws `AddressError` * if the mask is non-contiguous (e.g. `0.255.0.255`). * @example * var address = Address4.fromAddressAndWildcardMask('10.0.0.1', '0.0.0.255'); * address.subnetMask; // 24 */ static fromAddressAndWildcardMask(address, wildcardMask) { const wildcard = new _Address4(wildcardMask).bigInt(); const allOnes = (BigInt(1) << BigInt(constants3.BITS)) - BigInt(1); const mask = wildcard ^ allOnes; const bits = common.prefixLengthFromMask(mask, constants3.BITS); return new _Address4(`${address}/${bits}`); } /** * Construct an `Address4` from a wildcard pattern with trailing `*` * octets. The number of trailing wildcards determines the prefix * length: each `*` represents 8 bits. * * Only trailing whole-octet wildcards are supported. Partial-octet * wildcards (e.g. `192.168.0.1*`) and interior wildcards (e.g. * `192.*.0.1`) throw `AddressError`. * @example * Address4.fromWildcard('192.168.0.*').subnet; // '/24' * Address4.fromWildcard('192.168.*.*').subnet; // '/16' * Address4.fromWildcard('*.*.*.*').subnet; // '/0' */ static fromWildcard(input) { const groups = input.split("."); if (groups.length !== constants3.GROUPS) { throw new address_error_1.AddressError("Wildcard pattern must have 4 octets"); } let firstWildcard = -1; for (let i5 = 0; i5 < groups.length; i5++) { if (groups[i5] === "*") { if (firstWildcard === -1) { firstWildcard = i5; } } else if (firstWildcard !== -1) { throw new address_error_1.AddressError("Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)"); } } const trailing = firstWildcard === -1 ? 0 : groups.length - firstWildcard; const replaced = groups.map((g5) => g5 === "*" ? "0" : g5); const subnetBits = constants3.BITS - trailing * 8; return new _Address4(`${replaced.join(".")}/${subnetBits}`); } /** * Converts a hex string to an IPv4 address object. Accepts 8 hex digits * with optional `:` separators (e.g. `'7f000001'` or `'7f:00:00:01'`). * Throws `AddressError` for any other length or for non-hex characters. * @param {string} hex - a hex string to convert * @returns {Address4} */ static fromHex(hex) { const stripped = hex.replace(/:/g, ""); if (!/^[0-9a-fA-F]{8}$/.test(stripped)) { throw new address_error_1.AddressError("IPv4 hex must be exactly 8 hex digits"); } const groups = []; for (let i5 = 0; i5 < 8; i5 += 2) { groups.push(parseInt(stripped.slice(i5, i5 + 2), 16)); } return new _Address4(groups.join(".")); } /** * Converts an integer into a IPv4 address object. The integer must be a * non-negative safe integer in the range `[0, 2**32 - 1]`; otherwise * `AddressError` is thrown. * @param {integer} integer - a number to convert * @returns {Address4} */ static fromInteger(integer) { if (!Number.isInteger(integer) || integer < 0 || integer > 4294967295) { throw new address_error_1.AddressError("IPv4 integer must be in the range 0 to 2**32 - 1"); } return _Address4.fromHex(integer.toString(16).padStart(8, "0")); } /** * Return an address from in-addr.arpa form * @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address * @returns {Adress4} * @example * var address = Address4.fromArpa(42.2.0.192.in-addr.arpa.) * address.correctForm(); // '192.0.2.42' */ static fromArpa(arpaFormAddress) { const leader = arpaFormAddress.replace(/(\.in-addr\.arpa)?\.$/, ""); const address = leader.split(".").reverse().join("."); return new _Address4(address); } /** * Converts an IPv4 address object to a hex string * @returns {String} */ toHex() { return this.parsedAddress.map((part) => common.stringToPaddedHex(part)).join(":"); } /** * Converts an IPv4 address object to an array of bytes. * * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toArray())`. * @returns {Array} */ toArray() { return this.parsedAddress.map((part) => parseInt(part, 10)); } /** * Converts an IPv4 address object to an IPv6 address group * @returns {String} */ toGroup6() { const output = []; let i5; for (i5 = 0; i5 < constants3.GROUPS; i5 += 2) { output.push(`${common.stringToPaddedHex(this.parsedAddress[i5])}${common.stringToPaddedHex(this.parsedAddress[i5 + 1])}`); } return output.join(":"); } /** * Returns the address as a `bigint` * @returns {bigint} */ bigInt() { return BigInt(`0x${this.parsedAddress.map((n3) => common.stringToPaddedHex(n3)).join("")}`); } /** * Helper function getting start address. * @returns {bigint} */ _startAddress() { return BigInt(`0b${this.mask() + "0".repeat(constants3.BITS - this.subnetMask)}`); } /** * The first address in the range given by this address' subnet. * Often referred to as the Network Address. * @returns {Address4} */ startAddress() { return _Address4.fromBigInt(this._startAddress()); } /** * The first host address in the range given by this address's subnet ie * the first address after the Network Address * @returns {Address4} */ startAddressExclusive() { const adjust = BigInt("1"); return _Address4.fromBigInt(this._startAddress() + adjust); } /** * Helper function getting end address. * @returns {bigint} */ _endAddress() { return BigInt(`0b${this.mask() + "1".repeat(constants3.BITS - this.subnetMask)}`); } /** * The last address in the range given by this address' subnet * Often referred to as the Broadcast * @returns {Address4} */ endAddress() { return _Address4.fromBigInt(this._endAddress()); } /** * The last host address in the range given by this address's subnet ie * the last address prior to the Broadcast Address * @returns {Address4} */ endAddressExclusive() { const adjust = BigInt("1"); return _Address4.fromBigInt(this._endAddress() - adjust); } /** * The dotted-decimal form of the subnet mask, e.g. `255.255.240.0` for * a `/20`. Returns an `Address4`; call `.correctForm()` for the string. * @returns {Address4} */ subnetMaskAddress() { return _Address4.fromBigInt(BigInt(`0b${"1".repeat(this.subnetMask)}${"0".repeat(constants3.BITS - this.subnetMask)}`)); } /** * The Cisco-style wildcard mask, e.g. `0.0.0.255` for a `/24`. This is * the bitwise inverse of `subnetMaskAddress()`. Returns an `Address4`; * call `.correctForm()` for the string. * @returns {Address4} */ wildcardMask() { return _Address4.fromBigInt(BigInt(`0b${"0".repeat(this.subnetMask)}${"1".repeat(constants3.BITS - this.subnetMask)}`)); } /** * The network address in CIDR string form, e.g. `192.168.1.0/24` for * `192.168.1.5/24`. For an address with no explicit subnet the prefix is * `/32`, e.g. `networkForm()` on `192.168.1.5` returns `192.168.1.5/32`. * @returns {string} */ networkForm() { return `${this.startAddress().correctForm()}/${this.subnetMask}`; } /** * Converts a BigInt to a v4 address object. The value must be in the * range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown. * @param {bigint} bigInt - a BigInt to convert * @returns {Address4} */ static fromBigInt(bigInt) { if (bigInt < 0n || bigInt > 0xffffffffn) { throw new address_error_1.AddressError("IPv4 BigInt must be in the range 0 to 2**32 - 1"); } return _Address4.fromHex(bigInt.toString(16).padStart(8, "0")); } /** * Convert a byte array to an Address4 object. * * To convert from a Node.js `Buffer`, spread it: `Address4.fromByteArray([...buf])`. * @param {Array} bytes - an array of 4 bytes (0-255) * @returns {Address4} */ static fromByteArray(bytes) { if (bytes.length !== 4) { throw new address_error_1.AddressError("IPv4 addresses require exactly 4 bytes"); } for (let i5 = 0; i5 < bytes.length; i5++) { if (!Number.isInteger(bytes[i5]) || bytes[i5] < 0 || bytes[i5] > 255) { throw new address_error_1.AddressError("All bytes must be integers between 0 and 255"); } } return this.fromUnsignedByteArray(bytes); } /** * Convert an unsigned byte array to an Address4 object * @param {Array} bytes - an array of 4 unsigned bytes (0-255) * @returns {Address4} */ static fromUnsignedByteArray(bytes) { if (bytes.length !== 4) { throw new address_error_1.AddressError("IPv4 addresses require exactly 4 bytes"); } const address = bytes.join("."); return new _Address4(address); } /** * Returns the first n bits of the address, defaulting to the * subnet mask * @returns {String} */ mask(mask) { if (mask === void 0) { mask = this.subnetMask; } return this.getBitsBase2(0, mask); } /** * Returns the bits in the given range as a base-2 string * @returns {string} */ getBitsBase2(start, end) { return this.binaryZeroPad().slice(start, end); } /** * Return the reversed ip6.arpa form of the address * @param {Object} options * @param {boolean} options.omitSuffix - omit the "in-addr.arpa" suffix * @returns {String} */ reverseForm(options) { if (!options) { options = {}; } const reversed = this.correctForm().split(".").reverse().join("."); if (options.omitSuffix) { return reversed; } return `${reversed}.in-addr.arpa.`; } /** * Returns true if the given address is a multicast address * @returns {boolean} */ isMulticast() { return this.isInSubnet(MULTICAST_V4); } /** * Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`). * @returns {boolean} */ isPrivate() { return PRIVATE_V4.some((subnet) => this.isInSubnet(subnet)); } /** * Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)). * @returns {boolean} */ isLoopback() { return this.isInSubnet(LOOPBACK_V4); } /** * Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)). * @returns {boolean} */ isLinkLocal() { return this.isInSubnet(LINK_LOCAL_V4); } /** * Returns true if the address is the unspecified address `0.0.0.0`. * @returns {boolean} */ isUnspecified() { return this.isInSubnet(UNSPECIFIED_V4); } /** * Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)). * @returns {boolean} */ isBroadcast() { return this.isInSubnet(BROADCAST_V4); } /** * Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)). * @returns {boolean} */ isCGNAT() { return this.isInSubnet(CGNAT_V4); } /** * Returns a zero-padded base-2 string representation of the address * @returns {string} */ binaryZeroPad() { if (this._binaryZeroPad === void 0) { this._binaryZeroPad = this.bigInt().toString(2).padStart(constants3.BITS, "0"); } return this._binaryZeroPad; } /** * Groups an IPv4 address for inclusion at the end of an IPv6 address * @returns {String} */ groupForV6() { const segments = this.parsedAddress; return this.address.replace(constants3.RE_ADDRESS, `${segments.slice(0, 2).join(".")}.${segments.slice(2, 4).join(".")}`); } }; exports2.Address4 = Address4; var MULTICAST_V4 = new Address4("224.0.0.0/4"); var PRIVATE_V4 = [ new Address4("10.0.0.0/8"), new Address4("172.16.0.0/12"), new Address4("192.168.0.0/16") ]; var LOOPBACK_V4 = new Address4("127.0.0.0/8"); var LINK_LOCAL_V4 = new Address4("169.254.0.0/16"); var UNSPECIFIED_V4 = new Address4("0.0.0.0/32"); var BROADCAST_V4 = new Address4("255.255.255.255/32"); var CGNAT_V4 = new Address4("100.64.0.0/10"); } }); // node_modules/ip-address/dist/v6/constants.js var require_constants8 = __commonJS({ "node_modules/ip-address/dist/v6/constants.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RE_URL_WITH_PORT = exports2.RE_URL = exports2.RE_ZONE_STRING = exports2.RE_SUBNET_STRING = exports2.RE_BAD_ADDRESS = exports2.RE_BAD_CHARACTERS = exports2.TYPES = exports2.SCOPES = exports2.GROUPS = exports2.BITS = void 0; exports2.BITS = 128; exports2.GROUPS = 8; exports2.SCOPES = { 0: "Reserved", 1: "Interface local", 2: "Link local", 4: "Admin local", 5: "Site local", 8: "Organization local", 14: "Global", 15: "Reserved" }; exports2.TYPES = { "ff01::1/128": "Multicast (All nodes on this interface)", "ff01::2/128": "Multicast (All routers on this interface)", "ff02::1/128": "Multicast (All nodes on this link)", "ff02::2/128": "Multicast (All routers on this link)", "ff05::2/128": "Multicast (All routers in this site)", "ff02::5/128": "Multicast (OSPFv3 AllSPF routers)", "ff02::6/128": "Multicast (OSPFv3 AllDR routers)", "ff02::9/128": "Multicast (RIP routers)", "ff02::a/128": "Multicast (EIGRP routers)", "ff02::d/128": "Multicast (PIM routers)", "ff02::16/128": "Multicast (MLDv2 reports)", "ff01::fb/128": "Multicast (mDNSv6)", "ff02::fb/128": "Multicast (mDNSv6)", "ff05::fb/128": "Multicast (mDNSv6)", "ff02::1:2/128": "Multicast (All DHCP servers and relay agents on this link)", "ff05::1:2/128": "Multicast (All DHCP servers and relay agents in this site)", "ff02::1:3/128": "Multicast (All DHCP servers on this link)", "ff05::1:3/128": "Multicast (All DHCP servers in this site)", "::/128": "Unspecified", "::1/128": "Loopback", "ff00::/8": "Multicast", "fe80::/10": "Link-local unicast", "fc00::/7": "Unique local", "2002::/16": "6to4", "2001:db8::/32": "Documentation", "64:ff9b::/96": "NAT64 (well-known)", "64:ff9b:1::/48": "NAT64 (local-use)" }; exports2.RE_BAD_CHARACTERS = /([^0-9a-f:/%])/gi; exports2.RE_BAD_ADDRESS = /([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi; exports2.RE_SUBNET_STRING = /\/\d{1,3}(?=%|$)/; exports2.RE_ZONE_STRING = /%.*$/; exports2.RE_URL = /^\[{0,1}([0-9a-f:]+)\]{0,1}/; exports2.RE_URL_WITH_PORT = /\[([0-9a-f:]+)\]:([0-9]{1,5})/; } }); // node_modules/ip-address/dist/v6/helpers.js var require_helpers = __commonJS({ "node_modules/ip-address/dist/v6/helpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.escapeHtml = escapeHtml; exports2.spanAllZeroes = spanAllZeroes; exports2.spanAll = spanAll; exports2.spanLeadingZeroes = spanLeadingZeroes; exports2.simpleGroup = simpleGroup; function escapeHtml(s) { return s.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); } function spanAllZeroes(s) { return escapeHtml(s).replace(/(0+)/g, '$1'); } function spanAll(s, offset = 0) { const letters = s.split(""); return letters.map((n3, i5) => `${spanAllZeroes(n3)}`).join(""); } function spanLeadingZeroesSimple(group) { return escapeHtml(group).replace(/^(0+)/, '$1'); } function spanLeadingZeroes(address) { const groups = address.split(":"); return groups.map((g5) => spanLeadingZeroesSimple(g5)).join(":"); } function simpleGroup(addressString, offset = 0) { const groups = addressString.split(":"); return groups.map((g5, i5) => { if (/group-v4/.test(g5)) { return g5; } return `${spanLeadingZeroesSimple(g5)}`; }); } } }); // node_modules/ip-address/dist/v6/regular-expressions.js var require_regular_expressions = __commonJS({ "node_modules/ip-address/dist/v6/regular-expressions.js"(exports2) { "use strict"; var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; var desc = Object.getOwnPropertyDescriptor(m3, k5); if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m3[k5]; } }; } Object.defineProperty(o2, k22, desc); }) : (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; o2[k22] = m3[k5]; })); var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { Object.defineProperty(o2, "default", { enumerable: true, value: v }); }) : function(o2, v) { o2["default"] = v; }); var __importStar2 = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k5 in mod) if (k5 !== "default" && Object.prototype.hasOwnProperty.call(mod, k5)) __createBinding2(result, mod, k5); } __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ADDRESS_BOUNDARY = void 0; exports2.groupPossibilities = groupPossibilities; exports2.padGroup = padGroup; exports2.simpleRegularExpression = simpleRegularExpression; exports2.possibleElisions = possibleElisions; var v6 = __importStar2(require_constants8()); function groupPossibilities(possibilities) { return `(${possibilities.join("|")})`; } function padGroup(group) { if (group.length < 4) { return `0{0,${4 - group.length}}${group}`; } return group; } exports2.ADDRESS_BOUNDARY = "[^A-Fa-f0-9:]"; function simpleRegularExpression(groups) { const zeroIndexes = []; groups.forEach((group, i5) => { const groupInteger = parseInt(group, 16); if (groupInteger === 0) { zeroIndexes.push(i5); } }); const possibilities = zeroIndexes.map((zeroIndex) => groups.map((group, i5) => { if (i5 === zeroIndex) { const elision = i5 === 0 || i5 === v6.GROUPS - 1 ? ":" : ""; return groupPossibilities([padGroup(group), elision]); } return padGroup(group); }).join(":")); possibilities.push(groups.map(padGroup).join(":")); return groupPossibilities(possibilities); } function possibleElisions(elidedGroups, moreLeft, moreRight) { const left = moreLeft ? "" : ":"; const right = moreRight ? "" : ":"; const possibilities = []; if (!moreLeft && !moreRight) { possibilities.push("::"); } if (moreLeft && moreRight) { possibilities.push(""); } if (moreRight && !moreLeft || !moreRight && moreLeft) { possibilities.push(":"); } possibilities.push(`${left}(:0{1,4}){1,${elidedGroups - 1}}`); possibilities.push(`(0{1,4}:){1,${elidedGroups - 1}}${right}`); possibilities.push(`(0{1,4}:){${elidedGroups - 1}}0{1,4}`); for (let groups = 1; groups < elidedGroups - 1; groups++) { for (let position = 1; position < elidedGroups - groups; position++) { possibilities.push(`(0{1,4}:){${position}}:(0{1,4}:){${elidedGroups - position - groups - 1}}0{1,4}`); } } return groupPossibilities(possibilities); } } }); // node_modules/ip-address/dist/ipv6.js var require_ipv6 = __commonJS({ "node_modules/ip-address/dist/ipv6.js"(exports2) { "use strict"; var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; var desc = Object.getOwnPropertyDescriptor(m3, k5); if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m3[k5]; } }; } Object.defineProperty(o2, k22, desc); }) : (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; o2[k22] = m3[k5]; })); var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { Object.defineProperty(o2, "default", { enumerable: true, value: v }); }) : function(o2, v) { o2["default"] = v; }); var __importStar2 = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k5 in mod) if (k5 !== "default" && Object.prototype.hasOwnProperty.call(mod, k5)) __createBinding2(result, mod, k5); } __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Address6 = void 0; var common = __importStar2(require_common2()); var constants4 = __importStar2(require_constants7()); var constants6 = __importStar2(require_constants8()); var helpers = __importStar2(require_helpers()); var ipv4_1 = require_ipv4(); var regular_expressions_1 = require_regular_expressions(); var address_error_1 = require_address_error(); var common_1 = require_common2(); var isCorrect6 = common.isCorrect(constants6.BITS); function assert4(condition) { if (!condition) { throw new Error("Assertion failed."); } } function addCommas(number) { const r5 = /(\d+)(\d{3})/; while (r5.test(number)) { number = number.replace(r5, "$1,$2"); } return number; } function spanLeadingZeroes4(n3) { n3 = n3.replace(/^(0{1,})([1-9]+)$/, '$1$2'); n3 = n3.replace(/^(0{1,})(0)$/, '$1$2'); return n3; } function compact(address, slice) { const s1 = []; const s2 = []; let i5; for (i5 = 0; i5 < address.length; i5++) { if (i5 < slice[0]) { s1.push(address[i5]); } else if (i5 > slice[1]) { s2.push(address[i5]); } } return s1.concat(["compact"]).concat(s2); } function paddedHex(octet) { return parseInt(octet, 16).toString(16).padStart(4, "0"); } function unsignByte(b6) { return b6 & 255; } var Address6 = class _Address6 { constructor(address, optionalGroups) { this.addressMinusSuffix = ""; this.parsedSubnet = ""; this.subnet = "/128"; this.subnetMask = 128; this.v4 = false; this.zone = ""; this.isInSubnet = common.isInSubnet; this.isCorrect = isCorrect6; if (optionalGroups === void 0) { this.groups = constants6.GROUPS; } else { this.groups = optionalGroups; } this.address = address; const subnet = constants6.RE_SUBNET_STRING.exec(address); if (subnet) { this.parsedSubnet = subnet[0].replace("/", ""); this.subnetMask = parseInt(this.parsedSubnet, 10); this.subnet = `/${this.subnetMask}`; if (Number.isNaN(this.subnetMask) || this.subnetMask < 0 || this.subnetMask > constants6.BITS) { throw new address_error_1.AddressError("Invalid subnet mask."); } address = address.replace(constants6.RE_SUBNET_STRING, ""); } else if (/\//.test(address)) { throw new address_error_1.AddressError("Invalid subnet mask."); } const zone = constants6.RE_ZONE_STRING.exec(address); if (zone) { this.zone = zone[0]; address = address.replace(constants6.RE_ZONE_STRING, ""); } this.addressMinusSuffix = address; this.parsedAddress = this.parse(this.addressMinusSuffix); } /** * Returns true if the given string is a valid IPv6 address (with optional * CIDR subnet and zone identifier), false otherwise. Host bits in the * subnet portion are allowed (e.g. `2001:db8::1/32` is valid); for strict * network-address validation compare `correctForm()` to * `startAddress().correctForm()`, or use `networkForm()`. */ static isValid(address) { try { new _Address6(address); return true; } catch (e5) { return false; } } /** * Convert a BigInt to a v6 address object. The value must be in the * range `[0, 2**128 - 1]`; otherwise `AddressError` is thrown. * @param {bigint} bigInt - a BigInt to convert * @returns {Address6} * @example * var bigInt = BigInt('1000000000000'); * var address = Address6.fromBigInt(bigInt); * address.correctForm(); // '::e8:d4a5:1000' */ static fromBigInt(bigInt) { if (bigInt < 0n || bigInt > (1n << BigInt(constants6.BITS)) - 1n) { throw new address_error_1.AddressError("IPv6 BigInt must be in the range 0 to 2**128 - 1"); } const hex = bigInt.toString(16).padStart(32, "0"); const groups = []; for (let i5 = 0; i5 < constants6.GROUPS; i5++) { groups.push(hex.slice(i5 * 4, (i5 + 1) * 4)); } return new _Address6(groups.join(":")); } /** * Parse a URL (with optional bracketed host and port) into an address and * port. Returns either `{ address, port }` on success or * `{ error, address: null, port: null }` if the URL could not be parsed. * Ports are returned as numbers (or `null` if absent or out of range). * @example * var addressAndPort = Address6.fromURL('http://[ffff::]:8080/foo/'); * addressAndPort.address.correctForm(); // 'ffff::' * addressAndPort.port; // 8080 */ static fromURL(url) { let host; let port = null; let result; if (url.indexOf("[") !== -1 && url.indexOf("]:") !== -1) { result = constants6.RE_URL_WITH_PORT.exec(url); if (result === null) { return { error: "failed to parse address with port", address: null, port: null }; } host = result[1]; port = result[2]; } else if (url.indexOf("/") !== -1) { url = url.replace(/^[a-z0-9]+:\/\//, ""); result = constants6.RE_URL.exec(url); if (result === null) { return { error: "failed to parse address from URL", address: null, port: null }; } host = result[1]; } else { host = url; } if (port) { port = parseInt(port, 10); if (port < 0 || port > 65536) { port = null; } } else { port = null; } return { address: new _Address6(host), port }; } /** * Construct an `Address6` from an address and a hex subnet mask given as * separate strings (e.g. as returned by Node's `os.networkInterfaces()`). * Throws `AddressError` if the mask is non-contiguous (e.g. * `ffff::ffff`). * @example * var address = Address6.fromAddressAndMask('fe80::1', 'ffff:ffff:ffff:ffff::'); * address.subnetMask; // 64 */ static fromAddressAndMask(address, mask) { const bits = common.prefixLengthFromMask(new _Address6(mask).bigInt(), constants6.BITS); return new _Address6(`${address}/${bits}`); } /** * Construct an `Address6` from an address and a Cisco-style wildcard mask * given as separate strings (e.g. `::ffff:ffff:ffff:ffff` for a `/64`). * The wildcard mask is the bitwise inverse of the subnet mask. Throws * `AddressError` if the mask is non-contiguous. * @example * var address = Address6.fromAddressAndWildcardMask('fe80::1', '::ffff:ffff:ffff:ffff'); * address.subnetMask; // 64 */ static fromAddressAndWildcardMask(address, wildcardMask) { const wildcard = new _Address6(wildcardMask).bigInt(); const allOnes = (BigInt(1) << BigInt(constants6.BITS)) - BigInt(1); const mask = wildcard ^ allOnes; const bits = common.prefixLengthFromMask(mask, constants6.BITS); return new _Address6(`${address}/${bits}`); } /** * Construct an `Address6` from a wildcard pattern with trailing `*` * groups. The number of trailing wildcards determines the prefix * length: each `*` represents 16 bits. `::` is expanded to zero groups * (not wildcards) before evaluating trailing wildcards. * * Only trailing whole-group wildcards are supported. Partial-group * wildcards (e.g. `2001:db8::0*`) and interior wildcards (e.g. * `*::1`) throw `AddressError`. * @example * Address6.fromWildcard('2001:db8:*:*:*:*:*:*').subnet; // '/32' * Address6.fromWildcard('2001:db8::*').subnet; // '/112' * Address6.fromWildcard('*:*:*:*:*:*:*:*').subnet; // '/0' */ static fromWildcard(input) { if (input.includes("%") || input.includes("/")) { throw new address_error_1.AddressError("Wildcard pattern must not include a zone or CIDR suffix"); } const halves = input.split("::"); if (halves.length > 2) { throw new address_error_1.AddressError("Wildcard pattern cannot contain more than one '::'"); } let groups; if (halves.length === 2) { const left = halves[0] === "" ? [] : halves[0].split(":"); const right = halves[1] === "" ? [] : halves[1].split(":"); const remaining = constants6.GROUPS - left.length - right.length; if (remaining < 1) { throw new address_error_1.AddressError("Wildcard pattern with '::' has too many groups"); } groups = [...left, ...new Array(remaining).fill("0"), ...right]; } else { groups = input.split(":"); } if (groups.length !== constants6.GROUPS) { throw new address_error_1.AddressError("Wildcard pattern must have 8 groups"); } let firstWildcard = -1; for (let i5 = 0; i5 < groups.length; i5++) { if (groups[i5] === "*") { if (firstWildcard === -1) { firstWildcard = i5; } } else if (firstWildcard !== -1) { throw new address_error_1.AddressError("Wildcard `*` must only appear in trailing groups (e.g. `2001:db8:*:*:*:*:*:*`)"); } } const trailing = firstWildcard === -1 ? 0 : groups.length - firstWildcard; const replaced = groups.map((g5) => g5 === "*" ? "0" : g5); const subnetBits = constants6.BITS - trailing * 16; return new _Address6(`${replaced.join(":")}/${subnetBits}`); } /** * Create an IPv6-mapped address given an IPv4 address * @param {string} address - An IPv4 address string * @returns {Address6} * @example * var address = Address6.fromAddress4('192.168.0.1'); * address.correctForm(); // '::ffff:c0a8:1' * address.to4in6(); // '::ffff:192.168.0.1' */ static fromAddress4(address) { const address4 = new ipv4_1.Address4(address); const mask6 = constants6.BITS - (constants4.BITS - address4.subnetMask); return new _Address6(`::ffff:${address4.correctForm()}/${mask6}`); } /** * Return an address from ip6.arpa form * @param {string} arpaFormAddress - an 'ip6.arpa' form address * @returns {Adress6} * @example * var address = Address6.fromArpa(e.f.f.f.3.c.2.6.f.f.f.e.6.6.8.e.1.0.6.7.9.4.e.c.0.0.0.0.1.0.0.2.ip6.arpa.) * address.correctForm(); // '2001:0:ce49:7601:e866:efff:62c3:fffe' */ static fromArpa(arpaFormAddress) { let address = arpaFormAddress.replace(/(\.ip6\.arpa)?\.$/, ""); const semicolonAmount = 7; if (address.length !== 63) { throw new address_error_1.AddressError("Invalid 'ip6.arpa' form."); } const parts = address.split(".").reverse(); for (let i5 = semicolonAmount; i5 > 0; i5--) { const insertIndex = i5 * 4; parts.splice(insertIndex, 0, ":"); } address = parts.join(""); return new _Address6(address); } /** * Return the Microsoft UNC transcription of the address * @returns {String} the Microsoft UNC transcription of the address */ microsoftTranscription() { return `${this.correctForm().replace(/:/g, "-")}.ipv6-literal.net`; } /** * Return the first n bits of the address, defaulting to the subnet mask * @param {number} [mask=subnet] - the number of bits to mask * @returns {String} the first n bits of the address as a string */ mask(mask = this.subnetMask) { return this.getBitsBase2(0, mask); } /** * Return the number of possible subnets of a given size in the address * @param {number} [subnetSize=128] - the subnet size * @returns {String} */ // TODO: probably useful to have a numeric version of this too possibleSubnets(subnetSize = 128) { const availableBits = constants6.BITS - this.subnetMask; const subnetBits = Math.abs(subnetSize - constants6.BITS); const subnetPowers = availableBits - subnetBits; if (subnetPowers < 0) { return "0"; } return addCommas((BigInt("2") ** BigInt(subnetPowers)).toString(10)); } /** * Helper function getting start address. * @returns {bigint} */ _startAddress() { return BigInt(`0b${this.mask() + "0".repeat(constants6.BITS - this.subnetMask)}`); } /** * The first address in the range given by this address' subnet * Often referred to as the Network Address. * @returns {Address6} */ startAddress() { return _Address6.fromBigInt(this._startAddress()); } /** * The first host address in the range given by this address's subnet ie * the first address after the Network Address * @returns {Address6} */ startAddressExclusive() { const adjust = BigInt("1"); return _Address6.fromBigInt(this._startAddress() + adjust); } /** * Helper function getting end address. * @returns {bigint} */ _endAddress() { return BigInt(`0b${this.mask() + "1".repeat(constants6.BITS - this.subnetMask)}`); } /** * The last address in the range given by this address' subnet * Often referred to as the Broadcast * @returns {Address6} */ endAddress() { return _Address6.fromBigInt(this._endAddress()); } /** * The last host address in the range given by this address's subnet ie * the last address prior to the Broadcast Address * @returns {Address6} */ endAddressExclusive() { const adjust = BigInt("1"); return _Address6.fromBigInt(this._endAddress() - adjust); } /** * The hex form of the subnet mask, e.g. `ffff:ffff:ffff:ffff::` for a * `/64`. Returns an `Address6`; call `.correctForm()` for the string. * @returns {Address6} */ subnetMaskAddress() { return _Address6.fromBigInt(BigInt(`0b${"1".repeat(this.subnetMask)}${"0".repeat(constants6.BITS - this.subnetMask)}`)); } /** * The Cisco-style wildcard mask, e.g. `::ffff:ffff:ffff:ffff` for a * `/64`. This is the bitwise inverse of `subnetMaskAddress()`. Returns * an `Address6`; call `.correctForm()` for the string. * @returns {Address6} */ wildcardMask() { return _Address6.fromBigInt(BigInt(`0b${"0".repeat(this.subnetMask)}${"1".repeat(constants6.BITS - this.subnetMask)}`)); } /** * The network address in CIDR string form, e.g. `2001:db8::/32` for * `2001:db8::1/32`. For an address with no explicit subnet the prefix * is `/128`, e.g. `networkForm()` on `2001:db8::1` returns * `2001:db8::1/128`. * @returns {string} */ networkForm() { return `${this.startAddress().correctForm()}/${this.subnetMask}`; } /** * Return the scope of the address. The 4-bit scope field * ([RFC 4291 §2.7](https://datatracker.ietf.org/doc/html/rfc4291#section-2.7)) * is only defined for multicast addresses; for unicast addresses the scope * is derived from the address type per * [RFC 4007 §6](https://datatracker.ietf.org/doc/html/rfc4007#section-6). * @returns {String} */ getScope() { const type = this.getType(); if (type === "Multicast" || type.startsWith("Multicast ")) { const scope = constants6.SCOPES[parseInt(this.getBits(12, 16).toString(10), 10)]; return scope || "Unknown"; } if (type === "Link-local unicast" || type === "Loopback") { return "Link local"; } if (type === "Unspecified") { return "Unknown"; } return "Global"; } /** * Return the type of the address * @returns {String} */ getType() { for (let i5 = 0; i5 < TYPE_SUBNETS.length; i5++) { const entry = TYPE_SUBNETS[i5]; if (this.isInSubnet(entry[0])) { return entry[1]; } } return "Global unicast"; } /** * Return the bits in the given range as a BigInt * @returns {bigint} */ getBits(start, end) { return BigInt(`0b${this.getBitsBase2(start, end)}`); } /** * Return the bits in the given range as a base-2 string * @returns {String} */ getBitsBase2(start, end) { return this.binaryZeroPad().slice(start, end); } /** * Return the bits in the given range as a base-16 string * @returns {String} */ getBitsBase16(start, end) { const length = end - start; if (length % 4 !== 0) { throw new Error("Length of bits to retrieve must be divisible by four"); } return this.getBits(start, end).toString(16).padStart(length / 4, "0"); } /** * Return the bits that are set past the subnet mask length * @returns {String} */ getBitsPastSubnet() { return this.getBitsBase2(this.subnetMask, constants6.BITS); } /** * Return the reversed ip6.arpa form of the address * @param {Object} options * @param {boolean} options.omitSuffix - omit the "ip6.arpa" suffix * @returns {String} */ reverseForm(options) { if (!options) { options = {}; } const characters = Math.floor(this.subnetMask / 4); const reversed = this.canonicalForm().replace(/:/g, "").split("").slice(0, characters).reverse().join("."); if (characters > 0) { if (options.omitSuffix) { return reversed; } return `${reversed}.ip6.arpa.`; } if (options.omitSuffix) { return ""; } return "ip6.arpa."; } /** * Returns the address in correct form, per * [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952): leading zeros * stripped, the longest run of zero groups collapsed to `::`, and hex digits * lowercased (e.g. `2001:db8::1`). This is the recommended form for display. */ correctForm() { let i5; let groups = []; let zeroCounter = 0; const zeroes = []; for (i5 = 0; i5 < this.parsedAddress.length; i5++) { const value = parseInt(this.parsedAddress[i5], 16); if (value === 0) { zeroCounter++; } if (value !== 0 && zeroCounter > 0) { if (zeroCounter > 1) { zeroes.push([i5 - zeroCounter, i5 - 1]); } zeroCounter = 0; } } if (zeroCounter > 1) { zeroes.push([this.parsedAddress.length - zeroCounter, this.parsedAddress.length - 1]); } const zeroLengths = zeroes.map((n3) => n3[1] - n3[0] + 1); if (zeroes.length > 0) { const index = zeroLengths.indexOf(Math.max(...zeroLengths)); groups = compact(this.parsedAddress, zeroes[index]); } else { groups = this.parsedAddress; } for (i5 = 0; i5 < groups.length; i5++) { if (groups[i5] !== "compact") { groups[i5] = parseInt(groups[i5], 16).toString(16); } } let correct = groups.join(":"); correct = correct.replace(/^compact$/, "::"); correct = correct.replace(/(^compact)|(compact$)/, ":"); correct = correct.replace(/compact/, ""); return correct; } /** * Return a zero-padded base-2 string representation of the address * @returns {String} * @example * var address = new Address6('2001:4860:4001:803::1011'); * address.binaryZeroPad(); * // '0010000000000001010010000110000001000000000000010000100000000011 * // 0000000000000000000000000000000000000000000000000001000000010001' */ binaryZeroPad() { if (this._binaryZeroPad === void 0) { this._binaryZeroPad = this.bigInt().toString(2).padStart(constants6.BITS, "0"); } return this._binaryZeroPad; } /** * Parses a v4-in-v6 string (e.g. `::ffff:192.168.0.1`) by extracting the * trailing IPv4 address into `this.address4` / `this.parsedAddress4` and * returning the address with the v4 portion converted to two v6 groups. * Used internally by `parse()`. */ // TODO: Improve the semantics of this helper function parse4in6(address) { if (address.indexOf(".") === -1) { return address; } const groups = address.split(":"); const lastGroup = groups.slice(-1)[0]; const address4 = lastGroup.match(constants4.RE_ADDRESS); if (address4) { this.parsedAddress4 = address4[0]; this.address4 = new ipv4_1.Address4(this.parsedAddress4); for (let i5 = 0; i5 < this.address4.groups; i5++) { if (/^0[0-9]+/.test(this.address4.parsedAddress[i5])) { const highlighted = this.address4.parsedAddress.map(spanLeadingZeroes4).join("."); const prefix = groups.slice(0, -1).map(helpers.escapeHtml).join(":"); const separator = groups.length > 1 ? ":" : ""; throw new address_error_1.AddressError("IPv4 addresses can't have leading zeroes.", `${prefix}${separator}${highlighted}`); } } this.v4 = true; groups[groups.length - 1] = this.address4.toGroup6(); address = groups.join(":"); } return address; } /** * Parses an IPv6 address string into its 8 hexadecimal groups (expanding * any `::` elision and any trailing v4-in-v6 portion) and stores the result * on `this.parsedAddress`. Called automatically by the constructor; you * typically don't need to call it directly. Throws `AddressError` if the * input is malformed. */ // TODO: Make private? parse(address) { address = this.parse4in6(address); const badCharacters = address.match(constants6.RE_BAD_CHARACTERS); if (badCharacters) { throw new address_error_1.AddressError(`Bad character${badCharacters.length > 1 ? "s" : ""} detected in address: ${badCharacters.join("")}`, address.replace(constants6.RE_BAD_CHARACTERS, '$1')); } const badAddress = address.match(constants6.RE_BAD_ADDRESS); if (badAddress) { throw new address_error_1.AddressError(`Address failed regex: ${badAddress.join("")}`, address.replace(constants6.RE_BAD_ADDRESS, '$1')); } let groups = []; const halves = address.split("::"); if (halves.length === 2) { let first = halves[0].split(":"); let last = halves[1].split(":"); if (first.length === 1 && first[0] === "") { first = []; } if (last.length === 1 && last[0] === "") { last = []; } const remaining = this.groups - (first.length + last.length); if (!remaining) { throw new address_error_1.AddressError("Error parsing groups"); } this.elidedGroups = remaining; this.elisionBegin = first.length; this.elisionEnd = first.length + this.elidedGroups; groups = groups.concat(first); for (let i5 = 0; i5 < remaining; i5++) { groups.push("0"); } groups = groups.concat(last); } else if (halves.length === 1) { groups = address.split(":"); this.elidedGroups = 0; } else { throw new address_error_1.AddressError("Too many :: groups found"); } groups = groups.map((group) => parseInt(group, 16).toString(16)); if (groups.length !== this.groups) { throw new address_error_1.AddressError("Incorrect number of groups found"); } return groups; } /** * Returns the canonical (fully expanded) form of the address: all 8 groups, * each padded to 4 hex digits, with no `::` collapsing * (e.g. `2001:0db8:0000:0000:0000:0000:0000:0001`). Useful for sorting and * byte-exact comparison. */ canonicalForm() { return this.parsedAddress.map(paddedHex).join(":"); } /** * Return the decimal form of the address * @returns {String} */ decimal() { return this.parsedAddress.map((n3) => parseInt(n3, 16).toString(10).padStart(5, "0")).join(":"); } /** * Return the address as a BigInt * @returns {bigint} */ bigInt() { return BigInt(`0x${this.parsedAddress.map(paddedHex).join("")}`); } /** * Return the last two groups of this address as an IPv4 address string * @returns {Address4} * @example * var address = new Address6('2001:4860:4001::1825:bf11'); * address.to4().correctForm(); // '24.37.191.17' */ to4() { const binary = this.binaryZeroPad().split(""); return ipv4_1.Address4.fromHex(BigInt(`0b${binary.slice(96, 128).join("")}`).toString(16).padStart(8, "0")); } /** * Return the v4-in-v6 form of the address * @returns {String} */ to4in6() { const address4 = this.to4(); const address6 = new _Address6(this.parsedAddress.slice(0, 6).join(":"), 6); const correct = address6.correctForm(); let infix = ""; if (!/:$/.test(correct)) { infix = ":"; } return correct + infix + address4.address; } /** * Decodes the Teredo tunneling fields embedded in this address. Returns the * Teredo prefix, server IPv4, client IPv4, raw flag bits, cone-NAT flag, * UDP port, and Microsoft-format flag breakdown (reserved, universal/local, * group/individual, nonce). Only meaningful for addresses in `2001::/32`. */ inspectTeredo() { const prefix = this.getBitsBase16(0, 32); const bitsForUdpPort = this.getBits(80, 96); const udpPort = (bitsForUdpPort ^ BigInt("0xffff")).toString(); const server4 = ipv4_1.Address4.fromHex(this.getBitsBase16(32, 64)); const bitsForClient4 = this.getBits(96, 128); const client4 = ipv4_1.Address4.fromHex((bitsForClient4 ^ BigInt("0xffffffff")).toString(16).padStart(8, "0")); const flagsBase2 = this.getBitsBase2(64, 80); const coneNat = (0, common_1.testBit)(flagsBase2, 15); const reserved = (0, common_1.testBit)(flagsBase2, 14); const groupIndividual = (0, common_1.testBit)(flagsBase2, 8); const universalLocal = (0, common_1.testBit)(flagsBase2, 9); const nonce = BigInt(`0b${flagsBase2.slice(2, 6) + flagsBase2.slice(8, 16)}`).toString(10); return { prefix: `${prefix.slice(0, 4)}:${prefix.slice(4, 8)}`, server4: server4.address, client4: client4.address, flags: flagsBase2, coneNat, microsoft: { reserved, universalLocal, groupIndividual, nonce }, udpPort }; } /** * Decodes the 6to4 tunneling fields embedded in this address. Returns the * 6to4 prefix and the embedded IPv4 gateway address. Only meaningful for * addresses in `2002::/16`. */ inspect6to4() { const prefix = this.getBitsBase16(0, 16); const gateway = ipv4_1.Address4.fromHex(this.getBitsBase16(16, 48)); return { prefix: prefix.slice(0, 4), gateway: gateway.address }; } /** * Return a v6 6to4 address from a v6 v4inv6 address * @returns {Address6} */ to6to4() { if (!this.is4()) { return null; } const addr6to4 = [ "2002", this.getBitsBase16(96, 112), this.getBitsBase16(112, 128), "", "/16" ].join(":"); return new _Address6(addr6to4); } /** * Embed an IPv4 address into a NAT64 IPv6 address using the encoding * defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). * The default prefix is the well-known prefix `64:ff9b::/96`. The prefix * length must be one of 32, 40, 48, 56, 64, or 96; for prefixes shorter * than /64 the IPv4 octets are split around the reserved bits 64–71. * @example * Address6.fromAddress4Nat64('192.0.2.33').correctForm(); // '64:ff9b::c000:221' * Address6.fromAddress4Nat64('192.0.2.33', '2001:db8::/32').correctForm(); // '2001:db8:c000:221::' */ static fromAddress4Nat64(address, prefix = "64:ff9b::/96") { const v4 = new ipv4_1.Address4(address); const prefix6 = new _Address6(prefix); const pl = prefix6.subnetMask; if (pl !== 32 && pl !== 40 && pl !== 48 && pl !== 56 && pl !== 64 && pl !== 96) { throw new address_error_1.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96"); } const prefixBits = prefix6.binaryZeroPad(); const v4Bits = v4.binaryZeroPad(); let bits; if (pl === 96) { bits = prefixBits.slice(0, 96) + v4Bits; } else { const beforeU = 64 - pl; bits = prefixBits.slice(0, pl) + v4Bits.slice(0, beforeU) + "00000000" + v4Bits.slice(beforeU) + "0".repeat(128 - 72 - (32 - beforeU)); } const hex = BigInt(`0b${bits}`).toString(16).padStart(32, "0"); const groups = []; for (let i5 = 0; i5 < 8; i5++) { groups.push(hex.slice(i5 * 4, (i5 + 1) * 4)); } return new _Address6(groups.join(":")); } /** * Extract the embedded IPv4 address from a NAT64 IPv6 address using the * encoding defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). * The default prefix is the well-known prefix `64:ff9b::/96`. Returns * `null` if this address is not contained within the given prefix. * @example * new Address6('64:ff9b::c000:221').toAddress4Nat64()!.correctForm(); // '192.0.2.33' */ toAddress4Nat64(prefix = "64:ff9b::/96") { const prefix6 = new _Address6(prefix); const pl = prefix6.subnetMask; if (pl !== 32 && pl !== 40 && pl !== 48 && pl !== 56 && pl !== 64 && pl !== 96) { throw new address_error_1.AddressError("NAT64 prefix length must be 32, 40, 48, 56, 64, or 96"); } if (!this.isInSubnet(prefix6)) { return null; } const bits = this.binaryZeroPad(); let v4Bits; if (pl === 96) { v4Bits = bits.slice(96, 128); } else { const beforeU = 64 - pl; v4Bits = bits.slice(pl, pl + beforeU) + bits.slice(72, 72 + (32 - beforeU)); } const octets = []; for (let i5 = 0; i5 < 4; i5++) { octets.push(parseInt(v4Bits.slice(i5 * 8, (i5 + 1) * 8), 2).toString()); } return new ipv4_1.Address4(octets.join(".")); } /** * Return a byte array. * * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toByteArray())`. * @returns {Array} */ toByteArray() { const valueWithoutPadding = this.bigInt().toString(16); const leadingPad = "0".repeat(valueWithoutPadding.length % 2); const value = `${leadingPad}${valueWithoutPadding}`; const bytes = []; for (let i5 = 0, length = value.length; i5 < length; i5 += 2) { bytes.push(parseInt(value.substring(i5, i5 + 2), 16)); } return bytes; } /** * Return an unsigned byte array. * * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toUnsignedByteArray())`. * @returns {Array} */ toUnsignedByteArray() { return this.toByteArray().map(unsignByte); } /** * Convert a byte array to an Address6 object. * * To convert from a Node.js `Buffer`, spread it: `Address6.fromByteArray([...buf])`. * @returns {Address6} */ static fromByteArray(bytes) { return this.fromUnsignedByteArray(bytes.map(unsignByte)); } /** * Convert an unsigned byte array to an Address6 object. * * To convert from a Node.js `Buffer`, spread it: `Address6.fromUnsignedByteArray([...buf])`. * @returns {Address6} */ static fromUnsignedByteArray(bytes) { const BYTE_MAX = BigInt("256"); let result = BigInt("0"); let multiplier = BigInt("1"); for (let i5 = bytes.length - 1; i5 >= 0; i5--) { result += multiplier * BigInt(bytes[i5].toString(10)); multiplier *= BYTE_MAX; } return _Address6.fromBigInt(result); } /** * Returns true if the address is in the canonical form, false otherwise * @returns {boolean} */ isCanonical() { return this.addressMinusSuffix === this.canonicalForm(); } /** * Returns true if the address is a link local address, false otherwise * @returns {boolean} */ isLinkLocal() { if (this.getBitsBase2(0, 64) === "1111111010000000000000000000000000000000000000000000000000000000") { return true; } return false; } /** * Returns true if the address is a multicast address, false otherwise * @returns {boolean} */ isMulticast() { const type = this.getType(); return type === "Multicast" || type.startsWith("Multicast "); } /** * Returns true if the address was written in v4-in-v6 dotted-quad notation * (e.g. `::ffff:127.0.0.1`), false otherwise. This is a notation-level flag * and does not reflect whether the address bits lie in the IPv4-mapped * (`::ffff:0:0/96`) subnet — for that, see {@link isMapped4}. * @returns {boolean} */ is4() { return this.v4; } /** * Returns true if the address is an IPv4-mapped IPv6 address in * `::ffff:0:0/96` ([RFC 4291 §2.5.5.2](https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2)), * false otherwise. Unlike {@link is4}, this checks the underlying address * bits rather than the textual notation, so `::ffff:127.0.0.1` and * `::ffff:7f00:1` both return true. * @returns {boolean} */ isMapped4() { return this.isInSubnet(IPV4_MAPPED_SUBNET); } /** * Returns true if the address is a Teredo address, false otherwise * @returns {boolean} */ isTeredo() { return this.isInSubnet(TEREDO_SUBNET); } /** * Returns true if the address is a 6to4 address, false otherwise * @returns {boolean} */ is6to4() { return this.isInSubnet(SIX_TO_FOUR_SUBNET); } /** * Returns true if the address is a loopback address, false otherwise * @returns {boolean} */ isLoopback() { return this.getType() === "Loopback"; } /** * Returns true if the address is a Unique Local Address in `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)). ULAs are the IPv6 equivalent of IPv4 [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private addresses. * @returns {boolean} */ isULA() { return this.isInSubnet(ULA_SUBNET); } /** * Returns true if the address is the unspecified address `::`. * @returns {boolean} */ isUnspecified() { return this.getType() === "Unspecified"; } /** * Returns true if the address is in the documentation prefix `2001:db8::/32` ([RFC 3849](https://datatracker.ietf.org/doc/html/rfc3849)). * @returns {boolean} */ isDocumentation() { return this.isInSubnet(DOCUMENTATION_SUBNET); } // #endregion // #region HTML /** * Returns the address as an HTTP URL with the host bracketed, e.g. * `http://[2001:db8::1]/`. If `optionalPort` is provided it is appended, * e.g. `http://[2001:db8::1]:8080/`. */ href(optionalPort) { if (optionalPort === void 0) { optionalPort = ""; } else { optionalPort = `:${optionalPort}`; } return `http://[${this.correctForm()}]${optionalPort}/`; } /** * Returns an HTML `` element whose `href` encodes the address in a URL * hash fragment (default prefix `/#address=`). Useful for linking between * pages of an address-inspector UI. * @param options.className - CSS class for the rendered `` element * @param options.prefix - hash prefix prepended to the address (default `/#address=`) * @param options.v4 - when true, render the address in v4-in-v6 form */ link(options) { if (!options) { options = {}; } if (options.className === void 0) { options.className = ""; } if (options.prefix === void 0) { options.prefix = "/#address="; } if (options.v4 === void 0) { options.v4 = false; } let formFunction = this.correctForm; if (options.v4) { formFunction = this.to4in6; } const form = formFunction.call(this); const safeHref = helpers.escapeHtml(`${options.prefix}${form}`); const safeForm = helpers.escapeHtml(form); if (options.className) { const safeClass = helpers.escapeHtml(options.className); return `${safeForm}`; } return `${safeForm}`; } /** * Groups an address * @returns {String} */ group() { if (this.elidedGroups === 0) { return helpers.simpleGroup(this.addressMinusSuffix).join(":"); } assert4(typeof this.elidedGroups === "number"); assert4(typeof this.elisionBegin === "number"); const output = []; const [left, right] = this.addressMinusSuffix.split("::"); if (left.length) { output.push(...helpers.simpleGroup(left)); } else { output.push(""); } const classes = ["hover-group"]; for (let i5 = this.elisionBegin; i5 < this.elisionBegin + this.elidedGroups; i5++) { classes.push(`group-${i5}`); } output.push(``); if (right.length) { output.push(...helpers.simpleGroup(right, this.elisionEnd)); } else { output.push(""); } if (this.is4()) { assert4(this.address4 instanceof ipv4_1.Address4); output.pop(); output.push(this.address4.groupForV6()); } return output.join(":"); } // #endregion // #region Regular expressions /** * Generate a regular expression string that can be used to find or validate * all variations of this address * @param {boolean} substringSearch * @returns {string} */ regularExpressionString(substringSearch = false) { let output = []; const address6 = new _Address6(this.correctForm()); if (address6.elidedGroups === 0) { output.push((0, regular_expressions_1.simpleRegularExpression)(address6.parsedAddress)); } else if (address6.elidedGroups === constants6.GROUPS) { output.push((0, regular_expressions_1.possibleElisions)(constants6.GROUPS)); } else { const halves = address6.address.split("::"); if (halves[0].length) { output.push((0, regular_expressions_1.simpleRegularExpression)(halves[0].split(":"))); } assert4(typeof address6.elidedGroups === "number"); output.push((0, regular_expressions_1.possibleElisions)(address6.elidedGroups, halves[0].length !== 0, halves[1].length !== 0)); if (halves[1].length) { output.push((0, regular_expressions_1.simpleRegularExpression)(halves[1].split(":"))); } output = [output.join(":")]; } if (!substringSearch) { output = [ "(?=^|", regular_expressions_1.ADDRESS_BOUNDARY, "|[^\\w\\:])(", ...output, ")(?=[^\\w\\:]|", regular_expressions_1.ADDRESS_BOUNDARY, "|$)" ]; } return output.join(""); } /** * Generate a regular expression that can be used to find or validate all * variations of this address. * @param {boolean} substringSearch * @returns {RegExp} */ regularExpression(substringSearch = false) { return new RegExp(this.regularExpressionString(substringSearch), "i"); } }; exports2.Address6 = Address6; var TYPE_SUBNETS = Object.keys(constants6.TYPES).map((subnet) => [ new Address6(subnet), constants6.TYPES[subnet] ]); var TEREDO_SUBNET = new Address6("2001::/32"); var SIX_TO_FOUR_SUBNET = new Address6("2002::/16"); var ULA_SUBNET = new Address6("fc00::/7"); var DOCUMENTATION_SUBNET = new Address6("2001:db8::/32"); var IPV4_MAPPED_SUBNET = new Address6("::ffff:0:0/96"); } }); // node_modules/ip-address/dist/ip-address.js var require_ip_address = __commonJS({ "node_modules/ip-address/dist/ip-address.js"(exports2) { "use strict"; var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; var desc = Object.getOwnPropertyDescriptor(m3, k5); if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m3[k5]; } }; } Object.defineProperty(o2, k22, desc); }) : (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; o2[k22] = m3[k5]; })); var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { Object.defineProperty(o2, "default", { enumerable: true, value: v }); }) : function(o2, v) { o2["default"] = v; }); var __importStar2 = exports2 && exports2.__importStar || function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k5 in mod) if (k5 !== "default" && Object.prototype.hasOwnProperty.call(mod, k5)) __createBinding2(result, mod, k5); } __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.v6 = exports2.AddressError = exports2.Address6 = exports2.Address4 = void 0; var ipv4_1 = require_ipv4(); Object.defineProperty(exports2, "Address4", { enumerable: true, get: function() { return ipv4_1.Address4; } }); var ipv6_1 = require_ipv6(); Object.defineProperty(exports2, "Address6", { enumerable: true, get: function() { return ipv6_1.Address6; } }); var address_error_1 = require_address_error(); Object.defineProperty(exports2, "AddressError", { enumerable: true, get: function() { return address_error_1.AddressError; } }); var helpers = __importStar2(require_helpers()); exports2.v6 = { helpers }; } }); // node_modules/socks/build/common/helpers.js var require_helpers2 = __commonJS({ "node_modules/socks/build/common/helpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ipToBuffer = exports2.int32ToIpv4 = exports2.ipv4ToInt32 = exports2.validateSocksClientChainOptions = exports2.validateSocksClientOptions = void 0; var util_1 = require_util9(); var constants_1 = require_constants6(); var stream = require("stream"); var ip_address_1 = require_ip_address(); var net11 = require("net"); function validateSocksClientOptions(options, acceptedCommands = ["connect", "bind", "associate"]) { if (!constants_1.SocksCommand[options.command]) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommand, options); } if (acceptedCommands.indexOf(options.command) === -1) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandForOperation, options); } if (!isValidSocksRemoteHost(options.destination)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options); } if (!isValidSocksProxy(options.proxy)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options); } validateCustomProxyAuth(options.proxy, options); if (options.timeout && !isValidTimeoutValue(options.timeout)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options); } if (options.existing_socket && !(options.existing_socket instanceof stream.Duplex)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsExistingSocket, options); } } exports2.validateSocksClientOptions = validateSocksClientOptions; function validateSocksClientChainOptions(options) { if (options.command !== "connect") { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandChain, options); } if (!isValidSocksRemoteHost(options.destination)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options); } if (!(options.proxies && Array.isArray(options.proxies) && options.proxies.length >= 2)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxiesLength, options); } options.proxies.forEach((proxy) => { if (!isValidSocksProxy(proxy)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options); } validateCustomProxyAuth(proxy, options); }); if (options.timeout && !isValidTimeoutValue(options.timeout)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options); } } exports2.validateSocksClientChainOptions = validateSocksClientChainOptions; function validateCustomProxyAuth(proxy, options) { if (proxy.custom_auth_method !== void 0) { if (proxy.custom_auth_method < constants_1.SOCKS5_CUSTOM_AUTH_START || proxy.custom_auth_method > constants_1.SOCKS5_CUSTOM_AUTH_END) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthRange, options); } if (proxy.custom_auth_request_handler === void 0 || typeof proxy.custom_auth_request_handler !== "function") { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); } if (proxy.custom_auth_response_size === void 0) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); } if (proxy.custom_auth_response_handler === void 0 || typeof proxy.custom_auth_response_handler !== "function") { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); } } } function isValidSocksRemoteHost(remoteHost) { return remoteHost && typeof remoteHost.host === "string" && Buffer.byteLength(remoteHost.host) < 256 && typeof remoteHost.port === "number" && remoteHost.port >= 0 && remoteHost.port <= 65535; } function isValidSocksProxy(proxy) { return proxy && (typeof proxy.host === "string" || typeof proxy.ipaddress === "string") && typeof proxy.port === "number" && proxy.port >= 0 && proxy.port <= 65535 && (proxy.type === 4 || proxy.type === 5); } function isValidTimeoutValue(value) { return typeof value === "number" && value > 0; } function ipv4ToInt32(ip2) { const address = new ip_address_1.Address4(ip2); return address.toArray().reduce((acc, part) => (acc << 8) + part, 0) >>> 0; } exports2.ipv4ToInt32 = ipv4ToInt32; function int32ToIpv4(int32) { const octet1 = int32 >>> 24 & 255; const octet2 = int32 >>> 16 & 255; const octet3 = int32 >>> 8 & 255; const octet4 = int32 & 255; return [octet1, octet2, octet3, octet4].join("."); } exports2.int32ToIpv4 = int32ToIpv4; function ipToBuffer(ip2) { if (net11.isIPv4(ip2)) { const address = new ip_address_1.Address4(ip2); return Buffer.from(address.toArray()); } else if (net11.isIPv6(ip2)) { const address = new ip_address_1.Address6(ip2); return Buffer.from(address.canonicalForm().split(":").map((segment) => segment.padStart(4, "0")).join(""), "hex"); } else { throw new Error("Invalid IP address format"); } } exports2.ipToBuffer = ipToBuffer; } }); // node_modules/socks/build/common/receivebuffer.js var require_receivebuffer = __commonJS({ "node_modules/socks/build/common/receivebuffer.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ReceiveBuffer = void 0; var ReceiveBuffer = class { constructor(size = 4096) { this.buffer = Buffer.allocUnsafe(size); this.offset = 0; this.originalSize = size; } get length() { return this.offset; } append(data3) { if (!Buffer.isBuffer(data3)) { throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer."); } if (this.offset + data3.length >= this.buffer.length) { const tmp = this.buffer; this.buffer = Buffer.allocUnsafe(Math.max(this.buffer.length + this.originalSize, this.buffer.length + data3.length)); tmp.copy(this.buffer); } data3.copy(this.buffer, this.offset); return this.offset += data3.length; } peek(length) { if (length > this.offset) { throw new Error("Attempted to read beyond the bounds of the managed internal data."); } return this.buffer.slice(0, length); } get(length) { if (length > this.offset) { throw new Error("Attempted to read beyond the bounds of the managed internal data."); } const value = Buffer.allocUnsafe(length); this.buffer.slice(0, length).copy(value); this.buffer.copyWithin(0, length, length + this.offset - length); this.offset -= length; return value; } }; exports2.ReceiveBuffer = ReceiveBuffer; } }); // node_modules/socks/build/client/socksclient.js var require_socksclient = __commonJS({ "node_modules/socks/build/client/socksclient.js"(exports2) { "use strict"; var __awaiter7 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); }); } return new (P || (P = Promise))(function(resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e5) { reject(e5); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e5) { reject(e5); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SocksClientError = exports2.SocksClient = void 0; var events_1 = require("events"); var net11 = require("net"); var smart_buffer_1 = require_smartbuffer(); var constants_1 = require_constants6(); var helpers_1 = require_helpers2(); var receivebuffer_1 = require_receivebuffer(); var util_1 = require_util9(); Object.defineProperty(exports2, "SocksClientError", { enumerable: true, get: function() { return util_1.SocksClientError; } }); var ip_address_1 = require_ip_address(); var SocksClient3 = class _SocksClient extends events_1.EventEmitter { constructor(options) { super(); this.options = Object.assign({}, options); (0, helpers_1.validateSocksClientOptions)(options); this.setState(constants_1.SocksClientState.Created); } /** * Creates a new SOCKS connection. * * Note: Supports callbacks and promises. Only supports the connect command. * @param options { SocksClientOptions } Options. * @param callback { Function } An optional callback function. * @returns { Promise } */ static createConnection(options, callback) { return new Promise((resolve, reject) => { try { (0, helpers_1.validateSocksClientOptions)(options, ["connect"]); } catch (err) { if (typeof callback === "function") { callback(err); return resolve(err); } else { return reject(err); } } const client = new _SocksClient(options); client.connect(options.existing_socket); client.once("established", (info2) => { client.removeAllListeners(); if (typeof callback === "function") { callback(null, info2); resolve(info2); } else { resolve(info2); } }); client.once("error", (err) => { client.removeAllListeners(); if (typeof callback === "function") { callback(err); resolve(err); } else { reject(err); } }); }); } /** * Creates a new SOCKS connection chain to a destination host through 2 or more SOCKS proxies. * * Note: Supports callbacks and promises. Only supports the connect method. * Note: Implemented via createConnection() factory function. * @param options { SocksClientChainOptions } Options * @param callback { Function } An optional callback function. * @returns { Promise } */ static createConnectionChain(options, callback) { return new Promise((resolve, reject) => __awaiter7(this, void 0, void 0, function* () { try { (0, helpers_1.validateSocksClientChainOptions)(options); } catch (err) { if (typeof callback === "function") { callback(err); return resolve(err); } else { return reject(err); } } if (options.randomizeChain) { (0, util_1.shuffleArray)(options.proxies); } try { let sock; for (let i5 = 0; i5 < options.proxies.length; i5++) { const nextProxy = options.proxies[i5]; const nextDestination = i5 === options.proxies.length - 1 ? options.destination : { host: options.proxies[i5 + 1].host || options.proxies[i5 + 1].ipaddress, port: options.proxies[i5 + 1].port }; const result = yield _SocksClient.createConnection({ command: "connect", proxy: nextProxy, destination: nextDestination, existing_socket: sock }); sock = sock || result.socket; } if (typeof callback === "function") { callback(null, { socket: sock }); resolve({ socket: sock }); } else { resolve({ socket: sock }); } } catch (err) { if (typeof callback === "function") { callback(err); resolve(err); } else { reject(err); } } })); } /** * Creates a SOCKS UDP Frame. * @param options */ static createUDPFrame(options) { const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt16BE(0); buff.writeUInt8(options.frameNumber || 0); if (net11.isIPv4(options.remoteHost.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv4); buff.writeUInt32BE((0, helpers_1.ipv4ToInt32)(options.remoteHost.host)); } else if (net11.isIPv6(options.remoteHost.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv6); buff.writeBuffer((0, helpers_1.ipToBuffer)(options.remoteHost.host)); } else { buff.writeUInt8(constants_1.Socks5HostType.Hostname); buff.writeUInt8(Buffer.byteLength(options.remoteHost.host)); buff.writeString(options.remoteHost.host); } buff.writeUInt16BE(options.remoteHost.port); buff.writeBuffer(options.data); return buff.toBuffer(); } /** * Parses a SOCKS UDP frame. * @param data */ static parseUDPFrame(data3) { const buff = smart_buffer_1.SmartBuffer.fromBuffer(data3); buff.readOffset = 2; const frameNumber = buff.readUInt8(); const hostType = buff.readUInt8(); let remoteHost; if (hostType === constants_1.Socks5HostType.IPv4) { remoteHost = (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()); } else if (hostType === constants_1.Socks5HostType.IPv6) { remoteHost = ip_address_1.Address6.fromByteArray(Array.from(buff.readBuffer(16))).canonicalForm(); } else { remoteHost = buff.readString(buff.readUInt8()); } const remotePort = buff.readUInt16BE(); return { frameNumber, remoteHost: { host: remoteHost, port: remotePort }, data: buff.readBuffer() }; } /** * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state. */ setState(newState) { if (this.state !== constants_1.SocksClientState.Error) { this.state = newState; } } /** * Starts the connection establishment to the proxy and destination. * @param existingSocket Connected socket to use instead of creating a new one (internal use). */ connect(existingSocket) { this.onDataReceived = (data3) => this.onDataReceivedHandler(data3); this.onClose = () => this.onCloseHandler(); this.onError = (err) => this.onErrorHandler(err); this.onConnect = () => this.onConnectHandler(); const timer = setTimeout(() => this.onEstablishedTimeout(), this.options.timeout || constants_1.DEFAULT_TIMEOUT); if (timer.unref && typeof timer.unref === "function") { timer.unref(); } if (existingSocket) { this.socket = existingSocket; } else { this.socket = new net11.Socket(); } this.socket.once("close", this.onClose); this.socket.once("error", this.onError); this.socket.once("connect", this.onConnect); this.socket.on("data", this.onDataReceived); this.setState(constants_1.SocksClientState.Connecting); this.receiveBuffer = new receivebuffer_1.ReceiveBuffer(); if (existingSocket) { this.socket.emit("connect"); } else { this.socket.connect(this.getSocketOptions()); if (this.options.set_tcp_nodelay !== void 0 && this.options.set_tcp_nodelay !== null) { this.socket.setNoDelay(!!this.options.set_tcp_nodelay); } } this.prependOnceListener("established", (info2) => { setImmediate(() => { if (this.receiveBuffer.length > 0) { const excessData = this.receiveBuffer.get(this.receiveBuffer.length); info2.socket.emit("data", excessData); } info2.socket.resume(); }); }); } // Socket options (defaults host/port to options.proxy.host/options.proxy.port) getSocketOptions() { return Object.assign(Object.assign({}, this.options.socket_options), { host: this.options.proxy.host || this.options.proxy.ipaddress, port: this.options.proxy.port }); } /** * Handles internal Socks timeout callback. * Note: If the Socks client is not BoundWaitingForConnection or Established, the connection will be closed. */ onEstablishedTimeout() { if (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.BoundWaitingForConnection) { this.closeSocket(constants_1.ERRORS.ProxyConnectionTimedOut); } } /** * Handles Socket connect event. */ onConnectHandler() { this.setState(constants_1.SocksClientState.Connected); if (this.options.proxy.type === 4) { this.sendSocks4InitialHandshake(); } else { this.sendSocks5InitialHandshake(); } this.setState(constants_1.SocksClientState.SentInitialHandshake); } /** * Handles Socket data event. * @param data */ onDataReceivedHandler(data3) { this.receiveBuffer.append(data3); this.processData(); } /** * Handles processing of the data we have received. */ processData() { while (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.Error && this.receiveBuffer.length >= this.nextRequiredPacketBufferSize) { if (this.state === constants_1.SocksClientState.SentInitialHandshake) { if (this.options.proxy.type === 4) { this.handleSocks4FinalHandshakeResponse(); } else { this.handleInitialSocks5HandshakeResponse(); } } else if (this.state === constants_1.SocksClientState.SentAuthentication) { this.handleInitialSocks5AuthenticationHandshakeResponse(); } else if (this.state === constants_1.SocksClientState.SentFinalHandshake) { this.handleSocks5FinalHandshakeResponse(); } else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) { if (this.options.proxy.type === 4) { this.handleSocks4IncomingConnectionResponse(); } else { this.handleSocks5IncomingConnectionResponse(); } } else { this.closeSocket(constants_1.ERRORS.InternalError); break; } } } /** * Handles Socket close event. * @param had_error */ onCloseHandler() { this.closeSocket(constants_1.ERRORS.SocketClosed); } /** * Handles Socket error event. * @param err */ onErrorHandler(err) { this.closeSocket(err.message); } /** * Removes internal event listeners on the underlying Socket. */ removeInternalSocketHandlers() { this.socket.pause(); this.socket.removeListener("data", this.onDataReceived); this.socket.removeListener("close", this.onClose); this.socket.removeListener("error", this.onError); this.socket.removeListener("connect", this.onConnect); } /** * Closes and destroys the underlying Socket. Emits an error event. * @param err { String } An error string to include in error event. */ closeSocket(err) { if (this.state !== constants_1.SocksClientState.Error) { this.setState(constants_1.SocksClientState.Error); this.socket.destroy(); this.removeInternalSocketHandlers(); this.emit("error", new util_1.SocksClientError(err, this.options)); } } /** * Sends initial Socks v4 handshake request. */ sendSocks4InitialHandshake() { const userId = this.options.proxy.userId || ""; const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt8(4); buff.writeUInt8(constants_1.SocksCommand[this.options.command]); buff.writeUInt16BE(this.options.destination.port); if (net11.isIPv4(this.options.destination.host)) { buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host)); buff.writeStringNT(userId); } else { buff.writeUInt8(0); buff.writeUInt8(0); buff.writeUInt8(0); buff.writeUInt8(1); buff.writeStringNT(userId); buff.writeStringNT(this.options.destination.host); } this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks4Response; this.socket.write(buff.toBuffer()); } /** * Handles Socks v4 handshake response. * @param data */ handleSocks4FinalHandshakeResponse() { const data3 = this.receiveBuffer.get(8); if (data3[1] !== constants_1.Socks4Response.Granted) { this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedConnection} - (${constants_1.Socks4Response[data3[1]]})`); } else { if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) { const buff = smart_buffer_1.SmartBuffer.fromBuffer(data3); buff.readOffset = 2; const remoteHost = { port: buff.readUInt16BE(), host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()) }; if (remoteHost.host === "0.0.0.0") { remoteHost.host = this.options.proxy.ipaddress; } this.setState(constants_1.SocksClientState.BoundWaitingForConnection); this.emit("bound", { remoteHost, socket: this.socket }); } else { this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit("established", { socket: this.socket }); } } } /** * Handles Socks v4 incoming connection request (BIND) * @param data */ handleSocks4IncomingConnectionResponse() { const data3 = this.receiveBuffer.get(8); if (data3[1] !== constants_1.Socks4Response.Granted) { this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${constants_1.Socks4Response[data3[1]]})`); } else { const buff = smart_buffer_1.SmartBuffer.fromBuffer(data3); buff.readOffset = 2; const remoteHost = { port: buff.readUInt16BE(), host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()) }; this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit("established", { remoteHost, socket: this.socket }); } } /** * Sends initial Socks v5 handshake request. */ sendSocks5InitialHandshake() { const buff = new smart_buffer_1.SmartBuffer(); const supportedAuthMethods = [constants_1.Socks5Auth.NoAuth]; if (this.options.proxy.userId || this.options.proxy.password) { supportedAuthMethods.push(constants_1.Socks5Auth.UserPass); } if (this.options.proxy.custom_auth_method !== void 0) { supportedAuthMethods.push(this.options.proxy.custom_auth_method); } buff.writeUInt8(5); buff.writeUInt8(supportedAuthMethods.length); for (const authMethod of supportedAuthMethods) { buff.writeUInt8(authMethod); } this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse; this.socket.write(buff.toBuffer()); this.setState(constants_1.SocksClientState.SentInitialHandshake); } /** * Handles initial Socks v5 handshake response. * @param data */ handleInitialSocks5HandshakeResponse() { const data3 = this.receiveBuffer.get(2); if (data3[0] !== 5) { this.closeSocket(constants_1.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion); } else if (data3[1] === constants_1.SOCKS5_NO_ACCEPTABLE_AUTH) { this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType); } else { if (data3[1] === constants_1.Socks5Auth.NoAuth) { this.socks5ChosenAuthType = constants_1.Socks5Auth.NoAuth; this.sendSocks5CommandRequest(); } else if (data3[1] === constants_1.Socks5Auth.UserPass) { this.socks5ChosenAuthType = constants_1.Socks5Auth.UserPass; this.sendSocks5UserPassAuthentication(); } else if (data3[1] === this.options.proxy.custom_auth_method) { this.socks5ChosenAuthType = this.options.proxy.custom_auth_method; this.sendSocks5CustomAuthentication(); } else { this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType); } } } /** * Sends Socks v5 user & password auth handshake. * * Note: No auth and user/pass are currently supported. */ sendSocks5UserPassAuthentication() { const userId = this.options.proxy.userId || ""; const password = this.options.proxy.password || ""; const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt8(1); buff.writeUInt8(Buffer.byteLength(userId)); buff.writeString(userId); buff.writeUInt8(Buffer.byteLength(password)); buff.writeString(password); this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse; this.socket.write(buff.toBuffer()); this.setState(constants_1.SocksClientState.SentAuthentication); } sendSocks5CustomAuthentication() { return __awaiter7(this, void 0, void 0, function* () { this.nextRequiredPacketBufferSize = this.options.proxy.custom_auth_response_size; this.socket.write(yield this.options.proxy.custom_auth_request_handler()); this.setState(constants_1.SocksClientState.SentAuthentication); }); } handleSocks5CustomAuthHandshakeResponse(data3) { return __awaiter7(this, void 0, void 0, function* () { return yield this.options.proxy.custom_auth_response_handler(data3); }); } handleSocks5AuthenticationNoAuthHandshakeResponse(data3) { return __awaiter7(this, void 0, void 0, function* () { return data3[1] === 0; }); } handleSocks5AuthenticationUserPassHandshakeResponse(data3) { return __awaiter7(this, void 0, void 0, function* () { return data3[1] === 0; }); } /** * Handles Socks v5 auth handshake response. * @param data */ handleInitialSocks5AuthenticationHandshakeResponse() { return __awaiter7(this, void 0, void 0, function* () { this.setState(constants_1.SocksClientState.ReceivedAuthenticationResponse); let authResult = false; if (this.socks5ChosenAuthType === constants_1.Socks5Auth.NoAuth) { authResult = yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)); } else if (this.socks5ChosenAuthType === constants_1.Socks5Auth.UserPass) { authResult = yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)); } else if (this.socks5ChosenAuthType === this.options.proxy.custom_auth_method) { authResult = yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size)); } if (!authResult) { this.closeSocket(constants_1.ERRORS.Socks5AuthenticationFailed); } else { this.sendSocks5CommandRequest(); } }); } /** * Sends Socks v5 final handshake request. */ sendSocks5CommandRequest() { const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt8(5); buff.writeUInt8(constants_1.SocksCommand[this.options.command]); buff.writeUInt8(0); if (net11.isIPv4(this.options.destination.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv4); buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host)); } else if (net11.isIPv6(this.options.destination.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv6); buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host)); } else { buff.writeUInt8(constants_1.Socks5HostType.Hostname); buff.writeUInt8(this.options.destination.host.length); buff.writeString(this.options.destination.host); } buff.writeUInt16BE(this.options.destination.port); this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; this.socket.write(buff.toBuffer()); this.setState(constants_1.SocksClientState.SentFinalHandshake); } /** * Handles Socks v5 final handshake response. * @param data */ handleSocks5FinalHandshakeResponse() { const header = this.receiveBuffer.peek(5); if (header[0] !== 5 || header[1] !== constants_1.Socks5Response.Granted) { this.closeSocket(`${constants_1.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${constants_1.Socks5Response[header[1]]}`); } else { const addressType = header[3]; let remoteHost; let buff; if (addressType === constants_1.Socks5HostType.IPv4) { const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()), port: buff.readUInt16BE() }; if (remoteHost.host === "0.0.0.0") { remoteHost.host = this.options.proxy.ipaddress; } } else if (addressType === constants_1.Socks5HostType.Hostname) { const hostLength = header[4]; const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5)); remoteHost = { host: buff.readString(hostLength), port: buff.readUInt16BE() }; } else if (addressType === constants_1.Socks5HostType.IPv6) { const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip_address_1.Address6.fromByteArray(Array.from(buff.readBuffer(16))).canonicalForm(), port: buff.readUInt16BE() }; } this.setState(constants_1.SocksClientState.ReceivedFinalResponse); if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.connect) { this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit("established", { remoteHost, socket: this.socket }); } else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) { this.setState(constants_1.SocksClientState.BoundWaitingForConnection); this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; this.emit("bound", { remoteHost, socket: this.socket }); } else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.associate) { this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit("established", { remoteHost, socket: this.socket }); } } } /** * Handles Socks v5 incoming connection request (BIND). */ handleSocks5IncomingConnectionResponse() { const header = this.receiveBuffer.peek(5); if (header[0] !== 5 || header[1] !== constants_1.Socks5Response.Granted) { this.closeSocket(`${constants_1.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${constants_1.Socks5Response[header[1]]}`); } else { const addressType = header[3]; let remoteHost; let buff; if (addressType === constants_1.Socks5HostType.IPv4) { const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: (0, helpers_1.int32ToIpv4)(buff.readUInt32BE()), port: buff.readUInt16BE() }; if (remoteHost.host === "0.0.0.0") { remoteHost.host = this.options.proxy.ipaddress; } } else if (addressType === constants_1.Socks5HostType.Hostname) { const hostLength = header[4]; const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5)); remoteHost = { host: buff.readString(hostLength), port: buff.readUInt16BE() }; } else if (addressType === constants_1.Socks5HostType.IPv6) { const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip_address_1.Address6.fromByteArray(Array.from(buff.readBuffer(16))).canonicalForm(), port: buff.readUInt16BE() }; } this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit("established", { remoteHost, socket: this.socket }); } } get socksClientOptions() { return Object.assign({}, this.options); } }; exports2.SocksClient = SocksClient3; } }); // node_modules/socks/build/index.js var require_build = __commonJS({ "node_modules/socks/build/index.js"(exports2) { "use strict"; var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; var desc = Object.getOwnPropertyDescriptor(m3, k5); if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m3[k5]; } }; } Object.defineProperty(o2, k22, desc); }) : (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; o2[k22] = m3[k5]; })); var __exportStar2 = exports2 && exports2.__exportStar || function(m3, exports3) { for (var p2 in m3) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p2)) __createBinding2(exports3, m3, p2); }; Object.defineProperty(exports2, "__esModule", { value: true }); __exportStar2(require_socksclient(), exports2); } }); // node_modules/proxy-agent/node_modules/socks-proxy-agent/dist/index.js var dist_exports3 = {}; __export(dist_exports3, { SocksProxyAgent: () => SocksProxyAgent }); function parseSocksURL(url) { let lookup4 = false; let type = 5; const host = url.hostname; const port = parseInt(url.port, 10) || 1080; switch (url.protocol.replace(":", "")) { case "socks4": lookup4 = true; type = 4; break; // pass through case "socks4a": type = 4; break; case "socks5": lookup4 = true; type = 5; break; // pass through case "socks": type = 5; break; case "socks5h": type = 5; break; default: throw new TypeError(`A "socks" protocol must be specified! Got: ${String(url.protocol)}`); } const proxy = { host, port, type }; if (url.username) { Object.defineProperty(proxy, "userId", { value: decodeURIComponent(url.username), enumerable: false }); } if (url.password != null) { Object.defineProperty(proxy, "password", { value: decodeURIComponent(url.password), enumerable: false }); } return { lookup: lookup4, proxy }; } function omit3(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; } var import_socks, import_debug4, dns, net4, tls3, import_url3, debug5, setServernameFromNonIpHost2, SocksProxyAgent; var init_dist4 = __esm({ "node_modules/proxy-agent/node_modules/socks-proxy-agent/dist/index.js"() { import_socks = __toESM(require_build(), 1); init_dist(); import_debug4 = __toESM(require_src(), 1); dns = __toESM(require("dns"), 1); net4 = __toESM(require("net"), 1); tls3 = __toESM(require("tls"), 1); import_url3 = require("url"); debug5 = (0, import_debug4.default)("socks-proxy-agent"); setServernameFromNonIpHost2 = (options) => { if (options.servername === void 0 && options.host && !net4.isIP(options.host)) { return { ...options, servername: options.host }; } return options; }; SocksProxyAgent = class extends Agent4 { constructor(uri, opts) { super(opts); const url = typeof uri === "string" ? new import_url3.URL(uri) : uri; const { proxy, lookup: lookup4 } = parseSocksURL(url); this.shouldLookup = lookup4; this.proxy = proxy; this.timeout = opts?.timeout ?? null; this.socketOptions = opts?.socketOptions ?? null; } /** * Initiates a SOCKS connection to the specified SOCKS proxy server, * which in turn connects to the specified remote host and port. */ async connect(req, opts) { const { shouldLookup, proxy, timeout } = this; if (!opts.host) { throw new Error("No `host` defined!"); } let { host } = opts; const { port, lookup: lookupFn = dns.lookup } = opts; if (shouldLookup) { host = await new Promise((resolve, reject) => { lookupFn(host, {}, (err, address) => { if (err) { reject(err); } else { resolve(typeof address === "string" ? address : address[0].address); } }); }); } const socksOpts = { proxy, destination: { host, port: typeof port === "number" ? port : parseInt(port, 10) }, command: "connect", timeout: timeout ?? void 0, // @ts-expect-error the type supplied by socks for socket_options is wider // than necessary since socks will always override the host and port socket_options: this.socketOptions ?? void 0 }; const cleanup = (tlsSocket) => { req.destroy(); socket.destroy(); if (tlsSocket) tlsSocket.destroy(); }; debug5("Creating socks proxy connection: %o", socksOpts); const { socket } = await import_socks.SocksClient.createConnection(socksOpts); debug5("Successfully created socks proxy connection"); if (timeout !== null) { socket.setTimeout(timeout); socket.on("timeout", () => cleanup()); } if (opts.secureEndpoint) { debug5("Upgrading socket connection to TLS"); const tlsSocket = tls3.connect({ ...omit3(setServernameFromNonIpHost2(opts), "host", "path", "port"), socket }); tlsSocket.once("error", (error3) => { debug5("Socket TLS error", error3.message); cleanup(tlsSocket); }); return tlsSocket; } return socket; } }; SocksProxyAgent.protocols = [ "socks", "socks4", "socks4a", "socks5", "socks5h" ]; } }); // node_modules/pac-proxy-agent/node_modules/agent-base/dist/helpers.js async function toBuffer(stream) { let length = 0; const chunks = []; for await (const chunk of stream) { length += chunk.length; chunks.push(chunk); } return Buffer.concat(chunks, length); } var init_helpers2 = __esm({ "node_modules/pac-proxy-agent/node_modules/agent-base/dist/helpers.js"() { } }); // node_modules/pac-proxy-agent/node_modules/agent-base/dist/index.js var net5, http3, import_https2, INTERNAL2, Agent6; var init_dist5 = __esm({ "node_modules/pac-proxy-agent/node_modules/agent-base/dist/index.js"() { net5 = __toESM(require("net"), 1); http3 = __toESM(require("http"), 1); import_https2 = require("https"); init_helpers2(); INTERNAL2 = /* @__PURE__ */ Symbol("AgentBaseInternalState"); Agent6 = class extends http3.Agent { constructor(opts) { super(opts); this[INTERNAL2] = {}; } /** * Determine whether this is an `http` or `https` request. */ isSecureEndpoint(options) { if (options) { if (typeof options.secureEndpoint === "boolean") { return options.secureEndpoint; } if (typeof options.protocol === "string") { return options.protocol === "https:"; } } const { stack } = new Error(); if (typeof stack !== "string") return false; return stack.split("\n").some((l3) => l3.indexOf("(https.js:") !== -1 || l3.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(name) { if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) { return null; } if (!this.sockets[name]) { this.sockets[name] = []; } const fakeSocket = new net5.Socket({ writable: false }); this.sockets[name].push(fakeSocket); this.totalSocketCount++; return fakeSocket; } decrementSockets(name, socket) { if (!this.sockets[name] || socket === null) { return; } const sockets = this.sockets[name]; const index = sockets.indexOf(socket); if (index !== -1) { sockets.splice(index, 1); this.totalSocketCount--; if (sockets.length === 0) { delete this.sockets[name]; } } } // In order to properly update the socket pool, we need to call `getName()` on // the core `https.Agent` if it is a secureEndpoint. getName(options) { const secureEndpoint = this.isSecureEndpoint(options); if (secureEndpoint) { return import_https2.Agent.prototype.getName.call(this, options); } return super.getName(options); } createSocket(req, options, cb) { const connectOpts = { ...options, secureEndpoint: this.isSecureEndpoint(options) }; const name = this.getName(connectOpts); const fakeSocket = this.incrementSockets(name); Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => { this.decrementSockets(name, fakeSocket); if (typeof socket.addRequest === "function") { try { return socket.addRequest(req, connectOpts); } catch (err) { return cb(err); } } this[INTERNAL2].currentSocket = socket; super.createSocket(req, options, cb); }, (err) => { this.decrementSockets(name, fakeSocket); cb(err); }); } createConnection() { const socket = this[INTERNAL2].currentSocket; this[INTERNAL2].currentSocket = void 0; if (!socket) { throw new Error("No socket was returned in the `connect()` function"); } return socket; } get defaultPort() { return this[INTERNAL2].defaultPort ?? (this.protocol === "https:" ? 443 : 80); } set defaultPort(v) { if (this[INTERNAL2]) { this[INTERNAL2].defaultPort = v; } } get protocol() { return this[INTERNAL2].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); } set protocol(v) { if (this[INTERNAL2]) { this[INTERNAL2].protocol = v; } } }; } }); // node_modules/data-uri-to-buffer/dist/common.js var makeDataUriToBuffer; var init_common2 = __esm({ "node_modules/data-uri-to-buffer/dist/common.js"() { makeDataUriToBuffer = (convert) => (uri) => { uri = String(uri); if (!/^data:/i.test(uri)) { throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")'); } uri = uri.replace(/\r?\n/g, ""); const firstComma = uri.indexOf(","); if (firstComma === -1 || firstComma <= 4) { throw new TypeError("malformed data: URI"); } const meta = uri.substring(5, firstComma).split(";"); let charset = ""; let base64 = false; const type = meta[0] || "text/plain"; let typeFull = type; for (let i5 = 1; i5 < meta.length; i5++) { if (meta[i5] === "base64") { base64 = true; } else if (meta[i5]) { typeFull += `;${meta[i5]}`; if (meta[i5].indexOf("charset=") === 0) { charset = meta[i5].substring(8); } } } if (!meta[0] && !charset.length) { typeFull += ";charset=US-ASCII"; charset = "US-ASCII"; } const data3 = unescape(uri.substring(firstComma + 1)); const buffer = base64 ? convert.base64ToArrayBuffer(data3) : convert.stringToBuffer(data3); return { type, typeFull, charset, buffer }; }; } }); // node_modules/data-uri-to-buffer/dist/node.js function nodeBuffertoArrayBuffer(nodeBuf) { if (nodeBuf.byteLength === nodeBuf.buffer.byteLength) { return nodeBuf.buffer; } const buffer = new ArrayBuffer(nodeBuf.byteLength); const view = new Uint8Array(buffer); view.set(nodeBuf); return buffer; } function base64ToArrayBuffer(base64) { return nodeBuffertoArrayBuffer(Buffer.from(base64, "base64")); } function stringToBuffer(str) { return nodeBuffertoArrayBuffer(Buffer.from(str, "ascii")); } var dataUriToBuffer; var init_node = __esm({ "node_modules/data-uri-to-buffer/dist/node.js"() { init_common2(); dataUriToBuffer = makeDataUriToBuffer({ stringToBuffer, base64ToArrayBuffer }); } }); // node_modules/get-uri/dist/notmodified.js var NotModifiedError; var init_notmodified = __esm({ "node_modules/get-uri/dist/notmodified.js"() { NotModifiedError = class extends Error { constructor(message) { super(message || 'Source has not been modified since the provied "cache", re-use previous results'); this.code = "ENOTMODIFIED"; } }; } }); // node_modules/get-uri/dist/data.js var import_debug5, import_stream, import_crypto, debug6, DataReadable, data2; var init_data = __esm({ "node_modules/get-uri/dist/data.js"() { import_debug5 = __toESM(require_src(), 1); import_stream = require("stream"); import_crypto = require("crypto"); init_node(); init_notmodified(); debug6 = (0, import_debug5.default)("get-uri:data"); DataReadable = class extends import_stream.Readable { constructor(hash, buf) { super(); this.push(buf); this.push(null); this.hash = hash; } }; data2 = async ({ href: uri }, { cache: cache5 } = {}) => { const shasum = (0, import_crypto.createHash)("sha1"); shasum.update(uri); const hash = shasum.digest("hex"); debug6('generated SHA1 hash for "data:" URI: %o', hash); if (cache5?.hash === hash) { debug6("got matching cache SHA1 hash: %o", hash); throw new NotModifiedError(); } else { debug6('creating Readable stream from "data:" URI buffer'); const { buffer } = dataUriToBuffer(uri); return new DataReadable(hash, Buffer.from(buffer)); } }; } }); // node_modules/get-uri/dist/notfound.js var NotFoundError; var init_notfound = __esm({ "node_modules/get-uri/dist/notfound.js"() { NotFoundError = class extends Error { constructor(message) { super(message || "File does not exist at the specified endpoint"); this.code = "ENOTFOUND"; } }; } }); // node_modules/get-uri/dist/file.js function isNotModified(prev, curr) { return +prev.mtime === +curr.mtime; } var import_debug6, import_fs2, import_url4, debug7, file; var init_file = __esm({ "node_modules/get-uri/dist/file.js"() { import_debug6 = __toESM(require_src(), 1); import_fs2 = require("fs"); init_notfound(); init_notmodified(); import_url4 = require("url"); debug7 = (0, import_debug6.default)("get-uri:file"); file = async ({ href: uri }, opts = {}) => { const { cache: cache5, flags = "r", mode = 438 // =0666 } = opts; try { const filepath = (0, import_url4.fileURLToPath)(uri); debug7("Normalized pathname: %o", filepath); const fdHandle = await import_fs2.promises.open(filepath, flags, mode); const stat2 = await fdHandle.stat(); if (cache5 && cache5.stat && stat2 && isNotModified(cache5.stat, stat2)) { await fdHandle.close(); throw new NotModifiedError(); } const rs = (0, import_fs2.createReadStream)(filepath, { autoClose: true, ...opts, fd: fdHandle }); rs.stat = stat2; return rs; } catch (err) { if (err.code === "ENOENT") { throw new NotFoundError(); } throw err; } }; } }); // node_modules/basic-ftp/dist/parseControlResponse.js var require_parseControlResponse = __commonJS({ "node_modules/basic-ftp/dist/parseControlResponse.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.parseControlResponse = parseControlResponse; exports2.isSingleLine = isSingleLine; exports2.isMultiline = isMultiline; exports2.positiveCompletion = positiveCompletion; exports2.positiveIntermediate = positiveIntermediate; var LF = "\n"; function parseControlResponse(text) { const lines = text.split(/\r?\n/).filter(isNotBlank); const messages = []; let startAt = 0; let tokenRegex; for (let i5 = 0; i5 < lines.length; i5++) { const line = lines[i5]; if (!tokenRegex) { if (isMultiline(line)) { const token = line.substr(0, 3); tokenRegex = new RegExp(`^${token}(?:$| )`); startAt = i5; } else if (isSingleLine(line)) { messages.push(line); } } else if (tokenRegex.test(line)) { tokenRegex = void 0; messages.push(lines.slice(startAt, i5 + 1).join(LF)); } } const rest = tokenRegex ? lines.slice(startAt).join(LF) + LF : ""; return { messages, rest }; } function isSingleLine(line) { return /^\d\d\d(?:$| )/.test(line); } function isMultiline(line) { return /^\d\d\d-/.test(line); } function positiveCompletion(code) { return code >= 200 && code < 300; } function positiveIntermediate(code) { return code >= 300 && code < 400; } function isNotBlank(str) { return str.trim() !== ""; } } }); // node_modules/basic-ftp/dist/FtpContext.js var require_FtpContext = __commonJS({ "node_modules/basic-ftp/dist/FtpContext.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FTPContext = exports2.FTPError = void 0; var net_1 = require("net"); var parseControlResponse_1 = require_parseControlResponse(); var FTPError = class extends Error { constructor(res) { super(res.message); this.name = this.constructor.name; this.code = res.code; } }; exports2.FTPError = FTPError; function doNothing() { } var maxControlResponseLength = 2 ** 16; var FTPContext = class { /** * Instantiate an FTP context. * * @param timeout - Timeout in milliseconds to apply to control and data connections. Use 0 for no timeout. * @param encoding - Encoding to use for control connection. UTF-8 by default. Use "latin1" for older servers. */ constructor(timeout = 0, encoding = "utf8") { this.timeout = timeout; this.verbose = false; this.ipFamily = void 0; this.tlsOptions = {}; this._partialResponse = ""; this._encoding = encoding; this._socket = this.socket = this._newSocket(); this._dataSocket = void 0; } /** * Close the context. */ close() { const message = this._task ? "User closed client during task" : "User closed client"; const err = new Error(message); this.closeWithError(err); } /** * Close the context with an error. */ closeWithError(err) { if (this._closingError) { return; } this._closingError = err; this._closeControlSocket(); this._closeSocket(this._dataSocket); this._passToHandler(err); this._stopTrackingTask(); } /** * Returns true if this context has been closed or hasn't been connected yet. You can reopen it with `access`. */ get closed() { return this.socket.remoteAddress === void 0 || this._closingError !== void 0; } /** * Reset this contex and all of its state. */ reset() { this.socket = this._newSocket(); } /** * Get the FTP control socket. */ get socket() { return this._socket; } /** * Set the socket for the control connection. This will only close the current control socket * if the new one is not an upgrade to the current one. */ set socket(socket) { this.dataSocket = void 0; this.tlsOptions = {}; this._partialResponse = ""; if (this._socket) { const newSocketUpgradesExisting = socket.localPort === this._socket.localPort; if (newSocketUpgradesExisting) { this._removeSocketListeners(this.socket); } else { this._closeControlSocket(); } } if (socket) { this._closingError = void 0; socket.setTimeout(0); socket.setEncoding(this._encoding); socket.setKeepAlive(true); socket.on("data", (data3) => this._onControlSocketData(data3)); socket.on("end", () => this.closeWithError(new Error("Server sent FIN packet unexpectedly, closing connection."))); socket.on("close", (hadError) => { if (!hadError) this.closeWithError(new Error("Server closed connection unexpectedly.")); }); this._setupDefaultErrorHandlers(socket, "control socket"); } this._socket = socket; } /** * Get the current FTP data connection if present. */ get dataSocket() { return this._dataSocket; } /** * Set the socket for the data connection. This will automatically close the former data socket. */ set dataSocket(socket) { this._closeSocket(this._dataSocket); if (socket) { socket.setTimeout(0); this._setupDefaultErrorHandlers(socket, "data socket"); } this._dataSocket = socket; } /** * Get the currently used encoding. */ get encoding() { return this._encoding; } /** * Set the encoding used for the control socket. * * See https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings for what encodings * are supported by Node. */ set encoding(encoding) { this._encoding = encoding; if (this.socket) { this.socket.setEncoding(encoding); } } /** * Send an FTP command without waiting for or handling the result. */ send(command) { if (/[\r\n\0]/.test(command)) { throw new Error(`Invalid command: Contains control characters. (${command})`); } const containsPassword = command.startsWith("PASS"); const message = containsPassword ? "> PASS ###" : `> ${command}`; this.log(message); this._socket.write(command + "\r\n", this.encoding); } /** * Send an FTP command and handle the first response. Use this if you have a simple * request-response situation. */ request(command) { return this.handle(command, (res, task) => { if (res instanceof Error) { task.reject(res); } else { task.resolve(res); } }); } /** * Send an FTP command and handle any response until you resolve/reject. Use this if you expect multiple responses * to a request. This returns a Promise that will hold whatever the response handler passed on when resolving/rejecting its task. */ handle(command, responseHandler) { if (this._task) { const err = new Error("User launched a task while another one is still running. Forgot to use 'await' or '.then()'?"); err.stack += ` Running task launched at: ${this._task.stack}`; this.closeWithError(err); } return new Promise((resolveTask, rejectTask) => { this._task = { stack: new Error().stack || "Unknown call stack", responseHandler, resolver: { resolve: (arg) => { this._stopTrackingTask(); resolveTask(arg); }, reject: (err) => { this._stopTrackingTask(); rejectTask(err); } } }; if (this._closingError) { const err = new Error(`Client is closed because ${this._closingError.message}`); err.stack += ` Closing reason: ${this._closingError.stack}`; err.code = this._closingError.code !== void 0 ? this._closingError.code : "0"; this._passToHandler(err); return; } this.socket.setTimeout(this.timeout); if (command) { this.send(command); } }); } /** * Log message if set to be verbose. */ log(message) { if (this.verbose) { console.log(message); } } /** * Return true if the control socket is using TLS. This does not mean that a session * has already been negotiated. */ get hasTLS() { return "encrypted" in this._socket; } /** * Removes reference to current task and handler. This won't resolve or reject the task. * @protected */ _stopTrackingTask() { this.socket.setTimeout(0); this._task = void 0; } /** * Handle incoming data on the control socket. The chunk is going to be of type `string` * because we let `socket` handle encoding with `setEncoding`. * @protected */ _onControlSocketData(chunk) { this.log(`< ${chunk}`); if (this._partialResponse.length + chunk.length > maxControlResponseLength) { this.closeWithError(new Error("FTP control response exceeded maximum allowed size")); return; } const completeResponse = this._partialResponse + chunk; const parsed = (0, parseControlResponse_1.parseControlResponse)(completeResponse); this._partialResponse = parsed.rest; for (const message of parsed.messages) { const code = parseInt(message.substr(0, 3), 10); const response = { code, message }; const err = code >= 400 ? new FTPError(response) : void 0; this._passToHandler(err ? err : response); } } /** * Send the current handler a response. This is usually a control socket response * or a socket event, like an error or timeout. * @protected */ _passToHandler(response) { if (this._task) { this._task.responseHandler(response, this._task.resolver); } } /** * Setup all error handlers for a socket. * @protected */ _setupDefaultErrorHandlers(socket, identifier) { socket.once("error", (error3) => { error3.message += ` (${identifier})`; this.closeWithError(error3); }); socket.once("close", (hadError) => { if (hadError) { this.closeWithError(new Error(`Socket closed due to transmission error (${identifier})`)); } }); socket.once("timeout", () => { socket.destroy(); this.closeWithError(new Error(`Timeout (${identifier})`)); }); } /** * Close the control socket. Sends QUIT, then FIN, and ignores any response or error. */ _closeControlSocket() { this._removeSocketListeners(this._socket); this._socket.on("error", doNothing); this.send("QUIT"); this._closeSocket(this._socket); } /** * Close a socket, ignores any error. * @protected */ _closeSocket(socket) { if (socket) { this._removeSocketListeners(socket); socket.on("error", doNothing); socket.destroy(); } } /** * Remove all default listeners for socket. * @protected */ _removeSocketListeners(socket) { socket.removeAllListeners(); socket.removeAllListeners("timeout"); socket.removeAllListeners("data"); socket.removeAllListeners("end"); socket.removeAllListeners("error"); socket.removeAllListeners("close"); socket.removeAllListeners("connect"); } /** * Provide a new socket instance. * * Internal use only, replaced for unit tests. */ _newSocket() { return new net_1.Socket(); } }; exports2.FTPContext = FTPContext; } }); // node_modules/basic-ftp/dist/netUtils.js var require_netUtils = __commonJS({ "node_modules/basic-ftp/dist/netUtils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.describeTLS = describeTLS; exports2.describeAddress = describeAddress; exports2.upgradeSocket = upgradeSocket; exports2.ipIsPrivateV4Address = ipIsPrivateV4Address; var tls_1 = require("tls"); function describeTLS(socket) { if (socket instanceof tls_1.TLSSocket) { const protocol = socket.getProtocol(); return protocol ? protocol : "Server socket or disconnected client socket"; } return "No encryption"; } function describeAddress(socket) { if (socket.remoteFamily === "IPv6") { return `[${socket.remoteAddress}]:${socket.remotePort}`; } return `${socket.remoteAddress}:${socket.remotePort}`; } function upgradeSocket(socket, options) { return new Promise((resolve, reject) => { const tlsOptions = Object.assign({}, options, { socket }); const tlsSocket = (0, tls_1.connect)(tlsOptions, () => { const expectCertificate = tlsOptions.rejectUnauthorized !== false; if (expectCertificate && !tlsSocket.authorized) { reject(tlsSocket.authorizationError); } else { tlsSocket.removeAllListeners("error"); resolve(tlsSocket); } }).once("error", (error3) => { reject(error3); }); }); } function ipIsPrivateV4Address(ip2 = "") { if (ip2.startsWith("::ffff:")) { ip2 = ip2.substr(7); } const octets = ip2.split(".").map((o2) => parseInt(o2, 10)); return octets[0] === 10 || octets[0] === 172 && octets[1] >= 16 && octets[1] <= 31 || octets[0] === 192 && octets[1] === 168 || ip2 === "127.0.0.1"; } } }); // node_modules/basic-ftp/dist/FileInfo.js var require_FileInfo = __commonJS({ "node_modules/basic-ftp/dist/FileInfo.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.FileInfo = exports2.FileType = void 0; var FileType; (function(FileType2) { FileType2[FileType2["Unknown"] = 0] = "Unknown"; FileType2[FileType2["File"] = 1] = "File"; FileType2[FileType2["Directory"] = 2] = "Directory"; FileType2[FileType2["SymbolicLink"] = 3] = "SymbolicLink"; })(FileType || (exports2.FileType = FileType = {})); var FileInfo = class { constructor(name) { this.name = name; this.type = FileType.Unknown; this.size = 0; this.rawModifiedAt = ""; this.modifiedAt = void 0; this.permissions = void 0; this.hardLinkCount = void 0; this.link = void 0; this.group = void 0; this.user = void 0; this.uniqueID = void 0; this.name = name; } get isDirectory() { return this.type === FileType.Directory; } get isSymbolicLink() { return this.type === FileType.SymbolicLink; } get isFile() { return this.type === FileType.File; } /** * Deprecated, legacy API. Use `rawModifiedAt` instead. * @deprecated */ get date() { return this.rawModifiedAt; } set date(rawModifiedAt) { this.rawModifiedAt = rawModifiedAt; } }; exports2.FileInfo = FileInfo; FileInfo.UnixPermission = { Read: 4, Write: 2, Execute: 1 }; } }); // node_modules/basic-ftp/dist/parseListDOS.js var require_parseListDOS = __commonJS({ "node_modules/basic-ftp/dist/parseListDOS.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.testLine = testLine; exports2.parseLine = parseLine; exports2.transformList = transformList; var FileInfo_1 = require_FileInfo(); var RE_LINE = new RegExp( "(\\S+)\\s+(\\S+)\\s+(?:()|([0-9]+))\\s+(\\S.*)" // First non-space followed by rest of line (name) ); function testLine(line) { return /^\d{2}/.test(line) && RE_LINE.test(line); } function parseLine(line) { const groups = line.match(RE_LINE); if (groups === null) { return void 0; } const name = groups[5]; if (name === "." || name === "..") { return void 0; } const file2 = new FileInfo_1.FileInfo(name); const fileType = groups[3]; if (fileType === "") { file2.type = FileInfo_1.FileType.Directory; file2.size = 0; } else { file2.type = FileInfo_1.FileType.File; file2.size = parseInt(groups[4], 10); } file2.rawModifiedAt = groups[1] + " " + groups[2]; return file2; } function transformList(files) { return files; } } }); // node_modules/basic-ftp/dist/parseListUnix.js var require_parseListUnix = __commonJS({ "node_modules/basic-ftp/dist/parseListUnix.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.testLine = testLine; exports2.parseLine = parseLine; exports2.transformList = transformList; var FileInfo_1 = require_FileInfo(); var JA_MONTH = "\u6708"; var JA_DAY = "\u65E5"; var JA_YEAR = "\u5E74"; var RE_LINE = new RegExp("([bcdelfmpSs-])(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]?)))\\+?\\s*(\\d+)\\s+(?:(\\S+(?:\\s\\S+)*?)\\s+)?(?:(\\S+(?:\\s\\S+)*)\\s+)?(\\d+(?:,\\s*\\d+)?)\\s+((?:\\d+[-/]\\d+[-/]\\d+)|(?:\\S{3}\\s+\\d{1,2})|(?:\\d{1,2}\\s+\\S{3})|(?:\\d{1,2}" + JA_MONTH + "\\s+\\d{1,2}" + JA_DAY + "))\\s+((?:\\d+(?::\\d+)?)|(?:\\d{4}" + JA_YEAR + "))\\s(.*)"); function testLine(line) { return RE_LINE.test(line); } function parseLine(line) { const groups = line.match(RE_LINE); if (groups === null) { return void 0; } const name = groups[21]; if (name === "." || name === "..") { return void 0; } const file2 = new FileInfo_1.FileInfo(name); file2.size = parseInt(groups[18], 10); file2.user = groups[16]; file2.group = groups[17]; file2.hardLinkCount = parseInt(groups[15], 10); file2.rawModifiedAt = groups[19] + " " + groups[20]; file2.permissions = { user: parseMode(groups[4], groups[5], groups[6]), group: parseMode(groups[8], groups[9], groups[10]), world: parseMode(groups[12], groups[13], groups[14]) }; switch (groups[1].charAt(0)) { case "d": file2.type = FileInfo_1.FileType.Directory; break; case "e": file2.type = FileInfo_1.FileType.SymbolicLink; break; case "l": file2.type = FileInfo_1.FileType.SymbolicLink; break; case "b": case "c": file2.type = FileInfo_1.FileType.File; break; case "f": case "-": file2.type = FileInfo_1.FileType.File; break; default: file2.type = FileInfo_1.FileType.Unknown; } if (file2.isSymbolicLink) { const end = name.indexOf(" -> "); if (end !== -1) { file2.name = name.substring(0, end); file2.link = name.substring(end + 4); } } return file2; } function transformList(files) { return files; } function parseMode(r5, w, x) { let value = 0; if (r5 !== "-") { value += FileInfo_1.FileInfo.UnixPermission.Read; } if (w !== "-") { value += FileInfo_1.FileInfo.UnixPermission.Write; } const execToken = x.charAt(0); if (execToken !== "-" && execToken.toUpperCase() !== execToken) { value += FileInfo_1.FileInfo.UnixPermission.Execute; } return value; } } }); // node_modules/basic-ftp/dist/parseListMLSD.js var require_parseListMLSD = __commonJS({ "node_modules/basic-ftp/dist/parseListMLSD.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.testLine = testLine; exports2.parseLine = parseLine; exports2.transformList = transformList; exports2.parseMLSxDate = parseMLSxDate; var FileInfo_1 = require_FileInfo(); function parseSize(value, info2) { info2.size = parseInt(value, 10); } var factHandlersByName = { "size": parseSize, // File size "sizd": parseSize, // Directory size "unique": (value, info2) => { info2.uniqueID = value; }, "modify": (value, info2) => { info2.modifiedAt = parseMLSxDate(value); info2.rawModifiedAt = info2.modifiedAt.toISOString(); }, "type": (value, info2) => { if (value.startsWith("OS.unix=slink")) { info2.type = FileInfo_1.FileType.SymbolicLink; info2.link = value.substr(value.indexOf(":") + 1); return 1; } switch (value) { case "file": info2.type = FileInfo_1.FileType.File; break; case "dir": info2.type = FileInfo_1.FileType.Directory; break; case "OS.unix=symlink": info2.type = FileInfo_1.FileType.SymbolicLink; break; case "cdir": // Current directory being listed case "pdir": return 2; // Don't include these entries in the listing default: info2.type = FileInfo_1.FileType.Unknown; } return 1; }, "unix.mode": (value, info2) => { const digits = value.substr(-3); info2.permissions = { user: parseInt(digits[0], 10), group: parseInt(digits[1], 10), world: parseInt(digits[2], 10) }; }, "unix.ownername": (value, info2) => { info2.user = value; }, "unix.owner": (value, info2) => { if (info2.user === void 0) info2.user = value; }, get "unix.uid"() { return this["unix.owner"]; }, "unix.groupname": (value, info2) => { info2.group = value; }, "unix.group": (value, info2) => { if (info2.group === void 0) info2.group = value; }, get "unix.gid"() { return this["unix.group"]; } // Regarding the fact "perm": // We don't handle permission information stored in "perm" because its information is conceptually // different from what users of FTP clients usually associate with "permissions". Those that have // some expectations (and probably want to edit them with a SITE command) often unknowingly expect // the Unix permission system. The information passed by "perm" describes what FTP commands can be // executed with a file/directory. But even this can be either incomplete or just meant as a "guide" // as the spec mentions. From https://tools.ietf.org/html/rfc3659#section-7.5.5: "The permissions are // described here as they apply to FTP commands. They may not map easily into particular permissions // available on the server's operating system." The parser by Apache Commons tries to translate these // to Unix permissions – this is misleading users and might not even be correct. }; function splitStringOnce(str, delimiter) { const pos = str.indexOf(delimiter); const a5 = str.substr(0, pos); const b6 = str.substr(pos + delimiter.length); return [a5, b6]; } function testLine(line) { return /^\S+=\S+;/.test(line) || line.startsWith(" "); } function parseLine(line) { const [packedFacts, name] = splitStringOnce(line, " "); if (name === "" || name === "." || name === "..") { return void 0; } const info2 = new FileInfo_1.FileInfo(name); const facts = packedFacts.split(";"); for (const fact of facts) { const [factName, factValue] = splitStringOnce(fact, "="); if (!factValue) { continue; } const factHandler = factHandlersByName[factName.toLowerCase()]; if (!factHandler) { continue; } const result = factHandler(factValue, info2); if (result === 2) { return void 0; } } return info2; } function transformList(files) { const nonLinksByID = /* @__PURE__ */ new Map(); for (const file2 of files) { if (!file2.isSymbolicLink && file2.uniqueID !== void 0) { nonLinksByID.set(file2.uniqueID, file2); } } const resolvedFiles = []; for (const file2 of files) { if (file2.isSymbolicLink && file2.uniqueID !== void 0 && file2.link === void 0) { const target = nonLinksByID.get(file2.uniqueID); if (target !== void 0) { file2.link = target.name; } } const isPartOfDirectory = !file2.name.includes("/"); if (isPartOfDirectory) { resolvedFiles.push(file2); } } return resolvedFiles; } function parseMLSxDate(fact) { return new Date(Date.UTC( +fact.slice(0, 4), // Year +fact.slice(4, 6) - 1, // Month +fact.slice(6, 8), // Date +fact.slice(8, 10), // Hours +fact.slice(10, 12), // Minutes +fact.slice(12, 14), // Seconds +fact.slice(15, 18) // Milliseconds )); } } }); // node_modules/basic-ftp/dist/parseList.js var require_parseList = __commonJS({ "node_modules/basic-ftp/dist/parseList.js"(exports2) { "use strict"; var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; var desc = Object.getOwnPropertyDescriptor(m3, k5); if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m3[k5]; } }; } Object.defineProperty(o2, k22, desc); }) : (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; o2[k22] = m3[k5]; })); var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o2, v) { Object.defineProperty(o2, "default", { enumerable: true, value: v }); }) : function(o2, v) { o2["default"] = v; }); var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { var ownKeys2 = function(o2) { ownKeys2 = Object.getOwnPropertyNames || function(o3) { var ar = []; for (var k5 in o3) if (Object.prototype.hasOwnProperty.call(o3, k5)) ar[ar.length] = k5; return ar; }; return ownKeys2(o2); }; return function(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) { for (var k5 = ownKeys2(mod), i5 = 0; i5 < k5.length; i5++) if (k5[i5] !== "default") __createBinding2(result, mod, k5[i5]); } __setModuleDefault2(result, mod); return result; }; })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.parseList = parseList; var dosParser = __importStar2(require_parseListDOS()); var unixParser = __importStar2(require_parseListUnix()); var mlsdParser = __importStar2(require_parseListMLSD()); var availableParsers = [ dosParser, unixParser, mlsdParser // Keep MLSD last, may accept filename only ]; function firstCompatibleParser(line, parsers) { return parsers.find((parser) => parser.testLine(line) === true); } function isNotBlank(str) { return str.trim() !== ""; } function isNotMeta(str) { return !str.startsWith("total"); } var REGEX_NEWLINE = /\r?\n/; function parseList(rawList) { const lines = rawList.split(REGEX_NEWLINE).filter(isNotBlank).filter(isNotMeta); if (lines.length === 0) { return []; } const testLine = lines[lines.length - 1]; const parser = firstCompatibleParser(testLine, availableParsers); if (!parser) { throw new Error("This library only supports MLSD, Unix- or DOS-style directory listing. Your FTP server seems to be using another format. You can see the transmitted listing when setting `client.ftp.verbose = true`. You can then provide a custom parser to `client.parseList`, see the documentation for details."); } const files = lines.map(parser.parseLine).filter((info2) => info2 !== void 0); return parser.transformList(files); } } }); // node_modules/basic-ftp/dist/ProgressTracker.js var require_ProgressTracker = __commonJS({ "node_modules/basic-ftp/dist/ProgressTracker.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ProgressTracker = void 0; var ProgressTracker = class { constructor() { this.bytesOverall = 0; this.intervalMs = 500; this.onStop = noop; this.onHandle = noop; } /** * Register a new handler for progress info. Use `undefined` to disable reporting. */ reportTo(onHandle = noop) { this.onHandle = onHandle; } /** * Start tracking transfer progress of a socket. * * @param socket The socket to observe. * @param name A name associated with this progress tracking, e.g. a filename. * @param type The type of the transfer, typically "upload" or "download". */ start(socket, name, type) { let lastBytes = 0; this.onStop = poll(this.intervalMs, () => { const bytes = socket.bytesRead + socket.bytesWritten; this.bytesOverall += bytes - lastBytes; lastBytes = bytes; this.onHandle({ name, type, bytes, bytesOverall: this.bytesOverall }); }); } /** * Stop tracking transfer progress. */ stop() { this.onStop(false); } /** * Call the progress handler one more time, then stop tracking. */ updateAndStop() { this.onStop(true); } }; exports2.ProgressTracker = ProgressTracker; function poll(intervalMs, updateFunc) { const id = setInterval(updateFunc, intervalMs); const stopFunc = (stopWithUpdate) => { clearInterval(id); if (stopWithUpdate) { updateFunc(); } updateFunc = noop; }; updateFunc(); return stopFunc; } function noop() { } } }); // node_modules/basic-ftp/dist/StringWriter.js var require_StringWriter = __commonJS({ "node_modules/basic-ftp/dist/StringWriter.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.StringWriter = void 0; var stream_1 = require("stream"); var StringWriter = class extends stream_1.Writable { constructor(maxByteLength = 1 * 1024 * 1024) { super(); this.maxByteLength = maxByteLength; this.byteLength = 0; this.bufs = []; } _write(chunk, _, callback) { if (!(chunk instanceof Buffer)) { callback(new Error("StringWriter: expects chunks of type 'Buffer'.")); return; } if (this.byteLength + chunk.byteLength > this.maxByteLength) { callback(new Error(`StringWriter: Maximum bytes exceeded, maxByteLength=${this.maxByteLength}.`)); return; } this.byteLength += chunk.byteLength; this.bufs.push(chunk); callback(null); } getText(encoding) { return Buffer.concat(this.bufs).toString(encoding); } }; exports2.StringWriter = StringWriter; } }); // node_modules/basic-ftp/dist/transfer.js var require_transfer = __commonJS({ "node_modules/basic-ftp/dist/transfer.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.enterPassiveModeIPv6 = enterPassiveModeIPv6; exports2.parseEpsvResponse = parseEpsvResponse; exports2.enterPassiveModeIPv4 = enterPassiveModeIPv4; exports2.enterPassiveModeIPv4_forceControlHostIP = enterPassiveModeIPv4_forceControlHostIP; exports2.parsePasvResponse = parsePasvResponse; exports2.connectForPassiveTransfer = connectForPassiveTransfer; exports2.uploadFrom = uploadFrom; exports2.downloadTo = downloadTo; var netUtils_1 = require_netUtils(); var stream_1 = require("stream"); var tls_1 = require("tls"); var parseControlResponse_1 = require_parseControlResponse(); async function enterPassiveModeIPv6(ftp2) { const res = await ftp2.request("EPSV"); const port = parseEpsvResponse(res.message); if (!port) { throw new Error("Can't parse EPSV response: " + res.message); } const controlHost = ftp2.socket.remoteAddress; if (controlHost === void 0) { throw new Error("Control socket is disconnected, can't get remote address."); } await connectForPassiveTransfer(controlHost, port, ftp2); return res; } function parseEpsvResponse(message) { const groups = message.match(/[|!]{3}(.+)[|!]/); if (groups === null || groups[1] === void 0) { throw new Error(`Can't parse response to 'EPSV': ${message}`); } const port = parseInt(groups[1], 10); if (Number.isNaN(port)) { throw new Error(`Can't parse response to 'EPSV', port is not a number: ${message}`); } return port; } async function enterPassiveModeIPv4(ftp2) { const res = await ftp2.request("PASV"); const target = parsePasvResponse(res.message); if (!target) { throw new Error("Can't parse PASV response: " + res.message); } const controlHost = ftp2.socket.remoteAddress; if ((0, netUtils_1.ipIsPrivateV4Address)(target.host) && controlHost && !(0, netUtils_1.ipIsPrivateV4Address)(controlHost)) { target.host = controlHost; } await connectForPassiveTransfer(target.host, target.port, ftp2); return res; } async function enterPassiveModeIPv4_forceControlHostIP(ftp2) { const res = await ftp2.request("PASV"); const target = parsePasvResponse(res.message); if (!target) { throw new Error("Can't parse PASV response: " + res.message); } const controlHost = ftp2.socket.remoteAddress; if (controlHost === void 0) { throw new Error("Control socket is disconnected, can't get remote address."); } await connectForPassiveTransfer(controlHost, target.port, ftp2); return res; } function parsePasvResponse(message) { const groups = message.match(/([-\d]+,[-\d]+,[-\d]+,[-\d]+),([-\d]+),([-\d]+)/); if (groups === null || groups.length !== 4) { throw new Error(`Can't parse response to 'PASV': ${message}`); } return { host: groups[1].replace(/,/g, "."), port: (parseInt(groups[2], 10) & 255) * 256 + (parseInt(groups[3], 10) & 255) }; } function connectForPassiveTransfer(host, port, ftp2) { return new Promise((resolve, reject) => { let socket = ftp2._newSocket(); const handleConnErr = function(err) { err.message = "Can't open data connection in passive mode: " + err.message; reject(err); }; const handleTimeout = function() { socket.destroy(); reject(new Error(`Timeout when trying to open data connection to ${host}:${port}`)); }; socket.setTimeout(ftp2.timeout); socket.on("error", handleConnErr); socket.on("timeout", handleTimeout); socket.connect({ port, host, family: ftp2.ipFamily }, () => { if (ftp2.socket instanceof tls_1.TLSSocket) { socket = (0, tls_1.connect)(Object.assign({}, ftp2.tlsOptions, { socket, // Reuse the TLS session negotiated earlier when the control connection // was upgraded. Servers expect this because it provides additional // security: If a completely new session would be negotiated, a hacker // could guess the port and connect to the new data connection before we do // by just starting his/her own TLS session. session: ftp2.socket.getSession() })); } socket.removeListener("error", handleConnErr); socket.removeListener("timeout", handleTimeout); ftp2.dataSocket = socket; resolve(); }); }); } var TransferResolver = class { /** * Instantiate a TransferResolver */ constructor(ftp2, progress) { this.ftp = ftp2; this.progress = progress; this.response = void 0; this.dataTransferDone = false; } /** * Mark the beginning of a transfer. * * @param name - Name of the transfer, usually the filename. * @param type - Type of transfer, usually "upload" or "download". */ onDataStart(name, type) { if (this.ftp.dataSocket === void 0) { throw new Error("Data transfer should start but there is no data connection."); } this.ftp.socket.setTimeout(0); this.ftp.dataSocket.setTimeout(this.ftp.timeout); this.progress.start(this.ftp.dataSocket, name, type); } /** * The data connection has finished the transfer. */ onDataDone(task) { this.progress.updateAndStop(); this.ftp.socket.setTimeout(this.ftp.timeout); if (this.ftp.dataSocket) { this.ftp.dataSocket.setTimeout(0); } this.dataTransferDone = true; this.tryResolve(task); } /** * The control connection reports the transfer as finished. */ onControlDone(task, response) { this.response = response; this.tryResolve(task); } /** * An error has been reported and the task should be rejected. */ onError(task, err) { this.progress.updateAndStop(); this.ftp.socket.setTimeout(this.ftp.timeout); this.ftp.dataSocket = void 0; task.reject(err); } /** * Control connection sent an unexpected request requiring a response from our part. We * can't provide that (because unknown) and have to close the contrext with an error because * the FTP server is now caught up in a state we can't resolve. */ onUnexpectedRequest(response) { const err = new Error(`Unexpected FTP response is requesting an answer: ${response.message}`); this.ftp.closeWithError(err); } tryResolve(task) { const canResolve = this.dataTransferDone && this.response !== void 0; if (canResolve) { this.ftp.dataSocket = void 0; task.resolve(this.response); } } }; function uploadFrom(source, config) { const resolver = new TransferResolver(config.ftp, config.tracker); const fullCommand = `${config.command} ${config.remotePath}`; return config.ftp.handle(fullCommand, (res, task) => { if (res instanceof Error) { resolver.onError(task, res); } else if (res.code === 150 || res.code === 125) { const dataSocket = config.ftp.dataSocket; if (!dataSocket) { resolver.onError(task, new Error("Upload should begin but no data connection is available.")); return; } const canUpload = "getCipher" in dataSocket ? dataSocket.getCipher() !== void 0 : true; onConditionOrEvent(canUpload, dataSocket, "secureConnect", () => { config.ftp.log(`Uploading to ${(0, netUtils_1.describeAddress)(dataSocket)} (${(0, netUtils_1.describeTLS)(dataSocket)})`); resolver.onDataStart(config.remotePath, config.type); (0, stream_1.pipeline)(source, dataSocket, (err) => { if (err) { resolver.onError(task, err); } else { resolver.onDataDone(task); } }); }); } else if ((0, parseControlResponse_1.positiveCompletion)(res.code)) { resolver.onControlDone(task, res); } else if ((0, parseControlResponse_1.positiveIntermediate)(res.code)) { resolver.onUnexpectedRequest(res); } }); } function downloadTo(destination, config) { if (!config.ftp.dataSocket) { throw new Error("Download will be initiated but no data connection is available."); } const resolver = new TransferResolver(config.ftp, config.tracker); return config.ftp.handle(config.command, (res, task) => { if (res instanceof Error) { resolver.onError(task, res); } else if (res.code === 150 || res.code === 125) { const dataSocket = config.ftp.dataSocket; if (!dataSocket) { resolver.onError(task, new Error("Download should begin but no data connection is available.")); return; } config.ftp.log(`Downloading from ${(0, netUtils_1.describeAddress)(dataSocket)} (${(0, netUtils_1.describeTLS)(dataSocket)})`); resolver.onDataStart(config.remotePath, config.type); (0, stream_1.pipeline)(dataSocket, destination, (err) => { if (err) { resolver.onError(task, err); } else { resolver.onDataDone(task); } }); } else if (res.code === 350) { config.ftp.send("RETR " + config.remotePath); } else if ((0, parseControlResponse_1.positiveCompletion)(res.code)) { resolver.onControlDone(task, res); } else if ((0, parseControlResponse_1.positiveIntermediate)(res.code)) { resolver.onUnexpectedRequest(res); } }); } function onConditionOrEvent(condition, emitter, eventName, action) { if (condition === true) { action(); } else { emitter.once(eventName, () => action()); } } } }); // node_modules/basic-ftp/dist/Client.js var require_Client = __commonJS({ "node_modules/basic-ftp/dist/Client.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Client = void 0; var fs_1 = require("fs"); var path_1 = require("path"); var tls_1 = require("tls"); var util_1 = require("util"); var FtpContext_1 = require_FtpContext(); var netUtils_1 = require_netUtils(); var parseControlResponse_1 = require_parseControlResponse(); var parseList_1 = require_parseList(); var parseListMLSD_1 = require_parseListMLSD(); var ProgressTracker_1 = require_ProgressTracker(); var StringWriter_1 = require_StringWriter(); var transfer_1 = require_transfer(); var fsReadDir = (0, util_1.promisify)(fs_1.readdir); var fsMkDir = (0, util_1.promisify)(fs_1.mkdir); var fsStat = (0, util_1.promisify)(fs_1.stat); var fsOpen = (0, util_1.promisify)(fs_1.open); var fsClose = (0, util_1.promisify)(fs_1.close); var fsUnlink = (0, util_1.promisify)(fs_1.unlink); var defaultClientOptions = { allowSeparateTransferHost: true, maxListingBytes: 40 * 1024 * 1024 }; var LIST_COMMANDS_DEFAULT = () => ["LIST -a", "LIST"]; var LIST_COMMANDS_MLSD = () => ["MLSD", "LIST -a", "LIST"]; var Client2 = class { /** * Instantiate an FTP client. * * @param timeout Timeout in milliseconds, use 0 for no timeout. Optional, default is 30 seconds. */ constructor(timeout = 3e4, userOptions = defaultClientOptions) { this.availableListCommands = LIST_COMMANDS_DEFAULT(); const options = { ...defaultClientOptions, ...userOptions }; this.ftp = new FtpContext_1.FTPContext(timeout); this.prepareTransfer = this._enterFirstCompatibleMode([ transfer_1.enterPassiveModeIPv6, options.allowSeparateTransferHost ? transfer_1.enterPassiveModeIPv4 : transfer_1.enterPassiveModeIPv4_forceControlHostIP ]); this.options = options; this.parseList = parseList_1.parseList; this._progressTracker = new ProgressTracker_1.ProgressTracker(); } /** * Close the client and all open socket connections. * * Close the client and all open socket connections. The client can’t be used anymore after calling this method, * you have to either reconnect with `access` or `connect` or instantiate a new instance to continue any work. * A client is also closed automatically if any timeout or connection error occurs. */ close() { this.ftp.close(); this._progressTracker.stop(); } /** * Returns true if the client is closed and can't be used anymore. */ get closed() { return this.ftp.closed; } /** * Connect (or reconnect) to an FTP server. * * This is an instance method and thus can be called multiple times during the lifecycle of a `Client` * instance. Whenever you do, the client is reset with a new control connection. This also implies that * you can reopen a `Client` instance that has been closed due to an error when reconnecting with this * method. In fact, reconnecting is the only way to continue using a closed `Client`. * * @param host Host the client should connect to. Optional, default is "localhost". * @param port Port the client should connect to. Optional, default is 21. */ connect(host = "localhost", port = 21) { this.ftp.reset(); this.ftp.socket.connect({ host, port, family: this.ftp.ipFamily }, () => this.ftp.log(`Connected to ${(0, netUtils_1.describeAddress)(this.ftp.socket)} (${(0, netUtils_1.describeTLS)(this.ftp.socket)})`)); return this._handleConnectResponse(); } /** * As `connect` but using implicit TLS. Implicit TLS is not an FTP standard and has been replaced by * explicit TLS. There are still FTP servers that support only implicit TLS, though. */ connectImplicitTLS(host = "localhost", port = 21, tlsOptions = {}) { this.ftp.reset(); this.ftp.socket = (0, tls_1.connect)(port, host, tlsOptions, () => this.ftp.log(`Connected to ${(0, netUtils_1.describeAddress)(this.ftp.socket)} (${(0, netUtils_1.describeTLS)(this.ftp.socket)})`)); this.ftp.tlsOptions = tlsOptions; return this._handleConnectResponse(); } /** * Handles the first reponse by an FTP server after the socket connection has been established. */ _handleConnectResponse() { return this.ftp.handle(void 0, (res, task) => { if (res instanceof Error) { task.reject(res); } else if ((0, parseControlResponse_1.positiveCompletion)(res.code)) { task.resolve(res); } else { task.reject(new FtpContext_1.FTPError(res)); } }); } /** * Send an FTP command and handle the first response. */ send(command, ignoreErrorCodesDEPRECATED = false) { if (ignoreErrorCodesDEPRECATED) { this.ftp.log("Deprecated call using send(command, flag) with boolean flag to ignore errors. Use sendIgnoringError(command)."); return this.sendIgnoringError(command); } return this.ftp.request(command); } /** * Send an FTP command and ignore an FTP error response. Any other kind of error or timeout will still reject the Promise. * * @param command */ sendIgnoringError(command) { return this.ftp.handle(command, (res, task) => { if (res instanceof FtpContext_1.FTPError) { task.resolve({ code: res.code, message: res.message }); } else if (res instanceof Error) { task.reject(res); } else { task.resolve(res); } }); } /** * Upgrade the current socket connection to TLS. * * @param options TLS options as in `tls.connect(options)`, optional. * @param command Set the authentication command. Optional, default is "AUTH TLS". */ async useTLS(options = {}, command = "AUTH TLS") { const ret = await this.send(command); this.ftp.socket = await (0, netUtils_1.upgradeSocket)(this.ftp.socket, options); this.ftp.tlsOptions = options; this.ftp.log(`Control socket is using: ${(0, netUtils_1.describeTLS)(this.ftp.socket)}`); return ret; } /** * Login a user with a password. * * @param user Username to use for login. Optional, default is "anonymous". * @param password Password to use for login. Optional, default is "guest". */ login(user = "anonymous", password = "guest") { this.ftp.log(`Login security: ${(0, netUtils_1.describeTLS)(this.ftp.socket)}`); return this.ftp.handle("USER " + user, (res, task) => { if (res instanceof Error) { task.reject(res); } else if ((0, parseControlResponse_1.positiveCompletion)(res.code)) { task.resolve(res); } else if (res.code === 331) { this.ftp.send("PASS " + password); } else { task.reject(new FtpContext_1.FTPError(res)); } }); } /** * Set the usual default settings. * * Settings used: * * Binary mode (TYPE I) * * File structure (STRU F) * * Additional settings for FTPS (PBSZ 0, PROT P) */ async useDefaultSettings() { const features = await this.features(); const supportsMLSD = features.has("MLST"); this.availableListCommands = supportsMLSD ? LIST_COMMANDS_MLSD() : LIST_COMMANDS_DEFAULT(); await this.send("TYPE I"); await this.sendIgnoringError("STRU F"); await this.sendIgnoringError("OPTS UTF8 ON"); if (supportsMLSD) { await this.sendIgnoringError("OPTS MLST type;size;modify;unique;unix.mode;unix.owner;unix.group;unix.ownername;unix.groupname;"); } if (this.ftp.hasTLS) { await this.sendIgnoringError("PBSZ 0"); await this.sendIgnoringError("PROT P"); } } /** * Convenience method that calls `connect`, `useTLS`, `login` and `useDefaultSettings`. * * This is an instance method and thus can be called multiple times during the lifecycle of a `Client` * instance. Whenever you do, the client is reset with a new control connection. This also implies that * you can reopen a `Client` instance that has been closed due to an error when reconnecting with this * method. In fact, reconnecting is the only way to continue using a closed `Client`. */ async access(options = {}) { var _a2, _b; const useExplicitTLS = options.secure === true; const useImplicitTLS = options.secure === "implicit"; let welcome; if (useImplicitTLS) { welcome = await this.connectImplicitTLS(options.host, options.port, options.secureOptions); } else { welcome = await this.connect(options.host, options.port); } if (useExplicitTLS) { const secureOptions = (_a2 = options.secureOptions) !== null && _a2 !== void 0 ? _a2 : {}; secureOptions.host = (_b = secureOptions.host) !== null && _b !== void 0 ? _b : options.host; await this.useTLS(secureOptions); } await this.sendIgnoringError("OPTS UTF8 ON"); await this.login(options.user, options.password); await this.useDefaultSettings(); return welcome; } /** * Get the current working directory. */ async pwd() { const res = await this.send("PWD"); const parsed = res.message.match(/"(.+)"/); if (parsed === null || parsed[1] === void 0) { throw new Error(`Can't parse response to command 'PWD': ${res.message}`); } return parsed[1]; } /** * Get a description of supported features. * * This sends the FEAT command and parses the result into a Map where keys correspond to available commands * and values hold further information. Be aware that your FTP servers might not support this * command in which case this method will not throw an exception but just return an empty Map. */ async features() { const res = await this.sendIgnoringError("FEAT"); const features = /* @__PURE__ */ new Map(); if (res.code < 400 && (0, parseControlResponse_1.isMultiline)(res.message)) { res.message.split("\n").slice(1, -1).forEach((line) => { const entry = line.trim().split(" "); features.set(entry[0], entry[1] || ""); }); } return features; } /** * Set the working directory. */ async cd(path3) { const validPath = await this.protectWhitespace(path3); return this.send("CWD " + validPath); } /** * Switch to the parent directory of the working directory. */ async cdup() { return this.send("CDUP"); } /** * Get the last modified time of a file. This is not supported by every FTP server, in which case * calling this method will throw an exception. */ async lastMod(path3) { const validPath = await this.protectWhitespace(path3); const res = await this.send(`MDTM ${validPath}`); const date2 = res.message.slice(4); return (0, parseListMLSD_1.parseMLSxDate)(date2); } /** * Get the size of a file. */ async size(path3) { const validPath = await this.protectWhitespace(path3); const command = `SIZE ${validPath}`; const res = await this.send(command); const size = parseInt(res.message.slice(4), 10); if (Number.isNaN(size)) { throw new Error(`Can't parse response to command '${command}' as a numerical value: ${res.message}`); } return size; } /** * Rename a file. * * Depending on the FTP server this might also be used to move a file from one * directory to another by providing full paths. */ async rename(srcPath, destPath) { const validSrc = await this.protectWhitespace(srcPath); const validDest = await this.protectWhitespace(destPath); await this.send("RNFR " + validSrc); return this.send("RNTO " + validDest); } /** * Remove a file from the current working directory. * * You can ignore FTP error return codes which won't throw an exception if e.g. * the file doesn't exist. */ async remove(path3, ignoreErrorCodes = false) { const validPath = await this.protectWhitespace(path3); if (ignoreErrorCodes) { return this.sendIgnoringError(`DELE ${validPath}`); } return this.send(`DELE ${validPath}`); } /** * Report transfer progress for any upload or download to a given handler. * * This will also reset the overall transfer counter that can be used for multiple transfers. You can * also call the function without a handler to stop reporting to an earlier one. * * @param handler Handler function to call on transfer progress. */ trackProgress(handler) { this._progressTracker.bytesOverall = 0; this._progressTracker.reportTo(handler); } /** * Upload data from a readable stream or a local file to a remote file. * * @param source Readable stream or path to a local file. * @param toRemotePath Path to a remote file to write to. */ async uploadFrom(source, toRemotePath, options = {}) { return this._uploadWithCommand(source, toRemotePath, "STOR", options); } /** * Upload data from a readable stream or a local file by appending it to an existing file. If the file doesn't * exist the FTP server should create it. * * @param source Readable stream or path to a local file. * @param toRemotePath Path to a remote file to write to. */ async appendFrom(source, toRemotePath, options = {}) { return this._uploadWithCommand(source, toRemotePath, "APPE", options); } /** * @protected */ async _uploadWithCommand(source, remotePath, command, options) { if (typeof source === "string") { return this._uploadLocalFile(source, remotePath, command, options); } return this._uploadFromStream(source, remotePath, command); } /** * @protected */ async _uploadLocalFile(localPath, remotePath, command, options) { const fd = await fsOpen(localPath, "r"); const source = (0, fs_1.createReadStream)("", { fd, start: options.localStart, end: options.localEndInclusive, autoClose: false }); try { return await this._uploadFromStream(source, remotePath, command); } finally { await ignoreError(() => fsClose(fd)); } } /** * @protected */ async _uploadFromStream(source, remotePath, command) { const onError = (err) => this.ftp.closeWithError(err); source.once("error", onError); try { const validPath = await this.protectWhitespace(remotePath); await this.prepareTransfer(this.ftp); return await (0, transfer_1.uploadFrom)(source, { ftp: this.ftp, tracker: this._progressTracker, command, remotePath: validPath, type: "upload" }); } finally { source.removeListener("error", onError); } } /** * Download a remote file and pipe its data to a writable stream or to a local file. * * You can optionally define at which position of the remote file you'd like to start * downloading. If the destination you provide is a file, the offset will be applied * to it as well. For example: To resume a failed download, you'd request the size of * the local, partially downloaded file and use that as the offset. Assuming the size * is 23, you'd download the rest using `downloadTo("local.txt", "remote.txt", 23)`. * * @param destination Stream or path for a local file to write to. * @param fromRemotePath Path of the remote file to read from. * @param startAt Position within the remote file to start downloading at. If the destination is a file, this offset is also applied to it. */ async downloadTo(destination, fromRemotePath, startAt = 0) { if (typeof destination === "string") { return this._downloadToFile(destination, fromRemotePath, startAt); } return this._downloadToStream(destination, fromRemotePath, startAt); } /** * @protected */ async _downloadToFile(localPath, remotePath, startAt) { const appendingToLocalFile = startAt > 0; const fileSystemFlags = appendingToLocalFile ? "r+" : "w"; const fd = await fsOpen(localPath, fileSystemFlags); const destination = (0, fs_1.createWriteStream)("", { fd, start: startAt, autoClose: false }); try { return await this._downloadToStream(destination, remotePath, startAt); } catch (err) { const localFileStats = await ignoreError(() => fsStat(localPath)); const hasDownloadedData = localFileStats && localFileStats.size > 0; const shouldRemoveLocalFile = !appendingToLocalFile && !hasDownloadedData; if (shouldRemoveLocalFile) { await ignoreError(() => fsUnlink(localPath)); } throw err; } finally { await ignoreError(() => fsClose(fd)); } } /** * @protected */ async _downloadToStream(destination, remotePath, startAt) { const onError = (err) => this.ftp.closeWithError(err); destination.once("error", onError); try { const validPath = await this.protectWhitespace(remotePath); await this.prepareTransfer(this.ftp); return await (0, transfer_1.downloadTo)(destination, { ftp: this.ftp, tracker: this._progressTracker, command: startAt > 0 ? `REST ${startAt}` : `RETR ${validPath}`, remotePath: validPath, type: "download" }); } finally { destination.removeListener("error", onError); destination.end(); } } /** * List files and directories in the current working directory, or from `path` if specified. * * @param [path] Path to remote file or directory. */ async list(path3 = "") { const validPath = await this.protectWhitespace(path3); let lastError; for (const candidate of this.availableListCommands) { const command = validPath === "" ? candidate : `${candidate} ${validPath}`; await this.prepareTransfer(this.ftp); try { const parsedList = await this._requestListWithCommand(command); this.availableListCommands = [candidate]; return parsedList; } catch (err) { const shouldTryNext = err instanceof FtpContext_1.FTPError; if (!shouldTryNext) { throw err; } lastError = err; } } throw lastError; } /** * @protected */ async _requestListWithCommand(command) { const buffer = new StringWriter_1.StringWriter(this.options.maxListingBytes); await (0, transfer_1.downloadTo)(buffer, { ftp: this.ftp, tracker: this._progressTracker, command, remotePath: "", type: "list" }); const text = buffer.getText(this.ftp.encoding); this.ftp.log(text); return this.parseList(text); } /** * Remove a directory and all of its content. * * @param remoteDirPath The path of the remote directory to delete. * @example client.removeDir("foo") // Remove directory 'foo' using a relative path. * @example client.removeDir("foo/bar") // Remove directory 'bar' using a relative path. * @example client.removeDir("/foo/bar") // Remove directory 'bar' using an absolute path. * @example client.removeDir("/") // Remove everything. */ async removeDir(remoteDirPath) { return this._exitAtCurrentDirectory(async () => { await this.cd(remoteDirPath); const absoluteDirPath = await this.pwd(); await this.clearWorkingDir(); const dirIsRoot = absoluteDirPath === "/"; if (!dirIsRoot) { await this.cdup(); await this.removeEmptyDir(absoluteDirPath); } }); } /** * Remove all files and directories in the working directory without removing * the working directory itself. */ async clearWorkingDir() { for (const file2 of await this.list()) { if (file2.isDirectory) { await this.cd(file2.name); await this.clearWorkingDir(); await this.cdup(); await this.removeEmptyDir(file2.name); } else { await this.remove(file2.name); } } } /** * Upload the contents of a local directory to the remote working directory. * * This will overwrite existing files with the same names and reuse existing directories. * Unrelated files and directories will remain untouched. You can optionally provide a `remoteDirPath` * to put the contents inside a directory which will be created if necessary including all * intermediate directories. If you did provide a remoteDirPath the working directory will stay * the same as before calling this method. * * @param localDirPath Local path, e.g. "foo/bar" or "../test" * @param [remoteDirPath] Remote path of a directory to upload to. Working directory if undefined. */ async uploadFromDir(localDirPath, remoteDirPath) { return this._exitAtCurrentDirectory(async () => { if (remoteDirPath) { await this.ensureDir(remoteDirPath); } return await this._uploadToWorkingDir(localDirPath); }); } /** * @protected */ async _uploadToWorkingDir(localDirPath) { const files = await fsReadDir(localDirPath); for (const file2 of files) { const fullPath = (0, path_1.join)(localDirPath, file2); const stats = await fsStat(fullPath); if (stats.isFile()) { await this.uploadFrom(fullPath, file2); } else if (stats.isDirectory()) { await this._openDir(file2); await this._uploadToWorkingDir(fullPath); await this.cdup(); } } } /** * Download all files and directories of the working directory to a local directory. * * @param localDirPath The local directory to download to. * @param remoteDirPath Remote directory to download. Current working directory if not specified. */ async downloadToDir(localDirPath, remoteDirPath) { return this._exitAtCurrentDirectory(async () => { if (remoteDirPath) { await this.cd(remoteDirPath); } return await this._downloadFromWorkingDir(localDirPath); }); } /** * @protected */ async _downloadFromWorkingDir(localDirPath) { await ensureLocalDirectory(localDirPath); for (const file2 of await this.list()) { const hasInvalidName = !file2.name || (0, path_1.basename)(file2.name) !== file2.name; if (hasInvalidName) { const safeName = JSON.stringify(file2.name); this.ftp.log(`Invalid filename from server listing, will skip file. (${safeName})`); continue; } const localPath = (0, path_1.join)(localDirPath, file2.name); if (file2.isDirectory) { await this.cd(file2.name); await this._downloadFromWorkingDir(localPath); await this.cdup(); } else if (file2.isFile) { await this.downloadTo(localPath, file2.name); } } } /** * Make sure a given remote path exists, creating all directories as necessary. * This function also changes the current working directory to the given path. */ async ensureDir(remoteDirPath) { if (remoteDirPath.startsWith("/")) { await this.cd("/"); } const names = remoteDirPath.split("/").filter((name) => name !== ""); for (const name of names) { await this._openDir(name); } } /** * Try to create a directory and enter it. This will not raise an exception if the directory * couldn't be created if for example it already exists. * @protected */ async _openDir(dirName) { await this.sendIgnoringError("MKD " + dirName); await this.cd(dirName); } /** * Remove an empty directory, will fail if not empty. */ async removeEmptyDir(path3) { const validPath = await this.protectWhitespace(path3); return this.send(`RMD ${validPath}`); } /** * FTP servers can't handle filenames that have leading whitespace. This method transforms * a given path to fix that issue for most cases. */ async protectWhitespace(path3) { if (!path3.startsWith(" ")) { return path3; } const pwd = await this.pwd(); const absolutePathPrefix = pwd.endsWith("/") ? pwd : pwd + "/"; return absolutePathPrefix + path3; } async _exitAtCurrentDirectory(func) { const userDir = await this.pwd(); try { return await func(); } finally { if (!this.closed) { await ignoreError(() => this.cd(userDir)); } } } /** * Try all available transfer strategies and pick the first one that works. Update `client` to * use the working strategy for all successive transfer requests. * * @returns a function that will try the provided strategies. */ _enterFirstCompatibleMode(strategies) { return async (ftp2) => { ftp2.log("Trying to find optimal transfer strategy..."); let lastError = void 0; for (const strategy of strategies) { try { const res = await strategy(ftp2); ftp2.log("Optimal transfer strategy found."); this.prepareTransfer = strategy; return res; } catch (err) { lastError = err; } } throw new Error(`None of the available transfer strategies work. Last error response was '${lastError}'.`); }; } /** * DEPRECATED, use `uploadFrom`. * @deprecated */ async upload(source, toRemotePath, options = {}) { this.ftp.log("Warning: upload() has been deprecated, use uploadFrom()."); return this.uploadFrom(source, toRemotePath, options); } /** * DEPRECATED, use `appendFrom`. * @deprecated */ async append(source, toRemotePath, options = {}) { this.ftp.log("Warning: append() has been deprecated, use appendFrom()."); return this.appendFrom(source, toRemotePath, options); } /** * DEPRECATED, use `downloadTo`. * @deprecated */ async download(destination, fromRemotePath, startAt = 0) { this.ftp.log("Warning: download() has been deprecated, use downloadTo()."); return this.downloadTo(destination, fromRemotePath, startAt); } /** * DEPRECATED, use `uploadFromDir`. * @deprecated */ async uploadDir(localDirPath, remoteDirPath) { this.ftp.log("Warning: uploadDir() has been deprecated, use uploadFromDir()."); return this.uploadFromDir(localDirPath, remoteDirPath); } /** * DEPRECATED, use `downloadToDir`. * @deprecated */ async downloadDir(localDirPath) { this.ftp.log("Warning: downloadDir() has been deprecated, use downloadToDir()."); return this.downloadToDir(localDirPath); } }; exports2.Client = Client2; async function ensureLocalDirectory(path3) { try { await fsStat(path3); } catch (_a2) { await fsMkDir(path3, { recursive: true }); } } async function ignoreError(func) { try { return await func(); } catch (_a2) { return void 0; } } } }); // node_modules/basic-ftp/dist/StringEncoding.js var require_StringEncoding = __commonJS({ "node_modules/basic-ftp/dist/StringEncoding.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); } }); // node_modules/basic-ftp/dist/index.js var require_dist = __commonJS({ "node_modules/basic-ftp/dist/index.js"(exports2) { "use strict"; var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; var desc = Object.getOwnPropertyDescriptor(m3, k5); if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m3[k5]; } }; } Object.defineProperty(o2, k22, desc); }) : (function(o2, m3, k5, k22) { if (k22 === void 0) k22 = k5; o2[k22] = m3[k5]; })); var __exportStar2 = exports2 && exports2.__exportStar || function(m3, exports3) { for (var p2 in m3) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p2)) __createBinding2(exports3, m3, p2); }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.enterPassiveModeIPv6 = exports2.enterPassiveModeIPv4 = void 0; __exportStar2(require_Client(), exports2); __exportStar2(require_FtpContext(), exports2); __exportStar2(require_FileInfo(), exports2); __exportStar2(require_parseList(), exports2); __exportStar2(require_StringEncoding(), exports2); var transfer_1 = require_transfer(); Object.defineProperty(exports2, "enterPassiveModeIPv4", { enumerable: true, get: function() { return transfer_1.enterPassiveModeIPv4; } }); Object.defineProperty(exports2, "enterPassiveModeIPv6", { enumerable: true, get: function() { return transfer_1.enterPassiveModeIPv6; } }); } }); // node_modules/get-uri/dist/ftp.js var import_basic_ftp, import_stream2, import_path, import_debug7, debug8, ftp; var init_ftp = __esm({ "node_modules/get-uri/dist/ftp.js"() { import_basic_ftp = __toESM(require_dist(), 1); import_stream2 = require("stream"); import_path = require("path"); import_debug7 = __toESM(require_src(), 1); init_notfound(); init_notmodified(); debug8 = (0, import_debug7.default)("get-uri:ftp"); ftp = async (url, opts = {}) => { const { cache: cache5 } = opts; const filepath = decodeURIComponent(url.pathname); let lastModified; if (!filepath) { throw new TypeError('No "pathname"!'); } const client = new import_basic_ftp.Client(); try { const host = url.hostname || url.host || "localhost"; const port = parseInt(url.port || "0", 10) || 21; const user = url.username ? decodeURIComponent(url.username) : void 0; const password = url.password ? decodeURIComponent(url.password) : void 0; await client.access({ host, port, user, password, ...opts }); try { lastModified = await client.lastMod(filepath); } catch (err) { if (err.code === 550) { throw new NotFoundError(); } } if (!lastModified) { const list2 = await client.list((0, import_path.dirname)(filepath)); const name = (0, import_path.basename)(filepath); const entry = list2.find((e5) => e5.name === name); if (entry) { lastModified = entry.modifiedAt; } } if (lastModified) { if (isNotModified2()) { throw new NotModifiedError(); } } else { throw new NotFoundError(); } const stream = new import_stream2.PassThrough(); const rs = stream; client.downloadTo(stream, filepath).then((result) => { debug8(result.message); client.close(); }); rs.lastModified = lastModified; return rs; } catch (err) { client.close(); throw err; } function isNotModified2() { if (cache5?.lastModified && lastModified) { return +cache5.lastModified === +lastModified; } return false; } }; } }); // node_modules/get-uri/dist/http-error.js var import_http, HTTPError; var init_http_error = __esm({ "node_modules/get-uri/dist/http-error.js"() { import_http = require("http"); HTTPError = class extends Error { constructor(statusCode, message = import_http.STATUS_CODES[statusCode]) { super(message); this.statusCode = statusCode; this.code = `E${String(message).toUpperCase().replace(/\s+/g, "")}`; } }; } }); // node_modules/get-uri/dist/http.js function isFresh(cache5) { let fresh = false; let expires = parseInt(cache5.headers.expires || "", 10); const cacheControl = cache5.headers["cache-control"]; if (cacheControl) { debug9("Cache-Control: %o", cacheControl); const parts = cacheControl.split(/,\s*?\b/); for (let i5 = 0; i5 < parts.length; i5++) { const part = parts[i5]; const subparts = part.split("="); const name = subparts[0]; switch (name) { case "max-age": expires = (cache5.date || 0) + parseInt(subparts[1], 10) * 1e3; fresh = Date.now() < expires; if (fresh) { debug9('cache is "fresh" due to previous %o Cache-Control param', part); } return fresh; case "must-revalidate": break; case "no-cache": case "no-store": debug9('cache is "stale" due to explicit %o Cache-Control param', name); return false; default: break; } } } else if (expires) { debug9("Expires: %o", expires); fresh = Date.now() < expires; if (fresh) { debug9('cache is "fresh" due to previous Expires response header'); } return fresh; } return false; } function getCache(url, cache5) { if (cache5) { if (cache5.parsed && cache5.parsed.href === url.href) { return cache5; } if (cache5.redirects) { for (let i5 = 0; i5 < cache5.redirects.length; i5++) { const c5 = getCache(url, cache5.redirects[i5]); if (c5) { return c5; } } } } return null; } var import_http2, import_https3, import_events2, import_debug8, debug9, http4; var init_http = __esm({ "node_modules/get-uri/dist/http.js"() { import_http2 = __toESM(require("http"), 1); import_https3 = __toESM(require("https"), 1); import_events2 = require("events"); import_debug8 = __toESM(require_src(), 1); init_http_error(); init_notfound(); init_notmodified(); debug9 = (0, import_debug8.default)("get-uri:http"); http4 = async (url, opts = {}) => { debug9("GET %o", url.href); const cache5 = getCache(url, opts.cache); if (cache5 && isFresh(cache5) && typeof cache5.statusCode === "number") { const type2 = cache5.statusCode / 100 | 0; if (type2 === 3 && cache5.headers.location) { debug9("cached redirect"); throw new Error("TODO: implement cached redirects!"); } throw new NotModifiedError(); } const maxRedirects = typeof opts.maxRedirects === "number" ? opts.maxRedirects : 5; debug9("allowing %o max redirects", maxRedirects); let mod; if (opts.http) { mod = opts.http; debug9("using secure `https` core module"); } else { mod = import_http2.default; debug9("using `http` core module"); } const options = { ...opts }; if (cache5) { const prevHeaders = options.headers; const headers = {}; if (prevHeaders && !Array.isArray(prevHeaders)) { Object.assign(headers, prevHeaders); } options.headers = headers; const lastModified = cache5.headers["last-modified"]; if (lastModified) { headers["If-Modified-Since"] = lastModified; debug9('added "If-Modified-Since" request header: %o', lastModified); } const etag = cache5.headers.etag; if (etag) { headers["If-None-Match"] = etag; debug9('added "If-None-Match" request header: %o', etag); } } const req = mod.get(url, options); const [res] = await (0, import_events2.once)(req, "response"); const code = res.statusCode || 0; res.date = Date.now(); res.parsed = url; debug9("got %o response status code", code); const type = code / 100 | 0; const location = res.headers.location; if (type === 3 && location) { if (!opts.redirects) opts.redirects = []; const redirects = opts.redirects; if (redirects.length < maxRedirects) { debug9('got a "redirect" status code with Location: %o', location); res.resume(); redirects.push(res); const newUri = new URL(location, url.href); debug9("resolved redirect URL: %o", newUri.href); const left = maxRedirects - redirects.length; debug9("%o more redirects allowed after this one", left); if (newUri.protocol !== url.protocol) { opts.http = newUri.protocol === "https:" ? import_https3.default : void 0; } return http4(newUri, opts); } } if (type !== 2) { res.resume(); if (code === 304) { throw new NotModifiedError(); } else if (code === 404) { throw new NotFoundError(); } throw new HTTPError(code); } if (opts.redirects) { res.redirects = opts.redirects; } return res; }; } }); // node_modules/get-uri/dist/https.js var import_https4, https3; var init_https = __esm({ "node_modules/get-uri/dist/https.js"() { import_https4 = __toESM(require("https"), 1); init_http(); https3 = (url, opts) => { return http4(url, { ...opts, http: import_https4.default }); }; } }); // node_modules/get-uri/dist/index.js function isValidProtocol(p2) { return VALID_PROTOCOLS.has(p2); } async function getUri(uri, opts) { debug10("getUri(%o)", uri); if (!uri) { throw new TypeError('Must pass in a URI to "getUri()"'); } const url = typeof uri === "string" ? new URL(uri) : uri; const protocol = url.protocol.replace(/:$/, ""); if (!isValidProtocol(protocol)) { throw new TypeError(`Unsupported protocol "${protocol}" specified in URI: "${uri}"`); } const getter = protocols[protocol]; return getter(url, opts); } var import_debug9, debug10, protocols, VALID_PROTOCOLS; var init_dist6 = __esm({ "node_modules/get-uri/dist/index.js"() { import_debug9 = __toESM(require_src(), 1); init_data(); init_file(); init_ftp(); init_http(); init_https(); debug10 = (0, import_debug9.default)("get-uri"); protocols = { data: data2, file, ftp, http: http4, https: https3 }; VALID_PROTOCOLS = new Set(Object.keys(protocols)); } }); // node_modules/estraverse/estraverse.js var require_estraverse = __commonJS({ "node_modules/estraverse/estraverse.js"(exports2) { (function clone(exports3) { "use strict"; var Syntax, VisitorOption, VisitorKeys, BREAK, SKIP, REMOVE; function deepCopy(obj) { var ret = {}, key, val; for (key in obj) { if (obj.hasOwnProperty(key)) { val = obj[key]; if (typeof val === "object" && val !== null) { ret[key] = deepCopy(val); } else { ret[key] = val; } } } return ret; } function upperBound(array, func) { var diff, len, i5, current; len = array.length; i5 = 0; while (len) { diff = len >>> 1; current = i5 + diff; if (func(array[current])) { len = diff; } else { i5 = current + 1; len -= diff + 1; } } return i5; } Syntax = { AssignmentExpression: "AssignmentExpression", AssignmentPattern: "AssignmentPattern", ArrayExpression: "ArrayExpression", ArrayPattern: "ArrayPattern", ArrowFunctionExpression: "ArrowFunctionExpression", AwaitExpression: "AwaitExpression", // CAUTION: It's deferred to ES7. BlockStatement: "BlockStatement", BinaryExpression: "BinaryExpression", BreakStatement: "BreakStatement", CallExpression: "CallExpression", CatchClause: "CatchClause", ChainExpression: "ChainExpression", ClassBody: "ClassBody", ClassDeclaration: "ClassDeclaration", ClassExpression: "ClassExpression", ComprehensionBlock: "ComprehensionBlock", // CAUTION: It's deferred to ES7. ComprehensionExpression: "ComprehensionExpression", // CAUTION: It's deferred to ES7. ConditionalExpression: "ConditionalExpression", ContinueStatement: "ContinueStatement", DebuggerStatement: "DebuggerStatement", DirectiveStatement: "DirectiveStatement", DoWhileStatement: "DoWhileStatement", EmptyStatement: "EmptyStatement", ExportAllDeclaration: "ExportAllDeclaration", ExportDefaultDeclaration: "ExportDefaultDeclaration", ExportNamedDeclaration: "ExportNamedDeclaration", ExportSpecifier: "ExportSpecifier", ExpressionStatement: "ExpressionStatement", ForStatement: "ForStatement", ForInStatement: "ForInStatement", ForOfStatement: "ForOfStatement", FunctionDeclaration: "FunctionDeclaration", FunctionExpression: "FunctionExpression", GeneratorExpression: "GeneratorExpression", // CAUTION: It's deferred to ES7. Identifier: "Identifier", IfStatement: "IfStatement", ImportExpression: "ImportExpression", ImportDeclaration: "ImportDeclaration", ImportDefaultSpecifier: "ImportDefaultSpecifier", ImportNamespaceSpecifier: "ImportNamespaceSpecifier", ImportSpecifier: "ImportSpecifier", Literal: "Literal", LabeledStatement: "LabeledStatement", LogicalExpression: "LogicalExpression", MemberExpression: "MemberExpression", MetaProperty: "MetaProperty", MethodDefinition: "MethodDefinition", ModuleSpecifier: "ModuleSpecifier", NewExpression: "NewExpression", ObjectExpression: "ObjectExpression", ObjectPattern: "ObjectPattern", PrivateIdentifier: "PrivateIdentifier", Program: "Program", Property: "Property", PropertyDefinition: "PropertyDefinition", RestElement: "RestElement", ReturnStatement: "ReturnStatement", SequenceExpression: "SequenceExpression", SpreadElement: "SpreadElement", Super: "Super", SwitchStatement: "SwitchStatement", SwitchCase: "SwitchCase", TaggedTemplateExpression: "TaggedTemplateExpression", TemplateElement: "TemplateElement", TemplateLiteral: "TemplateLiteral", ThisExpression: "ThisExpression", ThrowStatement: "ThrowStatement", TryStatement: "TryStatement", UnaryExpression: "UnaryExpression", UpdateExpression: "UpdateExpression", VariableDeclaration: "VariableDeclaration", VariableDeclarator: "VariableDeclarator", WhileStatement: "WhileStatement", WithStatement: "WithStatement", YieldExpression: "YieldExpression" }; VisitorKeys = { AssignmentExpression: ["left", "right"], AssignmentPattern: ["left", "right"], ArrayExpression: ["elements"], ArrayPattern: ["elements"], ArrowFunctionExpression: ["params", "body"], AwaitExpression: ["argument"], // CAUTION: It's deferred to ES7. BlockStatement: ["body"], BinaryExpression: ["left", "right"], BreakStatement: ["label"], CallExpression: ["callee", "arguments"], CatchClause: ["param", "body"], ChainExpression: ["expression"], ClassBody: ["body"], ClassDeclaration: ["id", "superClass", "body"], ClassExpression: ["id", "superClass", "body"], ComprehensionBlock: ["left", "right"], // CAUTION: It's deferred to ES7. ComprehensionExpression: ["blocks", "filter", "body"], // CAUTION: It's deferred to ES7. ConditionalExpression: ["test", "consequent", "alternate"], ContinueStatement: ["label"], DebuggerStatement: [], DirectiveStatement: [], DoWhileStatement: ["body", "test"], EmptyStatement: [], ExportAllDeclaration: ["source"], ExportDefaultDeclaration: ["declaration"], ExportNamedDeclaration: ["declaration", "specifiers", "source"], ExportSpecifier: ["exported", "local"], ExpressionStatement: ["expression"], ForStatement: ["init", "test", "update", "body"], ForInStatement: ["left", "right", "body"], ForOfStatement: ["left", "right", "body"], FunctionDeclaration: ["id", "params", "body"], FunctionExpression: ["id", "params", "body"], GeneratorExpression: ["blocks", "filter", "body"], // CAUTION: It's deferred to ES7. Identifier: [], IfStatement: ["test", "consequent", "alternate"], ImportExpression: ["source"], ImportDeclaration: ["specifiers", "source"], ImportDefaultSpecifier: ["local"], ImportNamespaceSpecifier: ["local"], ImportSpecifier: ["imported", "local"], Literal: [], LabeledStatement: ["label", "body"], LogicalExpression: ["left", "right"], MemberExpression: ["object", "property"], MetaProperty: ["meta", "property"], MethodDefinition: ["key", "value"], ModuleSpecifier: [], NewExpression: ["callee", "arguments"], ObjectExpression: ["properties"], ObjectPattern: ["properties"], PrivateIdentifier: [], Program: ["body"], Property: ["key", "value"], PropertyDefinition: ["key", "value"], RestElement: ["argument"], ReturnStatement: ["argument"], SequenceExpression: ["expressions"], SpreadElement: ["argument"], Super: [], SwitchStatement: ["discriminant", "cases"], SwitchCase: ["test", "consequent"], TaggedTemplateExpression: ["tag", "quasi"], TemplateElement: [], TemplateLiteral: ["quasis", "expressions"], ThisExpression: [], ThrowStatement: ["argument"], TryStatement: ["block", "handler", "finalizer"], UnaryExpression: ["argument"], UpdateExpression: ["argument"], VariableDeclaration: ["declarations"], VariableDeclarator: ["id", "init"], WhileStatement: ["test", "body"], WithStatement: ["object", "body"], YieldExpression: ["argument"] }; BREAK = {}; SKIP = {}; REMOVE = {}; VisitorOption = { Break: BREAK, Skip: SKIP, Remove: REMOVE }; function Reference(parent, key) { this.parent = parent; this.key = key; } Reference.prototype.replace = function replace2(node) { this.parent[this.key] = node; }; Reference.prototype.remove = function remove() { if (Array.isArray(this.parent)) { this.parent.splice(this.key, 1); return true; } else { this.replace(null); return false; } }; function Element(node, path3, wrap, ref) { this.node = node; this.path = path3; this.wrap = wrap; this.ref = ref; } function Controller() { } Controller.prototype.path = function path3() { var i5, iz, j5, jz, result, element; function addToPath(result2, path4) { if (Array.isArray(path4)) { for (j5 = 0, jz = path4.length; j5 < jz; ++j5) { result2.push(path4[j5]); } } else { result2.push(path4); } } if (!this.__current.path) { return null; } result = []; for (i5 = 2, iz = this.__leavelist.length; i5 < iz; ++i5) { element = this.__leavelist[i5]; addToPath(result, element.path); } addToPath(result, this.__current.path); return result; }; Controller.prototype.type = function() { var node = this.current(); return node.type || this.__current.wrap; }; Controller.prototype.parents = function parents() { var i5, iz, result; result = []; for (i5 = 1, iz = this.__leavelist.length; i5 < iz; ++i5) { result.push(this.__leavelist[i5].node); } return result; }; Controller.prototype.current = function current() { return this.__current.node; }; Controller.prototype.__execute = function __execute(callback, element) { var previous, result; result = void 0; previous = this.__current; this.__current = element; this.__state = null; if (callback) { result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); } this.__current = previous; return result; }; Controller.prototype.notify = function notify(flag) { this.__state = flag; }; Controller.prototype.skip = function() { this.notify(SKIP); }; Controller.prototype["break"] = function() { this.notify(BREAK); }; Controller.prototype.remove = function() { this.notify(REMOVE); }; Controller.prototype.__initialize = function(root5, visitor) { this.visitor = visitor; this.root = root5; this.__worklist = []; this.__leavelist = []; this.__current = null; this.__state = null; this.__fallback = null; if (visitor.fallback === "iteration") { this.__fallback = Object.keys; } else if (typeof visitor.fallback === "function") { this.__fallback = visitor.fallback; } this.__keys = VisitorKeys; if (visitor.keys) { this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); } }; function isNode(node) { if (node == null) { return false; } return typeof node === "object" && typeof node.type === "string"; } function isProperty(nodeType, key) { return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && "properties" === key; } function candidateExistsInLeaveList(leavelist, candidate) { for (var i5 = leavelist.length - 1; i5 >= 0; --i5) { if (leavelist[i5].node === candidate) { return true; } } return false; } Controller.prototype.traverse = function traverse2(root5, visitor) { var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel; this.__initialize(root5, visitor); sentinel = {}; worklist = this.__worklist; leavelist = this.__leavelist; worklist.push(new Element(root5, null, null, null)); leavelist.push(new Element(null, null, null, null)); while (worklist.length) { element = worklist.pop(); if (element === sentinel) { element = leavelist.pop(); ret = this.__execute(visitor.leave, element); if (this.__state === BREAK || ret === BREAK) { return; } continue; } if (element.node) { ret = this.__execute(visitor.enter, element); if (this.__state === BREAK || ret === BREAK) { return; } worklist.push(sentinel); leavelist.push(element); if (this.__state === SKIP || ret === SKIP) { continue; } node = element.node; nodeType = node.type || element.wrap; candidates = this.__keys[nodeType]; if (!candidates) { if (this.__fallback) { candidates = this.__fallback(node); } else { throw new Error("Unknown node type " + nodeType + "."); } } current = candidates.length; while ((current -= 1) >= 0) { key = candidates[current]; candidate = node[key]; if (!candidate) { continue; } if (Array.isArray(candidate)) { current2 = candidate.length; while ((current2 -= 1) >= 0) { if (!candidate[current2]) { continue; } if (candidateExistsInLeaveList(leavelist, candidate[current2])) { continue; } if (isProperty(nodeType, candidates[current])) { element = new Element(candidate[current2], [key, current2], "Property", null); } else if (isNode(candidate[current2])) { element = new Element(candidate[current2], [key, current2], null, null); } else { continue; } worklist.push(element); } } else if (isNode(candidate)) { if (candidateExistsInLeaveList(leavelist, candidate)) { continue; } worklist.push(new Element(candidate, key, null, null)); } } } } }; Controller.prototype.replace = function replace2(root5, visitor) { var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key; function removeElem(element2) { var i5, key2, nextElem, parent; if (element2.ref.remove()) { key2 = element2.ref.key; parent = element2.ref.parent; i5 = worklist.length; while (i5--) { nextElem = worklist[i5]; if (nextElem.ref && nextElem.ref.parent === parent) { if (nextElem.ref.key < key2) { break; } --nextElem.ref.key; } } } } this.__initialize(root5, visitor); sentinel = {}; worklist = this.__worklist; leavelist = this.__leavelist; outer = { root: root5 }; element = new Element(root5, null, null, new Reference(outer, "root")); worklist.push(element); leavelist.push(element); while (worklist.length) { element = worklist.pop(); if (element === sentinel) { element = leavelist.pop(); target = this.__execute(visitor.leave, element); if (target !== void 0 && target !== BREAK && target !== SKIP && target !== REMOVE) { element.ref.replace(target); } if (this.__state === REMOVE || target === REMOVE) { removeElem(element); } if (this.__state === BREAK || target === BREAK) { return outer.root; } continue; } target = this.__execute(visitor.enter, element); if (target !== void 0 && target !== BREAK && target !== SKIP && target !== REMOVE) { element.ref.replace(target); element.node = target; } if (this.__state === REMOVE || target === REMOVE) { removeElem(element); element.node = null; } if (this.__state === BREAK || target === BREAK) { return outer.root; } node = element.node; if (!node) { continue; } worklist.push(sentinel); leavelist.push(element); if (this.__state === SKIP || target === SKIP) { continue; } nodeType = node.type || element.wrap; candidates = this.__keys[nodeType]; if (!candidates) { if (this.__fallback) { candidates = this.__fallback(node); } else { throw new Error("Unknown node type " + nodeType + "."); } } current = candidates.length; while ((current -= 1) >= 0) { key = candidates[current]; candidate = node[key]; if (!candidate) { continue; } if (Array.isArray(candidate)) { current2 = candidate.length; while ((current2 -= 1) >= 0) { if (!candidate[current2]) { continue; } if (isProperty(nodeType, candidates[current])) { element = new Element(candidate[current2], [key, current2], "Property", new Reference(candidate, current2)); } else if (isNode(candidate[current2])) { element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2)); } else { continue; } worklist.push(element); } } else if (isNode(candidate)) { worklist.push(new Element(candidate, key, null, new Reference(node, key))); } } } return outer.root; }; function traverse(root5, visitor) { var controller = new Controller(); return controller.traverse(root5, visitor); } function replace(root5, visitor) { var controller = new Controller(); return controller.replace(root5, visitor); } function extendCommentRange(comment, tokens) { var target; target = upperBound(tokens, function search(token) { return token.range[0] > comment.range[0]; }); comment.extendedRange = [comment.range[0], comment.range[1]]; if (target !== tokens.length) { comment.extendedRange[1] = tokens[target].range[0]; } target -= 1; if (target >= 0) { comment.extendedRange[0] = tokens[target].range[1]; } return comment; } function attachComments(tree, providedComments, tokens) { var comments = [], comment, len, i5, cursor2; if (!tree.range) { throw new Error("attachComments needs range information"); } if (!tokens.length) { if (providedComments.length) { for (i5 = 0, len = providedComments.length; i5 < len; i5 += 1) { comment = deepCopy(providedComments[i5]); comment.extendedRange = [0, tree.range[0]]; comments.push(comment); } tree.leadingComments = comments; } return tree; } for (i5 = 0, len = providedComments.length; i5 < len; i5 += 1) { comments.push(extendCommentRange(deepCopy(providedComments[i5]), tokens)); } cursor2 = 0; traverse(tree, { enter: function(node) { var comment2; while (cursor2 < comments.length) { comment2 = comments[cursor2]; if (comment2.extendedRange[1] > node.range[0]) { break; } if (comment2.extendedRange[1] === node.range[0]) { if (!node.leadingComments) { node.leadingComments = []; } node.leadingComments.push(comment2); comments.splice(cursor2, 1); } else { cursor2 += 1; } } if (cursor2 === comments.length) { return VisitorOption.Break; } if (comments[cursor2].extendedRange[0] > node.range[1]) { return VisitorOption.Skip; } } }); cursor2 = 0; traverse(tree, { leave: function(node) { var comment2; while (cursor2 < comments.length) { comment2 = comments[cursor2]; if (node.range[1] < comment2.extendedRange[0]) { break; } if (node.range[1] === comment2.extendedRange[0]) { if (!node.trailingComments) { node.trailingComments = []; } node.trailingComments.push(comment2); comments.splice(cursor2, 1); } else { cursor2 += 1; } } if (cursor2 === comments.length) { return VisitorOption.Break; } if (comments[cursor2].extendedRange[0] > node.range[1]) { return VisitorOption.Skip; } } }); return tree; } exports3.Syntax = Syntax; exports3.traverse = traverse; exports3.replace = replace; exports3.attachComments = attachComments; exports3.VisitorKeys = VisitorKeys; exports3.VisitorOption = VisitorOption; exports3.Controller = Controller; exports3.cloneEnvironment = function() { return clone({}); }; return exports3; })(exports2); } }); // node_modules/esutils/lib/ast.js var require_ast = __commonJS({ "node_modules/esutils/lib/ast.js"(exports2, module2) { (function() { "use strict"; function isExpression(node) { if (node == null) { return false; } switch (node.type) { case "ArrayExpression": case "AssignmentExpression": case "BinaryExpression": case "CallExpression": case "ConditionalExpression": case "FunctionExpression": case "Identifier": case "Literal": case "LogicalExpression": case "MemberExpression": case "NewExpression": case "ObjectExpression": case "SequenceExpression": case "ThisExpression": case "UnaryExpression": case "UpdateExpression": return true; } return false; } function isIterationStatement(node) { if (node == null) { return false; } switch (node.type) { case "DoWhileStatement": case "ForInStatement": case "ForStatement": case "WhileStatement": return true; } return false; } function isStatement(node) { if (node == null) { return false; } switch (node.type) { case "BlockStatement": case "BreakStatement": case "ContinueStatement": case "DebuggerStatement": case "DoWhileStatement": case "EmptyStatement": case "ExpressionStatement": case "ForInStatement": case "ForStatement": case "IfStatement": case "LabeledStatement": case "ReturnStatement": case "SwitchStatement": case "ThrowStatement": case "TryStatement": case "VariableDeclaration": case "WhileStatement": case "WithStatement": return true; } return false; } function isSourceElement(node) { return isStatement(node) || node != null && node.type === "FunctionDeclaration"; } function trailingStatement(node) { switch (node.type) { case "IfStatement": if (node.alternate != null) { return node.alternate; } return node.consequent; case "LabeledStatement": case "ForStatement": case "ForInStatement": case "WhileStatement": case "WithStatement": return node.body; } return null; } function isProblematicIfStatement(node) { var current; if (node.type !== "IfStatement") { return false; } if (node.alternate == null) { return false; } current = node.consequent; do { if (current.type === "IfStatement") { if (current.alternate == null) { return true; } } current = trailingStatement(current); } while (current); return false; } module2.exports = { isExpression, isStatement, isIterationStatement, isSourceElement, isProblematicIfStatement, trailingStatement }; })(); } }); // node_modules/esutils/lib/code.js var require_code = __commonJS({ "node_modules/esutils/lib/code.js"(exports2, module2) { (function() { "use strict"; var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; ES5Regex = { // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart: NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart: NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-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0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ }; ES6Regex = { // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart: NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\u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60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart: NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\u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DEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ }; function isDecimalDigit(ch2) { return 48 <= ch2 && ch2 <= 57; } function isHexDigit(ch2) { return 48 <= ch2 && ch2 <= 57 || // 0..9 97 <= ch2 && ch2 <= 102 || // a..f 65 <= ch2 && ch2 <= 70; } function isOctalDigit(ch2) { return ch2 >= 48 && ch2 <= 55; } NON_ASCII_WHITESPACES = [ 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279 ]; function isWhiteSpace(ch2) { return ch2 === 32 || ch2 === 9 || ch2 === 11 || ch2 === 12 || ch2 === 160 || ch2 >= 5760 && NON_ASCII_WHITESPACES.indexOf(ch2) >= 0; } function isLineTerminator(ch2) { return ch2 === 10 || ch2 === 13 || ch2 === 8232 || ch2 === 8233; } function fromCodePoint(cp) { if (cp <= 65535) { return String.fromCharCode(cp); } var cu1 = String.fromCharCode(Math.floor((cp - 65536) / 1024) + 55296); var cu2 = String.fromCharCode((cp - 65536) % 1024 + 56320); return cu1 + cu2; } IDENTIFIER_START = new Array(128); for (ch = 0; ch < 128; ++ch) { IDENTIFIER_START[ch] = ch >= 97 && ch <= 122 || // a..z ch >= 65 && ch <= 90 || // A..Z ch === 36 || ch === 95; } IDENTIFIER_PART = new Array(128); for (ch = 0; ch < 128; ++ch) { IDENTIFIER_PART[ch] = ch >= 97 && ch <= 122 || // a..z ch >= 65 && ch <= 90 || // A..Z ch >= 48 && ch <= 57 || // 0..9 ch === 36 || ch === 95; } function isIdentifierStartES5(ch2) { return ch2 < 128 ? IDENTIFIER_START[ch2] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch2)); } function isIdentifierPartES5(ch2) { return ch2 < 128 ? IDENTIFIER_PART[ch2] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch2)); } function isIdentifierStartES6(ch2) { return ch2 < 128 ? IDENTIFIER_START[ch2] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch2)); } function isIdentifierPartES6(ch2) { return ch2 < 128 ? IDENTIFIER_PART[ch2] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch2)); } module2.exports = { isDecimalDigit, isHexDigit, isOctalDigit, isWhiteSpace, isLineTerminator, isIdentifierStartES5, isIdentifierPartES5, isIdentifierStartES6, isIdentifierPartES6 }; })(); } }); // node_modules/esutils/lib/keyword.js var require_keyword = __commonJS({ "node_modules/esutils/lib/keyword.js"(exports2, module2) { (function() { "use strict"; var code = require_code(); function isStrictModeReservedWordES6(id) { switch (id) { case "implements": case "interface": case "package": case "private": case "protected": case "public": case "static": case "let": return true; default: return false; } } function isKeywordES5(id, strict) { if (!strict && id === "yield") { return false; } return isKeywordES6(id, strict); } function isKeywordES6(id, strict) { if (strict && isStrictModeReservedWordES6(id)) { return true; } switch (id.length) { case 2: return id === "if" || id === "in" || id === "do"; case 3: return id === "var" || id === "for" || id === "new" || id === "try"; case 4: return id === "this" || id === "else" || id === "case" || id === "void" || id === "with" || id === "enum"; case 5: return id === "while" || id === "break" || id === "catch" || id === "throw" || id === "const" || id === "yield" || id === "class" || id === "super"; case 6: return id === "return" || id === "typeof" || id === "delete" || id === "switch" || id === "export" || id === "import"; case 7: return id === "default" || id === "finally" || id === "extends"; case 8: return id === "function" || id === "continue" || id === "debugger"; case 10: return id === "instanceof"; default: return false; } } function isReservedWordES5(id, strict) { return id === "null" || id === "true" || id === "false" || isKeywordES5(id, strict); } function isReservedWordES6(id, strict) { return id === "null" || id === "true" || id === "false" || isKeywordES6(id, strict); } function isRestrictedWord(id) { return id === "eval" || id === "arguments"; } function isIdentifierNameES5(id) { var i5, iz, ch; if (id.length === 0) { return false; } ch = id.charCodeAt(0); if (!code.isIdentifierStartES5(ch)) { return false; } for (i5 = 1, iz = id.length; i5 < iz; ++i5) { ch = id.charCodeAt(i5); if (!code.isIdentifierPartES5(ch)) { return false; } } return true; } function decodeUtf16(lead, trail) { return (lead - 55296) * 1024 + (trail - 56320) + 65536; } function isIdentifierNameES6(id) { var i5, iz, ch, lowCh, check; if (id.length === 0) { return false; } check = code.isIdentifierStartES6; for (i5 = 0, iz = id.length; i5 < iz; ++i5) { ch = id.charCodeAt(i5); if (55296 <= ch && ch <= 56319) { ++i5; if (i5 >= iz) { return false; } lowCh = id.charCodeAt(i5); if (!(56320 <= lowCh && lowCh <= 57343)) { return false; } ch = decodeUtf16(ch, lowCh); } if (!check(ch)) { return false; } check = code.isIdentifierPartES6; } return true; } function isIdentifierES5(id, strict) { return isIdentifierNameES5(id) && !isReservedWordES5(id, strict); } function isIdentifierES6(id, strict) { return isIdentifierNameES6(id) && !isReservedWordES6(id, strict); } module2.exports = { isKeywordES5, isKeywordES6, isReservedWordES5, isReservedWordES6, isRestrictedWord, isIdentifierNameES5, isIdentifierNameES6, isIdentifierES5, isIdentifierES6 }; })(); } }); // node_modules/esutils/lib/utils.js var require_utils3 = __commonJS({ "node_modules/esutils/lib/utils.js"(exports2) { (function() { "use strict"; exports2.ast = require_ast(); exports2.code = require_code(); exports2.keyword = require_keyword(); })(); } }); // node_modules/source-map/lib/base64.js var require_base64 = __commonJS({ "node_modules/source-map/lib/base64.js"(exports2) { var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); exports2.encode = function(number) { if (0 <= number && number < intToCharMap.length) { return intToCharMap[number]; } throw new TypeError("Must be between 0 and 63: " + number); }; exports2.decode = function(charCode) { var bigA = 65; var bigZ = 90; var littleA = 97; var littleZ = 122; var zero = 48; var nine = 57; var plus = 43; var slash = 47; var littleOffset = 26; var numberOffset = 52; if (bigA <= charCode && charCode <= bigZ) { return charCode - bigA; } if (littleA <= charCode && charCode <= littleZ) { return charCode - littleA + littleOffset; } if (zero <= charCode && charCode <= nine) { return charCode - zero + numberOffset; } if (charCode == plus) { return 62; } if (charCode == slash) { return 63; } return -1; }; } }); // node_modules/source-map/lib/base64-vlq.js var require_base64_vlq = __commonJS({ "node_modules/source-map/lib/base64-vlq.js"(exports2) { var base64 = require_base64(); var VLQ_BASE_SHIFT = 5; var VLQ_BASE = 1 << VLQ_BASE_SHIFT; var VLQ_BASE_MASK = VLQ_BASE - 1; var VLQ_CONTINUATION_BIT = VLQ_BASE; function toVLQSigned(aValue) { return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0; } function fromVLQSigned(aValue) { var isNegative = (aValue & 1) === 1; var shifted = aValue >> 1; return isNegative ? -shifted : shifted; } exports2.encode = function base64VLQ_encode(aValue) { var encoded = ""; var digit; var vlq = toVLQSigned(aValue); do { digit = vlq & VLQ_BASE_MASK; vlq >>>= VLQ_BASE_SHIFT; if (vlq > 0) { digit |= VLQ_CONTINUATION_BIT; } encoded += base64.encode(digit); } while (vlq > 0); return encoded; }; exports2.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { var strLen = aStr.length; var result = 0; var shift = 0; var continuation, digit; do { if (aIndex >= strLen) { throw new Error("Expected more digits in base 64 VLQ value."); } digit = base64.decode(aStr.charCodeAt(aIndex++)); if (digit === -1) { throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); } continuation = !!(digit & VLQ_CONTINUATION_BIT); digit &= VLQ_BASE_MASK; result = result + (digit << shift); shift += VLQ_BASE_SHIFT; } while (continuation); aOutParam.value = fromVLQSigned(result); aOutParam.rest = aIndex; }; } }); // node_modules/source-map/lib/util.js var require_util10 = __commonJS({ "node_modules/source-map/lib/util.js"(exports2) { function getArg(aArgs, aName, aDefaultValue) { if (aName in aArgs) { return aArgs[aName]; } else if (arguments.length === 3) { return aDefaultValue; } else { throw new Error('"' + aName + '" is a required argument.'); } } exports2.getArg = getArg; var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; var dataUrlRegexp = /^data:.+\,.+$/; function urlParse(aUrl) { var match = aUrl.match(urlRegexp); if (!match) { return null; } return { scheme: match[1], auth: match[2], host: match[3], port: match[4], path: match[5] }; } exports2.urlParse = urlParse; function urlGenerate(aParsedUrl) { var url = ""; if (aParsedUrl.scheme) { url += aParsedUrl.scheme + ":"; } url += "//"; if (aParsedUrl.auth) { url += aParsedUrl.auth + "@"; } if (aParsedUrl.host) { url += aParsedUrl.host; } if (aParsedUrl.port) { url += ":" + aParsedUrl.port; } if (aParsedUrl.path) { url += aParsedUrl.path; } return url; } exports2.urlGenerate = urlGenerate; function normalize(aPath) { var path3 = aPath; var url = urlParse(aPath); if (url) { if (!url.path) { return aPath; } path3 = url.path; } var isAbsolute = exports2.isAbsolute(path3); var parts = path3.split(/\/+/); for (var part, up = 0, i5 = parts.length - 1; i5 >= 0; i5--) { part = parts[i5]; if (part === ".") { parts.splice(i5, 1); } else if (part === "..") { up++; } else if (up > 0) { if (part === "") { parts.splice(i5 + 1, up); up = 0; } else { parts.splice(i5, 2); up--; } } } path3 = parts.join("/"); if (path3 === "") { path3 = isAbsolute ? "/" : "."; } if (url) { url.path = path3; return urlGenerate(url); } return path3; } exports2.normalize = normalize; function join2(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } if (aPath === "") { aPath = "."; } var aPathUrl = urlParse(aPath); var aRootUrl = urlParse(aRoot); if (aRootUrl) { aRoot = aRootUrl.path || "/"; } if (aPathUrl && !aPathUrl.scheme) { if (aRootUrl) { aPathUrl.scheme = aRootUrl.scheme; } return urlGenerate(aPathUrl); } if (aPathUrl || aPath.match(dataUrlRegexp)) { return aPath; } if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { aRootUrl.host = aPath; return urlGenerate(aRootUrl); } var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath); if (aRootUrl) { aRootUrl.path = joined; return urlGenerate(aRootUrl); } return joined; } exports2.join = join2; exports2.isAbsolute = function(aPath) { return aPath.charAt(0) === "/" || urlRegexp.test(aPath); }; function relative(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } aRoot = aRoot.replace(/\/$/, ""); var level = 0; while (aPath.indexOf(aRoot + "/") !== 0) { var index = aRoot.lastIndexOf("/"); if (index < 0) { return aPath; } aRoot = aRoot.slice(0, index); if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { return aPath; } ++level; } return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); } exports2.relative = relative; var supportsNullProto = (function() { var obj = /* @__PURE__ */ Object.create(null); return !("__proto__" in obj); })(); function identity(s) { return s; } function toSetString(aStr) { if (isProtoString(aStr)) { return "$" + aStr; } return aStr; } exports2.toSetString = supportsNullProto ? identity : toSetString; function fromSetString(aStr) { if (isProtoString(aStr)) { return aStr.slice(1); } return aStr; } exports2.fromSetString = supportsNullProto ? identity : fromSetString; function isProtoString(s) { if (!s) { return false; } var length = s.length; if (length < 9) { return false; } if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) { return false; } for (var i5 = length - 10; i5 >= 0; i5--) { if (s.charCodeAt(i5) !== 36) { return false; } } return true; } function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { var cmp = strcmp(mappingA.source, mappingB.source); if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0 || onlyCompareOriginal) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } return strcmp(mappingA.name, mappingB.name); } exports2.compareByOriginalPositions = compareByOriginalPositions; function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { var cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0 || onlyCompareGenerated) { return cmp; } cmp = strcmp(mappingA.source, mappingB.source); if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0) { return cmp; } return strcmp(mappingA.name, mappingB.name); } exports2.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; function strcmp(aStr1, aStr2) { if (aStr1 === aStr2) { return 0; } if (aStr1 === null) { return 1; } if (aStr2 === null) { return -1; } if (aStr1 > aStr2) { return 1; } return -1; } function compareByGeneratedPositionsInflated(mappingA, mappingB) { var cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0) { return cmp; } cmp = strcmp(mappingA.source, mappingB.source); if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0) { return cmp; } return strcmp(mappingA.name, mappingB.name); } exports2.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; function parseSourceMapInput(str) { return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, "")); } exports2.parseSourceMapInput = parseSourceMapInput; function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { sourceURL = sourceURL || ""; if (sourceRoot) { if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") { sourceRoot += "/"; } sourceURL = sourceRoot + sourceURL; } if (sourceMapURL) { var parsed = urlParse(sourceMapURL); if (!parsed) { throw new Error("sourceMapURL could not be parsed"); } if (parsed.path) { var index = parsed.path.lastIndexOf("/"); if (index >= 0) { parsed.path = parsed.path.substring(0, index + 1); } } sourceURL = join2(urlGenerate(parsed), sourceURL); } return normalize(sourceURL); } exports2.computeSourceURL = computeSourceURL; } }); // node_modules/source-map/lib/array-set.js var require_array_set = __commonJS({ "node_modules/source-map/lib/array-set.js"(exports2) { var util = require_util10(); var has = Object.prototype.hasOwnProperty; var hasNativeMap = typeof Map !== "undefined"; function ArraySet() { this._array = []; this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null); } ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { var set = new ArraySet(); for (var i5 = 0, len = aArray.length; i5 < len; i5++) { set.add(aArray[i5], aAllowDuplicates); } return set; }; ArraySet.prototype.size = function ArraySet_size() { return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; }; ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { var sStr = hasNativeMap ? aStr : util.toSetString(aStr); var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); var idx = this._array.length; if (!isDuplicate || aAllowDuplicates) { this._array.push(aStr); } if (!isDuplicate) { if (hasNativeMap) { this._set.set(aStr, idx); } else { this._set[sStr] = idx; } } }; ArraySet.prototype.has = function ArraySet_has(aStr) { if (hasNativeMap) { return this._set.has(aStr); } else { var sStr = util.toSetString(aStr); return has.call(this._set, sStr); } }; ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { if (hasNativeMap) { var idx = this._set.get(aStr); if (idx >= 0) { return idx; } } else { var sStr = util.toSetString(aStr); if (has.call(this._set, sStr)) { return this._set[sStr]; } } throw new Error('"' + aStr + '" is not in the set.'); }; ArraySet.prototype.at = function ArraySet_at(aIdx) { if (aIdx >= 0 && aIdx < this._array.length) { return this._array[aIdx]; } throw new Error("No element indexed by " + aIdx); }; ArraySet.prototype.toArray = function ArraySet_toArray() { return this._array.slice(); }; exports2.ArraySet = ArraySet; } }); // node_modules/source-map/lib/mapping-list.js var require_mapping_list = __commonJS({ "node_modules/source-map/lib/mapping-list.js"(exports2) { var util = require_util10(); function generatedPositionAfter(mappingA, mappingB) { var lineA = mappingA.generatedLine; var lineB = mappingB.generatedLine; var columnA = mappingA.generatedColumn; var columnB = mappingB.generatedColumn; return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; } function MappingList() { this._array = []; this._sorted = true; this._last = { generatedLine: -1, generatedColumn: 0 }; } MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) { this._array.forEach(aCallback, aThisArg); }; MappingList.prototype.add = function MappingList_add(aMapping) { if (generatedPositionAfter(this._last, aMapping)) { this._last = aMapping; this._array.push(aMapping); } else { this._sorted = false; this._array.push(aMapping); } }; MappingList.prototype.toArray = function MappingList_toArray() { if (!this._sorted) { this._array.sort(util.compareByGeneratedPositionsInflated); this._sorted = true; } return this._array; }; exports2.MappingList = MappingList; } }); // node_modules/source-map/lib/source-map-generator.js var require_source_map_generator = __commonJS({ "node_modules/source-map/lib/source-map-generator.js"(exports2) { var base64VLQ = require_base64_vlq(); var util = require_util10(); var ArraySet = require_array_set().ArraySet; var MappingList = require_mapping_list().MappingList; function SourceMapGenerator(aArgs) { if (!aArgs) { aArgs = {}; } this._file = util.getArg(aArgs, "file", null); this._sourceRoot = util.getArg(aArgs, "sourceRoot", null); this._skipValidation = util.getArg(aArgs, "skipValidation", false); this._sources = new ArraySet(); this._names = new ArraySet(); this._mappings = new MappingList(); this._sourcesContents = null; } SourceMapGenerator.prototype._version = 3; SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { var sourceRoot = aSourceMapConsumer.sourceRoot; var generator = new SourceMapGenerator({ file: aSourceMapConsumer.file, sourceRoot }); aSourceMapConsumer.eachMapping(function(mapping) { var newMapping = { generated: { line: mapping.generatedLine, column: mapping.generatedColumn } }; if (mapping.source != null) { newMapping.source = mapping.source; if (sourceRoot != null) { newMapping.source = util.relative(sourceRoot, newMapping.source); } newMapping.original = { line: mapping.originalLine, column: mapping.originalColumn }; if (mapping.name != null) { newMapping.name = mapping.name; } } generator.addMapping(newMapping); }); aSourceMapConsumer.sources.forEach(function(sourceFile) { var sourceRelative = sourceFile; if (sourceRoot !== null) { sourceRelative = util.relative(sourceRoot, sourceFile); } if (!generator._sources.has(sourceRelative)) { generator._sources.add(sourceRelative); } var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { generator.setSourceContent(sourceFile, content); } }); return generator; }; SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { var generated = util.getArg(aArgs, "generated"); var original = util.getArg(aArgs, "original", null); var source = util.getArg(aArgs, "source", null); var name = util.getArg(aArgs, "name", null); if (!this._skipValidation) { this._validateMapping(generated, original, source, name); } if (source != null) { source = String(source); if (!this._sources.has(source)) { this._sources.add(source); } } if (name != null) { name = String(name); if (!this._names.has(name)) { this._names.add(name); } } this._mappings.add({ generatedLine: generated.line, generatedColumn: generated.column, originalLine: original != null && original.line, originalColumn: original != null && original.column, source, name }); }; SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { var source = aSourceFile; if (this._sourceRoot != null) { source = util.relative(this._sourceRoot, source); } if (aSourceContent != null) { if (!this._sourcesContents) { this._sourcesContents = /* @__PURE__ */ Object.create(null); } this._sourcesContents[util.toSetString(source)] = aSourceContent; } else if (this._sourcesContents) { delete this._sourcesContents[util.toSetString(source)]; if (Object.keys(this._sourcesContents).length === 0) { this._sourcesContents = null; } } }; SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { var sourceFile = aSourceFile; if (aSourceFile == null) { if (aSourceMapConsumer.file == null) { throw new Error( `SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.` ); } sourceFile = aSourceMapConsumer.file; } var sourceRoot = this._sourceRoot; if (sourceRoot != null) { sourceFile = util.relative(sourceRoot, sourceFile); } var newSources = new ArraySet(); var newNames = new ArraySet(); this._mappings.unsortedForEach(function(mapping) { if (mapping.source === sourceFile && mapping.originalLine != null) { var original = aSourceMapConsumer.originalPositionFor({ line: mapping.originalLine, column: mapping.originalColumn }); if (original.source != null) { mapping.source = original.source; if (aSourceMapPath != null) { mapping.source = util.join(aSourceMapPath, mapping.source); } if (sourceRoot != null) { mapping.source = util.relative(sourceRoot, mapping.source); } mapping.originalLine = original.line; mapping.originalColumn = original.column; if (original.name != null) { mapping.name = original.name; } } } var source = mapping.source; if (source != null && !newSources.has(source)) { newSources.add(source); } var name = mapping.name; if (name != null && !newNames.has(name)) { newNames.add(name); } }, this); this._sources = newSources; this._names = newNames; aSourceMapConsumer.sources.forEach(function(sourceFile2) { var content = aSourceMapConsumer.sourceContentFor(sourceFile2); if (content != null) { if (aSourceMapPath != null) { sourceFile2 = util.join(aSourceMapPath, sourceFile2); } if (sourceRoot != null) { sourceFile2 = util.relative(sourceRoot, sourceFile2); } this.setSourceContent(sourceFile2, content); } }, this); }; SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) { if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") { throw new Error( "original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values." ); } if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) { return; } else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) { return; } else { throw new Error("Invalid mapping: " + JSON.stringify({ generated: aGenerated, source: aSource, original: aOriginal, name: aName })); } }; SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() { var previousGeneratedColumn = 0; var previousGeneratedLine = 1; var previousOriginalColumn = 0; var previousOriginalLine = 0; var previousName = 0; var previousSource = 0; var result = ""; var next; var mapping; var nameIdx; var sourceIdx; var mappings = this._mappings.toArray(); for (var i5 = 0, len = mappings.length; i5 < len; i5++) { mapping = mappings[i5]; next = ""; if (mapping.generatedLine !== previousGeneratedLine) { previousGeneratedColumn = 0; while (mapping.generatedLine !== previousGeneratedLine) { next += ";"; previousGeneratedLine++; } } else { if (i5 > 0) { if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i5 - 1])) { continue; } next += ","; } } next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn); previousGeneratedColumn = mapping.generatedColumn; if (mapping.source != null) { sourceIdx = this._sources.indexOf(mapping.source); next += base64VLQ.encode(sourceIdx - previousSource); previousSource = sourceIdx; next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine); previousOriginalLine = mapping.originalLine - 1; next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn); previousOriginalColumn = mapping.originalColumn; if (mapping.name != null) { nameIdx = this._names.indexOf(mapping.name); next += base64VLQ.encode(nameIdx - previousName); previousName = nameIdx; } } result += next; } return result; }; SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { return aSources.map(function(source) { if (!this._sourcesContents) { return null; } if (aSourceRoot != null) { source = util.relative(aSourceRoot, source); } var key = util.toSetString(source); return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; }, this); }; SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() { var map2 = { version: this._version, sources: this._sources.toArray(), names: this._names.toArray(), mappings: this._serializeMappings() }; if (this._file != null) { map2.file = this._file; } if (this._sourceRoot != null) { map2.sourceRoot = this._sourceRoot; } if (this._sourcesContents) { map2.sourcesContent = this._generateSourcesContent(map2.sources, map2.sourceRoot); } return map2; }; SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() { return JSON.stringify(this.toJSON()); }; exports2.SourceMapGenerator = SourceMapGenerator; } }); // node_modules/source-map/lib/binary-search.js var require_binary_search = __commonJS({ "node_modules/source-map/lib/binary-search.js"(exports2) { exports2.GREATEST_LOWER_BOUND = 1; exports2.LEAST_UPPER_BOUND = 2; function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { var mid = Math.floor((aHigh - aLow) / 2) + aLow; var cmp = aCompare(aNeedle, aHaystack[mid], true); if (cmp === 0) { return mid; } else if (cmp > 0) { if (aHigh - mid > 1) { return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); } if (aBias == exports2.LEAST_UPPER_BOUND) { return aHigh < aHaystack.length ? aHigh : -1; } else { return mid; } } else { if (mid - aLow > 1) { return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); } if (aBias == exports2.LEAST_UPPER_BOUND) { return mid; } else { return aLow < 0 ? -1 : aLow; } } } exports2.search = function search(aNeedle, aHaystack, aCompare, aBias) { if (aHaystack.length === 0) { return -1; } var index = recursiveSearch( -1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports2.GREATEST_LOWER_BOUND ); if (index < 0) { return -1; } while (index - 1 >= 0) { if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { break; } --index; } return index; }; } }); // node_modules/source-map/lib/quick-sort.js var require_quick_sort = __commonJS({ "node_modules/source-map/lib/quick-sort.js"(exports2) { function swap(ary, x, y) { var temp = ary[x]; ary[x] = ary[y]; ary[y] = temp; } function randomIntInRange(low, high) { return Math.round(low + Math.random() * (high - low)); } function doQuickSort(ary, comparator, p2, r5) { if (p2 < r5) { var pivotIndex = randomIntInRange(p2, r5); var i5 = p2 - 1; swap(ary, pivotIndex, r5); var pivot = ary[r5]; for (var j5 = p2; j5 < r5; j5++) { if (comparator(ary[j5], pivot) <= 0) { i5 += 1; swap(ary, i5, j5); } } swap(ary, i5 + 1, j5); var q2 = i5 + 1; doQuickSort(ary, comparator, p2, q2 - 1); doQuickSort(ary, comparator, q2 + 1, r5); } } exports2.quickSort = function(ary, comparator) { doQuickSort(ary, comparator, 0, ary.length - 1); }; } }); // node_modules/source-map/lib/source-map-consumer.js var require_source_map_consumer = __commonJS({ "node_modules/source-map/lib/source-map-consumer.js"(exports2) { var util = require_util10(); var binarySearch = require_binary_search(); var ArraySet = require_array_set().ArraySet; var base64VLQ = require_base64_vlq(); var quickSort = require_quick_sort().quickSort; function SourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === "string") { sourceMap = util.parseSourceMapInput(aSourceMap); } return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); } SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); }; SourceMapConsumer.prototype._version = 3; SourceMapConsumer.prototype.__generatedMappings = null; Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", { configurable: true, enumerable: true, get: function() { if (!this.__generatedMappings) { this._parseMappings(this._mappings, this.sourceRoot); } return this.__generatedMappings; } }); SourceMapConsumer.prototype.__originalMappings = null; Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", { configurable: true, enumerable: true, get: function() { if (!this.__originalMappings) { this._parseMappings(this._mappings, this.sourceRoot); } return this.__originalMappings; } }); SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) { var c5 = aStr.charAt(index); return c5 === ";" || c5 === ","; }; SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { throw new Error("Subclasses must implement _parseMappings"); }; SourceMapConsumer.GENERATED_ORDER = 1; SourceMapConsumer.ORIGINAL_ORDER = 2; SourceMapConsumer.GREATEST_LOWER_BOUND = 1; SourceMapConsumer.LEAST_UPPER_BOUND = 2; SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { var context = aContext || null; var order = aOrder || SourceMapConsumer.GENERATED_ORDER; var mappings; switch (order) { case SourceMapConsumer.GENERATED_ORDER: mappings = this._generatedMappings; break; case SourceMapConsumer.ORIGINAL_ORDER: mappings = this._originalMappings; break; default: throw new Error("Unknown order of iteration."); } var sourceRoot = this.sourceRoot; mappings.map(function(mapping) { var source = mapping.source === null ? null : this._sources.at(mapping.source); source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); return { source, generatedLine: mapping.generatedLine, generatedColumn: mapping.generatedColumn, originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name: mapping.name === null ? null : this._names.at(mapping.name) }; }, this).forEach(aCallback, context); }; SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { var line = util.getArg(aArgs, "line"); var needle = { source: util.getArg(aArgs, "source"), originalLine: line, originalColumn: util.getArg(aArgs, "column", 0) }; needle.source = this._findSourceIndex(needle.source); if (needle.source < 0) { return []; } var mappings = []; var index = this._findMapping( needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND ); if (index >= 0) { var mapping = this._originalMappings[index]; if (aArgs.column === void 0) { var originalLine = mapping.originalLine; while (mapping && mapping.originalLine === originalLine) { mappings.push({ line: util.getArg(mapping, "generatedLine", null), column: util.getArg(mapping, "generatedColumn", null), lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) }); mapping = this._originalMappings[++index]; } } else { var originalColumn = mapping.originalColumn; while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) { mappings.push({ line: util.getArg(mapping, "generatedLine", null), column: util.getArg(mapping, "generatedColumn", null), lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) }); mapping = this._originalMappings[++index]; } } } return mappings; }; exports2.SourceMapConsumer = SourceMapConsumer; function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === "string") { sourceMap = util.parseSourceMapInput(aSourceMap); } var version = util.getArg(sourceMap, "version"); var sources = util.getArg(sourceMap, "sources"); var names = util.getArg(sourceMap, "names", []); var sourceRoot = util.getArg(sourceMap, "sourceRoot", null); var sourcesContent = util.getArg(sourceMap, "sourcesContent", null); var mappings = util.getArg(sourceMap, "mappings"); var file2 = util.getArg(sourceMap, "file", null); if (version != this._version) { throw new Error("Unsupported version: " + version); } if (sourceRoot) { sourceRoot = util.normalize(sourceRoot); } sources = sources.map(String).map(util.normalize).map(function(source) { return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source; }); this._names = ArraySet.fromArray(names.map(String), true); this._sources = ArraySet.fromArray(sources, true); this._absoluteSources = this._sources.toArray().map(function(s) { return util.computeSourceURL(sourceRoot, s, aSourceMapURL); }); this.sourceRoot = sourceRoot; this.sourcesContent = sourcesContent; this._mappings = mappings; this._sourceMapURL = aSourceMapURL; this.file = file2; } BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { var relativeSource = aSource; if (this.sourceRoot != null) { relativeSource = util.relative(this.sourceRoot, relativeSource); } if (this._sources.has(relativeSource)) { return this._sources.indexOf(relativeSource); } var i5; for (i5 = 0; i5 < this._absoluteSources.length; ++i5) { if (this._absoluteSources[i5] == aSource) { return i5; } } return -1; }; BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { var smc = Object.create(BasicSourceMapConsumer.prototype); var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); smc.sourceRoot = aSourceMap._sourceRoot; smc.sourcesContent = aSourceMap._generateSourcesContent( smc._sources.toArray(), smc.sourceRoot ); smc.file = aSourceMap._file; smc._sourceMapURL = aSourceMapURL; smc._absoluteSources = smc._sources.toArray().map(function(s) { return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); }); var generatedMappings = aSourceMap._mappings.toArray().slice(); var destGeneratedMappings = smc.__generatedMappings = []; var destOriginalMappings = smc.__originalMappings = []; for (var i5 = 0, length = generatedMappings.length; i5 < length; i5++) { var srcMapping = generatedMappings[i5]; var destMapping = new Mapping(); destMapping.generatedLine = srcMapping.generatedLine; destMapping.generatedColumn = srcMapping.generatedColumn; if (srcMapping.source) { destMapping.source = sources.indexOf(srcMapping.source); destMapping.originalLine = srcMapping.originalLine; destMapping.originalColumn = srcMapping.originalColumn; if (srcMapping.name) { destMapping.name = names.indexOf(srcMapping.name); } destOriginalMappings.push(destMapping); } destGeneratedMappings.push(destMapping); } quickSort(smc.__originalMappings, util.compareByOriginalPositions); return smc; }; BasicSourceMapConsumer.prototype._version = 3; Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", { get: function() { return this._absoluteSources.slice(); } }); function Mapping() { this.generatedLine = 0; this.generatedColumn = 0; this.source = null; this.originalLine = null; this.originalColumn = null; this.name = null; } BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { var generatedLine = 1; var previousGeneratedColumn = 0; var previousOriginalLine = 0; var previousOriginalColumn = 0; var previousSource = 0; var previousName = 0; var length = aStr.length; var index = 0; var cachedSegments = {}; var temp = {}; var originalMappings = []; var generatedMappings = []; var mapping, str, segment, end, value; while (index < length) { if (aStr.charAt(index) === ";") { generatedLine++; index++; previousGeneratedColumn = 0; } else if (aStr.charAt(index) === ",") { index++; } else { mapping = new Mapping(); mapping.generatedLine = generatedLine; for (end = index; end < length; end++) { if (this._charIsMappingSeparator(aStr, end)) { break; } } str = aStr.slice(index, end); segment = cachedSegments[str]; if (segment) { index += str.length; } else { segment = []; while (index < end) { base64VLQ.decode(aStr, index, temp); value = temp.value; index = temp.rest; segment.push(value); } if (segment.length === 2) { throw new Error("Found a source, but no line and column"); } if (segment.length === 3) { throw new Error("Found a source and line, but no column"); } cachedSegments[str] = segment; } mapping.generatedColumn = previousGeneratedColumn + segment[0]; previousGeneratedColumn = mapping.generatedColumn; if (segment.length > 1) { mapping.source = previousSource + segment[1]; previousSource += segment[1]; mapping.originalLine = previousOriginalLine + segment[2]; previousOriginalLine = mapping.originalLine; mapping.originalLine += 1; mapping.originalColumn = previousOriginalColumn + segment[3]; previousOriginalColumn = mapping.originalColumn; if (segment.length > 4) { mapping.name = previousName + segment[4]; previousName += segment[4]; } } generatedMappings.push(mapping); if (typeof mapping.originalLine === "number") { originalMappings.push(mapping); } } } quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); this.__generatedMappings = generatedMappings; quickSort(originalMappings, util.compareByOriginalPositions); this.__originalMappings = originalMappings; }; BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) { if (aNeedle[aLineName] <= 0) { throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]); } if (aNeedle[aColumnName] < 0) { throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]); } return binarySearch.search(aNeedle, aMappings, aComparator, aBias); }; BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() { for (var index = 0; index < this._generatedMappings.length; ++index) { var mapping = this._generatedMappings[index]; if (index + 1 < this._generatedMappings.length) { var nextMapping = this._generatedMappings[index + 1]; if (mapping.generatedLine === nextMapping.generatedLine) { mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; continue; } } mapping.lastGeneratedColumn = Infinity; } }; BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, "line"), generatedColumn: util.getArg(aArgs, "column") }; var index = this._findMapping( needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND) ); if (index >= 0) { var mapping = this._generatedMappings[index]; if (mapping.generatedLine === needle.generatedLine) { var source = util.getArg(mapping, "source", null); if (source !== null) { source = this._sources.at(source); source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); } var name = util.getArg(mapping, "name", null); if (name !== null) { name = this._names.at(name); } return { source, line: util.getArg(mapping, "originalLine", null), column: util.getArg(mapping, "originalColumn", null), name }; } } return { source: null, line: null, column: null, name: null }; }; BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() { if (!this.sourcesContent) { return false; } return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) { return sc == null; }); }; BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { if (!this.sourcesContent) { return null; } var index = this._findSourceIndex(aSource); if (index >= 0) { return this.sourcesContent[index]; } var relativeSource = aSource; if (this.sourceRoot != null) { relativeSource = util.relative(this.sourceRoot, relativeSource); } var url; if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) { var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]; } if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) { return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; } } if (nullOnMissing) { return null; } else { throw new Error('"' + relativeSource + '" is not in the SourceMap.'); } }; BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { var source = util.getArg(aArgs, "source"); source = this._findSourceIndex(source); if (source < 0) { return { line: null, column: null, lastColumn: null }; } var needle = { source, originalLine: util.getArg(aArgs, "line"), originalColumn: util.getArg(aArgs, "column") }; var index = this._findMapping( needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND) ); if (index >= 0) { var mapping = this._originalMappings[index]; if (mapping.source === needle.source) { return { line: util.getArg(mapping, "generatedLine", null), column: util.getArg(mapping, "generatedColumn", null), lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) }; } } return { line: null, column: null, lastColumn: null }; }; exports2.BasicSourceMapConsumer = BasicSourceMapConsumer; function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === "string") { sourceMap = util.parseSourceMapInput(aSourceMap); } var version = util.getArg(sourceMap, "version"); var sections = util.getArg(sourceMap, "sections"); if (version != this._version) { throw new Error("Unsupported version: " + version); } this._sources = new ArraySet(); this._names = new ArraySet(); var lastOffset = { line: -1, column: 0 }; this._sections = sections.map(function(s) { if (s.url) { throw new Error("Support for url field in sections not implemented."); } var offset = util.getArg(s, "offset"); var offsetLine = util.getArg(offset, "line"); var offsetColumn = util.getArg(offset, "column"); if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) { throw new Error("Section offsets must be ordered and non-overlapping."); } lastOffset = offset; return { generatedOffset: { // The offset fields are 0-based, but we use 1-based indices when // encoding/decoding from VLQ. generatedLine: offsetLine + 1, generatedColumn: offsetColumn + 1 }, consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL) }; }); } IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; IndexedSourceMapConsumer.prototype._version = 3; Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", { get: function() { var sources = []; for (var i5 = 0; i5 < this._sections.length; i5++) { for (var j5 = 0; j5 < this._sections[i5].consumer.sources.length; j5++) { sources.push(this._sections[i5].consumer.sources[j5]); } } return sources; } }); IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, "line"), generatedColumn: util.getArg(aArgs, "column") }; var sectionIndex = binarySearch.search( needle, this._sections, function(needle2, section2) { var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine; if (cmp) { return cmp; } return needle2.generatedColumn - section2.generatedOffset.generatedColumn; } ); var section = this._sections[sectionIndex]; if (!section) { return { source: null, line: null, column: null, name: null }; } return section.consumer.originalPositionFor({ line: needle.generatedLine - (section.generatedOffset.generatedLine - 1), column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), bias: aArgs.bias }); }; IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() { return this._sections.every(function(s) { return s.consumer.hasContentsOfAllSources(); }); }; IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { for (var i5 = 0; i5 < this._sections.length; i5++) { var section = this._sections[i5]; var content = section.consumer.sourceContentFor(aSource, true); if (content) { return content; } } if (nullOnMissing) { return null; } else { throw new Error('"' + aSource + '" is not in the SourceMap.'); } }; IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { for (var i5 = 0; i5 < this._sections.length; i5++) { var section = this._sections[i5]; if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) { continue; } var generatedPosition = section.consumer.generatedPositionFor(aArgs); if (generatedPosition) { var ret = { line: generatedPosition.line + (section.generatedOffset.generatedLine - 1), column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0) }; return ret; } } return { line: null, column: null }; }; IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { this.__generatedMappings = []; this.__originalMappings = []; for (var i5 = 0; i5 < this._sections.length; i5++) { var section = this._sections[i5]; var sectionMappings = section.consumer._generatedMappings; for (var j5 = 0; j5 < sectionMappings.length; j5++) { var mapping = sectionMappings[j5]; var source = section.consumer._sources.at(mapping.source); source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); this._sources.add(source); source = this._sources.indexOf(source); var name = null; if (mapping.name) { name = section.consumer._names.at(mapping.name); this._names.add(name); name = this._names.indexOf(name); } var adjustedMapping = { source, generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1), generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name }; this.__generatedMappings.push(adjustedMapping); if (typeof adjustedMapping.originalLine === "number") { this.__originalMappings.push(adjustedMapping); } } } quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); quickSort(this.__originalMappings, util.compareByOriginalPositions); }; exports2.IndexedSourceMapConsumer = IndexedSourceMapConsumer; } }); // node_modules/source-map/lib/source-node.js var require_source_node = __commonJS({ "node_modules/source-map/lib/source-node.js"(exports2) { var SourceMapGenerator = require_source_map_generator().SourceMapGenerator; var util = require_util10(); var REGEX_NEWLINE = /(\r?\n)/; var NEWLINE_CODE = 10; var isSourceNode = "$$$isSourceNode$$$"; function SourceNode(aLine, aColumn, aSource, aChunks, aName) { this.children = []; this.sourceContents = {}; this.line = aLine == null ? null : aLine; this.column = aColumn == null ? null : aColumn; this.source = aSource == null ? null : aSource; this.name = aName == null ? null : aName; this[isSourceNode] = true; if (aChunks != null) this.add(aChunks); } SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { var node = new SourceNode(); var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); var remainingLinesIndex = 0; var shiftNextLine = function() { var lineContents = getNextLine(); var newLine = getNextLine() || ""; return lineContents + newLine; function getNextLine() { return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0; } }; var lastGeneratedLine = 1, lastGeneratedColumn = 0; var lastMapping = null; aSourceMapConsumer.eachMapping(function(mapping) { if (lastMapping !== null) { if (lastGeneratedLine < mapping.generatedLine) { addMappingWithCode(lastMapping, shiftNextLine()); lastGeneratedLine++; lastGeneratedColumn = 0; } else { var nextLine = remainingLines[remainingLinesIndex] || ""; var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); lastGeneratedColumn = mapping.generatedColumn; addMappingWithCode(lastMapping, code); lastMapping = mapping; return; } } while (lastGeneratedLine < mapping.generatedLine) { node.add(shiftNextLine()); lastGeneratedLine++; } if (lastGeneratedColumn < mapping.generatedColumn) { var nextLine = remainingLines[remainingLinesIndex] || ""; node.add(nextLine.substr(0, mapping.generatedColumn)); remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); lastGeneratedColumn = mapping.generatedColumn; } lastMapping = mapping; }, this); if (remainingLinesIndex < remainingLines.length) { if (lastMapping) { addMappingWithCode(lastMapping, shiftNextLine()); } node.add(remainingLines.splice(remainingLinesIndex).join("")); } aSourceMapConsumer.sources.forEach(function(sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { if (aRelativePath != null) { sourceFile = util.join(aRelativePath, sourceFile); } node.setSourceContent(sourceFile, content); } }); return node; function addMappingWithCode(mapping, code) { if (mapping === null || mapping.source === void 0) { node.add(code); } else { var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source; node.add(new SourceNode( mapping.originalLine, mapping.originalColumn, source, code, mapping.name )); } } }; SourceNode.prototype.add = function SourceNode_add(aChunk) { if (Array.isArray(aChunk)) { aChunk.forEach(function(chunk) { this.add(chunk); }, this); } else if (aChunk[isSourceNode] || typeof aChunk === "string") { if (aChunk) { this.children.push(aChunk); } } else { throw new TypeError( "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk ); } return this; }; SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { if (Array.isArray(aChunk)) { for (var i5 = aChunk.length - 1; i5 >= 0; i5--) { this.prepend(aChunk[i5]); } } else if (aChunk[isSourceNode] || typeof aChunk === "string") { this.children.unshift(aChunk); } else { throw new TypeError( "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk ); } return this; }; SourceNode.prototype.walk = function SourceNode_walk(aFn) { var chunk; for (var i5 = 0, len = this.children.length; i5 < len; i5++) { chunk = this.children[i5]; if (chunk[isSourceNode]) { chunk.walk(aFn); } else { if (chunk !== "") { aFn(chunk, { source: this.source, line: this.line, column: this.column, name: this.name }); } } } }; SourceNode.prototype.join = function SourceNode_join(aSep) { var newChildren; var i5; var len = this.children.length; if (len > 0) { newChildren = []; for (i5 = 0; i5 < len - 1; i5++) { newChildren.push(this.children[i5]); newChildren.push(aSep); } newChildren.push(this.children[i5]); this.children = newChildren; } return this; }; SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { var lastChild = this.children[this.children.length - 1]; if (lastChild[isSourceNode]) { lastChild.replaceRight(aPattern, aReplacement); } else if (typeof lastChild === "string") { this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); } else { this.children.push("".replace(aPattern, aReplacement)); } return this; }; SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; }; SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i5 = 0, len = this.children.length; i5 < len; i5++) { if (this.children[i5][isSourceNode]) { this.children[i5].walkSourceContents(aFn); } } var sources = Object.keys(this.sourceContents); for (var i5 = 0, len = sources.length; i5 < len; i5++) { aFn(util.fromSetString(sources[i5]), this.sourceContents[sources[i5]]); } }; SourceNode.prototype.toString = function SourceNode_toString() { var str = ""; this.walk(function(chunk) { str += chunk; }); return str; }; SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { var generated = { code: "", line: 1, column: 0 }; var map2 = new SourceMapGenerator(aArgs); var sourceMappingActive = false; var lastOriginalSource = null; var lastOriginalLine = null; var lastOriginalColumn = null; var lastOriginalName = null; this.walk(function(chunk, original) { generated.code += chunk; if (original.source !== null && original.line !== null && original.column !== null) { if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) { map2.addMapping({ source: original.source, original: { line: original.line, column: original.column }, generated: { line: generated.line, column: generated.column }, name: original.name }); } lastOriginalSource = original.source; lastOriginalLine = original.line; lastOriginalColumn = original.column; lastOriginalName = original.name; sourceMappingActive = true; } else if (sourceMappingActive) { map2.addMapping({ generated: { line: generated.line, column: generated.column } }); lastOriginalSource = null; sourceMappingActive = false; } for (var idx = 0, length = chunk.length; idx < length; idx++) { if (chunk.charCodeAt(idx) === NEWLINE_CODE) { generated.line++; generated.column = 0; if (idx + 1 === length) { lastOriginalSource = null; sourceMappingActive = false; } else if (sourceMappingActive) { map2.addMapping({ source: original.source, original: { line: original.line, column: original.column }, generated: { line: generated.line, column: generated.column }, name: original.name }); } } else { generated.column++; } } }); this.walkSourceContents(function(sourceFile, sourceContent) { map2.setSourceContent(sourceFile, sourceContent); }); return { code: generated.code, map: map2 }; }; exports2.SourceNode = SourceNode; } }); // node_modules/source-map/source-map.js var require_source_map = __commonJS({ "node_modules/source-map/source-map.js"(exports2) { exports2.SourceMapGenerator = require_source_map_generator().SourceMapGenerator; exports2.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer; exports2.SourceNode = require_source_node().SourceNode; } }); // node_modules/escodegen/package.json var require_package2 = __commonJS({ "node_modules/escodegen/package.json"(exports2, module2) { module2.exports = { name: "escodegen", description: "ECMAScript code generator", homepage: "http://github.com/estools/escodegen", main: "escodegen.js", bin: { esgenerate: "./bin/esgenerate.js", escodegen: "./bin/escodegen.js" }, files: [ "LICENSE.BSD", "README.md", "bin", "escodegen.js", "package.json" ], version: "2.1.0", engines: { node: ">=6.0" }, maintainers: [ { name: "Yusuke Suzuki", email: "utatane.tea@gmail.com", web: "http://github.com/Constellation" } ], repository: { type: "git", url: "http://github.com/estools/escodegen.git" }, dependencies: { estraverse: "^5.2.0", esutils: "^2.0.2", esprima: "^4.0.1" }, optionalDependencies: { "source-map": "~0.6.1" }, devDependencies: { acorn: "^8.0.4", bluebird: "^3.4.7", "bower-registry-client": "^1.0.0", chai: "^4.2.0", "chai-exclude": "^2.0.2", "commonjs-everywhere": "^0.9.7", gulp: "^4.0.2", "gulp-eslint": "^6.0.0", "gulp-mocha": "^7.0.2", minimist: "^1.2.5", optionator: "^0.9.1", semver: "^7.3.4" }, license: "BSD-2-Clause", scripts: { test: "gulp travis", "unit-test": "gulp test", lint: "gulp lint", release: "node tools/release.js", "build-min": "./node_modules/.bin/cjsify -ma path: tools/entry-point.js > escodegen.browser.min.js", build: "./node_modules/.bin/cjsify -a path: tools/entry-point.js > escodegen.browser.js" } }; } }); // node_modules/escodegen/escodegen.js var require_escodegen = __commonJS({ "node_modules/escodegen/escodegen.js"(exports2) { (function() { "use strict"; var Syntax, Precedence, BinaryPrecedence, SourceNode, estraverse, esutils, base, indent, json, renumber, hexadecimal, quotes, escapeless, newline, space, parentheses, semicolons, safeConcatenation, directive, extra, parse, sourceMap, sourceCode, preserveBlankLines, FORMAT_MINIFY, FORMAT_DEFAULTS; estraverse = require_estraverse(); esutils = require_utils3(); Syntax = estraverse.Syntax; function isExpression(node) { return CodeGenerator.Expression.hasOwnProperty(node.type); } function isStatement(node) { return CodeGenerator.Statement.hasOwnProperty(node.type); } Precedence = { Sequence: 0, Yield: 1, Assignment: 1, Conditional: 2, ArrowFunction: 2, Coalesce: 3, LogicalOR: 4, LogicalAND: 5, BitwiseOR: 6, BitwiseXOR: 7, BitwiseAND: 8, Equality: 9, Relational: 10, BitwiseSHIFT: 11, Additive: 12, Multiplicative: 13, Exponentiation: 14, Await: 15, Unary: 15, Postfix: 16, OptionalChaining: 17, Call: 18, New: 19, TaggedTemplate: 20, Member: 21, Primary: 22 }; BinaryPrecedence = { "??": Precedence.Coalesce, "||": Precedence.LogicalOR, "&&": Precedence.LogicalAND, "|": Precedence.BitwiseOR, "^": Precedence.BitwiseXOR, "&": Precedence.BitwiseAND, "==": Precedence.Equality, "!=": Precedence.Equality, "===": Precedence.Equality, "!==": Precedence.Equality, "is": Precedence.Equality, "isnt": Precedence.Equality, "<": Precedence.Relational, ">": Precedence.Relational, "<=": Precedence.Relational, ">=": Precedence.Relational, "in": Precedence.Relational, "instanceof": Precedence.Relational, "<<": Precedence.BitwiseSHIFT, ">>": Precedence.BitwiseSHIFT, ">>>": Precedence.BitwiseSHIFT, "+": Precedence.Additive, "-": Precedence.Additive, "*": Precedence.Multiplicative, "%": Precedence.Multiplicative, "/": Precedence.Multiplicative, "**": Precedence.Exponentiation }; var F_ALLOW_IN = 1, F_ALLOW_CALL = 1 << 1, F_ALLOW_UNPARATH_NEW = 1 << 2, F_FUNC_BODY = 1 << 3, F_DIRECTIVE_CTX = 1 << 4, F_SEMICOLON_OPT = 1 << 5, F_FOUND_COALESCE = 1 << 6; var E_FTT = F_ALLOW_CALL | F_ALLOW_UNPARATH_NEW, E_TTF = F_ALLOW_IN | F_ALLOW_CALL, E_TTT = F_ALLOW_IN | F_ALLOW_CALL | F_ALLOW_UNPARATH_NEW, E_TFF = F_ALLOW_IN, E_FFT = F_ALLOW_UNPARATH_NEW, E_TFT = F_ALLOW_IN | F_ALLOW_UNPARATH_NEW; var S_TFFF = F_ALLOW_IN, S_TFFT = F_ALLOW_IN | F_SEMICOLON_OPT, S_FFFF = 0, S_TFTF = F_ALLOW_IN | F_DIRECTIVE_CTX, S_TTFF = F_ALLOW_IN | F_FUNC_BODY; function getDefaultOptions() { return { indent: null, base: null, parse: null, comment: false, format: { indent: { style: " ", base: 0, adjustMultilineComment: false }, newline: "\n", space: " ", json: false, renumber: false, hexadecimal: false, quotes: "single", escapeless: false, compact: false, parentheses: true, semicolons: true, safeConcatenation: false, preserveBlankLines: false }, moz: { comprehensionExpressionStartsWithAssignment: false, starlessGenerator: false }, sourceMap: null, sourceMapRoot: null, sourceMapWithCode: false, directive: false, raw: true, verbatim: null, sourceCode: null }; } function stringRepeat(str, num) { var result = ""; for (num |= 0; num > 0; num >>>= 1, str += str) { if (num & 1) { result += str; } } return result; } function hasLineTerminator(str) { return /[\r\n]/g.test(str); } function endsWithLineTerminator(str) { var len = str.length; return len && esutils.code.isLineTerminator(str.charCodeAt(len - 1)); } function merge(target, override) { var key; for (key in override) { if (override.hasOwnProperty(key)) { target[key] = override[key]; } } return target; } function updateDeeply(target, override) { var key, val; function isHashObject(target2) { return typeof target2 === "object" && target2 instanceof Object && !(target2 instanceof RegExp); } for (key in override) { if (override.hasOwnProperty(key)) { val = override[key]; if (isHashObject(val)) { if (isHashObject(target[key])) { updateDeeply(target[key], val); } else { target[key] = updateDeeply({}, val); } } else { target[key] = val; } } } return target; } function generateNumber(value) { var result, point, temp, exponent, pos; if (value !== value) { throw new Error("Numeric literal whose value is NaN"); } if (value < 0 || value === 0 && 1 / value < 0) { throw new Error("Numeric literal whose value is negative"); } if (value === 1 / 0) { return json ? "null" : renumber ? "1e400" : "1e+400"; } result = "" + value; if (!renumber || result.length < 3) { return result; } point = result.indexOf("."); if (!json && result.charCodeAt(0) === 48 && point === 1) { point = 0; result = result.slice(1); } temp = result; result = result.replace("e+", "e"); exponent = 0; if ((pos = temp.indexOf("e")) > 0) { exponent = +temp.slice(pos + 1); temp = temp.slice(0, pos); } if (point >= 0) { exponent -= temp.length - point - 1; temp = +(temp.slice(0, point) + temp.slice(point + 1)) + ""; } pos = 0; while (temp.charCodeAt(temp.length + pos - 1) === 48) { --pos; } if (pos !== 0) { exponent -= pos; temp = temp.slice(0, pos); } if (exponent !== 0) { temp += "e" + exponent; } if ((temp.length < result.length || hexadecimal && value > 1e12 && Math.floor(value) === value && (temp = "0x" + value.toString(16)).length < result.length) && +temp === value) { result = temp; } return result; } function escapeRegExpCharacter(ch, previousIsBackslash) { if ((ch & ~1) === 8232) { return (previousIsBackslash ? "u" : "\\u") + (ch === 8232 ? "2028" : "2029"); } else if (ch === 10 || ch === 13) { return (previousIsBackslash ? "" : "\\") + (ch === 10 ? "n" : "r"); } return String.fromCharCode(ch); } function generateRegExp(reg) { var match, result, flags, i5, iz, ch, characterInBrack, previousIsBackslash; result = reg.toString(); if (reg.source) { match = result.match(/\/([^/]*)$/); if (!match) { return result; } flags = match[1]; result = ""; characterInBrack = false; previousIsBackslash = false; for (i5 = 0, iz = reg.source.length; i5 < iz; ++i5) { ch = reg.source.charCodeAt(i5); if (!previousIsBackslash) { if (characterInBrack) { if (ch === 93) { characterInBrack = false; } } else { if (ch === 47) { result += "\\"; } else if (ch === 91) { characterInBrack = true; } } result += escapeRegExpCharacter(ch, previousIsBackslash); previousIsBackslash = ch === 92; } else { result += escapeRegExpCharacter(ch, previousIsBackslash); previousIsBackslash = false; } } return "/" + result + "/" + flags; } return result; } function escapeAllowedCharacter(code, next) { var hex; if (code === 8) { return "\\b"; } if (code === 12) { return "\\f"; } if (code === 9) { return "\\t"; } hex = code.toString(16).toUpperCase(); if (json || code > 255) { return "\\u" + "0000".slice(hex.length) + hex; } else if (code === 0 && !esutils.code.isDecimalDigit(next)) { return "\\0"; } else if (code === 11) { return "\\x0B"; } else { return "\\x" + "00".slice(hex.length) + hex; } } function escapeDisallowedCharacter(code) { if (code === 92) { return "\\\\"; } if (code === 10) { return "\\n"; } if (code === 13) { return "\\r"; } if (code === 8232) { return "\\u2028"; } if (code === 8233) { return "\\u2029"; } throw new Error("Incorrectly classified character"); } function escapeDirective(str) { var i5, iz, code, quote; quote = quotes === "double" ? '"' : "'"; for (i5 = 0, iz = str.length; i5 < iz; ++i5) { code = str.charCodeAt(i5); if (code === 39) { quote = '"'; break; } else if (code === 34) { quote = "'"; break; } else if (code === 92) { ++i5; } } return quote + str + quote; } function escapeString(str) { var result = "", i5, len, code, singleQuotes = 0, doubleQuotes = 0, single, quote; for (i5 = 0, len = str.length; i5 < len; ++i5) { code = str.charCodeAt(i5); if (code === 39) { ++singleQuotes; } else if (code === 34) { ++doubleQuotes; } else if (code === 47 && json) { result += "\\"; } else if (esutils.code.isLineTerminator(code) || code === 92) { result += escapeDisallowedCharacter(code); continue; } else if (!esutils.code.isIdentifierPartES5(code) && (json && code < 32 || !json && !escapeless && (code < 32 || code > 126))) { result += escapeAllowedCharacter(code, str.charCodeAt(i5 + 1)); continue; } result += String.fromCharCode(code); } single = !(quotes === "double" || quotes === "auto" && doubleQuotes < singleQuotes); quote = single ? "'" : '"'; if (!(single ? singleQuotes : doubleQuotes)) { return quote + result + quote; } str = result; result = quote; for (i5 = 0, len = str.length; i5 < len; ++i5) { code = str.charCodeAt(i5); if (code === 39 && single || code === 34 && !single) { result += "\\"; } result += String.fromCharCode(code); } return result + quote; } function flattenToString(arr) { var i5, iz, elem, result = ""; for (i5 = 0, iz = arr.length; i5 < iz; ++i5) { elem = arr[i5]; result += Array.isArray(elem) ? flattenToString(elem) : elem; } return result; } function toSourceNodeWhenNeeded(generated, node) { if (!sourceMap) { if (Array.isArray(generated)) { return flattenToString(generated); } else { return generated; } } if (node == null) { if (generated instanceof SourceNode) { return generated; } else { node = {}; } } if (node.loc == null) { return new SourceNode(null, null, sourceMap, generated, node.name || null); } return new SourceNode(node.loc.start.line, node.loc.start.column, sourceMap === true ? node.loc.source || null : sourceMap, generated, node.name || null); } function noEmptySpace() { return space ? space : " "; } function join2(left, right) { var leftSource, rightSource, leftCharCode, rightCharCode; leftSource = toSourceNodeWhenNeeded(left).toString(); if (leftSource.length === 0) { return [right]; } rightSource = toSourceNodeWhenNeeded(right).toString(); if (rightSource.length === 0) { return [left]; } leftCharCode = leftSource.charCodeAt(leftSource.length - 1); rightCharCode = rightSource.charCodeAt(0); if ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode) || leftCharCode === 47 && rightCharCode === 105) { return [left, noEmptySpace(), right]; } else if (esutils.code.isWhiteSpace(leftCharCode) || esutils.code.isLineTerminator(leftCharCode) || esutils.code.isWhiteSpace(rightCharCode) || esutils.code.isLineTerminator(rightCharCode)) { return [left, right]; } return [left, space, right]; } function addIndent(stmt) { return [base, stmt]; } function withIndent(fn) { var previousBase; previousBase = base; base += indent; fn(base); base = previousBase; } function calculateSpaces(str) { var i5; for (i5 = str.length - 1; i5 >= 0; --i5) { if (esutils.code.isLineTerminator(str.charCodeAt(i5))) { break; } } return str.length - 1 - i5; } function adjustMultilineComment(value, specialBase) { var array, i5, len, line, j5, spaces, previousBase, sn; array = value.split(/\r\n|[\r\n]/); spaces = Number.MAX_VALUE; for (i5 = 1, len = array.length; i5 < len; ++i5) { line = array[i5]; j5 = 0; while (j5 < line.length && esutils.code.isWhiteSpace(line.charCodeAt(j5))) { ++j5; } if (spaces > j5) { spaces = j5; } } if (typeof specialBase !== "undefined") { previousBase = base; if (array[1][spaces] === "*") { specialBase += " "; } base = specialBase; } else { if (spaces & 1) { --spaces; } previousBase = base; } for (i5 = 1, len = array.length; i5 < len; ++i5) { sn = toSourceNodeWhenNeeded(addIndent(array[i5].slice(spaces))); array[i5] = sourceMap ? sn.join("") : sn; } base = previousBase; return array.join("\n"); } function generateComment(comment, specialBase) { if (comment.type === "Line") { if (endsWithLineTerminator(comment.value)) { return "//" + comment.value; } else { var result = "//" + comment.value; if (!preserveBlankLines) { result += "\n"; } return result; } } if (extra.format.indent.adjustMultilineComment && /[\n\r]/.test(comment.value)) { return adjustMultilineComment("/*" + comment.value + "*/", specialBase); } return "/*" + comment.value + "*/"; } function addComments(stmt, result) { var i5, len, comment, save, tailingToStatement, specialBase, fragment, extRange, range2, prevRange, prefix, infix, suffix, count; if (stmt.leadingComments && stmt.leadingComments.length > 0) { save = result; if (preserveBlankLines) { comment = stmt.leadingComments[0]; result = []; extRange = comment.extendedRange; range2 = comment.range; prefix = sourceCode.substring(extRange[0], range2[0]); count = (prefix.match(/\n/g) || []).length; if (count > 0) { result.push(stringRepeat("\n", count)); result.push(addIndent(generateComment(comment))); } else { result.push(prefix); result.push(generateComment(comment)); } prevRange = range2; for (i5 = 1, len = stmt.leadingComments.length; i5 < len; i5++) { comment = stmt.leadingComments[i5]; range2 = comment.range; infix = sourceCode.substring(prevRange[1], range2[0]); count = (infix.match(/\n/g) || []).length; result.push(stringRepeat("\n", count)); result.push(addIndent(generateComment(comment))); prevRange = range2; } suffix = sourceCode.substring(range2[1], extRange[1]); count = (suffix.match(/\n/g) || []).length; result.push(stringRepeat("\n", count)); } else { comment = stmt.leadingComments[0]; result = []; if (safeConcatenation && stmt.type === Syntax.Program && stmt.body.length === 0) { result.push("\n"); } result.push(generateComment(comment)); if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { result.push("\n"); } for (i5 = 1, len = stmt.leadingComments.length; i5 < len; ++i5) { comment = stmt.leadingComments[i5]; fragment = [generateComment(comment)]; if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { fragment.push("\n"); } result.push(addIndent(fragment)); } } result.push(addIndent(save)); } if (stmt.trailingComments) { if (preserveBlankLines) { comment = stmt.trailingComments[0]; extRange = comment.extendedRange; range2 = comment.range; prefix = sourceCode.substring(extRange[0], range2[0]); count = (prefix.match(/\n/g) || []).length; if (count > 0) { result.push(stringRepeat("\n", count)); result.push(addIndent(generateComment(comment))); } else { result.push(prefix); result.push(generateComment(comment)); } } else { tailingToStatement = !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()); specialBase = stringRepeat(" ", calculateSpaces(toSourceNodeWhenNeeded([base, result, indent]).toString())); for (i5 = 0, len = stmt.trailingComments.length; i5 < len; ++i5) { comment = stmt.trailingComments[i5]; if (tailingToStatement) { if (i5 === 0) { result = [result, indent]; } else { result = [result, specialBase]; } result.push(generateComment(comment, specialBase)); } else { result = [result, addIndent(generateComment(comment))]; } if (i5 !== len - 1 && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { result = [result, "\n"]; } } } } return result; } function generateBlankLines(start, end, result) { var j5, newlineCount = 0; for (j5 = start; j5 < end; j5++) { if (sourceCode[j5] === "\n") { newlineCount++; } } for (j5 = 1; j5 < newlineCount; j5++) { result.push(newline); } } function parenthesize(text, current, should) { if (current < should) { return ["(", text, ")"]; } return text; } function generateVerbatimString(string) { var i5, iz, result; result = string.split(/\r\n|\n/); for (i5 = 1, iz = result.length; i5 < iz; i5++) { result[i5] = newline + base + result[i5]; } return result; } function generateVerbatim(expr, precedence) { var verbatim, result, prec; verbatim = expr[extra.verbatim]; if (typeof verbatim === "string") { result = parenthesize(generateVerbatimString(verbatim), Precedence.Sequence, precedence); } else { result = generateVerbatimString(verbatim.content); prec = verbatim.precedence != null ? verbatim.precedence : Precedence.Sequence; result = parenthesize(result, prec, precedence); } return toSourceNodeWhenNeeded(result, expr); } function CodeGenerator() { } CodeGenerator.prototype.maybeBlock = function(stmt, flags) { var result, noLeadingComment, that = this; noLeadingComment = !extra.comment || !stmt.leadingComments; if (stmt.type === Syntax.BlockStatement && noLeadingComment) { return [space, this.generateStatement(stmt, flags)]; } if (stmt.type === Syntax.EmptyStatement && noLeadingComment) { return ";"; } withIndent(function() { result = [ newline, addIndent(that.generateStatement(stmt, flags)) ]; }); return result; }; CodeGenerator.prototype.maybeBlockSuffix = function(stmt, result) { var ends = endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString()); if (stmt.type === Syntax.BlockStatement && (!extra.comment || !stmt.leadingComments) && !ends) { return [result, space]; } if (ends) { return [result, base]; } return [result, newline, base]; }; function generateIdentifier(node) { return toSourceNodeWhenNeeded(node.name, node); } function generateAsyncPrefix(node, spaceRequired) { return node.async ? "async" + (spaceRequired ? noEmptySpace() : space) : ""; } function generateStarSuffix(node) { var isGenerator = node.generator && !extra.moz.starlessGenerator; return isGenerator ? "*" + space : ""; } function generateMethodPrefix(prop) { var func = prop.value, prefix = ""; if (func.async) { prefix += generateAsyncPrefix(func, !prop.computed); } if (func.generator) { prefix += generateStarSuffix(func) ? "*" : ""; } return prefix; } CodeGenerator.prototype.generatePattern = function(node, precedence, flags) { if (node.type === Syntax.Identifier) { return generateIdentifier(node); } return this.generateExpression(node, precedence, flags); }; CodeGenerator.prototype.generateFunctionParams = function(node) { var i5, iz, result, hasDefault; hasDefault = false; if (node.type === Syntax.ArrowFunctionExpression && !node.rest && (!node.defaults || node.defaults.length === 0) && node.params.length === 1 && node.params[0].type === Syntax.Identifier) { result = [generateAsyncPrefix(node, true), generateIdentifier(node.params[0])]; } else { result = node.type === Syntax.ArrowFunctionExpression ? [generateAsyncPrefix(node, false)] : []; result.push("("); if (node.defaults) { hasDefault = true; } for (i5 = 0, iz = node.params.length; i5 < iz; ++i5) { if (hasDefault && node.defaults[i5]) { result.push(this.generateAssignment(node.params[i5], node.defaults[i5], "=", Precedence.Assignment, E_TTT)); } else { result.push(this.generatePattern(node.params[i5], Precedence.Assignment, E_TTT)); } if (i5 + 1 < iz) { result.push("," + space); } } if (node.rest) { if (node.params.length) { result.push("," + space); } result.push("..."); result.push(generateIdentifier(node.rest)); } result.push(")"); } return result; }; CodeGenerator.prototype.generateFunctionBody = function(node) { var result, expr; result = this.generateFunctionParams(node); if (node.type === Syntax.ArrowFunctionExpression) { result.push(space); result.push("=>"); } if (node.expression) { result.push(space); expr = this.generateExpression(node.body, Precedence.Assignment, E_TTT); if (expr.toString().charAt(0) === "{") { expr = ["(", expr, ")"]; } result.push(expr); } else { result.push(this.maybeBlock(node.body, S_TTFF)); } return result; }; CodeGenerator.prototype.generateIterationForStatement = function(operator, stmt, flags) { var result = ["for" + (stmt.await ? noEmptySpace() + "await" : "") + space + "("], that = this; withIndent(function() { if (stmt.left.type === Syntax.VariableDeclaration) { withIndent(function() { result.push(stmt.left.kind + noEmptySpace()); result.push(that.generateStatement(stmt.left.declarations[0], S_FFFF)); }); } else { result.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT)); } result = join2(result, operator); result = [join2( result, that.generateExpression(stmt.right, Precedence.Assignment, E_TTT) ), ")"]; }); result.push(this.maybeBlock(stmt.body, flags)); return result; }; CodeGenerator.prototype.generatePropertyKey = function(expr, computed) { var result = []; if (computed) { result.push("["); } result.push(this.generateExpression(expr, Precedence.Assignment, E_TTT)); if (computed) { result.push("]"); } return result; }; CodeGenerator.prototype.generateAssignment = function(left, right, operator, precedence, flags) { if (Precedence.Assignment < precedence) { flags |= F_ALLOW_IN; } return parenthesize( [ this.generateExpression(left, Precedence.Call, flags), space + operator + space, this.generateExpression(right, Precedence.Assignment, flags) ], Precedence.Assignment, precedence ); }; CodeGenerator.prototype.semicolon = function(flags) { if (!semicolons && flags & F_SEMICOLON_OPT) { return ""; } return ";"; }; CodeGenerator.Statement = { BlockStatement: function(stmt, flags) { var range2, content, result = ["{", newline], that = this; withIndent(function() { if (stmt.body.length === 0 && preserveBlankLines) { range2 = stmt.range; if (range2[1] - range2[0] > 2) { content = sourceCode.substring(range2[0] + 1, range2[1] - 1); if (content[0] === "\n") { result = ["{"]; } result.push(content); } } var i5, iz, fragment, bodyFlags; bodyFlags = S_TFFF; if (flags & F_FUNC_BODY) { bodyFlags |= F_DIRECTIVE_CTX; } for (i5 = 0, iz = stmt.body.length; i5 < iz; ++i5) { if (preserveBlankLines) { if (i5 === 0) { if (stmt.body[0].leadingComments) { range2 = stmt.body[0].leadingComments[0].extendedRange; content = sourceCode.substring(range2[0], range2[1]); if (content[0] === "\n") { result = ["{"]; } } if (!stmt.body[0].leadingComments) { generateBlankLines(stmt.range[0], stmt.body[0].range[0], result); } } if (i5 > 0) { if (!stmt.body[i5 - 1].trailingComments && !stmt.body[i5].leadingComments) { generateBlankLines(stmt.body[i5 - 1].range[1], stmt.body[i5].range[0], result); } } } if (i5 === iz - 1) { bodyFlags |= F_SEMICOLON_OPT; } if (stmt.body[i5].leadingComments && preserveBlankLines) { fragment = that.generateStatement(stmt.body[i5], bodyFlags); } else { fragment = addIndent(that.generateStatement(stmt.body[i5], bodyFlags)); } result.push(fragment); if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { if (preserveBlankLines && i5 < iz - 1) { if (!stmt.body[i5 + 1].leadingComments) { result.push(newline); } } else { result.push(newline); } } if (preserveBlankLines) { if (i5 === iz - 1) { if (!stmt.body[i5].trailingComments) { generateBlankLines(stmt.body[i5].range[1], stmt.range[1], result); } } } } }); result.push(addIndent("}")); return result; }, BreakStatement: function(stmt, flags) { if (stmt.label) { return "break " + stmt.label.name + this.semicolon(flags); } return "break" + this.semicolon(flags); }, ContinueStatement: function(stmt, flags) { if (stmt.label) { return "continue " + stmt.label.name + this.semicolon(flags); } return "continue" + this.semicolon(flags); }, ClassBody: function(stmt, flags) { var result = ["{", newline], that = this; withIndent(function(indent2) { var i5, iz; for (i5 = 0, iz = stmt.body.length; i5 < iz; ++i5) { result.push(indent2); result.push(that.generateExpression(stmt.body[i5], Precedence.Sequence, E_TTT)); if (i5 + 1 < iz) { result.push(newline); } } }); if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { result.push(newline); } result.push(base); result.push("}"); return result; }, ClassDeclaration: function(stmt, flags) { var result, fragment; result = ["class"]; if (stmt.id) { result = join2(result, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT)); } if (stmt.superClass) { fragment = join2("extends", this.generateExpression(stmt.superClass, Precedence.Unary, E_TTT)); result = join2(result, fragment); } result.push(space); result.push(this.generateStatement(stmt.body, S_TFFT)); return result; }, DirectiveStatement: function(stmt, flags) { if (extra.raw && stmt.raw) { return stmt.raw + this.semicolon(flags); } return escapeDirective(stmt.directive) + this.semicolon(flags); }, DoWhileStatement: function(stmt, flags) { var result = join2("do", this.maybeBlock(stmt.body, S_TFFF)); result = this.maybeBlockSuffix(stmt.body, result); return join2(result, [ "while" + space + "(", this.generateExpression(stmt.test, Precedence.Sequence, E_TTT), ")" + this.semicolon(flags) ]); }, CatchClause: function(stmt, flags) { var result, that = this; withIndent(function() { var guard; if (stmt.param) { result = [ "catch" + space + "(", that.generateExpression(stmt.param, Precedence.Sequence, E_TTT), ")" ]; if (stmt.guard) { guard = that.generateExpression(stmt.guard, Precedence.Sequence, E_TTT); result.splice(2, 0, " if ", guard); } } else { result = ["catch"]; } }); result.push(this.maybeBlock(stmt.body, S_TFFF)); return result; }, DebuggerStatement: function(stmt, flags) { return "debugger" + this.semicolon(flags); }, EmptyStatement: function(stmt, flags) { return ";"; }, ExportDefaultDeclaration: function(stmt, flags) { var result = ["export"], bodyFlags; bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF; result = join2(result, "default"); if (isStatement(stmt.declaration)) { result = join2(result, this.generateStatement(stmt.declaration, bodyFlags)); } else { result = join2(result, this.generateExpression(stmt.declaration, Precedence.Assignment, E_TTT) + this.semicolon(flags)); } return result; }, ExportNamedDeclaration: function(stmt, flags) { var result = ["export"], bodyFlags, that = this; bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF; if (stmt.declaration) { return join2(result, this.generateStatement(stmt.declaration, bodyFlags)); } if (stmt.specifiers) { if (stmt.specifiers.length === 0) { result = join2(result, "{" + space + "}"); } else if (stmt.specifiers[0].type === Syntax.ExportBatchSpecifier) { result = join2(result, this.generateExpression(stmt.specifiers[0], Precedence.Sequence, E_TTT)); } else { result = join2(result, "{"); withIndent(function(indent2) { var i5, iz; result.push(newline); for (i5 = 0, iz = stmt.specifiers.length; i5 < iz; ++i5) { result.push(indent2); result.push(that.generateExpression(stmt.specifiers[i5], Precedence.Sequence, E_TTT)); if (i5 + 1 < iz) { result.push("," + newline); } } }); if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { result.push(newline); } result.push(base + "}"); } if (stmt.source) { result = join2(result, [ "from" + space, // ModuleSpecifier this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), this.semicolon(flags) ]); } else { result.push(this.semicolon(flags)); } } return result; }, ExportAllDeclaration: function(stmt, flags) { return [ "export" + space, "*" + space, "from" + space, // ModuleSpecifier this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), this.semicolon(flags) ]; }, ExpressionStatement: function(stmt, flags) { var result, fragment; function isClassPrefixed(fragment2) { var code; if (fragment2.slice(0, 5) !== "class") { return false; } code = fragment2.charCodeAt(5); return code === 123 || esutils.code.isWhiteSpace(code) || esutils.code.isLineTerminator(code); } function isFunctionPrefixed(fragment2) { var code; if (fragment2.slice(0, 8) !== "function") { return false; } code = fragment2.charCodeAt(8); return code === 40 || esutils.code.isWhiteSpace(code) || code === 42 || esutils.code.isLineTerminator(code); } function isAsyncPrefixed(fragment2) { var code, i5, iz; if (fragment2.slice(0, 5) !== "async") { return false; } if (!esutils.code.isWhiteSpace(fragment2.charCodeAt(5))) { return false; } for (i5 = 6, iz = fragment2.length; i5 < iz; ++i5) { if (!esutils.code.isWhiteSpace(fragment2.charCodeAt(i5))) { break; } } if (i5 === iz) { return false; } if (fragment2.slice(i5, i5 + 8) !== "function") { return false; } code = fragment2.charCodeAt(i5 + 8); return code === 40 || esutils.code.isWhiteSpace(code) || code === 42 || esutils.code.isLineTerminator(code); } result = [this.generateExpression(stmt.expression, Precedence.Sequence, E_TTT)]; fragment = toSourceNodeWhenNeeded(result).toString(); if (fragment.charCodeAt(0) === 123 || // ObjectExpression isClassPrefixed(fragment) || isFunctionPrefixed(fragment) || isAsyncPrefixed(fragment) || directive && flags & F_DIRECTIVE_CTX && stmt.expression.type === Syntax.Literal && typeof stmt.expression.value === "string") { result = ["(", result, ")" + this.semicolon(flags)]; } else { result.push(this.semicolon(flags)); } return result; }, ImportDeclaration: function(stmt, flags) { var result, cursor2, that = this; if (stmt.specifiers.length === 0) { return [ "import", space, // ModuleSpecifier this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), this.semicolon(flags) ]; } result = [ "import" ]; cursor2 = 0; if (stmt.specifiers[cursor2].type === Syntax.ImportDefaultSpecifier) { result = join2(result, [ this.generateExpression(stmt.specifiers[cursor2], Precedence.Sequence, E_TTT) ]); ++cursor2; } if (stmt.specifiers[cursor2]) { if (cursor2 !== 0) { result.push(","); } if (stmt.specifiers[cursor2].type === Syntax.ImportNamespaceSpecifier) { result = join2(result, [ space, this.generateExpression(stmt.specifiers[cursor2], Precedence.Sequence, E_TTT) ]); } else { result.push(space + "{"); if (stmt.specifiers.length - cursor2 === 1) { result.push(space); result.push(this.generateExpression(stmt.specifiers[cursor2], Precedence.Sequence, E_TTT)); result.push(space + "}" + space); } else { withIndent(function(indent2) { var i5, iz; result.push(newline); for (i5 = cursor2, iz = stmt.specifiers.length; i5 < iz; ++i5) { result.push(indent2); result.push(that.generateExpression(stmt.specifiers[i5], Precedence.Sequence, E_TTT)); if (i5 + 1 < iz) { result.push("," + newline); } } }); if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { result.push(newline); } result.push(base + "}" + space); } } } result = join2(result, [ "from" + space, // ModuleSpecifier this.generateExpression(stmt.source, Precedence.Sequence, E_TTT), this.semicolon(flags) ]); return result; }, VariableDeclarator: function(stmt, flags) { var itemFlags = flags & F_ALLOW_IN ? E_TTT : E_FTT; if (stmt.init) { return [ this.generateExpression(stmt.id, Precedence.Assignment, itemFlags), space, "=", space, this.generateExpression(stmt.init, Precedence.Assignment, itemFlags) ]; } return this.generatePattern(stmt.id, Precedence.Assignment, itemFlags); }, VariableDeclaration: function(stmt, flags) { var result, i5, iz, node, bodyFlags, that = this; result = [stmt.kind]; bodyFlags = flags & F_ALLOW_IN ? S_TFFF : S_FFFF; function block() { node = stmt.declarations[0]; if (extra.comment && node.leadingComments) { result.push("\n"); result.push(addIndent(that.generateStatement(node, bodyFlags))); } else { result.push(noEmptySpace()); result.push(that.generateStatement(node, bodyFlags)); } for (i5 = 1, iz = stmt.declarations.length; i5 < iz; ++i5) { node = stmt.declarations[i5]; if (extra.comment && node.leadingComments) { result.push("," + newline); result.push(addIndent(that.generateStatement(node, bodyFlags))); } else { result.push("," + space); result.push(that.generateStatement(node, bodyFlags)); } } } if (stmt.declarations.length > 1) { withIndent(block); } else { block(); } result.push(this.semicolon(flags)); return result; }, ThrowStatement: function(stmt, flags) { return [join2( "throw", this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT) ), this.semicolon(flags)]; }, TryStatement: function(stmt, flags) { var result, i5, iz, guardedHandlers; result = ["try", this.maybeBlock(stmt.block, S_TFFF)]; result = this.maybeBlockSuffix(stmt.block, result); if (stmt.handlers) { for (i5 = 0, iz = stmt.handlers.length; i5 < iz; ++i5) { result = join2(result, this.generateStatement(stmt.handlers[i5], S_TFFF)); if (stmt.finalizer || i5 + 1 !== iz) { result = this.maybeBlockSuffix(stmt.handlers[i5].body, result); } } } else { guardedHandlers = stmt.guardedHandlers || []; for (i5 = 0, iz = guardedHandlers.length; i5 < iz; ++i5) { result = join2(result, this.generateStatement(guardedHandlers[i5], S_TFFF)); if (stmt.finalizer || i5 + 1 !== iz) { result = this.maybeBlockSuffix(guardedHandlers[i5].body, result); } } if (stmt.handler) { if (Array.isArray(stmt.handler)) { for (i5 = 0, iz = stmt.handler.length; i5 < iz; ++i5) { result = join2(result, this.generateStatement(stmt.handler[i5], S_TFFF)); if (stmt.finalizer || i5 + 1 !== iz) { result = this.maybeBlockSuffix(stmt.handler[i5].body, result); } } } else { result = join2(result, this.generateStatement(stmt.handler, S_TFFF)); if (stmt.finalizer) { result = this.maybeBlockSuffix(stmt.handler.body, result); } } } } if (stmt.finalizer) { result = join2(result, ["finally", this.maybeBlock(stmt.finalizer, S_TFFF)]); } return result; }, SwitchStatement: function(stmt, flags) { var result, fragment, i5, iz, bodyFlags, that = this; withIndent(function() { result = [ "switch" + space + "(", that.generateExpression(stmt.discriminant, Precedence.Sequence, E_TTT), ")" + space + "{" + newline ]; }); if (stmt.cases) { bodyFlags = S_TFFF; for (i5 = 0, iz = stmt.cases.length; i5 < iz; ++i5) { if (i5 === iz - 1) { bodyFlags |= F_SEMICOLON_OPT; } fragment = addIndent(this.generateStatement(stmt.cases[i5], bodyFlags)); result.push(fragment); if (!endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { result.push(newline); } } } result.push(addIndent("}")); return result; }, SwitchCase: function(stmt, flags) { var result, fragment, i5, iz, bodyFlags, that = this; withIndent(function() { if (stmt.test) { result = [ join2("case", that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)), ":" ]; } else { result = ["default:"]; } i5 = 0; iz = stmt.consequent.length; if (iz && stmt.consequent[0].type === Syntax.BlockStatement) { fragment = that.maybeBlock(stmt.consequent[0], S_TFFF); result.push(fragment); i5 = 1; } if (i5 !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { result.push(newline); } bodyFlags = S_TFFF; for (; i5 < iz; ++i5) { if (i5 === iz - 1 && flags & F_SEMICOLON_OPT) { bodyFlags |= F_SEMICOLON_OPT; } fragment = addIndent(that.generateStatement(stmt.consequent[i5], bodyFlags)); result.push(fragment); if (i5 + 1 !== iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { result.push(newline); } } }); return result; }, IfStatement: function(stmt, flags) { var result, bodyFlags, semicolonOptional, that = this; withIndent(function() { result = [ "if" + space + "(", that.generateExpression(stmt.test, Precedence.Sequence, E_TTT), ")" ]; }); semicolonOptional = flags & F_SEMICOLON_OPT; bodyFlags = S_TFFF; if (semicolonOptional) { bodyFlags |= F_SEMICOLON_OPT; } if (stmt.alternate) { result.push(this.maybeBlock(stmt.consequent, S_TFFF)); result = this.maybeBlockSuffix(stmt.consequent, result); if (stmt.alternate.type === Syntax.IfStatement) { result = join2(result, ["else ", this.generateStatement(stmt.alternate, bodyFlags)]); } else { result = join2(result, join2("else", this.maybeBlock(stmt.alternate, bodyFlags))); } } else { result.push(this.maybeBlock(stmt.consequent, bodyFlags)); } return result; }, ForStatement: function(stmt, flags) { var result, that = this; withIndent(function() { result = ["for" + space + "("]; if (stmt.init) { if (stmt.init.type === Syntax.VariableDeclaration) { result.push(that.generateStatement(stmt.init, S_FFFF)); } else { result.push(that.generateExpression(stmt.init, Precedence.Sequence, E_FTT)); result.push(";"); } } else { result.push(";"); } if (stmt.test) { result.push(space); result.push(that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)); result.push(";"); } else { result.push(";"); } if (stmt.update) { result.push(space); result.push(that.generateExpression(stmt.update, Precedence.Sequence, E_TTT)); result.push(")"); } else { result.push(")"); } }); result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)); return result; }, ForInStatement: function(stmt, flags) { return this.generateIterationForStatement("in", stmt, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF); }, ForOfStatement: function(stmt, flags) { return this.generateIterationForStatement("of", stmt, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF); }, LabeledStatement: function(stmt, flags) { return [stmt.label.name + ":", this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)]; }, Program: function(stmt, flags) { var result, fragment, i5, iz, bodyFlags; iz = stmt.body.length; result = [safeConcatenation && iz > 0 ? "\n" : ""]; bodyFlags = S_TFTF; for (i5 = 0; i5 < iz; ++i5) { if (!safeConcatenation && i5 === iz - 1) { bodyFlags |= F_SEMICOLON_OPT; } if (preserveBlankLines) { if (i5 === 0) { if (!stmt.body[0].leadingComments) { generateBlankLines(stmt.range[0], stmt.body[i5].range[0], result); } } if (i5 > 0) { if (!stmt.body[i5 - 1].trailingComments && !stmt.body[i5].leadingComments) { generateBlankLines(stmt.body[i5 - 1].range[1], stmt.body[i5].range[0], result); } } } fragment = addIndent(this.generateStatement(stmt.body[i5], bodyFlags)); result.push(fragment); if (i5 + 1 < iz && !endsWithLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { if (preserveBlankLines) { if (!stmt.body[i5 + 1].leadingComments) { result.push(newline); } } else { result.push(newline); } } if (preserveBlankLines) { if (i5 === iz - 1) { if (!stmt.body[i5].trailingComments) { generateBlankLines(stmt.body[i5].range[1], stmt.range[1], result); } } } } return result; }, FunctionDeclaration: function(stmt, flags) { return [ generateAsyncPrefix(stmt, true), "function", generateStarSuffix(stmt) || noEmptySpace(), stmt.id ? generateIdentifier(stmt.id) : "", this.generateFunctionBody(stmt) ]; }, ReturnStatement: function(stmt, flags) { if (stmt.argument) { return [join2( "return", this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT) ), this.semicolon(flags)]; } return ["return" + this.semicolon(flags)]; }, WhileStatement: function(stmt, flags) { var result, that = this; withIndent(function() { result = [ "while" + space + "(", that.generateExpression(stmt.test, Precedence.Sequence, E_TTT), ")" ]; }); result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)); return result; }, WithStatement: function(stmt, flags) { var result, that = this; withIndent(function() { result = [ "with" + space + "(", that.generateExpression(stmt.object, Precedence.Sequence, E_TTT), ")" ]; }); result.push(this.maybeBlock(stmt.body, flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF)); return result; } }; merge(CodeGenerator.prototype, CodeGenerator.Statement); CodeGenerator.Expression = { SequenceExpression: function(expr, precedence, flags) { var result, i5, iz; if (Precedence.Sequence < precedence) { flags |= F_ALLOW_IN; } result = []; for (i5 = 0, iz = expr.expressions.length; i5 < iz; ++i5) { result.push(this.generateExpression(expr.expressions[i5], Precedence.Assignment, flags)); if (i5 + 1 < iz) { result.push("," + space); } } return parenthesize(result, Precedence.Sequence, precedence); }, AssignmentExpression: function(expr, precedence, flags) { return this.generateAssignment(expr.left, expr.right, expr.operator, precedence, flags); }, ArrowFunctionExpression: function(expr, precedence, flags) { return parenthesize(this.generateFunctionBody(expr), Precedence.ArrowFunction, precedence); }, ConditionalExpression: function(expr, precedence, flags) { if (Precedence.Conditional < precedence) { flags |= F_ALLOW_IN; } return parenthesize( [ this.generateExpression(expr.test, Precedence.Coalesce, flags), space + "?" + space, this.generateExpression(expr.consequent, Precedence.Assignment, flags), space + ":" + space, this.generateExpression(expr.alternate, Precedence.Assignment, flags) ], Precedence.Conditional, precedence ); }, LogicalExpression: function(expr, precedence, flags) { if (expr.operator === "??") { flags |= F_FOUND_COALESCE; } return this.BinaryExpression(expr, precedence, flags); }, BinaryExpression: function(expr, precedence, flags) { var result, leftPrecedence, rightPrecedence, currentPrecedence, fragment, leftSource; currentPrecedence = BinaryPrecedence[expr.operator]; leftPrecedence = expr.operator === "**" ? Precedence.Postfix : currentPrecedence; rightPrecedence = expr.operator === "**" ? currentPrecedence : currentPrecedence + 1; if (currentPrecedence < precedence) { flags |= F_ALLOW_IN; } fragment = this.generateExpression(expr.left, leftPrecedence, flags); leftSource = fragment.toString(); if (leftSource.charCodeAt(leftSource.length - 1) === 47 && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0))) { result = [fragment, noEmptySpace(), expr.operator]; } else { result = join2(fragment, expr.operator); } fragment = this.generateExpression(expr.right, rightPrecedence, flags); if (expr.operator === "/" && fragment.toString().charAt(0) === "/" || expr.operator.slice(-1) === "<" && fragment.toString().slice(0, 3) === "!--") { result.push(noEmptySpace()); result.push(fragment); } else { result = join2(result, fragment); } if (expr.operator === "in" && !(flags & F_ALLOW_IN)) { return ["(", result, ")"]; } if ((expr.operator === "||" || expr.operator === "&&") && flags & F_FOUND_COALESCE) { return ["(", result, ")"]; } return parenthesize(result, currentPrecedence, precedence); }, CallExpression: function(expr, precedence, flags) { var result, i5, iz; result = [this.generateExpression(expr.callee, Precedence.Call, E_TTF)]; if (expr.optional) { result.push("?."); } result.push("("); for (i5 = 0, iz = expr["arguments"].length; i5 < iz; ++i5) { result.push(this.generateExpression(expr["arguments"][i5], Precedence.Assignment, E_TTT)); if (i5 + 1 < iz) { result.push("," + space); } } result.push(")"); if (!(flags & F_ALLOW_CALL)) { return ["(", result, ")"]; } return parenthesize(result, Precedence.Call, precedence); }, ChainExpression: function(expr, precedence, flags) { if (Precedence.OptionalChaining < precedence) { flags |= F_ALLOW_CALL; } var result = this.generateExpression(expr.expression, Precedence.OptionalChaining, flags); return parenthesize(result, Precedence.OptionalChaining, precedence); }, NewExpression: function(expr, precedence, flags) { var result, length, i5, iz, itemFlags; length = expr["arguments"].length; itemFlags = flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0 ? E_TFT : E_TFF; result = join2( "new", this.generateExpression(expr.callee, Precedence.New, itemFlags) ); if (!(flags & F_ALLOW_UNPARATH_NEW) || parentheses || length > 0) { result.push("("); for (i5 = 0, iz = length; i5 < iz; ++i5) { result.push(this.generateExpression(expr["arguments"][i5], Precedence.Assignment, E_TTT)); if (i5 + 1 < iz) { result.push("," + space); } } result.push(")"); } return parenthesize(result, Precedence.New, precedence); }, MemberExpression: function(expr, precedence, flags) { var result, fragment; result = [this.generateExpression(expr.object, Precedence.Call, flags & F_ALLOW_CALL ? E_TTF : E_TFF)]; if (expr.computed) { if (expr.optional) { result.push("?."); } result.push("["); result.push(this.generateExpression(expr.property, Precedence.Sequence, flags & F_ALLOW_CALL ? E_TTT : E_TFT)); result.push("]"); } else { if (!expr.optional && expr.object.type === Syntax.Literal && typeof expr.object.value === "number") { fragment = toSourceNodeWhenNeeded(result).toString(); if (fragment.indexOf(".") < 0 && !/[eExX]/.test(fragment) && esutils.code.isDecimalDigit(fragment.charCodeAt(fragment.length - 1)) && !(fragment.length >= 2 && fragment.charCodeAt(0) === 48)) { result.push(" "); } } result.push(expr.optional ? "?." : "."); result.push(generateIdentifier(expr.property)); } return parenthesize(result, Precedence.Member, precedence); }, MetaProperty: function(expr, precedence, flags) { var result; result = []; result.push(typeof expr.meta === "string" ? expr.meta : generateIdentifier(expr.meta)); result.push("."); result.push(typeof expr.property === "string" ? expr.property : generateIdentifier(expr.property)); return parenthesize(result, Precedence.Member, precedence); }, UnaryExpression: function(expr, precedence, flags) { var result, fragment, rightCharCode, leftSource, leftCharCode; fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT); if (space === "") { result = join2(expr.operator, fragment); } else { result = [expr.operator]; if (expr.operator.length > 2) { result = join2(result, fragment); } else { leftSource = toSourceNodeWhenNeeded(result).toString(); leftCharCode = leftSource.charCodeAt(leftSource.length - 1); rightCharCode = fragment.toString().charCodeAt(0); if ((leftCharCode === 43 || leftCharCode === 45) && leftCharCode === rightCharCode || esutils.code.isIdentifierPartES5(leftCharCode) && esutils.code.isIdentifierPartES5(rightCharCode)) { result.push(noEmptySpace()); result.push(fragment); } else { result.push(fragment); } } } return parenthesize(result, Precedence.Unary, precedence); }, YieldExpression: function(expr, precedence, flags) { var result; if (expr.delegate) { result = "yield*"; } else { result = "yield"; } if (expr.argument) { result = join2( result, this.generateExpression(expr.argument, Precedence.Yield, E_TTT) ); } return parenthesize(result, Precedence.Yield, precedence); }, AwaitExpression: function(expr, precedence, flags) { var result = join2( expr.all ? "await*" : "await", this.generateExpression(expr.argument, Precedence.Await, E_TTT) ); return parenthesize(result, Precedence.Await, precedence); }, UpdateExpression: function(expr, precedence, flags) { if (expr.prefix) { return parenthesize( [ expr.operator, this.generateExpression(expr.argument, Precedence.Unary, E_TTT) ], Precedence.Unary, precedence ); } return parenthesize( [ this.generateExpression(expr.argument, Precedence.Postfix, E_TTT), expr.operator ], Precedence.Postfix, precedence ); }, FunctionExpression: function(expr, precedence, flags) { var result = [ generateAsyncPrefix(expr, true), "function" ]; if (expr.id) { result.push(generateStarSuffix(expr) || noEmptySpace()); result.push(generateIdentifier(expr.id)); } else { result.push(generateStarSuffix(expr) || space); } result.push(this.generateFunctionBody(expr)); return result; }, ArrayPattern: function(expr, precedence, flags) { return this.ArrayExpression(expr, precedence, flags, true); }, ArrayExpression: function(expr, precedence, flags, isPattern) { var result, multiline, that = this; if (!expr.elements.length) { return "[]"; } multiline = isPattern ? false : expr.elements.length > 1; result = ["[", multiline ? newline : ""]; withIndent(function(indent2) { var i5, iz; for (i5 = 0, iz = expr.elements.length; i5 < iz; ++i5) { if (!expr.elements[i5]) { if (multiline) { result.push(indent2); } if (i5 + 1 === iz) { result.push(","); } } else { result.push(multiline ? indent2 : ""); result.push(that.generateExpression(expr.elements[i5], Precedence.Assignment, E_TTT)); } if (i5 + 1 < iz) { result.push("," + (multiline ? newline : space)); } } }); if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { result.push(newline); } result.push(multiline ? base : ""); result.push("]"); return result; }, RestElement: function(expr, precedence, flags) { return "..." + this.generatePattern(expr.argument); }, ClassExpression: function(expr, precedence, flags) { var result, fragment; result = ["class"]; if (expr.id) { result = join2(result, this.generateExpression(expr.id, Precedence.Sequence, E_TTT)); } if (expr.superClass) { fragment = join2("extends", this.generateExpression(expr.superClass, Precedence.Unary, E_TTT)); result = join2(result, fragment); } result.push(space); result.push(this.generateStatement(expr.body, S_TFFT)); return result; }, MethodDefinition: function(expr, precedence, flags) { var result, fragment; if (expr["static"]) { result = ["static" + space]; } else { result = []; } if (expr.kind === "get" || expr.kind === "set") { fragment = [ join2(expr.kind, this.generatePropertyKey(expr.key, expr.computed)), this.generateFunctionBody(expr.value) ]; } else { fragment = [ generateMethodPrefix(expr), this.generatePropertyKey(expr.key, expr.computed), this.generateFunctionBody(expr.value) ]; } return join2(result, fragment); }, Property: function(expr, precedence, flags) { if (expr.kind === "get" || expr.kind === "set") { return [ expr.kind, noEmptySpace(), this.generatePropertyKey(expr.key, expr.computed), this.generateFunctionBody(expr.value) ]; } if (expr.shorthand) { if (expr.value.type === "AssignmentPattern") { return this.AssignmentPattern(expr.value, Precedence.Sequence, E_TTT); } return this.generatePropertyKey(expr.key, expr.computed); } if (expr.method) { return [ generateMethodPrefix(expr), this.generatePropertyKey(expr.key, expr.computed), this.generateFunctionBody(expr.value) ]; } return [ this.generatePropertyKey(expr.key, expr.computed), ":" + space, this.generateExpression(expr.value, Precedence.Assignment, E_TTT) ]; }, ObjectExpression: function(expr, precedence, flags) { var multiline, result, fragment, that = this; if (!expr.properties.length) { return "{}"; } multiline = expr.properties.length > 1; withIndent(function() { fragment = that.generateExpression(expr.properties[0], Precedence.Sequence, E_TTT); }); if (!multiline) { if (!hasLineTerminator(toSourceNodeWhenNeeded(fragment).toString())) { return ["{", space, fragment, space, "}"]; } } withIndent(function(indent2) { var i5, iz; result = ["{", newline, indent2, fragment]; if (multiline) { result.push("," + newline); for (i5 = 1, iz = expr.properties.length; i5 < iz; ++i5) { result.push(indent2); result.push(that.generateExpression(expr.properties[i5], Precedence.Sequence, E_TTT)); if (i5 + 1 < iz) { result.push("," + newline); } } } }); if (!endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { result.push(newline); } result.push(base); result.push("}"); return result; }, AssignmentPattern: function(expr, precedence, flags) { return this.generateAssignment(expr.left, expr.right, "=", precedence, flags); }, ObjectPattern: function(expr, precedence, flags) { var result, i5, iz, multiline, property, that = this; if (!expr.properties.length) { return "{}"; } multiline = false; if (expr.properties.length === 1) { property = expr.properties[0]; if (property.type === Syntax.Property && property.value.type !== Syntax.Identifier) { multiline = true; } } else { for (i5 = 0, iz = expr.properties.length; i5 < iz; ++i5) { property = expr.properties[i5]; if (property.type === Syntax.Property && !property.shorthand) { multiline = true; break; } } } result = ["{", multiline ? newline : ""]; withIndent(function(indent2) { var i6, iz2; for (i6 = 0, iz2 = expr.properties.length; i6 < iz2; ++i6) { result.push(multiline ? indent2 : ""); result.push(that.generateExpression(expr.properties[i6], Precedence.Sequence, E_TTT)); if (i6 + 1 < iz2) { result.push("," + (multiline ? newline : space)); } } }); if (multiline && !endsWithLineTerminator(toSourceNodeWhenNeeded(result).toString())) { result.push(newline); } result.push(multiline ? base : ""); result.push("}"); return result; }, ThisExpression: function(expr, precedence, flags) { return "this"; }, Super: function(expr, precedence, flags) { return "super"; }, Identifier: function(expr, precedence, flags) { return generateIdentifier(expr); }, ImportDefaultSpecifier: function(expr, precedence, flags) { return generateIdentifier(expr.id || expr.local); }, ImportNamespaceSpecifier: function(expr, precedence, flags) { var result = ["*"]; var id = expr.id || expr.local; if (id) { result.push(space + "as" + noEmptySpace() + generateIdentifier(id)); } return result; }, ImportSpecifier: function(expr, precedence, flags) { var imported = expr.imported; var result = [imported.name]; var local = expr.local; if (local && local.name !== imported.name) { result.push(noEmptySpace() + "as" + noEmptySpace() + generateIdentifier(local)); } return result; }, ExportSpecifier: function(expr, precedence, flags) { var local = expr.local; var result = [local.name]; var exported = expr.exported; if (exported && exported.name !== local.name) { result.push(noEmptySpace() + "as" + noEmptySpace() + generateIdentifier(exported)); } return result; }, Literal: function(expr, precedence, flags) { var raw; if (expr.hasOwnProperty("raw") && parse && extra.raw) { try { raw = parse(expr.raw).body[0].expression; if (raw.type === Syntax.Literal) { if (raw.value === expr.value) { return expr.raw; } } } catch (e5) { } } if (expr.regex) { return "/" + expr.regex.pattern + "/" + expr.regex.flags; } if (typeof expr.value === "bigint") { return expr.value.toString() + "n"; } if (expr.bigint) { return expr.bigint + "n"; } if (expr.value === null) { return "null"; } if (typeof expr.value === "string") { return escapeString(expr.value); } if (typeof expr.value === "number") { return generateNumber(expr.value); } if (typeof expr.value === "boolean") { return expr.value ? "true" : "false"; } return generateRegExp(expr.value); }, GeneratorExpression: function(expr, precedence, flags) { return this.ComprehensionExpression(expr, precedence, flags); }, ComprehensionExpression: function(expr, precedence, flags) { var result, i5, iz, fragment, that = this; result = expr.type === Syntax.GeneratorExpression ? ["("] : ["["]; if (extra.moz.comprehensionExpressionStartsWithAssignment) { fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT); result.push(fragment); } if (expr.blocks) { withIndent(function() { for (i5 = 0, iz = expr.blocks.length; i5 < iz; ++i5) { fragment = that.generateExpression(expr.blocks[i5], Precedence.Sequence, E_TTT); if (i5 > 0 || extra.moz.comprehensionExpressionStartsWithAssignment) { result = join2(result, fragment); } else { result.push(fragment); } } }); } if (expr.filter) { result = join2(result, "if" + space); fragment = this.generateExpression(expr.filter, Precedence.Sequence, E_TTT); result = join2(result, ["(", fragment, ")"]); } if (!extra.moz.comprehensionExpressionStartsWithAssignment) { fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT); result = join2(result, fragment); } result.push(expr.type === Syntax.GeneratorExpression ? ")" : "]"); return result; }, ComprehensionBlock: function(expr, precedence, flags) { var fragment; if (expr.left.type === Syntax.VariableDeclaration) { fragment = [ expr.left.kind, noEmptySpace(), this.generateStatement(expr.left.declarations[0], S_FFFF) ]; } else { fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT); } fragment = join2(fragment, expr.of ? "of" : "in"); fragment = join2(fragment, this.generateExpression(expr.right, Precedence.Sequence, E_TTT)); return ["for" + space + "(", fragment, ")"]; }, SpreadElement: function(expr, precedence, flags) { return [ "...", this.generateExpression(expr.argument, Precedence.Assignment, E_TTT) ]; }, TaggedTemplateExpression: function(expr, precedence, flags) { var itemFlags = E_TTF; if (!(flags & F_ALLOW_CALL)) { itemFlags = E_TFF; } var result = [ this.generateExpression(expr.tag, Precedence.Call, itemFlags), this.generateExpression(expr.quasi, Precedence.Primary, E_FFT) ]; return parenthesize(result, Precedence.TaggedTemplate, precedence); }, TemplateElement: function(expr, precedence, flags) { return expr.value.raw; }, TemplateLiteral: function(expr, precedence, flags) { var result, i5, iz; result = ["`"]; for (i5 = 0, iz = expr.quasis.length; i5 < iz; ++i5) { result.push(this.generateExpression(expr.quasis[i5], Precedence.Primary, E_TTT)); if (i5 + 1 < iz) { result.push("${" + space); result.push(this.generateExpression(expr.expressions[i5], Precedence.Sequence, E_TTT)); result.push(space + "}"); } } result.push("`"); return result; }, ModuleSpecifier: function(expr, precedence, flags) { return this.Literal(expr, precedence, flags); }, ImportExpression: function(expr, precedence, flag) { return parenthesize([ "import(", this.generateExpression(expr.source, Precedence.Assignment, E_TTT), ")" ], Precedence.Call, precedence); } }; merge(CodeGenerator.prototype, CodeGenerator.Expression); CodeGenerator.prototype.generateExpression = function(expr, precedence, flags) { var result, type; type = expr.type || Syntax.Property; if (extra.verbatim && expr.hasOwnProperty(extra.verbatim)) { return generateVerbatim(expr, precedence); } result = this[type](expr, precedence, flags); if (extra.comment) { result = addComments(expr, result); } return toSourceNodeWhenNeeded(result, expr); }; CodeGenerator.prototype.generateStatement = function(stmt, flags) { var result, fragment; result = this[stmt.type](stmt, flags); if (extra.comment) { result = addComments(stmt, result); } fragment = toSourceNodeWhenNeeded(result).toString(); if (stmt.type === Syntax.Program && !safeConcatenation && newline === "" && fragment.charAt(fragment.length - 1) === "\n") { result = sourceMap ? toSourceNodeWhenNeeded(result).replaceRight(/\s+$/, "") : fragment.replace(/\s+$/, ""); } return toSourceNodeWhenNeeded(result, stmt); }; function generateInternal(node) { var codegen; codegen = new CodeGenerator(); if (isStatement(node)) { return codegen.generateStatement(node, S_TFFF); } if (isExpression(node)) { return codegen.generateExpression(node, Precedence.Sequence, E_TTT); } throw new Error("Unknown node type: " + node.type); } function generate2(node, options) { var defaultOptions = getDefaultOptions(), result, pair; if (options != null) { if (typeof options.indent === "string") { defaultOptions.format.indent.style = options.indent; } if (typeof options.base === "number") { defaultOptions.format.indent.base = options.base; } options = updateDeeply(defaultOptions, options); indent = options.format.indent.style; if (typeof options.base === "string") { base = options.base; } else { base = stringRepeat(indent, options.format.indent.base); } } else { options = defaultOptions; indent = options.format.indent.style; base = stringRepeat(indent, options.format.indent.base); } json = options.format.json; renumber = options.format.renumber; hexadecimal = json ? false : options.format.hexadecimal; quotes = json ? "double" : options.format.quotes; escapeless = options.format.escapeless; newline = options.format.newline; space = options.format.space; if (options.format.compact) { newline = space = indent = base = ""; } parentheses = options.format.parentheses; semicolons = options.format.semicolons; safeConcatenation = options.format.safeConcatenation; directive = options.directive; parse = json ? null : options.parse; sourceMap = options.sourceMap; sourceCode = options.sourceCode; preserveBlankLines = options.format.preserveBlankLines && sourceCode !== null; extra = options; if (sourceMap) { if (!exports2.browser) { SourceNode = require_source_map().SourceNode; } else { SourceNode = global.sourceMap.SourceNode; } } result = generateInternal(node); if (!sourceMap) { pair = { code: result.toString(), map: null }; return options.sourceMapWithCode ? pair : pair.code; } pair = result.toStringWithSourceMap({ file: options.file, sourceRoot: options.sourceMapRoot }); if (options.sourceContent) { pair.map.setSourceContent( options.sourceMap, options.sourceContent ); } if (options.sourceMapWithCode) { return pair; } return pair.map.toString(); } FORMAT_MINIFY = { indent: { style: "", base: 0 }, renumber: true, hexadecimal: true, quotes: "auto", escapeless: true, compact: true, parentheses: false, semicolons: false }; FORMAT_DEFAULTS = getDefaultOptions().format; exports2.version = require_package2().version; exports2.generate = generate2; exports2.attachComments = estraverse.attachComments; exports2.Precedence = updateDeeply({}, Precedence); exports2.browser = false; exports2.FORMAT_MINIFY = FORMAT_MINIFY; exports2.FORMAT_DEFAULTS = FORMAT_DEFAULTS; })(); } }); // node_modules/esprima/dist/esprima.js var require_esprima = __commonJS({ "node_modules/esprima/dist/esprima.js"(exports2, module2) { (function webpackUniversalModuleDefinition(root5, factory) { if (typeof exports2 === "object" && typeof module2 === "object") module2.exports = factory(); else if (typeof define === "function" && define.amd) define([], factory); else if (typeof exports2 === "object") exports2["esprima"] = factory(); else root5["esprima"] = factory(); })(exports2, function() { return ( /******/ (function(modules) { var installedModules = {}; function __webpack_require__(moduleId) { if (installedModules[moduleId]) return installedModules[moduleId].exports; var module3 = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; modules[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__); module3.loaded = true; return module3.exports; } __webpack_require__.m = modules; __webpack_require__.c = installedModules; __webpack_require__.p = ""; return __webpack_require__(0); })([ /* 0 */ /***/ function(module3, exports3, __webpack_require__) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); var comment_handler_1 = __webpack_require__(1); var jsx_parser_1 = __webpack_require__(3); var parser_1 = __webpack_require__(8); var tokenizer_1 = __webpack_require__(15); function parse(code, options, delegate) { var commentHandler = null; var proxyDelegate = function(node, metadata) { if (delegate) { delegate(node, metadata); } if (commentHandler) { commentHandler.visit(node, metadata); } }; var parserDelegate = typeof delegate === "function" ? proxyDelegate : null; var collectComment = false; if (options) { collectComment = typeof options.comment === "boolean" && options.comment; var attachComment = typeof options.attachComment === "boolean" && options.attachComment; if (collectComment || attachComment) { commentHandler = new comment_handler_1.CommentHandler(); commentHandler.attach = attachComment; options.comment = true; parserDelegate = proxyDelegate; } } var isModule = false; if (options && typeof options.sourceType === "string") { isModule = options.sourceType === "module"; } var parser; if (options && typeof options.jsx === "boolean" && options.jsx) { parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); } else { parser = new parser_1.Parser(code, options, parserDelegate); } var program = isModule ? parser.parseModule() : parser.parseScript(); var ast = program; if (collectComment && commentHandler) { ast.comments = commentHandler.comments; } if (parser.config.tokens) { ast.tokens = parser.tokens; } if (parser.config.tolerant) { ast.errors = parser.errorHandler.errors; } return ast; } exports3.parse = parse; function parseModule(code, options, delegate) { var parsingOptions = options || {}; parsingOptions.sourceType = "module"; return parse(code, parsingOptions, delegate); } exports3.parseModule = parseModule; function parseScript2(code, options, delegate) { var parsingOptions = options || {}; parsingOptions.sourceType = "script"; return parse(code, parsingOptions, delegate); } exports3.parseScript = parseScript2; function tokenize(code, options, delegate) { var tokenizer = new tokenizer_1.Tokenizer(code, options); var tokens; tokens = []; try { while (true) { var token = tokenizer.getNextToken(); if (!token) { break; } if (delegate) { token = delegate(token); } tokens.push(token); } } catch (e5) { tokenizer.errorHandler.tolerate(e5); } if (tokenizer.errorHandler.tolerant) { tokens.errors = tokenizer.errors(); } return tokens; } exports3.tokenize = tokenize; var syntax_1 = __webpack_require__(2); exports3.Syntax = syntax_1.Syntax; exports3.version = "4.0.1"; }, /* 1 */ /***/ function(module3, exports3, __webpack_require__) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); var syntax_1 = __webpack_require__(2); var CommentHandler = (function() { function CommentHandler2() { this.attach = false; this.comments = []; this.stack = []; this.leading = []; this.trailing = []; } CommentHandler2.prototype.insertInnerComments = function(node, metadata) { if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { var innerComments = []; for (var i5 = this.leading.length - 1; i5 >= 0; --i5) { var entry = this.leading[i5]; if (metadata.end.offset >= entry.start) { innerComments.unshift(entry.comment); this.leading.splice(i5, 1); this.trailing.splice(i5, 1); } } if (innerComments.length) { node.innerComments = innerComments; } } }; CommentHandler2.prototype.findTrailingComments = function(metadata) { var trailingComments = []; if (this.trailing.length > 0) { for (var i5 = this.trailing.length - 1; i5 >= 0; --i5) { var entry_1 = this.trailing[i5]; if (entry_1.start >= metadata.end.offset) { trailingComments.unshift(entry_1.comment); } } this.trailing.length = 0; return trailingComments; } var entry = this.stack[this.stack.length - 1]; if (entry && entry.node.trailingComments) { var firstComment = entry.node.trailingComments[0]; if (firstComment && firstComment.range[0] >= metadata.end.offset) { trailingComments = entry.node.trailingComments; delete entry.node.trailingComments; } } return trailingComments; }; CommentHandler2.prototype.findLeadingComments = function(metadata) { var leadingComments = []; var target; while (this.stack.length > 0) { var entry = this.stack[this.stack.length - 1]; if (entry && entry.start >= metadata.start.offset) { target = entry.node; this.stack.pop(); } else { break; } } if (target) { var count = target.leadingComments ? target.leadingComments.length : 0; for (var i5 = count - 1; i5 >= 0; --i5) { var comment = target.leadingComments[i5]; if (comment.range[1] <= metadata.start.offset) { leadingComments.unshift(comment); target.leadingComments.splice(i5, 1); } } if (target.leadingComments && target.leadingComments.length === 0) { delete target.leadingComments; } return leadingComments; } for (var i5 = this.leading.length - 1; i5 >= 0; --i5) { var entry = this.leading[i5]; if (entry.start <= metadata.start.offset) { leadingComments.unshift(entry.comment); this.leading.splice(i5, 1); } } return leadingComments; }; CommentHandler2.prototype.visitNode = function(node, metadata) { if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { return; } this.insertInnerComments(node, metadata); var trailingComments = this.findTrailingComments(metadata); var leadingComments = this.findLeadingComments(metadata); if (leadingComments.length > 0) { node.leadingComments = leadingComments; } if (trailingComments.length > 0) { node.trailingComments = trailingComments; } this.stack.push({ node, start: metadata.start.offset }); }; CommentHandler2.prototype.visitComment = function(node, metadata) { var type = node.type[0] === "L" ? "Line" : "Block"; var comment = { type, value: node.value }; if (node.range) { comment.range = node.range; } if (node.loc) { comment.loc = node.loc; } this.comments.push(comment); if (this.attach) { var entry = { comment: { type, value: node.value, range: [metadata.start.offset, metadata.end.offset] }, start: metadata.start.offset }; if (node.loc) { entry.comment.loc = node.loc; } node.type = type; this.leading.push(entry); this.trailing.push(entry); } }; CommentHandler2.prototype.visit = function(node, metadata) { if (node.type === "LineComment") { this.visitComment(node, metadata); } else if (node.type === "BlockComment") { this.visitComment(node, metadata); } else if (this.attach) { this.visitNode(node, metadata); } }; return CommentHandler2; })(); exports3.CommentHandler = CommentHandler; }, /* 2 */ /***/ function(module3, exports3) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); exports3.Syntax = { AssignmentExpression: "AssignmentExpression", AssignmentPattern: "AssignmentPattern", ArrayExpression: "ArrayExpression", ArrayPattern: "ArrayPattern", ArrowFunctionExpression: "ArrowFunctionExpression", AwaitExpression: "AwaitExpression", BlockStatement: "BlockStatement", BinaryExpression: "BinaryExpression", BreakStatement: "BreakStatement", CallExpression: "CallExpression", CatchClause: "CatchClause", ClassBody: "ClassBody", ClassDeclaration: "ClassDeclaration", ClassExpression: "ClassExpression", ConditionalExpression: "ConditionalExpression", ContinueStatement: "ContinueStatement", DoWhileStatement: "DoWhileStatement", DebuggerStatement: "DebuggerStatement", EmptyStatement: "EmptyStatement", ExportAllDeclaration: "ExportAllDeclaration", ExportDefaultDeclaration: "ExportDefaultDeclaration", ExportNamedDeclaration: "ExportNamedDeclaration", ExportSpecifier: "ExportSpecifier", ExpressionStatement: "ExpressionStatement", ForStatement: "ForStatement", ForOfStatement: "ForOfStatement", ForInStatement: "ForInStatement", FunctionDeclaration: "FunctionDeclaration", FunctionExpression: "FunctionExpression", Identifier: "Identifier", IfStatement: "IfStatement", ImportDeclaration: "ImportDeclaration", ImportDefaultSpecifier: "ImportDefaultSpecifier", ImportNamespaceSpecifier: "ImportNamespaceSpecifier", ImportSpecifier: "ImportSpecifier", Literal: "Literal", LabeledStatement: "LabeledStatement", LogicalExpression: "LogicalExpression", MemberExpression: "MemberExpression", MetaProperty: "MetaProperty", MethodDefinition: "MethodDefinition", NewExpression: "NewExpression", ObjectExpression: "ObjectExpression", ObjectPattern: "ObjectPattern", Program: "Program", Property: "Property", RestElement: "RestElement", ReturnStatement: "ReturnStatement", SequenceExpression: "SequenceExpression", SpreadElement: "SpreadElement", Super: "Super", SwitchCase: "SwitchCase", SwitchStatement: "SwitchStatement", TaggedTemplateExpression: "TaggedTemplateExpression", TemplateElement: "TemplateElement", TemplateLiteral: "TemplateLiteral", ThisExpression: "ThisExpression", ThrowStatement: "ThrowStatement", TryStatement: "TryStatement", UnaryExpression: "UnaryExpression", UpdateExpression: "UpdateExpression", VariableDeclaration: "VariableDeclaration", VariableDeclarator: "VariableDeclarator", WhileStatement: "WhileStatement", WithStatement: "WithStatement", YieldExpression: "YieldExpression" }; }, /* 3 */ /***/ function(module3, exports3, __webpack_require__) { "use strict"; var __extends2 = this && this.__extends || (function() { var extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b6) { d5.__proto__ = b6; } || function(d5, b6) { for (var p2 in b6) if (b6.hasOwnProperty(p2)) d5[p2] = b6[p2]; }; return function(d5, b6) { extendStatics2(d5, b6); function __() { this.constructor = d5; } d5.prototype = b6 === null ? Object.create(b6) : (__.prototype = b6.prototype, new __()); }; })(); Object.defineProperty(exports3, "__esModule", { value: true }); var character_1 = __webpack_require__(4); var JSXNode = __webpack_require__(5); var jsx_syntax_1 = __webpack_require__(6); var Node = __webpack_require__(7); var parser_1 = __webpack_require__(8); var token_1 = __webpack_require__(13); var xhtml_entities_1 = __webpack_require__(14); token_1.TokenName[ 100 /* Identifier */ ] = "JSXIdentifier"; token_1.TokenName[ 101 /* Text */ ] = "JSXText"; function getQualifiedElementName(elementName) { var qualifiedName; switch (elementName.type) { case jsx_syntax_1.JSXSyntax.JSXIdentifier: var id = elementName; qualifiedName = id.name; break; case jsx_syntax_1.JSXSyntax.JSXNamespacedName: var ns = elementName; qualifiedName = getQualifiedElementName(ns.namespace) + ":" + getQualifiedElementName(ns.name); break; case jsx_syntax_1.JSXSyntax.JSXMemberExpression: var expr = elementName; qualifiedName = getQualifiedElementName(expr.object) + "." + getQualifiedElementName(expr.property); break; /* istanbul ignore next */ default: break; } return qualifiedName; } var JSXParser = (function(_super) { __extends2(JSXParser2, _super); function JSXParser2(code, options, delegate) { return _super.call(this, code, options, delegate) || this; } JSXParser2.prototype.parsePrimaryExpression = function() { return this.match("<") ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this); }; JSXParser2.prototype.startJSX = function() { this.scanner.index = this.startMarker.index; this.scanner.lineNumber = this.startMarker.line; this.scanner.lineStart = this.startMarker.index - this.startMarker.column; }; JSXParser2.prototype.finishJSX = function() { this.nextToken(); }; JSXParser2.prototype.reenterJSX = function() { this.startJSX(); this.expectJSX("}"); if (this.config.tokens) { this.tokens.pop(); } }; JSXParser2.prototype.createJSXNode = function() { this.collectComments(); return { index: this.scanner.index, line: this.scanner.lineNumber, column: this.scanner.index - this.scanner.lineStart }; }; JSXParser2.prototype.createJSXChildNode = function() { return { index: this.scanner.index, line: this.scanner.lineNumber, column: this.scanner.index - this.scanner.lineStart }; }; JSXParser2.prototype.scanXHTMLEntity = function(quote) { var result = "&"; var valid = true; var terminated = false; var numeric = false; var hex = false; while (!this.scanner.eof() && valid && !terminated) { var ch = this.scanner.source[this.scanner.index]; if (ch === quote) { break; } terminated = ch === ";"; result += ch; ++this.scanner.index; if (!terminated) { switch (result.length) { case 2: numeric = ch === "#"; break; case 3: if (numeric) { hex = ch === "x"; valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0)); numeric = numeric && !hex; } break; default: valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0))); valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0))); break; } } } if (valid && terminated && result.length > 2) { var str = result.substr(1, result.length - 2); if (numeric && str.length > 1) { result = String.fromCharCode(parseInt(str.substr(1), 10)); } else if (hex && str.length > 2) { result = String.fromCharCode(parseInt("0" + str.substr(1), 16)); } else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) { result = xhtml_entities_1.XHTMLEntities[str]; } } return result; }; JSXParser2.prototype.lexJSX = function() { var cp = this.scanner.source.charCodeAt(this.scanner.index); if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) { var value = this.scanner.source[this.scanner.index++]; return { type: 7, value, lineNumber: this.scanner.lineNumber, lineStart: this.scanner.lineStart, start: this.scanner.index - 1, end: this.scanner.index }; } if (cp === 34 || cp === 39) { var start = this.scanner.index; var quote = this.scanner.source[this.scanner.index++]; var str = ""; while (!this.scanner.eof()) { var ch = this.scanner.source[this.scanner.index++]; if (ch === quote) { break; } else if (ch === "&") { str += this.scanXHTMLEntity(quote); } else { str += ch; } } return { type: 8, value: str, lineNumber: this.scanner.lineNumber, lineStart: this.scanner.lineStart, start, end: this.scanner.index }; } if (cp === 46) { var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1); var n22 = this.scanner.source.charCodeAt(this.scanner.index + 2); var value = n1 === 46 && n22 === 46 ? "..." : "."; var start = this.scanner.index; this.scanner.index += value.length; return { type: 7, value, lineNumber: this.scanner.lineNumber, lineStart: this.scanner.lineStart, start, end: this.scanner.index }; } if (cp === 96) { return { type: 10, value: "", lineNumber: this.scanner.lineNumber, lineStart: this.scanner.lineStart, start: this.scanner.index, end: this.scanner.index }; } if (character_1.Character.isIdentifierStart(cp) && cp !== 92) { var start = this.scanner.index; ++this.scanner.index; while (!this.scanner.eof()) { var ch = this.scanner.source.charCodeAt(this.scanner.index); if (character_1.Character.isIdentifierPart(ch) && ch !== 92) { ++this.scanner.index; } else if (ch === 45) { ++this.scanner.index; } else { break; } } var id = this.scanner.source.slice(start, this.scanner.index); return { type: 100, value: id, lineNumber: this.scanner.lineNumber, lineStart: this.scanner.lineStart, start, end: this.scanner.index }; } return this.scanner.lex(); }; JSXParser2.prototype.nextJSXToken = function() { this.collectComments(); this.startMarker.index = this.scanner.index; this.startMarker.line = this.scanner.lineNumber; this.startMarker.column = this.scanner.index - this.scanner.lineStart; var token = this.lexJSX(); this.lastMarker.index = this.scanner.index; this.lastMarker.line = this.scanner.lineNumber; this.lastMarker.column = this.scanner.index - this.scanner.lineStart; if (this.config.tokens) { this.tokens.push(this.convertToken(token)); } return token; }; JSXParser2.prototype.nextJSXText = function() { this.startMarker.index = this.scanner.index; this.startMarker.line = this.scanner.lineNumber; this.startMarker.column = this.scanner.index - this.scanner.lineStart; var start = this.scanner.index; var text = ""; while (!this.scanner.eof()) { var ch = this.scanner.source[this.scanner.index]; if (ch === "{" || ch === "<") { break; } ++this.scanner.index; text += ch; if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { ++this.scanner.lineNumber; if (ch === "\r" && this.scanner.source[this.scanner.index] === "\n") { ++this.scanner.index; } this.scanner.lineStart = this.scanner.index; } } this.lastMarker.index = this.scanner.index; this.lastMarker.line = this.scanner.lineNumber; this.lastMarker.column = this.scanner.index - this.scanner.lineStart; var token = { type: 101, value: text, lineNumber: this.scanner.lineNumber, lineStart: this.scanner.lineStart, start, end: this.scanner.index }; if (text.length > 0 && this.config.tokens) { this.tokens.push(this.convertToken(token)); } return token; }; JSXParser2.prototype.peekJSXToken = function() { var state2 = this.scanner.saveState(); this.scanner.scanComments(); var next = this.lexJSX(); this.scanner.restoreState(state2); return next; }; JSXParser2.prototype.expectJSX = function(value) { var token = this.nextJSXToken(); if (token.type !== 7 || token.value !== value) { this.throwUnexpectedToken(token); } }; JSXParser2.prototype.matchJSX = function(value) { var next = this.peekJSXToken(); return next.type === 7 && next.value === value; }; JSXParser2.prototype.parseJSXIdentifier = function() { var node = this.createJSXNode(); var token = this.nextJSXToken(); if (token.type !== 100) { this.throwUnexpectedToken(token); } return this.finalize(node, new JSXNode.JSXIdentifier(token.value)); }; JSXParser2.prototype.parseJSXElementName = function() { var node = this.createJSXNode(); var elementName = this.parseJSXIdentifier(); if (this.matchJSX(":")) { var namespace = elementName; this.expectJSX(":"); var name_1 = this.parseJSXIdentifier(); elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1)); } else if (this.matchJSX(".")) { while (this.matchJSX(".")) { var object = elementName; this.expectJSX("."); var property = this.parseJSXIdentifier(); elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property)); } } return elementName; }; JSXParser2.prototype.parseJSXAttributeName = function() { var node = this.createJSXNode(); var attributeName; var identifier = this.parseJSXIdentifier(); if (this.matchJSX(":")) { var namespace = identifier; this.expectJSX(":"); var name_2 = this.parseJSXIdentifier(); attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2)); } else { attributeName = identifier; } return attributeName; }; JSXParser2.prototype.parseJSXStringLiteralAttribute = function() { var node = this.createJSXNode(); var token = this.nextJSXToken(); if (token.type !== 8) { this.throwUnexpectedToken(token); } var raw = this.getTokenRaw(token); return this.finalize(node, new Node.Literal(token.value, raw)); }; JSXParser2.prototype.parseJSXExpressionAttribute = function() { var node = this.createJSXNode(); this.expectJSX("{"); this.finishJSX(); if (this.match("}")) { this.tolerateError("JSX attributes must only be assigned a non-empty expression"); } var expression = this.parseAssignmentExpression(); this.reenterJSX(); return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); }; JSXParser2.prototype.parseJSXAttributeValue = function() { return this.matchJSX("{") ? this.parseJSXExpressionAttribute() : this.matchJSX("<") ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute(); }; JSXParser2.prototype.parseJSXNameValueAttribute = function() { var node = this.createJSXNode(); var name = this.parseJSXAttributeName(); var value = null; if (this.matchJSX("=")) { this.expectJSX("="); value = this.parseJSXAttributeValue(); } return this.finalize(node, new JSXNode.JSXAttribute(name, value)); }; JSXParser2.prototype.parseJSXSpreadAttribute = function() { var node = this.createJSXNode(); this.expectJSX("{"); this.expectJSX("..."); this.finishJSX(); var argument = this.parseAssignmentExpression(); this.reenterJSX(); return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument)); }; JSXParser2.prototype.parseJSXAttributes = function() { var attributes = []; while (!this.matchJSX("/") && !this.matchJSX(">")) { var attribute = this.matchJSX("{") ? this.parseJSXSpreadAttribute() : this.parseJSXNameValueAttribute(); attributes.push(attribute); } return attributes; }; JSXParser2.prototype.parseJSXOpeningElement = function() { var node = this.createJSXNode(); this.expectJSX("<"); var name = this.parseJSXElementName(); var attributes = this.parseJSXAttributes(); var selfClosing = this.matchJSX("/"); if (selfClosing) { this.expectJSX("/"); } this.expectJSX(">"); return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); }; JSXParser2.prototype.parseJSXBoundaryElement = function() { var node = this.createJSXNode(); this.expectJSX("<"); if (this.matchJSX("/")) { this.expectJSX("/"); var name_3 = this.parseJSXElementName(); this.expectJSX(">"); return this.finalize(node, new JSXNode.JSXClosingElement(name_3)); } var name = this.parseJSXElementName(); var attributes = this.parseJSXAttributes(); var selfClosing = this.matchJSX("/"); if (selfClosing) { this.expectJSX("/"); } this.expectJSX(">"); return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); }; JSXParser2.prototype.parseJSXEmptyExpression = function() { var node = this.createJSXChildNode(); this.collectComments(); this.lastMarker.index = this.scanner.index; this.lastMarker.line = this.scanner.lineNumber; this.lastMarker.column = this.scanner.index - this.scanner.lineStart; return this.finalize(node, new JSXNode.JSXEmptyExpression()); }; JSXParser2.prototype.parseJSXExpressionContainer = function() { var node = this.createJSXNode(); this.expectJSX("{"); var expression; if (this.matchJSX("}")) { expression = this.parseJSXEmptyExpression(); this.expectJSX("}"); } else { this.finishJSX(); expression = this.parseAssignmentExpression(); this.reenterJSX(); } return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); }; JSXParser2.prototype.parseJSXChildren = function() { var children = []; while (!this.scanner.eof()) { var node = this.createJSXChildNode(); var token = this.nextJSXText(); if (token.start < token.end) { var raw = this.getTokenRaw(token); var child = this.finalize(node, new JSXNode.JSXText(token.value, raw)); children.push(child); } if (this.scanner.source[this.scanner.index] === "{") { var container = this.parseJSXExpressionContainer(); children.push(container); } else { break; } } return children; }; JSXParser2.prototype.parseComplexJSXElement = function(el) { var stack = []; while (!this.scanner.eof()) { el.children = el.children.concat(this.parseJSXChildren()); var node = this.createJSXChildNode(); var element = this.parseJSXBoundaryElement(); if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) { var opening = element; if (opening.selfClosing) { var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null)); el.children.push(child); } else { stack.push(el); el = { node, opening, closing: null, children: [] }; } } if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) { el.closing = element; var open_1 = getQualifiedElementName(el.opening.name); var close_1 = getQualifiedElementName(el.closing.name); if (open_1 !== close_1) { this.tolerateError("Expected corresponding JSX closing tag for %0", open_1); } if (stack.length > 0) { var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing)); el = stack[stack.length - 1]; el.children.push(child); stack.pop(); } else { break; } } } return el; }; JSXParser2.prototype.parseJSXElement = function() { var node = this.createJSXNode(); var opening = this.parseJSXOpeningElement(); var children = []; var closing = null; if (!opening.selfClosing) { var el = this.parseComplexJSXElement({ node, opening, closing, children }); children = el.children; closing = el.closing; } return this.finalize(node, new JSXNode.JSXElement(opening, children, closing)); }; JSXParser2.prototype.parseJSXRoot = function() { if (this.config.tokens) { this.tokens.pop(); } this.startJSX(); var element = this.parseJSXElement(); this.finishJSX(); return element; }; JSXParser2.prototype.isStartOfExpression = function() { return _super.prototype.isStartOfExpression.call(this) || this.match("<"); }; return JSXParser2; })(parser_1.Parser); exports3.JSXParser = JSXParser; }, /* 4 */ /***/ function(module3, exports3) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); var Regex = { // Unicode v8.0.0 NonAsciiIdentifierStart: NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\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F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, // Unicode v8.0.0 NonAsciiIdentifierPart: NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0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E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\u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uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B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86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ }; exports3.Character = { /* tslint:disable:no-bitwise */ fromCodePoint: function(cp) { return cp < 65536 ? String.fromCharCode(cp) : String.fromCharCode(55296 + (cp - 65536 >> 10)) + String.fromCharCode(56320 + (cp - 65536 & 1023)); }, // https://tc39.github.io/ecma262/#sec-white-space isWhiteSpace: function(cp) { return cp === 32 || cp === 9 || cp === 11 || cp === 12 || cp === 160 || cp >= 5760 && [5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279].indexOf(cp) >= 0; }, // https://tc39.github.io/ecma262/#sec-line-terminators isLineTerminator: function(cp) { return cp === 10 || cp === 13 || cp === 8232 || cp === 8233; }, // https://tc39.github.io/ecma262/#sec-names-and-keywords isIdentifierStart: function(cp) { return cp === 36 || cp === 95 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 92 || cp >= 128 && Regex.NonAsciiIdentifierStart.test(exports3.Character.fromCodePoint(cp)); }, isIdentifierPart: function(cp) { return cp === 36 || cp === 95 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp >= 48 && cp <= 57 || cp === 92 || cp >= 128 && Regex.NonAsciiIdentifierPart.test(exports3.Character.fromCodePoint(cp)); }, // https://tc39.github.io/ecma262/#sec-literals-numeric-literals isDecimalDigit: function(cp) { return cp >= 48 && cp <= 57; }, isHexDigit: function(cp) { return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 70 || cp >= 97 && cp <= 102; }, isOctalDigit: function(cp) { return cp >= 48 && cp <= 55; } }; }, /* 5 */ /***/ function(module3, exports3, __webpack_require__) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); var jsx_syntax_1 = __webpack_require__(6); var JSXClosingElement = /* @__PURE__ */ (function() { function JSXClosingElement2(name) { this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement; this.name = name; } return JSXClosingElement2; })(); exports3.JSXClosingElement = JSXClosingElement; var JSXElement = /* @__PURE__ */ (function() { function JSXElement2(openingElement, children, closingElement) { this.type = jsx_syntax_1.JSXSyntax.JSXElement; this.openingElement = openingElement; this.children = children; this.closingElement = closingElement; } return JSXElement2; })(); exports3.JSXElement = JSXElement; var JSXEmptyExpression = /* @__PURE__ */ (function() { function JSXEmptyExpression2() { this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression; } return JSXEmptyExpression2; })(); exports3.JSXEmptyExpression = JSXEmptyExpression; var JSXExpressionContainer = /* @__PURE__ */ (function() { function JSXExpressionContainer2(expression) { this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer; this.expression = expression; } return JSXExpressionContainer2; })(); exports3.JSXExpressionContainer = JSXExpressionContainer; var JSXIdentifier = /* @__PURE__ */ (function() { function JSXIdentifier2(name) { this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier; this.name = name; } return JSXIdentifier2; })(); exports3.JSXIdentifier = JSXIdentifier; var JSXMemberExpression = /* @__PURE__ */ (function() { function JSXMemberExpression2(object, property) { this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression; this.object = object; this.property = property; } return JSXMemberExpression2; })(); exports3.JSXMemberExpression = JSXMemberExpression; var JSXAttribute = /* @__PURE__ */ (function() { function JSXAttribute2(name, value) { this.type = jsx_syntax_1.JSXSyntax.JSXAttribute; this.name = name; this.value = value; } return JSXAttribute2; })(); exports3.JSXAttribute = JSXAttribute; var JSXNamespacedName = /* @__PURE__ */ (function() { function JSXNamespacedName2(namespace, name) { this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName; this.namespace = namespace; this.name = name; } return JSXNamespacedName2; })(); exports3.JSXNamespacedName = JSXNamespacedName; var JSXOpeningElement = /* @__PURE__ */ (function() { function JSXOpeningElement2(name, selfClosing, attributes) { this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement; this.name = name; this.selfClosing = selfClosing; this.attributes = attributes; } return JSXOpeningElement2; })(); exports3.JSXOpeningElement = JSXOpeningElement; var JSXSpreadAttribute = /* @__PURE__ */ (function() { function JSXSpreadAttribute2(argument) { this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute; this.argument = argument; } return JSXSpreadAttribute2; })(); exports3.JSXSpreadAttribute = JSXSpreadAttribute; var JSXText = /* @__PURE__ */ (function() { function JSXText2(value, raw) { this.type = jsx_syntax_1.JSXSyntax.JSXText; this.value = value; this.raw = raw; } return JSXText2; })(); exports3.JSXText = JSXText; }, /* 6 */ /***/ function(module3, exports3) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); exports3.JSXSyntax = { JSXAttribute: "JSXAttribute", JSXClosingElement: "JSXClosingElement", JSXElement: "JSXElement", JSXEmptyExpression: "JSXEmptyExpression", JSXExpressionContainer: "JSXExpressionContainer", JSXIdentifier: "JSXIdentifier", JSXMemberExpression: "JSXMemberExpression", JSXNamespacedName: "JSXNamespacedName", JSXOpeningElement: "JSXOpeningElement", JSXSpreadAttribute: "JSXSpreadAttribute", JSXText: "JSXText" }; }, /* 7 */ /***/ function(module3, exports3, __webpack_require__) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); var syntax_1 = __webpack_require__(2); var ArrayExpression = /* @__PURE__ */ (function() { function ArrayExpression2(elements) { this.type = syntax_1.Syntax.ArrayExpression; this.elements = elements; } return ArrayExpression2; })(); exports3.ArrayExpression = ArrayExpression; var ArrayPattern = /* @__PURE__ */ (function() { function ArrayPattern2(elements) { this.type = syntax_1.Syntax.ArrayPattern; this.elements = elements; } return ArrayPattern2; })(); exports3.ArrayPattern = ArrayPattern; var ArrowFunctionExpression = /* @__PURE__ */ (function() { function ArrowFunctionExpression2(params, body, expression) { this.type = syntax_1.Syntax.ArrowFunctionExpression; this.id = null; this.params = params; this.body = body; this.generator = false; this.expression = expression; this.async = false; } return ArrowFunctionExpression2; })(); exports3.ArrowFunctionExpression = ArrowFunctionExpression; var AssignmentExpression = /* @__PURE__ */ (function() { function AssignmentExpression2(operator, left, right) { this.type = syntax_1.Syntax.AssignmentExpression; this.operator = operator; this.left = left; this.right = right; } return AssignmentExpression2; })(); exports3.AssignmentExpression = AssignmentExpression; var AssignmentPattern = /* @__PURE__ */ (function() { function AssignmentPattern2(left, right) { this.type = syntax_1.Syntax.AssignmentPattern; this.left = left; this.right = right; } return AssignmentPattern2; })(); exports3.AssignmentPattern = AssignmentPattern; var AsyncArrowFunctionExpression = /* @__PURE__ */ (function() { function AsyncArrowFunctionExpression2(params, body, expression) { this.type = syntax_1.Syntax.ArrowFunctionExpression; this.id = null; this.params = params; this.body = body; this.generator = false; this.expression = expression; this.async = true; } return AsyncArrowFunctionExpression2; })(); exports3.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression; var AsyncFunctionDeclaration = /* @__PURE__ */ (function() { function AsyncFunctionDeclaration2(id, params, body) { this.type = syntax_1.Syntax.FunctionDeclaration; this.id = id; this.params = params; this.body = body; this.generator = false; this.expression = false; this.async = true; } return AsyncFunctionDeclaration2; })(); exports3.AsyncFunctionDeclaration = AsyncFunctionDeclaration; var AsyncFunctionExpression = /* @__PURE__ */ (function() { function AsyncFunctionExpression2(id, params, body) { this.type = syntax_1.Syntax.FunctionExpression; this.id = id; this.params = params; this.body = body; this.generator = false; this.expression = false; this.async = true; } return AsyncFunctionExpression2; })(); exports3.AsyncFunctionExpression = AsyncFunctionExpression; var AwaitExpression = /* @__PURE__ */ (function() { function AwaitExpression2(argument) { this.type = syntax_1.Syntax.AwaitExpression; this.argument = argument; } return AwaitExpression2; })(); exports3.AwaitExpression = AwaitExpression; var BinaryExpression = /* @__PURE__ */ (function() { function BinaryExpression2(operator, left, right) { var logical = operator === "||" || operator === "&&"; this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression; this.operator = operator; this.left = left; this.right = right; } return BinaryExpression2; })(); exports3.BinaryExpression = BinaryExpression; var BlockStatement = /* @__PURE__ */ (function() { function BlockStatement2(body) { this.type = syntax_1.Syntax.BlockStatement; this.body = body; } return BlockStatement2; })(); exports3.BlockStatement = BlockStatement; var BreakStatement = /* @__PURE__ */ (function() { function BreakStatement2(label) { this.type = syntax_1.Syntax.BreakStatement; this.label = label; } return BreakStatement2; })(); exports3.BreakStatement = BreakStatement; var CallExpression = /* @__PURE__ */ (function() { function CallExpression2(callee, args) { this.type = syntax_1.Syntax.CallExpression; this.callee = callee; this.arguments = args; } return CallExpression2; })(); exports3.CallExpression = CallExpression; var CatchClause = /* @__PURE__ */ (function() { function CatchClause2(param, body) { this.type = syntax_1.Syntax.CatchClause; this.param = param; this.body = body; } return CatchClause2; })(); exports3.CatchClause = CatchClause; var ClassBody = /* @__PURE__ */ (function() { function ClassBody2(body) { this.type = syntax_1.Syntax.ClassBody; this.body = body; } return ClassBody2; })(); exports3.ClassBody = ClassBody; var ClassDeclaration = /* @__PURE__ */ (function() { function ClassDeclaration2(id, superClass, body) { this.type = syntax_1.Syntax.ClassDeclaration; this.id = id; this.superClass = superClass; this.body = body; } return ClassDeclaration2; })(); exports3.ClassDeclaration = ClassDeclaration; var ClassExpression = /* @__PURE__ */ (function() { function ClassExpression2(id, superClass, body) { this.type = syntax_1.Syntax.ClassExpression; this.id = id; this.superClass = superClass; this.body = body; } return ClassExpression2; })(); exports3.ClassExpression = ClassExpression; var ComputedMemberExpression = /* @__PURE__ */ (function() { function ComputedMemberExpression2(object, property) { this.type = syntax_1.Syntax.MemberExpression; this.computed = true; this.object = object; this.property = property; } return ComputedMemberExpression2; })(); exports3.ComputedMemberExpression = ComputedMemberExpression; var ConditionalExpression = /* @__PURE__ */ (function() { function ConditionalExpression2(test, consequent, alternate) { this.type = syntax_1.Syntax.ConditionalExpression; this.test = test; this.consequent = consequent; this.alternate = alternate; } return ConditionalExpression2; })(); exports3.ConditionalExpression = ConditionalExpression; var ContinueStatement = /* @__PURE__ */ (function() { function ContinueStatement2(label) { this.type = syntax_1.Syntax.ContinueStatement; this.label = label; } return ContinueStatement2; })(); exports3.ContinueStatement = ContinueStatement; var DebuggerStatement = /* @__PURE__ */ (function() { function DebuggerStatement2() { this.type = syntax_1.Syntax.DebuggerStatement; } return DebuggerStatement2; })(); exports3.DebuggerStatement = DebuggerStatement; var Directive = /* @__PURE__ */ (function() { function Directive2(expression, directive) { this.type = syntax_1.Syntax.ExpressionStatement; this.expression = expression; this.directive = directive; } return Directive2; })(); exports3.Directive = Directive; var DoWhileStatement = /* @__PURE__ */ (function() { function DoWhileStatement2(body, test) { this.type = syntax_1.Syntax.DoWhileStatement; this.body = body; this.test = test; } return DoWhileStatement2; })(); exports3.DoWhileStatement = DoWhileStatement; var EmptyStatement = /* @__PURE__ */ (function() { function EmptyStatement2() { this.type = syntax_1.Syntax.EmptyStatement; } return EmptyStatement2; })(); exports3.EmptyStatement = EmptyStatement; var ExportAllDeclaration = /* @__PURE__ */ (function() { function ExportAllDeclaration2(source) { this.type = syntax_1.Syntax.ExportAllDeclaration; this.source = source; } return ExportAllDeclaration2; })(); exports3.ExportAllDeclaration = ExportAllDeclaration; var ExportDefaultDeclaration = /* @__PURE__ */ (function() { function ExportDefaultDeclaration2(declaration) { this.type = syntax_1.Syntax.ExportDefaultDeclaration; this.declaration = declaration; } return ExportDefaultDeclaration2; })(); exports3.ExportDefaultDeclaration = ExportDefaultDeclaration; var ExportNamedDeclaration = /* @__PURE__ */ (function() { function ExportNamedDeclaration2(declaration, specifiers, source) { this.type = syntax_1.Syntax.ExportNamedDeclaration; this.declaration = declaration; this.specifiers = specifiers; this.source = source; } return ExportNamedDeclaration2; })(); exports3.ExportNamedDeclaration = ExportNamedDeclaration; var ExportSpecifier = /* @__PURE__ */ (function() { function ExportSpecifier2(local, exported) { this.type = syntax_1.Syntax.ExportSpecifier; this.exported = exported; this.local = local; } return ExportSpecifier2; })(); exports3.ExportSpecifier = ExportSpecifier; var ExpressionStatement = /* @__PURE__ */ (function() { function ExpressionStatement2(expression) { this.type = syntax_1.Syntax.ExpressionStatement; this.expression = expression; } return ExpressionStatement2; })(); exports3.ExpressionStatement = ExpressionStatement; var ForInStatement = /* @__PURE__ */ (function() { function ForInStatement2(left, right, body) { this.type = syntax_1.Syntax.ForInStatement; this.left = left; this.right = right; this.body = body; this.each = false; } return ForInStatement2; })(); exports3.ForInStatement = ForInStatement; var ForOfStatement = /* @__PURE__ */ (function() { function ForOfStatement2(left, right, body) { this.type = syntax_1.Syntax.ForOfStatement; this.left = left; this.right = right; this.body = body; } return ForOfStatement2; })(); exports3.ForOfStatement = ForOfStatement; var ForStatement = /* @__PURE__ */ (function() { function ForStatement2(init, test, update, body) { this.type = syntax_1.Syntax.ForStatement; this.init = init; this.test = test; this.update = update; this.body = body; } return ForStatement2; })(); exports3.ForStatement = ForStatement; var FunctionDeclaration = /* @__PURE__ */ (function() { function FunctionDeclaration2(id, params, body, generator) { this.type = syntax_1.Syntax.FunctionDeclaration; this.id = id; this.params = params; this.body = body; this.generator = generator; this.expression = false; this.async = false; } return FunctionDeclaration2; })(); exports3.FunctionDeclaration = FunctionDeclaration; var FunctionExpression = /* @__PURE__ */ (function() { function FunctionExpression2(id, params, body, generator) { this.type = syntax_1.Syntax.FunctionExpression; this.id = id; this.params = params; this.body = body; this.generator = generator; this.expression = false; this.async = false; } return FunctionExpression2; })(); exports3.FunctionExpression = FunctionExpression; var Identifier = /* @__PURE__ */ (function() { function Identifier2(name) { this.type = syntax_1.Syntax.Identifier; this.name = name; } return Identifier2; })(); exports3.Identifier = Identifier; var IfStatement = /* @__PURE__ */ (function() { function IfStatement2(test, consequent, alternate) { this.type = syntax_1.Syntax.IfStatement; this.test = test; this.consequent = consequent; this.alternate = alternate; } return IfStatement2; })(); exports3.IfStatement = IfStatement; var ImportDeclaration = /* @__PURE__ */ (function() { function ImportDeclaration2(specifiers, source) { this.type = syntax_1.Syntax.ImportDeclaration; this.specifiers = specifiers; this.source = source; } return ImportDeclaration2; })(); exports3.ImportDeclaration = ImportDeclaration; var ImportDefaultSpecifier = /* @__PURE__ */ (function() { function ImportDefaultSpecifier2(local) { this.type = syntax_1.Syntax.ImportDefaultSpecifier; this.local = local; } return ImportDefaultSpecifier2; })(); exports3.ImportDefaultSpecifier = ImportDefaultSpecifier; var ImportNamespaceSpecifier = /* @__PURE__ */ (function() { function ImportNamespaceSpecifier2(local) { this.type = syntax_1.Syntax.ImportNamespaceSpecifier; this.local = local; } return ImportNamespaceSpecifier2; })(); exports3.ImportNamespaceSpecifier = ImportNamespaceSpecifier; var ImportSpecifier = /* @__PURE__ */ (function() { function ImportSpecifier2(local, imported) { this.type = syntax_1.Syntax.ImportSpecifier; this.local = local; this.imported = imported; } return ImportSpecifier2; })(); exports3.ImportSpecifier = ImportSpecifier; var LabeledStatement = /* @__PURE__ */ (function() { function LabeledStatement2(label, body) { this.type = syntax_1.Syntax.LabeledStatement; this.label = label; this.body = body; } return LabeledStatement2; })(); exports3.LabeledStatement = LabeledStatement; var Literal = /* @__PURE__ */ (function() { function Literal2(value, raw) { this.type = syntax_1.Syntax.Literal; this.value = value; this.raw = raw; } return Literal2; })(); exports3.Literal = Literal; var MetaProperty = /* @__PURE__ */ (function() { function MetaProperty2(meta, property) { this.type = syntax_1.Syntax.MetaProperty; this.meta = meta; this.property = property; } return MetaProperty2; })(); exports3.MetaProperty = MetaProperty; var MethodDefinition = /* @__PURE__ */ (function() { function MethodDefinition2(key, computed, value, kind, isStatic) { this.type = syntax_1.Syntax.MethodDefinition; this.key = key; this.computed = computed; this.value = value; this.kind = kind; this.static = isStatic; } return MethodDefinition2; })(); exports3.MethodDefinition = MethodDefinition; var Module = /* @__PURE__ */ (function() { function Module2(body) { this.type = syntax_1.Syntax.Program; this.body = body; this.sourceType = "module"; } return Module2; })(); exports3.Module = Module; var NewExpression = /* @__PURE__ */ (function() { function NewExpression2(callee, args) { this.type = syntax_1.Syntax.NewExpression; this.callee = callee; this.arguments = args; } return NewExpression2; })(); exports3.NewExpression = NewExpression; var ObjectExpression = /* @__PURE__ */ (function() { function ObjectExpression2(properties) { this.type = syntax_1.Syntax.ObjectExpression; this.properties = properties; } return ObjectExpression2; })(); exports3.ObjectExpression = ObjectExpression; var ObjectPattern = /* @__PURE__ */ (function() { function ObjectPattern2(properties) { this.type = syntax_1.Syntax.ObjectPattern; this.properties = properties; } return ObjectPattern2; })(); exports3.ObjectPattern = ObjectPattern; var Property = /* @__PURE__ */ (function() { function Property2(kind, key, computed, value, method, shorthand) { this.type = syntax_1.Syntax.Property; this.key = key; this.computed = computed; this.value = value; this.kind = kind; this.method = method; this.shorthand = shorthand; } return Property2; })(); exports3.Property = Property; var RegexLiteral = /* @__PURE__ */ (function() { function RegexLiteral2(value, raw, pattern, flags) { this.type = syntax_1.Syntax.Literal; this.value = value; this.raw = raw; this.regex = { pattern, flags }; } return RegexLiteral2; })(); exports3.RegexLiteral = RegexLiteral; var RestElement = /* @__PURE__ */ (function() { function RestElement2(argument) { this.type = syntax_1.Syntax.RestElement; this.argument = argument; } return RestElement2; })(); exports3.RestElement = RestElement; var ReturnStatement = /* @__PURE__ */ (function() { function ReturnStatement2(argument) { this.type = syntax_1.Syntax.ReturnStatement; this.argument = argument; } return ReturnStatement2; })(); exports3.ReturnStatement = ReturnStatement; var Script = /* @__PURE__ */ (function() { function Script2(body) { this.type = syntax_1.Syntax.Program; this.body = body; this.sourceType = "script"; } return Script2; })(); exports3.Script = Script; var SequenceExpression = /* @__PURE__ */ (function() { function SequenceExpression2(expressions) { this.type = syntax_1.Syntax.SequenceExpression; this.expressions = expressions; } return SequenceExpression2; })(); exports3.SequenceExpression = SequenceExpression; var SpreadElement = /* @__PURE__ */ (function() { function SpreadElement2(argument) { this.type = syntax_1.Syntax.SpreadElement; this.argument = argument; } return SpreadElement2; })(); exports3.SpreadElement = SpreadElement; var StaticMemberExpression = /* @__PURE__ */ (function() { function StaticMemberExpression2(object, property) { this.type = syntax_1.Syntax.MemberExpression; this.computed = false; this.object = object; this.property = property; } return StaticMemberExpression2; })(); exports3.StaticMemberExpression = StaticMemberExpression; var Super = /* @__PURE__ */ (function() { function Super2() { this.type = syntax_1.Syntax.Super; } return Super2; })(); exports3.Super = Super; var SwitchCase = /* @__PURE__ */ (function() { function SwitchCase2(test, consequent) { this.type = syntax_1.Syntax.SwitchCase; this.test = test; this.consequent = consequent; } return SwitchCase2; })(); exports3.SwitchCase = SwitchCase; var SwitchStatement = /* @__PURE__ */ (function() { function SwitchStatement2(discriminant, cases) { this.type = syntax_1.Syntax.SwitchStatement; this.discriminant = discriminant; this.cases = cases; } return SwitchStatement2; })(); exports3.SwitchStatement = SwitchStatement; var TaggedTemplateExpression = /* @__PURE__ */ (function() { function TaggedTemplateExpression2(tag2, quasi) { this.type = syntax_1.Syntax.TaggedTemplateExpression; this.tag = tag2; this.quasi = quasi; } return TaggedTemplateExpression2; })(); exports3.TaggedTemplateExpression = TaggedTemplateExpression; var TemplateElement = /* @__PURE__ */ (function() { function TemplateElement2(value, tail) { this.type = syntax_1.Syntax.TemplateElement; this.value = value; this.tail = tail; } return TemplateElement2; })(); exports3.TemplateElement = TemplateElement; var TemplateLiteral = /* @__PURE__ */ (function() { function TemplateLiteral2(quasis, expressions) { this.type = syntax_1.Syntax.TemplateLiteral; this.quasis = quasis; this.expressions = expressions; } return TemplateLiteral2; })(); exports3.TemplateLiteral = TemplateLiteral; var ThisExpression = /* @__PURE__ */ (function() { function ThisExpression2() { this.type = syntax_1.Syntax.ThisExpression; } return ThisExpression2; })(); exports3.ThisExpression = ThisExpression; var ThrowStatement = /* @__PURE__ */ (function() { function ThrowStatement2(argument) { this.type = syntax_1.Syntax.ThrowStatement; this.argument = argument; } return ThrowStatement2; })(); exports3.ThrowStatement = ThrowStatement; var TryStatement = /* @__PURE__ */ (function() { function TryStatement2(block, handler, finalizer) { this.type = syntax_1.Syntax.TryStatement; this.block = block; this.handler = handler; this.finalizer = finalizer; } return TryStatement2; })(); exports3.TryStatement = TryStatement; var UnaryExpression = /* @__PURE__ */ (function() { function UnaryExpression2(operator, argument) { this.type = syntax_1.Syntax.UnaryExpression; this.operator = operator; this.argument = argument; this.prefix = true; } return UnaryExpression2; })(); exports3.UnaryExpression = UnaryExpression; var UpdateExpression = /* @__PURE__ */ (function() { function UpdateExpression2(operator, argument, prefix) { this.type = syntax_1.Syntax.UpdateExpression; this.operator = operator; this.argument = argument; this.prefix = prefix; } return UpdateExpression2; })(); exports3.UpdateExpression = UpdateExpression; var VariableDeclaration = /* @__PURE__ */ (function() { function VariableDeclaration2(declarations, kind) { this.type = syntax_1.Syntax.VariableDeclaration; this.declarations = declarations; this.kind = kind; } return VariableDeclaration2; })(); exports3.VariableDeclaration = VariableDeclaration; var VariableDeclarator = /* @__PURE__ */ (function() { function VariableDeclarator2(id, init) { this.type = syntax_1.Syntax.VariableDeclarator; this.id = id; this.init = init; } return VariableDeclarator2; })(); exports3.VariableDeclarator = VariableDeclarator; var WhileStatement = /* @__PURE__ */ (function() { function WhileStatement2(test, body) { this.type = syntax_1.Syntax.WhileStatement; this.test = test; this.body = body; } return WhileStatement2; })(); exports3.WhileStatement = WhileStatement; var WithStatement = /* @__PURE__ */ (function() { function WithStatement2(object, body) { this.type = syntax_1.Syntax.WithStatement; this.object = object; this.body = body; } return WithStatement2; })(); exports3.WithStatement = WithStatement; var YieldExpression = /* @__PURE__ */ (function() { function YieldExpression2(argument, delegate) { this.type = syntax_1.Syntax.YieldExpression; this.argument = argument; this.delegate = delegate; } return YieldExpression2; })(); exports3.YieldExpression = YieldExpression; }, /* 8 */ /***/ function(module3, exports3, __webpack_require__) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); var assert_1 = __webpack_require__(9); var error_handler_1 = __webpack_require__(10); var messages_1 = __webpack_require__(11); var Node = __webpack_require__(7); var scanner_1 = __webpack_require__(12); var syntax_1 = __webpack_require__(2); var token_1 = __webpack_require__(13); var ArrowParameterPlaceHolder = "ArrowParameterPlaceHolder"; var Parser = (function() { function Parser2(code, options, delegate) { if (options === void 0) { options = {}; } this.config = { range: typeof options.range === "boolean" && options.range, loc: typeof options.loc === "boolean" && options.loc, source: null, tokens: typeof options.tokens === "boolean" && options.tokens, comment: typeof options.comment === "boolean" && options.comment, tolerant: typeof options.tolerant === "boolean" && options.tolerant }; if (this.config.loc && options.source && options.source !== null) { this.config.source = String(options.source); } this.delegate = delegate; this.errorHandler = new error_handler_1.ErrorHandler(); this.errorHandler.tolerant = this.config.tolerant; this.scanner = new scanner_1.Scanner(code, this.errorHandler); this.scanner.trackComment = this.config.comment; this.operatorPrecedence = { ")": 0, ";": 0, ",": 0, "=": 0, "]": 0, "||": 1, "&&": 2, "|": 3, "^": 4, "&": 5, "==": 6, "!=": 6, "===": 6, "!==": 6, "<": 7, ">": 7, "<=": 7, ">=": 7, "<<": 8, ">>": 8, ">>>": 8, "+": 9, "-": 9, "*": 11, "/": 11, "%": 11 }; this.lookahead = { type: 2, value: "", lineNumber: this.scanner.lineNumber, lineStart: 0, start: 0, end: 0 }; this.hasLineTerminator = false; this.context = { isModule: false, await: false, allowIn: true, allowStrictDirective: true, allowYield: true, firstCoverInitializedNameError: null, isAssignmentTarget: false, isBindingElement: false, inFunctionBody: false, inIteration: false, inSwitch: false, labelSet: {}, strict: false }; this.tokens = []; this.startMarker = { index: 0, line: this.scanner.lineNumber, column: 0 }; this.lastMarker = { index: 0, line: this.scanner.lineNumber, column: 0 }; this.nextToken(); this.lastMarker = { index: this.scanner.index, line: this.scanner.lineNumber, column: this.scanner.index - this.scanner.lineStart }; } Parser2.prototype.throwError = function(messageFormat) { var values = []; for (var _i = 1; _i < arguments.length; _i++) { values[_i - 1] = arguments[_i]; } var args = Array.prototype.slice.call(arguments, 1); var msg = messageFormat.replace(/%(\d)/g, function(whole, idx) { assert_1.assert(idx < args.length, "Message reference must be in range"); return args[idx]; }); var index = this.lastMarker.index; var line = this.lastMarker.line; var column = this.lastMarker.column + 1; throw this.errorHandler.createError(index, line, column, msg); }; Parser2.prototype.tolerateError = function(messageFormat) { var values = []; for (var _i = 1; _i < arguments.length; _i++) { values[_i - 1] = arguments[_i]; } var args = Array.prototype.slice.call(arguments, 1); var msg = messageFormat.replace(/%(\d)/g, function(whole, idx) { assert_1.assert(idx < args.length, "Message reference must be in range"); return args[idx]; }); var index = this.lastMarker.index; var line = this.scanner.lineNumber; var column = this.lastMarker.column + 1; this.errorHandler.tolerateError(index, line, column, msg); }; Parser2.prototype.unexpectedTokenError = function(token, message) { var msg = message || messages_1.Messages.UnexpectedToken; var value; if (token) { if (!message) { msg = token.type === 2 ? messages_1.Messages.UnexpectedEOS : token.type === 3 ? messages_1.Messages.UnexpectedIdentifier : token.type === 6 ? messages_1.Messages.UnexpectedNumber : token.type === 8 ? messages_1.Messages.UnexpectedString : token.type === 10 ? messages_1.Messages.UnexpectedTemplate : messages_1.Messages.UnexpectedToken; if (token.type === 4) { if (this.scanner.isFutureReservedWord(token.value)) { msg = messages_1.Messages.UnexpectedReserved; } else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) { msg = messages_1.Messages.StrictReservedWord; } } } value = token.value; } else { value = "ILLEGAL"; } msg = msg.replace("%0", value); if (token && typeof token.lineNumber === "number") { var index = token.start; var line = token.lineNumber; var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column; var column = token.start - lastMarkerLineStart + 1; return this.errorHandler.createError(index, line, column, msg); } else { var index = this.lastMarker.index; var line = this.lastMarker.line; var column = this.lastMarker.column + 1; return this.errorHandler.createError(index, line, column, msg); } }; Parser2.prototype.throwUnexpectedToken = function(token, message) { throw this.unexpectedTokenError(token, message); }; Parser2.prototype.tolerateUnexpectedToken = function(token, message) { this.errorHandler.tolerate(this.unexpectedTokenError(token, message)); }; Parser2.prototype.collectComments = function() { if (!this.config.comment) { this.scanner.scanComments(); } else { var comments = this.scanner.scanComments(); if (comments.length > 0 && this.delegate) { for (var i5 = 0; i5 < comments.length; ++i5) { var e5 = comments[i5]; var node = void 0; node = { type: e5.multiLine ? "BlockComment" : "LineComment", value: this.scanner.source.slice(e5.slice[0], e5.slice[1]) }; if (this.config.range) { node.range = e5.range; } if (this.config.loc) { node.loc = e5.loc; } var metadata = { start: { line: e5.loc.start.line, column: e5.loc.start.column, offset: e5.range[0] }, end: { line: e5.loc.end.line, column: e5.loc.end.column, offset: e5.range[1] } }; this.delegate(node, metadata); } } } }; Parser2.prototype.getTokenRaw = function(token) { return this.scanner.source.slice(token.start, token.end); }; Parser2.prototype.convertToken = function(token) { var t = { type: token_1.TokenName[token.type], value: this.getTokenRaw(token) }; if (this.config.range) { t.range = [token.start, token.end]; } if (this.config.loc) { t.loc = { start: { line: this.startMarker.line, column: this.startMarker.column }, end: { line: this.scanner.lineNumber, column: this.scanner.index - this.scanner.lineStart } }; } if (token.type === 9) { var pattern = token.pattern; var flags = token.flags; t.regex = { pattern, flags }; } return t; }; Parser2.prototype.nextToken = function() { var token = this.lookahead; this.lastMarker.index = this.scanner.index; this.lastMarker.line = this.scanner.lineNumber; this.lastMarker.column = this.scanner.index - this.scanner.lineStart; this.collectComments(); if (this.scanner.index !== this.startMarker.index) { this.startMarker.index = this.scanner.index; this.startMarker.line = this.scanner.lineNumber; this.startMarker.column = this.scanner.index - this.scanner.lineStart; } var next = this.scanner.lex(); this.hasLineTerminator = token.lineNumber !== next.lineNumber; if (next && this.context.strict && next.type === 3) { if (this.scanner.isStrictModeReservedWord(next.value)) { next.type = 4; } } this.lookahead = next; if (this.config.tokens && next.type !== 2) { this.tokens.push(this.convertToken(next)); } return token; }; Parser2.prototype.nextRegexToken = function() { this.collectComments(); var token = this.scanner.scanRegExp(); if (this.config.tokens) { this.tokens.pop(); this.tokens.push(this.convertToken(token)); } this.lookahead = token; this.nextToken(); return token; }; Parser2.prototype.createNode = function() { return { index: this.startMarker.index, line: this.startMarker.line, column: this.startMarker.column }; }; Parser2.prototype.startNode = function(token, lastLineStart) { if (lastLineStart === void 0) { lastLineStart = 0; } var column = token.start - token.lineStart; var line = token.lineNumber; if (column < 0) { column += lastLineStart; line--; } return { index: token.start, line, column }; }; Parser2.prototype.finalize = function(marker, node) { if (this.config.range) { node.range = [marker.index, this.lastMarker.index]; } if (this.config.loc) { node.loc = { start: { line: marker.line, column: marker.column }, end: { line: this.lastMarker.line, column: this.lastMarker.column } }; if (this.config.source) { node.loc.source = this.config.source; } } if (this.delegate) { var metadata = { start: { line: marker.line, column: marker.column, offset: marker.index }, end: { line: this.lastMarker.line, column: this.lastMarker.column, offset: this.lastMarker.index } }; this.delegate(node, metadata); } return node; }; Parser2.prototype.expect = function(value) { var token = this.nextToken(); if (token.type !== 7 || token.value !== value) { this.throwUnexpectedToken(token); } }; Parser2.prototype.expectCommaSeparator = function() { if (this.config.tolerant) { var token = this.lookahead; if (token.type === 7 && token.value === ",") { this.nextToken(); } else if (token.type === 7 && token.value === ";") { this.nextToken(); this.tolerateUnexpectedToken(token); } else { this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken); } } else { this.expect(","); } }; Parser2.prototype.expectKeyword = function(keyword) { var token = this.nextToken(); if (token.type !== 4 || token.value !== keyword) { this.throwUnexpectedToken(token); } }; Parser2.prototype.match = function(value) { return this.lookahead.type === 7 && this.lookahead.value === value; }; Parser2.prototype.matchKeyword = function(keyword) { return this.lookahead.type === 4 && this.lookahead.value === keyword; }; Parser2.prototype.matchContextualKeyword = function(keyword) { return this.lookahead.type === 3 && this.lookahead.value === keyword; }; Parser2.prototype.matchAssign = function() { if (this.lookahead.type !== 7) { return false; } var op2 = this.lookahead.value; return op2 === "=" || op2 === "*=" || op2 === "**=" || op2 === "/=" || op2 === "%=" || op2 === "+=" || op2 === "-=" || op2 === "<<=" || op2 === ">>=" || op2 === ">>>=" || op2 === "&=" || op2 === "^=" || op2 === "|="; }; Parser2.prototype.isolateCoverGrammar = function(parseFunction) { var previousIsBindingElement = this.context.isBindingElement; var previousIsAssignmentTarget = this.context.isAssignmentTarget; var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; this.context.isBindingElement = true; this.context.isAssignmentTarget = true; this.context.firstCoverInitializedNameError = null; var result = parseFunction.call(this); if (this.context.firstCoverInitializedNameError !== null) { this.throwUnexpectedToken(this.context.firstCoverInitializedNameError); } this.context.isBindingElement = previousIsBindingElement; this.context.isAssignmentTarget = previousIsAssignmentTarget; this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError; return result; }; Parser2.prototype.inheritCoverGrammar = function(parseFunction) { var previousIsBindingElement = this.context.isBindingElement; var previousIsAssignmentTarget = this.context.isAssignmentTarget; var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; this.context.isBindingElement = true; this.context.isAssignmentTarget = true; this.context.firstCoverInitializedNameError = null; var result = parseFunction.call(this); this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement; this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget; this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError; return result; }; Parser2.prototype.consumeSemicolon = function() { if (this.match(";")) { this.nextToken(); } else if (!this.hasLineTerminator) { if (this.lookahead.type !== 2 && !this.match("}")) { this.throwUnexpectedToken(this.lookahead); } this.lastMarker.index = this.startMarker.index; this.lastMarker.line = this.startMarker.line; this.lastMarker.column = this.startMarker.column; } }; Parser2.prototype.parsePrimaryExpression = function() { var node = this.createNode(); var expr; var token, raw; switch (this.lookahead.type) { case 3: if ((this.context.isModule || this.context.await) && this.lookahead.value === "await") { this.tolerateUnexpectedToken(this.lookahead); } expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); break; case 6: case 8: if (this.context.strict && this.lookahead.octal) { this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral); } this.context.isAssignmentTarget = false; this.context.isBindingElement = false; token = this.nextToken(); raw = this.getTokenRaw(token); expr = this.finalize(node, new Node.Literal(token.value, raw)); break; case 1: this.context.isAssignmentTarget = false; this.context.isBindingElement = false; token = this.nextToken(); raw = this.getTokenRaw(token); expr = this.finalize(node, new Node.Literal(token.value === "true", raw)); break; case 5: this.context.isAssignmentTarget = false; this.context.isBindingElement = false; token = this.nextToken(); raw = this.getTokenRaw(token); expr = this.finalize(node, new Node.Literal(null, raw)); break; case 10: expr = this.parseTemplateLiteral(); break; case 7: switch (this.lookahead.value) { case "(": this.context.isBindingElement = false; expr = this.inheritCoverGrammar(this.parseGroupExpression); break; case "[": expr = this.inheritCoverGrammar(this.parseArrayInitializer); break; case "{": expr = this.inheritCoverGrammar(this.parseObjectInitializer); break; case "/": case "/=": this.context.isAssignmentTarget = false; this.context.isBindingElement = false; this.scanner.index = this.startMarker.index; token = this.nextRegexToken(); raw = this.getTokenRaw(token); expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); break; default: expr = this.throwUnexpectedToken(this.nextToken()); } break; case 4: if (!this.context.strict && this.context.allowYield && this.matchKeyword("yield")) { expr = this.parseIdentifierName(); } else if (!this.context.strict && this.matchKeyword("let")) { expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); } else { this.context.isAssignmentTarget = false; this.context.isBindingElement = false; if (this.matchKeyword("function")) { expr = this.parseFunctionExpression(); } else if (this.matchKeyword("this")) { this.nextToken(); expr = this.finalize(node, new Node.ThisExpression()); } else if (this.matchKeyword("class")) { expr = this.parseClassExpression(); } else { expr = this.throwUnexpectedToken(this.nextToken()); } } break; default: expr = this.throwUnexpectedToken(this.nextToken()); } return expr; }; Parser2.prototype.parseSpreadElement = function() { var node = this.createNode(); this.expect("..."); var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); return this.finalize(node, new Node.SpreadElement(arg)); }; Parser2.prototype.parseArrayInitializer = function() { var node = this.createNode(); var elements = []; this.expect("["); while (!this.match("]")) { if (this.match(",")) { this.nextToken(); elements.push(null); } else if (this.match("...")) { var element = this.parseSpreadElement(); if (!this.match("]")) { this.context.isAssignmentTarget = false; this.context.isBindingElement = false; this.expect(","); } elements.push(element); } else { elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); if (!this.match("]")) { this.expect(","); } } } this.expect("]"); return this.finalize(node, new Node.ArrayExpression(elements)); }; Parser2.prototype.parsePropertyMethod = function(params) { this.context.isAssignmentTarget = false; this.context.isBindingElement = false; var previousStrict = this.context.strict; var previousAllowStrictDirective = this.context.allowStrictDirective; this.context.allowStrictDirective = params.simple; var body = this.isolateCoverGrammar(this.parseFunctionSourceElements); if (this.context.strict && params.firstRestricted) { this.tolerateUnexpectedToken(params.firstRestricted, params.message); } if (this.context.strict && params.stricted) { this.tolerateUnexpectedToken(params.stricted, params.message); } this.context.strict = previousStrict; this.context.allowStrictDirective = previousAllowStrictDirective; return body; }; Parser2.prototype.parsePropertyMethodFunction = function() { var isGenerator = false; var node = this.createNode(); var previousAllowYield = this.context.allowYield; this.context.allowYield = true; var params = this.parseFormalParameters(); var method = this.parsePropertyMethod(params); this.context.allowYield = previousAllowYield; return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); }; Parser2.prototype.parsePropertyMethodAsyncFunction = function() { var node = this.createNode(); var previousAllowYield = this.context.allowYield; var previousAwait = this.context.await; this.context.allowYield = false; this.context.await = true; var params = this.parseFormalParameters(); var method = this.parsePropertyMethod(params); this.context.allowYield = previousAllowYield; this.context.await = previousAwait; return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method)); }; Parser2.prototype.parseObjectPropertyKey = function() { var node = this.createNode(); var token = this.nextToken(); var key; switch (token.type) { case 8: case 6: if (this.context.strict && token.octal) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); } var raw = this.getTokenRaw(token); key = this.finalize(node, new Node.Literal(token.value, raw)); break; case 3: case 1: case 5: case 4: key = this.finalize(node, new Node.Identifier(token.value)); break; case 7: if (token.value === "[") { key = this.isolateCoverGrammar(this.parseAssignmentExpression); this.expect("]"); } else { key = this.throwUnexpectedToken(token); } break; default: key = this.throwUnexpectedToken(token); } return key; }; Parser2.prototype.isPropertyKey = function(key, value) { return key.type === syntax_1.Syntax.Identifier && key.name === value || key.type === syntax_1.Syntax.Literal && key.value === value; }; Parser2.prototype.parseObjectProperty = function(hasProto) { var node = this.createNode(); var token = this.lookahead; var kind; var key = null; var value = null; var computed = false; var method = false; var shorthand = false; var isAsync = false; if (token.type === 3) { var id = token.value; this.nextToken(); computed = this.match("["); isAsync = !this.hasLineTerminator && id === "async" && !this.match(":") && !this.match("(") && !this.match("*") && !this.match(","); key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); } else if (this.match("*")) { this.nextToken(); } else { computed = this.match("["); key = this.parseObjectPropertyKey(); } var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); if (token.type === 3 && !isAsync && token.value === "get" && lookaheadPropertyKey) { kind = "get"; computed = this.match("["); key = this.parseObjectPropertyKey(); this.context.allowYield = false; value = this.parseGetterMethod(); } else if (token.type === 3 && !isAsync && token.value === "set" && lookaheadPropertyKey) { kind = "set"; computed = this.match("["); key = this.parseObjectPropertyKey(); value = this.parseSetterMethod(); } else if (token.type === 7 && token.value === "*" && lookaheadPropertyKey) { kind = "init"; computed = this.match("["); key = this.parseObjectPropertyKey(); value = this.parseGeneratorMethod(); method = true; } else { if (!key) { this.throwUnexpectedToken(this.lookahead); } kind = "init"; if (this.match(":") && !isAsync) { if (!computed && this.isPropertyKey(key, "__proto__")) { if (hasProto.value) { this.tolerateError(messages_1.Messages.DuplicateProtoProperty); } hasProto.value = true; } this.nextToken(); value = this.inheritCoverGrammar(this.parseAssignmentExpression); } else if (this.match("(")) { value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); method = true; } else if (token.type === 3) { var id = this.finalize(node, new Node.Identifier(token.value)); if (this.match("=")) { this.context.firstCoverInitializedNameError = this.lookahead; this.nextToken(); shorthand = true; var init = this.isolateCoverGrammar(this.parseAssignmentExpression); value = this.finalize(node, new Node.AssignmentPattern(id, init)); } else { shorthand = true; value = id; } } else { this.throwUnexpectedToken(this.nextToken()); } } return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand)); }; Parser2.prototype.parseObjectInitializer = function() { var node = this.createNode(); this.expect("{"); var properties = []; var hasProto = { value: false }; while (!this.match("}")) { properties.push(this.parseObjectProperty(hasProto)); if (!this.match("}")) { this.expectCommaSeparator(); } } this.expect("}"); return this.finalize(node, new Node.ObjectExpression(properties)); }; Parser2.prototype.parseTemplateHead = function() { assert_1.assert(this.lookahead.head, "Template literal must start with a template head"); var node = this.createNode(); var token = this.nextToken(); var raw = token.value; var cooked = token.cooked; return this.finalize(node, new Node.TemplateElement({ raw, cooked }, token.tail)); }; Parser2.prototype.parseTemplateElement = function() { if (this.lookahead.type !== 10) { this.throwUnexpectedToken(); } var node = this.createNode(); var token = this.nextToken(); var raw = token.value; var cooked = token.cooked; return this.finalize(node, new Node.TemplateElement({ raw, cooked }, token.tail)); }; Parser2.prototype.parseTemplateLiteral = function() { var node = this.createNode(); var expressions = []; var quasis = []; var quasi = this.parseTemplateHead(); quasis.push(quasi); while (!quasi.tail) { expressions.push(this.parseExpression()); quasi = this.parseTemplateElement(); quasis.push(quasi); } return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); }; Parser2.prototype.reinterpretExpressionAsPattern = function(expr) { switch (expr.type) { case syntax_1.Syntax.Identifier: case syntax_1.Syntax.MemberExpression: case syntax_1.Syntax.RestElement: case syntax_1.Syntax.AssignmentPattern: break; case syntax_1.Syntax.SpreadElement: expr.type = syntax_1.Syntax.RestElement; this.reinterpretExpressionAsPattern(expr.argument); break; case syntax_1.Syntax.ArrayExpression: expr.type = syntax_1.Syntax.ArrayPattern; for (var i5 = 0; i5 < expr.elements.length; i5++) { if (expr.elements[i5] !== null) { this.reinterpretExpressionAsPattern(expr.elements[i5]); } } break; case syntax_1.Syntax.ObjectExpression: expr.type = syntax_1.Syntax.ObjectPattern; for (var i5 = 0; i5 < expr.properties.length; i5++) { this.reinterpretExpressionAsPattern(expr.properties[i5].value); } break; case syntax_1.Syntax.AssignmentExpression: expr.type = syntax_1.Syntax.AssignmentPattern; delete expr.operator; this.reinterpretExpressionAsPattern(expr.left); break; default: break; } }; Parser2.prototype.parseGroupExpression = function() { var expr; this.expect("("); if (this.match(")")) { this.nextToken(); if (!this.match("=>")) { this.expect("=>"); } expr = { type: ArrowParameterPlaceHolder, params: [], async: false }; } else { var startToken = this.lookahead; var params = []; if (this.match("...")) { expr = this.parseRestElement(params); this.expect(")"); if (!this.match("=>")) { this.expect("=>"); } expr = { type: ArrowParameterPlaceHolder, params: [expr], async: false }; } else { var arrow = false; this.context.isBindingElement = true; expr = this.inheritCoverGrammar(this.parseAssignmentExpression); if (this.match(",")) { var expressions = []; this.context.isAssignmentTarget = false; expressions.push(expr); while (this.lookahead.type !== 2) { if (!this.match(",")) { break; } this.nextToken(); if (this.match(")")) { this.nextToken(); for (var i5 = 0; i5 < expressions.length; i5++) { this.reinterpretExpressionAsPattern(expressions[i5]); } arrow = true; expr = { type: ArrowParameterPlaceHolder, params: expressions, async: false }; } else if (this.match("...")) { if (!this.context.isBindingElement) { this.throwUnexpectedToken(this.lookahead); } expressions.push(this.parseRestElement(params)); this.expect(")"); if (!this.match("=>")) { this.expect("=>"); } this.context.isBindingElement = false; for (var i5 = 0; i5 < expressions.length; i5++) { this.reinterpretExpressionAsPattern(expressions[i5]); } arrow = true; expr = { type: ArrowParameterPlaceHolder, params: expressions, async: false }; } else { expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); } if (arrow) { break; } } if (!arrow) { expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); } } if (!arrow) { this.expect(")"); if (this.match("=>")) { if (expr.type === syntax_1.Syntax.Identifier && expr.name === "yield") { arrow = true; expr = { type: ArrowParameterPlaceHolder, params: [expr], async: false }; } if (!arrow) { if (!this.context.isBindingElement) { this.throwUnexpectedToken(this.lookahead); } if (expr.type === syntax_1.Syntax.SequenceExpression) { for (var i5 = 0; i5 < expr.expressions.length; i5++) { this.reinterpretExpressionAsPattern(expr.expressions[i5]); } } else { this.reinterpretExpressionAsPattern(expr); } var parameters = expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]; expr = { type: ArrowParameterPlaceHolder, params: parameters, async: false }; } } this.context.isBindingElement = false; } } } return expr; }; Parser2.prototype.parseArguments = function() { this.expect("("); var args = []; if (!this.match(")")) { while (true) { var expr = this.match("...") ? this.parseSpreadElement() : this.isolateCoverGrammar(this.parseAssignmentExpression); args.push(expr); if (this.match(")")) { break; } this.expectCommaSeparator(); if (this.match(")")) { break; } } } this.expect(")"); return args; }; Parser2.prototype.isIdentifierName = function(token) { return token.type === 3 || token.type === 4 || token.type === 1 || token.type === 5; }; Parser2.prototype.parseIdentifierName = function() { var node = this.createNode(); var token = this.nextToken(); if (!this.isIdentifierName(token)) { this.throwUnexpectedToken(token); } return this.finalize(node, new Node.Identifier(token.value)); }; Parser2.prototype.parseNewExpression = function() { var node = this.createNode(); var id = this.parseIdentifierName(); assert_1.assert(id.name === "new", "New expression must start with `new`"); var expr; if (this.match(".")) { this.nextToken(); if (this.lookahead.type === 3 && this.context.inFunctionBody && this.lookahead.value === "target") { var property = this.parseIdentifierName(); expr = new Node.MetaProperty(id, property); } else { this.throwUnexpectedToken(this.lookahead); } } else { var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); var args = this.match("(") ? this.parseArguments() : []; expr = new Node.NewExpression(callee, args); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } return this.finalize(node, expr); }; Parser2.prototype.parseAsyncArgument = function() { var arg = this.parseAssignmentExpression(); this.context.firstCoverInitializedNameError = null; return arg; }; Parser2.prototype.parseAsyncArguments = function() { this.expect("("); var args = []; if (!this.match(")")) { while (true) { var expr = this.match("...") ? this.parseSpreadElement() : this.isolateCoverGrammar(this.parseAsyncArgument); args.push(expr); if (this.match(")")) { break; } this.expectCommaSeparator(); if (this.match(")")) { break; } } } this.expect(")"); return args; }; Parser2.prototype.parseLeftHandSideExpressionAllowCall = function() { var startToken = this.lookahead; var maybeAsync = this.matchContextualKeyword("async"); var previousAllowIn = this.context.allowIn; this.context.allowIn = true; var expr; if (this.matchKeyword("super") && this.context.inFunctionBody) { expr = this.createNode(); this.nextToken(); expr = this.finalize(expr, new Node.Super()); if (!this.match("(") && !this.match(".") && !this.match("[")) { this.throwUnexpectedToken(this.lookahead); } } else { expr = this.inheritCoverGrammar(this.matchKeyword("new") ? this.parseNewExpression : this.parsePrimaryExpression); } while (true) { if (this.match(".")) { this.context.isBindingElement = false; this.context.isAssignmentTarget = true; this.expect("."); var property = this.parseIdentifierName(); expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property)); } else if (this.match("(")) { var asyncArrow = maybeAsync && startToken.lineNumber === this.lookahead.lineNumber; this.context.isBindingElement = false; this.context.isAssignmentTarget = false; var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); if (asyncArrow && this.match("=>")) { for (var i5 = 0; i5 < args.length; ++i5) { this.reinterpretExpressionAsPattern(args[i5]); } expr = { type: ArrowParameterPlaceHolder, params: args, async: true }; } } else if (this.match("[")) { this.context.isBindingElement = false; this.context.isAssignmentTarget = true; this.expect("["); var property = this.isolateCoverGrammar(this.parseExpression); this.expect("]"); expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property)); } else if (this.lookahead.type === 10 && this.lookahead.head) { var quasi = this.parseTemplateLiteral(); expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); } else { break; } } this.context.allowIn = previousAllowIn; return expr; }; Parser2.prototype.parseSuper = function() { var node = this.createNode(); this.expectKeyword("super"); if (!this.match("[") && !this.match(".")) { this.throwUnexpectedToken(this.lookahead); } return this.finalize(node, new Node.Super()); }; Parser2.prototype.parseLeftHandSideExpression = function() { assert_1.assert(this.context.allowIn, "callee of new expression always allow in keyword."); var node = this.startNode(this.lookahead); var expr = this.matchKeyword("super") && this.context.inFunctionBody ? this.parseSuper() : this.inheritCoverGrammar(this.matchKeyword("new") ? this.parseNewExpression : this.parsePrimaryExpression); while (true) { if (this.match("[")) { this.context.isBindingElement = false; this.context.isAssignmentTarget = true; this.expect("["); var property = this.isolateCoverGrammar(this.parseExpression); this.expect("]"); expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property)); } else if (this.match(".")) { this.context.isBindingElement = false; this.context.isAssignmentTarget = true; this.expect("."); var property = this.parseIdentifierName(); expr = this.finalize(node, new Node.StaticMemberExpression(expr, property)); } else if (this.lookahead.type === 10 && this.lookahead.head) { var quasi = this.parseTemplateLiteral(); expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); } else { break; } } return expr; }; Parser2.prototype.parseUpdateExpression = function() { var expr; var startToken = this.lookahead; if (this.match("++") || this.match("--")) { var node = this.startNode(startToken); var token = this.nextToken(); expr = this.inheritCoverGrammar(this.parseUnaryExpression); if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { this.tolerateError(messages_1.Messages.StrictLHSPrefix); } if (!this.context.isAssignmentTarget) { this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); } var prefix = true; expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } else { expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall); if (!this.hasLineTerminator && this.lookahead.type === 7) { if (this.match("++") || this.match("--")) { if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { this.tolerateError(messages_1.Messages.StrictLHSPostfix); } if (!this.context.isAssignmentTarget) { this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); } this.context.isAssignmentTarget = false; this.context.isBindingElement = false; var operator = this.nextToken().value; var prefix = false; expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); } } } return expr; }; Parser2.prototype.parseAwaitExpression = function() { var node = this.createNode(); this.nextToken(); var argument = this.parseUnaryExpression(); return this.finalize(node, new Node.AwaitExpression(argument)); }; Parser2.prototype.parseUnaryExpression = function() { var expr; if (this.match("+") || this.match("-") || this.match("~") || this.match("!") || this.matchKeyword("delete") || this.matchKeyword("void") || this.matchKeyword("typeof")) { var node = this.startNode(this.lookahead); var token = this.nextToken(); expr = this.inheritCoverGrammar(this.parseUnaryExpression); expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); if (this.context.strict && expr.operator === "delete" && expr.argument.type === syntax_1.Syntax.Identifier) { this.tolerateError(messages_1.Messages.StrictDelete); } this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } else if (this.context.await && this.matchContextualKeyword("await")) { expr = this.parseAwaitExpression(); } else { expr = this.parseUpdateExpression(); } return expr; }; Parser2.prototype.parseExponentiationExpression = function() { var startToken = this.lookahead; var expr = this.inheritCoverGrammar(this.parseUnaryExpression); if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match("**")) { this.nextToken(); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; var left = expr; var right = this.isolateCoverGrammar(this.parseExponentiationExpression); expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression("**", left, right)); } return expr; }; Parser2.prototype.binaryPrecedence = function(token) { var op2 = token.value; var precedence; if (token.type === 7) { precedence = this.operatorPrecedence[op2] || 0; } else if (token.type === 4) { precedence = op2 === "instanceof" || this.context.allowIn && op2 === "in" ? 7 : 0; } else { precedence = 0; } return precedence; }; Parser2.prototype.parseBinaryExpression = function() { var startToken = this.lookahead; var expr = this.inheritCoverGrammar(this.parseExponentiationExpression); var token = this.lookahead; var prec = this.binaryPrecedence(token); if (prec > 0) { this.nextToken(); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; var markers = [startToken, this.lookahead]; var left = expr; var right = this.isolateCoverGrammar(this.parseExponentiationExpression); var stack = [left, token.value, right]; var precedences = [prec]; while (true) { prec = this.binaryPrecedence(this.lookahead); if (prec <= 0) { break; } while (stack.length > 2 && prec <= precedences[precedences.length - 1]) { right = stack.pop(); var operator = stack.pop(); precedences.pop(); left = stack.pop(); markers.pop(); var node = this.startNode(markers[markers.length - 1]); stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); } stack.push(this.nextToken().value); precedences.push(prec); markers.push(this.lookahead); stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression)); } var i5 = stack.length - 1; expr = stack[i5]; var lastMarker = markers.pop(); while (i5 > 1) { var marker = markers.pop(); var lastLineStart = lastMarker && lastMarker.lineStart; var node = this.startNode(marker, lastLineStart); var operator = stack[i5 - 1]; expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i5 - 2], expr)); i5 -= 2; lastMarker = marker; } } return expr; }; Parser2.prototype.parseConditionalExpression = function() { var startToken = this.lookahead; var expr = this.inheritCoverGrammar(this.parseBinaryExpression); if (this.match("?")) { this.nextToken(); var previousAllowIn = this.context.allowIn; this.context.allowIn = true; var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); this.context.allowIn = previousAllowIn; this.expect(":"); var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } return expr; }; Parser2.prototype.checkPatternParam = function(options, param) { switch (param.type) { case syntax_1.Syntax.Identifier: this.validateParam(options, param, param.name); break; case syntax_1.Syntax.RestElement: this.checkPatternParam(options, param.argument); break; case syntax_1.Syntax.AssignmentPattern: this.checkPatternParam(options, param.left); break; case syntax_1.Syntax.ArrayPattern: for (var i5 = 0; i5 < param.elements.length; i5++) { if (param.elements[i5] !== null) { this.checkPatternParam(options, param.elements[i5]); } } break; case syntax_1.Syntax.ObjectPattern: for (var i5 = 0; i5 < param.properties.length; i5++) { this.checkPatternParam(options, param.properties[i5].value); } break; default: break; } options.simple = options.simple && param instanceof Node.Identifier; }; Parser2.prototype.reinterpretAsCoverFormalsList = function(expr) { var params = [expr]; var options; var asyncArrow = false; switch (expr.type) { case syntax_1.Syntax.Identifier: break; case ArrowParameterPlaceHolder: params = expr.params; asyncArrow = expr.async; break; default: return null; } options = { simple: true, paramSet: {} }; for (var i5 = 0; i5 < params.length; ++i5) { var param = params[i5]; if (param.type === syntax_1.Syntax.AssignmentPattern) { if (param.right.type === syntax_1.Syntax.YieldExpression) { if (param.right.argument) { this.throwUnexpectedToken(this.lookahead); } param.right.type = syntax_1.Syntax.Identifier; param.right.name = "yield"; delete param.right.argument; delete param.right.delegate; } } else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === "await") { this.throwUnexpectedToken(this.lookahead); } this.checkPatternParam(options, param); params[i5] = param; } if (this.context.strict || !this.context.allowYield) { for (var i5 = 0; i5 < params.length; ++i5) { var param = params[i5]; if (param.type === syntax_1.Syntax.YieldExpression) { this.throwUnexpectedToken(this.lookahead); } } } if (options.message === messages_1.Messages.StrictParamDupe) { var token = this.context.strict ? options.stricted : options.firstRestricted; this.throwUnexpectedToken(token, options.message); } return { simple: options.simple, params, stricted: options.stricted, firstRestricted: options.firstRestricted, message: options.message }; }; Parser2.prototype.parseAssignmentExpression = function() { var expr; if (!this.context.allowYield && this.matchKeyword("yield")) { expr = this.parseYieldExpression(); } else { var startToken = this.lookahead; var token = startToken; expr = this.parseConditionalExpression(); if (token.type === 3 && token.lineNumber === this.lookahead.lineNumber && token.value === "async") { if (this.lookahead.type === 3 || this.matchKeyword("yield")) { var arg = this.parsePrimaryExpression(); this.reinterpretExpressionAsPattern(arg); expr = { type: ArrowParameterPlaceHolder, params: [arg], async: true }; } } if (expr.type === ArrowParameterPlaceHolder || this.match("=>")) { this.context.isAssignmentTarget = false; this.context.isBindingElement = false; var isAsync = expr.async; var list2 = this.reinterpretAsCoverFormalsList(expr); if (list2) { if (this.hasLineTerminator) { this.tolerateUnexpectedToken(this.lookahead); } this.context.firstCoverInitializedNameError = null; var previousStrict = this.context.strict; var previousAllowStrictDirective = this.context.allowStrictDirective; this.context.allowStrictDirective = list2.simple; var previousAllowYield = this.context.allowYield; var previousAwait = this.context.await; this.context.allowYield = true; this.context.await = isAsync; var node = this.startNode(startToken); this.expect("=>"); var body = void 0; if (this.match("{")) { var previousAllowIn = this.context.allowIn; this.context.allowIn = true; body = this.parseFunctionSourceElements(); this.context.allowIn = previousAllowIn; } else { body = this.isolateCoverGrammar(this.parseAssignmentExpression); } var expression = body.type !== syntax_1.Syntax.BlockStatement; if (this.context.strict && list2.firstRestricted) { this.throwUnexpectedToken(list2.firstRestricted, list2.message); } if (this.context.strict && list2.stricted) { this.tolerateUnexpectedToken(list2.stricted, list2.message); } expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list2.params, body, expression)) : this.finalize(node, new Node.ArrowFunctionExpression(list2.params, body, expression)); this.context.strict = previousStrict; this.context.allowStrictDirective = previousAllowStrictDirective; this.context.allowYield = previousAllowYield; this.context.await = previousAwait; } } else { if (this.matchAssign()) { if (!this.context.isAssignmentTarget) { this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); } if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) { var id = expr; if (this.scanner.isRestrictedWord(id.name)) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment); } if (this.scanner.isStrictModeReservedWord(id.name)) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); } } if (!this.match("=")) { this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } else { this.reinterpretExpressionAsPattern(expr); } token = this.nextToken(); var operator = token.value; var right = this.isolateCoverGrammar(this.parseAssignmentExpression); expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); this.context.firstCoverInitializedNameError = null; } } } return expr; }; Parser2.prototype.parseExpression = function() { var startToken = this.lookahead; var expr = this.isolateCoverGrammar(this.parseAssignmentExpression); if (this.match(",")) { var expressions = []; expressions.push(expr); while (this.lookahead.type !== 2) { if (!this.match(",")) { break; } this.nextToken(); expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); } expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); } return expr; }; Parser2.prototype.parseStatementListItem = function() { var statement; this.context.isAssignmentTarget = true; this.context.isBindingElement = true; if (this.lookahead.type === 4) { switch (this.lookahead.value) { case "export": if (!this.context.isModule) { this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration); } statement = this.parseExportDeclaration(); break; case "import": if (!this.context.isModule) { this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration); } statement = this.parseImportDeclaration(); break; case "const": statement = this.parseLexicalDeclaration({ inFor: false }); break; case "function": statement = this.parseFunctionDeclaration(); break; case "class": statement = this.parseClassDeclaration(); break; case "let": statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement(); break; default: statement = this.parseStatement(); break; } } else { statement = this.parseStatement(); } return statement; }; Parser2.prototype.parseBlock = function() { var node = this.createNode(); this.expect("{"); var block = []; while (true) { if (this.match("}")) { break; } block.push(this.parseStatementListItem()); } this.expect("}"); return this.finalize(node, new Node.BlockStatement(block)); }; Parser2.prototype.parseLexicalBinding = function(kind, options) { var node = this.createNode(); var params = []; var id = this.parsePattern(params, kind); if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { if (this.scanner.isRestrictedWord(id.name)) { this.tolerateError(messages_1.Messages.StrictVarName); } } var init = null; if (kind === "const") { if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) { if (this.match("=")) { this.nextToken(); init = this.isolateCoverGrammar(this.parseAssignmentExpression); } else { this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const"); } } } else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) { this.expect("="); init = this.isolateCoverGrammar(this.parseAssignmentExpression); } return this.finalize(node, new Node.VariableDeclarator(id, init)); }; Parser2.prototype.parseBindingList = function(kind, options) { var list2 = [this.parseLexicalBinding(kind, options)]; while (this.match(",")) { this.nextToken(); list2.push(this.parseLexicalBinding(kind, options)); } return list2; }; Parser2.prototype.isLexicalDeclaration = function() { var state2 = this.scanner.saveState(); this.scanner.scanComments(); var next = this.scanner.lex(); this.scanner.restoreState(state2); return next.type === 3 || next.type === 7 && next.value === "[" || next.type === 7 && next.value === "{" || next.type === 4 && next.value === "let" || next.type === 4 && next.value === "yield"; }; Parser2.prototype.parseLexicalDeclaration = function(options) { var node = this.createNode(); var kind = this.nextToken().value; assert_1.assert(kind === "let" || kind === "const", "Lexical declaration must be either let or const"); var declarations = this.parseBindingList(kind, options); this.consumeSemicolon(); return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); }; Parser2.prototype.parseBindingRestElement = function(params, kind) { var node = this.createNode(); this.expect("..."); var arg = this.parsePattern(params, kind); return this.finalize(node, new Node.RestElement(arg)); }; Parser2.prototype.parseArrayPattern = function(params, kind) { var node = this.createNode(); this.expect("["); var elements = []; while (!this.match("]")) { if (this.match(",")) { this.nextToken(); elements.push(null); } else { if (this.match("...")) { elements.push(this.parseBindingRestElement(params, kind)); break; } else { elements.push(this.parsePatternWithDefault(params, kind)); } if (!this.match("]")) { this.expect(","); } } } this.expect("]"); return this.finalize(node, new Node.ArrayPattern(elements)); }; Parser2.prototype.parsePropertyPattern = function(params, kind) { var node = this.createNode(); var computed = false; var shorthand = false; var method = false; var key; var value; if (this.lookahead.type === 3) { var keyToken = this.lookahead; key = this.parseVariableIdentifier(); var init = this.finalize(node, new Node.Identifier(keyToken.value)); if (this.match("=")) { params.push(keyToken); shorthand = true; this.nextToken(); var expr = this.parseAssignmentExpression(); value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr)); } else if (!this.match(":")) { params.push(keyToken); shorthand = true; value = init; } else { this.expect(":"); value = this.parsePatternWithDefault(params, kind); } } else { computed = this.match("["); key = this.parseObjectPropertyKey(); this.expect(":"); value = this.parsePatternWithDefault(params, kind); } return this.finalize(node, new Node.Property("init", key, computed, value, method, shorthand)); }; Parser2.prototype.parseObjectPattern = function(params, kind) { var node = this.createNode(); var properties = []; this.expect("{"); while (!this.match("}")) { properties.push(this.parsePropertyPattern(params, kind)); if (!this.match("}")) { this.expect(","); } } this.expect("}"); return this.finalize(node, new Node.ObjectPattern(properties)); }; Parser2.prototype.parsePattern = function(params, kind) { var pattern; if (this.match("[")) { pattern = this.parseArrayPattern(params, kind); } else if (this.match("{")) { pattern = this.parseObjectPattern(params, kind); } else { if (this.matchKeyword("let") && (kind === "const" || kind === "let")) { this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding); } params.push(this.lookahead); pattern = this.parseVariableIdentifier(kind); } return pattern; }; Parser2.prototype.parsePatternWithDefault = function(params, kind) { var startToken = this.lookahead; var pattern = this.parsePattern(params, kind); if (this.match("=")) { this.nextToken(); var previousAllowYield = this.context.allowYield; this.context.allowYield = true; var right = this.isolateCoverGrammar(this.parseAssignmentExpression); this.context.allowYield = previousAllowYield; pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right)); } return pattern; }; Parser2.prototype.parseVariableIdentifier = function(kind) { var node = this.createNode(); var token = this.nextToken(); if (token.type === 4 && token.value === "yield") { if (this.context.strict) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); } else if (!this.context.allowYield) { this.throwUnexpectedToken(token); } } else if (token.type !== 3) { if (this.context.strict && token.type === 4 && this.scanner.isStrictModeReservedWord(token.value)) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); } else { if (this.context.strict || token.value !== "let" || kind !== "var") { this.throwUnexpectedToken(token); } } } else if ((this.context.isModule || this.context.await) && token.type === 3 && token.value === "await") { this.tolerateUnexpectedToken(token); } return this.finalize(node, new Node.Identifier(token.value)); }; Parser2.prototype.parseVariableDeclaration = function(options) { var node = this.createNode(); var params = []; var id = this.parsePattern(params, "var"); if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { if (this.scanner.isRestrictedWord(id.name)) { this.tolerateError(messages_1.Messages.StrictVarName); } } var init = null; if (this.match("=")) { this.nextToken(); init = this.isolateCoverGrammar(this.parseAssignmentExpression); } else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { this.expect("="); } return this.finalize(node, new Node.VariableDeclarator(id, init)); }; Parser2.prototype.parseVariableDeclarationList = function(options) { var opt = { inFor: options.inFor }; var list2 = []; list2.push(this.parseVariableDeclaration(opt)); while (this.match(",")) { this.nextToken(); list2.push(this.parseVariableDeclaration(opt)); } return list2; }; Parser2.prototype.parseVariableStatement = function() { var node = this.createNode(); this.expectKeyword("var"); var declarations = this.parseVariableDeclarationList({ inFor: false }); this.consumeSemicolon(); return this.finalize(node, new Node.VariableDeclaration(declarations, "var")); }; Parser2.prototype.parseEmptyStatement = function() { var node = this.createNode(); this.expect(";"); return this.finalize(node, new Node.EmptyStatement()); }; Parser2.prototype.parseExpressionStatement = function() { var node = this.createNode(); var expr = this.parseExpression(); this.consumeSemicolon(); return this.finalize(node, new Node.ExpressionStatement(expr)); }; Parser2.prototype.parseIfClause = function() { if (this.context.strict && this.matchKeyword("function")) { this.tolerateError(messages_1.Messages.StrictFunction); } return this.parseStatement(); }; Parser2.prototype.parseIfStatement = function() { var node = this.createNode(); var consequent; var alternate = null; this.expectKeyword("if"); this.expect("("); var test = this.parseExpression(); if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); } else { this.expect(")"); consequent = this.parseIfClause(); if (this.matchKeyword("else")) { this.nextToken(); alternate = this.parseIfClause(); } } return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); }; Parser2.prototype.parseDoWhileStatement = function() { var node = this.createNode(); this.expectKeyword("do"); var previousInIteration = this.context.inIteration; this.context.inIteration = true; var body = this.parseStatement(); this.context.inIteration = previousInIteration; this.expectKeyword("while"); this.expect("("); var test = this.parseExpression(); if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); } else { this.expect(")"); if (this.match(";")) { this.nextToken(); } } return this.finalize(node, new Node.DoWhileStatement(body, test)); }; Parser2.prototype.parseWhileStatement = function() { var node = this.createNode(); var body; this.expectKeyword("while"); this.expect("("); var test = this.parseExpression(); if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); body = this.finalize(this.createNode(), new Node.EmptyStatement()); } else { this.expect(")"); var previousInIteration = this.context.inIteration; this.context.inIteration = true; body = this.parseStatement(); this.context.inIteration = previousInIteration; } return this.finalize(node, new Node.WhileStatement(test, body)); }; Parser2.prototype.parseForStatement = function() { var init = null; var test = null; var update = null; var forIn = true; var left, right; var node = this.createNode(); this.expectKeyword("for"); this.expect("("); if (this.match(";")) { this.nextToken(); } else { if (this.matchKeyword("var")) { init = this.createNode(); this.nextToken(); var previousAllowIn = this.context.allowIn; this.context.allowIn = false; var declarations = this.parseVariableDeclarationList({ inFor: true }); this.context.allowIn = previousAllowIn; if (declarations.length === 1 && this.matchKeyword("in")) { var decl = declarations[0]; if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in"); } init = this.finalize(init, new Node.VariableDeclaration(declarations, "var")); this.nextToken(); left = init; right = this.parseExpression(); init = null; } else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) { init = this.finalize(init, new Node.VariableDeclaration(declarations, "var")); this.nextToken(); left = init; right = this.parseAssignmentExpression(); init = null; forIn = false; } else { init = this.finalize(init, new Node.VariableDeclaration(declarations, "var")); this.expect(";"); } } else if (this.matchKeyword("const") || this.matchKeyword("let")) { init = this.createNode(); var kind = this.nextToken().value; if (!this.context.strict && this.lookahead.value === "in") { init = this.finalize(init, new Node.Identifier(kind)); this.nextToken(); left = init; right = this.parseExpression(); init = null; } else { var previousAllowIn = this.context.allowIn; this.context.allowIn = false; var declarations = this.parseBindingList(kind, { inFor: true }); this.context.allowIn = previousAllowIn; if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) { init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); this.nextToken(); left = init; right = this.parseExpression(); init = null; } else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) { init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); this.nextToken(); left = init; right = this.parseAssignmentExpression(); init = null; forIn = false; } else { this.consumeSemicolon(); init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); } } } else { var initStartToken = this.lookahead; var previousAllowIn = this.context.allowIn; this.context.allowIn = false; init = this.inheritCoverGrammar(this.parseAssignmentExpression); this.context.allowIn = previousAllowIn; if (this.matchKeyword("in")) { if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { this.tolerateError(messages_1.Messages.InvalidLHSInForIn); } this.nextToken(); this.reinterpretExpressionAsPattern(init); left = init; right = this.parseExpression(); init = null; } else if (this.matchContextualKeyword("of")) { if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { this.tolerateError(messages_1.Messages.InvalidLHSInForLoop); } this.nextToken(); this.reinterpretExpressionAsPattern(init); left = init; right = this.parseAssignmentExpression(); init = null; forIn = false; } else { if (this.match(",")) { var initSeq = [init]; while (this.match(",")) { this.nextToken(); initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); } init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); } this.expect(";"); } } } if (typeof left === "undefined") { if (!this.match(";")) { test = this.parseExpression(); } this.expect(";"); if (!this.match(")")) { update = this.parseExpression(); } } var body; if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); body = this.finalize(this.createNode(), new Node.EmptyStatement()); } else { this.expect(")"); var previousInIteration = this.context.inIteration; this.context.inIteration = true; body = this.isolateCoverGrammar(this.parseStatement); this.context.inIteration = previousInIteration; } return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(init, test, update, body)) : forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : this.finalize(node, new Node.ForOfStatement(left, right, body)); }; Parser2.prototype.parseContinueStatement = function() { var node = this.createNode(); this.expectKeyword("continue"); var label = null; if (this.lookahead.type === 3 && !this.hasLineTerminator) { var id = this.parseVariableIdentifier(); label = id; var key = "$" + id.name; if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { this.throwError(messages_1.Messages.UnknownLabel, id.name); } } this.consumeSemicolon(); if (label === null && !this.context.inIteration) { this.throwError(messages_1.Messages.IllegalContinue); } return this.finalize(node, new Node.ContinueStatement(label)); }; Parser2.prototype.parseBreakStatement = function() { var node = this.createNode(); this.expectKeyword("break"); var label = null; if (this.lookahead.type === 3 && !this.hasLineTerminator) { var id = this.parseVariableIdentifier(); var key = "$" + id.name; if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { this.throwError(messages_1.Messages.UnknownLabel, id.name); } label = id; } this.consumeSemicolon(); if (label === null && !this.context.inIteration && !this.context.inSwitch) { this.throwError(messages_1.Messages.IllegalBreak); } return this.finalize(node, new Node.BreakStatement(label)); }; Parser2.prototype.parseReturnStatement = function() { if (!this.context.inFunctionBody) { this.tolerateError(messages_1.Messages.IllegalReturn); } var node = this.createNode(); this.expectKeyword("return"); var hasArgument = !this.match(";") && !this.match("}") && !this.hasLineTerminator && this.lookahead.type !== 2 || this.lookahead.type === 8 || this.lookahead.type === 10; var argument = hasArgument ? this.parseExpression() : null; this.consumeSemicolon(); return this.finalize(node, new Node.ReturnStatement(argument)); }; Parser2.prototype.parseWithStatement = function() { if (this.context.strict) { this.tolerateError(messages_1.Messages.StrictModeWith); } var node = this.createNode(); var body; this.expectKeyword("with"); this.expect("("); var object = this.parseExpression(); if (!this.match(")") && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); body = this.finalize(this.createNode(), new Node.EmptyStatement()); } else { this.expect(")"); body = this.parseStatement(); } return this.finalize(node, new Node.WithStatement(object, body)); }; Parser2.prototype.parseSwitchCase = function() { var node = this.createNode(); var test; if (this.matchKeyword("default")) { this.nextToken(); test = null; } else { this.expectKeyword("case"); test = this.parseExpression(); } this.expect(":"); var consequent = []; while (true) { if (this.match("}") || this.matchKeyword("default") || this.matchKeyword("case")) { break; } consequent.push(this.parseStatementListItem()); } return this.finalize(node, new Node.SwitchCase(test, consequent)); }; Parser2.prototype.parseSwitchStatement = function() { var node = this.createNode(); this.expectKeyword("switch"); this.expect("("); var discriminant = this.parseExpression(); this.expect(")"); var previousInSwitch = this.context.inSwitch; this.context.inSwitch = true; var cases = []; var defaultFound = false; this.expect("{"); while (true) { if (this.match("}")) { break; } var clause = this.parseSwitchCase(); if (clause.test === null) { if (defaultFound) { this.throwError(messages_1.Messages.MultipleDefaultsInSwitch); } defaultFound = true; } cases.push(clause); } this.expect("}"); this.context.inSwitch = previousInSwitch; return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); }; Parser2.prototype.parseLabelledStatement = function() { var node = this.createNode(); var expr = this.parseExpression(); var statement; if (expr.type === syntax_1.Syntax.Identifier && this.match(":")) { this.nextToken(); var id = expr; var key = "$" + id.name; if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { this.throwError(messages_1.Messages.Redeclaration, "Label", id.name); } this.context.labelSet[key] = true; var body = void 0; if (this.matchKeyword("class")) { this.tolerateUnexpectedToken(this.lookahead); body = this.parseClassDeclaration(); } else if (this.matchKeyword("function")) { var token = this.lookahead; var declaration = this.parseFunctionDeclaration(); if (this.context.strict) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction); } else if (declaration.generator) { this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext); } body = declaration; } else { body = this.parseStatement(); } delete this.context.labelSet[key]; statement = new Node.LabeledStatement(id, body); } else { this.consumeSemicolon(); statement = new Node.ExpressionStatement(expr); } return this.finalize(node, statement); }; Parser2.prototype.parseThrowStatement = function() { var node = this.createNode(); this.expectKeyword("throw"); if (this.hasLineTerminator) { this.throwError(messages_1.Messages.NewlineAfterThrow); } var argument = this.parseExpression(); this.consumeSemicolon(); return this.finalize(node, new Node.ThrowStatement(argument)); }; Parser2.prototype.parseCatchClause = function() { var node = this.createNode(); this.expectKeyword("catch"); this.expect("("); if (this.match(")")) { this.throwUnexpectedToken(this.lookahead); } var params = []; var param = this.parsePattern(params); var paramMap = {}; for (var i5 = 0; i5 < params.length; i5++) { var key = "$" + params[i5].value; if (Object.prototype.hasOwnProperty.call(paramMap, key)) { this.tolerateError(messages_1.Messages.DuplicateBinding, params[i5].value); } paramMap[key] = true; } if (this.context.strict && param.type === syntax_1.Syntax.Identifier) { if (this.scanner.isRestrictedWord(param.name)) { this.tolerateError(messages_1.Messages.StrictCatchVariable); } } this.expect(")"); var body = this.parseBlock(); return this.finalize(node, new Node.CatchClause(param, body)); }; Parser2.prototype.parseFinallyClause = function() { this.expectKeyword("finally"); return this.parseBlock(); }; Parser2.prototype.parseTryStatement = function() { var node = this.createNode(); this.expectKeyword("try"); var block = this.parseBlock(); var handler = this.matchKeyword("catch") ? this.parseCatchClause() : null; var finalizer = this.matchKeyword("finally") ? this.parseFinallyClause() : null; if (!handler && !finalizer) { this.throwError(messages_1.Messages.NoCatchOrFinally); } return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); }; Parser2.prototype.parseDebuggerStatement = function() { var node = this.createNode(); this.expectKeyword("debugger"); this.consumeSemicolon(); return this.finalize(node, new Node.DebuggerStatement()); }; Parser2.prototype.parseStatement = function() { var statement; switch (this.lookahead.type) { case 1: case 5: case 6: case 8: case 10: case 9: statement = this.parseExpressionStatement(); break; case 7: var value = this.lookahead.value; if (value === "{") { statement = this.parseBlock(); } else if (value === "(") { statement = this.parseExpressionStatement(); } else if (value === ";") { statement = this.parseEmptyStatement(); } else { statement = this.parseExpressionStatement(); } break; case 3: statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement(); break; case 4: switch (this.lookahead.value) { case "break": statement = this.parseBreakStatement(); break; case "continue": statement = this.parseContinueStatement(); break; case "debugger": statement = this.parseDebuggerStatement(); break; case "do": statement = this.parseDoWhileStatement(); break; case "for": statement = this.parseForStatement(); break; case "function": statement = this.parseFunctionDeclaration(); break; case "if": statement = this.parseIfStatement(); break; case "return": statement = this.parseReturnStatement(); break; case "switch": statement = this.parseSwitchStatement(); break; case "throw": statement = this.parseThrowStatement(); break; case "try": statement = this.parseTryStatement(); break; case "var": statement = this.parseVariableStatement(); break; case "while": statement = this.parseWhileStatement(); break; case "with": statement = this.parseWithStatement(); break; default: statement = this.parseExpressionStatement(); break; } break; default: statement = this.throwUnexpectedToken(this.lookahead); } return statement; }; Parser2.prototype.parseFunctionSourceElements = function() { var node = this.createNode(); this.expect("{"); var body = this.parseDirectivePrologues(); var previousLabelSet = this.context.labelSet; var previousInIteration = this.context.inIteration; var previousInSwitch = this.context.inSwitch; var previousInFunctionBody = this.context.inFunctionBody; this.context.labelSet = {}; this.context.inIteration = false; this.context.inSwitch = false; this.context.inFunctionBody = true; while (this.lookahead.type !== 2) { if (this.match("}")) { break; } body.push(this.parseStatementListItem()); } this.expect("}"); this.context.labelSet = previousLabelSet; this.context.inIteration = previousInIteration; this.context.inSwitch = previousInSwitch; this.context.inFunctionBody = previousInFunctionBody; return this.finalize(node, new Node.BlockStatement(body)); }; Parser2.prototype.validateParam = function(options, param, name) { var key = "$" + name; if (this.context.strict) { if (this.scanner.isRestrictedWord(name)) { options.stricted = param; options.message = messages_1.Messages.StrictParamName; } if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { options.stricted = param; options.message = messages_1.Messages.StrictParamDupe; } } else if (!options.firstRestricted) { if (this.scanner.isRestrictedWord(name)) { options.firstRestricted = param; options.message = messages_1.Messages.StrictParamName; } else if (this.scanner.isStrictModeReservedWord(name)) { options.firstRestricted = param; options.message = messages_1.Messages.StrictReservedWord; } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { options.stricted = param; options.message = messages_1.Messages.StrictParamDupe; } } if (typeof Object.defineProperty === "function") { Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true }); } else { options.paramSet[key] = true; } }; Parser2.prototype.parseRestElement = function(params) { var node = this.createNode(); this.expect("..."); var arg = this.parsePattern(params); if (this.match("=")) { this.throwError(messages_1.Messages.DefaultRestParameter); } if (!this.match(")")) { this.throwError(messages_1.Messages.ParameterAfterRestParameter); } return this.finalize(node, new Node.RestElement(arg)); }; Parser2.prototype.parseFormalParameter = function(options) { var params = []; var param = this.match("...") ? this.parseRestElement(params) : this.parsePatternWithDefault(params); for (var i5 = 0; i5 < params.length; i5++) { this.validateParam(options, params[i5], params[i5].value); } options.simple = options.simple && param instanceof Node.Identifier; options.params.push(param); }; Parser2.prototype.parseFormalParameters = function(firstRestricted) { var options; options = { simple: true, params: [], firstRestricted }; this.expect("("); if (!this.match(")")) { options.paramSet = {}; while (this.lookahead.type !== 2) { this.parseFormalParameter(options); if (this.match(")")) { break; } this.expect(","); if (this.match(")")) { break; } } } this.expect(")"); return { simple: options.simple, params: options.params, stricted: options.stricted, firstRestricted: options.firstRestricted, message: options.message }; }; Parser2.prototype.matchAsyncFunction = function() { var match = this.matchContextualKeyword("async"); if (match) { var state2 = this.scanner.saveState(); this.scanner.scanComments(); var next = this.scanner.lex(); this.scanner.restoreState(state2); match = state2.lineNumber === next.lineNumber && next.type === 4 && next.value === "function"; } return match; }; Parser2.prototype.parseFunctionDeclaration = function(identifierIsOptional) { var node = this.createNode(); var isAsync = this.matchContextualKeyword("async"); if (isAsync) { this.nextToken(); } this.expectKeyword("function"); var isGenerator = isAsync ? false : this.match("*"); if (isGenerator) { this.nextToken(); } var message; var id = null; var firstRestricted = null; if (!identifierIsOptional || !this.match("(")) { var token = this.lookahead; id = this.parseVariableIdentifier(); if (this.context.strict) { if (this.scanner.isRestrictedWord(token.value)) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); } } else { if (this.scanner.isRestrictedWord(token.value)) { firstRestricted = token; message = messages_1.Messages.StrictFunctionName; } else if (this.scanner.isStrictModeReservedWord(token.value)) { firstRestricted = token; message = messages_1.Messages.StrictReservedWord; } } } var previousAllowAwait = this.context.await; var previousAllowYield = this.context.allowYield; this.context.await = isAsync; this.context.allowYield = !isGenerator; var formalParameters = this.parseFormalParameters(firstRestricted); var params = formalParameters.params; var stricted = formalParameters.stricted; firstRestricted = formalParameters.firstRestricted; if (formalParameters.message) { message = formalParameters.message; } var previousStrict = this.context.strict; var previousAllowStrictDirective = this.context.allowStrictDirective; this.context.allowStrictDirective = formalParameters.simple; var body = this.parseFunctionSourceElements(); if (this.context.strict && firstRestricted) { this.throwUnexpectedToken(firstRestricted, message); } if (this.context.strict && stricted) { this.tolerateUnexpectedToken(stricted, message); } this.context.strict = previousStrict; this.context.allowStrictDirective = previousAllowStrictDirective; this.context.await = previousAllowAwait; this.context.allowYield = previousAllowYield; return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); }; Parser2.prototype.parseFunctionExpression = function() { var node = this.createNode(); var isAsync = this.matchContextualKeyword("async"); if (isAsync) { this.nextToken(); } this.expectKeyword("function"); var isGenerator = isAsync ? false : this.match("*"); if (isGenerator) { this.nextToken(); } var message; var id = null; var firstRestricted; var previousAllowAwait = this.context.await; var previousAllowYield = this.context.allowYield; this.context.await = isAsync; this.context.allowYield = !isGenerator; if (!this.match("(")) { var token = this.lookahead; id = !this.context.strict && !isGenerator && this.matchKeyword("yield") ? this.parseIdentifierName() : this.parseVariableIdentifier(); if (this.context.strict) { if (this.scanner.isRestrictedWord(token.value)) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); } } else { if (this.scanner.isRestrictedWord(token.value)) { firstRestricted = token; message = messages_1.Messages.StrictFunctionName; } else if (this.scanner.isStrictModeReservedWord(token.value)) { firstRestricted = token; message = messages_1.Messages.StrictReservedWord; } } } var formalParameters = this.parseFormalParameters(firstRestricted); var params = formalParameters.params; var stricted = formalParameters.stricted; firstRestricted = formalParameters.firstRestricted; if (formalParameters.message) { message = formalParameters.message; } var previousStrict = this.context.strict; var previousAllowStrictDirective = this.context.allowStrictDirective; this.context.allowStrictDirective = formalParameters.simple; var body = this.parseFunctionSourceElements(); if (this.context.strict && firstRestricted) { this.throwUnexpectedToken(firstRestricted, message); } if (this.context.strict && stricted) { this.tolerateUnexpectedToken(stricted, message); } this.context.strict = previousStrict; this.context.allowStrictDirective = previousAllowStrictDirective; this.context.await = previousAllowAwait; this.context.allowYield = previousAllowYield; return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); }; Parser2.prototype.parseDirective = function() { var token = this.lookahead; var node = this.createNode(); var expr = this.parseExpression(); var directive = expr.type === syntax_1.Syntax.Literal ? this.getTokenRaw(token).slice(1, -1) : null; this.consumeSemicolon(); return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); }; Parser2.prototype.parseDirectivePrologues = function() { var firstRestricted = null; var body = []; while (true) { var token = this.lookahead; if (token.type !== 8) { break; } var statement = this.parseDirective(); body.push(statement); var directive = statement.directive; if (typeof directive !== "string") { break; } if (directive === "use strict") { this.context.strict = true; if (firstRestricted) { this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral); } if (!this.context.allowStrictDirective) { this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective); } } else { if (!firstRestricted && token.octal) { firstRestricted = token; } } } return body; }; Parser2.prototype.qualifiedPropertyName = function(token) { switch (token.type) { case 3: case 8: case 1: case 5: case 6: case 4: return true; case 7: return token.value === "["; default: break; } return false; }; Parser2.prototype.parseGetterMethod = function() { var node = this.createNode(); var isGenerator = false; var previousAllowYield = this.context.allowYield; this.context.allowYield = !isGenerator; var formalParameters = this.parseFormalParameters(); if (formalParameters.params.length > 0) { this.tolerateError(messages_1.Messages.BadGetterArity); } var method = this.parsePropertyMethod(formalParameters); this.context.allowYield = previousAllowYield; return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); }; Parser2.prototype.parseSetterMethod = function() { var node = this.createNode(); var isGenerator = false; var previousAllowYield = this.context.allowYield; this.context.allowYield = !isGenerator; var formalParameters = this.parseFormalParameters(); if (formalParameters.params.length !== 1) { this.tolerateError(messages_1.Messages.BadSetterArity); } else if (formalParameters.params[0] instanceof Node.RestElement) { this.tolerateError(messages_1.Messages.BadSetterRestParameter); } var method = this.parsePropertyMethod(formalParameters); this.context.allowYield = previousAllowYield; return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); }; Parser2.prototype.parseGeneratorMethod = function() { var node = this.createNode(); var isGenerator = true; var previousAllowYield = this.context.allowYield; this.context.allowYield = true; var params = this.parseFormalParameters(); this.context.allowYield = false; var method = this.parsePropertyMethod(params); this.context.allowYield = previousAllowYield; return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); }; Parser2.prototype.isStartOfExpression = function() { var start = true; var value = this.lookahead.value; switch (this.lookahead.type) { case 7: start = value === "[" || value === "(" || value === "{" || value === "+" || value === "-" || value === "!" || value === "~" || value === "++" || value === "--" || value === "/" || value === "/="; break; case 4: start = value === "class" || value === "delete" || value === "function" || value === "let" || value === "new" || value === "super" || value === "this" || value === "typeof" || value === "void" || value === "yield"; break; default: break; } return start; }; Parser2.prototype.parseYieldExpression = function() { var node = this.createNode(); this.expectKeyword("yield"); var argument = null; var delegate = false; if (!this.hasLineTerminator) { var previousAllowYield = this.context.allowYield; this.context.allowYield = false; delegate = this.match("*"); if (delegate) { this.nextToken(); argument = this.parseAssignmentExpression(); } else if (this.isStartOfExpression()) { argument = this.parseAssignmentExpression(); } this.context.allowYield = previousAllowYield; } return this.finalize(node, new Node.YieldExpression(argument, delegate)); }; Parser2.prototype.parseClassElement = function(hasConstructor) { var token = this.lookahead; var node = this.createNode(); var kind = ""; var key = null; var value = null; var computed = false; var method = false; var isStatic = false; var isAsync = false; if (this.match("*")) { this.nextToken(); } else { computed = this.match("["); key = this.parseObjectPropertyKey(); var id = key; if (id.name === "static" && (this.qualifiedPropertyName(this.lookahead) || this.match("*"))) { token = this.lookahead; isStatic = true; computed = this.match("["); if (this.match("*")) { this.nextToken(); } else { key = this.parseObjectPropertyKey(); } } if (token.type === 3 && !this.hasLineTerminator && token.value === "async") { var punctuator = this.lookahead.value; if (punctuator !== ":" && punctuator !== "(" && punctuator !== "*") { isAsync = true; token = this.lookahead; key = this.parseObjectPropertyKey(); if (token.type === 3 && token.value === "constructor") { this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync); } } } } var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); if (token.type === 3) { if (token.value === "get" && lookaheadPropertyKey) { kind = "get"; computed = this.match("["); key = this.parseObjectPropertyKey(); this.context.allowYield = false; value = this.parseGetterMethod(); } else if (token.value === "set" && lookaheadPropertyKey) { kind = "set"; computed = this.match("["); key = this.parseObjectPropertyKey(); value = this.parseSetterMethod(); } } else if (token.type === 7 && token.value === "*" && lookaheadPropertyKey) { kind = "init"; computed = this.match("["); key = this.parseObjectPropertyKey(); value = this.parseGeneratorMethod(); method = true; } if (!kind && key && this.match("(")) { kind = "init"; value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); method = true; } if (!kind) { this.throwUnexpectedToken(this.lookahead); } if (kind === "init") { kind = "method"; } if (!computed) { if (isStatic && this.isPropertyKey(key, "prototype")) { this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype); } if (!isStatic && this.isPropertyKey(key, "constructor")) { if (kind !== "method" || !method || value && value.generator) { this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod); } if (hasConstructor.value) { this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor); } else { hasConstructor.value = true; } kind = "constructor"; } } return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic)); }; Parser2.prototype.parseClassElementList = function() { var body = []; var hasConstructor = { value: false }; this.expect("{"); while (!this.match("}")) { if (this.match(";")) { this.nextToken(); } else { body.push(this.parseClassElement(hasConstructor)); } } this.expect("}"); return body; }; Parser2.prototype.parseClassBody = function() { var node = this.createNode(); var elementList = this.parseClassElementList(); return this.finalize(node, new Node.ClassBody(elementList)); }; Parser2.prototype.parseClassDeclaration = function(identifierIsOptional) { var node = this.createNode(); var previousStrict = this.context.strict; this.context.strict = true; this.expectKeyword("class"); var id = identifierIsOptional && this.lookahead.type !== 3 ? null : this.parseVariableIdentifier(); var superClass = null; if (this.matchKeyword("extends")) { this.nextToken(); superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); } var classBody = this.parseClassBody(); this.context.strict = previousStrict; return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); }; Parser2.prototype.parseClassExpression = function() { var node = this.createNode(); var previousStrict = this.context.strict; this.context.strict = true; this.expectKeyword("class"); var id = this.lookahead.type === 3 ? this.parseVariableIdentifier() : null; var superClass = null; if (this.matchKeyword("extends")) { this.nextToken(); superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); } var classBody = this.parseClassBody(); this.context.strict = previousStrict; return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); }; Parser2.prototype.parseModule = function() { this.context.strict = true; this.context.isModule = true; this.scanner.isModule = true; var node = this.createNode(); var body = this.parseDirectivePrologues(); while (this.lookahead.type !== 2) { body.push(this.parseStatementListItem()); } return this.finalize(node, new Node.Module(body)); }; Parser2.prototype.parseScript = function() { var node = this.createNode(); var body = this.parseDirectivePrologues(); while (this.lookahead.type !== 2) { body.push(this.parseStatementListItem()); } return this.finalize(node, new Node.Script(body)); }; Parser2.prototype.parseModuleSpecifier = function() { var node = this.createNode(); if (this.lookahead.type !== 8) { this.throwError(messages_1.Messages.InvalidModuleSpecifier); } var token = this.nextToken(); var raw = this.getTokenRaw(token); return this.finalize(node, new Node.Literal(token.value, raw)); }; Parser2.prototype.parseImportSpecifier = function() { var node = this.createNode(); var imported; var local; if (this.lookahead.type === 3) { imported = this.parseVariableIdentifier(); local = imported; if (this.matchContextualKeyword("as")) { this.nextToken(); local = this.parseVariableIdentifier(); } } else { imported = this.parseIdentifierName(); local = imported; if (this.matchContextualKeyword("as")) { this.nextToken(); local = this.parseVariableIdentifier(); } else { this.throwUnexpectedToken(this.nextToken()); } } return this.finalize(node, new Node.ImportSpecifier(local, imported)); }; Parser2.prototype.parseNamedImports = function() { this.expect("{"); var specifiers = []; while (!this.match("}")) { specifiers.push(this.parseImportSpecifier()); if (!this.match("}")) { this.expect(","); } } this.expect("}"); return specifiers; }; Parser2.prototype.parseImportDefaultSpecifier = function() { var node = this.createNode(); var local = this.parseIdentifierName(); return this.finalize(node, new Node.ImportDefaultSpecifier(local)); }; Parser2.prototype.parseImportNamespaceSpecifier = function() { var node = this.createNode(); this.expect("*"); if (!this.matchContextualKeyword("as")) { this.throwError(messages_1.Messages.NoAsAfterImportNamespace); } this.nextToken(); var local = this.parseIdentifierName(); return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); }; Parser2.prototype.parseImportDeclaration = function() { if (this.context.inFunctionBody) { this.throwError(messages_1.Messages.IllegalImportDeclaration); } var node = this.createNode(); this.expectKeyword("import"); var src; var specifiers = []; if (this.lookahead.type === 8) { src = this.parseModuleSpecifier(); } else { if (this.match("{")) { specifiers = specifiers.concat(this.parseNamedImports()); } else if (this.match("*")) { specifiers.push(this.parseImportNamespaceSpecifier()); } else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword("default")) { specifiers.push(this.parseImportDefaultSpecifier()); if (this.match(",")) { this.nextToken(); if (this.match("*")) { specifiers.push(this.parseImportNamespaceSpecifier()); } else if (this.match("{")) { specifiers = specifiers.concat(this.parseNamedImports()); } else { this.throwUnexpectedToken(this.lookahead); } } } else { this.throwUnexpectedToken(this.nextToken()); } if (!this.matchContextualKeyword("from")) { var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; this.throwError(message, this.lookahead.value); } this.nextToken(); src = this.parseModuleSpecifier(); } this.consumeSemicolon(); return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); }; Parser2.prototype.parseExportSpecifier = function() { var node = this.createNode(); var local = this.parseIdentifierName(); var exported = local; if (this.matchContextualKeyword("as")) { this.nextToken(); exported = this.parseIdentifierName(); } return this.finalize(node, new Node.ExportSpecifier(local, exported)); }; Parser2.prototype.parseExportDeclaration = function() { if (this.context.inFunctionBody) { this.throwError(messages_1.Messages.IllegalExportDeclaration); } var node = this.createNode(); this.expectKeyword("export"); var exportDeclaration; if (this.matchKeyword("default")) { this.nextToken(); if (this.matchKeyword("function")) { var declaration = this.parseFunctionDeclaration(true); exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); } else if (this.matchKeyword("class")) { var declaration = this.parseClassDeclaration(true); exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); } else if (this.matchContextualKeyword("async")) { var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); } else { if (this.matchContextualKeyword("from")) { this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); } var declaration = this.match("{") ? this.parseObjectInitializer() : this.match("[") ? this.parseArrayInitializer() : this.parseAssignmentExpression(); this.consumeSemicolon(); exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); } } else if (this.match("*")) { this.nextToken(); if (!this.matchContextualKeyword("from")) { var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; this.throwError(message, this.lookahead.value); } this.nextToken(); var src = this.parseModuleSpecifier(); this.consumeSemicolon(); exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); } else if (this.lookahead.type === 4) { var declaration = void 0; switch (this.lookahead.value) { case "let": case "const": declaration = this.parseLexicalDeclaration({ inFor: false }); break; case "var": case "class": case "function": declaration = this.parseStatementListItem(); break; default: this.throwUnexpectedToken(this.lookahead); } exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); } else if (this.matchAsyncFunction()) { var declaration = this.parseFunctionDeclaration(); exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); } else { var specifiers = []; var source = null; var isExportFromIdentifier = false; this.expect("{"); while (!this.match("}")) { isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword("default"); specifiers.push(this.parseExportSpecifier()); if (!this.match("}")) { this.expect(","); } } this.expect("}"); if (this.matchContextualKeyword("from")) { this.nextToken(); source = this.parseModuleSpecifier(); this.consumeSemicolon(); } else if (isExportFromIdentifier) { var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; this.throwError(message, this.lookahead.value); } else { this.consumeSemicolon(); } exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); } return exportDeclaration; }; return Parser2; })(); exports3.Parser = Parser; }, /* 9 */ /***/ function(module3, exports3) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); function assert4(condition, message) { if (!condition) { throw new Error("ASSERT: " + message); } } exports3.assert = assert4; }, /* 10 */ /***/ function(module3, exports3) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); var ErrorHandler = (function() { function ErrorHandler2() { this.errors = []; this.tolerant = false; } ErrorHandler2.prototype.recordError = function(error3) { this.errors.push(error3); }; ErrorHandler2.prototype.tolerate = function(error3) { if (this.tolerant) { this.recordError(error3); } else { throw error3; } }; ErrorHandler2.prototype.constructError = function(msg, column) { var error3 = new Error(msg); try { throw error3; } catch (base) { if (Object.create && Object.defineProperty) { error3 = Object.create(base); Object.defineProperty(error3, "column", { value: column }); } } return error3; }; ErrorHandler2.prototype.createError = function(index, line, col, description) { var msg = "Line " + line + ": " + description; var error3 = this.constructError(msg, col); error3.index = index; error3.lineNumber = line; error3.description = description; return error3; }; ErrorHandler2.prototype.throwError = function(index, line, col, description) { throw this.createError(index, line, col, description); }; ErrorHandler2.prototype.tolerateError = function(index, line, col, description) { var error3 = this.createError(index, line, col, description); if (this.tolerant) { this.recordError(error3); } else { throw error3; } }; return ErrorHandler2; })(); exports3.ErrorHandler = ErrorHandler; }, /* 11 */ /***/ function(module3, exports3) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); exports3.Messages = { BadGetterArity: "Getter must not have any formal parameters", BadSetterArity: "Setter must have exactly one formal parameter", BadSetterRestParameter: "Setter function argument must not be a rest parameter", ConstructorIsAsync: "Class constructor may not be an async method", ConstructorSpecialMethod: "Class constructor may not be an accessor", DeclarationMissingInitializer: "Missing initializer in %0 declaration", DefaultRestParameter: "Unexpected token =", DuplicateBinding: "Duplicate binding %0", DuplicateConstructor: "A class may only have one constructor", DuplicateProtoProperty: "Duplicate __proto__ fields are not allowed in object literals", ForInOfLoopInitializer: "%0 loop variable declaration may not have an initializer", GeneratorInLegacyContext: "Generator declarations are not allowed in legacy contexts", IllegalBreak: "Illegal break statement", IllegalContinue: "Illegal continue statement", IllegalExportDeclaration: "Unexpected token", IllegalImportDeclaration: "Unexpected token", IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list", IllegalReturn: "Illegal return statement", InvalidEscapedReservedWord: "Keyword must not contain escaped characters", InvalidHexEscapeSequence: "Invalid hexadecimal escape sequence", InvalidLHSInAssignment: "Invalid left-hand side in assignment", InvalidLHSInForIn: "Invalid left-hand side in for-in", InvalidLHSInForLoop: "Invalid left-hand side in for-loop", InvalidModuleSpecifier: "Unexpected token", InvalidRegExp: "Invalid regular expression", LetInLexicalBinding: "let is disallowed as a lexically bound name", MissingFromClause: "Unexpected token", MultipleDefaultsInSwitch: "More than one default clause in switch statement", NewlineAfterThrow: "Illegal newline after throw", NoAsAfterImportNamespace: "Unexpected token", NoCatchOrFinally: "Missing catch or finally after try", ParameterAfterRestParameter: "Rest parameter must be last formal parameter", Redeclaration: "%0 '%1' has already been declared", StaticPrototype: "Classes may not have static property named prototype", StrictCatchVariable: "Catch variable may not be eval or arguments in strict mode", StrictDelete: "Delete of an unqualified identifier in strict mode.", StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block", StrictFunctionName: "Function name may not be eval or arguments in strict mode", StrictLHSAssignment: "Assignment to eval or arguments is not allowed in strict mode", StrictLHSPostfix: "Postfix increment/decrement may not have eval or arguments operand in strict mode", StrictLHSPrefix: "Prefix increment/decrement may not have eval or arguments operand in strict mode", StrictModeWith: "Strict mode code may not include a with statement", StrictOctalLiteral: "Octal literals are not allowed in strict mode.", StrictParamDupe: "Strict mode function may not have duplicate parameter names", StrictParamName: "Parameter name eval or arguments is not allowed in strict mode", StrictReservedWord: "Use of future reserved word in strict mode", StrictVarName: "Variable name may not be eval or arguments in strict mode", TemplateOctalLiteral: "Octal literals are not allowed in template strings.", UnexpectedEOS: "Unexpected end of input", UnexpectedIdentifier: "Unexpected identifier", UnexpectedNumber: "Unexpected number", UnexpectedReserved: "Unexpected reserved word", UnexpectedString: "Unexpected string", UnexpectedTemplate: "Unexpected quasi %0", UnexpectedToken: "Unexpected token %0", UnexpectedTokenIllegal: "Unexpected token ILLEGAL", UnknownLabel: "Undefined label '%0'", UnterminatedRegExp: "Invalid regular expression: missing /" }; }, /* 12 */ /***/ function(module3, exports3, __webpack_require__) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); var assert_1 = __webpack_require__(9); var character_1 = __webpack_require__(4); var messages_1 = __webpack_require__(11); function hexValue(ch) { return "0123456789abcdef".indexOf(ch.toLowerCase()); } function octalValue(ch) { return "01234567".indexOf(ch); } var Scanner = (function() { function Scanner2(code, handler) { this.source = code; this.errorHandler = handler; this.trackComment = false; this.isModule = false; this.length = code.length; this.index = 0; this.lineNumber = code.length > 0 ? 1 : 0; this.lineStart = 0; this.curlyStack = []; } Scanner2.prototype.saveState = function() { return { index: this.index, lineNumber: this.lineNumber, lineStart: this.lineStart }; }; Scanner2.prototype.restoreState = function(state2) { this.index = state2.index; this.lineNumber = state2.lineNumber; this.lineStart = state2.lineStart; }; Scanner2.prototype.eof = function() { return this.index >= this.length; }; Scanner2.prototype.throwUnexpectedToken = function(message) { if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); }; Scanner2.prototype.tolerateUnexpectedToken = function(message) { if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); }; Scanner2.prototype.skipSingleLineComment = function(offset) { var comments = []; var start, loc; if (this.trackComment) { comments = []; start = this.index - offset; loc = { start: { line: this.lineNumber, column: this.index - this.lineStart - offset }, end: {} }; } while (!this.eof()) { var ch = this.source.charCodeAt(this.index); ++this.index; if (character_1.Character.isLineTerminator(ch)) { if (this.trackComment) { loc.end = { line: this.lineNumber, column: this.index - this.lineStart - 1 }; var entry = { multiLine: false, slice: [start + offset, this.index - 1], range: [start, this.index - 1], loc }; comments.push(entry); } if (ch === 13 && this.source.charCodeAt(this.index) === 10) { ++this.index; } ++this.lineNumber; this.lineStart = this.index; return comments; } } if (this.trackComment) { loc.end = { line: this.lineNumber, column: this.index - this.lineStart }; var entry = { multiLine: false, slice: [start + offset, this.index], range: [start, this.index], loc }; comments.push(entry); } return comments; }; Scanner2.prototype.skipMultiLineComment = function() { var comments = []; var start, loc; if (this.trackComment) { comments = []; start = this.index - 2; loc = { start: { line: this.lineNumber, column: this.index - this.lineStart - 2 }, end: {} }; } while (!this.eof()) { var ch = this.source.charCodeAt(this.index); if (character_1.Character.isLineTerminator(ch)) { if (ch === 13 && this.source.charCodeAt(this.index + 1) === 10) { ++this.index; } ++this.lineNumber; ++this.index; this.lineStart = this.index; } else if (ch === 42) { if (this.source.charCodeAt(this.index + 1) === 47) { this.index += 2; if (this.trackComment) { loc.end = { line: this.lineNumber, column: this.index - this.lineStart }; var entry = { multiLine: true, slice: [start + 2, this.index - 2], range: [start, this.index], loc }; comments.push(entry); } return comments; } ++this.index; } else { ++this.index; } } if (this.trackComment) { loc.end = { line: this.lineNumber, column: this.index - this.lineStart }; var entry = { multiLine: true, slice: [start + 2, this.index], range: [start, this.index], loc }; comments.push(entry); } this.tolerateUnexpectedToken(); return comments; }; Scanner2.prototype.scanComments = function() { var comments; if (this.trackComment) { comments = []; } var start = this.index === 0; while (!this.eof()) { var ch = this.source.charCodeAt(this.index); if (character_1.Character.isWhiteSpace(ch)) { ++this.index; } else if (character_1.Character.isLineTerminator(ch)) { ++this.index; if (ch === 13 && this.source.charCodeAt(this.index) === 10) { ++this.index; } ++this.lineNumber; this.lineStart = this.index; start = true; } else if (ch === 47) { ch = this.source.charCodeAt(this.index + 1); if (ch === 47) { this.index += 2; var comment = this.skipSingleLineComment(2); if (this.trackComment) { comments = comments.concat(comment); } start = true; } else if (ch === 42) { this.index += 2; var comment = this.skipMultiLineComment(); if (this.trackComment) { comments = comments.concat(comment); } } else { break; } } else if (start && ch === 45) { if (this.source.charCodeAt(this.index + 1) === 45 && this.source.charCodeAt(this.index + 2) === 62) { this.index += 3; var comment = this.skipSingleLineComment(3); if (this.trackComment) { comments = comments.concat(comment); } } else { break; } } else if (ch === 60 && !this.isModule) { if (this.source.slice(this.index + 1, this.index + 4) === "!--") { this.index += 4; var comment = this.skipSingleLineComment(4); if (this.trackComment) { comments = comments.concat(comment); } } else { break; } } else { break; } } return comments; }; Scanner2.prototype.isFutureReservedWord = function(id) { switch (id) { case "enum": case "export": case "import": case "super": return true; default: return false; } }; Scanner2.prototype.isStrictModeReservedWord = function(id) { switch (id) { case "implements": case "interface": case "package": case "private": case "protected": case "public": case "static": case "yield": case "let": return true; default: return false; } }; Scanner2.prototype.isRestrictedWord = function(id) { return id === "eval" || id === "arguments"; }; Scanner2.prototype.isKeyword = function(id) { switch (id.length) { case 2: return id === "if" || id === "in" || id === "do"; case 3: return id === "var" || id === "for" || id === "new" || id === "try" || id === "let"; case 4: return id === "this" || id === "else" || id === "case" || id === "void" || id === "with" || id === "enum"; case 5: return id === "while" || id === "break" || id === "catch" || id === "throw" || id === "const" || id === "yield" || id === "class" || id === "super"; case 6: return id === "return" || id === "typeof" || id === "delete" || id === "switch" || id === "export" || id === "import"; case 7: return id === "default" || id === "finally" || id === "extends"; case 8: return id === "function" || id === "continue" || id === "debugger"; case 10: return id === "instanceof"; default: return false; } }; Scanner2.prototype.codePointAt = function(i5) { var cp = this.source.charCodeAt(i5); if (cp >= 55296 && cp <= 56319) { var second = this.source.charCodeAt(i5 + 1); if (second >= 56320 && second <= 57343) { var first = cp; cp = (first - 55296) * 1024 + second - 56320 + 65536; } } return cp; }; Scanner2.prototype.scanHexEscape = function(prefix) { var len = prefix === "u" ? 4 : 2; var code = 0; for (var i5 = 0; i5 < len; ++i5) { if (!this.eof() && character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) { code = code * 16 + hexValue(this.source[this.index++]); } else { return null; } } return String.fromCharCode(code); }; Scanner2.prototype.scanUnicodeCodePointEscape = function() { var ch = this.source[this.index]; var code = 0; if (ch === "}") { this.throwUnexpectedToken(); } while (!this.eof()) { ch = this.source[this.index++]; if (!character_1.Character.isHexDigit(ch.charCodeAt(0))) { break; } code = code * 16 + hexValue(ch); } if (code > 1114111 || ch !== "}") { this.throwUnexpectedToken(); } return character_1.Character.fromCodePoint(code); }; Scanner2.prototype.getIdentifier = function() { var start = this.index++; while (!this.eof()) { var ch = this.source.charCodeAt(this.index); if (ch === 92) { this.index = start; return this.getComplexIdentifier(); } else if (ch >= 55296 && ch < 57343) { this.index = start; return this.getComplexIdentifier(); } if (character_1.Character.isIdentifierPart(ch)) { ++this.index; } else { break; } } return this.source.slice(start, this.index); }; Scanner2.prototype.getComplexIdentifier = function() { var cp = this.codePointAt(this.index); var id = character_1.Character.fromCodePoint(cp); this.index += id.length; var ch; if (cp === 92) { if (this.source.charCodeAt(this.index) !== 117) { this.throwUnexpectedToken(); } ++this.index; if (this.source[this.index] === "{") { ++this.index; ch = this.scanUnicodeCodePointEscape(); } else { ch = this.scanHexEscape("u"); if (ch === null || ch === "\\" || !character_1.Character.isIdentifierStart(ch.charCodeAt(0))) { this.throwUnexpectedToken(); } } id = ch; } while (!this.eof()) { cp = this.codePointAt(this.index); if (!character_1.Character.isIdentifierPart(cp)) { break; } ch = character_1.Character.fromCodePoint(cp); id += ch; this.index += ch.length; if (cp === 92) { id = id.substr(0, id.length - 1); if (this.source.charCodeAt(this.index) !== 117) { this.throwUnexpectedToken(); } ++this.index; if (this.source[this.index] === "{") { ++this.index; ch = this.scanUnicodeCodePointEscape(); } else { ch = this.scanHexEscape("u"); if (ch === null || ch === "\\" || !character_1.Character.isIdentifierPart(ch.charCodeAt(0))) { this.throwUnexpectedToken(); } } id += ch; } } return id; }; Scanner2.prototype.octalToDecimal = function(ch) { var octal = ch !== "0"; var code = octalValue(ch); if (!this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) { octal = true; code = code * 8 + octalValue(this.source[this.index++]); if ("0123".indexOf(ch) >= 0 && !this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) { code = code * 8 + octalValue(this.source[this.index++]); } } return { code, octal }; }; Scanner2.prototype.scanIdentifier = function() { var type; var start = this.index; var id = this.source.charCodeAt(start) === 92 ? this.getComplexIdentifier() : this.getIdentifier(); if (id.length === 1) { type = 3; } else if (this.isKeyword(id)) { type = 4; } else if (id === "null") { type = 5; } else if (id === "true" || id === "false") { type = 1; } else { type = 3; } if (type !== 3 && start + id.length !== this.index) { var restore = this.index; this.index = start; this.tolerateUnexpectedToken(messages_1.Messages.InvalidEscapedReservedWord); this.index = restore; } return { type, value: id, lineNumber: this.lineNumber, lineStart: this.lineStart, start, end: this.index }; }; Scanner2.prototype.scanPunctuator = function() { var start = this.index; var str = this.source[this.index]; switch (str) { case "(": case "{": if (str === "{") { this.curlyStack.push("{"); } ++this.index; break; case ".": ++this.index; if (this.source[this.index] === "." && this.source[this.index + 1] === ".") { this.index += 2; str = "..."; } break; case "}": ++this.index; this.curlyStack.pop(); break; case ")": case ";": case ",": case "[": case "]": case ":": case "?": case "~": ++this.index; break; default: str = this.source.substr(this.index, 4); if (str === ">>>=") { this.index += 4; } else { str = str.substr(0, 3); if (str === "===" || str === "!==" || str === ">>>" || str === "<<=" || str === ">>=" || str === "**=") { this.index += 3; } else { str = str.substr(0, 2); if (str === "&&" || str === "||" || str === "==" || str === "!=" || str === "+=" || str === "-=" || str === "*=" || str === "/=" || str === "++" || str === "--" || str === "<<" || str === ">>" || str === "&=" || str === "|=" || str === "^=" || str === "%=" || str === "<=" || str === ">=" || str === "=>" || str === "**") { this.index += 2; } else { str = this.source[this.index]; if ("<>=!+-*%&|^/".indexOf(str) >= 0) { ++this.index; } } } } } if (this.index === start) { this.throwUnexpectedToken(); } return { type: 7, value: str, lineNumber: this.lineNumber, lineStart: this.lineStart, start, end: this.index }; }; Scanner2.prototype.scanHexLiteral = function(start) { var num = ""; while (!this.eof()) { if (!character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) { break; } num += this.source[this.index++]; } if (num.length === 0) { this.throwUnexpectedToken(); } if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) { this.throwUnexpectedToken(); } return { type: 6, value: parseInt("0x" + num, 16), lineNumber: this.lineNumber, lineStart: this.lineStart, start, end: this.index }; }; Scanner2.prototype.scanBinaryLiteral = function(start) { var num = ""; var ch; while (!this.eof()) { ch = this.source[this.index]; if (ch !== "0" && ch !== "1") { break; } num += this.source[this.index++]; } if (num.length === 0) { this.throwUnexpectedToken(); } if (!this.eof()) { ch = this.source.charCodeAt(this.index); if (character_1.Character.isIdentifierStart(ch) || character_1.Character.isDecimalDigit(ch)) { this.throwUnexpectedToken(); } } return { type: 6, value: parseInt(num, 2), lineNumber: this.lineNumber, lineStart: this.lineStart, start, end: this.index }; }; Scanner2.prototype.scanOctalLiteral = function(prefix, start) { var num = ""; var octal = false; if (character_1.Character.isOctalDigit(prefix.charCodeAt(0))) { octal = true; num = "0" + this.source[this.index++]; } else { ++this.index; } while (!this.eof()) { if (!character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) { break; } num += this.source[this.index++]; } if (!octal && num.length === 0) { this.throwUnexpectedToken(); } if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index)) || character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) { this.throwUnexpectedToken(); } return { type: 6, value: parseInt(num, 8), octal, lineNumber: this.lineNumber, lineStart: this.lineStart, start, end: this.index }; }; Scanner2.prototype.isImplicitOctalLiteral = function() { for (var i5 = this.index + 1; i5 < this.length; ++i5) { var ch = this.source[i5]; if (ch === "8" || ch === "9") { return false; } if (!character_1.Character.isOctalDigit(ch.charCodeAt(0))) { return true; } } return true; }; Scanner2.prototype.scanNumericLiteral = function() { var start = this.index; var ch = this.source[start]; assert_1.assert(character_1.Character.isDecimalDigit(ch.charCodeAt(0)) || ch === ".", "Numeric literal must start with a decimal digit or a decimal point"); var num = ""; if (ch !== ".") { num = this.source[this.index++]; ch = this.source[this.index]; if (num === "0") { if (ch === "x" || ch === "X") { ++this.index; return this.scanHexLiteral(start); } if (ch === "b" || ch === "B") { ++this.index; return this.scanBinaryLiteral(start); } if (ch === "o" || ch === "O") { return this.scanOctalLiteral(ch, start); } if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) { if (this.isImplicitOctalLiteral()) { return this.scanOctalLiteral(ch, start); } } } while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) { num += this.source[this.index++]; } ch = this.source[this.index]; } if (ch === ".") { num += this.source[this.index++]; while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) { num += this.source[this.index++]; } ch = this.source[this.index]; } if (ch === "e" || ch === "E") { num += this.source[this.index++]; ch = this.source[this.index]; if (ch === "+" || ch === "-") { num += this.source[this.index++]; } if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) { while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) { num += this.source[this.index++]; } } else { this.throwUnexpectedToken(); } } if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) { this.throwUnexpectedToken(); } return { type: 6, value: parseFloat(num), lineNumber: this.lineNumber, lineStart: this.lineStart, start, end: this.index }; }; Scanner2.prototype.scanStringLiteral = function() { var start = this.index; var quote = this.source[start]; assert_1.assert(quote === "'" || quote === '"', "String literal must starts with a quote"); ++this.index; var octal = false; var str = ""; while (!this.eof()) { var ch = this.source[this.index++]; if (ch === quote) { quote = ""; break; } else if (ch === "\\") { ch = this.source[this.index++]; if (!ch || !character_1.Character.isLineTerminator(ch.charCodeAt(0))) { switch (ch) { case "u": if (this.source[this.index] === "{") { ++this.index; str += this.scanUnicodeCodePointEscape(); } else { var unescaped_1 = this.scanHexEscape(ch); if (unescaped_1 === null) { this.throwUnexpectedToken(); } str += unescaped_1; } break; case "x": var unescaped = this.scanHexEscape(ch); if (unescaped === null) { this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence); } str += unescaped; break; case "n": str += "\n"; break; case "r": str += "\r"; break; case "t": str += " "; break; case "b": str += "\b"; break; case "f": str += "\f"; break; case "v": str += "\v"; break; case "8": case "9": str += ch; this.tolerateUnexpectedToken(); break; default: if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) { var octToDec = this.octalToDecimal(ch); octal = octToDec.octal || octal; str += String.fromCharCode(octToDec.code); } else { str += ch; } break; } } else { ++this.lineNumber; if (ch === "\r" && this.source[this.index] === "\n") { ++this.index; } this.lineStart = this.index; } } else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { break; } else { str += ch; } } if (quote !== "") { this.index = start; this.throwUnexpectedToken(); } return { type: 8, value: str, octal, lineNumber: this.lineNumber, lineStart: this.lineStart, start, end: this.index }; }; Scanner2.prototype.scanTemplate = function() { var cooked = ""; var terminated = false; var start = this.index; var head = this.source[start] === "`"; var tail = false; var rawOffset = 2; ++this.index; while (!this.eof()) { var ch = this.source[this.index++]; if (ch === "`") { rawOffset = 1; tail = true; terminated = true; break; } else if (ch === "$") { if (this.source[this.index] === "{") { this.curlyStack.push("${"); ++this.index; terminated = true; break; } cooked += ch; } else if (ch === "\\") { ch = this.source[this.index++]; if (!character_1.Character.isLineTerminator(ch.charCodeAt(0))) { switch (ch) { case "n": cooked += "\n"; break; case "r": cooked += "\r"; break; case "t": cooked += " "; break; case "u": if (this.source[this.index] === "{") { ++this.index; cooked += this.scanUnicodeCodePointEscape(); } else { var restore = this.index; var unescaped_2 = this.scanHexEscape(ch); if (unescaped_2 !== null) { cooked += unescaped_2; } else { this.index = restore; cooked += ch; } } break; case "x": var unescaped = this.scanHexEscape(ch); if (unescaped === null) { this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence); } cooked += unescaped; break; case "b": cooked += "\b"; break; case "f": cooked += "\f"; break; case "v": cooked += "\v"; break; default: if (ch === "0") { if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) { this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral); } cooked += "\0"; } else if (character_1.Character.isOctalDigit(ch.charCodeAt(0))) { this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral); } else { cooked += ch; } break; } } else { ++this.lineNumber; if (ch === "\r" && this.source[this.index] === "\n") { ++this.index; } this.lineStart = this.index; } } else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { ++this.lineNumber; if (ch === "\r" && this.source[this.index] === "\n") { ++this.index; } this.lineStart = this.index; cooked += "\n"; } else { cooked += ch; } } if (!terminated) { this.throwUnexpectedToken(); } if (!head) { this.curlyStack.pop(); } return { type: 10, value: this.source.slice(start + 1, this.index - rawOffset), cooked, head, tail, lineNumber: this.lineNumber, lineStart: this.lineStart, start, end: this.index }; }; Scanner2.prototype.testRegExp = function(pattern, flags) { var astralSubstitute = "\uFFFF"; var tmp = pattern; var self = this; if (flags.indexOf("u") >= 0) { tmp = tmp.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function($0, $1, $2) { var codePoint = parseInt($1 || $2, 16); if (codePoint > 1114111) { self.throwUnexpectedToken(messages_1.Messages.InvalidRegExp); } if (codePoint <= 65535) { return String.fromCharCode(codePoint); } return astralSubstitute; }).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, astralSubstitute); } try { RegExp(tmp); } catch (e5) { this.throwUnexpectedToken(messages_1.Messages.InvalidRegExp); } try { return new RegExp(pattern, flags); } catch (exception) { return null; } }; Scanner2.prototype.scanRegExpBody = function() { var ch = this.source[this.index]; assert_1.assert(ch === "/", "Regular expression literal must start with a slash"); var str = this.source[this.index++]; var classMarker = false; var terminated = false; while (!this.eof()) { ch = this.source[this.index++]; str += ch; if (ch === "\\") { ch = this.source[this.index++]; if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp); } str += ch; } else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp); } else if (classMarker) { if (ch === "]") { classMarker = false; } } else { if (ch === "/") { terminated = true; break; } else if (ch === "[") { classMarker = true; } } } if (!terminated) { this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp); } return str.substr(1, str.length - 2); }; Scanner2.prototype.scanRegExpFlags = function() { var str = ""; var flags = ""; while (!this.eof()) { var ch = this.source[this.index]; if (!character_1.Character.isIdentifierPart(ch.charCodeAt(0))) { break; } ++this.index; if (ch === "\\" && !this.eof()) { ch = this.source[this.index]; if (ch === "u") { ++this.index; var restore = this.index; var char = this.scanHexEscape("u"); if (char !== null) { flags += char; for (str += "\\u"; restore < this.index; ++restore) { str += this.source[restore]; } } else { this.index = restore; flags += "u"; str += "\\u"; } this.tolerateUnexpectedToken(); } else { str += "\\"; this.tolerateUnexpectedToken(); } } else { flags += ch; str += ch; } } return flags; }; Scanner2.prototype.scanRegExp = function() { var start = this.index; var pattern = this.scanRegExpBody(); var flags = this.scanRegExpFlags(); var value = this.testRegExp(pattern, flags); return { type: 9, value: "", pattern, flags, regex: value, lineNumber: this.lineNumber, lineStart: this.lineStart, start, end: this.index }; }; Scanner2.prototype.lex = function() { if (this.eof()) { return { type: 2, value: "", lineNumber: this.lineNumber, lineStart: this.lineStart, start: this.index, end: this.index }; } var cp = this.source.charCodeAt(this.index); if (character_1.Character.isIdentifierStart(cp)) { return this.scanIdentifier(); } if (cp === 40 || cp === 41 || cp === 59) { return this.scanPunctuator(); } if (cp === 39 || cp === 34) { return this.scanStringLiteral(); } if (cp === 46) { if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index + 1))) { return this.scanNumericLiteral(); } return this.scanPunctuator(); } if (character_1.Character.isDecimalDigit(cp)) { return this.scanNumericLiteral(); } if (cp === 96 || cp === 125 && this.curlyStack[this.curlyStack.length - 1] === "${") { return this.scanTemplate(); } if (cp >= 55296 && cp < 57343) { if (character_1.Character.isIdentifierStart(this.codePointAt(this.index))) { return this.scanIdentifier(); } } return this.scanPunctuator(); }; return Scanner2; })(); exports3.Scanner = Scanner; }, /* 13 */ /***/ function(module3, exports3) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); exports3.TokenName = {}; exports3.TokenName[ 1 /* BooleanLiteral */ ] = "Boolean"; exports3.TokenName[ 2 /* EOF */ ] = ""; exports3.TokenName[ 3 /* Identifier */ ] = "Identifier"; exports3.TokenName[ 4 /* Keyword */ ] = "Keyword"; exports3.TokenName[ 5 /* NullLiteral */ ] = "Null"; exports3.TokenName[ 6 /* NumericLiteral */ ] = "Numeric"; exports3.TokenName[ 7 /* Punctuator */ ] = "Punctuator"; exports3.TokenName[ 8 /* StringLiteral */ ] = "String"; exports3.TokenName[ 9 /* RegularExpression */ ] = "RegularExpression"; exports3.TokenName[ 10 /* Template */ ] = "Template"; }, /* 14 */ /***/ function(module3, exports3) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); exports3.XHTMLEntities = { quot: '"', amp: "&", apos: "'", gt: ">", nbsp: "\xA0", iexcl: "\xA1", cent: "\xA2", pound: "\xA3", curren: "\xA4", yen: "\xA5", brvbar: "\xA6", sect: "\xA7", uml: "\xA8", copy: "\xA9", ordf: "\xAA", laquo: "\xAB", not: "\xAC", shy: "\xAD", reg: "\xAE", macr: "\xAF", deg: "\xB0", plusmn: "\xB1", sup2: "\xB2", sup3: "\xB3", acute: "\xB4", micro: "\xB5", para: "\xB6", middot: "\xB7", cedil: "\xB8", sup1: "\xB9", ordm: "\xBA", raquo: "\xBB", frac14: "\xBC", frac12: "\xBD", frac34: "\xBE", iquest: "\xBF", Agrave: "\xC0", Aacute: "\xC1", Acirc: "\xC2", Atilde: "\xC3", Auml: "\xC4", Aring: "\xC5", AElig: "\xC6", Ccedil: "\xC7", Egrave: "\xC8", Eacute: "\xC9", Ecirc: "\xCA", Euml: "\xCB", Igrave: "\xCC", Iacute: "\xCD", Icirc: "\xCE", Iuml: "\xCF", ETH: "\xD0", Ntilde: "\xD1", Ograve: "\xD2", Oacute: "\xD3", Ocirc: "\xD4", Otilde: "\xD5", Ouml: "\xD6", times: "\xD7", Oslash: "\xD8", Ugrave: "\xD9", Uacute: "\xDA", Ucirc: "\xDB", Uuml: "\xDC", Yacute: "\xDD", THORN: "\xDE", szlig: "\xDF", agrave: "\xE0", aacute: "\xE1", acirc: "\xE2", atilde: "\xE3", auml: "\xE4", aring: "\xE5", aelig: "\xE6", ccedil: "\xE7", egrave: "\xE8", eacute: "\xE9", ecirc: "\xEA", euml: "\xEB", igrave: "\xEC", iacute: "\xED", icirc: "\xEE", iuml: "\xEF", eth: "\xF0", ntilde: "\xF1", ograve: "\xF2", oacute: "\xF3", ocirc: "\xF4", otilde: "\xF5", ouml: "\xF6", divide: "\xF7", oslash: "\xF8", ugrave: "\xF9", uacute: "\xFA", ucirc: "\xFB", uuml: "\xFC", yacute: "\xFD", thorn: "\xFE", yuml: "\xFF", OElig: "\u0152", oelig: "\u0153", Scaron: "\u0160", scaron: "\u0161", Yuml: "\u0178", fnof: "\u0192", circ: "\u02C6", tilde: "\u02DC", Alpha: "\u0391", Beta: "\u0392", Gamma: "\u0393", Delta: "\u0394", Epsilon: "\u0395", Zeta: "\u0396", Eta: "\u0397", Theta: "\u0398", Iota: "\u0399", Kappa: "\u039A", Lambda: "\u039B", Mu: "\u039C", Nu: "\u039D", Xi: "\u039E", Omicron: "\u039F", Pi: "\u03A0", Rho: "\u03A1", Sigma: "\u03A3", Tau: "\u03A4", Upsilon: "\u03A5", Phi: "\u03A6", Chi: "\u03A7", Psi: "\u03A8", Omega: "\u03A9", alpha: "\u03B1", beta: "\u03B2", gamma: "\u03B3", delta: "\u03B4", epsilon: "\u03B5", zeta: "\u03B6", eta: "\u03B7", theta: "\u03B8", iota: "\u03B9", kappa: "\u03BA", lambda: "\u03BB", mu: "\u03BC", nu: "\u03BD", xi: "\u03BE", omicron: "\u03BF", pi: "\u03C0", rho: "\u03C1", sigmaf: "\u03C2", sigma: "\u03C3", tau: "\u03C4", upsilon: "\u03C5", phi: "\u03C6", chi: "\u03C7", psi: "\u03C8", omega: "\u03C9", thetasym: "\u03D1", upsih: "\u03D2", piv: "\u03D6", ensp: "\u2002", emsp: "\u2003", thinsp: "\u2009", zwnj: "\u200C", zwj: "\u200D", lrm: "\u200E", rlm: "\u200F", ndash: "\u2013", mdash: "\u2014", lsquo: "\u2018", rsquo: "\u2019", sbquo: "\u201A", ldquo: "\u201C", rdquo: "\u201D", bdquo: "\u201E", dagger: "\u2020", Dagger: "\u2021", bull: "\u2022", hellip: "\u2026", permil: "\u2030", prime: "\u2032", Prime: "\u2033", lsaquo: "\u2039", rsaquo: "\u203A", oline: "\u203E", frasl: "\u2044", euro: "\u20AC", image: "\u2111", weierp: "\u2118", real: "\u211C", trade: "\u2122", alefsym: "\u2135", larr: "\u2190", uarr: "\u2191", rarr: "\u2192", darr: "\u2193", harr: "\u2194", crarr: "\u21B5", lArr: "\u21D0", uArr: "\u21D1", rArr: "\u21D2", dArr: "\u21D3", hArr: "\u21D4", forall: "\u2200", part: "\u2202", exist: "\u2203", empty: "\u2205", nabla: "\u2207", isin: "\u2208", notin: "\u2209", ni: "\u220B", prod: "\u220F", sum: "\u2211", minus: "\u2212", lowast: "\u2217", radic: "\u221A", prop: "\u221D", infin: "\u221E", ang: "\u2220", and: "\u2227", or: "\u2228", cap: "\u2229", cup: "\u222A", int: "\u222B", there4: "\u2234", sim: "\u223C", cong: "\u2245", asymp: "\u2248", ne: "\u2260", equiv: "\u2261", le: "\u2264", ge: "\u2265", sub: "\u2282", sup: "\u2283", nsub: "\u2284", sube: "\u2286", supe: "\u2287", oplus: "\u2295", otimes: "\u2297", perp: "\u22A5", sdot: "\u22C5", lceil: "\u2308", rceil: "\u2309", lfloor: "\u230A", rfloor: "\u230B", loz: "\u25CA", spades: "\u2660", clubs: "\u2663", hearts: "\u2665", diams: "\u2666", lang: "\u27E8", rang: "\u27E9" }; }, /* 15 */ /***/ function(module3, exports3, __webpack_require__) { "use strict"; Object.defineProperty(exports3, "__esModule", { value: true }); var error_handler_1 = __webpack_require__(10); var scanner_1 = __webpack_require__(12); var token_1 = __webpack_require__(13); var Reader = (function() { function Reader2() { this.values = []; this.curly = this.paren = -1; } Reader2.prototype.beforeFunctionExpression = function(t) { return [ "(", "{", "[", "in", "typeof", "instanceof", "new", "return", "case", "delete", "throw", "void", // assignment operators "=", "+=", "-=", "*=", "**=", "/=", "%=", "<<=", ">>=", ">>>=", "&=", "|=", "^=", ",", // binary/unary operators "+", "-", "*", "**", "/", "%", "++", "--", "<<", ">>", ">>>", "&", "|", "^", "!", "~", "&&", "||", "?", ":", "===", "==", ">=", "<=", "<", ">", "!=", "!==" ].indexOf(t) >= 0; }; Reader2.prototype.isRegexStart = function() { var previous = this.values[this.values.length - 1]; var regex = previous !== null; switch (previous) { case "this": case "]": regex = false; break; case ")": var keyword = this.values[this.paren - 1]; regex = keyword === "if" || keyword === "while" || keyword === "for" || keyword === "with"; break; case "}": regex = false; if (this.values[this.curly - 3] === "function") { var check = this.values[this.curly - 4]; regex = check ? !this.beforeFunctionExpression(check) : false; } else if (this.values[this.curly - 4] === "function") { var check = this.values[this.curly - 5]; regex = check ? !this.beforeFunctionExpression(check) : true; } break; default: break; } return regex; }; Reader2.prototype.push = function(token) { if (token.type === 7 || token.type === 4) { if (token.value === "{") { this.curly = this.values.length; } else if (token.value === "(") { this.paren = this.values.length; } this.values.push(token.value); } else { this.values.push(null); } }; return Reader2; })(); var Tokenizer = (function() { function Tokenizer2(code, config) { this.errorHandler = new error_handler_1.ErrorHandler(); this.errorHandler.tolerant = config ? typeof config.tolerant === "boolean" && config.tolerant : false; this.scanner = new scanner_1.Scanner(code, this.errorHandler); this.scanner.trackComment = config ? typeof config.comment === "boolean" && config.comment : false; this.trackRange = config ? typeof config.range === "boolean" && config.range : false; this.trackLoc = config ? typeof config.loc === "boolean" && config.loc : false; this.buffer = []; this.reader = new Reader(); } Tokenizer2.prototype.errors = function() { return this.errorHandler.errors; }; Tokenizer2.prototype.getNextToken = function() { if (this.buffer.length === 0) { var comments = this.scanner.scanComments(); if (this.scanner.trackComment) { for (var i5 = 0; i5 < comments.length; ++i5) { var e5 = comments[i5]; var value = this.scanner.source.slice(e5.slice[0], e5.slice[1]); var comment = { type: e5.multiLine ? "BlockComment" : "LineComment", value }; if (this.trackRange) { comment.range = e5.range; } if (this.trackLoc) { comment.loc = e5.loc; } this.buffer.push(comment); } } if (!this.scanner.eof()) { var loc = void 0; if (this.trackLoc) { loc = { start: { line: this.scanner.lineNumber, column: this.scanner.index - this.scanner.lineStart }, end: {} }; } var startRegex = this.scanner.source[this.scanner.index] === "/" && this.reader.isRegexStart(); var token = startRegex ? this.scanner.scanRegExp() : this.scanner.lex(); this.reader.push(token); var entry = { type: token_1.TokenName[token.type], value: this.scanner.source.slice(token.start, token.end) }; if (this.trackRange) { entry.range = [token.start, token.end]; } if (this.trackLoc) { loc.end = { line: this.scanner.lineNumber, column: this.scanner.index - this.scanner.lineStart }; entry.loc = loc; } if (token.type === 9) { var pattern = token.pattern; var flags = token.flags; entry.regex = { pattern, flags }; } this.buffer.push(entry); } } return this.buffer.shift(); }; return Tokenizer2; })(); exports3.Tokenizer = Tokenizer; } /******/ ]) ); }); } }); // node_modules/ast-types/lib/types.js var require_types = __commonJS({ "node_modules/ast-types/lib/types.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Def = void 0; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var Op = Object.prototype; var objToStr = Op.toString; var hasOwn = Op.hasOwnProperty; var BaseType = ( /** @class */ (function() { function BaseType2() { } BaseType2.prototype.assert = function(value, deep) { if (!this.check(value, deep)) { var str = shallowStringify(value); throw new Error(str + " does not match type " + this); } return true; }; BaseType2.prototype.arrayOf = function() { var elemType = this; return new ArrayType(elemType); }; return BaseType2; })() ); var ArrayType = ( /** @class */ (function(_super) { tslib_1.__extends(ArrayType2, _super); function ArrayType2(elemType) { var _this = _super.call(this) || this; _this.elemType = elemType; _this.kind = "ArrayType"; return _this; } ArrayType2.prototype.toString = function() { return "[" + this.elemType + "]"; }; ArrayType2.prototype.check = function(value, deep) { var _this = this; return Array.isArray(value) && value.every(function(elem) { return _this.elemType.check(elem, deep); }); }; return ArrayType2; })(BaseType) ); var IdentityType = ( /** @class */ (function(_super) { tslib_1.__extends(IdentityType2, _super); function IdentityType2(value) { var _this = _super.call(this) || this; _this.value = value; _this.kind = "IdentityType"; return _this; } IdentityType2.prototype.toString = function() { return String(this.value); }; IdentityType2.prototype.check = function(value, deep) { var result = value === this.value; if (!result && typeof deep === "function") { deep(this, value); } return result; }; return IdentityType2; })(BaseType) ); var ObjectType = ( /** @class */ (function(_super) { tslib_1.__extends(ObjectType2, _super); function ObjectType2(fields) { var _this = _super.call(this) || this; _this.fields = fields; _this.kind = "ObjectType"; return _this; } ObjectType2.prototype.toString = function() { return "{ " + this.fields.join(", ") + " }"; }; ObjectType2.prototype.check = function(value, deep) { return objToStr.call(value) === objToStr.call({}) && this.fields.every(function(field) { return field.type.check(value[field.name], deep); }); }; return ObjectType2; })(BaseType) ); var OrType = ( /** @class */ (function(_super) { tslib_1.__extends(OrType2, _super); function OrType2(types3) { var _this = _super.call(this) || this; _this.types = types3; _this.kind = "OrType"; return _this; } OrType2.prototype.toString = function() { return this.types.join(" | "); }; OrType2.prototype.check = function(value, deep) { return this.types.some(function(type) { return type.check(value, deep); }); }; return OrType2; })(BaseType) ); var PredicateType = ( /** @class */ (function(_super) { tslib_1.__extends(PredicateType2, _super); function PredicateType2(name, predicate) { var _this = _super.call(this) || this; _this.name = name; _this.predicate = predicate; _this.kind = "PredicateType"; return _this; } PredicateType2.prototype.toString = function() { return this.name; }; PredicateType2.prototype.check = function(value, deep) { var result = this.predicate(value, deep); if (!result && typeof deep === "function") { deep(this, value); } return result; }; return PredicateType2; })(BaseType) ); var Def = ( /** @class */ (function() { function Def2(type, typeName) { this.type = type; this.typeName = typeName; this.baseNames = []; this.ownFields = /* @__PURE__ */ Object.create(null); this.allSupertypes = /* @__PURE__ */ Object.create(null); this.supertypeList = []; this.allFields = /* @__PURE__ */ Object.create(null); this.fieldNames = []; this.finalized = false; this.buildable = false; this.buildParams = []; } Def2.prototype.isSupertypeOf = function(that) { if (that instanceof Def2) { if (this.finalized !== true || that.finalized !== true) { throw new Error(""); } return hasOwn.call(that.allSupertypes, this.typeName); } else { throw new Error(that + " is not a Def"); } }; Def2.prototype.checkAllFields = function(value, deep) { var allFields = this.allFields; if (this.finalized !== true) { throw new Error("" + this.typeName); } function checkFieldByName(name) { var field = allFields[name]; var type = field.type; var child = field.getValue(value); return type.check(child, deep); } return value !== null && typeof value === "object" && Object.keys(allFields).every(checkFieldByName); }; Def2.prototype.bases = function() { var supertypeNames = []; for (var _i = 0; _i < arguments.length; _i++) { supertypeNames[_i] = arguments[_i]; } var bases = this.baseNames; if (this.finalized) { if (supertypeNames.length !== bases.length) { throw new Error(""); } for (var i5 = 0; i5 < supertypeNames.length; i5++) { if (supertypeNames[i5] !== bases[i5]) { throw new Error(""); } } return this; } supertypeNames.forEach(function(baseName) { if (bases.indexOf(baseName) < 0) { bases.push(baseName); } }); return this; }; return Def2; })() ); exports2.Def = Def; var Field = ( /** @class */ (function() { function Field2(name, type, defaultFn, hidden) { this.name = name; this.type = type; this.defaultFn = defaultFn; this.hidden = !!hidden; } Field2.prototype.toString = function() { return JSON.stringify(this.name) + ": " + this.type; }; Field2.prototype.getValue = function(obj) { var value = obj[this.name]; if (typeof value !== "undefined") { return value; } if (typeof this.defaultFn === "function") { value = this.defaultFn.call(obj); } return value; }; return Field2; })() ); function shallowStringify(value) { if (Array.isArray(value)) { return "[" + value.map(shallowStringify).join(", ") + "]"; } if (value && typeof value === "object") { return "{ " + Object.keys(value).map(function(key) { return key + ": " + value[key]; }).join(", ") + " }"; } return JSON.stringify(value); } function typesPlugin(_fork) { var Type = { or: function() { var types3 = []; for (var _i = 0; _i < arguments.length; _i++) { types3[_i] = arguments[_i]; } return new OrType(types3.map(function(type) { return Type.from(type); })); }, from: function(value, name) { if (value instanceof ArrayType || value instanceof IdentityType || value instanceof ObjectType || value instanceof OrType || value instanceof PredicateType) { return value; } if (value instanceof Def) { return value.type; } if (isArray.check(value)) { if (value.length !== 1) { throw new Error("only one element type is permitted for typed arrays"); } return new ArrayType(Type.from(value[0])); } if (isObject.check(value)) { return new ObjectType(Object.keys(value).map(function(name2) { return new Field(name2, Type.from(value[name2], name2)); })); } if (typeof value === "function") { var bicfIndex = builtInCtorFns.indexOf(value); if (bicfIndex >= 0) { return builtInCtorTypes[bicfIndex]; } if (typeof name !== "string") { throw new Error("missing name"); } return new PredicateType(name, value); } return new IdentityType(value); }, // Define a type whose name is registered in a namespace (the defCache) so // that future definitions will return the same type given the same name. // In particular, this system allows for circular and forward definitions. // The Def object d returned from Type.def may be used to configure the // type d.type by calling methods such as d.bases, d.build, and d.field. def: function(typeName) { return hasOwn.call(defCache, typeName) ? defCache[typeName] : defCache[typeName] = new DefImpl(typeName); }, hasDef: function(typeName) { return hasOwn.call(defCache, typeName); } }; var builtInCtorFns = []; var builtInCtorTypes = []; function defBuiltInType(name, example) { var objStr = objToStr.call(example); var type = new PredicateType(name, function(value) { return objToStr.call(value) === objStr; }); if (example && typeof example.constructor === "function") { builtInCtorFns.push(example.constructor); builtInCtorTypes.push(type); } return type; } var isString = defBuiltInType("string", "truthy"); var isFunction = defBuiltInType("function", function() { }); var isArray = defBuiltInType("array", []); var isObject = defBuiltInType("object", {}); var isRegExp = defBuiltInType("RegExp", /./); var isDate = defBuiltInType("Date", /* @__PURE__ */ new Date()); var isNumber = defBuiltInType("number", 3); var isBoolean = defBuiltInType("boolean", true); var isNull = defBuiltInType("null", null); var isUndefined = defBuiltInType("undefined", void 0); var builtInTypes = { string: isString, function: isFunction, array: isArray, object: isObject, RegExp: isRegExp, Date: isDate, number: isNumber, boolean: isBoolean, null: isNull, undefined: isUndefined }; var defCache = /* @__PURE__ */ Object.create(null); function defFromValue(value) { if (value && typeof value === "object") { var type = value.type; if (typeof type === "string" && hasOwn.call(defCache, type)) { var d5 = defCache[type]; if (d5.finalized) { return d5; } } } return null; } var DefImpl = ( /** @class */ (function(_super) { tslib_1.__extends(DefImpl2, _super); function DefImpl2(typeName) { var _this = _super.call(this, new PredicateType(typeName, function(value, deep) { return _this.check(value, deep); }), typeName) || this; return _this; } DefImpl2.prototype.check = function(value, deep) { if (this.finalized !== true) { throw new Error("prematurely checking unfinalized type " + this.typeName); } if (value === null || typeof value !== "object") { return false; } var vDef = defFromValue(value); if (!vDef) { if (this.typeName === "SourceLocation" || this.typeName === "Position") { return this.checkAllFields(value, deep); } return false; } if (deep && vDef === this) { return this.checkAllFields(value, deep); } if (!this.isSupertypeOf(vDef)) { return false; } if (!deep) { return true; } return vDef.checkAllFields(value, deep) && this.checkAllFields(value, false); }; DefImpl2.prototype.build = function() { var _this = this; var buildParams = []; for (var _i = 0; _i < arguments.length; _i++) { buildParams[_i] = arguments[_i]; } this.buildParams = buildParams; if (this.buildable) { return this; } this.field("type", String, function() { return _this.typeName; }); this.buildable = true; var addParam = function(built, param, arg, isArgAvailable) { if (hasOwn.call(built, param)) return; var all = _this.allFields; if (!hasOwn.call(all, param)) { throw new Error("" + param); } var field = all[param]; var type = field.type; var value; if (isArgAvailable) { value = arg; } else if (field.defaultFn) { value = field.defaultFn.call(built); } else { var message = "no value or default function given for field " + JSON.stringify(param) + " of " + _this.typeName + "(" + _this.buildParams.map(function(name) { return all[name]; }).join(", ") + ")"; throw new Error(message); } if (!type.check(value)) { throw new Error(shallowStringify(value) + " does not match field " + field + " of type " + _this.typeName); } built[param] = value; }; var builder = function() { var args = []; for (var _i2 = 0; _i2 < arguments.length; _i2++) { args[_i2] = arguments[_i2]; } var argc = args.length; if (!_this.finalized) { throw new Error("attempting to instantiate unfinalized type " + _this.typeName); } var built = Object.create(nodePrototype); _this.buildParams.forEach(function(param, i5) { if (i5 < argc) { addParam(built, param, args[i5], true); } else { addParam(built, param, null, false); } }); Object.keys(_this.allFields).forEach(function(param) { addParam(built, param, null, false); }); if (built.type !== _this.typeName) { throw new Error(""); } return built; }; builder.from = function(obj) { if (!_this.finalized) { throw new Error("attempting to instantiate unfinalized type " + _this.typeName); } var built = Object.create(nodePrototype); Object.keys(_this.allFields).forEach(function(param) { if (hasOwn.call(obj, param)) { addParam(built, param, obj[param], true); } else { addParam(built, param, null, false); } }); if (built.type !== _this.typeName) { throw new Error(""); } return built; }; Object.defineProperty(builders, getBuilderName(this.typeName), { enumerable: true, value: builder }); return this; }; DefImpl2.prototype.field = function(name, type, defaultFn, hidden) { if (this.finalized) { console.error("Ignoring attempt to redefine field " + JSON.stringify(name) + " of finalized type " + JSON.stringify(this.typeName)); return this; } this.ownFields[name] = new Field(name, Type.from(type), defaultFn, hidden); return this; }; DefImpl2.prototype.finalize = function() { var _this = this; if (!this.finalized) { var allFields = this.allFields; var allSupertypes = this.allSupertypes; this.baseNames.forEach(function(name) { var def = defCache[name]; if (def instanceof Def) { def.finalize(); extend(allFields, def.allFields); extend(allSupertypes, def.allSupertypes); } else { var message = "unknown supertype name " + JSON.stringify(name) + " for subtype " + JSON.stringify(_this.typeName); throw new Error(message); } }); extend(allFields, this.ownFields); allSupertypes[this.typeName] = this; this.fieldNames.length = 0; for (var fieldName in allFields) { if (hasOwn.call(allFields, fieldName) && !allFields[fieldName].hidden) { this.fieldNames.push(fieldName); } } Object.defineProperty(namedTypes, this.typeName, { enumerable: true, value: this.type }); this.finalized = true; populateSupertypeList(this.typeName, this.supertypeList); if (this.buildable && this.supertypeList.lastIndexOf("Expression") >= 0) { wrapExpressionBuilderWithStatement(this.typeName); } } }; return DefImpl2; })(Def) ); function getSupertypeNames(typeName) { if (!hasOwn.call(defCache, typeName)) { throw new Error(""); } var d5 = defCache[typeName]; if (d5.finalized !== true) { throw new Error(""); } return d5.supertypeList.slice(1); } function computeSupertypeLookupTable(candidates) { var table = {}; var typeNames = Object.keys(defCache); var typeNameCount = typeNames.length; for (var i5 = 0; i5 < typeNameCount; ++i5) { var typeName = typeNames[i5]; var d5 = defCache[typeName]; if (d5.finalized !== true) { throw new Error("" + typeName); } for (var j5 = 0; j5 < d5.supertypeList.length; ++j5) { var superTypeName = d5.supertypeList[j5]; if (hasOwn.call(candidates, superTypeName)) { table[typeName] = superTypeName; break; } } } return table; } var builders = /* @__PURE__ */ Object.create(null); var nodePrototype = {}; function defineMethod(name, func) { var old = nodePrototype[name]; if (isUndefined.check(func)) { delete nodePrototype[name]; } else { isFunction.assert(func); Object.defineProperty(nodePrototype, name, { enumerable: true, configurable: true, value: func }); } return old; } function getBuilderName(typeName) { return typeName.replace(/^[A-Z]+/, function(upperCasePrefix) { var len = upperCasePrefix.length; switch (len) { case 0: return ""; // If there's only one initial capital letter, just lower-case it. case 1: return upperCasePrefix.toLowerCase(); default: return upperCasePrefix.slice(0, len - 1).toLowerCase() + upperCasePrefix.charAt(len - 1); } }); } function getStatementBuilderName(typeName) { typeName = getBuilderName(typeName); return typeName.replace(/(Expression)?$/, "Statement"); } var namedTypes = {}; function getFieldNames(object) { var d5 = defFromValue(object); if (d5) { return d5.fieldNames.slice(0); } if ("type" in object) { throw new Error("did not recognize object of type " + JSON.stringify(object.type)); } return Object.keys(object); } function getFieldValue(object, fieldName) { var d5 = defFromValue(object); if (d5) { var field = d5.allFields[fieldName]; if (field) { return field.getValue(object); } } return object && object[fieldName]; } function eachField(object, callback, context) { getFieldNames(object).forEach(function(name) { callback.call(this, name, getFieldValue(object, name)); }, context); } function someField(object, callback, context) { return getFieldNames(object).some(function(name) { return callback.call(this, name, getFieldValue(object, name)); }, context); } function wrapExpressionBuilderWithStatement(typeName) { var wrapperName = getStatementBuilderName(typeName); if (builders[wrapperName]) return; var wrapped = builders[getBuilderName(typeName)]; if (!wrapped) return; var builder = function() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return builders.expressionStatement(wrapped.apply(builders, args)); }; builder.from = function() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return builders.expressionStatement(wrapped.from.apply(builders, args)); }; builders[wrapperName] = builder; } function populateSupertypeList(typeName, list2) { list2.length = 0; list2.push(typeName); var lastSeen = /* @__PURE__ */ Object.create(null); for (var pos = 0; pos < list2.length; ++pos) { typeName = list2[pos]; var d5 = defCache[typeName]; if (d5.finalized !== true) { throw new Error(""); } if (hasOwn.call(lastSeen, typeName)) { delete list2[lastSeen[typeName]]; } lastSeen[typeName] = pos; list2.push.apply(list2, d5.baseNames); } for (var to = 0, from = to, len = list2.length; from < len; ++from) { if (hasOwn.call(list2, from)) { list2[to++] = list2[from]; } } list2.length = to; } function extend(into, from) { Object.keys(from).forEach(function(name) { into[name] = from[name]; }); return into; } function finalize() { Object.keys(defCache).forEach(function(name) { defCache[name].finalize(); }); } return { Type, builtInTypes, getSupertypeNames, computeSupertypeLookupTable, builders, defineMethod, getBuilderName, getStatementBuilderName, namedTypes, getFieldNames, getFieldValue, eachField, someField, finalize }; } exports2.default = typesPlugin; } }); // node_modules/ast-types/lib/path.js var require_path = __commonJS({ "node_modules/ast-types/lib/path.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var types_1 = tslib_1.__importDefault(require_types()); var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; function pathPlugin(fork) { var types3 = fork.use(types_1.default); var isArray = types3.builtInTypes.array; var isNumber = types3.builtInTypes.number; var Path = function Path2(value, parentPath, name) { if (!(this instanceof Path2)) { throw new Error("Path constructor cannot be invoked without 'new'"); } if (parentPath) { if (!(parentPath instanceof Path2)) { throw new Error(""); } } else { parentPath = null; name = null; } this.value = value; this.parentPath = parentPath; this.name = name; this.__childCache = null; }; var Pp = Path.prototype; function getChildCache(path3) { return path3.__childCache || (path3.__childCache = /* @__PURE__ */ Object.create(null)); } function getChildPath(path3, name) { var cache5 = getChildCache(path3); var actualChildValue = path3.getValueProperty(name); var childPath = cache5[name]; if (!hasOwn.call(cache5, name) || // Ensure consistency between cache and reality. childPath.value !== actualChildValue) { childPath = cache5[name] = new path3.constructor(actualChildValue, path3, name); } return childPath; } Pp.getValueProperty = function getValueProperty(name) { return this.value[name]; }; Pp.get = function get2() { var names = []; for (var _i = 0; _i < arguments.length; _i++) { names[_i] = arguments[_i]; } var path3 = this; var count = names.length; for (var i5 = 0; i5 < count; ++i5) { path3 = getChildPath(path3, names[i5]); } return path3; }; Pp.each = function each(callback, context) { var childPaths = []; var len = this.value.length; var i5 = 0; for (var i5 = 0; i5 < len; ++i5) { if (hasOwn.call(this.value, i5)) { childPaths[i5] = this.get(i5); } } context = context || this; for (i5 = 0; i5 < len; ++i5) { if (hasOwn.call(childPaths, i5)) { callback.call(context, childPaths[i5]); } } }; Pp.map = function map2(callback, context) { var result = []; this.each(function(childPath) { result.push(callback.call(this, childPath)); }, context); return result; }; Pp.filter = function filter(callback, context) { var result = []; this.each(function(childPath) { if (callback.call(this, childPath)) { result.push(childPath); } }, context); return result; }; function emptyMoves() { } function getMoves(path3, offset, start, end) { isArray.assert(path3.value); if (offset === 0) { return emptyMoves; } var length = path3.value.length; if (length < 1) { return emptyMoves; } var argc = arguments.length; if (argc === 2) { start = 0; end = length; } else if (argc === 3) { start = Math.max(start, 0); end = length; } else { start = Math.max(start, 0); end = Math.min(end, length); } isNumber.assert(start); isNumber.assert(end); var moves = /* @__PURE__ */ Object.create(null); var cache5 = getChildCache(path3); for (var i5 = start; i5 < end; ++i5) { if (hasOwn.call(path3.value, i5)) { var childPath = path3.get(i5); if (childPath.name !== i5) { throw new Error(""); } var newIndex = i5 + offset; childPath.name = newIndex; moves[newIndex] = childPath; delete cache5[i5]; } } delete cache5.length; return function() { for (var newIndex2 in moves) { var childPath2 = moves[newIndex2]; if (childPath2.name !== +newIndex2) { throw new Error(""); } cache5[newIndex2] = childPath2; path3.value[newIndex2] = childPath2.value; } }; } Pp.shift = function shift() { var move = getMoves(this, -1); var result = this.value.shift(); move(); return result; }; Pp.unshift = function unshift() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var move = getMoves(this, args.length); var result = this.value.unshift.apply(this.value, args); move(); return result; }; Pp.push = function push() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } isArray.assert(this.value); delete getChildCache(this).length; return this.value.push.apply(this.value, args); }; Pp.pop = function pop() { isArray.assert(this.value); var cache5 = getChildCache(this); delete cache5[this.value.length - 1]; delete cache5.length; return this.value.pop(); }; Pp.insertAt = function insertAt(index) { var argc = arguments.length; var move = getMoves(this, argc - 1, index); if (move === emptyMoves && argc <= 1) { return this; } index = Math.max(index, 0); for (var i5 = 1; i5 < argc; ++i5) { this.value[index + i5 - 1] = arguments[i5]; } move(); return this; }; Pp.insertBefore = function insertBefore() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var pp = this.parentPath; var argc = args.length; var insertAtArgs = [this.name]; for (var i5 = 0; i5 < argc; ++i5) { insertAtArgs.push(args[i5]); } return pp.insertAt.apply(pp, insertAtArgs); }; Pp.insertAfter = function insertAfter() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var pp = this.parentPath; var argc = args.length; var insertAtArgs = [this.name + 1]; for (var i5 = 0; i5 < argc; ++i5) { insertAtArgs.push(args[i5]); } return pp.insertAt.apply(pp, insertAtArgs); }; function repairRelationshipWithParent(path3) { if (!(path3 instanceof Path)) { throw new Error(""); } var pp = path3.parentPath; if (!pp) { return path3; } var parentValue = pp.value; var parentCache = getChildCache(pp); if (parentValue[path3.name] === path3.value) { parentCache[path3.name] = path3; } else if (isArray.check(parentValue)) { var i5 = parentValue.indexOf(path3.value); if (i5 >= 0) { parentCache[path3.name = i5] = path3; } } else { parentValue[path3.name] = path3.value; parentCache[path3.name] = path3; } if (parentValue[path3.name] !== path3.value) { throw new Error(""); } if (path3.parentPath.get(path3.name) !== path3) { throw new Error(""); } return path3; } Pp.replace = function replace(replacement) { var results = []; var parentValue = this.parentPath.value; var parentCache = getChildCache(this.parentPath); var count = arguments.length; repairRelationshipWithParent(this); if (isArray.check(parentValue)) { var originalLength = parentValue.length; var move = getMoves(this.parentPath, count - 1, this.name + 1); var spliceArgs = [this.name, 1]; for (var i5 = 0; i5 < count; ++i5) { spliceArgs.push(arguments[i5]); } var splicedOut = parentValue.splice.apply(parentValue, spliceArgs); if (splicedOut[0] !== this.value) { throw new Error(""); } if (parentValue.length !== originalLength - 1 + count) { throw new Error(""); } move(); if (count === 0) { delete this.value; delete parentCache[this.name]; this.__childCache = null; } else { if (parentValue[this.name] !== replacement) { throw new Error(""); } if (this.value !== replacement) { this.value = replacement; this.__childCache = null; } for (i5 = 0; i5 < count; ++i5) { results.push(this.parentPath.get(this.name + i5)); } if (results[0] !== this) { throw new Error(""); } } } else if (count === 1) { if (this.value !== replacement) { this.__childCache = null; } this.value = parentValue[this.name] = replacement; results.push(this); } else if (count === 0) { delete parentValue[this.name]; delete this.value; this.__childCache = null; } else { throw new Error("Could not replace path"); } return results; }; return Path; } exports2.default = pathPlugin; module2.exports = exports2["default"]; } }); // node_modules/ast-types/lib/scope.js var require_scope = __commonJS({ "node_modules/ast-types/lib/scope.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var types_1 = tslib_1.__importDefault(require_types()); var hasOwn = Object.prototype.hasOwnProperty; function scopePlugin(fork) { var types3 = fork.use(types_1.default); var Type = types3.Type; var namedTypes = types3.namedTypes; var Node = namedTypes.Node; var Expression = namedTypes.Expression; var isArray = types3.builtInTypes.array; var b6 = types3.builders; var Scope = function Scope2(path3, parentScope) { if (!(this instanceof Scope2)) { throw new Error("Scope constructor cannot be invoked without 'new'"); } ScopeType.assert(path3.value); var depth; if (parentScope) { if (!(parentScope instanceof Scope2)) { throw new Error(""); } depth = parentScope.depth + 1; } else { parentScope = null; depth = 0; } Object.defineProperties(this, { path: { value: path3 }, node: { value: path3.value }, isGlobal: { value: !parentScope, enumerable: true }, depth: { value: depth }, parent: { value: parentScope }, bindings: { value: {} }, types: { value: {} } }); }; var scopeTypes = [ // Program nodes introduce global scopes. namedTypes.Program, // Function is the supertype of FunctionExpression, // FunctionDeclaration, ArrowExpression, etc. namedTypes.Function, // In case you didn't know, the caught parameter shadows any variable // of the same name in an outer scope. namedTypes.CatchClause ]; var ScopeType = Type.or.apply(Type, scopeTypes); Scope.isEstablishedBy = function(node) { return ScopeType.check(node); }; var Sp = Scope.prototype; Sp.didScan = false; Sp.declares = function(name) { this.scan(); return hasOwn.call(this.bindings, name); }; Sp.declaresType = function(name) { this.scan(); return hasOwn.call(this.types, name); }; Sp.declareTemporary = function(prefix) { if (prefix) { if (!/^[a-z$_]/i.test(prefix)) { throw new Error(""); } } else { prefix = "t$"; } prefix += this.depth.toString(36) + "$"; this.scan(); var index = 0; while (this.declares(prefix + index)) { ++index; } var name = prefix + index; return this.bindings[name] = types3.builders.identifier(name); }; Sp.injectTemporary = function(identifier, init) { identifier || (identifier = this.declareTemporary()); var bodyPath = this.path.get("body"); if (namedTypes.BlockStatement.check(bodyPath.value)) { bodyPath = bodyPath.get("body"); } bodyPath.unshift(b6.variableDeclaration("var", [b6.variableDeclarator(identifier, init || null)])); return identifier; }; Sp.scan = function(force) { if (force || !this.didScan) { for (var name in this.bindings) { delete this.bindings[name]; } scanScope(this.path, this.bindings, this.types); this.didScan = true; } }; Sp.getBindings = function() { this.scan(); return this.bindings; }; Sp.getTypes = function() { this.scan(); return this.types; }; function scanScope(path3, bindings, scopeTypes2) { var node = path3.value; ScopeType.assert(node); if (namedTypes.CatchClause.check(node)) { var param = path3.get("param"); if (param.value) { addPattern(param, bindings); } } else { recursiveScanScope(path3, bindings, scopeTypes2); } } function recursiveScanScope(path3, bindings, scopeTypes2) { var node = path3.value; if (path3.parent && namedTypes.FunctionExpression.check(path3.parent.node) && path3.parent.node.id) { addPattern(path3.parent.get("id"), bindings); } if (!node) { } else if (isArray.check(node)) { path3.each(function(childPath) { recursiveScanChild(childPath, bindings, scopeTypes2); }); } else if (namedTypes.Function.check(node)) { path3.get("params").each(function(paramPath) { addPattern(paramPath, bindings); }); recursiveScanChild(path3.get("body"), bindings, scopeTypes2); } else if (namedTypes.TypeAlias && namedTypes.TypeAlias.check(node) || namedTypes.InterfaceDeclaration && namedTypes.InterfaceDeclaration.check(node) || namedTypes.TSTypeAliasDeclaration && namedTypes.TSTypeAliasDeclaration.check(node) || namedTypes.TSInterfaceDeclaration && namedTypes.TSInterfaceDeclaration.check(node)) { addTypePattern(path3.get("id"), scopeTypes2); } else if (namedTypes.VariableDeclarator.check(node)) { addPattern(path3.get("id"), bindings); recursiveScanChild(path3.get("init"), bindings, scopeTypes2); } else if (node.type === "ImportSpecifier" || node.type === "ImportNamespaceSpecifier" || node.type === "ImportDefaultSpecifier") { addPattern( // Esprima used to use the .name field to refer to the local // binding identifier for ImportSpecifier nodes, but .id for // ImportNamespaceSpecifier and ImportDefaultSpecifier nodes. // ESTree/Acorn/ESpree use .local for all three node types. path3.get(node.local ? "local" : node.name ? "name" : "id"), bindings ); } else if (Node.check(node) && !Expression.check(node)) { types3.eachField(node, function(name, child) { var childPath = path3.get(name); if (!pathHasValue(childPath, child)) { throw new Error(""); } recursiveScanChild(childPath, bindings, scopeTypes2); }); } } function pathHasValue(path3, value) { if (path3.value === value) { return true; } if (Array.isArray(path3.value) && path3.value.length === 0 && Array.isArray(value) && value.length === 0) { return true; } return false; } function recursiveScanChild(path3, bindings, scopeTypes2) { var node = path3.value; if (!node || Expression.check(node)) { } else if (namedTypes.FunctionDeclaration.check(node) && node.id !== null) { addPattern(path3.get("id"), bindings); } else if (namedTypes.ClassDeclaration && namedTypes.ClassDeclaration.check(node)) { addPattern(path3.get("id"), bindings); } else if (ScopeType.check(node)) { if (namedTypes.CatchClause.check(node) && // TODO Broaden this to accept any pattern. namedTypes.Identifier.check(node.param)) { var catchParamName = node.param.name; var hadBinding = hasOwn.call(bindings, catchParamName); recursiveScanScope(path3.get("body"), bindings, scopeTypes2); if (!hadBinding) { delete bindings[catchParamName]; } } } else { recursiveScanScope(path3, bindings, scopeTypes2); } } function addPattern(patternPath, bindings) { var pattern = patternPath.value; namedTypes.Pattern.assert(pattern); if (namedTypes.Identifier.check(pattern)) { if (hasOwn.call(bindings, pattern.name)) { bindings[pattern.name].push(patternPath); } else { bindings[pattern.name] = [patternPath]; } } else if (namedTypes.AssignmentPattern && namedTypes.AssignmentPattern.check(pattern)) { addPattern(patternPath.get("left"), bindings); } else if (namedTypes.ObjectPattern && namedTypes.ObjectPattern.check(pattern)) { patternPath.get("properties").each(function(propertyPath) { var property = propertyPath.value; if (namedTypes.Pattern.check(property)) { addPattern(propertyPath, bindings); } else if (namedTypes.Property.check(property)) { addPattern(propertyPath.get("value"), bindings); } else if (namedTypes.SpreadProperty && namedTypes.SpreadProperty.check(property)) { addPattern(propertyPath.get("argument"), bindings); } }); } else if (namedTypes.ArrayPattern && namedTypes.ArrayPattern.check(pattern)) { patternPath.get("elements").each(function(elementPath) { var element = elementPath.value; if (namedTypes.Pattern.check(element)) { addPattern(elementPath, bindings); } else if (namedTypes.SpreadElement && namedTypes.SpreadElement.check(element)) { addPattern(elementPath.get("argument"), bindings); } }); } else if (namedTypes.PropertyPattern && namedTypes.PropertyPattern.check(pattern)) { addPattern(patternPath.get("pattern"), bindings); } else if (namedTypes.SpreadElementPattern && namedTypes.SpreadElementPattern.check(pattern) || namedTypes.SpreadPropertyPattern && namedTypes.SpreadPropertyPattern.check(pattern)) { addPattern(patternPath.get("argument"), bindings); } } function addTypePattern(patternPath, types4) { var pattern = patternPath.value; namedTypes.Pattern.assert(pattern); if (namedTypes.Identifier.check(pattern)) { if (hasOwn.call(types4, pattern.name)) { types4[pattern.name].push(patternPath); } else { types4[pattern.name] = [patternPath]; } } } Sp.lookup = function(name) { for (var scope = this; scope; scope = scope.parent) if (scope.declares(name)) break; return scope; }; Sp.lookupType = function(name) { for (var scope = this; scope; scope = scope.parent) if (scope.declaresType(name)) break; return scope; }; Sp.getGlobalScope = function() { var scope = this; while (!scope.isGlobal) scope = scope.parent; return scope; }; return Scope; } exports2.default = scopePlugin; module2.exports = exports2["default"]; } }); // node_modules/ast-types/lib/node-path.js var require_node_path = __commonJS({ "node_modules/ast-types/lib/node-path.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var types_1 = tslib_1.__importDefault(require_types()); var path_1 = tslib_1.__importDefault(require_path()); var scope_1 = tslib_1.__importDefault(require_scope()); function nodePathPlugin(fork) { var types3 = fork.use(types_1.default); var n3 = types3.namedTypes; var b6 = types3.builders; var isNumber = types3.builtInTypes.number; var isArray = types3.builtInTypes.array; var Path = fork.use(path_1.default); var Scope = fork.use(scope_1.default); var NodePath = function NodePath2(value, parentPath, name) { if (!(this instanceof NodePath2)) { throw new Error("NodePath constructor cannot be invoked without 'new'"); } Path.call(this, value, parentPath, name); }; var NPp = NodePath.prototype = Object.create(Path.prototype, { constructor: { value: NodePath, enumerable: false, writable: true, configurable: true } }); Object.defineProperties(NPp, { node: { get: function() { Object.defineProperty(this, "node", { configurable: true, value: this._computeNode() }); return this.node; } }, parent: { get: function() { Object.defineProperty(this, "parent", { configurable: true, value: this._computeParent() }); return this.parent; } }, scope: { get: function() { Object.defineProperty(this, "scope", { configurable: true, value: this._computeScope() }); return this.scope; } } }); NPp.replace = function() { delete this.node; delete this.parent; delete this.scope; return Path.prototype.replace.apply(this, arguments); }; NPp.prune = function() { var remainingNodePath = this.parent; this.replace(); return cleanUpNodesAfterPrune(remainingNodePath); }; NPp._computeNode = function() { var value = this.value; if (n3.Node.check(value)) { return value; } var pp = this.parentPath; return pp && pp.node || null; }; NPp._computeParent = function() { var value = this.value; var pp = this.parentPath; if (!n3.Node.check(value)) { while (pp && !n3.Node.check(pp.value)) { pp = pp.parentPath; } if (pp) { pp = pp.parentPath; } } while (pp && !n3.Node.check(pp.value)) { pp = pp.parentPath; } return pp || null; }; NPp._computeScope = function() { var value = this.value; var pp = this.parentPath; var scope = pp && pp.scope; if (n3.Node.check(value) && Scope.isEstablishedBy(value)) { scope = new Scope(this, scope); } return scope || null; }; NPp.getValueProperty = function(name) { return types3.getFieldValue(this.value, name); }; NPp.needsParens = function(assumeExpressionContext) { var pp = this.parentPath; if (!pp) { return false; } var node = this.value; if (!n3.Expression.check(node)) { return false; } if (node.type === "Identifier") { return false; } while (!n3.Node.check(pp.value)) { pp = pp.parentPath; if (!pp) { return false; } } var parent = pp.value; switch (node.type) { case "UnaryExpression": case "SpreadElement": case "SpreadProperty": return parent.type === "MemberExpression" && this.name === "object" && parent.object === node; case "BinaryExpression": case "LogicalExpression": switch (parent.type) { case "CallExpression": return this.name === "callee" && parent.callee === node; case "UnaryExpression": case "SpreadElement": case "SpreadProperty": return true; case "MemberExpression": return this.name === "object" && parent.object === node; case "BinaryExpression": case "LogicalExpression": { var n_1 = node; var po = parent.operator; var pp_1 = PRECEDENCE[po]; var no = n_1.operator; var np = PRECEDENCE[no]; if (pp_1 > np) { return true; } if (pp_1 === np && this.name === "right") { if (parent.right !== n_1) { throw new Error("Nodes must be equal"); } return true; } } default: return false; } case "SequenceExpression": switch (parent.type) { case "ForStatement": return false; case "ExpressionStatement": return this.name !== "expression"; default: return true; } case "YieldExpression": switch (parent.type) { case "BinaryExpression": case "LogicalExpression": case "UnaryExpression": case "SpreadElement": case "SpreadProperty": case "CallExpression": case "MemberExpression": case "NewExpression": case "ConditionalExpression": case "YieldExpression": return true; default: return false; } case "Literal": return parent.type === "MemberExpression" && isNumber.check(node.value) && this.name === "object" && parent.object === node; case "AssignmentExpression": case "ConditionalExpression": switch (parent.type) { case "UnaryExpression": case "SpreadElement": case "SpreadProperty": case "BinaryExpression": case "LogicalExpression": return true; case "CallExpression": return this.name === "callee" && parent.callee === node; case "ConditionalExpression": return this.name === "test" && parent.test === node; case "MemberExpression": return this.name === "object" && parent.object === node; default: return false; } default: if (parent.type === "NewExpression" && this.name === "callee" && parent.callee === node) { return containsCallExpression(node); } } if (assumeExpressionContext !== true && !this.canBeFirstInStatement() && this.firstInStatement()) return true; return false; }; function isBinary(node) { return n3.BinaryExpression.check(node) || n3.LogicalExpression.check(node); } function isUnaryLike(node) { return n3.UnaryExpression.check(node) || n3.SpreadElement && n3.SpreadElement.check(node) || n3.SpreadProperty && n3.SpreadProperty.check(node); } var PRECEDENCE = {}; [ ["||"], ["&&"], ["|"], ["^"], ["&"], ["==", "===", "!=", "!=="], ["<", ">", "<=", ">=", "in", "instanceof"], [">>", "<<", ">>>"], ["+", "-"], ["*", "/", "%"] ].forEach(function(tier, i5) { tier.forEach(function(op2) { PRECEDENCE[op2] = i5; }); }); function containsCallExpression(node) { if (n3.CallExpression.check(node)) { return true; } if (isArray.check(node)) { return node.some(containsCallExpression); } if (n3.Node.check(node)) { return types3.someField(node, function(_name, child) { return containsCallExpression(child); }); } return false; } NPp.canBeFirstInStatement = function() { var node = this.node; return !n3.FunctionExpression.check(node) && !n3.ObjectExpression.check(node); }; NPp.firstInStatement = function() { return firstInStatement(this); }; function firstInStatement(path3) { for (var node, parent; path3.parent; path3 = path3.parent) { node = path3.node; parent = path3.parent.node; if (n3.BlockStatement.check(parent) && path3.parent.name === "body" && path3.name === 0) { if (parent.body[0] !== node) { throw new Error("Nodes must be equal"); } return true; } if (n3.ExpressionStatement.check(parent) && path3.name === "expression") { if (parent.expression !== node) { throw new Error("Nodes must be equal"); } return true; } if (n3.SequenceExpression.check(parent) && path3.parent.name === "expressions" && path3.name === 0) { if (parent.expressions[0] !== node) { throw new Error("Nodes must be equal"); } continue; } if (n3.CallExpression.check(parent) && path3.name === "callee") { if (parent.callee !== node) { throw new Error("Nodes must be equal"); } continue; } if (n3.MemberExpression.check(parent) && path3.name === "object") { if (parent.object !== node) { throw new Error("Nodes must be equal"); } continue; } if (n3.ConditionalExpression.check(parent) && path3.name === "test") { if (parent.test !== node) { throw new Error("Nodes must be equal"); } continue; } if (isBinary(parent) && path3.name === "left") { if (parent.left !== node) { throw new Error("Nodes must be equal"); } continue; } if (n3.UnaryExpression.check(parent) && !parent.prefix && path3.name === "argument") { if (parent.argument !== node) { throw new Error("Nodes must be equal"); } continue; } return false; } return true; } function cleanUpNodesAfterPrune(remainingNodePath) { if (n3.VariableDeclaration.check(remainingNodePath.node)) { var declarations = remainingNodePath.get("declarations").value; if (!declarations || declarations.length === 0) { return remainingNodePath.prune(); } } else if (n3.ExpressionStatement.check(remainingNodePath.node)) { if (!remainingNodePath.get("expression").value) { return remainingNodePath.prune(); } } else if (n3.IfStatement.check(remainingNodePath.node)) { cleanUpIfStatementAfterPrune(remainingNodePath); } return remainingNodePath; } function cleanUpIfStatementAfterPrune(ifStatement) { var testExpression = ifStatement.get("test").value; var alternate = ifStatement.get("alternate").value; var consequent = ifStatement.get("consequent").value; if (!consequent && !alternate) { var testExpressionStatement = b6.expressionStatement(testExpression); ifStatement.replace(testExpressionStatement); } else if (!consequent && alternate) { var negatedTestExpression = b6.unaryExpression("!", testExpression, true); if (n3.UnaryExpression.check(testExpression) && testExpression.operator === "!") { negatedTestExpression = testExpression.argument; } ifStatement.get("test").replace(negatedTestExpression); ifStatement.get("consequent").replace(alternate); ifStatement.get("alternate").replace(); } } return NodePath; } exports2.default = nodePathPlugin; module2.exports = exports2["default"]; } }); // node_modules/ast-types/lib/path-visitor.js var require_path_visitor = __commonJS({ "node_modules/ast-types/lib/path-visitor.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var types_1 = tslib_1.__importDefault(require_types()); var node_path_1 = tslib_1.__importDefault(require_node_path()); var hasOwn = Object.prototype.hasOwnProperty; function pathVisitorPlugin(fork) { var types3 = fork.use(types_1.default); var NodePath = fork.use(node_path_1.default); var isArray = types3.builtInTypes.array; var isObject = types3.builtInTypes.object; var isFunction = types3.builtInTypes.function; var undefined2; var PathVisitor = function PathVisitor2() { if (!(this instanceof PathVisitor2)) { throw new Error("PathVisitor constructor cannot be invoked without 'new'"); } this._reusableContextStack = []; this._methodNameTable = computeMethodNameTable(this); this._shouldVisitComments = hasOwn.call(this._methodNameTable, "Block") || hasOwn.call(this._methodNameTable, "Line"); this.Context = makeContextConstructor(this); this._visiting = false; this._changeReported = false; }; function computeMethodNameTable(visitor) { var typeNames = /* @__PURE__ */ Object.create(null); for (var methodName in visitor) { if (/^visit[A-Z]/.test(methodName)) { typeNames[methodName.slice("visit".length)] = true; } } var supertypeTable = types3.computeSupertypeLookupTable(typeNames); var methodNameTable = /* @__PURE__ */ Object.create(null); var typeNameKeys = Object.keys(supertypeTable); var typeNameCount = typeNameKeys.length; for (var i5 = 0; i5 < typeNameCount; ++i5) { var typeName = typeNameKeys[i5]; methodName = "visit" + supertypeTable[typeName]; if (isFunction.check(visitor[methodName])) { methodNameTable[typeName] = methodName; } } return methodNameTable; } PathVisitor.fromMethodsObject = function fromMethodsObject(methods) { if (methods instanceof PathVisitor) { return methods; } if (!isObject.check(methods)) { return new PathVisitor(); } var Visitor = function Visitor2() { if (!(this instanceof Visitor2)) { throw new Error("Visitor constructor cannot be invoked without 'new'"); } PathVisitor.call(this); }; var Vp = Visitor.prototype = Object.create(PVp); Vp.constructor = Visitor; extend(Vp, methods); extend(Visitor, PathVisitor); isFunction.assert(Visitor.fromMethodsObject); isFunction.assert(Visitor.visit); return new Visitor(); }; function extend(target, source) { for (var property in source) { if (hasOwn.call(source, property)) { target[property] = source[property]; } } return target; } PathVisitor.visit = function visit2(node, methods) { return PathVisitor.fromMethodsObject(methods).visit(node); }; var PVp = PathVisitor.prototype; PVp.visit = function() { if (this._visiting) { throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead."); } this._visiting = true; this._changeReported = false; this._abortRequested = false; var argc = arguments.length; var args = new Array(argc); for (var i5 = 0; i5 < argc; ++i5) { args[i5] = arguments[i5]; } if (!(args[0] instanceof NodePath)) { args[0] = new NodePath({ root: args[0] }).get("root"); } this.reset.apply(this, args); var didNotThrow; try { var root5 = this.visitWithoutReset(args[0]); didNotThrow = true; } finally { this._visiting = false; if (!didNotThrow && this._abortRequested) { return args[0].value; } } return root5; }; PVp.AbortRequest = function AbortRequest() { }; PVp.abort = function() { var visitor = this; visitor._abortRequested = true; var request = new visitor.AbortRequest(); request.cancel = function() { visitor._abortRequested = false; }; throw request; }; PVp.reset = function(_path) { }; PVp.visitWithoutReset = function(path3) { if (this instanceof this.Context) { return this.visitor.visitWithoutReset(path3); } if (!(path3 instanceof NodePath)) { throw new Error(""); } var value = path3.value; var methodName = value && typeof value === "object" && typeof value.type === "string" && this._methodNameTable[value.type]; if (methodName) { var context = this.acquireContext(path3); try { return context.invokeVisitorMethod(methodName); } finally { this.releaseContext(context); } } else { return visitChildren(path3, this); } }; function visitChildren(path3, visitor) { if (!(path3 instanceof NodePath)) { throw new Error(""); } if (!(visitor instanceof PathVisitor)) { throw new Error(""); } var value = path3.value; if (isArray.check(value)) { path3.each(visitor.visitWithoutReset, visitor); } else if (!isObject.check(value)) { } else { var childNames = types3.getFieldNames(value); if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) { childNames.push("comments"); } var childCount = childNames.length; var childPaths = []; for (var i5 = 0; i5 < childCount; ++i5) { var childName = childNames[i5]; if (!hasOwn.call(value, childName)) { value[childName] = types3.getFieldValue(value, childName); } childPaths.push(path3.get(childName)); } for (var i5 = 0; i5 < childCount; ++i5) { visitor.visitWithoutReset(childPaths[i5]); } } return path3.value; } PVp.acquireContext = function(path3) { if (this._reusableContextStack.length === 0) { return new this.Context(path3); } return this._reusableContextStack.pop().reset(path3); }; PVp.releaseContext = function(context) { if (!(context instanceof this.Context)) { throw new Error(""); } this._reusableContextStack.push(context); context.currentPath = null; }; PVp.reportChanged = function() { this._changeReported = true; }; PVp.wasChangeReported = function() { return this._changeReported; }; function makeContextConstructor(visitor) { function Context(path3) { if (!(this instanceof Context)) { throw new Error(""); } if (!(this instanceof PathVisitor)) { throw new Error(""); } if (!(path3 instanceof NodePath)) { throw new Error(""); } Object.defineProperty(this, "visitor", { value: visitor, writable: false, enumerable: true, configurable: false }); this.currentPath = path3; this.needToCallTraverse = true; Object.seal(this); } if (!(visitor instanceof PathVisitor)) { throw new Error(""); } var Cp = Context.prototype = Object.create(visitor); Cp.constructor = Context; extend(Cp, sharedContextProtoMethods); return Context; } var sharedContextProtoMethods = /* @__PURE__ */ Object.create(null); sharedContextProtoMethods.reset = function reset(path3) { if (!(this instanceof this.Context)) { throw new Error(""); } if (!(path3 instanceof NodePath)) { throw new Error(""); } this.currentPath = path3; this.needToCallTraverse = true; return this; }; sharedContextProtoMethods.invokeVisitorMethod = function invokeVisitorMethod(methodName) { if (!(this instanceof this.Context)) { throw new Error(""); } if (!(this.currentPath instanceof NodePath)) { throw new Error(""); } var result = this.visitor[methodName].call(this, this.currentPath); if (result === false) { this.needToCallTraverse = false; } else if (result !== undefined2) { this.currentPath = this.currentPath.replace(result)[0]; if (this.needToCallTraverse) { this.traverse(this.currentPath); } } if (this.needToCallTraverse !== false) { throw new Error("Must either call this.traverse or return false in " + methodName); } var path3 = this.currentPath; return path3 && path3.value; }; sharedContextProtoMethods.traverse = function traverse(path3, newVisitor) { if (!(this instanceof this.Context)) { throw new Error(""); } if (!(path3 instanceof NodePath)) { throw new Error(""); } if (!(this.currentPath instanceof NodePath)) { throw new Error(""); } this.needToCallTraverse = false; return visitChildren(path3, PathVisitor.fromMethodsObject(newVisitor || this.visitor)); }; sharedContextProtoMethods.visit = function visit2(path3, newVisitor) { if (!(this instanceof this.Context)) { throw new Error(""); } if (!(path3 instanceof NodePath)) { throw new Error(""); } if (!(this.currentPath instanceof NodePath)) { throw new Error(""); } this.needToCallTraverse = false; return PathVisitor.fromMethodsObject(newVisitor || this.visitor).visitWithoutReset(path3); }; sharedContextProtoMethods.reportChanged = function reportChanged() { this.visitor.reportChanged(); }; sharedContextProtoMethods.abort = function abort() { this.needToCallTraverse = false; this.visitor.abort(); }; return PathVisitor; } exports2.default = pathVisitorPlugin; module2.exports = exports2["default"]; } }); // node_modules/ast-types/lib/equiv.js var require_equiv = __commonJS({ "node_modules/ast-types/lib/equiv.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var types_1 = tslib_1.__importDefault(require_types()); function default_1(fork) { var types3 = fork.use(types_1.default); var getFieldNames = types3.getFieldNames; var getFieldValue = types3.getFieldValue; var isArray = types3.builtInTypes.array; var isObject = types3.builtInTypes.object; var isDate = types3.builtInTypes.Date; var isRegExp = types3.builtInTypes.RegExp; var hasOwn = Object.prototype.hasOwnProperty; function astNodesAreEquivalent(a5, b6, problemPath) { if (isArray.check(problemPath)) { problemPath.length = 0; } else { problemPath = null; } return areEquivalent(a5, b6, problemPath); } astNodesAreEquivalent.assert = function(a5, b6) { var problemPath = []; if (!astNodesAreEquivalent(a5, b6, problemPath)) { if (problemPath.length === 0) { if (a5 !== b6) { throw new Error("Nodes must be equal"); } } else { throw new Error("Nodes differ in the following path: " + problemPath.map(subscriptForProperty).join("")); } } }; function subscriptForProperty(property) { if (/[_$a-z][_$a-z0-9]*/i.test(property)) { return "." + property; } return "[" + JSON.stringify(property) + "]"; } function areEquivalent(a5, b6, problemPath) { if (a5 === b6) { return true; } if (isArray.check(a5)) { return arraysAreEquivalent(a5, b6, problemPath); } if (isObject.check(a5)) { return objectsAreEquivalent(a5, b6, problemPath); } if (isDate.check(a5)) { return isDate.check(b6) && +a5 === +b6; } if (isRegExp.check(a5)) { return isRegExp.check(b6) && (a5.source === b6.source && a5.global === b6.global && a5.multiline === b6.multiline && a5.ignoreCase === b6.ignoreCase); } return a5 == b6; } function arraysAreEquivalent(a5, b6, problemPath) { isArray.assert(a5); var aLength = a5.length; if (!isArray.check(b6) || b6.length !== aLength) { if (problemPath) { problemPath.push("length"); } return false; } for (var i5 = 0; i5 < aLength; ++i5) { if (problemPath) { problemPath.push(i5); } if (i5 in a5 !== i5 in b6) { return false; } if (!areEquivalent(a5[i5], b6[i5], problemPath)) { return false; } if (problemPath) { var problemPathTail = problemPath.pop(); if (problemPathTail !== i5) { throw new Error("" + problemPathTail); } } } return true; } function objectsAreEquivalent(a5, b6, problemPath) { isObject.assert(a5); if (!isObject.check(b6)) { return false; } if (a5.type !== b6.type) { if (problemPath) { problemPath.push("type"); } return false; } var aNames = getFieldNames(a5); var aNameCount = aNames.length; var bNames = getFieldNames(b6); var bNameCount = bNames.length; if (aNameCount === bNameCount) { for (var i5 = 0; i5 < aNameCount; ++i5) { var name = aNames[i5]; var aChild = getFieldValue(a5, name); var bChild = getFieldValue(b6, name); if (problemPath) { problemPath.push(name); } if (!areEquivalent(aChild, bChild, problemPath)) { return false; } if (problemPath) { var problemPathTail = problemPath.pop(); if (problemPathTail !== name) { throw new Error("" + problemPathTail); } } } return true; } if (!problemPath) { return false; } var seenNames = /* @__PURE__ */ Object.create(null); for (i5 = 0; i5 < aNameCount; ++i5) { seenNames[aNames[i5]] = true; } for (i5 = 0; i5 < bNameCount; ++i5) { name = bNames[i5]; if (!hasOwn.call(seenNames, name)) { problemPath.push(name); return false; } delete seenNames[name]; } for (name in seenNames) { problemPath.push(name); break; } return false; } return astNodesAreEquivalent; } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/fork.js var require_fork = __commonJS({ "node_modules/ast-types/fork.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var types_1 = tslib_1.__importDefault(require_types()); var path_visitor_1 = tslib_1.__importDefault(require_path_visitor()); var equiv_1 = tslib_1.__importDefault(require_equiv()); var path_1 = tslib_1.__importDefault(require_path()); var node_path_1 = tslib_1.__importDefault(require_node_path()); function default_1(defs) { var fork = createFork(); var types3 = fork.use(types_1.default); defs.forEach(fork.use); types3.finalize(); var PathVisitor = fork.use(path_visitor_1.default); return { Type: types3.Type, builtInTypes: types3.builtInTypes, namedTypes: types3.namedTypes, builders: types3.builders, defineMethod: types3.defineMethod, getFieldNames: types3.getFieldNames, getFieldValue: types3.getFieldValue, eachField: types3.eachField, someField: types3.someField, getSupertypeNames: types3.getSupertypeNames, getBuilderName: types3.getBuilderName, astNodesAreEquivalent: fork.use(equiv_1.default), finalize: types3.finalize, Path: fork.use(path_1.default), NodePath: fork.use(node_path_1.default), PathVisitor, use: fork.use, visit: PathVisitor.visit }; } exports2.default = default_1; function createFork() { var used = []; var usedResult = []; function use(plugin) { var idx = used.indexOf(plugin); if (idx === -1) { idx = used.length; used.push(plugin); usedResult[idx] = plugin(fork); } return usedResult[idx]; } var fork = { use }; return fork; } module2.exports = exports2["default"]; } }); // node_modules/ast-types/lib/shared.js var require_shared = __commonJS({ "node_modules/ast-types/lib/shared.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var types_1 = tslib_1.__importDefault(require_types()); function default_1(fork) { var types3 = fork.use(types_1.default); var Type = types3.Type; var builtin = types3.builtInTypes; var isNumber = builtin.number; function geq(than) { return Type.from(function(value) { return isNumber.check(value) && value >= than; }, isNumber + " >= " + than); } ; var defaults = { // Functions were used because (among other reasons) that's the most // elegant way to allow for the emptyArray one always to give a new // array instance. "null": function() { return null; }, "emptyArray": function() { return []; }, "false": function() { return false; }, "true": function() { return true; }, "undefined": function() { }, "use strict": function() { return "use strict"; } }; var naiveIsPrimitive = Type.or(builtin.string, builtin.number, builtin.boolean, builtin.null, builtin.undefined); var isPrimitive = Type.from(function(value) { if (value === null) return true; var type = typeof value; if (type === "object" || type === "function") { return false; } return true; }, naiveIsPrimitive.toString()); return { geq, defaults, isPrimitive }; } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/def/core.js var require_core = __commonJS({ "node_modules/ast-types/def/core.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var types_1 = tslib_1.__importDefault(require_types()); var shared_1 = tslib_1.__importDefault(require_shared()); function default_1(fork) { var types3 = fork.use(types_1.default); var Type = types3.Type; var def = Type.def; var or = Type.or; var shared = fork.use(shared_1.default); var defaults = shared.defaults; var geq = shared.geq; def("Printable").field("loc", or(def("SourceLocation"), null), defaults["null"], true); def("Node").bases("Printable").field("type", String).field("comments", or([def("Comment")], null), defaults["null"], true); def("SourceLocation").field("start", def("Position")).field("end", def("Position")).field("source", or(String, null), defaults["null"]); def("Position").field("line", geq(1)).field("column", geq(0)); def("File").bases("Node").build("program", "name").field("program", def("Program")).field("name", or(String, null), defaults["null"]); def("Program").bases("Node").build("body").field("body", [def("Statement")]); def("Function").bases("Node").field("id", or(def("Identifier"), null), defaults["null"]).field("params", [def("Pattern")]).field("body", def("BlockStatement")).field("generator", Boolean, defaults["false"]).field("async", Boolean, defaults["false"]); def("Statement").bases("Node"); def("EmptyStatement").bases("Statement").build(); def("BlockStatement").bases("Statement").build("body").field("body", [def("Statement")]); def("ExpressionStatement").bases("Statement").build("expression").field("expression", def("Expression")); def("IfStatement").bases("Statement").build("test", "consequent", "alternate").field("test", def("Expression")).field("consequent", def("Statement")).field("alternate", or(def("Statement"), null), defaults["null"]); def("LabeledStatement").bases("Statement").build("label", "body").field("label", def("Identifier")).field("body", def("Statement")); def("BreakStatement").bases("Statement").build("label").field("label", or(def("Identifier"), null), defaults["null"]); def("ContinueStatement").bases("Statement").build("label").field("label", or(def("Identifier"), null), defaults["null"]); def("WithStatement").bases("Statement").build("object", "body").field("object", def("Expression")).field("body", def("Statement")); def("SwitchStatement").bases("Statement").build("discriminant", "cases", "lexical").field("discriminant", def("Expression")).field("cases", [def("SwitchCase")]).field("lexical", Boolean, defaults["false"]); def("ReturnStatement").bases("Statement").build("argument").field("argument", or(def("Expression"), null)); def("ThrowStatement").bases("Statement").build("argument").field("argument", def("Expression")); def("TryStatement").bases("Statement").build("block", "handler", "finalizer").field("block", def("BlockStatement")).field("handler", or(def("CatchClause"), null), function() { return this.handlers && this.handlers[0] || null; }).field("handlers", [def("CatchClause")], function() { return this.handler ? [this.handler] : []; }, true).field("guardedHandlers", [def("CatchClause")], defaults.emptyArray).field("finalizer", or(def("BlockStatement"), null), defaults["null"]); def("CatchClause").bases("Node").build("param", "guard", "body").field("param", or(def("Pattern"), null), defaults["null"]).field("guard", or(def("Expression"), null), defaults["null"]).field("body", def("BlockStatement")); def("WhileStatement").bases("Statement").build("test", "body").field("test", def("Expression")).field("body", def("Statement")); def("DoWhileStatement").bases("Statement").build("body", "test").field("body", def("Statement")).field("test", def("Expression")); def("ForStatement").bases("Statement").build("init", "test", "update", "body").field("init", or(def("VariableDeclaration"), def("Expression"), null)).field("test", or(def("Expression"), null)).field("update", or(def("Expression"), null)).field("body", def("Statement")); def("ForInStatement").bases("Statement").build("left", "right", "body").field("left", or(def("VariableDeclaration"), def("Expression"))).field("right", def("Expression")).field("body", def("Statement")); def("DebuggerStatement").bases("Statement").build(); def("Declaration").bases("Statement"); def("FunctionDeclaration").bases("Function", "Declaration").build("id", "params", "body").field("id", def("Identifier")); def("FunctionExpression").bases("Function", "Expression").build("id", "params", "body"); def("VariableDeclaration").bases("Declaration").build("kind", "declarations").field("kind", or("var", "let", "const")).field("declarations", [def("VariableDeclarator")]); def("VariableDeclarator").bases("Node").build("id", "init").field("id", def("Pattern")).field("init", or(def("Expression"), null), defaults["null"]); def("Expression").bases("Node"); def("ThisExpression").bases("Expression").build(); def("ArrayExpression").bases("Expression").build("elements").field("elements", [or(def("Expression"), null)]); def("ObjectExpression").bases("Expression").build("properties").field("properties", [def("Property")]); def("Property").bases("Node").build("kind", "key", "value").field("kind", or("init", "get", "set")).field("key", or(def("Literal"), def("Identifier"))).field("value", def("Expression")); def("SequenceExpression").bases("Expression").build("expressions").field("expressions", [def("Expression")]); var UnaryOperator = or("-", "+", "!", "~", "typeof", "void", "delete"); def("UnaryExpression").bases("Expression").build("operator", "argument", "prefix").field("operator", UnaryOperator).field("argument", def("Expression")).field("prefix", Boolean, defaults["true"]); var BinaryOperator = or( "==", "!=", "===", "!==", "<", "<=", ">", ">=", "<<", ">>", ">>>", "+", "-", "*", "/", "%", "**", "&", // TODO Missing from the Parser API. "|", "^", "in", "instanceof" ); def("BinaryExpression").bases("Expression").build("operator", "left", "right").field("operator", BinaryOperator).field("left", def("Expression")).field("right", def("Expression")); var AssignmentOperator = or("=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&="); def("AssignmentExpression").bases("Expression").build("operator", "left", "right").field("operator", AssignmentOperator).field("left", or(def("Pattern"), def("MemberExpression"))).field("right", def("Expression")); var UpdateOperator = or("++", "--"); def("UpdateExpression").bases("Expression").build("operator", "argument", "prefix").field("operator", UpdateOperator).field("argument", def("Expression")).field("prefix", Boolean); var LogicalOperator = or("||", "&&"); def("LogicalExpression").bases("Expression").build("operator", "left", "right").field("operator", LogicalOperator).field("left", def("Expression")).field("right", def("Expression")); def("ConditionalExpression").bases("Expression").build("test", "consequent", "alternate").field("test", def("Expression")).field("consequent", def("Expression")).field("alternate", def("Expression")); def("NewExpression").bases("Expression").build("callee", "arguments").field("callee", def("Expression")).field("arguments", [def("Expression")]); def("CallExpression").bases("Expression").build("callee", "arguments").field("callee", def("Expression")).field("arguments", [def("Expression")]); def("MemberExpression").bases("Expression").build("object", "property", "computed").field("object", def("Expression")).field("property", or(def("Identifier"), def("Expression"))).field("computed", Boolean, function() { var type = this.property.type; if (type === "Literal" || type === "MemberExpression" || type === "BinaryExpression") { return true; } return false; }); def("Pattern").bases("Node"); def("SwitchCase").bases("Node").build("test", "consequent").field("test", or(def("Expression"), null)).field("consequent", [def("Statement")]); def("Identifier").bases("Expression", "Pattern").build("name").field("name", String).field("optional", Boolean, defaults["false"]); def("Literal").bases("Expression").build("value").field("value", or(String, Boolean, null, Number, RegExp)).field("regex", or({ pattern: String, flags: String }, null), function() { if (this.value instanceof RegExp) { var flags = ""; if (this.value.ignoreCase) flags += "i"; if (this.value.multiline) flags += "m"; if (this.value.global) flags += "g"; return { pattern: this.value.source, flags }; } return null; }); def("Comment").bases("Printable").field("value", String).field("leading", Boolean, defaults["true"]).field("trailing", Boolean, defaults["false"]); } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/def/es6.js var require_es6 = __commonJS({ "node_modules/ast-types/def/es6.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var core_1 = tslib_1.__importDefault(require_core()); var types_1 = tslib_1.__importDefault(require_types()); var shared_1 = tslib_1.__importDefault(require_shared()); function default_1(fork) { fork.use(core_1.default); var types3 = fork.use(types_1.default); var def = types3.Type.def; var or = types3.Type.or; var defaults = fork.use(shared_1.default).defaults; def("Function").field("generator", Boolean, defaults["false"]).field("expression", Boolean, defaults["false"]).field("defaults", [or(def("Expression"), null)], defaults.emptyArray).field("rest", or(def("Identifier"), null), defaults["null"]); def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field( "typeAnnotation", // for Babylon. Flow parser puts it on the identifier or(def("TypeAnnotation"), def("TSTypeAnnotation"), null), defaults["null"] ); def("SpreadElementPattern").bases("Pattern").build("argument").field("argument", def("Pattern")); def("FunctionDeclaration").build("id", "params", "body", "generator", "expression"); def("FunctionExpression").build("id", "params", "body", "generator", "expression"); def("ArrowFunctionExpression").bases("Function", "Expression").build("params", "body", "expression").field("id", null, defaults["null"]).field("body", or(def("BlockStatement"), def("Expression"))).field("generator", false, defaults["false"]); def("ForOfStatement").bases("Statement").build("left", "right", "body").field("left", or(def("VariableDeclaration"), def("Pattern"))).field("right", def("Expression")).field("body", def("Statement")); def("YieldExpression").bases("Expression").build("argument", "delegate").field("argument", or(def("Expression"), null)).field("delegate", Boolean, defaults["false"]); def("GeneratorExpression").bases("Expression").build("body", "blocks", "filter").field("body", def("Expression")).field("blocks", [def("ComprehensionBlock")]).field("filter", or(def("Expression"), null)); def("ComprehensionExpression").bases("Expression").build("body", "blocks", "filter").field("body", def("Expression")).field("blocks", [def("ComprehensionBlock")]).field("filter", or(def("Expression"), null)); def("ComprehensionBlock").bases("Node").build("left", "right", "each").field("left", def("Pattern")).field("right", def("Expression")).field("each", Boolean); def("Property").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("value", or(def("Expression"), def("Pattern"))).field("method", Boolean, defaults["false"]).field("shorthand", Boolean, defaults["false"]).field("computed", Boolean, defaults["false"]); def("ObjectProperty").field("shorthand", Boolean, defaults["false"]); def("PropertyPattern").bases("Pattern").build("key", "pattern").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("pattern", def("Pattern")).field("computed", Boolean, defaults["false"]); def("ObjectPattern").bases("Pattern").build("properties").field("properties", [or(def("PropertyPattern"), def("Property"))]); def("ArrayPattern").bases("Pattern").build("elements").field("elements", [or(def("Pattern"), null)]); def("MethodDefinition").bases("Declaration").build("kind", "key", "value", "static").field("kind", or("constructor", "method", "get", "set")).field("key", def("Expression")).field("value", def("Function")).field("computed", Boolean, defaults["false"]).field("static", Boolean, defaults["false"]); def("SpreadElement").bases("Node").build("argument").field("argument", def("Expression")); def("ArrayExpression").field("elements", [or(def("Expression"), def("SpreadElement"), def("RestElement"), null)]); def("NewExpression").field("arguments", [or(def("Expression"), def("SpreadElement"))]); def("CallExpression").field("arguments", [or(def("Expression"), def("SpreadElement"))]); def("AssignmentPattern").bases("Pattern").build("left", "right").field("left", def("Pattern")).field("right", def("Expression")); var ClassBodyElement = or(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty")); def("ClassProperty").bases("Declaration").build("key").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("computed", Boolean, defaults["false"]); def("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition", ClassBodyElement); def("ClassBody").bases("Declaration").build("body").field("body", [ClassBodyElement]); def("ClassDeclaration").bases("Declaration").build("id", "body", "superClass").field("id", or(def("Identifier"), null)).field("body", def("ClassBody")).field("superClass", or(def("Expression"), null), defaults["null"]); def("ClassExpression").bases("Expression").build("id", "body", "superClass").field("id", or(def("Identifier"), null), defaults["null"]).field("body", def("ClassBody")).field("superClass", or(def("Expression"), null), defaults["null"]); def("Specifier").bases("Node"); def("ModuleSpecifier").bases("Specifier").field("local", or(def("Identifier"), null), defaults["null"]).field("id", or(def("Identifier"), null), defaults["null"]).field("name", or(def("Identifier"), null), defaults["null"]); def("ImportSpecifier").bases("ModuleSpecifier").build("id", "name"); def("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("id"); def("ImportDefaultSpecifier").bases("ModuleSpecifier").build("id"); def("ImportDeclaration").bases("Declaration").build("specifiers", "source", "importKind").field("specifiers", [or(def("ImportSpecifier"), def("ImportNamespaceSpecifier"), def("ImportDefaultSpecifier"))], defaults.emptyArray).field("source", def("Literal")).field("importKind", or("value", "type"), function() { return "value"; }); def("TaggedTemplateExpression").bases("Expression").build("tag", "quasi").field("tag", def("Expression")).field("quasi", def("TemplateLiteral")); def("TemplateLiteral").bases("Expression").build("quasis", "expressions").field("quasis", [def("TemplateElement")]).field("expressions", [def("Expression")]); def("TemplateElement").bases("Node").build("value", "tail").field("value", { "cooked": String, "raw": String }).field("tail", Boolean); } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/def/es7.js var require_es7 = __commonJS({ "node_modules/ast-types/def/es7.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var es6_1 = tslib_1.__importDefault(require_es6()); var types_1 = tslib_1.__importDefault(require_types()); var shared_1 = tslib_1.__importDefault(require_shared()); function default_1(fork) { fork.use(es6_1.default); var types3 = fork.use(types_1.default); var def = types3.Type.def; var or = types3.Type.or; var defaults = fork.use(shared_1.default).defaults; def("Function").field("async", Boolean, defaults["false"]); def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression")); def("ObjectExpression").field("properties", [or(def("Property"), def("SpreadProperty"), def("SpreadElement"))]); def("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument", def("Pattern")); def("ObjectPattern").field("properties", [or(def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"))]); def("AwaitExpression").bases("Expression").build("argument", "all").field("argument", or(def("Expression"), null)).field("all", Boolean, defaults["false"]); } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/def/es2020.js var require_es2020 = __commonJS({ "node_modules/ast-types/def/es2020.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var es7_1 = tslib_1.__importDefault(require_es7()); var types_1 = tslib_1.__importDefault(require_types()); function default_1(fork) { fork.use(es7_1.default); var types3 = fork.use(types_1.default); var def = types3.Type.def; def("ImportExpression").bases("Expression").build("source").field("source", def("Expression")); } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/def/jsx.js var require_jsx = __commonJS({ "node_modules/ast-types/def/jsx.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var es7_1 = tslib_1.__importDefault(require_es7()); var types_1 = tslib_1.__importDefault(require_types()); var shared_1 = tslib_1.__importDefault(require_shared()); function default_1(fork) { fork.use(es7_1.default); var types3 = fork.use(types_1.default); var def = types3.Type.def; var or = types3.Type.or; var defaults = fork.use(shared_1.default).defaults; def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or( def("Literal"), // attr="value" def("JSXExpressionContainer"), // attr={value} null // attr= or just attr ), defaults["null"]); def("JSXIdentifier").bases("Identifier").build("name").field("name", String); def("JSXNamespacedName").bases("Node").build("namespace", "name").field("namespace", def("JSXIdentifier")).field("name", def("JSXIdentifier")); def("JSXMemberExpression").bases("MemberExpression").build("object", "property").field("object", or(def("JSXIdentifier"), def("JSXMemberExpression"))).field("property", def("JSXIdentifier")).field("computed", Boolean, defaults.false); var JSXElementName = or(def("JSXIdentifier"), def("JSXNamespacedName"), def("JSXMemberExpression")); def("JSXSpreadAttribute").bases("Node").build("argument").field("argument", def("Expression")); var JSXAttributes = [or(def("JSXAttribute"), def("JSXSpreadAttribute"))]; def("JSXExpressionContainer").bases("Expression").build("expression").field("expression", def("Expression")); def("JSXElement").bases("Expression").build("openingElement", "closingElement", "children").field("openingElement", def("JSXOpeningElement")).field("closingElement", or(def("JSXClosingElement"), null), defaults["null"]).field("children", [or( def("JSXElement"), def("JSXExpressionContainer"), def("JSXFragment"), def("JSXText"), def("Literal") // TODO Esprima should return JSXText instead. )], defaults.emptyArray).field("name", JSXElementName, function() { return this.openingElement.name; }, true).field("selfClosing", Boolean, function() { return this.openingElement.selfClosing; }, true).field("attributes", JSXAttributes, function() { return this.openingElement.attributes; }, true); def("JSXOpeningElement").bases("Node").build("name", "attributes", "selfClosing").field("name", JSXElementName).field("attributes", JSXAttributes, defaults.emptyArray).field("selfClosing", Boolean, defaults["false"]); def("JSXClosingElement").bases("Node").build("name").field("name", JSXElementName); def("JSXFragment").bases("Expression").build("openingElement", "closingElement", "children").field("openingElement", def("JSXOpeningFragment")).field("closingElement", def("JSXClosingFragment")).field("children", [or( def("JSXElement"), def("JSXExpressionContainer"), def("JSXFragment"), def("JSXText"), def("Literal") // TODO Esprima should return JSXText instead. )], defaults.emptyArray); def("JSXOpeningFragment").bases("Node").build(); def("JSXClosingFragment").bases("Node").build(); def("JSXText").bases("Literal").build("value").field("value", String); def("JSXEmptyExpression").bases("Expression").build(); def("JSXSpreadChild").bases("Expression").build("expression").field("expression", def("Expression")); } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/def/type-annotations.js var require_type_annotations = __commonJS({ "node_modules/ast-types/def/type-annotations.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var types_1 = tslib_1.__importDefault(require_types()); var shared_1 = tslib_1.__importDefault(require_shared()); function default_1(fork) { var types3 = fork.use(types_1.default); var def = types3.Type.def; var or = types3.Type.or; var defaults = fork.use(shared_1.default).defaults; var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null); var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null); def("Identifier").field("typeAnnotation", TypeAnnotation, defaults["null"]); def("ObjectPattern").field("typeAnnotation", TypeAnnotation, defaults["null"]); def("Function").field("returnType", TypeAnnotation, defaults["null"]).field("typeParameters", TypeParamDecl, defaults["null"]); def("ClassProperty").build("key", "value", "typeAnnotation", "static").field("value", or(def("Expression"), null)).field("static", Boolean, defaults["false"]).field("typeAnnotation", TypeAnnotation, defaults["null"]); [ "ClassDeclaration", "ClassExpression" ].forEach(function(typeName) { def(typeName).field("typeParameters", TypeParamDecl, defaults["null"]).field("superTypeParameters", or(def("TypeParameterInstantiation"), def("TSTypeParameterInstantiation"), null), defaults["null"]).field("implements", or([def("ClassImplements")], [def("TSExpressionWithTypeArguments")]), defaults.emptyArray); }); } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/def/flow.js var require_flow = __commonJS({ "node_modules/ast-types/def/flow.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var es7_1 = tslib_1.__importDefault(require_es7()); var type_annotations_1 = tslib_1.__importDefault(require_type_annotations()); var types_1 = tslib_1.__importDefault(require_types()); var shared_1 = tslib_1.__importDefault(require_shared()); function default_1(fork) { fork.use(es7_1.default); fork.use(type_annotations_1.default); var types3 = fork.use(types_1.default); var def = types3.Type.def; var or = types3.Type.or; var defaults = fork.use(shared_1.default).defaults; def("Flow").bases("Node"); def("FlowType").bases("Flow"); def("AnyTypeAnnotation").bases("FlowType").build(); def("EmptyTypeAnnotation").bases("FlowType").build(); def("MixedTypeAnnotation").bases("FlowType").build(); def("VoidTypeAnnotation").bases("FlowType").build(); def("NumberTypeAnnotation").bases("FlowType").build(); def("NumberLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", Number).field("raw", String); def("NumericLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", Number).field("raw", String); def("StringTypeAnnotation").bases("FlowType").build(); def("StringLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", String).field("raw", String); def("BooleanTypeAnnotation").bases("FlowType").build(); def("BooleanLiteralTypeAnnotation").bases("FlowType").build("value", "raw").field("value", Boolean).field("raw", String); def("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation", def("FlowType")); def("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation", def("FlowType")); def("NullLiteralTypeAnnotation").bases("FlowType").build(); def("NullTypeAnnotation").bases("FlowType").build(); def("ThisTypeAnnotation").bases("FlowType").build(); def("ExistsTypeAnnotation").bases("FlowType").build(); def("ExistentialTypeParam").bases("FlowType").build(); def("FunctionTypeAnnotation").bases("FlowType").build("params", "returnType", "rest", "typeParameters").field("params", [def("FunctionTypeParam")]).field("returnType", def("FlowType")).field("rest", or(def("FunctionTypeParam"), null)).field("typeParameters", or(def("TypeParameterDeclaration"), null)); def("FunctionTypeParam").bases("Node").build("name", "typeAnnotation", "optional").field("name", def("Identifier")).field("typeAnnotation", def("FlowType")).field("optional", Boolean); def("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType", def("FlowType")); def("ObjectTypeAnnotation").bases("FlowType").build("properties", "indexers", "callProperties").field("properties", [ or(def("ObjectTypeProperty"), def("ObjectTypeSpreadProperty")) ]).field("indexers", [def("ObjectTypeIndexer")], defaults.emptyArray).field("callProperties", [def("ObjectTypeCallProperty")], defaults.emptyArray).field("inexact", or(Boolean, void 0), defaults["undefined"]).field("exact", Boolean, defaults["false"]).field("internalSlots", [def("ObjectTypeInternalSlot")], defaults.emptyArray); def("Variance").bases("Node").build("kind").field("kind", or("plus", "minus")); var LegacyVariance = or(def("Variance"), "plus", "minus", null); def("ObjectTypeProperty").bases("Node").build("key", "value", "optional").field("key", or(def("Literal"), def("Identifier"))).field("value", def("FlowType")).field("optional", Boolean).field("variance", LegacyVariance, defaults["null"]); def("ObjectTypeIndexer").bases("Node").build("id", "key", "value").field("id", def("Identifier")).field("key", def("FlowType")).field("value", def("FlowType")).field("variance", LegacyVariance, defaults["null"]); def("ObjectTypeCallProperty").bases("Node").build("value").field("value", def("FunctionTypeAnnotation")).field("static", Boolean, defaults["false"]); def("QualifiedTypeIdentifier").bases("Node").build("qualification", "id").field("qualification", or(def("Identifier"), def("QualifiedTypeIdentifier"))).field("id", def("Identifier")); def("GenericTypeAnnotation").bases("FlowType").build("id", "typeParameters").field("id", or(def("Identifier"), def("QualifiedTypeIdentifier"))).field("typeParameters", or(def("TypeParameterInstantiation"), null)); def("MemberTypeAnnotation").bases("FlowType").build("object", "property").field("object", def("Identifier")).field("property", or(def("MemberTypeAnnotation"), def("GenericTypeAnnotation"))); def("UnionTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]); def("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]); def("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument", def("FlowType")); def("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument", def("FlowType")); def("ObjectTypeInternalSlot").bases("Node").build("id", "value", "optional", "static", "method").field("id", def("Identifier")).field("value", def("FlowType")).field("optional", Boolean).field("static", Boolean).field("method", Boolean); def("TypeParameterDeclaration").bases("Node").build("params").field("params", [def("TypeParameter")]); def("TypeParameterInstantiation").bases("Node").build("params").field("params", [def("FlowType")]); def("TypeParameter").bases("FlowType").build("name", "variance", "bound").field("name", String).field("variance", LegacyVariance, defaults["null"]).field("bound", or(def("TypeAnnotation"), null), defaults["null"]); def("ClassProperty").field("variance", LegacyVariance, defaults["null"]); def("ClassImplements").bases("Node").build("id").field("id", def("Identifier")).field("superClass", or(def("Expression"), null), defaults["null"]).field("typeParameters", or(def("TypeParameterInstantiation"), null), defaults["null"]); def("InterfaceTypeAnnotation").bases("FlowType").build("body", "extends").field("body", def("ObjectTypeAnnotation")).field("extends", or([def("InterfaceExtends")], null), defaults["null"]); def("InterfaceDeclaration").bases("Declaration").build("id", "body", "extends").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterDeclaration"), null), defaults["null"]).field("body", def("ObjectTypeAnnotation")).field("extends", [def("InterfaceExtends")]); def("DeclareInterface").bases("InterfaceDeclaration").build("id", "body", "extends"); def("InterfaceExtends").bases("Node").build("id").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterInstantiation"), null), defaults["null"]); def("TypeAlias").bases("Declaration").build("id", "typeParameters", "right").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterDeclaration"), null)).field("right", def("FlowType")); def("OpaqueType").bases("Declaration").build("id", "typeParameters", "impltype", "supertype").field("id", def("Identifier")).field("typeParameters", or(def("TypeParameterDeclaration"), null)).field("impltype", def("FlowType")).field("supertype", def("FlowType")); def("DeclareTypeAlias").bases("TypeAlias").build("id", "typeParameters", "right"); def("DeclareOpaqueType").bases("TypeAlias").build("id", "typeParameters", "supertype"); def("TypeCastExpression").bases("Expression").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TypeAnnotation")); def("TupleTypeAnnotation").bases("FlowType").build("types").field("types", [def("FlowType")]); def("DeclareVariable").bases("Statement").build("id").field("id", def("Identifier")); def("DeclareFunction").bases("Statement").build("id").field("id", def("Identifier")); def("DeclareClass").bases("InterfaceDeclaration").build("id"); def("DeclareModule").bases("Statement").build("id", "body").field("id", or(def("Identifier"), def("Literal"))).field("body", def("BlockStatement")); def("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation", def("TypeAnnotation")); def("DeclareExportDeclaration").bases("Declaration").build("default", "declaration", "specifiers", "source").field("default", Boolean).field("declaration", or( def("DeclareVariable"), def("DeclareFunction"), def("DeclareClass"), def("FlowType"), // Implies default. null )).field("specifiers", [or(def("ExportSpecifier"), def("ExportBatchSpecifier"))], defaults.emptyArray).field("source", or(def("Literal"), null), defaults["null"]); def("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source", or(def("Literal"), null), defaults["null"]); def("FlowPredicate").bases("Flow"); def("InferredPredicate").bases("FlowPredicate").build(); def("DeclaredPredicate").bases("FlowPredicate").build("value").field("value", def("Expression")); def("CallExpression").field("typeArguments", or(null, def("TypeParameterInstantiation")), defaults["null"]); def("NewExpression").field("typeArguments", or(null, def("TypeParameterInstantiation")), defaults["null"]); } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/def/esprima.js var require_esprima2 = __commonJS({ "node_modules/ast-types/def/esprima.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var es7_1 = tslib_1.__importDefault(require_es7()); var types_1 = tslib_1.__importDefault(require_types()); var shared_1 = tslib_1.__importDefault(require_shared()); function default_1(fork) { fork.use(es7_1.default); var types3 = fork.use(types_1.default); var defaults = fork.use(shared_1.default).defaults; var def = types3.Type.def; var or = types3.Type.or; def("VariableDeclaration").field("declarations", [or( def("VariableDeclarator"), def("Identifier") // Esprima deviation. )]); def("Property").field("value", or( def("Expression"), def("Pattern") // Esprima deviation. )); def("ArrayPattern").field("elements", [or(def("Pattern"), def("SpreadElement"), null)]); def("ObjectPattern").field("properties", [or( def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"), def("SpreadProperty") // Used by Esprima. )]); def("ExportSpecifier").bases("ModuleSpecifier").build("id", "name"); def("ExportBatchSpecifier").bases("Specifier").build(); def("ExportDeclaration").bases("Declaration").build("default", "declaration", "specifiers", "source").field("default", Boolean).field("declaration", or( def("Declaration"), def("Expression"), // Implies default. null )).field("specifiers", [or(def("ExportSpecifier"), def("ExportBatchSpecifier"))], defaults.emptyArray).field("source", or(def("Literal"), null), defaults["null"]); def("Block").bases("Comment").build( "value", /*optional:*/ "leading", "trailing" ); def("Line").bases("Comment").build( "value", /*optional:*/ "leading", "trailing" ); } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/def/babel-core.js var require_babel_core = __commonJS({ "node_modules/ast-types/def/babel-core.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var types_1 = tslib_1.__importDefault(require_types()); var shared_1 = tslib_1.__importDefault(require_shared()); var es7_1 = tslib_1.__importDefault(require_es7()); function default_1(fork) { fork.use(es7_1.default); var types3 = fork.use(types_1.default); var defaults = fork.use(shared_1.default).defaults; var def = types3.Type.def; var or = types3.Type.or; def("Noop").bases("Statement").build(); def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]); def("Super").bases("Expression").build(); def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression")); def("Decorator").bases("Node").build("expression").field("expression", def("Expression")); def("Property").field("decorators", or([def("Decorator")], null), defaults["null"]); def("MethodDefinition").field("decorators", or([def("Decorator")], null), defaults["null"]); def("MetaProperty").bases("Expression").build("meta", "property").field("meta", def("Identifier")).field("property", def("Identifier")); def("ParenthesizedExpression").bases("Expression").build("expression").field("expression", def("Expression")); def("ImportSpecifier").bases("ModuleSpecifier").build("imported", "local").field("imported", def("Identifier")); def("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"); def("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"); def("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration", or(def("Declaration"), def("Expression"))); def("ExportNamedDeclaration").bases("Declaration").build("declaration", "specifiers", "source").field("declaration", or(def("Declaration"), null)).field("specifiers", [def("ExportSpecifier")], defaults.emptyArray).field("source", or(def("Literal"), null), defaults["null"]); def("ExportSpecifier").bases("ModuleSpecifier").build("local", "exported").field("exported", def("Identifier")); def("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported", def("Identifier")); def("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported", def("Identifier")); def("ExportAllDeclaration").bases("Declaration").build("exported", "source").field("exported", or(def("Identifier"), null)).field("source", def("Literal")); def("CommentBlock").bases("Comment").build( "value", /*optional:*/ "leading", "trailing" ); def("CommentLine").bases("Comment").build( "value", /*optional:*/ "leading", "trailing" ); def("Directive").bases("Node").build("value").field("value", def("DirectiveLiteral")); def("DirectiveLiteral").bases("Node", "Expression").build("value").field("value", String, defaults["use strict"]); def("InterpreterDirective").bases("Node").build("value").field("value", String); def("BlockStatement").bases("Statement").build("body").field("body", [def("Statement")]).field("directives", [def("Directive")], defaults.emptyArray); def("Program").bases("Node").build("body").field("body", [def("Statement")]).field("directives", [def("Directive")], defaults.emptyArray).field("interpreter", or(def("InterpreterDirective"), null), defaults["null"]); def("StringLiteral").bases("Literal").build("value").field("value", String); def("NumericLiteral").bases("Literal").build("value").field("value", Number).field("raw", or(String, null), defaults["null"]).field("extra", { rawValue: Number, raw: String }, function getDefault() { return { rawValue: this.value, raw: this.value + "" }; }); def("BigIntLiteral").bases("Literal").build("value").field("value", or(String, Number)).field("extra", { rawValue: String, raw: String }, function getDefault() { return { rawValue: String(this.value), raw: this.value + "n" }; }); def("NullLiteral").bases("Literal").build().field("value", null, defaults["null"]); def("BooleanLiteral").bases("Literal").build("value").field("value", Boolean); def("RegExpLiteral").bases("Literal").build("pattern", "flags").field("pattern", String).field("flags", String).field("value", RegExp, function() { return new RegExp(this.pattern, this.flags); }); var ObjectExpressionProperty = or(def("Property"), def("ObjectMethod"), def("ObjectProperty"), def("SpreadProperty"), def("SpreadElement")); def("ObjectExpression").bases("Expression").build("properties").field("properties", [ObjectExpressionProperty]); def("ObjectMethod").bases("Node", "Function").build("kind", "key", "params", "body", "computed").field("kind", or("method", "get", "set")).field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("params", [def("Pattern")]).field("body", def("BlockStatement")).field("computed", Boolean, defaults["false"]).field("generator", Boolean, defaults["false"]).field("async", Boolean, defaults["false"]).field( "accessibility", // TypeScript or(def("Literal"), null), defaults["null"] ).field("decorators", or([def("Decorator")], null), defaults["null"]); def("ObjectProperty").bases("Node").build("key", "value").field("key", or(def("Literal"), def("Identifier"), def("Expression"))).field("value", or(def("Expression"), def("Pattern"))).field( "accessibility", // TypeScript or(def("Literal"), null), defaults["null"] ).field("computed", Boolean, defaults["false"]); var ClassBodyElement = or(def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("ClassPrivateProperty"), def("ClassMethod"), def("ClassPrivateMethod")); def("ClassBody").bases("Declaration").build("body").field("body", [ClassBodyElement]); def("ClassMethod").bases("Declaration", "Function").build("kind", "key", "params", "body", "computed", "static").field("key", or(def("Literal"), def("Identifier"), def("Expression"))); def("ClassPrivateMethod").bases("Declaration", "Function").build("key", "params", "body", "kind", "computed", "static").field("key", def("PrivateName")); [ "ClassMethod", "ClassPrivateMethod" ].forEach(function(typeName) { def(typeName).field("kind", or("get", "set", "method", "constructor"), function() { return "method"; }).field("body", def("BlockStatement")).field("computed", Boolean, defaults["false"]).field("static", or(Boolean, null), defaults["null"]).field("abstract", or(Boolean, null), defaults["null"]).field("access", or("public", "private", "protected", null), defaults["null"]).field("accessibility", or("public", "private", "protected", null), defaults["null"]).field("decorators", or([def("Decorator")], null), defaults["null"]).field("optional", or(Boolean, null), defaults["null"]); }); def("ClassPrivateProperty").bases("ClassProperty").build("key", "value").field("key", def("PrivateName")).field("value", or(def("Expression"), null), defaults["null"]); def("PrivateName").bases("Expression", "Pattern").build("id").field("id", def("Identifier")); var ObjectPatternProperty = or( def("Property"), def("PropertyPattern"), def("SpreadPropertyPattern"), def("SpreadProperty"), // Used by Esprima def("ObjectProperty"), // Babel 6 def("RestProperty") // Babel 6 ); def("ObjectPattern").bases("Pattern").build("properties").field("properties", [ObjectPatternProperty]).field("decorators", or([def("Decorator")], null), defaults["null"]); def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression")); def("RestProperty").bases("Node").build("argument").field("argument", def("Expression")); def("ForAwaitStatement").bases("Statement").build("left", "right", "body").field("left", or(def("VariableDeclaration"), def("Expression"))).field("right", def("Expression")).field("body", def("Statement")); def("Import").bases("Expression").build(); } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/def/babel.js var require_babel = __commonJS({ "node_modules/ast-types/def/babel.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var babel_core_1 = tslib_1.__importDefault(require_babel_core()); var flow_1 = tslib_1.__importDefault(require_flow()); function default_1(fork) { fork.use(babel_core_1.default); fork.use(flow_1.default); } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/def/typescript.js var require_typescript = __commonJS({ "node_modules/ast-types/def/typescript.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var babel_core_1 = tslib_1.__importDefault(require_babel_core()); var type_annotations_1 = tslib_1.__importDefault(require_type_annotations()); var types_1 = tslib_1.__importDefault(require_types()); var shared_1 = tslib_1.__importDefault(require_shared()); function default_1(fork) { fork.use(babel_core_1.default); fork.use(type_annotations_1.default); var types3 = fork.use(types_1.default); var n3 = types3.namedTypes; var def = types3.Type.def; var or = types3.Type.or; var defaults = fork.use(shared_1.default).defaults; var StringLiteral = types3.Type.from(function(value, deep) { if (n3.StringLiteral && n3.StringLiteral.check(value, deep)) { return true; } if (n3.Literal && n3.Literal.check(value, deep) && typeof value.value === "string") { return true; } return false; }, "StringLiteral"); def("TSType").bases("Node"); var TSEntityName = or(def("Identifier"), def("TSQualifiedName")); def("TSTypeReference").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("typeName", "typeParameters").field("typeName", TSEntityName); def("TSHasOptionalTypeParameterInstantiation").field("typeParameters", or(def("TSTypeParameterInstantiation"), null), defaults["null"]); def("TSHasOptionalTypeParameters").field("typeParameters", or(def("TSTypeParameterDeclaration"), null, void 0), defaults["null"]); def("TSHasOptionalTypeAnnotation").field("typeAnnotation", or(def("TSTypeAnnotation"), null), defaults["null"]); def("TSQualifiedName").bases("Node").build("left", "right").field("left", TSEntityName).field("right", TSEntityName); def("TSAsExpression").bases("Expression", "Pattern").build("expression", "typeAnnotation").field("expression", def("Expression")).field("typeAnnotation", def("TSType")).field("extra", or({ parenthesized: Boolean }, null), defaults["null"]); def("TSNonNullExpression").bases("Expression", "Pattern").build("expression").field("expression", def("Expression")); [ "TSAnyKeyword", "TSBigIntKeyword", "TSBooleanKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword", "TSThisType" ].forEach(function(keywordType) { def(keywordType).bases("TSType").build(); }); def("TSArrayType").bases("TSType").build("elementType").field("elementType", def("TSType")); def("TSLiteralType").bases("TSType").build("literal").field("literal", or(def("NumericLiteral"), def("StringLiteral"), def("BooleanLiteral"), def("TemplateLiteral"), def("UnaryExpression"))); [ "TSUnionType", "TSIntersectionType" ].forEach(function(typeName) { def(typeName).bases("TSType").build("types").field("types", [def("TSType")]); }); def("TSConditionalType").bases("TSType").build("checkType", "extendsType", "trueType", "falseType").field("checkType", def("TSType")).field("extendsType", def("TSType")).field("trueType", def("TSType")).field("falseType", def("TSType")); def("TSInferType").bases("TSType").build("typeParameter").field("typeParameter", def("TSTypeParameter")); def("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType")); var ParametersType = [or(def("Identifier"), def("RestElement"), def("ArrayPattern"), def("ObjectPattern"))]; [ "TSFunctionType", "TSConstructorType" ].forEach(function(typeName) { def(typeName).bases("TSType", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation").build("parameters").field("parameters", ParametersType); }); def("TSDeclareFunction").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "params", "returnType").field("declare", Boolean, defaults["false"]).field("async", Boolean, defaults["false"]).field("generator", Boolean, defaults["false"]).field("id", or(def("Identifier"), null), defaults["null"]).field("params", [def("Pattern")]).field("returnType", or( def("TSTypeAnnotation"), def("Noop"), // Still used? null ), defaults["null"]); def("TSDeclareMethod").bases("Declaration", "TSHasOptionalTypeParameters").build("key", "params", "returnType").field("async", Boolean, defaults["false"]).field("generator", Boolean, defaults["false"]).field("params", [def("Pattern")]).field("abstract", Boolean, defaults["false"]).field("accessibility", or("public", "private", "protected", void 0), defaults["undefined"]).field("static", Boolean, defaults["false"]).field("computed", Boolean, defaults["false"]).field("optional", Boolean, defaults["false"]).field("key", or( def("Identifier"), def("StringLiteral"), def("NumericLiteral"), // Only allowed if .computed is true. def("Expression") )).field("kind", or("get", "set", "method", "constructor"), function getDefault() { return "method"; }).field( "access", // Not "accessibility"? or("public", "private", "protected", void 0), defaults["undefined"] ).field("decorators", or([def("Decorator")], null), defaults["null"]).field("returnType", or( def("TSTypeAnnotation"), def("Noop"), // Still used? null ), defaults["null"]); def("TSMappedType").bases("TSType").build("typeParameter", "typeAnnotation").field("readonly", or(Boolean, "+", "-"), defaults["false"]).field("typeParameter", def("TSTypeParameter")).field("optional", or(Boolean, "+", "-"), defaults["false"]).field("typeAnnotation", or(def("TSType"), null), defaults["null"]); def("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes", [or(def("TSType"), def("TSNamedTupleMember"))]); def("TSNamedTupleMember").bases("TSType").build("label", "elementType", "optional").field("label", def("Identifier")).field("optional", Boolean, defaults["false"]).field("elementType", def("TSType")); def("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType")); def("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation", def("TSType")); def("TSIndexedAccessType").bases("TSType").build("objectType", "indexType").field("objectType", def("TSType")).field("indexType", def("TSType")); def("TSTypeOperator").bases("TSType").build("operator").field("operator", String).field("typeAnnotation", def("TSType")); def("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation", or(def("TSType"), def("TSTypeAnnotation"))); def("TSIndexSignature").bases("Declaration", "TSHasOptionalTypeAnnotation").build("parameters", "typeAnnotation").field("parameters", [def("Identifier")]).field("readonly", Boolean, defaults["false"]); def("TSPropertySignature").bases("Declaration", "TSHasOptionalTypeAnnotation").build("key", "typeAnnotation", "optional").field("key", def("Expression")).field("computed", Boolean, defaults["false"]).field("readonly", Boolean, defaults["false"]).field("optional", Boolean, defaults["false"]).field("initializer", or(def("Expression"), null), defaults["null"]); def("TSMethodSignature").bases("Declaration", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation").build("key", "parameters", "typeAnnotation").field("key", def("Expression")).field("computed", Boolean, defaults["false"]).field("optional", Boolean, defaults["false"]).field("parameters", ParametersType); def("TSTypePredicate").bases("TSTypeAnnotation", "TSType").build("parameterName", "typeAnnotation", "asserts").field("parameterName", or(def("Identifier"), def("TSThisType"))).field("typeAnnotation", or(def("TSTypeAnnotation"), null), defaults["null"]).field("asserts", Boolean, defaults["false"]); [ "TSCallSignatureDeclaration", "TSConstructSignatureDeclaration" ].forEach(function(typeName) { def(typeName).bases("Declaration", "TSHasOptionalTypeParameters", "TSHasOptionalTypeAnnotation").build("parameters", "typeAnnotation").field("parameters", ParametersType); }); def("TSEnumMember").bases("Node").build("id", "initializer").field("id", or(def("Identifier"), StringLiteral)).field("initializer", or(def("Expression"), null), defaults["null"]); def("TSTypeQuery").bases("TSType").build("exprName").field("exprName", or(TSEntityName, def("TSImportType"))); var TSTypeMember = or(def("TSCallSignatureDeclaration"), def("TSConstructSignatureDeclaration"), def("TSIndexSignature"), def("TSMethodSignature"), def("TSPropertySignature")); def("TSTypeLiteral").bases("TSType").build("members").field("members", [TSTypeMember]); def("TSTypeParameter").bases("Identifier").build("name", "constraint", "default").field("name", String).field("constraint", or(def("TSType"), void 0), defaults["undefined"]).field("default", or(def("TSType"), void 0), defaults["undefined"]); def("TSTypeAssertion").bases("Expression", "Pattern").build("typeAnnotation", "expression").field("typeAnnotation", def("TSType")).field("expression", def("Expression")).field("extra", or({ parenthesized: Boolean }, null), defaults["null"]); def("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params", [def("TSTypeParameter")]); def("TSTypeParameterInstantiation").bases("Node").build("params").field("params", [def("TSType")]); def("TSEnumDeclaration").bases("Declaration").build("id", "members").field("id", def("Identifier")).field("const", Boolean, defaults["false"]).field("declare", Boolean, defaults["false"]).field("members", [def("TSEnumMember")]).field("initializer", or(def("Expression"), null), defaults["null"]); def("TSTypeAliasDeclaration").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "typeAnnotation").field("id", def("Identifier")).field("declare", Boolean, defaults["false"]).field("typeAnnotation", def("TSType")); def("TSModuleBlock").bases("Node").build("body").field("body", [def("Statement")]); def("TSModuleDeclaration").bases("Declaration").build("id", "body").field("id", or(StringLiteral, TSEntityName)).field("declare", Boolean, defaults["false"]).field("global", Boolean, defaults["false"]).field("body", or(def("TSModuleBlock"), def("TSModuleDeclaration"), null), defaults["null"]); def("TSImportType").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("argument", "qualifier", "typeParameters").field("argument", StringLiteral).field("qualifier", or(TSEntityName, void 0), defaults["undefined"]); def("TSImportEqualsDeclaration").bases("Declaration").build("id", "moduleReference").field("id", def("Identifier")).field("isExport", Boolean, defaults["false"]).field("moduleReference", or(TSEntityName, def("TSExternalModuleReference"))); def("TSExternalModuleReference").bases("Declaration").build("expression").field("expression", StringLiteral); def("TSExportAssignment").bases("Statement").build("expression").field("expression", def("Expression")); def("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id", def("Identifier")); def("TSInterfaceBody").bases("Node").build("body").field("body", [TSTypeMember]); def("TSExpressionWithTypeArguments").bases("TSType", "TSHasOptionalTypeParameterInstantiation").build("expression", "typeParameters").field("expression", TSEntityName); def("TSInterfaceDeclaration").bases("Declaration", "TSHasOptionalTypeParameters").build("id", "body").field("id", TSEntityName).field("declare", Boolean, defaults["false"]).field("extends", or([def("TSExpressionWithTypeArguments")], null), defaults["null"]).field("body", def("TSInterfaceBody")); def("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility", or("public", "private", "protected", void 0), defaults["undefined"]).field("readonly", Boolean, defaults["false"]).field("parameter", or(def("Identifier"), def("AssignmentPattern"))); def("ClassProperty").field( "access", // Not "accessibility"? or("public", "private", "protected", void 0), defaults["undefined"] ); def("ClassBody").field("body", [or( def("MethodDefinition"), def("VariableDeclarator"), def("ClassPropertyDefinition"), def("ClassProperty"), def("ClassPrivateProperty"), def("ClassMethod"), def("ClassPrivateMethod"), // Just need to add these types: def("TSDeclareMethod"), TSTypeMember )]); } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/def/es-proposals.js var require_es_proposals = __commonJS({ "node_modules/ast-types/def/es-proposals.js"(exports2, module2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var types_1 = tslib_1.__importDefault(require_types()); var shared_1 = tslib_1.__importDefault(require_shared()); var core_1 = tslib_1.__importDefault(require_core()); function default_1(fork) { fork.use(core_1.default); var types3 = fork.use(types_1.default); var Type = types3.Type; var def = types3.Type.def; var or = Type.or; var shared = fork.use(shared_1.default); var defaults = shared.defaults; def("OptionalMemberExpression").bases("MemberExpression").build("object", "property", "computed", "optional").field("optional", Boolean, defaults["true"]); def("OptionalCallExpression").bases("CallExpression").build("callee", "arguments", "optional").field("optional", Boolean, defaults["true"]); var LogicalOperator = or("||", "&&", "??"); def("LogicalExpression").field("operator", LogicalOperator); } exports2.default = default_1; module2.exports = exports2["default"]; } }); // node_modules/ast-types/gen/namedTypes.js var require_namedTypes = __commonJS({ "node_modules/ast-types/gen/namedTypes.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.namedTypes = void 0; var namedTypes; /* @__PURE__ */ (function(namedTypes2) { })(namedTypes = exports2.namedTypes || (exports2.namedTypes = {})); } }); // node_modules/ast-types/main.js var require_main = __commonJS({ "node_modules/ast-types/main.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.visit = exports2.use = exports2.Type = exports2.someField = exports2.PathVisitor = exports2.Path = exports2.NodePath = exports2.namedTypes = exports2.getSupertypeNames = exports2.getFieldValue = exports2.getFieldNames = exports2.getBuilderName = exports2.finalize = exports2.eachField = exports2.defineMethod = exports2.builtInTypes = exports2.builders = exports2.astNodesAreEquivalent = void 0; var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); var fork_1 = tslib_1.__importDefault(require_fork()); var core_1 = tslib_1.__importDefault(require_core()); var es6_1 = tslib_1.__importDefault(require_es6()); var es7_1 = tslib_1.__importDefault(require_es7()); var es2020_1 = tslib_1.__importDefault(require_es2020()); var jsx_1 = tslib_1.__importDefault(require_jsx()); var flow_1 = tslib_1.__importDefault(require_flow()); var esprima_1 = tslib_1.__importDefault(require_esprima2()); var babel_1 = tslib_1.__importDefault(require_babel()); var typescript_1 = tslib_1.__importDefault(require_typescript()); var es_proposals_1 = tslib_1.__importDefault(require_es_proposals()); var namedTypes_1 = require_namedTypes(); Object.defineProperty(exports2, "namedTypes", { enumerable: true, get: function() { return namedTypes_1.namedTypes; } }); var _a2 = fork_1.default([ // This core module of AST types captures ES5 as it is parsed today by // git://github.com/ariya/esprima.git#master. core_1.default, // Feel free to add to or remove from this list of extension modules to // configure the precise type hierarchy that you need. es6_1.default, es7_1.default, es2020_1.default, jsx_1.default, flow_1.default, esprima_1.default, babel_1.default, typescript_1.default, es_proposals_1.default ]); var astNodesAreEquivalent = _a2.astNodesAreEquivalent; var builders = _a2.builders; var builtInTypes = _a2.builtInTypes; var defineMethod = _a2.defineMethod; var eachField = _a2.eachField; var finalize = _a2.finalize; var getBuilderName = _a2.getBuilderName; var getFieldNames = _a2.getFieldNames; var getFieldValue = _a2.getFieldValue; var getSupertypeNames = _a2.getSupertypeNames; var n3 = _a2.namedTypes; var NodePath = _a2.NodePath; var Path = _a2.Path; var PathVisitor = _a2.PathVisitor; var someField = _a2.someField; var Type = _a2.Type; var use = _a2.use; var visit2 = _a2.visit; exports2.astNodesAreEquivalent = astNodesAreEquivalent; exports2.builders = builders; exports2.builtInTypes = builtInTypes; exports2.defineMethod = defineMethod; exports2.eachField = eachField; exports2.finalize = finalize; exports2.getBuilderName = getBuilderName; exports2.getFieldNames = getFieldNames; exports2.getFieldValue = getFieldValue; exports2.getSupertypeNames = getSupertypeNames; exports2.NodePath = NodePath; exports2.Path = Path; exports2.PathVisitor = PathVisitor; exports2.someField = someField; exports2.Type = Type; exports2.use = use; exports2.visit = visit2; Object.assign(namedTypes_1.namedTypes, n3); } }); // node_modules/degenerator/dist/degenerator.js function degenerator(code, _names) { if (!Array.isArray(_names)) { throw new TypeError('an array of async function "names" is required'); } const names = _names.slice(0); const ast = (0, import_esprima.parseScript)(code); let lastNamesLength = 0; do { lastNamesLength = names.length; (0, import_ast_types.visit)(ast, { visitVariableDeclaration(path3) { if (path3.node.declarations) { for (let i5 = 0; i5 < path3.node.declarations.length; i5++) { const declaration = path3.node.declarations[i5]; if (import_ast_types.namedTypes.VariableDeclarator.check(declaration) && import_ast_types.namedTypes.Identifier.check(declaration.init) && import_ast_types.namedTypes.Identifier.check(declaration.id) && checkName(declaration.init.name, names) && !checkName(declaration.id.name, names)) { names.push(declaration.id.name); } } } return false; }, visitAssignmentExpression(path3) { if (import_ast_types.namedTypes.Identifier.check(path3.node.left) && import_ast_types.namedTypes.Identifier.check(path3.node.right) && checkName(path3.node.right.name, names) && !checkName(path3.node.left.name, names)) { names.push(path3.node.left.name); } return false; }, visitFunction(path3) { if (path3.node.id) { let shouldDegenerate = false; (0, import_ast_types.visit)(path3.node, { visitCallExpression(path4) { if (checkNames(path4.node, names)) { shouldDegenerate = true; } return false; } }); if (!shouldDegenerate) { return false; } path3.node.async = true; if (!checkName(path3.node.id.name, names)) { names.push(path3.node.id.name); } } this.traverse(path3); } }); } while (lastNamesLength !== names.length); (0, import_ast_types.visit)(ast, { visitCallExpression(path3) { if (checkNames(path3.node, names)) { const delegate = false; const { name, parent: { node: pNode } } = path3; const expr = import_ast_types.builders.awaitExpression(path3.node, delegate); if (import_ast_types.namedTypes.CallExpression.check(pNode)) { pNode.arguments[name] = expr; } else { pNode[name] = expr; } } this.traverse(path3); } }); return (0, import_escodegen.generate)(ast); } function checkNames({ callee }, names) { let name; if (import_ast_types.namedTypes.Identifier.check(callee)) { name = callee.name; } else if (import_ast_types.namedTypes.MemberExpression.check(callee)) { if (import_ast_types.namedTypes.Identifier.check(callee.object) && import_ast_types.namedTypes.Identifier.check(callee.property)) { name = `${callee.object.name}.${callee.property.name}`; } else { return false; } } else if (import_ast_types.namedTypes.FunctionExpression.check(callee)) { if (callee.id) { name = callee.id.name; } else { return false; } } else { throw new Error(`Don't know how to get name for: ${callee.type}`); } return checkName(name, names); } function checkName(name, names) { for (let i5 = 0; i5 < names.length; i5++) { const n3 = names[i5]; if (import_util.types.isRegExp(n3)) { if (n3.test(name)) { return true; } } else if (name === n3) { return true; } } return false; } var import_util, import_escodegen, import_esprima, import_ast_types; var init_degenerator = __esm({ "node_modules/degenerator/dist/degenerator.js"() { import_util = require("util"); import_escodegen = __toESM(require_escodegen(), 1); import_esprima = __toESM(require_esprima(), 1); import_ast_types = __toESM(require_main(), 1); } }); // node_modules/degenerator/dist/compile.js function compile(vm, code, returnName, options = {}) { const compiled = degenerator(code, options.names ?? []); if (options.sandbox) { for (const [name, value] of Object.entries(options.sandbox)) { if (typeof value !== "function") { throw new Error(`Expected a "function" for sandbox property \`${name}\`, but got "${typeof value}"`); } const fnHandle = getOrCreateSandboxFunction(vm, name, value); fnHandle.consume((handle) => vm.setProp(vm.global, name, handle)); } } const fn = vm.evalCode(`${compiled};${returnName}`, options.filename); const t = vm.typeof(fn); if (t !== "function") { throw new Error(`Expected a "function" named \`${returnName}\` to be defined, but got "${t}"`); } const r5 = async function(...args) { let promiseHandle; let resolvedHandle; try { const result = vm.callFunction(fn, vm.undefined, ...args.map((arg) => hostToQuickJSHandle(vm, arg))); promiseHandle = result; const resolvedResultP = vm.resolvePromise(promiseHandle); vm.executePendingJobs(); const resolvedResult = await resolvedResultP; if ("error" in resolvedResult) { const dumped = vm.dump(resolvedResult.error); resolvedResult.error.dispose(); if (dumped instanceof Error) { if (dumped.stack && !dumped.stack.startsWith(dumped.name)) { dumped.stack = `${dumped.name}: ${dumped.message} ${dumped.stack}`; } throw dumped; } throw new Error(String(dumped)); } resolvedHandle = resolvedResult.value; return vm.dump(resolvedHandle); } catch (err) { if (err && typeof err === "object" && "cause" in err && err.cause) { if (typeof err.cause === "object" && "stack" in err.cause && "name" in err.cause && "message" in err.cause && typeof err.cause.stack === "string" && typeof err.cause.name === "string" && typeof err.cause.message === "string") { err.cause.stack = `${err.cause.name}: ${err.cause.message} ${err.cause.stack}`; } throw err.cause; } throw err; } finally { promiseHandle?.dispose(); resolvedHandle?.dispose(); } }; Object.defineProperty(r5, "toString", { value: () => compiled, enumerable: false }); return r5; } function getOrCreateSandboxFunction(vm, name, value) { const callback = (...args) => { const result = value(...args.map((arg) => vm.dump(arg))); vm.executePendingJobs(); return hostToQuickJSHandle(vm, result); }; const globalFunctionName = `${SANDBOX_FUNCTION_PREFIX}${name}`; const keyHandle = vm.newString(globalFunctionName); let existingHandle; try { existingHandle = vm.getProp(vm.global, keyHandle); if (vm.typeof(existingHandle) === "function") { vm.registerHostCallback(name, callback); return existingHandle; } existingHandle.dispose(); existingHandle = void 0; const fnHandle = vm.newFunction(name, callback); vm.defineProp(vm.global, globalFunctionName, fnHandle, { writable: false, enumerable: false, configurable: false }); return fnHandle; } finally { keyHandle.dispose(); } } function hostToQuickJSHandle(vm, val) { if (typeof val === "undefined") { return vm.undefined; } else if (val === null) { return vm.null; } else if (typeof val === "string") { return vm.newString(val); } else if (typeof val === "number") { return vm.newNumber(val); } else if (typeof val === "bigint") { return vm.newBigInt(val); } else if (typeof val === "boolean") { return val ? vm.true : vm.false; } else if (import_util2.types.isPromise(val)) { const promise = vm.newPromise(); val.then((r5) => { promise.resolve(hostToQuickJSHandle(vm, r5)); vm.executePendingJobs(); }, (err) => { promise.reject(hostToQuickJSHandle(vm, err)); vm.executePendingJobs(); }); return promise.handle; } else if (import_util2.types.isNativeError(val)) { return vm.newError(val); } throw new Error(`Unsupported value: ${val}`); } var import_util2, SANDBOX_FUNCTION_PREFIX; var init_compile = __esm({ "node_modules/degenerator/dist/compile.js"() { import_util2 = require("util"); init_degenerator(); SANDBOX_FUNCTION_PREFIX = "__degeneratorSandboxFunction:"; } }); // node_modules/degenerator/dist/index.js var init_dist7 = __esm({ "node_modules/degenerator/dist/index.js"() { init_degenerator(); init_compile(); } }); // node_modules/pac-resolver/dist/dateRange.js function dateRange() { return false; } var init_dateRange = __esm({ "node_modules/pac-resolver/dist/dateRange.js"() { } }); // node_modules/pac-resolver/dist/dnsDomainIs.js function dnsDomainIs(host, domain) { host = String(host); domain = String(domain); return host.substr(domain.length * -1) === domain; } var init_dnsDomainIs = __esm({ "node_modules/pac-resolver/dist/dnsDomainIs.js"() { } }); // node_modules/pac-resolver/dist/dnsDomainLevels.js function dnsDomainLevels(host) { const match = String(host).match(/\./g); let levels = 0; if (match) { levels = match.length; } return levels; } var init_dnsDomainLevels = __esm({ "node_modules/pac-resolver/dist/dnsDomainLevels.js"() { } }); // node_modules/pac-resolver/dist/util.js function dnsLookup(host, opts) { return new Promise((resolve, reject) => { (0, import_dns.lookup)(host, opts, (err, res) => { if (err) { reject(err); } else { resolve(res); } }); }); } function isGMT(v) { return v === "GMT"; } var import_dns; var init_util = __esm({ "node_modules/pac-resolver/dist/util.js"() { import_dns = require("dns"); } }); // node_modules/pac-resolver/dist/dnsResolve.js async function dnsResolve(host) { const family = 4; try { const r5 = await dnsLookup(host, { family }); if (typeof r5 === "string") { return r5; } } catch (err) { } return null; } var init_dnsResolve = __esm({ "node_modules/pac-resolver/dist/dnsResolve.js"() { init_util(); } }); // node_modules/netmask/dist/netmask4.js var require_netmask4 = __commonJS({ "node_modules/netmask/dist/netmask4.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Netmask4Impl = void 0; exports2.ip2long = ip2long; exports2.long2ip = long2ip; function long2ip(long) { const a5 = (long & 255 << 24) >>> 24; const b6 = (long & 255 << 16) >>> 16; const c5 = (long & 255 << 8) >>> 8; const d5 = long & 255; return [a5, b6, c5, d5].join("."); } var chr0 = "0".charCodeAt(0); var chra = "a".charCodeAt(0); var chrA = "A".charCodeAt(0); function parseNum(s) { let n3 = 0; let base = 10; let dmax = "9"; let i5 = 0; if (s.length > 1 && s[i5] === "0") { if (s[i5 + 1] === "x" || s[i5 + 1] === "X") { i5 += 2; base = 16; } else if ("0" <= s[i5 + 1] && s[i5 + 1] <= "9") { i5++; base = 8; dmax = "7"; } } const start = i5; while (i5 < s.length) { if ("0" <= s[i5] && s[i5] <= dmax) { n3 = n3 * base + (s.charCodeAt(i5) - chr0) >>> 0; } else if (base === 16) { if ("a" <= s[i5] && s[i5] <= "f") { n3 = n3 * base + (10 + s.charCodeAt(i5) - chra) >>> 0; } else if ("A" <= s[i5] && s[i5] <= "F") { n3 = n3 * base + (10 + s.charCodeAt(i5) - chrA) >>> 0; } else { break; } } else { break; } if (n3 > 4294967295) { throw new Error("too large"); } i5++; } if (i5 === start) { throw new Error("empty octet"); } return [n3, i5]; } function ip2long(ip2) { const b6 = []; for (let i5 = 0; i5 <= 3; i5++) { if (ip2.length === 0) { break; } if (i5 > 0) { if (ip2[0] !== ".") { throw new Error("Invalid IP"); } ip2 = ip2.substring(1); } const [n3, c5] = parseNum(ip2); ip2 = ip2.substring(c5); b6.push(n3); } if (ip2.length !== 0) { throw new Error("Invalid IP"); } switch (b6.length) { case 1: if (b6[0] > 4294967295) { throw new Error("Invalid IP"); } return b6[0] >>> 0; case 2: if (b6[0] > 255 || b6[1] > 16777215) { throw new Error("Invalid IP"); } return (b6[0] << 24 | b6[1]) >>> 0; case 3: if (b6[0] > 255 || b6[1] > 255 || b6[2] > 65535) { throw new Error("Invalid IP"); } return (b6[0] << 24 | b6[1] << 16 | b6[2]) >>> 0; case 4: if (b6[0] > 255 || b6[1] > 255 || b6[2] > 255 || b6[3] > 255) { throw new Error("Invalid IP"); } return (b6[0] << 24 | b6[1] << 16 | b6[2] << 8 | b6[3]) >>> 0; default: throw new Error("Invalid IP"); } } var Netmask4Impl = class _Netmask4Impl { constructor(net11, mask) { if (typeof net11 !== "string") { throw new Error("Missing `net' parameter"); } let maskStr = mask; if (!maskStr) { const parts = net11.split("/", 2); net11 = parts[0]; maskStr = parts[1]; } if (!maskStr) { maskStr = 32; } if (typeof maskStr === "string" && maskStr.indexOf(".") > -1) { try { this.maskLong = ip2long(maskStr); } catch (error3) { throw new Error("Invalid mask: " + maskStr); } this.bitmask = NaN; for (let i5 = 32; i5 >= 0; i5--) { if (this.maskLong === 4294967295 << 32 - i5 >>> 0) { this.bitmask = i5; break; } } } else if (maskStr || maskStr === 0) { this.bitmask = parseInt(maskStr, 10); this.maskLong = 0; if (this.bitmask > 0) { this.maskLong = 4294967295 << 32 - this.bitmask >>> 0; } } else { throw new Error("Invalid mask: empty"); } try { this.netLong = (ip2long(net11) & this.maskLong) >>> 0; } catch (error3) { throw new Error("Invalid net address: " + net11); } if (!(this.bitmask <= 32)) { throw new Error("Invalid mask for ip4: " + maskStr); } this.size = Math.pow(2, 32 - this.bitmask); this.base = long2ip(this.netLong); this.mask = long2ip(this.maskLong); this.hostmask = long2ip(~this.maskLong); this.first = this.bitmask <= 30 ? long2ip(this.netLong + 1) : this.base; this.last = this.bitmask <= 30 ? long2ip(this.netLong + this.size - 2) : long2ip(this.netLong + this.size - 1); this.broadcast = this.bitmask <= 30 ? long2ip(this.netLong + this.size - 1) : void 0; } contains(ip2) { if (typeof ip2 === "string" && (ip2.indexOf("/") > 0 || ip2.split(".").length !== 4)) { ip2 = new _Netmask4Impl(ip2); } if (ip2 instanceof _Netmask4Impl) { return this.contains(ip2.base) && this.contains(ip2.broadcast || ip2.last); } else { return (ip2long(ip2) & this.maskLong) >>> 0 === (this.netLong & this.maskLong) >>> 0; } } next(count = 1) { return new _Netmask4Impl(long2ip(this.netLong + this.size * count), this.mask); } forEach(fn) { let long = ip2long(this.first); const lastLong = ip2long(this.last); let index = 0; while (long <= lastLong) { fn(long2ip(long), long, index); index++; long++; } } toString() { return this.base + "/" + this.bitmask; } }; exports2.Netmask4Impl = Netmask4Impl; } }); // node_modules/netmask/dist/netmask6.js var require_netmask6 = __commonJS({ "node_modules/netmask/dist/netmask6.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Netmask6Impl = void 0; exports2.ip6bigint = ip6bigint; exports2.bigint2ip6 = bigint2ip6; var netmask4_1 = require_netmask4(); var MAX_IPV6 = (1n << 128n) - 1n; function ip6bigint(ip2) { const zoneIdx = ip2.indexOf("%"); if (zoneIdx !== -1) { ip2 = ip2.substring(0, zoneIdx); } const lastColon = ip2.lastIndexOf(":"); if (lastColon !== -1 && ip2.indexOf(".", lastColon) !== -1) { const ipv4Part = ip2.substring(lastColon + 1); const ipv4Long = (0, netmask4_1.ip2long)(ipv4Part); const ipv6Prefix = ip2.substring(0, lastColon + 1) + "0:0"; const prefixVal = parseIPv6Pure(ipv6Prefix); return prefixVal & ~0xffffffffn | BigInt(ipv4Long); } return parseIPv6Pure(ip2); } function parseIPv6Pure(ip2) { const doubleColonIdx = ip2.indexOf("::"); let groups; if (doubleColonIdx !== -1) { const left = ip2.substring(0, doubleColonIdx); const right = ip2.substring(doubleColonIdx + 2); const leftGroups = left === "" ? [] : left.split(":"); const rightGroups = right === "" ? [] : right.split(":"); const missing = 8 - leftGroups.length - rightGroups.length; if (missing < 0) { throw new Error("Invalid IPv6: too many groups"); } groups = [...leftGroups, ...Array(missing).fill("0"), ...rightGroups]; } else { groups = ip2.split(":"); } if (groups.length !== 8) { throw new Error("Invalid IPv6: expected 8 groups, got " + groups.length); } let result = 0n; for (let i5 = 0; i5 < 8; i5++) { const g5 = groups[i5]; if (g5.length === 0 || g5.length > 4) { throw new Error('Invalid IPv6: bad group "' + g5 + '"'); } const val = parseInt(g5, 16); if (isNaN(val) || val < 0 || val > 65535) { throw new Error('Invalid IPv6: bad group "' + g5 + '"'); } result = result << 16n | BigInt(val); } return result; } function bigint2ip6(n3) { if (n3 < 0n || n3 > MAX_IPV6) { throw new Error("Invalid IPv6 address value"); } const groups = []; for (let i5 = 0; i5 < 8; i5++) { groups.unshift(Number(n3 & 0xffffn)); n3 >>= 16n; } let bestStart = -1; let bestLen = 0; let curStart = -1; let curLen = 0; for (let i5 = 0; i5 < 8; i5++) { if (groups[i5] === 0) { if (curStart === -1) { curStart = i5; curLen = 1; } else { curLen++; } } else { if (curLen > bestLen && curLen >= 2) { bestStart = curStart; bestLen = curLen; } curStart = -1; curLen = 0; } } if (curLen > bestLen && curLen >= 2) { bestStart = curStart; bestLen = curLen; } if (bestStart !== -1 && bestStart + bestLen === 8 && bestStart > 0) { const before = groups.slice(0, bestStart).map((g5) => g5.toString(16)); return before.join(":") + "::"; } else if (bestStart === 0) { const after = groups.slice(bestLen).map((g5) => g5.toString(16)); return "::" + after.join(":"); } else if (bestStart > 0) { const before = groups.slice(0, bestStart).map((g5) => g5.toString(16)); const after = groups.slice(bestStart + bestLen).map((g5) => g5.toString(16)); return before.join(":") + "::" + after.join(":"); } else { return groups.map((g5) => g5.toString(16)).join(":"); } } var Netmask6Impl = class _Netmask6Impl { constructor(net11, mask) { if (typeof net11 !== "string") { throw new Error("Missing `net' parameter"); } let prefixLen = mask; if (prefixLen === void 0 || prefixLen === null) { const slashIdx = net11.indexOf("/"); if (slashIdx !== -1) { prefixLen = parseInt(net11.substring(slashIdx + 1), 10); net11 = net11.substring(0, slashIdx); } else { prefixLen = 128; } } if (isNaN(prefixLen) || prefixLen < 0 || prefixLen > 128) { throw new Error("Invalid mask for IPv6: " + prefixLen); } this.bitmask = prefixLen; if (this.bitmask === 0) { this.maskBigint = 0n; } else { this.maskBigint = MAX_IPV6 >> BigInt(128 - this.bitmask) << BigInt(128 - this.bitmask); } try { this.netBigint = ip6bigint(net11) & this.maskBigint; } catch (error3) { throw new Error("Invalid IPv6 net address: " + net11); } this.size = Number(1n << BigInt(128 - this.bitmask)); this.base = bigint2ip6(this.netBigint); this.mask = bigint2ip6(this.maskBigint); this.hostmask = bigint2ip6(~this.maskBigint & MAX_IPV6); this.first = this.base; this.last = bigint2ip6(this.netBigint + (1n << BigInt(128 - this.bitmask)) - 1n); this.broadcast = void 0; } contains(ip2) { if (typeof ip2 === "string") { if (ip2.indexOf("/") > 0) { ip2 = new _Netmask6Impl(ip2); } } if (ip2 instanceof _Netmask6Impl) { return this.contains(ip2.base) && this.contains(ip2.last); } else { const addr = ip6bigint(ip2); return (addr & this.maskBigint) === this.netBigint; } } next(count = 1) { const sizeBig = 1n << BigInt(128 - this.bitmask); return new _Netmask6Impl(bigint2ip6(this.netBigint + sizeBig * BigInt(count)), this.bitmask); } forEach(fn) { let addr = this.netBigint; const sizeBig = 1n << BigInt(128 - this.bitmask); const lastAddr = this.netBigint + sizeBig - 1n; let index = 0; while (addr <= lastAddr) { fn(bigint2ip6(addr), Number(addr), index); index++; addr++; } } toString() { return this.base + "/" + this.bitmask; } }; exports2.Netmask6Impl = Netmask6Impl; } }); // node_modules/netmask/dist/netmask.js var require_netmask = __commonJS({ "node_modules/netmask/dist/netmask.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.long2ip = exports2.ip2long = exports2.Netmask = void 0; var netmask4_1 = require_netmask4(); Object.defineProperty(exports2, "ip2long", { enumerable: true, get: function() { return netmask4_1.ip2long; } }); Object.defineProperty(exports2, "long2ip", { enumerable: true, get: function() { return netmask4_1.long2ip; } }); var netmask6_1 = require_netmask6(); var Netmask2 = class _Netmask { constructor(net11, mask) { if (typeof net11 !== "string") { throw new Error("Missing `net' parameter"); } const addrPart = net11.indexOf("/") !== -1 ? net11.substring(0, net11.indexOf("/")) : net11; if (addrPart.indexOf(":") !== -1) { this._impl = new netmask6_1.Netmask6Impl(net11, mask); } else { this._impl = new netmask4_1.Netmask4Impl(net11, mask); } this.base = this._impl.base; this.mask = this._impl.mask; this.hostmask = this._impl.hostmask; this.bitmask = this._impl.bitmask; this.size = this._impl.size; this.first = this._impl.first; this.last = this._impl.last; this.broadcast = this._impl.broadcast; if (this._impl instanceof netmask4_1.Netmask4Impl) { this.maskLong = this._impl.maskLong; this.netLong = this._impl.netLong; } else { this.maskLong = 0; this.netLong = 0; } } contains(ip2) { if (typeof ip2 === "string") { if (ip2.indexOf("/") > 0) { ip2 = new _Netmask(ip2); } else if (ip2.indexOf(":") === -1 && ip2.split(".").length !== 4) { ip2 = new _Netmask(ip2); } } if (ip2 instanceof _Netmask) { return this.contains(ip2.base) && this.contains(ip2.broadcast || ip2.last); } return this._impl.contains(ip2); } next(count = 1) { const nextImpl = this._impl.next(count); const result = new _Netmask(nextImpl.base, nextImpl.bitmask); return result; } /** @deprecated */ forEach(fn) { this._impl.forEach(fn); } toString() { return this._impl.toString(); } }; exports2.Netmask = Netmask2; } }); // node_modules/pac-resolver/dist/isInNet.js async function isInNet(host, pattern, mask) { const family = 4; try { const ip2 = await dnsLookup(host, { family }); if (typeof ip2 === "string") { const netmask = new import_netmask.Netmask(pattern, mask); return netmask.contains(ip2); } } catch (err) { } return false; } var import_netmask; var init_isInNet = __esm({ "node_modules/pac-resolver/dist/isInNet.js"() { import_netmask = __toESM(require_netmask(), 1); init_util(); } }); // node_modules/pac-resolver/dist/isPlainHostName.js function isPlainHostName(host) { return !/\./.test(host); } var init_isPlainHostName = __esm({ "node_modules/pac-resolver/dist/isPlainHostName.js"() { } }); // node_modules/pac-resolver/dist/isResolvable.js async function isResolvable(host) { const family = 4; try { if (await dnsLookup(host, { family })) { return true; } } catch (err) { } return false; } var init_isResolvable = __esm({ "node_modules/pac-resolver/dist/isResolvable.js"() { init_util(); } }); // node_modules/pac-resolver/dist/localHostOrDomainIs.js function localHostOrDomainIs(host, hostdom) { const parts = host.split("."); const domparts = hostdom.split("."); let matches = true; for (let i5 = 0; i5 < parts.length; i5++) { if (parts[i5] !== domparts[i5]) { matches = false; break; } } return matches; } var init_localHostOrDomainIs = __esm({ "node_modules/pac-resolver/dist/localHostOrDomainIs.js"() { } }); // node_modules/pac-resolver/dist/ip.js function normalizeFamily(family) { if (family === 4) { return "ipv4"; } if (family === 6) { return "ipv6"; } return family ? family.toLowerCase() : "ipv4"; } var import_os3, ip; var init_ip = __esm({ "node_modules/pac-resolver/dist/ip.js"() { import_os3 = __toESM(require("os"), 1); ip = { address() { const interfaces = import_os3.default.networkInterfaces(); const family = normalizeFamily(); const all = Object.values(interfaces).map((addrs = []) => { const addresses = addrs.filter((details) => { const detailsFamily = normalizeFamily(details.family); if (detailsFamily !== family || ip.isLoopback(details.address)) { return false; } return true; }); return addresses.length ? addresses[0].address : void 0; }).filter(Boolean); return !all.length ? ip.loopback(family) : all[0]; }, isLoopback(addr) { return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/.test(addr) || /^fe80::1$/.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); }, loopback(family) { family = normalizeFamily(family); if (family !== "ipv4" && family !== "ipv6") { throw new Error("family must be ipv4 or ipv6"); } return family === "ipv4" ? "127.0.0.1" : "fe80::1"; } }; } }); // node_modules/pac-resolver/dist/myIpAddress.js async function myIpAddress() { return new Promise((resolve, reject) => { const socket = import_net.default.connect({ host: "8.8.8.8", port: 53 }); const onError = () => { resolve(ip.address()); }; socket.once("error", onError); socket.once("connect", () => { socket.removeListener("error", onError); const addr = socket.address(); socket.destroy(); if (typeof addr === "string") { resolve(addr); } else if (addr.address) { resolve(addr.address); } else { reject(new Error("Expected a `string`")); } }); }); } var import_net; var init_myIpAddress = __esm({ "node_modules/pac-resolver/dist/myIpAddress.js"() { init_ip(); import_net = __toESM(require("net"), 1); } }); // node_modules/pac-resolver/dist/shExpMatch.js function shExpMatch(str, shexp) { const re = toRegExp(shexp); return re.test(str); } function toRegExp(str) { str = String(str).replace(/\./g, "\\.").replace(/\?/g, ".").replace(/\*/g, ".*"); return new RegExp(`^${str}$`); } var init_shExpMatch = __esm({ "node_modules/pac-resolver/dist/shExpMatch.js"() { } }); // node_modules/pac-resolver/dist/timeRange.js function timeRange() { const args = Array.prototype.slice.call(arguments); const lastArg = args.pop(); const useGMTzone = lastArg === "GMT"; const currentDate = /* @__PURE__ */ new Date(); if (!useGMTzone) { args.push(lastArg); } let result = false; const noOfArgs = args.length; const numericArgs = args.map((n3) => parseInt(n3, 10)); if (noOfArgs === 1) { result = getCurrentHour(useGMTzone, currentDate) === numericArgs[0]; } else if (noOfArgs === 2) { const currentHour = getCurrentHour(useGMTzone, currentDate); result = numericArgs[0] <= currentHour && currentHour < numericArgs[1]; } else if (noOfArgs === 4) { result = valueInRange(secondsElapsedToday(numericArgs[0], numericArgs[1], 0), secondsElapsedToday(getCurrentHour(useGMTzone, currentDate), getCurrentMinute(useGMTzone, currentDate), 0), secondsElapsedToday(numericArgs[2], numericArgs[3], 59)); } else if (noOfArgs === 6) { result = valueInRange(secondsElapsedToday(numericArgs[0], numericArgs[1], numericArgs[2]), secondsElapsedToday(getCurrentHour(useGMTzone, currentDate), getCurrentMinute(useGMTzone, currentDate), getCurrentSecond(useGMTzone, currentDate)), secondsElapsedToday(numericArgs[3], numericArgs[4], numericArgs[5])); } return result; } function secondsElapsedToday(hh, mm, ss) { return hh * 3600 + mm * 60 + ss; } function getCurrentHour(gmt, currentDate) { return gmt ? currentDate.getUTCHours() : currentDate.getHours(); } function getCurrentMinute(gmt, currentDate) { return gmt ? currentDate.getUTCMinutes() : currentDate.getMinutes(); } function getCurrentSecond(gmt, currentDate) { return gmt ? currentDate.getUTCSeconds() : currentDate.getSeconds(); } function valueInRange(start, value, finish) { return start <= value && value <= finish; } var init_timeRange = __esm({ "node_modules/pac-resolver/dist/timeRange.js"() { } }); // node_modules/pac-resolver/dist/weekdayRange.js function weekdayRange(wd1, wd2, gmt) { let useGMTzone = false; let wd1Index = -1; let wd2Index = -1; let wd2IsGmt = false; if (isGMT(gmt)) { useGMTzone = true; } else if (isGMT(wd2)) { useGMTzone = true; wd2IsGmt = true; } wd1Index = weekdays.indexOf(wd1); if (!wd2IsGmt && isWeekday(wd2)) { wd2Index = weekdays.indexOf(wd2); } const todaysDay = getTodaysDay(useGMTzone); let result; if (wd2Index < 0) { result = todaysDay === wd1Index; } else if (wd1Index <= wd2Index) { result = valueInRange2(wd1Index, todaysDay, wd2Index); } else { result = valueInRange2(wd1Index, todaysDay, 6) || valueInRange2(0, todaysDay, wd2Index); } return result; } function getTodaysDay(gmt) { return gmt ? (/* @__PURE__ */ new Date()).getUTCDay() : (/* @__PURE__ */ new Date()).getDay(); } function valueInRange2(start, value, finish) { return start <= value && value <= finish; } function isWeekday(v) { if (!v) return false; return weekdays.includes(v); } var weekdays; var init_weekdayRange = __esm({ "node_modules/pac-resolver/dist/weekdayRange.js"() { init_util(); weekdays = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]; } }); // node_modules/pac-resolver/dist/index.js function createPacResolver(qjs, _str, _opts = {}) { const str = Buffer.isBuffer(_str) ? _str.toString("utf8") : _str; const context = { ...sandbox, ..._opts.sandbox }; const names = Object.keys(context).filter((k5) => isAsyncFunction(context[k5])); const opts = { filename: "proxy.pac", names, ..._opts, sandbox: context }; const resolver = compile(qjs, str, "FindProxyForURL", opts); function FindProxyForURL(url, _host) { const urlObj = typeof url === "string" ? new URL(url) : url; const host = _host || urlObj.hostname; if (!host) { throw new TypeError("Could not determine `host`"); } return resolver(urlObj.href, host); } Object.defineProperty(FindProxyForURL, "toString", { value: () => resolver.toString(), enumerable: false }); return FindProxyForURL; } function isAsyncFunction(v) { if (typeof v !== "function") return false; if (v.constructor.name === "AsyncFunction") return true; if (String(v).indexOf("__awaiter(") !== -1) return true; return Boolean(v.async); } var sandbox; var init_dist8 = __esm({ "node_modules/pac-resolver/dist/index.js"() { init_dist7(); init_dateRange(); init_dnsDomainIs(); init_dnsDomainLevels(); init_dnsResolve(); init_isInNet(); init_isPlainHostName(); init_isResolvable(); init_localHostOrDomainIs(); init_myIpAddress(); init_shExpMatch(); init_timeRange(); init_weekdayRange(); sandbox = Object.freeze({ alert: (message = "") => console.log("%s", message), dateRange, dnsDomainIs, dnsDomainLevels, dnsResolve, isInNet, isPlainHostName, isResolvable, localHostOrDomainIs, myIpAddress, shExpMatch, timeRange, weekdayRange }); } }); // node_modules/quickjs-wasi/dist/wasi-shim.js function createWasiShim(memoryAccessor) { const ERRNO_SUCCESS = 0; const ERRNO_BADF = 8; const ERRNO_NOSYS = 52; const CLOCK_REALTIME = 0; const CLOCK_MONOTONIC = 1; return { clock_time_get(clockId, _precision, resultPtr) { const mem = memoryAccessor(); const view = new DataView(mem.buffer); if (clockId === CLOCK_REALTIME || clockId === CLOCK_MONOTONIC) { const timeNs = BigInt(Date.now()) * 1000000n; view.setBigUint64(resultPtr, timeNs, true); return ERRNO_SUCCESS; } return ERRNO_NOSYS; }, fd_write(fd, iovsPtr, iovsLen, nwrittenPtr) { const mem = memoryAccessor(); const view = new DataView(mem.buffer); const bytes = new Uint8Array(mem.buffer); let totalWritten = 0; if (fd !== 1 && fd !== 2) { return ERRNO_BADF; } for (let i5 = 0; i5 < iovsLen; i5++) { const bufPtr = view.getUint32(iovsPtr + i5 * 8, true); const bufLen = view.getUint32(iovsPtr + i5 * 8 + 4, true); const chunk = bytes.slice(bufPtr, bufPtr + bufLen); const text = new TextDecoder().decode(chunk); if (fd === 1) { if (typeof process !== "undefined" && process.stdout) { process.stdout.write(text); } else { console.log(text); } } else { if (typeof process !== "undefined" && process.stderr) { process.stderr.write(text); } else { console.error(text); } } totalWritten += bufLen; } view.setUint32(nwrittenPtr, totalWritten, true); return ERRNO_SUCCESS; }, fd_close(_fd) { return ERRNO_NOSYS; }, fd_fdstat_get(fd, statPtr) { const mem = memoryAccessor(); const view = new DataView(mem.buffer); if (fd === 1 || fd === 2) { view.setUint8(statPtr, 2); view.setUint16(statPtr + 2, 0, true); view.setBigUint64(statPtr + 8, 0n, true); view.setBigUint64(statPtr + 16, 0n, true); return ERRNO_SUCCESS; } return ERRNO_BADF; }, fd_seek(_fd, _offset2, _whence, _resultPtr) { return ERRNO_NOSYS; }, random_get(bufPtr, bufLen) { const mem = memoryAccessor(); const bytes = new Uint8Array(mem.buffer, bufPtr, bufLen); if (typeof crypto !== "undefined" && crypto.getRandomValues) { crypto.getRandomValues(bytes); } else { for (let i5 = 0; i5 < bufLen; i5++) { bytes[i5] = Math.floor(Math.random() * 256); } } return ERRNO_SUCCESS; } }; } var init_wasi_shim = __esm({ "node_modules/quickjs-wasi/dist/wasi-shim.js"() { } }); // node_modules/quickjs-wasi/dist/extensions.js function parseVersionString(memory, ptr) { const mem = new Uint8Array(memory.buffer); let end = ptr; while (mem[end] !== 0) end++; if (end === ptr) return {}; const str = decoder.decode(mem.slice(ptr, end)); const result = {}; for (const line of str.split("\n")) { const eq = line.indexOf("="); if (eq > 0) { result[line.slice(0, eq)] = line.slice(eq + 1); } } return result; } function extractExtensionVersions(ext, memory) { const versionsFnName = `qjs_ext_${ext.name.replace(/-/g, "_")}_versions`; const versionsFn = ext.instance.exports[versionsFnName]; if (typeof versionsFn !== "function") return void 0; const ptr = versionsFn(); if (ptr === 0) return void 0; return parseVersionString(memory, ptr); } function readULEB128(bytes, offset) { let result = 0; let shift = 0; while (offset.value < bytes.length) { const byte = bytes[offset.value++]; result |= (byte & 127) << shift; if ((byte & 128) === 0) break; shift += 7; } return result; } function parseDylink(module2) { const sections = WebAssembly.Module.customSections(module2, "dylink.0"); if (sections.length === 0) return null; const bytes = new Uint8Array(sections[0]); const offset = { value: 0 }; const info2 = { memorySize: 0, memoryAlignment: 0, tableSize: 0, tableAlignment: 0, needed: [] }; while (offset.value < bytes.length) { const subsectionType = readULEB128(bytes, offset); const subsectionSize = readULEB128(bytes, offset); const subsectionEnd = offset.value + subsectionSize; if (subsectionType === 1) { info2.memorySize = readULEB128(bytes, offset); info2.memoryAlignment = readULEB128(bytes, offset); info2.tableSize = readULEB128(bytes, offset); info2.tableAlignment = readULEB128(bytes, offset); } else if (subsectionType === 2) { const count = readULEB128(bytes, offset); for (let i5 = 0; i5 < count; i5++) { const len = readULEB128(bytes, offset); const name = new TextDecoder().decode(bytes.slice(offset.value, offset.value + len)); offset.value += len; info2.needed.push(name); } } offset.value = subsectionEnd; } return info2; } async function loadExtension(descriptor, mainExports, wasiBuiltins, wasiUserOverrides, memoryProxy, allocBase) { let module2; if (descriptor.wasm instanceof WebAssembly.Module) { module2 = descriptor.wasm; } else { module2 = await WebAssembly.compile(descriptor.wasm); } const dylink = parseDylink(module2); if (!dylink) { throw new Error(`Extension "${descriptor.name}" is not a WASM shared library (missing dylink.0 section)`); } const memory = mainExports.memory; const table = mainExports.__indirect_function_table; const stackPointer = mainExports.__stack_pointer; const mallocFn = mainExports.malloc; if (!memory) throw new Error("Main module does not export memory"); if (!table) throw new Error("Main module does not export __indirect_function_table"); if (!mallocFn) throw new Error("Main module does not export malloc"); let memoryBase; let tableBase; if (allocBase) { memoryBase = allocBase.memoryBase; tableBase = allocBase.tableBase; } else { if (dylink.memorySize > 0) { memoryBase = mallocFn(dylink.memorySize); if (memoryBase === 0) { throw new Error(`Failed to allocate ${dylink.memorySize} bytes for extension "${descriptor.name}"`); } new Uint8Array(memory.buffer, memoryBase, dylink.memorySize).fill(0); } else { memoryBase = 0; } } if (allocBase) { tableBase = allocBase.tableBase; if (tableBase + dylink.tableSize > table.length) { table.grow(tableBase + dylink.tableSize - table.length); } } else { tableBase = table.length; if (dylink.tableSize > 0) { table.grow(dylink.tableSize); } } const extImports = WebAssembly.Module.imports(module2); const importObj = { env: {}, "GOT.mem": {}, "GOT.func": {} }; const needsWasi = extImports.some((imp) => imp.module === "wasi_snapshot_preview1"); if (needsWasi) { const extWasi = descriptor.wasi && memoryProxy ? descriptor.wasi(memoryProxy) : void 0; importObj["wasi_snapshot_preview1"] = { ...wasiBuiltins, // 1. Built-in defaults (lowest priority) ...extWasi, // 2. Extension-provided ...wasiUserOverrides // 3. User overrides (highest priority) }; } const extExportNames = new Set(WebAssembly.Module.exports(module2).filter((e5) => e5.kind === "function").map((e5) => e5.name)); const unresolvedFuncs = /* @__PURE__ */ new Set(); for (const imp of extImports) { if (imp.module === "env") { if (imp.name === "memory" && imp.kind === "memory") { importObj.env.memory = memory; } else if (imp.name === "__indirect_function_table" && imp.kind === "table") { importObj.env.__indirect_function_table = table; } else if (imp.name === "__memory_base" && imp.kind === "global") { importObj.env.__memory_base = new WebAssembly.Global({ value: "i32", mutable: false }, memoryBase); } else if (imp.name === "__table_base" && imp.kind === "global") { importObj.env.__table_base = new WebAssembly.Global({ value: "i32", mutable: false }, tableBase); } else if (imp.name === "__stack_pointer" && imp.kind === "global") { importObj.env.__stack_pointer = stackPointer; } else if (imp.kind === "function") { const resolved = mainExports[imp.name]; if (resolved && typeof resolved === "function") { importObj.env[imp.name] = resolved; } else { unresolvedFuncs.add(imp.name); importObj.env[imp.name] = () => { throw new Error(`Extension "${descriptor.name}" called unresolved symbol: env.${imp.name}`); }; } } else if (imp.kind === "global") { const resolved = mainExports[imp.name]; if (resolved instanceof WebAssembly.Global) { importObj.env[imp.name] = resolved; } else { importObj.env[imp.name] = new WebAssembly.Global({ value: "i32", mutable: true }, 0); } } } else if (imp.module === "GOT.mem" && imp.kind === "global") { importObj["GOT.mem"][imp.name] = new WebAssembly.Global({ value: "i32", mutable: true }, 0); } else if (imp.module === "GOT.func" && imp.kind === "global") { const resolved = mainExports[imp.name]; if (resolved && typeof resolved === "function") { const idx = table.length; table.grow(1); table.set(idx, resolved); importObj["GOT.func"][imp.name] = new WebAssembly.Global({ value: "i32", mutable: true }, idx); } else { importObj["GOT.func"][imp.name] = new WebAssembly.Global({ value: "i32", mutable: true }, 0); } } } const selfResolvable = [...unresolvedFuncs].filter((name) => extExportNames.has(name)); const wrappers = {}; for (const name of selfResolvable) { const wrapper = { target: null }; wrappers[name] = wrapper; importObj.env[name] = (...args) => { if (!wrapper.target) { throw new Error(`Extension "${descriptor.name}" called unresolved symbol during init: env.${name}`); } return wrapper.target(...args); }; } const instance = await WebAssembly.instantiate(module2, importObj); const extExports = instance.exports; for (const name of selfResolvable) { const selfExport = extExports[name]; if (typeof selfExport === "function") { wrappers[name].target = selfExport; } } if (typeof extExports.__wasm_apply_data_relocs === "function") { extExports.__wasm_apply_data_relocs(); } if (typeof extExports.__wasm_call_ctors === "function") { extExports.__wasm_call_ctors(); } const initFn = descriptor.initFn ?? `qjs_ext_${descriptor.name.replace(/-/g, "_")}_init`; const ext = { name: descriptor.name, module: module2, instance, dylink, memoryBase, tableBase, initFn }; ext.versions = extractExtensionVersions(ext, memory); return ext; } function initExtension(ext, mainExports) { const initFunc = ext.instance.exports[ext.initFn]; if (typeof initFunc !== "function") { throw new Error(`Extension "${ext.name}" does not export init function "${ext.initFn}"`); } const ctxPtr = mainExports.qjs_get_context_ptr(); const rtPtr = mainExports.qjs_get_runtime_ptr(); const result = initFunc(ctxPtr, rtPtr); if (result !== 0) { throw new Error(`Extension "${ext.name}" init function returned error code ${result}`); } } async function restoreExtensions(descriptors, extensionMeta, mainExports, wasiBuiltins, wasiUserOverrides, memoryProxy) { const loaded = []; for (const meta of extensionMeta) { const descriptor = descriptors.find((d5) => d5.name === meta.name); if (!descriptor) { throw new Error(`Extension "${meta.name}" required by snapshot but not provided`); } const ext = await loadExtension(descriptor, mainExports, wasiBuiltins, wasiUserOverrides, memoryProxy, { memoryBase: meta.memoryBase, tableBase: meta.tableBase }); ext.initFn = meta.initFn; loaded.push(ext); } return loaded; } var decoder; var init_extensions = __esm({ "node_modules/quickjs-wasi/dist/extensions.js"() { decoder = new TextDecoder(); } }); // node_modules/quickjs-wasi/dist/version.js var VERSION; var init_version = __esm({ "node_modules/quickjs-wasi/dist/version.js"() { VERSION = "2.2.0"; } }); // node_modules/quickjs-wasi/dist/index.js var import_meta, __addDisposableResource2, __disposeResources2, EvalFlags, CompileFlags, Intrinsics, SNAPSHOT_MAGIC, SNAPSHOT_VERSION, SNAPSHOT_HEADER_SIZE, QuickJS, JSException, JSValueHandle; var init_dist9 = __esm({ "node_modules/quickjs-wasi/dist/index.js"() { init_wasi_shim(); init_extensions(); init_version(); import_meta = {}; __addDisposableResource2 = function(env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); var dispose, inner; if (async) { if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); dispose = value[Symbol.asyncDispose]; } if (dispose === void 0) { if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); dispose = value[Symbol.dispose]; if (async) inner = dispose; } if (typeof dispose !== "function") throw new TypeError("Object not disposable."); if (inner) dispose = function() { try { inner.call(this); } catch (e5) { return Promise.reject(e5); } }; env.stack.push({ value, dispose, async }); } else if (async) { env.stack.push({ async: true }); } return value; }; __disposeResources2 = /* @__PURE__ */ (function(SuppressedError2) { return function(env) { function fail(e5) { env.error = env.hasError ? new SuppressedError2(e5, env.error, "An error was suppressed during disposal.") : e5; env.hasError = true; } var r5, s = 0; function next() { while (r5 = env.stack.pop()) { try { if (!r5.async && s === 1) return s = 0, env.stack.push(r5), Promise.resolve().then(next); if (r5.dispose) { var result = r5.dispose.call(r5.value); if (r5.async) return s |= 2, Promise.resolve(result).then(next, function(e5) { fail(e5); return next(); }); } else s |= 1; } catch (e5) { fail(e5); } } if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); if (env.hasError) throw env.error; } return next(); }; })(typeof SuppressedError === "function" ? SuppressedError : function(error3, suppressed, message) { var e5 = new Error(message); return e5.name = "SuppressedError", e5.error = error3, e5.suppressed = suppressed, e5; }); EvalFlags = { /** Global script mode (default). */ TYPE_GLOBAL: 0, /** Module mode. */ TYPE_MODULE: 1 << 0, /** Force strict mode. */ STRICT: 1 << 3, /** Compile only — do not execute. */ COMPILE_ONLY: 1 << 5, /** Omit stack frames before this eval from Error backtraces. */ BACKTRACE_BARRIER: 1 << 6, /** * Allow top-level `await` in global scripts. When used, `evalCode()` * returns a handle to a Promise that resolves to the completion value. * Use together with `executePendingJobs()` and `resolvePromise()`. */ ASYNC: 1 << 7 }; CompileFlags = { /** Strip source code from the bytecode (smaller output, no source in errors). */ STRIP_SOURCE: 1 << 4, /** Strip debug information (line numbers, etc.) from the bytecode. */ STRIP_DEBUG: 1 << 5 }; Intrinsics = { /** `Date` constructor and prototype methods. */ DATE: 1 << 0, /** `eval()` and `Function()` constructor. */ EVAL: 1 << 1, /** `RegExp` constructor, prototype methods, and regex literals. */ REGEXP: 1 << 2, /** `JSON.parse()` and `JSON.stringify()`. */ JSON: 1 << 3, /** `Proxy` and `Reflect`. */ PROXY: 1 << 4, /** `Map`, `Set`, `WeakMap`, `WeakSet`. */ MAP_SET: 1 << 5, /** `ArrayBuffer`, `TypedArray` variants, `DataView`. */ TYPED_ARRAYS: 1 << 6, /** `Promise`, `async`/`await`. */ PROMISE: 1 << 7, /** `BigInt`. Note: BigInt is part of BaseObjects in quickjs-ng and cannot be fully removed. */ BIG_INT: 1 << 8, /** `WeakRef` and `FinalizationRegistry`. */ WEAK_REF: 1 << 9, /** `performance.now()`. */ PERFORMANCE: 1 << 10, /** `DOMException` class. */ DOM_EXCEPTION: 1 << 11, /** All intrinsics enabled (default). */ ALL: 4294967295 }; SNAPSHOT_MAGIC = 1363825491; SNAPSHOT_VERSION = 2; SNAPSHOT_HEADER_SIZE = 24; QuickJS = class _QuickJS { exports; module; instance; encoder = new TextEncoder(); decoder = new TextDecoder(); disposed = false; /** Registry of host callbacks, keyed by function name */ hostCallbacks = /* @__PURE__ */ new Map(); /** Counter for internal-only callbacks (e.g. promise settle handlers) */ nextInternalId = 1; interruptHandler = null; unhandledRejectionHandler = null; moduleNormalizeHandler = null; moduleLoadHandler = null; timezoneOffsetHandler = null; // Cached singleton handles _global = null; _versions = null; _undefined = null; _null = null; _true = null; _false = null; // Handles that must be freed on dispose (e.g. unresolved promise resolve/reject functions) _ownedHandles = /* @__PURE__ */ new Set(); /** Loaded extensions in deterministic order */ loadedExtensions = []; constructor(module2) { this.module = module2; this.instance = null; this.exports = null; } setInstance(instance) { this.instance = instance; this.exports = instance.exports; } // ---- Cached property accessors ---- /** * Version information for the runtime and loaded native libraries. * Always includes `"quickjs-wasi"` (the npm package version) and * `"quickjs"` (the QuickJS engine version). Extensions may contribute * additional entries for their native dependencies (e.g. `"ada"`, `"mbedtls"`). */ get versions() { this.assertNotDisposed(); if (!this._versions) { const result = { "quickjs-wasi": VERSION, quickjs: this.readCString(this.exports.qjs_get_quickjs_version()) }; for (const ext of this.loadedExtensions) { if (ext.versions) { Object.assign(result, ext.versions); } } this._versions = result; } return this._versions; } /** The global object. Cached — do not dispose. */ get global() { if (!this._global) { this._global = new JSValueHandle(this, this.exports.qjs_get_global()); } return this._global; } /** The undefined value. Cached — do not dispose. */ get undefined() { if (!this._undefined) { this._undefined = new JSValueHandle(this, this.exports.qjs_get_undefined()); } return this._undefined; } /** The null value. Cached — do not dispose. */ get null() { if (!this._null) { this._null = new JSValueHandle(this, this.exports.qjs_get_null()); } return this._null; } /** The true value. Cached — do not dispose. */ get true() { if (!this._true) { this._true = new JSValueHandle(this, this.exports.qjs_get_true()); } return this._true; } /** The false value. Cached — do not dispose. */ get false() { if (!this._false) { this._false = new JSValueHandle(this, this.exports.qjs_get_false()); } return this._false; } /** * Create a fresh QuickJS VM instance. * * @param options - Optional configuration. Can also pass raw WASM bytes * directly for backwards compatibility. */ static async create(options) { const opts = _QuickJS.normalizeOptions(options); const module2 = await _QuickJS.resolveModule(opts.wasm); const vm = new _QuickJS(module2); const { instance, wasiBuiltins, wasiUserOverrides, memoryProxy } = await _QuickJS.instantiate(module2, vm, opts.wasi); vm.setInstance(instance); vm.exports._initialize(); const result = opts.intrinsics !== void 0 ? vm.exports.qjs_init2(opts.intrinsics) : vm.exports.qjs_init(); if (result !== 0) { throw new Error("Failed to initialize QuickJS runtime"); } if (opts.extensions) { const mainExports = instance.exports; for (const desc of opts.extensions) { const ext = await loadExtension(desc, mainExports, wasiBuiltins, wasiUserOverrides, memoryProxy); vm.loadedExtensions.push(ext); initExtension(ext, mainExports); } } _QuickJS.applyLimits(vm, opts); return vm; } /** * Restore a QuickJS VM from a snapshot. * * @param snapshot - The snapshot to restore from. * @param options - Optional configuration. Can also pass raw WASM bytes * directly for backwards compatibility. */ static async restore(snapshot, options) { const opts = _QuickJS.normalizeOptions(options); const module2 = await _QuickJS.resolveModule(opts.wasm); const vm = new _QuickJS(module2); const { instance, wasiBuiltins, wasiUserOverrides, memoryProxy } = await _QuickJS.instantiate(module2, vm, opts.wasi); vm.setInstance(instance); const mainExports = instance.exports; const exportedMemory = vm.exports.memory; const currentPages = exportedMemory.buffer.byteLength / 65536; const neededPages = Math.ceil(snapshot.memory.byteLength / 65536); if (neededPages > currentPages) { exportedMemory.grow(neededPages - currentPages); } if (snapshot.extensions.length > 0) { const descriptors = opts.extensions ?? []; vm.loadedExtensions = await restoreExtensions(descriptors, snapshot.extensions, mainExports, wasiBuiltins, wasiUserOverrides, memoryProxy); } const dst = new Uint8Array(exportedMemory.buffer); dst.set(snapshot.memory); vm.exports.qjs_set_runtime_and_context(snapshot.runtimePtr, snapshot.contextPtr); vm.exports.__stack_pointer.value = snapshot.stackPointer; _QuickJS.applyLimits(vm, opts); return vm; } // ---- Snapshot serialization ---- /** * Serialize a snapshot to a binary buffer for persistent storage. * * The format includes a versioned header followed by the raw memory. * Apply your own compression (gzip, zstd, etc.) on top for smaller * storage — the memory compresses very well due to large zero regions. * * Format (version 1): * ``` * Offset Size Field * 0 4 Magic: "QJSS" (0x514A5353, big-endian) * 4 1 Version: 1 * 5 3 Reserved (zero) * 8 4 Memory size in bytes (u32 little-endian) * 12 4 Stack pointer (u32 little-endian) * 16 4 Runtime pointer (u32 little-endian) * 20 4 Context pointer (u32 little-endian) * 24 N Memory data (N = memory size from offset 8) * ``` */ static serializeSnapshot(snapshot) { const textEncoder = new TextEncoder(); let extMetaSize = 4; const extEncodedNames = []; const extEncodedInitFns = []; for (const ext of snapshot.extensions) { const nameBytes = textEncoder.encode(ext.name); const initFnBytes = textEncoder.encode(ext.initFn); extEncodedNames.push(nameBytes); extEncodedInitFns.push(initFnBytes); extMetaSize += 4 + nameBytes.length + 4 + 4 + 4 + initFnBytes.length; } const totalSize = SNAPSHOT_HEADER_SIZE + extMetaSize + snapshot.memory.byteLength; const buffer = new ArrayBuffer(totalSize); const view = new DataView(buffer); const bytes = new Uint8Array(buffer); view.setUint32(0, SNAPSHOT_MAGIC, false); view.setUint8(4, SNAPSHOT_VERSION); view.setUint32(8, snapshot.memory.byteLength, true); view.setUint32(12, snapshot.stackPointer, true); view.setUint32(16, snapshot.runtimePtr, true); view.setUint32(20, snapshot.contextPtr, true); let offset = SNAPSHOT_HEADER_SIZE; view.setUint32(offset, snapshot.extensions.length, true); offset += 4; for (let i5 = 0; i5 < snapshot.extensions.length; i5++) { const ext = snapshot.extensions[i5]; const nameBytes = extEncodedNames[i5]; const initFnBytes = extEncodedInitFns[i5]; view.setUint32(offset, nameBytes.length, true); offset += 4; bytes.set(nameBytes, offset); offset += nameBytes.length; view.setUint32(offset, ext.memoryBase, true); offset += 4; view.setUint32(offset, ext.tableBase, true); offset += 4; view.setUint32(offset, initFnBytes.length, true); offset += 4; bytes.set(initFnBytes, offset); offset += initFnBytes.length; } bytes.set(snapshot.memory, offset); return bytes; } /** * Deserialize a snapshot from a binary buffer produced by `serializeSnapshot()`. */ static deserializeSnapshot(data3) { if (data3.length < SNAPSHOT_HEADER_SIZE) { throw new Error("Invalid snapshot: too small"); } const view = new DataView(data3.buffer, data3.byteOffset, data3.byteLength); const magic = view.getUint32(0, false); if (magic !== SNAPSHOT_MAGIC) { throw new Error(`Invalid snapshot: bad magic (expected 0x${SNAPSHOT_MAGIC.toString(16)}, got 0x${magic.toString(16)})`); } const version = view.getUint8(4); if (version !== SNAPSHOT_VERSION && version !== 1) { throw new Error(`Unsupported snapshot version: ${version} (expected ${SNAPSHOT_VERSION})`); } const memorySize = view.getUint32(8, true); const stackPointer = view.getUint32(12, true); const runtimePtr = view.getUint32(16, true); const contextPtr = view.getUint32(20, true); let extensions = []; let memoryOffset = SNAPSHOT_HEADER_SIZE; if (version >= 2) { const extCount = view.getUint32(24, true); let offset = 28; const textDecoder2 = new TextDecoder(); for (let i5 = 0; i5 < extCount; i5++) { const nameLen = view.getUint32(offset, true); offset += 4; const name = textDecoder2.decode(data3.slice(offset, offset + nameLen)); offset += nameLen; const memBase = view.getUint32(offset, true); offset += 4; const tblBase = view.getUint32(offset, true); offset += 4; const initFnLen = view.getUint32(offset, true); offset += 4; const initFn = textDecoder2.decode(data3.slice(offset, offset + initFnLen)); offset += initFnLen; extensions.push({ name, memoryBase: memBase, tableBase: tblBase, initFn }); } memoryOffset = offset; } const expectedSize = memoryOffset + memorySize; if (data3.length < expectedSize) { throw new Error(`Invalid snapshot: expected ${expectedSize} bytes, got ${data3.length}`); } const memory = data3.slice(memoryOffset, memoryOffset + memorySize); return { memory, stackPointer, runtimePtr, contextPtr, extensions }; } // ---- Internal instantiation helpers ---- static normalizeOptions(options) { if (!options) return {}; if (options instanceof WebAssembly.Module) return { wasm: options }; if (typeof options === "object" && ("wasm" in options || "wasi" in options || "memoryLimit" in options || "interruptHandler" in options || "onUnhandledRejection" in options || "moduleLoader" in options || "intrinsics" in options || "extensions" in options || "timezoneOffset" in options)) return options; return { wasm: options }; } static applyLimits(vm, opts) { if (opts.memoryLimit !== void 0) { vm.exports.qjs_set_memory_limit(opts.memoryLimit); } if (opts.interruptHandler) { vm.interruptHandler = opts.interruptHandler; vm.exports.qjs_set_interrupt_handler(1); } if (opts.onUnhandledRejection) { vm.unhandledRejectionHandler = opts.onUnhandledRejection; vm.exports.qjs_set_promise_rejection_handler(1); } if (opts.moduleLoader) { vm.moduleLoadHandler = opts.moduleLoader.load; vm.moduleNormalizeHandler = opts.moduleLoader.normalize ?? null; vm.exports.qjs_set_module_loader(1); } const tz = opts.timezoneOffset; if (typeof tz === "function") { vm.timezoneOffsetHandler = (timeSecs) => -tz(timeSecs) * 60; } else if (typeof tz === "number") { const offsetSecs = -tz * 60; vm.timezoneOffsetHandler = () => offsetSecs; } else { vm.timezoneOffsetHandler = (timeSecs) => { return -new Date(timeSecs * 1e3).getTimezoneOffset() * 60; }; } } static async resolveModule(wasmInput) { if (wasmInput instanceof WebAssembly.Module) { return wasmInput; } else if (wasmInput) { return WebAssembly.compile(wasmInput); } else { const { readFile } = await import("node:fs/promises"); const buf = await readFile(new URL("../quickjs.wasm", import_meta.url)); return WebAssembly.compile(buf); } } static async instantiate(module2, vm, wasiOptions) { let memory = null; const memoryProxy = new Proxy({}, { get(_target, prop) { return memory[prop]; } }); const wasiBuiltins = createWasiShim(() => memory); const wasiUserOverrides = wasiOptions ? wasiOptions(memoryProxy) : void 0; const wasiShim = { ...wasiBuiltins, ...wasiUserOverrides }; const hostCall = (namePtr, nameLen, thisPtr, argc, argvPtr) => { return vm.handleHostCall(namePtr, nameLen, thisPtr, argc, argvPtr); }; const hostInterrupt = () => { return vm.interruptHandler ? vm.interruptHandler() ? 1 : 0 : 0; }; const hostPromiseRejection = (promisePtr, reasonPtr, isHandled) => { if (!vm.unhandledRejectionHandler) { vm.exports.qjs_free_value(promisePtr); vm.exports.qjs_free_value(reasonPtr); return; } const promise = new JSValueHandle(vm, promisePtr); const reason = new JSValueHandle(vm, reasonPtr); try { vm.unhandledRejectionHandler(promise, reason, isHandled !== 0); } finally { promise.dispose(); reason.dispose(); } }; const hostModuleNormalize = (baseNamePtr, namePtr) => { if (!vm.moduleNormalizeHandler) { const name = vm.readCString(namePtr); return vm.writeString(name).ptr; } const baseName = vm.readCString(baseNamePtr); const specifier = vm.readCString(namePtr); try { const normalized = vm.moduleNormalizeHandler(baseName, specifier); return vm.writeString(normalized).ptr; } catch { return 0; } }; const hostModuleLoad = (namePtr, outLenPtr) => { if (!vm.moduleLoadHandler) return 0; const name = vm.readCString(namePtr); try { const source = vm.moduleLoadHandler(name); const { ptr, len } = vm.writeString(source); new Uint32Array(vm.exports.memory.buffer, outLenPtr, 1)[0] = len; return ptr; } catch { return 0; } }; const hostGetTimezoneOffset = (hi, lo) => { const timeSecs = Number(BigInt(hi) << 32n | BigInt(lo >>> 0)); return vm.timezoneOffsetHandler ? vm.timezoneOffsetHandler(timeSecs) : 0; }; const instance = await WebAssembly.instantiate(module2, { env: { host_call: hostCall, host_interrupt: hostInterrupt, host_promise_rejection: hostPromiseRejection, host_module_normalize: hostModuleNormalize, host_module_load: hostModuleLoad, host_get_timezone_offset: hostGetTimezoneOffset }, wasi_snapshot_preview1: wasiShim }); memory = instance.exports.memory; return { instance, wasiBuiltins, wasiUserOverrides, memoryProxy }; } /** * Called from WASM when a host function is invoked from QuickJS code. */ handleHostCall(namePtr, nameLen, thisPtr, argc, argvPtr) { const name = this.decoder.decode(new Uint8Array(this.exports.memory.buffer, namePtr, nameLen)); const callback = this.hostCallbacks.get(name); if (!callback) { return this.exports.qjs_get_undefined(); } const thisHandle = new JSValueHandle(this, thisPtr); const args = []; if (argc > 0 && argvPtr !== 0) { const view = new DataView(this.exports.memory.buffer); for (let i5 = 0; i5 < argc; i5++) { const argPtr = view.getUint32(argvPtr + i5 * 4, true); args.push(new JSValueHandle(this, argPtr)); } } try { const result = callback.call(thisHandle, ...args); return this.exports.qjs_dup_value(result.ptr); } catch (err) { const errHandle = this.newError(err instanceof Error ? err : String(err)); this.exports.qjs_throw(errHandle.ptr); errHandle.dispose(); return 0; } } // ---- String helpers ---- /** Write a JS string into WASM memory, returning the pointer. Caller must free. */ writeString(str) { const encoded = this.encoder.encode(str); const ptr = this.exports.wasm_malloc(encoded.length + 1); if (ptr === 0) throw new Error("wasm_malloc failed"); const mem = new Uint8Array(this.exports.memory.buffer); mem.set(encoded, ptr); mem[ptr + encoded.length] = 0; return { ptr, len: encoded.length }; } /** Read a null-terminated C string from WASM memory */ readCString(ptr) { const mem = new Uint8Array(this.exports.memory.buffer); let end = ptr; while (mem[end] !== 0) end++; return this.decoder.decode(mem.slice(ptr, end)); } // ---- Public API ---- /** * Check if a result handle is an exception and throw a JSException if so. * Used internally by evalCode and callFunction. */ throwIfException(result) { if (this.exports.qjs_is_exception(result.ptr) !== 0) { const exc = this.getException(); result.dispose(); this._ownedHandles.add(exc); throw new JSException(exc); } return result; } /** * Evaluate JavaScript code and return the result as a handle. * If the code throws, a `JSException` (which extends `Error`) is thrown * on the host side — matching standard JavaScript semantics. * * @param code - The JavaScript source code to evaluate. * @param filename - Optional filename for error stack traces (default `''`). * @param flags - Optional bitwise OR of `EvalFlags.*` constants. * For example, pass `EvalFlags.ASYNC` to allow top-level `await` — the * returned handle will be a Promise that resolves to the completion value. */ evalCode(code, filename = "", flags = 0) { this.assertNotDisposed(); const codeStr = this.writeString(code); const fnStr = this.writeString(filename); const resultPtr = this.exports.qjs_eval(codeStr.ptr, codeStr.len, fnStr.ptr, flags); this.exports.wasm_free(codeStr.ptr); this.exports.wasm_free(fnStr.ptr); return this.throwIfException(new JSValueHandle(this, resultPtr)); } /** * Compile JavaScript source code to bytecode without executing it. * The returned `Uint8Array` can be stored, transferred, or later executed * with `evalBytecode()`. * * @param code - The JavaScript source code to compile. * @param filename - Optional filename for error stack traces (default `''`). * @param evalFlags - Optional bitwise OR of `EvalFlags.*` constants. * Use `EvalFlags.TYPE_MODULE` to compile as a module. * @param compileFlags - Optional bitwise OR of `CompileFlags.*` constants. * Use `CompileFlags.STRIP_SOURCE` and/or `CompileFlags.STRIP_DEBUG` to * reduce bytecode size. */ compile(code, filename = "", evalFlags = 0, compileFlags = 0) { this.assertNotDisposed(); const codeStr = this.writeString(code); const fnStr = this.writeString(filename); const outLenPtr = this.exports.wasm_malloc(4); const bufPtr = this.exports.qjs_compile(codeStr.ptr, codeStr.len, fnStr.ptr, evalFlags, compileFlags, outLenPtr); this.exports.wasm_free(codeStr.ptr); this.exports.wasm_free(fnStr.ptr); if (bufPtr === 0) { this.exports.wasm_free(outLenPtr); const exc = this.getException(); throw new Error(`Compilation error: ${exc.toString()}`); } const outLen = new Uint32Array(this.exports.memory.buffer, outLenPtr, 1)[0]; this.exports.wasm_free(outLenPtr); const bytecode = new Uint8Array(this.exports.memory.buffer, bufPtr, outLen).slice(); this.exports.wasm_free(bufPtr); return bytecode; } /** * Execute previously compiled bytecode (from `compile()`). * Returns the evaluation result as a handle. * * @param bytecode - The bytecode `Uint8Array` from `compile()`. */ evalBytecode(bytecode) { this.assertNotDisposed(); const bufPtr = this.exports.wasm_malloc(bytecode.byteLength); new Uint8Array(this.exports.memory.buffer, bufPtr, bytecode.byteLength).set(bytecode); const resultPtr = this.exports.qjs_eval_bytecode(bufPtr, bytecode.byteLength); this.exports.wasm_free(bufPtr); return this.throwIfException(new JSValueHandle(this, resultPtr)); } /** * Execute all pending microtask jobs (promise reactions, etc.) * Returns the number of jobs executed. */ executePendingJobs() { this.assertNotDisposed(); let count = 0; while (this.exports.qjs_is_job_pending()) { const result = this.exports.qjs_execute_pending_job(); if (result < 0) { const exc = this.getException(); throw new Error(`Job execution error: ${exc.toString()}`); } count++; } return count; } /** * Explicitly trigger garbage collection. QuickJS runs GC automatically, * but this can be useful to reclaim memory at a known point or before * taking a snapshot. */ runGC() { this.assertNotDisposed(); this.exports.qjs_run_gc(); } /** * The GC threshold in bytes. When allocated memory exceeds this value, * garbage collection is triggered automatically. Set to 0 to disable * automatic GC. */ get gcThreshold() { this.assertNotDisposed(); return this.exports.qjs_get_gc_threshold(); } set gcThreshold(threshold) { this.assertNotDisposed(); this.exports.qjs_set_gc_threshold(threshold); } /** * Get detailed memory usage statistics from the QuickJS runtime. * Returns counts and sizes for atoms, strings, objects, functions, etc. */ getMemoryUsage() { this.assertNotDisposed(); const bufPtr = this.exports.wasm_malloc(26 * 8); this.exports.qjs_compute_memory_usage(bufPtr); const view = new BigInt64Array(this.exports.memory.buffer, bufPtr, 26); const result = { mallocSize: Number(view[0]), mallocLimit: Number(view[1]), memoryUsedSize: Number(view[2]), mallocCount: Number(view[3]), memoryUsedCount: Number(view[4]), atomCount: Number(view[5]), atomSize: Number(view[6]), strCount: Number(view[7]), strSize: Number(view[8]), objCount: Number(view[9]), objSize: Number(view[10]), propCount: Number(view[11]), propSize: Number(view[12]), shapeCount: Number(view[13]), shapeSize: Number(view[14]), jsFuncCount: Number(view[15]), jsFuncSize: Number(view[16]), jsFuncCodeSize: Number(view[17]), jsFuncPc2lineCount: Number(view[18]), jsFuncPc2lineSize: Number(view[19]), cFuncCount: Number(view[20]), arrayCount: Number(view[21]), fastArrayCount: Number(view[22]), fastArrayElements: Number(view[23]), binaryObjectCount: Number(view[24]), binaryObjectSize: Number(view[25]) }; this.exports.wasm_free(bufPtr); return result; } /** * Get the global object. Prefer the cached `vm.global` property. */ getGlobal() { this.assertNotDisposed(); return new JSValueHandle(this, this.exports.qjs_get_global()); } /** * Create a new QuickJS string value. */ newString(str) { this.assertNotDisposed(); const { ptr, len } = this.writeString(str); const resultPtr = this.exports.qjs_new_string(ptr, len); this.exports.wasm_free(ptr); return new JSValueHandle(this, resultPtr); } /** * Create a new QuickJS number value. */ newNumber(num) { this.assertNotDisposed(); return new JSValueHandle(this, this.exports.qjs_new_number(num)); } /** * Create a new QuickJS BigInt value. */ newBigInt(val) { this.assertNotDisposed(); const lo = Number(val & 0xffffffffn); const hi = Number(val >> 32n & 0xffffffffn); return new JSValueHandle(this, this.exports.qjs_new_big_int64(lo, hi)); } /** * Create a new QuickJS object value. */ newObject() { this.assertNotDisposed(); return new JSValueHandle(this, this.exports.qjs_new_object()); } /** * Create a new QuickJS array value. */ newArray() { this.assertNotDisposed(); return new JSValueHandle(this, this.exports.qjs_new_array()); } /** * Create a global symbol (`Symbol.for(description)`). * Global symbols with the same description are always the same symbol, * even across snapshot/restore. */ newSymbolFor(description) { this.assertNotDisposed(); const { ptr, len } = this.writeString(description); const result = new JSValueHandle(this, this.exports.qjs_new_symbol(ptr, len, 1)); this.exports.wasm_free(ptr); return result; } /** * Create a new QuickJS ArrayBuffer by copying data from a host buffer. */ newArrayBuffer(data3) { this.assertNotDisposed(); const bytes = data3 instanceof ArrayBuffer ? new Uint8Array(data3) : data3; const ptr = this.exports.wasm_malloc(bytes.length); if (ptr === 0) throw new Error("wasm_malloc failed"); new Uint8Array(this.exports.memory.buffer).set(bytes, ptr); const result = new JSValueHandle(this, this.exports.qjs_new_array_buffer(ptr, bytes.length)); this.exports.wasm_free(ptr); return result; } /** * Create a new QuickJS Uint8Array by copying data from a host buffer. */ newUint8Array(data3) { this.assertNotDisposed(); const ptr = this.exports.wasm_malloc(data3.length); if (ptr === 0) throw new Error("wasm_malloc failed"); new Uint8Array(this.exports.memory.buffer).set(data3, ptr); const result = new JSValueHandle(this, this.exports.qjs_new_uint8_array(ptr, data3.length)); this.exports.wasm_free(ptr); return result; } /** * Get undefined. Prefer the cached `vm.undefined` property. */ getUndefined() { this.assertNotDisposed(); return new JSValueHandle(this, this.exports.qjs_get_undefined()); } /** * Get null. Prefer the cached `vm.null` property. */ getNull() { this.assertNotDisposed(); return new JSValueHandle(this, this.exports.qjs_get_null()); } /** * Get true. Prefer the cached `vm.true` property. */ getTrue() { this.assertNotDisposed(); return new JSValueHandle(this, this.exports.qjs_get_true()); } /** * Get false. Prefer the cached `vm.false` property. */ getFalse() { this.assertNotDisposed(); return new JSValueHandle(this, this.exports.qjs_get_false()); } /** * Create a new QuickJS function backed by a host callback. * * When the function is called inside QuickJS, the host callback is invoked * with the `this` value and arguments as JSValueHandles. */ newFunction(name, fn) { this.assertNotDisposed(); if (this.hostCallbacks.has(name)) { throw new Error(`Host callback with name "${name}" is already registered`); } this.hostCallbacks.set(name, fn); const { ptr: namePtr, len: nameLen } = this.writeString(name); const resultPtr = this.exports.qjs_new_host_function(namePtr, nameLen, 0); this.exports.wasm_free(namePtr); return new JSValueHandle(this, resultPtr); } /** * Create an internal host function that bypasses the duplicate-name check. * Used for ephemeral callbacks (promise settle handlers, resolvePromise, etc.) * that are not intended to survive snapshot/restore. */ newInternalFunction(name, fn) { this.hostCallbacks.set(name, fn); const { ptr: namePtr, len: nameLen } = this.writeString(name); const resultPtr = this.exports.qjs_new_host_function(namePtr, nameLen, 0); this.exports.wasm_free(namePtr); return new JSValueHandle(this, resultPtr); } /** * Create a new promise. * * Returns a Deferred with: * - `handle` - the QuickJS promise object * - `settled` - a host Promise that resolves when the QuickJS promise settles * - `resolve(value)` - resolve the promise with a QuickJS value * - `reject(value)` - reject the promise with a QuickJS value */ newPromise() { this.assertNotDisposed(); const resolveOutPtr = this.exports.wasm_malloc(4); const rejectOutPtr = this.exports.wasm_malloc(4); const promisePtr = this.exports.qjs_new_promise(resolveOutPtr, rejectOutPtr); const view = new DataView(this.exports.memory.buffer); const resolvePtr = view.getUint32(resolveOutPtr, true); const rejectPtr = view.getUint32(rejectOutPtr, true); this.exports.wasm_free(resolveOutPtr); this.exports.wasm_free(rejectOutPtr); const promiseHandle = new JSValueHandle(this, promisePtr); const resolveHandle = new JSValueHandle(this, resolvePtr); const rejectHandle = new JSValueHandle(this, rejectPtr); const vm = this; vm._ownedHandles.add(resolveHandle); vm._ownedHandles.add(rejectHandle); let _settled = null; return { handle: promiseHandle, get settled() { if (!_settled) { let settledResolve; _settled = new Promise((res) => { settledResolve = res; }); const settleName = `__settle:${vm.nextInternalId++}`; const onSettleFn = vm.newInternalFunction(settleName, () => { settledResolve(); vm.hostCallbacks.delete(settleName); return vm.undefined; }); const thenFn = promiseHandle.getProp("then"); const onSettleDup = onSettleFn.dup(); vm.callFunctionRaw(thenFn, promiseHandle, onSettleFn, onSettleDup).dispose(); thenFn.dispose(); onSettleFn.dispose(); onSettleDup.dispose(); } return _settled; }, resolve(value) { vm.callFunctionRaw(resolveHandle, vm.undefined, value).dispose(); vm._ownedHandles.delete(resolveHandle); resolveHandle.dispose(); }, reject(value) { vm.callFunctionRaw(rejectHandle, vm.undefined, value).dispose(); vm._ownedHandles.delete(rejectHandle); rejectHandle.dispose(); } }; } /** * Resolve a promise handle. Returns a host-side Promise that resolves * with the settled value/error of the QuickJS promise. * * If the handle is not a promise, it is treated as an already-fulfilled value. * * The returned host Promise resolves to `{ value: JSValueHandle }` on * fulfillment or `{ error: JSValueHandle }` on rejection. */ resolvePromise(promiseHandle) { this.assertNotDisposed(); if (!this.exports.qjs_is_promise(promiseHandle.ptr)) { return Promise.resolve({ value: promiseHandle.dup() }); } const state2 = this.exports.qjs_promise_state(promiseHandle.ptr); if (state2 === 1) { return Promise.resolve({ value: new JSValueHandle(this, this.exports.qjs_promise_result(promiseHandle.ptr)) }); } else if (state2 === 2) { return Promise.resolve({ error: new JSValueHandle(this, this.exports.qjs_promise_result(promiseHandle.ptr)) }); } return new Promise((hostResolve) => { const id = this.nextInternalId++; const fulfilledName = `__onFulfilled:${id}`; const rejectedName = `__onRejected:${id}`; const onFulfilled = this.newInternalFunction(fulfilledName, (...args) => { const val = args[0]?.dup() ?? this.undefined; this.hostCallbacks.delete(fulfilledName); this.hostCallbacks.delete(rejectedName); hostResolve({ value: val }); return this.undefined; }); const onRejected = this.newInternalFunction(rejectedName, (...args) => { const val = args[0]?.dup() ?? this.undefined; this.hostCallbacks.delete(fulfilledName); this.hostCallbacks.delete(rejectedName); hostResolve({ error: val }); return this.undefined; }); const thenFn = promiseHandle.getProp("then"); this.callFunctionRaw(thenFn, promiseHandle, onFulfilled, onRejected).dispose(); thenFn.dispose(); onFulfilled.dispose(); onRejected.dispose(); }); } /** * Call a QuickJS function. If the function throws, a `JSException` * is thrown on the host side. */ callFunction(func, thisVal, ...args) { return this.throwIfException(this.callFunctionRaw(func, thisVal, ...args)); } /** * Internal: call a QuickJS function without throwing on exception. * Used by promise plumbing where exceptions are handled differently. */ callFunctionRaw(func, thisVal, ...args) { this.assertNotDisposed(); const argc = args.length; let argvPtr = 0; if (argc > 0) { argvPtr = this.exports.wasm_malloc(argc * 4); const view = new DataView(this.exports.memory.buffer); for (let i5 = 0; i5 < argc; i5++) { view.setUint32(argvPtr + i5 * 4, args[i5].ptr, true); } } const resultPtr = this.exports.qjs_call(func.ptr, thisVal.ptr, argc, argvPtr); if (argvPtr) this.exports.wasm_free(argvPtr); return new JSValueHandle(this, resultPtr); } /** * Set a property on an object. Accepts string or JSValueHandle as key. * JSValueHandle keys support symbols (including `Symbol.for()`). */ setProp(obj, key, value) { this.assertNotDisposed(); if (typeof key === "string") { const { ptr: namePtr } = this.writeString(key); this.exports.qjs_set_prop_string(obj.ptr, namePtr, value.ptr); this.exports.wasm_free(namePtr); } else { this.exports.qjs_set_prop_value(obj.ptr, key.ptr, value.ptr); } } /** * Define a property on an object with explicit property descriptor flags. * Unlike `setProp`, this allows controlling `writable`, `enumerable`, and * `configurable` attributes, matching `Object.defineProperty()` semantics. * Accepts string or JSValueHandle as key (JSValueHandle keys support symbols). * * All flags default to `false` when not specified. */ defineProp(obj, key, value, descriptor) { this.assertNotDisposed(); let flags = 0; if (descriptor?.configurable) flags |= 1; if (descriptor?.writable) flags |= 2; if (descriptor?.enumerable) flags |= 4; if (typeof key === "string") { const { ptr: namePtr } = this.writeString(key); this.exports.qjs_define_prop_string(obj.ptr, namePtr, value.ptr, flags); this.exports.wasm_free(namePtr); } else { this.exports.qjs_define_prop_value(obj.ptr, key.ptr, value.ptr, flags); } } /** * Get a property from an object using a JSValueHandle key. * Supports symbol keys (including `Symbol.for()`). */ getProp(obj, key) { this.assertNotDisposed(); return new JSValueHandle(this, this.exports.qjs_get_prop_value(obj.ptr, key.ptr)); } /** * Get the current exception, if any. */ getException() { this.assertNotDisposed(); return new JSValueHandle(this, this.exports.qjs_get_exception()); } /** * Create a new QuickJS Error object. * Accepts a string message or a native Error object. */ newError(messageOrError) { this.assertNotDisposed(); const errPtr = this.exports.qjs_new_error(); const errHandle = new JSValueHandle(this, errPtr); if (typeof messageOrError === "string") { const msgHandle = this.newString(messageOrError); errHandle.setProp("message", msgHandle); msgHandle.dispose(); } else { const msgHandle = this.newString(messageOrError.message); errHandle.setProp("message", msgHandle); msgHandle.dispose(); if (messageOrError.name) { const nameHandle = this.newString(messageOrError.name); errHandle.setProp("name", nameHandle); nameHandle.dispose(); } if (messageOrError.stack) { const stackHandle = this.newString(messageOrError.stack); errHandle.setProp("stack", stackHandle); stackHandle.dispose(); } } return errHandle; } /** * Get the typeof a handle as a string. */ typeof(handle) { this.assertNotDisposed(); const e5 = this.exports; if (e5.qjs_is_undefined(handle.ptr)) return "undefined"; if (e5.qjs_is_null(handle.ptr)) return "object"; if (e5.qjs_is_bool(handle.ptr)) return "boolean"; if (e5.qjs_is_number(handle.ptr)) return "number"; if (e5.qjs_is_big_int(handle.ptr)) return "bigint"; if (e5.qjs_is_string(handle.ptr)) return "string"; if (e5.qjs_is_symbol(handle.ptr)) return "symbol"; if (e5.qjs_is_function(handle.ptr)) return "function"; if (e5.qjs_is_object(handle.ptr)) return "object"; return "unknown"; } /** * Convert a QuickJS handle to a host JavaScript value. * Handles strings, numbers, booleans, null, undefined, bigint, arrays, * errors, functions, and plain objects. Circular references in objects * are returned as `undefined`. */ dump(handle) { this.assertNotDisposed(); return this._dump(handle, /* @__PURE__ */ new Map()); } _dump(handle, visited) { const e5 = this.exports; if (e5.qjs_is_undefined(handle.ptr)) return void 0; if (e5.qjs_is_null(handle.ptr)) return null; if (e5.qjs_is_bool(handle.ptr)) return e5.qjs_get_bool(handle.ptr) !== 0; if (e5.qjs_is_number(handle.ptr)) return e5.qjs_get_float64(handle.ptr); if (e5.qjs_is_string(handle.ptr)) return handle.toString(); if (e5.qjs_is_big_int(handle.ptr)) return handle.toBigInt(); if (e5.qjs_is_symbol(handle.ptr)) { const descOutPtr = e5.wasm_malloc(4); const kind = e5.qjs_get_symbol_description(handle.ptr, descOutPtr); const view = new DataView(e5.memory.buffer); const descPtr = view.getUint32(descOutPtr, true); e5.wasm_free(descOutPtr); if (kind === 1) { const descHandle = new JSValueHandle(this, descPtr); const description = descHandle.toString(); descHandle.dispose(); return Symbol.for(description); } else if (kind === 2) { const descHandle = new JSValueHandle(this, descPtr); descHandle.dispose(); return void 0; } return void 0; } if (e5.qjs_is_array_buffer(handle.ptr)) return handle.toArrayBuffer(); if (e5.qjs_is_exception(handle.ptr)) { const exc = this.getException(); const msg = exc.toString(); exc.dispose(); return new Error(msg); } if (e5.qjs_is_function(handle.ptr)) return void 0; if (e5.qjs_is_object(handle.ptr)) { const objPtr = e5.qjs_get_value_ptr(handle.ptr); if (objPtr) { const existing = visited.get(objPtr); if (existing !== void 0) return existing; } } if (e5.qjs_is_object(handle.ptr)) { const byteOffsetPtr = e5.wasm_malloc(4); const byteLengthPtr = e5.wasm_malloc(4); const bytesPerElemPtr = e5.wasm_malloc(4); const abPtr = e5.qjs_get_typed_array_buffer(handle.ptr, byteOffsetPtr, byteLengthPtr, bytesPerElemPtr); const abHandle = new JSValueHandle(this, abPtr); if (e5.qjs_is_exception(abHandle.ptr) === 0) { const view = new DataView(e5.memory.buffer); const byteOffset = view.getUint32(byteOffsetPtr, true); const byteLength = view.getUint32(byteLengthPtr, true); const bytesPerElement = view.getUint32(bytesPerElemPtr, true); e5.wasm_free(byteOffsetPtr); e5.wasm_free(byteLengthPtr); e5.wasm_free(bytesPerElemPtr); const abLenPtr = e5.wasm_malloc(4); const abDataPtr = e5.qjs_get_array_buffer(abHandle.ptr, abLenPtr); e5.wasm_free(abLenPtr); abHandle.dispose(); if (abDataPtr !== 0) { const rawBytes = new Uint8Array(e5.memory.buffer, abDataPtr + byteOffset, byteLength).slice(); switch (bytesPerElement) { case 1: return rawBytes; case 2: return new Uint16Array(rawBytes.buffer); case 4: return new Uint32Array(rawBytes.buffer); case 8: return new Float64Array(rawBytes.buffer); default: return rawBytes; } } } else { abHandle.dispose(); e5.wasm_free(byteOffsetPtr); e5.wasm_free(byteLengthPtr); e5.wasm_free(bytesPerElemPtr); } } if (e5.qjs_is_array(handle.ptr)) { const lenHandle = handle.getProp("length"); const len = e5.qjs_get_float64(lenHandle.ptr); lenHandle.dispose(); const arr = []; const objPtr = e5.qjs_get_value_ptr(handle.ptr); if (objPtr) visited.set(objPtr, arr); for (let i5 = 0; i5 < len; i5++) { const elemPtr = e5.qjs_get_prop_uint32(handle.ptr, i5); const elemHandle = new JSValueHandle(this, elemPtr); arr.push(this._dump(elemHandle, visited)); elemHandle.dispose(); } return arr; } if (e5.qjs_is_error(handle.ptr)) { const nameHandle = handle.getProp("name"); const msgHandle = handle.getProp("message"); const stackHandle = handle.getProp("stack"); const name = nameHandle.isUndefined ? "Error" : nameHandle.toString(); const message = msgHandle.isUndefined ? "" : msgHandle.toString(); const stack = stackHandle.isUndefined ? void 0 : stackHandle.toString(); nameHandle.dispose(); msgHandle.dispose(); stackHandle.dispose(); const err = new Error(message); err.name = name; if (stack !== void 0) { err.stack = stack; } return err; } if (e5.qjs_is_object(handle.ptr)) { const keysPtr = e5.qjs_get_own_property_names(handle.ptr); const keysHandle = new JSValueHandle(this, keysPtr); if (e5.qjs_is_exception(keysHandle.ptr) !== 0) { keysHandle.dispose(); return {}; } const lenHandle = keysHandle.getProp("length"); const len = e5.qjs_get_float64(lenHandle.ptr); lenHandle.dispose(); const obj = {}; const objPtr = e5.qjs_get_value_ptr(handle.ptr); if (objPtr) visited.set(objPtr, obj); for (let i5 = 0; i5 < len; i5++) { const keyPtr = e5.qjs_get_prop_uint32(keysHandle.ptr, i5); const keyHandle = new JSValueHandle(this, keyPtr); const key = keyHandle.toString(); keyHandle.dispose(); const valHandle = handle.getProp(key); obj[key] = this._dump(valHandle, visited); valHandle.dispose(); } keysHandle.dispose(); return obj; } return void 0; } /** * Convert a host JavaScript value to a QuickJS handle. */ hostToHandle(value) { this.assertNotDisposed(); if (value === void 0) return this.undefined; if (value === null) return this.null; if (value === true) return this.true; if (value === false) return this.false; if (typeof value === "number") return this.newNumber(value); if (typeof value === "string") return this.newString(value); if (typeof value === "bigint") return this.newBigInt(value); if (typeof value === "symbol") { const key = Symbol.keyFor(value); if (key !== void 0) { return this.newSymbolFor(key); } throw new Error(`Cannot convert local symbol to QuickJS handle. Use Symbol.for() for cross-boundary symbols.`); } if (value instanceof Promise) { const deferred = this.newPromise(); value.then((r5) => { deferred.resolve(this.hostToHandle(r5)); this.executePendingJobs(); }, (err) => { deferred.reject(this.hostToHandle(err)); this.executePendingJobs(); }); return deferred.handle; } if (value instanceof Error) { return this.newError(value); } if (value instanceof ArrayBuffer) { return this.newArrayBuffer(value); } if (value instanceof Uint8Array) { return this.newUint8Array(value); } if (ArrayBuffer.isView(value)) { return this.newArrayBuffer(new Uint8Array(value.buffer, value.byteOffset, value.byteLength)); } if (Array.isArray(value)) { const arr = this.newArray(); for (let i5 = 0; i5 < value.length; i5++) { const elemHandle = this.hostToHandle(value[i5]); this.exports.qjs_set_prop_uint32(arr.ptr, i5, elemHandle.ptr); elemHandle.dispose(); } return arr; } if (typeof value === "object" && value !== null) { const obj = this.newObject(); for (const [key, val] of Object.entries(value)) { const valHandle = this.hostToHandle(val); obj.setProp(key, valHandle); valHandle.dispose(); } return obj; } return this.undefined; } // ---- Snapshot / Restore ---- /** * Snapshot the entire VM state. * * Returns a snapshot containing the full WASM linear memory. Use * `QuickJS.serializeSnapshot()` to convert to a versioned binary * buffer for persistent storage. */ snapshot() { this.assertNotDisposed(); return { memory: new Uint8Array(this.exports.memory.buffer).slice(), stackPointer: this.exports.__stack_pointer.value, runtimePtr: this.exports.qjs_get_runtime_ptr(), contextPtr: this.exports.qjs_get_context_ptr(), extensions: this.loadedExtensions.map((ext) => ({ name: ext.name, memoryBase: ext.memoryBase, tableBase: ext.tableBase, initFn: ext.initFn })) }; } /** * Re-register a host callback after restoring from a snapshot. * The name must match the name passed to `newFunction()` before the snapshot. */ registerHostCallback(name, fn) { this.hostCallbacks.set(name, fn); } /** * Dispose the VM, releasing all references to the WASM instance * so it can be garbage collected by the host JS engine. */ dispose() { if (!this.disposed) { this.disposed = true; this._global = null; this._undefined = null; this._null = null; this._true = null; this._false = null; this._ownedHandles.clear(); this.hostCallbacks.clear(); this.exports = null; this.instance = null; this.module = null; } } /** * Support for `using` declarations (Explicit Resource Management). * Automatically disposes the VM when it goes out of scope. * * ```typescript * using vm = await QuickJS.create(wasmBytes); * vm.evalCode('1 + 2'); * // vm is automatically disposed here * ``` */ [Symbol.dispose]() { this.dispose(); } assertNotDisposed() { if (this.disposed) { throw new Error("QuickJS instance has been disposed"); } } // ---- Internal accessors for JSValueHandle ---- /** @internal */ _getExports() { return this.exports; } /** @internal */ _getMemory() { return this.exports.memory; } /** @internal */ _writeString(str) { return this.writeString(str); } /** @internal */ _readCString(ptr) { return this.readCString(ptr); } }; JSException = class extends Error { /** * A live handle to the QuickJS exception value. You can read custom * properties, call methods, etc. Must be disposed when done. */ handle; // Cached values so they survive handle disposal / VM teardown. // Using # fields keeps them out of console.log / Object.keys output. #name; #message; #stack; /** @internal */ constructor(handle) { const env_1 = { stack: [], error: void 0, hasError: false }; try { super(); this.handle = handle; delete this.stack; const msgHandle = __addDisposableResource2(env_1, handle.getProp("message"), false); this.#name = handle.getProp("name").consume((h5) => h5.isUndefined ? "Error" : h5.toString()); this.#message = msgHandle.isUndefined ? handle.toString() : msgHandle.toString(); this.#stack = handle.getProp("stack").consume((h5) => h5.isUndefined ? void 0 : h5.toString()); } catch (e_1) { env_1.error = e_1; env_1.hasError = true; } finally { __disposeResources2(env_1); } } get name() { return this.#name; } set name(v) { this.#name = v; } get message() { return this.#message; } set message(v) { this.#message = v; } get stack() { return this.#stack; } set stack(v) { this.#stack = v; } dispose() { this.handle.dispose(); } [Symbol.dispose]() { this.handle.dispose(); } }; JSValueHandle = class _JSValueHandle { /** The QuickJS VM instance this handle belongs to. */ vm; /** @internal */ ptr; disposed = false; constructor(vm, ptr) { this.vm = vm; this.ptr = ptr; } get isUndefined() { return this.vm._getExports().qjs_is_undefined(this.ptr) !== 0; } get isNull() { return this.vm._getExports().qjs_is_null(this.ptr) !== 0; } /** * Get the promise state: 0 = pending, 1 = fulfilled, 2 = rejected */ get isBool() { return this.vm._getExports().qjs_is_bool(this.ptr) !== 0; } get isNumber() { return this.vm._getExports().qjs_is_number(this.ptr) !== 0; } get isString() { return this.vm._getExports().qjs_is_string(this.ptr) !== 0; } get isSymbol() { return this.vm._getExports().qjs_is_symbol(this.ptr) !== 0; } get isBigInt() { return this.vm._getExports().qjs_is_big_int(this.ptr) !== 0; } get isObject() { return this.vm._getExports().qjs_is_object(this.ptr) !== 0; } get isArray() { return this.vm._getExports().qjs_is_array(this.ptr) !== 0; } get isFunction() { return this.vm._getExports().qjs_is_function(this.ptr) !== 0; } get isError() { return this.vm._getExports().qjs_is_error(this.ptr) !== 0; } get isPromise() { return this.vm._getExports().qjs_is_promise(this.ptr) !== 0; } get isArrayBuffer() { return this.vm._getExports().qjs_is_array_buffer(this.ptr) !== 0; } get promiseState() { return this.vm._getExports().qjs_promise_state(this.ptr); } /** * Get the typeof this value as a string. * Returns the same values as the native `typeof` operator. */ get typeof() { return this.vm.typeof(this); } /** * Get the length property of this value (for arrays, strings, etc.). */ get length() { const h5 = this.getProp("length"); const n3 = h5.toNumber(); h5.dispose(); return n3; } /** * Get the constructor name of this object, or undefined if unavailable. */ get constructorName() { const ctor = this.getProp("constructor"); if (ctor.isUndefined || ctor.isNull) { ctor.dispose(); return void 0; } const name = ctor.getProp("name"); ctor.dispose(); if (name.isUndefined || name.isNull) { name.dispose(); return void 0; } const result = name.toString(); name.dispose(); return result; } /** * Get the own enumerable string property names (equivalent to Object.keys()). */ keys() { const e5 = this.vm._getExports(); const keysPtr = e5.qjs_get_own_property_names(this.ptr); const keysHandle = new _JSValueHandle(this.vm, keysPtr); if (e5.qjs_is_exception(keysHandle.ptr) !== 0) { keysHandle.dispose(); return []; } const lenHandle = keysHandle.getProp("length"); const len = e5.qjs_get_float64(lenHandle.ptr); lenHandle.dispose(); const result = []; for (let i5 = 0; i5 < len; i5++) { const keyPtr = e5.qjs_get_prop_uint32(keysHandle.ptr, i5); const keyHandle = new _JSValueHandle(this.vm, keyPtr); result.push(keyHandle.toString()); keyHandle.dispose(); } keysHandle.dispose(); return result; } /** * Get all own property names including non-enumerable ones * (equivalent to Object.getOwnPropertyNames()). */ getOwnPropertyNames() { const e5 = this.vm._getExports(); const keysPtr = e5.qjs_get_own_property_names_all(this.ptr); const keysHandle = new _JSValueHandle(this.vm, keysPtr); if (e5.qjs_is_exception(keysHandle.ptr) !== 0) { keysHandle.dispose(); return []; } const lenHandle = keysHandle.getProp("length"); const len = e5.qjs_get_float64(lenHandle.ptr); lenHandle.dispose(); const result = []; for (let i5 = 0; i5 < len; i5++) { const keyPtr = e5.qjs_get_prop_uint32(keysHandle.ptr, i5); const keyHandle = new _JSValueHandle(this.vm, keyPtr); result.push(keyHandle.toString()); keyHandle.dispose(); } keysHandle.dispose(); return result; } /** * Check if a property is an own property (equivalent to Object.prototype.hasOwnProperty). */ hasOwnProperty(name) { const { ptr: namePtr } = this.vm._writeString(name); const result = this.vm._getExports().qjs_has_own_property(this.ptr, namePtr); this.vm._getExports().wasm_free(namePtr); return result === 1; } /** * Check if a property is enumerable (equivalent to Object.prototype.propertyIsEnumerable). */ propertyIsEnumerable(name) { const { ptr: namePtr } = this.vm._writeString(name); const result = this.vm._getExports().qjs_property_is_enumerable(this.ptr, namePtr); this.vm._getExports().wasm_free(namePtr); return result === 1; } /** * Get the prototype of this object (equivalent to Object.getPrototypeOf()). */ getPrototypeOf() { const protoPtr = this.vm._getExports().qjs_get_prototype_of(this.ptr); return new _JSValueHandle(this.vm, protoPtr); } /** * Get a property by name. */ getProp(name) { const { ptr: namePtr } = this.vm._writeString(name); const resultPtr = this.vm._getExports().qjs_get_prop_string(this.ptr, namePtr); this.vm._getExports().wasm_free(namePtr); return new _JSValueHandle(this.vm, resultPtr); } /** * Set a property by name. */ setProp(name, value) { const { ptr: namePtr } = this.vm._writeString(name); this.vm._getExports().qjs_set_prop_string(this.ptr, namePtr, value.ptr); this.vm._getExports().wasm_free(namePtr); } /** * Define a property with explicit property descriptor flags. * Unlike `setProp`, this allows controlling `writable`, `enumerable`, and * `configurable` attributes, matching `Object.defineProperty()` semantics. * Accepts string or JSValueHandle as key (JSValueHandle keys support symbols). * * All flags default to `false` when not specified. */ defineProp(key, value, descriptor) { let flags = 0; if (descriptor?.configurable) flags |= 1; if (descriptor?.writable) flags |= 2; if (descriptor?.enumerable) flags |= 4; if (typeof key === "string") { const { ptr: namePtr } = this.vm._writeString(key); this.vm._getExports().qjs_define_prop_string(this.ptr, namePtr, value.ptr, flags); this.vm._getExports().wasm_free(namePtr); } else { this.vm._getExports().qjs_define_prop_value(this.ptr, key.ptr, value.ptr, flags); } } /** * Extract the value as a number. */ toNumber() { return this.vm._getExports().qjs_get_float64(this.ptr); } /** * Extract the value as a BigInt. */ toBigInt() { const e5 = this.vm._getExports(); const loPtr = e5.wasm_malloc(4); const hiPtr = e5.wasm_malloc(4); const ret = e5.qjs_get_big_int64(this.ptr, loPtr, hiPtr); if (ret !== 0) { e5.wasm_free(loPtr); e5.wasm_free(hiPtr); throw new Error("Failed to convert value to BigInt"); } const view = new DataView(e5.memory.buffer); const lo = view.getUint32(loPtr, true); const hi = view.getInt32(hiPtr, true); e5.wasm_free(loPtr); e5.wasm_free(hiPtr); return BigInt(hi) << 32n | BigInt(lo); } /** * Extract the value as an ArrayBuffer (copies from WASM memory). * Works on ArrayBuffer values. For typed arrays, gets the underlying buffer. */ toArrayBuffer() { const e5 = this.vm._getExports(); const lenOutPtr = e5.wasm_malloc(4); if (e5.qjs_is_array_buffer(this.ptr)) { const dataPtr = e5.qjs_get_array_buffer(this.ptr, lenOutPtr); if (dataPtr === 0) { e5.wasm_free(lenOutPtr); throw new Error("Failed to get ArrayBuffer data"); } const view2 = new DataView(e5.memory.buffer); const len = view2.getUint32(lenOutPtr, true); e5.wasm_free(lenOutPtr); return new Uint8Array(e5.memory.buffer, dataPtr, len).slice().buffer; } e5.wasm_free(lenOutPtr); const byteOffsetPtr = e5.wasm_malloc(4); const byteLengthPtr = e5.wasm_malloc(4); const bytesPerElemPtr = e5.wasm_malloc(4); const abPtr = e5.qjs_get_typed_array_buffer(this.ptr, byteOffsetPtr, byteLengthPtr, bytesPerElemPtr); const abHandle = new _JSValueHandle(this.vm, abPtr); if (this.vm._getExports().qjs_is_exception(abHandle.ptr) !== 0) { abHandle.dispose(); e5.wasm_free(byteOffsetPtr); e5.wasm_free(byteLengthPtr); e5.wasm_free(bytesPerElemPtr); throw new Error("Value is not an ArrayBuffer or typed array"); } const view = new DataView(e5.memory.buffer); const byteOffset = view.getUint32(byteOffsetPtr, true); const byteLength = view.getUint32(byteLengthPtr, true); e5.wasm_free(byteOffsetPtr); e5.wasm_free(byteLengthPtr); e5.wasm_free(bytesPerElemPtr); const abLenPtr = e5.wasm_malloc(4); const abDataPtr = e5.qjs_get_array_buffer(abHandle.ptr, abLenPtr); e5.wasm_free(abLenPtr); abHandle.dispose(); if (abDataPtr === 0) { throw new Error("Failed to get ArrayBuffer data from typed array"); } return new Uint8Array(e5.memory.buffer, abDataPtr + byteOffset, byteLength).slice().buffer; } /** * Extract the value as a Uint8Array (copies from WASM memory). * Works on Uint8Array, ArrayBuffer, and other typed array values. */ toUint8Array() { return new Uint8Array(this.toArrayBuffer()); } /** * Extract the value as a string (calls JS_ToCString - works on any value). */ toString() { const cstrPtr = this.vm._getExports().qjs_get_string(this.ptr); if (cstrPtr === 0) return ""; const str = this.vm._readCString(cstrPtr); this.vm._getExports().qjs_free_cstring(cstrPtr); return str; } /** * Use this handle, then dispose it. Returns the callback's return value. */ consume(fn) { try { return fn(this); } finally { this.dispose(); } } /** * Duplicate this handle (increment refcount). */ dup() { return new _JSValueHandle(this.vm, this.vm._getExports().qjs_dup_value(this.ptr)); } /** * Dispose this handle, freeing the heap-allocated JSValue. * Safe to call after the VM has been disposed (becomes a no-op). */ dispose() { if (!this.disposed) { this.disposed = true; const exports2 = this.vm._getExports(); if (exports2) { exports2.qjs_free_value(this.ptr); } } } /** * Support for `using` declarations (Explicit Resource Management). * Automatically disposes the handle when it goes out of scope. * * ```typescript * using result = vm.evalCode('1 + 2'); * console.log(result.toNumber()); // 3 * // result is automatically disposed here * ``` */ [Symbol.dispose]() { this.dispose(); } }; } }); // node_modules/pac-proxy-agent/node_modules/socks-proxy-agent/dist/index.js var dist_exports4 = {}; __export(dist_exports4, { SocksProxyAgent: () => SocksProxyAgent2 }); function parseSocksURL2(url) { let lookup4 = false; let type = 5; const host = url.hostname; const port = parseInt(url.port, 10) || 1080; switch (url.protocol.replace(":", "")) { case "socks4": lookup4 = true; type = 4; break; // pass through case "socks4a": type = 4; break; case "socks5": lookup4 = true; type = 5; break; // pass through case "socks": type = 5; break; case "socks5h": type = 5; break; default: throw new TypeError(`A "socks" protocol must be specified! Got: ${String(url.protocol)}`); } const proxy = { host, port, type }; if (url.username) { Object.defineProperty(proxy, "userId", { value: decodeURIComponent(url.username), enumerable: false }); } if (url.password != null) { Object.defineProperty(proxy, "password", { value: decodeURIComponent(url.password), enumerable: false }); } return { lookup: lookup4, proxy }; } function omit4(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; } var import_socks2, import_debug10, dns2, net7, tls4, import_url5, debug11, setServernameFromNonIpHost3, SocksProxyAgent2; var init_dist10 = __esm({ "node_modules/pac-proxy-agent/node_modules/socks-proxy-agent/dist/index.js"() { import_socks2 = __toESM(require_build(), 1); init_dist5(); import_debug10 = __toESM(require_src(), 1); dns2 = __toESM(require("dns"), 1); net7 = __toESM(require("net"), 1); tls4 = __toESM(require("tls"), 1); import_url5 = require("url"); debug11 = (0, import_debug10.default)("socks-proxy-agent"); setServernameFromNonIpHost3 = (options) => { if (options.servername === void 0 && options.host && !net7.isIP(options.host)) { return { ...options, servername: options.host }; } return options; }; SocksProxyAgent2 = class extends Agent6 { constructor(uri, opts) { super(opts); const url = typeof uri === "string" ? new import_url5.URL(uri) : uri; const { proxy, lookup: lookup4 } = parseSocksURL2(url); this.shouldLookup = lookup4; this.proxy = proxy; this.timeout = opts?.timeout ?? null; this.socketOptions = opts?.socketOptions ?? null; } /** * Initiates a SOCKS connection to the specified SOCKS proxy server, * which in turn connects to the specified remote host and port. */ async connect(req, opts) { const { shouldLookup, proxy, timeout } = this; if (!opts.host) { throw new Error("No `host` defined!"); } let { host } = opts; const { port, lookup: lookupFn = dns2.lookup } = opts; if (shouldLookup) { host = await new Promise((resolve, reject) => { lookupFn(host, {}, (err, address) => { if (err) { reject(err); } else { resolve(typeof address === "string" ? address : address[0].address); } }); }); } const socksOpts = { proxy, destination: { host, port: typeof port === "number" ? port : parseInt(port, 10) }, command: "connect", timeout: timeout ?? void 0, // @ts-expect-error the type supplied by socks for socket_options is wider // than necessary since socks will always override the host and port socket_options: this.socketOptions ?? void 0 }; const cleanup = (tlsSocket) => { req.destroy(); socket.destroy(); if (tlsSocket) tlsSocket.destroy(); }; debug11("Creating socks proxy connection: %o", socksOpts); const { socket } = await import_socks2.SocksClient.createConnection(socksOpts); debug11("Successfully created socks proxy connection"); if (timeout !== null) { socket.setTimeout(timeout); socket.on("timeout", () => cleanup()); } if (opts.secureEndpoint) { debug11("Upgrading socket connection to TLS"); const tlsSocket = tls4.connect({ ...omit4(setServernameFromNonIpHost3(opts), "host", "path", "port"), socket }); tlsSocket.once("error", (error3) => { debug11("Socket TLS error", error3.message); cleanup(tlsSocket); }); return tlsSocket; } return socket; } }; SocksProxyAgent2.protocols = [ "socks", "socks4", "socks4a", "socks5", "socks5h" ]; } }); // node_modules/pac-proxy-agent/node_modules/https-proxy-agent/dist/parse-proxy-response.js function parseProxyResponse2(socket) { return new Promise((resolve, reject) => { let buffersLength = 0; const buffers = []; function read() { const b6 = socket.read(); if (b6) ondata(b6); else socket.once("readable", read); } function cleanup() { socket.removeListener("end", onend); socket.removeListener("error", onerror); socket.removeListener("readable", read); } function onend() { cleanup(); debug12("onend"); reject(new Error("Proxy connection ended before receiving CONNECT response")); } function onerror(err) { cleanup(); debug12("onerror %o", err); reject(err); } 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) { debug12("have not received end of HTTP headers yet..."); read(); 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; } } debug12("got proxy server response: %o %o", firstLine, headers); cleanup(); resolve({ connect: { statusCode, statusText, headers }, buffered }); } socket.on("error", onerror); socket.on("end", onend); read(); }); } var import_debug11, debug12; var init_parse_proxy_response2 = __esm({ "node_modules/pac-proxy-agent/node_modules/https-proxy-agent/dist/parse-proxy-response.js"() { import_debug11 = __toESM(require_src(), 1); debug12 = (0, import_debug11.default)("https-proxy-agent:parse-proxy-response"); } }); // node_modules/pac-proxy-agent/node_modules/https-proxy-agent/dist/index.js var dist_exports5 = {}; __export(dist_exports5, { HttpsProxyAgent: () => HttpsProxyAgent2 }); function resume2(socket) { socket.resume(); } function omit5(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; } var net8, tls5, import_assert2, import_debug12, import_url6, debug13, setServernameFromNonIpHost4, HttpsProxyAgent2; var init_dist11 = __esm({ "node_modules/pac-proxy-agent/node_modules/https-proxy-agent/dist/index.js"() { net8 = __toESM(require("net"), 1); tls5 = __toESM(require("tls"), 1); import_assert2 = __toESM(require("assert"), 1); import_debug12 = __toESM(require_src(), 1); init_dist5(); import_url6 = require("url"); init_parse_proxy_response2(); debug13 = (0, import_debug12.default)("https-proxy-agent"); setServernameFromNonIpHost4 = (options) => { if (options.servername === void 0 && options.host && !net8.isIP(options.host)) { return { ...options, servername: options.host }; } return options; }; HttpsProxyAgent2 = class extends Agent6 { constructor(proxy, opts) { super(opts); this.options = { path: void 0 }; this.proxy = typeof proxy === "string" ? new import_url6.URL(proxy) : proxy; this.proxyHeaders = opts?.headers ?? {}; debug13("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 ? omit5(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 } = this; if (!opts.host) { throw new TypeError('No "host" provided'); } let socket; if (proxy.protocol === "https:") { debug13("Creating `tls.Socket`: %o", this.connectOpts); socket = tls5.connect(setServernameFromNonIpHost4(this.connectOpts)); } else { debug13("Creating `net.Socket`: %o", this.connectOpts); socket = net8.connect(this.connectOpts); } const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; const host = net8.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; let payload2 = `CONNECT ${host}:${opts.port} HTTP/1.1\r `; if (proxy.username || proxy.password) { const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.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 name of Object.keys(headers)) { payload2 += `${name}: ${headers[name]}\r `; } const proxyResponsePromise = parseProxyResponse2(socket); socket.write(`${payload2}\r `); const { connect: connect13, buffered } = await proxyResponsePromise; req.emit("proxyConnect", connect13); this.emit("proxyConnect", connect13, req); if (connect13.statusCode === 200) { req.once("socket", resume2); if (opts.secureEndpoint) { debug13("Upgrading socket connection to TLS"); return tls5.connect({ ...omit5(setServernameFromNonIpHost4(opts), "host", "path", "port"), socket }); } return socket; } socket.destroy(); const fakeSocket = new net8.Socket({ writable: false }); fakeSocket.readable = true; req.once("socket", (s) => { debug13("Replaying proxy buffer for failed request"); (0, import_assert2.default)(s.listenerCount("data") > 0); s.push(buffered); s.push(null); }); return fakeSocket; } }; HttpsProxyAgent2.protocols = ["http", "https"]; } }); // node_modules/pac-proxy-agent/node_modules/http-proxy-agent/dist/index.js var dist_exports6 = {}; __export(dist_exports6, { HttpProxyAgent: () => HttpProxyAgent2 }); function omit6(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; } var net9, tls6, import_debug13, import_events3, import_url7, debug14, HttpProxyAgent2; var init_dist12 = __esm({ "node_modules/pac-proxy-agent/node_modules/http-proxy-agent/dist/index.js"() { net9 = __toESM(require("net"), 1); tls6 = __toESM(require("tls"), 1); import_debug13 = __toESM(require_src(), 1); import_events3 = require("events"); init_dist5(); import_url7 = require("url"); debug14 = (0, import_debug13.default)("http-proxy-agent"); HttpProxyAgent2 = class extends Agent6 { constructor(proxy, opts) { super(opts); this.proxy = typeof proxy === "string" ? new import_url7.URL(proxy) : proxy; this.proxyHeaders = opts?.headers ?? {}; debug14("Creating new HttpProxyAgent 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 = { ...opts ? omit6(opts, "headers") : null, host, port }; } addRequest(req, opts) { req._header = null; this.setRequestProps(req, opts); super.addRequest(req, opts); } setRequestProps(req, opts) { const { proxy } = this; const protocol = opts.secureEndpoint ? "https:" : "http:"; const hostname = req.getHeader("host") || "localhost"; const base = `${protocol}//${hostname}`; const url = new import_url7.URL(req.path, base); if (opts.port !== 80) { url.port = String(opts.port); } req.path = String(url); const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; if (proxy.username || proxy.password) { const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } if (!headers["Proxy-Connection"]) { headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } for (const name of Object.keys(headers)) { const value = headers[name]; if (value) { req.setHeader(name, value); } } } async connect(req, opts) { req._header = null; if (!req.path.includes("://")) { this.setRequestProps(req, opts); } let first; let endOfHeaders; debug14("Regenerating stored HTTP header string for request"); req._implicitHeader(); if (req.outputData && req.outputData.length > 0) { debug14("Patching connection write() output buffer with updated header"); first = req.outputData[0].data; endOfHeaders = first.indexOf("\r\n\r\n") + 4; req.outputData[0].data = req._header + first.substring(endOfHeaders); debug14("Output buffer: %o", req.outputData[0].data); } let socket; if (this.proxy.protocol === "https:") { debug14("Creating `tls.Socket`: %o", this.connectOpts); socket = tls6.connect(this.connectOpts); } else { debug14("Creating `net.Socket`: %o", this.connectOpts); socket = net9.connect(this.connectOpts); } await (0, import_events3.once)(socket, "connect"); return socket; } }; HttpProxyAgent2.protocols = ["http", "https"]; } }); // node_modules/pac-proxy-agent/dist/index.js var dist_exports7 = {}; __export(dist_exports7, { PacProxyAgent: () => PacProxyAgent }); var net10, tls7, crypto3, import_events4, import_debug14, import_url8, debug15, setServernameFromNonIpHost5, PacProxyAgent; var init_dist13 = __esm({ "node_modules/pac-proxy-agent/dist/index.js"() { net10 = __toESM(require("net"), 1); tls7 = __toESM(require("tls"), 1); crypto3 = __toESM(require("crypto"), 1); import_events4 = require("events"); import_debug14 = __toESM(require_src(), 1); import_url8 = require("url"); init_dist5(); init_dist6(); init_dist8(); init_dist9(); debug15 = (0, import_debug14.default)("pac-proxy-agent"); setServernameFromNonIpHost5 = (options) => { if (options.servername === void 0 && options.host && !net10.isIP(options.host)) { return { ...options, servername: options.host }; } return options; }; PacProxyAgent = class extends Agent6 { constructor(uri, opts) { super(opts); this.clearResolverPromise = () => { this.resolverPromise = void 0; }; const uriStr = typeof uri === "string" ? uri : uri.href; this.uri = new import_url8.URL(uriStr.replace(/^pac\+/i, "")); debug15("Creating PacProxyAgent with URI %o", this.uri.href); this.opts = { ...opts }; this.cache = void 0; this.resolver = void 0; this.resolverHash = ""; this.resolverPromise = void 0; if (!this.opts.filename) { this.opts.filename = this.uri.href; } } /** * Loads the PAC proxy file from the source if necessary, and returns * a generated `FindProxyForURL()` resolver function to use. */ getResolver() { if (!this.resolverPromise) { this.resolverPromise = this.loadResolver(); this.resolverPromise.then(this.clearResolverPromise, this.clearResolverPromise); } return this.resolverPromise; } async loadResolver() { try { const [qjs, code] = await Promise.all([ QuickJS.create(), this.loadPacFile() ]); const hash = crypto3.createHash("sha1").update(code).digest("hex"); if (this.resolver && this.resolverHash === hash) { debug15("Same sha1 hash for code - contents have not changed, reusing previous proxy resolver"); qjs.dispose(); return this.resolver; } if (this.qjs) { this.qjs.dispose(); } this.qjs = qjs; debug15("Creating new proxy resolver instance"); this.resolver = createPacResolver(qjs, code, this.opts); this.resolverHash = hash; return this.resolver; } catch (err) { if (this.resolver && err.code === "ENOTMODIFIED") { debug15("Got ENOTMODIFIED response, reusing previous proxy resolver"); return this.resolver; } throw err; } } /** * Loads the contents of the PAC proxy file. * * @api private */ async loadPacFile() { debug15("Loading PAC file: %o", this.uri); const rs = await getUri(this.uri, { ...this.opts, cache: this.cache }); debug15("Got `Readable` instance for URI"); this.cache = rs; const buf = await toBuffer(rs); debug15("Read %o byte PAC file from URI", buf.length); return buf.toString("utf8"); } /** * Called when the node-core HTTP client library is creating a new HTTP request. */ async connect(req, opts) { const { secureEndpoint } = opts; const isWebSocket = req.getHeader("upgrade") === "websocket"; const resolver = await this.getResolver(); const protocol = secureEndpoint ? "https:" : "http:"; const host = opts.host && net10.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; const defaultPort = secureEndpoint ? 443 : 80; const url = Object.assign(new import_url8.URL(req.path, `${protocol}//${host}`), defaultPort ? void 0 : { port: opts.port }); debug15("url: %s", url); let result = await resolver(url); if (!result) { result = "DIRECT"; } const proxies2 = String(result).trim().split(/\s*;\s*/g).filter(Boolean); if (this.opts.fallbackToDirect && !proxies2.includes("DIRECT")) { proxies2.push("DIRECT"); } for (const proxy of proxies2) { let agent = null; let socket = null; const [type, target] = proxy.split(/\s+/); debug15("Attempting to use proxy: %o", proxy); if (type === "DIRECT") { if (secureEndpoint) { socket = tls7.connect(setServernameFromNonIpHost5(opts)); } else { socket = net10.connect(opts); } } else if (type === "SOCKS" || type === "SOCKS5") { const { SocksProxyAgent: SocksProxyAgent3 } = await Promise.resolve().then(() => (init_dist10(), dist_exports4)); agent = new SocksProxyAgent3(`socks://${target}`, this.opts); } else if (type === "SOCKS4") { const { SocksProxyAgent: SocksProxyAgent3 } = await Promise.resolve().then(() => (init_dist10(), dist_exports4)); agent = new SocksProxyAgent3(`socks4a://${target}`, this.opts); } else if (type === "PROXY" || type === "HTTP" || type === "HTTPS") { const proxyURL = `${type === "HTTPS" ? "https" : "http"}://${target}`; if (secureEndpoint || isWebSocket) { const { HttpsProxyAgent: HttpsProxyAgent3 } = await Promise.resolve().then(() => (init_dist11(), dist_exports5)); agent = new HttpsProxyAgent3(proxyURL, this.opts); } else { const { HttpProxyAgent: HttpProxyAgent3 } = await Promise.resolve().then(() => (init_dist12(), dist_exports6)); agent = new HttpProxyAgent3(proxyURL, this.opts); } } try { if (socket) { await (0, import_events4.once)(socket, "connect"); req.emit("proxy", { proxy, socket }); return socket; } if (agent) { const s = await agent.connect(req, opts); if (!(s instanceof net10.Socket)) { throw new Error("Expected a `net.Socket` to be returned from agent"); } req.emit("proxy", { proxy, socket: s }); return s; } throw new Error(`Could not determine proxy type for: ${proxy}`); } catch (err) { debug15("Got error for proxy %o: %o", proxy, err); req.emit("proxy", { proxy, error: err }); } } throw new Error(`Failed to establish a socket connection to proxies: ${JSON.stringify(proxies2)}`); } }; PacProxyAgent.protocols = [ "pac+data", "pac+file", "pac+ftp", "pac+http", "pac+https" ]; } }); // src/index.ts var index_exports = {}; __export(index_exports, { run: () => run }); module.exports = __toCommonJS(index_exports); // node_modules/@actions/core/lib/command.js var os = __toESM(require("os"), 1); // node_modules/@actions/core/lib/utils.js function toCommandValue(input) { if (input === null || input === void 0) { return ""; } else if (typeof input === "string" || input instanceof String) { return input; } return JSON.stringify(input); } function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; } return { title: annotationProperties.title, file: annotationProperties.file, line: annotationProperties.startLine, endLine: annotationProperties.endLine, col: annotationProperties.startColumn, endColumn: annotationProperties.endColumn }; } // node_modules/@actions/core/lib/command.js function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); process.stdout.write(cmd.toString() + os.EOL); } var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { if (!command) { command = "missing.command"; } this.command = command; this.properties = properties; this.message = message; } toString() { let cmdStr = CMD_STRING + this.command; if (this.properties && Object.keys(this.properties).length > 0) { cmdStr += " "; let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { const val = this.properties[key]; if (val) { if (first) { first = false; } else { cmdStr += ","; } cmdStr += `${key}=${escapeProperty(val)}`; } } } } cmdStr += `${CMD_STRING}${escapeData(this.message)}`; return cmdStr; } }; function escapeData(s) { return toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); } function escapeProperty(s) { return toCommandValue(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C"); } // node_modules/@actions/core/lib/file-command.js var crypto2 = __toESM(require("crypto"), 1); var fs = __toESM(require("fs"), 1); var os2 = __toESM(require("os"), 1); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } if (!fs.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } fs.appendFileSync(filePath, `${toCommandValue(message)}${os2.EOL}`, { encoding: "utf8" }); } function prepareKeyValueMessage(key, value) { const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; const convertedValue = toCommandValue(value); if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } if (convertedValue.includes(delimiter)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } // node_modules/@actions/core/lib/core.js var os4 = __toESM(require("os"), 1); // node_modules/@actions/http-client/lib/index.js var http = __toESM(require("http"), 1); var https = __toESM(require("https"), 1); // node_modules/@actions/http-client/lib/proxy.js function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { return void 0; } const proxyVar = (() => { if (usingSsl) { return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; } else { return process.env["http_proxy"] || process.env["HTTP_PROXY"]; } })(); if (proxyVar) { try { return new DecodedURL(proxyVar); } catch (_a2) { if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) return new DecodedURL(`http://${proxyVar}`); } } else { return void 0; } } function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } const reqHost = reqUrl.hostname; if (isLoopbackAddress(reqHost)) { return true; } const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; if (!noProxy) { return false; } let reqPort; if (reqUrl.port) { reqPort = Number(reqUrl.port); } else if (reqUrl.protocol === "http:") { reqPort = 80; } else if (reqUrl.protocol === "https:") { reqPort = 443; } const upperReqHosts = [reqUrl.hostname.toUpperCase()]; if (typeof reqPort === "number") { upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } for (const upperNoProxyItem of noProxy.split(",").map((x) => x.trim().toUpperCase()).filter((x) => x)) { if (upperNoProxyItem === "*" || upperReqHosts.some((x) => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || upperNoProxyItem.startsWith(".") && x.endsWith(`${upperNoProxyItem}`))) { return true; } } return false; } function isLoopbackAddress(host) { const hostLower = host.toLowerCase(); return hostLower === "localhost" || hostLower.startsWith("127.") || hostLower.startsWith("[::1]") || hostLower.startsWith("[0:0:0:0:0:0:0:1]"); } var DecodedURL = class extends URL { constructor(url, base) { super(url, base); this._decodedUsername = decodeURIComponent(super.username); this._decodedPassword = decodeURIComponent(super.password); } get username() { return this._decodedUsername; } get password() { return this._decodedPassword; } }; // node_modules/@actions/http-client/lib/index.js var tunnel = __toESM(require_tunnel2(), 1); var import_undici = __toESM(require_undici(), 1); var __awaiter = function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); }); } return new (P || (P = Promise))(function(resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e5) { reject(e5); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e5) { reject(e5); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var HttpCodes; (function(HttpCodes2) { HttpCodes2[HttpCodes2["OK"] = 200] = "OK"; HttpCodes2[HttpCodes2["MultipleChoices"] = 300] = "MultipleChoices"; HttpCodes2[HttpCodes2["MovedPermanently"] = 301] = "MovedPermanently"; HttpCodes2[HttpCodes2["ResourceMoved"] = 302] = "ResourceMoved"; HttpCodes2[HttpCodes2["SeeOther"] = 303] = "SeeOther"; HttpCodes2[HttpCodes2["NotModified"] = 304] = "NotModified"; HttpCodes2[HttpCodes2["UseProxy"] = 305] = "UseProxy"; HttpCodes2[HttpCodes2["SwitchProxy"] = 306] = "SwitchProxy"; HttpCodes2[HttpCodes2["TemporaryRedirect"] = 307] = "TemporaryRedirect"; HttpCodes2[HttpCodes2["PermanentRedirect"] = 308] = "PermanentRedirect"; HttpCodes2[HttpCodes2["BadRequest"] = 400] = "BadRequest"; HttpCodes2[HttpCodes2["Unauthorized"] = 401] = "Unauthorized"; HttpCodes2[HttpCodes2["PaymentRequired"] = 402] = "PaymentRequired"; HttpCodes2[HttpCodes2["Forbidden"] = 403] = "Forbidden"; HttpCodes2[HttpCodes2["NotFound"] = 404] = "NotFound"; HttpCodes2[HttpCodes2["MethodNotAllowed"] = 405] = "MethodNotAllowed"; HttpCodes2[HttpCodes2["NotAcceptable"] = 406] = "NotAcceptable"; HttpCodes2[HttpCodes2["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; HttpCodes2[HttpCodes2["RequestTimeout"] = 408] = "RequestTimeout"; HttpCodes2[HttpCodes2["Conflict"] = 409] = "Conflict"; HttpCodes2[HttpCodes2["Gone"] = 410] = "Gone"; HttpCodes2[HttpCodes2["TooManyRequests"] = 429] = "TooManyRequests"; HttpCodes2[HttpCodes2["InternalServerError"] = 500] = "InternalServerError"; HttpCodes2[HttpCodes2["NotImplemented"] = 501] = "NotImplemented"; HttpCodes2[HttpCodes2["BadGateway"] = 502] = "BadGateway"; HttpCodes2[HttpCodes2["ServiceUnavailable"] = 503] = "ServiceUnavailable"; HttpCodes2[HttpCodes2["GatewayTimeout"] = 504] = "GatewayTimeout"; })(HttpCodes || (HttpCodes = {})); var Headers2; (function(Headers3) { Headers3["Accept"] = "accept"; Headers3["ContentType"] = "content-type"; })(Headers2 || (Headers2 = {})); var MediaTypes; (function(MediaTypes2) { MediaTypes2["ApplicationJson"] = "application/json"; })(MediaTypes || (MediaTypes = {})); var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect ]; var HttpResponseRetryCodes = [ HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout ]; var RetryableHttpVerbs = ["OPTIONS", "GET", "DELETE", "HEAD"]; var ExponentialBackoffCeiling = 10; var ExponentialBackoffTimeSlice = 5; var HttpClientError = class _HttpClientError extends Error { constructor(message, statusCode) { super(message); this.name = "HttpClientError"; this.statusCode = statusCode; Object.setPrototypeOf(this, _HttpClientError.prototype); } }; var HttpClientResponse = class { constructor(message) { this.message = message; } readBody() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); }); this.message.on("end", () => { resolve(output.toString()); }); })); }); } readBodyBuffer() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); }); this.message.on("end", () => { resolve(Buffer.concat(chunks)); }); })); }); } }; var HttpClient = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; this._allowRedirects = true; this._allowRedirectDowngrade = false; this._maxRedirects = 50; this._allowRetries = false; this._maxRetries = 1; this._keepAlive = false; this._disposed = false; this.userAgent = this._getUserAgentWithOrchestrationId(userAgent); this.handlers = handlers || []; this.requestOptions = requestOptions; if (requestOptions) { if (requestOptions.ignoreSslError != null) { this._ignoreSslError = requestOptions.ignoreSslError; } this._socketTimeout = requestOptions.socketTimeout; if (requestOptions.allowRedirects != null) { this._allowRedirects = requestOptions.allowRedirects; } if (requestOptions.allowRedirectDowngrade != null) { this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; } if (requestOptions.maxRedirects != null) { this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); } if (requestOptions.keepAlive != null) { this._keepAlive = requestOptions.keepAlive; } if (requestOptions.allowRetries != null) { this._allowRetries = requestOptions.allowRetries; } if (requestOptions.maxRetries != null) { this._maxRetries = requestOptions.maxRetries; } } } options(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data3, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data3, additionalHeaders || {}); }); } patch(requestUrl, data3, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data3, additionalHeaders || {}); }); } put(requestUrl, data3, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data3, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } /** * Gets a typed object from an endpoint * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl_1) { return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) { additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); const res = yield this.get(requestUrl, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } postJson(requestUrl_1, obj_1) { return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { const data3 = JSON.stringify(obj, null, 2); additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.post(requestUrl, data3, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } putJson(requestUrl_1, obj_1) { return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { const data3 = JSON.stringify(obj, null, 2); additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.put(requestUrl, data3, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } patchJson(requestUrl_1, obj_1) { return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { const data3 = JSON.stringify(obj, null, 2); additionalHeaders[Headers2.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers2.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers2.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data3, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } /** * Makes a raw http request. * All other methods such as get, post, patch, and request ultimately call this. * Prefer get, del, post and patch */ request(verb, requestUrl, data3, headers) { return __awaiter(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } const parsedUrl = new URL(requestUrl); let info2 = this._prepareRequest(verb, parsedUrl, headers); const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; let numTries = 0; let response; do { response = yield this.requestRaw(info2, data3); if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { let authenticationHandler; for (const handler of this.handlers) { if (handler.canHandleAuthentication(response)) { authenticationHandler = handler; break; } } if (authenticationHandler) { return authenticationHandler.handleAuthentication(this, info2, data3); } else { return response; } } let redirectsRemaining = this._maxRedirects; while (response.message.statusCode && HttpRedirectCodes.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { const redirectUrl = response.message.headers["location"]; if (!redirectUrl) { break; } const parsedRedirectUrl = new URL(redirectUrl); if (parsedUrl.protocol === "https:" && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true."); } yield response.readBody(); if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { for (const header in headers) { if (header.toLowerCase() === "authorization") { delete headers[header]; } } } info2 = this._prepareRequest(verb, parsedRedirectUrl, headers); response = yield this.requestRaw(info2, data3); redirectsRemaining--; } if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { return response; } numTries += 1; if (numTries < maxTries) { yield response.readBody(); yield this._performExponentialBackoff(numTries); } } while (numTries < maxTries); return response; }); } /** * Needs to be called if keepAlive is set to true in request options. */ dispose() { if (this._agent) { this._agent.destroy(); } this._disposed = true; } /** * Raw request. * @param info * @param data */ requestRaw(info2, data3) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { function callbackForResult(err, res) { if (err) { reject(err); } else if (!res) { reject(new Error("Unknown error")); } else { resolve(res); } } this.requestRawWithCallback(info2, data3, callbackForResult); }); }); } /** * Raw request with callback. * @param info * @param data * @param onResult */ requestRawWithCallback(info2, data3, onResult) { if (typeof data3 === "string") { if (!info2.options.headers) { info2.options.headers = {}; } info2.options.headers["Content-Length"] = Buffer.byteLength(data3, "utf8"); } let callbackCalled = false; function handleResult(err, res) { if (!callbackCalled) { callbackCalled = true; onResult(err, res); } } const req = info2.httpModule.request(info2.options, (msg) => { const res = new HttpClientResponse(msg); handleResult(void 0, res); }); let socket; req.on("socket", (sock) => { socket = sock; }); req.setTimeout(this._socketTimeout || 3 * 6e4, () => { if (socket) { socket.end(); } handleResult(new Error(`Request timeout: ${info2.options.path}`)); }); req.on("error", function(err) { handleResult(err); }); if (data3 && typeof data3 === "string") { req.write(data3, "utf8"); } if (data3 && typeof data3 !== "string") { data3.on("close", function() { req.end(); }); data3.pipe(req); } else { req.end(); } } /** * Gets an http agent. This function is useful when you need an http agent that handles * routing through a proxy server - depending upon the url and proxy environment variables. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ getAgent(serverUrl) { const parsedUrl = new URL(serverUrl); return this._getAgent(parsedUrl); } getAgentDispatcher(serverUrl) { const parsedUrl = new URL(serverUrl); const proxyUrl = getProxyUrl(parsedUrl); const useProxy = proxyUrl && proxyUrl.hostname; if (!useProxy) { return; } return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); } _prepareRequest(method, requestUrl, headers) { const info2 = {}; info2.parsedUrl = requestUrl; const usingSsl = info2.parsedUrl.protocol === "https:"; info2.httpModule = usingSsl ? https : http; const defaultPort = usingSsl ? 443 : 80; info2.options = {}; info2.options.host = info2.parsedUrl.hostname; info2.options.port = info2.parsedUrl.port ? parseInt(info2.parsedUrl.port) : defaultPort; info2.options.path = (info2.parsedUrl.pathname || "") + (info2.parsedUrl.search || ""); info2.options.method = method; info2.options.headers = this._mergeHeaders(headers); if (this.userAgent != null) { info2.options.headers["user-agent"] = this.userAgent; } info2.options.agent = this._getAgent(info2.parsedUrl); if (this.handlers) { for (const handler of this.handlers) { handler.prepareRequest(info2.options); } } return info2; } _mergeHeaders(headers) { if (this.requestOptions && this.requestOptions.headers) { return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } return lowercaseKeys(headers || {}); } /** * Gets an existing header value or returns a default. * Handles converting number header values to strings since HTTP headers must be strings. * Note: This returns string | string[] since some headers can have multiple values. * For headers that must always be a single string (like Content-Type), use the * specialized _getExistingOrDefaultContentTypeHeader method instead. */ _getExistingOrDefaultHeader(additionalHeaders, header, _default) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; if (headerValue) { clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; } } const additionalValue = additionalHeaders[header]; if (additionalValue !== void 0) { return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; } if (clientHeader !== void 0) { return clientHeader; } return _default; } /** * Specialized version of _getExistingOrDefaultHeader for Content-Type header. * Always returns a single string (not an array) since Content-Type should be a single value. * Converts arrays to comma-separated strings and numbers to strings to ensure type safety. * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]). */ _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers2.ContentType]; if (headerValue) { if (typeof headerValue === "number") { clientHeader = String(headerValue); } else if (Array.isArray(headerValue)) { clientHeader = headerValue.join(", "); } else { clientHeader = headerValue; } } } const additionalValue = additionalHeaders[Headers2.ContentType]; if (additionalValue !== void 0) { if (typeof additionalValue === "number") { return String(additionalValue); } else if (Array.isArray(additionalValue)) { return additionalValue.join(", "); } else { return additionalValue; } } if (clientHeader !== void 0) { return clientHeader; } return _default; } _getAgent(parsedUrl) { let agent; const proxyUrl = getProxyUrl(parsedUrl); const useProxy = proxyUrl && proxyUrl.hostname; if (this._keepAlive && useProxy) { agent = this._proxyAgent; } if (!useProxy) { agent = this._agent; } if (agent) { return agent; } const usingSsl = parsedUrl.protocol === "https:"; let maxSockets = 100; if (this.requestOptions) { maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } if (proxyUrl && proxyUrl.hostname) { const agentOptions = { maxSockets, keepAlive: this._keepAlive, proxy: Object.assign(Object.assign({}, (proxyUrl.username || proxyUrl.password) && { proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` }), { host: proxyUrl.hostname, port: proxyUrl.port }) }; let tunnelAgent; const overHttps = proxyUrl.protocol === "https:"; if (usingSsl) { tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; } else { tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } agent = tunnelAgent(agentOptions); this._proxyAgent = agent; } if (!agent) { const options = { keepAlive: this._keepAlive, maxSockets }; agent = usingSsl ? new https.Agent(options) : new http.Agent(options); this._agent = agent; } if (usingSsl && this._ignoreSslError) { agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false }); } return agent; } _getProxyAgentDispatcher(parsedUrl, proxyUrl) { let proxyAgent; if (this._keepAlive) { proxyAgent = this._proxyAgentDispatcher; } if (proxyAgent) { return proxyAgent; } const usingSsl = parsedUrl.protocol === "https:"; proxyAgent = new import_undici.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, (proxyUrl.username || proxyUrl.password) && { token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString("base64")}` })); this._proxyAgentDispatcher = proxyAgent; if (usingSsl && this._ignoreSslError) { proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { rejectUnauthorized: false }); } return proxyAgent; } _getUserAgentWithOrchestrationId(userAgent) { const baseUserAgent = userAgent || "actions/http-client"; const orchId = process.env["ACTIONS_ORCHESTRATION_ID"]; if (orchId) { const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, "_"); return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`; } return baseUserAgent; } _performExponentialBackoff(retryNumber) { return __awaiter(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve) => setTimeout(() => resolve(), ms)); }); } _processResponse(res, options) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, result: null, headers: {} }; if (statusCode === HttpCodes.NotFound) { resolve(response); } function dateTimeDeserializer(key, value) { if (typeof value === "string") { const a5 = new Date(value); if (!isNaN(a5.valueOf())) { return a5; } } return value; } let obj; let contents; try { contents = yield res.readBody(); if (contents && contents.length > 0) { if (options && options.deserializeDates) { obj = JSON.parse(contents, dateTimeDeserializer); } else { obj = JSON.parse(contents); } response.result = obj; } response.headers = res.message.headers; } catch (err) { } if (statusCode > 299) { let msg; if (obj && obj.message) { msg = obj.message; } else if (contents && contents.length > 0) { msg = contents; } else { msg = `Failed request: (${statusCode})`; } const err = new HttpClientError(msg, statusCode); err.result = response.result; reject(err); } else { resolve(response); } })); }); } }; var lowercaseKeys = (obj) => Object.keys(obj).reduce((c5, k5) => (c5[k5.toLowerCase()] = obj[k5], c5), {}); // node_modules/@actions/http-client/lib/auth.js var __awaiter2 = function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); }); } return new (P || (P = Promise))(function(resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e5) { reject(e5); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e5) { reject(e5); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var BearerCredentialHandler = class { constructor(token) { this.token = token; } // currently implements pre-authorization // TODO: support preAuth = false where it hooks on 401 prepareRequest(options) { if (!options.headers) { throw Error("The request has no headers"); } options.headers["Authorization"] = `Bearer ${this.token}`; } // This handler cannot handle 401 canHandleAuthentication() { return false; } handleAuthentication() { return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } }; // node_modules/@actions/core/lib/oidc-utils.js var __awaiter3 = function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); }); } return new (P || (P = Promise))(function(resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e5) { reject(e5); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e5) { reject(e5); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var OidcClient = class _OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { allowRetries: allowRetry, maxRetries: maxRetry }; return new HttpClient("actions/oidc-client", [new BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); } static getRequestToken() { const token = process.env["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]; if (!token) { throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable"); } return token; } static getIDTokenUrl() { const runtimeUrl = process.env["ACTIONS_ID_TOKEN_REQUEST_URL"]; if (!runtimeUrl) { throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable"); } return runtimeUrl; } static getCall(id_token_url) { return __awaiter3(this, void 0, void 0, function* () { var _a2; const httpclient = _OidcClient.createHttpClient(); const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. Error Code : ${error3.statusCode} Error Message: ${error3.message}`); }); const id_token = (_a2 = res.result) === null || _a2 === void 0 ? void 0 : _a2.value; if (!id_token) { throw new Error("Response json body do not have ID Token field"); } return id_token; }); } static getIDToken(audience) { return __awaiter3(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { const encodedAudience = encodeURIComponent(audience); id_token_url = `${id_token_url}&audience=${encodedAudience}`; } debug(`ID token url is ${id_token_url}`); const id_token = yield _OidcClient.getCall(id_token_url); setSecret(id_token); return id_token; } catch (error3) { throw new Error(`Error message: ${error3.message}`); } }); } }; // node_modules/@actions/core/lib/summary.js var import_os = require("os"); var import_fs = require("fs"); var __awaiter4 = function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); }); } return new (P || (P = Promise))(function(resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e5) { reject(e5); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e5) { reject(e5); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var { access, appendFile, writeFile } = import_fs.promises; var SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY"; var Summary = class { constructor() { this._buffer = ""; } /** * Finds the summary file path from the environment, rejects if env var is not found or file does not exist * Also checks r/w permissions. * * @returns step summary file path */ filePath() { return __awaiter4(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } const pathFromEnv = process.env[SUMMARY_ENV_VAR]; if (!pathFromEnv) { throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); } try { yield access(pathFromEnv, import_fs.constants.R_OK | import_fs.constants.W_OK); } catch (_a2) { throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } this._filePath = pathFromEnv; return this._filePath; }); } /** * Wraps content in an HTML tag, adding any HTML attributes * * @param {string} tag HTML tag to wrap * @param {string | null} content content within the tag * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add * * @returns {string} content wrapped in HTML element */ wrap(tag2, content, attrs = {}) { const htmlAttrs = Object.entries(attrs).map(([key, value]) => ` ${key}="${value}"`).join(""); if (!content) { return `<${tag2}${htmlAttrs}>`; } return `<${tag2}${htmlAttrs}>${content}`; } /** * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. * * @param {SummaryWriteOptions} [options] (optional) options for write operation * * @returns {Promise} summary instance */ write(options) { return __awaiter4(this, void 0, void 0, function* () { const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); const filePath = yield this.filePath(); const writeFunc = overwrite ? writeFile : appendFile; yield writeFunc(filePath, this._buffer, { encoding: "utf8" }); return this.emptyBuffer(); }); } /** * Clears the summary buffer and wipes the summary file * * @returns {Summary} summary instance */ clear() { return __awaiter4(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } /** * Returns the current summary buffer as a string * * @returns {string} string of summary buffer */ stringify() { return this._buffer; } /** * If the summary buffer is empty * * @returns {boolen} true if the buffer is empty */ isEmptyBuffer() { return this._buffer.length === 0; } /** * Resets the summary buffer without writing to summary file * * @returns {Summary} summary instance */ emptyBuffer() { this._buffer = ""; return this; } /** * Adds raw text to the summary buffer * * @param {string} text content to add * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) * * @returns {Summary} summary instance */ addRaw(text, addEOL = false) { this._buffer += text; return addEOL ? this.addEOL() : this; } /** * Adds the operating system-specific end-of-line marker to the buffer * * @returns {Summary} summary instance */ addEOL() { return this.addRaw(import_os.EOL); } /** * Adds an HTML codeblock to the summary buffer * * @param {string} code content to render within fenced code block * @param {string} lang (optional) language to syntax highlight code * * @returns {Summary} summary instance */ addCodeBlock(code, lang) { const attrs = Object.assign({}, lang && { lang }); const element = this.wrap("pre", this.wrap("code", code), attrs); return this.addRaw(element).addEOL(); } /** * Adds an HTML list to the summary buffer * * @param {string[]} items list of items to render * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) * * @returns {Summary} summary instance */ addList(items, ordered = false) { const tag2 = ordered ? "ol" : "ul"; const listItems = items.map((item) => this.wrap("li", item)).join(""); const element = this.wrap(tag2, listItems); return this.addRaw(element).addEOL(); } /** * Adds an HTML table to the summary buffer * * @param {SummaryTableCell[]} rows table rows * * @returns {Summary} summary instance */ addTable(rows) { const tableBody = rows.map((row) => { const cells = row.map((cell) => { if (typeof cell === "string") { return this.wrap("td", cell); } const { header, data: data3, colspan, rowspan } = cell; const tag2 = header ? "th" : "td"; const attrs = Object.assign(Object.assign({}, colspan && { colspan }), rowspan && { rowspan }); return this.wrap(tag2, data3, attrs); }).join(""); return this.wrap("tr", cells); }).join(""); const element = this.wrap("table", tableBody); return this.addRaw(element).addEOL(); } /** * Adds a collapsable HTML details element to the summary buffer * * @param {string} label text for the closed state * @param {string} content collapsable content * * @returns {Summary} summary instance */ addDetails(label, content) { const element = this.wrap("details", this.wrap("summary", label) + content); return this.addRaw(element).addEOL(); } /** * Adds an HTML image tag to the summary buffer * * @param {string} src path to the image you to embed * @param {string} alt text description of the image * @param {SummaryImageOptions} options (optional) addition image attributes * * @returns {Summary} summary instance */ addImage(src, alt, options) { const { width, height } = options || {}; const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); return this.addRaw(element).addEOL(); } /** * Adds an HTML section heading element * * @param {string} text heading text * @param {number | string} [level=1] (optional) the heading level, default: 1 * * @returns {Summary} summary instance */ addHeading(text, level) { const tag2 = `h${level}`; const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag2) ? tag2 : "h1"; const element = this.wrap(allowedTag, text); return this.addRaw(element).addEOL(); } /** * Adds an HTML thematic break (
) to the summary buffer * * @returns {Summary} summary instance */ addSeparator() { const element = this.wrap("hr", null); return this.addRaw(element).addEOL(); } /** * Adds an HTML line break (
) to the summary buffer * * @returns {Summary} summary instance */ addBreak() { const element = this.wrap("br", null); return this.addRaw(element).addEOL(); } /** * Adds an HTML blockquote to the summary buffer * * @param {string} text quote text * @param {string} cite (optional) citation url * * @returns {Summary} summary instance */ addQuote(text, cite) { const attrs = Object.assign({}, cite && { cite }); const element = this.wrap("blockquote", text, attrs); return this.addRaw(element).addEOL(); } /** * Adds an HTML anchor tag to the summary buffer * * @param {string} text link text/content * @param {string} href hyperlink * * @returns {Summary} summary instance */ addLink(text, href) { const element = this.wrap("a", text, { href }); return this.addRaw(element).addEOL(); } }; var _summary = new Summary(); // node_modules/@actions/core/lib/platform.js var import_os2 = __toESM(require("os"), 1); // node_modules/@actions/io/lib/io-util.js var fs2 = __toESM(require("fs"), 1); var { chmod, copyFile, lstat, mkdir, open, readdir, rename, rm, rmdir, stat, symlink, unlink } = fs2.promises; var IS_WINDOWS = process.platform === "win32"; var READONLY = fs2.constants.O_RDONLY; // node_modules/@actions/exec/lib/toolrunner.js var IS_WINDOWS2 = process.platform === "win32"; // node_modules/@actions/core/lib/platform.js var platform = import_os2.default.platform(); var arch = import_os2.default.arch(); // node_modules/@actions/core/lib/core.js var __awaiter5 = function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve) { resolve(value); }); } return new (P || (P = Promise))(function(resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e5) { reject(e5); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e5) { reject(e5); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var ExitCode; (function(ExitCode2) { ExitCode2[ExitCode2["Success"] = 0] = "Success"; ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; })(ExitCode || (ExitCode = {})); function exportVariable(name, val) { const convertedVal = toCommandValue(val); process.env[name] = convertedVal; const filePath = process.env["GITHUB_ENV"] || ""; if (filePath) { return issueFileCommand("ENV", prepareKeyValueMessage(name, val)); } issueCommand("set-env", { name }, convertedVal); } function setSecret(secret) { issueCommand("add-mask", {}, secret); } function getInput(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; if (options && options.required && !val) { throw new Error(`Input required and not supplied: ${name}`); } if (options && options.trimWhitespace === false) { return val; } return val.trim(); } function getMultilineInput(name, options) { const inputs = getInput(name, options).split("\n").filter((x) => x !== ""); if (options && options.trimWhitespace === false) { return inputs; } return inputs.map((input) => input.trim()); } function setOutput(name, value) { const filePath = process.env["GITHUB_OUTPUT"] || ""; if (filePath) { return issueFileCommand("OUTPUT", prepareKeyValueMessage(name, value)); } process.stdout.write(os4.EOL); issueCommand("set-output", { name }, toCommandValue(value)); } function setFailed(message) { process.exitCode = ExitCode.Failure; error(message); } function debug(message) { issueCommand("debug", {}, message); } function error(message, properties = {}) { issueCommand("error", toCommandProperties(properties), message instanceof Error ? message.toString() : message); } function warning(message, properties = {}) { issueCommand("warning", toCommandProperties(properties), message instanceof Error ? message.toString() : message); } function notice(message, properties = {}) { issueCommand("notice", toCommandProperties(properties), message instanceof Error ? message.toString() : message); } function info(message) { process.stdout.write(message + os4.EOL); } function getIDToken(aud) { return __awaiter5(this, void 0, void 0, function* () { return yield OidcClient.getIDToken(aud); }); } // src/assumeRole.ts var import_node_assert = __toESM(require("node:assert")); var import_node_fs = __toESM(require("node:fs")); var import_node_path = __toESM(require("node:path")); var import_client_sts2 = __toESM(require_dist_cjs56()); // src/helpers.ts var import_client_sts = __toESM(require_dist_cjs56()); var MAX_TAG_VALUE_LENGTH = 256; var SANITIZATION_CHARACTER = "_"; var SPECIAL_CHARS_REGEX = /[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]+/; function translateEnvVariables() { const envVars = [ "AWS_REGION", "ROLE_TO_ASSUME", "WEB_IDENTITY_TOKEN_FILE", "ROLE_CHAINING", "AUDIENCE", "HTTP_PROXY", "MASK_AWS_ACCOUNT_ID", "ROLE_DURATION_SECONDS", "ROLE_EXTERNAL_ID", "ROLE_SESSION_NAME", "ROLE_SKIP_SESSION_TAGGING", "TRANSITIVE_TAG_KEYS", "INLINE_SESSION_POLICY", "MANAGED_SESSION_POLICIES", "OUTPUT_CREDENTIALS", "UNSET_CURRENT_CREDENTIALS", "DISABLE_RETRY", "RETRY_MAX_ATTEMPTS", "SPECIAL_CHARACTERS_WORKAROUND", "USE_EXISTING_CREDENTIALS", "NO_PROXY", "OVERWRITE_AWS_PROFILE" ]; if (process.env.HTTPS_PROXY) process.env.HTTP_PROXY = process.env.HTTPS_PROXY; for (const envVar of envVars) { if (process.env[envVar]) { const inputKey = `INPUT_${envVar.replace(/_/g, "-")}`; process.env[inputKey] = process.env[inputKey] || process.env[envVar]; } } } function exportCredentials(creds, outputCredentials, outputEnvCredentials) { if (creds?.AccessKeyId) { setSecret(creds.AccessKeyId); } if (creds?.SecretAccessKey) { setSecret(creds.SecretAccessKey); } if (creds?.SessionToken) { setSecret(creds.SessionToken); } if (outputEnvCredentials) { if (creds?.AccessKeyId) { exportVariable("AWS_ACCESS_KEY_ID", creds.AccessKeyId); } if (creds?.SecretAccessKey) { exportVariable("AWS_SECRET_ACCESS_KEY", creds.SecretAccessKey); } if (creds?.SessionToken) { exportVariable("AWS_SESSION_TOKEN", creds.SessionToken); } else if (process.env.AWS_SESSION_TOKEN) { exportVariable("AWS_SESSION_TOKEN", ""); } } if (outputCredentials) { if (creds?.AccessKeyId) { setOutput("aws-access-key-id", creds.AccessKeyId); } if (creds?.SecretAccessKey) { setOutput("aws-secret-access-key", creds.SecretAccessKey); } if (creds?.SessionToken) { setOutput("aws-session-token", creds.SessionToken); } if (creds?.Expiration) { setOutput("aws-expiration", creds.Expiration); } } } function unsetCredentials(outputEnvCredentials) { if (outputEnvCredentials) { exportVariable("AWS_ACCESS_KEY_ID", ""); exportVariable("AWS_SECRET_ACCESS_KEY", ""); exportVariable("AWS_SESSION_TOKEN", ""); exportVariable("AWS_REGION", ""); exportVariable("AWS_DEFAULT_REGION", ""); } } function exportRegion(region, outputEnvCredentials) { if (outputEnvCredentials) { exportVariable("AWS_DEFAULT_REGION", region); exportVariable("AWS_REGION", region); } } async function getCallerIdentity(client) { const identity = await client.send(new import_client_sts.GetCallerIdentityCommand({})); if (!identity.Account || !identity.Arn) { throw new Error("Could not get Account ID or ARN from STS. Did you set credentials?"); } const result = { Account: identity.Account, Arn: identity.Arn }; if (identity.UserId !== void 0) { result.UserId = identity.UserId; } return result; } async function exportAccountId(credentialsClient, maskAccountId) { const identity = await getCallerIdentity(credentialsClient.stsClient); const accountId = identity.Account; const arn = identity.Arn; if (maskAccountId) { setSecret(accountId); setSecret(arn); } setOutput("aws-account-id", accountId); setOutput("authenticated-arn", arn); return accountId; } function sanitizeGitHubVariables(name) { const nameWithoutSpecialCharacters = name.replace(/[^\p{L}\p{Z}\p{N}_.:/=+\-@]/gu, SANITIZATION_CHARACTER); const nameTruncated = nameWithoutSpecialCharacters.slice(0, MAX_TAG_VALUE_LENGTH); return nameTruncated; } async function defaultSleep(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); } var sleep = defaultSleep; function verifyKeys(creds) { if (!creds) { return false; } if (creds.AccessKeyId) { if (SPECIAL_CHARS_REGEX.test(creds.AccessKeyId)) { debug("AccessKeyId contains special characters."); return false; } } if (creds.SecretAccessKey) { if (SPECIAL_CHARS_REGEX.test(creds.SecretAccessKey)) { debug("SecretAccessKey contains special characters."); return false; } } return true; } async function retryAndBackoff(fn, isRetryable, maxRetries = 12, retries = 0, base = 50) { try { return await fn(); } catch (err) { if (!isRetryable) { debug(`retryAndBackoff: error is not retryable: ${errorMessage(err)}`); throw err; } const delay = Math.random() * (2 ** retries * base); const nextRetry = retries + 1; debug( `retryAndBackoff: attempt ${nextRetry} of ${maxRetries} failed: ${errorMessage(err)}. Retrying after ${Math.floor(delay)}ms.` ); await sleep(delay); if (nextRetry >= maxRetries) { debug("retryAndBackoff: reached max retries; giving up."); throw err; } return await retryAndBackoff(fn, isRetryable, maxRetries, nextRetry, base); } } function errorMessage(error3) { return error3 instanceof Error ? error3.message : String(error3); } function isDefined(i5) { return i5 !== void 0 && i5 !== null; } async function areCredentialsValid(credentialsClient) { const client = credentialsClient.stsClient; try { const identity = await client.send(new import_client_sts.GetCallerIdentityCommand({})); if (identity.Account) { return true; } return false; } catch (_) { return false; } } function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; const optionsWithoutDefault = { ...options }; delete optionsWithoutDefault.default; const val = getInput(name, optionsWithoutDefault); if (trueValue.includes(val)) return true; if (falseValue.includes(val)) return false; if (val === "") return options?.default ?? false; throw new TypeError( `Input does not meet YAML 1.2 "Core Schema" specification: ${name} Support boolean input list: \`true | True | TRUE | false | False | FALSE\`` ); } // src/assumeRole.ts async function assumeRoleWithOIDC(params, client, webIdentityToken) { delete params.Tags; delete params.TransitiveTagKeys; info("Assuming role with OIDC"); try { const creds = await client.send( new import_client_sts2.AssumeRoleWithWebIdentityCommand({ ...params, WebIdentityToken: webIdentityToken }) ); return creds; } catch (error3) { throw new Error(`Could not assume role with OIDC: ${errorMessage(error3)}`); } } async function assumeRoleWithWebIdentityTokenFile(params, client, webIdentityTokenFile, workspace) { debug( "webIdentityTokenFile provided. Will call sts:AssumeRoleWithWebIdentity and take session tags from token contents." ); const webIdentityTokenFilePath = import_node_path.default.isAbsolute(webIdentityTokenFile) ? webIdentityTokenFile : import_node_path.default.join(workspace, webIdentityTokenFile); if (!import_node_fs.default.existsSync(webIdentityTokenFilePath)) { throw new Error(`Web identity token file does not exist: ${webIdentityTokenFilePath}`); } info("Assuming role with web identity token file"); try { const webIdentityToken = import_node_fs.default.readFileSync(webIdentityTokenFilePath, "utf8"); delete params.Tags; const creds = await client.send( new import_client_sts2.AssumeRoleWithWebIdentityCommand({ ...params, WebIdentityToken: webIdentityToken }) ); return creds; } catch (error3) { throw new Error(`Could not assume role with web identity token file: ${errorMessage(error3)}`); } } async function assumeRoleWithCredentials(params, client) { info("Assuming role with user credentials"); try { const creds = await client.send(new import_client_sts2.AssumeRoleCommand({ ...params })); return creds; } catch (error3) { throw new Error(`Could not assume role with user credentials: ${errorMessage(error3)}`); } } var TAG_KEY_REGEX = /^[\p{L}\p{Z}\p{N}_.:/=+\-@]+$/u; var TAG_VALUE_REGEX = /^[\p{L}\p{Z}\p{N}_.:/=+\-@]*$/u; var MAX_TAG_KEY_LENGTH = 128; var MAX_TAG_VALUE_LENGTH2 = 256; var MAX_SESSION_TAGS = 50; function parseAndValidateCustomTags(customTags, existingTags) { let parsed; try { parsed = JSON.parse(customTags); } catch { throw new Error("custom-tags: input is not valid JSON"); } if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) { throw new Error("custom-tags: input must be a JSON object (not an array or primitive)"); } const reservedKeys = new Set(existingTags.map((tag2) => tag2.Key)); const newTags = []; for (const [key, value] of Object.entries(parsed)) { if (typeof value === "object") { throw new Error( `custom-tags: value for key '${key}' must be a string, number, or boolean (not an object or array)` ); } const stringValue = String(value); if (key.length === 0 || key.length > MAX_TAG_KEY_LENGTH) { throw new Error(`custom-tags: key '${key}' must be between 1 and ${MAX_TAG_KEY_LENGTH} characters`); } if (stringValue.length > MAX_TAG_VALUE_LENGTH2) { throw new Error( `custom-tags: value for key '${key}' exceeds maximum length of ${MAX_TAG_VALUE_LENGTH2} characters` ); } if (!TAG_KEY_REGEX.test(key)) { throw new Error( `custom-tags: key '${key}' contains invalid characters. Allowed: unicode letters, digits, spaces, and _.:/=+-@` ); } if (stringValue.length > 0 && !TAG_VALUE_REGEX.test(stringValue)) { throw new Error( `custom-tags: value for key '${key}' contains invalid characters. Allowed: unicode letters, digits, spaces, and _.:/=+-@` ); } if (reservedKeys.has(key)) { throw new Error( `custom-tags: key '${key}' conflicts with a default session tag set by this action and cannot be overridden` ); } newTags.push({ Key: key, Value: stringValue }); } if (existingTags.length + newTags.length > MAX_SESSION_TAGS) { throw new Error( `custom-tags: total session tags (${existingTags.length + newTags.length}) would exceed the AWS limit of ${MAX_SESSION_TAGS}` ); } return newTags; } async function assumeRole(params) { const { credentialsClient, sourceAccountId, roleToAssume, roleExternalId, roleDuration, roleSessionName, roleSkipSessionTagging, transitiveTagKeys, webIdentityTokenFile, webIdentityToken, inlineSessionPolicy, managedSessionPolicies, customTags } = { ...params }; const { GITHUB_REPOSITORY, GITHUB_WORKFLOW, GITHUB_ACTION, GITHUB_ACTOR, GITHUB_SHA, GITHUB_WORKSPACE } = process.env; if (!GITHUB_REPOSITORY || !GITHUB_WORKFLOW || !GITHUB_ACTION || !GITHUB_ACTOR || !GITHUB_SHA || !GITHUB_WORKSPACE) { throw new Error("Missing required environment variables. Are you running in GitHub Actions?"); } const tagArray = [ { Key: "GitHub", Value: "Actions" }, { Key: "Repository", Value: GITHUB_REPOSITORY }, { Key: "Workflow", Value: sanitizeGitHubVariables(GITHUB_WORKFLOW) }, { Key: "Action", Value: GITHUB_ACTION }, { Key: "Actor", Value: sanitizeGitHubVariables(GITHUB_ACTOR) }, { Key: "Commit", Value: GITHUB_SHA } ]; if (process.env.GITHUB_REF) { tagArray.push({ Key: "Branch", Value: sanitizeGitHubVariables(process.env.GITHUB_REF) }); } if (customTags) { const parsed = parseAndValidateCustomTags(customTags, tagArray); tagArray.push(...parsed); } const tags = roleSkipSessionTagging ? void 0 : tagArray; if (!tags) { debug("Role session tagging has been skipped."); } else { debug(`${tags.length} role session tags are being used:`); } const transitiveTagKeysArray = roleSkipSessionTagging ? void 0 : transitiveTagKeys?.filter((key) => tags?.some((tag2) => tag2.Key === key)); let roleArn = roleToAssume; if (!roleArn.startsWith("arn:aws")) { (0, import_node_assert.default)( isDefined(sourceAccountId), "Source Account ID is needed if the Role Name is provided and not the Role Arn." ); roleArn = `arn:aws:iam::${sourceAccountId}:role/${roleArn}`; } const commonAssumeRoleParams = { RoleArn: roleArn, RoleSessionName: roleSessionName, DurationSeconds: roleDuration, Tags: tags ? tags : void 0, TransitiveTagKeys: transitiveTagKeysArray ? transitiveTagKeysArray : void 0, ExternalId: roleExternalId ? roleExternalId : void 0, Policy: inlineSessionPolicy ? inlineSessionPolicy : void 0, PolicyArns: managedSessionPolicies?.length ? managedSessionPolicies : void 0 }; const keys = Object.keys(commonAssumeRoleParams); keys.forEach((k5) => { if (commonAssumeRoleParams[k5] === void 0) { delete commonAssumeRoleParams[k5]; } }); const stsClient = credentialsClient.stsClient; if (!!webIdentityToken) { return assumeRoleWithOIDC(commonAssumeRoleParams, stsClient, webIdentityToken); } if (!!webIdentityTokenFile) { return assumeRoleWithWebIdentityTokenFile( commonAssumeRoleParams, stsClient, webIdentityTokenFile, GITHUB_WORKSPACE ); } return assumeRoleWithCredentials(commonAssumeRoleParams, stsClient); } // src/CredentialsClient.ts var import_client_sts3 = __toESM(require_dist_cjs56()); var import_node_http_handler5 = __toESM(require_dist_cjs13()); // node_modules/proxy-agent/dist/index.js var http5 = __toESM(require("http"), 1); var https4 = __toESM(require("https"), 1); var import_url9 = require("url"); // node_modules/proxy-agent/node_modules/lru-cache/index.mjs var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date; var hasAbortController = typeof AbortController === "function"; var AC = hasAbortController ? AbortController : class AbortController2 { constructor() { this.signal = new AS(); } abort(reason = new Error("This operation was aborted")) { this.signal.reason = this.signal.reason || reason; this.signal.aborted = true; this.signal.dispatchEvent({ type: "abort", target: this.signal }); } }; var hasAbortSignal = typeof AbortSignal === "function"; var hasACAbortSignal = typeof AC.AbortSignal === "function"; var AS = hasAbortSignal ? AbortSignal : hasACAbortSignal ? AC.AbortController : class AbortSignal2 { constructor() { this.reason = void 0; this.aborted = false; this._listeners = []; } dispatchEvent(e5) { if (e5.type === "abort") { this.aborted = true; this.onabort(e5); this._listeners.forEach((f5) => f5(e5), this); } } onabort() { } addEventListener(ev, fn) { if (ev === "abort") { this._listeners.push(fn); } } removeEventListener(ev, fn) { if (ev === "abort") { this._listeners = this._listeners.filter((f5) => f5 !== fn); } } }; var warned = /* @__PURE__ */ new Set(); var deprecatedOption = (opt, instead) => { const code = `LRU_CACHE_OPTION_${opt}`; if (shouldWarn(code)) { warn(code, `${opt} option`, `options.${instead}`, LRUCache); } }; var deprecatedMethod = (method, instead) => { const code = `LRU_CACHE_METHOD_${method}`; if (shouldWarn(code)) { const { prototype } = LRUCache; const { get: get2 } = Object.getOwnPropertyDescriptor(prototype, method); warn(code, `${method} method`, `cache.${instead}()`, get2); } }; var deprecatedProperty = (field, instead) => { const code = `LRU_CACHE_PROPERTY_${field}`; if (shouldWarn(code)) { const { prototype } = LRUCache; const { get: get2 } = Object.getOwnPropertyDescriptor(prototype, field); warn(code, `${field} property`, `cache.${instead}`, get2); } }; var emitWarning = (...a5) => { typeof process === "object" && process && typeof process.emitWarning === "function" ? process.emitWarning(...a5) : console.error(...a5); }; var shouldWarn = (code) => !warned.has(code); var warn = (code, what, instead, fn) => { warned.add(code); const msg = `The ${what} is deprecated. Please use ${instead} instead.`; emitWarning(msg, "DeprecationWarning", code, fn); }; var isPosInt = (n3) => n3 && n3 === Math.floor(n3) && n3 > 0 && isFinite(n3); var getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null; var ZeroArray = class extends Array { constructor(size) { super(size); this.fill(0); } }; var Stack = class { constructor(max) { if (max === 0) { return []; } const UintArray = getUintArray(max); this.heap = new UintArray(max); this.length = 0; } push(n3) { this.heap[this.length++] = n3; } pop() { return this.heap[--this.length]; } }; var LRUCache = class _LRUCache { constructor(options = {}) { const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, fetchContext, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options; const { length, maxAge, stale } = options instanceof _LRUCache ? {} : options; if (max !== 0 && !isPosInt(max)) { throw new TypeError("max option must be a nonnegative integer"); } const UintArray = max ? getUintArray(max) : Array; if (!UintArray) { throw new Error("invalid max value: " + max); } this.max = max; this.maxSize = maxSize; this.maxEntrySize = maxEntrySize || this.maxSize; this.sizeCalculation = sizeCalculation || length; if (this.sizeCalculation) { if (!this.maxSize && !this.maxEntrySize) { throw new TypeError( "cannot set sizeCalculation without setting maxSize or maxEntrySize" ); } if (typeof this.sizeCalculation !== "function") { throw new TypeError("sizeCalculation set to non-function"); } } this.fetchMethod = fetchMethod || null; if (this.fetchMethod && typeof this.fetchMethod !== "function") { throw new TypeError( "fetchMethod must be a function if specified" ); } this.fetchContext = fetchContext; if (!this.fetchMethod && fetchContext !== void 0) { throw new TypeError( "cannot set fetchContext without fetchMethod" ); } this.keyMap = /* @__PURE__ */ new Map(); this.keyList = new Array(max).fill(null); this.valList = new Array(max).fill(null); this.next = new UintArray(max); this.prev = new UintArray(max); this.head = 0; this.tail = 0; this.free = new Stack(max); this.initialFill = 1; this.size = 0; if (typeof dispose === "function") { this.dispose = dispose; } if (typeof disposeAfter === "function") { this.disposeAfter = disposeAfter; this.disposed = []; } else { this.disposeAfter = null; this.disposed = null; } this.noDisposeOnSet = !!noDisposeOnSet; this.noUpdateTTL = !!noUpdateTTL; this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; this.ignoreFetchAbort = !!ignoreFetchAbort; if (this.maxEntrySize !== 0) { if (this.maxSize !== 0) { if (!isPosInt(this.maxSize)) { throw new TypeError( "maxSize must be a positive integer if specified" ); } } if (!isPosInt(this.maxEntrySize)) { throw new TypeError( "maxEntrySize must be a positive integer if specified" ); } this.initializeSizeTracking(); } this.allowStale = !!allowStale || !!stale; this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; this.updateAgeOnGet = !!updateAgeOnGet; this.updateAgeOnHas = !!updateAgeOnHas; this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; this.ttlAutopurge = !!ttlAutopurge; this.ttl = ttl || maxAge || 0; if (this.ttl) { if (!isPosInt(this.ttl)) { throw new TypeError( "ttl must be a positive integer if specified" ); } this.initializeTTLTracking(); } if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) { throw new TypeError( "At least one of max, maxSize, or ttl is required" ); } if (!this.ttlAutopurge && !this.max && !this.maxSize) { const code = "LRU_CACHE_UNBOUNDED"; if (shouldWarn(code)) { warned.add(code); const msg = "TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption."; emitWarning(msg, "UnboundedCacheWarning", code, _LRUCache); } } if (stale) { deprecatedOption("stale", "allowStale"); } if (maxAge) { deprecatedOption("maxAge", "ttl"); } if (length) { deprecatedOption("length", "sizeCalculation"); } } getRemainingTTL(key) { return this.has(key, { updateAgeOnHas: false }) ? Infinity : 0; } initializeTTLTracking() { this.ttls = new ZeroArray(this.max); this.starts = new ZeroArray(this.max); this.setItemTTL = (index, ttl, start = perf.now()) => { this.starts[index] = ttl !== 0 ? start : 0; this.ttls[index] = ttl; if (ttl !== 0 && this.ttlAutopurge) { const t = setTimeout(() => { if (this.isStale(index)) { this.delete(this.keyList[index]); } }, ttl + 1); if (t.unref) { t.unref(); } } }; this.updateItemAge = (index) => { this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0; }; this.statusTTL = (status, index) => { if (status) { status.ttl = this.ttls[index]; status.start = this.starts[index]; status.now = cachedNow || getNow(); status.remainingTTL = status.now + status.ttl - status.start; } }; let cachedNow = 0; const getNow = () => { const n3 = perf.now(); if (this.ttlResolution > 0) { cachedNow = n3; const t = setTimeout( () => cachedNow = 0, this.ttlResolution ); if (t.unref) { t.unref(); } } return n3; }; this.getRemainingTTL = (key) => { const index = this.keyMap.get(key); if (index === void 0) { return 0; } return this.ttls[index] === 0 || this.starts[index] === 0 ? Infinity : this.starts[index] + this.ttls[index] - (cachedNow || getNow()); }; this.isStale = (index) => { return this.ttls[index] !== 0 && this.starts[index] !== 0 && (cachedNow || getNow()) - this.starts[index] > this.ttls[index]; }; } updateItemAge(_index) { } statusTTL(_status, _index) { } setItemTTL(_index, _ttl, _start) { } isStale(_index) { return false; } initializeSizeTracking() { this.calculatedSize = 0; this.sizes = new ZeroArray(this.max); this.removeItemSize = (index) => { this.calculatedSize -= this.sizes[index]; this.sizes[index] = 0; }; this.requireSize = (k5, v, size, sizeCalculation) => { if (this.isBackgroundFetch(v)) { return 0; } if (!isPosInt(size)) { if (sizeCalculation) { if (typeof sizeCalculation !== "function") { throw new TypeError("sizeCalculation must be a function"); } size = sizeCalculation(v, k5); if (!isPosInt(size)) { throw new TypeError( "sizeCalculation return invalid (expect positive integer)" ); } } else { throw new TypeError( "invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set." ); } } return size; }; this.addItemSize = (index, size, status) => { this.sizes[index] = size; if (this.maxSize) { const maxSize = this.maxSize - this.sizes[index]; while (this.calculatedSize > maxSize) { this.evict(true); } } this.calculatedSize += this.sizes[index]; if (status) { status.entrySize = size; status.totalCalculatedSize = this.calculatedSize; } }; } removeItemSize(_index) { } addItemSize(_index, _size) { } requireSize(_k, _v, size, sizeCalculation) { if (size || sizeCalculation) { throw new TypeError( "cannot set size without setting maxSize or maxEntrySize on cache" ); } } *indexes({ allowStale = this.allowStale } = {}) { if (this.size) { for (let i5 = this.tail; true; ) { if (!this.isValidIndex(i5)) { break; } if (allowStale || !this.isStale(i5)) { yield i5; } if (i5 === this.head) { break; } else { i5 = this.prev[i5]; } } } } *rindexes({ allowStale = this.allowStale } = {}) { if (this.size) { for (let i5 = this.head; true; ) { if (!this.isValidIndex(i5)) { break; } if (allowStale || !this.isStale(i5)) { yield i5; } if (i5 === this.tail) { break; } else { i5 = this.next[i5]; } } } } isValidIndex(index) { return index !== void 0 && this.keyMap.get(this.keyList[index]) === index; } *entries() { for (const i5 of this.indexes()) { if (this.valList[i5] !== void 0 && this.keyList[i5] !== void 0 && !this.isBackgroundFetch(this.valList[i5])) { yield [this.keyList[i5], this.valList[i5]]; } } } *rentries() { for (const i5 of this.rindexes()) { if (this.valList[i5] !== void 0 && this.keyList[i5] !== void 0 && !this.isBackgroundFetch(this.valList[i5])) { yield [this.keyList[i5], this.valList[i5]]; } } } *keys() { for (const i5 of this.indexes()) { if (this.keyList[i5] !== void 0 && !this.isBackgroundFetch(this.valList[i5])) { yield this.keyList[i5]; } } } *rkeys() { for (const i5 of this.rindexes()) { if (this.keyList[i5] !== void 0 && !this.isBackgroundFetch(this.valList[i5])) { yield this.keyList[i5]; } } } *values() { for (const i5 of this.indexes()) { if (this.valList[i5] !== void 0 && !this.isBackgroundFetch(this.valList[i5])) { yield this.valList[i5]; } } } *rvalues() { for (const i5 of this.rindexes()) { if (this.valList[i5] !== void 0 && !this.isBackgroundFetch(this.valList[i5])) { yield this.valList[i5]; } } } [Symbol.iterator]() { return this.entries(); } find(fn, getOptions) { for (const i5 of this.indexes()) { const v = this.valList[i5]; const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === void 0) continue; if (fn(value, this.keyList[i5], this)) { return this.get(this.keyList[i5], getOptions); } } } forEach(fn, thisp = this) { for (const i5 of this.indexes()) { const v = this.valList[i5]; const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === void 0) continue; fn.call(thisp, value, this.keyList[i5], this); } } rforEach(fn, thisp = this) { for (const i5 of this.rindexes()) { const v = this.valList[i5]; const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === void 0) continue; fn.call(thisp, value, this.keyList[i5], this); } } get prune() { deprecatedMethod("prune", "purgeStale"); return this.purgeStale; } purgeStale() { let deleted = false; for (const i5 of this.rindexes({ allowStale: true })) { if (this.isStale(i5)) { this.delete(this.keyList[i5]); deleted = true; } } return deleted; } dump() { const arr = []; for (const i5 of this.indexes({ allowStale: true })) { const key = this.keyList[i5]; const v = this.valList[i5]; const value = this.isBackgroundFetch(v) ? v.__staleWhileFetching : v; if (value === void 0) continue; const entry = { value }; if (this.ttls) { entry.ttl = this.ttls[i5]; const age = perf.now() - this.starts[i5]; entry.start = Math.floor(Date.now() - age); } if (this.sizes) { entry.size = this.sizes[i5]; } arr.unshift([key, entry]); } return arr; } load(arr) { this.clear(); for (const [key, entry] of arr) { if (entry.start) { const age = Date.now() - entry.start; entry.start = perf.now() - age; } this.set(key, entry.value, entry); } } dispose(_v, _k, _reason) { } set(k5, v, { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, status } = {}) { size = this.requireSize(k5, v, size, sizeCalculation); if (this.maxEntrySize && size > this.maxEntrySize) { if (status) { status.set = "miss"; status.maxEntrySizeExceeded = true; } this.delete(k5); return this; } let index = this.size === 0 ? void 0 : this.keyMap.get(k5); if (index === void 0) { index = this.newIndex(); this.keyList[index] = k5; this.valList[index] = v; this.keyMap.set(k5, index); this.next[this.tail] = index; this.prev[index] = this.tail; this.tail = index; this.size++; this.addItemSize(index, size, status); if (status) { status.set = "add"; } noUpdateTTL = false; } else { this.moveToTail(index); const oldVal = this.valList[index]; if (v !== oldVal) { if (this.isBackgroundFetch(oldVal)) { oldVal.__abortController.abort(new Error("replaced")); } else { if (!noDisposeOnSet) { this.dispose(oldVal, k5, "set"); if (this.disposeAfter) { this.disposed.push([oldVal, k5, "set"]); } } } this.removeItemSize(index); this.valList[index] = v; this.addItemSize(index, size, status); if (status) { status.set = "replace"; const oldValue = oldVal && this.isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal; if (oldValue !== void 0) status.oldValue = oldValue; } } else if (status) { status.set = "update"; } } if (ttl !== 0 && this.ttl === 0 && !this.ttls) { this.initializeTTLTracking(); } if (!noUpdateTTL) { this.setItemTTL(index, ttl, start); } this.statusTTL(status, index); if (this.disposeAfter) { while (this.disposed.length) { this.disposeAfter(...this.disposed.shift()); } } return this; } newIndex() { if (this.size === 0) { return this.tail; } if (this.size === this.max && this.max !== 0) { return this.evict(false); } if (this.free.length !== 0) { return this.free.pop(); } return this.initialFill++; } pop() { if (this.size) { const val = this.valList[this.head]; this.evict(true); return val; } } evict(free) { const head = this.head; const k5 = this.keyList[head]; const v = this.valList[head]; if (this.isBackgroundFetch(v)) { v.__abortController.abort(new Error("evicted")); } else { this.dispose(v, k5, "evict"); if (this.disposeAfter) { this.disposed.push([v, k5, "evict"]); } } this.removeItemSize(head); if (free) { this.keyList[head] = null; this.valList[head] = null; this.free.push(head); } this.head = this.next[head]; this.keyMap.delete(k5); this.size--; return head; } has(k5, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) { const index = this.keyMap.get(k5); if (index !== void 0) { if (!this.isStale(index)) { if (updateAgeOnHas) { this.updateItemAge(index); } if (status) status.has = "hit"; this.statusTTL(status, index); return true; } else if (status) { status.has = "stale"; this.statusTTL(status, index); } } else if (status) { status.has = "miss"; } return false; } // like get(), but without any LRU updating or TTL expiration peek(k5, { allowStale = this.allowStale } = {}) { const index = this.keyMap.get(k5); if (index !== void 0 && (allowStale || !this.isStale(index))) { const v = this.valList[index]; return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v; } } backgroundFetch(k5, index, options, context) { const v = index === void 0 ? void 0 : this.valList[index]; if (this.isBackgroundFetch(v)) { return v; } const ac = new AC(); if (options.signal) { options.signal.addEventListener( "abort", () => ac.abort(options.signal.reason) ); } const fetchOpts = { signal: ac.signal, options, context }; const cb = (v2, updateCache = false) => { const { aborted } = ac.signal; const ignoreAbort = options.ignoreFetchAbort && v2 !== void 0; if (options.status) { if (aborted && !updateCache) { options.status.fetchAborted = true; options.status.fetchError = ac.signal.reason; if (ignoreAbort) options.status.fetchAbortIgnored = true; } else { options.status.fetchResolved = true; } } if (aborted && !ignoreAbort && !updateCache) { return fetchFail(ac.signal.reason); } if (this.valList[index] === p2) { if (v2 === void 0) { if (p2.__staleWhileFetching) { this.valList[index] = p2.__staleWhileFetching; } else { this.delete(k5); } } else { if (options.status) options.status.fetchUpdated = true; this.set(k5, v2, fetchOpts.options); } } return v2; }; const eb = (er) => { if (options.status) { options.status.fetchRejected = true; options.status.fetchError = er; } return fetchFail(er); }; const fetchFail = (er) => { const { aborted } = ac.signal; const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; const noDelete = allowStale || options.noDeleteOnFetchRejection; if (this.valList[index] === p2) { const del = !noDelete || p2.__staleWhileFetching === void 0; if (del) { this.delete(k5); } else if (!allowStaleAborted) { this.valList[index] = p2.__staleWhileFetching; } } if (allowStale) { if (options.status && p2.__staleWhileFetching !== void 0) { options.status.returnedStale = true; } return p2.__staleWhileFetching; } else if (p2.__returned === p2) { throw er; } }; const pcall = (res, rej) => { this.fetchMethod(k5, v, fetchOpts).then((v2) => res(v2), rej); ac.signal.addEventListener("abort", () => { if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { res(); if (options.allowStaleOnFetchAbort) { res = (v2) => cb(v2, true); } } }); }; if (options.status) options.status.fetchDispatched = true; const p2 = new Promise(pcall).then(cb, eb); p2.__abortController = ac; p2.__staleWhileFetching = v; p2.__returned = null; if (index === void 0) { this.set(k5, p2, { ...fetchOpts.options, status: void 0 }); index = this.keyMap.get(k5); } else { this.valList[index] = p2; } return p2; } isBackgroundFetch(p2) { return p2 && typeof p2 === "object" && typeof p2.then === "function" && Object.prototype.hasOwnProperty.call( p2, "__staleWhileFetching" ) && Object.prototype.hasOwnProperty.call(p2, "__returned") && (p2.__returned === p2 || p2.__returned === null); } // this takes the union of get() and set() opts, because it does both async fetch(k5, { // get options allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, // set options ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, // fetch exclusive options noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, fetchContext = this.fetchContext, forceRefresh = false, status, signal } = {}) { if (!this.fetchMethod) { if (status) status.fetch = "get"; return this.get(k5, { allowStale, updateAgeOnGet, noDeleteOnStaleGet, status }); } const options = { allowStale, updateAgeOnGet, noDeleteOnStaleGet, ttl, noDisposeOnSet, size, sizeCalculation, noUpdateTTL, noDeleteOnFetchRejection, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, status, signal }; let index = this.keyMap.get(k5); if (index === void 0) { if (status) status.fetch = "miss"; const p2 = this.backgroundFetch(k5, index, options, fetchContext); return p2.__returned = p2; } else { const v = this.valList[index]; if (this.isBackgroundFetch(v)) { const stale = allowStale && v.__staleWhileFetching !== void 0; if (status) { status.fetch = "inflight"; if (stale) status.returnedStale = true; } return stale ? v.__staleWhileFetching : v.__returned = v; } const isStale = this.isStale(index); if (!forceRefresh && !isStale) { if (status) status.fetch = "hit"; this.moveToTail(index); if (updateAgeOnGet) { this.updateItemAge(index); } this.statusTTL(status, index); return v; } const p2 = this.backgroundFetch(k5, index, options, fetchContext); const hasStale = p2.__staleWhileFetching !== void 0; const staleVal = hasStale && allowStale; if (status) { status.fetch = hasStale && isStale ? "stale" : "refresh"; if (staleVal && isStale) status.returnedStale = true; } return staleVal ? p2.__staleWhileFetching : p2.__returned = p2; } } get(k5, { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = {}) { const index = this.keyMap.get(k5); if (index !== void 0) { const value = this.valList[index]; const fetching = this.isBackgroundFetch(value); this.statusTTL(status, index); if (this.isStale(index)) { if (status) status.get = "stale"; if (!fetching) { if (!noDeleteOnStaleGet) { this.delete(k5); } if (status) status.returnedStale = allowStale; return allowStale ? value : void 0; } else { if (status) { status.returnedStale = allowStale && value.__staleWhileFetching !== void 0; } return allowStale ? value.__staleWhileFetching : void 0; } } else { if (status) status.get = "hit"; if (fetching) { return value.__staleWhileFetching; } this.moveToTail(index); if (updateAgeOnGet) { this.updateItemAge(index); } return value; } } else if (status) { status.get = "miss"; } } connect(p2, n3) { this.prev[n3] = p2; this.next[p2] = n3; } moveToTail(index) { if (index !== this.tail) { if (index === this.head) { this.head = this.next[index]; } else { this.connect(this.prev[index], this.next[index]); } this.connect(this.tail, index); this.tail = index; } } get del() { deprecatedMethod("del", "delete"); return this.delete; } delete(k5) { let deleted = false; if (this.size !== 0) { const index = this.keyMap.get(k5); if (index !== void 0) { deleted = true; if (this.size === 1) { this.clear(); } else { this.removeItemSize(index); const v = this.valList[index]; if (this.isBackgroundFetch(v)) { v.__abortController.abort(new Error("deleted")); } else { this.dispose(v, k5, "delete"); if (this.disposeAfter) { this.disposed.push([v, k5, "delete"]); } } this.keyMap.delete(k5); this.keyList[index] = null; this.valList[index] = null; if (index === this.tail) { this.tail = this.prev[index]; } else if (index === this.head) { this.head = this.next[index]; } else { this.next[this.prev[index]] = this.next[index]; this.prev[this.next[index]] = this.prev[index]; } this.size--; this.free.push(index); } } } if (this.disposed) { while (this.disposed.length) { this.disposeAfter(...this.disposed.shift()); } } return deleted; } clear() { for (const index of this.rindexes({ allowStale: true })) { const v = this.valList[index]; if (this.isBackgroundFetch(v)) { v.__abortController.abort(new Error("deleted")); } else { const k5 = this.keyList[index]; this.dispose(v, k5, "delete"); if (this.disposeAfter) { this.disposed.push([v, k5, "delete"]); } } } this.keyMap.clear(); this.valList.fill(null); this.keyList.fill(null); if (this.ttls) { this.ttls.fill(0); this.starts.fill(0); } if (this.sizes) { this.sizes.fill(0); } this.head = 0; this.tail = 0; this.initialFill = 1; this.free.length = 0; this.calculatedSize = 0; this.size = 0; if (this.disposed) { while (this.disposed.length) { this.disposeAfter(...this.disposed.shift()); } } } get reset() { deprecatedMethod("reset", "clear"); return this.clear; } get length() { deprecatedProperty("length", "size"); return this.size; } static get AbortController() { return AC; } static get AbortSignal() { return AS; } }; var lru_cache_default = LRUCache; // node_modules/proxy-agent/dist/index.js init_dist(); var import_debug15 = __toESM(require_src(), 1); // node_modules/proxy-from-env/index.js var DEFAULT_PORTS = { ftp: 21, gopher: 70, http: 80, https: 443, ws: 80, wss: 443 }; function parseUrl6(urlString) { try { return new URL(urlString); } catch { return null; } } function getProxyForUrl(url) { var parsedUrl = (typeof url === "string" ? parseUrl6(url) : url) || {}; var proto = parsedUrl.protocol; var hostname = parsedUrl.host; var port = parsedUrl.port; if (typeof hostname !== "string" || !hostname || typeof proto !== "string") { return ""; } proto = proto.split(":", 1)[0]; hostname = hostname.replace(/:\d*$/, ""); port = parseInt(port) || DEFAULT_PORTS[proto] || 0; if (!shouldProxy(hostname, port)) { return ""; } var proxy = getEnv(proto + "_proxy") || getEnv("all_proxy"); if (proxy && proxy.indexOf("://") === -1) { proxy = proto + "://" + proxy; } return proxy; } function shouldProxy(hostname, port) { var NO_PROXY = getEnv("no_proxy").toLowerCase(); if (!NO_PROXY) { return true; } if (NO_PROXY === "*") { return false; } return NO_PROXY.split(/[,\s]/).every(function(proxy) { if (!proxy) { return true; } var parsedProxy = proxy.match(/^(.+):(\d+)$/); var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; if (parsedProxyPort && parsedProxyPort !== port) { return true; } if (!/^[.*]/.test(parsedProxyHostname)) { return hostname !== parsedProxyHostname; } if (parsedProxyHostname.charAt(0) === "*") { parsedProxyHostname = parsedProxyHostname.slice(1); } return !hostname.endsWith(parsedProxyHostname); }); } function getEnv(key) { return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ""; } // node_modules/proxy-agent/dist/index.js var debug16 = (0, import_debug15.default)("proxy-agent"); var wellKnownAgents = { http: async () => (await Promise.resolve().then(() => (init_dist2(), dist_exports))).HttpProxyAgent, https: async () => (await Promise.resolve().then(() => (init_dist3(), dist_exports2))).HttpsProxyAgent, socks: async () => (await Promise.resolve().then(() => (init_dist4(), dist_exports3))).SocksProxyAgent, pac: async () => (await Promise.resolve().then(() => (init_dist13(), dist_exports7))).PacProxyAgent }; var proxies = { http: [wellKnownAgents.http, wellKnownAgents.https], https: [wellKnownAgents.http, wellKnownAgents.https], socks: [wellKnownAgents.socks, wellKnownAgents.socks], socks4: [wellKnownAgents.socks, wellKnownAgents.socks], socks4a: [wellKnownAgents.socks, wellKnownAgents.socks], socks5: [wellKnownAgents.socks, wellKnownAgents.socks], socks5h: [wellKnownAgents.socks, wellKnownAgents.socks], "pac+data": [wellKnownAgents.pac, wellKnownAgents.pac], "pac+file": [wellKnownAgents.pac, wellKnownAgents.pac], "pac+ftp": [wellKnownAgents.pac, wellKnownAgents.pac], "pac+http": [wellKnownAgents.pac, wellKnownAgents.pac], "pac+https": [wellKnownAgents.pac, wellKnownAgents.pac] }; function isValidProtocol2(v) { return Object.keys(proxies).includes(v); } var ProxyAgent2 = class extends Agent4 { constructor(opts) { super(opts); this.cache = new lru_cache_default({ max: 20, dispose: (agent) => agent.destroy() }); debug16("Creating new ProxyAgent instance: %o", opts); this.connectOpts = opts; this.httpAgent = opts?.httpAgent || new http5.Agent(opts); this.httpsAgent = opts?.httpsAgent || new https4.Agent(opts); this.getProxyForUrl = opts?.getProxyForUrl || getProxyForUrl; } async connect(req, opts) { const { secureEndpoint } = opts; const isWebSocket = req.getHeader("upgrade") === "websocket"; const protocol = secureEndpoint ? isWebSocket ? "wss:" : "https:" : isWebSocket ? "ws:" : "http:"; const host = req.getHeader("host"); const url = new import_url9.URL(req.path, `${protocol}//${host}`).href; const proxy = await this.getProxyForUrl(url, req); if (!proxy) { debug16("Proxy not enabled for URL: %o", url); return secureEndpoint ? this.httpsAgent : this.httpAgent; } debug16("Request URL: %o", url); debug16("Proxy URL: %o", proxy); const cacheKey = `${protocol}+${proxy}`; let agent = this.cache.get(cacheKey); if (!agent) { const proxyUrl = new import_url9.URL(proxy); const proxyProto = proxyUrl.protocol.replace(":", ""); if (!isValidProtocol2(proxyProto)) { throw new Error(`Unsupported protocol for proxy URL: ${proxy}`); } const ctor = await proxies[proxyProto][secureEndpoint || isWebSocket ? 1 : 0](); agent = new ctor(proxy, this.connectOpts); this.cache.set(cacheKey, agent); } else { debug16("Cache hit for proxy URL: %o", proxy); } return agent; } destroy() { for (const agent of this.cache.values()) { agent.destroy(); } super.destroy(); } }; // src/ProxyResolver.ts var DEFAULT_PORTS2 = { http: 80, https: 443 }; var ProxyResolver = class { constructor(options) { // This method matches the interface expected by 'proxy-agent'. It is an arrow function to bind 'this'. this.getProxyForUrl = (url, _req) => { return this.getProxyForUrlOptions(url, this.options); }; this.options = options; } getProxyForUrlOptions(url, options) { let parsedUrl; try { parsedUrl = typeof url === "string" ? new URL(url) : url; } catch (_) { return ""; } const proto = parsedUrl.protocol.split(":", 1)[0]; if (!proto) return ""; const hostname = parsedUrl.host; const port = parseInt(parsedUrl.port || "") || DEFAULT_PORTS2[proto] || 0; if (options?.noProxy && !this.shouldProxy(hostname, port, options.noProxy)) return ""; if (proto === "http" && options?.httpProxy) return options.httpProxy; if (proto === "https" && options?.httpsProxy) return options.httpsProxy; return ""; } shouldProxy(hostname, port, noProxy) { if (!noProxy) return true; if (noProxy === "*") return false; return noProxy.split(/[,\s]/).every((proxy) => { if (!proxy) return true; const parsedProxy = proxy.match(/^(.+):(\d+)$/); const parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; const parsedProxyPort = parsedProxy?.[2] ? parseInt(parsedProxy[2]) : 0; if (parsedProxyPort && parsedProxyPort !== port) return true; if (parsedProxyHostname && !/^[.*]/.test(parsedProxyHostname)) { return hostname !== parsedProxyHostname; } let cleanProxyHostname = parsedProxyHostname; if (parsedProxyHostname && parsedProxyHostname.charAt(0) === "*") { cleanProxyHostname = parsedProxyHostname.slice(1); } return !cleanProxyHostname || !hostname.endsWith(cleanProxyHostname); }); } }; // src/CredentialsClient.ts var USER_AGENT = "configure-aws-credentials-for-github-actions"; var CredentialsClient = class { constructor(props) { if (props.region !== void 0) { this.region = props.region; } if (props.proxyServer) { info("Configuring proxy handler for STS client"); const proxyOptions = { httpProxy: props.proxyServer, httpsProxy: props.proxyServer }; if (props.noProxy !== void 0) { proxyOptions.noProxy = props.noProxy; } const getProxyForUrl2 = new ProxyResolver(proxyOptions).getProxyForUrl; const handler = new ProxyAgent2({ getProxyForUrl: getProxyForUrl2 }); this.requestHandler = new import_node_http_handler5.NodeHttpHandler({ httpsAgent: handler, httpAgent: handler }); } if (props.stsEndpoint) { this.stsEndpoint = props.stsEndpoint; } this.roleChaining = props.roleChaining; } get stsClient() { if (!this._stsClient || this.roleChaining) { const config = { customUserAgent: USER_AGENT }; if (this.region !== void 0) config.region = this.region; if (this.stsEndpoint !== void 0) config.endpoint = this.stsEndpoint; if (this.requestHandler !== void 0) config.requestHandler = this.requestHandler; this._stsClient = new import_client_sts3.STSClient(config); } return this._stsClient; } async validateCredentials(expectedAccessKeyId, roleChaining, expectedAccountIds) { let credentials; try { credentials = await this.loadCredentials(); if (!credentials.accessKeyId) { throw new Error("Access key ID empty after loading credentials"); } } catch (error3) { throw new Error(`Credentials could not be loaded, please check your action inputs: ${errorMessage(error3)}`); } if (expectedAccountIds && expectedAccountIds.length > 0 && expectedAccountIds[0] !== "") { let callerIdentity; try { callerIdentity = await getCallerIdentity(this.stsClient); } catch (error3) { throw new Error(`Could not validate account ID of credentials: ${errorMessage(error3)}`); } if (!callerIdentity.Account || !expectedAccountIds.includes(callerIdentity.Account)) { throw new Error( `The account ID of the provided credentials (${callerIdentity.Account ?? "unknown"}) does not match any of the expected account IDs: ${expectedAccountIds.join(", ")}` ); } } if (!roleChaining) { const actualAccessKeyId = credentials.accessKeyId; if (expectedAccessKeyId && expectedAccessKeyId !== actualAccessKeyId) { throw new Error( "Credentials loaded by the SDK do not match the expected access key ID configured by the action" ); } } } async loadCredentials() { const config = {}; if (this.requestHandler !== void 0) config.requestHandler = this.requestHandler; const client = new import_client_sts3.STSClient(config); return client.config.credentials(); } }; // src/profileManager.ts var fs4 = __toESM(require("node:fs")); var os6 = __toESM(require("node:os")); var path2 = __toESM(require("node:path")); function parseIni(iniData) { const result = {}; let currentSection; for (const line of iniData.split(/\r?\n/)) { const trimmed = line.trim(); if (!trimmed || trimmed.startsWith(";") || trimmed.startsWith("#")) { continue; } const sectionMatch = trimmed.match(/^\[([^\]]*)\]$/); if (sectionMatch) { currentSection = sectionMatch[1]; if (currentSection === "__proto__") { currentSection = void 0; continue; } result[currentSection] = result[currentSection] || {}; continue; } if (currentSection) { const eqIndex = trimmed.indexOf("="); if (eqIndex > 0) { const key = trimmed.substring(0, eqIndex).trim(); const value = trimmed.substring(eqIndex + 1).trim(); if (key !== "__proto__") { const section = result[currentSection]; if (section) { section[key] = value; } } } } } return result; } function stringifyIni(data3) { const sections = []; for (const [sectionName, sectionData] of Object.entries(data3)) { const lines = [`[${sectionName}]`]; for (const [key, value] of Object.entries(sectionData)) { lines.push(`${key} = ${value}`); } sections.push(lines.join("\n")); } return `${sections.join("\n\n")} `; } function getProfileFilePaths() { const credentialsPath = process.env.AWS_SHARED_CREDENTIALS_FILE || path2.join(os6.homedir(), ".aws", "credentials"); const configPath = process.env.AWS_CONFIG_FILE || path2.join(os6.homedir(), ".aws", "config"); return { credentials: credentialsPath, config: configPath }; } function ensureAwsDirectoryExists(filePath) { const dir = path2.dirname(filePath); if (!fs4.existsSync(dir)) { debug(`Creating directory: ${dir}`); fs4.mkdirSync(dir, { recursive: true, mode: 448 }); } } function validateProfileName(profileName) { if (!profileName || profileName.trim() === "") { throw new Error("aws-profile must not be empty"); } if (/\s/.test(profileName)) { throw new Error("aws-profile must not contain whitespace"); } if (/[[\]]/.test(profileName)) { throw new Error("aws-profile must not contain brackets"); } if (profileName.includes("/") || profileName.includes("\\")) { throw new Error("aws-profile must not contain path separators"); } } function mergeProfileSection(filePath, sectionName, data3, overwriteAwsProfile) { let existingContent = {}; if (fs4.existsSync(filePath)) { debug(`Reading existing file: ${filePath}`); const fileContent = fs4.readFileSync(filePath, "utf-8"); existingContent = parseIni(fileContent); } if (existingContent[sectionName] && !overwriteAwsProfile) { throw new Error( `Profile with name "${sectionName}" already exists. Please use the overwrite-aws-profile input if you want to overwrite existing profiles.` ); } existingContent[sectionName] = data3; const content = stringifyIni(existingContent); debug(`Writing profile to ${filePath}`); fs4.writeFileSync(filePath, content, { mode: 384 }); } function writeProfileFiles(profileName, credentials, region, overwriteAwsProfile) { try { validateProfileName(profileName); const paths = getProfileFilePaths(); ensureAwsDirectoryExists(paths.credentials); ensureAwsDirectoryExists(paths.config); const credentialsData = {}; if (credentials.AccessKeyId) { credentialsData.aws_access_key_id = credentials.AccessKeyId; } if (credentials.SecretAccessKey) { credentialsData.aws_secret_access_key = credentials.SecretAccessKey; } if (credentials.SessionToken) { credentialsData.aws_session_token = credentials.SessionToken; } const credsSectionName = profileName; const configSectionName = profileName === "default" ? "default" : `profile ${profileName}`; const configData = { region }; info(`Writing credentials to profile: ${profileName}`); mergeProfileSection(paths.credentials, credsSectionName, credentialsData, overwriteAwsProfile); info(`Writing config to profile: ${profileName}`); mergeProfileSection(paths.config, configSectionName, configData, overwriteAwsProfile); info(`\u2713 Successfully configured AWS profile: ${profileName}`); } catch (error3) { throw new Error( `Failed to write AWS profile '${profileName}': ${error3 instanceof Error ? error3.message : String(error3)}` ); } } // src/index.ts var DEFAULT_ROLE_DURATION = 3600; var ROLE_SESSION_NAME = "GitHubActions"; var REGION_REGEX = /^[a-z0-9-]+$/g; async function run() { try { translateEnvVariables(); const AccessKeyId = getInput("aws-access-key-id", { required: false }); const SecretAccessKey = getInput("aws-secret-access-key", { required: false }); const sessionTokenInput = getInput("aws-session-token", { required: false }); const SessionToken = sessionTokenInput === "" ? void 0 : sessionTokenInput; const region = getInput("aws-region", { required: true }); const awsProfile = getInput("aws-profile", { required: false }); const overwriteAwsProfile = getBooleanInput("overwrite-aws-profile", { required: false }); const roleToAssume = getInput("role-to-assume", { required: false }); const audience = getInput("audience", { required: false }); const maskAccountId = getBooleanInput("mask-aws-account-id", { required: false }); const roleExternalId = getInput("role-external-id", { required: false }); const webIdentityTokenFile = getInput("web-identity-token-file", { required: false }); const roleDuration = Number.parseInt(getInput("role-duration-seconds", { required: false })) || DEFAULT_ROLE_DURATION; const roleSessionName = getInput("role-session-name", { required: false }) || ROLE_SESSION_NAME; const roleSkipSessionTagging = getBooleanInput("role-skip-session-tagging", { required: false }); const transitiveTagKeys = getMultilineInput("transitive-tag-keys", { required: false }); const proxyServer = getInput("http-proxy", { required: false }) || process.env.HTTP_PROXY; const customTags = getInput("custom-tags", { required: false }); const inlineSessionPolicy = getInput("inline-session-policy", { required: false }); const managedSessionPolicies = getMultilineInput("managed-session-policies", { required: false }).map((p2) => { return { arn: p2 }; }); const roleChaining = getBooleanInput("role-chaining", { required: false }); const outputCredentials = getBooleanInput("output-credentials", { required: false }); const outputEnvCredentials = getBooleanInput("output-env-credentials", { required: false, default: !awsProfile }); const unsetCurrentCredentials = getBooleanInput("unset-current-credentials", { required: false }); let disableRetry = getBooleanInput("disable-retry", { required: false }); const specialCharacterWorkaround = getBooleanInput("special-characters-workaround", { required: false }); const useExistingCredentials = getInput("use-existing-credentials", { required: false }); let maxRetries = Number.parseInt(getInput("retry-max-attempts", { required: false })) || 12; const expectedAccountIds = getInput("allowed-account-ids", { required: false }).split(",").map((s) => s.trim()); const forceSkipOidc = getBooleanInput("force-skip-oidc", { required: false }); const noProxy = getInput("no-proxy", { required: false }); const stsEndpoint = getInput("sts-endpoint", { required: false }); const globalTimeout = Number.parseInt(getInput("action-timeout-s", { required: false })) || 0; let timeoutId; if (globalTimeout > 0) { info(`Setting a global timeout of ${globalTimeout} seconds for the action`); timeoutId = setTimeout(() => { setFailed(`Action timed out after ${globalTimeout} seconds`); process.exit(1); }, globalTimeout * 1e3); } if (forceSkipOidc && roleToAssume && !AccessKeyId && !webIdentityTokenFile) { throw new Error( "If 'force-skip-oidc' is true and 'role-to-assume' is set, 'aws-access-key-id' or 'web-identity-token-file' must be set" ); } if (specialCharacterWorkaround) { disableRetry = false; maxRetries = 12; } else if (maxRetries < 1) { maxRetries = 1; } const useGitHubOIDCProvider = () => { if (forceSkipOidc) return false; if (!!roleToAssume && !webIdentityTokenFile && !AccessKeyId && !process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN && !roleChaining) { info( "It looks like you might be trying to authenticate with OIDC. Did you mean to set the `id-token` permission? If you are not trying to authenticate with OIDC and the action is working successfully, you can ignore this message." ); } return !!roleToAssume && !!process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN && !AccessKeyId && !webIdentityTokenFile && !roleChaining; }; if (unsetCurrentCredentials) { unsetCredentials(outputEnvCredentials); } if (!region.match(REGION_REGEX)) { throw new Error(`Region is not valid: ${region}`); } exportRegion(region, outputEnvCredentials); const clientProps = { region, roleChaining }; if (proxyServer) clientProps.proxyServer = proxyServer; if (noProxy) clientProps.noProxy = noProxy; if (stsEndpoint) clientProps.stsEndpoint = stsEndpoint; const credentialsClient = new CredentialsClient(clientProps); let sourceAccountId; let webIdentityToken; if (useExistingCredentials) { const validCredentials = await areCredentialsValid(credentialsClient); if (validCredentials) { notice("Pre-existing credentials are valid. No need to generate new ones."); if (timeoutId) clearTimeout(timeoutId); return; } notice("No valid credentials exist. Running as normal."); } if (useGitHubOIDCProvider()) { try { webIdentityToken = await retryAndBackoff( async () => { return getIDToken(audience); }, !disableRetry, maxRetries ); } catch (error3) { throw new Error(`getIDToken call failed: ${errorMessage(error3)}`); } } else if (AccessKeyId) { if (!SecretAccessKey) { throw new Error("'aws-secret-access-key' must be provided if 'aws-access-key-id' is provided"); } exportCredentials({ AccessKeyId, SecretAccessKey, SessionToken }, outputCredentials, outputEnvCredentials); if (awsProfile) { writeProfileFiles(awsProfile, { AccessKeyId, SecretAccessKey, SessionToken }, region, overwriteAwsProfile); } } else if (!webIdentityTokenFile && !roleChaining) { await credentialsClient.validateCredentials(void 0, roleChaining, expectedAccountIds); sourceAccountId = await exportAccountId(credentialsClient, maskAccountId); } if (AccessKeyId || roleChaining) { await credentialsClient.validateCredentials(AccessKeyId, roleChaining, expectedAccountIds); sourceAccountId = await exportAccountId(credentialsClient, maskAccountId); } if (customTags && (useGitHubOIDCProvider() || webIdentityTokenFile)) { warning( "'custom-tags' is set but will be ignored because session tags cannot be applied when using OIDC or web identity token authentication. Tags are controlled by the identity provider token claims in these authentication flows." ); } if (roleToAssume) { let roleCredentials; do { roleCredentials = await retryAndBackoff( async () => { return assumeRole({ credentialsClient, sourceAccountId, roleToAssume, roleExternalId, roleDuration, roleSessionName, roleSkipSessionTagging, transitiveTagKeys, webIdentityTokenFile, webIdentityToken, inlineSessionPolicy, managedSessionPolicies, customTags }); }, !disableRetry, maxRetries ); } while (specialCharacterWorkaround && !verifyKeys(roleCredentials.Credentials)); info(`Authenticated as assumedRoleId ${roleCredentials.AssumedRoleUser?.AssumedRoleId}`); exportCredentials(roleCredentials.Credentials, outputCredentials, outputEnvCredentials); if ((!process.env.GITHUB_ACTIONS || AccessKeyId) && !awsProfile) { await credentialsClient.validateCredentials( roleCredentials.Credentials?.AccessKeyId, roleChaining, expectedAccountIds ); } if (outputEnvCredentials) { await exportAccountId(credentialsClient, maskAccountId); } if (awsProfile) { if (!roleCredentials.Credentials) { throw new Error("AssumeRole call succeeded but returned no credentials"); } if (AccessKeyId || !process.env.GITHUB_ACTIONS) { writeProfileFiles(awsProfile, roleCredentials.Credentials, region, true); await credentialsClient.validateCredentials( roleCredentials.Credentials.AccessKeyId, roleChaining, expectedAccountIds ); } else { writeProfileFiles(awsProfile, roleCredentials.Credentials, region, overwriteAwsProfile); } if (outputEnvCredentials) { exportVariable("AWS_PROFILE", awsProfile); } } } else { info("Proceeding with IAM user credentials"); if (awsProfile) { if (outputEnvCredentials) { exportVariable("AWS_PROFILE", awsProfile); } } } if (timeoutId) clearTimeout(timeoutId); } catch (error3) { setFailed(errorMessage(error3)); const showStackTrace = process.env.SHOW_STACK_TRACE; if (showStackTrace === "true") { throw error3; } } } if (require.main === module) { (async () => { await run(); })().catch((error3) => { setFailed(errorMessage(error3)); }); } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { run }); /*! Bundled license information: undici/lib/web/fetch/body.js: (*! formdata-polyfill. MIT License. Jimmy Wärting *) undici/lib/web/websocket/frame.js: (*! ws. MIT License. Einar Otto Stangvik *) */